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
returns either +1 or 1, randomly. This determines whether the landscape moves up, or down. We use the range 0 .. 99 to try and get a better, more even distribution of results.
static int getRandomDelta() { int d = rand.nextInt(100); if (d < 50) { return -1; } else { return 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int decideRandomMove() {\n return (int) (Math.random() * 4);\n }", "static void randomMove() {\n int directionNum; // Randomly set to 0, 1, 2, or 3 to choose direction.\n directionNum = ( int )( Math.random() * 4 );\n\n switch ( directionNum ) {\n case 0: // Mov...
[ "0.6848944", "0.63345134", "0.6309417", "0.6151362", "0.6140919", "0.6089861", "0.6039997", "0.60239303", "0.60195166", "0.5997348", "0.59854615", "0.5963902", "0.59204006", "0.5847412", "0.5833621", "0.5831938", "0.58251363", "0.5805799", "0.57999355", "0.579801", "0.5796052...
0.56404585
41
Index a few projects to compare search results
public void testSearchRules() throws Exception { Project project = new Project(); DateFormatSymbols symbols = new DateFormatSymbols(Locale.US); for (int i = 0; i < 12; i++) { String month = symbols.getMonths()[i]; String shortMonth = symbols.getShortMonths()[i]; // Basic project info project.setId(i); project.setCategoryId(1); project.setAllowGuests(true); project.setMembershipRequired(false); project.setApproved(true); project.setClosed(false); project.setPortal(false); // Unique Title project.setTitle(month + " test project"); project.setShortDescription(month + " description word"); project.setKeywords(shortMonth); // Unique Location project.setCity("Virginia Beach"); project.setState("VA"); project.setPostalCode("234" + String.valueOf(50 + i)); // Random Rating for now project.setRatingCount(i + 1); project.setRatingValue(project.getRatingCount() * StringUtils.rand(1, 5)); project.setRatingAverage(project.getRatingValue() / project.getRatingCount()); // Index it ProjectIndexer indexer = new ProjectIndexer(); indexer.add(snowballWriter, project, true); } QueryParser parser = new QueryParser("contents", snowballAnalyzer); { // Make sure a single matching term yields a single hit SearchBean search = new SearchBean(); search.setQuery(symbols.getMonths()[0]); search.setLocation("Virginia Beach"); assertNotNull(search.getQuery()); assertNotNull(search.getLocation()); search.parseQuery(); assertTrue(search.isValid()); String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null); assertNotNull(queryString); // (approved:1) // AND (guests:1) // AND (closed:0) // AND (website:0) // AND ("january"^20 OR january^15 OR january*^4) AND (location:("virginia beach"^30)) Query query = parser.parse(queryString); Hits hits = getSnowballSearcher().search(query); assertTrue(hits.length() == 1); } { // Make sure a single matching term stem yields a single hit SearchBean search = new SearchBean(); search.setQuery(symbols.getMonths()[0] + "'s"); search.setLocation("Virginia Beach"); assertNotNull(search.getQuery()); assertNotNull(search.getLocation()); search.parseQuery(); assertTrue(search.isValid()); String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null); assertNotNull(queryString); // (approved:1) // AND (guests:1) // AND (closed:0) // AND (website:0) // AND ("january's"^20 OR january's^15 OR january's*^4) AND (location:("virginia beach"^30)) Query query = parser.parse(queryString); Hits hits = getSnowballSearcher().search(query); assertTrue(hits.length() == 1); } { // Make sure multiple matching words yield two hits SearchBean search = new SearchBean(); search.setQuery(symbols.getMonths()[0] + " " + symbols.getMonths()[1]); search.setLocation("Virginia Beach"); search.parseQuery(); assertTrue(search.isValid()); String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null); assertNotNull(queryString); // (approved:1) // AND (guests:1) // AND (closed:0) // AND (website:0) // AND ("january february"^20 OR january^15 OR february^14 OR january*^4 OR february*^3) AND (location:("virginia beach"^30)) Query query = parser.parse(queryString); Hits hits = getSnowballSearcher().search(query); assertTrue(hits.length() == 2); } { // Make sure wilcards yield multiple hits SearchBean search = new SearchBean(); search.setQuery("j"); search.setLocation("Virginia Beach"); search.parseQuery(); assertTrue(search.isValid()); // Look for data with a "j" for comparison int jCount = 0; for (int i = 0; i < symbols.getMonths().length; i++) { if (symbols.getMonths()[i].toLowerCase().indexOf("j") > -1 || symbols.getShortMonths()[i].toLowerCase().indexOf("j") > -1) { ++jCount; } } assertTrue(jCount > 0); String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null); assertNotNull(queryString); // (approved:1) // AND (guests:1) // AND (closed:0) // AND (website:0) // AND ("j"^20 OR j^15 OR j*^4) AND (location:("virginia beach"^30)) Query query = parser.parse(queryString); Hits hits = getSnowballSearcher().search(query); assertTrue(hits.length() == jCount); } { // Make sure alternate locations do not yield any hits SearchBean search = new SearchBean(); search.setQuery(symbols.getMonths()[0]); search.setLocation("Norfolk"); search.parseQuery(); String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null); Query query = parser.parse(queryString); Hits hits = getSnowballSearcher().search(query); assertTrue(hits.length() == 0); } { // Make sure locations as query terms do not yield any hits SearchBean search = new SearchBean(); search.setQuery("Virginia Beach"); search.setLocation("Virginia Beach"); search.parseQuery(); String queryString = SearchUtils.generateProjectQueryString(search, UserUtils.createGuestUser().getId(), -1, null); Query query = parser.parse(queryString); Hits hits = getSnowballSearcher().search(query); assertTrue(hits.length() == 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Result index(Long project) {\n if(Secured.isMemberOf(project)) {\n return ok(\n index.render(\n Project.find.byId(project)\n )\n );\n } else {\n return forbidden();\n }\n }", "private void setP...
[ "0.6617504", "0.6422079", "0.5964285", "0.59245276", "0.5839153", "0.5800335", "0.57479185", "0.57382214", "0.57350665", "0.5729835", "0.572654", "0.5667509", "0.5651745", "0.56272244", "0.5605358", "0.558594", "0.5582875", "0.55745167", "0.5537258", "0.55348957", "0.5531782"...
0.70676214
0
Metodo que obtiene del archivo de idiomas la traducion de los textos que se muestran en pantalla de acuerdo al idoma de la maquina
public void configurarIdioma() { botonAceptar.setText(resources.getString("aceptar")); labelErrorRegistro.setText(resources.getString("LabelErrorRegistro")); labelNoSePuedeRegistrar.setText(resources.getString("noSePuedeRegistrar")); labelCamposVacios.setText(resources.getString("hayCamposVacios")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void idlize() throws IOException {\r\n\t\t/**give mid who has name a id, for other mid, keep using mid to identify them*/\r\n\t\t//\t\tHashMap<String, Integer> namedmid2name = new HashMap<String, Integer>(20000000);\r\n\t\t//\t\tHashMap<String, Integer> relationname2id = new HashMap<String, Integer>(1000000...
[ "0.62389266", "0.5896091", "0.5858356", "0.5829236", "0.5777105", "0.57732844", "0.5748071", "0.5665108", "0.564045", "0.5639392", "0.563329", "0.55874676", "0.554037", "0.55288607", "0.5526205", "0.5500685", "0.5490089", "0.546181", "0.5460125", "0.54599917", "0.54586273", ...
0.0
-1
Metodo que cierra la ventana de alerta
@FXML public void clicAceptar() { Stage stage= new Stage(); stage = (Stage) botonAceptar.getScene().getWindow(); stage.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void msgErreur(){\n \n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.setTitle(\"Entrée invalide\");\n alert.setHeaderText(\"Corriger les entrées invalides.\");\n alert.setContentText(\"Les informations entrées sont erronnées\");\n\n alert.sh...
[ "0.7204441", "0.6927624", "0.6760936", "0.6668943", "0.6656815", "0.66078144", "0.660703", "0.6577573", "0.6545449", "0.6542805", "0.65334", "0.65142196", "0.65033865", "0.6484888", "0.64410514", "0.64375925", "0.6428791", "0.6412094", "0.63859", "0.637041", "0.6352331", "0...
0.0
-1
TODO Autogenerated method stub
public String grow(int cm) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
Creates new form JpKho
public JpKho() { initComponents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FORM createFORM();", "public static Result newForm() {\n return ok(newForm.render(palletForm, setOfArticleForm));\n }", "public void CrearNew(ActionEvent e) {\n List<Pensum> R = ejbFacade.existePensumID(super.getSelected().getIdpensum());\n if(R.isEmpty()){\n super.saveNew(e)...
[ "0.6538922", "0.6211051", "0.59777755", "0.59704316", "0.5923763", "0.59075147", "0.5886783", "0.58335763", "0.5813566", "0.5810559", "0.5798118", "0.57457", "0.5745545", "0.5737248", "0.57297313", "0.5726034", "0.571729", "0.5684891", "0.5676697", "0.56717235", "0.5670103", ...
0.62903136
1
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form Editor.
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jPanel1.setPreferredSize(new java.awt.Dimension(1051, 486)); jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder()); jButton2.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N jButton2.setForeground(new java.awt.Color(51, 0, 51)); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Interface/Images/kiemke.png"))); // NOI18N jButton2.setText("KIỂM KÊ"); jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton2.setHorizontalAlignment(javax.swing.SwingConstants.LEADING); jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); jButton2.setIconTextGap(10); jButton3.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N jButton3.setForeground(new java.awt.Color(51, 0, 51)); jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Interface/Images/nhap.png"))); // NOI18N jButton3.setText("NHẬP MUA"); jButton3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton3.setHorizontalAlignment(javax.swing.SwingConstants.LEADING); jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); jButton3.setIconTextGap(10); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); jButton1.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N jButton1.setForeground(new java.awt.Color(51, 0, 51)); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Interface/Images/mailinglist.jpg"))); // NOI18N jButton1.setText("DANH MỤC NL"); jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton1.setHorizontalAlignment(javax.swing.SwingConstants.LEADING); jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); jButton1.setIconTextGap(10); jButton4.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N jButton4.setForeground(new java.awt.Color(51, 0, 51)); jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Interface/Images/nguyenlieu.png"))); // NOI18N jButton4.setText("NGUYÊN LIỆU"); jButton4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton4.setHorizontalAlignment(javax.swing.SwingConstants.LEADING); jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.RIGHT); jButton4.setIconTextGap(10); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 201, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addComponent(jButton3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jButton4) .addContainerGap(304, Short.MAX_VALUE)) ); jPanel3.setLayout(new java.awt.BorderLayout()); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 796, Short.MAX_VALUE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Form() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public MainForm() {\n initComponents();\n }", "public frmRectangulo() {\n initComponents();\n }", "public form() {\n ...
[ "0.7319396", "0.7290941", "0.7290941", "0.7290941", "0.7285927", "0.7248002", "0.72139066", "0.72086275", "0.71958303", "0.718997", "0.7184516", "0.7159095", "0.71481097", "0.709288", "0.70806605", "0.70578784", "0.6986726", "0.6977067", "0.6955257", "0.6954392", "0.6945326",...
0.0
-1
Create the Entity and all the components that will go in the entity
private void createPlayer() { Entity entity = engine.createEntity(); B2dBodyComponent b2dbody = engine.createComponent(B2dBodyComponent.class); TransformComponent position = engine.createComponent(TransformComponent.class); TextureComponent texture = engine.createComponent(TextureComponent.class); PlayerComponent player = engine.createComponent(PlayerComponent.class); CollisionComponent colComp = engine.createComponent(CollisionComponent.class); TypeComponent type = engine.createComponent(TypeComponent.class); StateComponent stateCom = engine.createComponent(StateComponent.class); // create the data for the components and add them to the components b2dbody.body = bodyFactory.makeCirclePolyBody(10,10,1, BodyFactory.STONE, BodyType.DynamicBody,true); // set object position (x,y,z) z used to define draw order 0 first drawn position.position.set(10,10,0); texture.region = atlas.findRegion("player"); type.type = TypeComponent.PLAYER; stateCom.set(StateComponent.STATE_NORMAL); b2dbody.body.setUserData(entity); // add the components to the entity entity.add(b2dbody); entity.add(position); entity.add(texture); entity.add(player); entity.add(colComp); entity.add(type); entity.add(stateCom); // add the entity to the engine engine.addEntity(entity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract ENTITY createEntity();", "Entity createEntity();", "public void constructEntity (EntityBuilder entityBuilder, Position position){\n entityBuilder.createEntity();\n entityBuilder.buildPosition(position);\n entityBuilder.buildName();\n entityBuilder.buildPosition();...
[ "0.7137803", "0.71373147", "0.70773464", "0.6906245", "0.6855227", "0.6852961", "0.6768196", "0.6712497", "0.6638372", "0.6628171", "0.6608384", "0.64917743", "0.6475808", "0.6380604", "0.63388985", "0.6335564", "0.6299969", "0.62866074", "0.62590486", "0.6213979", "0.6167878...
0.6759954
7
Creates an instance with keyLength of 32 bytes and standard Base64 encoding.
public Base64StringKeyGenerator() { this(DEFAULT_KEY_LENGTH); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Base64StringKeyGenerator(int keyLength) {\n this(Base64.getEncoder(), keyLength);\n }", "public Base64StringKeyGenerator(Base64.Encoder encoder, int keyLength) {\n if(encoder == null) {\n throw new IllegalArgumentException(\"encode cannot be null\");\n }\n if(keyL...
[ "0.78097653", "0.7075744", "0.6944317", "0.67103845", "0.64923525", "0.64472646", "0.5995444", "0.59890825", "0.5971672", "0.59598225", "0.59495187", "0.594934", "0.59310615", "0.58993447", "0.58850384", "0.58720237", "0.5804282", "0.58014756", "0.5770096", "0.5702659", "0.56...
0.7753275
1
Creates an instance with the provided key length in bytes and standard Base64 encoding.
public Base64StringKeyGenerator(int keyLength) { this(Base64.getEncoder(), keyLength); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Base64StringKeyGenerator() {\n this(DEFAULT_KEY_LENGTH);\n }", "public Base64StringKeyGenerator(Base64.Encoder encoder, int keyLength) {\n if(encoder == null) {\n throw new IllegalArgumentException(\"encode cannot be null\");\n }\n if(keyLength < DEFAULT_KEY_LENGT...
[ "0.7438505", "0.7130591", "0.7027417", "0.66406", "0.63612473", "0.6298721", "0.6073119", "0.5945582", "0.58475965", "0.5818616", "0.56774706", "0.5676326", "0.56318253", "0.5611683", "0.5557064", "0.5491458", "0.54809964", "0.546575", "0.5437798", "0.54301316", "0.53814965",...
0.7822996
0
Creates an instance with keyLength of 32 bytes and the provided encoder.
public Base64StringKeyGenerator(Base64.Encoder encoder) { this(encoder, DEFAULT_KEY_LENGTH); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Base64StringKeyGenerator(Base64.Encoder encoder, int keyLength) {\n if(encoder == null) {\n throw new IllegalArgumentException(\"encode cannot be null\");\n }\n if(keyLength < DEFAULT_KEY_LENGTH) {\n throw new IllegalArgumentException(\"keyLength must be greater th...
[ "0.6718751", "0.6053091", "0.5716339", "0.5630361", "0.55788016", "0.5567722", "0.5528082", "0.5507274", "0.5438198", "0.54326713", "0.5341502", "0.5278811", "0.52612936", "0.52126545", "0.5180441", "0.51682156", "0.51139057", "0.51092035", "0.5061105", "0.5041881", "0.502528...
0.657012
1
Creates an instance with the provided key length and encoder.
public Base64StringKeyGenerator(Base64.Encoder encoder, int keyLength) { if(encoder == null) { throw new IllegalArgumentException("encode cannot be null"); } if(keyLength < DEFAULT_KEY_LENGTH) { throw new IllegalArgumentException("keyLength must be greater than or equal to" + DEFAULT_KEY_LENGTH); } this.encoder = encoder; this.keyGenerator = KeyGenerators.secureRandom(keyLength); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Base64StringKeyGenerator(int keyLength) {\n this(Base64.getEncoder(), keyLength);\n }", "public Base64StringKeyGenerator(Base64.Encoder encoder) {\n this(encoder, DEFAULT_KEY_LENGTH);\n }", "public Base64StringKeyGenerator() {\n this(DEFAULT_KEY_LENGTH);\n }", "public Ses...
[ "0.6768411", "0.6533879", "0.6067156", "0.60408413", "0.60067266", "0.58121437", "0.5609912", "0.5563462", "0.5560337", "0.55561423", "0.5548543", "0.5507418", "0.5455354", "0.5401208", "0.53887296", "0.5381723", "0.5371248", "0.5322238", "0.5300766", "0.5286783", "0.5271754"...
0.71266174
0
/Convertit le clic de l'utilisateur sur un bouton du joystick en un entier
public int AFaire(Button b) { if (b==fleches[0]) return -1; else if (b==fleches[1]) return -2; else if (b==fleches[2]) return -3; else if (b==fleches[3]) return -4; else if (b==fleches[4]) return -5; else if (b==fleches[5]) return -6; else return Integer.MAX_VALUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void tener_Usuario_activo() {\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='username']\").typeKeys(\"ocastro\");\n\t\t\t\tdesktop.<DomTextField>find(\"//BrowserApplication//BrowserWindow//input[@id='password']\").setText(\"bogota2016\");\n\t\t\t\tdesktop.<DomBu...
[ "0.633259", "0.59464663", "0.59226847", "0.57687205", "0.5742302", "0.5699914", "0.56814164", "0.5632567", "0.5617749", "0.5586527", "0.5556541", "0.54946953", "0.54924816", "0.54831946", "0.5461302", "0.54604155", "0.5453388", "0.54335254", "0.5419011", "0.53958184", "0.5357...
0.0
-1
Get updated InstanceID token.
@Override public void onTokenRefresh() { String refreshedToken = FirebaseInstanceId.getInstance().getToken(); Log.d(TAG, "Refreshed token: " + refreshedToken); saveToken(refreshedToken); sendRegistrationToServer(refreshedToken); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getToken(Context context) {\n FirebaseInstanceId.getInstance().getInstanceId()\r\n .addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<InstanceIdResult> task) {\r\n ...
[ "0.69057786", "0.63239825", "0.62900764", "0.62784994", "0.62601286", "0.623197", "0.6227492", "0.6198446", "0.6192798", "0.61522585", "0.61522585", "0.61522585", "0.61196923", "0.6054839", "0.602489", "0.5985385", "0.59782743", "0.5972175", "0.5921381", "0.58963776", "0.5886...
0.0
-1
UI code goes here
public void run() { if(isOnline){ if(!webView.getUrl().contains(MainActivity.url)){ webView.loadUrl(url); // webView.addJavascriptInterface(new WebAppInterface(context), "Android"); } }else { webView.loadUrl("file:///android_asset/noConnection.html"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void initUi() {\n\t\t\n\t}", "@Override\r\n\tprotected void initUI() {\n\r\n\t}", "protected void setupUI() {\n\n }", "@Override\r\n public void updateUI() {\r\n ...
[ "0.73626995", "0.73626995", "0.726125", "0.72110134", "0.7206347", "0.70793664", "0.6894437", "0.6877016", "0.6877016", "0.6877016", "0.6791054", "0.67362046", "0.6672258", "0.66234004", "0.6555086", "0.65252286", "0.65146667", "0.64653236", "0.64399046", "0.64311206", "0.642...
0.0
-1
TODO Autogenerated method stub
@Override public boolean addCategory(String catName) { Transaction tx=sessionFactory.getCurrentSession().beginTransaction(); boolean found =categoryhome.isFound(catName); if(found==true) { return false; } else { Category cat =new Category(); cat.setName(catName); sessionFactory.getCurrentSession().save(cat); tx.commit(); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public boolean deleteCategory(String catName) { Transaction tx=sessionFactory.getCurrentSession().beginTransaction(); boolean found =categoryhome.isFound(catName); if(found==true) { Category cat=categoryhome.getByName(catName); sessionFactory.getCurrentSession().delete(cat); tx.commit(); return true; } else { return false; } }
{ "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
Stores customers close by / Parses a single customer entry and inserts into the map if valid
public static void objParse(JSONObject j) { // Current coordinates double lon = Double.parseDouble((String)j.get(Constants.LONG_KEY)); double lat = Double.parseDouble((String)j.get(Constants.LAT_KEY)); if (inRange(lon, lat)) { // If in range int id = Integer.parseInt(String.valueOf(j.get(Constants.ID_KEY))); String name = (String)j.get(Constants.NAME_KEY); valid.put(id, name); // Inserts into map } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int newCustomer(Map customerMap, Map allData) {\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "public int updateCustomer(Map customerMap, Map allData){\r\n\t\t\r\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic void createAccount(Customer customer) {\n\t\tcustMap.put(customer.getMobileNo(),customer);\r\n\t\t\r\n\t}",...
[ "0.5864896", "0.5830562", "0.5738802", "0.56986636", "0.56961393", "0.5654677", "0.5617355", "0.5603424", "0.5601521", "0.557754", "0.5537291", "0.553573", "0.552781", "0.5495777", "0.54881364", "0.54513395", "0.5431914", "0.5420978", "0.5407702", "0.53997505", "0.53935987", ...
0.0
-1
/ Checks to see if the coordinates are in range
public static boolean inRange(double lon, double lat) { // Coordinates of office and current location in radians double lon1 = Math.toRadians(lon); double lat1 = Math.toRadians(lat); double lon2 = Constants.OFFICE_LONG; double lat2 = Constants.OFFICE_LAT; // Uses the haversine formula to calculate distance double deltaLon = Math.abs(lon1 - lon2); double deltaLat = Math.abs(lat1 - lat2); double num1 = Math.sin(deltaLat/Constants.SQUARE); num1 = Math.pow(num1, Constants.SQUARE); double num2 = Math.sin(deltaLon/Constants.SQUARE); num2 = Math.pow(num2, Constants.SQUARE); num2 = num2 * Math.cos(lat1) * Math.cos(lat2); double num = num1 + num2; num = Math.sqrt(num); num = Math.asin(num); num *= Constants.SQUARE; double dist = num * Constants.RADIUS; return (dist <= Constants.MAX); // Compares it to max distance }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean checkCoordinatesInRange(int x1, int y1) {\n\n if (x1 < minRow || y1 < minCol || x1 > maxRow || y1 > maxCol) {\n return false;\n }\n\n return true;\n }", "private boolean isBetweenBounds(int x, int y, int[] bounds) {\n return x >= bounds[0] && x <= bounds[2...
[ "0.7433008", "0.7194027", "0.705091", "0.6972708", "0.6950448", "0.6942083", "0.69173855", "0.69173855", "0.69173855", "0.69023144", "0.68942136", "0.68932605", "0.684393", "0.6837298", "0.6831658", "0.68308544", "0.68005896", "0.6800245", "0.6797128", "0.6786613", "0.6774826...
0.6912965
9
/ Writes the valid customers into a formatted file
@SuppressWarnings("unchecked") public static void writeFile(String outputFile) { try (FileWriter file = new FileWriter(outputFile)) { // Creates file file.write(Constants.OPEN_SQUARE); // Begin array for(Map.Entry<Integer, String> entry : valid.entrySet()) { // Iterates names int id = entry.getKey(); String name = entry.getValue(); String cust = String.format(Constants.ENTRY, id, name); file.write(cust); // Writes formatted string to file } file.write(Constants.CLOSE_SQUARE); // Closes the array file.flush(); // Flushes buffer } catch (IOException e) { // Case of exception e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void write() throws IOException {\n\t\t// declare and instantiate a filewriter to write to the customer's file\n\t\tFileWriter wr = new FileWriter(this.customer);\n\t\tBufferedWriter br = new BufferedWriter(wr);\n\n\t\t// write the customers first and last name (seperate lines)\n\t\tbr.write(th...
[ "0.7158397", "0.7047679", "0.6654232", "0.6440759", "0.6163684", "0.61364406", "0.608642", "0.6027815", "0.58864033", "0.58258873", "0.57899773", "0.57880586", "0.5772242", "0.57500756", "0.5713324", "0.5686968", "0.564005", "0.562177", "0.5594624", "0.5590645", "0.55884975",...
0.5253595
47
/ Driver for program to parse given input and create output file
@SuppressWarnings("unchecked") public static void main(String[] args) { if (args.length < 1) { // No input file given System.out.println(Constants.ERROR); return; } String input = args[0]; // Stores input name String output; // Stores output name if (args.length == Constants.OUTPUT_LEN) { // Given output name output = args[1]; } else { // Default output name output = Constants.DEFAULT_NAME; } valid = new TreeMap<Integer, String>(); // Initializes data structure JSONParser parser = new JSONParser(); try (FileReader reader = new FileReader(input)) { // Parses through file Object obj = parser.parse(reader); JSONArray customerList = (JSONArray)obj; // Gets array of customers customerList.forEach(cus->objParse((JSONObject)cus)); // Iterates } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } writeFile(output); // Writes results to the output file return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) throws IOException {\n\t\tString line = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\t\t\n\t\tFiles.write(Paths.get(\"outputh.txt\"), getOutput(line).getBytes(), StandardOpenOption.CREATE);\n\t\t\n\t}", "public static void main(String[] args) throws IOExcepti...
[ "0.65942276", "0.6283153", "0.6142437", "0.6130466", "0.61229795", "0.6043793", "0.60277265", "0.60266286", "0.6001847", "0.5940345", "0.5932193", "0.58716875", "0.58387995", "0.5838155", "0.5826334", "0.58169776", "0.5799944", "0.5783504", "0.577885", "0.57763195", "0.574104...
0.64184225
1
Logger variables are initiated before class so that they can be used by all the tests
@BeforeClass public void setup() { logger = Logger.getLogger("AveroRestAPI"); PropertyConfigurator.configure("Log4j.properties"); logger.setLevel(Level.DEBUG); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@BeforeClass\n public static void beforeClass()\n throws Exception\n {\n LoggerConfiguration.logSetup();\n }", "private HeaderBrandingTest()\n\t{\n\t\tBaseTest.classLogger = LoggerFactory.getLogger( HeaderBrandingTest.class );\n\t}", "@BeforeClass\n\tpublic static void setup() {\n\t\...
[ "0.77704537", "0.7699813", "0.7514476", "0.7481501", "0.7470758", "0.7368556", "0.7312347", "0.7231757", "0.71501005", "0.71149415", "0.7050964", "0.70289737", "0.6983943", "0.6972263", "0.69720554", "0.6963823", "0.69396037", "0.6884449", "0.68530524", "0.68522143", "0.68411...
0.73647106
6
Get the packages that should not be isolated (and by transience their dependent classes, e.g. log4j in the classpath) NOTE: The transient packages cannot be used directly by the test unless explicity mentioned in this list. The list can be expanded by using the jboss.test.parent.pkgs system property with a commaseparated list of package names, e.g. Djboss.test.parent.pkgs=org.jboss.package1, org.jboss.package2
public static Set<String> getParentPackages() { Set<String> result = new HashSet<String>(); result.add(Test.class.getPackage().getName()); result.add(TestSetup.class.getPackage().getName()); result.add(AbstractTestCaseWithSetup.class.getPackage().getName()); result.add(Logger.class.getPackage().getName()); result.add(LoggingPlugin.class.getPackage().getName()); result.add(PolicyPlugin.class.getPackage().getName()); result.add(ClassLoaderSystem.class.getPackage().getName()); result.add(IsolatedClassLoaderTest.class.getPackage().getName()); String pkgString = AccessController.doPrivileged(new PrivilegedAction<String>() { public String run() { return System.getProperty("jboss.test.parent.pkgs"); }} ); if (pkgString != null) { StringTokenizer tok = new StringTokenizer(pkgString, ","); while(tok.hasMoreTokens()) { String pkg = tok.nextToken(); result.add(pkg.trim()); } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Collection<TestPackage> getTestPackages() {\n return mSessionLog.getTestPackages();\n }", "@Override\r\n\tpublic List<String> getJavaPackages() {\n\t\treturn null;\r\n\t}", "void removePackagesRecursive(String... packageNames) {\n for (String packageName : packageNames) {\n ...
[ "0.5782042", "0.5715194", "0.560191", "0.55618244", "0.5463374", "0.5388214", "0.5332301", "0.52993613", "0.52647066", "0.52618825", "0.51880336", "0.5176465", "0.5155665", "0.51313424", "0.51284707", "0.51014304", "0.50771874", "0.5070043", "0.49971536", "0.49871656", "0.498...
0.7979514
0
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, boolean importAll, Class<?>... packages) { MockClassLoaderPolicy policy = new MockClassLoaderPolicy(); Set<Class<?>> classes = new HashSet<Class<?>>(); classes.add(clazz); classes.addAll(Arrays.asList(packages)); policy.setImportAll(importAll); policy.setPathsAndPackageNames(classes.toArray(new Class[classes.size()])); return initializeClassLoader(clazz, policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.84201306", "0.7475218", "0.73930424", "0.725573", "0.7228198", "0.72050923", "0.70609313", "0.6968202", "0.68811417", "0.6850116", "0.68330383", "0.6818677", "0.67800105", "0.6730344", "0.6709214", "0.6665234", "0.66294897", "0.65773326", "0.65584344", "0.65472573", "0.653...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderPolicy policy) { ClassLoaderSystem system = new DefaultClassLoaderSystem(); return initializeClassLoader(clazz, system, policy, getParentPackages()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8420625", "0.7476951", "0.7392985", "0.7255819", "0.72275263", "0.72071564", "0.70595974", "0.69684696", "0.6882959", "0.6850205", "0.68315244", "0.6821789", "0.6779142", "0.67337036", "0.67108196", "0.6668308", "0.6629455", "0.65798354", "0.65596664", "0.655012", "0.65429...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderPolicy policy) { return initializeClassLoader(clazz, system, policy, getParentPackages()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8419875", "0.74768686", "0.73924506", "0.72560453", "0.722778", "0.7207152", "0.7059336", "0.69679743", "0.6882124", "0.684957", "0.6831586", "0.6822031", "0.6779228", "0.67334014", "0.67100227", "0.66685146", "0.6629433", "0.65796447", "0.6558707", "0.6549098", "0.654286"...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderPolicy policy, Set<String> parentPackages) { String[] parentPkgs = parentPackages.toArray(new String[parentPackages.size()]); return initializeClassLoader(clazz, system, policy, parentPkgs); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8420625", "0.7476951", "0.7392985", "0.7255819", "0.72275263", "0.72071564", "0.70595974", "0.69684696", "0.6882959", "0.6850205", "0.68315244", "0.6821789", "0.6779142", "0.67337036", "0.67108196", "0.6668308", "0.6629455", "0.65798354", "0.65596664", "0.655012", "0.65429...
0.62047553
100
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderPolicy policy, String... parentPackages) { // The parent filter PackageClassFilter filter = new PackageClassFilter(parentPackages); filter.setIncludeJava(true); return initializeClassLoader(clazz, system, filter, ClassFilterUtils.NOTHING, policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.84201306", "0.7475218", "0.73930424", "0.725573", "0.7228198", "0.72050923", "0.70609313", "0.6968202", "0.68811417", "0.6850116", "0.68330383", "0.6818677", "0.67800105", "0.6730344", "0.6709214", "0.6665234", "0.66294897", "0.65773326", "0.65584344", "0.65472573", "0.653...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassFilter parentFilter, boolean importAll, Class<?>... packages) { MockClassLoaderPolicy policy = new MockClassLoaderPolicy(); Set<Class<?>> classes = new HashSet<Class<?>>(); classes.add(clazz); classes.addAll(Arrays.asList(packages)); policy.setImportAll(importAll); policy.setPathsAndPackageNames(classes.toArray(new Class[classes.size()])); return initializeClassLoader(clazz, parentFilter, policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8420625", "0.7476951", "0.7392985", "0.7255819", "0.72275263", "0.72071564", "0.70595974", "0.69684696", "0.6882959", "0.6850205", "0.68315244", "0.6821789", "0.6779142", "0.67337036", "0.67108196", "0.6668308", "0.6629455", "0.65798354", "0.65596664", "0.655012", "0.65429...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassFilter parentFilter, ClassLoaderPolicy policy) { ClassLoaderSystem system = new DefaultClassLoaderSystem(); return initializeClassLoader(clazz, system, parentFilter, policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8419875", "0.74768686", "0.73924506", "0.72560453", "0.722778", "0.7207152", "0.7059336", "0.69679743", "0.6882124", "0.684957", "0.6831586", "0.6822031", "0.6779228", "0.67334014", "0.67100227", "0.66685146", "0.6629433", "0.65796447", "0.6558707", "0.6549098", "0.654286"...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassFilter parentFilter, ClassLoaderPolicy policy) { Set<String> parentPackages = getParentPackages(); String[] parentPkgs = parentPackages.toArray(new String[parentPackages.size()]); PackageClassFilter filter = new PackageClassFilter(parentPkgs); filter.setIncludeJava(true); CombiningClassFilter beforeFilter = CombiningClassFilter.create(filter, parentFilter); ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, ClassFilterUtils.NOTHING); return initializeClassLoader(clazz, system, parentPolicy, policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8420625", "0.7476951", "0.7392985", "0.7255819", "0.72275263", "0.72071564", "0.70595974", "0.69684696", "0.6882959", "0.6850205", "0.68315244", "0.6821789", "0.6779142", "0.67337036", "0.67108196", "0.6668308", "0.6629455", "0.65798354", "0.65596664", "0.655012", "0.65429...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassFilter beforeFilter, ClassFilter afterFilter, ClassLoaderPolicy policy) { ParentPolicy parentPolicy = new ParentPolicy(beforeFilter, afterFilter); return initializeClassLoader(clazz, system, parentPolicy, policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.84201306", "0.7475218", "0.73930424", "0.725573", "0.7228198", "0.72050923", "0.70609313", "0.6968202", "0.68811417", "0.6850116", "0.68330383", "0.6818677", "0.67800105", "0.6730344", "0.6709214", "0.6665234", "0.66294897", "0.65773326", "0.65584344", "0.65472573", "0.653...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ParentPolicy parentPolicy, ClassLoaderPolicy policy) { ClassLoaderDomain domain = system.createAndRegisterDomain("TEST", parentPolicy); return initializeClassLoader(clazz, system, domain, policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8420625", "0.7476951", "0.7392985", "0.7255819", "0.72275263", "0.72071564", "0.70595974", "0.69684696", "0.6882959", "0.6850205", "0.68315244", "0.6821789", "0.6779142", "0.67337036", "0.67108196", "0.6668308", "0.6629455", "0.65798354", "0.65596664", "0.655012", "0.65429...
0.0
-1
Initialize the classloader system
public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderDomain domain, ClassLoaderPolicy policy) { // Remember some information this.system = system; this.domain = domain; this.policy = policy; // Create the classloader ClassLoader classLoader = system.registerClassLoaderPolicy(domain, policy); // Load the class from the isolated classloader try { clazz = classLoader.loadClass(clazz.getName()); } catch (ClassNotFoundException e) { throw new RuntimeException("Unable to load test class in isolated classloader " + clazz, e); } return clazz; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "public void initClassLoader() {\n FileClassLoadingService cla...
[ "0.8419875", "0.74768686", "0.73924506", "0.72560453", "0.722778", "0.7207152", "0.7059336", "0.69679743", "0.6882124", "0.684957", "0.6831586", "0.6822031", "0.6779228", "0.67334014", "0.67100227", "0.66685146", "0.6629433", "0.65796447", "0.6558707", "0.6549098", "0.654286"...
0.0
-1
Create a classloader It exports everything
public ClassLoader createClassLoader(String name, boolean importAll, String... packages) throws Exception { MockClassLoaderPolicy policy = MockClassLoaderHelper.createMockClassLoaderPolicy(name); policy.setImportAll(importAll); policy.setPathsAndPackageNames(packages); return createClassLoader(policy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initClassloaders() {\n\t\tthis.commonloader = createClassloader(\"common\",null);\n\t\tthis.sharedloader = createClassloader(\"shared\", commonloader);\n\t\tthis.catalinaloader = createClassloader(\"server\", commonloader);\n\t}", "private ModuleLoader() {\r\n }", "LiveClassLoader()\r\n\t{\r\n\...
[ "0.683746", "0.67037904", "0.63406324", "0.6317454", "0.6227615", "0.61595994", "0.6109432", "0.60524344", "0.5989269", "0.5958963", "0.5842708", "0.58329815", "0.57686466", "0.5756763", "0.57514703", "0.57293224", "0.57269126", "0.57096034", "0.5709011", "0.5670202", "0.5625...
0.5748984
15
Create the default delegate loader
public List<? extends DelegateLoader> createDefaultDelegates() { return createDelegates(getPolicy()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GenericDelegatorLoader() {\n this(null, null);\n }", "public DefaultLoaderDefinition() {\n\t\t// nothing to do\n\t}", "public GenericDelegatorLoader(String delegatorName, Class<?> caller) {\n\t this.delegatorName = delegatorName != null ? delegatorName : \"default\";\n callerClazz = ...
[ "0.74841404", "0.694554", "0.6917746", "0.65559673", "0.6389173", "0.627265", "0.6139386", "0.6114636", "0.6101558", "0.6060231", "0.6005159", "0.6005159", "0.5969284", "0.5932425", "0.59029764", "0.58433306", "0.5836046", "0.58356124", "0.5834909", "0.58261657", "0.57660675"...
0.70437914
1
Create delegate loaders from policies
public List<? extends DelegateLoader> createDelegates(ClassLoaderPolicy... policies) { List<DelegateLoader> delegates = new ArrayList<DelegateLoader>(); for (ClassLoaderPolicy policy : policies) delegates.add(new FilteredDelegateLoader(policy)); return delegates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<? extends DelegateLoader> createDefaultDelegates()\n {\n return createDelegates(getPolicy());\n }", "LoadGenerator createLoadGenerator();", "LoadGenerator createLoadGenerator();", "public GenericDelegatorLoader() {\n this(null, null);\n }", "public Authorizer withNarLoader(fi...
[ "0.5798123", "0.53477186", "0.53477186", "0.5297881", "0.5265742", "0.5260168", "0.5254922", "0.5192532", "0.5125465", "0.51091754", "0.51040095", "0.507699", "0.50731695", "0.5068681", "0.5003294", "0.49904877", "0.4958977", "0.49582282", "0.49468032", "0.49206185", "0.49083...
0.76917505
0
Create a scoped classloader domain using the test domain as parent using the parent first policy
public ClassLoaderDomain createScopedClassLoaderDomainParentFirst(String name) { return createScopedClassLoaderDomain(name, ParentPolicy.BEFORE, getDomain()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClassLoaderDomain createScopedClassLoaderDomain(String name, ParentPolicy parentPolicy, Loader parent)\n {\n ClassLoaderSystem system = getSystem();\n return system.createAndRegisterDomain(name, parentPolicy, parent);\n }", "public ClassLoaderDomain createScopedClassLoaderDomain(String name,...
[ "0.73149544", "0.7028857", "0.69285744", "0.6448159", "0.6363321", "0.6176346", "0.6086921", "0.598036", "0.5866402", "0.58109665", "0.5715656", "0.566941", "0.5548782", "0.5454496", "0.5448437", "0.53886384", "0.53504586", "0.5338213", "0.52860475", "0.5284692", "0.5230694",...
0.69781417
2
Create a scoped classloader domain using the test domain as parent using the parent last policy
public ClassLoaderDomain createScopedClassLoaderDomainParentLast(String name) { return createScopedClassLoaderDomain(name, ParentPolicy.AFTER_BUT_JAVA_BEFORE, getDomain()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClassLoaderDomain createScopedClassLoaderDomain(String name, ParentPolicy parentPolicy, Loader parent)\n {\n ClassLoaderSystem system = getSystem();\n return system.createAndRegisterDomain(name, parentPolicy, parent);\n }", "public ClassLoaderDomain createScopedClassLoaderDomain(String name,...
[ "0.7289357", "0.70513135", "0.67813414", "0.6630357", "0.6217089", "0.5965135", "0.58650225", "0.5740164", "0.57042164", "0.5673019", "0.5647979", "0.54717714", "0.53693223", "0.5303062", "0.5240452", "0.52079487", "0.5199213", "0.517921", "0.51701564", "0.51696634", "0.51416...
0.6617344
4
Create a scoped classloader domain using the test domain as parent
public ClassLoaderDomain createScopedClassLoaderDomain(String name, ParentPolicy parentPolicy) { return createScopedClassLoaderDomain(name, parentPolicy, getDomain()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClassLoaderDomain createScopedClassLoaderDomain(String name, ParentPolicy parentPolicy, Loader parent)\n {\n ClassLoaderSystem system = getSystem();\n return system.createAndRegisterDomain(name, parentPolicy, parent);\n }", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSy...
[ "0.70125574", "0.6507794", "0.6391453", "0.6328801", "0.6035832", "0.58363336", "0.5831111", "0.58228153", "0.58135813", "0.5737616", "0.55924624", "0.558534", "0.5580062", "0.5530513", "0.55092394", "0.5509174", "0.5497897", "0.54718924", "0.54640603", "0.54424995", "0.53997...
0.67181623
1
Create a scoped classloader domain
public ClassLoaderDomain createScopedClassLoaderDomain(String name, ParentPolicy parentPolicy, Loader parent) { ClassLoaderSystem system = getSystem(); return system.createAndRegisterDomain(name, parentPolicy, parent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ClassLoaderDomain createScopedClassLoaderDomain(String name, ParentPolicy parentPolicy)\n {\n return createScopedClassLoaderDomain(name, parentPolicy, getDomain());\n }", "public Class<?> initializeClassLoader(Class<?> clazz, ClassLoaderSystem system, ClassLoaderDomain domain, ClassLoaderPolicy p...
[ "0.6763815", "0.6362934", "0.6224885", "0.62076133", "0.6198405", "0.6093187", "0.6028852", "0.59799623", "0.59662473", "0.59475714", "0.59450054", "0.59312963", "0.5900397", "0.5859975", "0.5838085", "0.58238196", "0.5823467", "0.58170784", "0.5801636", "0.57888263", "0.5767...
0.7009235
0
Read from the database
public void chargerLesParcours() { refParcours.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { Log.d("PARCOURS ADDED (snap)", dataSnapshot.getKey()+""); addParcoursFromFirebase(evenementFactory.parseParcours(dataSnapshot)); } @Override public void onChildChanged(DataSnapshot dataSnapshot, String s) {} @Override public void onChildRemoved(DataSnapshot dataSnapshot) {} @Override public void onChildMoved(DataSnapshot dataSnapshot, String s) {} @Override public void onCancelled(DatabaseError databaseError) {} }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void read() {\r\n Connection conexao = mysql.getConnection();\r\n try {\r\n PreparedStatement stm = conexao.prepareStatement(readSQL);\r\n ResultSet rs = stm.executeQuery();\r\n\r\n while (rs.next()) {\r\n int idcodigo = rs.getIn...
[ "0.71633124", "0.6691416", "0.6681814", "0.66794646", "0.6536708", "0.6527908", "0.6510126", "0.64799327", "0.6461278", "0.6411238", "0.640649", "0.6322477", "0.6319045", "0.6253361", "0.6228985", "0.6228635", "0.6228275", "0.62251467", "0.6199575", "0.6162528", "0.61311084",...
0.0
-1
TODO Autogenerated method stub
@Override public int describeContents() { return 0; }
{ "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
/ renamed from: a
public static final boolean m18706a(double d, double d2, double d3) { return d == d2 || (Double.isNaN(d) && Double.isNaN(d2)) || Math.abs(d - d2) <= d3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.6249669", "0.6242452", "0.61399835", "0.6117525", "0.61137056", "0.6089649", "0.6046804", "0.6024678", "0.6020427", "0.5975322", "0.59474325", "0.5912173", "0.5883731", "0.58788097", "0.58703065", "0.58670723", "0.5864566", "0.58566767", "0.5830755", "0.58286554", "0.58273...
0.0
-1
TODO: Listen for cancel message by overriding onCancel
@Override public void onCancel(DialogInterface dialog) { super.onCancel(dialog); Log.d(TAG,"Dialog cancelled!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void onCancel();", "@Override\r\n\t\tpublic void onCancel() {\n\t\t}", "@Override\n public void onCancel() {\n }", "@Override\n protected void onCancel() {\n }", "@Override\n\t\tpublic void onCancel() {\n \n \t}", "@Override\n\t\t\tpublic void onCancel() {\n\...
[ "0.8794033", "0.8632704", "0.8625279", "0.86062104", "0.8579161", "0.8565891", "0.85550517", "0.8519647", "0.84627587", "0.84627587", "0.8422438", "0.8422438", "0.84016377", "0.8399991", "0.8397674", "0.83899534", "0.83561873", "0.833639", "0.8303694", "0.82950205", "0.826066...
0.0
-1
TODO: Override onAttach to get Activity instance
@Override public void onAttach(Context context) { super.onAttach(context); // mHost=(NetworkDialogListener)context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n this.context = activity;\n }", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\n\t\tcontext = activity;\n\t}", "@Override\n\tpublic void onAttach(Activity activity) {...
[ "0.8001821", "0.79844743", "0.79636335", "0.79366297", "0.7895965", "0.78826565", "0.78521556", "0.78521556", "0.78459996", "0.78459996", "0.78459996", "0.7813221", "0.7758227", "0.77427924", "0.7730993", "0.7708894", "0.7643358", "0.76136786", "0.7573981", "0.7462945", "0.73...
0.0
-1
The constructor for LMTransitionOptionsToolbar. LMOptionsPanel optionsPanel: the options panel that controls the visible options toolbar in the panel
public LMTransitionOptionsToolbar(LMOptionsPanel optionsPanel) { super(JToolBar.VERTICAL); setFloatable(false); setLayout(new GridBagLayout()); this.optionsPanel = optionsPanel; buildUI(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public OptionsPanel() {\n initComponents();\n }", "public OptionPanel() {\n initComponents();\n }", "PanelOptionsVisual(PanelConfigureProject panel) {\n this.panel = panel;\n\n preInitComponents();\n initComponents();\n postInitComponents();\n }", "public Op...
[ "0.6074105", "0.5860327", "0.58025616", "0.5589056", "0.5502115", "0.548664", "0.5444704", "0.5427713", "0.5393373", "0.5376504", "0.534921", "0.53059447", "0.52312917", "0.5152064", "0.5114041", "0.50989425", "0.5055677", "0.50316584", "0.5022541", "0.500782", "0.49833173", ...
0.8224199
0
Sets the rule that applies to the selected transition. Transition transition: the transition that is selected in order to bring up the transition options panel
public void setTransitionInfo(Transition transition) { this.transition = transition; String ruleString = transition.buildStringFromRules(); ruleTextField.setText(ruleString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTransition(final String transition) {\n\t\tthis.transition = transition;\n\t}", "public void setTransitionStyle(String transitionStyle) {\n\t\tthis.transitionStyle = transitionStyle;\n\t}", "Transition createTransition();", "Transition createTransition();", "public void setTransitionScript(U...
[ "0.6543085", "0.5859773", "0.569016", "0.569016", "0.55636156", "0.551714", "0.5507388", "0.54960597", "0.54953086", "0.53583103", "0.5346014", "0.53391635", "0.52919286", "0.5216524", "0.5199237", "0.517539", "0.5131569", "0.5116571", "0.5075664", "0.5031", "0.50170743", "...
0.6430772
1
Allows other classes access to the rule text field. Returns the rule text field.
public JTextField getRuleTextField() { return ruleTextField; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getRule();", "public java.lang.String getRule() {\n java.lang.Object ref = rule_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n ...
[ "0.70793766", "0.68698776", "0.6802988", "0.6779976", "0.6741191", "0.66697025", "0.65202653", "0.65121174", "0.64564735", "0.6382352", "0.6290188", "0.62879443", "0.62583786", "0.6240221", "0.62141037", "0.6193278", "0.61745274", "0.6160803", "0.6126117", "0.6102649", "0.609...
0.78177553
0
Performs all the actions that are possible in the toolbar. Clears the acceptance text and message panel text, and sets setModified to true. ActionEvent e: an action event that allows us to handle actions performed in the toolbar
public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals("enter")) { enterRules(); } else if (command.equals("epsilon")) { addAndEnterEpsilonRule(); } else if (command.equals("delete")) { deleteSelectedTransition(); } optionsPanel.getInputToolbar().clearAcceptanceText(); optionsPanel.getMessagePanel().clearText(); optionsPanel.getWorkspacePanel().setModified(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateActionState()\n\t{\n\t\tboolean enabled = ConcernReCS.getDefault().isDirty(); //Indicates if the view content has changed\n\t\t\n//\t\tsaveaction.setEnabled(enabled);\n\n\t\tgetViewSite().getActionBars().updateActionBars();\n\t}", "@Override\n public void actionPerformed(ActionEvent e)\n ...
[ "0.6582521", "0.64922184", "0.6322287", "0.62243617", "0.6204694", "0.61403054", "0.61360687", "0.60813344", "0.6057631", "0.6055593", "0.6027373", "0.6002868", "0.59969175", "0.59937024", "0.59608614", "0.5945913", "0.594578", "0.5931864", "0.5926271", "0.59248984", "0.59207...
0.6210899
4
Assigns the rules to the selected transition, paints them into the workspace, and resets the tool to the select tool.
private void enterRules() { String ruleString = ruleTextField.getText(); transition.buildRulesFromString(ruleString); ruleString = transition.buildStringFromRules(); ruleTextField.setText(ruleString); optionsPanel.getWorkspacePanel().requestFocusInWindow(); optionsPanel.getWorkspacePanel().repaint(); // Daniel didn't like this automatic switching any more. // optionsPanel.getWorkspacePanel().setTool(LMWorkspacePanel.SELECT_TOOL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void deleteSelectedTransition()\n {\n Transition oppositeTransition = optionsPanel.getWorkspacePanel().findTransitionBetween(transition.getToState(), transition.getFromState());\n if (oppositeTransition != null)\n {\n oppositeTransition.setTangent(false);\n }\n ...
[ "0.5439719", "0.52097577", "0.515394", "0.51526594", "0.51086175", "0.50640804", "0.49989098", "0.4994517", "0.4985402", "0.49486655", "0.48931393", "0.48888502", "0.4876204", "0.4872739", "0.48535585", "0.48214364", "0.48197803", "0.4792594", "0.47873282", "0.4782427", "0.47...
0.63247055
0
Adds an epsilon to the text field and performs the enter action on it.
private void addAndEnterEpsilonRule() { ruleTextField.setText(ruleTextField.getText() + "\u025B"); enterRules(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enterPressed()\n\t{\n\t\t// Call the enter method if the enter key was pressed\n\t\tif (showCaret)\n\t\t\tonSubmit(text.getText().substring(0, text.getText().length() - 1));\n\t\telse onSubmit(text.getText());\n\t}", "public void keyPressed(KeyEvent e) {\r\n\r\n\t\tif(e == null || e.getKeyCode()==...
[ "0.63009053", "0.5743899", "0.5666084", "0.5664682", "0.56595784", "0.5611321", "0.54948664", "0.5477129", "0.54716265", "0.54650086", "0.54557854", "0.5435455", "0.54123574", "0.5405594", "0.53797954", "0.53797853", "0.53584343", "0.53494036", "0.5344387", "0.5338598", "0.53...
0.72254884
0
Deletes the selected transition when you click the delete button, and if there are transitions going both directions, set the other one back to pointing at the center of the states. Sets the options panel to blank, and sets the tool back to the select tool.
private void deleteSelectedTransition() { Transition oppositeTransition = optionsPanel.getWorkspacePanel().findTransitionBetween(transition.getToState(), transition.getFromState()); if (oppositeTransition != null) { oppositeTransition.setTangent(false); } optionsPanel.getWorkspacePanel().repaint(); optionsPanel.getWorkspacePanel().getNFA().removeTransition(transition); optionsPanel.getWorkspacePanel().setTool(LMWorkspacePanel.SELECT_TOOL); optionsPanel.changeOptions("blank"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void unSelect() {\n /** if we had some object selected we need to delete it's Transformation Points. */\n if(this.action.isSelect() && this.curr_obj != null) {\n this.canvas.remove(this.transformPoints);\n this.transformPoints.clear();\n this.curr_obj = null;\...
[ "0.6590217", "0.6380657", "0.6372404", "0.62646335", "0.6188965", "0.6112101", "0.61003107", "0.6059788", "0.59862244", "0.5958222", "0.5945033", "0.59131545", "0.5881539", "0.58760244", "0.5857654", "0.5850021", "0.5846656", "0.58290046", "0.58173746", "0.5774993", "0.576332...
0.7926093
0
Builds the transition options panel.
private void buildUI() { GridBagConstraints c = new GridBagConstraints(); c.fill = GridBagConstraints.HORIZONTAL; c.gridy = 0; // Adds the title to the panel, changes the font, and centers it c.gridwidth = 2; Font displayFont = new Font("Serif", Font.BOLD, 18); JLabel cardTitle = new JLabel("Transition Options"); cardTitle.setFont(displayFont); cardTitle.setHorizontalAlignment(JLabel.CENTER); add(cardTitle, c); // Adds a separator between the title and the rules text field c.gridy++; JSeparator separator = new JSeparator(); separator.setPreferredSize(new Dimension(0, 15)); add(separator, c); // Adds a label for the rules field c.gridy++; c.gridwidth = 1; JLabel rulesLabel = new JLabel("Rules:"); add(rulesLabel, c); // Sets the insets to 3 on every side c.insets = new Insets(3, 3, 3, 3); // Creates the rules text field of size 100, sets the action command // to enter c.gridy++; c.ipadx = 100; ruleTextField = new JTextField(); ruleTextField.setActionCommand("enter"); ruleTextField.addActionListener(this); add(ruleTextField, c); // Creates an enter button, resets padding to 0 c.gridx = 1; c.ipadx = 0; enterButton = new JButton("Enter"); enterButton.setActionCommand("enter"); enterButton.addActionListener(this); add(enterButton, c); // Creates a button that adds an epsilon transition to the rule text field c.gridy++; c.gridx = 0; c.gridwidth = 2; epsilonButton = new JButton("Add Epsilon Transition"); epsilonButton.setActionCommand("epsilon"); epsilonButton.addActionListener(this); add(epsilonButton, c); // Adds a separator between the rule text field items and the delete button c.gridy++; separator = new JSeparator(); separator.setPreferredSize(new Dimension(0, 15)); add(separator, c); // Creates a delete button c.gridy++; deleteButton = new JButton("Delete Transition"); deleteButton.setVerticalTextPosition(AbstractButton.BOTTOM); deleteButton.setHorizontalTextPosition(AbstractButton.CENTER); deleteButton.setActionCommand("delete"); deleteButton.addActionListener(this); add(deleteButton, c); // I hate Alby for making this work. // Pushes the panel to the top c.gridy++; c.weighty = 1; JLabel blank = new JLabel(); add(blank, c); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public LMTransitionOptionsToolbar(LMOptionsPanel optionsPanel)\n {\n super(JToolBar.VERTICAL);\n setFloatable(false);\n setLayout(new GridBagLayout());\n this.optionsPanel = optionsPanel;\n buildUI();\n }", "private void addComponentsToOptionsPanel(){\r\n\t\tBox box = Box...
[ "0.61072046", "0.610524", "0.6062956", "0.6039598", "0.6026687", "0.60201573", "0.5931273", "0.58188766", "0.5769387", "0.5723789", "0.56983", "0.56750846", "0.5662043", "0.56582606", "0.56573486", "0.5652465", "0.5643824", "0.56427974", "0.56325144", "0.555743", "0.555501", ...
0.5911456
7
/ / / / / / / / / / / / / /
public Stroke getStroke(Comparable key) { /* 95 */ ParamChecks.nullNotPermitted(key, "key"); /* 96 */ return (Stroke)this.store.get(key); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "private double[] getExtents(){\n return new double[] { -90, -180, 90, 180 };\n }", "int getWidth() {return width;}...
[ "0.5488869", "0.539071", "0.50996655", "0.50901884", "0.50699633", "0.5069328", "0.5067209", "0.5062026", "0.50451916", "0.5015583", "0.5014", "0.5003613", "0.496958", "0.49570796", "0.49513507", "0.49506724", "0.49293694", "0.49275625", "0.49267942", "0.4916937", "0.4910187"...
0.0
-1
/ / / / / / / / / / / / 109
public boolean containsKey(Comparable key) { return this.store.containsKey(key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static int getNumPatterns() { return 64; }", "public int getBlockLength()\r\n/* 45: */ {\r\n/* 46:107 */ return -32;\r\n/* 47: */ }", "public int mo36g() {\n return 8;\n }", "protected int bytesPerAtom() {\n return (2);\n }", "protected int bytesPerAtom(...
[ "0.5708411", "0.5561626", "0.5473841", "0.54653114", "0.54653114", "0.54438925", "0.54348075", "0.537737", "0.5341869", "0.5331218", "0.5325043", "0.53194827", "0.5315039", "0.5222638", "0.5199902", "0.5192258", "0.51921844", "0.5190002", "0.51898533", "0.5183229", "0.5179709...
0.0
-1
/ / / / / / / / / /
public void put(Comparable key, Stroke stroke) { /* 120 */ ParamChecks.nullNotPermitted(key, "key"); /* 121 */ this.store.put(key, stroke); /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50...
[ "0.5540896", "0.5446543", "0.5227331", "0.52141076", "0.5111389", "0.50963986", "0.50654864", "0.5038032", "0.50336593", "0.501189", "0.50033337", "0.5002645", "0.4999724", "0.4997505", "0.49938273", "0.4988672", "0.4982446", "0.49785286", "0.4967535", "0.49578318", "0.491564...
0.0
-1
/ / / / / / 128
public void clear() { this.store.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public KMP(){\n this.R = 128;\n }", "static int getNumPatterns() { return 64; }", "byte[] mo38566a();", "BigInteger getWidth();", "void mo33732Px();", "protected void doPadding(byte[] paramArrayOfByte, int paramInt)\r\n/* 107: */ {\r\n/* 108:172 */ int i = flush();\r\n/...
[ "0.5635052", "0.5478421", "0.5466134", "0.54569703", "0.53953296", "0.5386969", "0.5294484", "0.5289256", "0.52420914", "0.5240141", "0.5217099", "0.5175102", "0.5171171", "0.51093024", "0.5108147", "0.5107512", "0.5098389", "0.5094728", "0.5070558", "0.5057248", "0.5040861",...
0.0
-1
/ / / / / / / / / / /
public boolean equals(Object obj) { /* 140 */ if (obj == this) { /* 141 */ return true; /* */ } /* 143 */ if (!(obj instanceof StrokeMap)) { /* 144 */ return false; /* */ } /* 146 */ StrokeMap that = (StrokeMap)obj; /* 147 */ if (this.store.size() != that.store.size()) { /* 148 */ return false; /* */ } /* 150 */ Set keys = this.store.keySet(); /* 151 */ Iterator iterator = keys.iterator(); /* 152 */ while (iterator.hasNext()) { /* 153 */ Comparable key = (Comparable)iterator.next(); /* 154 */ Stroke s1 = getStroke(key); /* 155 */ Stroke s2 = that.getStroke(key); /* 156 */ if (!ObjectUtilities.equal(s1, s2)) { /* 157 */ return false; /* */ } /* */ } /* 160 */ return true; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "double passer();", "int getWidth() {return width;}", "public void zeichneQuadra...
[ "0.554104", "0.5444409", "0.52052575", "0.5181639", "0.50943696", "0.50592345", "0.5053618", "0.5044308", "0.50261515", "0.5012445", "0.5012299", "0.5010886", "0.5004179", "0.49991733", "0.49972177", "0.49859008", "0.49799305", "0.49781325", "0.4966782", "0.4959202", "0.49114...
0.0
-1
/ / / / / / / / / /
public Object clone() throws CloneNotSupportedException { /* 172 */ StrokeMap clone = (StrokeMap)super.clone(); /* 173 */ clone.store = new TreeMap(); /* 174 */ clone.store.putAll(this.store); /* */ /* */ /* 177 */ return clone; /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50...
[ "0.5541532", "0.5446955", "0.52281594", "0.5213684", "0.5111094", "0.50968313", "0.5062466", "0.50367206", "0.5034724", "0.5012806", "0.5004324", "0.5002564", "0.49986076", "0.4996109", "0.49904776", "0.49866053", "0.49804097", "0.49778533", "0.4967638", "0.49571368", "0.4915...
0.0
-1
/ / / / / / / / /
private void writeObject(ObjectOutputStream stream) throws IOException { /* 188 */ stream.defaultWriteObject(); /* 189 */ stream.writeInt(this.store.size()); /* 190 */ Set keys = this.store.keySet(); /* 191 */ Iterator iterator = keys.iterator(); /* 192 */ while (iterator.hasNext()) { /* 193 */ Comparable key = (Comparable)iterator.next(); /* 194 */ stream.writeObject(key); /* 195 */ Stroke stroke = getStroke(key); /* 196 */ SerialUtilities.writeStroke(stroke, stream); /* */ } /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "public void divide() {\n\t\t\n\t}", "private int rightChild(int i){return 2*i+2;}", "public void zeichneQuadrate(){\n for (int i=0; i<10;i++)\n rect (50+i*25,50,25,25);\n }", "public abstract void b...
[ "0.5532527", "0.54391015", "0.5251596", "0.52418447", "0.5150535", "0.512878", "0.50683415", "0.5066834", "0.50221753", "0.50129646", "0.50077325", "0.50051177", "0.49997202", "0.499538", "0.49736512", "0.49707893", "0.49684572", "0.49598044", "0.49381968", "0.49364173", "0.4...
0.0
-1
/ / / / / / / / / / /
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { /* 210 */ stream.defaultReadObject(); /* 211 */ this.store = new TreeMap(); /* 212 */ int keyCount = stream.readInt(); /* 213 */ for (int i = 0; i < keyCount; i++) { /* 214 */ Comparable key = (Comparable)stream.readObject(); /* 215 */ Stroke stroke = SerialUtilities.readStroke(stream); /* 216 */ this.store.put(key, stroke); /* */ } /* */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int parent(int i){return (i-1)/2;}", "private int leftChild(int i){return 2*i+1;}", "private int rightChild(int i){return 2*i+2;}", "public void divide() {\n\t\t\n\t}", "public abstract void bepaalGrootte();", "double passer();", "int getWidth() {return width;}", "public void zeichneQuadra...
[ "0.55392164", "0.5443003", "0.52042043", "0.51812166", "0.5094322", "0.5058843", "0.5053321", "0.50448096", "0.5025622", "0.5012025", "0.50120205", "0.50111294", "0.5003863", "0.49984357", "0.49974853", "0.4984652", "0.49787974", "0.4978001", "0.49672434", "0.4957116", "0.491...
0.0
-1
Utility method that you can use to compare tow futures. Since their values should be resolved in some point of time and you would not wait for that moment, this method wraps the result of comparision into a brand new future to be resolved later
public static BaseFuture<Boolean> compare (Future<? extends Comparable> a , Future<? extends Comparable> b , BaseFuture.CompareMode mode) { throw new UnsupportedOperationException("implement compare in BaseFuture!!!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n @DisplayName(\"Future with result\")\n void testFutureWithResult() throws ExecutionException, InterruptedException {\n final ExecutorService executor = Executors.newSingleThreadExecutor();\n final Future<String> future = executor.submit(this::getThreadName);\n\n // check if the f...
[ "0.63303494", "0.6053591", "0.5705284", "0.566612", "0.56364757", "0.56277424", "0.55699176", "0.5479452", "0.5422428", "0.5386985", "0.5368475", "0.5299373", "0.5296992", "0.5205443", "0.5123261", "0.5091705", "0.5083834", "0.5079675", "0.5054841", "0.5054841", "0.4999825", ...
0.62845254
1
TODO Autogenerated method stub
public static void main(String[] args) { float f1=100.0f; byte b1=80; char c='o'; String s1="123"; f1=(int)f1<<2; b1=(byte)(b1<<2); //s1=s1<<2; c=(char)(c<<2);//位运算符的操作数只能是整形和字符型 System.out.println(f1); System.out.println(b1); System.out.println(c); }
{ "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
Get a URL to the uploaded content
@Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Uri downloadUrl = taskSnapshot.getUploadSessionUri(); //Toast.makeText(c, downloadUrl.toString(), Toast.LENGTH_LONG).show(); onProgressOperation.onFinished("Upload complete!", "Video has been successfully uploaded"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getContentURL();", "public String getFileUploadUrl()\n\t\t{\n\t\t\treturn EU.getFileUploadUrl();\n\t\t}", "public String getFileUploadUrl()\n\t\t{\n\t\t\treturn EU.getFileUploadUrl();\n\t\t}", "public String getFileUploadUrl()\n\t\t{\n\t\t\treturn EU.getFileUploadUrl();\n\t\t}", "private Stri...
[ "0.7411904", "0.7123956", "0.7123956", "0.7123956", "0.7011507", "0.6939975", "0.6882386", "0.66676927", "0.6547934", "0.64150995", "0.640093", "0.6314368", "0.6178131", "0.61342305", "0.61033934", "0.6082854", "0.6011752", "0.600413", "0.600413", "0.600413", "0.600413", "0...
0.0
-1
Inicia a matriz de quadrados e posteriormente marca alguns quadrados como bandeiras para o teste.
@Before public void setUp() { quadrados = new Quadrado[linhas][colunas]; for (int linha = 0; linha < linhas; linha++) { for (int coluna = 0; coluna < colunas; coluna++) { quadrados[linha][coluna] = new Quadrado(linha, coluna); } } quadrados[0][0].marcar(); quadrados[5][5].marcar(); quadrados[0][5].marcar(); quadrados[5][0].marcar(); quadrados[1][2].marcar(); quadrados[1][1].marcar(); quadrados[0][2].marcar(); quadrados[2][2].marcar(); quadrados[3][5].marcar(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void matrizAdjunta (){\n float tablaA[][]= getMatriz();\n setMatrizAdjunta(new float[3][3]);\n getMatrizAdjunta()[0][0]=(tablaA[1][1]*tablaA[2][2]) - (tablaA[1][2]*tablaA[2][1]);\n getMatrizAdjunta()[0][1]=-((tablaA[0][1]*tablaA[2][2]) - (tablaA[0][2]*tablaA[2][1]));\n get...
[ "0.61226666", "0.5772333", "0.56444335", "0.5568604", "0.5563425", "0.55509776", "0.55134684", "0.54511625", "0.5449854", "0.54233754", "0.54156274", "0.5414235", "0.53986484", "0.5368417", "0.5367732", "0.53408414", "0.53380257", "0.5333596", "0.5319432", "0.53178674", "0.53...
0.57559264
2
Test of hasNext method, of class BandeirasIterator.
@Test public void testHasNext() { System.out.println("hasNext"); BandeirasIterator instanceHasNext = new BandeirasIterator(quadrados); int quantidadeBandeirasContadas = 0; while (instanceHasNext.hasNext()) { quantidadeBandeirasContadas++; instanceHasNext.next(); } assertEquals(9, quantidadeBandeirasContadas); quadrados[3][3].marcar(); quadrados[2][3].marcar(); quadrados[1][3].marcar(); instanceHasNext = new BandeirasIterator(quadrados); quantidadeBandeirasContadas = 0; while (instanceHasNext.hasNext()) { quantidadeBandeirasContadas++; instanceHasNext.next(); } assertEquals(12, quantidadeBandeirasContadas); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean hasNext() {\n return next != null;\n }", "@Test\n public void hasNextTrueTest() {\n this.it.next();\n this.it.next();\n this.it.hasNext();\n assertThat(true, is(this.it.hasNext()));\n }", "private boolean hasNext() {\n\t\treturn iterator...
[ "0.7974788", "0.79635835", "0.7948749", "0.79319584", "0.79319584", "0.78968704", "0.7873414", "0.7858786", "0.7828657", "0.7828657", "0.7828657", "0.7828657", "0.7828657", "0.7828657", "0.7828657", "0.7828657", "0.78074557", "0.77837706", "0.77797234", "0.77582115", "0.77370...
0.8573086
0
Returns a String representation of a base raised to a power using the BigNum class
public static String power(int base, int exp){ BigNum temp = new BigNum(base); temp = temp.power(exp); return temp.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String powName(double base) {\n\t\tif (base == Math.E)\n\t\t\treturn \"exp\";\n\t\telse\n\t\t\treturn \"\" + MathUtil.format(base) + \"^\";\n\t}", "public double pow(double base, double exponent){ return Math.pow(base, exponent); }", "private int toPower(int base, int exponent)\n\t {\n\t ...
[ "0.6800095", "0.66753656", "0.6410099", "0.6349084", "0.63021505", "0.6253354", "0.60830885", "0.6057403", "0.6024753", "0.6016298", "0.58761793", "0.58740664", "0.5867358", "0.5845244", "0.58073014", "0.5798401", "0.5783224", "0.57163465", "0.5703397", "0.5665035", "0.565446...
0.8198695
0
Sums the digits of a String that represents a number
public static int digitSum(String input){ int sum = 0; for(int i = 0; i < input.length(); i++){ sum += Character.getNumericValue(input.charAt(i)); } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int numeralSum(String s) {\n \tint sum = 0;\n \tfor(int i = 0; i<s.length(); i++) {\n \t\tif(Character.isDigit(s.charAt(i))) {\n \t\t\tsum += Integer.parseInt(s.substring(i, i + 1));\n \t\t}\n \t}\n return sum;\n }", "public int sumNumb(String str) {\n\t\tint sum = 0;\n\...
[ "0.8116474", "0.78437287", "0.78163767", "0.77038133", "0.75277114", "0.702842", "0.6911147", "0.68518996", "0.68507373", "0.6742702", "0.6741972", "0.66637105", "0.6619353", "0.65964514", "0.6563477", "0.6549951", "0.65367043", "0.64786965", "0.64504665", "0.64083", "0.63984...
0.80416113
1
When a step is completed then all the remaining time of each bomb containing cell will increase by 1
public void stepCompleted() { for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { grid[i][j] += (grid[i][j] >= 0 ? 1 : 0); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void step() {\n \tinternaltime ++;\n \n }", "public void timePassed() {\n this.moveOneStep();\n }", "@Override\n public void timePassed() {\n moveOneStep();\n }", "public void doTimeStep() {\r\n\t\twalk(getRandomInt(8));\r\n\t\tif (getEnergy() < 6 * Params.min_reproduce...
[ "0.69981915", "0.68596137", "0.65600044", "0.6269976", "0.6097635", "0.6084129", "0.6076109", "0.6074212", "0.60614127", "0.60584664", "0.6043874", "0.6042221", "0.6026272", "0.5973779", "0.5968142", "0.59620064", "0.59423524", "0.5939557", "0.59208083", "0.58916664", "0.5873...
0.64291286
3
Empty cells have value < 0, so, setting 0 to those cells to contain bombs
public void plantBombsInEmptyCells() { for (int i = 0; i < r; i++) { for (int j = 0; j < c; j++) { grid[i][j] = ( grid[i][j] < 0 ? 0 : grid[i][j] ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static float computeEmptyCellScore(GameModel model) {\n\n int numEmptyCells = 0;\n for (byte b : model.getGrid()) {\n if (b < 0) {\n numEmptyCells++;\n }\n }\n return 1 << numEmptyCells;\n }", "public void forzerocount() {\r\n val = new BigDecimal[zerocntretobj.getRow...
[ "0.65884495", "0.64388263", "0.6399064", "0.6371829", "0.61713535", "0.6127418", "0.6119932", "0.6073522", "0.6022572", "0.6009821", "0.5983693", "0.5980779", "0.59626913", "0.58967507", "0.58664286", "0.5832561", "0.58304155", "0.58175087", "0.581529", "0.5791853", "0.576249...
0.79008627
0
constructor instantiate objects, initialize variables. Just the usual...
public Player() { if (Main.role == 0) this.role = Role.Attacker; if (Main.role == 1) this.role = Role.Defender; navigator = Main.nav; ballGrabber = new BallGrab(); ballPlatform[0] = Main.upperRightX + 35; //120 ballPlatform[1] = Main.upperRightY - 8; //165 startingCorner = Main.startingCorner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void init(){\n\t\tEmployee first = new Employee(\"Diego\", \"Gerente\", \"bebexitaHemoxita@gmail.com\");\n\t\tHighSchool toAdd = new HighSchool(\"Santiago Apostol\", \"4656465\", \"cra 33a #44-56\", \"3145689879\", 30, 5000, \"Jose\", new Date(1, 3, 2001), 3, \"Servicios educativos\", \"451616\", 15, \"Pied...
[ "0.7281563", "0.72534114", "0.71721154", "0.71721154", "0.71721154", "0.71721154", "0.7166929", "0.7166929", "0.7152827", "0.71285444", "0.71038324", "0.70998895", "0.70998895", "0.7079366", "0.70693445", "0.70475996", "0.7037745", "0.7030393", "0.7028151", "0.69942623", "0.6...
0.0
-1
method that will be called from Main to make the robot start playing after localization is complete
public void startPlaying() { // make the player travel to its home base travelTo(Location.Home); // once it has travelled to its home base, start performing // the appropriate tasks -- whether that is attack or defend if (role == Role.Defender) defend(); else if (role == Role.Attacker) attack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startUp() {\n\t\twhile (startupSettings.getContinue()) {\n\t\t\tstartView.showLogo();\n\t\t\tthis.setupNewMatch();\n\t\t\tstartView.showNewMatchStarting();\n\t\t\tcurrentMatch.start();\n\t\t\tstartupSettings = startView.askNewStartupSettings();\n\t\t}\n\t\tthis.ending();\n\t}", "public void start(){\...
[ "0.6545613", "0.64755946", "0.6460288", "0.6421784", "0.6418635", "0.6417513", "0.6416493", "0.63815707", "0.6380726", "0.6363133", "0.6349386", "0.63312286", "0.6281108", "0.62750155", "0.62260145", "0.6202559", "0.618911", "0.614676", "0.6129869", "0.6129869", "0.6101964", ...
0.5751409
79
code to expand the defense wall
private void defend() { navigator.setPlaying(true); travelTo(Location.DefenseBase); navigator.turnTo(0); //unfold Defense def = Main.def; def.mode(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void expand(){\n\t\tsetBounds(getX()-getWidth()/4, getY(), getWidth() * 1.5f, getHeight());\n\t\tcollisionBounds.setWidth(getWidth());\n\t}", "public void fullyHeal() {\n removeStatus();\n getActualMoves().restoreAllPP();\n healHealthFraction(1);\n }", "public void expand() {\n\t...
[ "0.6023098", "0.59630036", "0.594101", "0.58941025", "0.5884238", "0.5877626", "0.58269525", "0.58041286", "0.57695574", "0.57156444", "0.5681532", "0.56793994", "0.5672438", "0.5662294", "0.56559247", "0.56495327", "0.5646352", "0.5615276", "0.56071246", "0.56048137", "0.558...
0.61833715
0
code to travel to a certain destination
private void travelTo(Location destination) { System.out.println(destination.name()); if (destination == Location.Home) { if (role == Role.Attacker) { switch(startingCorner) { /*case 1: travelTo(Location.X4); travelTo(Location.AttackBase); break; case 2: travelTo(Location.X3); travelTo(Location.AttackBase); break; case 3: case 4: travelTo(Location.AttackBase);*/ case 1: travelTo(Location.AttackBase); break; case 2: travelTo(Location.AttackBase); break; case 3: //travelTo(Location.X2); travelTo(Location.AttackBase); break; case 4: //travelTo(Location.X1); travelTo(Location.AttackBase); break; } } else if (role == Role.Defender) { switch(startingCorner) { case 1: //travelTo(Location.X4); travelTo(Location.DefenseBase); break; case 2: //travelTo(Location.X3); travelTo(Location.DefenseBase); break; case 3: travelTo(Location.DefWay3); travelTo(Location.DefenseBase); break; case 4: travelTo(Location.DefWay4); travelTo(Location.DefenseBase); break; } } } else if (destination == Location.BallPlatform) navigator.travelTo(ballPlatform[0], ballPlatform[1]); else if (destination == Location.ShootingRegion) navigator.travelTo(CENTER, 7 * 30.0); // we have to account for the case when there is an obstacle in the destination // also need to find a way of determining the y coordinate else if (destination == Location.AttackBase) navigator.travelTo(ATTACK_BASE[0], ATTACK_BASE[1]); else if (destination == Location.DefenseBase) navigator.travelTo(DEFENSE_BASE[0], DEFENSE_BASE[1]); else if (destination == Location.X1) navigator.travelTo(X[0][0] * 30.0, X[0][1] * 30.0); else if (destination == Location.X2) navigator.travelTo(X[1][0] * 30.0, X[1][1] * 30.0); else if (destination == Location.X3) navigator.travelTo(X[2][0] * 30.0, X[2][1] * 30.0); else if (destination == Location.X4) navigator.travelTo(X[3][0] * 30.0, X[3][1] * 30.0); else if (destination == Location.DefWay3) navigator.travelTo(240, 240); else if (destination == Location.DefWay4) navigator.travelTo(60, 240); // return from method only after navigation is complete while (navigator.isNavigating()) { System.out.println("destX: " + navigator.destDistance[0] + "destY: " + navigator.destDistance[1]); try { Thread.sleep(100); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void findDestination() {\n\t\t\n\t}", "public void travel();", "int getDestination();", "public void doGoToLocation(Structure structure)\n\t{\n\t\tif(vehicle.currentLocation != null)\n\t\t{\n\t\t\tx = (int)vehicle.currentLocation.getParkingLocation().getX();\n\t\t\ty = (int)vehicle.currentLocation.get...
[ "0.70640516", "0.6860521", "0.668201", "0.6677483", "0.6626711", "0.65478003", "0.6523827", "0.6457171", "0.64530843", "0.64461774", "0.63803065", "0.63489366", "0.6338275", "0.6297636", "0.62910575", "0.6275009", "0.61669034", "0.6156558", "0.6154473", "0.6097217", "0.606064...
0.74039495
0
set the label of gameID display in the panel
public void setGameId(String gameId) { this.gameIdDisplay.setText(gameId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLabel()\r\n {\r\n int i = Converter(Input);\r\n \r\n if(j<i && label.getText().equals(\"Player 1\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n \r\n }else if(j<i && label.getText().equals(\"Player 2\"))\r\n {\r\n ...
[ "0.6964432", "0.6950722", "0.6733679", "0.6716621", "0.669278", "0.66052854", "0.64723235", "0.64628273", "0.64190865", "0.63629794", "0.63599527", "0.63015664", "0.62851536", "0.6278583", "0.6269617", "0.62425864", "0.6228934", "0.61400557", "0.61348605", "0.6129203", "0.610...
0.65459204
6
set manager of the game and perform corresponding action on the lock and reset buttons
public void setManagingUser(String managingUser, boolean isManagingUser) { this.managingUserDisplay.setText(managingUser); if (!isManagingUser) { btnResetGame.setEnabled(false); btnLockGame.setEnabled(false); } else { if (isLocked) { btnLockGame.setEnabled(false); btnResetGame.setEnabled(true); } else { btnLockGame.setEnabled(true); btnResetGame.setEnabled(true); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void lockGame() {\n this.isLocked = true;\n btnLockGame.setEnabled(false);\n }", "public void activateManager(int manager)\n {\n switch(manager)\n {\n case 0:\n if(activeManager == 2)\n {\n ou.saveFlipMatrices();\n if(ou.getMosaic()!= null)\n {\n ...
[ "0.64944017", "0.6319306", "0.624125", "0.60952866", "0.60626507", "0.605824", "0.604521", "0.59784484", "0.5966027", "0.59644735", "0.59118325", "0.5876919", "0.5873054", "0.5871038", "0.58691835", "0.5867791", "0.5842769", "0.58425033", "0.58373195", "0.5814513", "0.5809357...
0.0
-1
set the label of score display in the panel
public void setWordScore(int score) { if (score == 0) { this.wordScoreDisplay.setText(""); } else { this.wordScoreDisplay.setText(String.valueOf(score)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setScore(){\n\t\t//get player's score and change it to the string\n\t\tthis.scoreLabel.setSize(scoreLabel.getPreferredSize().width, \n\t\t\t\tscoreLabel.getPreferredSize().height);\n\t\tthis.scoreLabel.setText(String.valueOf(this.player.getScore()));\n\t}", "private void setScoreText(){\n if(c...
[ "0.76685786", "0.75623494", "0.7497121", "0.7401812", "0.7353534", "0.73080987", "0.723999", "0.72384167", "0.7230764", "0.7186961", "0.7146499", "0.70781606", "0.7037822", "0.7018949", "0.7018947", "0.6979723", "0.6972917", "0.69645196", "0.6960602", "0.6939735", "0.68797255...
0.0
-1
set the label of chosen word display in the panel
public void setChosenWord(String word) { this.chosenWordDisplay.setText(word); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setLabel( String label )\n { \n this.label = label;\n show_text();\n }", "public void setLabelText(String text);", "public void displayWord(String word) \n\t{ \n\t\tguessedLabel.setLabel(word);\n\t\tadd(guessedLabel);\n\t}", "public void setLabelToBeShown(String label);", "void setLabe...
[ "0.72903484", "0.727254", "0.7227831", "0.715091", "0.69333035", "0.6910654", "0.68288594", "0.6748306", "0.6722249", "0.6721214", "0.67204493", "0.67183656", "0.6702373", "0.6680526", "0.6671706", "0.6656017", "0.66342366", "0.663356", "0.6565022", "0.65486926", "0.6488961",...
0.63071465
35
lock the game and disable the lock game button
public void lockGame() { this.isLocked = true; btnLockGame.setEnabled(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void lockButton(){\n\t\tconversionPdf_Txt.setEnabled(false);\n\t\tavisJury.setEnabled(false);\n\t\tstatistique.setEnabled(false);\n\t\tbData.setEnabled(false);\n\t\tbDataTraining.setEnabled(false);\n\t\tbCompare.setEnabled(false);\n\t}", "private void unlockButton() {\n\t\tconversionPdf_Txt.setEnabled(tr...
[ "0.7393513", "0.6944386", "0.68752795", "0.6699641", "0.6509865", "0.65072966", "0.6419307", "0.6386686", "0.63626724", "0.63594425", "0.63430023", "0.6288452", "0.6278157", "0.6278157", "0.6250608", "0.62358534", "0.62254596", "0.62186015", "0.6177488", "0.6175618", "0.61432...
0.9004709
0
set the player list display in the panel
public void setPlayersListArea(String playersList) { this.playersListArea.setText(playersList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void showPanelToNewPlayList() {\n\t\tjpIntroduceNameList.setVisible(true);\n\t\tjpIntroduceNameList.setFocusable(true);\n\t\tjpIntroduceNameList.requestFocus(true);\n\t\tjpIntroduceNameList.setRequestFocusEnabled(true);\n\t\tjpIntroduceNameList.requestFocus();\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void s...
[ "0.7434012", "0.68735874", "0.6836342", "0.6747417", "0.67468405", "0.66745156", "0.661047", "0.66103554", "0.6582362", "0.64315146", "0.64017206", "0.6385875", "0.6379108", "0.63702893", "0.6257861", "0.6255273", "0.62509817", "0.6244841", "0.6241754", "0.62318367", "0.61899...
0.68270344
3
set the score display in the panel
public void setMyScoreDisplay(String score) { myScoreDisplay.setText(score); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showScore() {\r\n View.show(score, this.getSize().width + 15, 0);\r\n }", "public void showScore()\n {\n showText(\"Score:\" + score,550,50);\n }", "public void setScore(){\n\t\t//get player's score and change it to the string\n\t\tthis.scoreLabel.setSize(scoreLabel.getPrefe...
[ "0.7785304", "0.77601904", "0.7619564", "0.7451005", "0.73677397", "0.73427486", "0.73105747", "0.7210621", "0.7199527", "0.71079165", "0.70777714", "0.705348", "0.7051945", "0.7034749", "0.7032332", "0.70230484", "0.7022131", "0.7002632", "0.7001849", "0.69782895", "0.694780...
0.7355019
5
For searching the records
@RequestMapping(method = RequestMethod.GET) public ResponseEntity<SearchPageResponse<PaymentInformation>> search( @RequestParam Map<String, String> requestParams) { LOGGER.info("Inside paymentinfo search."); SearchDetails searchDetails = new SearchDetails(requestParams); SearchPageResponse<PaymentInformation> pageResponse = paymentInformationService .search(searchDetails); // If no content found if (pageResponse.getData().isEmpty()) { return new ResponseEntity<SearchPageResponse<PaymentInformation>>( HttpStatus.NO_CONTENT); } // Return with success return new ResponseEntity<SearchPageResponse<PaymentInformation>>( pageResponse, HttpStatus.OK); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void search() {\r\n \t\r\n }", "private void searchFunction() {\n\t\t\r\n\t}", "abstract public void search();", "public void search() {\n listTbagendamentos\n = agendamentoLogic.findAllTbagendamentoByDataAndPacienteAndFuncionario(dataSearch, tbcliente, tbfuncionario);\n ...
[ "0.7236051", "0.70287776", "0.6916564", "0.6824871", "0.67517155", "0.6742833", "0.67104053", "0.6654661", "0.6654661", "0.6611538", "0.6547224", "0.65462583", "0.65030795", "0.6483969", "0.6464691", "0.64251816", "0.6381924", "0.6367435", "0.6365992", "0.6354994", "0.633938"...
0.0
-1
Creates the payment information
@RequestMapping(method = RequestMethod.POST) public ResponseEntity<PaymentInformation> createPaymentInformation( @RequestBody PaymentInformation paymentInformation) { if (paymentInformationService .isPaymentInformationExist(paymentInformation.getId())) { return new ResponseEntity<PaymentInformation>(HttpStatus.CONFLICT); } PaymentInformation createdPaymentInformation = paymentInformationService .createPaymentInformation(paymentInformation); return new ResponseEntity<PaymentInformation>( createdPaymentInformation, HttpStatus.CREATED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void createPayment() throws IOException {\t\t\n\t\tDate date = new Date((long) random(100000000));\n\t\tString date2 = \"'19\" + date.getYear() + \"-\" + (random(12)+1) + \"-\" + (random(28)+1) + \"'\";\n\t\tint amount = random(10000);\n\t\t\n\t\twriter.write(\"INSERT INTO Payment (Id, Date, CCNum, a...
[ "0.6892244", "0.6502089", "0.6113885", "0.5971451", "0.59612626", "0.594315", "0.592161", "0.59061915", "0.590116", "0.58994704", "0.5892841", "0.5876832", "0.5874257", "0.58414394", "0.58288044", "0.57956463", "0.57903695", "0.57877904", "0.57835174", "0.5782563", "0.5777968...
0.5678673
29
Gets the payment information for the passed ID
@RequestMapping(method = RequestMethod.GET, value = "/{id}") public ResponseEntity<PaymentInformation> getPaymentInformation( @PathVariable("id") Integer id) { PaymentInformation paymentInformation = paymentInformationService .findPaymentInformationById(id); if (paymentInformation == null) { return new ResponseEntity<PaymentInformation>(HttpStatus.NOT_FOUND); } return new ResponseEntity<PaymentInformation>(paymentInformation, HttpStatus.OK); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic RotatePayment getPayment(String id) {\n\t\tRotatePayment payment = paymentDao.getPayment(id);\n\t\tHashMap<String, Object> map = new HashMap<>();\n\t\tmap.put(\"paymentId\", id);\n\t\tList<RotatePaymentDetail> details=paymentDao.listPaymentDetail(map);\n\t\tpayment.setDetailList(details);\n\t\t...
[ "0.7444429", "0.74108934", "0.73741", "0.7371314", "0.7218765", "0.7180447", "0.7164119", "0.7009561", "0.69541967", "0.6930452", "0.68030095", "0.6721172", "0.65884775", "0.65721166", "0.6524318", "0.64918506", "0.6435472", "0.639334", "0.6371439", "0.6322525", "0.63092095",...
0.74032104
2
Gets the payment information for the passed ID
@RequestMapping(method = RequestMethod.DELETE, value = "/{id}") public ResponseEntity<Void> deletePaymentInformation( @PathVariable("id") Integer id) { if (!paymentInformationService.isPaymentInformationExist(id)) { return new ResponseEntity<Void>(HttpStatus.NOT_FOUND); } paymentInformationService.deletePaymentInformationById(id); return new ResponseEntity<Void>(HttpStatus.NO_CONTENT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic RotatePayment getPayment(String id) {\n\t\tRotatePayment payment = paymentDao.getPayment(id);\n\t\tHashMap<String, Object> map = new HashMap<>();\n\t\tmap.put(\"paymentId\", id);\n\t\tList<RotatePaymentDetail> details=paymentDao.listPaymentDetail(map);\n\t\tpayment.setDetailList(details);\n\t\t...
[ "0.7444334", "0.74113756", "0.74036074", "0.73737156", "0.73702866", "0.7218409", "0.7180691", "0.7164343", "0.7009905", "0.6954194", "0.69316995", "0.68040997", "0.6721872", "0.6589631", "0.65730417", "0.6524626", "0.64913297", "0.64358294", "0.6392649", "0.6371565", "0.6323...
0.53670514
99
we are only overriding certain types
@Override public FieldConverter getFieldConverter(DataType dataType) { switch (dataType) { case BOOLEAN : case BOOLEAN_OBJ : return booleanConverter; case BYTE : return byteConverter; default : return super.getFieldConverter(dataType); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void checkSubclass() {\n }", "public void override() {\n isOverridden = true;\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n protected void checkSubclass() {\n }", "@Override\n publ...
[ "0.6427032", "0.6336306", "0.6253361", "0.6253361", "0.6253361", "0.62516105", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", "0.6168729", ...
0.0
-1
TINYINT exists but it gives 0255 unsigned
@Override protected void appendByteType(StringBuilder sb) { sb.append("SMALLINT"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public byte getTinyInt(int columnIndex) {\n TinyIntVector vector = (TinyIntVector) table.getVector(columnIndex);\n return vector.get(rowNumber);\n }", "public byte getTinyInt(String columnName) {\n TinyIntVector vector = (TinyIntVector) table.getVector(columnName);\n return vector.get(rowNumber);\n ...
[ "0.6003659", "0.5980272", "0.59619015", "0.58463335", "0.57539606", "0.5674202", "0.56540895", "0.5652139", "0.5591128", "0.5535973", "0.55263674", "0.5523733", "0.5519191", "0.5512566", "0.54888356", "0.547501", "0.5463065", "0.5412365", "0.5382526", "0.5382526", "0.5382526"...
0.6533561
0
TIMESTAMP is some sort of internal database type
@Override protected void appendDateType(StringBuilder sb, int fieldWidth) { sb.append("DATETIME"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Date getDBTimeStamp() throws Exception;", "private final LocalDateTime get_TIMESTAMP(int column) {\n String timeString = dataBuffer_.getCharSequence(columnDataPosition_[column - 1],\n 26, charset_[column - 1]).toString();\n return LocalDateTime.parse(timeString, DRDAConstants.DB2_...
[ "0.7344369", "0.71351755", "0.7064937", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.68798906", "0.6809025", ...
0.0
-1
store it as a short
public SqlType getSqlType() { return SqlType.BYTE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public short getShortA() {\n\t\tint i = (payload.get() & 0xFF) << 8 | payload.get() - 128 & 0xFF;\n\t\tif (i > 32767) {\n\t\t\ti -= 0x10000;\n\t\t}\n\t\treturn (short) i;\n\t}", "public short getLEShortA() {\n\t\tint i = payload.get() - 128 & 0xFF | (payload.get() & 0xFF) << 8;\n\t\tif (i > 32767) {\n\t\t\ti -= ...
[ "0.7398815", "0.7154624", "0.7119771", "0.7055427", "0.7028009", "0.7004251", "0.6978719", "0.6919857", "0.69151264", "0.67610866", "0.66904354", "0.66716206", "0.6668112", "0.66434246", "0.661367", "0.65969324", "0.6594964", "0.65660363", "0.6561746", "0.65573525", "0.655075...
0.0
-1
convert the Byte arg to be a short
public Object javaToSqlArg(FieldType fieldType, Object javaObject) { byte byteVal = (Byte) javaObject; return (short) byteVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "short decodeShort();", "public short toShort()\n\t{\n\t\treturn (short)this.ordinal();\n\t}", "public static short toShort(byte b1, byte b2) {\n\t\tByteBuffer bb = ByteBuffer.allocate(2);\n\t\tbb.order(ByteOrder.LITTLE_ENDIAN);\n\t\tbb.put(b1);\n\t\tbb.put(b2);\n\t\treturn bb.getShort(0);\n\t}", "public stat...
[ "0.7563412", "0.7458614", "0.7372937", "0.7364099", "0.7321834", "0.7254604", "0.72528213", "0.7242289", "0.7197666", "0.718552", "0.71814597", "0.717629", "0.7160504", "0.71182674", "0.7087801", "0.70780265", "0.70758766", "0.70706075", "0.70590967", "0.70286936", "0.702691"...
0.60926676
100
starts as a short and then gets converted to a byte on the way out
public Object resultToJava(FieldType fieldType, DatabaseResults results, int dbColumnPos) throws SQLException { short shortVal = results.getShort(dbColumnPos); // make sure the database value doesn't overflow the byte if (shortVal < Byte.MIN_VALUE) { return Byte.MIN_VALUE; } else if (shortVal > Byte.MAX_VALUE) { return Byte.MAX_VALUE; } else { return (byte) shortVal; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\nshort i = 128;\r\nbyte shortToByte = (byte)i;\r\nSystem.out.println(shortToByte);\r\nbyte t = 127;\r\nt++;\r\nSystem.out.println(t);\r\nt++;\r\nSystem.out.println(t);\r\n\r\n\t}", "abstract int readShort(int start);", "public short toShort()\n\t{\n\t\treturn (short)thi...
[ "0.77010304", "0.75393534", "0.75376064", "0.7430528", "0.730079", "0.7295046", "0.725529", "0.7223995", "0.7201819", "0.7166669", "0.71645176", "0.7126498", "0.7123976", "0.70985204", "0.70710117", "0.7056339", "0.7049516", "0.7046942", "0.7022605", "0.70128447", "0.6990844"...
0.0
-1
Same as QuickAdapterQuickAdapter(Context,int) but with some initialization data.
public RecommendAdapter(List<RecommendFood> data) { super(data); addItemType(RecommendFood.TYPE_BIG, R.layout.recommend_item_middle); addItemType(RecommendFood.TYPE_DETAIL, R.layout.recommend_item_detail); addItemType(RecommendFood.TYPE_MIDDLE, R.layout.recommend_item_middle); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void init(Context context) {\n\t\tsuper.init(context);\n\t\tmContext = context;\n\t\tid = \"qq\";\n\t\tdescription = \"QQ\";\n\n\t}", "private void initializeAdapter() {\n }", "abstract public void setUpAdapter();", "public DataBaseAdapter(Context context) {\r\n\t\tmDbHelper = new Data...
[ "0.67986727", "0.62483835", "0.62023205", "0.6057942", "0.60370755", "0.5939922", "0.59008205", "0.5895381", "0.5863921", "0.58598846", "0.5859854", "0.581384", "0.58122975", "0.5802757", "0.58023816", "0.5801917", "0.57867527", "0.576234", "0.57494664", "0.57287693", "0.5717...
0.0
-1
int a = 5; a++; a = a +1 ; int b = a++; System.out.println(b); System.out.println(a++); int c = 8; int d = ++c; System.out.println(d); int f = 15; System.out.println(++f); System.out.println(f++); System.out.println(f);
public static void main(String[] args) { int g = 15; int m = g++ + ++g - --g; System.out.println(m); System.out.println(g); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\tint a = 10; \n\tint b = ++a; \n\t\n\t// post increment--->first assign --> increment \n\tint c = 10; //11\n\tint d = c++; //10 \n\t\n\tSystem.out.println(a);//11\n\tSystem.out.println(b);//11\n\t\n\tSystem.out.println();\n\t\n\tSystem.out.println(c);\n\tSystem.out.print...
[ "0.8604836", "0.78338873", "0.7806229", "0.7371083", "0.7328661", "0.73144644", "0.7310813", "0.72492474", "0.70805043", "0.7002463", "0.6923757", "0.6897815", "0.6809674", "0.6703939", "0.66862094", "0.6623942", "0.66185814", "0.6615112", "0.66055834", "0.65247685", "0.64875...
0.5374762
86
/ metodos de instancia
public void addEncomenda(Encomenda e) { this.encomendas.put(e.getCodigoEncomenda(), e.clone()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Instantiation(){}", "private MApi() {}", "public Pasien() {\r\n }", "private UsineJoueur() {}", "Reproducible newInstance();", "Petunia() {\r\n\t\t}", "public AntrianPasien() {\r\n\r\n }", "public Curso() {\r\n }", "public Alojamiento() {\r\n\t}", "public Caso_de_uso () {\n }", ...
[ "0.72666943", "0.7244235", "0.7159078", "0.7157291", "0.7153", "0.7133482", "0.7116663", "0.7073818", "0.70555687", "0.7051892", "0.70295304", "0.70201385", "0.7005605", "0.69870245", "0.69584316", "0.6953372", "0.69379264", "0.6928524", "0.69153154", "0.69095", "0.6890418", ...
0.0
-1
Criar map com codigo de utilizador e lista de encomendas associadas
public List<String>top10Utilizadores() { Map<String,List<String>> utilizadorEncomendas = new HashMap<String,List<String>>(); for(Encomenda e : this.encomendas.values()) { if(!utilizadorEncomendas.containsKey(e.getCodigoUtilizador())) { utilizadorEncomendas.put(e.getCodigoUtilizador(), new ArrayList<>()); } utilizadorEncomendas.get(e.getCodigoUtilizador()).add(e.getCodigoEncomenda()); } // a partir do primeiro map criar um segundo com codigo de utilizador e numero de encomendas // a razao de ser um double é porque o mesmo comparator é também utilizado no metodo List<String>top10Transportadores() Map<String,Double> utilizadoresNumeroEncs = new HashMap<>(); Iterator<Map.Entry<String, List<String>>> itr = utilizadorEncomendas.entrySet().iterator(); while(itr.hasNext()) { Map.Entry<String, List<String>> entry = itr.next(); utilizadoresNumeroEncs.put(entry.getKey(), Double.valueOf(entry.getValue().size())); } MapStringDoubleComparator comparator = new MapStringDoubleComparator(utilizadoresNumeroEncs); // criar map ordenado (descending) TreeMap<String, Double> utilizadorNumeroEncsOrdenado = new TreeMap<String, Double>(comparator); utilizadorNumeroEncsOrdenado.putAll(utilizadoresNumeroEncs); // retornar a lista de codigos de utilizadores pretendida return utilizadorNumeroEncsOrdenado.keySet() .stream() .limit(10) .collect(Collectors.toList()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<Long, GrupoAtencion> getGruposAtentionGenerados(Integer accion, Long numeroProgramacion) {\n\t\tlogger.info(\" ### getGruposAtentionGenerados ### \");\n\t\t\n\t\tMap<Long, GrupoAtencion> mpGrupos = Collections.EMPTY_MAP;\n\t\t\n\t\ttry{\n\t\t\t\n\t\t\tif(accion!=null && accion.equals(ConstantBusiness.A...
[ "0.60527563", "0.60201925", "0.5952992", "0.59471965", "0.58398026", "0.57966596", "0.57928896", "0.5658476", "0.56570774", "0.5642323", "0.55710113", "0.55631757", "0.55526763", "0.54891217", "0.548586", "0.54612976", "0.5416005", "0.54060704", "0.54007757", "0.53751564", "0...
0.0
-1
Get the scene for the nickname and server selection menu
public static Scene getScene(GUIManager guiManager) { UserSettings userSettings = GUIManager.getUserSettings(); GridPane mainGrid = new GridPane(); mainGrid.setAlignment(Pos.CENTER); mainGrid.setHgap(10); mainGrid.setVgap(10); mainGrid.setPadding(MenuControls.scaleByResolution(25)); LoadingPane loadingPane = new LoadingPane(mainGrid); Label titleLabel = new Label("Multiplayer"); titleLabel.setStyle("-fx-font-size: 26px;"); GridPane topGrid = new GridPane(); topGrid.setAlignment(Pos.CENTER); topGrid.setHgap(10); topGrid.setVgap(10); topGrid.setPadding(MenuControls.scaleByResolution(25)); // Create the username label and text field Label usernameLabel = new Label("Username"); TextField usernameText = new TextField(); usernameText.setId("UsernameTextField"); usernameText.setText(userSettings.getUsername()); topGrid.add(usernameLabel, 0, 0); topGrid.add(usernameText, 1, 0); GridPane selectionGrid = new GridPane(); selectionGrid.setAlignment(Pos.CENTER); selectionGrid.setHgap(10); selectionGrid.setVgap(10); selectionGrid.setPadding(MenuControls.scaleByResolution(25)); // Create the toggle group final ToggleGroup group = new ToggleGroup(); // Create the automatic radio button RadioButton automatic = new RadioButton(); automatic.setToggleGroup(group); automatic.setSelected(true); // Create the search label Label automaticLabel = new Label("Search LAN for a Server"); automaticLabel.setOnMouseClicked((event) -> automatic.fire()); selectionGrid.add(automatic, 0, 0); selectionGrid.add(automaticLabel, 1, 0); // Create the manual radio button, label and text field RadioButton manual = new RadioButton(); manual.setToggleGroup(group); Label ipLabel = new Label("Manually Enter IP Address"); ipLabel.setOnMouseClicked((event) -> manual.fire()); TextField ipText = new TextField("127.0.0.1"); GridPane manualField = new GridPane(); manualField.add(ipLabel, 0, 0); manualField.add(ipText, 0, 1); selectionGrid.add(manual, 0, 1); selectionGrid.add(manualField, 1, 1); // Add opacity styling to the form automaticLabel.setStyle("-fx-opacity: 1.0;"); ipLabel.setStyle("-fx-opacity: 0.5;"); ipText.setStyle("-fx-opacity: 0.5;"); group.selectedToggleProperty().addListener((observable, oldValue, newValue) -> { if (automatic.isSelected()) { automaticLabel.setStyle("-fx-opacity: 1.0;"); ipLabel.setStyle("-fx-opacity: 0.5;"); ipText.setStyle("-fx-opacity: 0.5;"); } else { automaticLabel.setStyle("-fx-opacity: 0.5;"); ipLabel.setStyle("-fx-opacity: 1.0;"); ipText.setStyle("-fx-opacity: 1.0;"); } }); // Add listeners for focusing and editing on the text field, changing the selection to manual ipText.focusedProperty().addListener((observable, oldValue, newValue) -> manual.setSelected(true)); ipText.editableProperty().addListener((observable, oldValue, newValue) -> manual.setSelected(true)); // Create the set of buttons for connecting and going back MenuOption[] connect = {new MenuOption("Connect", true, (event) -> { loadingPane.startLoading(); userSettings.setUsername(usernameText.getText()); guiManager.notifySettingsObservers(); (new Thread(() -> { if (automatic.isSelected()) { // Search the local network for servers DiscoveryClientAnnouncer client = new DiscoveryClientAnnouncer(); String ipPort = client.findServer().split(":")[0]; if (ipPort.equals("")) { // Could not find a LAN server Platform.runLater(() -> { (new AlertBox("No LAN server", "Could not find any local servers. Please try again or enter the server IP address manually.")).showAlert(true); loadingPane.stopLoading(); }); } else { // Found a LAN server, so try to connect to it Platform.runLater(() -> { guiManager.setIpAddress(ipPort); int error = guiManager.establishConnection(); if (error == 0) guiManager.transitionTo(Menu.MULTIPLAYER_GAME_TYPE); else if (error == 6) loadingPane.stopLoading(); else { (new AlertBox("No LAN server", "Could not find any local servers. Please try again or enter the server IP address manually.")).showAlert(true); loadingPane.stopLoading(); } }); } } else { // Manual is selected, so try to connect to the server (new Thread(() -> { Platform.runLater(() -> { // If localhost is selected, use the LAN IP instead if (ipText.getText().equals("127.0.0.1") || ipText.getText().equals("localhost")) guiManager.setIpAddress(IPAddress.getLAN()); else guiManager.setIpAddress(ipText.getText()); // Try to establish a connection if (guiManager.establishConnection() == 0) guiManager.transitionTo(Menu.MULTIPLAYER_GAME_TYPE); else loadingPane.stopLoading(); }); })).start(); } })).start(); }), new MenuOption("Back", false, (event) -> guiManager.transitionTo(Menu.MAIN_MENU))}; // Turn the array into a grid pane GridPane connectGrid = MenuOptionSet.optionSetToGridPane(connect); // Add the options grid and the button grid to the main grid mainGrid.add(MenuControls.centreInPane(titleLabel), 0, 0); mainGrid.add(topGrid, 0, 1); mainGrid.add(selectionGrid, 0, 2); mainGrid.add(connectGrid, 0, 3); ipText.setOnKeyPressed((event) -> { if (event.getCode().equals(KeyCode.ENTER)) for (Node n : connectGrid.getChildren()) if (n instanceof Button && ((Button) n).getText().equals("Connect")) ((Button) n).fire(); }); // Create a new scene using the main grid return guiManager.createScene(loadingPane); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Scene getMainMenuScene() {\n return scene;\n }", "public Scene retrieveScene()\n {\n return gameStage.getScene();\n }", "@FXML\n public void ServerScene(ActionEvent event) throws IOException\n {\n Parent clientViewParent = FXMLLoader.load(getClass().getResource(\"server.fxml\...
[ "0.6209582", "0.5928256", "0.58846664", "0.58376366", "0.5832249", "0.5827372", "0.57823884", "0.57799304", "0.5766692", "0.5752837", "0.5749629", "0.5693457", "0.56814265", "0.56631345", "0.56255907", "0.5599762", "0.5576025", "0.55560404", "0.5541177", "0.55410904", "0.5540...
0.6809118
0
TODO Autogenerated method stub
@Override public int describeContents() { return 0; }
{ "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
Remove unwanted horizontal padding of android.preference.PreferenceScreen (no necessary for android.support.v7.preference.PreferenceScreen). Keep it before Android 5.0.
private void removeUnwantedPadding() { if (C.SDK < 21) { return; } View view = getView(); if (view != null) { View viewList = view.findViewById(android.R.id.list); if (viewList != null) { viewList.setPadding(0, 0, 0, 0); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setupSimplePreferencesScreen() {\n if (!isSimplePreferences(this)) {\n return;\n }\n\n addPreferencesFromResource(R.xml.pref_empty);\n\n addHeader(R.string.pref_header_game);\n addPreferencesFromResource(R.xml.pref_game);\n this.gameModeSettingsPref...
[ "0.55457264", "0.5253538", "0.5214827", "0.5204186", "0.51601166", "0.51097506", "0.4935086", "0.49326822", "0.49196193", "0.48850676", "0.48118064", "0.48100644", "0.4800211", "0.47884494", "0.47737595", "0.47468823", "0.4706318", "0.47003102", "0.46691576", "0.46673864", "0...
0.61478746
0
add to the front of the cell array
public void appendToCells(String value) { String[] ca = new String[cell.length + 1]; ca[0] = value; for (int i=0; i < cell.length; i++) { ca[i+1] = cell[i]; } cell = ca; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void putValueBeforeArrayAddrIndex() {\n\t\tObj index = Tab.currentScope().findSymbol(\"@@TEMPOBJ\");\n\t\tObj address = Tab.currentScope().findSymbol(\"@@TEMPOBJ2\");\n\t\tObj value = Tab.currentScope().findSymbol(\"@@TEMPOBJ3\");\n\t\t\n\t\tCode.store(index);\n\t\tCode.store(address);\n\t\tCode.store(value...
[ "0.6329152", "0.6207522", "0.6152984", "0.6117231", "0.60424024", "0.6026071", "0.6010182", "0.6005232", "0.59818035", "0.5977744", "0.5973576", "0.59623855", "0.5956479", "0.5931208", "0.58400005", "0.5837024", "0.580331", "0.5803139", "0.5797864", "0.5741213", "0.57341325",...
0.0
-1