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
findKthLargest(array, 2); quickSort(array); System.out.println(Arrays.toString(array));
public static void main(String[] args) { for (int i = 1; i <= 9; i++) { int[] array = { 3, 4, 1, 2, 9, 8, 6, 5, 7 }; System.out.println(findKthLargest(array,i)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void p215() {\n// int[] nums = {5, 2, 1, 8, 3};\n// int[] nums = {5, 2, 1, 8, 3, 5, 7};\n int[] nums = {3, 2, 3, 1, 2, 4, 5, 5, 6};\n int k = 4;\n// int ret1 = findKthLargestUsingSort(nums, k);\n// System.out.println(ret1);\n int ret2 = findKthLargest...
[ "0.8220189", "0.67712086", "0.6752516", "0.6729454", "0.6727419", "0.66998243", "0.66543853", "0.6619493", "0.6597869", "0.6557483", "0.651984", "0.64454734", "0.6389315", "0.6385403", "0.6384965", "0.63767785", "0.6375761", "0.6360194", "0.6346818", "0.6319265", "0.6316794",...
0.72294486
1
convert InputStream to String
public static String getStringFromInputStream(InputStream is) { BufferedReader br = null; StringBuilder sb = new StringBuilder(); String line; try { br = new BufferedReader(new InputStreamReader(is)); while ((line = br.readLine()) != null) { sb.append(line); } } catch (IOException e) { e.printStackTrace(); } finally { if (br != null) { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } return sb.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String convertStreamToString(InputStream is) throws IOException {\n BufferedReader reader = new BufferedReader(new InputStreamReader(is));\n StringBuilder builder = new StringBuilder();\n String line;\n while ((line = reader.readLine()) != null) {\n builder.append(lin...
[ "0.8287886", "0.8158139", "0.81556314", "0.8113989", "0.8075132", "0.8070196", "0.8050584", "0.8034654", "0.8028828", "0.8010856", "0.8005428", "0.8005033", "0.7989694", "0.7987228", "0.7977151", "0.79752237", "0.7971573", "0.7952899", "0.79171985", "0.7911311", "0.7907695", ...
0.7584088
50
/ fungsi ini akan ngambil value place dari yang terdekat
private String getPlace(String[] tokens, int start_index) { int i = start_index + 1; boolean found = false; String ret = ""; while(!found && i < tokens.length) { if(isWordPlace(tokens[i])) { found = true; } else { i++; } } if(found) { ret = tokens[i]; } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLocacion(String locacion);", "private void setValueForEditAddrss() {\n ServiceCaller serviceCaller = new ServiceCaller(context);\n serviceCaller.callGetAllAddressByIdService(addressid, new IAsyncWorkCompletedCallback() {\n @Override\n public void onDone(String w...
[ "0.65038747", "0.60328484", "0.59416205", "0.59142196", "0.5900167", "0.58453625", "0.58063674", "0.57776195", "0.5775225", "0.5729979", "0.5680264", "0.56392914", "0.563721", "0.5632486", "0.5630458", "0.5621697", "0.55864817", "0.5585124", "0.5565515", "0.55546", "0.5535351...
0.0
-1
Test of getRuedas method, of class Camiones.
@Test public void testGetRuedas() { System.out.println("getRuedas"); Camiones instance = new Camiones("C088IJ", true, 10); int expResult = 0; int result = instance.getRuedas(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testSetRuedas() {\n System.out.println(\"setRuedas\");\n int ruedas = 3;\n Camiones instance = new Camiones(\"C088IJ\", true, 10);\n instance.setRuedas(ruedas);\n // TODO review the generated test code and remove the default call to fail.\n \n }", ...
[ "0.63642883", "0.60654104", "0.58248144", "0.5496328", "0.54888755", "0.54304963", "0.5324309", "0.5299856", "0.52468723", "0.52136403", "0.5209782", "0.51668096", "0.51345694", "0.5101191", "0.5090679", "0.5074036", "0.5067419", "0.5062903", "0.50517434", "0.5050167", "0.503...
0.74258065
0
Test of setRuedas method, of class Camiones.
@Test public void testSetRuedas() { System.out.println("setRuedas"); int ruedas = 3; Camiones instance = new Camiones("C088IJ", true, 10); instance.setRuedas(ruedas); // TODO review the generated test code and remove the default call to fail. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testGetRuedas() {\n System.out.println(\"getRuedas\");\n Camiones instance = new Camiones(\"C088IJ\", true, 10);\n int expResult = 0;\n int result = instance.getRuedas();\n \n }", "@Test\r\n public void testActualizar() throws Exception {\r\n ...
[ "0.57988685", "0.5474027", "0.5321149", "0.530335", "0.52540666", "0.52379435", "0.5232671", "0.52316123", "0.5220494", "0.5217994", "0.5198392", "0.5195281", "0.5185912", "0.5169603", "0.51288426", "0.5126837", "0.5123262", "0.5085222", "0.5083302", "0.50487757", "0.50198877...
0.75956845
0
Test of calcularImporte method, of class Camiones.
@Test public void testCalcularImporte() { System.out.println("calcularImporte"); double min = 10.1; Camiones instance = new Camiones("C088IJ", true, 10); double expResult = 0.0; double result = instance.calcularImporte(min); // TODO review the generated test code and remove the default call to fail. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testCambiaImporto() {\n\t\tfloat nuovoImporto = 15.678f;\n\t\tFondo.inserisciFondo(nome, importo);\n\t\tidFondo = Utils.lastInsertID();\n\t\t\n\t\tFondo.cambiaImporto(idFondo, nuovoImporto);\n\t\tfondo = Fondo.visualizzaFondo(idFondo);\n\t\tassertTrue(\"cambiaImporto() non funziona correttamen...
[ "0.73937887", "0.64339274", "0.5919905", "0.5895878", "0.57027054", "0.5690652", "0.5682809", "0.56622976", "0.55497545", "0.5539538", "0.55395323", "0.548843", "0.5468299", "0.54626554", "0.5422247", "0.54130656", "0.5408228", "0.5406192", "0.53956854", "0.5389676", "0.53888...
0.8193862
0
Test of anchoOruedas method, of class Camiones.
@Test public void testAnchoOruedas() { System.out.println("anchoOruedas"); Camiones instance = new Camiones("C088IJ", true, 10); double expResult = 0.0; double result = instance.anchoOruedas(); // TODO review the generated test code and remove the default call to fail. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void verEstadoAmarres() {\n System.out.println(\"****************************************************\");\n for(int posicion = 0; posicion<NUMERO_AMARRES; posicion++) {\n int i = 0;\n boolean posicionEncontrada = false;\n while(!posicionEncontrada && i<alquiler...
[ "0.58462924", "0.58216524", "0.58216524", "0.58216524", "0.5802335", "0.56742287", "0.56632465", "0.5655718", "0.5635685", "0.5563942", "0.5561026", "0.5551117", "0.55427027", "0.55280614", "0.55006576", "0.54906267", "0.54821134", "0.54725975", "0.54629976", "0.5459774", "0....
0.7323096
0
Test of alto method, of class Camiones.
@Test public void testAlto() { System.out.println("alto"); Camiones instance = new Camiones("C088IJ", true, 10); double expResult = 0.0; double result = instance.alto(); // TODO review the generated test code and remove the default call to fail. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testAgregarCamion() {\n try {\n System.out.println(\"agregarCamion\");\n Camion camion = new Camion(0, \"ABC-000\", \"MODELO PRUEBA\", \"COLOR PRUEBA\", \"ESTADO PRUEBA\", 999, null);\n ControlCamion instance = new ControlCamion();\n boolean...
[ "0.7308816", "0.6910069", "0.6841422", "0.66745687", "0.66297704", "0.6532912", "0.6506662", "0.64821446", "0.64007866", "0.63845396", "0.6384432", "0.6358531", "0.63389796", "0.6319535", "0.6310544", "0.6280969", "0.6271632", "0.6262084", "0.625875", "0.6242025", "0.6215809"...
0.72520024
1
Test of getIdentificador method, of class Camiones.
@Test public void testGetIdentificador() { System.out.println("getIdentificador"); Camiones instance = new Camiones("C088IJ", true, 10); int expResult = 0; int result = instance.getIdentificador(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testGetId_edificio() {\n System.out.println(\"getId_edificio\");\n DboEdificio instance = new DboEdificio(1, \"T-3\");\n int expResult = 1;\n int result = instance.getId_edificio();\n assertEquals(expResult, result);\n \n }", "public int getIden...
[ "0.66410196", "0.65534115", "0.65396017", "0.642745", "0.63907206", "0.6350497", "0.63329154", "0.6307897", "0.62589693", "0.62577033", "0.62403506", "0.6236449", "0.6201871", "0.61984015", "0.61977094", "0.6170809", "0.61700946", "0.61686933", "0.6145152", "0.6125937", "0.60...
0.7419622
0
To load all mydog plugin properties
void loadMyDogPluginParams(MyDogPluginsParams myDogPluginsParams);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void load() {\n tag = getPlugin().getConfig().getString(\"Tag\");\n hologram_prefix = getPlugin().getConfig().getString(\"Prefix\");\n hologram_time_fixed = getPlugin().getConfig().getBoolean(\"Hologram_time_fixed\");\n hologram_time = getPlugin().getConfig().getInt(\"Holo...
[ "0.6557359", "0.6239225", "0.6159763", "0.6153539", "0.6114984", "0.6031165", "0.59723675", "0.5971117", "0.5939959", "0.59015596", "0.5885264", "0.58797383", "0.5868724", "0.58302677", "0.58278346", "0.5809412", "0.579586", "0.5794901", "0.5789778", "0.5784527", "0.5781879",...
0.70097375
0
AudioListener listener = new AudioListener();
public void run() { try { sourcedata.play(); //sourcedata.load(); } catch ( Exception e ) { e.printStackTrace(); System.exit(0); }//end catch }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AudioMonitor(AudioMonitorListener listener) {\n this.listener = listener;\n }", "private Audio() {}", "public interface IAudioMediaPlayerListener {\n void onLoadAudioDone(int duration);\n void onLoadAudioError();\n void onLoadAudioBuffering(int percent);\n}", "public void playAudio(...
[ "0.73296875", "0.7235378", "0.6841324", "0.6839647", "0.6814244", "0.64409614", "0.64107627", "0.6405614", "0.63394725", "0.63182503", "0.63182503", "0.62980956", "0.62896013", "0.62896013", "0.6272608", "0.6242715", "0.6182233", "0.6174314", "0.61672825", "0.61576855", "0.61...
0.0
-1
Title: ProductMapper ProjectName: springbootpanicbuying description: TODO
@Mapper public interface ProductMapper { ProductPo getProduct(Long id); int decreaseProduct(@Param("id") Long id, @Param("quantity") Integer quantity, @Param("version") Integer version); int decreaseProductRedis(@Param("id") Long id, @Param("quantity") Integer quantity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Repository(\"productTypeMapper\")\npublic interface ProductTypeMapper extends CommonMapper<ProductTypeInfo> {\n}", "public static void main(String[] args) {\n AbstractApplicationContext context = new AnnotationConfigApplicationContext(\"com.ravindra\");\n Product p =(Product)context.getBean(\"prod...
[ "0.60077745", "0.59205294", "0.5844186", "0.5821817", "0.57614976", "0.5750053", "0.57446265", "0.5706835", "0.56858367", "0.56699914", "0.56618035", "0.5643287", "0.560798", "0.5577127", "0.5576904", "0.5576621", "0.55759186", "0.5563518", "0.55543447", "0.5544271", "0.55345...
0.5633669
12
int i, j; i = j = 0;
private double[][] convertArrayToMatrix(ArrayList<String> data, int row, int column) { int ct = 0; double[][] mat = new double[row][column]; for (int i = 0; i < row; i++) { for (int j = 0; j < column; j++) { mat[i][j] = Double.parseDouble(data.get(ct)); ct++; } } /*for (String s : data) { mat[i][j] = Double.parseDouble(s); i++; if (i == row) { i = 0; j++; } if (i == row && j == column) { break; } }*/ return mat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void swap(int i, int j) {\n\t\tlong temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "private void swap(int i, int j){\n \t\tint temp = a[i];\n \t\ta[i] = a[j];\n \t\ta[j] = temp;\n }", "private void swap(int[] nums, int i, int j) {\n int temp = nums[i];\n nums[i] = nums[j];\n ...
[ "0.5928941", "0.5867724", "0.58552283", "0.58265454", "0.57946765", "0.57903045", "0.57903045", "0.5790155", "0.57505906", "0.5732275", "0.57296765", "0.5727004", "0.5713811", "0.57086486", "0.56921285", "0.5674976", "0.56555194", "0.56518745", "0.5626392", "0.56168115", "0.5...
0.0
-1
Create a FacesBean for a component class. TODO change from ownerClass to componentFamily?
static public FacesBean createFacesBean( Class<?> ownerClass, String rendererType) { if (ownerClass == null) return null; String className = ownerClass.getName(); FacesBean bean = createFacesBean(className, rendererType); if (bean == null && rendererType != null) bean = createFacesBean(className, null); if (bean == null) bean = createFacesBean(ownerClass.getSuperclass(), rendererType); return bean; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public NewJSFManagedBean() {\n }", "ComponentBean getBean();", "ComponentType createComponentType();", "ComponentBean getReferencedBean();", "public BPCustomCharts() {\n FacesContext BPCustomcontext = FacesContext.getCurrentInstance();\n ValueBinding bpCustomValueBinding = \n BPCus...
[ "0.6669995", "0.61485183", "0.6018101", "0.5670632", "0.56150955", "0.55782527", "0.55782527", "0.5572082", "0.54930705", "0.54924953", "0.5475208", "0.5466458", "0.5461517", "0.5426579", "0.539665", "0.539665", "0.5363524", "0.53504896", "0.53439426", "0.5335116", "0.5286860...
0.7247927
0
TODO Autogenerated method stub
public void handleMessage(Message msg) { super.handleMessage(msg); switch (msg.what) { case 1: if (!isStop) { updateTimeSpent(); mHandler.sendEmptyMessageDelayed(1, 1000); } break; case 0: break; } }
{ "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
clicks where the AI tells it to
private void click(int[] coordinates) { String id = "#cell" + ((coordinates[0] < 10)? "0" + coordinates[0] : coordinates[0]) + ((coordinates[1] < 10)? "0" + coordinates[1] : coordinates[1]); AnchorPane cell = (AnchorPane) play.getScene().lookup(id); // click on the cell cell.fireEvent(new MouseEvent(MouseEvent.MOUSE_CLICKED, 0, 0, 0, 0, MouseButton.PRIMARY, 1, true, true, true, true, true, true, true, true, true, true, null)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Point userClickPoint();", "public void mouseClicked() {\n\t\tswitch(screen) {\n\t\t\n\t\t// Pantalla Home\n\t\tcase 0:\n\t\t\tif((mouseX > 529 && mouseY > 691) && (mouseX < 966 & mouseY < 867)) {\n\t\t\t\t//si hace click adentro del boton de jugar\n\t\t\t\tscreen = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t// Panta...
[ "0.68207407", "0.6810007", "0.6697475", "0.6691869", "0.66456914", "0.66085", "0.6597077", "0.64912593", "0.6436263", "0.64114285", "0.63975227", "0.6371074", "0.63584673", "0.6338585", "0.6336616", "0.63330144", "0.6312294", "0.63027877", "0.62824273", "0.62788737", "0.62258...
0.0
-1
do the winner stuff
private void win() { Player winner = board.win(); if (winner == null) return; int winner_number; Label winner_info; Label loser_info; if (winner.getId() == 'U') { winner_info = player1info; loser_info = player2info; winner_number = 1; } else { winner_info = player2info; loser_info = player1info; winner_number = 2; } winner_info.setFont(new Font("Segoe UI Semibold", 20)); winner_info.setText("You Won!!"); loser_info.setFont(new Font("Segoe UI Semibold", 20)); loser_info.setText("You Lost :)"); for (int i = 0; i < 17; ++i) for (int j = 0; j < 17; j++) { String id = "#cell" + ((i < 10) ? "0" + i : i) + ((j < 10) ? "0" + j : j); AnchorPane cell = (AnchorPane) (play.getScene().lookup(id)); // remove functionality cell.setOnMouseClicked(null); cell.setOnMouseEntered(null); cell.setOnMouseExited(null); if (!cup_is_on) { if (i == 6) { if (j == 6) { cell.setStyle("-fx-background-color: mediumaquamarine"); Label label = new Label("try"); label.setTextFill(Color.BLACK); label.setFont(new Font("Arial Rounded MT Bold", 12)); label.setAlignment(Pos.CENTER); label.setPrefSize(40, 40); cell.getChildren().add(label); if (bead1.getLayoutX() == cell.getLayoutX() && bead1.getLayoutY() == cell.getLayoutY()) bead1.setVisible(false); if (bead2.getLayoutX() == cell.getLayoutX() && bead2.getLayoutY() == cell.getLayoutY()) bead2.setVisible(false); } else if (j == 8) { cell.setStyle("-fx-background-color: mediumaquamarine"); Label label = new Label("again?"); label.setTextFill(Color.BLACK); label.setFont(new Font("Arial Rounded MT Bold", 12)); label.setAlignment(Pos.CENTER); label.setPrefSize(40, 40); cell.getChildren().add(label); if (bead1.getLayoutX() == cell.getLayoutX() && bead1.getLayoutY() == cell.getLayoutY()) bead1.setVisible(false); if (bead2.getLayoutX() == cell.getLayoutX() && bead2.getLayoutY() == cell.getLayoutY()) bead2.setVisible(false); } } else if(i == 8) { if (j == 6) { cell.setStyle("-fx-background-color: limegreen"); Label label = new Label("YES"); label.setTextFill(Color.BLACK); label.setFont(new Font("Arial Rounded MT Bold", 12)); label.setAlignment(Pos.CENTER); label.setPrefSize(40, 40); label.setOnMouseClicked(event -> { try { gotoNewGame(new Player(board.getPlayer1().getName(), 'U', 10), new Player(board.getPlayer2().getName(), 'D', 10)); } catch (IOException ioException) { ioException.printStackTrace(); } }); cell.getChildren().add(label); if (bead1.getLayoutX() == cell.getLayoutX() && bead1.getLayoutY() == cell.getLayoutY()) bead1.setVisible(false); if (bead2.getLayoutX() == cell.getLayoutX() && bead2.getLayoutY() == cell.getLayoutY()) bead2.setVisible(false); } else if (j == 8) { cell.setStyle("-fx-background-color: red"); Label label = new Label("NO"); label.setTextFill(Color.BLACK); label.setFont(new Font("Arial Rounded MT Bold", 12)); label.setAlignment(Pos.CENTER); label.setPrefSize(40, 40); label.setOnMouseClicked(event -> { try { gotoGameModes(); } catch (IOException ioException) { ioException.printStackTrace(); } }); cell.getChildren().add(label); if (bead1.getLayoutX() == cell.getLayoutX() && bead1.getLayoutY() == cell.getLayoutY()) bead1.setVisible(false); if (bead2.getLayoutX() == cell.getLayoutX() && bead2.getLayoutY() == cell.getLayoutY()) bead2.setVisible(false); } } } } if (cup_is_on) cupOptimizer(winner_number); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkWinner() {\n\t}", "public void tellPlayerResult(int winner) {\n\t}", "private void win(int winner)\n {\n switch (winner) {\n case PLAYER_1_FLAG:\n player1.gameOver(RESULT_WIN);\n player2.gameOver(RESULT_LOSS);\n winSend.close();\n ...
[ "0.7492281", "0.74499065", "0.73696387", "0.7357791", "0.73552483", "0.72365654", "0.71870524", "0.71814495", "0.7175226", "0.71610767", "0.7157984", "0.7114986", "0.7079828", "0.7041767", "0.6994562", "0.6979291", "0.6971771", "0.6961908", "0.6954644", "0.69521004", "0.69310...
0.6571008
77
maxProgress has not been determined manually => == 100
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (fromUser) { switch (seekBar.getId()) { case R.id.farmersSeekBar: if (colonyManager.workersEnabled && colonyManager.scientistsEnabled) { double k; if (colonyManager.workersPercentage + colonyManager.scientistsPercentage != 0) { k = colonyManager.workersPercentage / (colonyManager.workersPercentage + colonyManager.scientistsPercentage); } else { k = 0.5; } double newFarmersPercentage = progress / 100.0; double sumPercentageLeft = 1 - newFarmersPercentage; double newWorkersPercentage = k * sumPercentageLeft; double newScientistPercentage = sumPercentageLeft - newWorkersPercentage; colonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, newScientistPercentage); } else { if (colonyManager.workersEnabled) { double maxPercentage = colonyManager.farmersPercentage + colonyManager.workersPercentage; int maxProgress = (int) Math.round(maxPercentage * 100); if (progress >= maxProgress) { colonyManager.setPercentage(maxPercentage, 0, colonyManager.scientistsPercentage); } else { double newFarmersPercentage = progress / 100.0; double newWorkersPercentage = maxPercentage - newFarmersPercentage; colonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, colonyManager.scientistsPercentage); } } else { /*=> colonyManager.scientistsEnabled == true, otherwise user would be unable to impact farmersSeekBar*/ double maxPercentage = colonyManager.farmersPercentage + colonyManager.scientistsPercentage; int maxProgress = (int) Math.round(maxPercentage * 100); if (progress >= maxProgress) { colonyManager.setPercentage(maxPercentage, colonyManager.workersPercentage, 0); } else { double newFarmersPercentage = progress / 100.0; double newScientistsPercentage = maxPercentage - newFarmersPercentage; colonyManager.setPercentage(newFarmersPercentage, colonyManager.workersPercentage, newScientistsPercentage); } } } invalidatePercentages(); invalidateDeltaMorale(); break; case R.id.workersSeekBar: if (colonyManager.farmersEnabled && colonyManager.scientistsEnabled) { double k; if (colonyManager.farmersPercentage + colonyManager.scientistsPercentage != 0) { k = colonyManager.farmersPercentage / (colonyManager.farmersPercentage + colonyManager.scientistsPercentage); } else { k = 0.5; } double newWorkersPercentage = progress / 100.0; double sumPercentageLeft = 1 - newWorkersPercentage; double newFarmersPercentage = k * sumPercentageLeft; double newScientistsPercentage = sumPercentageLeft - newFarmersPercentage; colonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, newScientistsPercentage); } else { if (colonyManager.farmersEnabled) { double maxPercentage = colonyManager.farmersPercentage + colonyManager.workersPercentage; int maxProgress = (int) Math.round(maxPercentage * 100); if (progress >= maxProgress) { colonyManager.setPercentage(0, maxPercentage, colonyManager.scientistsPercentage); } else { double newWorkersPercentage = progress / 100.0; double newFarmersPercentage = maxPercentage - newWorkersPercentage; colonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, colonyManager.scientistsPercentage); } } else { //=> colonyManager.scientistsEnabled == true, otherwise user would be unable to impact workersSeekBar double maxPercentage = colonyManager.workersPercentage + colonyManager.scientistsPercentage; int maxProgress = (int) Math.round(maxPercentage * 100); if (progress >= maxProgress) { colonyManager.setPercentage(colonyManager.farmersPercentage, maxPercentage, 0); } else { double newWorkersPercentage = progress / 100.0; double newScientistsPercentage = maxPercentage - newWorkersPercentage; colonyManager.setPercentage(colonyManager.farmersPercentage, newWorkersPercentage, newScientistsPercentage); } } } invalidatePercentages(); invalidateDeltaMorale(); break; case R.id.scientistsSeekBar: if (colonyManager.farmersEnabled && colonyManager.workersEnabled) { double k; if (colonyManager.farmersPercentage + colonyManager.workersPercentage != 0) { k = colonyManager.farmersPercentage / (colonyManager.farmersPercentage + colonyManager.workersPercentage); } else { k = 0.5; } double newScientistsPercentage = progress / 100.0; double sumPercentageLeft = 1 - newScientistsPercentage; double newFarmersPercentage = k * sumPercentageLeft; double newWorkersPercentage = sumPercentageLeft - newFarmersPercentage; colonyManager.setPercentage(newFarmersPercentage, newWorkersPercentage, newScientistsPercentage); } else { if (colonyManager.farmersEnabled) { double maxPercentage = colonyManager.farmersPercentage + colonyManager.scientistsPercentage; int maxProgress = (int) Math.round(maxPercentage * 100); if (progress >= maxProgress) { colonyManager.setPercentage(0, colonyManager.workersPercentage, maxPercentage); } else { double newScientistsPercentage = progress / 100.0; double newFarmersPercentage = maxPercentage - newScientistsPercentage; colonyManager.setPercentage(newFarmersPercentage, colonyManager.workersPercentage, newScientistsPercentage); } } else { /*=> colonyManager.workersEnabled == true, otherwise user would be unable to impact scientistsSeekBar*/ double maxPercentage = colonyManager.workersPercentage + colonyManager.scientistsPercentage; int maxProgress = (int) Math.round(maxPercentage * 100); if (progress >= maxProgress) { colonyManager.setPercentage(colonyManager.farmersPercentage, 0, maxPercentage); } else { double newScientistsPercentage = progress / 100.0; double newWorkersPercentage = maxPercentage - newScientistsPercentage; colonyManager.setPercentage(colonyManager.farmersPercentage, newWorkersPercentage, newScientistsPercentage); } } } invalidatePercentages(); invalidateDeltaMorale(); break; default: Toast.makeText(MainActivity.context, "Error: unknown seekBar.", Toast.LENGTH_SHORT).show(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onProgress(Object progress, Object max) {\n\t\t\t\t\t}", "private int getCompleteProgress()\n {\n int complete = (int)(getProgress() * 100);\n \n if (complete >= 100)\n complete = 100;\n \n return complete;\n }", "public void setMax(int max) {\n\t...
[ "0.750288", "0.7157622", "0.6927056", "0.6906573", "0.6867773", "0.6865764", "0.68234587", "0.6752939", "0.66571784", "0.66303056", "0.6614012", "0.65966886", "0.648345", "0.648345", "0.648345", "0.64831316", "0.6482441", "0.6421288", "0.6405839", "0.6405839", "0.6405839", ...
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mView= inflater.inflate(R.layout.fragment_default_internal_staff, container, false); initObjects(); getInternalStaffListThread(); getFlatOwnerListThread(); // :::::::::::::: Onclick:Listner ::::::::::::::::::: button_submit.setOnClickListener(this); button_Select.setOnClickListener(this); spinner_visitorTypeUser.setOnItemSelectedListener(this); spinner_searchToVisit.setOnItemSelectedListener(this); spinner_staffName.setOnItemSelectedListener(this); return mView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
API for getting list of all Employees
@RequestMapping(value = "/employees") public String getAllEmployess(@RequestParam String user,HttpServletRequest request,HttpServletResponse response,Model mv) throws JsonMappingException, JsonProcessingException { List<Employee> empList = RestCalls.getAllEmployees(); mv.addAttribute("empList",empList); mv.addAttribute("auth", "true"); mv.addAttribute("user", user); return "employeedetails.jsp"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(value=\"/searchEmpData\")\n\tpublic List<Employee> getAllEmployees()\n\t{\n\t\treturn this.integrationClient.getAllEmployees();\n\t}", "@RequestMapping(value = \"/getAllEmployees\", method = RequestMethod.GET, produces = { MediaType.APPLICATION_JSON_VALUE })\r\n\tpublic List<Employee> getAllEmpoyees(...
[ "0.86199963", "0.838291", "0.8349084", "0.8348313", "0.8346476", "0.830163", "0.8223551", "0.82226014", "0.82216895", "0.820573", "0.81615996", "0.81376624", "0.81331575", "0.812531", "0.8076654", "0.80730826", "0.8064224", "0.80581975", "0.8054742", "0.8002125", "0.80012584"...
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String tipo = request.getParameter("tipo"); String url = "", erro; ConnectionFactory con = new ConnectionFactory(); if (con.conectarBanco()) { if (tipo.equals("racao")) { RacaoDAO racDAO = new RacaoDAO(con.getConexao()); ArrayList<Racao> racs = racDAO.getListaRacao(); if (racs != null) { VendaRacaoDAO venDAO = new VendaRacaoDAO(con.getConexao()); ArrayList<VendaRacao> vendas = new ArrayList<VendaRacao>(); for (Racao r : racs) { vendas.add(venDAO.getUltimaVenda(r.getCodigo())); } request.setAttribute("prods", racs); request.setAttribute("vendas", vendas); url = "/escolher-insumo.jsp"; } else { erro = "Não foi possível acessar as rações cadastradas."; url = "/erro.jsp?erro=" + erro; } } else { if (tipo.equals("quimico")) { QuimicoDAO quimDAO = new QuimicoDAO(con.getConexao()); ArrayList<Quimico> quims = quimDAO.getListaQuimico(); if (quims != null) { request.setAttribute("prods", quims); url = "/escolher-insumo.jsp"; } else { erro = "Não foi possível acessar os produtos químicos cadastradas."; url = "/erro.jsp?erro=" + erro; } } } con.fecharConexao(); } else { erro = "Não foi possível conectar-se ao banco de dados."; url = "/erro.jsp?erro=" + erro; } RequestDispatcher despachante = getServletContext().getRequestDispatcher(url); despachante.forward(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) thro...
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234",...
0.0
-1
Map details = new HashMap();
@Override public void contribute(Builder builder) { builder.withDetail("yayay", "Donkey"); builder.withDetail("NumberOfOphaal", service.getLastOphaalData().size()); builder.withDetail("DateOfLastGet", service.dateOfLastGet); int counter=0; for(ModelAfvalkalender mod: service.getLastOphaalData()) { builder.withDetail("ophaaldata"+ counter++, mod.getAfvalstroomId() +"-"+ mod.getOphaaldatum()); } Map<String, String> details = new HashMap<>(); details.put("5", "Glas papier BEST tas"); details.put("11", "PMD (big bin)"); details.put("55", "GFT (green bin)"); builder.withDetail("Ophaal", details); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.util.Map<java.lang.String, java.lang.String>\n getDetailsMap();", "java.util.Map<java.lang.String, java.lang.String>\n getDetailsMap();", "public static void getMapDetails(){\n\t\tmap=new HashMap<String,String>();\r\n\t map.put(getProjName(), getDevID());\r\n\t //System.out.println(\"\\n[TEST Te...
[ "0.76722217", "0.7615511", "0.68414307", "0.6731298", "0.66675246", "0.6418329", "0.64107907", "0.6347876", "0.6306505", "0.6288042", "0.62820727", "0.6257298", "0.61785674", "0.6138743", "0.6072193", "0.6020299", "0.59885675", "0.5987102", "0.5964132", "0.59283286", "0.58449...
0.0
-1
Noargument constructor: should not be instantiated outside package
JDKSort() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "Reproducible newInstance();", "defaultConstructor(){}", "private Instantiation(){}", "void DefaultConstructor(){}", "private NaturePackage() {}", "private Consts(){\n //this prevents even the native c...
[ "0.79625124", "0.7610281", "0.74685013", "0.743081", "0.73016113", "0.7233642", "0.7185272", "0.7139294", "0.70701736", "0.70507133", "0.69745964", "0.69702214", "0.69441646", "0.6933297", "0.693223", "0.6929257", "0.69228506", "0.69084805", "0.68989193", "0.6887183", "0.6864...
0.0
-1
fill me in with good code
@Override public void sortIt(final Comparable a[]) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void smell() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "public void mo9848a() {\n }", "public void mo21785J() {\n }", "public static void generateCode()\n {\n \n }", "public void mo12930a() {\n }", "public v...
[ "0.6703637", "0.63586324", "0.63545066", "0.6252273", "0.6166299", "0.6151235", "0.6140729", "0.6136442", "0.6136442", "0.6136442", "0.6136442", "0.6136442", "0.6136442", "0.6136442", "0.6136332", "0.6127894", "0.6096016", "0.6095593", "0.6093045", "0.60784227", "0.6077278", ...
0.0
-1
Packageprotected to override for Unit Tests
ObservablePath createObservablePath(final Path path) { return IOC.getBeanManager().lookupBean(ObservablePath.class).getInstance().wrap(path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "private Mocks() { }", "@Override\n public void test() {\n \n }", "private ProtomakEngineTestHelper() {\r\n\t}", "@Override\n public void setUp() {\n }", "@Override\n public void setUp() throws Exception {}", "public void testSetB...
[ "0.6843334", "0.6580932", "0.65495", "0.6526193", "0.6343837", "0.63173944", "0.63066477", "0.6288872", "0.6278871", "0.62712777", "0.6251226", "0.624661", "0.6219932", "0.6191983", "0.61517584", "0.6149652", "0.6149652", "0.61422604", "0.6123496", "0.6111737", "0.6107036", ...
0.0
-1
Packageprotected to override for Unit Tests
void destroyObservablePath(final ObservablePath path) { path.dispose(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void test() {\n\t\t\t}", "private Mocks() { }", "@Override\n public void test() {\n \n }", "private ProtomakEngineTestHelper() {\r\n\t}", "@Override\n public void setUp() {\n }", "@Override\n public void setUp() throws Exception {}", "public void testSetB...
[ "0.68442065", "0.6581115", "0.6550277", "0.6526858", "0.6344418", "0.6317534", "0.6307393", "0.6289529", "0.62792903", "0.627184", "0.62508076", "0.6247757", "0.6220006", "0.6192959", "0.615241", "0.6150346", "0.6150346", "0.61427474", "0.6123835", "0.6111953", "0.6107573", ...
0.0
-1
optimization to avoid reloading the complete model when a module is added.
private Callback<Project> getModuleAddedSuccessCallback() { return new Callback<Project>() { @Override public void callback(final Project _project) { history.setLastAddedModule(_project); if (_project != null) { //A new module was added. if (model.isMultiModule()) { view.showBusyIndicator(Constants.INSTANCE.Loading()); repositoryStructureService.call(new RemoteCallback<RepositoryStructureModel>() { @Override public void callback(RepositoryStructureModel _model) { view.hideBusyIndicator(); if (_model != null) { model.setPOM(_model.getPOM()); model.setPOMMetaData(_model.getPOMMetaData()); model.setModules(_model.getModules()); model.getModulesProject().put(_project.getProjectName(), _project); addToModulesList(_project); } } }, new HasBusyIndicatorDefaultErrorCallback(view)).load(projectContext.getActiveRepository(), projectContext.getActiveBranch(), false); } else { view.showBusyIndicator(Constants.INSTANCE.Loading()); pomService.call(new RemoteCallback<POM>() { @Override public void callback(POM _pom) { view.hideBusyIndicator(); model.getOrphanProjects().add(_project); model.getOrphanProjectsPOM().put(_project.getIdentifier(), _pom); addToModulesList(_project); } }, new HasBusyIndicatorDefaultErrorCallback(view)).load(_project.getPomXMLPath()); } } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SideOnly(Side.CLIENT)\n public static void initModels() {\n }", "void updateModel() {\n updateModel(false);\n }", "protected void prepareModel() {\n model();\n }", "private void cargarModelo() {\n dlmLibros = new DefaultListModel<>();\n listaLibros.setModel(dlmLibros)...
[ "0.5709444", "0.56777656", "0.56719613", "0.56699586", "0.56473017", "0.5647178", "0.5619988", "0.560347", "0.55119276", "0.5506872", "0.55025154", "0.5468189", "0.54651195", "0.5433157", "0.5426994", "0.5426035", "0.5419013", "0.5392619", "0.5376026", "0.5372996", "0.5350437...
0.0
-1
optimization to avoid reloading the complete model when a module is added.
private RemoteCallback<Void> getModuleDeletedSuccessCallback(final Project _project) { return new RemoteCallback<Void>() { @Override public void callback(Void response) { if (_project != null) { //A project was deleted if (model.isMultiModule()) { view.showBusyIndicator(Constants.INSTANCE.Loading()); repositoryStructureService.call(new RemoteCallback<RepositoryStructureModel>() { @Override public void callback(RepositoryStructureModel _model) { view.hideBusyIndicator(); if (_model != null) { model.setPOM(_model.getPOM()); model.setPOMMetaData(_model.getPOMMetaData()); model.setModules(_model.getModules()); model.getModulesProject().remove(_project.getProjectName()); removeFromModulesList(_project.getProjectName()); } } }, new HasBusyIndicatorDefaultErrorCallback(view)).load(projectContext.getActiveRepository(), projectContext.getActiveBranch(), false); } else { model.getOrphanProjects().remove(_project); model.getOrphanProjectsPOM().remove(_project.getIdentifier()); removeFromModulesList(_project.getProjectName()); } } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SideOnly(Side.CLIENT)\n public static void initModels() {\n }", "void updateModel() {\n updateModel(false);\n }", "protected void prepareModel() {\n model();\n }", "private void cargarModelo() {\n dlmLibros = new DefaultListModel<>();\n listaLibros.setModel(dlmLibros)...
[ "0.57089573", "0.56778234", "0.5672009", "0.56687003", "0.56467783", "0.5645635", "0.5618479", "0.5604204", "0.55122155", "0.55047643", "0.5502352", "0.5468292", "0.546492", "0.5433857", "0.54265976", "0.5426017", "0.5419295", "0.5392612", "0.53762263", "0.5373472", "0.534994...
0.0
-1
TODO add parameters validation
@Override public void onInitRepositoryStructure() { if (model != null) { if (model.isMultiModule()) { doRepositoryStructureInitialization(DeploymentMode.VALIDATED); } else if (model.isSingleProject()) { repositoryManagedStatusUpdater.initSingleProject(projectContext.getActiveRepository(), projectContext.getActiveBranch()); } else if (!model.isManaged()) { repositoryManagedStatusUpdater.updateNonManaged(projectContext.getActiveRepository(), projectContext.getActiveBranch()); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void initParams() {\n\t\t\n\t}", "protected void setupParameters() {\n \n \n\n }", "private void validateInputParameters(){\n\n }", "public void getParameters(Parameters parameters) {\n\n }", "@Override\n\tprotected void validateParameterValues() {\n\t\t\n\t}", "...
[ "0.6536352", "0.6319192", "0.62480277", "0.6188858", "0.6166877", "0.61023015", "0.5964763", "0.59450746", "0.59262633", "0.5900514", "0.58943325", "0.5869513", "0.58669204", "0.584803", "0.58260393", "0.5813422", "0.5812689", "0.5806369", "0.5804029", "0.57963353", "0.579361...
0.0
-1
The real Throwable is wrapped in an InvocationTargetException when ran as a Unit Test and invoked with Reflection.
@Override public boolean error(final Message message, final Throwable throwable) { final Throwable _throwable = (throwable.getCause() == null ? throwable : throwable.getCause()); if (_throwable instanceof GAVAlreadyExistsException) { final GAVAlreadyExistsException gae = (GAVAlreadyExistsException) _throwable; conflictingRepositoriesPopup.setContent(gae.getGAV(), gae.getRepositories(), new Command() { @Override public void execute() { conflictingRepositoriesPopup.hide(); doRepositoryStructureInitialization(DeploymentMode.FORCED); } }); conflictingRepositoriesPopup.show(); return true; } else { return super.error(message, _throwable); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testUnwrapInvocationTargetExceptionWithCause() {\n RuntimeException rte = new RuntimeException();\n InvocationTargetException iteWithCause = new InvocationTargetException(rte);\n assertTrue(rte == ExceptionUtil.unwrapInvocationTargetException(iteWithCause));\n }", "...
[ "0.74080646", "0.7395079", "0.6862788", "0.6721242", "0.66056275", "0.6508437", "0.6453906", "0.6418921", "0.6411949", "0.63813865", "0.6361606", "0.6255283", "0.6228584", "0.61445886", "0.6073753", "0.6073594", "0.6071403", "0.60226375", "0.600493", "0.59678024", "0.5949167"...
0.0
-1
filtra y ordena los articulos
List<ArticleDTO> getFilteredByTwo(ArticlesFilterDTO filterDTO) throws ApiException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void moverCarroLujo() {\n for (Auto auto : arrEnemigosAuto) {\n auto.render(batch);\n\n auto.moverIzquierda();\n }\n }", "public void ordenaPontos(){\r\n\t\tloja.ordenaPontos();\r\n\t}", "public void editarArtista() {\n\t\tArrayList<String> listString = new ArrayL...
[ "0.6367039", "0.625469", "0.6223288", "0.60230273", "0.5965494", "0.59653085", "0.59562105", "0.5879843", "0.58767307", "0.5861175", "0.58558834", "0.5843095", "0.58111244", "0.57910436", "0.577678", "0.57651013", "0.57493556", "0.5747753", "0.57467383", "0.57361025", "0.5727...
0.0
-1
Se encarga de la creacion de la compra y de devolver una respuesta
ResponseDTO createPurchase(PurchaseOrderDTO purchaseOrderDTO) throws ApiException, IOException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Compuesta createCompuesta();", "Compleja createCompleja();", "private HttpResponse sendCreateComputer() {\r\n\t\tHttpResponse result = null;\r\n Log.i(TAG,\"sendCreateComputer to: \"+ m_url);\r\n\t\t\r\n\t\ttry {\r\n\t\t\t//\r\n\t\t\t// Use this client instead of default one! June 2013\r\n\t\t\t//\r\n\...
[ "0.69342476", "0.6678233", "0.6279691", "0.6262241", "0.6217238", "0.60467345", "0.59169865", "0.59164286", "0.59046805", "0.5872757", "0.58463", "0.5838733", "0.5823837", "0.58078986", "0.58074534", "0.57983845", "0.57820183", "0.57803494", "0.5772777", "0.57385194", "0.5727...
0.0
-1
Created by oleg on 11.03.16.
public interface OrderedProductService extends Service<OrderedProduct> { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private void poetries() {\n\n\t}", "p...
[ "0.5720126", "0.568", "0.56737405", "0.5606774", "0.5572662", "0.5569758", "0.55654114", "0.5555568", "0.5522972", "0.5521064", "0.5521064", "0.5513627", "0.5491377", "0.54827666", "0.54575366", "0.54548293", "0.5451591", "0.5446719", "0.54252887", "0.54178476", "0.5415786", ...
0.0
-1
Use the Builder class for convenient dialog construction
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); try { itemsJSONArray = new JSONArray(getArguments().getString("order")); } catch (JSONException e) { e.printStackTrace(); } builder.setView(inflater.inflate(R.layout.user_details, null)).setTitle("User details"); builder.setPositiveButton("Order", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { name = (EditText) getDialog().findViewById(R.id.nameET); phone = (EditText) getDialog().findViewById(R.id.phoneET); year = (Spinner) getDialog().findViewById(R.id.spinnerYear); branch = (Spinner) getDialog().findViewById(R.id.spinnerBranch); // FIRE ZE MISSILES! if(name.getText().toString().isEmpty() || phone.getText().toString().isEmpty()){ Toast.makeText(((OrderItem)getTargetFragment()).getActivity(), "Fill all fields", Toast.LENGTH_SHORT).show(); OrderDialogFragment frag = new OrderDialogFragment(); frag.setTargetFragment(getTargetFragment(),0); frag.setArguments(getArguments()); frag.show(getFragmentManager(), "Order dialog"); } else{ try { orderJSON.put("name",name.getText().toString()); orderJSON.put("phone",phone.getText().toString()); orderJSON.put("year",year.getSelectedItem().toString()); orderJSON.put("branch",branch.getSelectedItem().toString()); Log.e("Tag",branch.getSelectedItem().toString()); orderJSON.put("order",itemsJSONArray); ringProgressDialog = ProgressDialog.show(getActivity(), "Please wait ...", "Order is being placed ...", true, true, new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { ringProgressDialog.hide(); } }); AndroidNetworking.post(URL+"/order") .addJSONObjectBody(orderJSON) // posting json .setTag("test") .setPriority(Priority.MEDIUM) .build() .getAsJSONObject(new JSONObjectRequestListener() { @Override public void onResponse(JSONObject response) { // do anything with response ringProgressDialog.hide(); ((OrderItem)getTargetFragment()).onOrderPlaced(true,orderJSON); } @Override public void onError(ANError error) { // handle error //Toast.makeText(c,"Error , Order not placed",Toast.LENGTH_LONG).show(); ringProgressDialog.hide(); ((OrderItem)getTargetFragment()).onOrderPlaced(false,orderJSON); } }); } catch (JSONException e) { e.printStackTrace(); } } } }) .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { // User cancelled the dialog } }); // Create the AlertDialog object and return it return builder.create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dialog() {\n\t}", "public abstract Dialog createDialog(DialogDescriptor descriptor);", "void makeDialog()\n\t{\n\t\tfDialog = new ViewOptionsDialog(this.getTopLevelAncestor());\n\t}", "public Dialog<String> createDialog() {\n\t\t// Creating a dialog\n\t\tDialog<String> dialog = new Dialog<String>();\n...
[ "0.7058409", "0.69739115", "0.69248044", "0.69188714", "0.6861694", "0.67276263", "0.66768533", "0.6675558", "0.66329443", "0.66153866", "0.6558171", "0.6547412", "0.6532059", "0.65145797", "0.64638484", "0.6462401", "0.64596057", "0.64340484", "0.6427146", "0.6427146", "0.63...
0.0
-1
do anything with response
@Override public void onResponse(JSONObject response) { ringProgressDialog.hide(); ((OrderItem)getTargetFragment()).onOrderPlaced(true,orderJSON); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void faild_response();", "@Override\n\tpublic void processResponse(Response response)\n\t{\n\t\t\n\t}", "@Override\n\tpublic void handleResponse() {\n\t\t\n\t}", "void execute(final T response);", "@Override\n public void processResult(HttpResponseMessage response) {\n }", "public void parseRespons...
[ "0.79426897", "0.7364535", "0.71089447", "0.70610934", "0.70000875", "0.68810135", "0.68329155", "0.68329155", "0.6785315", "0.6778337", "0.6710226", "0.6655047", "0.6629885", "0.6625666", "0.6625453", "0.66068256", "0.6597449", "0.65902555", "0.65775585", "0.6571541", "0.656...
0.0
-1
User cancelled the dialog
public void onClick(DialogInterface dialog, int id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void cancelDialog() {dispose();}", "public void cancel() { Common.exitWindow(cancelBtn); }", "@Override\n public void onCancel(DialogInterface dialog) {\n cancel(true);\n }", "@Override\n\t\t\t\t\tpublic void onCancel(DialogInterface dialog) {\n\t\t\t\t...
[ "0.84252524", "0.81816214", "0.81397384", "0.80922073", "0.7927849", "0.79160905", "0.78777075", "0.78763556", "0.7856008", "0.7849157", "0.7848072", "0.7838308", "0.7804249", "0.77992254", "0.7796975", "0.7796975", "0.77921396", "0.7792013", "0.77904165", "0.77860636", "0.77...
0.0
-1
Loads the Settings.xml file into memory from the file system
public static void GetApplicationSettingsFile() { // Get the current path where the application (.jar) was launched from String path = ""; try { path = Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath(); } catch (URISyntaxException e) { e.printStackTrace(); } // Handle result if (path.length() > 0) { // Handle leading "/" if (path.startsWith("/")) { path = path.substring(1); } // Check for settings file Boolean exists = new File(path + "settings.xml").exists(); // Handle existence if (exists) { // Load the file into memory applicationSettingsFile = Utilities.LoadDocumentFromFilePath(path + "settings.xml"); } else { // Create the file applicationSettingsFile = Utilities.CreateDocument(); // Create the root element node org.w3c.dom.Element root = applicationSettingsFile.createElement("root"); applicationSettingsFile.appendChild(root); // Write the document to disk Utilities.writeDocumentToFile(applicationSettingsFile, new File(path + "settings.xml")); } // Store a reference to the file path applicationSettingsFilePath = path + "settings.xml"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadSettings() {\r\n \tString fname = baseDir + \"/\" + configFile;\r\n\t\tString line = null;\r\n\r\n\t\t// Load the settings hash with defaults\r\n\t\tsettings.put(\"db_url\", \"\");\r\n\t\tsettings.put(\"db_user\", \"\");\r\n\t\tsettings.put(\"db_pass\", \"\");\r\n\t\tsettings.put(\"db_min\", \"...
[ "0.74143326", "0.6904963", "0.6835334", "0.6798996", "0.67367136", "0.67287993", "0.67280364", "0.664244", "0.65542096", "0.6413865", "0.6343844", "0.633825", "0.63038313", "0.62324476", "0.62090874", "0.620615", "0.62049043", "0.61978143", "0.60958135", "0.6074894", "0.60606...
0.6298402
13
Gets the Base Address
public static String GetBaseAddress() { // Load Projects Settings XML file Document doc = Utilities.LoadDocumentFromFilePath(IDE.projectFolderPath + "\\ProjectSettings.xml"); String baseAddress = ""; if (doc != null) { // Get all "files" NodeList baseAddressNode = doc.getDocumentElement().getElementsByTagName("baseAddress"); // Handle result if (baseAddressNode.getLength() > 0) { baseAddress = Utilities.getXmlNodeAttribute(baseAddressNode.item(0), "value"); } } return baseAddress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getBaseAddress() {\n return base_address.getAddress();\n }", "public Address getStartAddress() {\n\t\treturn baseAddress;\n\t}", "public LocatorIF getBase() {\n return base_address;\n }", "public Address getImagebase() {\n return new Address(m_module.getConfiguration().getImageBase()...
[ "0.8283209", "0.7346126", "0.7244084", "0.71553546", "0.7139641", "0.70180655", "0.69805807", "0.6892143", "0.6869168", "0.6869168", "0.68643534", "0.6831028", "0.6827843", "0.6823744", "0.67560065", "0.6737369", "0.6663203", "0.6638575", "0.66149336", "0.66149336", "0.657379...
0.7835261
1
Gets the path of the last opened project location
public static String GetLastOpenedProject() { String lastOpenedProjectPath = ""; if (applicationSettingsFile != null) { // Get all "files" NodeList lastProject = applicationSettingsFile.getDocumentElement().getElementsByTagName("lastProject"); // Handle result if (lastProject.getLength() > 0) { lastOpenedProjectPath = Utilities.getXmlNodeAttribute(lastProject.item(0), "value"); } } return lastOpenedProjectPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getCurrentPath() {\n File file = new File(\"\");\n return file.getAbsolutePath();\n }", "public String getProjectFilePath() {\n\t\tif (projectFileIO != null) {\n\t\t\treturn projectFileIO.getFilePath();\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "private static F...
[ "0.7102287", "0.6950947", "0.6947353", "0.6914966", "0.68926084", "0.6748572", "0.664753", "0.6609904", "0.6576426", "0.6508395", "0.64459044", "0.64320666", "0.6412442", "0.6362435", "0.63222814", "0.6303525", "0.6296305", "0.6287957", "0.6276368", "0.6246805", "0.6242935", ...
0.8372531
0
Gets the value of the "previousProjects" node
public static String GetPreviousProjects() { String previousProjects = ""; if (applicationSettingsFile != null) { // Get all "files" NodeList lastProject = applicationSettingsFile.getDocumentElement().getElementsByTagName("previousProjects"); // Handle result if (lastProject.getLength() > 0) { previousProjects = Utilities.getXmlNodeAttribute(lastProject.item(0), "value"); } } return previousProjects; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public node getPrevious() {\n\t\t\treturn previous;\n\t\t}", "public Node getPrevious() {\n return previous;\n }", "public ListElement getPrevious()\n\t {\n\t return this.previous;\n\t }", "public int getPrevNode() {\n\t\treturn this.previousNode;\n\t}", "public DSAGraphNode<...
[ "0.6729995", "0.658587", "0.64816135", "0.6477995", "0.6474306", "0.6437874", "0.64017695", "0.6386294", "0.63851994", "0.6355644", "0.6344441", "0.6324204", "0.62895244", "0.6261144", "0.62538075", "0.6240149", "0.6235945", "0.6227473", "0.62264556", "0.62149334", "0.6205877...
0.8254383
0
Removes the given project from the previousProjects
public static void RemoveProjectFromPreviousProjects(String projectToRemove) { // Get the <root> element of the Document org.w3c.dom.Element root = applicationSettingsFile.getDocumentElement(); // Handle the "previousProject" Node previousLastProject = null; String previousLastProjectValue = null; try { // Get the previous last opened project previousLastProject = root.getElementsByTagName("lastProject").item(0); // Get the previous last opened project's value previousLastProjectValue = previousLastProject.getAttributes().getNamedItem("value").getNodeValue(); // Remove the previous last opened project root.removeChild(previousLastProject); } catch (Exception e) { /* do nothing */ } // Create a child node of root: <lastProject value="{path}"> org.w3c.dom.Element lastProjectNode = applicationSettingsFile.createElement("lastProject"); if (previousLastProjectValue == projectToRemove) { lastProjectNode.setAttribute("value", ""); } else { lastProjectNode.setAttribute("value", previousLastProjectValue); } // Add the node to the root element root.appendChild(lastProjectNode); // Handle the "previousProjects" Node previousProjects = null; String previousProjectsValue = null; try { // Get the previous projects previousProjects = root.getElementsByTagName("previousProjects").item(0); // Get the previous projects' value previousProjectsValue = previousProjects.getAttributes().getNamedItem("value").getNodeValue(); // Remove the previous last projects root.removeChild(previousProjects); } catch (Exception e) { /* do nothing*/ } // Remove the projectToRemove from previousProjectsValue if (previousProjectsValue != null) { if (previousProjectsValue.contains(projectToRemove)) { previousProjectsValue = previousProjectsValue.replace(projectToRemove, ""); previousProjectsValue = previousProjectsValue.replace(",,", ","); } // Remove any leading commas if (previousProjectsValue.startsWith(",")) { previousProjectsValue = previousProjectsValue.substring(1); } // Remove any trailing commas if (previousProjectsValue.endsWith(",")) { previousProjectsValue = previousProjectsValue.substring(0, previousProjectsValue.length()-1); } } // Create a child node of root: <lastProject value="{path},{path},etc"> org.w3c.dom.Element previousProjectsNode = applicationSettingsFile.createElement("previousProjects"); previousProjectsNode.setAttribute("value", previousProjectsValue); // Add the node to the root element root.appendChild(previousProjectsNode); // Save document to disk Utilities.writeDocumentToFile(applicationSettingsFile, new File(applicationSettingsFilePath)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic Integer removeProject(Integer projId) {\n\t\treturn sqlSession.delete(\"cn.sep.samp2.project.removeProject\", projId);\n\t}", "public void changeCurrProject(ProjectModel p) {\n \tprojects.remove(p);\n \tprojects.add(0, p);\n }", "public void removeProject(Project item){\n\t\tCollec...
[ "0.6955398", "0.6929771", "0.691634", "0.69036853", "0.68893147", "0.68361604", "0.66769934", "0.6511277", "0.6418584", "0.6378609", "0.6253461", "0.6213726", "0.6192846", "0.6142959", "0.6134698", "0.6114832", "0.6094391", "0.60167664", "0.601369", "0.6012042", "0.5987161", ...
0.7821643
0
Sets the Base Address
public static void SetBaseAddress(String baseAddress) { // Load Projects Settings XML file Document doc = Utilities.LoadDocumentFromFilePath(IDE.projectFolderPath + "\\ProjectSettings.xml"); // Get the <root> element of the Document org.w3c.dom.Element root = doc.getDocumentElement(); // Remove previous entry Node previousBaseAddress = null; try { previousBaseAddress = root.getElementsByTagName("baseAddress").item(0); } catch (Exception ex) { /* do nothing */ } if (previousBaseAddress != null) { root.removeChild(previousBaseAddress); } // Create a child node for <baseAddress value="{baseAddress}"> org.w3c.dom.Element baseAddressNode = doc.createElement("baseAddress"); baseAddressNode.setAttribute("value", baseAddress); root.appendChild(baseAddressNode); // Save document to disk Utilities.writeDocumentToFile(doc, new File(IDE.projectFolderPath + "\\ProjectSettings.xml")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setBase(LocatorIF base_address) {\n this.base_address = base_address;\n }", "public void setBaseAddress(String base_address) {\n try {\n this.base_address = new URILocator(base_address);\n } catch (MalformedURLException e) {\n throw new OntopiaRuntimeException(e);\n }\n }", ...
[ "0.7752658", "0.7691809", "0.7486517", "0.66345304", "0.6512399", "0.6180665", "0.61609674", "0.61583984", "0.6070426", "0.6046926", "0.6026257", "0.59849113", "0.5978607", "0.5974502", "0.5960271", "0.5943009", "0.59268934", "0.5886268", "0.5872123", "0.5866728", "0.5841056"...
0.72597206
3
Sets the last project opened (or created)
public static void SetLastOpenedProject(String path) { // Get the <root> element of the Document org.w3c.dom.Element root = applicationSettingsFile.getDocumentElement(); // Handle the "previousProject" Node previousLastProject = null; String previousLastProjectValue = null; try { // Get the previous last opened project previousLastProject = root.getElementsByTagName("lastProject").item(0); // Get the previous last opened project's value previousLastProjectValue = previousLastProject.getAttributes().getNamedItem("value").getNodeValue(); // Remove the previous last opened project root.removeChild(previousLastProject); } catch (Exception e) { /* do nothing */ } // Create a child node of root: <lastProject value="{path}"> org.w3c.dom.Element lastProjectNode = applicationSettingsFile.createElement("lastProject"); lastProjectNode.setAttribute("value", path); // Add the node to the root element root.appendChild(lastProjectNode); // Handle the "previousProjects" Node previousProjects = null; String previousProjectsValue = null; try { // Get the previous projects previousProjects = root.getElementsByTagName("previousProjects").item(0); // Get the previous projects' value previousProjectsValue = previousProjects.getAttributes().getNamedItem("value").getNodeValue(); // Remove the previous last projects root.removeChild(previousProjects); } catch (Exception e) { /* do nothing*/ } // Move the old previousProject to the previousProjects if (previousLastProjectValue != null) { previousProjectsValue = previousProjectsValue + "," + previousLastProjectValue; } // Remove the [new] previousProject if contained in previousProjectsValue if (previousProjectsValue != null) { if(previousProjectsValue.contains(path)) { previousProjectsValue = previousProjectsValue.replace(path, ""); previousProjectsValue = previousProjectsValue.replace(",,", ","); } // Remove any leading commas if (previousProjectsValue.startsWith(",")) { previousProjectsValue = previousProjectsValue.substring(1); } } // Create a child node of root: <lastProject value="{path},{path},etc"> org.w3c.dom.Element previousProjectsNode = applicationSettingsFile.createElement("previousProjects"); previousProjectsNode.setAttribute("value", previousProjectsValue); // Add the node to the root element root.appendChild(previousProjectsNode); // Save document to disk Utilities.writeDocumentToFile(applicationSettingsFile, new File(applicationSettingsFilePath)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void openNewProject() {\n\n\t\t// Dispose of all the sound objects in the project that is currently open\n\t\tCollection<SoundInfo> sounds = soundList.values();\n for(SoundInfo sound: sounds){\n sound.close();\n }\n \n // Set the newly opened project variables\n\t\tsou...
[ "0.6344341", "0.6305454", "0.62192357", "0.6043924", "0.596537", "0.58028775", "0.58025813", "0.5755982", "0.57531655", "0.5700437", "0.5692005", "0.5658349", "0.5658227", "0.5599954", "0.5599859", "0.5507212", "0.5507212", "0.5496105", "0.5493956", "0.5486711", "0.5454468", ...
0.71139807
0
This class is generated by jOOQ.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.9.3" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) @Entity @Table(name = "ha_membership", schema = "cattle") public interface HaMembership extends Serializable { /** * Setter for <code>cattle.ha_membership.id</code>. */ public void setId(Long value); /** * Getter for <code>cattle.ha_membership.id</code>. */ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "id", unique = true, nullable = false, precision = 19) public Long getId(); /** * Setter for <code>cattle.ha_membership.name</code>. */ public void setName(String value); /** * Getter for <code>cattle.ha_membership.name</code>. */ @Column(name = "name", length = 255) public String getName(); /** * Setter for <code>cattle.ha_membership.uuid</code>. */ public void setUuid(String value); /** * Getter for <code>cattle.ha_membership.uuid</code>. */ @Column(name = "uuid", unique = true, nullable = false, length = 128) public String getUuid(); /** * Setter for <code>cattle.ha_membership.heartbeat</code>. */ public void setHeartbeat(Long value); /** * Getter for <code>cattle.ha_membership.heartbeat</code>. */ @Column(name = "heartbeat", precision = 19) public Long getHeartbeat(); /** * Setter for <code>cattle.ha_membership.config</code>. */ public void setConfig(String value); /** * Getter for <code>cattle.ha_membership.config</code>. */ @Column(name = "config", length = 16777215) public String getConfig(); /** * Setter for <code>cattle.ha_membership.clustered</code>. */ public void setClustered(Boolean value); /** * Getter for <code>cattle.ha_membership.clustered</code>. */ @Column(name = "clustered", nullable = false, precision = 1) public Boolean getClustered(); // ------------------------------------------------------------------------- // FROM and INTO // ------------------------------------------------------------------------- /** * Load data from another generated Record/POJO implementing the common interface HaMembership */ public void from(io.cattle.platform.core.model.HaMembership from); /** * Copy data into another generated Record/POJO implementing the common interface HaMembership */ public <E extends io.cattle.platform.core.model.HaMembership> E into(E into); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public T_2698Dao() {\n\t\tsuper(org.jooq.test.jdbc.generatedclasses.tables.T_2698.T_2698, org.jooq.test.jdbc.generatedclasses.tables.pojos.T_2698.class);\n\t}", "private Builder() {\n super(org.apache.gora.cascading.test.storage.TestRow.SCHEMA$);\n }", "public ObjectRecord() {\n\t\tsuper(org.jooq.test....
[ "0.60794973", "0.6066551", "0.59953856", "0.5985798", "0.5696937", "0.5672971", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", "0.566314", ...
0.0
-1
FROM and INTO Load data from another generated Record/POJO implementing the common interface HaMembership
public void from(io.cattle.platform.core.model.HaMembership from);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public <E extends io.cattle.platform.core.model.HaMembership> E into(E into);", "RecordSet loadAllMemberContribution (Record inputRecord);", "@Override\r\n\tpublic void loadData() {\r\n\t\t// Get Session\r\n\r\n\t\tSession ses = HibernateUtil.getSession();\r\n\r\n\t\tQuery query = ses.createQuery(\"FROM User\"...
[ "0.63633895", "0.61385345", "0.5531192", "0.54328793", "0.5396804", "0.5375115", "0.5359605", "0.5315945", "0.5262477", "0.51827794", "0.51663536", "0.5154291", "0.51521623", "0.51209646", "0.511661", "0.5092733", "0.50481975", "0.49825615", "0.49737906", "0.49711272", "0.496...
0.58235866
2
Copy data into another generated Record/POJO implementing the common interface HaMembership
public <E extends io.cattle.platform.core.model.HaMembership> E into(E into);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "RecordSet loadAllMemberContribution (Record inputRecord);", "private Object copy ( Object record )\n\t{\n\t try\n {\n ByteArrayOutputStream baos = new ByteArrayOutputStream ();\n ObjectOutputStream oos = new ObjectOutputStream (baos);\n oos.writeObject (record);\n ...
[ "0.5614701", "0.5579105", "0.55642194", "0.55059326", "0.5466148", "0.5441246", "0.52577", "0.5197716", "0.51555204", "0.5138609", "0.5116503", "0.50813574", "0.5079189", "0.5075417", "0.505234", "0.50481826", "0.50457233", "0.50454414", "0.50168866", "0.49999532", "0.4991226...
0.6200452
0
Is this a Priority Flight
public Flight(String flightNumber, String airline, int passengerCapacity, String destination){ this.flightNumber = flightNumber; this.airline = airline; this.passengerCapacity = passengerCapacity; this.destination = destination; passengerManifest = new ArrayList<Passenger>(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasPriority();", "boolean hasPriority();", "boolean hasPriority();", "public boolean isPriority()\r\n/* 49: */ {\r\n/* 50:47 */ return false;\r\n/* 51: */ }", "int getPriority();", "int getPriority();", "int getPriority();", "int getPriority();", "int getPriority();", "int get...
[ "0.7547378", "0.7547378", "0.7547378", "0.7142443", "0.66058904", "0.66058904", "0.66058904", "0.66058904", "0.66058904", "0.66058904", "0.66058904", "0.66058904", "0.6597794", "0.6597794", "0.6543375", "0.6543375", "0.6450421", "0.6450421", "0.6450421", "0.643308", "0.638190...
0.0
-1
Checks if the specified buffer is a direct buffer and is composed of a single NIO buffer. (We check this because otherwise we need to make it a noncomposite buffer.)
private static boolean isSingleDirectBuffer(ByteBuf buf) { return buf.isDirect() && buf.nioBufferCount() == 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static boolean isSingleDirectBuffer(ByteBuf buf) {\n/* 340 */ return (buf.isDirect() && buf.nioBufferCount() == 1);\n/* */ }", "public boolean verifyBuffer(Buffer buffer) {\n if (buffer.isDiscard()) {\n return true;\n }\n Object data = buffer.getData();\n ...
[ "0.7745987", "0.60196126", "0.5652189", "0.5639444", "0.5639444", "0.5576841", "0.55446887", "0.5356705", "0.52059716", "0.51880777", "0.50737417", "0.5066515", "0.50182194", "0.49820635", "0.4976126", "0.4968723", "0.49465215", "0.4902006", "0.48797274", "0.4850407", "0.4833...
0.7638284
1
Continue on write error as a DatagramChannel can write to multiple remote peers See
@Override protected boolean continueOnWriteError() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean continueOnWriteError() {\n/* 348 */ return true;\n/* */ }", "@Override\n public boolean write() throws Exception {\n if (count >= size) return true;\n if (dest == null) dest = new ChannelOutputDestination(channel);\n while (count < size) {\n final int n = location.trans...
[ "0.6619976", "0.6186935", "0.6093466", "0.59737605", "0.59598553", "0.5897437", "0.5872775", "0.5699546", "0.5657649", "0.56486183", "0.5628166", "0.5531819", "0.5461079", "0.54495734", "0.54485536", "0.54237896", "0.5385792", "0.53527135", "0.53499615", "0.534333", "0.532334...
0.6525923
1
We do not want to close on SocketException when using DatagramChannel as we usually can continue receiving. See
@Override protected boolean closeOnReadError(Throwable cause) { if (cause instanceof SocketException) { return false; } return super.closeOnReadError(cause); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean closeOnReadError(Throwable cause) {\n/* 606 */ if (cause instanceof SocketException) {\n/* 607 */ return false;\n/* */ }\n/* 609 */ return super.closeOnReadError(cause);\n/* */ }", "@Override\r\n\tpublic void close() {\r\n\t\tthis.socket.close();\r\n\t}", "@Overrid...
[ "0.74648815", "0.65335107", "0.650069", "0.64106315", "0.6350976", "0.62587816", "0.62454814", "0.62016135", "0.6164088", "0.6141161", "0.6135947", "0.61300236", "0.6128853", "0.61162144", "0.61104816", "0.6079088", "0.60759175", "0.606996", "0.60604703", "0.6059111", "0.6057...
0.7107558
1
We're going to need images for the markers
private void updateMarkers() { if( mPopulateImagesTask != null ) mPopulateImagesTask.cancel(true); mPopulateImagesTask = new PopulateBirdImagesTask() { @Override protected void onPostExecute(List<RemoteSighting> remoteSightings) { super.onPostExecute(remoteSightings); if( mSelectedMarker != null ) { // refresh mSelectedMarker.hideInfoWindow(); mSelectedMarker.showInfoWindow(); } } }; mPopulateImagesTask.execute(mBirds); // Now let's create the markers Marker marker; MarkerOptions markerOptions; LatLng location; boolean isSelectedMarker = false; mLocationBirdsMap.clear(); mMarkerBirdsMap.clear(); float maxbirds = 1.0f; // For marker hue for( RemoteSighting bird: mBirds ) { location = new LatLng(bird.getLat(), bird.getLng()); if( !mLocationBirdsMap.containsKey(location) ) mLocationBirdsMap.put(location, new ArrayList<RemoteSighting>()); ArrayList<RemoteSighting> birdsAtLocation = mLocationBirdsMap.get(location); birdsAtLocation.add(bird); if( birdsAtLocation.size() > maxbirds ) maxbirds = birdsAtLocation.size(); } for (Map.Entry<LatLng, ArrayList<RemoteSighting>> entry : mLocationBirdsMap.entrySet()) { ArrayList<RemoteSighting> birds = (entry.getValue()); RemoteSighting firstBird = birds.get(0); markerOptions = new MarkerOptions(). position(entry.getKey()). alpha( ((birds.size()/maxbirds) * 0.5f) + 0.5f). title(firstBird.getLocName()). snippet(birds.size() + (birds.size() > 1 ? " birds" : " bird") ); if (mSelectedBird != null) { LatLng birdLocation = entry.getKey(); LatLng selectedBirdLocation = new LatLng(mSelectedBird.getLat(), mSelectedBird.getLng()); if( selectedBirdLocation.equals(birdLocation)) { isSelectedMarker = true; } } marker = mMap.addMarker(markerOptions); if( !mMarkerBirdsMap.containsKey(marker) ) mMarkerBirdsMap.put(marker, entry.getValue()); if( isSelectedMarker ) { mSelectedMarker = marker; marker.showInfoWindow(); isSelectedMarker = false; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setUpImage() {\n Bitmap icon = BitmapFactory.decodeResource( this.getResources(), R.drawable.hotel_icon );\n map.addImage( MARKER_IMAGE_ID, icon );\n }", "public static void setMarker() {\n\t\tfor (Picture p : pictures) {\n\t\t\tif (p.getLon() < 200 && p.getLat() < 200) {\n\t\t\t\tM...
[ "0.7157844", "0.7080755", "0.6869598", "0.6675554", "0.66739106", "0.6549286", "0.6544894", "0.6409159", "0.6396894", "0.63643646", "0.6358369", "0.6318094", "0.6303579", "0.626473", "0.6263973", "0.62083656", "0.6200386", "0.6200135", "0.61751145", "0.6167107", "0.6128983", ...
0.6546782
6
Number of refresh per second
public Ball(Point c) { center = c; // Random velocity velocity = new Point((int)(Math.random()*20-10), (int)(Math.random()*20-10)); radius = 20; // repaint(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private float getRefreshRate() {\n return 1;\n }", "public int getRefreshFreq() {\n return m_refreshFrequency;\n }", "public final int getRefreshRate() {\r\n return settings.getRefreshRate();\r\n }", "public int getRefreshTime() {\n return refreshTime;\n }", "long ...
[ "0.78493536", "0.72872794", "0.71413714", "0.6964258", "0.6846169", "0.6800075", "0.6788029", "0.6676082", "0.66334814", "0.65579295", "0.65251327", "0.6480885", "0.64298105", "0.63723403", "0.63680154", "0.63594985", "0.63467026", "0.6320495", "0.6297987", "0.62756693", "0.6...
0.0
-1
TODO Autogenerated method stub
@Override public void run() { while (true) { // move(); // collisions(); // Refresh the display repaint(); // Callback paintComponent() // Delay for timing control and give other threads a chance try { Thread.sleep(1000 / UPDATE_RATE); // milliseconds } catch (InterruptedException ex) { } } }
{ "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
Project: JoeyTools Create : joey Date : 2019/01/30 13:36 Description:
public interface OnCrashListener { /** * 当发生崩溃时触发,注意:crashLog可能为空 * @param crashLog * @param crashData * @param crashInfo */ public void onCrash(File crashLog, List<AppCrashInfo> crashData, StringBuilder crashInfo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testCreate() throws Exception {\n\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\t\tDate startDate = new Date();\n\t\tCalendar calendar = new GregorianCalendar();\n\t\tcalendar.setTime(startDate);\n\t\tcalendar.add(Calendar.MONTH, 2);\n\t\t//\"name\":\"mizehau\",\...
[ "0.6457891", "0.61973464", "0.5779468", "0.5658449", "0.5633108", "0.54258853", "0.5423342", "0.5402356", "0.5395279", "0.5385982", "0.5367583", "0.5358612", "0.5354371", "0.53303653", "0.5319079", "0.5317732", "0.5261809", "0.5250475", "0.52380514", "0.52371854", "0.52371854...
0.0
-1
Log.e("TAG", "" + response);
@Override public void onResponse(String response, int id) { processData(response); OkHttpUtils.get().url(Constants.BANNER_URL).build().execute(new StringCallback() { @Override public void onError(Call call, Exception e, int id) { Log.e("TAG", "" + e.getMessage()); } @Override public void onResponse(final String response, int id) { //Log.e("TAG", "" + response); /*MainActivity activity = (MainActivity) mContext; activity.runOnUiThread(new Runnable() { @Override public void run() {*/ processData1(response); adapter = new ThemAdapter(mContext, resultBean, result); rvThem.setAdapter(adapter); GridLayoutManager manager = new GridLayoutManager(mContext, 1); rvThem.setLayoutManager(manager); swipeRefreshLayout.setRefreshing(false); /* } });*/ } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onResponse(String response) {\n Log.d(DEBUG_TAG, \"Response is: \"+ response);\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n System.out.println();\n Log.d(\"ERROR\", error.toS...
[ "0.7986216", "0.73571646", "0.73486173", "0.73275703", "0.72481674", "0.72360253", "0.7156059", "0.7096566", "0.70344234", "0.70248646", "0.70248646", "0.70248646", "0.70248646", "0.70248646", "0.70248646", "0.70248646", "0.70248646", "0.70248646", "0.70248646", "0.70248646", ...
0.0
-1
Spring Data repository for the EmployeeDetails entity.
@SuppressWarnings("unused") @Repository public interface EmployeeDetailsRepository extends JpaRepository<EmployeeDetails, Long> { Optional<EmployeeDetails> findByUserId(Long id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface EmployeeRepository extends CrudRepository<Employee, Long>{\n}", "@Repository\npublic interface EmployeeRepository extends JpaRepository<Employee, Integer> {\n}", "public interface EmployeeRepository extends JpaRepository<Employee, Integer> {\r\n\r\n}", "public interface IEmployeeRepository e...
[ "0.74925214", "0.74649894", "0.7438549", "0.7409356", "0.7220697", "0.7217011", "0.71919787", "0.71260804", "0.70977396", "0.7055417", "0.7051792", "0.70326376", "0.7026134", "0.67591286", "0.67237216", "0.6690215", "0.6684579", "0.6665783", "0.66598636", "0.6603268", "0.6579...
0.7701356
0
Create a new unzipper. It may be used for an entire session or subsession.
public Unzipper(BitReader bitreader) { super(); this.bitreader=bitreader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static synchronized ZipManager getInstance() {\n if (instance == null) {\n instance = new ZipManager();\n }\n return instance;\n }", "public StreamUnzipper(InputStream zipStream, File destDir)\n {\n if (zipStream == null)\n throw new IllegalArgumentException(\"zip strea...
[ "0.5310683", "0.5172201", "0.49978468", "0.49803728", "0.49226567", "0.48451337", "0.47456372", "0.46470505", "0.45649746", "0.45367402", "0.45207113", "0.4518288", "0.45065105", "0.44829395", "0.44707575", "0.4467271", "0.44290233", "0.44176143", "0.4417366", "0.43972716", "...
0.5121571
2
Read enough bits to obtain an integer from the keep, and increase that integer's weight.
private Object getAndTick(Keep keep,BitReader bitreader) throws JSONException { try { int width=keep.bitsize(); int integer=bitreader.read(width); Object value=keep.value(integer); if(JSONzip.probe) { JSONzip.log("\""+value+"\""); JSONzip.log(integer,width); } if(integer>=keep.length) { throw new JSONException("Deep error."); } keep.tick(integer); return value; } catch(Throwable e) { throw new JSONException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setWeight(int newWeight) {\n weight = newWeight;\n }", "public void addWeight(){\n\t\tweight++;\n\t}", "public void setWeight(int w){\n\t\tweight = w;\n\t}", "public void setWeight(Integer weight) {\n this.weight = weight;\n }", "public void setWeight(int w) {\n\t\tweight = w;\...
[ "0.5867173", "0.57572556", "0.561334", "0.5568176", "0.55232996", "0.54784703", "0.54784703", "0.54775715", "0.5419633", "0.5410427", "0.54048467", "0.5357981", "0.5352369", "0.5344381", "0.5342583", "0.5342583", "0.53353775", "0.5330978", "0.5324434", "0.531041", "0.5305938"...
0.5061462
51
The pad method skips the bits that padded a stream to fit some allocation. pad(8) will skip over the remainder of a byte.
public boolean pad(int width) throws JSONException { try { return this.bitreader.pad(width); } catch(Throwable e) { throw new JSONException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getAutoSkipPadding();", "Padding createPadding();", "public void set_pad(CArrayFacade<Byte> _pad) throws IOException\n\t{\n\t\tlong __dna__offset;\n\t\tif ((__io__pointersize == 8)) {\n\t\t\t__dna__offset = 12;\n\t\t} else {\n\t\t\t__dna__offset = 12;\n\t\t}\n\t\tif (__io__equals(_pad, __io__address + __dn...
[ "0.60475945", "0.58059025", "0.5767131", "0.5758368", "0.5737756", "0.57083774", "0.5705746", "0.56848407", "0.56523776", "0.5652101", "0.56246173", "0.56135356", "0.5606943", "0.55241543", "0.54392105", "0.5438116", "0.5419592", "0.5412804", "0.5380555", "0.53728896", "0.535...
0.47025415
61
Read an integer, specifying its width in bits.
private int read(int width) throws JSONException { try { int value=this.bitreader.read(width); if(probe) { log(value,width); } return value; } catch(Throwable e) { throw new JSONException(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int readInt();", "public int readInt() throws IOException;", "public int readInt() {\n return ((int) readLong());\n }", "private static int readInt(InputStream is) throws IOException {\n int a = is.read();\n int b = is.read();\n int c = is.read();\n int d = is.rea...
[ "0.65996647", "0.65401775", "0.65296406", "0.64344186", "0.64252704", "0.6416591", "0.6348403", "0.6317884", "0.6235417", "0.6204385", "0.6203775", "0.6131001", "0.61111504", "0.60381377", "0.59729636", "0.5969455", "0.5956561", "0.5940226", "0.59371895", "0.58801126", "0.588...
0.6425466
4
Read Huffman encoded characters into a keep.
private String read(Huff huff,Huff ext,Keep keep) throws JSONException { Kim kim; int at=0; int allocation=256; byte[] bytes=new byte[allocation]; if(bit()) { return getAndTick(keep,this.bitreader).toString(); } while(true) { if(at>=allocation) { allocation*=2; bytes=java.util.Arrays.copyOf(bytes,allocation); } int c=huff.read(this.bitreader); if(c==end) { break; } while((c&128)==128) { bytes[at]=(byte)c; at+=1; c=ext.read(this.bitreader); } bytes[at]=(byte)c; at+=1; } if(at==0) { return ""; } kim=new Kim(bytes,at); keep.register(kim); return kim.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void ReadHuffman(String aux) {\n\n Huffman DY = new Huffman();\n Huffman DCB = new Huffman();\n Huffman DCR = new Huffman();\n DY.setFrequencies(FreqY);\n DCB.setFrequencies(FreqCB);\n DCR.setFrequencies(FreqCR);\n\n StringBuilder encoding = new StringBuilde...
[ "0.6371224", "0.6205063", "0.59080094", "0.5820265", "0.57077676", "0.5689978", "0.56763905", "0.5584242", "0.555228", "0.5539482", "0.5517534", "0.5479856", "0.5445054", "0.54205114", "0.5379548", "0.53779674", "0.5362948", "0.53619045", "0.5337907", "0.5327747", "0.53154147...
0.59438956
2
Read a JSON value. The type of value is determined by the next 3 bits.
private Object readJSON() throws JSONException { switch(read(3)) { case zipObject: return readObject(); case zipArrayString: return readArray(true); case zipArrayValue: return readArray(false); case zipEmptyObject: return new JSONObject(); case zipEmptyArray: return new JSONArray(); case zipTrue: return Boolean.TRUE; case zipFalse: return Boolean.FALSE; default: return JSONObject.NULL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object readValue();", "public <V> V readValue(byte[] bytes, Type valueType) throws JsonException {\n try (ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);\n JsonReader jsonReader = Json.createReader(inputStream)) {\n return toJavaObject(jsonReader.readValue(), val...
[ "0.6739551", "0.666905", "0.64912426", "0.64743215", "0.6392956", "0.6349202", "0.613125", "0.60519505", "0.6041249", "0.59936357", "0.5891945", "0.583156", "0.5785544", "0.57751226", "0.568685", "0.566481", "0.562216", "0.561381", "0.559015", "0.555796", "0.54535896", "0.5...
0.6389723
5
Initializes the controller class.
public void initImages(ArrayList<Produit> l) { if (l.size() > 0) { loadImage1(l.get(0).getImg_url()); } if (l.size() > 1) { loadImage2(l.get(1).getImg_url()); } if (l.size() > 2) { loadImage3(l.get(2).getImg_url()); } if (l.size() > 3) { loadImage4(l.get(3).getImg_url()); } if (l.size() > 4) { loadImage5(l.get(4).getImg_url()); } if (l.size() > 5) { loadImage6(l.get(5).getImg_url()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initialize() {\n\t\tcontroller = Controller.getInstance();\n\t}", "public MainController() {\n\t\tcontroller = new Controller(this);\n\t}", "public abstract void initController();", "public Controller() {\n super();\n }", "public Controller() {\n super();\n }", "public Co...
[ "0.8125658", "0.78537387", "0.78320265", "0.776199", "0.776199", "0.76010174", "0.74497247", "0.7437837", "0.7430714", "0.742303", "0.74057597", "0.7341963", "0.7327749", "0.72634363", "0.72230434", "0.7102504", "0.70575505", "0.69873077", "0.69721675", "0.6944077", "0.691256...
0.0
-1
System.out.println(""); System.out.println("index :"+i); System.out.println("");
public void loadPreviousPage() { // System.out.println("index :"+i); // System.out.println("##########"); lisOfProduct = serv.read(); CurrP--; if (CurrP < nbP) { i = 0; indexOfImage = CurrP * 6 + i; loadImage1(lisOfProduct.get(x).getImg_url()); i++; x = CurrP * 6 + i; System.out.println(" i: " + i + "Curr: " + CurrP + "i in page: " + x); loadImage1(lisOfProduct.get(indexOfImage).getImg_url()); indexOfImage++; loadImage2(lisOfProduct.get(indexOfImage).getImg_url()); indexOfImage++; loadImage3(lisOfProduct.get(indexOfImage).getImg_url()); indexOfImage++; loadImage4(lisOfProduct.get(indexOfImage).getImg_url()); indexOfImage++; loadImage5(lisOfProduct.get(indexOfImage).getImg_url()); indexOfImage++; loadImage6(lisOfProduct.get(indexOfImage).getImg_url()); indexOfImage++; } indexOfImage -= 5; // IntStream.range(0, 1).forEach( // i -> next.fire() // ); // CurrP = 0; // i = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getIndex(){\r\n\t\treturn index;\r\n\t}", "public int getIndex(){\r\n \treturn index;\r\n }", "public static void main(String[] args) {\n\t\tint[] ia= {940,880,830,790,750,660,590,510,440};\n\t\tSystem.out.println(\"Size of the array \\\"ia\\\": \"+ia.length);\n\t\tSystem.out.println(\"First index of...
[ "0.67145914", "0.65625423", "0.64793754", "0.64603233", "0.64603233", "0.6417402", "0.6403859", "0.63936013", "0.6332785", "0.6329237", "0.63156825", "0.6309979", "0.6304934", "0.6304934", "0.6304934", "0.6287191", "0.6284219", "0.6280712", "0.6275039", "0.62701124", "0.62621...
0.0
-1
This function sets motor speeds, will set to static speed when bumper is pressed There is a debug at the end
public void setMotors(final double speed, double spinnerSafetySpeedMod) { spinnerMotorCan.set(ControlMode.PercentOutput, speed); /// DEBUG CODE /// if (RobotMap.driveDebug) { System.out.println("Spinner Speed : " + speed); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void setMotorSpeed(double speed){\n setLeftMotorSpeed(speed);\n setRightMotorSpeed(speed);\n }", "private void updateMotors() {\n\t\t//Pass filtered values to ChopperStatus.\n\t\tmStatus.setMotorFields(mMotorSpeed);\n\t\tString logline = Long.toString(System.currentTimeMillis()) + \" \" + mM...
[ "0.74853665", "0.73734987", "0.7282789", "0.7213817", "0.71929985", "0.71244", "0.70715433", "0.7062565", "0.7039658", "0.698736", "0.6979108", "0.6955857", "0.69310266", "0.69257516", "0.69242424", "0.69239557", "0.68566227", "0.6813019", "0.6806751", "0.67756706", "0.677396...
0.6866853
16
This function returns a double based on the values of two safety variables
public static double configSpeed(final double speed, final double speedMod) { final double returnVar; returnVar = speed * speedMod; /// DEBUG CODE /// if (RobotMap.driveDebug) { System.out.println("Error in configSpeed"); /// Return 0 /// return 0; } return returnVar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getDoubleValue2();", "double getDoubleValue1();", "double getDoubleValue3();", "public double calculateValue () {\n return double1 * double2;\n }", "public double evaluateAsDouble();", "public double utility();", "double getBasedOnValue();", "Double getValue();", "Double getDoubleV...
[ "0.7027152", "0.66362196", "0.6621033", "0.6607653", "0.6578242", "0.6504947", "0.6493745", "0.641602", "0.6279954", "0.623022", "0.61946696", "0.61384463", "0.61384463", "0.61384463", "0.6043229", "0.601391", "0.600114", "0.5978358", "0.5963149", "0.59571946", "0.59566003", ...
0.0
-1
Loads commands from src/main/resources/METAINF/services/fr.ign.validation.command.Command
private void loadRegistredCommands() { ServiceLoader<Command> loader = ServiceLoader.load(Command.class); for (Command command : loader) { addCommand(command); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface CommandLoader {\n\n\t/**\n\t * Gets list of commands in bundle\n\t * @return\n\t */\n\tList<CommandInfo> list();\n\t\n\t/**\n\t * Executes command\n\t * @param cmdName command name\n\t * @return\n\t */\n\tObject execute(String cmdName, String param);\n}", "public void registerCommands() {\n ...
[ "0.6790442", "0.6440591", "0.62500834", "0.5960908", "0.59331024", "0.58868706", "0.57956415", "0.57955784", "0.5704906", "0.56278783", "0.56207883", "0.5594443", "0.55798984", "0.55672354", "0.5567099", "0.55616826", "0.55610573", "0.5548339", "0.5513751", "0.55107194", "0.5...
0.77243084
0
Get command by name
private Command getCommandByName(String name) { for (Command command : commands) { if (command.getName().equals(name)) { return command; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Commands getCommand(String cmdName) {\n return cmdMap.get(cmdName);\n }", "private Command findCommand( String commandName )\n {\n Command command = null;\n CommandLine[] commands = commandList;\n\n for (int cmd = 0; cmd < commandList.length; ++cmd)\n {\n ...
[ "0.80245507", "0.7724539", "0.7714949", "0.7488315", "0.74508584", "0.72367364", "0.719698", "0.7141017", "0.7128828", "0.69755405", "0.6953135", "0.6831036", "0.6820455", "0.68004453", "0.6772535", "0.67518735", "0.67486274", "0.67445093", "0.6727549", "0.66868216", "0.66283...
0.8324972
0
Format item for help.
private String formatHelpItem(String name, String description) { return "\t" + name + " - " + description; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void encodeItemConfig(Formatter fmt, FacesContext context, UIComponent item, String text) {\n String icon = getItemIcon(context, item);\n String styleClass = (String)item.getAttributes().get(\"styleClass\");\n String disabledClass = (String)item.getAttributes().get(\"disabledClass\");\n...
[ "0.60555583", "0.5932985", "0.59148055", "0.58876795", "0.5803681", "0.57036626", "0.56776404", "0.5637026", "0.55823874", "0.55531687", "0.55448854", "0.5516748", "0.5497486", "0.54954726", "0.54890954", "0.5488375", "0.5466627", "0.54651016", "0.5459602", "0.54525006", "0.5...
0.7579072
0
Allows to replace writes to out.
public void setStdout(PrintStream stdout) { this.stdout = stdout; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected final Object writeReplace() throws ObjectStreamException {\n return replacement;\n }", "@Override\n protected void doWriteTo(StreamOutput out) throws IOException {\n }", "public Object writeReplace() {\n getDescription();\n return this;\n }", "public voi...
[ "0.66176707", "0.652256", "0.6391617", "0.6117145", "0.6106531", "0.60658884", "0.6050625", "0.6008649", "0.5975499", "0.5974005", "0.5968267", "0.5952056", "0.59292424", "0.59257543", "0.59233177", "0.59171945", "0.5905088", "0.58469045", "0.5845529", "0.584436", "0.5834822"...
0.0
-1
Disable error reporting from nontest threads found during tearDown(). The idea is that odd issue find while coming down are not important, as they are usually timing issues. Note: this doesn't quite work as intended. This should be run before each other tearDown() method, but junit offers no way to do that. If you can figure out how to make that work, then update this code.
@After // named differently than tearDown(), so subclasses do not override it public void dockingTearDown() { ConcurrentTestExceptionHandler.disable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void runBare() throws Throwable {\n Throwable exception= null;\n setUp();\n try {\n runTest();\n } catch (Throwable running) {\n exception= running;\n }\n finally {\n try {\n tearDown();\n } ca...
[ "0.66109586", "0.66088474", "0.65019995", "0.64681244", "0.64556855", "0.63430303", "0.6324708", "0.6324708", "0.62981427", "0.62890667", "0.6268144", "0.621852", "0.6214248", "0.62007827", "0.61938244", "0.61914796", "0.6186454", "0.6183828", "0.6171222", "0.61679405", "0.61...
0.69937426
0
make sure swing has handled any pending changes
public static void waitForUpdateOnChooser(GhidraFileChooser chooser) throws Exception { waitForSwing(); // Use an artificially high wait period that won't be reached most of the time. We // need this because file choosers use the native filesystem, which can have 'hiccups' int timeoutMillis = PRIVATE_LONG_WAIT_TIMEOUT; int totalTime = 0; while (pendingUpdate(chooser) && (totalTime < timeoutMillis)) { Thread.sleep(DEFAULT_WAIT_DELAY); totalTime += DEFAULT_WAIT_DELAY; } if (totalTime >= timeoutMillis) { Assert.fail("Timed-out waiting for directory to load"); } // make sure swing has handled any pending changes waitForSwing(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateGUIStatus() {\r\n\r\n }", "@Override\n public void stateChanged(javax.swing.event.ChangeEvent e) {\n }", "static private void change_do(BSUIWindow ui) {\n\t\tui.getPanel().removeAll();\n\t\tui.getPanel().setBackground(background);\n\t\tui.getPanel().s...
[ "0.6607065", "0.64587134", "0.6418883", "0.6215543", "0.6181347", "0.6080787", "0.6078154", "0.60576105", "0.6031606", "0.59995306", "0.59965974", "0.59878004", "0.5986522", "0.59742904", "0.5968546", "0.59557056", "0.59526813", "0.59511423", "0.59287447", "0.5915278", "0.591...
0.0
-1
Waits for the system error dialog to appear
public static AbstractErrDialog waitForErrorDialog() { return waitForDialogComponent(AbstractErrDialog.class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void run() {\n waitDialog.dismiss();\n\n //show an error dialog\n\n\n }", "private void tellTheUserToWait() {\n\t\tfinal JDialog warningDialog = new JDialog(descriptionDialog, ejsRes.getString(\"Simulation.Open...
[ "0.7038761", "0.63708246", "0.62744105", "0.6248411", "0.61255836", "0.61095524", "0.6093752", "0.60878706", "0.60618687", "0.60256344", "0.6023292", "0.6002634", "0.595824", "0.59355617", "0.58987385", "0.5849067", "0.584493", "0.5844505", "0.58328146", "0.5814521", "0.58022...
0.69417053
1
Waits for the system info dialog to appear
public static OkDialog waitForInfoDialog() { return waitForDialogComponent(OkDialog.class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void tellTheUserToWait() {\n\t\tfinal JDialog warningDialog = new JDialog(descriptionDialog, ejsRes.getString(\"Simulation.Opening\"));\r\n\t\tfinal JLabel label = new JLabel(ejsRes.getString(\"Simulation.Opening\"));\r\n\t\tlabel.setBorder(new javax.swing.border.EmptyBorder(5, 5, 5, 5));\r\n\t\tSwingUtili...
[ "0.66886336", "0.62706834", "0.6237807", "0.61859477", "0.6126609", "0.6123649", "0.60530007", "0.60356283", "0.5983243", "0.5891926", "0.58408666", "0.5811555", "0.5750621", "0.572885", "0.57207686", "0.5712357", "0.56544834", "0.56529295", "0.56482285", "0.56341934", "0.561...
0.6592629
1
try at least one time
public static Window waitForWindowByTitleContaining(String text) { Window window = getWindowByTitleContaining(null, text); if (window != null) { return window;// we found it...no waiting required } int totalTime = 0; int timeout = DEFAULT_WAIT_TIMEOUT; while (totalTime <= timeout) { window = getWindowByTitleContaining(null, text); if (window != null) { return window; } totalTime += sleep(DEFAULT_WAIT_DELAY); } throw new AssertionFailedError( "Timed-out waiting for window containg title '" + text + "'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean retry() {\n return tries++ < MAX_TRY;\n }", "public void retryRequired(){\n startFetching(query);\n }", "@Override\n public boolean callCheck() {\n return last == null;\n }", "private boolean mustTryConnection(int iteration) {\n\t\t\n\t\t//the goal is to not to...
[ "0.68439627", "0.64358497", "0.60569274", "0.6015974", "0.5928207", "0.59256506", "0.58887213", "0.58800524", "0.5863321", "0.5855299", "0.5813067", "0.58111966", "0.5810897", "0.5807581", "0.5802951", "0.579762", "0.579762", "0.5790075", "0.5767517", "0.5767517", "0.57525134...
0.0
-1
Waits for a window with the given name.
@Deprecated public static Window waitForWindow(String title, int timeoutMS) { return waitForWindow(title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Window waitForWindowByName(String name) {\n\n\t\tint time = 0;\n\t\tint timeout = DEFAULT_WAIT_TIMEOUT;\n\t\twhile (time <= timeout) {\n\t\t\tSet<Window> allWindows = getAllWindows();\n\t\t\tfor (Window window : allWindows) {\n\t\t\t\tString windowName = window.getName();\n\t\t\t\tif (name.equals(win...
[ "0.83356386", "0.6503099", "0.64917576", "0.5951411", "0.59218454", "0.57931554", "0.55775434", "0.55130935", "0.54625404", "0.5431215", "0.5414923", "0.5355884", "0.5342915", "0.53243756", "0.52972597", "0.5260902", "0.5257219", "0.5219599", "0.51930773", "0.5192455", "0.517...
0.5265982
15
Waits for a window with the given name
public static Window waitForWindow(String title) { Window window = getWindow(title); if (window != null) { return window;// we found it...no waiting required } int totalTime = 0; int timeout = DEFAULT_WAIT_TIMEOUT; while (totalTime <= timeout) { window = getWindow(title); if (window != null) { return window; } totalTime += sleep(DEFAULT_WAIT_DELAY); } throw new AssertionFailedError("Timed-out waiting for window with title '" + title + "'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Window waitForWindowByName(String name) {\n\n\t\tint time = 0;\n\t\tint timeout = DEFAULT_WAIT_TIMEOUT;\n\t\twhile (time <= timeout) {\n\t\t\tSet<Window> allWindows = getAllWindows();\n\t\t\tfor (Window window : allWindows) {\n\t\t\t\tString windowName = window.getName();\n\t\t\t\tif (name.equals(win...
[ "0.83102995", "0.6586516", "0.6151005", "0.61149603", "0.5848624", "0.5801215", "0.56955117", "0.5678787", "0.5659288", "0.5650635", "0.56177", "0.55916715", "0.5567714", "0.5477484", "0.5449996", "0.5443462", "0.5400526", "0.53648704", "0.5359121", "0.5344511", "0.53423166",...
0.65309966
2
Waits for a window with the given name.
public static Window waitForWindowByName(String name) { int time = 0; int timeout = DEFAULT_WAIT_TIMEOUT; while (time <= timeout) { Set<Window> allWindows = getAllWindows(); for (Window window : allWindows) { String windowName = window.getName(); if (name.equals(windowName) && window.isShowing()) { return window; } time += sleep(DEFAULT_WAIT_DELAY); } } throw new AssertionFailedError("Timed-out waiting for window with name '" + name + "'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Window waitForWindow(String title) {\n\t\tWindow window = getWindow(title);\n\t\tif (window != null) {\n\t\t\treturn window;// we found it...no waiting required\n\t\t}\n\n\t\tint totalTime = 0;\n\t\tint timeout = DEFAULT_WAIT_TIMEOUT;\n\t\twhile (totalTime <= timeout) {\n\n\t\t\twindow = getWindow(ti...
[ "0.6501918", "0.6490597", "0.59487855", "0.5920008", "0.57917917", "0.5576763", "0.55109954", "0.54607004", "0.54283774", "0.5412252", "0.5354202", "0.53419644", "0.53241307", "0.52958715", "0.526459", "0.5259765", "0.5258869", "0.52202374", "0.51931083", "0.51916367", "0.516...
0.8334784
0
Check for and display message component text associated with OptionDialog windows
public static String getMessageText(Window w) { Component c = findComponentByName(w, OptionDialog.MESSAGE_COMPONENT_NAME); if (c instanceof JLabel) { return ((JLabel) c).getText(); } else if (c instanceof MultiLineLabel) { return ((MultiLineLabel) c).getLabel(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Object displayOptionsPanel(String message, Object[] possibleValues) {\n return JOptionPane.showInputDialog(\n mainPanel, // parentComponent\n message, // message\n \"\", // title\n ...
[ "0.7053466", "0.69088846", "0.68452114", "0.6727242", "0.66337913", "0.6541317", "0.64361686", "0.62699413", "0.6240449", "0.623097", "0.6190022", "0.61710715", "0.6166234", "0.6126749", "0.6106578", "0.6105025", "0.6093661", "0.60819995", "0.6064234", "0.60640866", "0.606116...
0.629805
7
Get the dialog provider's status text
public static String getStatusText(DialogComponentProvider provider) { AtomicReference<String> ref = new AtomicReference<>(); runSwing(() -> { ref.set(provider.getStatusText()); }); return ref.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getTstatStatusMessage() {\n\n String thStatusMsg = null;\n WebElement modeDialog = getElement(getDriver(), By.cssSelector(MODEL_DIALOG), TINY_TIMEOUT);\n if (modeDialog.isDisplayed()) {\n WebElement modeMessage = getElementBySubElement(getDriver(), modeDialog,\n ...
[ "0.7087378", "0.68069977", "0.6800799", "0.67868906", "0.66965735", "0.66892916", "0.664434", "0.66295666", "0.65683115", "0.65683115", "0.65683115", "0.65683115", "0.6514086", "0.64682937", "0.64210963", "0.64210963", "0.64210963", "0.64210963", "0.64210963", "0.64089876", "...
0.82094055
0
Will try to close dialogs prompting for changes to be saved, whether from program changes or from tool config changes.
public static void closeSaveChangesDialog() { waitForSwing(); OptionDialog dialog = getDialogComponent(OptionDialog.class); if (dialog == null) { return; } String title = dialog.getTitle(); boolean isSavePrompt = StringUtils.containsAny(title, "Changed", "Saved"); if (!isSavePrompt) { throw new AssertionError("Unexpected dialog with title '" + title + "'; " + "Expected a dialog alerting to program changes"); } if (StringUtils.contains(title, "Program Changed")) { // the program is read-only or not in a writable project pressButtonByText(dialog, "Continue"); return; } if (StringUtils.contains(title, "Save Program?")) { pressButtonByText(dialog, "Cancel"); return; } throw new AssertionError("Unexpected dialog with title '" + title + "'; " + "Expected a dialog alerting to program changes"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void performWindowClosing() {\r\n if (dataChanged) {\r\n try {\r\n int result = CoeusOptionPane.showQuestionDialog(\r\n coeusMessageResources.parseMessageKey(\r\n \"saveConfirmCode.1002\"),\r\n CoeusOption...
[ "0.7257918", "0.7127329", "0.7059525", "0.70095795", "0.6996831", "0.691289", "0.6844197", "0.67878157", "0.67827624", "0.67770684", "0.67544395", "0.67014265", "0.6600086", "0.6595679", "0.6587334", "0.6544002", "0.64957875", "0.6447326", "0.6439917", "0.64152527", "0.641000...
0.8230727
0
A convenience method to close all of the windows and frames that the current Java windowing environment knows about
public static void closeAllWindows() { closeAllWindows(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void closeAllWindow() {\n\t\tthis.dispose();\n\t\tSystem.exit(0);\n\t}", "private void thisWindowClosing()\n {\n // Keep track of the fact that we're in the act of closing this window\n m_bClosing = true;\n\n // Need to explicitly release the focus which in turn will cause any\n ...
[ "0.8180735", "0.7042632", "0.70211804", "0.7015948", "0.69724685", "0.694776", "0.6901517", "0.67963743", "0.67894286", "0.6784396", "0.6778293", "0.6768504", "0.6764809", "0.6743199", "0.67386574", "0.6731341", "0.67201513", "0.66941774", "0.6691282", "0.667922", "0.66589105...
0.81791574
1
Waits for the JDialog with the given title Note: Sometimes the task dialog might have the same title as the dialog you pop up and you want to get yours instead of the one for the task monitor.
public static JDialog waitForJDialog(String title) { int totalTime = 0; while (totalTime <= DEFAULT_WINDOW_TIMEOUT) { Set<Window> winList = getAllWindows(); Iterator<Window> iter = winList.iterator(); while (iter.hasNext()) { Window w = iter.next(); if ((w instanceof JDialog) && w.isShowing()) { String windowTitle = getTitleForWindow(w); if (title.equals(windowTitle)) { return (JDialog) w; } } } totalTime += sleep(DEFAULT_WAIT_DELAY); } throw new AssertionFailedError("Timed-out waiting for window with title '" + title + "'"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void ShowWaitDialog(String title, String message);", "public void waitDialog(String title) {\n Stage dialog = new Stage();\n Parent root = null;\n try {\n root = FXMLLoader.load(Objects.requireNonNull(getClass().getClassLoader().getResource(\"wait.fxml\")));\n Scene s1 ...
[ "0.73215365", "0.695093", "0.6557166", "0.64045435", "0.6332776", "0.6245229", "0.61225027", "0.59287864", "0.5863348", "0.58478874", "0.5835997", "0.58137524", "0.578079", "0.5760937", "0.5740598", "0.57402986", "0.57249844", "0.570766", "0.5675095", "0.56607", "0.56567484",...
0.8039681
0
Waits for the first window of the given class.
public static <T extends DialogComponentProvider> T waitForDialogComponent( Class<T> ghidraClass) { return waitForDialogComponent(null, ghidraClass, DEFAULT_WINDOW_TIMEOUT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Window waitForWindowByName(String name) {\n\n\t\tint time = 0;\n\t\tint timeout = DEFAULT_WAIT_TIMEOUT;\n\t\twhile (time <= timeout) {\n\t\t\tSet<Window> allWindows = getAllWindows();\n\t\t\tfor (Window window : allWindows) {\n\t\t\t\tString windowName = window.getName();\n\t\t\t\tif (name.equals(win...
[ "0.575764", "0.57561284", "0.5710059", "0.53589743", "0.52907264", "0.52660143", "0.52362734", "0.51611537", "0.5159747", "0.5106563", "0.5064663", "0.5061127", "0.5013278", "0.5009259", "0.49372876", "0.4919933", "0.49182492", "0.4900952", "0.48725304", "0.4865367", "0.48346...
0.5842965
0
Waits for the first window of the given class. This method assumes that the desired dialog is parented by parentWindow.
@Deprecated public static <T extends DialogComponentProvider> T waitForDialogComponent(Window parentWindow, Class<T> clazz, int timeoutMS) { if (!DialogComponentProvider.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(clazz.getName() + " does not extend " + DialogComponentProvider.class.getSimpleName()); } int totalTime = 0; while (totalTime <= DEFAULT_WAIT_TIMEOUT) { T provider = getDialogComponent(parentWindow, clazz); if (provider != null) { return provider; } totalTime += sleep(DEFAULT_WAIT_DELAY); } throw new AssertionFailedError("Timed-out waiting for window of class: " + clazz); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static <T extends DialogComponentProvider> T waitForDialogComponent(\n\t\t\tClass<T> ghidraClass) {\n\t\treturn waitForDialogComponent(null, ghidraClass, DEFAULT_WINDOW_TIMEOUT);\n\t}", "public static JDialog waitForJDialog(String title) {\n\n\t\tint totalTime = 0;\n\t\twhile (totalTime <= DEFAULT_WINDOW_...
[ "0.60728705", "0.60083264", "0.57343054", "0.56013453", "0.5521947", "0.55195624", "0.54724634", "0.54241985", "0.5414633", "0.5399139", "0.53885406", "0.53663677", "0.5342363", "0.5335067", "0.5326282", "0.5321582", "0.52475375", "0.5236462", "0.5200911", "0.5186313", "0.518...
0.52387744
17
Gets the dialog component provider that is inside the given window or null if a provider of the given class type is not in the window.
protected static <T extends DialogComponentProvider> T getDialogComponentProvider(Window window, Class<T> ghidraClass) { if (!(window instanceof DockingDialog)) { return null; } if (!window.isShowing()) { return null; } DialogComponentProvider provider = ((DockingDialog) window).getDialogComponent(); if (provider == null || !provider.isVisible()) { // provider can be null if the DockingDialog is disposed before we can get the provider return null; } if (!ghidraClass.isAssignableFrom(provider.getClass())) { return null; } return ghidraClass.cast(provider); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static <T extends ComponentProvider> T getDetachedWindowProvider(\n\t\t\tfinal Class<T> providerClass, final DockingWindowManager windowManager) {\n\n\t\tObjects.requireNonNull(windowManager, \"DockingWindowManager cannot be null\");\n\n\t\tAtomicReference<T> ref = new AtomicReference<>();\n\n\t\trunSwing(...
[ "0.6854022", "0.58095014", "0.5799224", "0.5699134", "0.5681097", "0.5496266", "0.54233366", "0.52836037", "0.527111", "0.52568716", "0.5217039", "0.5198581", "0.51854837", "0.5177067", "0.51337314", "0.51143676", "0.51129574", "0.510504", "0.50983554", "0.4886487", "0.487773...
0.75833714
0
These providers are those that appear in dialogs outside of the main frame
private static <T extends ComponentProvider> T getDetachedWindowProvider( final Class<T> providerClass, final DockingWindowManager windowManager) { Objects.requireNonNull(windowManager, "DockingWindowManager cannot be null"); AtomicReference<T> ref = new AtomicReference<>(); runSwing(() -> { Object rootNode = getInstanceField("root", windowManager); List<?> windowNodeList = (List<?>) invokeInstanceMethod("getDetachedWindows", rootNode); for (Object windowNode : windowNodeList) { Object childNode = getInstanceField("child", windowNode); ComponentProvider provider = getComponentProviderFromNode(childNode, providerClass); if (provider != null) { ref.set(providerClass.cast(provider)); } } }); return ref.get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JDialog getParametersWidget(JFrame master);", "@Override\n public void onCancel(DialogInterface dialog) {\n onProviderInstallerNotAvailable();\n }", "private void handleProviderSelected() {\n \t\tint index = fProviderCombo.getSelec...
[ "0.58917737", "0.5848815", "0.5715735", "0.5603612", "0.5512013", "0.5461051", "0.539525", "0.5332763", "0.5311718", "0.5308931", "0.5236822", "0.5192139", "0.51908445", "0.5188884", "0.5162883", "0.51510286", "0.51457685", "0.51372313", "0.5134755", "0.5102044", "0.5091336",...
0.0
-1
A recursive method to get the first encountered ComponentProvider instance of the give component provider class. Note: this method assumes the given node is not a RootNode, but a child thereof
private static ComponentProvider getComponentProviderFromNode(Object node, Class<? extends ComponentProvider> providerClass) { Class<?> nodeClass = node.getClass(); String className = nodeClass.getName(); if (className.indexOf("ComponentNode") != -1) { List<ComponentPlaceholder> infoList = CollectionUtils.asList( (List<?>) getInstanceField("windowPlaceholders", node), ComponentPlaceholder.class); for (ComponentPlaceholder info : infoList) { ComponentProvider provider = info.getProvider(); if ((provider != null) && providerClass.isAssignableFrom(provider.getClass())) { return provider; } } } else if (className.indexOf("WindowNode") != -1) { Object childNode = getInstanceField("child", node); return getComponentProviderFromNode(childNode, providerClass);// recurse } else if (className.indexOf("SplitNode") != -1) { Object leftNode = getInstanceField("child1", node); ComponentProvider leftProvider = getComponentProviderFromNode(leftNode, providerClass);// recurse if (leftProvider != null) { return leftProvider; } Object rightNode = getInstanceField("child2", node); return getComponentProviderFromNode(rightNode, providerClass);// recurse } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Component clickComponentProvider(ComponentProvider provider) {\n\n\t\tJComponent component = provider.getComponent();\n\t\tDockableComponent dockableComponent = getDockableComponent(component);\n\t\tselectTabIfAvailable(dockableComponent);\n\t\tRectangle bounds = component.getBounds();\n\t\tint cente...
[ "0.55078375", "0.5501486", "0.5484058", "0.5461959", "0.5346745", "0.52717006", "0.52662456", "0.52460915", "0.5232855", "0.5195451", "0.5174138", "0.51422024", "0.5113151", "0.5104527", "0.50579286", "0.50377506", "0.5027439", "0.50168973", "0.500804", "0.5001382", "0.498088...
0.8189384
0
Finds the button with the indicated TEXT that is a subcomponent of the indicated container, and then programmatically presses the button. The following is a sample JUnit test use: env.showTool(); OptionDialog dialog = (OptionDialog)env.waitForDialog(OptionDialog.class, 1000); assertNotNull(dialog); pressButtonByText(dialog, "OK");
public static void pressButtonByText(DialogComponentProvider provider, String buttonText) { pressButtonByText(provider.getComponent(), buttonText, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void pressButtonByText(DialogComponentProvider provider, String buttonText,\n\t\t\tboolean waitForCompletion) {\n\t\tpressButtonByText(provider.getComponent(), buttonText, waitForCompletion);\n\t}", "private void handleSearchButtonSelected() {\n\t\tShell shell = getShell();\n\t\tIProject project = ...
[ "0.6084282", "0.60295045", "0.6027084", "0.5926249", "0.5808261", "0.5723254", "0.57157516", "0.56899047", "0.56623775", "0.56583613", "0.5652666", "0.56427026", "0.5586214", "0.5579828", "0.5535214", "0.5430125", "0.540621", "0.53745115", "0.5355727", "0.53309095", "0.532504...
0.5729826
5
Finds the button with the indicated TEXT that is a subcomponent of the indicated container, and then programmatically presses the button.
public static void pressButtonByText(DialogComponentProvider provider, String buttonText, boolean waitForCompletion) { pressButtonByText(provider.getComponent(), buttonText, waitForCompletion); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void clickOnSearchButton() {\n elementControl.clickElement(searchButton);\n }", "public void actionButton(String text);", "public void clickOnText(String text);", "public void clickSearchButton() {\n\t\tsearchButton.click();\n\t}", "public void clickSubmitInkAndTonnerSearchButton(){\r\n\r\...
[ "0.6464412", "0.60690844", "0.6063368", "0.586", "0.5718922", "0.57156205", "0.5714102", "0.57034016", "0.5685538", "0.55871016", "0.5557051", "0.55311704", "0.54929775", "0.54754275", "0.54675114", "0.54604137", "0.5456728", "0.54464746", "0.5433518", "0.542765", "0.5423135"...
0.5218658
64
Checks the selected state of a JToggleButton in a thread safe way.
public static void assertToggleButtonSelected(JToggleButton button, boolean selected) { AtomicBoolean ref = new AtomicBoolean(); runSwing(() -> ref.set(button.isSelected())); Assert.assertEquals("Button not in expected selected state", selected, ref.get()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isSelected();", "boolean isSelected();", "boolean isSelected();", "public boolean isSelected() {\n return (state & STATE_SELECTED) != 0;\n }", "public boolean isSelected();", "public boolean isSelected();", "private void checkButton(ActionEvent e) {\n List<PuzzleButton> selecte...
[ "0.6065645", "0.6065645", "0.6065645", "0.6010127", "0.5976002", "0.5976002", "0.5971468", "0.5856909", "0.5818161", "0.572904", "0.5704233", "0.56885976", "0.5668983", "0.56351733", "0.5604993", "0.55866665", "0.5580256", "0.5563777", "0.556216", "0.5561465", "0.5513359", ...
0.6492369
0
Checks the enablement state of a JComponent in a thread safe way.
public static void assertEnabled(JComponent component, boolean enabled) { AtomicBoolean ref = new AtomicBoolean(); runSwing(() -> ref.set(component.isEnabled())); Assert.assertEquals("Component not in expected enablement state", enabled, ref.get()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkEnabled() {\n }", "public boolean areComponentsEnabled() {\n return itiefe.isEnabled();\n }", "boolean hasEnabled();", "public void checkin(CriticalComponent criticalComponent);", "boolean updateEnabling();", "public void checkEnabled()\n {\n if(graph == null || grap...
[ "0.650755", "0.59199524", "0.58758646", "0.585941", "0.5845792", "0.5744802", "0.56336516", "0.5619617", "0.5589796", "0.55687857", "0.5519078", "0.5517915", "0.54524994", "0.5438708", "0.53776485", "0.5350793", "0.5350793", "0.53292894", "0.5318911", "0.5302434", "0.52848923...
0.61395556
1
A helper method to find all actions with the given name
public static Set<DockingActionIf> getActionsByName(Tool tool, String name) { Set<DockingActionIf> result = new HashSet<>(); Set<DockingActionIf> toolActions = tool.getAllActions(); for (DockingActionIf action : toolActions) { if (action.getName().equals(name)) { result.add(action); } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Action getAction(String name) { return actions.get(name); }", "public ActionReader getAction(String name);", "String[] getActions();", "public ActionList getActions();", "public static Set<DockingActionIf> getActionsByOwner(Tool tool, String name) {\n\t\treturn tool.getDockingActionsByOwnerName(nam...
[ "0.7597417", "0.6711573", "0.65880316", "0.6423776", "0.6145476", "0.6137768", "0.611756", "0.6088767", "0.60679007", "0.60427195", "0.59779114", "0.5963767", "0.58847004", "0.5881752", "0.58307904", "0.5761987", "0.5751861", "0.5725649", "0.57246333", "0.57092893", "0.570716...
0.6857733
1
A helper method to find all actions with the given owner's name (this will not include reserved system actions)
public static Set<DockingActionIf> getActionsByOwner(Tool tool, String name) { return tool.getDockingActionsByOwnerName(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Set<DockingActionIf> getActionsByOwnerAndName(Tool tool, String owner,\n\t\t\tString name) {\n\t\tSet<DockingActionIf> ownerActions = tool.getDockingActionsByOwnerName(owner);\n\t\treturn ownerActions.stream()\n\t\t\t\t.filter(action -> action.getName().equals(name))\n\t\t\t\t.collect(Collectors.toSe...
[ "0.7359365", "0.61252517", "0.5858882", "0.5850454", "0.57741255", "0.5719765", "0.5713571", "0.5637789", "0.56176335", "0.55812615", "0.55480564", "0.5520516", "0.5516009", "0.5499499", "0.54889685", "0.54621035", "0.5404498", "0.53887755", "0.5385841", "0.5345597", "0.53231...
0.7142432
1
A helper method to find all actions by name, with the given owner's name (this will not include reserved system actions)
public static Set<DockingActionIf> getActionsByOwnerAndName(Tool tool, String owner, String name) { Set<DockingActionIf> ownerActions = tool.getDockingActionsByOwnerName(owner); return ownerActions.stream() .filter(action -> action.getName().equals(name)) .collect(Collectors.toSet()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Set<DockingActionIf> getActionsByOwner(Tool tool, String name) {\n\t\treturn tool.getDockingActionsByOwnerName(name);\n\t}", "public Action getAction(String name) { return actions.get(name); }", "public static Set<DockingActionIf> getActionsByName(Tool tool, String name) {\n\n\t\tSet<DockingActi...
[ "0.7158747", "0.61698675", "0.61021596", "0.58007777", "0.5653872", "0.5652864", "0.5545967", "0.55386883", "0.54787624", "0.5466087", "0.54590803", "0.54437315", "0.5390995", "0.5327131", "0.5315829", "0.52977425", "0.5292855", "0.52570486", "0.52474827", "0.52361524", "0.52...
0.74895155
0
Returns the action by the given name that belongs to the given provider
public static DockingActionIf getLocalAction(ComponentProvider provider, String actionName) { Tool tool = provider.getTool(); DockingToolActions toolActions = tool.getToolActions(); DockingActionIf action = toolActions.getLocalAction(provider, actionName); return action; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static DockingActionIf getAction(DialogComponentProvider provider, String actionName) {\n\n\t\tSet<DockingActionIf> actions = provider.getActions();\n\t\tfor (DockingActionIf action : actions) {\n\t\t\tif (action.getName().equals(actionName)) {\n\t\t\t\treturn action;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}"...
[ "0.7393949", "0.69655395", "0.6866072", "0.6255322", "0.58758646", "0.5865874", "0.5816839", "0.565748", "0.5639007", "0.5517844", "0.5442503", "0.5442143", "0.5442143", "0.5427379", "0.53432274", "0.5307676", "0.52588457", "0.5232824", "0.52201754", "0.51857173", "0.51855093...
0.6601403
3
Returns the given dialog's action that has the given name
public static DockingActionIf getAction(DialogComponentProvider provider, String actionName) { Set<DockingActionIf> actions = provider.getActions(); for (DockingActionIf action : actions) { if (action.getName().equals(actionName)) { return action; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Action getAction(String name) { return actions.get(name); }", "String getActionName();", "public ActionReader getAction(String name);", "String getAction();", "String getAction();", "String getActionName(Closure action);", "public String getAction() {\n\t\treturn action.get();\n\t}", "public ...
[ "0.73775625", "0.7242831", "0.71186715", "0.68627965", "0.68627965", "0.6841713", "0.647275", "0.62598836", "0.6227112", "0.62092996", "0.6196451", "0.61848927", "0.61848927", "0.61848927", "0.61432874", "0.6110334", "0.61096686", "0.60927165", "0.6066363", "0.6066363", "0.60...
0.65209323
6
Performs the specified action within the Swing Thread. If the action results in a modal dialog, waitForCompletion must be false.
public static void performAction(DockingActionIf action, boolean waitForCompletion) { ActionContext context = runSwing(() -> { ActionContext actionContext = new DefaultActionContext(); DockingWindowManager activeInstance = DockingWindowManager.getActiveInstance(); if (activeInstance == null) { return actionContext; } ComponentProvider provider = activeInstance.getActiveComponentProvider(); if (provider == null) { return actionContext; } ActionContext providerContext = provider.getActionContext(null); if (providerContext != null) { return providerContext; } return actionContext; }); doPerformAction(action, context, waitForCompletion); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void performDialogAction(DockingActionIf action, DialogComponentProvider provider,\n\t\t\tboolean wait) {\n\n\t\tActionContext context = runSwing(() -> {\n\t\t\tActionContext actionContext = provider.getActionContext(null);\n\t\t\tif (actionContext != null) {\n\t\t\t\tactionContext.setSourceObject(pr...
[ "0.59666514", "0.5965371", "0.57532865", "0.56618935", "0.5473442", "0.53965646", "0.5388226", "0.5378051", "0.5351238", "0.5327025", "0.5323031", "0.5320751", "0.5283636", "0.5270851", "0.5238461", "0.5208349", "0.5195089", "0.5177639", "0.51732546", "0.51643133", "0.516139"...
0.6361882
0
Performs the specified action with context within the Swing Thread. If the action results in a modal dialog, waitForCompletion must be false.
public static void performAction(DockingActionIf action, ComponentProvider provider, boolean wait) { ActionContext context = runSwing(() -> { ActionContext actionContext = new DefaultActionContext(); if (provider == null) { return actionContext; } ActionContext newContext = provider.getActionContext(null); if (newContext == null) { return actionContext; } actionContext = newContext; actionContext.setSourceObject(provider.getComponent()); return actionContext; }); doPerformAction(action, context, wait); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void performAction(DockingActionIf action, boolean waitForCompletion) {\n\n\t\tActionContext context = runSwing(() -> {\n\t\t\tActionContext actionContext = new DefaultActionContext();\n\t\t\tDockingWindowManager activeInstance = DockingWindowManager.getActiveInstance();\n\t\t\tif (activeInstance == ...
[ "0.6784974", "0.62197375", "0.58393127", "0.57604027", "0.57086927", "0.54286337", "0.5411149", "0.5365572", "0.5258272", "0.5250968", "0.5241448", "0.5230009", "0.5184213", "0.5182562", "0.5144984", "0.5126672", "0.5125197", "0.51036614", "0.50516635", "0.50379074", "0.50362...
0.5841594
2
Performs the specified action with context within the Swing Thread. If the action results in a modal dialog, waitForCompletion must be false.
public static void performDialogAction(DockingActionIf action, DialogComponentProvider provider, boolean wait) { ActionContext context = runSwing(() -> { ActionContext actionContext = provider.getActionContext(null); if (actionContext != null) { actionContext.setSourceObject(provider.getComponent()); } return actionContext; }); doPerformAction(action, context, wait); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void performAction(DockingActionIf action, boolean waitForCompletion) {\n\n\t\tActionContext context = runSwing(() -> {\n\t\t\tActionContext actionContext = new DefaultActionContext();\n\t\t\tDockingWindowManager activeInstance = DockingWindowManager.getActiveInstance();\n\t\t\tif (activeInstance == ...
[ "0.67856514", "0.5840263", "0.5837278", "0.57583326", "0.5710005", "0.54272604", "0.5409092", "0.5363207", "0.5255432", "0.524878", "0.52414316", "0.5226712", "0.5183037", "0.51816416", "0.51422983", "0.51255095", "0.5124252", "0.5100215", "0.5050282", "0.5034804", "0.50344",...
0.6218749
1