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
Collect only objects modified since a certain date
private static void collectObjectDataModifiedSinceDate(Date collectionTime, Integer numberOfDays) { List<String> hosts = Arrays.asList(ecsHosts.split(",")); // instantiate billing BO BillingBO billingBO = new BillingBO( ecsMgmtAccessKey, ecsMgmtSecretKey, hosts, ecsMgmtPort, null, // dao is not required in this case objectCount ); // Instantiate DAO ObjectDAO objectDAO = null; if(!elasticHosts.isEmpty()) { // Instantiate ElasticSearch DAO ElasticDAOConfig daoConfig = new ElasticDAOConfig(); daoConfig.setHosts(Arrays.asList(elasticHosts.split(","))); daoConfig.setPort(elasticPort); daoConfig.setClusterName(elasticCluster); daoConfig.setCollectionTime(collectionTime); daoConfig.setCollectionType(EcsCollectionType.object); initXPackConfig(daoConfig); objectDAO = new ElasticS3ObjectDAO(daoConfig); // init indexes objectDAO.initIndexes(collectionTime); } else { // Instantiate file DAO objectDAO = new FileObjectDAO(); } ObjectBO objectBO = new ObjectBO(billingBO, hosts, objectDAO, threadPoolExecutor, futures, objectCount ); // query criteria should look like ( LastModified >= 'since date' ) Date sinceDate = new Date( (collectionTime.getTime() - (TimeUnit.MILLISECONDS.convert(numberOfDays, TimeUnit.DAYS)) )); String yesterdayDateTime = DATA_DATE_FORMAT.format( sinceDate ); String queryCriteria = "( " + ECS_OBJECT_LAST_MODIFIED_MD_KEY + " >= '" + yesterdayDateTime + "' )"; // Start collection objectBO.collectObjectData(collectionTime, queryCriteria); objectBO.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Date getModifiedDate();", "public Date getModifiedDate();", "public Date getModifiedDate();", "public Date getDateModified();", "ImmutableList<SchemaOrgType> getDateModifiedList();", "public Date getDateModifed(){return dateModified;}", "public Date getUpdatedOn();", "@Override\n\tpublic Date ...
[ "0.62957585", "0.62957585", "0.62957585", "0.62254167", "0.6113187", "0.60876054", "0.58535606", "0.57148564", "0.57148564", "0.5691028", "0.5670661", "0.5667204", "0.5663733", "0.56464654", "0.5604172", "0.5604172", "0.5588063", "0.55680174", "0.55575347", "0.5534625", "0.55...
0.59265375
6
Collects object version data
private static void collectObjectVersionData(Date collectionTime) { List<String> hosts = Arrays.asList(ecsHosts.split(",")); // instantiate billing BO BillingBO billingBO = new BillingBO( ecsMgmtAccessKey, ecsMgmtSecretKey, hosts, ecsMgmtPort, null, // dao is not required in this case objectCount ); // Instantiate DAO ObjectDAO objectDAO = null; if(!elasticHosts.isEmpty()) { // Instantiate ElasticSearch DAO ElasticDAOConfig daoConfig = new ElasticDAOConfig(); daoConfig.setHosts(Arrays.asList(elasticHosts.split(","))); daoConfig.setPort(elasticPort); daoConfig.setClusterName(elasticCluster); daoConfig.setCollectionTime(collectionTime); daoConfig.setCollectionType(EcsCollectionType.object_version); initXPackConfig(daoConfig); objectDAO = new ElasticS3ObjectDAO(daoConfig); // init indexes objectDAO.initIndexes(collectionTime); } else { // Instantiate file DAO objectDAO = new FileObjectDAO(); } ObjectBO objectBO = new ObjectBO(billingBO, hosts, objectDAO, threadPoolExecutor, futures, objectCount ); //objectBO. // Start collection objectBO.collectObjectVersionData(collectionTime); objectBO.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected VersionData() {}", "public interface ObjectVersionReference {\n\n /**\n * Gets the ObjectReference object that encapsualtes everything about\n * the underlying Fedora 3 object.\n */\n public ObjectReference getObject();\n\n /**\n * Gets all the basic object information. This i...
[ "0.6435303", "0.6191046", "0.61249685", "0.57716954", "0.56813407", "0.55896527", "0.5514263", "0.54786813", "0.54436636", "0.5430057", "0.5403705", "0.5398561", "0.5385498", "0.53379977", "0.5328605", "0.5324276", "0.5324276", "0.5324276", "0.53041536", "0.52951753", "0.5293...
0.67662066
0
Collects Namespace details data
private static void collectNamespaceDetails(Date collectionTime) { NamespaceDAO namespaceDAO = null; if(!elasticHosts.isEmpty()) { // Instantiate file DAO ElasticDAOConfig daoConfig = new ElasticDAOConfig(); daoConfig.setHosts(Arrays.asList(elasticHosts.split(","))); daoConfig.setPort(elasticPort); daoConfig.setClusterName(elasticCluster); daoConfig.setCollectionTime(collectionTime); initXPackConfig(daoConfig); namespaceDAO = new ElasticNamespaceDetailDAO(daoConfig); // init indexes namespaceDAO.initIndexes(collectionTime); } else { // Instantiate file DAO namespaceDAO = new FileNamespaceDAO(null); } // instantiate billing BO NamespaceBO namespaceBO = new NamespaceBO( ecsMgmtAccessKey, ecsMgmtSecretKey, Arrays.asList(ecsHosts.split(",")), ecsMgmtPort, namespaceDAO, objectCount ); // Start collection namespaceBO.collectNamespaceDetails(collectionTime); namespaceBO.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map getNamespaceMap() {\n/* 130 */ return this.nsMap;\n/* */ }", "Namespaces namespaces();", "public java.util.Map<String,String> getNamespaces() {\n return (_namespaces);\n }", "private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){\n java.util...
[ "0.6288201", "0.6267803", "0.61238164", "0.59332144", "0.59332144", "0.59332144", "0.59332144", "0.59149456", "0.59128606", "0.5890139", "0.5874332", "0.5802557", "0.5787466", "0.5786097", "0.5759004", "0.57105553", "0.56399584", "0.56183606", "0.56183606", "0.56183606", "0.5...
0.69534487
0
Collects Namespace quota data
private static void collectNamespaceQuota(Date collectionTime) { NamespaceDAO namespaceDAO = null; if(!elasticHosts.isEmpty()) { // Instantiate file DAO ElasticDAOConfig daoConfig = new ElasticDAOConfig(); daoConfig.setHosts(Arrays.asList(elasticHosts.split(","))); daoConfig.setPort(elasticPort); daoConfig.setClusterName(elasticCluster); daoConfig.setCollectionTime(collectionTime); initXPackConfig(daoConfig); namespaceDAO = new ElasticNamespaceQuotaDAO(daoConfig); // init indexes namespaceDAO.initIndexes(collectionTime); } else { // Instantiate file DAO namespaceDAO = new FileNamespaceDAO(null); } // instantiate billing BO NamespaceBO namespaceBO = new NamespaceBO( ecsMgmtAccessKey, ecsMgmtSecretKey, Arrays.asList(ecsHosts.split(",")), ecsMgmtPort, namespaceDAO, objectCount ); // Start collection namespaceBO.collectNamespaceQuota(collectionTime); namespaceBO.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getQuotaMetricsCount();", "public Quota.Counts computeQuotaUsage4CurrentDirectory(Quota.Counts counts) {\r\n counts.add(Quota.NAMESPACE, 1);\r\n return counts; \r\n }", "java.util.List<com.google.api.servicecontrol.v1.MetricValueSet> getQuotaMetricsList();", "com.google.api.servicecontrol.v1.Me...
[ "0.62808937", "0.6196239", "0.61383444", "0.57307744", "0.5670178", "0.5651722", "0.5495213", "0.54546016", "0.5452423", "0.53564346", "0.5321322", "0.5263029", "0.5229553", "0.5201699", "0.51655835", "0.5017903", "0.500623", "0.50041914", "0.4992819", "0.49797747", "0.497786...
0.7177791
0
creating request handler object
@Override protected String doInBackground(Void... voids) { RequestHandler requestHandler = new RequestHandler(); String id = String.valueOf(SharedPrefManagerTechnician.getInstance(context).getTechnician().getId()); //creating request parameters HashMap<String, String> params = new HashMap<>(); params.put("technician_id", id); //returing the response return requestHandler.sendPostRequest(Apis.GET_CREATE_JOB_LIST_URL, params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CreateHandler()\n {\n }", "private Handler getHandler(Request request) {\n return resolver.get(request.getClass().getCanonicalName()).create();\n }", "Object handle(Object request);", "public void handleRequest(Request req) {\n\n }", "public RequestUrlHandler() {\n // requestServi...
[ "0.73784363", "0.7327999", "0.6984377", "0.6888248", "0.66800064", "0.6640932", "0.66393524", "0.6623903", "0.65493894", "0.6454828", "0.64295924", "0.63787603", "0.6311171", "0.62942547", "0.6291829", "0.6269873", "0.6250737", "0.6243524", "0.61719954", "0.61604834", "0.6154...
0.0
-1
TODO Autogenerated method stub
@Override public void focusLost(FocusEvent e) { }
{ "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 focusGained(FocusEvent e) { chat_field.setText(""); }
{ "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 actionPerformed(ActionEvent e) { if(name_field.getText().equals("")) { JOptionPane.showMessageDialog(null, "사용자 이름을 설정해 주세요.", "warning",JOptionPane.WARNING_MESSAGE); }else { id = name_field.getText(); JOptionPane.showMessageDialog(null, "설정되었습니다.", "success",JOptionPane.INFORMATION_MESSAGE); setting.setEnabled(false); name_field.setEnabled(false); wt.sendMsg(); // who_area.append(id + "\n"); } }
{ "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 actionPerformed(ActionEvent e) { if(chat_field.getText().equals("")) { JOptionPane.showMessageDialog(null, "채팅을 입력해주세요.", "warning",JOptionPane.WARNING_MESSAGE); } chat_area.append("[" + id + "]" + chat_field.getText() + "\n"); wt.sendMsg(); chat_field.setText(""); }
{ "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
============================= Constructor ============================// Constructs a new instance of the ION search from the input PAGs
public IonJoeModifications(List<Graph> pags) { for (Graph pag : pags) { this.input.add(pag); } for (Graph pag : input) { for (Node node : pag.getNodes()) { if (!variables.contains(node.getName())) { this.variables.add(node.getName()); } } for (Triple triple : getAllTriples(pag)) { if (pag.isDefNoncollider(triple.getX(), triple.getY(), triple.getZ())) { pag.addUnderlineTriple(triple.getX(), triple.getY(), triple.getZ()); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Graph> search() {\n\n long start = System.currentTimeMillis();\n TetradLogger.getInstance().log(\"info\", \"Starting ION Search.\");\n logGraphs(\"\\nInitial Pags: \", this.input);\n TetradLogger.getInstance().log(\"info\", \"Transfering local information.\");\n long ...
[ "0.56353396", "0.52647895", "0.524639", "0.5201267", "0.50106", "0.49595895", "0.48779866", "0.48546293", "0.4852471", "0.48513255", "0.48320517", "0.48262015", "0.48044258", "0.48019075", "0.47926924", "0.478546", "0.47774085", "0.47769243", "0.47712883", "0.47659895", "0.47...
0.0
-1
============================= Public Methods ============================// Sets path length search on or off
public void setPathLengthSearch(boolean b) { pathLengthSearch = b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setPathLength(Integer pathLength) {\n this.pathLength = pathLength;\n }", "public int getPathLength();", "void setFoundLength(final int foundLength) {\n this.vars.put(\"foundLength\", String.valueOf(foundLength));\n }", "public boolean setLength(double Length);", "void setLe...
[ "0.6855215", "0.59793645", "0.5706507", "0.5662909", "0.5592294", "0.55887216", "0.55887216", "0.5555064", "0.54986095", "0.5455036", "0.5432193", "0.53680617", "0.53514254", "0.5317966", "0.52953017", "0.52814144", "0.52814144", "0.52809834", "0.5274729", "0.5263939", "0.526...
0.7869652
0
Sets adjacency search on or off
public void setAdjacencySearch(boolean b) { adjacencySearch = b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setVisited(boolean value){this.visited = value;}", "public AdjacencyListGraph(boolean isDirected) {\r\n\t\tthis.isDirected = isDirected;\r\n\t\tvertices = new HashMap<>();\r\n\t\tadjacencyLists = new HashMap<>();\r\n\t}", "void setIndexed(boolean indexed);", "Dijk(){\n grp = new HashMap<>();\n...
[ "0.58435965", "0.5608546", "0.5606652", "0.5499805", "0.54875183", "0.54812425", "0.54105", "0.5384961", "0.5351501", "0.534259", "0.5322368", "0.53071725", "0.5294218", "0.52686214", "0.52137876", "0.52078444", "0.51721334", "0.51659644", "0.51645666", "0.5156271", "0.514059...
0.8401874
0
Begins the ION search procedure, described at each step
public List<Graph> search() { long start = System.currentTimeMillis(); TetradLogger.getInstance().log("info", "Starting ION Search."); logGraphs("\nInitial Pags: ", this.input); TetradLogger.getInstance().log("info", "Transfering local information."); long steps = System.currentTimeMillis(); /* * Step 1 - Create the empty graph */ List<Node> varNodes = new ArrayList<>(); for (String varName : variables) { varNodes.add(new GraphNode(varName)); } Graph graph = new EdgeListGraph(varNodes); /* * Step 2 - Transfer local information from the PAGs (adjacencies * and edge orientations) */ // transfers edges from each graph and finds definite noncolliders transferLocal(graph); // adds edges for variables never jointly measured for (NodePair pair : nonIntersection(graph)) { graph.addEdge(new Edge(pair.getFirst(), pair.getSecond(), Endpoint.CIRCLE, Endpoint.CIRCLE)); } TetradLogger.getInstance().log("info", "Steps 1-2: " + (System.currentTimeMillis() - steps) / 1000. + "s"); System.out.println("step2"); System.out.println(graph); /* * Step 3 * * Branch and prune step that blocks problematic undirectedPaths, possibly d-connecting undirectedPaths */ steps = System.currentTimeMillis(); Queue<Graph> searchPags = new LinkedList<>(); // place graph constructed in step 2 into the queue searchPags.offer(graph); // get d-separations and d-connections List<Set<IonIndependenceFacts>> sepAndAssoc = findSepAndAssoc(graph); this.separations = sepAndAssoc.get(0); this.associations = sepAndAssoc.get(1); Map<Collection<Node>, List<PossibleDConnectingPath>> paths; // Queue<Graph> step3PagsSet = new LinkedList<Graph>(); HashSet<Graph> step3PagsSet = new HashSet<>(); Set<Graph> reject = new HashSet<>(); // if no d-separations, nothing left to search if (separations.isEmpty()) { // makes orientations preventing definite noncolliders from becoming colliders // do final orientations // doFinalOrientation(graph); step3PagsSet.add(graph); } // sets length to iterate once if search over path lengths not enabled, otherwise set to 2 int numNodes = graph.getNumNodes(); int pl = numNodes - 1; if (pathLengthSearch) { pl = 2; } // iterates over path length, then adjacencies for (int l = pl; l < numNodes; l++) { if (pathLengthSearch) { TetradLogger.getInstance().log("info", "Braching over path lengths: " + l + " of " + (numNodes - 1)); } int seps = separations.size(); int currentSep = 1; int numAdjacencies = separations.size(); for (IonIndependenceFacts fact : separations) { if (adjacencySearch) { TetradLogger.getInstance().log("info", "Braching over path nonadjacencies: " + currentSep + " of " + numAdjacencies); } seps--; // uses two queues to keep up with which PAGs are being iterated and which have been // accepted to be iterated over in the next iteration of the above for loop searchPags.addAll(step3PagsSet); recGraphs.add(searchPags.size()); step3PagsSet.clear(); while (!searchPags.isEmpty()) { System.out.println("ION Step 3 size: " + searchPags.size()); double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); if (currentUsage > maxMemory) maxMemory = currentUsage; // deques first PAG from searchPags Graph pag = searchPags.poll(); // Part 3.a - finds possibly d-connecting undirectedPaths between each pair of nodes // known to be d-separated List<PossibleDConnectingPath> dConnections = new ArrayList<>(); // checks to see if looping over adjacencies if (adjacencySearch) { for (Collection<Node> conditions : fact.getZ()) { // checks to see if looping over path lengths if (pathLengthSearch) { dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength (pag, fact.getX(), fact.getY(), conditions, l)); } else { dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths (pag, fact.getX(), fact.getY(), conditions)); } } } else { for (IonIndependenceFacts allfact : separations) { for (Collection<Node> conditions : allfact.getZ()) { // checks to see if looping over path lengths if (pathLengthSearch) { dConnections.addAll(PossibleDConnectingPath.findDConnectingPathsOfLength (pag, allfact.getX(), allfact.getY(), conditions, l)); } else { dConnections.addAll(PossibleDConnectingPath.findDConnectingPaths (pag, allfact.getX(), allfact.getY(), conditions)); } } } } // accept PAG go to next PAG if no possibly d-connecting undirectedPaths if (dConnections.isEmpty()) { // doFinalOrientation(pag); // Graph p = screenForKnowledge(pag); // if (p != null) step3PagsSet.add(p); step3PagsSet.add(pag); continue; } // maps conditioning sets to list of possibly d-connecting undirectedPaths paths = new HashMap<>(); for (PossibleDConnectingPath path : dConnections) { List<PossibleDConnectingPath> p = paths.get(path.getConditions()); if (p == null) { p = new LinkedList<>(); } p.add(path); paths.put(path.getConditions(), p); } // Part 3.b - finds minimal graphical changes to block possibly d-connecting undirectedPaths List<Set<GraphChange>> possibleChanges = new ArrayList<>(); for (Set<GraphChange> changes : findChanges(paths)) { Set<GraphChange> newChanges = new HashSet<>(); for (GraphChange gc : changes) { boolean okay = true; for (Triple collider : gc.getColliders()) { if (pag.isUnderlineTriple(collider.getX(), collider.getY(), collider.getZ())) { okay = false; break; } } if (!okay) { continue; } for (Triple collider : gc.getNoncolliders()) { if (pag.isDefCollider(collider.getX(), collider.getY(), collider.getZ())) { okay = false; break; } } if (okay) { newChanges.add(gc); } } if (!newChanges.isEmpty()) { possibleChanges.add(newChanges); } else { possibleChanges.clear(); break; } } float starthitset = System.currentTimeMillis(); Collection<GraphChange> hittingSets = IonHittingSet.findHittingSet(possibleChanges); recHitTimes.add((System.currentTimeMillis() - starthitset) / 1000.); // Part 3.c - checks the newly constructed graphs from 3.b and rejects those that // cycles or produce independencies known not to occur from the input PAGs or // include undirectedPaths from definite nonancestors for (GraphChange gc : hittingSets) { boolean badhittingset = false; for (Edge edge : gc.getRemoves()) { Node node1 = edge.getNode1(); Node node2 = edge.getNode2(); Set<Triple> triples = new HashSet<>(); triples.addAll(gc.getColliders()); triples.addAll(gc.getNoncolliders()); if (triples.size() != (gc.getColliders().size() + gc.getNoncolliders().size())) { badhittingset = true; break; } for (Triple triple : triples) { if (node1.equals(triple.getY())) { if (node2.equals(triple.getX()) || node2.equals(triple.getZ())) { badhittingset = true; break; } } if (node2.equals(triple.getY())) { if (node1.equals(triple.getX()) || node1.equals(triple.getZ())) { badhittingset = true; break; } } } if (badhittingset) { break; } for (NodePair pair : gc.getOrients()) { if ((node1.equals(pair.getFirst()) && node2.equals(pair.getSecond())) || (node2.equals(pair.getFirst()) && node1.equals(pair.getSecond()))) { badhittingset = true; break; } } if (badhittingset) { break; } } if (!badhittingset) { for (NodePair pair : gc.getOrients()) { for (Triple triple : gc.getNoncolliders()) { if (pair.getSecond().equals(triple.getY())) { if (pair.getFirst().equals(triple.getX()) && pag.getEndpoint(triple.getZ(), triple.getY()).equals(Endpoint.ARROW)) { badhittingset = true; break; } if (pair.getFirst().equals(triple.getZ()) && pag.getEndpoint(triple.getX(), triple.getY()).equals(Endpoint.ARROW)) { badhittingset = true; break; } } if (badhittingset) { break; } } if (badhittingset) { break; } } } if (badhittingset) { continue; } Graph changed = gc.applyTo(pag); // if graph change has already been rejected move on to next graph if (reject.contains(changed)) { continue; } // if graph change has already been accepted move on to next graph if (step3PagsSet.contains(changed)) { continue; } // reject if null, predicts false independencies or has cycle if (predictsFalseIndependence(associations, changed) || changed.existsDirectedCycle()) { reject.add(changed); } // makes orientations preventing definite noncolliders from becoming colliders // do final orientations // doFinalOrientation(changed); // now add graph to queue // Graph p = screenForKnowledge(changed); // if (p != null) step3PagsSet.add(p); step3PagsSet.add(changed); } } // exits loop if not looping over adjacencies if (!adjacencySearch) { break; } } } TetradLogger.getInstance().log("info", "Step 3: " + (System.currentTimeMillis() - steps) / 1000. + "s"); Queue<Graph> step3Pags = new LinkedList<>(step3PagsSet); /* * Step 4 * * Finds redundant undirectedPaths and uses this information to expand the list * of possible graphs */ steps = System.currentTimeMillis(); Map<Edge, Boolean> necEdges; Set<Graph> outputPags = new HashSet<>(); while (!step3Pags.isEmpty()) { Graph pag = step3Pags.poll(); necEdges = new HashMap<>(); // Step 4.a - if x and y are known to be unconditionally associated and there is // exactly one trek between them, mark each edge on that trek as necessary and // make the tiples on the trek definite noncolliders // initially mark each edge as not necessary for (Edge edge : pag.getEdges()) { necEdges.put(edge, false); } // look for unconditional associations for (IonIndependenceFacts fact : associations) { for (List<Node> nodes : fact.getZ()) { if (nodes.isEmpty()) { List<List<Node>> treks = treks(pag, fact.x, fact.y); if (treks.size() == 1) { List<Node> trek = treks.get(0); List<Triple> triples = new ArrayList<>(); for (int i = 1; i < trek.size(); i++) { // marks each edge in trek as necessary necEdges.put(pag.getEdge(trek.get(i - 1), trek.get(i)), true); if (i == 1) { continue; } // makes each triple a noncollider pag.addUnderlineTriple(trek.get(i - 2), trek.get(i - 1), trek.get(i)); } } // stop looping once the empty set is found break; } } } // Part 4.b - branches by generating graphs for every combination of removing // redundant undirectedPaths boolean elimTreks; // checks to see if removing redundant undirectedPaths eliminates every trek between // two variables known to be nconditionally assoicated List<Graph> possRemovePags = possRemove(pag, necEdges); double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); if (currentUsage > maxMemory) maxMemory = currentUsage; for (Graph newPag : possRemovePags) { elimTreks = false; // looks for unconditional associations for (IonIndependenceFacts fact : associations) { for (List<Node> nodes : fact.getZ()) { if (nodes.isEmpty()) { if (treks(newPag, fact.x, fact.y).isEmpty()) { elimTreks = true; } // stop looping once the empty set is found break; } } } // add new PAG to output unless a necessary trek has been eliminated if (!elimTreks) { outputPags.add(newPag); } } } outputPags = removeMoreSpecific(outputPags); // outputPags = applyKnowledge(outputPags); TetradLogger.getInstance().log("info", "Step 4: " + (System.currentTimeMillis() - steps) / 1000. + "s"); /* * Step 5 * * Generate the Markov equivalence classes for graphs and accept only * those that do not predict false d-separations */ steps = System.currentTimeMillis(); Set<Graph> outputSet = new HashSet<>(); for (Graph pag : outputPags) { Set<Triple> unshieldedPossibleColliders = new HashSet<>(); for (Triple triple : getPossibleTriples(pag)) { if (!pag.isAdjacentTo(triple.getX(), triple.getZ())) { unshieldedPossibleColliders.add(triple); } } PowerSet<Triple> pset = new PowerSet<>(unshieldedPossibleColliders); for (Set<Triple> set : pset) { Graph newGraph = new EdgeListGraph(pag); for (Triple triple : set) { newGraph.setEndpoint(triple.getX(), triple.getY(), Endpoint.ARROW); newGraph.setEndpoint(triple.getZ(), triple.getY(), Endpoint.ARROW); } doFinalOrientation(newGraph); } for (Graph outputPag : finalResult) { if (!predictsFalseIndependence(associations, outputPag)) { Set<Triple> underlineTriples = new HashSet<>(outputPag.getUnderLines()); for (Triple triple : underlineTriples) { outputPag.removeUnderlineTriple(triple.getX(), triple.getY(), triple.getZ()); } outputSet.add(outputPag); } } } // outputSet = applyKnowledge(outputSet); outputSet = checkPaths(outputSet); output.addAll(outputSet); TetradLogger.getInstance().log("info", "Step 5: " + (System.currentTimeMillis() - steps) / 1000. + "s"); runtime = ((System.currentTimeMillis() - start) / 1000.); logGraphs("\nReturning output (" + output.size() + " Graphs):", output); double currentUsage = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory(); if (currentUsage > maxMemory) maxMemory = currentUsage; return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void searchFunction() {\n\t\t\r\n\t}", "private void goSearch() {\n\t\tThread t = new Thread(this);\n\t\tt.start();\n\t}", "@Override\n\tpublic boolean onSearchRequested()\n\t{\n \tstartSearch(getCurSearch(), true, null, false);\n \treturn true;\n\t}", "public void startSearch() {\n if (...
[ "0.6326334", "0.63061506", "0.6230616", "0.6228422", "0.61832505", "0.61830366", "0.6172838", "0.6030307", "0.60160726", "0.60034674", "0.598179", "0.594412", "0.59435785", "0.5885258", "0.58598673", "0.58478606", "0.58380914", "0.5810887", "0.5797676", "0.5777879", "0.577141...
0.5955484
11
returns total runtime and times for hitting set calculations
public List<String> getRuntime() { double totalhit = 0; double longesthit = 0; double averagehit = 0; for (Double i : recHitTimes) { totalhit += i; averagehit += i / recHitTimes.size(); if (i > longesthit) { longesthit = i; } } List<String> list = new ArrayList<>(); list.add(Double.toString(runtime)); list.add(Double.toString(totalhit)); list.add(Double.toString(longesthit)); list.add(Double.toString(averagehit)); return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getStats() {\n String stats = \"Total running time: \" + runtime + \"\\\\\\\\\";\n int totalit = 0;\n int largestit = 0;\n int averageit = 0;\n for (Integer i : recGraphs) {\n totalit += i;\n averageit += i;\n if (i > largestit) {\n...
[ "0.68819416", "0.66673344", "0.64965546", "0.645114", "0.6450323", "0.6447129", "0.6394125", "0.6345206", "0.62643045", "0.6173303", "0.61066794", "0.6080876", "0.60678536", "0.6055198", "0.60505223", "0.6035829", "0.59609", "0.5958504", "0.59583086", "0.59500396", "0.5949353...
0.61546195
10
returns the maximum memory used in a run of ION
public double getMaxMemUsage() { return maxMemory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getMaxMemory();", "abstract int getMaxMemoryUsage();", "long getMemLimit();", "public static native int getMaxCacheMem();", "public long getMemMax() {\n return memMax;\n }", "public long getMemUsedMax() {\n return memUsedMax;\n }", "public static double getMaxMemory()\n {\n \treturn ...
[ "0.7995515", "0.7780597", "0.7517388", "0.7334496", "0.7329411", "0.73031896", "0.7071999", "0.6847173", "0.6842302", "0.6795751", "0.6795751", "0.67892635", "0.67881876", "0.67787623", "0.67282504", "0.66230196", "0.65753853", "0.65708226", "0.6570246", "0.6518058", "0.64902...
0.72049576
6
return hitting set sizes
public List<Integer> getIterations() { int totalit = 0; int largestit = 0; int averageit = 0; for (Integer i : recGraphs) { totalit += i; averageit += i / recGraphs.size(); if (i > largestit) { largestit = i; } } List<Integer> list = new ArrayList<>(); list.add(totalit); list.add(largestit); list.add(averageit); return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int size(){\n return set.length;\n }", "Dimension[] getSizes();", "public int[] getSizes() {\n\t\treturn new int[] { quoteMap.size(), bookMap.size(), _cumulativeVolumeTable.size() };\n\t}", "@Override\n public int size() {\n return theSet.size();\n }", "public int getSetSize()...
[ "0.66374683", "0.6636576", "0.6550133", "0.6436562", "0.6428125", "0.6367287", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6365625", "0.6354162", "0.6325157", ...
0.0
-1
summarizes time and hitting set time and size information for latex
public String getStats() { String stats = "Total running time: " + runtime + "\\\\"; int totalit = 0; int largestit = 0; int averageit = 0; for (Integer i : recGraphs) { totalit += i; averageit += i; if (i > largestit) { largestit = i; } } averageit /= recGraphs.size(); double totalhit = 0; double longesthit = 0; double averagehit = 0; for (Double i : recHitTimes) { totalhit += i; averagehit += i / recHitTimes.size(); if (i > longesthit) { longesthit = i; } } stats += "Total iterations in step 3: " + totalit + "\\\\"; stats += "Largest set of iterations in step 3: " + largestit + "\\\\"; stats += "Average iterations set in step 3: " + averageit + "\\\\"; stats += "Total hitting sets calculation time: " + totalhit + "\\\\"; stats += "Average hitting set calculation time: " + averagehit + "\\\\"; stats += "Longest hitting set calculation time: " + longesthit + "\\\\"; return stats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createTotalTime(BufferedWriter writer) throws IOException {\r\n\t\tMap<String, String> dataMap = data.getTotalTime();\r\n\t\tString parent = \"<div style='width: 260px;background-color: #FFFFFF;box-shadow: 1px 1px 1px #888888;height: 85px;position: absolute;top: 67px;left: 281px;'>\";\r\n\t\tString su...
[ "0.56317085", "0.558515", "0.55580676", "0.5532689", "0.55153173", "0.54914767", "0.54027253", "0.53999144", "0.5388539", "0.53433263", "0.53009677", "0.5298649", "0.52845615", "0.5267844", "0.52654487", "0.52573603", "0.5242679", "0.519337", "0.5188936", "0.51858306", "0.517...
0.57476074
0
============================= Private Methods ============================// Logs a set of graphs with a corresponding message
private void logGraphs(String message, List<? extends Graph> graphs) { if (message != null) { TetradLogger.getInstance().log("graph", message); } for (Graph graph : graphs) { TetradLogger.getInstance().log("graph", graph.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void logGraph(@NonNull String graph) {\n if (getLogger().isDebugEnabled()) {\n getLogger().debug(\"logGraph {}\", graph);\n }\n\n sendSynchronously(restApiClient::logGraph, createGraphRequest(graph));\n }", "private void log(String message) {\r\n\t\tif (Ch...
[ "0.58653265", "0.5620501", "0.5561195", "0.5546202", "0.5483517", "0.53807855", "0.5359266", "0.5358611", "0.5349227", "0.53401893", "0.53134036", "0.5303085", "0.52837855", "0.5254636", "0.524579", "0.5240814", "0.52211344", "0.52208483", "0.52041477", "0.51327974", "0.51116...
0.790797
0
Generates NodePairs of all possible pairs of nodes from given list of nodes.
private List<NodePair> allNodePairs(List<Node> nodes) { List<NodePair> nodePairs = new ArrayList<>(); for (int j = 0; j < nodes.size() - 1; j++) { for (int k = j + 1; k < nodes.size(); k++) { nodePairs.add(new NodePair(nodes.get(j), nodes.get(k))); } } return nodePairs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void generatePointPairs() {\n\t\tfinal int mod = SIZE_OF_ORIGINAL_LIST * 8; \n\t\t\n\t\tif(DEBUG) System.out.println(\"----- Generating Point Pairs...\");\n\n\t\tint counter = 0;\n\t\tint j = 0;\n\t\t\n\t\tfor(int i = 0; i < myPoints.length; i++) {\n\t\t\t//while(j++ < myPoints.length) {\n\t\t\tfor( ; j < ...
[ "0.6049518", "0.56802857", "0.56484526", "0.56027126", "0.5465934", "0.54330546", "0.5393137", "0.5388823", "0.5350224", "0.534209", "0.53418183", "0.52832866", "0.5220392", "0.5214971", "0.5179633", "0.5119694", "0.509907", "0.50071245", "0.49729323", "0.49702463", "0.493955...
0.834163
0
Finds all node pairs that are not adjacent in an input graph
private Set<NodePair> nonadjacencies(Graph graph) { Set<NodePair> nonadjacencies = new HashSet<>(); for (Graph inputPag : input) { for (NodePair pair : allNodePairs(inputPag.getNodes())) { if (!inputPag.isAdjacentTo(pair.getFirst(), pair.getSecond())) { nonadjacencies.add(new NodePair(graph.getNode(pair.getFirst().getName()), graph.getNode(pair.getSecond().getName()))); } } } return nonadjacencies; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unchecked\")\n\tpublic ArrayList<Node<A>> neighbours(){\n\t\t\n\t\tArrayList<Node<A>> output = new ArrayList<Node<A>>();\n\t\t\n\t\tif (g == null) return output;\n\t\t\n\t\tfor (Object o: g.getEdges()){\n\n\t\t\t\n\t\t\tif (((Edge<?>)o).getTo().equals(this)) {\n\t\t\t\t\n\t\t\t\tif (!output.con...
[ "0.6582746", "0.6470498", "0.6284552", "0.6254425", "0.62415856", "0.61844003", "0.6178847", "0.6153618", "0.61299306", "0.61292666", "0.6120783", "0.6091862", "0.6036511", "0.60212076", "0.59832036", "0.59690404", "0.5957887", "0.5956588", "0.59278315", "0.5890939", "0.58758...
0.8322748
0
/ Transfers local information from the input PAGs by adding edges from local PAGs with their orientations and unorienting the edges if there is a conflict and recording definite noncolliders.
private void transferLocal(Graph graph) { Set<NodePair> nonadjacencies = nonadjacencies(graph); for (Graph pag : input) { for (Edge edge : pag.getEdges()) { NodePair graphNodePair = new NodePair(graph.getNode(edge.getNode1().getName()), graph.getNode(edge.getNode2().getName())); if (nonadjacencies.contains(graphNodePair)) { continue; } if (!graph.isAdjacentTo(graphNodePair.getFirst(), graphNodePair.getSecond())) { graph.addEdge(new Edge(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint1(), edge.getEndpoint2())); continue; } Endpoint first = edge.getEndpoint1(); Endpoint firstCurrent = graph.getEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst()); if (!first.equals(Endpoint.CIRCLE)) { if ((first.equals(Endpoint.ARROW) && firstCurrent.equals(Endpoint.TAIL)) || (first.equals(Endpoint.TAIL) && firstCurrent.equals(Endpoint.ARROW))) { graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), Endpoint.CIRCLE); } else { graph.setEndpoint(graphNodePair.getSecond(), graphNodePair.getFirst(), edge.getEndpoint1()); } } Endpoint second = edge.getEndpoint2(); Endpoint secondCurrent = graph.getEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond()); if (!second.equals(Endpoint.CIRCLE)) { if ((second.equals(Endpoint.ARROW) && secondCurrent.equals(Endpoint.TAIL)) || (second.equals(Endpoint.TAIL) && secondCurrent.equals(Endpoint.ARROW))) { graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), Endpoint.CIRCLE); } else { graph.setEndpoint(graphNodePair.getFirst(), graphNodePair.getSecond(), edge.getEndpoint2()); } } } for (Triple triple : pag.getUnderLines()) { Triple graphTriple = new Triple(graph.getNode(triple.getX().getName()), graph.getNode(triple.getY().getName()), graph.getNode(triple.getZ().getName())); if (graphTriple.alongPathIn(graph)) { graph.addUnderlineTriple(graphTriple.getX(), graphTriple.getY(), graphTriple.getZ()); definiteNoncolliders.add(graphTriple); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void preFlow() {\n\t\tg.getVertex(source).h = g.getV();\n\t\tg.getVertex(sink).h = 0;\n\t\t\n\t\tfor (int i : g.getAdjacents(source)) {\n\t\t\tpushFillingFlow(source, i);\n\t\t}\n\t}", "static void bridge()\n {\n // Mark all the vertices as not visited\n boolean visited[] = new boolean[V]...
[ "0.5140432", "0.49932358", "0.49661303", "0.49345478", "0.49290448", "0.48162726", "0.48129866", "0.48083872", "0.48019508", "0.47721297", "0.47666028", "0.47265494", "0.4633755", "0.4619854", "0.4596171", "0.45909056", "0.45722234", "0.4572064", "0.45615143", "0.4560236", "0...
0.5484684
0
Finds the association or seperation sets for every pair of nodes.
private List<Set<IonIndependenceFacts>> findSepAndAssoc(Graph graph) { Set<IonIndependenceFacts> separations = new HashSet<>(); Set<IonIndependenceFacts> associations = new HashSet<>(); List<NodePair> allNodes = allNodePairs(graph.getNodes()); for (NodePair pair : allNodes) { Node x = pair.getFirst(); Node y = pair.getSecond(); List<Node> variables = new ArrayList<>(graph.getNodes()); variables.remove(x); variables.remove(y); List<Set<Node>> subsets = SearchGraphUtils.powerSet(variables); IonIndependenceFacts indep = new IonIndependenceFacts(x, y, new HashSet<List<Node>>()); IonIndependenceFacts assoc = new IonIndependenceFacts(x, y, new HashSet<List<Node>>()); boolean addIndep = false; boolean addAssoc = false; for (Graph pag : input) { for (Set<Node> subset : subsets) { if (containsAll(pag, subset, pair)) { Node pagX = pag.getNode(x.getName()); Node pagY = pag.getNode(y.getName()); ArrayList<Node> pagSubset = new ArrayList<>(); for (Node node : subset) { pagSubset.add(pag.getNode(node.getName())); } if (pag.isDSeparatedFrom(pagX, pagY, new ArrayList<>(pagSubset))) { if (!pag.isAdjacentTo(pagX, pagY)) { addIndep = true; indep.addMoreZ(new ArrayList<>(subset)); } } else { addAssoc = true; assoc.addMoreZ(new ArrayList<>(subset)); } } } } if (addIndep) separations.add(indep); if (addAssoc) associations.add(assoc); } List<Set<IonIndependenceFacts>> facts = new ArrayList<>(2); facts.add(0, separations); facts.add(1, associations); return facts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void phaseTwo(){\r\n\r\n\t\tCollections.shuffle(allNodes, random);\r\n\t\tList<Pair<Node, Node>> pairs = new ArrayList<Pair<Node, Node>>();\r\n\t\t\r\n\t\t//For each node in allNode, get all relationshpis and iterate through each relationship.\r\n\t\tfor (Node n1 : allNodes){\r\n\r\n\t\t\ttry (Transaction ...
[ "0.62977594", "0.60578394", "0.6004731", "0.54747313", "0.54528105", "0.5409494", "0.54027164", "0.5390736", "0.5390158", "0.53620166", "0.5357006", "0.53506434", "0.5348596", "0.53136396", "0.53046894", "0.5301995", "0.5293953", "0.5290387", "0.5272205", "0.5272139", "0.5268...
0.5876435
3
States whether the given graph contains the nodes in the given set and the node pair.
private boolean containsAll(Graph g, Set<Node> nodes, NodePair pair) { List<String> nodeNames = g.getNodeNames(); if (!nodeNames.contains(pair.getFirst().getName()) || !nodeNames.contains(pair.getSecond().getName())) { return false; } for (Node node : nodes) { if (!nodeNames.contains(node.getName())) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean hasANeighbour(Graph<V, E> g, Set<V> set, V v)\n {\n return set.stream().anyMatch(s -> g.containsEdge(s, v));\n }", "public boolean containsNode(Node n);", "public boolean isBipartite(List<GraphNode> graph) {\n Map<GraphNode, Integer> group = new HashMap<>();\n for (Gr...
[ "0.6229556", "0.6009475", "0.5976236", "0.5973974", "0.5966141", "0.59520996", "0.59329146", "0.5863353", "0.58109957", "0.5795994", "0.57807595", "0.57537496", "0.5706368", "0.5688438", "0.56625813", "0.56599677", "0.56592506", "0.56503606", "0.5649426", "0.5646024", "0.5632...
0.7583605
0
Checks given pag against a set of necessary associations to determine if the pag implies an indepedence where one is known to not exist.
private boolean predictsFalseIndependence(Set<IonIndependenceFacts> associations, Graph pag) { for (IonIndependenceFacts assocFact : associations) for (List<Node> conditioningSet : assocFact.getZ()) if (pag.isDSeparatedFrom( assocFact.getX(), assocFact.getY(), conditioningSet)) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean isObjectInPAG(Object objElement, InferenceProteinGroup pag) {\n if (objElement instanceof IntermediateProtein) {\n // check whether protein is in the PAG\n if (pag.getProteins().contains(objElement)) {\n return true;\n }\n } else if (obj...
[ "0.6254162", "0.57818377", "0.5611908", "0.55128855", "0.5490838", "0.5271116", "0.52526104", "0.523539", "0.52246565", "0.5132399", "0.5132399", "0.50977343", "0.50625396", "0.50326025", "0.49253184", "0.49253184", "0.49253184", "0.49253184", "0.49253184", "0.49253184", "0.4...
0.6606197
0
Given a map between sets of conditioned on variables and lists of PossibleDConnectingPaths, finds all the possible GraphChanges which could be used to block said undirectedPaths
private List<Set<GraphChange>> findChanges(Map<Collection<Node>, List<PossibleDConnectingPath>> paths) { List<Set<GraphChange>> pagChanges = new ArrayList<>(); Set<Map.Entry<Collection<Node>, List<PossibleDConnectingPath>>> entries = paths.entrySet(); /* Loop through each entry, ie each conditioned set of variables. */ for (Map.Entry<Collection<Node>, List<PossibleDConnectingPath>> entry : entries) { Collection<Node> conditions = entry.getKey(); List<PossibleDConnectingPath> dConnecting = entry.getValue(); /* loop through each path */ for (PossibleDConnectingPath possible : dConnecting) { List<Node> possPath = possible.getPath(); /* Created with 2*# of undirectedPaths as appoximation. might have to increase size once */ Set<GraphChange> pathChanges = new HashSet<>(2 * possPath.size()); /* find those conditions which are not along the path (used in colider) */ List<Node> outsidePath = new ArrayList<>(conditions.size()); for (Node condition : conditions) { if (!possPath.contains(condition)) outsidePath.add(condition); } /* Walk through path, node by node */ for (int i = 0; i < possPath.size() - 1; i++) { Node current = possPath.get(i); Node next = possPath.get(i + 1); GraphChange gc; /* for each pair of nodes, add the operation to remove their edge */ gc = new GraphChange(); gc.addRemove(possible.getPag().getEdge(current, next)); pathChanges.add(gc); /* for each triple centered on a node which is an element of the conditioning * set, add the operation to orient as a nonColider around that node */ if (conditions.contains(current) && i > 0) { gc = new GraphChange(); Triple nonColider = new Triple(possPath.get(i - 1), current, next); gc.addNonCollider(nonColider); pathChanges.add(gc); } /* for each node on the path not in the conditioning set, make a colider. It * is necessary though to ensure that there are no undirectedPaths implying that a * conditioned variable (even outside the path) is a decendant of a colider */ if ((!conditions.contains(current)) && i > 0) { Triple colider = new Triple(possPath.get(i - 1), current, next); if (possible.getPag().isUnderlineTriple(possPath.get(i - 1), current, next)) continue; Edge edge1 = possible.getPag().getEdge(colider.getX(), colider.getY()); Edge edge2 = possible.getPag().getEdge(colider.getZ(), colider.getY()); if (edge1.getNode1().equals(colider.getY())) { if (edge1.getEndpoint1().equals(Endpoint.TAIL)) { continue; } } else if (edge1.getNode2().equals(colider.getY())) { if (edge1.getEndpoint2().equals(Endpoint.TAIL)) { continue; } } if (edge2.getNode1().equals(colider.getY())) { if (edge2.getEndpoint1().equals(Endpoint.TAIL)) { continue; } } else if (edge2.getNode2().equals(colider.getY())) { if (edge2.getEndpoint2().equals(Endpoint.TAIL)) { continue; } } /* Simple case, no conditions outside the path, so just add colider */ if (outsidePath.size() == 0) { gc = new GraphChange(); gc.addCollider(colider); pathChanges.add(gc); continue; } /* ensure nondecendency in possible path between getModel and each conditioned * variable outside the path */ for (Node outside : outsidePath) { /* list of possible decendant undirectedPaths */ List<PossibleDConnectingPath> decendantPaths = new ArrayList<>(); decendantPaths = PossibleDConnectingPath.findDConnectingPaths (possible.getPag(), current, outside, new ArrayList<Node>()); if (decendantPaths.isEmpty()) { gc = new GraphChange(); gc.addCollider(colider); pathChanges.add(gc); continue; } /* loop over each possible path which might indicate decendency */ for (PossibleDConnectingPath decendantPDCPath : decendantPaths) { List<Node> decendantPath = decendantPDCPath.getPath(); /* walk down path checking orientation (path may already * imply non-decendency) and creating changes if need be*/ boolean impliesDecendant = true; Set<GraphChange> colideChanges = new HashSet<>(); for (int j = 0; j < decendantPath.size() - 1; j++) { Node from = decendantPath.get(j); // chaneges from +1 Node to = decendantPath.get(j + 1); Edge currentEdge = possible.getPag().getEdge(from, to); if (currentEdge.getEndpoint1().equals(Endpoint.ARROW)) { impliesDecendant = false; break; } gc = new GraphChange(); gc.addCollider(colider); gc.addRemove(currentEdge); colideChanges.add(gc); gc = new GraphChange(); gc.addCollider(colider); gc.addOrient(to, from); colideChanges.add(gc); } if (impliesDecendant) pathChanges.addAll(colideChanges); } } } } pagChanges.add(pathChanges); } } return pagChanges; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public Set<List<String>> findAllPaths(int sourceId, int targetId, int reachability) {\r\n //all paths found\r\n Set<List<String>> allPaths = new HashSet<List<String>>();\r\n //collects path in one iteration\r\n Set<List<String>> newPa...
[ "0.6220816", "0.602565", "0.5773332", "0.57074034", "0.5680132", "0.56379604", "0.5578151", "0.5537675", "0.5487885", "0.54609555", "0.5436478", "0.5414925", "0.5389629", "0.5345772", "0.5342937", "0.5339807", "0.52966654", "0.52961814", "0.52785087", "0.5266348", "0.5248162"...
0.84290475
0
Constructs PossRemove, every combination of removing of not removing redudant undirectedPaths
private List<Graph> possRemove(Graph pag, Map<Edge, Boolean> necEdges) { // list of edges that can be removed List<Edge> remEdges = new ArrayList<>(); for (Edge remEdge : necEdges.keySet()) { if (!necEdges.get(remEdge)) remEdges.add(remEdge); } // powerset of edges that can be removed PowerSet<Edge> pset = new PowerSet<>(remEdges); List<Graph> possRemove = new ArrayList<>(); // for each set of edges in the powerset remove edges from graph and add to PossRemove for (Set<Edge> set : pset) { Graph newPag = new EdgeListGraph(pag); for (Edge edge : set) { newPag.removeEdge(edge); } possRemove.add(newPag); } return possRemove; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected boolean removeChanceNode() {\n\n Node candidateToReduce;\n Node candidateToRemove;\n Node nodeToRemove;\n String operation;\n int i;\n NodeList children;\n Node valueNodeToReduce;\n\n NodeList chancesID;\n boolean removed = fal...
[ "0.56442577", "0.5556615", "0.548942", "0.5488811", "0.532095", "0.52739924", "0.52602667", "0.52564126", "0.5231639", "0.5160155", "0.5146022", "0.5139036", "0.51264375", "0.5107984", "0.50789475", "0.50743103", "0.5072155", "0.5060305", "0.5036233", "0.5023168", "0.50207156...
0.59327275
0
/ Does the final set of orientations after colliders have been oriented
private void doFinalOrientation(Graph graph) { discrimGraphs.clear(); Set<Graph> currentDiscrimGraphs = new HashSet<>(); currentDiscrimGraphs.add(graph); while (changeFlag) { changeFlag = false; currentDiscrimGraphs.addAll(discrimGraphs); discrimGraphs.clear(); for (Graph newGraph : currentDiscrimGraphs) { doubleTriangle(newGraph); awayFromColliderAncestorCycle(newGraph); if (!discrimPaths(newGraph)) { if (changeFlag) { discrimGraphs.add(newGraph); } else { finalResult.add(newGraph); } } } currentDiscrimGraphs.clear(); } changeFlag = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean colisionPalas() {\r\n\t\treturn game.racketIzq.getBounds().intersects(getBounds())\r\n\t\t\t\t|| game.racketDer.getBounds().intersects(getBounds());\r\n\t}", "public boolean doesCollide()\n {\n return doesCollide;\n }", "public abstract boolean isCollided();", "private boolean rightC...
[ "0.61680263", "0.60314876", "0.59730625", "0.5910881", "0.5857102", "0.5801611", "0.570871", "0.5696123", "0.5671425", "0.5655996", "0.56477016", "0.56017184", "0.5593909", "0.5579227", "0.55352646", "0.5531321", "0.55265266", "0.5496452", "0.5481549", "0.5477303", "0.5474577...
0.5106276
77
Implements the doubletriangle orientation rule, which states that if DoB, A>BB.
private void doubleTriangle(Graph graph) { List<Node> nodes = graph.getNodes(); for (Node B : nodes) { List<Node> intoBArrows = graph.getNodesInTo(B, Endpoint.ARROW); List<Node> intoBCircles = graph.getNodesInTo(B, Endpoint.CIRCLE); //possible A's and C's are those with arrows into B List<Node> possA = new LinkedList<>(intoBArrows); List<Node> possC = new LinkedList<>(intoBArrows); //possible D's are those with circles into B for (Node D : intoBCircles) { for (Node A : possA) { for (Node C : possC) { if (C == A) { continue; } //skip anything not a double triangle if (!graph.isAdjacentTo(A, D) || !graph.isAdjacentTo(C, D)) { continue; } //skip if A,D,C is a collider if (graph.isDefCollider(A, D, C)) { continue; } //if all of the previous tests pass, orient D*-oB as D*->B if (!isArrowpointAllowed(graph, D, B)) { continue; } graph.setEndpoint(D, B, Endpoint.ARROW); changeFlag = true; } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void determineOrientation(Triangulator triRef, int ind) {\n\tdouble area;\n\n\t// compute the polygon's signed area, i.e., its orientation.\n\tarea = polygonArea(triRef, ind);\n\n\t// adjust the orientation (i.e., make it CCW)\n\tif (area < 0.0) {\n\t triRef.swapLinks(ind);\n\t triRef.ccwLoop = fals...
[ "0.5636842", "0.5503011", "0.52086127", "0.5094613", "0.50666445", "0.50379276", "0.50299716", "0.5016858", "0.500738", "0.4986856", "0.49686214", "0.49554402", "0.49167687", "0.48544285", "0.48485374", "0.47952783", "0.47159117", "0.47147655", "0.47082308", "0.4687949", "0.4...
0.57256687
0
Does only the ancestor and cycle rules of these repeatedly until no changes
private void awayFromAncestorCycle(Graph graph) { while (changeFlag) { changeFlag = false; List<Node> nodes = graph.getNodes(); for (Node B : nodes) { List<Node> adj = graph.getAdjacentNodes(B); if (adj.size() < 2) { continue; } ChoiceGenerator cg = new ChoiceGenerator(adj.size(), 2); int[] combination; while ((combination = cg.next()) != null) { Node A = adj.get(combination[0]); Node C = adj.get(combination[1]); //choice gen doesnt do diff orders, so must switch A & C around. awayFromAncestor(graph, A, B, C); awayFromAncestor(graph, C, B, A); awayFromCycle(graph, A, B, C); awayFromCycle(graph, C, B, A); } } } changeFlag = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void awayFromColliderAncestorCycle(Graph graph) {\n List<Node> nodes = graph.getNodes();\n\n for (Node B : nodes) {\n List<Node> adj = graph.getAdjacentNodes(B);\n\n if (adj.size() < 2) {\n continue;\n }\n\n ChoiceGenerator cg = new C...
[ "0.671652", "0.6148483", "0.5838766", "0.57453984", "0.5698783", "0.56802666", "0.5650435", "0.56335753", "0.5617865", "0.5592831", "0.5565909", "0.5565874", "0.554377", "0.55356765", "0.5518426", "0.5484975", "0.5478976", "0.5460071", "0.5433312", "0.5423964", "0.54106224", ...
0.66550225
1
Does all 3 of these rules at once instead of going through all triples multiple times per iteration of doFinalOrientation.
private void awayFromColliderAncestorCycle(Graph graph) { List<Node> nodes = graph.getNodes(); for (Node B : nodes) { List<Node> adj = graph.getAdjacentNodes(B); if (adj.size() < 2) { continue; } ChoiceGenerator cg = new ChoiceGenerator(adj.size(), 2); int[] combination; while ((combination = cg.next()) != null) { Node A = adj.get(combination[0]); Node C = adj.get(combination[1]); //choice gen doesnt do diff orders, so must switch A & C around. // awayFromCollider(graph, A, B, C); // awayFromCollider(graph, C, B, A); // awayFromAncestor(graph, A, B, C); // awayFromAncestor(graph, C, B, A); // awayFromCycle(graph, A, B, C); // awayFromCycle(graph, C, B, A); ruleR1(A, B, C, graph); ruleR1(C, B, A, graph); ruleR2(A, B, C, graph); ruleR2(C, B, A, graph); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void doFinalOrientation(Graph graph) {\n discrimGraphs.clear();\n Set<Graph> currentDiscrimGraphs = new HashSet<>();\n currentDiscrimGraphs.add(graph);\n while (changeFlag) {\n changeFlag = false;\n currentDiscrimGraphs.addAll(discrimGraphs);\n d...
[ "0.59555364", "0.5513941", "0.54198545", "0.5408177", "0.5297965", "0.5277192", "0.5276315", "0.5246262", "0.51896906", "0.51855826", "0.5125092", "0.511761", "0.5075904", "0.50628996", "0.5062671", "0.5042094", "0.49932477", "0.49441013", "0.49436066", "0.48866144", "0.48039...
0.0
-1
/ R1, away from collider
private void ruleR1(Node a, Node b, Node c, Graph graph) { if (graph.isAdjacentTo(a, c)) { return; } if (graph.getEndpoint(a, b) == Endpoint.ARROW && graph.getEndpoint(c, b) == Endpoint.CIRCLE) { if (!isArrowpointAllowed(graph, b, c)) { return; } graph.setEndpoint(c, b, Endpoint.TAIL); graph.setEndpoint(b, c, Endpoint.ARROW); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void circleCollison() {\n\t\t\n\t}", "public abstract void collided(CircleCollider col);", "public void laserMoveUp()\r\n\t{\r\n\r\n\t\tif (y > 0)\r\n\t\t\ty -= 20;\r\n\r\n\t\telse\r\n\t\t\tdestroyed = true;\r\n\r\n\t}", "private void subtractPlayerMissile() {\n this.playerMissile -= 1;\n }...
[ "0.665518", "0.6143172", "0.59924114", "0.59655917", "0.5780594", "0.5731717", "0.5721696", "0.5720563", "0.57079023", "0.5686413", "0.56735617", "0.56684816", "0.563305", "0.56213266", "0.5615798", "0.56151754", "0.5606837", "0.55925345", "0.55876684", "0.5572155", "0.556650...
0.0
-1
if Ao>c and a>b>c, then a>c Zhang's rule R2, awy from ancestor.
private void ruleR2(Node a, Node b, Node c, Graph graph) { if (!graph.isAdjacentTo(a, c)) { return; } if (graph.getEndpoint(b, a) == Endpoint.TAIL && graph.getEndpoint(a, b) == Endpoint.ARROW && graph.getEndpoint(b, c) == Endpoint.ARROW && graph.getEndpoint(a, c) == Endpoint.CIRCLE) { if (!isArrowpointAllowed(graph, a, c)) { return; } graph.setEndpoint(a, c, Endpoint.ARROW); } else if (graph.getEndpoint(a, b) == Endpoint.ARROW && graph.getEndpoint(c, b) == Endpoint.TAIL && graph.getEndpoint(b, c) == Endpoint.ARROW && graph.getEndpoint(a, c) == Endpoint.CIRCLE ) { if (!isArrowpointAllowed(graph, a, c)) { return; } graph.setEndpoint(a, c, Endpoint.ARROW); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int CmpAscendancy( TaxoNode node1, TaxoNode node2 ) {\r\n\t\tif( node1 == null || node2 == null )\r\n\t\t\tthrow new RuntimeException( \"Bad node passed to CmpAscendancy\" );\r\n\t\tTaxoNode par = node1.parent;\r\n\t\twhile( par != null ) {\r\n\t\t\tif( par == node2 )\r\n\t\t\t\treturn 1; // Tag 2 i...
[ "0.5496813", "0.5490459", "0.5406583", "0.5382602", "0.5374466", "0.5302459", "0.5299449", "0.5288243", "0.52541256", "0.5246501", "0.52326965", "0.5227964", "0.5171448", "0.5170703", "0.51456195", "0.5120788", "0.50946796", "0.50831187", "0.5063157", "0.5059717", "0.5041201"...
0.5592574
0
if a>BooC and not ac, then a>b>c (orient either circle if present, don't need both)
private void awayFromCollider(Graph graph, Node a, Node b, Node c) { Endpoint BC = graph.getEndpoint(b, c); Endpoint CB = graph.getEndpoint(c, b); if (!(graph.isAdjacentTo(a, c)) && (graph.getEndpoint(a, b) == Endpoint.ARROW)) { if (CB == Endpoint.CIRCLE || CB == Endpoint.TAIL) { if (BC == Endpoint.CIRCLE) { if (!isArrowpointAllowed(graph, b, c)) { return; } graph.setEndpoint(b, c, Endpoint.ARROW); changeFlag = true; } } if (BC == Endpoint.CIRCLE || BC == Endpoint.ARROW) { if (CB == Endpoint.CIRCLE) { graph.setEndpoint(c, b, Endpoint.TAIL); changeFlag = true; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AngleGreater createAngleGreater();", "boolean canFormTriangle(double a, double b, double c) {\n return (a + b > c) && (a + c > b) && (b + c > a);\n }", "static String catAndMouse(int x, int y, int z) {\nint PosCatA ;\nint PosCatB ;\nString wins = null;\nPosCatA = Math.abs(z-x);\nPosCatB = Mat...
[ "0.5738367", "0.563813", "0.5464553", "0.54461217", "0.5369082", "0.5368818", "0.5368192", "0.5358545", "0.5351269", "0.53036946", "0.52188593", "0.51997876", "0.51858735", "0.51578873", "0.50948757", "0.5037303", "0.50127745", "0.49901175", "0.4986831", "0.4972258", "0.49654...
0.46782517
65
if aoC and either a>b>c or a>b>c, then a>c
private void awayFromAncestor(Graph graph, Node a, Node b, Node c) { if ((graph.isAdjacentTo(a, c)) && (graph.getEndpoint(a, c) == Endpoint.CIRCLE)) { if ((graph.getEndpoint(a, b) == Endpoint.ARROW) && (graph.getEndpoint(b, c) == Endpoint.ARROW) && ( (graph.getEndpoint(b, a) == Endpoint.TAIL) || (graph.getEndpoint(c, b) == Endpoint.TAIL))) { if (!isArrowpointAllowed(graph, a, c)) { return; } graph.setEndpoint(a, c, Endpoint.ARROW); changeFlag = true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean cond1(Data C) {\n return (C.getRight() < this.xL);\n }", "public static void main(String[] args) {\n\n int a = 34;\n int b = 45;\n int c = 78;\n\n if (a >= b && a >= c)\n System.out.println(a + \" is a largest number\");\n else if (b >= a && b >= c)\n System...
[ "0.6286512", "0.62792146", "0.6200532", "0.6178659", "0.6175262", "0.60792345", "0.60719633", "0.6036331", "0.60332656", "0.59748304", "0.5970809", "0.59571993", "0.5899514", "0.58956915", "0.5890563", "0.58307695", "0.5809145", "0.5799478", "0.57850844", "0.5780352", "0.5754...
0.0
-1
if Ao>c and a>b>c, then a>c
private void awayFromCycle(Graph graph, Node a, Node b, Node c) { if ((graph.isAdjacentTo(a, c)) && (graph.getEndpoint(a, c) == Endpoint.ARROW) && (graph.getEndpoint(c, a) == Endpoint.CIRCLE)) { if (graph.isDirectedFromTo(a, b) && graph.isDirectedFromTo(b, c)) { graph.setEndpoint(c, a, Endpoint.TAIL); changeFlag = true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n int a = 34;\n int b = 45;\n int c = 78;\n\n if (a >= b && a >= c)\n System.out.println(a + \" is a largest number\");\n else if (b >= a && b >= c)\n System.out.println(b + \" is a largest number\");\n else\n System.out.println(c + ...
[ "0.6546493", "0.6437621", "0.6297933", "0.6288665", "0.6288629", "0.6282517", "0.6244928", "0.6167188", "0.6138189", "0.60069835", "0.5951933", "0.5922606", "0.58875084", "0.58797073", "0.5873491", "0.5843565", "0.5839509", "0.58384705", "0.58317024", "0.57985264", "0.5788427...
0.0
-1
The triangles that must be oriented this way (won't be done by another rule) all look like the ones below, where the dots are a collider path from L to A with each node on the path (except L) a parent of C. B xo x is either an arrowhead or a circle / \ v v L....A > C
private boolean discrimPaths(Graph graph) { List<Node> nodes = graph.getNodes(); for (Node b : nodes) { //potential A and C candidate pairs are only those // that look like this: A<-oBo->C or A<->Bo->C List<Node> possAandC = graph.getNodesOutTo(b, Endpoint.ARROW); //keep arrows and circles List<Node> possA = new LinkedList<>(possAandC); possA.removeAll(graph.getNodesInTo(b, Endpoint.TAIL)); //keep only circles List<Node> possC = new LinkedList<>(possAandC); possC.retainAll(graph.getNodesInTo(b, Endpoint.CIRCLE)); for (Node a : possA) { for (Node c : possC) { if (!graph.isParentOf(a, c)) { continue; } LinkedList<Node> reachable = new LinkedList<>(); reachable.add(a); if (reachablePathFindOrient(graph, a, b, c, reachable)) { return true; } } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TriangleBumper(Double x,Double y,Double orientation,List<Gadget>triggeredGadgets){\n this.x = x;\n this.y = y;\n this.collideCirc = new ArrayList<Circle>(); //corner that ball will collide with\n this.collideLine = new ArrayList<LineSegment>(); //side that ball will collide with\...
[ "0.63859373", "0.62521976", "0.62073416", "0.5793147", "0.5649469", "0.5623542", "0.5540402", "0.5493933", "0.5483143", "0.5479158", "0.54728955", "0.54348725", "0.54223454", "0.54151064", "0.54127806", "0.5405145", "0.5344873", "0.5303819", "0.5274163", "0.5264487", "0.52551...
0.0
-1
a method to search "back from a" to find a DDP. It is called with a reachability list (first consisting only of a). This is breadthfirst, utilizing "reachability" concept from Geiger, Verma, and Pearl 1990. The body of a DDP consists of colliders that are parents of c.
private boolean reachablePathFindOrient(Graph graph, Node a, Node b, Node c, LinkedList<Node> reachable) { Set<Node> cParents = new HashSet<>(graph.getParents(c)); // Needed to avoid cycles in failure case. Set<Node> visited = new HashSet<>(); visited.add(b); visited.add(c); // We don't want to include a,b,or c on the path, so they are added to // the "visited" set. b and c are added explicitly here; a will be // added in the first while iteration. while (reachable.size() > 0) { Node x = reachable.removeFirst(); visited.add(x); // Possible DDP path endpoints. List<Node> pathExtensions = graph.getNodesInTo(x, Endpoint.ARROW); pathExtensions.removeAll(visited); for (Node l : pathExtensions) { // If l is reachable and not adjacent to c, its a DDP // endpoint, so do DDP orientation. Otherwise, if l <-> c, // add l to the list of reachable nodes. if (!graph.isAdjacentTo(l, c)) { // Check whether <a, b, c> should be reoriented given // that l is not adjacent to c; if so, orient and stop. doDdpOrientation(graph, l, a, b, c); return true; } else if (cParents.contains(l)) { if (graph.getEndpoint(x, l) == Endpoint.ARROW) { reachable.add(l); } } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n BDNode a = new BDNode(\"A\");\n BDNode b = new BDNode(\"B\");\n BDNode c = new BDNode(\"C\");\n BDNode d = new BDNode(\"D\");\n BDNode e = new BDNode(\"E\");\n\n a.link(b);\n a.link(d);\n b.link(a);\n b.link...
[ "0.5986866", "0.5586553", "0.5456336", "0.53782773", "0.5350011", "0.5285343", "0.52395946", "0.5228327", "0.5202633", "0.5190836", "0.5171084", "0.5158762", "0.5158067", "0.5136667", "0.5056458", "0.5042463", "0.5035146", "0.50312567", "0.5030197", "0.5026179", "0.50111246",...
0.0
-1
Orients the edges inside the definte discriminating path triangle. Takes the left endpoint, and a,b,c as arguments.
private void doDdpOrientation(Graph graph, Node l, Node a, Node b, Node c) { changeFlag = true; for (IonIndependenceFacts iif : separations) { if ((iif.getX().equals(l) && iif.getY().equals(c)) || iif.getY().equals(l) && iif.getX().equals(c)) { for (List<Node> condSet : iif.getZ()) { if (condSet.contains(b)) { graph.setEndpoint(c, b, Endpoint.TAIL); discrimGraphs.add(graph); return; } } break; } } Graph newGraph1 = new EdgeListGraph(graph); newGraph1.setEndpoint(a, b, Endpoint.ARROW); newGraph1.setEndpoint(c, b, Endpoint.ARROW); discrimGraphs.add(newGraph1); Graph newGraph2 = new EdgeListGraph(graph); newGraph2.setEndpoint(c, b, Endpoint.TAIL); discrimGraphs.add(newGraph2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n void create_edge_between_null_vertexes() {\r\n graph.addEdge(null, \"B\");\r\n graph.addEdge(\"A\", null);\r\n graph.addEdge(null, null);\r\n vertices = graph.getAllVertices();\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> a...
[ "0.58128554", "0.5631211", "0.56077766", "0.5564957", "0.55443126", "0.54480267", "0.54217476", "0.54206455", "0.53802973", "0.5371011", "0.53528756", "0.53354454", "0.5296786", "0.52850884", "0.5279236", "0.5276082", "0.52682716", "0.51731193", "0.5158775", "0.5140045", "0.5...
0.5185486
17
Constructs a triple of nodes.
public IonIndependenceFacts(Node x, Node y, Collection<List<Node>> z) { if (x == null || y == null || z == null) { throw new NullPointerException(); } this.x = x; this.y = y; this.z = z; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TripleGraph createTripleGraph();", "NodeChain createNodeChain();", "private void createNodes() {\n head = new ListNode(30);\n ListNode l2 = new ListNode(40);\n ListNode l3 = new ListNode(50);\n head.next = l2;\n l2.next = l3;\n }", "public TrieNode(){}", "public void c...
[ "0.70181614", "0.6185237", "0.60655576", "0.5941989", "0.58958775", "0.57093734", "0.57078505", "0.5702455", "0.56916475", "0.5667885", "0.56088084", "0.5595286", "0.55942565", "0.5535861", "0.5525903", "0.54929143", "0.54902476", "0.54774284", "0.54501265", "0.5427246", "0.5...
0.0
-1
Constructs the list of treks between node1 and node2.
private static void treks(Graph graph, Node node1, Node node2, LinkedList<Node> path, List<List<Node>> paths) { path.addLast(node1); for (Edge edge : graph.getEdges(node1)) { Node next = Edges.traverse(node1, edge); if (next == null) { continue; } if (path.size() > 1) { Node node0 = path.get(path.size() - 2); if (next == node0) { continue; } if (graph.isDefCollider(node0, node1, next)) { continue; } } if (next == node2) { LinkedList<Node> _path = new LinkedList<>(path); _path.add(next); paths.add(_path); continue; } if (path.contains(next)) { continue; } treks(graph, next, node2, path, paths); } path.removeLast(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<GraphNode> getAroundNodes(GraphNode n1){\n ArrayList<GraphNode> temp1 = new ArrayList<GraphNode>();\n if(!n1.isValid())\n return temp1;\n EdgeList<GraphEdge> m1 = edgeListVector.get(n1.getIndex());\n\n\n for(GraphEdge e1:m1){\n temp1.add(nodeVector...
[ "0.52292466", "0.5183918", "0.5136256", "0.5055446", "0.50291973", "0.50272614", "0.49898455", "0.4988652", "0.49458942", "0.49417424", "0.49408978", "0.49126944", "0.49116838", "0.48960128", "0.48937196", "0.48877695", "0.48356166", "0.48342073", "0.48259014", "0.48116925", ...
0.60340273
0
TODO Autogenerated method stub
public static void main(String[] args) { System.out.println(multiplication(5,2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Creates a new visitor.
MetadataVisitor() { visited = new IdentityHashMap<>(); propertyPath = new String[6]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Visitor() {}", "public void accept(Visitor visitor);", "void accept(Visitor visitor);", "void accept(Visitor<V> visitor);", "public Visitor visitor(Visitor v) \n { \n return visitor = v; \n }", "void visit(Visitor visitor);", "public void accept(IVisitor visitor);", "public abstra...
[ "0.7419392", "0.6870752", "0.6809964", "0.6734062", "0.6698606", "0.668431", "0.66822076", "0.6633472", "0.62853235", "0.626553", "0.6258367", "0.62492025", "0.6222093", "0.61949307", "0.5901925", "0.59016544", "0.5885093", "0.58594847", "0.58202326", "0.57979333", "0.5795451...
0.0
-1
Finds best target between specified possible targetsMap
public EntityID nextTarget(Set<StandardEntity> victims) { // Clustering clustering = this.moduleManager.getModule(SampleModuleKey.AMBULANCE_MODULE_CLUSTERING); // if (this.clusterIndex == -1) { this.clusterIndex = clustering.getClusterIndex(this.agentInfo.getID()); // } Collection<StandardEntity> elements = clustering.getClusterEntities(this.clusterIndex); calculateMapCenters(this.clusterIndex, elements); targetsMap.clear(); if (previousTarget != null && !victims.contains(worldInfo.getEntity(previousTarget.getVictimID()))) { previousTarget = null; } refreshTargetsMap(victims, targetsMap); calculateDecisionParameters(victims, targetsMap); calculateVictimsCostValue(); AmbulanceTarget bestTarget = null; bestTarget = findBestVictim(targetsMap, elements); //considering inertia for the current target to prevent loop in target selection if (previousTarget != null && victims.contains(worldInfo.getEntity(previousTarget.getVictimID()))) { if (bestTarget != null && !bestTarget.getVictimID().equals(previousTarget.getVictimID())) { Human bestHuman = (Human) worldInfo.getEntity(bestTarget.getVictimID()); Human previousHuman = (Human) worldInfo.getEntity(previousTarget.getVictimID()); double bestHumanCost = pathPlanning.setFrom(agentInfo.getPosition()).setDestination(bestHuman.getPosition()).calc().getDistance(); double previousHumanCost = pathPlanning.setFrom(agentInfo.getPosition()).setDestination(previousHuman.getPosition()).calc().getDistance(); if (previousHumanCost < bestHumanCost) { bestTarget = previousTarget; } } } previousTarget = bestTarget; if (bestTarget != null) { return bestTarget.getVictimID(); } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public TargetReport retrieveBestTarget()\n\t{\n\t\t// get targets...\n\t\tgetTargetReports(allTargets);\n//\t\tSystem.out.println(\"All Targets: \" + allTargets);\n\t\t\n\t\t// and find the best one\n\t\tTargetReport bestTarget = null;\n\t\tdouble bestScore = 0;\n\t\tfor (TargetReport target : allTargets)\n\t\t{\n...
[ "0.6241609", "0.61127067", "0.60999435", "0.60665977", "0.60554856", "0.59103924", "0.5898972", "0.5812612", "0.57561505", "0.5731103", "0.5724341", "0.5631864", "0.55837995", "0.55595064", "0.55471367", "0.55320007", "0.5476772", "0.5464031", "0.5461966", "0.54140544", "0.53...
0.62716204
0
Calculates different parameters for a target such as distance of the target to nearest refuge, distance of target to this agent partitions, distance of this agent to the target and situations of the target based on its BRD and DMG
private void calculateDecisionParameters(Set<StandardEntity> victims, Map<EntityID, AmbulanceTarget> targetsMap) { AmbulanceTarget target; Human human; if (victims != null && !victims.isEmpty()) { for (StandardEntity victim : victims) { target = targetsMap.get(victim.getID()); human = (Human) worldInfo.getEntity(victim.getID()); if (target == null) { //creating a new AmbulanceTarget object target = new AmbulanceTarget(victim.getID()); //set target position target.setPositionID(human.getPosition()); //euclidean distance from this victim to the nearest refuge target.setDistanceToRefuge(worldInfo.getDistance(human.getPosition(), findNearestRefuge(human.getPosition()))); target.setDistanceToPartition(Util.distance(victim.getLocation(worldInfo.getRawWorld()), clusterCenterMap.get(this.clusterIndex))); } //euclidean distance from this victim to the me target.setDistanceToMe(computingDistance(human)); target.setVictimSituation(calculateVictimProfitability(human)); targetsMap.put(victim.getID(), target); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public double getDistanceToTarget() {\n if (!Config.isVisionInstalled) {\n return 0;\n }\n double distanceToVisionTarget =\n Config.visionDistanceConstant * (Config.fieldVisionTargetHeight-Config.limelightMountingHeight) /\n Math.tan(Math.toRadians(lime...
[ "0.63556796", "0.6302632", "0.60963565", "0.5984661", "0.5805028", "0.5791289", "0.57698375", "0.5643999", "0.55936784", "0.5590978", "0.55894524", "0.5423312", "0.5404816", "0.5399349", "0.53961486", "0.5364665", "0.536039", "0.5346604", "0.5344275", "0.53356755", "0.5335415...
0.5848453
4
This method computes distance based on euclidean distance. Note: Based on human importance, the distance may be changed to lower value
private int computingDistance(Human human) { double coefficient = 1; if (human instanceof AmbulanceTeam) { coefficient = 0.90; } else if (human instanceof PoliceForce) { coefficient = 0.95; } else if (human instanceof FireBrigade) { coefficient = 0.97; } else {//human is instance of Civilian coefficient = 1; } return (int) (coefficient * Util.distance(human.getPosition(worldInfo.getRawWorld()).getLocation(worldInfo.getRawWorld()), worldInfo.getLocation(agentInfo.me()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int euclideanDistance(DataValue<T> value1, DataValue<T> value2)\r\n\t{\n\t\tint difference = value1.difference(value2);\r\n\t\tdifference = difference * difference;\t\r\n\t\treturn (int) Math.sqrt(difference);\r\n\t}", "public double getEuclideanDistanceTo(Position other) {\n\n double sum = 0;\n ...
[ "0.74070835", "0.6879562", "0.6856477", "0.6817672", "0.6816904", "0.6778078", "0.67774713", "0.6699773", "0.6646563", "0.6637409", "0.66348124", "0.66270584", "0.66264766", "0.6604974", "0.6604686", "0.65473425", "0.6505142", "0.64949536", "0.645954", "0.6443619", "0.6436392...
0.0
-1
Retourne potentiellement un Compte en fonction de son ID.
@Override public Optional<Compte> getById(Long idCompte) { Session session = entityManager.unwrap(Session.class); return Optional.of(session.get(Compte.class, idCompte)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Integer getCompteId();", "public String getCompoId() {\n\t return compoId;\r\n\t }", "public Long getCompId() {\n return compId;\n }", "public Long getCompId() {\n return compId;\n }", "public Integer getCompId() {\n return compId;\n }", "public Integer g...
[ "0.7837721", "0.73290443", "0.7152379", "0.7152379", "0.7094046", "0.70904064", "0.6908809", "0.68714654", "0.68087596", "0.67653567", "0.6636247", "0.66037154", "0.65567976", "0.6523787", "0.65110505", "0.65110505", "0.65110505", "0.65110505", "0.65110505", "0.65110505", "0....
0.6935366
6
Supprime un Compte en fonction de son ID.
@Override public void deleteById(Long idCompte) { Session session = entityManager.unwrap(Session.class); Compte compte = session.get(Compte.class, idCompte); session.remove(compte); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean supprimerCompte(int id);", "public static int suprrimerCompte(int Compteid){\n\t\ttry{\n\t\t\tDAO.getLog().envoyerlog(10, \"DAOUtilisateur\", \"suprrimerCompte: tentative suppression enregistrement compte= \"+Compteid );\n\t Connection maConnexion = DAO.getConnection();\n\t PreparedS...
[ "0.7554082", "0.7410682", "0.65403897", "0.65273184", "0.65273184", "0.6474279", "0.6370051", "0.6335649", "0.6269458", "0.61745346", "0.6170361", "0.6150006", "0.6115635", "0.6103546", "0.60955775", "0.608091", "0.6071186", "0.6052878", "0.6043812", "0.6034022", "0.60337675"...
0.6835304
2
Permet de crediter un compte d'un certain montant.
@Override public void credit(Long idClient, Double value) { log.info("methode credit"); Optional<Compte> compteClient = getByIdClient(idClient); if (compteClient.isPresent()) { Double solde = compteClient.get().getSolde(); compteClient.get().setSolde(solde + value); log.info("Methode credit : " + compteClient.get().toString()); update(compteClient.get()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addCredito(double montante) {\r\n\t\tcredito += montante;\r\n\t}", "public void simulerCreditConso(Client client, float emprunt, int nbMois) {\n\t\tSystem.out.println(\"Proposition de credit consommation : \");\n\t\tCredit creditconso = new Credit(emprunt, nbMois);\n\t\tcreditconso.CreditConso(emprun...
[ "0.6715479", "0.6047241", "0.6010099", "0.59352946", "0.58912724", "0.5830262", "0.57151926", "0.5706986", "0.5685342", "0.56757444", "0.5642625", "0.55858266", "0.5572313", "0.5530399", "0.551818", "0.5513667", "0.5489456", "0.54888785", "0.5486181", "0.54816717", "0.5477232...
0.518663
66
Permet de debiter un compte d'un certain montant.
@Override public void debit(Long idClient, Double value) { Optional<Compte> compteClient = getByIdClient(idClient); if (compteClient.isPresent()) { Double solde = compteClient.get().getSolde(); compteClient.get().setSolde(solde - value); update(compteClient.get()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void debiterMontant( double montant);", "public void comportement() {\n\t\tif (compteurPas > 0) {\n seDeplacer(deplacementEnCours);\n compteurPas--;\n\n // sinon charge le prochain deplacement\n\t\t} else {\n\t\t // recalcul le chemin si la cible a bouge\n ...
[ "0.67094964", "0.66778696", "0.6321536", "0.62640405", "0.61379594", "0.6109003", "0.6068976", "0.6010698", "0.5957064", "0.59056324", "0.59019333", "0.5890511", "0.5858637", "0.5838498", "0.5835983", "0.5787519", "0.57865816", "0.5779444", "0.57257205", "0.57129055", "0.5708...
0.0
-1
TODO Autogenerated method stub
public void display() { applet.image(applet.loadImage("/keypad.png"), 22,410); // TODO Auto-generated method stub }
{ "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
don't allow construction of an instance Get the operational step for given binary operator.
public static EvaluationStep getBinaryOperation(final String theOperator) { if("+".equals(theOperator)) return Addition; if("-".equals(theOperator)) return Subtraction; if("*".equals(theOperator)) return Mulitplication; if("/".equals(theOperator)) return Division; if("^".equals(theOperator)) return Exponentiation; throw new IllegalStateException("Invalid binary operator ($operator).".replace("$operator", (null != theOperator) ? theOperator : "null")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public com.hps.july.persistence.OperatorAccessBean getOperator() throws java.rmi.RemoteException, javax.ejb.FinderException, javax.naming.NamingException {\n instantiateEJB();\n com.hps.july.persistence.Operator localEJBRef = ejbRef().getOperator();\n if ( localEJBRef != null )\n re...
[ "0.6501083", "0.62320817", "0.6199239", "0.6180463", "0.6129221", "0.6023977", "0.5934199", "0.5934199", "0.59292865", "0.59103125", "0.58646137", "0.58610207", "0.5855632", "0.5830829", "0.5829585", "0.580401", "0.5765868", "0.57658654", "0.5756521", "0.57391196", "0.5726003...
0.6493145
1
Get the operational step for a given unary operator.
public static EvaluationStep getUnaryOperation(final String theOperator) { if("+".equals(theOperator)) return NoOp; if("-".equals(theOperator)) return Negation; throw new IllegalStateException("Invalid unary operator ($operator).".replace("$operator", (null != theOperator) ? theOperator : "null")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Unary operator(Operator o);", "private Expr unary() {\n if(match(BANG, MINUS)) { // If this thing can be accurately considered a unary...\n Token operator = previous();\n Expr right = unary();\n return new Expr.Unary(operator, right);\n }\n\n return call(...
[ "0.6579088", "0.64441353", "0.6239744", "0.6212987", "0.6094108", "0.5996377", "0.59488976", "0.5921858", "0.5896969", "0.58484334", "0.57923895", "0.57666504", "0.57221454", "0.5711161", "0.57066345", "0.57062995", "0.5691747", "0.5689459", "0.5685396", "0.5679413", "0.56770...
0.7294194
0
pop the top 2 values and add them and push the result onto the value stack
@Override public void step(final EvaluationContext theContext) { // pop the top 2 values and add them // and push the result onto the value stack // final Double theSecondOperand = theContext.popValue(); final Double theFirstOperand = theContext.popValue(); theContext.pushValue(theFirstOperand + theSecondOperand); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand...
[ "0.68377626", "0.6803724", "0.6747728", "0.6344156", "0.6331312", "0.6324791", "0.62872905", "0.6274577", "0.6266223", "0.62451106", "0.6237114", "0.623234", "0.61845", "0.6169413", "0.6142062", "0.6141208", "0.6125802", "0.61072373", "0.60982776", "0.609537", "0.6073347", ...
0.6692639
3
pop the top 2 values and add them and push the result onto the value stack
@Override public void step(final EvaluationContext theContext) { // pop the top 2 values and add them // and push the result onto the value stack // final Double theSecondOperand = theContext.popValue(); final Double theFirstOperand = theContext.popValue(); theContext.pushValue(theFirstOperand - theSecondOperand); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void add() {\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tpush(secondTopMostValue + topMostValue);\n\t\t}\n\t}", "public final void sub() {\n\t\tif (size > 1) {\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop()...
[ "0.6803724", "0.6747728", "0.6692639", "0.6344156", "0.6331312", "0.6324791", "0.62872905", "0.6274577", "0.6266223", "0.62451106", "0.6237114", "0.623234", "0.61845", "0.6169413", "0.6142062", "0.6141208", "0.6125802", "0.61072373", "0.60982776", "0.609537", "0.6073347", "...
0.68377626
0
pop the top 2 values and add them and push the result onto the value stack
@Override public void step(final EvaluationContext theContext) { // pop the top 2 values and add them // and push the result onto the value stack // final Double theSecondOperand = theContext.popValue(); final Double theFirstOperand = theContext.popValue(); theContext.pushValue(theFirstOperand * theSecondOperand); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand...
[ "0.68377626", "0.6803724", "0.6747728", "0.6692639", "0.6344156", "0.6331312", "0.6324791", "0.62872905", "0.6274577", "0.62451106", "0.6237114", "0.623234", "0.61845", "0.6169413", "0.6142062", "0.6141208", "0.6125802", "0.61072373", "0.60982776", "0.609537", "0.6073347", ...
0.6266223
9
pop the top 2 values and add them and push the result onto the value stack
@Override public void step(final EvaluationContext theContext) { // pop the top 2 values and add them // and push the result onto the value stack // final Double theSecondOperand = theContext.popValue(); final Double theFirstOperand = theContext.popValue(); theContext.pushValue(theFirstOperand / theSecondOperand); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void step(final EvaluationContext theContext)\n {\n // pop the top 2 values and add them\n // and push the result onto the value stack\n //\n final Double theSecondOperand = theContext.popValue();\n final Double theFirstOperand...
[ "0.68380815", "0.6806844", "0.67462766", "0.6693638", "0.6342677", "0.6328589", "0.63218766", "0.628542", "0.62755173", "0.62668246", "0.62422603", "0.623853", "0.6230382", "0.61809534", "0.61687183", "0.61401945", "0.6139249", "0.6124462", "0.6103724", "0.60959554", "0.60923...
0.5934216
37
pop the top 2 values and do a power calculation and push the result onto the value stack
@Override public void step(EvaluationContext theContext) { // pop the top 2 values and do a power calculation // and push the result onto the value stack // final Double theSecondOperand = theContext.popValue(); final Double theFirstOperand = theContext.popValue(); theContext.pushValue(Math.pow(theFirstOperand, theSecondOperand)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void pow() throws Exception{\n\t\tif(!(stackBiggerThanTwo())) throw new Exception(\"Stack hat zu wenig einträge mindestens 2 werden gebraucht!!\");\n\t\telse {\n\t\t\tvalue1= stack.pop();\n\t\t\tvalue2= stack.pop();\n\t\t\tstack.push(Math.pow(value2, value1));\n\t\t}\n\t}", "@Override\n public voi...
[ "0.71680355", "0.6601423", "0.6564644", "0.6508011", "0.644852", "0.64347404", "0.6428437", "0.63760763", "0.63366026", "0.63198936", "0.62985086", "0.6158783", "0.6088106", "0.6049005", "0.59233296", "0.5906486", "0.5827587", "0.58191913", "0.57590675", "0.5703018", "0.56899...
0.7109281
1
pop the value, negate, push the value
@Override public void step(final EvaluationContext theContext) { // pop the value, negate, push the value // final Double theOperand = theContext.popValue(); theContext.pushValue(-theOperand); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void dequeue(){\n if(isEmpty()!=1){\n\n for(int i=0;i<size-1;i++){\n values[i] = values[i+1];\n }\n\n values[size-1] = (-1);\n }\n }", "public ExParValue pop() {\r\n\t\tExParValue v = null;\r\n\t\tif (value.next != null) {\r\n\t\t\tv = value;\r\n\t...
[ "0.6628337", "0.6615048", "0.6586896", "0.6518616", "0.6441966", "0.6384828", "0.62439126", "0.6234343", "0.6234343", "0.6234343", "0.6213064", "0.62128943", "0.62128943", "0.62128943", "0.62128943", "0.62128943", "0.6210871", "0.620669", "0.6169978", "0.6158341", "0.6158341"...
0.0
-1
Returns the only app engine standard artifact found for the given module or null if there aren't any or more than one.
@Nullable public static Artifact findOneAppEngineStandardArtifact(@NotNull Module module) { Collection<Artifact> artifacts = ArtifactUtil.getArtifactsContainingModuleOutput(module); Collection<Artifact> appEngineStandardArtifacts = Lists.newArrayList(); appEngineStandardArtifacts.addAll( artifacts .stream() .filter( artifact -> AppEngineProjectService.getInstance().isAppEngineStandardArtifactType(artifact)) .collect(toList())); return appEngineStandardArtifacts.size() == 1 ? appEngineStandardArtifacts.iterator().next() : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Optional<T> getModule() {\n return Optional.ofNullable(this.module);\n }", "Artifact getArtifact(String version) throws ArtifactNotFoundException;", "private Artifact getArtifactFromReactor(Artifact artifact) {\n\t\t// check project dependencies first off\n\t\tfor (Artifact a : (Set<Artifact>)...
[ "0.5530873", "0.5478128", "0.54414666", "0.5269066", "0.52288824", "0.50519204", "0.49951097", "0.49780652", "0.4939315", "0.4933144", "0.48617852", "0.48304576", "0.47965303", "0.47666886", "0.47453362", "0.47323096", "0.47261962", "0.47246358", "0.47074926", "0.46859148", "...
0.82510495
0
With extra space Time: O(n1+n2) Space: O(n1+n2)
public ListNode mergeTwoListsWithExtraLinkedList(ListNode l1, ListNode l2) { ListNode dummy=new ListNode(); ListNode curr=dummy,temp; while(l1!=null && l2!=null){ if(l1.val<l2.val){ temp=new ListNode(l1.val); l1=l1.next; } else{ temp=new ListNode(l2.val); l2=l2.next; } curr.next=temp; curr=curr.next; } while(l1!=null){ curr.next=new ListNode(l1.val); l1=l1.next; curr=curr.next; } while(l2!=null){ curr.next=new ListNode(l2.val); l2=l2.next; curr=curr.next; } return dummy.next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int f2(int N) { \n int x = 0; //O(1)\n for(int i = 0; i < N; i++) // O(n)\n // O(n)`\n for(int j = 0; j < i; j++) \n x++;\n return x;\n }", "public static int example2(int[] arr) { // O(1)\r\n\t\tint n = arr.length, total = 0; // O(1...
[ "0.706756", "0.64110523", "0.6395304", "0.60193986", "0.59794015", "0.5892131", "0.5755833", "0.56705076", "0.56557506", "0.5622811", "0.5605218", "0.55792505", "0.5576256", "0.553115", "0.5524217", "0.55240536", "0.5473857", "0.54517335", "0.5430535", "0.54290205", "0.542795...
0.0
-1
Iterative choice Time: O(n1+n2) Space: O(1)
public ListNode mergeTwoListsIterative(ListNode l1, ListNode l2) { ListNode dummy=new ListNode(); ListNode curr=dummy; while(l1!=null && l2!=null){ if(l1.val<l2.val){ curr.next=l1; l1=l1.next; curr=curr.next; } else{ curr.next=l2; l2=l2.next; curr=curr.next; } } while(l1!=null){ curr.next=l1; l1=l1.next; curr=curr.next; } while(l2!=null){ curr.next=l2; l2=l2.next; curr=curr.next; } return dummy.next; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static int choose(int n, int k) {\n return factorial(n) / (factorial(k) * factorial(n - k));\n }", "public static BigInteger choose(int n, int k) {\n\n\t\t\t if (k > n) return BI0;\n\t\t\t else if (k == 0 || n == k) return BI1;\n\t\t\t else if (k == 1 || k == n-1) return BigInteger.val...
[ "0.58167946", "0.58003527", "0.5750926", "0.5664892", "0.559232", "0.5523889", "0.5516424", "0.54569244", "0.53861296", "0.5376345", "0.5337263", "0.53330445", "0.528848", "0.52870256", "0.52558124", "0.5252926", "0.5204713", "0.52010036", "0.5198079", "0.51965123", "0.519319...
0.0
-1
Recursive choice Time: O(n1+n2) Space: O(1)
public ListNode mergeTwoListsRecursion(ListNode l1, ListNode l2) { if(l1==null)return l2; if(l2==null)return l1; if(l1.val<l2.val){ l1.next=mergeTwoListsRecursion(l1.next,l2); return l1; } else{ l2.next=mergeTwoLists(l1,l2.next); return l2; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static BigInteger choose(int n, int k) {\n\n\t\t\t if (k > n) return BI0;\n\t\t\t else if (k == 0 || n == k) return BI1;\n\t\t\t else if (k == 1 || k == n-1) return BigInteger.valueOf(n);\n\n\t\t\t List<Integer> nk = Arrays.asList(n, k);\n\t\t\t if (!choose_cache.containsKey(nk)) {\n\t\t\t ...
[ "0.5962403", "0.5906308", "0.578635", "0.5722322", "0.56730765", "0.5651009", "0.5638849", "0.56182206", "0.56097263", "0.55620134", "0.55014944", "0.53240186", "0.53222", "0.53143257", "0.5313161", "0.5298194", "0.5290909", "0.5262699", "0.52578986", "0.52295136", "0.5213355...
0.0
-1
All parameters are injected by GIN
@Inject public AppControllerImpl(PlaceController placeController, EventBus eventBus, PlaceHistoryHandler placeHistoryHandler, AppLayout appLayout, ActivityManagerInitializer activityManagerInitializer) { this.placeController = placeController; this.placeHistoryHandler = placeHistoryHandler; this.appPanelView = appLayout; this.eventBus = eventBus; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void inject() {\n }", "@GinModules(MyAppGinModule.class)\npublic interface MyAppGinjector extends Ginjector {\n\n String ANNOTATED_STRING_VALUE = \"abc\";\n\n MyApp getMyApp();\n\n SimpleObject getSimple();\n\n MyService getMyService();\n\n MyServiceImpl getMyServiceImpl();\n\n MyProvided getMyP...
[ "0.6220878", "0.59634805", "0.59477264", "0.5780569", "0.5705217", "0.56719846", "0.5663709", "0.5588904", "0.5450064", "0.5405846", "0.53925925", "0.5358226", "0.5333029", "0.53205585", "0.5230679", "0.5205825", "0.5202148", "0.52002805", "0.5198679", "0.5175266", "0.5173786...
0.0
-1
private static final int NUM_ACTORS = 3;
@PostMapping("/payment/pay/{user_id}/{order_id}/{amount}") public String postPayment(@PathVariable(name="user_id") String user_id, @PathVariable(name="amount") Integer amount) { String credit = ""; try (ActorClient client = new ActorClient()) { ActorProxyBuilder<PaymentActor> builder = new ActorProxyBuilder(PaymentActor.class, client); // List<Thread> threads = new ArrayList<>(NUM_ACTORS); ExecutorService threadPool = Executors.newSingleThreadExecutor(); ActorId actorId = new ActorId(user_id); PaymentActor actor = builder.build(actorId); Future<String> future = threadPool.submit(new CallActor(actorId.toString(), actor, 3, amount)); credit = future.get(); System.out.println("Got user credit: "+credit); } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } String json = "{\"user_id\":"+user_id+","+"\"credit\":"+credit+"}"; return json; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getActionCount(){return 4;}", "public int numActors() { return ActorSet.size(); }", "public int getAccessibleActionCount() {\n return 1;\n }", "@Override\n public int howManyActivated(){\n return (gameboardPanel.howManyActivated() + leaderCardsPanel.howManyActivated());\n }...
[ "0.66385233", "0.61165184", "0.5647382", "0.5638232", "0.56264865", "0.5602849", "0.5589131", "0.5558333", "0.551749", "0.55079824", "0.54840237", "0.5478982", "0.54789543", "0.5382739", "0.5350869", "0.5349922", "0.53430194", "0.5327863", "0.53102446", "0.53102446", "0.52883...
0.0
-1
Read accessor for CourseEnCours attribute
public delistation.datatypes.Course[] CourseEnCours() { while(true) { if (!this._is_local()) { org.omg.CORBA.portable.InputStream _input = null; try { org.omg.CORBA.portable.OutputStream _output = this._request("_get_CourseEnCours",true); _input = this._invoke(_output); return delistation.datatypes.LCoursesHelper.read(_input); } catch (final org.omg.CORBA.portable.RemarshalException _exception) { continue; } catch (final org.omg.CORBA.portable.ApplicationException _exception) { final String _exception_id = _exception.getId(); throw new org.omg.CORBA.UNKNOWN("Unexpected User Exception: "+ _exception_id); } finally { this._releaseReply(_input); } } else { org.omg.CORBA.portable.ServantObject _so = _servant_preinvoke("_get_CourseEnCours",_opsClass); if (_so == null) continue; delistation.g_superviseur.G_SuperviseurOperations _self = (delistation.g_superviseur.G_SuperviseurOperations) _so.servant; try { return _self.CourseEnCours(); } finally { _servant_postinvoke(_so); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Course getCourse() {\n return course; //XXX-CHANGE-XXX\n }", "public Course getCourse() {\n return course;\n }", "@Override\r\n\tpublic double getCourse() {\n\t\treturn this.course;\r\n\t}", "public String getCourse() {\n return courseName;\n }", "public Course getCourseById(...
[ "0.7060265", "0.69882333", "0.65920794", "0.6562323", "0.6486885", "0.6423614", "0.64222586", "0.64124376", "0.6402834", "0.63868684", "0.63816607", "0.6257854", "0.6213117", "0.621111", "0.6188446", "0.6150706", "0.61500376", "0.6148725", "0.6111963", "0.6102329", "0.6096486...
0.667869
2
Initializes all config fields.
void init();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized static void initConfig() {\n SeLionLogger.getLogger().entering();\n Map<ConfigProperty, String> initialValues = new HashMap<>();\n\n initConfig(initialValues);\n\n SeLionLogger.getLogger().exiting();\n }", "public synchronized static void initConfig() {\n\t\tMap...
[ "0.7115953", "0.7097988", "0.70862854", "0.7039013", "0.6977848", "0.6887913", "0.6875101", "0.68419087", "0.68295187", "0.6823274", "0.6816665", "0.6807302", "0.6778714", "0.67688555", "0.67504066", "0.6725149", "0.66789293", "0.66453177", "0.6641786", "0.6641375", "0.655998...
0.0
-1
Gets the primary EmojIDE bot token to use.
String getPrimaryToken();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getToken() {\n String token = \"96179ce8939c4cdfacba65baab1d5ff8\";\n return token;\n }", "@Override\n public String getBotToken() {\n return \"412386556:AAHawYQpPaNLFdnpckQsYr7c3YdBQZEXy0I\";\n }", "@Override\r\n\tpublic String getBotToken() {\t\t\r\n\t\tretu...
[ "0.69581664", "0.6888638", "0.68491036", "0.65881974", "0.6567986", "0.6388356", "0.6388356", "0.6388356", "0.63559246", "0.6353398", "0.6351918", "0.6337298", "0.6337298", "0.63368917", "0.63368917", "0.63368917", "0.63368917", "0.63368917", "0.6266712", "0.6266712", "0.6266...
0.66046834
3
Gets a list of servers the bot is in and has admin access to, to upload emojis.
List<Long> getServers();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<SkungeeServer> getServers() {\n\t\treturn ServerManager.getServers();\n\t}", "public List<Server> getServerList() {\n return new ArrayList<Server>(serversList);\n }", "public List<Server> getServerList() {\n return serverList;\n }", "public List<Server> getAllServers(){...
[ "0.66255385", "0.64522266", "0.6442518", "0.6421698", "0.63552254", "0.63285697", "0.6276628", "0.6258488", "0.62436247", "0.61668104", "0.6147344", "0.61239904", "0.60760695", "0.5823568", "0.5817461", "0.57923436", "0.5752526", "0.56998074", "0.5696567", "0.5694851", "0.561...
0.62627155
7
public static final double INTEREST_RATE = 0.0001;
public CheckingAccount() { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double getInterestRate() {\n return DEFAULT_INTEREST_RATE ;\n }", "double getRate();", "public static double getInterestRate(){\n\t\t return interest_rate;\r\n\t }", "@Override\n\tpublic double calRate() {\n\t\treturn 0.9f;\n\t}", "double getTransRate();", "public double getRate()...
[ "0.719255", "0.69388855", "0.6775234", "0.6653872", "0.66117084", "0.65609527", "0.6406343", "0.63571554", "0.6302153", "0.6283851", "0.6264757", "0.6261198", "0.62511533", "0.6248882", "0.6241137", "0.62393165", "0.62002975", "0.6184107", "0.61562234", "0.6151598", "0.614909...
0.0
-1
Mark online boolean as b in firebase
private void markOnline(boolean b) { usersRef.child(userMe.getId()).child("online").setValue(b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean setOffline(boolean b);", "private void updateUserStatus(boolean online)\n {\n }", "public static void setOnline(boolean flag) {\r\n ONLINE = flag;\r\n }", "private void setOffline(boolean value) {\n \n offline_ = value;\n }", "public boolean isOnline() {\n ret...
[ "0.7001775", "0.6968461", "0.69197124", "0.6623774", "0.6296028", "0.6205458", "0.6202381", "0.61354053", "0.613008", "0.61029315", "0.60882044", "0.6069493", "0.6052231", "0.5981001", "0.59574497", "0.5952099", "0.59344095", "0.59006864", "0.5886733", "0.58844936", "0.587091...
0.8309003
0
constructor for the user
public User(String email, long locationId, String type) { this.email = email; this.locationId = locationId; this.type = type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "User()\n\t{\n\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper();\n\t}", "public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}", "public User() {\r\n this(\"\", \"\");\r\n }", "public User() {\r\n \r\n }", "public TUser() ...
[ "0.8318456", "0.7813997", "0.7813997", "0.7813997", "0.7761916", "0.7750236", "0.7738098", "0.7693695", "0.76751924", "0.76751924", "0.76741606", "0.76546437", "0.76546067", "0.7641786", "0.7606404", "0.75897914", "0.7577998", "0.7564268", "0.7560402", "0.7549942", "0.7527262...
0.0
-1
(a) initialize vocabulary: words appear in both training and testing data (b) initialize H: a map from lexical to its ID TODO (c) initialize V: ??? (d)
public void load() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void train(Instance[] trainingData, int v) {\n\n\t\t// For all the words in the documents, count the number of occurrences. Save in\n\t\t// HashMap\n\t\t// e.g.\n\t\t// m_map[0].get(\"catch\") should return the number of \"catch\" es, in the\n\t\t// documents labeled sports\n\t\t// Hint: m_map[...
[ "0.6400461", "0.60260856", "0.5978915", "0.5938277", "0.58937657", "0.5872086", "0.58641595", "0.58203834", "0.5721043", "0.5713476", "0.5712003", "0.5707434", "0.57045126", "0.5697029", "0.5690978", "0.56895584", "0.56555504", "0.5610744", "0.56088173", "0.5608138", "0.56033...
0.0
-1
train_model is initialized to be zero
public void train(int n_epochs) { TrainModel train_model = null; int lenW = vocabulary.length; int W = 3 * lenW + 3; // randomly initialize U_Ot, values are randomly selected between -0.1 to 0.1; double[][] U_Ot = new double[D][W]; // randomly initialize U_R, values are randomly selected between -0.1 and 0.1 double[][] U_R = new double[D][W]; double prev_err = 0D; for (int epoch = 0; epoch < n_epochs; epoch++) { double total_error = 0D; int n_wrong = 0; for (int i = 0; i < train_lines.size(); i++) { Instance line = train_lines.get(i); if ("q".equals(line.type)) { // indicates question List<Integer> refs = line.refs; // Indexing from 1 List<Integer> f = refs.stream() .map(ref -> ref-1) .collect(Collectors.toList()); // Indexing from 0 int id = line.ID - 1; // Indexing from 0 // all indices from List<Integer> indices = range(i-id, i+1); List<double[]> memory_list = indices.stream() .map(idx -> L_train[idx]) .collect(Collectors.toList()); if (train_model == null) { train_model = new TrainModel(lenW, f.size()); } List<Integer> m = f; // TODO List<Integer> mm = new ArrayList<>(); //TODO for (int j = 0; j < f.size(); j++) { mm.add(O_t( newM, memory_list )); } double err = train_model(H.get("answer"), gamma, memory_list, V, id, ???)[0]; total_error += err; System.out.println("epoch: " + epoch + "\terr: " + (total_error / train_lines.size())); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void train() {\n actual = observations.toArray();\n min_val_error = Double.MAX_VALUE;\n if (findDecayConstant)\n for (float alpha = 0f; alpha <= 1f; alpha += 0.01f)\n initializeAndTrainModel(alpha);\n else\n initializeAndTrainMo...
[ "0.6923119", "0.6829311", "0.67274714", "0.6653585", "0.65485394", "0.65067893", "0.64625615", "0.644881", "0.6404668", "0.6317009", "0.63065046", "0.6293375", "0.61974907", "0.6167365", "0.61569905", "0.6144516", "0.604809", "0.603737", "0.60237736", "0.602343", "0.5999879",...
0.5813627
42
some utils Find the index which s_Ot > 0
public static int O_t(List<Integer> xs, List<double[]> L, TrainModel train_model) { int t = 0; for (int i = 0; i < L.size()-1; i++) { // Last element is the answer, so we can ignore that. if (train_model.s_Ot(xs, i, t, L) > 0) { t = i; } } return t; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int indexOf(Object o) {\n int current = 0;\n while (current < size && !(data[current].equals(o))) {\n ++current;\n }\n return current == size ? -1 : current;\n }", "protected int findNonEmptyPosition() {\n\t\t\twhile (!set.bv[++indice]) {\n\t\t\t}\n\t\t\treturn i...
[ "0.649414", "0.6198929", "0.6190638", "0.61551946", "0.6124671", "0.60406655", "0.5995661", "0.58864284", "0.5830195", "0.58077395", "0.57995474", "0.57970595", "0.57970595", "0.57970595", "0.57970595", "0.57970595", "0.57970595", "0.57970595", "0.57970595", "0.57970595", "0....
0.0
-1
Created by cheng on 2018/12/14.
@Transactional public interface OperationDaoI extends BaseDaoI<Operation> { void saveOperation(Operation operation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private sta...
[ "0.6085042", "0.587569", "0.5869949", "0.58669454", "0.58119386", "0.58119386", "0.5806678", "0.57741314", "0.5754362", "0.5690324", "0.56713986", "0.5665702", "0.56610036", "0.5651978", "0.56490844", "0.5643421", "0.5624007", "0.56164205", "0.5615466", "0.55998397", "0.55957...
0.0
-1
Constructor used by the decorator
public Vigenere(EncryptionDecorator encrypt) { algo = encrypt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Constructor(){\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "private Instantiation(){}", "public ContentDecorator() {\r\n super();\r\n }", "public Clade() {}", "private ChainingMethods() {\n // private constructor\n\n }", "public ProductDecorator() {}", "protected abstr...
[ "0.6830426", "0.6747362", "0.6682747", "0.6647739", "0.66349095", "0.66231567", "0.6621666", "0.6545452", "0.65358424", "0.6411604", "0.6404389", "0.63977295", "0.63750124", "0.6370328", "0.63470036", "0.6332848", "0.63085896", "0.6306608", "0.62855923", "0.62719053", "0.6266...
0.0
-1
Encrypt the value using the key Decorator function
@Override public void encrypt() { algo.encrypt(); String cypher = vigenereAlgo(true); this.setValue(cypher); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void Encrypt(Object key) {\n\n\t}", "Encryption encryption();", "String encryption(Long key, String encryptionContent);", "public EncryptorReturn encrypt(String in) throws CustomizeEncryptorException;", "public String encrypt(final String value) {\n\t\treturn encryptor.encrypt(value);\n...
[ "0.73767936", "0.730067", "0.7106536", "0.6592108", "0.65878123", "0.6470394", "0.64358056", "0.6336842", "0.6336185", "0.63164264", "0.61657596", "0.61622465", "0.61167985", "0.60954803", "0.60825986", "0.60262144", "0.6003058", "0.5995725", "0.5978597", "0.5919993", "0.5888...
0.63021195
10
Decrypt the value using the key Decorator function
@Override public void decrypt() { algo.decrypt(); String cypher = vigenereAlgo(false); this.setValue(cypher); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String decrypt(String key);", "@Override\n\tpublic void Decrypt(Object key) {\n\n\t}", "public String decrypt(final String value) {\n\t\treturn encryptor.decrypt(value);\n\t}", "private String decryptKey(String keyValue) {\n if (keyValue != null) {\n byte[] encryptedKey = Base64.deco...
[ "0.7737744", "0.74817395", "0.66638833", "0.663611", "0.65996146", "0.65556294", "0.65026575", "0.64997405", "0.6492199", "0.6439102", "0.6390989", "0.6343245", "0.63043165", "0.62187696", "0.61664504", "0.61566824", "0.61553204", "0.6133659", "0.61090195", "0.60888684", "0.6...
0.6454952
9
Algorithm used to encrypt or decrypt
private String vigenereAlgo(boolean encrypt){ List<Integer> key = EncryptionUtils.stringToIntList(algo.getKey()); List<Integer> value = EncryptionUtils.stringToIntList(algo.getValue()); int keyLength = key.size(); int valueLength = value.size(); List<Integer> crypt = new ArrayList<>(); for (int i = 0; i < valueLength; i++){ crypt.add(Math.floorMod(value.get(i)-EncryptionUtils.FIRST+ mult(encrypt)* (key.get(i%keyLength)-EncryptionUtils.FIRST),EncryptionUtils.SIZE) +EncryptionUtils.FIRST); } return EncryptionUtils.intListToString(crypt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Encryption encryption();", "public interface EncryptionAlgorithm {\n\n public String encrypt(String plaintext);\n\n}", "public String Crypt(String s);", "public interface ICryptoEngine \n{\n\t/**\n\t * Initialize the \n\t * \n\t * @param forEncryption should the engine be initialized for encryption (true...
[ "0.7827271", "0.7210363", "0.7020258", "0.6789162", "0.6687029", "0.6497599", "0.649306", "0.6462944", "0.6433752", "0.64334816", "0.6371008", "0.63382393", "0.63366824", "0.63121086", "0.6296068", "0.6293743", "0.6285546", "0.6281153", "0.62765956", "0.62660235", "0.62057126...
0.6495643
6
Validate if Dockerfile is created.
public void validateDockerfile() { File dockerFile = DOCKER_TARGET_PATH.resolve("Dockerfile").toFile(); Assert.assertTrue(dockerFile.exists()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testGetDockerfile() throws Exception {\n System.out.println(\"getDockerfile\");\n Path path = Paths.get(\"/tmp/test.txt\");\n Files.createDirectories(path.getParent());\n try {\n Files.createFile(path);\n } catch (FileAlreadyExistsException e) {\...
[ "0.6379253", "0.58897793", "0.5786186", "0.55596805", "0.5513865", "0.53696334", "0.5225533", "0.5138156", "0.5128119", "0.5125257", "0.51155657", "0.5104756", "0.50488985", "0.5014007", "0.5013935", "0.5005256", "0.4995101", "0.49841878", "0.49830386", "0.49814624", "0.49681...
0.8187172
0
Validate contents of the Dockerfile.
public void validateDockerImage() throws DockerTestException, InterruptedException { List<String> ports = getExposedPorts(DOCKER_IMAGE); Assert.assertEquals(ports.size(), 1); Assert.assertEquals(ports.get(0), "9099/tcp"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void validateDockerfile() {\n File dockerFile = DOCKER_TARGET_PATH.resolve(\"Dockerfile\").toFile();\n Assert.assertTrue(dockerFile.exists());\n }", "static boolean isConfigValid(Path path) {\n Yaml yaml = new Yaml();\n InputStream inputStream = null;\n try {\n input...
[ "0.7667841", "0.5667907", "0.55348253", "0.5467585", "0.53200114", "0.5250387", "0.5235512", "0.51870674", "0.5166164", "0.5117301", "0.5099464", "0.5017855", "0.49427265", "0.49319807", "0.49313772", "0.4913751", "0.48637164", "0.48573434", "0.4846915", "0.48411384", "0.4839...
0.5531399
3
Test create room with OK response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testCreateRoomOkResponse() { // given final CreateRoomRequest createRoomRequest = CreateRoomRequest.builder().name(TEST_ROOM).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_CREATE_ROOM_COMMAND, createRoomRequest)) .willReturn(OK_RESPONSE); // when multiUserChatService.createRoom(TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testCreateRoomWithOptionsOkResponse() {\n // given\n Map<String, String> options = new HashMap<>();\n final CreateRoomRequest createRoomRequest =\n CreateRoomRequest.builder().name(TEST_ROOM).options(options).build()...
[ "0.79625946", "0.7361861", "0.72645134", "0.6996082", "0.6762875", "0.6760224", "0.6675829", "0.660688", "0.65562135", "0.65498567", "0.6435905", "0.6367765", "0.6224084", "0.6160081", "0.6138431", "0.61356175", "0.61067736", "0.61005604", "0.60368985", "0.59903574", "0.59186...
0.8588965
0
Test create room with BAD response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testCreateRoomBadResponse() { // given final CreateRoomRequest createRoomRequest = CreateRoomRequest.builder().name(TEST_ROOM).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_CREATE_ROOM_COMMAND, createRoomRequest)) .willReturn(BAD_RESPONSE); // when multiUserChatService.createRoom(TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testCreateRoomWithOptionsBadResponse() {\n // given\n Map<String, String> options = new HashMap<>();\n final CreateRoomRequest createRoomRequest =\n CreateRoomRequest.builder().name(TEST_ROOM).options(options).build(...
[ "0.79857576", "0.76745355", "0.7527585", "0.69724554", "0.67604774", "0.6736078", "0.6667345", "0.65308297", "0.6465973", "0.6400262", "0.6352011", "0.62984204", "0.62977517", "0.62482107", "0.6108074", "0.6105664", "0.60738117", "0.6038059", "0.6023685", "0.60232633", "0.596...
0.86359787
0
Test subscribe to room with OK response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testSubscribeToRoomOkResponse() { // given final SubscribeRequest subscribeRequest = SubscribeRequest.builder() .user(TEST_USER + "/" + TEST_USER).nick(TEST_NICK).room(TEST_ROOM + "@null").build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_SUBSCRIBE_COMMAND, subscribeRequest)) .willReturn(OK_RESPONSE); // when multiUserChatService.subscribeToRoom(TEST_USER, TEST_NICK, TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testUnsubsribeFromRoomOkResponse() {\n // given\n final UnsubscribeRequest unsubscribeRequest =\n UnsubscribeRequest.builder().user(TEST_USER).room(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(\...
[ "0.75163984", "0.6885466", "0.67642814", "0.6709303", "0.6421001", "0.63598406", "0.63168687", "0.6214526", "0.61838335", "0.6080401", "0.60476655", "0.6038078", "0.6036763", "0.5878041", "0.58552504", "0.5830859", "0.5807378", "0.5763003", "0.5740165", "0.569473", "0.5685599...
0.82825357
0
Test subscribe to room with BAD response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testSubscribeToRoomBadResponse() { // given final SubscribeRequest subscribeRequest = SubscribeRequest.builder() .user(TEST_USER + "/" + TEST_USER).nick(TEST_NICK).room(TEST_ROOM + "@null").build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_SUBSCRIBE_COMMAND, subscribeRequest)) .willReturn(BAD_RESPONSE); // when multiUserChatService.subscribeToRoom(TEST_USER, TEST_NICK, TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testUnsubsribeFromRoomBadResponse() {\n // given\n final UnsubscribeRequest unsubscribeRequest =\n UnsubscribeRequest.builder().user(TEST_USER).room(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(...
[ "0.7844186", "0.7087127", "0.7008085", "0.6679671", "0.65952456", "0.657602", "0.63337326", "0.6216939", "0.61093724", "0.60050124", "0.5946579", "0.5920542", "0.5867388", "0.58327854", "0.58285385", "0.580471", "0.57998747", "0.57867354", "0.5759776", "0.57557046", "0.574457...
0.8425102
0
Test unsubscribe from room with OK response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testUnsubsribeFromRoomOkResponse() { // given final UnsubscribeRequest unsubscribeRequest = UnsubscribeRequest.builder().user(TEST_USER).room(TEST_ROOM).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_UNSUBSCRIBE_COMMAND, unsubscribeRequest)) .willReturn(OK_RESPONSE); // when multiUserChatService.unsubsribeFromRoom(TEST_USER, TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testUnsubsribeFromRoomBadResponse() {\n // given\n final UnsubscribeRequest unsubscribeRequest =\n UnsubscribeRequest.builder().user(TEST_USER).room(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(...
[ "0.74956673", "0.67848885", "0.6698345", "0.6517849", "0.6343124", "0.6255932", "0.6255238", "0.6233202", "0.62093586", "0.62048733", "0.6142961", "0.61196", "0.6049487", "0.5994707", "0.59774095", "0.59432876", "0.587371", "0.585649", "0.5827028", "0.5824708", "0.5795557", ...
0.85158426
0
Test unsubscribe from room with BAD response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testUnsubsribeFromRoomBadResponse() { // given final UnsubscribeRequest unsubscribeRequest = UnsubscribeRequest.builder().user(TEST_USER).room(TEST_ROOM).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_UNSUBSCRIBE_COMMAND, unsubscribeRequest)) .willReturn(BAD_RESPONSE); // when multiUserChatService.unsubsribeFromRoom(TEST_USER, TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testUnsubsribeFromRoomOkResponse() {\n // given\n final UnsubscribeRequest unsubscribeRequest =\n UnsubscribeRequest.builder().user(TEST_USER).room(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(\...
[ "0.78261435", "0.7283425", "0.67501706", "0.6220154", "0.62011075", "0.60809314", "0.6073964", "0.6025553", "0.5895785", "0.5868265", "0.58272797", "0.5812657", "0.5811339", "0.57979643", "0.575231", "0.57479936", "0.57424235", "0.5712644", "0.5702734", "0.5688584", "0.566737...
0.8494272
0
Test create room with OK response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testCreateRoomWithOptionsOkResponse() { // given Map<String, String> options = new HashMap<>(); final CreateRoomRequest createRoomRequest = CreateRoomRequest.builder().name(TEST_ROOM).options(options).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_CREATE_ROOM_WITH_OPT_COMMAND, createRoomRequest)) .willReturn(OK_RESPONSE); // when multiUserChatService.createRoomWithOptions(TEST_ROOM, options); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testCreateRoomOkResponse() {\n // given\n final CreateRoomRequest createRoomRequest = CreateRoomRequest.builder().name(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(\n MultiUserChatConstants.MULT...
[ "0.8588965", "0.7361861", "0.72645134", "0.6996082", "0.6762875", "0.6760224", "0.6675829", "0.660688", "0.65562135", "0.65498567", "0.6435905", "0.6367765", "0.6224084", "0.6160081", "0.6138431", "0.61356175", "0.61067736", "0.61005604", "0.60368985", "0.59903574", "0.591864...
0.79625946
1
Test create room with BAD response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testCreateRoomWithOptionsBadResponse() { // given Map<String, String> options = new HashMap<>(); final CreateRoomRequest createRoomRequest = CreateRoomRequest.builder().name(TEST_ROOM).options(options).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_CREATE_ROOM_WITH_OPT_COMMAND, createRoomRequest)) .willReturn(BAD_RESPONSE); // when multiUserChatService.createRoomWithOptions(TEST_ROOM, options); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testCreateRoomBadResponse() {\n // given\n final CreateRoomRequest createRoomRequest = CreateRoomRequest.builder().name(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(\n MultiUserChatConstants.MUL...
[ "0.86370623", "0.76741", "0.7530209", "0.69732565", "0.6760679", "0.6738321", "0.66673696", "0.6529695", "0.6466491", "0.640136", "0.6353072", "0.63016254", "0.630025", "0.62503874", "0.6111346", "0.6103968", "0.60770583", "0.6037773", "0.60232913", "0.60230696", "0.59647685"...
0.7986307
1
Test destroy room with OK response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testDestroyRoomOkResponse() { // given final DestroyRoomRequest destroyRoomRequest = DestroyRoomRequest.builder().name(TEST_ROOM).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_DESTROY_ROOM_COMMAND, destroyRoomRequest)) .willReturn(OK_RESPONSE); // when multiUserChatService.destroyRoom(TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testDeleteRoomPositive() {\n\t\tRoom room;\n\t\tint roomId;\n\n\t\tsuper.authenticate(\"player1\");\n\n\t\troomId = super.getEntityId(\"Room1\");\n\t\troom = this.roomService.findOne(roomId);\n\n\t\tthis.roomService.delete(room);\n\n\t\tsuper.unauthenticate();\n\t}", "@Test\n @SuppressWarni...
[ "0.7293854", "0.72705877", "0.6966079", "0.69004834", "0.6858897", "0.6783929", "0.6501883", "0.62563545", "0.6065838", "0.6037401", "0.6034127", "0.600715", "0.5993144", "0.5991298", "0.5987442", "0.59838367", "0.5974232", "0.59319663", "0.5902847", "0.58904654", "0.5882242"...
0.8395029
0
Test destroy room with BAD response.
@Test @SuppressWarnings({"PMD.JUnitTestsShouldIncludeAssert"}) public void testDestroyRoomBadResponse() { // given final DestroyRoomRequest destroyRoomRequest = DestroyRoomRequest.builder().name(TEST_ROOM).build(); given(clientResponseProvider.sendPostRequest( MultiUserChatConstants.MULTI_USER_CHAT_DESTROY_ROOM_COMMAND, destroyRoomRequest)) .willReturn(BAD_RESPONSE); // when multiUserChatService.destroyRoom(TEST_ROOM); // then }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @SuppressWarnings({\"PMD.JUnitTestsShouldIncludeAssert\"})\n public void testDestroyRoomOkResponse() {\n // given\n final DestroyRoomRequest destroyRoomRequest =\n DestroyRoomRequest.builder().name(TEST_ROOM).build();\n given(clientResponseProvider.sendPostRequest(\n MultiUserChatC...
[ "0.7337161", "0.72573996", "0.6758563", "0.6737609", "0.6671037", "0.6646778", "0.6629924", "0.6585239", "0.6200904", "0.6169643", "0.6158415", "0.6121971", "0.61148363", "0.6025938", "0.5992489", "0.5980116", "0.5871064", "0.5857336", "0.57794917", "0.5735285", "0.5687424", ...
0.85044307
0
Created by Gyandeep on 13/11/17.
public interface SearchFilterAPIListener { public void getFilterAttributeDataFromNetwork(Map<String, List<AttrValSpinnerModel>> data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void interr() {\n\t}", "@Over...
[ "0.5903571", "0.57782894", "0.57602715", "0.5702929", "0.56978756", "0.56542087", "0.5637721", "0.5637721", "0.5601682", "0.5594641", "0.55865383", "0.5580202", "0.5547378", "0.55460036", "0.55385154", "0.55102944", "0.55023026", "0.54984444", "0.54984444", "0.54984444", "0.5...
0.0
-1
/ renamed from: a
static boolean m6825a(Context context) { return context.getResources().getConfiguration().orientation == 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
/ renamed from: a
public final void mo309a() { throw new NoSuchMethodError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
/ renamed from: b
public final void mo310b() { throw new NoSuchMethodError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void mo2508a(bxb bxb);", "@Override\n public void func_104112_b() {\n \n }", "@Override\n public void b() {\n }", "public interface C19351a {\n /* renamed from: b */\n void mo30633b(int i, String str, byte[] bArr);\n }", "@Override\n\tpublic void b2() {\n\t\t\n\t}", "v...
[ "0.64558864", "0.6283203", "0.6252635", "0.6250949", "0.6244743", "0.6216273", "0.6194491", "0.6193556", "0.61641675", "0.6140157", "0.60993093", "0.60974354", "0.6077849", "0.6001867", "0.5997364", "0.59737104", "0.59737104", "0.5905105", "0.5904295", "0.58908087", "0.588663...
0.0
-1
/ renamed from: d
static void m6826d() { throw new NoSuchMethodError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void d() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public int d()\r\n/* 79: */ {\r\n/* 80:82 */ return this.d;\r\n/* 81: */ }", "public String d_()\r\n/* 445: */ {\r\n/* 446:459 */ return \"container.inventor...
[ "0.63814974", "0.6161482", "0.6071298", "0.59962976", "0.58773404", "0.58716977", "0.58259004", "0.5758642", "0.5701838", "0.5660324", "0.56520164", "0.56360936", "0.5623887", "0.56160694", "0.5611214", "0.5611214", "0.5606199", "0.5599611", "0.5588785", "0.5571922", "0.55582...
0.0
-1
/ return true if there is a win
public static boolean craps() { int dice1 = rollDice(); int dice2 = rollDice(); int sum = dice1 + dice2; if(sum == 2 || sum == 3 || sum == 12) { return false; } else if(sum == 7 || sum == 11) { return true; } else { int points = sum; do { dice1 = rollDice(); dice2 = rollDice(); sum = dice1 + dice2; } while( sum != 7 && sum != points); if(sum == points) return true; else return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasWin();", "public boolean CheckWin(){\n\t return false;\n\t }", "public boolean isWin() {\n return win;\n }", "public final boolean checkForWin() {\r\n boolean result = false;\r\n String player = \"\";\r\n \r\n for (Rail rail : rails) {\r\n ...
[ "0.90526736", "0.8285967", "0.81781214", "0.81520545", "0.810769", "0.7992573", "0.796918", "0.79594505", "0.7933491", "0.789095", "0.77996135", "0.77853554", "0.77625567", "0.77472997", "0.7741481", "0.7740096", "0.7685745", "0.7685504", "0.76686156", "0.765922", "0.76454806...
0.0
-1
Constructor that takes a diagnostic message as argument.
public UnableToFindSolutionException(String message) { super(message); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Message(){\n this(\"Not Specified\",\"Not Specified\");\n }", "public Error(String message) {\r\n \tsuper(message);\r\n \t}", "public SMSLibException(String errorMessage)\n/* 10: */ {\n/* 11:34 */ super(errorMessage);\n\n/* 12: */ }", "public MessageParseException() {\n...
[ "0.6786409", "0.67841625", "0.66440445", "0.65473354", "0.6539955", "0.6522354", "0.65056425", "0.6503153", "0.6481866", "0.6481197", "0.64660424", "0.64589685", "0.6449692", "0.6439881", "0.63993824", "0.63847315", "0.636358", "0.6346419", "0.6335967", "0.6318208", "0.631820...
0.0
-1
Method to get the string value of content type
@Override public String toString() { return type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@java.lang.Override\n public java.lang.String getStringValue() {\n java.lang.Object ref = \"\";\n if (typeCase_ == 5) {\n ref = type_;\n }\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteStr...
[ "0.7586277", "0.7503437", "0.75026906", "0.7401955", "0.7332279", "0.7255922", "0.7255922", "0.7255922", "0.7010507", "0.6992102", "0.69909644", "0.69909644", "0.69583935", "0.69583935", "0.69583935", "0.69583935", "0.69583935", "0.69583935", "0.69583935", "0.69583935", "0.69...
0.0
-1
Method to retrieve the corresponding content type for the given format
public static String getContentType(String format) { if (StringUtils.hasText(format)) { if (format.equalsIgnoreCase(XML.name())) { return ContentTypes.XML.toString(); } else if (format.equalsIgnoreCase(JSON.name())) { return ContentTypes.JSON.toString(); } else if (format.equalsIgnoreCase(PDF.name())) { return ContentTypes.PDF.toString(); } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getMIMEType(String format)\n\t{\n\t\treturn engine.getMIMEType(format);\n\t}", "String getContentType();", "String getContentType();", "String getContentType();", "public MediaType getContentType()\r\n/* 193: */ {\r\n/* 194:289 */ String value = getFirst(\"Content-Type\");\r\n/* 195:...
[ "0.7422548", "0.6961255", "0.6961255", "0.6961255", "0.6863672", "0.672557", "0.672557", "0.67227024", "0.6677401", "0.66054666", "0.65568143", "0.6495747", "0.6475821", "0.64708287", "0.6399924", "0.6324717", "0.62385404", "0.62385404", "0.6229523", "0.61074954", "0.61065316...
0.79831785
0