query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
we use the OkHttp library from
@Override protected String doInBackground(String... urls) { OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url(urls[0]) .build(); Response response = null; try { response = client.newCall(request).execute(); if (response.isSuccessful()) { return response.body().string(); } } catch (IOException e) { e.printStackTrace(); } return "Download failed"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static OkHttpClient m35241c() {\n return new OkHttpClient();\n }", "public void okhttpClick(View view) {\n\n\n String url = \"https://gank.io/api/add2gank\";\n RequestBody requestBody = new MultipartRequestBody()\n .addFormDataPart(\"pageNo\", \"1\")\n ...
[ "0.69246924", "0.6799639", "0.67022085", "0.66763645", "0.66354907", "0.6529461", "0.64835596", "0.6477396", "0.6381048", "0.6272685", "0.6210887", "0.61883676", "0.6163704", "0.61142814", "0.6100359", "0.6094651", "0.6054427", "0.59165025", "0.58922184", "0.5839536", "0.5797...
0.5472385
39
TODO code application logic here
public static void main(String[] args) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }"...
[ "0.60802186", "0.5912082", "0.58425087", "0.58339286", "0.5810548", "0.57580656", "0.57396024", "0.5721001", "0.5705411", "0.5666017", "0.5657976", "0.5613798", "0.5611188", "0.5611188", "0.55960613", "0.55933475", "0.557677", "0.5572332", "0.5565667", "0.55482084", "0.553657...
0.0
-1
initializing scanner and random number generator
public static void main(String[]args)throws IOException{ Scanner scan = new Scanner(System.in); Random generator = new Random(); System.out.println("Welcome to a game of Reversi/Othello.\nChoose option 3 in the main menu if you do not know how to play the game."); System.out.println("Press any key to proceed to menu..."); System.in.read(); System.out.println("\t\t Main Menu"); System.out.println("\t\t *********"); System.out.println("\t\t 1. Play Reversi"); System.out.println("\t\t 2. Options"); System.out.println("\t\t 3. How to play"); System.out.println("\t\t 4. Exit"); int choice=scan.nextInt(); while(choice<1||choice>4){ System.out.println("Invalid option. Try again."); choice=scan.nextInt(); } while(choice==1||choice==2||choice==3){ if(choice==1){ //creating game board for(int x=0;x<boardwidth+2;x++){ for(int i=0;i<boardlength+2;i++){ board[x][i]="-"; dynamicboard[x][i]=0; } } //assigning starting pieces board[boardwidth/2][boardlength/2]="x"; board[boardwidth/2+1][boardlength/2+1]="x"; board[boardwidth/2+1][boardlength/2]="o"; board[boardwidth/2][boardlength/2+1]="o"; playerpoints(board); int movechoice; //this variable will alternate every loop to give turns to both player int playerturn=1; //piecevalue sets the value of a piece depending on the player turn, if player 1, then piecevalue will be x, if player 2, it will be o. Will be used in following loop String piecevalue="x"; //fullboard and playerlost are boolean variables that monitor the state of the board, game will end if the board is full or if a player has lost (has no more pieces left standing on the board) boolean fullboard=false; boolean playerlost=false; //preliminary fullboard check (if the dimensions are set at 2 by 2, game will automatically end at the start of the game since the board is ALREADY full) fullboard=true; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i].equals("-")){ fullboard=false; } } } //while loop begins, this loop will end once an end condition has been met //end conditions are explained in the tutorial or user manual but essentially, the game ends when the board is full, a player has no more pieces on the board left or both players cannot make a move. while(fullboard==false&&playerlost==false&&nomovecount!=2){ //boolean is first set to false and a check will be performed to see if the ai has been enabled for this player. boolean ai=false; //checks this for player 1 if(playerturn==1){ if(player1ai==true){ ai=true; } } //checks player 2 if(playerturn==2){ if(player2ai==true){ ai=true; } } //assigning the piece value according to the player's turn. Player 1=x Player 2=o if(playerturn==1){ piecevalue="x"; } else if(playerturn==2){ piecevalue="o"; } //checks board to see if ANY move can be made during this turn, if no move can, this move will be automatically skipped. boardcheck(piecevalue); //in the case that ai is not enabled for this player, the program will let the user enter values (choose their move) if(ai==false){ //display player turn and current score for both players System.out.println("\nPlayer "+playerturn+"'s turn ("+piecevalue+") Score - Player 1: "+player1score+" points (x), Player 2: "+player2score+" points (o)"); //displaying game board so the player can decide on their next move displayboard(board); //the following block of code will be initialized if boardcheck method has determined that a move can be made during this turn. if(boardavailability==true){ //player gets to choose if they want to pass or make a move. Once a player wants to make a move it is too late to pass. //However, this issue is minor since no player would want to pass their move and if they do want to, they should plan ahead and press pass. //Remember, if no moves can be made, this block of code would not even be initialized, the program would auto-skip the player's turn, therefore there will always be a move to make. System.out.println("\n(1)Make a move (2)Pass"); movechoice=scan.nextInt(); while(movechoice!=1&&movechoice!=2){ System.out.println("Invalid option, try again."); movechoice=scan.nextInt(); } //if the player chooses to make a move, this block of code is initialized if(movechoice==1){ //will keep looping and asking user to enter a row and column until valid coordinates are entered while(validation==false){ int row, column; System.out.print("Enter the row:"); row=scan.nextInt(); //a player cannot put a piece thats out of the range of the board, this prevents them from doing so while(row>boardlength||row<1){ System.out.println("Invalid row on the board. Try again."); row=scan.nextInt(); } //a player cannot put a piece thats out of the range of the board, this prevents them from doing so System.out.print("Enter the column:"); column=scan.nextInt(); while(column>boardlength||column<1){ System.out.println("Invalid column on the board. Try again."); column=scan.nextInt(); } //validationcheck method checks to see if the coordinate that the players wants to place a piece on is -, if it is, then validation will become true. //players cannot place a piece on an area of the board that has already been taken validation=validationcheck(row,column,piecevalue); //if the first validation method is true, it will then check to see if placing a piece on these coordinates will perform an action, if not, validation is still false and the loop will continue... if(validation==true){ validationcheck2(row,column,piecevalue); } //in the case that validation is true after both checks, then the program will proceed to place a piece on the specified coordinate and perform the resulting actions (see tutorial or user manual if you do not know how this game works) if(validation==true){ board[row][column]=piecevalue; changepieces(row,column,piecevalue); } //naturally if validation is false, the program will simply display a message telling the user that it is an invalid move. It will then loop again and ask for a row and column again. else if(validation==false){ System.out.println("Invalid move, try again."); } } //necessary or validation will be true on next loop skipping the inside loop. validation=false; } //if player skips, no action is performed as shown in this else if statement else if(movechoice==2){ System.out.println("Player "+playerturn+" has chosen to pass their turn."); } //checks if the board is full, if it is then the game will end. fullboard=true; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i].equals("-")){ fullboard=false; } } } //switches playerturn so that the next loop, the other player gets a turn. if(playerturn==1){ playerturn=2; } else{ playerturn=1; } //calculates the amount of points each player has (which will be displayed in the next loop or if the game ends playerpoints(board); if(player1score==0||player2score==0){ playerlost=true; } } //the following block of code will be initialized if the boardcheck method has determined that no moves can be made so it will skip the player's turn. else{ System.out.println("Auto-Pass. This turn has been skipped due to the fact that this player cannot make any moves in this turn."); System.out.println("Press any key to continue to the next turn..."); //instead of skipping too immediately and making the user lose track of what happened, the user gets to see that their move has been skipped. System.in.read(); //notice how the fullboard method check and playerpoints method have not been initialized here. This is because the player's turn has been skipped so the points and the board will not change. if(playerturn==1){ playerturn=2; } else{ playerturn=1; } } } //the following block of code is the similar to the if statement in which there is no ai. //since there is AI, the user will not be asked to enter row/column and the program will randomly generator numbers until a valid move is generated and that will be used as the row and column. else{ System.out.println("\nPlayer "+playerturn+"'s turn ("+piecevalue+") Score - Player 1: "+player1score+" points (x), Player 2: "+player2score+" points (o)"); displayboard(board); System.out.println("\n(AI player turn) Press any NUMBER to continue to the next turn..."); //System.in.read(); does not work properly in this situation (it may be skipped due to some reason) //scan.nextInt(); will always work int read=scan.nextInt(); if(boardavailability==true){ //chosenrow and chosencolumn variables int chosenrow=0,chosencolumn=0; while(validation==false){ int row, column; //generator random row and columns, these can be invalid and if so, the program will just loop this part again until valid numbers are generated. row=generator.nextInt(boardwidth)+1; column=generator.nextInt(boardlength)+1; validation=validationcheck(row,column,piecevalue); if(validation==true){ validationcheck2(row,column,piecevalue); } if(validation==true){ board[row][column]=piecevalue; changepieces(row,column,piecevalue); chosenrow=row; chosencolumn=column; } } //displaying the coordinates that the AI chose. System.out.println("Player "+playerturn+" has placed a piece on coordinates ("+chosenrow+","+chosencolumn+")\n"); validation=false; fullboard=true; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i].equals("-")){ fullboard=false; } } } if(playerturn==1){ playerturn=2; } else{ playerturn=1; } playerpoints(board); if(player1score==0||player2score==0){ playerlost=true; } } //the AI's move will also be skipped if no moves can be made on the turn. else{ System.out.println("Auto-Pass. This turn has been skipped due to the fact that this player cannot make any moves in this turn."); System.out.println("Press any key to continue..."); System.in.read(); if(playerturn==1){ playerturn=2; } else{ playerturn=1; } } } //nomovecheck method checks both players to see if they can make a move on the current board, if both of them can't, then the game will end. nomovecheck(); //boardavailability will be reset to false and further changes on this boolean will be set in the next loop //this also ensures that if the game ends and restarts, this value will be false and not cause the game to end immediately. boardavailability=false; } //game ends if the above while loop ends (due to a certain condition broken) displayboard(board); //displays board and score of each player as well as a message of congratulations System.out.println("\nFinal score - Player 1: "+player1score+" points, Player 2: "+player2score+" points"); if(player1score>player2score){ System.out.println("\nCongratulations Player 1. You are the winner! Better luck next time Player 2 :("); } else if(player2score>player1score){ System.out.println("\nCongratulations Player 2. You are the winner! Better luck next time Player 1 :("); } else if(player1score==player2score){ System.out.println("\nIt's a tie! Congratulations to both players!"); } //player scores are reset to 2 (starting game scores), nomovecount is set to 0 in case the user decides to run another game. player1score=2; player2score=2; //if nomovecount is not reset to 0, the next game will end immediately as it starts nomovecount=0; } else if(choice==2){ //Options choice, allows users to modify board dimensions and set AI players. int optionchoice; System.out.println("What would you like to modify? (1)Board Dimensions (2)Set AI players"); optionchoice=scan.nextInt(); while(optionchoice!=1&&optionchoice!=2){ System.out.println("Invalid option, try again."); optionchoice=scan.nextInt(); } //lets user change board size if(optionchoice==1){ System.out.println("Here you'll be able to change the reversi gamem board size to your liking."); System.out.print("Assign the length of the board: "); boardlength=scan.nextInt(); //having boardlength or boardwidth be less than 2, the fundamentals mechanics of Reversi will be broken. //if boardlength is over 9, then the column indicators will be inaccurate (after 9, 10 is double digit and will cause the column indicators to not line up to the game board anymore) while(boardlength<2||boardlength>9){ System.out.println("The game cannot support this board length breaks. Try again."); boardlength=scan.nextInt(); } System.out.print("Assign the width of the board: "); boardwidth=scan.nextInt(); //there is no reason why the width should be less than 9, but keeping it to maximum dimensions of 9 by 9 board is more professional. while(boardwidth<2||boardwidth>9){ System.out.println("The game cannot support this board width breaks. Try again."); boardwidth=scan.nextInt(); } System.out.println("Your board now has dimensions: "+boardlength+" by "+boardwidth); } //Here, the user will be able to set AI players, all 4 possibilities are listed. else if(optionchoice==2){ int aichange; System.out.println("(1)Player vs. Player (2)Player vs. Ai (3)AI vs. AI (4)AI vs. Player"); aichange=scan.nextInt(); while(aichange<1||aichange>4){ System.out.println("Invalid option, try again."); aichange=scan.nextInt(); } if(aichange==1){ player1ai=false; player2ai=false; } else if(aichange==2){ player1ai=false; player2ai=true; } else if(aichange==3){ player1ai=true; player2ai=true; } else if(aichange==4){ player1ai=true; player2ai=false; } } } //Game tutorial, explains the game using the actual game board to effectively teach the user how the game works else if(choice==3){ boardwidth=8; boardlength=8; for(int x=0;x<boardwidth+2;x++){ for(int i=0;i<boardlength+2;i++){ board[x][i]="-"; } } board[boardwidth/2][boardlength/2]="x"; board[boardwidth/2+1][boardlength/2+1]="x"; board[boardwidth/2+1][boardlength/2]="o"; board[boardwidth/2][boardlength/2+1]="o"; System.out.println("Reversi Game Tutorial"); System.out.println("\nPress any key to continue..."); System.in.read(); System.out.println("Reversi is a board game where each player's aim is to have more pieces on the board."); System.out.println("Turns alternate and on each player's turn, the player can make a move by placing their pieces somewhere on the board.\nAlternatively, they can pass(not recommended)"); System.out.println("Please read on to find out more about the pass feature."); System.out.println("\nPress any key to continue..."); //double System.in.read(); are used as one does not perform the action somehow System.in.read(); System.in.read(); displayboard(board); System.out.println("\nThis is the starting board for most games, each player will have 2 pieces diagonal to each other at the center of the board"); System.out.println("[x] are pieces of player 1, [o] are pieces of player 2, [-] represent unused spaces"); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("When a piece is placed, it'll convert [up, down, left, right, all diagonals directions] pieces to its own type if a specific condition is met."); System.out.println("The condition is that there must be a same-type piece in that certain direction.\nSo, if this condition is met, all enemy pieces in between the placed piece and the piece it is making a 'connection' with.\nNOTE:This connection is broken if there is a blank space [-] in between the connection."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("Example: In this situation, Player 1 (x) decides to place their piece on coordinates (5,3)"); displayboard(board); board[5][3]="x"; board[5][4]="x"; System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); displayboard(board); System.out.println("\nHere is the result of this move."); System.out.println("This can happen with all directions simultaneously as long as the above condition is met."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("There a few rules to the placing of these pieces on a player's turn:"); System.out.println("Rule #1: the player piece must be placed on a blank space represented by [-] (cannot replace an already placed piece such as [x] or [o])"); System.out.println("Rule #2: the player's move must perform an action (make a 'connection' with another piece) other than being placed on the board."); System.out.println("NOTE: Rule #2 will take some time to comprehend. Example: a unit cannot be placed in an area where its surrounding units are blank [-],\nremember, a blank space breaks/blocks potential connection."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("ILLEGAL MOVES"); board[7][7]="o"; board[3][3]="x"; displayboard(board); System.out.println("\nCoordinates (7,7) and (3,3) are illegal in this scenario.\n(7,7) cannot make any connections due to being surrounded by blank space, on top of the fact that even if it was not, its (up,down,left,right,diagonals) directions never reach the other two present [o] units.\n(3,3) does reach another x at (down,right) direction, but NO connection is made. A connection must involve opponent pieces in between friendly pieces."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("Do you need to worry about this? No, the program will not let you make any illegal moves breaking the rules.\nYou will need to re-enter your move if this happens."); System.out.println("In addition, if no move can be made during one's turn, the program will automatically skip this turn at your leisure."); System.out.println("\nPress any key to continue..."); System.in.read(); System.in.read(); System.out.println("Conditions of winning:\n1.Board is full, player with most points wins\n2.One player has no units/pieces left standing, their opponent wins\n3.No moves can be made by either player, player with most points win"); System.out.println("\nFor more information, see the user manual.\nEnjoy your game!"); System.in.read(); } System.out.println("\nPress any key to return to menu..."); System.in.read(); //For some reasons, System.in.read(); does not work after a game (choice 1) has been played. This if statement ensures that it does. if(choice==1){ System.in.read(); } //re-initializing menu System.out.println("\t\t Main Menu"); System.out.println("\t\t *********"); System.out.println("\t\t 1. Play Reversi"); System.out.println("\t\t 2. Options"); System.out.println("\t\t 3. How to play"); System.out.println("\t\t 4. Exit"); choice=scan.nextInt(); } System.out.println("Thank you for playing Reversi, come play again anytime."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void randomInit(int r) { }", "private PRNG() {\n java.util.Random r = new java.util.Random();\n seed = r.nextInt();\n mersenne = new MersenneTwister(seed);\n }", "public static void init() {\n\t\tscanner = new Scanner(System.in);\n\t\treturn;\n\t}", "public void random_i...
[ "0.6724402", "0.66659266", "0.666274", "0.64989614", "0.64914125", "0.6407054", "0.63780195", "0.6227535", "0.6202566", "0.6133434", "0.611734", "0.60835254", "0.6047053", "0.6012686", "0.5969043", "0.59478575", "0.5939906", "0.59352314", "0.5921882", "0.59186804", "0.5916983...
0.0
-1
this method displays the board with column and row indicators (that line up with the rows and columns to help the user indicate what the coordinates are. displays board in accordance to the assigned width and length of the board
public static void displayboard(String board[][]){ int rowindicator[]=new int[boardwidth+1]; int rowcount=1; for(int i=1;i<=boardwidth;i++){ rowindicator[i]=rowcount; rowcount++; } int columnindicator[]=new int[boardlength+1]; int columncount=1; for(int i=1;i<=boardlength;i++){ columnindicator[i]=columncount; columncount++; } System.out.print("\n "); for(int i=1;i<=boardlength;i++){ //displays column indicator System.out.print(" "+columnindicator[i]); } //displays board System.out.println(""); for(int x=1;x<=boardwidth;x++){ //displays row indicator System.out.print(" "+rowindicator[x]); for(int i=1;i<=boardlength;i++){ System.out.print(" "+board[x][i]); } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void displayBoard() {\n System.out.printf(\"%20s\",\"\"); // to add spacing\n for(int i = 0; i < space[0].length; i++) //Put labels for number axis\n {\n System.out.printf(\"%4d\",i+1);\n }\n System.out.println();\n for(int row = 0; row < this.space.length; row+...
[ "0.7779962", "0.77215385", "0.7478092", "0.74368227", "0.73855746", "0.73706996", "0.73327553", "0.73144007", "0.7269648", "0.72456187", "0.7227598", "0.7219403", "0.72185963", "0.71398365", "0.7138224", "0.71321875", "0.7127638", "0.7123956", "0.71223736", "0.71164554", "0.7...
0.7618845
2
this method is used to check EVERY space on the board that the current player can place a piece on. If none are found, then validation will become false and the player's turn will be skipped.
public static void boardcheck(String piecevalue){ //in all check methods, an opposite piece value must be set which holds the opposite piece to the current one (ie. x's opposite piece is o, o's opposite piece is x) String oppositepiece; if(piecevalue.equals("x")){ oppositepiece="o"; } else if(piecevalue.equals("o")){ oppositepiece="x"; } //This step is needed or JAVA will think that the piecevalue may not have been initialized else{ oppositepiece="-"; } //With the 2 for loops and the if statement, the program will go through the whole board but only check the value if it is on a blank space [-]. for(int row=1;row<=boardwidth;row++){ for(int column=1;column<=boardlength;column++){ if(board[row][column].equals("-")){ //found booleans will turn into true if a 'connection' is available and an action can be made with the current row/column in the loop. boolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false; //checkfurther all begin as 1 and will increase in value if an opposite piece is found in the direction it is checking, this lets the while loop continue and check more in that direction. int checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1; //R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left. //program will check all directions using this scheme. //If the board in this direction holds and opposite piece, it will advance and check further, until something other than an opposite piece is reached. while(board[row][column+checkfurtherR].equals(oppositepiece)){ checkfurtherR++; } //If the piece after the check furthers have stopped is the same-type piece, then everything in between will be converted to the current piece. A 'connection' is made as explained in the tutorial/user manual. if(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){ foundR=true; } while(board[row][column-checkfurtherL].equals(oppositepiece)){ checkfurtherL++; } if(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){ foundL=true; } while(board[row+checkfurtherB][column].equals(oppositepiece)){ checkfurtherB++; } if(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){ foundB=true; } while(board[row-checkfurtherT][column].equals(oppositepiece)){ checkfurtherT++; } if(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){ foundT=true; } while(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){ checkfurtherTR++; } if(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){ foundTR=true; } while(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){ checkfurtherTL++; } if(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){ foundTL=true; } while(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){ checkfurtherBL++; } if(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){ foundBL=true; } while(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){ checkfurtherBR++; } if(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){ foundBR=true; } //If any pieces have if(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){ boardavailability=true; } } } } //This if statement does not have to do with the current method. It is useful to the next nomovecheck method. if(boardavailability==false){ nomovecount++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isValid() {\n\t\tif (isPlayer1() && currentPit < 7 && currentPit != 6) {\n\t\t\tif (board[currentPit] == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true; // check appropriate side of board, excluding scoring\n\t\t}\n\t\t// pit\n\t\telse if (!isPlayer1() && currentPit >= 7 && currentPit != 13...
[ "0.71183985", "0.70717794", "0.7065794", "0.7022124", "0.69962335", "0.6980841", "0.6946115", "0.6938572", "0.6933991", "0.6915689", "0.68908983", "0.6833541", "0.6833396", "0.68263495", "0.67880374", "0.6782931", "0.6742853", "0.67358106", "0.6729848", "0.6715963", "0.671146...
0.0
-1
nomovecheck method checks both players to see if they can make a move on the current board, if both of them can't, then the game will end.
public static void nomovecheck(){ nomovecount=0; boardcheck("x"); boardcheck("o"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public void callingMovePossibleWhenTryingToTakeAnOpponentPieceWith2MarkersOnShouldReturnFalse() {\n player1.movePiece(12, 11, board);\r\n player1.movePiece(12, 11, board);\r\n\r\n player2.movesLeft.moves.add(2);\r\n\r\n // Then\r\n assertFalse(player2.isMovePossible(...
[ "0.6972275", "0.6912142", "0.6837607", "0.681851", "0.6780781", "0.67553604", "0.67080176", "0.66978765", "0.66589814", "0.6644148", "0.6558877", "0.6546216", "0.6495472", "0.6487584", "0.6481598", "0.6479931", "0.64747566", "0.64712393", "0.64586127", "0.6458013", "0.6456519...
0.6941133
1
First validation check, checks to see if the pending coordinate is being placed on a [] space. If it's not, the validation will resutl in false;
public static boolean validationcheck(int row, int column, String piecevalue){ if(board[row][column].equals("x")||board[row][column].equals("o")){ return false; } else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean judgeValid()\r\n\t{\r\n\t\tif(loc.i>=0 && loc.i<80 && loc.j>=0 && loc.j<80 && des.i>=0 && des.i<80 && des.j>=0 && des.j<80)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t\t\r\n\t}", "private boolean hasValidBounds() {\n\n\n\n return false;\n }", "private boolean isLegalCoo...
[ "0.6740807", "0.671091", "0.6550293", "0.6542579", "0.65371525", "0.6530339", "0.648184", "0.6459767", "0.64237386", "0.64066786", "0.6392082", "0.63244355", "0.63094676", "0.6307224", "0.6300341", "0.62814313", "0.62608105", "0.6234125", "0.62314147", "0.62263256", "0.622192...
0.0
-1
Same as the boardcheck method but checks only a specific row and column to find out if its valid or not.
public static void validationcheck2(int row, int column, String piecevalue){ String oppositepiece; if(piecevalue.equals("x")){ oppositepiece="o"; } else if(piecevalue.equals("o")){ oppositepiece="x"; } else{ oppositepiece="-"; } //R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left. boolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false; int checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1; while(board[row][column+checkfurtherR].equals(oppositepiece)){ checkfurtherR++; } if(board[row][column+checkfurtherR].equals(piecevalue)&&checkfurtherR>1){ foundR=true; } while(board[row][column-checkfurtherL].equals(oppositepiece)){ checkfurtherL++; } if(board[row][column-checkfurtherL].equals(piecevalue)&&checkfurtherL>1){ foundL=true; } while(board[row+checkfurtherB][column].equals(oppositepiece)){ checkfurtherB++; } if(board[row+checkfurtherB][column].equals(piecevalue)&&checkfurtherB>1){ foundB=true; } while(board[row-checkfurtherT][column].equals(oppositepiece)){ checkfurtherT++; } if(board[row-checkfurtherT][column].equals(piecevalue)&&checkfurtherT>1){ foundT=true; } while(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){ checkfurtherTR++; } if(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)&&checkfurtherTR>1){ foundTR=true; } while(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){ checkfurtherTL++; } if(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)&&checkfurtherTL>1){ foundTL=true; } while(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){ checkfurtherBL++; } if(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)&&checkfurtherBL>1){ foundBL=true; } while(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){ checkfurtherBR++; } if(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)&&checkfurtherBR>1){ foundBR=true; } if(foundR==true||foundL==true||foundT==true||foundB==true||foundTL==true||foundTR==true||foundBL==true||foundBR==true){ validation=true; } else{ validation=false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean valid (int row, int column) {\n\n boolean result = false;\n \n // check if cell is in the bounds of the matrix\n if (row >= 0 && row < grid.length &&\n column >= 0 && column < grid[0].length)\n\n // check if cell is not blocked and not previously tried\n if ...
[ "0.77507055", "0.7622198", "0.7501211", "0.74974406", "0.74868107", "0.7478383", "0.73417526", "0.73245716", "0.73112625", "0.73033255", "0.7294153", "0.72924346", "0.72710526", "0.7237017", "0.72293544", "0.72111934", "0.72100645", "0.71997577", "0.7185766", "0.7174827", "0....
0.69764775
45
This method uses the same mechanics as the boardcheck or validationcheck2 methods but actually changes the board, it doesn't just check.
public static void changepieces(int row, int column, String piecevalue){ String oppositepiece; if(piecevalue.equals("x")){ oppositepiece="o"; } else if(piecevalue.equals("o")){ oppositepiece="x"; } else{ oppositepiece="-"; } //R=right, L=left, T=top, B=bottom, and there are diagonals such as TL=top left. boolean foundR=false,foundL=false,foundT=false,foundB=false,foundTL=false,foundTR=false,foundBL=false,foundBR=false; int checkfurtherR=1,checkfurtherL=1,checkfurtherT=1,checkfurtherB=1,checkfurtherTL=1,checkfurtherTR=1,checkfurtherBL=1,checkfurtherBR=1; while(board[row][column+checkfurtherR].equals(oppositepiece)){ checkfurtherR++; } if(board[row][column+checkfurtherR].equals(piecevalue)){ foundR=true; } //The board changes the board if a 'connection' has been found in the [right] direction. It makes the connection following the game rules. if(foundR==true){ for(int i=column;i<column+checkfurtherR;i++){ board[row][i]=(piecevalue); } } while(board[row][column-checkfurtherL].equals(oppositepiece)){ checkfurtherL++; } if(board[row][column-checkfurtherL].equals(piecevalue)){ foundL=true; } //Again, if something is found in the [left] direction, this block of code will be initialized to change to board array (making that 'connection' on the board). if(foundL==true){ for(int i=column;i>column-checkfurtherL;i--){ board[row][i]=(piecevalue); } } while(board[row+checkfurtherB][column].equals(oppositepiece)){ checkfurtherB++; } if(board[row+checkfurtherB][column].equals(piecevalue)){ foundB=true; } if(foundB==true){ for(int i=row;i<row+checkfurtherB;i++){ board[i][column]=(piecevalue); } } while(board[row-checkfurtherT][column].equals(oppositepiece)){ checkfurtherT++; } if(board[row-checkfurtherT][column].equals(piecevalue)){ foundT=true; } if(foundT==true){ for(int i=row;i>row-checkfurtherT;i--){ board[i][column]=(piecevalue); } } //Diagonal directions are harder and different from the 4 basic directions //It must use dynamic board to 'mark' the coordinates that it must convert to make a proper 'connection' while(board[row-checkfurtherTR][column+checkfurtherTR].equals(oppositepiece)){ //each coordinate that is reached will be recorded on the dynamic board dynamicboard[row-checkfurtherTR][column+checkfurtherTR]=1; checkfurtherTR++; } if(board[row-checkfurtherTR][column+checkfurtherTR].equals(piecevalue)){ foundTR=true; } //Now the board will be changed if an available move has been found if(foundTR==true){ for(int x=row;x>row-checkfurtherTR;x--){ for(int i=column;i<column+checkfurtherTR;i++){ //without the use of the dynamic board, some units of the board that should not be converted, will be converted. //(hard to explain)Example, if coordinate places a piece on the Top right of an available move, the connection and change on the board will be performed but [down] and [right] directions will also be inconveniently converted if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } //dynamicboard must be cleared each time for its next job in 'marking' units in the array to be converted. cleandynamicboard(); while(board[row-checkfurtherTL][column-checkfurtherTL].equals(oppositepiece)){ dynamicboard[row-checkfurtherTL][column-checkfurtherTL]=1; checkfurtherTL++; } if(board[row-checkfurtherTL][column-checkfurtherTL].equals(piecevalue)){ foundTL=true; } if(foundTL==true){ for(int x=row;x>row-checkfurtherTL;x--){ for(int i=column;i>column-checkfurtherTL;i--){ if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } cleandynamicboard(); while(board[row+checkfurtherBL][column-checkfurtherBL].equals(oppositepiece)){ dynamicboard[row+checkfurtherBL][column-checkfurtherBL]=1; checkfurtherBL++; } if(board[row+checkfurtherBL][column-checkfurtherBL].equals(piecevalue)){ foundBL=true; } if(foundBL==true){ for(int x=row;x<row+checkfurtherBL;x++){ for(int i=column;i>column-checkfurtherBL;i--){ if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } cleandynamicboard(); while(board[row+checkfurtherBR][column+checkfurtherBR].equals(oppositepiece)){ dynamicboard[row+checkfurtherBR][column+checkfurtherBR]=1; checkfurtherBR++; } if(board[row+checkfurtherBR][column+checkfurtherBR].equals(piecevalue)){ foundBR=true; } if(foundBR==true){ for(int x=row;x<row+checkfurtherBR;x++){ for(int i=column;i<column+checkfurtherBR;i++){ if(dynamicboard[x][i]==1){ board[x][i]=(piecevalue); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean check(piece[][] board) {\n\t\t\n\t\treturn false;\n\t\t\n\t}", "public boolean move(int x, int y, CheckersBoard board) {\n if (whiteTurn == true && team == Constants.TeamId.team1Id) {\n return false;\n }\n if (whiteTurn == false && team == Constants.Tea...
[ "0.7013071", "0.6868344", "0.65192896", "0.64055544", "0.6398928", "0.6360477", "0.63574296", "0.6351401", "0.62972456", "0.62766486", "0.624728", "0.6218869", "0.61810714", "0.61248213", "0.61132705", "0.60965663", "0.60804826", "0.60790545", "0.60661364", "0.6054188", "0.60...
0.0
-1
This method simply goes through the whole board the check player points and set their score for the main method.
public static void playerpoints(String board[][]){ int player1pointcount=0, player2pointcount=0; for(int x=1;x<=boardwidth;x++){ for(int i=1;i<=boardlength;i++){ if(board[x][i]=="x"){ player1pointcount++; } if(board[x][i]=="o"){ player2pointcount++; } } } player1score=player1pointcount; player2score=player2pointcount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void calculateScores()\r\n {\r\n for(int i = 0; i < gameBoard.getBoardRows(); i++)\r\n for(int j = 0; j < gameBoard.getBoardCols(); j++)\r\n {\r\n if(gameBoard.tilePlayer(i,j) == 0)\r\n currentRedScore = currentRedScore + gameBoard.tileSc...
[ "0.6991874", "0.67492455", "0.67082316", "0.66929626", "0.66498804", "0.6600745", "0.6555265", "0.6503112", "0.64672905", "0.6452299", "0.6446668", "0.6417586", "0.6380305", "0.6373713", "0.6367624", "0.63553274", "0.6343133", "0.6325692", "0.6300121", "0.6295358", "0.6272669...
0.72149414
0
cleans dynamicboard for the changepieces method.
public static void cleandynamicboard(){ for(int x=0;x<boardwidth+2;x++){ for(int i=0;i<boardlength+2;i++){ dynamicboard[x][i]=0; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clearBoard() {\r\n\t\tbody.removeAll();\r\n\t\tpiece.clear();\r\n\t\t\r\n\t\t// Assign1, Remove 'K' label of all pieces\r\n\t\tfor (int i=0; i<blackPieces.length; i++) {\r\n\t\t\tblackPieces[i].setText(null);\r\n\t\t}\r\n\t\tfor (int i=0; i<whitePieces.length; i++) {\r\n\t\t\twhitePieces[i].setText(nul...
[ "0.7229526", "0.7143044", "0.7129801", "0.7033402", "0.68127084", "0.67741156", "0.6613575", "0.6603037", "0.6538431", "0.6442157", "0.64259946", "0.63819754", "0.6344033", "0.6338527", "0.63172567", "0.6287836", "0.62625235", "0.6262068", "0.62553155", "0.625018", "0.625018"...
0.73818576
0
create datacenter with 2 hosts
private static Datacenter Create_Datacenter(String name){ // creating list of host machine List<Host> hostList = new ArrayList<Host>(); // creating list of CPU for each host machine, In our simulation with choose 1 core per machine List<Pe> peList1 = new ArrayList<Pe>(); int mips = 1000; // computing power of each core // add 1 core to each host machine for (int i =0; i < VM_number; i ++ ) { peList1.add(new Pe(i, new PeProvisionerSimple(mips))); } // configuring host int hostId=0; int ram = 56320; //host memory 40 GB long storage = 10240000; //host storage 10000 GB int bw = 102400; // bandwidth 100 Gbps // create first host machine with 4 cores hostList.add( new Host( hostId, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList1, new VmSchedulerTimeShared(peList1) ) ); // create another host machine with 1 cores List<Pe> peList2 = new ArrayList<Pe>(); // add 1 core to each host machine for (int i =0; i < VM_number; i ++ ) { peList2.add(new Pe(i, new PeProvisionerSimple(mips))); } hostId++; hostList.add( new Host( hostId, new RamProvisionerSimple(ram), new BwProvisionerSimple(bw), storage, peList2, new VmSchedulerTimeShared(peList2) ) ); // configuring datacenter String arch = "x86"; // system architecture String os = "Linux"; // operating system String vmm = "Xen"; double time_zone = 10.0; // time zone this resource located double cost = 3.0; // the cost of using processing in this resource double costPerMem = 0.05; // the cost of using memory in this resource double costPerStorage = 0.001; // the cost of using storage in this resource double costPerBw = 0.0; // the cost of using bw in this resource LinkedList<Storage> storageList = new LinkedList<Storage>(); DatacenterCharacteristics characteristics = new DatacenterCharacteristics( arch, os, vmm, hostList, time_zone, cost, costPerMem, costPerStorage, costPerBw); // creating data center Datacenter datacenter = null; try { datacenter = new Datacenter(name, characteristics, new VmAllocationPolicySimple(hostList), storageList, 0); } catch (Exception e) { e.printStackTrace(); } return datacenter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Datacenter createDatacenter(String name){\n List<Host> hostList = new ArrayList<Host>();\n\n for (int i=0; i<HostCount; i++){\n\n // 2. A Machine contains one or more PEs or CPUs/Cores.\n List<Pe> peList = new ArrayList<Pe>();\n\n // 3. Create PEs and add thes...
[ "0.72537225", "0.7115208", "0.6985777", "0.60574734", "0.5923377", "0.58679867", "0.5706707", "0.5516754", "0.54930973", "0.5464983", "0.5458991", "0.5441326", "0.53525615", "0.5274352", "0.5241603", "0.51800704", "0.5149127", "0.5134232", "0.5111367", "0.50610286", "0.505483...
0.74904996
0
create data center brokers
private static DatacenterBroker createBroker(){ DatacenterBroker broker = null; try { broker = new DatacenterBroker("Broker"); } catch (Exception e) { e.printStackTrace(); return null; } return broker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostConstruct\n private void init() {\n Properties props = new Properties();\n props.put(\"oracle.user.name\", user);\n props.put(\"oracle.password\", pwd);\n props.put(\"oracle.service.name\", serviceName);\n //props.put(\"oracle.instance.name\", instanceName);\n prop...
[ "0.5879939", "0.58418936", "0.5834202", "0.5801835", "0.5786039", "0.57818013", "0.57221746", "0.5698351", "0.5651542", "0.5500502", "0.5497762", "0.54851156", "0.540663", "0.54028034", "0.5371037", "0.5330681", "0.53215915", "0.53115773", "0.52500516", "0.5242055", "0.524020...
0.7197028
0
print out all runtime results of cloudlets
private static void printCloudletList(List<Cloudlet> list) { int size = list.size(); Cloudlet cloudlet; List<Double> CPUtime = new ArrayList<Double>(); List <Double> cputime = new ArrayList<Double>(); List <Double> start_time = new ArrayList<Double>(); List<Double> starttime = new ArrayList<Double>(); List<Double> endtime = new ArrayList<Double>(); String indent = " "; Log.printLine(); Log.printLine("========== OUTPUT =========="); DecimalFormat dft = new DecimalFormat("###.##"); for (int i = 0; i < size; i++) { cloudlet = list.get(i); if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){ cputime.add(cloudlet.getActualCPUTime()); start_time.add(cloudlet.getExecStartTime()); } } for (int i = 0; i < size; i++) { cloudlet = list.get(i); if (cloudlet.getCloudletStatus() == Cloudlet.SUCCESS){ if(!CPUtime.contains(cloudlet.getActualCPUTime())) { CPUtime.add(cloudlet.getActualCPUTime()); } if(!starttime.contains(cloudlet.getExecStartTime())) { starttime.add(cloudlet.getExecStartTime()); } if(!endtime.contains(cloudlet.getFinishTime())) { endtime.add(cloudlet.getFinishTime()); } } } int n=0; for (int i=0; i< CPUtime.size();i++) { n= Collections.frequency(cputime,CPUtime.get(i)); Log.printLine(dft.format(n)+" "+"Cloudlets finish in "+ dft.format(CPUtime.get(i))+"s" ); } Log.printLine(); for (int i=0; i< starttime.size();i++) { n= Collections.frequency(start_time,starttime.get(i)); Log.printLine(dft.format(n)+" "+"Cloudlets executes in time "+ dft.format(starttime.get(i))+"~" + dft.format(endtime.get(i))+"s"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printRuntimes() {\n\t\tfor(long x: runtimes){\n\t\t\tSystem.out.println(\"run with time \"+x+\" nanoseconds\");\n\t\t}\t\n\t}", "public static void stdout(){\n\t\tSystem.out.println(\"Buildings Found: \" + buildingsFound);\n\t\tSystem.out.println(\"Pages searched: \"+ pagesSearched);\n\t\tSystem.out....
[ "0.68659896", "0.6412911", "0.60707206", "0.60406214", "0.5961284", "0.595488", "0.59206575", "0.5860434", "0.581589", "0.58138037", "0.58050585", "0.5729597", "0.5694924", "0.5683936", "0.5678493", "0.5654876", "0.5617875", "0.5598696", "0.5579681", "0.55496305", "0.55364877...
0.7081279
0
update view for event list view
public void updateEvent(EasyRVHolder holder, GithubEvent event) { Glide.with(GithubApp.getsInstance()).load(event.actor.avatar_url) .placeholder(R.mipmap.ic_default_avatar) .transform(new GlideRoundTransform(GithubApp.getsInstance())) .override(ScreenUtils.dpToPxInt(40), ScreenUtils.dpToPxInt(40)) .into((ImageView) holder.getView(R.id.ivAvatar)); StyledText main = new StyledText(); StyledText details = new StyledText(); String icon = EventTypeManager.valueOf(event.type.toString()) .generateIconAndFormatStyledText(this, event, main, details); if (TextUtils.isEmpty(icon)) { holder.setVisible(R.id.tvEventIcon, View.GONE); } else { TypefaceUtils.setOcticons((TextView) holder.getView(R.id.tvEventIcon)); holder.setText(R.id.tvEventIcon, icon); } ((TextView) holder.getView(R.id.tvEvent)).setText(main); if (TextUtils.isEmpty(details)) { holder.setVisible(R.id.tvEventDetails, View.GONE); } else { ((TextView) holder.getView(R.id.tvEventDetails)).setText(details); } ((TextView) holder.getView(R.id.tvEventDate)).setText(TimeUtils.getRelativeTime(event.created_at)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateListView(List<Event> list) {\n this.eventsList = list;\n notifyDataSetChanged();\n }", "public interface OwnEventsView extends BaseView {\n\n void adaptEventsList(List<EventModel> eventModelsList);\n\n void viewEvent(EventModel eventModel);\n\n void showViewRefreshing(...
[ "0.7361302", "0.66950625", "0.66597044", "0.653114", "0.64463943", "0.6415051", "0.6415051", "0.63933504", "0.63572633", "0.62991804", "0.6296234", "0.6286773", "0.62852323", "0.62732846", "0.6271444", "0.62653893", "0.6260679", "0.62494415", "0.6248532", "0.6246283", "0.6242...
0.5920372
56
Finish the Activity off (unless was never launched anyway)
@Override protected void tearDown() throws Exception { Activity a = super.getActivity(); if (a != null) { a.finish(); setActivity(null); } // Scrub out members - protects against memory leaks in the case where someone // creates a non-static inner class (thus referencing the test case) and gives it to // someone else to hold onto scrubClass(ActivityInstrumentationTestCase2.class); super.tearDown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void tryToFinishActivity() {\n Log.i(TAG, \"[tryToFinishActivity]\");\n finish();\n }", "public void exitActivity() {\n\n finish();\n\n }", "public void finishActivity() {\r\n if (handler != null)\r\n handler.postDelayed(new Runnable() {\r\n ...
[ "0.8038519", "0.74261427", "0.73406506", "0.73156655", "0.7303257", "0.72095037", "0.7082912", "0.7006911", "0.6985956", "0.6981455", "0.6953694", "0.6942703", "0.69333786", "0.690403", "0.68899965", "0.68744516", "0.6856123", "0.6842417", "0.6839579", "0.68187875", "0.675896...
0.0
-1
Get the list of all animation callbacks that have been requested and have not been canceled.
public List<AnimationCallback> getAnimationCallbacks() { return callbacks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<TweenCallback> getCallbacks()\n\t{\n\t\treturn callbacks;\n\t}", "public List<Callback> pendingCallbacks() {\n ObjectNode req = makeRequest(\"callbacks\");\n JsonNode resp = this.runtime.requestResponse(req);\n\n JsonNode callbacksResp = resp.get(\"callbacks\");\n if ...
[ "0.6754207", "0.6457786", "0.6356525", "0.62166387", "0.60267305", "0.5918305", "0.5602264", "0.5528044", "0.54075956", "0.53414136", "0.53055", "0.5257517", "0.52077127", "0.5178258", "0.5170903", "0.51673406", "0.51568615", "0.5134082", "0.5127861", "0.51237404", "0.5105693...
0.76543576
0
updateStatus Update a status of a task.
public boolean updateStatus(TaskStatus status) { TaskAttemptID taskID = status.getTaskID(); TaskStatus oldStatus = taskStatuses.get(taskID); if (oldStatus != null) { if (oldStatus.getState() == status.getState()) { return false; } } taskStatuses.put(taskID, status); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setStatus(TaskStatus status);", "public void updateTaskStatus(CaptureTask task, String status, String description) {\n\t\t\r\n\t}", "public void setStatus(ServiceTaskStatus status) {\n\t\tthis.status = status;\n\t}", "Status updateStatus(String status) throws TwitterException;", "@Override\n\tpublic b...
[ "0.78919566", "0.7824492", "0.7311404", "0.7088133", "0.7086696", "0.69836813", "0.6784794", "0.6719823", "0.664444", "0.66248256", "0.66244334", "0.66171646", "0.6616617", "0.65368146", "0.64955324", "0.64738554", "0.64647925", "0.6460799", "0.64561903", "0.642336", "0.64109...
0.6957571
6
setTaskCompleted Set a task to complete.
public void setTaskCompleted(TaskAttemptID taskID) { taskStatuses.get(taskID).setState(TaskStatus.SUCCEEDED); successfulTaskID = taskID; activeTasks.remove(taskID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void completeTask() {\n completed = true;\n }", "@Override\n public void completeTask(@NonNull String taskId) {\n }", "@Override\n protected void onPostExecute(BackgroundTaskResult result)\n {\n taskCompleted = true;\n dismissProgressDialog();\n notifyTaskCompl...
[ "0.7220624", "0.6645527", "0.6614889", "0.65461296", "0.64381963", "0.64137703", "0.63632435", "0.6293023", "0.62860006", "0.62624395", "0.6248954", "0.6189483", "0.6172629", "0.6101055", "0.6064891", "0.60525584", "0.603075", "0.60095435", "0.60013515", "0.59628934", "0.5931...
0.7423937
0
getTaskToRun Set the task to running state.
public Task getTaskToRun(String taskTrackerName) throws RemoteException, NotBoundException { TaskAttemptID attemptID = new TaskAttemptID(taskID, nextAttemptID++); Task newTask = null; if (isMapTask()) { newTask = new MapTask(attemptID, partition, locatedBlock); } else { HashSet<String> locations = job.getAllMapTaskLocations(); newTask = new ReduceTask(attemptID, partition, locatedBlock, locations); } activeTasks.put(attemptID, taskTrackerName); allTaskAttempts.add(attemptID); jobTracker.createTaskEntry(attemptID, taskTrackerName, this); return newTask; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRunning(boolean b) {\n mRun = b;\n }", "public void setRunning(boolean run) {\n _run = run;\r\n }", "private synchronized void startTask(Task task) {\n if (_scheduledTasks.get(task.table) == task) {\n _scheduledTasks.remove(task.table);\n }\n ...
[ "0.580173", "0.5787465", "0.5785471", "0.57758844", "0.5439274", "0.5424531", "0.5352626", "0.526999", "0.5261035", "0.5256253", "0.52319735", "0.52186316", "0.5201057", "0.5178088", "0.5169167", "0.5155029", "0.5120765", "0.5119403", "0.51185614", "0.510463", "0.5042828", ...
0.0
-1
Add user account info to Firebase Database
@Override public void onComplete(@NonNull Task<AuthResult> task) { dbHelper.addNewUser( user ); // Get new FirebaseUser dbHelper.fetchCurrentUser(); // Add the new user to a new chat containing only the new user String chatID = dbHelper.getNewChildKey( dbHelper.getChatUserPath() ); String userID = dbHelper.getAuth().getUid(); String displayName = dbHelper.getAuthUserDisplayName(); dbHelper.addToChatUser( chatID, userID, displayName ); dbHelper.addToUserChat( userID, chatID ); String messageOneID = dbHelper.getNewChildKey(dbHelper.getMessagePath()); String timestampOne = dbHelper.getNewTimestamp(); String messageOne = "COUCH POTATOES:\nWelcome to Couch Potatoes!" + "\nEnjoy meeting new people with similar interests!"; dbHelper.addToMessage( messageOneID, userID, "COUCH POTATOES", chatID, timestampOne, messageOne ); String messageTwoID = dbHelper.getNewChildKey(dbHelper.getMessagePath()); String timestampTwo = dbHelper.getNewTimestamp(); String messageTwo = "COUCH POTATOES:\nThis chat is your space. Feel free to experiment with the chat here."; dbHelper.addToMessage( messageTwoID, userID, "COUCH POTATOES", chatID, timestampTwo, messageTwo ); // Registration complete. Redirect the new user the the main activity. startActivity( new Intent( getApplicationContext(), MainActivity.class ) ); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void uploadUserDetailsToDatabase(String email, String password){\n User user = new User(email, password);\n FirebaseDatabase.getInstance().getReference(\"Users\").push()\n .setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n ...
[ "0.7641824", "0.73897165", "0.73144656", "0.7299505", "0.7269646", "0.7268222", "0.72624207", "0.7231295", "0.72205925", "0.72200966", "0.71550554", "0.7133968", "0.71305233", "0.7122674", "0.70455235", "0.700148", "0.6995268", "0.6988102", "0.698118", "0.69725525", "0.695678...
0.63613725
76
Gets the contentFlowno value for this CustomContentInfo.
public long getContentFlowno() { return contentFlowno; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setContentFlowno(long contentFlowno) {\n this.contentFlowno = contentFlowno;\n }", "public int getFlow() {\r\n\r\n return flow;\r\n }", "public int getCompFlow(){\n return this.mFarm.getCompFlow();\n }", "public int flow() {\n\t\treturn this.flow;\n\t}", "public String g...
[ "0.73687387", "0.6175913", "0.5962681", "0.59192216", "0.55223423", "0.54574066", "0.5426244", "0.53608286", "0.5297047", "0.5221876", "0.52018285", "0.5197071", "0.515945", "0.50639117", "0.50483304", "0.50483304", "0.50449514", "0.50449437", "0.502824", "0.4931141", "0.4891...
0.8097677
0
Sets the contentFlowno value for this CustomContentInfo.
public void setContentFlowno(long contentFlowno) { this.contentFlowno = contentFlowno; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public long getContentFlowno() {\n return contentFlowno;\n }", "public void setFlow(int flow) {\r\n\r\n this.flow = flow;\r\n }", "public void setCompFlow(int compFlow){\n this.mFarm.setCompFlow(compFlow);\n }", "public void setFlowType(String flowType);", "public void setFileFlow(S...
[ "0.62117016", "0.5773436", "0.53224146", "0.5258136", "0.49501434", "0.49253407", "0.46749982", "0.4644235", "0.4591876", "0.4583912", "0.45304403", "0.45123976", "0.44773278", "0.44680017", "0.444549", "0.44292575", "0.4376892", "0.43747994", "0.42971662", "0.42934966", "0.4...
0.8320489
0
Gets the informationSystem value for this CustomContentInfo.
public long getInformationSystem() { return informationSystem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getSystem() {\r\n return this.system;\r\n }", "public String getIsSystem() {\n return isSystem;\n }", "@ApiModelProperty(required = true, value = \"The id of the system where this file lives.\")\n public String getSystem() {\n return system;\n }", "public String getSyst...
[ "0.7012555", "0.6771391", "0.67464167", "0.65498793", "0.65188515", "0.6475458", "0.6399715", "0.6399715", "0.6399715", "0.6399715", "0.63899827", "0.6286752", "0.62378764", "0.61800694", "0.6173959", "0.6172105", "0.6162572", "0.6134674", "0.6130312", "0.6106724", "0.6090443...
0.7580528
0
Sets the informationSystem value for this CustomContentInfo.
public void setInformationSystem(long informationSystem) { this.informationSystem = informationSystem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSystem(String value) {\r\n this.system = value;\r\n }", "void setSystem(java.lang.String system);", "public void setCodeSystem(CodeSystem codeSystem) {\r\n\t\tthis.codeSystem = codeSystem;\r\n\t}", "public void setSystemName(String systemName) {\n this.systemName = systemName;...
[ "0.66385144", "0.65328145", "0.6082662", "0.60810184", "0.60054845", "0.5973015", "0.5963681", "0.59293246", "0.5896924", "0.5888917", "0.58535135", "0.57795566", "0.57367444", "0.5700364", "0.5652763", "0.5652672", "0.5500373", "0.54994714", "0.54460084", "0.5436409", "0.538...
0.78455883
0
Gets the shareName value for this CustomContentInfo.
public java.lang.String getShareName() { return shareName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setShareName(java.lang.String shareName) {\n this.shareName = shareName;\n }", "public String getIsShare() {\n return isShare;\n }", "public Share getShare(String name) throws Exception{\n return (Share) collectionObjectFinder.search(this.getAllSharesAsSnapshot(), name, new Sha...
[ "0.67472816", "0.627916", "0.597184", "0.5911845", "0.5878564", "0.5874765", "0.5834849", "0.58204705", "0.54810536", "0.54792583", "0.5468903", "0.5445566", "0.5438818", "0.5436207", "0.5282035", "0.5232004", "0.51992995", "0.51942605", "0.51940906", "0.51816624", "0.5140041...
0.8134476
0
Sets the shareName value for this CustomContentInfo.
public void setShareName(java.lang.String shareName) { this.shareName = shareName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getShareName() {\n return shareName;\n }", "public void setShareholderName(String shareholderName);", "public void setSharedSetName(String sharedSetName) {\r\n this.sharedSetName = sharedSetName;\r\n }", "public void setIsShare(String isShare) {\n this.isShare = i...
[ "0.6989729", "0.6349417", "0.5972731", "0.5821812", "0.53689605", "0.5347893", "0.5309321", "0.5291541", "0.5289067", "0.52571213", "0.52571213", "0.5213136", "0.5208696", "0.5203485", "0.51423067", "0.51393944", "0.5123863", "0.5093585", "0.50730395", "0.505705", "0.5053612"...
0.8335743
0
Gets the shareUserType value for this CustomContentInfo.
public java.lang.String getShareUserType() { return shareUserType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setShareUserType(java.lang.String shareUserType) {\n this.shareUserType = shareUserType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", "public String getUserType() {\n return userType;\n }", ...
[ "0.6994159", "0.59299964", "0.59299964", "0.59299964", "0.59299964", "0.59146637", "0.57210505", "0.5710259", "0.5683617", "0.5663514", "0.55762637", "0.5568301", "0.55639625", "0.55527174", "0.546308", "0.5405414", "0.5369842", "0.53136355", "0.5258311", "0.5248842", "0.5247...
0.8369713
0
Sets the shareUserType value for this CustomContentInfo.
public void setShareUserType(java.lang.String shareUserType) { this.shareUserType = shareUserType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getShareUserType() {\n return shareUserType;\n }", "public void setUserType(String userType) {\n\t\t_userType = userType;\n\t}", "public void setUserType(UserType userType) {\n\t\tthis.userType = userType;\n\t\tif (userType != CustomerControl.dummyUserType)\n\t\t\tthis.userTypeID=us...
[ "0.72036624", "0.56014234", "0.5539446", "0.55248433", "0.5483902", "0.54818577", "0.5470023", "0.54661906", "0.5455425", "0.5336002", "0.5336002", "0.5336002", "0.52641934", "0.50910485", "0.50910485", "0.50659215", "0.5045248", "0.5028664", "0.502328", "0.49946746", "0.4969...
0.8436232
0
Return type metadata object
public static org.apache.axis.description.TypeDesc getTypeDesc() { return typeDesc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public MetadataType getType();", "public MetadataType getType() {\n return type;\n }", "public MilanoTypeMetadata.TypeMetadata getMetadata()\n {\n if (typeMetadata == null) {\n return null;\n }\n\n return typeMetadata;\n }", "private Metadata getMetadata(RubyModule type)...
[ "0.7969707", "0.7373198", "0.7358018", "0.7090138", "0.67353225", "0.67259765", "0.66725683", "0.65644145", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223", "0.6543223",...
0.0
-1
JMS Queue Consumer handles incoming request messages JMS message handling entry point for incoming Request messages (i.e. requests for remote method invocation).
public void handleJMSMessage(Message jmsMessage) { if (jmsMessage == null) return; Request request = null; // First get Request instance from jms message (see sendCallRequest for send code) try { if (jmsMessage instanceof ObjectMessage) { Serializable object = ((ObjectMessage) jmsMessage).getObject(); if (object instanceof Request) request = (Request) object; } if (request == null) throw new JMSException("Invalid message=" + jmsMessage); //$NON-NLS-1$ } catch (JMSException e) { log("handleJMSMessage message=" + jmsMessage, e); //$NON-NLS-1$ return; } // Process call request locally handleJMSRequest(jmsMessage, request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void handleJMSRequest(Message jmsMessage, Request request) {\n \t\tfinal RemoteServiceRegistrationImpl localRegistration = getLocalRegistrationForJMSRequest(request);\n \t\t// Else we've got a local service and we invoke it\n \t\tfinal RemoteCallImpl call = request.getCall();\n \t\tResponse response = null;\n \t\t...
[ "0.7280152", "0.67240244", "0.63188136", "0.6268633", "0.62472093", "0.6159754", "0.6080197", "0.605946", "0.6028903", "0.601523", "0.597764", "0.59605", "0.59238684", "0.5909902", "0.5884185", "0.58778685", "0.5875004", "0.58668333", "0.5866066", "0.5849763", "0.5844052", ...
0.6753657
1
XXX should have some use of Job to actually make synchronous call in response to request and send result
void handleJMSRequest(Message jmsMessage, Request request) { final RemoteServiceRegistrationImpl localRegistration = getLocalRegistrationForJMSRequest(request); // Else we've got a local service and we invoke it final RemoteCallImpl call = request.getCall(); Response response = null; Object result = null; // Actually call local service here try { result = localRegistration.callService(call); response = new Response(request.getRequestId(), result); } catch (final Exception e) { response = new Response(request.getRequestId(), e); log(208, "Exception invoking service", e); //$NON-NLS-1$ } // Then send response back to initial sender try { ObjectMessage responseMessage = container.getSession().createObjectMessage(); responseMessage.setObject(response); responseMessage.setJMSCorrelationID(jmsMessage.getJMSCorrelationID()); container.getMessageProducer().send(jmsMessage.getJMSReplyTo(), responseMessage); } catch (JMSException e) { log("sendCallResponse jmsMessage=" + jmsMessage + ", response=" + response, e); //$NON-NLS-1$ //$NON-NLS-2$ } // XXX end need for job }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public byte[] execute() {\n return buildResponse();\n }", "JobResponse apply();", "@SuppressWarnings(\"WeakerAccess\")\n protected void makeRequest() {\n if (mCallback == null) {\n CoreLogger.logError(addLoaderInfo(\"mCallback == null\"));\n return;\n ...
[ "0.67672485", "0.66923016", "0.6448357", "0.6355778", "0.63354486", "0.6292546", "0.62463236", "0.6238822", "0.6234964", "0.62222266", "0.6100803", "0.60879904", "0.60739547", "0.6029415", "0.60183555", "0.5994023", "0.5927785", "0.5922658", "0.5918867", "0.59157974", "0.5897...
0.0
-1
Override of RegistrySharedObject.sendCallRequest. This is called when RegistrySharedObject.callSynch is called (i.e. when an IRemoteService proxy or IRemoteService.callSync is called.
protected Request sendCallRequest(RemoteServiceRegistrationImpl remoteRegistration, final IRemoteCall call) throws IOException { Request request = new Request(this.getLocalContainerID(), remoteRegistration.getServiceId(), RemoteCallImpl.createRemoteCall(null, call.getMethod(), call.getParameters(), call.getTimeout()), null); requests.add(request); try { //Get a temporary queue that this client will listen for responses Destination tempDest = container.getResponseQueue(); MessageConsumer responseConsumer = container.getSession().createConsumer(tempDest); //This class will handle the messages to the temp queue as well responseConsumer.setMessageListener(responseHandler); // Create the request message and set the object (the Request itself) ObjectMessage objMessage = container.getSession().createObjectMessage(); objMessage.setObject(request); //Set the reply to field to the temp queue you created above, this is the queue the server //will respond to objMessage.setJMSReplyTo(tempDest); //Set a correlation ID so when you get a response you know which sent message the response is for objMessage.setJMSCorrelationID(request.getRequestContainerID().getName() + "-" + request.getRequestId()); //$NON-NLS-1$ container.getMessageProducer().send(objMessage); } catch (JMSException e) { log("sendCallRequest request=" + request, e); //$NON-NLS-1$ } return request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object sendRpcRequest(RpcRequest rpcRequest);", "void sendRequest(String invocationId, HttpRequest request);", "@Override\n public void callSync() {\n\n }", "public void writeSysCall() {\n clientChannel.write(writeBuffer, this, writeCompletionHandler);\n }", "@Override\n public void onCa...
[ "0.5969786", "0.5530751", "0.55268335", "0.5463744", "0.5452925", "0.5388251", "0.5377536", "0.5361625", "0.5355967", "0.5296846", "0.5270217", "0.5242815", "0.52345574", "0.52205765", "0.5217821", "0.52107084", "0.5205808", "0.5171984", "0.5169628", "0.5148546", "0.5145587",...
0.5934414
1
==================== PUBLIC METHODS ==================== ==================== PROTECTED METHODS ==================== ==================== PRIVATE METHODS ==================== ==================== OVERRIDE METHODS ====================
@Override public int getCount() { return drinks.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize(...
[ "0.65445083", "0.6460066", "0.6432554", "0.63927174", "0.63927174", "0.63927174", "0.63927174", "0.63927174", "0.63927174", "0.6383184", "0.6366494", "0.6256918", "0.62398374", "0.61758244", "0.6170681", "0.6145826", "0.6145826", "0.6144714", "0.61325765", "0.6129376", "0.612...
0.0
-1
/ selectedRounds is a list of Integers that are the IDs of the rounds selected by the user in the 'Admin'form of the tournament scheduler. This function gives this list to the scheduler to make sure that this will be the list of running rounds.
public void loadRounds () { for (Integer roundId : selectedRounds) { log.info("Loading Round " + roundId); } log.info("End of list of rounds that are loaded"); Scheduler scheduler = Scheduler.getScheduler(); scheduler.loadRounds(selectedRounds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setRoundNum(int roundNum){\n gameRounds = roundNum;\n }", "public ArrayList<Move> getRound(int round) {\r\n\t\tint startIndex;\r\n\t\tint endIndex;\r\n\t\t\r\n\t\tArrayList<Move> moves = new ArrayList<Move>();\r\n\t\t\r\n\t\t// Guard against negatives\r\n\t\tif (round < 0) {\r\n\t\t\tround ...
[ "0.56702876", "0.5629443", "0.557572", "0.5535272", "0.55350035", "0.54923815", "0.54827607", "0.5193189", "0.5156438", "0.51245177", "0.51239604", "0.511997", "0.51101667", "0.51079607", "0.5026324", "0.50006735", "0.49871776", "0.49856102", "0.4881916", "0.48806372", "0.487...
0.68715703
0
/ This function is run when the user presses the 'Unload'button on the 'Admin'form of the tournament scheduler. It makes sure that the scheduler will clear the list with running rounds.
public void unloadRounds () { log.info("Unloading Rounds"); Scheduler scheduler = Scheduler.getScheduler(); scheduler.unloadRounds(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void removeFromSavedScheduleList() {\n if (!yesNoQuestion(\"This will print every schedule, are you sure? \")) {\n return;\n }\n\n showAllSchedules(scheduleList.getScheduleList());\n\n System.out.println(\"What is the number of the one you want to remove?\");\n ...
[ "0.65442145", "0.646687", "0.63234025", "0.6118957", "0.60431314", "0.6017023", "0.60028875", "0.59678966", "0.5960545", "0.59126407", "0.59027344", "0.5896921", "0.5896061", "0.5862987", "0.58505833", "0.5841117", "0.5813088", "0.5805522", "0.5764609", "0.5755086", "0.573580...
0.68811977
0
/ Represents a strategy to perform zip operation.
public interface IZipStrategy { void zip(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface CompressionStrategy {\n\n /**\n * The type of compression performed.\n */\n String getType();\n\n /**\n * Uncompresses the data. The array received should not be modified, but it\n * may be returned unchanged.\n * \n * @param data compressed data.\n * @return u...
[ "0.5382652", "0.5301716", "0.5293611", "0.5281589", "0.52726924", "0.52262735", "0.5218736", "0.51827186", "0.51671505", "0.514773", "0.51073253", "0.5098309", "0.5090201", "0.50887525", "0.508748", "0.5083619", "0.50731814", "0.50345916", "0.5034229", "0.50024754", "0.497632...
0.81606513
0
TODO move business logic from view.
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { LayoutInflater inflater = LayoutInflater.from(parent.getContext()); RecyclerView.ViewHolder viewHolder = null; View view; if (viewType == TaskDetail.VIEW_TYPE_EDIT_VALUE) { view = inflater.inflate(R.layout.item_detail_task_title, parent, false); viewHolder = new TaskTitleViewHolder(view); } else if (viewType == TaskDetail.VIEW_TYPE_ADD_SUBTASK || viewType == TaskDetail.VIEW_TYPE_NOTE || viewType == TaskDetail.VIEW_TYPE_SCHEDULE) { view = inflater.inflate(R.layout.item_detail_basic, parent, false); viewHolder = new BasicViewHolder(view); } else if (viewType == TaskDetail.VIEW_TYPE_SUBTASK) { view = inflater.inflate(R.layout.item_detail_subtask, parent, false); viewHolder = new SubtaskViewHolder(view); } return viewHolder; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void init...
[ "0.6352832", "0.61935586", "0.61935586", "0.61018366", "0.6097702", "0.6097702", "0.6057193", "0.5973011", "0.59212345", "0.5921226", "0.5912992", "0.58622044", "0.58622044", "0.5857603", "0.5823805", "0.57559574", "0.5751031", "0.5714346", "0.5686387", "0.56784075", "0.56784...
0.0
-1
TODO move business logic from view.
@Override public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) { int viewType = holder.getItemViewType(); if (viewType == TaskDetail.VIEW_TYPE_EDIT_VALUE) { presenter.bindTaskTitleViewToValue((TaskTitleViewHolder) holder, position); } else if (viewType == TaskDetail.VIEW_TYPE_ADD_SUBTASK || viewType == TaskDetail.VIEW_TYPE_NOTE || viewType == TaskDetail.VIEW_TYPE_SCHEDULE) { presenter.bindBasicViewToValue((BasicViewHolder) holder, position); } else if (viewType == TaskDetail.VIEW_TYPE_SUBTASK) { presenter.bindSubtaskViewToValue((SubtaskViewHolder) holder, position); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void view() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView() {\n\t\t\n\t}", "@Override\n\tprotected void initView()\n\t{\n\n\t}", "@Override\r\n\tprotected void initView() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void init...
[ "0.6352832", "0.61935586", "0.61935586", "0.61018366", "0.6097702", "0.6097702", "0.6057193", "0.5973011", "0.59212345", "0.5921226", "0.5912992", "0.58622044", "0.58622044", "0.5857603", "0.5823805", "0.57559574", "0.5751031", "0.5714346", "0.5686387", "0.56784075", "0.56784...
0.0
-1
Clears the current contents of this object and prepares it for reuse.
public void clear() { super.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clear() {\n\t\tthis.contents.clear();\n\t}", "public void clear() {\r\n init();\r\n }", "public void clear() {\n this.init(buffer.length);\n }", "public void clear() {\n this.data().clear();\n }", "public void clear () {\n\t\treset();\n\t}", "@Override\n ...
[ "0.743447", "0.74014795", "0.738529", "0.7317419", "0.7231902", "0.7225262", "0.7207089", "0.7143764", "0.7135566", "0.7049034", "0.704184", "0.7038369", "0.701683", "0.70141226", "0.6973435", "0.69579303", "0.6943925", "0.6938591", "0.6913943", "0.69135195", "0.6911195", "...
0.71300006
9
Decode a UPA message into a market by order close message.
@Override public int decode(DecodeIterator dIter, Msg msg) { clear(); if (msg.msgClass() != MsgClasses.CLOSE) return CodecReturnCodes.FAILURE; streamId(msg.streamId()); return CodecReturnCodes.SUCCESS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "IMessage decode(byte[] data) throws InvalidMessageException;", "public String decode(String message)\n\t{\n\t\treturn decode(message, 0);\n\t}", "public String decode(String message) {\n if (message == null || message.isEmpty()) {\n return \"\";\n }\n StringBuilder source = new ...
[ "0.5742109", "0.55227417", "0.5401231", "0.5259003", "0.5258162", "0.520585", "0.51273835", "0.5066266", "0.5012486", "0.49366596", "0.4925714", "0.4924141", "0.49153635", "0.49097306", "0.48834392", "0.4794204", "0.47343096", "0.472892", "0.47225896", "0.47137225", "0.470559...
0.4988301
9
Creates a property descriptor with the given id and display name.
public BooleanPropertyDescriptor(Object id, String displayName, boolean readonly) { super(id, displayName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ListPropertyDescriptor(Object id, String displayName) {\r\n\t\tsuper(id, displayName);\r\n\t}", "public static <T extends AbstractEntity<?>> PropertyDescriptor<T> fromString(final String toStringRepresentation, final Optional<EntityFactory> factory) {\n try {\n final String[] parts = toS...
[ "0.6464241", "0.60921824", "0.58358777", "0.5669488", "0.5616335", "0.5611811", "0.5605618", "0.55789965", "0.55033803", "0.5484122", "0.5483197", "0.5471708", "0.542557", "0.5421038", "0.5396688", "0.53733927", "0.5370932", "0.53506166", "0.5340828", "0.53199637", "0.5311399...
0.5020674
43
Creates new form search_package
public search_package() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form getSearchForm() throws PublicationTemplateException;", "private DynamicForm createSearchBox() {\r\n\t\tfinal DynamicForm filterForm = new DynamicForm();\r\n\t\tfilterForm.setNumCols(4);\r\n\t\tfilterForm.setAlign(Alignment.LEFT);\r\n\t\tfilterForm.setAutoFocus(false);\r\n\t\tfilterForm.setWidth(\"59%...
[ "0.6002915", "0.5979369", "0.59331447", "0.5594465", "0.5512492", "0.5500552", "0.54461116", "0.5396839", "0.53941375", "0.53785735", "0.5376238", "0.53728825", "0.53652716", "0.531743", "0.5310169", "0.5286538", "0.52777636", "0.5267216", "0.5253768", "0.5237197", "0.5202801...
0.6755813
0
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() { jLabel1 = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); jScrollPane1 = new javax.swing.JScrollPane(); jList1 = new javax.swing.JList(); jSeparator2 = new javax.swing.JSeparator(); jLabel2 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jTextField3 = new javax.swing.JTextField(); jLabel5 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); ClearCmdButton = new javax.swing.JButton(); ExitCmdButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); addWindowListener(new java.awt.event.WindowAdapter() { public void windowActivated(java.awt.event.WindowEvent evt) { formWindowActivated(evt); } }); jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 1, 30)); jLabel1.setForeground(new java.awt.Color(51, 0, 255)); jLabel1.setText("SEARCH PACKAGE INFO"); jLabel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED)); jSeparator1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); jList1.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(204, 0, 0), 3, true), "ID-DURATION", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 14), new java.awt.Color(255, 51, 0))); // NOI18N jList1.setModel(new DefaultListModel()); jList1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jList1MouseClicked(evt); } }); jScrollPane1.setViewportView(jList1); jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL); jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel2.setForeground(new java.awt.Color(0, 102, 102)); jLabel2.setText("PACKAGE ID"); jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel3.setForeground(new java.awt.Color(0, 102, 102)); jLabel3.setText("DURATION"); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel4.setForeground(new java.awt.Color(0, 102, 102)); jLabel4.setText("PRICE"); jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 18)); jLabel5.setForeground(new java.awt.Color(0, 102, 102)); jLabel5.setText("GYM FACIILTY"); ClearCmdButton.setFont(new java.awt.Font("Times New Roman", 1, 18)); ClearCmdButton.setForeground(new java.awt.Color(0, 102, 102)); ClearCmdButton.setText("CLEAR"); ClearCmdButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ClearCmdButtonActionPerformed(evt); } }); ExitCmdButton.setFont(new java.awt.Font("Times New Roman", 1, 18)); ExitCmdButton.setForeground(new java.awt.Color(0, 102, 102)); ExitCmdButton.setText("EXIT"); ExitCmdButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ExitCmdButtonActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(214, 214, 214) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jLabel5) .addComponent(jLabel2) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(40, 40, 40) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jTextField4, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addComponent(jTextField3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE) .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE))) .addGroup(layout.createSequentialGroup() .addGap(81, 81, 81) .addComponent(ClearCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(143, 143, 143) .addComponent(ExitCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE))) .addContainerGap(39, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(91, 91, 91) .addComponent(jLabel1) .addContainerGap(93, Short.MAX_VALUE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(26, 26, 26) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))))) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addGap(69, 69, 69) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField1) .addComponent(jLabel2)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3)) .addGap(30, 30, 30) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) .addGap(26, 26, 26) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel5)) .addGap(65, 65, 65) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(ClearCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(ExitCmdButton, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(41, 41, 41)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(67, 67, 67) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jSeparator2, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 248, Short.MAX_VALUE)) .addGap(110, 110, 110))) ); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.7318948", "0.7290426", "0.7290426", "0.7290426", "0.7284922", "0.7247965", "0.7213206", "0.72080696", "0.7195916", "0.7189941", "0.71835536", "0.71579427", "0.7147217", "0.70927703", "0.7080282", "0.7055882", "0.6987108", "0.69770193", "0.6954159", "0.69529283", "0.6944756...
0.0
-1
The Game constructor is used to create a new game instance to track game progress.
public Game() { this.players = new Player[Config.PlayerLimit]; this.resetGame(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Game() {}", "public Game() {\n\n\t}", "public Game() {\n }", "public Game() {\n\n GameBoard gameBoard = new GameBoard();\n Renderer renderer = new Renderer(gameBoard);\n }", "public Game(){\n\n }", "public Game()\n {\n // initialise instance variables\n play...
[ "0.76979506", "0.76940507", "0.7677524", "0.76167434", "0.75755113", "0.7387691", "0.73847973", "0.7367482", "0.73578364", "0.73447645", "0.7332422", "0.72944003", "0.72893715", "0.7262542", "0.7225731", "0.71399796", "0.7105542", "0.7095395", "0.70819426", "0.70690644", "0.7...
0.6758834
39
The resetGame instance method is used to reset the game object back to its default state.
public void resetGame() { this.inProgress = false; this.round = 0; this.phase = 0; this.prices = Share.generate(); int i = 0; while(i < this.prices.size()) { this.prices.get(i).addShares(Config.StartingStockPrice); ++i; } int p = 0; while(p < Config.PlayerLimit) { if(this.players[p] != null) { this.players[p].reset(); } ++p; } this.deck = Card.createDeck(); this.onTable = new LinkedList<>(); Collections.shuffle(this.deck); this.dealToTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void reset(MiniGame game) {\n }", "public void resetGame() {\r\n\r\n\t\tplayerScore = 0;\r\n\t\tframe.setVisible(false);\r\n\t\tgame = new Game();\r\n\r\n\t}", "@Override\n public void resetGame() {\n\n }", "private void resetGame(){\n\n }", "public void resetGame(){\n\t\t...
[ "0.8372879", "0.8242723", "0.8198773", "0.81964046", "0.80499667", "0.8040182", "0.80287826", "0.79989046", "0.79198545", "0.7874916", "0.7842612", "0.780214", "0.7715352", "0.7708213", "0.76820606", "0.76223934", "0.75863963", "0.7548463", "0.75316286", "0.7512772", "0.74869...
0.7204229
34
The dealToTable instance method is used to deal fresh cards from the deck to the table.
private void dealToTable() { this.onTable.clear(); if(this.deck.size() >= Config.TableCards) { this.onTable.addAll(this.deck.subList(0, Config.TableCards)); this.deck = this.deck.subList(Config.TableCards, this.deck.size()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void deal(){\n\t\tInteger topRank;\n\t\tInteger btmRank;\n\t\tDouble[] currPercent = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};\n\t\tlastRaise = -1;\n\t\tcurrBet = 3.0;\n\t\tfor (int i = 0; i<tablePlayers.length*2+5; i++) {\n\t\t\tif (i<tablePlayers.length) {\n\t\t\t\ttablePlayers[i].setCard1(deck[i]); \n\t...
[ "0.5949106", "0.5946713", "0.5899441", "0.5846753", "0.58383924", "0.5826058", "0.58257776", "0.58129877", "0.5796115", "0.57738906", "0.57240283", "0.5716875", "0.5674992", "0.56350666", "0.562432", "0.56077343", "0.5606883", "0.5538377", "0.55191183", "0.549962", "0.547814"...
0.8226038
0
The cardsOnTable instance method is used to get the list of cards currently on the table.
public List<Card> cardsOnTable() { return this.onTable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Card> getCards() {\n return new ArrayList<Card>(cards);\n }", "@Override\n\tpublic List<Card> findAllCard() {\n\t\treturn cb.findAllCard();\n\t}", "public List<Card> getCards(){\r\n\t\treturn cards;\r\n\t}", "public List<Card> findAllCards();", "public List<Card> getCards() {\n\t\tret...
[ "0.68857574", "0.6834336", "0.6828815", "0.6815238", "0.67658556", "0.6755368", "0.66971934", "0.6637439", "0.6561376", "0.65366036", "0.65322083", "0.65016425", "0.65003777", "0.6499346", "0.6495082", "0.64055824", "0.63896334", "0.6385005", "0.6382844", "0.6347153", "0.6324...
0.8553714
0
The trigger method is used to respond to a player readying up.
public void trigger() { if(!this.inProgress && this.round >= Config.RoundLimit) { this.sendMessages(new String[]{"The game has already ended."}); } else { int count = this.playerCount(); if(count > 1 && count - this.readyCount() == 0) { List<String> messages = new LinkedList<>(); if(this.inProgress) { if(Config.Phases[this.phase].equals(Config.VotePhaseName)) { messages.add("Voting ended. Counting votes."); // Sum all the votes from each player. int[] votes = new int[Config.TableCards]; for(Player player : this.players) { if(player != null) { int[] playerVotes = player.getVotes(); int i = 0; while(i < playerVotes.length) { if(playerVotes[i] != 0) { votes[i] += playerVotes[i]; } ++i; } player.resetVotes(); } } // Pick the cards with more yes votes than no votes. List<Card> picked = new LinkedList<>(); int pos = 0; while(pos < this.onTable.size()) { if(votes[pos] > 0) { Card card = this.onTable.get(pos); picked.add(card); for(Share price : this.prices) { if(price.getStock().equals(card.stock)) { price.addShares(card.effect); break; } } } ++pos; } // Prepare the output string for the picked cards. String message = ""; boolean isNotFirst = false; for(Card card : picked) { if(isNotFirst) { message += ", "; } else { isNotFirst = true; } message += card.stock; if(card.effect > 0) { message += "+"; } message += card.effect; } this.dealToTable(); messages.add("Picked influence cards: " + message); messages.add(""); } ++this.phase; if(this.phase >= Config.Phases.length) { this.phase = 0; ++this.round; if(this.round >= Config.RoundLimit) { this.stopGame(); Share[] prices = this.prices.toArray(new Share[0]); for(Player player : this.players) { if(player != null) { player.sellAll(prices); } } messages.add("Game over. Scores:"); // Copy and sort the players list by total money. Player[] winners = Arrays.copyOf(this.players, this.players.length); Arrays.sort(winners, (Player o1, Player o2) -> { if(o1 == null && o2 == null) { return 0; } else if(o1 == null) { return 1; } else if(o2 == null) { return -1; } else { return o2.getMoney() - o1.getMoney(); } }); int lastScore = winners[0].getMoney(); int num = 0; int i = 0; while(i < winners.length) { if(winners[i] == null) { break; } else { if(lastScore > winners[i].getMoney()) { num = i; } messages.add(Config.PlayerPositions[num] + ": Player " + winners[i].getPlayerNumber() + ", " + winners[i].getName() + " - " + Config.Currency + winners[i].getMoney()); } ++i; } } else { messages.add("Round " + (this.round + 1) + " of " + Config.RoundLimit + "."); messages.add(Config.Phases[this.phase] + " phase started."); } } else { messages.add(Config.Phases[this.phase] + " phase started."); } } else { this.inProgress = true; messages.add("Game started. Round " + (this.round + 1) + " of " + Config.RoundLimit + "."); messages.add(Config.Phases[this.phase] + " phase started."); } this.sendMessages(messages.toArray(new String[0])); for(Player player : this.players) { if(player != null) { player.setReady(false); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void playerWon()\r\n {\r\n \r\n }", "void trigger();", "public abstract void onTrigger();", "protected void roomAction() {\n if (this.count < 1 && !this.room.isTriggerSet())\n {\n System.out.println(\"Prisoner: \" + this.id + \" turns trigger on!\");\n this....
[ "0.6886458", "0.6803918", "0.6669573", "0.66227406", "0.65321314", "0.63903475", "0.63430965", "0.6313317", "0.63108456", "0.6290668", "0.6260295", "0.62048084", "0.6204701", "0.6192604", "0.6181876", "0.61772573", "0.61647135", "0.61595213", "0.61576736", "0.6147395", "0.613...
0.6151694
19
The playerCount instance method is used to get the number of currently connected players.
public int playerCount() { int count = 0; for(Player player: this.players) { if(player != null) { ++count; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getPlayerCount() {\n\t\treturn playerCount;\n\t}", "public int getPlayerCount() {\n \n \treturn playerCount;\n \t\n }", "public int playersCount(){\r\n\t\treturn players.size();\r\n\t}", "public int playerCount() {\n\t\treturn playerList.size();\n\t}", "public int getNumPlayers()...
[ "0.82681185", "0.8267662", "0.81939244", "0.8176777", "0.8141179", "0.8029487", "0.7968089", "0.79046917", "0.7861193", "0.7847334", "0.7752351", "0.7713133", "0.75327015", "0.74983364", "0.74870425", "0.74741316", "0.7451059", "0.7405569", "0.7370881", "0.7363518", "0.730545...
0.8205426
2
The readyCount instance method is used to get the number of players marked as ready.
public int readyCount() { int count = 0; for(Player player: this.players) { if(player != null) { if(player.isReady()) { ++count; } } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int readyCount ()\n\t{\n\t\tint count =0;\n\t\tIterator<Player> it = iterator();\n\t\twhile(it.hasNext())\n\t\t{\n\t\t\tPlayer p = it.next();\n\t\t\tif(p.available())\n\t\t\t\tcount++;\n\t\t}\n\t\treturn count;\n\t}", "int getNewlyAvailableQuestsCount();", "public int getAvailableCount();", "public in...
[ "0.84620833", "0.68994975", "0.6890458", "0.66155684", "0.6573826", "0.6557323", "0.64937717", "0.648371", "0.6416672", "0.6397754", "0.6391072", "0.6325577", "0.63246846", "0.63131607", "0.63087004", "0.6290155", "0.6271074", "0.6238433", "0.619113", "0.6171227", "0.61708003...
0.8617662
0
The getPrice instance method is used to get the current price of a stock.
public int getPrice(Stock stock) { for(Share share: this.prices) { if(share.getStock().equals(stock)) { return share.getShares(); } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public double getPrice(){\n \n return currentPrice; \n }", "public double getStockPrice() {\n\t\treturn stockPrice;\n\t}", "public Money getPrice() {\n\t\treturn price;\n\t}", "public BigDecimal getStock_price() {\n return stock_price;\n }", "public Double getP...
[ "0.79063666", "0.781557", "0.76037586", "0.75794786", "0.75559133", "0.7546828", "0.7546828", "0.753589", "0.7526091", "0.752348", "0.75163734", "0.7514892", "0.7508464", "0.75038743", "0.75038743", "0.75038743", "0.7490746", "0.74890155", "0.74873894", "0.7482088", "0.748148...
0.0
-1
The getPrices instance method is used to get the full list of current prices.
public List<Share> getPrices() { return this.prices; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Double> GetPrices()\r\n\t{\r\n\t\treturn dayStockPrices;\r\n\t}", "public ReservedInstancePriceItem [] getPrices() {\n return this.Prices;\n }", "public static Vector<Company> getAllPrices(){\n\t\treturn all_prices;\n\t}", "Price[] getTradePrices();", "public PriceList getPriceLi...
[ "0.78247297", "0.77679914", "0.75758", "0.72160065", "0.717855", "0.7120052", "0.70184404", "0.69153816", "0.6892907", "0.68544656", "0.6843557", "0.6772173", "0.6647583", "0.6639269", "0.6604595", "0.6602248", "0.6523243", "0.6463167", "0.64497477", "0.64132816", "0.63781005...
0.75046736
3
The getPlayers instance method is used to get the list of currently connected players.
public Player[] getPlayers() { return this.players; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<Player> getPlayers() {\r\n return players;\r\n }", "public List<Player> getPlayers() {\r\n\t\treturn players;\r\n\t}", "public List<Player> getPlayers() {\n\n\t\treturn players;\n\t}", "public List<Player> getPl...
[ "0.79977614", "0.79977614", "0.7964292", "0.79313743", "0.7915567", "0.7910655", "0.7873358", "0.78220856", "0.78201693", "0.780598", "0.7802151", "0.77900636", "0.77395314", "0.77046937", "0.7704655", "0.763593", "0.76280755", "0.7622997", "0.75699437", "0.75699437", "0.7555...
0.75324
22
The getRound instance method is used to get the current round.
public int getRound() { return this.round; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getCurrentRound()\n\t{\n \treturn currentRound;\n\t}", "public int getCurrentRound() {\n\t\treturn roundNumber;\n\t}", "public Round getRound(){\n return mRound;\n }", "public Integer getRound() {\n return round;\n }", "public int getRound() {\n return round;\n }...
[ "0.84180677", "0.8356365", "0.82741916", "0.821651", "0.8107867", "0.7925991", "0.7807371", "0.7766279", "0.7673339", "0.70740855", "0.7065951", "0.68071645", "0.6768157", "0.6676699", "0.66464734", "0.66136074", "0.64570737", "0.6410125", "0.6275228", "0.6158244", "0.6126895...
0.80654335
5
The getPhase instance method is used to get the current phase.
public int getPhase() { return this.phase; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int getPhase() {\n return this.phase;\n }", "public int getPhase() {\n return this.phase;\n }", "public Integer getPhase() {\n return phase;\n }", "public String getPhase() {\n\t\treturn phase;\n\t}", "public Phase getD_CurrentPhase() {\n return d_CurrentP...
[ "0.84086406", "0.8405662", "0.8339386", "0.8243151", "0.81131893", "0.79948896", "0.79521406", "0.7731136", "0.77106464", "0.74260104", "0.7217502", "0.716918", "0.71565753", "0.6990769", "0.6731599", "0.6607765", "0.6467386", "0.6461022", "0.6445761", "0.6109343", "0.5856984...
0.83340263
3
The isInProgress instance method is used to check if a game is in progress.
public boolean isInProgress() { return this.inProgress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean isInProgress() {\n\t\treturn false;\r\n\t}", "public boolean isInGame() {\n return this.hasStarted;\n }", "boolean hasProgress();", "boolean hasProgress();", "boolean isGameComplete();", "public boolean hasProgress();", "private boolean hasInProgressAttempt(Queue...
[ "0.73214716", "0.6756821", "0.6575066", "0.6575066", "0.6550368", "0.6513505", "0.64501417", "0.64220613", "0.6275364", "0.62673223", "0.6253216", "0.61739945", "0.6169875", "0.60692513", "0.6064543", "0.6056077", "0.60463893", "0.6041199", "0.6021367", "0.5953381", "0.594474...
0.7839518
0
The stopGame instance method is used to end the game.
public void stopGame() { this.inProgress = false; if(this.round == 0) { ++this.round; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void stopGame() {\n\t\tgetGameThread().stop();\n\t\tgetRenderer().stopRendering();\n\t}", "public synchronized void stopGame(){\n \t\tif (running){\n \t\t\trunning = false;\n \t\t}\n \t}", "public void stopGame() {\r\n\t\tif (logger.isDebugEnabled())\r\n\t\t\tlogger.debug(\"Stop\");\r\n\t\t\r\n\t\tif (s...
[ "0.8672555", "0.86236274", "0.8618185", "0.8360121", "0.83188444", "0.82794267", "0.82311434", "0.8006411", "0.7994857", "0.7773786", "0.77678716", "0.7737656", "0.771298", "0.76491565", "0.76461816", "0.761492", "0.7474701", "0.74675405", "0.7280287", "0.7168279", "0.7148678...
0.73546755
18
The sendMessages instance method is used to send a list of messages to all connected players.
public void sendMessages(String[] messages) { for(Player player: this.players) { if(player != null) { player.sendMessages(messages); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sendMessages(List<String> messages) {\n if (!this.isConnectedToClientServer){return;}\n for (String message : messages){\n try {\n outputQueue.put(message);\n break;\n //board is sending a ball message about this ball, which means th...
[ "0.67061657", "0.6358617", "0.6329156", "0.6314923", "0.62853146", "0.62835634", "0.6251713", "0.62020797", "0.6196456", "0.61734086", "0.6167636", "0.6112832", "0.61036706", "0.6102614", "0.6099181", "0.6061626", "0.6057576", "0.6001087", "0.5979728", "0.59749204", "0.597004...
0.74275255
0
/ Initialize standard Hardware interfaces
public void init(HardwareMap ahwMap) { // Save reference to Hardware map hwMap = ahwMap; // Define and Initialize Motors // leftRearMotor = hwMap.dcMotor.get("left_rear_drive"); // rightRearMotor = hwMap.dcMotor.get("right_rear_drive"); leftFrontMotor = hwMap.dcMotor.get("left_front_drive"); rightFrontMotor = hwMap.dcMotor.get("right_front_drive"); // liftMotor = hwMap.dcMotor.get("lift_motor"); brushMotor = hwMap.dcMotor.get("brush_motor"); leftSpinMotor = hwMap.dcMotor.get("left_spin_motor"); rightSpinMotor = hwMap.dcMotor.get("right_spin_motor"); tiltMotor = hwMap.dcMotor.get("tilt_motor"); // rangeSensor = hwMap.get(ModernRoboticsI2cRangeSensor.class, "range sensor"); //define and initialize servos // loadServo = hwMap.servo.get("load_servo"); // loadServo.setPosition(BEGIN_SERVO); pushServo = hwMap.servo.get("push_servo"); pushServo.setPosition(MID_SERVO); leftLiftServo = hwMap.servo.get("left_lift_servo"); leftLiftServo.setPosition(MID_SERVO); rightLiftServo = hwMap.servo.get("right_lift_servo"); rightLiftServo.setPosition(MID_SERVO); //define and initialize buttons // bottomTouchButton = hwMap.touchSensor.get("bottom_touch_button"); // topTouchButton = hwMap.touchSensor.get("top_touch_button"); leftSpinMotor.setDirection(DcMotor.Direction.REVERSE); leftFrontMotor.setDirection(DcMotor.Direction.REVERSE); // Set to REVERSE if using AndyMark motors rightFrontMotor.setDirection(DcMotor.Direction.FORWARD); // Set to FORWARD if using AndyMark motors // Set all motors to zero power // leftRearMotor.setPower(0); // rightRearMotor.setPower(0); leftFrontMotor.setPower(0); rightFrontMotor.setPower(0); // liftMotor.setPower(0); brushMotor.setPower(0); leftSpinMotor.setPower(0); rightSpinMotor.setPower(0); tiltMotor.setPower(0); // Set all motors to run without encoders. // May want to use RUN_USING_ENCODERS if encoders are installed. // leftRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // rightRearMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); leftFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); rightFrontMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // liftMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); brushMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); leftSpinMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); // rightSpinMotor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER); tiltMotor.setMode(DcMotor.RunMode.RUN_USING_ENCODER); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initHardware(){\n }", "protected abstract void initHardwareInstructions();", "public void initDevice() {\r\n\t\t\r\n\t}", "@Override\n public void init() {\n imu = new IMU(hardwareMap, \"imu\");\n left = hardwareMap.get(DcMotor.class, \"left\");\n right = hardwareMap.g...
[ "0.8218544", "0.73745877", "0.72169113", "0.6796372", "0.6724548", "0.6694773", "0.6593789", "0.65810317", "0.6566287", "0.6544252", "0.65379685", "0.65292406", "0.65153146", "0.6504885", "0.6436474", "0.6425336", "0.6412519", "0.64116925", "0.64075726", "0.6403585", "0.63959...
0.61488396
48
waitForTick implements a periodic delay. However, this acts like a metronome with a regular periodic tick. This is used to compensate for varying processing times for each cycle. The function looks at the elapsed cycle time, and sleeps for the remaining time interval.
public void waitForTick(long periodMs) throws InterruptedException { long remaining = periodMs - (long)period.milliseconds(); // sleep for the remaining portion of the regular cycle period. if (remaining > 0) Thread.sleep(remaining); // Reset the cycle clock for the next pass. period.reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void waitForTick(long periodMs) throws InterruptedException {\n\n long remaining = periodMs - (long)period.milliseconds();\n\n // sleep for the remaining portion of the regular cycle period.\n if (remaining > 0)\n Thread.sleep(remaining);\n\n // Reset the cycle clock for t...
[ "0.7622029", "0.75536036", "0.7522144", "0.7517583", "0.73249257", "0.7297914", "0.7264519", "0.636563", "0.5797119", "0.5728334", "0.56351984", "0.55938864", "0.55850667", "0.5576087", "0.5488821", "0.5452249", "0.5356256", "0.5310051", "0.52522993", "0.5249029", "0.52489555...
0.7514138
5
Implemented by keywords that precede the WITH statement.
public interface BeforeWith<T extends BeforeWith<T>> extends QueryPart, QueryPartSQL<T>, QueryPartLinked<T> { /** * Continue query with WITH * * @param name The name of the with-block * @return The new WITH statement */ default With with(final String name) { return new With(this, name); } /** * Accept an existing WITH statement as predecessor * * @param with The existing WITH statement * @return Returns the passed WITH statement */ default With with(final With with) { return with.parent(this); } /** * Use plain SQL to form this WITH statement * * @param sql The sql string * @return The new WITH statement */ default With withSQL(final String sql) { return with((String) null).sql(sql); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ParseTree parseWithStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.WITH);\n eat(TokenType.OPEN_PAREN);\n ParseTree expression = parseExpression();\n eat(TokenType.CLOSE_PAREN);\n ParseTree body = parseStatement();\n return new WithStatementTree(getTreeLoc...
[ "0.634191", "0.5309057", "0.5291128", "0.5236089", "0.52353394", "0.5211241", "0.52087605", "0.5180937", "0.5144532", "0.5136329", "0.5131977", "0.50836205", "0.5082199", "0.50676763", "0.5000713", "0.4976135", "0.49729675", "0.49356726", "0.4934884", "0.4927079", "0.48920164...
0.6408788
0
Continue query with WITH
default With with(final String name) { return new With(this, name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void applyToQuery(DatabaseQuery theQuery, GenerationContext context);", "public interface BeforeWith<T extends BeforeWith<T>> extends QueryPart, QueryPartSQL<T>, QueryPartLinked<T> {\r\n\r\n\t/**\r\n\t * Continue query with WITH\r\n\t *\r\n\t * @param name The name of the with-block\r\n\t * @retu...
[ "0.51794016", "0.5172465", "0.51546013", "0.51300955", "0.51294535", "0.50884265", "0.49982187", "0.49654195", "0.49580547", "0.49138653", "0.49109137", "0.48987406", "0.4883453", "0.4872609", "0.48671827", "0.48521683", "0.48320463", "0.48302302", "0.48234868", "0.48220164", ...
0.0
-1
Accept an existing WITH statement as predecessor
default With with(final With with) { return with.parent(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ParseTree parseWithStatement() {\n SourcePosition start = getTreeStartLocation();\n eat(TokenType.WITH);\n eat(TokenType.OPEN_PAREN);\n ParseTree expression = parseExpression();\n eat(TokenType.CLOSE_PAREN);\n ParseTree body = parseStatement();\n return new WithStatementTree(getTreeLoc...
[ "0.6766358", "0.6666881", "0.49690145", "0.49477813", "0.4942035", "0.493057", "0.48435014", "0.48421955", "0.48006582", "0.47915897", "0.47484758", "0.46888533", "0.46482936", "0.46227553", "0.46044135", "0.45949382", "0.45571828", "0.45243528", "0.45065513", "0.44965035", "...
0.5486227
2
Use plain SQL to form this WITH statement
default With withSQL(final String sql) { return with((String) null).sql(sql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SELECT createSELECT();", "public interface BeforeWith<T extends BeforeWith<T>> extends QueryPart, QueryPartSQL<T>, QueryPartLinked<T> {\r\n\r\n\t/**\r\n\t * Continue query with WITH\r\n\t *\r\n\t * @param name The name of the with-block\r\n\t * @return The new WITH statement\r\n\t */\r\n\tdefault With with(final...
[ "0.598458", "0.59490705", "0.5808424", "0.5266306", "0.5196228", "0.5196002", "0.5188849", "0.5161675", "0.5148545", "0.513405", "0.50437915", "0.5043681", "0.5039633", "0.50248593", "0.50087214", "0.49994987", "0.4968628", "0.4951153", "0.49459863", "0.49439287", "0.49414614...
0.6276536
0
TODO: Implement this method
@Override public void onCreate ( Bundle savedInstanceState, PersistableBundle persistentState ) { super.onCreate(savedInstanceState, persistentState); setContentView(R.layout.form_persons); getActionBar().setDisplayHomeAsUpEnabled(true); name = (EditText) findViewById(R.id.eTextNamePerson); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t...
[ "0.6146684", "0.5972078", "0.5951665", "0.5893627", "0.5893573", "0.58674604", "0.57714313", "0.57463145", "0.5679119", "0.5679119", "0.56602454", "0.5640005", "0.56188494", "0.5614183", "0.5613904", "0.5604922", "0.55885965", "0.5585748", "0.5544809", "0.5542787", "0.5460681...
0.0
-1
/ Define a constructor which expects two parameters width and height here.
public Rectangle(int w, int h) { this.width = w; this.height = h; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Picture(int width, int height)\n {\n // let the parent class handle this width and height\n super(width,height);\n }", "public Picture(int width, int height)\n {\n // let the parent class handle this width and height\n super(width,height);\n }", "public Size(double width, double height)\...
[ "0.76474863", "0.76474863", "0.74248964", "0.73131216", "0.71495456", "0.70131725", "0.7012864", "0.700418", "0.6930825", "0.6913676", "0.6906826", "0.68476236", "0.6815502", "0.6815362", "0.6809706", "0.6807199", "0.6792909", "0.6762098", "0.6741957", "0.67383784", "0.672274...
0.64253557
36
/ Define a public method `getArea` which can calculate the area of the rectangle and return.
public int getArea() { return this.height * this.width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Rectangle getArea() {\n return area;\n }", "double getArea();", "double getArea();", "public double getArea();", "public double getArea();", "public double getArea();", "public abstract double getArea();", "public abstract double getArea();", "public abstract double getArea();", ...
[ "0.86227924", "0.85988116", "0.85988116", "0.8512758", "0.8512758", "0.8512758", "0.83431387", "0.83431387", "0.83431387", "0.816596", "0.8127072", "0.8032444", "0.8002692", "0.79883236", "0.79846734", "0.7958184", "0.7939954", "0.7937622", "0.79369825", "0.79349893", "0.7898...
0.79060817
20
no physicsComponent for this entity handleCollision should be associated with PhysicsComponent instead of Entity, but it is not worth extending PhysicsComponent until subclasses can be used more than once
@Override public void handleCollision(Contact contact) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void collide(Entity e) {\n\n\t}", "public abstract void collideWith(Entity entity);", "public void applyEntityCollision(Entity entityIn) {\n }", "@Override\n\tpublic void onCollision(Entity collidedEntity)\n\t{\n\t\t\n\t}", "public void handleCollision(Collision c);", "@Override\r\n...
[ "0.71062845", "0.70843774", "0.7038629", "0.6964459", "0.6927745", "0.67602766", "0.67225546", "0.66811246", "0.63855517", "0.6380392", "0.63437396", "0.6339132", "0.63268775", "0.63217974", "0.6292759", "0.62703156", "0.6256576", "0.624683", "0.6228343", "0.62248147", "0.621...
0.7293603
0
Script Name : AddlistviewRow_E2E_Android Generated : Sep 19, 2011 9:21:47 AM Description : Functional Test Script Original Host : WinNT Version 5.1 Build 2600 (S)
public void testMain(Object[] args) { // TODO Insert code here WN.useProject(Cfg.projectName); EE.runSQL(new ScrapbookCP().database("sampledb") .type("Sybase_ASA_12.x").name("My Sample Database"), GlobalConfig.getRFTProjectRoot()+"/testscript/Workflow/Screens/setup/add_a_b.sql"); EE.dnd("Database Connections->My Sample Database->sampledb->Tables->wf_ff_a (dba)"); EE.dnd("Database Connections->My Sample Database->sampledb->Tables->wf_ff_b (dba)"); WN.createRelationship(new Relationship() .startParameter(WN.mboPath(Cfg.projectName, "Wf_ff_a")) .target("Wf_ff_b") .mapping("aid,aid") .composite("true") .type(Relationship.TYPE_OTM)); WN.deployProject(new DeployOption().startParameter(Cfg.projectName) .server("My Unwired Server") .mode(DeployOption.MODE_REPLACE) .serverConnectionMapping("My Sample Database,sampledb")); WN.createWorkFlow(new WorkFlow().startParameter(Cfg.projectName) .name("myWF") .option(WorkFlow.SP_SERVER_INIT) .mbo("Wf_ff_a") .objectQuery("findByPrimaryKey") .subject("dept_id=1") .subjectMatchingRule("dept_id=") .setParameterValue("aid,Subject,dept_id=")); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffa")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("WfffaDetail")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffacreate")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffadeleteinstance")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffaupdateinstance")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffb")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("WfffbDetail")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffbupdateinstance")).performTest(); vpManual("screen", true, WorkFlowEditor.hasScreen("Wfffbadd")).performTest(); MainMenu.saveAll(); WFCustomizer.runTest(new WorkFlowPackage() .startParameter(WN.filePath(Cfg.projectName, "myWF")) .unwiredServer("My Unwired Server") .deployToServer("true") .assignToSelectedUser(Cfg.deviceUser), customTestScript(), // "tplan.Workflow.iconcommon.BB.server_dt_icon.Script", new CallBackMethod().receiver(WorkFlowEditor.class) .methodName("sendNotification") .parameter(new Email() .unwiredServer("My Unwired Server") .selectTo(Cfg.deviceUser) .subject("dept_id=1"))); sleep(1); //need to check data the backend DB vpManual("db",1,getDB("select * from Wf_ff_b where bid = 4 and aid = 1 and bname ='Bfour' ")).performTest(); // java.util.List<String> clause = new ArrayList<String>(); // clause.add("bid=4"); // clause.add("aid=1"); // clause.add("bname='Bfour'"); // vpManual("dbresult", 1, CDBUtil.getRecordCount("localhost", "wf1", "Wf_ff_b", clause)).performTest(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public native void appendRow(List<TableViewRow> rows) /*-{\n\t\tvar jso = this.@com.emitrom.ti4j.core.client.ProxyObject::getJsObj()();\n\t\tjso\n\t\t\t\t.appendRow(@com.emitrom.ti4j.mobile.client.ui.TableViewRow::fromList(Ljava/util/List;)(rows));\n }-*/;", "public void onGoToListViewClicked(View view) {\n\n...
[ "0.5620522", "0.5528805", "0.5508734", "0.54759514", "0.54742265", "0.5334922", "0.5334096", "0.53206533", "0.5306363", "0.5261322", "0.5237651", "0.5224749", "0.52095425", "0.52028304", "0.5193556", "0.5147347", "0.5144099", "0.5119734", "0.5076978", "0.501954", "0.5014343",...
0.0
-1
it would be better to left join qfileEntity to fileEntity and look for row where the left part is null, but does not allow to join table in a delete query :/
@Override public Long deleteUnreferenced(String fileType, RelationalPathBase<?> relationalPathBase, NumberPath<Long> column) { return transactionManagerQuerydsl .delete(QFile.file) .where(QFile.file.fileType.eq(fileType)) .where(QFile.file.id.notIn( JPAExpressions .select(column) .from(relationalPathBase) )) .execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void excluir(Filme f) {\r\n\r\n //Pegando o gerenciador de acesso ao BD\r\n EntityManager gerenciador = JPAUtil.getGerenciador();\r\n\r\n //Iniciar a transação\r\n gerenciador.getTransaction().begin();\r\n\r\n //Para excluir tem que dar o merge primeiro para \r\n //...
[ "0.534569", "0.52749735", "0.5262316", "0.52498096", "0.52443844", "0.52227706", "0.5174608", "0.5161461", "0.5104213", "0.5100908", "0.5073581", "0.50029105", "0.49771118", "0.49635103", "0.49566618", "0.4917879", "0.48915514", "0.48864272", "0.48738977", "0.48689118", "0.48...
0.53296584
1
accessor methods package methods protected methods private methods
private void initializeComponents() throws Exception { // get locale. DfkUserInfo ui = (DfkUserInfo)getUserInfo(); Locale locale = httpRequest.getLocale(); // initialize pul_Area. _pdm_pul_Area = new WmsAreaPullDownModel(pul_Area, locale, ui); // initialize pul_WorkFlag. _pdm_pul_WorkFlag = new DefaultPullDownModel(pul_WorkFlag, locale, ui); // initialize pager control. _pager = new PagerModel(new Pager[]{pgr_U, pgr_D}, locale); // initialize lst_StorageRetrievalResultList. _lcm_lst_StorageRetrievalResultList = new ListCellModel(lst_StorageRetrievalResultList, LST_STORAGERETRIEVALRESULTLIST_KEYS, locale); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_REGIST_DATE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_REGIST_TIME, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_ITEM_CODE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_ITEM_NAME, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_LOT_NO, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_INC_DEC_TYPE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_JOB_TYPE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_AREA_NO, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_LOCATION_NO, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_INC_DEC_QTY, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_STORAGE_DATE, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_STORAGE_TIME, true); _lcm_lst_StorageRetrievalResultList.setToolTipVisible(KEY_LST_USER_NAME, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "private Get() {}", "private Get() {}", "protected abstract MethodDescription accessorMethod();", "@Override\n public void get() {}", "private stendhal() {\n\t}", "private PropertyAccess() {\n\t...
[ "0.64094245", "0.6400707", "0.63424176", "0.63424176", "0.6269189", "0.6267352", "0.6205872", "0.6133806", "0.6047557", "0.6042094", "0.6042094", "0.60241544", "0.6018622", "0.600183", "0.59663707", "0.592365", "0.59089446", "0.5888522", "0.5887451", "0.5879395", "0.585674", ...
0.0
-1
utility methods Returns current repository info for this class
public static String getVersion() { return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Repository getRepository();", "public String getRepository() {\n return repository;\n }", "public String getRepository() {\n return repository;\n }", "public String getLocalRepository() {\r\n return localRepository;\r\n }", "public Repository getRepository() {\n return mR...
[ "0.71555", "0.7154877", "0.7154877", "0.7063313", "0.68738824", "0.6668143", "0.66567254", "0.6614322", "0.6581406", "0.6579891", "0.6554382", "0.6511588", "0.6510712", "0.6489127", "0.6402426", "0.63694924", "0.63687754", "0.6332049", "0.6325409", "0.62988627", "0.62966025",...
0.0
-1
Este metodo compara los RUT ingresados con los RUT registrados de los clientes. Si el RUT coincide se devuelve un boolean true, si no coincide con ningun RUT se retorna un false.
public boolean compararRut(String dato1, SisCliente sCliente){ for(int i=0; i<sCliente.listaClientes.size(); i++){ if(dato1.equals(sCliente.listaClientes.get(i).getRut())){ System.out.println("RUT encontrado"); existe = true; break; }else{ System.out.println("RUT no encontrado"); existe = false; } } return existe; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean verificarCliente(int cedulaCliente) {\n for (int i = 0; i < posicionActual; i++) { //Recorre hasta la posicon actual en la que se estan agregando datos, osea en la ultima en que se registro.\n if (getCedulaCliente(i) == cedulaCliente) { //Pregunta si la cedula pasada por parametro...
[ "0.6164433", "0.60459006", "0.5978634", "0.58812094", "0.58024484", "0.5777989", "0.5769511", "0.57445097", "0.571856", "0.5554237", "0.5537599", "0.5532346", "0.5510153", "0.5475851", "0.54632145", "0.54622984", "0.54596406", "0.5457807", "0.5436019", "0.5423242", "0.5406537...
0.73634744
0
Este metodo separa el RUT del cliente a formato xx.xxx.xxxx.
public ArrayList separarRut(String rut){ this.lista = new ArrayList<>(); if(rut.length()==12 || rut.length()==11){ if(rut.length()==12){ this.lista.add(Character.toString(rut.charAt(0))+Character.toString(rut.charAt(1))); this.lista.add(Character.toString(rut.charAt(3))+Character.toString(rut.charAt(4))+Character.toString(rut.charAt(5))); this.lista.add(Character.toString(rut.charAt(7))+Character.toString(rut.charAt(8))+Character.toString(rut.charAt(9))); this.lista.add(Character.toString(rut.charAt(11))); }else{ this.lista.add(Character.toString(rut.charAt(0))); this.lista.add(Character.toString(rut.charAt(2))+Character.toString(rut.charAt(3))+Character.toString(rut.charAt(4))); this.lista.add(Character.toString(rut.charAt(6))+Character.toString(rut.charAt(7))+Character.toString(rut.charAt(8))); this.lista.add(Character.toString(rut.charAt(10))); } } return this.lista; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getIPCliente(){//192.168, 172.16. o 10.0.\n\t\tString ipAddress=\"\";\n\t\ttry{\n\t\t\tHttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n\t\t\tipAddress = request.getHeader(\"X-FORWARDED-FOR\");\n\t\t\tif ( ipAddress == null...
[ "0.65344054", "0.58736557", "0.5787115", "0.5787115", "0.5772045", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.5768959", "0.57436585", "0.57093346", "0.5690034", "0.567917", "0.567917", "0.5607276", "0.560507", "0.54845285", ...
0.0
-1
Este metodo limita el numero de caracteres ingresados en los JTextfields.
public void limitarCaracteres(JTextField l, int nmax){ l.addKeyListener(new KeyAdapter(){ @Override public void keyTyped(KeyEvent e){ if (l.getText().length()==nmax){ e.consume();} } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setCharLimitOnFields() {\n Common.setCharLimit(nameField, Constants.CHAR_LIMIT_NORMAL);\n Common.setCharLimit(addressField, Constants.CHAR_LIMIT_LARGE);\n Common.setCharLimit(postalField, Constants.CHAR_LIMIT_NORMAL);\n Common.setCharLimit(phoneField, Constants.CHAR_LIMIT_N...
[ "0.6850491", "0.63665223", "0.6061864", "0.5951577", "0.58666635", "0.5833398", "0.57716674", "0.57375383", "0.5727599", "0.5723752", "0.5710528", "0.5665955", "0.5653749", "0.56394434", "0.56297976", "0.5608447", "0.5568516", "0.5542471", "0.553556", "0.55289686", "0.5514864...
0.7250425
0
Returns an iterator over all noncleared values.
public Iterator<T> iterator() { return new ReferentIterator(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Iterator<Value> iterator() {\n\t\treturn null;\n\t}", "final Iterator<T> iterateAndClear() {\n\t\t// Iteration is atomically destructive.\n\t\tObject iteratedValue = value.getAndSet(null);\n\t\treturn new IteratorImpl<>(iteratedValue);\n\t}", "public Iterator getValues() {\n synchro...
[ "0.73889536", "0.729965", "0.70907706", "0.7082149", "0.6993631", "0.6827973", "0.68039465", "0.6775363", "0.6738598", "0.67060715", "0.6654691", "0.65793693", "0.65793693", "0.6492075", "0.6472839", "0.64588976", "0.6443766", "0.63897794", "0.6369789", "0.6367422", "0.636742...
0.0
-1
Removes all cleared references from the internal collection.
public void purge() { Iterator<T> it = iterator(); while (it.hasNext()) { it.next(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void clear() {\n collected.clear();\n }", "public void clear() {\n while (refqueue.poll() != null) {\n ;\n }\n\n for (int i = 0; i < entries.length; ++i) {\n entries[i] = null;\n }\n size = 0;\n\n while (refqueue.poll()...
[ "0.77582484", "0.77442646", "0.756711", "0.7560952", "0.75388986", "0.75304013", "0.74919575", "0.7444603", "0.74019647", "0.739601", "0.73880595", "0.73773044", "0.73653007", "0.7363943", "0.7316898", "0.7304284", "0.7292913", "0.72896785", "0.7287348", "0.7262513", "0.72533...
0.0
-1
Get the "root location" by location context name.
public static Location getLocationContext(String name) { return Location.contextNames.get(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getBundleLocation(String location) {\n\t\tint index = location.lastIndexOf(PREFIX_DELIMITER);\r\n\t\tString path = ((index > 0) ? location.substring(index + 1) : location);\r\n\t\t// clean up the path\r\n\t\tpath = StringUtils.cleanPath(path);\r\n\t\t// check if it's a folder\r\n\t\tif (path.endsWit...
[ "0.6137372", "0.59186673", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5916459", "0.5846729", "0.58462304", "0.5842318", "0.58355874", "0.582467", "0.582467", "0.582467", "0.582467", "0.58060133", "0.58060133", "0.58060133", ...
0.6708846
0
TOTAL COUNT: 10, for now!
public Executor(){ errorsMade = 0; decisionsMade = 0; //total number of decisions made accross all days // dailyBenchmark = 4; //number of apps that you shld get right disads = 0; numApps = 7; //number of apps in one day numDay = 1; errorThreshold = 3; //number of errors for one disadulation. threshold of 3 = 2 errors allowed. 3rd one is a disad. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getTotalCount();", "Long getAllCount();", "public int getTotalCount() {\n return totalCount;\n }", "int getResultsCount();", "int getResultsCount();", "public int getTotRuptures();", "@Override\n public long count() {\n return super.doCountAll();\n }", "@Ove...
[ "0.7915168", "0.75063235", "0.7253009", "0.7151748", "0.7151748", "0.71307576", "0.71072155", "0.71072155", "0.71072155", "0.7090294", "0.7061855", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0.70216936", "0...
0.0
-1
this will be rewritten once we're in processing!
public void compare(Application app, String userDecision){ int intDecision = -1; String decision = userDecision.toLowerCase(); if (decision.contains("harvard")){ // decision making will be replaced by BUTTONS in processing intDecision = 1; } if (decision.contains("greendale")){ intDecision = 0; } if (decision.contains("mit")){ intDecision = 2; } //catches bad user input in which they try to submit multiple colleges to cheat the system... nice try. if ((decision.contains("harvard") && decision.contains("mit")) || (decision.contains("harvard") && decision.contains("greendale")) || (decision.contains("mit") && decision.contains("greendale"))) { intDecision = -1; } if (intDecision == -1){ // catches bad user input, technically unnecessary but i like dissing people System.out.println("How can you call yourself an admissions officer when you can't even choose correctly?"); errorMade(); // runs failure }else if (intDecision == app.getCollege()){ System.out.println(printAcceptance(intDecision)); } else{ errorMade(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tpublic void processing() {\n\n\t}", "protected void additionalProcessing() {\n\t}", "@Override\n public void preprocess() {\n }", "@Override\n public void preprocess() {\n }", "public void preprocess() {\n }", "publ...
[ "0.71847457", "0.7160415", "0.6990437", "0.6663253", "0.6603203", "0.6421452", "0.6421452", "0.6421452", "0.6421452", "0.6400366", "0.6362756", "0.632073", "0.632073", "0.632073", "0.6317286", "0.61910623", "0.6126668", "0.6113758", "0.5982054", "0.5965684", "0.5941143", "0...
0.0
-1
more complex in processing yada yada
public String printAcceptance(int school){ int letterPicker = (int) (Math.random()*10); String accLetter = acceptanceLetter[letterPicker]; if (school == 0){ accLetter += "Greendale..?"; } if (school == 1){ accLetter += "Harvard!"; } if (school == 2){ accLetter += "MIT!"; } return accLetter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void processing();", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tpublic void processing() {\n\n\t}", "private void processData() {\n\t\tfloat S, M, VPR, VM;\n\t\tgetCal();\n\t\tgetTimestamps();\n\t\t\n \n\t\tfor(int i = 0; i < r.length; i++) {\n\t\t\t//get lux\n\t\t\tlux...
[ "0.5932722", "0.5830406", "0.58236116", "0.57979345", "0.5783375", "0.5644619", "0.5632119", "0.562075", "0.54783463", "0.54061776", "0.53511024", "0.5345127", "0.5329498", "0.5236988", "0.5232481", "0.5224075", "0.52178365", "0.5217408", "0.5217408", "0.5217408", "0.5217408"...
0.0
-1
will be slightly more complex in processing
public void showRules(Application app){ System.out.println("Here are your rules: \n • GPA >= " + app.getStand().getReqGPA() + "\n • SAT >= " + app.getStand().getReqSAT() + "\n • A valid intended major, either aligned towards STEM or Humanities." + "\n • Three valid extracurriculars. \n \t • A valid extracurricular is defined as a productive use of time and/or a standout accomplishment. \n \t • It must align with the student's STEM or Humanities focus. \n \t • All three extracurriculars must be valid. \n • A statement of purpose without spelling errors."); System.out.println(" • Students admitted to Harvard must have a passion for Humanities. Students admitted to MIT must have a passion for STEM. This can be determined through their intended major and extracurriculars, assuming both are valid."); System.out.println(" • All students with errors in their applications should be admitted to Greendale Community College."); System.out.println(); System.out.println("Good luck!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\r\n private void findAbdomenVOI() {\r\n \r\n // find the center of mass of the single label object in the sliceBuffer (abdomenImage)\r\n findAbdomenCM();\r\n int xcm = centerOfMass[0];\r\n int ycm = centerOfMass[1];\r\n\r\n ArrayList<Intege...
[ "0.54915345", "0.540406", "0.53858006", "0.53498703", "0.52877605", "0.5259809", "0.52222455", "0.52173066", "0.5217249", "0.5213142", "0.5183625", "0.51789826", "0.5160655", "0.51563305", "0.5154238", "0.5152134", "0.5145496", "0.51405036", "0.51327765", "0.5128358", "0.5125...
0.0
-1
might want to rewrite/rework this
public void gameOver(){ // will be more complex in processing (like a fadey screen or whatever, more dramatic) System.out.println(); System.out.println("Three strikes and you're out! You're FIRED!"); gameOver = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean func_70814_o() { return true; }", "@Override\r\n\t\t\tpublic void func02() {\n\t\t\t\t\r\n\t\t\t}", "private void poetries() {\n\n\t}", "private void kk12() {\n\n\t}", "public void method_4270() {}", "private static void cajas() {\n\t\t\n\t}", "@Override\n public void func_104112_b...
[ "0.549792", "0.5496047", "0.5480973", "0.54556537", "0.5447211", "0.5421305", "0.53785974", "0.5366508", "0.5366195", "0.53650194", "0.52914476", "0.52033865", "0.5187824", "0.5181645", "0.5174026", "0.51501405", "0.51469177", "0.5141178", "0.5140477", "0.5140477", "0.5140223...
0.0
-1
PURELY A JAVA THING!
public static void wait(int ms){ try { Thread.sleep(ms); } catch(InterruptedException ex) { Thread.currentThread().interrupt(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void cajas() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "private stendhal() {\n\t}", "public void method_4270() {}", "zzafe mo29840Y() throws RemoteException;", "public static void main(String[] args) throws Exception {\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}", "public static void main(Stri...
[ "0.62576336", "0.5752865", "0.5695815", "0.5679847", "0.565246", "0.5631891", "0.5571657", "0.55077386", "0.54996836", "0.54825145", "0.54823947", "0.54749167", "0.5466756", "0.54601514", "0.54404974", "0.54381454", "0.5417832", "0.5399428", "0.5378559", "0.53577995", "0.5333...
0.0
-1
loop through days, actually runs the thing
public static void main(String[] args){ Executor game = new Executor(); System.out.println(); System.out.println(); game.introduction(); while (! game.gameOver){ game.day(); if (! game.gameOver){ wait(2000); game.endOfDay(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void runEachDay() {\n \n }", "public void setupDays() {\n\n //if(days.isEmpty()) {\n days.clear();\n int day_number = today.getActualMaximum(Calendar.DAY_OF_MONTH);\n SimpleDateFormat sdf = new SimpleDateFormat(\"EEEE\");\n SimpleDateFormat sdfMonth = new Si...
[ "0.8416838", "0.64887184", "0.64507014", "0.637882", "0.6345973", "0.6304365", "0.6279529", "0.62520236", "0.61495286", "0.6113016", "0.60502464", "0.6020753", "0.59945357", "0.5982248", "0.5967224", "0.5963433", "0.5935323", "0.5899049", "0.58803177", "0.5876353", "0.5864902...
0.54331636
95
Initiates a data transfer process on the consumer.
TransferInitiateResponse initiateConsumerRequest(DataRequest dataRequest);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n this.sleepTime = dataStream.convertToInterval(this.flowRate);\n this.co...
[ "0.6789154", "0.59981936", "0.5781974", "0.56658334", "0.5634414", "0.56334186", "0.5574141", "0.5501442", "0.54959804", "0.5494307", "0.5422763", "0.53978324", "0.53685236", "0.5320976", "0.5313904", "0.5300449", "0.5293145", "0.5292819", "0.52878946", "0.52525574", "0.52469...
0.6824806
0
Initiates a data transfer process on the provider.
TransferInitiateResponse initiateProviderRequest(DataRequest dataRequest);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TransferInitiateResponse initiateConsumerRequest(DataRequest dataRequest);", "@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n ...
[ "0.6282128", "0.61552674", "0.59375083", "0.5685262", "0.5530422", "0.55089927", "0.5496831", "0.54513377", "0.54509497", "0.5443855", "0.54166096", "0.53875345", "0.5360906", "0.5355025", "0.5340727", "0.53284216", "0.5295845", "0.52679574", "0.5232787", "0.52158564", "0.518...
0.66066766
0
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_stats_detail, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ...
[ "0.7904975", "0.78056985", "0.77671826", "0.77275974", "0.7632173", "0.7622138", "0.75856143", "0.7531176", "0.7488386", "0.74576557", "0.74576557", "0.74391466", "0.7422802", "0.7403698", "0.7392229", "0.73873955", "0.73796785", "0.737091", "0.73627585", "0.7356357", "0.7346...
0.0
-1
private ChannelFuture cf; EventLoopGroup workerGroup = new NioEventLoopGroup();
public void sendMsg(Msg msg) throws Exception { sendMsg(msg, host, port); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws Exception {\n EventLoopGroup bossGroup = new NioEventLoopGroup(1);\n EventLoopGroup workerGroup = new NioEventLoopGroup(8);\n\n //\n ServerBootstrap bootstrap = new ServerBootstrap();\n\n try {\n //\n bootstrap.g...
[ "0.67186415", "0.6465836", "0.6453094", "0.6293637", "0.62570405", "0.6248594", "0.6229412", "0.6219548", "0.6174287", "0.61616224", "0.61444235", "0.61223567", "0.6105966", "0.60558844", "0.60316944", "0.6002795", "0.597009", "0.5966231", "0.59539104", "0.58803564", "0.58782...
0.0
-1
Base for everything being placed on the board
public interface GameEntity { int getSize(); void update(Board board); boolean isRemoved(); void setRemoved(boolean removed); Command remove(); ThemeableType getType(); Point getPosition(); void setPosition(double x, double y); void setPosition(Point position); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void createBoard();", "Board() {\r\n init();\r\n }", "public abstract void buildMoveData(ChessBoard board);", "public void boardSetUp(){\n\t}", "public Board(String boardName) {\n\n /*\n * Created according to the specs online.\n */\n if (boardName.eq...
[ "0.6790752", "0.6461386", "0.6375507", "0.63660324", "0.6359709", "0.6337701", "0.63307416", "0.63204426", "0.6307523", "0.6260508", "0.6229936", "0.62271696", "0.6205758", "0.6190841", "0.61756986", "0.6163486", "0.6118671", "0.6115042", "0.61060315", "0.60936433", "0.607635...
0.0
-1
I have assumed that there are no duplicate characters in the string.
public static void main(String[] args) { Scanner scan = new Scanner(System.in); String str; System.out.print("Enter the string : "); str = scan.next(); int len = str.length(); Assignment obj = new Assignment(); obj.recursiveCall(str, 0, len); for (int i = 0; i <= lst.size() - 1; i++) { System.out.println(lst.get(i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean uniqueCharStringNoDS(String s){\r\n for (int i = 0; i < s.length(); i++){\r\n for (int j = i+1; j < s.length(); j++){\r\n char temp = s.charAt(i);\r\n if (temp == s.charAt(j)){\r\n return false;\r\n }\r\n ...
[ "0.74256855", "0.7381893", "0.7379483", "0.7269708", "0.72589207", "0.72372943", "0.7236145", "0.7231809", "0.7166506", "0.7149725", "0.71457994", "0.7110613", "0.7109908", "0.70977837", "0.7081422", "0.7079397", "0.70337", "0.7020245", "0.7013417", "0.7013122", "0.70070916",...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) throws Exception { if(args.length!=2){ System.console().printf("Usage:<file.yml> log_suffix"); return; } System.setProperty("suffix",String.valueOf(args[1])); String configFile = "--Spring.config.location=file:"+args[0]; SpringApplication app = new SpringApplication(AuthSpringConfig.class); app.setBannerMode(Banner.Mode.OFF); app.run(configFile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub4
public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("please enter any String"); String str=sc.next(); String org_str=str; String rev=" "; int len=str.length(); for(int i=len-1;i>=0;i--){ rev=rev+str.charAt(i); } System.out.println("reverse string is :" +rev); if(org_str.equals(rev)){ System.out.println(org_str+ "is palindrom"); } else{ System.out.println(org_str+ "is not palindrom"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6587409", "0.6522317", "0.6450984", "0.6405692", "0.63972616", "0.6301175", "0.628741", "0.62550014", "0.6251908", "0.6241692", "0.62307465", "0.6199742", "0.61923385", "0.61923385", "0.6187377", "0.61755323", "0.61683935", "0.6164061", "0.61493236", "0.61285615", "0.61012...
0.0
-1
TODO Ahora vamos a ver que hay motos disponibles
public void asignarPedido(Pedido pedido){ double costeMin=100000; int pos=0; if (pedido.getPeso()<PESOMAXMOTO) { if(motosDisponibles.size()!=0){ pos=0; //Damos como primer valor el de primera posición costeMin=pedido.coste(motosDisponibles.get(0)); //Ahora vamos a calcular el min yendo uno por uno for(int i=0; i<motosDisponibles.size(); i++){ if(costeMin>pedido.coste(motosDisponibles.get(i))){ costeMin=pedido.coste(motosDisponibles.get(i)); pos=i; } } //Una vez hallada la moto de menor coste la asignamos pedido.setTransporte(motosDisponibles.get(pos)); motosDisponibles.removeElementAt(pos); } else { pedidosEsperandoMoto.add(pedidosEsperandoMoto.size(),pedido); } } else { if (furgonetasDisponibles.size()!=0){ costeMin = pedido.coste(furgonetasDisponibles.get(0)); for(int i=0; i<furgonetasDisponibles.size(); i++){ if(costeMin>pedido.coste(furgonetasDisponibles.get(i))){ costeMin=pedido.coste(furgonetasDisponibles.get(i)); pos=i; } } pedido.setTransporte(furgonetasDisponibles.get(pos)); furgonetasDisponibles.removeElementAt(pos); } else{ pedidosEsperandoFurgoneta.add(pedidosEsperandoFurgoneta.size(),pedido); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fotos(){}", "public ArrayList<Moto> getMotos()\r\n {\r\n return motos;\r\n }", "public void getListaArchivos() {\n\n File rutaAudio = new File(Environment.getExternalStorageDirectory() + \"/RecordedAudio/\");\n File[] archivosAudio = rutaAudio.listFiles();\n\n for (int i = 0; ...
[ "0.63093364", "0.57212687", "0.570804", "0.56451666", "0.5602815", "0.55436605", "0.55010366", "0.5452672", "0.5424493", "0.54170996", "0.5387014", "0.53826874", "0.53745496", "0.53361017", "0.532896", "0.53250325", "0.5300517", "0.52797437", "0.5274516", "0.52700686", "0.525...
0.0
-1
Will retrieve a BankThing.
public BankThing retrieve(String id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Bank getBank() {\n return Bank;\n }", "public Bank getBank() {\r\n return bank;\r\n }", "Optional<BankBranch> getByName(String name) throws ObjectNotFoundException;", "shared.data.Bank getBank();", "IBank getBank(int rekeningNr) throws RemoteException;", "Databank getB...
[ "0.66192895", "0.6453765", "0.6350455", "0.6288944", "0.622146", "0.62195086", "0.61301184", "0.6044638", "0.5981973", "0.5853764", "0.5853764", "0.5851994", "0.58435225", "0.58002305", "0.57914877", "0.5791348", "0.57818335", "0.5756963", "0.56227714", "0.5619003", "0.561803...
0.8226009
0
Will delete a BankThing.
public void delete(String id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void deleteHouseholdUsingDeleteTest() throws ApiException {\n UUID householdId = null;\n api.deleteHouseholdUsingDelete(householdId);\n\n // TODO: test validations\n }", "@Override\r\n\tpublic void deleteBankAccount(String name) {\n\t\t\r\n\t}", "void deleteBet(Account...
[ "0.67934835", "0.6650266", "0.6625948", "0.6610784", "0.64936113", "0.64879084", "0.6457224", "0.6406962", "0.63761854", "0.634295", "0.63401484", "0.6339789", "0.6333321", "0.6332378", "0.63322914", "0.63301", "0.63194627", "0.63093805", "0.62909174", "0.62764895", "0.626753...
0.0
-1
Will update a BankThing.
public BankThing save(BankThing thing);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void updateWaybill(WaybillEntity waybill) {\n\t\t\n\t}", "public void updateBid(Bid b) {\r\n this.edit(b);\r\n }", "int updWayBillById(WayBill record) throws WayBillNotFoundException;", "@Override\n\tpublic Besoin updateBesoin(Besoin besoin) {\n\t\treturn dao.updateBesoin(besoin...
[ "0.6999", "0.6740015", "0.6420185", "0.6401678", "0.63638836", "0.62979656", "0.62560844", "0.62012434", "0.6169537", "0.6167391", "0.616102", "0.61435956", "0.60919523", "0.6086381", "0.60740393", "0.60607874", "0.60175747", "0.6012173", "0.5997083", "0.59722424", "0.5967765...
0.63287216
5
Constructor for the CourseCalendar class
public CourseCalendar(List<Course> courses, String pattern, boolean recurring, boolean rounded) { this.mClasses = courses; this.mPattern = pattern; this.mRecurring = recurring; this.mRounded = rounded; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CourseCalendar(List<Course> courses) {\n this(courses, \"C-TY\", true, false);\n }", "public Calendar() {\n }", "public Calendar() {\n initComponents();\n }", "public Calendar() {\n dateAndTimeables = new HashMap<>();\n }", "public Course(String courseName, String ci...
[ "0.82507426", "0.77475417", "0.746025", "0.73486465", "0.7171342", "0.7142317", "0.7129383", "0.7076167", "0.70034903", "0.6984693", "0.69649667", "0.686833", "0.686833", "0.6823989", "0.6815624", "0.68091416", "0.669629", "0.6686609", "0.6682199", "0.66376626", "0.66090715",...
0.6899739
11