query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
required string ip = 1;
public boolean hasIp() { return ((bitField0_ & 0x00000001) == 0x00000001); }
[ "private void setIp(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n ip_ = value;\n }", "void setIP(String ip);", "public void setIp2(String ip2);", "public void setIp(String tmp) {\n this.ip = tmp;\n }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Phuong thuc tra ve thoi thanh chay time
private JProgressBar getTime() { if (time == null) { time = new JProgressBar(); time.setBounds(200, 22, 500, 14); } return time; }
[ "private void laySoTrang() {\n tongTrang = TaiKhoanDAO.getInstance().layTongSoBanGhi();\n tongTrang = tongTrang % 15 == 0 ? tongTrang / 15 : tongTrang / 15 + 1;\n }", "@Override\r\n\tpublic long getTrongTai() {\r\n\t\treturn _qlvtXuLyBienHieuPhuongTien.getTrongTai();\r\n\t}", "private Phrase sw...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Convert any object to a JSON string
public static String objectToJson(Object object) { ObjectMapper mapper = new ObjectMapper(); try { return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(object); } catch (JsonProcessingException e) { l.error(e.getMessage()); } return null; }
[ "private String convertToJSON(T obj) {\n try {\n if (!type.equals(obj.getClass())) {\n throw new RuntimeException(\"cannot convert different types\");\n }\n return objectMapper.writeValueAsString(obj);\n } catch (Exception e) {\n throw new Run...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate a new bitmap with all integers in [rangeStart,rangeEnd) added.
public static RoaringBitmap add(RoaringBitmap rb, final long rangeStart, final long rangeEnd) { rangeSanityCheck(rangeStart, rangeEnd); if (rangeStart >= rangeEnd) { return rb.clone(); // empty range } final int hbStart = (Util.highbits(rangeStart)); final int lbStart = (Util.lowbits(rangeStart)); final int hbLast = (Util.highbits(rangeEnd - 1)); final int lbLast = (Util.lowbits(rangeEnd - 1)); RoaringBitmap answer = new RoaringBitmap(); answer.highLowContainer.appendCopiesUntil(rb.highLowContainer, (char) hbStart); if (hbStart == hbLast) { final int i = rb.highLowContainer.getIndex((char) hbStart); final Container c = i >= 0 ? rb.highLowContainer.getContainerAtIndex(i).add(lbStart, lbLast + 1) : Container.rangeOfOnes(lbStart, lbLast + 1); answer.highLowContainer.append((char) hbStart, c); answer.highLowContainer.appendCopiesAfter(rb.highLowContainer, (char) hbLast); return answer; } int ifirst = rb.highLowContainer.getIndex((char) hbStart); int ilast = rb.highLowContainer.getIndex((char) hbLast); { final Container c = ifirst >= 0 ? rb.highLowContainer.getContainerAtIndex(ifirst).add(lbStart, Util.maxLowBitAsInteger() + 1) : Container.rangeOfOnes(lbStart, Util.maxLowBitAsInteger() + 1); answer.highLowContainer.append((char) hbStart, c); } for (int hb = hbStart + 1; hb < hbLast; ++hb) { Container c = Container.rangeOfOnes(0, Util.maxLowBitAsInteger() + 1); answer.highLowContainer.append((char) hb, c); } { final Container c = ilast >= 0 ? rb.highLowContainer.getContainerAtIndex(ilast).add(0, lbLast + 1) : Container.rangeOfOnes(0, lbLast + 1); answer.highLowContainer.append((char) hbLast, c); } answer.highLowContainer.appendCopiesAfter(rb.highLowContainer, (char) hbLast); return answer; }
[ "protected IntegerVector addRangeToSet(int start, int end,\n IntegerVector ivec) {\n if (ivec == null) {\n ivec = new IntegerVector((end - start) + 2);\n }\n for (int i = start; i <= end; ++i) {\n ivec.addInt(i);\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public boolean verify(String hostname, SSLSession session) { return true; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method that returns the round the question was asked
public int getRound() { return round; }
[ "public long getRound() {\n return round;\n }", "public Round getRound() {return round; }", "public int getCurrentRound() {\n return currentRound;\n }", "public int roundNumber() {\n return roundNumber;\n }", "public Round getRound(){\n\t\treturn gameScreen.getRound();\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Anade, si no existia, la IP del cliente al registro de IPs de clientes
public void addIPcliente(Mensaje mensaje){ if (!clientes.contains(mensaje.ips.get(0))) clientes.add(mensaje.ips.get(0)); }
[ "public void saisirAdresse(){\n\t\tSystem.out.println(\"Saisir la nouvelle adresse du client : \");\n\t\tthis.adrClient = Lire.S();\n\t}", "default @org.jetbrains.annotations.Nullable imports.k8s.ClientIpConfig getClientIP() {\n return null;\n }", "public Clientes (String idCliente, String dirIP){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new NodeInitializer instance.
public NodesInitializer( final boolean isClassExistsTested, final char[] keyStorePassword, final BasicNodeRuntime nodeRuntime, final String keyStoreFilePath, final String containerConfigurationCertificateFilePath) { //Preconditions assert keyStorePassword != null : "keyStorePassword must not be null"; assert keyStorePassword.length > 0 : "keyStorePassword must not be empty"; assert nodeRuntime != null : "nodeRuntime must not be null"; assert StringUtils.isNonEmptyString(keyStoreFilePath) : "keyStoreFilePath must be a non-empty string"; assert StringUtils.isNonEmptyString(containerConfigurationCertificateFilePath) : "containerConfigurationCertificateFilePath must be a non-empty string"; this.isClassExistsTested = isClassExistsTested; this.keyStorePassword = keyStorePassword.clone(); this.nodeRuntime = nodeRuntime; this.keyStoreFilePath = keyStoreFilePath; this.configurationCertificateFilePath = containerConfigurationCertificateFilePath; containerName = nodeRuntime.getContainerName(); nodeAccess = nodeRuntime.getNodeAccess(); }
[ "ForInitializer createForInitializer();", "public Node() {\n }", "public ClusterChainGenerator() {\n logger.info(\"Initialized new ClusterChainGenerator instance\");\n }", "public Node()\n\t{\n\t\t// Defaults\n\t\tbounds = new Rectangle(0, 0);\n\t\tdepth = 0;\n\t\tmaxChildren = 5;\n\t\tmaxDepth...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check corectness of topological sort
@Test public void getTopologicalSort(){ Collection<Node> nodes = graph.getNodes(); List<String> sortedNodes = new LinkedList<String>(); for(Node node: nodes){ sortedNodes.add(node.getName()); } List<String> actualList = new LinkedList<String>(Arrays.asList("0","1","2", "3", "4", "5", "6", "7", "8", "9")); assertEquals(sortedNodes,actualList); }
[ "private static void ex22_4_1() {\n\t\tAdjacencyListGraph<TCPLVertex> g = new AdjacencyListGraph<TCPLVertex>(\n\t\t\t\ttrue, false);\n\t\tTestFigures.figure22_8_dag_alphabetically(g, TCPLVertex.class);\n\t\tg.print();\n\t\tList<TCPLVertex> list = null;\n\t\ttry {\n\t\t\tlist = GraphAlgorithm.topologicalSortByDFS(g)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds the maximum pressure of the hurricanes.
public int findMaxPressure( ) { int maxPressure=Integer.MIN_VALUE; for(int i=0;i<hurricanes.size();i++) { maxPressure=Math.max(maxPressure,hurricanes.get(i).getPressure()); } return maxPressure; }
[ "public double getMaxHR(){\n double max = 0;\n for (int i = 0; i < activityData.size(); i++){\n if (activityData.get(i).getHeartRate() >= max){\n max = activityData.get(i).getHeartRate();\n }\n }\n return max;\n }", "float getMaximumValue();", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new object of class 'Role Attribute Setter'.
RoleAttributeSetter createRoleAttributeSetter();
[ "public abstract Builder setRole(String role);", "private void setRole() {\n\n\t}", "public void setRole(Role role){ this.role = role; }", "@Override\n public UserRole createRole(UserRole newRole) {\n UserRole savedUserRole = new UserRole();\n savedUserRole.setName(newRole.getName());\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loggedin user ID to impersonate instead of the user's ID.
public UpdateLeads setRequestMetadataUserOverridesUserId(java.lang.String requestMetadataUserOverridesUserId) { this.requestMetadataUserOverridesUserId = requestMetadataUserOverridesUserId; return this; }
[ "protected String getUserIdentifier() {\n return GlobalVariables.getUserSession().getPrincipalId();\n }", "String getCurrentUserID();", "String getIdUser();", "String getCurrentUserEntityID();", "public String getSessionUserId();", "public static String user_id() {\n\t\treturn moduleProvider.ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (mView != null) { ViewGroup parent = (ViewGroup) mView.getParent(); if (parent != null) parent.removeView(mView); } try { mView = inflater.inflate(R.layout.fragment_online_map, container, false); } catch (InflateException e) { /* map is already there, just return view as it is */ } ((MainActivity)getActivity()).isOnlineMap = true; googleMap = ((MapFragment) getActivity().getFragmentManager().findFragmentById(R.id.googleMapView)) .getMap(); googleMap.setMyLocationEnabled(true); MarkerOptions options = new MarkerOptions(); options.position(hospitalPosition); if (hospitalPosition.latitude != 0 || hospitalPosition.longitude != 0) googleMap.addMarker(options); googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(41.025232, 29.017080), 6.0f)); return mView; }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.movie_statistic_layout, parent, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indent this string as if it were written by a coder or eclipse, based on parenthesis.
public String indent(String s, String tab, HashSet<Character> openParens, HashSet<Character> closeParens){ StringBuilder result = new StringBuilder(); int depth = 0; int lineLength = 0; LinkedList<Character> stack = new LinkedList<Character>(); for(char c : s.toCharArray()){ stack.addLast(c); } while(!stack.isEmpty()){ char c = stack.pop(); if(openParens.contains(c)){ depth ++; result.append(c); //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } else if(closeParens.contains(c)){ depth --; //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } result.append(c); //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } else{ if(c == '\n'){ //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } else{ lineLength ++; if(lineLength > 70 && c == ' '){ //go to the last space in this chunk. // if the character after it isn't a newline, then // make this whole chunk of spaces into a newline. while(stack.peek() == ' '){ c = stack.pop(); } if(stack.peek() != '\n'){ //newline result.append("\n"); lineLength = 0; for(int i = 0; i < depth ; i ++){ result.append(tab); lineLength += tab.length(); } } } result.append(c); } } } return result.toString(); }
[ "private String buildIndent()\n {\n return Strings.repeat(\" \", indent * 4);\n }", "public static String indent(String src) {\r\n\t\treturn indent(\" \", src);\r\n\t}", "private void doIndent() {\r\n\t\tfor (int i = 0; i < indent; i++) {\r\n\t\t\tresult.append(\" \");\r\n\t\t}\r\n\t}", "@Overr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
private HashMap sku_map = new HashMap();
public List<String> getSku_map() { return sku_map; }
[ "public Cart() {\r\n myMap = new HashMap<Item, Integer>();\r\n }", "public ProductList(){\n products = new HashMap<>();\n }", "public void setSKU (String SKU);", "public Library(){\n this.inventory = new HashMap<>();\n }", "public ShoppingCart() {\n myCart = new HashMap<...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Getter for the MaxQuant Score type
public MaxQuantScoreType getMaxQuantScoreType() { return iMaxQuantScoreType; }
[ "java.lang.String getPriceMax();", "public int getmaxscore(){\r\n \r\n return maximumScore;\r\n }", "public float getMaxScore() {\n return maxScore_;\n }", "public static int getMaxScore(){\n return maxScore;\n }", "public double getMax() {\n return _max;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
After completing background task Dismiss the progress dialog
protected void onPostExecute(String file_url) { // dismiss the dialog after getting all products pDialog.dismiss(); }
[ "@Override\n public void onFinish() {\n dismissProgressDialog();\n }", "protected void onSwPostExecute() {\n\t\tif (mProgressBar != null)\n\t\t\tmProgressBar.stop();\n\t}", "@Override\r\n public void run() {\n progressDialog.dismiss(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method will assign the DCA role.
private void assignRole(WorkListDisplayForm workListDisplayForm2, String roleName) { LOGGER.info("Entering Assinrole*****************"); if(WorkListDisplayConstants.DCA_ROLE.equalsIgnoreCase(roleName)){ LOGGER.info("inside the dca role role......"+roleName); workListDisplayForm2.setRoleEditable(WorkListDisplayConstants.YES_VALUE); workListDisplayForm2.setReadOnlyUser(WorkListDisplayConstants.NO_VALUE); //Set role details //Completion date edit start workListDisplayForm2.setRoleName(WorkListDisplayConstants.DCA_ROLE); //Completion date edit end } if(WorkListDisplayConstants.VENDOR.equalsIgnoreCase(roleName)){ LOGGER.info("inside the vendor role......"+roleName); workListDisplayForm2.setRoleEditable(WorkListDisplayConstants.YES_VALUE); workListDisplayForm2.setReadOnlyUser(WorkListDisplayConstants.NO_VALUE); workListDisplayForm2.setRoleName(WorkListDisplayConstants.VENDOR); } if(WorkListDisplayConstants.READ_ONLY_ROLE.equalsIgnoreCase(roleName)){ LOGGER.info("inside the read only role......"+roleName); workListDisplayForm2.setReadOnlyUser(WorkListDisplayConstants.YES_VALUE); workListDisplayForm2.setRoleName(WorkListDisplayConstants.READ_ONLY_ROLE); } }
[ "public void assignRole() {\n\r\n\t}", "private void setRole() {\n\n\t}", "public void setRole(Role role){ this.role = role; }", "@Override\r\n\tpublic void createRole(Role role) throws ERPException {\n\r\n\t}", "private void addRole() {\n\t\tRole role = new Role(\"ROLE_USER\", \"user role\", privilegeServi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
repeated string tags = 4;
public com.google.protobuf.ByteString getTagsBytes(int index) { return tags_.getByteString(index); }
[ "@Test\n public void test3() {\n String input = \"<tagz/>\" + \n \"<tag ><x>элемент 1</x></tag >\" +\n \"<tag att1=\\\"test1\\\" att2=\\\"test2\\\"\\t/>\\n\" +\n \"<tag attrib=\\\"test\\\" />\";\n String output[] = {\n \"<tag ><x>элемент 1</x></ta...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ updates the name of a branch
private void updateBranch() { int bid; String bname; PreparedStatement ps; try { ps = con.prepareStatement("UPDATE branch SET branch_name = ? WHERE branch_id = ?"); System.out.print("\nBranch ID: "); bid = Integer.parseInt(in.readLine()); ps.setInt(2, bid); System.out.print("\nBranch Name: "); bname = in.readLine(); ps.setString(1, bname); int rowCount = ps.executeUpdate(); if (rowCount == 0) { System.out.println("\nBranch " + bid + " does not exist!"); } con.commit(); ps.close(); } catch (IOException e) { System.out.println("IOException!"); } catch (SQLException ex) { System.out.println("Message: " + ex.getMessage()); try { con.rollback(); } catch (SQLException ex2) { System.out.println("Message: " + ex2.getMessage()); System.exit(-1); } } }
[ "public void changeName(String newName) {\n _branchName = newName;\n }", "public static void branch(String branchname) throws IOException {\n if(!FileStatus.branchExist(\"master\")){\n System.out.println(\"Not a valid object name: 'master'.\");\n return;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A comment by the usert has received a new reply.
@org.jetbrains.annotations.Nullable() public final java.lang.Integer component8() { return null; }
[ "java.lang.String getReplyNote();", "@Override\r\n\tpublic void getNoteReply() throws Throwable {\n\t\tif(trigger!=null){\r\n\t\t\ttrigger.triggerBusiness(null, null, NoteConstants.NOTE_REPLY, null);\r\n\t\t}\r\n\t}", "void receivedReply(AttachReply reply);", "@Override\n\t\t\t\t\tpublic void onResponse(Comme...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determines the highest cards out of the given cards
private String highCards() { Card[] sorted = sortCardsDesc(Card.SortOrder.BY_RANK, false); String theValue = "0"; int i; for (i = 0; i < noOfCards && i < 5; i++) theValue += sorted[i].getRankInHex(); while(i < 5) { theValue += "0"; i++; } return theValue; }
[ "private int getHighestCardThreeFourKind(Poker[] cards)\n\t{\n\t\t// int counter = 0;\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\tfor (int i=0; i<cards.length; i++){\n\t\t\tif (!map.containsKey(cards[i].getNumber())){\n\t\t\t\tmap.put(cards[i].getNumber(), 1);\t\t\t\t\n\t\t\t} else {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/The objective of this function is to reiterate the loop if user wants to roll dics again till 3 times. it also allow USer to change any specific dics index and roll its value again Argument taken: as Array that User entered
public void loopcheck(String [] arrInput){ inputloop=new Scanner(System.in); boolean run = true ; int num =0; int[] newindex = new int [5]; String [] replacecopy= null; /*The while loop will allow user to set position of the dics that he need ot change * the value for*/ while(run){ System.out.print("\nEnter position of dices that you want to REROLL. (,) seperated => "); Loop=new StringBuilder(inputloop.nextLine()); String []rollindex=Loop.toString().split(","); for(int i=0;i<rollindex.length;i++) { num=Integer.parseInt(rollindex[i]); newindex[i]= num; if(num<Main.MinValue || num>Main.Dices) { System.out.print("\nNumber should be in range of 1 to 5 Only"); }else{ run = false; } } } run = true; /*The while loop allow user to enter new value for old value * and validates it to be between 1 to 6*/ while(run){ System.out.print("Enter the replaced values(,) seperated:"); Loop=new StringBuilder(inputloop.nextLine()); String [] replace=Loop.toString().split(","); for(int i=0;i<replace.length;i++){ num=Integer.parseInt(replace[i]); if(num<Main.MinValue || num>Main.MaxValue){ System.out.print("\nNumber should be in range of 1 to 6 Only"); }else{ run = false; } } replacecopy = Arrays.copyOf(replace, replace.length); } for(int i=0;i<replacecopy.length;i++){ arrInput[newindex[i]-1]=replacecopy[i]; } System.out.print("\nDices values : "); /*This for loop run the new values for score and rule check*/ for(String str:arrInput){ System.out.print(str+" "); } if(validate(arrInput) == Main.valid ){ int rulevalue = rule(arrInput); System.out.print(Main.RuleCheck.get(rulevalue)); int scorevalue = score(rulevalue,arrInput); System.out.print("\nYour new score is :"+scorevalue); } else{ System.out.print("\nInvalid Input Entered"); } Attempt++; if(Attempt<2) { System.out.print("\nDo you want to REROLL again(y/n) ?"); Loop=new StringBuilder(inputloop.nextLine()); if(Loop.toString().contains("y") && (Loop.toString().trim().length()==1)) { loopcheck(arrInput); } } else { System.out.println("Maximum limit of 3 completed.."); } }
[ "private void reroll(){\n for(int i=0; i<2; i++){\n display.printMessage(\"Select the dice you wish to re-roll and click \\\"Roll Again\\\".\");\n display.waitForPlayerToSelectDice();\n for(int j=0; j<5; j++){\n if(display.isDieSelected(j)){\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public Object forceVersionIncrement(Serializable id, Object currentVersion, SessionImplementor session) throws HibernateException { return null; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
used by updateboard, movement find the gap, find how big it is add thread wait here
public void slideRows2() { int gapWid = 0; int leftIndex = 0; int startIndex; ArrayList<Integer> startIndexes = new ArrayList(); for (int i = 0; i <= width; i++) { if (gapWid > 0 && board[i][height] != 0) { leftIndex = i; i = width + 1; //end the check } else if (board[i][height] == 0) { gapWid++; } if (gapWid == 1) { startIndexes.add(i); } } startIndex = startIndexes.get(0); copyLeftOfGapOver(leftIndex, startIndex); fillRightGap(gapWid); checkForRemainingRowGap(); }
[ "public void run(){\r\n \t\twhile(true){\r\n \t\t\tboard.new_game();\r\n \t\t\t\r\n \t\t\twhile(!board.lost && !board.won){\r\n\t\t\t\t/*try {\r\n\t\t\t\t\tsleep(0);\r\n\t\t\t\t} catch (InterruptedException e) {}*/\r\n \t\t\t\tboolean made_a_move = false;\r\n \t\t\t\t\r\n \t\t\t\tfor(int x = 0; x<board.width; x++){...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Query 1 for the customer menu
public void SearchandBuy() { ArrayList<String> CategoryList=Merchant.getCategoryList(); ArrayList<ArrayList<Item>> ItemCategoryList=Merchant.getItemCategoryList(); ArrayList<ArrayList<Integer>> MerchantIdList=Merchant.getMerchantIdList(); System.out.println("Please select category"); for(int j=0;j<CategoryList.size();j++) { System.out.println((j+1)+") "+CategoryList.get(j)); } int selection=in.nextInt(); selection=selection-1; if(selection>=CategoryList.size() && selection<0) System.out.println("Wrong category Selected"); else { int j; for( j=0;j<MerchantIdList.get(selection).size();j++) { ItemCategoryList.get(selection).get(j).display(); System.out.println(); } System.out.println(); System.out.println("Enter Item code"); int ItemCode=in.nextInt(); System.out.println("Enter Item quantity"); int quantity=in.nextInt(); for(j=0;j<MerchantIdList.get(selection).size();j++) { if(ItemCategoryList.get(selection).get(j).getUniqueCode()==ItemCode) { break; } } if(j==MerchantIdList.get(selection).size()) { System.out.println("Wrong Id chosen"); return; } Item itemtobuy=ItemCategoryList.get(selection).get(j); int MerchantId=MerchantIdList.get(selection).get(j); System.out.println("Choose method of transaction"); System.out.println("1) Buy item"); System.out.println("2) Add item to cart"); System.out.println("3) Exit"); selection=in.nextInt(); if(selection==1) { //buy item directly this.buydirectly(new BuyItem(ItemCode, quantity, itemtobuy,MerchantId)); } else if(selection==2) { //Add to cart if((itemtobuy.getOffer().toLowerCase().equals("Buy one Get One".toLowerCase()) && itemtobuy.getQuantity()<quantity) || (itemtobuy.getQuantity()<quantity)) { System.out.println("Not enough items in stock"); return; } Cart.add(new BuyItem(ItemCode,quantity,itemtobuy,MerchantId)); } else { //Exit this menu return; } } }
[ "@Override\n public void getMenuIdInside()\n {\n try\n {\n result1 = gatherResultSet(setStatement(inputQuery1,menu.getRestaurants_id(),menu.getMenu_name(), true,1,2));\n //System.out.println(result1);\n if(result1.next())\n {\n menu_id =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an instance of DonationResponse given an JSON string
public static DonationResponse fromJson(String jsonString) throws IOException { return JSON.getGson().fromJson(jsonString, DonationResponse.class); }
[ "public static PaymentVerificationResponse fromJson(String jsonString) throws JsonProcessingException {\n return JSON.getMapper().readValue(jsonString, PaymentVerificationResponse.class);\n }", "private RequestResponse createResponse(JSONObject o) {\r\n\t\treturn new RequestResponse(o.toJSONString());\r\n\t}"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ensure the death occurred in the correct world
@EventHandler public void onEntityDeath(EntityDeathEvent event) { if (!event.getEntity().getWorld().getName().equals(this.getWorldName())) { return; } //Ensure the entity was a monster if (!(event.getEntity() instanceof Monster)) { return; } //Ensure the mob had a killer Monster mob = (Monster)event.getEntity(); if (mob.getKiller() == null) { return; } //Ensure the killer and entity are both in the data store Player player = mob.getKiller(); if (!dataStore.containsPlayer(player.getName()) || !dataStore.containsMob(mob.getEntityId())) { return; } //Fetch information from data store ZomboPlayerInfo playerInfo = dataStore.getPlayerByName(player.getName()); ZomboMobInfo entityInfo = dataStore.getMobById(mob.getEntityId()); //Update player information playerInfo.addKill(entityInfo.getType()); playerInfo.addXp(entityInfo.getXp()); dataStore.putPlayer(player.getName(), playerInfo); //Send message to the player mob.getKiller().sendMessage("Killed a " + mob.getType().getName() + " [+" + entityInfo.getXp() + " XP]"); //Disable vanilla drops event.setDroppedExp(0); event.getDrops().clear(); //Drop crafting items ArrayList<ZomboDropInfo> mobDrops = dataStore.getDropsByType(mob.getType()); Random rand = new Random(); if (mobDrops != null && !mobDrops.isEmpty()) { for (ZomboDropInfo dropInfo : mobDrops) { if (dropInfo.canDrop(rand)) { event.getDrops().add(new ItemStack(dropInfo.getType(), dropInfo.getAmount())); } } } //Stop tracking mob dataStore.removeMob(mob.getEntityId()); //If no mobs are left, advance to the next wave if (dataStore.getMobs().isEmpty()) { if (wave == 5) { //Give XP bonus to online players for (String playerName : dataStore.getPlayers().keySet()) { Player msgPlayer = getServer().getPlayerExact(playerName); ZomboPlayerInfo msgPlayerInfo = dataStore.getPlayerByName(playerName); if (msgPlayer == null) { continue; } msgPlayerInfo.addXp(roundXpBonus); msgPlayer.sendMessage("Round complete bonus! [+" + + roundXpBonus + " XP]"); } } if (this.isAutoAdvance()) { advanceWave(); } else { //Tell players to ready up messagePlayers("Wave complete! /zready to continue."); } } else if (dataStore.getMobs().size() <= 3) { //Tell players that the wave is almost over messagePlayers(dataStore.getMobs().size() + " mobs remaining"); } }
[ "public void deathCheck(){\n if (boxman.ceiling && boxman.grounded){\n boxman.dead = true;\n }\n else {\n boxman.ceiling = false;\n boxman.grounded = false;\n }\n }", "void checkDeath();", "void death();", "public void death() {\n disablePowerUpsOnDeath();\n this.visible = false;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Applies the Heckbert's mediancut algorithm to partition the color space into maxcubes cubes. The centroids of each cube are are used to create a color table.
public void medianCut(int expectedColorNum) { int k; int num, width; Cube cubeA, cubeB; // Creates the first color cube partition = new Cube[expectedColorNum]; int numCubes = 0; Cube cube = new Cube(); int numColors = 0; for (int i=0; i < histogramSize; i++) { if (counts[i] != 0) { numColors++; cube.count = cube.count + counts[i]; } } cube.lower = 0; cube.upper = numColors-1; cube.level = 0; shrinkCube(cube); partition[numCubes++] = cube; //Partition the cubes until the expected number of cubes are reached, or // cannot further partition while (numCubes < expectedColorNum) { // Search the list of cubes for next cube to split, the lowest level cube int level = 255; int splitableCube = -1; for (k=0; k < numCubes; k++) { if (partition[k].lower != partition[k].upper && partition[k].level < level) { level = partition[k].level; splitableCube = k; } } // no more cubes to split if (splitableCube == -1) break; // Find longest dimension of this cube: 0 - red, 1 - green, 2 - blue cube = partition[splitableCube]; level = cube.level; // Weigted with luminosities int lr = 77 * (cube.rmax - cube.rmin); int lg = 150 * (cube.gmax - cube.gmin); int lb = 29 * (cube.bmax - cube.bmin); int longDimMask = 0; if (lr >= lg && lr >= lb) longDimMask = 0xFF0000; if (lg >= lr && lg >= lb) longDimMask = 0xFF00; if (lb >= lr && lb >= lg) longDimMask = 0xFF; // Sort along "longdim" quickSort(colors, cube.lower, cube.upper, longDimMask); // Find median int count = 0; int median = cube.lower; for (; median <= cube.upper - 1; median++) { if (count >= cube.count/2) break; count = count + counts[median]; } // Now split "cube" at the median and add the two new // cubes to the list of cubes. cubeA = new Cube(); cubeA.lower = cube.lower; cubeA.upper = median-1; cubeA.count = count; cubeA.level = cube.level + 1; shrinkCube(cubeA); partition[splitableCube] = cubeA; // add in old slot cubeB = new Cube(); cubeB.lower = median; cubeB.upper = cube.upper; cubeB.count = cube.count - count; cubeB.level = cube.level + 1; shrinkCube(cubeB); partition[numCubes++] = cubeB; // add in new slot */ } // creates the lookup table and the inverse mapping createLUT(numCubes); }
[ "Cube splitChannel(int splitChannel, int c0, int c1) {\n/* 294 */ if (this.min[splitChannel] == this.max[splitChannel])\n/* */ {\n/* 296 */ return null;\n/* */ }\n/* */ \n/* 299 */ if (this.count == 0)\n/* */ {\n/* 301 */ return null;\n/* */ ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
EXIBE O MENU NA TELA
public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.menu, menu); return super.onCreateOptionsMenu(menu); }
[ "private static void irMenuEstoque() {\n\t\t\n\t}", "public static void VypisMenu () {\n\t\t\n\t\tSystem.out.println(\"Menu:\");\n\t\tSystem.out.println(\"1. Scitani\");\n\t\tSystem.out.println(\"2. Odecitani\");\n\t\tSystem.out.println(\"3. Nasobeni\");\n\t\tSystem.out.println(\"4. Deleni\");\n\t\t\t\t\n\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public void onAttach(Activity activity) { super.onAttach(activity); }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates page scroll synchronously after measure and layout child views.
public void updateScrollSynchronously() { // onMeasure is needed to update child's measured width which is used in scroll calculation, // in case TaskView sizes has changed when being focused/unfocused. onMeasure(makeMeasureSpec(getMeasuredWidth(), EXACTLY), makeMeasureSpec(getMeasuredHeight(), EXACTLY)); onLayout(false /* changed */, getLeft(), getTop(), getRight(), getBottom()); updateMinAndMaxScrollX(); }
[ "@Override\n\tpublic void computeScroll() {\n\t\tif (scroller.computeScrollOffset()) {\n\t\t\tscrollTo(scroller.getCurrX(), scroller.getCurrY());\n\t\t\tpostInvalidate();// 刷新\n\t\t}\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tint off = mLayout.getMeasuredHeight() - mScrollView.getHeight();\n\t\t\tif (off >...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method sets the value of the database column OSOADATA.T_ACCEPTED_CUSTOMER_INFO.SECONDCONTACTTEL
public void setSecondcontacttel(String secondcontacttel) { this.secondcontacttel = secondcontacttel == null ? null : secondcontacttel.trim(); }
[ "public void setSecondarycontactphonenumber(java.lang.String param){\n \n this.localSecondarycontactphonenumber=param;\n \n\n }", "public void setSecondarycontactmobilenumber(java...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jRadioButton1 = new javax.swing.JRadioButton(); jRadioButton2 = new javax.swing.JRadioButton(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("EN-DE PROGRAM"); setBackground(new java.awt.Color(255, 204, 204)); jPanel1.setBackground(new java.awt.Color(255, 204, 204)); jRadioButton1.setText("Encrypt "); jRadioButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton1ActionPerformed(evt); } }); jRadioButton2.setText("Decrypt "); jRadioButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jRadioButton2ActionPerformed(evt); } }); jLabel2.setText("Enter Text:"); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); } }); jLabel1.setText("Choose (Encrypte OR Decrypt) :"); jLabel3.setText("Output:"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(36, 36, 36) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel2) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jRadioButton1) .addGap(107, 107, 107) .addComponent(jRadioButton2)) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 33, Short.MAX_VALUE)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(24, 24, 24) .addComponent(jLabel2) .addGap(18, 18, 18) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(31, 31, 31) .addComponent(jLabel1) .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jRadioButton1) .addComponent(jRadioButton2)) .addGap(23, 23, 23) .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(41, Short.MAX_VALUE)) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }
[ "public StForm() {\n initComponents();\n }", "public CineForm() {\n initComponents();\n }", "public javaform() {\n initComponents();\n }", "public EditDemographicForm() {\n initComponents();\n }", "public FightForm() {\n initComponents();\n }", "public For...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
.google.protobuf2.Any consensus_state = 2 [(.gogoproto.moretags) = "yaml:&92;"consensus_state&92;""];
public com.google.protobuf2.AnyOrBuilder getConsensusStateOrBuilder() { if (consensusStateBuilder_ != null) { return consensusStateBuilder_.getMessageOrBuilder(); } else { return consensusState_ == null ? com.google.protobuf2.Any.getDefaultInstance() : consensusState_; } }
[ "@SerializedName(\"state\")\n public abstract Optional<String> getState();", "@Test\n public void messageWithMultipleSpans_proto3() {\n messageWithMultipleSpans(SpanBytesEncoder.PROTO3);\n }", "com.google.protobuf.ByteString getStateMessageBytes();", "edu.kit.ipd.crowdcontrol.objectservice.proto.Exper...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get content type, eg: music,picture, vedio, vcard, etc.
public abstract int getType();
[ "public String getContentType() {\n try {\n URL url = getLocator().getURL();\n String urlFile = url.getFile();\n if (urlFile.endsWith(\".mov\")) return \"video.quicktime\"; else if (urlFile.endsWith(\".mpg\")) return \"video.mpeg\"; else if (urlFile.endsWith(\".avi\")) return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method returns the value of the database column user.update_time
public Date getUpdateTime() { return updateTime; }
[ "public java.sql.Timestamp getUpdateDate() {\n return dto.getUpdateDate();\n }", "public Date getLast_update_time() {\n return last_update_time;\n }", "public Timestamp getUpdateTimestamp() {\n return this.ojv_update_timestamp;\n }", "public Date getUpdatedTime() {\n return mUpd...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Processes requests for both HTTP GET and POST methods.
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet eliminarPiezaServlet</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet eliminarPiezaServlet at " + request.getContextPath() + "</h1>"); out.println("</body>"); out.println("</html>"); } }
[ "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n Enumeration<String> parameterNames = request.getParameterNames(); //checking for unappropriate parameters\r\n if (parameterNames.hasMoreEleme...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method to fetch the best price quote amongst a list of Service Providers for airlines
@RequestMapping(value = "/v1/air/") public ResponseEntity<Object> getAirlineQuotes(){ return ResponseEntity.ok().body( service.selectBestTripPlan(initializeAirlines(), "Dallas", "Miami")); }
[ "Product getLowestCurrentAvailablePrice(String productName);", "public interface PriceService {\n long getPrice(long orderId);\n\n List<String> getSupportedCurrencies();\n}", "double servicePrice();", "void getMarketPriceData();", "public static Product findMostExpensiveItem(Store store) {\r\n\t\t\r\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form PartsInstalled
public ManageInstallParts() throws ParseException, SQLException { initComponents(); setModal(true); setTitle("Manage Install Parts"); this.installTable.setModel(TableModel); TableModel.loadInstalled(); custNames = TableModel.getAllCustomerNames(); vehicleRegs = TableModel.getAllVehicleRegs(); for(int i =0; i<vehicleRegs.size();i++){ v = Database.getInstance().getAllVehiclesForPartsInstalled(vehicleRegs.get(i)); this.VehicleDetailsTable.setModel(vTableModel); for (Vehicle vehicle : v){ vTableModel.addRow(vehicle); } } for(int i =0; i<custNames.size();i++){ c = Database.getInstance().getCustomersWithNameForParts(custNames.get(i)); this.CustomerDetailsTable.setModel(cTableModel); for (Customer customer : c) { cTableModel.addRow(customer); } } DefaultTableCellRenderer leftRenderer = new DefaultTableCellRenderer(); leftRenderer.setHorizontalAlignment(DefaultTableCellRenderer.LEFT); installTable.getColumn("ID").setCellRenderer(leftRenderer); installTable.getColumn("ID").setMaxWidth(40); installTable.getColumn("Booking ID").setCellRenderer(leftRenderer); installTable.getColumn("Booking ID").setPreferredWidth(30); installTable.getColumn("Date Booked").setCellRenderer(leftRenderer); installTable.getColumn("Vehicle Registration").setCellRenderer(leftRenderer); installTable.getColumn("Customer Name").setCellRenderer(leftRenderer); installTable.getColumn("Customer Name").setMinWidth(100); installTable.getColumn("Part Name").setCellRenderer(leftRenderer); installTable.getColumn("Part Name").setMinWidth(100); installTable.getColumn("Quantity").setCellRenderer(leftRenderer); installTable.getColumn("Quantity").setPreferredWidth(20); installTable.getColumn("Date Installed").setCellRenderer(leftRenderer); installTable.getColumn("Waranty Expiry Date").setCellRenderer(leftRenderer); CustomerDetailsTable.getColumn("ID").setCellRenderer(leftRenderer); CustomerDetailsTable.getColumn("ID").setMaxWidth(30); CustomerDetailsTable.getColumn("Full Name").setMinWidth(150); CustomerDetailsTable.getColumn("Email Address").setMinWidth(200); VehicleDetailsTable.getColumn("Engine Size").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("CustomerID").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("WarrantyID").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("Current Mileage").setCellRenderer(leftRenderer); VehicleDetailsTable.getColumn("Model").setMaxWidth(50); VehicleDetailsTable.getColumn("Make").setMaxWidth(75); VehicleDetailsTable.getColumn("MOT Renewal Date").setMinWidth(100); VehicleDetailsTable.getColumn("Last Service Date").setMinWidth(100); VehicleDetailsTable.getColumn("Current Mileage").setMaxWidth(60); VehicleDetailsTable.getColumn("Registration No").setHeaderValue("Reg No."); VehicleDetailsTable.getColumn("Current Mileage").setHeaderValue("Mileage"); VehicleDetailsTable.getColumn("MOT Renewal Date").setHeaderValue("MOT Renew Date"); VehicleDetailsTable.getColumn("Last Service Date").setHeaderValue("Serviced Date"); }
[ "public void addNewPart(Part part) {\r\n\r\n part.setPartID(inventory.getCurrentPartID());\r\n inventory.iterateCurrentPartID();\r\n// partsTable.getItems().add(part);\r\n inventory.addPart(part);\r\n }", "@Override\n\tpublic abstract void createPartControl();", "private void a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Trigger a DAG Run
@POST @Path("/dags/{dag_id}/dagRuns/{dag_run_id}") @Consumes({ "application/json" }) @Produces({ "application/json" }) public DAGRun createDagRun(@PathParam("dag_id") String dagId, @PathParam("dag_run_id") String dagRunId, DAGRun daGRun) throws ApiException, ProcessingException;
[ "@Test\n public void trigger_batch_task() {\n job.configure();\n addBatchTask(\"runit\");\n addBatchTask(\"dontrunit\");\n configureBatchTrigger(job,task(\"runit\"));\n job.save();\n\n job.startBuild().waitUntilFinished().shouldSucceed();\n task(\"runit\").shouldE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Five parameters constructor to create a Survivor Object
public Survivor(String userName, int day, int hp, int energy, int food) { this.userName = userName; this.day = day; this.hp = hp; this.energy = energy; this.food = food; }
[ "public FourObjectContainer(Object object1, Object object2,Object object3, Object object4) {\r\n\tsuper();\r\n\t_object1 = object1;\r\n\t_object2 = object2;\r\n\t_object3 = object3;\r\n\t_object4 = object4;\r\n\t\r\n}", "public abstract T create(Object...params) throws VilException;", "public Burger(double pric...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Criando a View e preenchendo a lista
@NonNull @Override public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int i) { View itemLista = LayoutInflater.from(parent.getContext()).inflate(R.layout.adapter_produto, parent, false); return new MyViewHolder(itemLista); }
[ "public List <View> getItems() { return _items; }", "public abstract void mo3298a(View view, List<View> list);", "public GereVendasView() {\n this.opcoes = new ArrayList<String>();\n }", "private void initView()\n {\n mActiveGoodsViewAdapter.addItems((ArrayList<GoodsItem>) mMainDB.readAll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the object contained at the index within the LinkedList
public E get(int index) { if (index > size) throw new IndexOutOfBoundsException("You cannot get the object contained at index " + index +" because the largest index is" + (size-1) + "."); else return getNode(index).getObject(); }
[ "@Override\r\n\tpublic Object retrieve(int index) throws IndexOutOfBoundsException {\r\n\t\tif (isEmpty()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tNode current = head;\r\n\t\tObject temp = null;\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < index; i++) {\r\n\t\t\t\tcurrent = current.getNext();\r\n\t\t\t\t//Syst...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test Name: test_run_1 Description: Verify that once the update_watchgods_after_TCP_connection() function is called if neither input_1hWatchog_timestamp_table nor input_24hWatchog_timestamp_table contain only true values, neither Global_1h_Watchdog nor Global_24h_Watchdog are kicked. Verify also that 1hWatchog_timestamp_table and 24hWatchog_timestamp_table are not updated External variables TBV: Global_24h_Watchdog.millisecondsLeftUntilExpiration, Global_1h_Watchdog.millisecondsLeftUntilExpiration, TCPserver._1hWatchog_timestamp_table TCPserver._24hWatchog_timestamp_table Exceptions thrown: IOException, InterruptedException
@Test public void test_run_1() throws IOException, InterruptedException { double input_watchdog = 100 * global_watchdog_scale_factor; double expected_1h_Global_watchdog_readout = input_watchdog; double expected_24h_Global_watchdog_readout = input_watchdog; TCPserver.setComputing_time(input_watchdog * 1.5); boolean[] input_1hWatchog_timestamp_table = {true, false, false, false, false}; boolean[] input_24hWatchog_timestamp_table = {true, false, false, false, false}; boolean[] expected_1hWatchog_timestamp_table = {true, false, false, false, false}; boolean[] expected_24hWatchog_timestamp_table = {true, false, false, false, false}; for (int i = 1; i <= sensor_coordinates_array.length; i++) { sensor = new SensorImpl(i, new Point2D.Float(sensor_coordinates_array[i-1][0], sensor_coordinates_array[i-1][1]), softwareImageID, TCPserver.getMeasurements_limit()); sensor.setSensorState(SensorState.OPERATIONAL); sensor.setSensor_watchdog_scale_factor(global_watchdog_scale_factor); TCPserver.Server_Sensors_LIST = TCPserver.processing_engine.updateServerSensorList(sensor); TCPserver.processing_engine.saveSensorInfo(sensor, "sensorINITIALIZATION"); TCPserver.set_1hWatchog_Timestamp_tableID_value(input_1hWatchog_timestamp_table[i-1], sensor.getSensorID()-1); TCPserver.set_24hWatchog_Timestamp_tableID_value(input_24hWatchog_timestamp_table[i-1], sensor.getSensorID()-1); } mockTCPserverTest.getServerSocket().bind(new java.net.InetSocketAddress(port_1)); mockTCPserverTest.startServer(mockTCPserverTest.getServerSocket()); mockServerThread.start(); tempClientSocket_1 = new Socket(serverHostName, port_1); when(mockTCPclient.getClientSocket()).thenReturn(tempClientSocket_1); obj_out_stream = new ObjectOutputStream(mockTCPclient.getClientSocket().getOutputStream()); when(mockClientManager.getOutputStream()).thenReturn(obj_out_stream); Thread.sleep(20); comp_engine_1 = new ComputeEngine_Runnable(mock_CER_ClientSocket, global_watchdog_scale_factor, true); Global_1h_Watchdog.getInstance().setTimeLeftBeforeExpiration(input_watchdog); Global_24h_Watchdog.getInstance().setTimeLeftBeforeExpiration(input_watchdog); Global_1h_Watchdog.getInstance().setEnabled(true); Global_24h_Watchdog.getInstance().setEnabled(true); comp_engine_1.update_watchgods_after_TCP_connection(input_1hWatchog_timestamp_table, input_24hWatchog_timestamp_table, sensor); assertEquals(expected_1h_Global_watchdog_readout, Global_1h_Watchdog.getInstance().getTimeLeftBeforeExpiration(), 0.1); assertEquals(expected_24h_Global_watchdog_readout, Global_24h_Watchdog.getInstance().getTimeLeftBeforeExpiration(), 0.1); for (int i = 0; i < input_1hWatchog_timestamp_table.length; i++) { assertEquals(expected_1hWatchog_timestamp_table[i], TCPserver.get_1hWatchog_timestamp_table().get()[i]); assertEquals(expected_24hWatchog_timestamp_table[i], TCPserver.get_24hWatchog_timestamp_table().get()[i]); } }
[ "@Test(timeout = 4000)\n public void test017() throws Throwable {\n FBConnectionProperties fBConnectionProperties0 = new FBConnectionProperties();\n assertNotNull(fBConnectionProperties0);\n assertNull(fBConnectionProperties0.getTpbMapping());\n assertNull(fBConnectionProperties0.getType());\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns true if RequiredDerivedKey element is present under SecureConversationToken
boolean isRequireDerivedKeys();
[ "boolean hasCorrelationKey();", "boolean hasPrivateKeyValidTo();", "boolean hasPrivateKeyValidFrom();", "boolean hasSenderIdAuthSecretV2();", "public boolean hasCorrelationKey() {\n\t\t\t\treturn ((bitField0_ & 0x00000400) != 0);\n\t\t\t}", "public boolean hasMyKey() {\n return ((bitField0_ & 0x00000...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: a
public final void mo9277a(boolean z) { if (z) { C2624k.this.f8420c.mo106015a(C2624k.f8415a, false, r0); } else { C2624k.this.f8420c.mo106004a(C2624k.f8415a, r0); } }
[ "public interface C3511a {\n /* renamed from: a */\n void mo29057a(int i);\n }", "interface C4511c {\n /* renamed from: a */\n void mo29775a();\n }", "public interface ans {\n /* renamed from: a */\n void mo1174a();\n}", "public interface C24712af {\n /* renamed from...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ renamed from: e
public abstract void mo951e(int i);
[ "@Override protected void process (int e) {\n\t\t}", "@Override\n\tpublic void eee() {\n\t\t\n\t}", "public void e() throws c {\n for (i a2 : this.f13971e) {\n a2.e();\n }\n }", "@Override\n\tpublic void visitEnemigo(Enemigo e) {\n\n\t}", "public int e() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a linked list.
@Override public LinkedList<Type> getLinkedList(){ LinkedList<Type> tmpList = new LinkedList<>(); for(DoublyLinkedNode<Type> tmp = head ; tmp != null ; tmp = tmp.nextNode){ tmpList.add(tmp.data); } return tmpList; }
[ "public LinkedList getLinkedList(){\n\t\treturn linkedlist;\n\t}", "OneWayListNode<T> next();", "public LinkedList<LinearNode<Performance>> getLinkedList() {\n\t\treturn linkedList;\n\t}", "private static Node createList() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tNode head = null;\r\n\t\tNode previo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__Factor__Group_1_0_1__1" $ANTLR start "rule__Factor__Group_1_0_1__1__Impl" InternalRestControllerGeneration.g:3156:1: rule__Factor__Group_1_0_1__1__Impl : ( () ) ;
public final void rule__Factor__Group_1_0_1__1__Impl() throws RecognitionException { int stackSize = keepStackSize(); try { // InternalRestControllerGeneration.g:3160:1: ( ( () ) ) // InternalRestControllerGeneration.g:3161:1: ( () ) { // InternalRestControllerGeneration.g:3161:1: ( () ) // InternalRestControllerGeneration.g:3162:2: () { before(grammarAccess.getFactorAccess().getDivLeftAction_1_0_1_1()); // InternalRestControllerGeneration.g:3163:2: () // InternalRestControllerGeneration.g:3163:3: { } after(grammarAccess.getFactorAccess().getDivLeftAction_1_0_1_1()); } } } finally { restoreStackSize(stackSize); } return ; }
[ "public final void rule__GrammarRule__Group__1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalLpp.g:2176:1: ( rule__GrammarRule__Group__1__Impl )\r\n // InternalLpp.g:2177:2: rule__GrammarRule__Group__1__Impl\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Con anonymous inner class
@Override public void handle(ActionEvent event) { mensajeBt.setText("Hola " + textfield1.getText() + " " + textfield2.getText()); }
[ "public void makeInner(){\n\t\tMyInner in = new MyInner();\t\t\t// DNC if surrounding method is static \n\t\t\t\t\t\t\t\t\t\t\t// 19: error: non-static variable this cannot be referenced from a static context \n\t\tin.seeOuter();\n\t}", "@Override\n\tpublic void visitInnerClass(InnerClass obj) {\n\t\t\n\t}", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inflate the layout for this fragment
@Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_records, container, false); ButterKnife.bind(this, view); List<Record> records = new ArrayList<>(); records.add(new Record("Patient Problem: Fever", "Hospital: AIIMS", "Department: Department of Pediatrics")); records.add(new Record("Patient Problem: Fever", "Hospital: AIIMS", "Department: Department of Pediatrics")); RecordsAdapter adapter = new RecordsAdapter(records); RecyclerView recyclerView = view.findViewById(R.id.recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); recyclerView.setAdapter(adapter); return view; }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.movie_statistic_layout, parent, false);\n }", "@Override\n\tprotected View initView(LayoutInflater inflate...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return all of the parameters passed in the request to the session
public static void addRequestParametersToSession(HttpSession sess, HttpServletRequest req, String name) { sess.setAttribute(name, req.getParameterMap() .entrySet() .stream() .collect(Collectors.toMap(Map.Entry::getKey, v -> v.getValue()[0]))); }
[ "@Override\n\tpublic Map<String, String[]> getParameterMap() {\n\t\treturn request.getParameterMap();\n\t}", "protected String[] getValuesFromRequest() \n\t{\n\t\treturn this.context.getRequest().getParameterValues(this.getUIID());\n\t}", "String getParameterValues();", "public Vector getRequestParameterNames...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Removes the ith "initparam" element
public void removeInitParam(int i) { synchronized (monitor()) { check_orphaned(); get_store().remove_element(INITPARAM$10, i); } }
[ "@Override\r\n\tpublic void removeInitParameter(String paramString) {\n\t\t\r\n\t}", "public void removeInputParam(InputType it)\n {\n inputParams.remove(it.token);\n }", "public void removeSearchParam(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns collection of leasing after applying transaction.
public List<LeaseInfo> leases() { return leases; }
[ "public ArrayList<Lease> getLeases(){\r\n return leases;\r\n }", "public LinkedHashSet<Transaction> get_Transactions(){\n return this.transactions;\n }", "public List<Transaction> getValidatedOrphans() {\n return Collections.unmodifiableList(addedOrphans);\n }", "public static Tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Opens the birthday statistics.
@FXML private void handleShowBirthdayStatistics() { mainController.showBirthdayStatistics(); }
[ "public birthday() {\n initComponents();\n }", "public java.util.Date getBirthday() {\n\t\treturn _vFile.getBirthday();\n\t}", "public java.util.Calendar getBirthday() {\r\n return birthday;\r\n }", "public void testTotalBirths () {\n FileResource fr = new FileResource(\"data/yob201...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method generated by IntelliJ IDEA GUI Designer >>> IMPORTANT!! <<< DO NOT edit this method OR call it in your code!
private void $$$setupUI$$$() { final JPanel panel2 = new JPanel(); panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); panel1 = new JPanel(); panel1.setLayout(new GridLayoutManager(6, 3, new Insets(0, 0, 0, 0), -1, -1)); panel1.setBackground(new Color(-16777216)); panel2.add(panel1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); final JLabel label1 = new JLabel(); label1.setForeground(new Color(-13575640)); label1.setText("Width:"); panel1.add(label1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label2 = new JLabel(); label2.setForeground(new Color(-13575640)); label2.setText("Heidth:"); panel1.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label3 = new JLabel(); label3.setForeground(new Color(-13575640)); label3.setText("Setting"); panel1.add(label3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); textField2 = new JTextField(); textField2.setBackground(new Color(-2695207)); textField2.setText(""); panel1.add(textField2, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); final Spacer spacer1 = new Spacer(); panel1.add(spacer1, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); final Spacer spacer2 = new Spacer(); panel1.add(spacer2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); backButton = new JButton(); backButton.setBackground(new Color(-16777216)); backButton.setForeground(new Color(-13575640)); backButton.setText("Back"); panel1.add(backButton, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); final JLabel label4 = new JLabel(); label4.setForeground(new Color(-13575640)); label4.setText("Length snake:"); panel1.add(label4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); textField1 = new JTextField(); textField1.setBackground(new Color(-2695207)); panel1.add(textField1, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); length = new JTextField(); length.setBackground(new Color(-2695207)); panel1.add(length, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); speedText = new JTextField(); speedText.setBackground(new Color(-2695207)); panel1.add(speedText, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); labelSpeed = new JLabel(); labelSpeed.setForeground(new Color(-13575640)); labelSpeed.setText("Speed snake:"); panel1.add(labelSpeed, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); }
[ "@Override\n\tprotected void UpdateUI() {\n\t}", "@Override\n\tprotected void onGuiEvent(GuiEvent arg0) {\n\t\t\n\t}", "@Override\n\t\t\tprotected void updateUI() {\n\t\t\t\tsuper.updateUI();\n\t\t\t}", "private void $$$setupUI$$$() {\n MyPanel = new JPanel();\n MyPanel.setLayout(new com.intelli...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the Month component of the specified time instant. If the new month has less total days than the specified day of the month, this value is coerced to the nearest sane value. e.g. 0731 to month 6 = 0630 0331 to month 2 = 0228 or 0229 depending
public long set(long instant, int month) { FieldUtils.verifyValueBounds(this, month, MIN, iMax); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[74]++; CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[75]++; // int thisYear = iChronology.getYear(instant); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[76]++; // int thisDom = iChronology.getDayOfMonth(instant, thisYear); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[77]++; int maxDom = iChronology.getDaysInYearMonth(thisYear, month); CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[78]++; int CodeCoverConditionCoverageHelper_C19; if ((((((CodeCoverConditionCoverageHelper_C19 = 0) == 0) || true) && ( (((CodeCoverConditionCoverageHelper_C19 |= (2)) == 0 || true) && ((thisDom > maxDom) && ((CodeCoverConditionCoverageHelper_C19 |= (1)) == 0 || true))) )) && (CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.conditionCounters[19].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C19, 1) || true)) || (CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.conditionCounters[19].incrementCounterOfBitMask(CodeCoverConditionCoverageHelper_C19, 1) && false)) { CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.branches[35]++; // Quietly force DOM to nearest sane value. thisDom = maxDom; CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.statements[79]++; } else { CodeCoverCoverageCounter$2bnv4ehm3ee7lgptormg6y6ntkpy9wm764vwmt9vxo5sspq8asc4h.branches[36]++;} // Return newly calculated millis value return iChronology.getYearMonthDayMillis(thisYear, month, thisDom) + iChronology.getMillisOfDay(instant); }
[ "public void setMonth (int month) {\n\tcheckWidget ();\n\tSYSTEMTIME systime = new SYSTEMTIME ();\n\tint msg = (style & SWT.CALENDAR) != 0 ? OS.MCM_GETCURSEL : OS.DTM_GETSYSTEMTIME;\n\tOS.SendMessage (handle, msg, 0, systime);\n\tmsg = (style & SWT.CALENDAR) != 0 ? OS.MCM_SETCURSEL : OS.DTM_SETSYSTEMTIME;\n\tsystim...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method attempts to connect to/create a new database. Creates an initial table with 10 columns AJ after db connection.
public static void createDB(String dbName) { Connection conn = null; Statement stmt = null; //sql statement to create a table with 10 columns to match the csv. String sql = "CREATE TABLE records (" + "A TEXT NOT NULL," + "B TEXT NOT NULL," + "C TEXT NOT NULL," + "D TEXT NOT NULL," + "E TEXT NOT NULL," + "F TEXT NOT NULL," + "G TEXT NOT NULL," + "H TEXT NOT NULL," + "I TEXT NOT NULL," + "J TEXT NOT NULL)"; //if dbName isn't already a file if (!alreadyExists(dbName)) { //Check for driver try { Class.forName("org.sqlite.JDBC"); } catch (ClassNotFoundException e) { e.printStackTrace(); } //connect to/create the db try{ //creates new db on first connection attempt conn = DriverManager.getConnection("jdbc:sqlite:" + dbName); System.out.println("Database Connection Successful"); //if the connection is established create the table if (conn != null) { try { stmt = conn.createStatement(); stmt.executeUpdate(sql); System.out.println("Table created"); } catch (SQLException sqlException) { sqlException.printStackTrace(); } finally { DbUtils.closeQuietly(stmt); DbUtils.closeQuietly(conn); } } } catch (Exception e) { System.err.println(e.getClass().getName() + ": " + e.getMessage()); System.exit(0); } } else { System.out.println("Database File Already Exists"); } }
[ "public void createDatabase() {\n\t\ttry {\n\t\t\tConnection con = DriverManager.getConnection(url);\n\t\t\tcon.setAutoCommit(false);\n\t\t\tStatement stm = con.createStatement();\n\t\t\tcreateUserTable(stm);\n\t\t\tcreateSignatureTable(stm);\n\t\t\tcreateUserSignatureTable(stm);\n\t\t\tcreateFieldTable(stm);\t\n\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers a mouse release on the gameboard
@Override public void mouseReleased(MouseEvent e) { // Mouse was released (user clicked) addPoint(e); }
[ "protected void mouseReleasedAction()\r\n\t{\r\n\t\t//Make a move described by the mouse movement between press and release\r\n\t\t//Not implemented in Connect 4, since only mouseDownX is required to play this.\r\n\t\t/*\r\n\t\tboard.makeMove(mouseDownX,mouseDownY,mouseUpX,mouseUpY,0,0,getSize().width,getSize().hei...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new 'CompanyServiceBeanConfigurationException' instance with the given message.
public CompanyServiceBeanConfigurationException(String message) { super(message); }
[ "public SearchBuilderConfigurationException(String message) {\r\n super(message);\r\n }", "public LoggerConfigurationException(String message)\r\n {\r\n super(message);\r\n }", "public InvalidConfigurationException(String msg) {\r\n super(msg);\r\n }", "public InvalidConfigExce...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ERROR HANDLING:nok DOC:nok TEST:nok
public void setArtistId(String key, String value) { Object obj = findEntry(this.currentEntryId); if(obj instanceof Artist) { ((Artist) obj).getArtistIdMap().put(key, value); calcResolvBaseMaps(key); } }
[ "@Override\n public void fail() {\n }", "private void fail(String out) {\r\n gui.trace(\"Fehler: \" + out);\r\n answer(ERROR);\r\n closeServer();\r\n }", "@Override\n public void fail(int err, String reason, String result) {\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a single entitlement template Permissions Needed: TEMPLATE_ADMIN or ACHIEVEMENTS_ADMIN
public ItemTemplateResource getEntitlementTemplate(String id) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing the required parameter 'id' when calling getEntitlementTemplate"); } // create path and map variables String localVarPath = "/entitlements/templates/{id}" .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); // query params List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { "oauth2_client_credentials_grant", "oauth2_password_grant" }; GenericType<ItemTemplateResource> localVarReturnType = new GenericType<ItemTemplateResource>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); }
[ "public String GetContextRequiredPermission(String context);", "@Test\n public void testGetAllWithPermissionsForPriviligedUser() {\n List<VmTemplate> result = dao.getAll(PRIVILEGED_USER_ID, true, VmEntityType.TEMPLATE);\n\n assertNotNull(result);\n assertEquals(NUMBER_OF_TEMPLATES_FOR_PRIV...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Used when the statement is an 'if' statement.
R visitStmt(Stmt.If stmt);
[ "ifStmt getIfStatement();", "@Override\n\tpublic void enterIf_statement(BagelParser.If_statementContext ctx) {\n\n\t\tsuper.enterIf_statement(ctx);\n\t}", "private Conditional ifStatement () {\n match(If);\n match(RightParen);\n\n Expression e = expression();\n\n match(LeftParen);\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
doesn't need to do anything as of yet simply a static view
public interface AboutView { }
[ "public abstract View mo76895a();", "public abstract View mo24477a();", "private void intiViews() {\n }", "protected abstract ViewType createView();", "public void displayFirstView();", "private void viewApplication() {\n\t\t\r\n\t}", "protected void setupView() {}", "@GetMapping(\"/static\")\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ access modifiers changed from: private
public /* synthetic */ void lambda$fileDidFailedLoad$6(String str, int i, int i2) { ImageLoader.this.fileDidFailedLoad(str, i); NotificationCenter.getInstance(i2).postNotificationName(NotificationCenter.fileLoadFailed, str, Integer.valueOf(i)); }
[ "@Override\n }", "protected void method_5557() {}", "@Override\n public void extornar() {\n \n }", "@Override\r\n public void publicando() {\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "private InternalReflect() {\n\t\t\t// do nothing\n\t\t}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method ensures that aliquots that were shipped to the NA Lab are correctly indicated in Acquire.
public void migrateShippedStatus() { /* * Get the specimen labels for all the specimen/aliquots that have been * added to a shipment form. */ CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<String> criteria = cb.createQuery(String.class); Root<NaLabSample> root = criteria.from(NaLabSample.class); criteria.select(root.get(NaLabSample_.sampleId)); List<String> labels = em.createQuery(criteria).getResultList(); /* * Use the labels to get a list of caTissue specimenIds that correspond */ CriteriaBuilder caTissueCb = caTissueEm.getCriteriaBuilder(); CriteriaQuery<Long> specimenCriteria = caTissueCb.createQuery(Long.class); Root<Specimen> specimenRoot = specimenCriteria.from(Specimen.class); specimenCriteria.select(specimenRoot.<Long> get("id")); specimenCriteria.where(specimenRoot.<String> get("label").in(labels)); List<Long> caTissueIds = caTissueEm.createQuery(specimenCriteria).getResultList(); /* * Use the list of specimenIds to get the AliquotAnnotations that * correspond, using the EntityMap to make the connection */ CriteriaQuery<AliquotAnnotation> aliquotCriteria = cb.createQuery(AliquotAnnotation.class); Root<AliquotAnnotation> aliquotRoot = aliquotCriteria.from(AliquotAnnotation.class); Root<EntityMap> mapRoot = aliquotCriteria.from(EntityMap.class); aliquotCriteria.select(aliquotRoot); /* * Start building the Predicate by matching AliquotAnnotation with EntityMap */ Predicate where = cb.equal(mapRoot.get(EntityMap_.id), aliquotRoot.get(AliquotAnnotation_.entityId)); /* * Restrict to the EntityMap instances that represent the specimen in our * list */ Predicate mapWhere = cb.and(cb.equal(mapRoot.get(EntityMap_.entityName), "edu.wustl.catissuecore.domain.Specimen"), cb.equal( mapRoot.get(EntityMap_.caTissue), CaTissueInstance.TCRB), mapRoot .get(EntityMap_.entityId).in(caTissueIds)); /* * Add the combined restriction to the criteria */ aliquotCriteria.where(where, mapWhere); /* * Get the results */ List<AliquotAnnotation> aliquots = em.createQuery(aliquotCriteria).getResultList(); /* * Update the aliquots to mark them as shipped to NA Lab */ for (AliquotAnnotation annotation : aliquots) { annotation.getStatus().add(SpecimenStatus.SHIPPED_NA_LAB); } this.messages.info("Shipped to NA Lab migrated to aliquots"); }
[ "private void checkRep() {\n Set<BookCopy> intersection = new HashSet<>(inLibrary);\n intersection.retainAll(checkedOut);\n assert(intersection.isEmpty());\n }", "@Test\n public void requirementWithApplicabilityRangeIsNotInitializedAgainstNonApplicableInventory()\n throws Excepti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
lets us neatly enter a map from the overworld in a location that makes sense without storing data
public abstract void enterFromOverworld();
[ "public void setMapLocation(Point mapLocation);", "@Override\n\tpublic void enterMap() {\n\n\t}", "public void showInMap(){\n Utils.handleGeoCoordinates(this,\n new fr.free.nrw.commons.location.LatLng(cameraPosition.target.getLatitude(),\n cameraPosition.target.getLongitude(), 0...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Inject the Main Controller to be able to call function on it when picking a guest
public void injectMainController(Controller controller) { this.controller = controller; }
[ "public MainController(){\n \n }", "private MainScreenController()\n {\n //instantiate the repo object's\n mLocalRepo = LocalRepository.getLocalRepository();\n mRemoteRepo = new RemoteRepository(this);\n }", "public void injectMainController(MainController mc) {\r\n\t\tthis....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Empty constructor only used by JAXB.
private DefaultRecordType() { parent = null; name = null; memberTypes = Collections.emptyMap(); }
[ "private XML()\n {\n }", "private GxmlElement()\n {\n }", "private XmlUtil() {\n // do nothing\n }", "private RootElement() {\n\t}", "public ConstructorEmpty() {}", "private XmlPackage() {}", "private XMLSchemaValidator()\n {\n // Does nothing.\n }", "@SuppressWarning...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A SessionFactory is set up once for an application!
static void initialize() { final StandardServiceRegistry registry = new StandardServiceRegistryBuilder() .configure() // configures settings from hibernate.cfg.xml .build(); try { sessionFactory = new MetadataSources( registry ).buildMetadata().buildSessionFactory(); } catch (Exception e) { System.out.println(sessionFactory); System.err.println("Exception "+e); StandardServiceRegistryBuilder.destroy( registry ); } }
[ "public void initSessionFactory(){\n if (sessionFactory == null) {\n // loads configuration and mappings\n Configuration configuration = new Configuration().configure();\n // builds a session factory from the service registry\n sessionFactory = configuration.buildS...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
optional int32 class_fq_name = 2;
public boolean hasClassFqName() { return ((bitField0_ & 0x00000002) == 0x00000002); }
[ "public int getClassFqName() {\n return classFqName_;\n }", "Integer getClassIdexam();", "public static String abbrevFQClassname(String fqClassname)\r\n {\r\n int index = fqClassname.lastIndexOf('.') + 1;\r\n if (index < 0 || index >= fqClassname.length())\r\n {\r\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/I used the onWakeupWord() method as a test for the gaze aversion and other features. You can delete this if need be. Ese
@Override public void onWakeupWord(String wakeupWord, int direction) { face.changeGazeTo(Gaze.PERFORM_ALL); //END }
[ "private void computerTurn() {\n\n String wordFragment = ghostTextView.getText().toString();\n if( wordFragment.length() >= 4 && dictionary.isWord(wordFragment) ){\n USER_WON = false;\n endGame(\"You Looser :( [Valid Word]\");\n }\n else{\n Log.d(\"TAG\",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Crea el directorio o verifica que exita el mismo
private static void crearDirectorio(String dirc){ //Creacion del directorio y del achivo File dir = new File(dirc);//Primero creamos el directorio if (!dir.exists()) { dir.mkdirs(); } }
[ "public void createDir(){\n /**\n * Hace un Directorio LLamado LinkedDB en la misma ruta del Jar.\n * Para luego crear los directorios ahi mismo.\n * Si retorna valor true al hacer el Directorio envia unos mensajes.\n */\n new File(\"LinkedDB\").mkdir();\n File d...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Enregistrement de processus
public Processus[] registerProcessus(int ptr, Processus[] listeProcessus ,String nomProcessus , int dureeProcessus , int prioriteProcessus, int tempArrivee){ Processus p1 = new Processus (nomProcessus, tempArrivee ,dureeProcessus, prioriteProcessus); listeProcessus[ptr] = p1; ptr++; return listeProcessus; }
[ "public void registrarSalida(){\r\n \r\n }", "public void guar()\r\n {\r\n RequestContext ctx = RequestContext.getCurrentInstance(); //Capturo el contexto de la página\r\n try\r\n {\r\n this.objeTipoEsta.setEstaTipoEsta(1);\r\n FCDETipo.create(this.objeTipoEsta)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Nullable @Override protected Class<?>[] getRootConfigClasses() { return new Class[] {Application.class, JPAConfig.class}; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Disables the button and attributes a point to the player
@Override public void actionPerformed(ActionEvent ae) { JButton button = (JButton) ae.getSource(); button.setEnabled(false); mGameInfo.mScore++; mGameInfo.updateInfo(); }
[ "public synchronized void disablePlayer() {\n _isActive = false;\n }", "public abstract void onDisable(Player p);", "public void disableButtons() {\n \tpokemon1.setDisable(true);\n \tpokemon2.setDisable(true);\n \tpokemon3.setDisable(true);\n \tpokemon4.setDisable(true);\n \tpokemon5.se...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create an aliased public.login_ip table reference
public LoginIp(String alias) { this(DSL.name(alias), LOGIN_IP); }
[ "public void setIpAddress(String tmp) {\n this.ipAddress = tmp;\n }", "public void setIp(String tmp) {\n this.ip = tmp;\n }", "void generateIPfromNetworkPrefix() {\n\t\tfor(int i=0; i<counterInitAddresses; i++) {\n\t\t\tNetworkPrefixIPformat[i] = processIP(NetworkPrefixBinary[i]); \n\t\t}\n\t}", "publ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Auto generated getter method
public boolean getShowStatsToStudent(){ return localShowStatsToStudent; }
[ "public MethodDoc getGetter()\r\n {\r\n return m_jvdGetter;\r\n }", "public long getGetter() {\n return getter_;\n }", "public T get() {\n return value;\n }", "public abstract M get();", "@Override\n \tpublic String get() {\n \t\treturn null;\n \t}", "public Object get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the element to the beginning of the free list. The caller of this method needs to synchronize on freeQueueLock
private void addToFreeList(TimerCommand tc) { // Add command to the beginning of the free list. tc.next = freeQueueHead; freeQueueHead = tc; // Null out user object references (so the VM does not hold them). tc.context = null; tc.callbackObject = null; }
[ "public void addFirst(T item) {\n if (isFull()) {\n resize(capacity * REFACTOR);\n }\n items[nextFirst] = item;\n nextFirst--;\n // check after minus\n nextFirst = checkNext(nextFirst);\n size++;\n\n }", "public void enqueue(Object elem){\n inser...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Test with writeQuorum = majority
@Override public void executeTest() throws Exception { banner("Test with writeQuorum = majority"); ODatabaseDocument dbServer1 = getDatabase(0); // changing configuration: readQuorum=2, autoDeploy=false System.out.print("\nChanging configuration (autoDeploy=false)..."); ODocument cfg = null; ServerRun server = serverInstance.get(2); ODistributedPlugin manager = (ODistributedPlugin) server.getServerInstance().getDistributedManager(); ODistributedConfiguration databaseConfiguration = manager.getDatabaseConfiguration(getDatabaseName()); cfg = databaseConfiguration.getDocument(); System.out.println("\nConfiguration updated."); // inserting record r1 and checking consistency on all the servers try { dbServer1.activateOnCurrentThread(); System.out.print("Inserting record r1..."); new ODocument("Person") .fields("id", "R001", "firstName", "Luke", "lastName", "Skywalker") .save(); System.out.println("Done."); } catch (Exception e) { e.printStackTrace(); fail("Record r1 not inserted!."); } finally { dbServer1.close(); } waitForInsertedRecordPropagation("R001"); System.out.print("Checking consistency for record r1..."); ODocument r1onServer1 = retrieveRecord(serverInstance.get(0), "R001"); ODocument r1onServer2 = retrieveRecord(serverInstance.get(1), "R001"); ODocument r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); final ORecordId r1Rid = (ORecordId) r1onServer1.getIdentity(); assertEquals((Integer) r1onServer1.field("@version"), (Integer) r1onServer2.field("@version")); assertEquals((String) r1onServer1.field("id"), (String) r1onServer2.field("id")); assertEquals((String) r1onServer1.field("firstName"), (String) r1onServer2.field("firstName")); assertEquals((String) r1onServer1.field("lastName"), (String) r1onServer2.field("lastName")); assertEquals((Integer) r1onServer2.field("@version"), (Integer) r1onServer3.field("@version")); assertEquals((String) r1onServer2.field("id"), (String) r1onServer3.field("id")); assertEquals((String) r1onServer2.field("firstName"), (String) r1onServer3.field("firstName")); assertEquals((String) r1onServer2.field("lastName"), (String) r1onServer3.field("lastName")); System.out.println("\tDone."); // initial version of the record r1 int initialVersion = r1onServer1.field("@version"); // isolating server3 System.out.println("Network fault on server3.\n"); simulateServerFault(serverInstance.get(2), "net-fault"); assertFalse(serverInstance.get(2).isActive()); // updating r1 in r1* on server3 banner("Updating r1* on server3 (isolated from the the cluster)"); ODatabaseDocument dbServer3 = null; try { r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); dbServer3 = getDatabase(2); r1onServer3.field("firstName", "Darth"); r1onServer3.field("lastName", "Vader"); r1onServer3.save(); System.out.println(r1onServer3.getRecord().toString()); } catch (Exception e) { e.printStackTrace(); fail(); } finally { if (dbServer3 != null) dbServer3.close(); } // restarting server3 serverInstance .get(2) .startServer(getDistributedServerConfiguration(serverInstance.get(SERVERS - 1))); System.out.println("Server 3 restarted."); assertTrue(serverInstance.get(2).isActive()); // reading r1* on server3 dbServer3 = getDatabase(2); try { r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); } catch (Exception e) { e.printStackTrace(); } finally { dbServer3.activateOnCurrentThread(); dbServer3.close(); } // r1 was not modified both on server1 and server2 r1onServer1 = retrieveRecord(serverInstance.get(0), "R001"); r1onServer2 = retrieveRecord(serverInstance.get(1), "R001"); assertEquals(1, (int) r1onServer1.field("@version")); assertEquals("R001", (String) r1onServer1.field("id")); assertEquals("Luke", (String) r1onServer1.field("firstName")); assertEquals("Skywalker", (String) r1onServer1.field("lastName")); assertEquals((Integer) r1onServer1.field("@version"), (Integer) r1onServer2.field("@version")); assertEquals((String) r1onServer1.field("id"), r1onServer2.field("id")); assertEquals((String) r1onServer1.field("firstName"), r1onServer2.field("firstName")); assertEquals((String) r1onServer1.field("lastName"), r1onServer2.field("lastName")); // checking we have different values for r1* on server3 assertEquals("R001", (String) r1onServer3.field("id")); assertEquals("Darth", (String) r1onServer3.field("firstName")); assertEquals("Vader", (String) r1onServer3.field("lastName")); assertEquals(initialVersion + 1, (int) r1onServer3.field("@version")); // shutdown server1 System.out.println("Network fault on server1.\n"); simulateServerFault(serverInstance.get(0), "net-fault"); assertFalse(serverInstance.get(0).isActive()); // delete request on server3 for r1* dbServer3 = getDatabase(2); try { dbServer3.command(new OCommandSQL("delete from Person where @rid=#27:0")).execute(); } catch (Exception e) { System.out.println(e.getMessage()); } finally { dbServer3.close(); } // restarting server1 serverInstance.get(0).startServer(getDistributedServerConfiguration(serverInstance.get(0))); System.out.println("Server 1 restarted."); assertTrue(serverInstance.get(0).isActive()); // r1 is still present both on server1 and server2 r1onServer1 = retrieveRecord(serverInstance.get(0), "R001"); r1onServer2 = retrieveRecord(serverInstance.get(1), "R001"); assertEquals(1, (int) r1onServer1.field("@version")); assertEquals("R001", (String) r1onServer1.field("id")); assertEquals("Luke", (String) r1onServer1.field("firstName")); assertEquals("Skywalker", (String) r1onServer1.field("lastName")); assertEquals(r1onServer1.field("@version"), r1onServer2.field("@version")); assertEquals(r1onServer1.field("id"), r1onServer2.field("id")); assertEquals(r1onServer1.field("firstName"), r1onServer2.field("firstName")); assertEquals(r1onServer1.field("lastName"), r1onServer2.field("lastName")); // r1* is still present on server3 r1onServer3 = retrieveRecord(serverInstance.get(2), "R001"); assertEquals(2, (int) r1onServer3.field("@version")); assertEquals("R001", (String) r1onServer3.field("id")); assertEquals("Darth", (String) r1onServer3.field("firstName")); assertEquals("Vader", (String) r1onServer3.field("lastName")); // delete request on server1 for r1 dbServer1 = getDatabase(0); try { Integer result = dbServer1.command(new OCommandSQL("delete from " + r1Rid)).execute(); } catch (Exception e) { e.printStackTrace(); } finally { dbServer1.close(); } // r1 is no more present neither on server1, server2 nor server3 r1onServer1 = retrieveRecord( serverInstance.get(0), "R001", true, new OCallable<ODocument, ODocument>() { @Override public ODocument call(ODocument doc) { assertEquals(MISSING_DOCUMENT, doc); return null; } }); r1onServer2 = retrieveRecord( serverInstance.get(1), "R001", true, new OCallable<ODocument, ODocument>() { @Override public ODocument call(ODocument doc) { assertEquals(MISSING_DOCUMENT, doc); return null; } }); r1onServer3 = retrieveRecord( serverInstance.get(2), "R001", true, new OCallable<ODocument, ODocument>() { @Override public ODocument call(ODocument doc) { assertEquals(MISSING_DOCUMENT, doc); return null; } }); }
[ "public void testStaleMasterNotHijackingMajority() throws Exception {\n final List<String> nodes = internalCluster().startNodes(3, Settings.builder()\n .put(LeaderChecker.LEADER_CHECK_TIMEOUT_SETTING.getKey(), \"1s\")\n .put(Coordinator.PUBLISH_TIMEOUT_SETTING.getKey(), \"1s\")\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
repeated .dstore.engine.Message message = 3;
public java.util.List<? extends io.dstore.engine.MessageOrBuilder> getMessageOrBuilderList() { if (messageBuilder_ != null) { return messageBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(message_); } }
[ "void mo31256a(Message message);", "Recorder setMessage(String message);", "public void d(Message message) {\n if (message != null) {\n int i = 1;\n if (message.arg1 >= 1) {\n i = message.arg1;\n }\n this.g = i;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override protected void onPostExecute(String result) { super.onPostExecute(result); adapter.notifyDataSetChanged(); }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the object that takes on the responsibility for drawing an individual marker. This allows for the option of reusing the drawing code for symbol previews or other purposes outside the map, or for changing the rendering code without changing other code.
public final void setRenderer(@NonNull PointRenderer renderer) { if (renderer == null) { throw new IllegalArgumentException("Argument renderer cannot be null."); } this.renderer = renderer; }
[ "public void setMarker(String marker) {\n this.marker = marker;\n paint();\n }", "void setMarker(Object o) {\n this.undoActionMarker = o;\n }", "public void drawMarker(PGraphics pg, float x, float y);", "public void setmMarker(Marker m){\n mMarker = m;\n }", "private voi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by Abator for iBATIS. This method returns the value of the database column MI402.SUCCESSNUM
public Integer getSuccessnum() { return successnum; }
[ "public String getSuccessCode() {\n return getPropertyAsString(SUCCESSCODE);\n }", "public int getSuccess() {\n return success;\n }", "public Long getReturnCode() {\n return returnCode;\n }", "long getReturnCode();", "public java.lang.Integer getResultCode() {\n return resul...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Preload some application definition, including application name and whether the app is based on behavior network.
public String preloadAppDef(String externalFile) { try { return AppLoader.preloadAppDef(externalFile); } catch (Exception e) { MessageUtils.debug(this, "preloadAppDef", e); MessageUtils.displayError("Can not preload the app definition."); } return null; }
[ "public void loadApplication() {\n loadUsers();\n loadPapers();\n loadReviews();\n loadReports();\n loadNotifications();\n loadDeadlines();\n }", "public void setApplicationIsLoaded(ApplicationConfiguration appConf) {\n this.loadedApps.add( appConf );\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Granted by DB it's will return a unique menu for restaurant in 1 day
default Map<Integer, List<Menu>> findAllWithLunchsByDateToMap(LocalDate date) { return findAllWithLunchsByDate(date).stream().collect(Collectors.groupingBy(menu -> menu.getRestaurant().getId())); }
[ "@Transactional(readOnly = true)\n Menu getRandomMenuByRetaurant(Restaurant r);", "@Transactional(readOnly = true)\n Menu getRandomMenuByTagAndRestaurant(Tag tag, Restaurant restaurant);", "@Override\r\n\tpublic Menu getMenuByRestaurant(Long id) {\n\t\treturn null;\r\n\t}", "@Test\n public void testG...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
fetches all flight numbers /ContentValues initialValues = new ContentValues(); //adds some test cases to the database double weight = 45.0; initialValues.put(PREDICTED_LONG, weight); double weight1 = 45.1; initialValues.put(PREDICTED_LAT, weight1); double weight2 = 45.2; initialValues.put(TRACKED_LONG, weight2); double weight3 = 45.3; initialValues.put(TRACKED_LAT, weight3); initialValues.put(KEY_ROWID, 6); ContentValues initialValues2 = new ContentValues(); //adds some test cases to the database double weight22 = 49.4; initialValues2.put(PREDICTED_LONG, weight22); double weight21 = 49.3; initialValues2.put(PREDICTED_LAT, weight21); double weight222 = 49.5; initialValues2.put(TRACKED_LONG, weight222); double weight23 = 49.4; initialValues2.put(TRACKED_LAT, weight23); initialValues2.put(KEY_ROWID, 5); ContentValues initialValues1 = new ContentValues(); double weight10 = 46.2; initialValues1.put(PREDICTED_LONG, weight10); double weight11 = 45.4; initialValues1.put(PREDICTED_LAT, weight11); double weight12 = 46.2; initialValues1.put(TRACKED_LONG, weight12); double weight13 = 46.3; initialValues1.put(TRACKED_LAT, weight13); initialValues1.put(KEY_ROWID, 4); mDb.insert(DATABASE_TABLE2, null, initialValues1); mDb.insert(DATABASE_TABLE2, null, initialValues2); mDb.insert(DATABASE_TABLE2, null, initialValues);
public Cursor fetchGPSData(String flightnumber) { return mDb.query(DATABASE_TABLE2, new String[] {PREDICTED_LONG, PREDICTED_LAT, TRACKED_LONG, TRACKED_LAT}, KEY_ROWID + " = " + flightnumber, null, null, null, null); // picks the four columns based on the flight number }
[ "public void fillDB(){\n\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n\n //create a map of each car to later insert into the database\n Map<String, String> car1 = new HashMap<>();\n car1.put(\"_id\", \"59d2698c2eaefb1268b69ee...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
generates the integration of the first input provided in window
public static void int1(Window window) { window.getOutput().setText(Functions .integrate(StringToPolynomial.stringToRealPolynomial(window.getInput1().getText())).toString()); }
[ "double integrate(Element e, Function fun);", "public Polinom integrate(){\n\t\t// neimplementat\n\t\tArrayList<Monom> newCoefs= new ArrayList<Monom>();\n\n\t\t//constanta C\n\t\tnewCoefs.add(new MonomInt(0 ,0));\n\t\t//\n\t\tfor(Monom coef:coefs)\n\t\t\tnewCoefs.add(coef.integration());\n\t\treturn new Polinom(n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ The ElementListener interface is for use with GameElements which generate events. The events generated by those GameElements are passed to an ElementListener's event function so that the listener can process the event.
public interface ElementListener { public void event(ElementEvent event); }
[ "void addEventListener( String type, IEventListener listener );", "public void processElementEvent(ElementEvent ee) {\n//\t\tif (ee instanceof KeyInputEvent) {\n//\t\t\tSystem.out.println(ee);\n//\t\t}\n\t\tList<GameEvent> gameEvents = new ArrayList<>();\n\t\tfor (GameElement ge: gameSate.getCurrentGamePart().get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Cria a estrutura do email
protected SimpleMailMessage prepareSimpleMailMessage(Pedido obj) { SimpleMailMessage mensagem = new SimpleMailMessage(); mensagem.setTo(obj.getCliente().getEmail()); // email do destinatario mensagem.setFrom(sender); //email remetente recuperado de application mensagem.setSubject("Pedido confirmado! Código: " + obj.getId()); //assunto do email mensagem.setSentDate(new Date(System.currentTimeMillis())); // data do email mensagem.setText(obj.toString()); //corpo do email return mensagem; }
[ "private CreationViaEmail() { }", "public EmailKey(String Email){ \r\n email = Email;\r\n }", "private static Email getEmailOne() {\n Email email = new Email();\n email.setSubject(\"test email one\");\n email.addTO(\"harry.potter@external.com\");\n email.setBody(\"blah blah bl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end names who survived < age X get names who perished < age X
public String getPerishedNamesLessGivenAge(int age) { String name = ""; for (int i = 0; i < getTotalPax(); i++) { if (data[i].length >= 6 && data[i][4].length()>0) { int status = Integer.parseInt(data[i][1]); double givenAge = Double.parseDouble(data[i][4]); if (status == 0 && givenAge < age) { name += "\n" + data[i][2]; }//end if statement }//end if statement }//end for loop return name; }
[ "private void filterByAge(List<Person> people){\n final PersonFilter personFilter = new PersonFilter();\n people.stream()\n .filter(personFilter::filterAdult);\n }", "void search(ArrayList <Data> a, int age ) {\n\t\tint count =0;\n\t\tArrayList <Data> r = new ArrayList();\n\t\tfor(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create GTFS Feed with service alerts
@Test @Transactional public void testReadAlerts() { FeedEntity alertEntityA = createAlert("alertA", TEST_1, DESC_1, CAUSE_1, EFFECT_1, URL_1, TIME_START_1, TIME_END_1, AGENCY_1, ROUTE_1, STOP_1); FeedEntity alertEntityB = createAlert("alertB", TEST_2, DESC_2, CAUSE_2, EFFECT_2, URL_2, TIME_START_2, TIME_END_2, AGENCY_2, ROUTE_2, STOP_2); FeedEntity alertEntityC = createAlert("alertC", TEST_3, DESC_3, CAUSE_3, EFFECT_3, URL_3, TIME_START_3, TIME_END_3, AGENCY_3, ROUTE_3, STOP_3); // Create FeedMessage FeedMessage.Builder alerts = createFeed(); alerts.addEntity(alertEntityA); alerts.addEntity(alertEntityB); alerts.addEntity(alertEntityC); FeedMessage alert = alerts.build(); _feedService.readAlerts(alert, _entitySource); Collection<AlertModel> alertsFromDB = null; // Wait for 15 seconds to make sure GtfsPersistor has had time to run // the AlertThread, which actually writes to the DB. try { TimeUnit.SECONDS.sleep(15); } catch (Exception ignoredEx) { } // Get data that was persisted to the database try { Query query = getSession().createQuery("from AlertModel"); alertsFromDB = query.list(); } catch (Exception ex) { ex.getMessage(); _log.info("find failed: " + ex.getMessage()); } assertNotNull("database query failed!", alertsFromDB); // Check persisted data against the original value. _log.info("results size: " + alertsFromDB.size()); assertEquals(3, alertsFromDB.size()); for (AlertModel alertFromDB : alertsFromDB) { String header = alertFromDB.getHeaderText(); String desc = alertFromDB.getDescriptionText(); String cause = alertFromDB.getCause(); String effect = alertFromDB.getEffect(); String url = alertFromDB.getUrl(); long timeStart = 0L; long timeEnd = 0L; List<TimeRangeModel> timeRanges = alertFromDB.getTimeRanges(); for (TimeRangeModel tr : timeRanges) { timeStart = tr.getStart(); timeEnd = tr.getEnd(); } String agency = ""; String route = ""; String stop = ""; List<EntitySelectorModel> entitySelectors = alertFromDB.getEntitySelectors(); for (EntitySelectorModel es : entitySelectors) { agency = es.getAgencyId(); route = es.getRouteId(); stop = es.getStopId(); } if (header.equals(TEST_1)) { assertEquals(TEST_1, header); assertEquals(DESC_1, desc); assertEquals(CAUSE_1.toString(), cause); assertEquals(EFFECT_1.toString(), effect); assertEquals(URL_1.toString(), url); assertEquals(TIME_START_1, timeStart); assertEquals(TIME_END_1, timeEnd); assertEquals(AGENCY_1, agency); assertEquals(ROUTE_1, route); assertEquals(STOP_1, stop); } else if (header.equals(TEST_2)) { assertEquals(TEST_2, header); assertEquals(DESC_2, desc); assertEquals(CAUSE_2.toString(), cause); assertEquals(EFFECT_2.toString(), effect); assertEquals(URL_2.toString(), url); assertEquals(TIME_START_2, timeStart); assertEquals(TIME_END_2, timeEnd); assertEquals(AGENCY_2, agency); assertEquals(AGENCY_2 + "_" + ROUTE_2, route); // Verify that agency has // been prepended to // route. assertEquals(STOP_2, stop); } else if (header.equals(TEST_3)) { assertEquals(TEST_3, header); assertEquals(DESC_3, desc); assertEquals(CAUSE_3.toString(), cause); assertEquals(EFFECT_3.toString(), effect); assertEquals(URL_3.toString(), url); assertEquals(TIME_START_3, timeStart); assertEquals(TIME_END_3, timeEnd); assertEquals(AGENCY_3, agency); assertEquals(ROUTE_3, route); assertEquals(AGENCY_3 + "_" + STOP_3, stop); // Verify that agency has // been prepended to stop. } } }
[ "public void createTaskFeed(int taskId);", "private void feed() {\n for (Server tempServer : Server.servers) {\n Fsd.serverInterface.sendServerNotify(\"*\", tempServer, this);\n }\n for (Client tempClient : Client.clients) {\n Fsd.serverInterface.sendAddClient(\"*\", tem...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public long getItemId(int arg0) { return 0; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
TODO Autogenerated method stub
@Override public boolean insert(BuyingHistory buyingHistory) { return false; }
[ "@Override\n }", "@Override\n\t\t\t\tpublic void pintate() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void extornar() {\n \n }", "@Override\r\n\tpublic void hablar() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void kayit1() {\n\t\t\t\n\t\t}", "@Override\r\n\tpublic void wydaj() {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Handles the Start Updates button and requests start of location updates. Does nothing if updates have already been requested.
public void startUpdatesButtonHandler() { if (!mRequestingLocationUpdates) { mRequestingLocationUpdates = true; startLocationUpdates(); } }
[ "public void startUpdatesButtonHandler(View view) {\n if (!mRequestingLocationUpdates) {\n mRequestingLocationUpdates = true;\n startLocationUpdates();\n }else{\n mRequestingLocationUpdates = false;\n stopLocationUpdates();\n }\n setButtonsText...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method automatically generated with DtoGenerator
public SemanticAnnotationFetchOptions withSemanticAnnotationsUsing(SemanticAnnotationFetchOptions fetchOptions) { return semanticAnnotations = fetchOptions; }
[ "private DtoConverter() {\n // Empty for SonarQube.\n }", "public SedeDTO() {}", "S convertToEntity(D dto);", "D convertToDto(S entity);", "private FamilyRelationOutDTOMapper() {}", "MODEL map(DTO dto);", "public IdentificadorDto() {}", "public interface DTO<T> {\n\n\tpublic T toModel();\n\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
First startup, leader is discovered
public void pong(Pong message) { if (message.getId() != 0 && context.getLeaderId() == 0 && context.isLeader() == false) { context.setLeader(true); context.setLeaderId(message.getId()); context.setLeaderPort(message.getPort()); //The peer of other side is leader if (message.getLocalId() == message.getId()) { context.setConnectedToLeader(true); } else { //Connect to leader try { ConnectionFactory.getInstance(context.getPeerFactory()).connect(String.valueOf(message.getId()), "127.0.0.1", message.getPort()); } catch (Exception e) { logger.error(e.getMessage(), e); } } } //This peer is leader if (context.isLeader()) { //Nothing to do } //Leader is founded if (context.getLeaderId() != 0) { //Nothing to do } //The peer of other side isn't leader, close the connection if (message.getLocalId() != message.getId()) { ConnectionFactory.getInstance(context.getPeerFactory()).disConnect(String.valueOf(message.getLocalId())); } }
[ "public void startup() {\n }", "private void startup()\n\t{\n\t}", "@Override\r\n\tpublic void watchLeader() {\n\t\t\r\n\t}", "Member leader();", "private EpzillaLeader() {\r\n\t\tsetClusterClientList(new Vector<IEpzillaEventListner>());\r\n\t}", "@Override\r\n\t\t\tpublic void isLeader() {\n\t\t\t\tSy...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates new form MainFrame
public MainFrame() { contador.adicionaNovoInteressadoNoContador(this); initComponents(); }
[ "private static void createAndShowGUI() {\n new MainFrame();\n }", "public MainFrame() {\n\t\tcreate();\n\t\taddListeners();\n\t\tsetVisible(true);\n\t}", "public MainFrame() {\r\n\t\tinitComponents();\r\n\t}", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public MainJFrame() {\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Performs a full cold app restart restarts application
protected void doColdRestart() { String baseError = "Unable to cold restart application: "; try { Log.d(TAG, "Cold restarting application"); Context c = applicationContext; //check if the context is given if (c != null) { //fetch the packagemanager so we can get the default launch activity // (you can replace this intent with any other activity if you want PackageManager pm = c.getPackageManager(); //check if we got the PackageManager if (pm != null) { //create the intent with the default start activity for your application Intent mStartActivity = pm.getLaunchIntentForPackage( c.getPackageName() ); if (mStartActivity != null) { //mStartActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); //create a pending intent so the application is restarted after System.exit(0) was called. // We use an AlarmManager to call this intent in 100ms int mPendingIntentId = 223344; PendingIntent mPendingIntent = PendingIntent .getActivity(c, mPendingIntentId, mStartActivity, PendingIntent.FLAG_CANCEL_CURRENT); AlarmManager mgr = (AlarmManager) c.getSystemService(Context.ALARM_SERVICE); mgr.set(AlarmManager.RTC, System.currentTimeMillis() + 100, mPendingIntent); Log.i(TAG, "Killing application for cold restart"); //kill the application System.exit(0); } else { handleError(baseError+"StartActivity is null"); } } else { handleError(baseError+"PackageManager is null"); } } else { handleError(baseError+"Context is null"); } } catch (Exception ex) { handleError(baseError+ ex.getMessage()); } }
[ "private void restartApp() {\n\n System.exit(0);\n }", "public void restart() {\n appController.restart();\n }", "@Override\n\tprotected void onRestart() {\n\t\tsuper.onRestart();\n\t\tdashboardSENDSTATE(STATE_APP_ON);\n\t}", "protected void restart() {\n cleanup();\n init();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }