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
Formulates a URL for requesting the access token from the Facebook API
public static String getAccessTokenURL(String authCode) { return FB.oauthURL + "client_id=" + FB.client_id + "&redirect_uri=" + FB.redirect_uri + "&client_secret=" + FB.secret + "&code=" + authCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected String getAccessTokenUrl(final JsonNode inputOAuthConfiguration) {\n return TOKEN_URL;\n }", "String buildAuthorizeUrl(LastFmAuthParameters parameters);", "@FormUrlEncoded\n @POST(\"oauth/request_token\")\n Flowable<ResponseBody> requestToken(@Field(\"oauth_callback\") String o...
[ "0.7174247", "0.67358166", "0.63978994", "0.63711077", "0.6369336", "0.6369336", "0.6318406", "0.6265307", "0.6232534", "0.6231573", "0.6211513", "0.6143979", "0.6079701", "0.59834015", "0.5929206", "0.59226036", "0.58403486", "0.57384217", "0.5654786", "0.5648027", "0.563433...
0.6697174
2
Get the Facebook access token
public static String getAccessToken(String theCode) throws IOException { String authURL = getAccessTokenURL(theCode); URL token = new URL(authURL); String result = HTTP.readHttpURL(token); String accessToken = null; Integer expires = null; String[] pairs = result.split("&"); for (String pair : pairs) { String[] kv = pair.split("="); if (kv.length != 2) { System.out .println("Unexpected response in Facebook.getAccessToken()"); return ("Unexpected response"); } else { if (kv[0].equals("access_token")) { accessToken = kv[1]; } if (kv[0].equals("expires")) { expires = Integer.valueOf(kv[1]); } } } if (accessToken != null && expires != null) { System.out.println("Access token:" + accessToken); System.out.println("Expires:" + expires); } System.out .println("Access token retreived by Facebook.getAccessToken():" + accessToken); return accessToken; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAccessToken();", "String getAccessToken();", "String getAccessToken();", "AccessToken getOAuthAccessToken() throws MoefouException;", "public String getAccessToken() {\n return accessToken;\n }", "public String getAccessToken() {\n return accessToken;\n }", "public sta...
[ "0.79011357", "0.7860001", "0.7860001", "0.73886603", "0.73851407", "0.73563963", "0.73465526", "0.73387593", "0.72404337", "0.7220674", "0.71591127", "0.70405036", "0.70405036", "0.7023075", "0.7014213", "0.6917292", "0.68857735", "0.6880963", "0.6867267", "0.68402874", "0.6...
0.693242
15
TODO Autogenerated method stub
@Override public void onSensorChanged(final SensorEvent event) { Sensor sensor = event.sensor; while (System.currentTimeMillis() - startTime < 5002 && System.currentTimeMillis() - startTime > 1000) { if (System.currentTimeMillis() - startTime > 5000) { setContentView(R.layout.maler); setActivityBackgroundColor(0xFF000000); blackScreen = true; } } if (sensor.getType() == Sensor.TYPE_LIGHT) { System.out.println("System.currentTimeMillis() - startTime " + (startTime)); new Timer().scheduleAtFixedRate(new TimerTask() { @Override public void run() { getLights(event); } }, 0, 50); // Wenn Grenze erreicht => Animation if (event.values[0] > (helligkeitsGrenze + 200) && !animations[0].isStarted() && !animations[1].isStarted() && !animations[2].isStarted() && blackScreen) { // Bildschirmhelligkeit maximal setzen WindowManager.LayoutParams layout = getWindow().getAttributes(); layout.screenBrightness = 1F; getWindow().setAttributes(layout); setContentView(R.layout.maler); animations[counter].start(); counter++; if (counter == 3) { counter = 0; } v.vibrate(pattern, -1); } } }
{ "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
Lebenszyklus Methoden (hier nicht reinpfuschen) !!!
@Override public void onAccuracyChanged(Sensor arg0, int arg1) { // TODO Auto-generated method stub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void loeschen() {\r\n//\t\tsuper.leuchterAbmelden(this);\r\n\t\tsuper.loeschen();\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public void trenneVerbindung();", "void zmniejszBieg();", "@Override\n\tpublic void verkaufen() {\n\t}", "@Override\n\tpublic void einkaufen...
[ "0.7055416", "0.6515362", "0.6467662", "0.6457606", "0.64413834", "0.6429464", "0.63398296", "0.6261893", "0.61878455", "0.61288637", "0.6081381", "0.60325503", "0.59574926", "0.5952822", "0.5949516", "0.59478587", "0.5918084", "0.59106576", "0.5867008", "0.5861079", "0.58234...
0.0
-1
When the search button is long pressed, quit
@Override public boolean onKeyLongPress(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { dialogExists = true; Intent intent = new Intent(this, start.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); // beendet alle Activities außer die Startactivity startActivity(intent); finish(); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onSearchExit();", "void unsetSearchWindowEnd();", "@FXML\n public void onButtonClick(ActionEvent e){\n if(e.getSource().equals(exit)){\n System.exit(0);\n }\n else if(e.getSource().equals(search)){\n performSearch();\n }\n }", "private void ...
[ "0.77375835", "0.72305375", "0.70677865", "0.7027022", "0.68821126", "0.6760255", "0.66862464", "0.6644257", "0.6634503", "0.65206087", "0.6498059", "0.64833575", "0.64715034", "0.642932", "0.64197886", "0.6356123", "0.63381714", "0.63161683", "0.6310334", "0.6300886", "0.629...
0.0
-1
Instantiates a new risultati ricerca tipo bene ajax action.
public RisultatiRicercaSvalutazioneCespiteAjaxAction() { super(); setParametroSessioneLista(BilSessionParameter.RISULTATI_RICERCA_SVALUTAZIONE_CESPITE); setParametroSessioneRequest(BilSessionParameter.REQUEST_RICERCA_SVALUTAZIONE_CESPITE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public RisultatiRicercaRegistroIvaAjaxAction() {\n\t\tsuper();\n\t\tsetParametroSessioneLista(BilSessionParameter.RISULTATI_RICERCA_REGISTRO_IVA);\n\t\tsetParametroSessioneRequest(BilSessionParameter.REQUEST_RICERCA_REGISTRO_IVA);\n\t}", "private void initFormEditMode() {\n initSpinnerSelectionChamps();\n...
[ "0.73448014", "0.60253245", "0.598608", "0.592823", "0.57360953", "0.5706846", "0.5655001", "0.56336826", "0.56089395", "0.5585454", "0.5571923", "0.5569196", "0.5567687", "0.55388063", "0.5529839", "0.5512886", "0.5510951", "0.54792446", "0.5439279", "0.54370517", "0.5436839...
0.6697595
1
Created by Yejt on 2017/9/1 0001.
public interface ComputerPartVisitor { public void visit(Computer computer); public void visit(Mouse mouse); public void visit(Keyboard keyboard); public void visit(Monitor monitor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void func_104112_b() {\n \n }", "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "private static void cajas() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "@Override\r\n\tpublic v...
[ "0.5868961", "0.58396566", "0.582372", "0.5803819", "0.5772242", "0.56995934", "0.5636393", "0.5636393", "0.561812", "0.55929774", "0.55754757", "0.5557678", "0.5543204", "0.5543031", "0.5500176", "0.5500176", "0.5500176", "0.5500176", "0.5500176", "0.5500176", "0.5500176", ...
0.0
-1
Initializes thrust object for a shape.
public Thrust(Shape host, float acceleration, float max_speed) { this.host = host; this.max_speed = max_speed; this.acceleration = acceleration; this.speed = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initShape()\n\t{\n\t\tcoords = new int[4][2];\n\t\tcoordsTable = new int [][][] \n\t\t{\n { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },\n { { 0, -1 }, { 0, 0 }, { -1, 0 }, { -1, 1 } },\n { { 0, -1 }, { 0, 0 }, { 1, 0 }, { 1, 1 } },\n { { 0, -1 }...
[ "0.62587994", "0.6257954", "0.6158418", "0.611854", "0.5850872", "0.5789232", "0.57301605", "0.5726894", "0.5689514", "0.56304324", "0.5606485", "0.55892503", "0.5587287", "0.5586909", "0.55842507", "0.55598116", "0.5548544", "0.55409724", "0.5539264", "0.5536177", "0.5525244...
0.0
-1
Applies the thrust at the given angle.
public void setAngle(double angle) { this.angle = angle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void thrust() {\n // Offset the angle since we drew the ship vertically\n float angle = heading - PI/2;\n // Polar to cartesian for force vector!\n PVector force = new PVector(cos(angle),sin(angle));\n force.mult(5); // original shiffman code =.5\n applyForce(force); \n // To draw boost...
[ "0.68638223", "0.5970591", "0.5835872", "0.56565106", "0.56508434", "0.5650748", "0.55970585", "0.55818605", "0.5558879", "0.55038846", "0.55038846", "0.5502696", "0.54984105", "0.5490509", "0.54856807", "0.54193056", "0.54174453", "0.53727996", "0.524255", "0.5207883", "0.51...
0.46608463
60
Sets the acceleration of the thrust.
public void setAccelerationFlat(float acceleration) { this.acceleration = acceleration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setAcceleration(double acceleration) {\r\n this.acceleration = acceleration;\r\n }", "public static void setAcceleration(int acceleration) {\n leftMotor.setAcceleration(acceleration);\n rightMotor.setAcceleration(acceleration);\n }", "public void setAcceleration(Vector3d accelerati...
[ "0.7734886", "0.77017367", "0.75880873", "0.7403533", "0.73528415", "0.7215854", "0.7133372", "0.7019547", "0.6860256", "0.6817565", "0.6536592", "0.6443926", "0.63196325", "0.6289539", "0.62497026", "0.6235079", "0.6121529", "0.61029", "0.607867", "0.6065069", "0.605011", ...
0.65567034
10
Sets the max speed of the thrust.
public void setMaxSpeed(float max_speed) { this.max_speed = max_speed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setMaxSpeed() {\n\t\tspeed = MAX_SPEED;\n\t}", "public void setMaxSpeed(double maxSpeed) {\r\n this.maxSpeed = maxSpeed;\r\n }", "public void setMaxSpeed(double value) {\n super.setMaxSpeed(value);\n }", "public void setMaxSpeed(double speed){\n\t\tthis.speed = speed;\n\t}", ...
[ "0.8169642", "0.80951065", "0.7978068", "0.78632903", "0.7846965", "0.7832724", "0.75120467", "0.73921794", "0.729236", "0.7225815", "0.7188523", "0.7155996", "0.7040816", "0.7021992", "0.6795716", "0.6788269", "0.6756157", "0.6751477", "0.66594017", "0.6648319", "0.6613675",...
0.7933847
3
Will update the thrust depending on its active state.
public void update() { if (active) { // Increases speed to accelerate. if (speed < max_speed) speed += acceleration; if (speed > max_speed) speed = max_speed; } else { // Negates speed to slow down. if (speed > 0) speed = -speed; if (speed < 0) speed += acceleration; if (speed > 0) speed = 0; } // Sets the speed for thrust. host.momentum.addVelocity(new Displacement(speed * Math.cos(angle), speed * Math.sin(angle))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void updateActiveTime(int T);", "@Override\n public void update(float tpf) {\n super.update(tpf);\n\n updateTurn(tpf);\n updateBrakeAndAccelerate();\n\n SignalMode signalMode = getState(SignalMode.class);\n SignalTracker signalTracker = signalMode.getSignalTracker();\n ...
[ "0.62937915", "0.5961807", "0.5874641", "0.5870132", "0.58011425", "0.5772709", "0.571559", "0.5697082", "0.5604554", "0.5593363", "0.55645424", "0.55462146", "0.5541181", "0.554019", "0.55260843", "0.55007297", "0.54836464", "0.5461473", "0.5460007", "0.5458022", "0.5446585"...
0.6506353
0
Will toggle the activity of this thrust to the given parameter.
public void toggle(boolean active) { this.active = active; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void toggle(){\n isOn = !isOn;\n }", "void toggle();", "public abstract void toggle();", "public void toggle() {\n if (isOn()) {\n turnOff();\n } else {\n turnOn();\n }\n }", "@VisibleForTesting\n public void setActivity(int i) {\n T t = th...
[ "0.60212797", "0.59524196", "0.5921438", "0.5884899", "0.5862121", "0.58545405", "0.58062905", "0.58012444", "0.5796318", "0.57961607", "0.57803494", "0.5761307", "0.57423264", "0.5735587", "0.567365", "0.5670889", "0.5626753", "0.56254077", "0.56239134", "0.55778146", "0.557...
0.5568721
21
Create new TestHeadData object.
public Long newTestHeadData(@NotNull TestHeadData testHeadData) { Long id = null; Session session = SessionFactoryHelper.getOpenedSession(); try { session.beginTransaction(); session.save(testHeadData); //insert into table ! session.getTransaction().commit(); id = testHeadData.getId(); logger.info("TestHead record created successfully: {}", id); } catch (Exception e) { session.getTransaction().rollback(); logger.warn("TestHead record creation failure", e); } session.close(); return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HNode createHead(String name) throws InvalidTreeException;", "TH createTH();", "public PthTestContentsInfo() {\n }", "private void createTestData() {\n for (int i = startKey; i < startKey + numKeys; i++) {\n keys.add(i);\n }\n }", "TestEntity buildEntity () {\n ...
[ "0.5978877", "0.5731875", "0.56762224", "0.5655051", "0.5617368", "0.5515582", "0.5500103", "0.5484625", "0.54197025", "0.5402533", "0.5376851", "0.533711", "0.53232986", "0.5299074", "0.5292496", "0.52810377", "0.52695936", "0.5264437", "0.525343", "0.52410007", "0.5237844",...
0.6718821
0
Get (search for) a specific test head by specifying its head id.
public TestHead getTestHeadByHeadId(@NotNull final String headId) { Session session = SessionFactoryHelper.getOpenedSession(); session.beginTransaction(); String hql = "from TestHead as T where T.headId = :expectedName"; Query<TestHead> query = session.createQuery(hql, TestHead.class); query.setParameter("expectedName", headId); List<TestHead> result = query.list(); session.getTransaction().commit(); session.close(); return (TestHead) returnWithFirstItem(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@GetMapping(\"/operational-heads/{id}\")\n @Timed\n public ResponseEntity<OperationalHeadDTO> getOperationalHead(@PathVariable Long id) {\n log.debug(\"REST request to get OperationalHead : {}\", id);\n Optional<OperationalHeadDTO> operationalHeadDTO = operationalHeadService.findOne(id);\n ...
[ "0.59873444", "0.55444545", "0.54346853", "0.53328663", "0.5329925", "0.5268561", "0.5266249", "0.5261518", "0.52552646", "0.52549875", "0.5225244", "0.5207297", "0.5182181", "0.51794434", "0.5178543", "0.5130603", "0.5121259", "0.5104009", "0.50950086", "0.5079826", "0.50703...
0.8018811
0
Get full list of TestHead records.
public List<TestHead> getList() { List<TestHead> result; Session session = SessionFactoryHelper.getOpenedSession(); session.beginTransaction(); result = session.createQuery("from TestHead", TestHead.class).list(); session.getTransaction().commit(); session.close(); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Test> getAllRecord() {\n\t\tList<Test> lis=(List<Test>)testRepository.findAll();\n\t\treturn lis;\n\t}", "@Override\n\tpublic List<HeadUnit> getallHeadUnitDetail() {\n\t\tdatasource = getDataSource();\n\t\tjdbcTemplate = new JdbcTemplate(datasource);\n\t\tString sql = \"SELECT * FROM headunit\";\n\t\...
[ "0.6734691", "0.6713712", "0.62251437", "0.6092452", "0.5963417", "0.5862544", "0.57827", "0.57734954", "0.5731556", "0.5675134", "0.5664316", "0.55866754", "0.55637145", "0.55620074", "0.55264044", "0.55234075", "0.55207497", "0.54983556", "0.54897547", "0.5476579", "0.54573...
0.76972693
0
LLAMO AL DIALOGO REDES DESDE EL FRAGMENT EQUIPO
@Override public void OnSelecterEquipoDetalle(Equipo equipo) { DialogoRedes dialogoRedes = DialogoRedes.newInstance(equipo); dialogoRedes.show(getSupportFragmentManager(),"key3"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void Relatorio() throws Exception \r\n {//Inicio menuRelatorio\r\n byte opcao;\r\n boolean fecharMenu = false;\r\n int idCliente, idProduto, quant;\r\n Produto p = null;\r\n Cliente c = null;\r\n do{\r\n System.out.println(\r\n ...
[ "0.6227435", "0.6187185", "0.59650666", "0.5952506", "0.5893686", "0.5879195", "0.5873469", "0.586346", "0.5828678", "0.5818959", "0.5813078", "0.5812578", "0.58077997", "0.5806649", "0.5800689", "0.57935536", "0.57899636", "0.5788339", "0.5775716", "0.5752393", "0.5745508", ...
0.62946707
0
MANDO AL FRAGMENT FAVORITO EL EQUIPO SELECCIONADO
@Override public void OnSelecterEquipoFavorito(Equipo equipo) { FragmentFavoritos fragment = (FragmentFavoritos) getSupportFragmentManager().findFragmentByTag("list"); String equipoNombre = equipo.getNombre(); DatabaseReference databaseReferenceEscritura = firebaseDatabase.getReference().child("usuarios").child(nombre); databaseReferenceEscritura.child("equipos").child("favoritos").child(equipoNombre).setValue(equipo); //SE MANDA AL SERVIDOR EL EQUIPO SELECCIONADO DatabaseReference databaseRefeceTodos = firebaseDatabase.getReference().child("usuarios").child(nombre).child("equipos").child("favoritos"); databaseRefeceTodos.get().addOnCompleteListener(new OnCompleteListener<DataSnapshot>() { @Override public void onComplete(@NonNull Task<DataSnapshot> task) { DataSnapshot dataSnapshot = task.getResult(); Iterator<DataSnapshot> iterator = dataSnapshot.getChildren().iterator(); while (iterator.hasNext()){ //DataSnapshot hijo = iterator.next(); //Usuario usuario = hijo.getValue(Usuario.class); Equipo favorito1 = iterator.next().getValue(Equipo.class); if(favorito1.getNombre().equals(equipo.getNombre())) { fragment.addEquipo(favorito1); } } } }); /*FragmentFavoritos fragment = (FragmentFavoritos) getSupportFragmentManager().findFragmentByTag("list"); fragment.addEquipo(equipo);*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IFilialAux vendaToFilial();", "public IFatura vendaToFatura();", "@Override\n public void affiche(){\n System.out.println(\"Loup : \\n points de vie : \"+this.ptVie+\"\\n pourcentage d'attaque : \"+this.pourcentageAtt+\n \"\\n dégâts d'attaque : \"+this.degAtt+\...
[ "0.59406435", "0.5854837", "0.5833951", "0.5772585", "0.57137084", "0.5704301", "0.56940526", "0.5662006", "0.5572058", "0.5538012", "0.55118084", "0.5469321", "0.5459712", "0.544353", "0.54349804", "0.5432246", "0.5426745", "0.54235077", "0.5414698", "0.54119563", "0.5411329...
0.0
-1
ELIMINA EL EL EQUIPO SELECCIONADO
@Override public void onEquipoFavoritosSelected(Equipo equipos) { DatabaseReference databa = firebaseDatabase.getReference().child("usuarios").child(nombre).child("equipos").child("favoritos").child(equipos.getNombre()); databa.get().addOnCompleteListener(new OnCompleteListener<DataSnapshot>() { @Override public void onComplete(@NonNull Task<DataSnapshot> task) { Equipo equipo = task.getResult().getValue(Equipo.class); if(equipo.getNombre().equals(equipos.getNombre())){ FragmentFavoritos fragments = (FragmentFavoritos) getSupportFragmentManager().findFragmentByTag("list"); databa.setValue(null); Toast.makeText(getApplicationContext(),"borro",Toast.LENGTH_SHORT).show(); fragments.eliminaEquipo(equipos); } } }); /*FragmentFavoritos fragment = (FragmentFavoritos) getSupportFragmentManager().findFragmentByTag("list"); fragment.eliminaEquipo(equipos);*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEquipo(Equipo Equipo) {\n this.equipo = Equipo;\n }", "public Equipo getEquipo() {\n return equipo;\n }", "@Override\r\n\tpublic Equipo mostrar() {\n\t\tLOG.info(\"Mostrar datos del equipo\");\r\n\t\treturn equipo;\r\n\t}", "@Override\r\n\tpublic Equipo mostrar() {\n\t\tLOG...
[ "0.6824366", "0.6709021", "0.6642817", "0.6608688", "0.6566322", "0.6508392", "0.6478251", "0.64330006", "0.6335393", "0.6297571", "0.62392193", "0.6235941", "0.6215516", "0.62101424", "0.6165225", "0.61641705", "0.6158579", "0.6139972", "0.6103519", "0.61012", "0.6095418", ...
0.0
-1
Start typing your Java solution below DO NOT write main() function
public String intToRoman(int num) { StringBuilder ans = new StringBuilder(""); char a[][] ={ {'I','V','X'}, {'X','L','C'}, {'C','D','M'}, {'M','M','M'}}; int threshold = 1000; for(int i=3;i>=0;i--){ if(num>=threshold){ int k = num/threshold; num -= k*threshold; if(k==0){ } else if(k==9){ ans.append(a[i][0]); ans.append(a[i][2]); }else if(k<=3){ for(int j=0;j<k;j++){ ans.append(a[i][0]); } }else if(k==4){ ans.append(a[i][0]); ans.append(a[i][1]); }else if(k<=8){ ans.append(a[i][1]); for(int j=0;j<k-5;j++){ ans.append(a[i][0]); } } } threshold /=10; } return ans.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main() {\n \n }", "public static void main(String[] args) {\n\n Solution2.solution();\n }", "public static void main(String[] args) {\n // write your code here - this is called comment and it always starts with double slash\n // and comlier will ignore this ...
[ "0.7085202", "0.70152825", "0.70048785", "0.6863522", "0.68364745", "0.682089", "0.68138087", "0.6797307", "0.6784227", "0.6755715", "0.6755715", "0.6755715", "0.6755715", "0.6755715", "0.6755715", "0.67436904", "0.67295706", "0.67241466", "0.6723099", "0.66999674", "0.668805...
0.0
-1
Returns the value of the 'XAxis Label' attribute.
String getXAxisLabel();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getxLabel() {\n return xLabel;\n }", "public String getValueAxisLabel() {\n return this.valueAxisLabel;\n }", "public Object getXaxisLabels() {\r\n if (xaxisLabels != null) {\r\n return xaxisLabels;\r\n }\r\n ValueBinding vb = getValueBinding(\"...
[ "0.76940423", "0.73557204", "0.71181744", "0.6916718", "0.6845731", "0.68293864", "0.68227446", "0.68015516", "0.66016495", "0.6566513", "0.6545991", "0.6541105", "0.64933723", "0.64750445", "0.6473725", "0.6473725", "0.6473725", "0.6473725", "0.6470677", "0.6469006", "0.6469...
0.7856595
0
Returns the value of the 'YAxis Label' attribute.
String getYAxisLabel();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getyLabel() {\n return yLabel;\n }", "public void setYAxisLabel(String yAxisLabel){\n yAxisName = yAxisLabel;\n }", "public String getYAxisTitle() {\n return yAxisTitle;\n }", "private float getYAxisLabelHeight() {\n return ViewUtils.getTextHeight(mYAxisTextPaint, PERCE...
[ "0.82140696", "0.7336486", "0.7318841", "0.73043543", "0.7165974", "0.7160352", "0.7066217", "0.6995024", "0.6986203", "0.69840336", "0.6803489", "0.6791523", "0.6746583", "0.6678546", "0.66239315", "0.6500413", "0.64037496", "0.6354122", "0.6352276", "0.6312248", "0.62975675...
0.8230109
0
Validate input with regular expression
public boolean validate(final String input){ matcher = pattern.matcher(input); return matcher.matches(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "default Boolean validateInput(String input){\n if (input.contains(\"(\") || input.contains(\")\") || input.contains(\"[\") || input.contains(\"}\") || input.contains(\"{\") || input.contains(\"}\") )\n {\n return true;\n }else{\n return false;\n }\n }", "p...
[ "0.6793505", "0.6770881", "0.67291373", "0.6667843", "0.664466", "0.6559807", "0.6544479", "0.6393", "0.63818693", "0.6378078", "0.63586843", "0.6344418", "0.6316325", "0.6296572", "0.62914526", "0.6289342", "0.6262443", "0.6261852", "0.6241308", "0.62411946", "0.6220313", ...
0.7303389
0
This method simulate login with specified user name and password
public String login(String username, String password) { UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken( username, password); Authentication authentication = authenticationManager.authenticate(token); SecurityContextHolder.getContext().setAuthentication(authentication); UserDetails details = userDetailsService.loadUserByUsername(username); return tokenUtils.generateToken(details); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void login(String user, String password);", "public abstract void login(String userName, String password) throws RemoteException;", "private void login(String username,String password){\n\n }", "String login(String userName, String password) throws RemoteException, InterruptedException;", "public User l...
[ "0.8153239", "0.7976775", "0.78624237", "0.7793189", "0.7769307", "0.76334727", "0.76046413", "0.7579212", "0.75756544", "0.7518252", "0.7500287", "0.74796695", "0.7416", "0.7415287", "0.7396401", "0.7364944", "0.7362587", "0.7352271", "0.731876", "0.7314149", "0.73074484", ...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Program1 p=new Program1(); Program1 p1= new Program1(); System.out.println("sdsad"); }
{ "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.66713095", "0.6567948", "0.652319", "0.648097", "0.64770466", "0.64586824", "0.64132667", "0.6376419", "0.62759", "0.62545097", "0.62371093", "0.62237984", "0.6201738", "0.619477", "0.619477", "0.61924416", "0.61872935", "0.6173417", "0.613289", "0.6127952", "0.6080854", ...
0.0
-1
null safe for jsp :)
public static String format(Endereco endereco) { if(endereco != null) { return endereco.getLogradouro() + (endereco.getComplemento() != null ? " - " + endereco.getComplemento() : "") + ", " + endereco.getNumero() + " - " + endereco.getBairro() + " (" + endereco.getCidade().getNome() + "/" + endereco.getCidade().getEstado().getNome() + ")"; } return Constants.TEXT_EMPTY; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract String evalDefault() throws JspException;", "public static String fomatStrForJsp(String str){\t\t\n\t\tif( str==null || str.trim().equals(\"\")) return \"&nbsp;\";\n\t\treturn str;\n\t}", "@Override\r\n\tpublic int doEndTag() throws JspException {\n\t\treturn 0;\r\n\t}", "public String get...
[ "0.64776975", "0.6197702", "0.61193526", "0.6069308", "0.59693086", "0.59170705", "0.58822215", "0.5849142", "0.5834581", "0.580635", "0.5757433", "0.57436883", "0.5685699", "0.5684832", "0.56816953", "0.56803787", "0.562422", "0.56063974", "0.55909497", "0.55707973", "0.5565...
0.0
-1
Recurse to the top of the tree and then perform a depthfirst search.
private boolean contains(Bundle bundle, ScopeUpdateImpl scopeUpdate) { return parent == null ? contains0(bundle, scopeUpdate) : parent.contains(bundle, scopeUpdate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void depthFirstSearch(){\n\t\tStack<TreeNode<T>> nodeStack = new Stack<TreeNode<T>>();\n\n\t\tif(root!=null){\n\t\t\tnodeStack.push(root);\n\t\t\tSystem.out.println(root.data);\n\t\t\tTreeNode<T> topNode = root;\n\t\t\twhile(!nodeStack.isEmpty()){\n\t\t\t\tif(topNode.left!=null){\n\t\t\t\t\tnodeStack.push(t...
[ "0.7725169", "0.70337325", "0.6829189", "0.67065924", "0.6341245", "0.6293579", "0.6291936", "0.6250248", "0.62253493", "0.61815214", "0.6178338", "0.617058", "0.6142182", "0.6098661", "0.6066666", "0.5951961", "0.5940732", "0.5914695", "0.58776605", "0.5862752", "0.5861539",...
0.0
-1
Getter method for the current tile of a grid item
TileItem getCurrentTile();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tile getTile(){\n\t\treturn currentTile;\n\t}", "public Tile getTile() { return tile; }", "public Tile getTile() {\n return _tile;\n }", "public Tile getTile() {\n\t\treturn tile;\n\t}", "public Tile getTile() {\n return tile;\n }", "public Tile getTile() {\n return tile;\n...
[ "0.7741681", "0.74361837", "0.7322838", "0.72618806", "0.712942", "0.712942", "0.6934251", "0.687303", "0.6834623", "0.6829074", "0.6828118", "0.6794861", "0.6740248", "0.6701343", "0.6650392", "0.6627692", "0.66238374", "0.6610371", "0.65555805", "0.652042", "0.6503362", "...
0.83542067
0
validate username and password
public void loginBtnHandler(ActionEvent actionEvent)throws Exception { String userName = tfUserName.getText().trim().toLowerCase(); String passWord = tfPassword.getText().trim().toLowerCase(); boolean validInput = false; //check if username and password are valid for (int i=0; i< login.length; i++){ if (userName.equals(login[i][0]) && passWord.equals(login[i][1])){ validInput = true; break; } } if (validInput == true){ Stage stage = new Stage(); Parent root = FXMLLoader.load(getClass().getResource("ProductOverView.fxml")); stage.setTitle("Main Screen"); Scene scene = new Scene (root); stage.setScene(scene); stage.show(); ((Stage) ((Button) actionEvent.getSource()).getScene().getWindow()).close(); } else { JOptionPane.showMessageDialog(null, String.format("Your user name or password is wrong.\n" + " Please enter a valid user name and password"), "ERROR", JOptionPane.ERROR_MESSAGE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean validateUserAndPassword(String username, String password);", "Boolean isValidUserPassword(String username, String password);", "private boolean validate(String username, String password) {\n\t\tif(username.equals(\"Venkat\") && password.equals(\"kumar\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse {\...
[ "0.87622976", "0.83012426", "0.798466", "0.7859837", "0.78433764", "0.78370017", "0.75285935", "0.74732614", "0.746247", "0.743893", "0.73437613", "0.73141474", "0.73110455", "0.7284263", "0.72610545", "0.72262096", "0.7225763", "0.72228444", "0.72132933", "0.7198534", "0.719...
0.0
-1
make the scene bigger when SAIGON is clicked
public void handlerSaiGon(ActionEvent actionEvent) { loginPane.getScene().getWindow().setWidth(loginPane.getScene().getWindow().getWidth() +100); loginPane.getScene().getWindow().setHeight(loginPane.getScene().getWindow().getHeight() + 50); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void changeSize()\n {\n //if mouse is on the play button, make it bigger\n if(Greenfoot.mouseMoved(this))\n setImage(\"play button bigger.png\");\n //if mouse is on the background, return play button to regular size\n else if(Greenfoot.mouseMoved(getWorld()))\n ...
[ "0.7095779", "0.67583454", "0.6494947", "0.63720876", "0.6340431", "0.6278398", "0.62191385", "0.6206311", "0.6138047", "0.6137816", "0.61091244", "0.60385764", "0.6026346", "0.6015575", "0.60058063", "0.599202", "0.5954414", "0.59379685", "0.5932623", "0.5906955", "0.5880161...
0.6216362
7
/ Must be implemented by host activity
public interface OnLoadMapListener { public void onLoadMapSelected(String mapFilePath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void onFirstUse() {}", "@Override\n\tprotected void onHandleIntent(Intent arg0) {\n\t\t\n\t}", "@Override\n\tpublic void starctActivity(Context context) {\n\t\t\n\t}", "@Override\n\tprotected void onHandleIntent(Intent intent) {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", ...
[ "0.6582777", "0.63537157", "0.63253665", "0.6320382", "0.6281217", "0.6243714", "0.6197916", "0.6183697", "0.61719275", "0.6159505", "0.61585987", "0.614174", "0.61396563", "0.6131402", "0.61197835", "0.6119636", "0.60985506", "0.60984373", "0.6090003", "0.6070518", "0.606173...
0.0
-1
return a value in [0, 1] return 0.6 means there are 60% time left
public float getRemainingPercentage() { float percentage = (float) getRemainingTime() / this.duration; if (Float.isNaN(percentage)) { percentage = 1; } return Math.min(Math.max(0, percentage), 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static float tock(){\n\t\treturn (System.currentTimeMillis() - startTime);\n\t}", "public float getIterationValue()\n\t{\n\t\tif (getDuration() <= 0) { return 1; }\n\t\treturn getCurrentTime() / getDuration();\n\t}", "public double getSlowToFire();", "int getMPPerSecond();", "public void checkRegSc...
[ "0.6624987", "0.64778167", "0.6387369", "0.6387165", "0.6369874", "0.6294325", "0.625903", "0.62010384", "0.6191999", "0.616912", "0.6158678", "0.61553377", "0.6123937", "0.609987", "0.60631925", "0.6035806", "0.6029616", "0.5987285", "0.59776753", "0.59632164", "0.59437954",...
0.0
-1
return after how many second times out
public long getRemainingTime() { if (isPaused()) { return pausedPoint; } long res = (long) ((spedEndTime - SystemClock.elapsedRealtime()) * speed); return res > 0 ? res : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void timePassed(double dt) {\r\n return;\r\n }", "public void timePassed() {\nreturn;\n}", "public void timePassed() { }", "void countdownResult(long l);", "@Override\r\n public void timePassed() {\r\n }", "public void timePassed() {\r\n }", "public void timeP...
[ "0.6686251", "0.6598073", "0.65630114", "0.6520669", "0.65120876", "0.6456643", "0.6456643", "0.6449306", "0.6409778", "0.6388275", "0.6363659", "0.63239545", "0.6315472", "0.6315472", "0.62884605", "0.6280909", "0.6249835", "0.6249835", "0.6247902", "0.62257934", "0.6213478"...
0.0
-1
/ funckija naslednji clen vrne naslednje stevilo v Collatzovem zaporedja
public static int naslednjiClen(int n) { if(n == 1) { return(1); }else { if(n % 2== 0) { return(n/2); }else { return(3*n +1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String vylozZvieraZVozidla() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz index zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n ...
[ "0.6748047", "0.63947064", "0.63758993", "0.63444483", "0.61821264", "0.61768067", "0.6162043", "0.61602986", "0.60786504", "0.5947122", "0.5932566", "0.5922854", "0.5910548", "0.59045255", "0.58670014", "0.5845691", "0.583159", "0.58240855", "0.58232355", "0.5822101", "0.580...
0.0
-1
/ funkcija dolzina vrne dolzino Collatzovega zaporedja, ki se zacne s stevilom n
public static int dolzina(int n) { int dolzina = 1; while(n != 1) { n = naslednjiClen(n); dolzina = dolzina + 1; } return(dolzina); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void ustawPojazdNaPoczatek()\n\t{\n\t\tSciezka pierwszaSc = droga.get(0);\n\t\tfinal double y = 10;\n\t\tpojazd.zmienPozycje(pierwszaSc.getCenterDownX(), y);\n\t}", "public void dodajZmijuPocetak() {\n\t\tthis.zmija.add(new Cvor(1,4));\n\t\tthis.zmija.add(new Cvor(1,3));\n\t\tthis.zmija.add(new Cvor(1,2))...
[ "0.6762529", "0.65869045", "0.6423361", "0.6278609", "0.6178526", "0.61723095", "0.6156399", "0.61038727", "0.6057569", "0.6047543", "0.6032939", "0.60030305", "0.5998923", "0.5925307", "0.591667", "0.5873329", "0.5869891", "0.5869505", "0.5848728", "0.5842486", "0.583198", ...
0.0
-1
/ funkcija collatz izpise vse clene Collatzovega zaporedja, ki se zacnjejo s stevilom n
public static void collatz(int n) { System.out.println(n); while(n != 1) { n = naslednjiClen(n); System.out.println(n); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public char controlloVerticale(char[][] scacchiera)\n {\n for (int w=0;w<3;w++)\n {\n if (scacchiera[0][w]==scacchiera[1][w]&&scacchiera[1][w]==scacchiera[2][w]) return scacchiera[0][w];\n }\n return ' ';\n }", "private void colidiuBloco(Bloco[] linhaBloco) {\n\n\t\tf...
[ "0.6358338", "0.63559866", "0.6128296", "0.60524374", "0.6052074", "0.58775485", "0.58552766", "0.57819575", "0.5770609", "0.57526076", "0.5752042", "0.5661885", "0.56445736", "0.5588665", "0.5573256", "0.5563569", "0.55502063", "0.553821", "0.54790956", "0.5466951", "0.54666...
0.58825123
5
Created by asus on 2017/5/21.
public interface UpdatePlaceAddressPresenter { void updatePlaceAddress(String areaName, String detailAreaName, String objectId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void mo51373a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpubl...
[ "0.61386454", "0.60281855", "0.59110403", "0.5811875", "0.5809622", "0.5809412", "0.5809412", "0.57622135", "0.56928843", "0.5682171", "0.56752187", "0.5673102", "0.5668242", "0.56607383", "0.56504714", "0.5641165", "0.56364906", "0.56159616", "0.5600729", "0.55972165", "0.55...
0.0
-1
Granite GameRegistry.addRecipe(MobDropsHandler.test, "XY ", " ", " ", 'X', ModItems.prismarine_crystals, 'Y', Item.getItemById(406)); /GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " XY", " ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", "XY ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", " XY", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", " ", "XY ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", " ", " XY", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), "YX ", " ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " YX", " ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", "YX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", " YX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", " ", "YX ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 1, 1), " ", " ", " YX", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(406)); Polished Granite GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 2), "XX ", "XX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 1)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 2), " XX", " XX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 1)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 2), " ", "XX ", "XX ", 'X', new ItemStack(ModBlocks.stone, 1, 1)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 2), " ", " XX", " XX", 'X', new ItemStack(ModBlocks.stone, 1, 1)); Diorite GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), "XY ", "YX ", " ", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), " XY", " YX", " ", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), "YX ", "XY ", " ", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), " YX", " XY", " ", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), " ", "XY ", "YX ", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), " ", " XY", " YX", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), " ", "YX ", "XY ", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 3), " ", " YX", " XY", 'X', Item.getItemById(4), 'Y', Item.getItemById(13)); Polished Diorite GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 4), "XX ", "XX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 4), " XX", " XX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 4), " ", "XX ", "XX ", 'X', new ItemStack(ModBlocks.stone, 1, 3)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 4), " ", " XX", " XX", 'X', new ItemStack(ModBlocks.stone, 1, 3)); Andesite GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), "XY ", " ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " XY", " ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", "XY ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", " XY", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", " ", "XY ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", " ", " XY", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), "YX ", " ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " YX", " ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", "YX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", " YX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", " ", "YX ", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 2, 5), " ", " ", " YX", 'X', new ItemStack(ModBlocks.stone, 1, 3), 'Y', Item.getItemById(4)); Polished Andesite GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 6), "XX ", "XX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 5)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 6), " XX", " XX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 5)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 6), " ", "XX ", "XX ", 'X', new ItemStack(ModBlocks.stone, 1, 5)); GameRegistry.addRecipe(new ItemStack(ModBlocks.stone, 4, 6), " ", " XX", " XX", 'X', new ItemStack(ModBlocks.stone, 1, 5)); Stone Bricks GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), "XX ", "XX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 4)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " XX", " XX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 4)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " ", "XX ", "XX ", 'X', new ItemStack(ModBlocks.stone, 1, 4)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " ", " XX", " XX", 'X', new ItemStack(ModBlocks.stone, 1, 4)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), "XX ", "XX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 6)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " XX", " XX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 6)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " ", "XX ", "XX ", 'X', new ItemStack(ModBlocks.stone, 1, 6)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " ", " XX", " XX", 'X', new ItemStack(ModBlocks.stone, 1, 6)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), "XX ", "XX ", " ", 'X', new ItemStack(ModBlocks.stone, 1, 2)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " XX", " XX", " ", 'X', new ItemStack(ModBlocks.stone, 1, 2)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " ", "XX ", "XX ", 'X', new ItemStack(ModBlocks.stone, 1, 2)); GameRegistry.addRecipe(new ItemStack(Block.getBlockById(98), 4), " ", " XX", " XX", 'X', new ItemStack(ModBlocks.stone, 1, 2)); Coarse Dirt /GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), "XY ", " ", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " XY", " ", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", "XY ", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", " XY", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", " ", "XY ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", " ", " XY", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), "YX ", " ", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " YX", " ", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", "YX ", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", " YX", " ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", " ", "YX ", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); GameRegistry.addRecipe(new ItemStack(ModBlocks.coarse_dirt), " ", " ", " YX", 'X', Block.getBlockById(3), 'Y', Item.getItemById(13)); Sea Lantern
public static void init () { GameRegistry.addRecipe(new ItemStack(ModBlocks.sea_lantern), "XYX", "YYY", "XYX", 'X', ModItems.prismarine_shard, 'Y', ModItems.prismarine_crystals); //Prismarine GameRegistry.addRecipe(new ItemStack(ModBlocks.prismarine, 1, 0), " ", "XX ", "XX ", 'X', ModItems.prismarine_shard); //Prismarine Bricks GameRegistry.addRecipe(new ItemStack(ModBlocks.prismarine, 1, 1), "XXX", "XXX", "XXX", 'X', ModItems.prismarine_shard); //Dark Prismarine GameRegistry.addRecipe(new ItemStack(ModBlocks.prismarine, 1, 2), "XXX", "XYX", "XXX", 'X', ModItems.prismarine_shard, 'Y', Item.getItemById(351)); //Cooked mutton GameRegistry.addSmelting(new ItemStack(ModItems.mutton_raw), new ItemStack(ModItems.mutton_cooked), 0.35f); //Iron trapdoor GameRegistry.addRecipe(new ItemStack(ModBlocks.iron_trapdoor), "XX ", "XX ", " ", 'X', Blocks.iron_bars); GameRegistry.addRecipe(new ItemStack(ModBlocks.iron_trapdoor), " XX", " XX", " ", 'X', Blocks.iron_bars); GameRegistry.addRecipe(new ItemStack(ModBlocks.iron_trapdoor), " ", "XX ", "XX ", 'X', Blocks.iron_bars); GameRegistry.addRecipe(new ItemStack(ModBlocks.iron_trapdoor), " ", " XX", " XX", 'X', Blocks.iron_bars); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void reci(){\n\n GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(generatorBase, 1),\"XXX\", \"XXX\", \"XXX\", 'X', ItemHandler.ironHard));\n GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(generatorCombust, 1), \"XYX\", \"DFD\", \"XXX\", 'X', generatorBase, 'Y', \"gemD...
[ "0.8319666", "0.78970635", "0.78916574", "0.7805263", "0.77531946", "0.7465672", "0.72869486", "0.72801703", "0.7120566", "0.711362", "0.70881796", "0.70363796", "0.703029", "0.69139844", "0.69072443", "0.6888919", "0.64922833", "0.6478399", "0.64566654", "0.6413078", "0.6410...
0.7857969
3
Attempts to read an image file using ImageIO and return the data in a TextureLoader.Texture object.
public static Texture readTexture(String filename) throws IOException { BufferedImage img = ImageIO.read( TextureLoader.getResourceAsStream(filename) ); if( img != null ) return readTexture(img); else return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TextureAtlas.AtlasRegion getTexture(FileHandle textureFile);", "public static Texture readTexture(BufferedImage img) {\n\t\tint bytesPerPixel = -1, pix;\n\t\t\n\t\t// 3 or 4 bytes per pixel?\n\t\tif( img.getColorModel().hasAlpha() )\n\t\t\tbytesPerPixel = 4;\n\t\telse\n\t\t\tbytesPerPixel = 3;\n\t\n\t\t// Alloca...
[ "0.6711119", "0.67109895", "0.6586851", "0.6518552", "0.644014", "0.6413931", "0.6314479", "0.62969255", "0.62691575", "0.60941815", "0.60911137", "0.6078019", "0.60679966", "0.6048994", "0.60460097", "0.60456043", "0.59965634", "0.5952266", "0.5930317", "0.5902932", "0.58889...
0.6859287
0
Attempts to read an image from an InputStream and return the data in a TextureLoader.Texture object.
public static Texture readTexture( InputStream str ) throws IOException { return readTexture( ImageIO.read(str) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Texture getTexture(InputStream in, String resourceName, boolean flipped, int filter) throws IOException {\n/* 200 */ return getTexture(in, resourceName, flipped, filter, null);\n/* */ }", "public static com.jme.image.Image loadImage(InputStream fis) throws\n IOException {\n return lo...
[ "0.6385115", "0.6313579", "0.61404175", "0.6064561", "0.5952927", "0.59210354", "0.58923084", "0.58573955", "0.58456874", "0.5794314", "0.57377064", "0.57207286", "0.5630764", "0.56189793", "0.55537695", "0.55478257", "0.5509931", "0.5474113", "0.5471787", "0.5458754", "0.545...
0.7174165
0
Attempts to find the file as a jar resource. If not found, tries to open the file from the system. Returns an InputStream for the file.
private static InputStream getResourceAsStream(final String filename) throws IOException { // Try to load resource from jar InputStream stream = TextureLoader.class.getResourceAsStream(filename); // If not found in jar, then load from disk if (stream == null) { return new BufferedInputStream( new FileInputStream(filename) ); } else { return stream; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static InputStream getInputStream(String resource) throws URISyntaxException, IOException {\r\n\t\tString projectDirectory = DirectoryUtils.getProjectDirectory();\r\n\t\tURL url = DirectoryUtils.class.getClassLoader().getResource(resource);\r\n\r\n\t\t/**\r\n\t\t * Rank 1: Local resources path.\r\n\t\t */\r...
[ "0.68895674", "0.6877384", "0.6747671", "0.6677492", "0.65189034", "0.6501549", "0.6498805", "0.64026886", "0.63926196", "0.62715185", "0.6252574", "0.6170458", "0.6170166", "0.6121372", "0.61046416", "0.6043099", "0.599413", "0.5974178", "0.5972647", "0.59718955", "0.5952422...
0.6921548
0
Reads the pixels from the BufferedImage and stores them in a ByteBuffer within a TextureLoader.Texture object. The data is stored in the ByteBuffer as RGBA bytes.
public static Texture readTexture(BufferedImage img) { int bytesPerPixel = -1, pix; // 3 or 4 bytes per pixel? if( img.getColorModel().hasAlpha() ) bytesPerPixel = 4; else bytesPerPixel = 3; // Allocate a ByteBuffer ByteBuffer unpackedPixels = ByteBuffer.allocateDirect(img.getWidth() * img.getHeight() * bytesPerPixel); // Pack the pixels into the ByteBuffer in RGBA, 4 byte format. for(int row = img.getHeight() - 1; row >= 0; row--) { for (int col = 0; col < img.getWidth(); col++) { pix = img.getRGB(col,row); // Should return the pixel in format TYPE_INT_ARGB unpackedPixels.put((byte) ((pix >> 16) & 0xFF)); // red unpackedPixels.put((byte) ((pix >> 8 ) & 0xFF)); // green unpackedPixels.put((byte) ((pix ) & 0xFF)); // blue if (bytesPerPixel == 4) { unpackedPixels.put((byte) ((pix >> 24) & 0xFF)); // alpha } } } if(bytesPerPixel == 4 ) { return new Texture(unpackedPixels,img.getWidth(), img.getHeight(), Texture.TEXTURE_4BYTE_RGBA); } else { return new Texture(unpackedPixels,img.getWidth(), img.getHeight(), Texture.TEXTURE_3BYTE_RGB); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IntBuffer getData(BufferedImage img)\n\t{\n\t\tIntBuffer buf = IntBuffer.allocate(img.getWidth()*img.getHeight());\n\t\t//ByteBuffer b = ByteBuffer.allocate(buf.capacity()*4);\n\n\t\tfor(int i=0; i<img.getHeight(); i++)\n\t\t{\n\t\t\tfor(int j=0; j<img.getWidth(); j++)\n\t\t\t{\n\t\t\t\t// We need to shuffl...
[ "0.62010735", "0.6046024", "0.60072255", "0.5841934", "0.58157915", "0.57469004", "0.56986207", "0.55032486", "0.54503775", "0.5420045", "0.54159844", "0.54096985", "0.5360386", "0.5354627", "0.5294339", "0.51310325", "0.5116171", "0.5115572", "0.50827473", "0.507464", "0.506...
0.637027
0
Data storage type Creates a new Texture with the given data.
public Texture(ByteBuffer pixels, int width, int height, int type) { this.height = height; this.pixels = pixels; this.width = width; this.type = type; this.pixels.rewind(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Texture() {\n }", "public Texture createTexture(int width, int height, int filter) throws IOException {\n/* 372 */ ImageData ds = new EmptyImageData(width, height);\n/* */ \n/* 374 */ return getTexture(ds, filter);\n/* */ }", "public Object create( DataWrapper data) {\...
[ "0.62227714", "0.6167015", "0.6137788", "0.58789825", "0.58332366", "0.5803158", "0.57790893", "0.57119215", "0.5632834", "0.56054133", "0.54969245", "0.5487154", "0.5478105", "0.54482263", "0.5446187", "0.5420597", "0.5420122", "0.54192454", "0.5412864", "0.5391821", "0.5377...
0.5583952
10
Returns the storage type of this Texture
public int getType() { return type; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public short getStorageType() {\n\treturn storageType;\n }", "public StorageTargetType targetType() {\n return this.targetType;\n }", "@Override\n\tpublic String getTexture() {\n\t\treturn type.getTextureString();\n\t}", "public Storage getStorage() {\n return this.storage;\n }", "pu...
[ "0.7095327", "0.66306406", "0.64922345", "0.63804483", "0.6288687", "0.6171135", "0.6171135", "0.6140922", "0.6080562", "0.6051311", "0.60335964", "0.6032943", "0.60252273", "0.60047513", "0.6001086", "0.59901667", "0.5942481", "0.593025", "0.591925", "0.5894864", "0.5845027"...
0.0
-1
Returns the height of this texture.
public int getHeight() { return height; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getTextureHeight() {\r\n\t\treturn textureHeight;\r\n\t}", "@Basic\n\tpublic int getHeight() {\n\t\treturn getCurrentSprite().getHeight();\n\t}", "public int getHeight()\n\t{\n\t\treturn this._height;\n\t}", "@Field(3) \n\tpublic int height() {\n\t\treturn this.io.getIntField(this, 3);\n\t}", ...
[ "0.84287757", "0.7863419", "0.76544756", "0.7645088", "0.7609985", "0.76074743", "0.760495", "0.7600748", "0.7599651", "0.759267", "0.7580741", "0.7580741", "0.7580741", "0.7580741", "0.7580741", "0.7580741", "0.7580741", "0.7580741", "0.7580741", "0.7580741", "0.7580741", ...
0.7607606
5
Returns the pixel data for this texture.
public ByteBuffer getPixels() { return pixels; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float[] getData()\n {\n return this.pixels;\n }", "public ImageData getImageData() {\n\t\treturn this.data.getImageData();\n\t}", "public float[] getTextureCoords() {\r\n\t\treturn textureCoords;\r\n\t}", "public ByteBuffer getTextureCoordsBuffer() {\n return texCoordsBuf;\n }",...
[ "0.7482659", "0.7136657", "0.6796734", "0.6607979", "0.6592848", "0.6489398", "0.6481908", "0.64512354", "0.63287145", "0.63193643", "0.6213305", "0.6182322", "0.6177293", "0.61473966", "0.6135589", "0.6121174", "0.610422", "0.6036868", "0.601405", "0.5985871", "0.59847623", ...
0.6237369
10
Returns the width of this texture.
public int getWidth() { return width; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public float getTextureWidth() {\r\n\t\treturn textureWidth;\r\n\t}", "@Basic\n\tpublic int getWidth() {\n\t\treturn getCurrentSprite().getWidth();\n\t}", "public int width() {\n return picture().width();\n }", "public int getSpriteWidth() {\n return this.spriteWidth;\n }", "public int getWid...
[ "0.8483859", "0.777318", "0.7578602", "0.7471306", "0.746223", "0.74242896", "0.73927706", "0.7381593", "0.73812735", "0.73777425", "0.7359139", "0.7359139", "0.73555297", "0.7354837", "0.7333597", "0.7318942", "0.7305547", "0.73051", "0.730467", "0.72960985", "0.7290294", ...
0.7287941
29
Loads the texture object into the given OpenGL context. Optionally builds mipmaps and sets the mag filter to linear and the min filter to GL_LINEAR or GL_LINEAR_MIPMAP_NEAREST (depending on mipmap).
public int toGL( GL gl, GLU glu, boolean mipmap ) { // Generate the texture ID int[] temp = new int[1]; int name; gl.glGenTextures(1, temp, 0); name = temp[0]; gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); // Bind the texture gl.glBindTexture( GL.GL_TEXTURE_2D, name ); // Build Mipmaps if( mipmap ) { switch(this.type) { case TEXTURE_3BYTE_RGB: glu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, GL.GL_RGB8, this.width, this.height, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, this.pixels ); break; case TEXTURE_4BYTE_RGBA: glu.gluBuild2DMipmaps(GL.GL_TEXTURE_2D, GL.GL_RGBA, this.width, this.height, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, this.pixels ); break; default: throw new RuntimeException("Unknown texture type: " + this.type); } // Assign the mip map levels and texture info gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR ); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_NEAREST); gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE); } else { switch(this.type) { case TEXTURE_3BYTE_RGB: gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGB, this.width, this.height, 0, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, this.pixels ); break; case TEXTURE_4BYTE_RGBA: gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL.GL_RGBA, this.width, this.height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, this.pixels ); break; default: throw new RuntimeException("Unknown texture type: " + this.type); } //Assign the mip map levels and texture info gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR ); gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR); gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE); } return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Sprite loadBitmap(Context context, GL10 gl, int resourceId)\r\n\t{\r\n\t if(context != null && gl != null)\r\n\t {\r\n\t \t//Generate one texture pointer...\r\n\t gl.glGenTextures(1, mTexture, 0);\r\n\t \r\n\t //grab location index\r\n\t int textureID = mTexture[0];\r\n\...
[ "0.6795187", "0.6720138", "0.65992224", "0.6562427", "0.6456527", "0.6286479", "0.6241724", "0.6211127", "0.6206643", "0.6173885", "0.6169017", "0.61501485", "0.6062737", "0.5917792", "0.5816219", "0.5772447", "0.5760591", "0.5668057", "0.566264", "0.5661405", "0.5659087", ...
0.552699
25
Called when the activity is first created.
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); accountManager = AccountManager.get(getApplicationContext()); Account[] accounts = accountManager.getAccountsByType("com.google"); String[] emails = new String[accounts.length]; for (int i = 0; i < emails.length; i++) emails[i] = accounts[i].name; this.setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, emails)); setResult(RESULT_CANCELED); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t\tinit();\n\t}", "@Override\r\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\tsuper.onActivityCreated(savedInstanceState);\r\n\t}", "@Override\n\tpublic void onActivit...
[ "0.79173684", "0.7726369", "0.7692746", "0.7692746", "0.7692746", "0.7692746", "0.7692746", "0.7692746", "0.7636681", "0.7636681", "0.763111", "0.76181364", "0.76181364", "0.7543469", "0.7539785", "0.7539785", "0.7538629", "0.7527225", "0.75151294", "0.7508903", "0.7500434", ...
0.0
-1
AAAAA BBBBB CCCCC DDDDD EEEEE
public static void m1() { char ch = 'A'; for(int i =1;i<=5;i++) { for(int j=1;j<=5;j++) { System.out.print(ch); } ch++; System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String a(byte paramByte) {\n/* 65 */ return \"\" + a[(paramByte & 0xF0) >>> 4] + a[paramByte & 0xF];\n/* */ }", "private static char[] m619z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArr...
[ "0.57006276", "0.563488", "0.5593928", "0.5571103", "0.5535287", "0.5496323", "0.5467275", "0.5458262", "0.54376847", "0.542596", "0.5412748", "0.5394277", "0.5393525", "0.5375058", "0.5373203", "0.53704035", "0.53605646", "0.5357593", "0.5356114", "0.534853", "0.5348077", ...
0.0
-1
ABCDE ABCDE ABCDE ABCDE ABCDE
public static void m2() { for(int i =1;i<=5;i++) { char ch ='A'; for(int j =1;j<=5;j++) { System.out.print(ch); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void repeatedSubstringPattern() {\n assertTrue(new Solution1().repeatedSubstringPattern(\"abcabcabcabc\"));\n }", "public abstract void createLongestRepeatedSubstring();", "public static void m13() {\r\n\tfor(int i=1;i<=4;i++) {\r\n\t\tfor(int j =1;j<=(4-i);j++) {\r\n\t\t\tSystem....
[ "0.6254221", "0.6008275", "0.5954243", "0.5923539", "0.5897007", "0.58885646", "0.580307", "0.57225347", "0.5717957", "0.5717739", "0.57042545", "0.5697641", "0.5694604", "0.5685695", "0.5677344", "0.5660277", "0.5643853", "0.56409264", "0.5640609", "0.5637196", "0.56301713",...
0.56701684
15
EEEEE DDDDD CCCCC BBBBB AAAAA
public static void m3() { char ch ='E'; for(int i =1 ;i<=5;i++) { for(int j=5;j>=1;j--) { System.out.print(ch); } ch--; System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void buildDiamond_widestPointCharSetToCharGreaterThanA_returnedValueHasCorrectNumberOfRepetitions() {\n\t\tfor (char widestPointChar = 'B'; widestPointChar <= 'Z'; widestPointChar++) {\n\t\t\t//assume\n\t\t\tint diagonalLength = widestPointChar - Diamond.BASE_CHARACTER + 1;\n\n\t\t\t//act\n\t\t\tSt...
[ "0.5563715", "0.55454147", "0.5532693", "0.55257964", "0.5517017", "0.5513205", "0.5459235", "0.5443559", "0.5416365", "0.54065865", "0.5348381", "0.534783", "0.5338788", "0.5331993", "0.53300256", "0.53279316", "0.5320052", "0.5316525", "0.5313383", "0.53053415", "0.5286412"...
0.51077336
41
EDCBA EDCBA EDCBA EDCBA EDCBA
public static void m4() { for(int i=1;i<=5;i++) { char ch ='E'; for(int j=5;j>=1;j--) { System.out.print(ch); ch--; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static char[] m619z(String str) {\n char[] toCharArray = str.toCharArray();\n if (toCharArray.length < 2) {\n toCharArray[0] = (char) (toCharArray[0] ^ 20);\n }\n return toCharArray;\n }", "private static char[] m7947z(String str) {\n char[] toCharArray = ...
[ "0.6202605", "0.59961724", "0.5958859", "0.59018105", "0.5863975", "0.5745517", "0.5741735", "0.57187426", "0.5704918", "0.5653474", "0.56401974", "0.562495", "0.5596885", "0.5582707", "0.5581586", "0.5577128", "0.557204", "0.5568853", "0.55665904", "0.5557537", "0.55522513",...
0.0
-1
A AB ABC ABCD ABCDE
public static void m5() { for(int i =1;i<=5;i++) { char ch ='A'; for(int j =1;j<=i;j++) { System.out.print(ch); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void m13() {\r\n\tfor(int i=1;i<=4;i++) {\r\n\t\tfor(int j =1;j<=(4-i);j++) {\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tchar ch ='A';\r\n\t\tfor(int j=1;j<=i;j++) {\r\n\t\t\tSystem.out.print(ch+\" \");\r\n\t\t\tch++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}\r\n}", "public static void ...
[ "0.63166565", "0.62088287", "0.61369014", "0.611305", "0.60443795", "0.6021502", "0.6016422", "0.6001259", "0.5988064", "0.5981731", "0.5934605", "0.59296393", "0.59091216", "0.59077275", "0.58922744", "0.5882054", "0.5876279", "0.58557343", "0.58401424", "0.57948625", "0.579...
0.63734114
0
A AB ABC ABCD ABCDE
public static void m6() { for(int i=1;i<=5;i++) { for(int j=1;j<=(5-i);j++) { System.out.print(" "); } char ch ='A'; for(int k =1;k<=i;k++) { System.out.print(ch); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void m5() {\r\nfor(int i =1;i<=5;i++) {\r\n\tchar ch ='A';\r\n\tfor(int j =1;j<=i;j++) {\r\n\t\tSystem.out.print(ch);\r\n\t\tch++;\r\n\t}\r\n\tSystem.out.println();\r\n}\t\r\n}", "public static void m13() {\r\n\tfor(int i=1;i<=4;i++) {\r\n\t\tfor(int j =1;j<=(4-i);j++) {\r\n\t\t\tSystem.out.print...
[ "0.63734114", "0.63166565", "0.62088287", "0.61369014", "0.611305", "0.60443795", "0.6021502", "0.6016422", "0.6001259", "0.5988064", "0.5981731", "0.5934605", "0.59296393", "0.59091216", "0.58922744", "0.5882054", "0.5876279", "0.58557343", "0.58401424", "0.57948625", "0.579...
0.59077275
14
A BB CCC DDDD EEEEE
public static void m7() { char ch ='A'; for(int i=1;i<=5;i++) { for(int j =1;j<=i;j++) { System.out.print(ch); } ch++; System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void m5() {\r\nfor(int i =1;i<=5;i++) {\r\n\tchar ch ='A';\r\n\tfor(int j =1;j<=i;j++) {\r\n\t\tSystem.out.print(ch);\r\n\t\tch++;\r\n\t}\r\n\tSystem.out.println();\r\n}\t\r\n}", "public static void m13() {\r\n\tfor(int i=1;i<=4;i++) {\r\n\t\tfor(int j =1;j<=(4-i);j++) {\r\n\t\t\tSystem.out.print...
[ "0.6377812", "0.634612", "0.6190271", "0.6162569", "0.61392057", "0.611654", "0.6106233", "0.604845", "0.5982482", "0.5962439", "0.5944216", "0.59436154", "0.59410256", "0.5915033", "0.58884996", "0.5861713", "0.5857398", "0.5848304", "0.58313507", "0.5808725", "0.571502", ...
0.6182743
3
ABCDE ABCE ABC AB A
public static void m8() { for(int i =1;i<=5;i++) { char ch ='A'; for(int j=5;j>=i;j--) { System.out.print(ch); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void circulardecode()\n{\nfor(i=0;i<s.length();i++)\n{\nc=s.charAt(i);\nk=(int)c;\nif(k==90)\nk1=65;\nelse\nif(k==122)\nk1=97;\nelse\nk1=k+1;\nc1=caseconverter(k,k1);\nSystem.out.print(c1);\n}\n}", "public static void main(String[] args) {\n\t\tString s=\"A\";\n\t\tint l=s.length();\n\t\tint c=0;\n\t\tfor(int i=...
[ "0.6044217", "0.60111547", "0.59776235", "0.59663385", "0.59198296", "0.590584", "0.59012437", "0.58639395", "0.5861253", "0.5813403", "0.57883704", "0.57798165", "0.5769029", "0.573752", "0.5734094", "0.56926054", "0.5692204", "0.5677336", "0.5670817", "0.56656086", "0.56509...
0.5575892
38
ABCDE ABCD ABC AB A
public static void m9() { for(int i =1;i<=5;i++) { for(int j =1;j<=i;j++) { System.out.print(" "); } char ch ='A'; for(int k=0;k<=(5-i);k++) { System.out.print(ch); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void m13() {\r\n\tfor(int i=1;i<=4;i++) {\r\n\t\tfor(int j =1;j<=(4-i);j++) {\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tchar ch ='A';\r\n\t\tfor(int j=1;j<=i;j++) {\r\n\t\t\tSystem.out.print(ch+\" \");\r\n\t\t\tch++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}\r\n}", "public static void ...
[ "0.6110238", "0.60452086", "0.59552294", "0.5919497", "0.58397526", "0.5820209", "0.58180237", "0.58029443", "0.57943773", "0.5783742", "0.57644606", "0.5739091", "0.5738406", "0.573269", "0.5729606", "0.5729454", "0.57225865", "0.5721607", "0.5710976", "0.57079226", "0.56948...
0.5679864
22
A AB ABC ABCD ABCDE ABCD ABC AB A
public static void m10() { int size =4; for(int i =size;i>=-size;i--) { char ch ='A'; for(int j =size;j>=Math.abs(i);j-- ) { System.out.print(ch); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void m13() {\r\n\tfor(int i=1;i<=4;i++) {\r\n\t\tfor(int j =1;j<=(4-i);j++) {\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tchar ch ='A';\r\n\t\tfor(int j=1;j<=i;j++) {\r\n\t\t\tSystem.out.print(ch+\" \");\r\n\t\t\tch++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}\r\n}", "public static void ...
[ "0.6346118", "0.6305057", "0.6184684", "0.6105908", "0.6080294", "0.6072925", "0.6023426", "0.60118794", "0.6000425", "0.5999797", "0.5994327", "0.5953885", "0.59480965", "0.58978784", "0.58948386", "0.5894519", "0.58636355", "0.58310443", "0.5818608", "0.57995373", "0.579087...
0.572388
24
A AB ABC ABCD ABCDE ABCD ABC AB A
public static void m11() { int size =4; for(int i=size;i>=-size;i--) { for(int j=1;j<=Math.abs(i);j++) { System.out.print(" "); } char ch = 'A'; for(int k =size;k>=Math.abs(i) ;k--) { System.out.print(ch); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void m13() {\r\n\tfor(int i=1;i<=4;i++) {\r\n\t\tfor(int j =1;j<=(4-i);j++) {\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tchar ch ='A';\r\n\t\tfor(int j=1;j<=i;j++) {\r\n\t\t\tSystem.out.print(ch+\" \");\r\n\t\t\tch++;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}\r\n}", "public static void ...
[ "0.6346118", "0.6305057", "0.6184684", "0.6105908", "0.6080294", "0.6072925", "0.6023426", "0.60118794", "0.6000425", "0.5994327", "0.5953885", "0.59480965", "0.58978784", "0.58948386", "0.5894519", "0.58636355", "0.58310443", "0.5818608", "0.57995373", "0.57908785", "0.57656...
0.5999797
9
A ABC ABCDE ABCDEFG
public static void m12() { int m =1; for(int i =1;i<=4;i++) { for(int j =1;j<=(4-i);j++) { System.out.print(" "); } char ch ='A'; for(int k =1;k<=m;k++) { System.out.print(ch); ch++; } m+=2; System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createAA() {\r\n\r\n\t\tfor( int x = 0 ; x < dnasequence.size(); x++) {\r\n\t\t\tString str = dnasequence.get(x);\r\n\t\t\t//put catch for missing 3rd letter\r\n\t\t\tif(str.substring(0, 1).equals(\"G\")) {\r\n\t\t\t\taasequence.add(getG(str));\r\n\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"C\...
[ "0.6105383", "0.5942791", "0.5941946", "0.5920584", "0.5919073", "0.5842632", "0.58408034", "0.5809438", "0.5790168", "0.5790168", "0.5790168", "0.5786747", "0.5773503", "0.5767864", "0.57506996", "0.57119393", "0.5708121", "0.5700858", "0.56893796", "0.5688038", "0.56813884"...
0.5494611
47
A A B A B C A B C D
public static void m13() { for(int i=1;i<=4;i++) { for(int j =1;j<=(4-i);j++) { System.out.print(" "); } char ch ='A'; for(int j=1;j<=i;j++) { System.out.print(ch+" "); ch++; } System.out.println(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void buildDiamond_widestPointCharSetToCharGreaterThanA_returnedValueHasCorrectNumberOfRepetitions() {\n\t\tfor (char widestPointChar = 'B'; widestPointChar <= 'Z'; widestPointChar++) {\n\t\t\t//assume\n\t\t\tint diagonalLength = widestPointChar - Diamond.BASE_CHARACTER + 1;\n\n\t\t\t//act\n\t\t\tSt...
[ "0.57088506", "0.5306728", "0.5167502", "0.5163604", "0.51493704", "0.50655454", "0.50539935", "0.5046869", "0.50386393", "0.499094", "0.49821773", "0.49781314", "0.49571234", "0.49524108", "0.49280027", "0.4926524", "0.49235344", "0.49162322", "0.4889136", "0.48856184", "0.4...
0.53434104
1
Load the config.properties values
private void init() { if ( PropertiesConfigurationFilename == null ) { logger.info("config.properties is default"); configProp = createDefaultProperties(); } else { try { logger.info("config.properties is "+ PropertiesConfigurationFilename.getAbsolutePath()); configProp = new PropertiesConfiguration(); configProp.load(PropertiesConfigurationFilename); } catch (ConfigurationException e) { logger.error("Unable to open config file: " + PropertiesConfigurationFilename.getAbsolutePath(), e); logger.info("config.properties is default"); configProp = createDefaultProperties(); } } // Load the locale information String locale = configProp.getString("locale"); configProp.setProperty("zmMsg", ResourceBundle.getBundle("ZmMsg", new Locale(locale))); configProp.setProperty("zhMsg", ResourceBundle.getBundle("ZhMsg", new Locale(locale))); configProp.setProperty("ajxMsg", ResourceBundle.getBundle("AjxMsg", new Locale(locale))); configProp.setProperty("i18Msg", ResourceBundle.getBundle("I18nMsg", new Locale(locale))); configProp.setProperty("zsMsg", ResourceBundle.getBundle("ZsMsg", new Locale(locale))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadData() {\n\n \tInputStream inputStream = this.getClass().getResourceAsStream(propertyFilePath);\n \n //Read configuration.properties file\n try {\n //prop.load(new FileInputStream(propertyFilePath));\n \tprop.load(inputStream);\n //prop.load(this.getCl...
[ "0.7633322", "0.75857854", "0.75469446", "0.7539617", "0.7401792", "0.7319398", "0.7292526", "0.7211021", "0.72085094", "0.718894", "0.71762586", "0.7138291", "0.70684236", "0.7059504", "0.70514697", "0.70201606", "0.6972688", "0.6967626", "0.6900244", "0.688508", "0.6878896"...
0.6948654
18
isWebDriver() method to check whether WebDriver mode is enabled in the configuration settings
public static boolean isWebDriver() { if (ZmailSeleniumProperties.getStringProperty("seleniumDriver") != null && ZmailSeleniumProperties.getStringProperty("seleniumDriver").contentEquals("WebDriver")) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isWebDriverBackedSelenium() {\n\t\tif (ZmailSeleniumProperties.getStringProperty(\"seleniumDriver\") != null && ZmailSeleniumProperties.getStringProperty(\"seleniumDriver\").contentEquals(\"WebDriverBackedSelenium\"))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public boolean...
[ "0.7281055", "0.647867", "0.6227361", "0.61298436", "0.610285", "0.60567474", "0.6025551", "0.5953264", "0.59128094", "0.590669", "0.58730894", "0.5863534", "0.5814458", "0.58051556", "0.57846314", "0.5780311", "0.57098246", "0.5699476", "0.5685225", "0.568477", "0.5683173", ...
0.82335293
0
isWebDriverBackedSelenium() method to check whether WebDriverBackedSelenium mode is enabled in the configuration settings
public static boolean isWebDriverBackedSelenium() { if (ZmailSeleniumProperties.getStringProperty("seleniumDriver") != null && ZmailSeleniumProperties.getStringProperty("seleniumDriver").contentEquals("WebDriverBackedSelenium")) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isWebDriver() {\n\t\tif (ZmailSeleniumProperties.getStringProperty(\"seleniumDriver\") != null && ZmailSeleniumProperties.getStringProperty(\"seleniumDriver\").contentEquals(\"WebDriver\"))\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public static final BaseRemoteWebDriver ge...
[ "0.7373856", "0.5950749", "0.5801217", "0.57238954", "0.5646387", "0.5607121", "0.5600878", "0.5600786", "0.5593937", "0.55256706", "0.5517212", "0.5516085", "0.55121815", "0.54735196", "0.5469392", "0.54291844", "0.5420065", "0.5415188", "0.54144657", "0.54009736", "0.538684...
0.86572224
0
Get Logout URL for selenium to sign out from the application
public static String getLogoutURL() { ZmailURI uri = new ZmailURI(ZmailURI.getBaseURI()); uri.addQuery("loginOp", "logout"); return (uri.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static URL getUrlForLogout()\r\n {\r\n String strUrl = getBaseURL() + \"account_services/api/1.0/account/logout\";\r\n return str2url( strUrl );\r\n }", "public String getLogoutUrl() {\n if (springLogoutUrl == null) {\n springLogoutUrl = GWT.getHostPageBaseURL() + DEF...
[ "0.78821075", "0.7363579", "0.6894178", "0.6862277", "0.6622107", "0.6594077", "0.65630376", "0.6470142", "0.6462845", "0.637679", "0.63712734", "0.6371184", "0.6366229", "0.6324787", "0.6313769", "0.63051337", "0.6297671", "0.620323", "0.61928046", "0.6177749", "0.6153077", ...
0.7457627
1
Get Base URL for selenium to open to access the application under test
public static String getBaseURL() { return (ZmailURI.getBaseURI().toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getCurrentUrl(){\n return seleniumDriver.getCurrentUrl();\n }", "public String getCurrentUrl() {\n return driver.getCurrentUrl();\n }", "public String getCurrentUrl() {\n return driver.getCurrentUrl();\n }", "public String getCurrentUrl() {\n return webDriver.ge...
[ "0.74248004", "0.71873105", "0.71873105", "0.71687776", "0.7161266", "0.713475", "0.7120237", "0.706514", "0.7052463", "0.69786966", "0.68710744", "0.6867365", "0.6834935", "0.6824755", "0.681526", "0.6811682", "0.6797431", "0.67827237", "0.6750964", "0.67469853", "0.67441416...
0.0
-1
for unit test need to change access to public
public static void main(String[] args) { System .setProperty("log4j.configuration", "file:///C:/log4j.properties"); System.out.println(System.getProperty("log4j.configuration")); System.out.println(System.getProperty("user.dir")); String br = (String) ZmailSeleniumProperties.getInstance() .getConfigProp().getProperty("browser"); System.out.println(br); logger.debug(br); ResourceBundle zmMsg = (ResourceBundle) ZmailSeleniumProperties .getInstance().getConfigProp().getProperty("zmMsg"); System.out.println(zmMsg.getLocale()); logger.debug(zmMsg.getLocale()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void publicInstanceTest() {\n // TODO: test publicInstance\n }", "public void checkPublic() {\n }", "private stendhal() {\n\t}", "private Mocks() { }", "@Override\n\tpublic boolean isPublic() {\n\t\treturn false;\n\t}", "@Override\n public boolean isPrivate() {\n re...
[ "0.7027652", "0.6902832", "0.6713559", "0.64500564", "0.6401919", "0.6396849", "0.637128", "0.63497114", "0.634584", "0.6261403", "0.62333626", "0.6225281", "0.6217813", "0.6149196", "0.6145849", "0.6136223", "0.6136223", "0.61166275", "0.61166275", "0.61166275", "0.61166275"...
0.0
-1
int id = item.getItemId();
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_refresh: Toast.makeText(this, "Refreshing data", Toast.LENGTH_SHORT).show(); SharedPreferences pref = getPreferences(Context.MODE_PRIVATE); int mode = pref.getInt("display_status_key", 1); //hasil yang disimpan dari display_status_key if (mode == 1) { getNowPlayingMovies(); } else { getUpComingMovies(); } //getNowPlayingMovies(); break; case R.id.now_playing: getNowPlayingMovies(); break; case R.id.up_coming: getUpComingMovies(); break; } //if (id==R.id.menu_refresh){ // getNowPlayingMovies(); //loadDummyData(); //} return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n\n return super.onOpti...
[ "0.7823855", "0.75627804", "0.73676", "0.73676", "0.73676", "0.73676", "0.73676", "0.73676", "0.7075392", "0.70030504", "0.70030504", "0.6947985", "0.6896521", "0.68778205", "0.6848715", "0.6848715", "0.6848715", "0.6848715", "0.6848715", "0.6848715", "0.6848715", "0.684871...
0.0
-1
Disini kode kalau berhasil
@Override public void onResponse(Call<MovieList> call, Response<MovieList> response) { MovieList movieList = response.body(); List<MovieItem> listMovieItem = movieList.results; adapter.setDataFilm(new ArrayList<MovieItem>(listMovieItem)); getSupportActionBar().setTitle("Now Playing"); //progressBar.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void zpracujObjednavky()\n\t{\n\t\tint idtmp = 0;\n\t\tfloat delkaCesty = 0;\n\t\t\n\t\tif (this.objednavky.isEmpty())\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tNakladak nakl = (Nakladak) getVolneAuto();\n\t\t\n\t\tnakl.poloha[0] = this.poloha[0];\n\t\tnakl.poloha[1] = this.poloha[1];\n\t\tObjednavka ob = th...
[ "0.63418716", "0.6257034", "0.6186402", "0.61798465", "0.61705863", "0.6080044", "0.60626477", "0.6010675", "0.59906816", "0.59696114", "0.59690607", "0.5954869", "0.59126276", "0.59038633", "0.59032243", "0.5876343", "0.5864511", "0.5863693", "0.5854269", "0.585415", "0.5849...
0.0
-1
Disini kode kalau error progressBar.setVisibility(View.GONE);
@Override public void onFailure(Call<MovieList> call, Throwable t) { recyclerView.setVisibility(View.VISIBLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void hideProgress() {\n\n if(null != mErrorTextView) {\n mErrorTextView.setVisibility(View.GONE);\n }\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisi...
[ "0.746759", "0.7421277", "0.7358994", "0.73411566", "0.73161227", "0.7299909", "0.7291835", "0.72371405", "0.7102834", "0.69870704", "0.69119036", "0.6893381", "0.68924236", "0.68659014", "0.6859615", "0.6848932", "0.6823403", "0.68176955", "0.6817091", "0.6814145", "0.680465...
0.0
-1
Disini kode kalau berhasil
@Override public void onResponse(Call<MovieList> call, Response<MovieList> response) { MovieList movieList = response.body(); List<MovieItem> listMovieItem = movieList.results; adapter.setDataFilm(new ArrayList<MovieItem>(listMovieItem)); getSupportActionBar().setTitle("Upcoming"); //progressBar.setVisibility(View.GONE); recyclerView.setVisibility(View.VISIBLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void zpracujObjednavky()\n\t{\n\t\tint idtmp = 0;\n\t\tfloat delkaCesty = 0;\n\t\t\n\t\tif (this.objednavky.isEmpty())\n\t\t{\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\tNakladak nakl = (Nakladak) getVolneAuto();\n\t\t\n\t\tnakl.poloha[0] = this.poloha[0];\n\t\tnakl.poloha[1] = this.poloha[1];\n\t\tObjednavka ob = th...
[ "0.63418716", "0.6257034", "0.6186402", "0.61798465", "0.61705863", "0.6080044", "0.60626477", "0.6010675", "0.59906816", "0.59696114", "0.59690607", "0.5954869", "0.59126276", "0.59038633", "0.59032243", "0.5876343", "0.5864511", "0.5863693", "0.5854269", "0.585415", "0.5849...
0.0
-1
Disini kode kalau error progressBar.setVisibility(View.GONE);
@Override public void onFailure(Call<MovieList> call, Throwable t) { recyclerView.setVisibility(View.VISIBLE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void hideProgress() {\n\n if(null != mErrorTextView) {\n mErrorTextView.setVisibility(View.GONE);\n }\n }", "@Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"response is:\", error.toString());\n progressBar.setVisi...
[ "0.7466633", "0.7421736", "0.7360415", "0.73427844", "0.7317062", "0.73006696", "0.7292638", "0.723657", "0.7104758", "0.69891477", "0.6913747", "0.68939734", "0.6893948", "0.6866513", "0.6860034", "0.6849929", "0.6824856", "0.6818987", "0.68167424", "0.68145865", "0.680464",...
0.0
-1
private variables Constructor to setup the GUI components and event handlers
public MyGUIProgram() { Label MyLabel = new Label("Test string.", Label.CENTER); this.add(MyLabel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public GUI() {\n\t\tinitComponents();\n\t}", "public GUI() {\n initComponents();\n }", "public GUI() {\n initComponents();\n }", "public GUI() {\n initComponents();\n }", "public GUI()\n {\n //Initializes the variables and UI aspects\n UI.initialise();\n ...
[ "0.82066953", "0.8130394", "0.8130394", "0.7863155", "0.785327", "0.78210545", "0.7799129", "0.7791159", "0.7725017", "0.77207994", "0.7691472", "0.76856506", "0.76856506", "0.7684221", "0.76751953", "0.76708573", "0.7646072", "0.7643758", "0.7621853", "0.76178825", "0.759349...
0.0
-1
The entry main() method
public static void main(String[] args) { Frame testFrame = new MyGUIProgram(); testFrame.setVisible(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main() {\n \n }", "public static void main()\n\t{\n\t}", "public static void main() {\n }", "public static void main(String[] args) {}", "public static void main(String[] args) {}", "public static void main(){\n\t}", "public static void main(String... args) {\n doMain...
[ "0.83095366", "0.823736", "0.8213252", "0.807594", "0.807594", "0.8017239", "0.8000871", "0.79600644", "0.7957076", "0.7942369", "0.7936067", "0.79177535", "0.79132897", "0.79132247", "0.79132247", "0.7885108", "0.78806263", "0.7866932", "0.7863532", "0.7863532", "0.7863532",...
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_activity_date, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {...
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.6862...
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.logout) { if (currentUser != null) { // User clicked to log out. ParseUser.logOut(); currentUser = null; //showProfileLoggedOut(); ParseLoginBuilder loginBuilder = new ParseLoginBuilder(ActivityZodiacDetail.this); startActivityForResult(loginBuilder.build(), LOGIN_REQUEST); } Toast.makeText(getApplicationContext(),"Logout",Toast.LENGTH_SHORT).show(); return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n ...
[ "0.7904231", "0.78061396", "0.7767007", "0.77273244", "0.76318634", "0.7621818", "0.7585249", "0.7531511", "0.7488678", "0.74574006", "0.74574006", "0.7439257", "0.7421747", "0.7403457", "0.73920685", "0.7387285", "0.7379893", "0.73710734", "0.7363068", "0.73565257", "0.73461...
0.0
-1
Add business logic below. (Rightclick in editor and choose "Insert Code > Add Business Method")
@Override public List<Contract> getAllResContracts() { try { List<Contract> l = new ArrayList(); Query q = entityManager.createQuery("SELECT c FROM Contract c WHERE c.shop.shopType='Restaurant'"); return q.getResultList(); } catch(Exception ex) { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doBusiness() {\n\t\tsuper.doBusiness();\n\t}", "@Override\n\tpublic void businessMoney() {\n\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "public void logic(){\r\n\r\n\t}", "public interface BusinessMethod extends BusinessObjectElement {\r\n\t\r\n\t/**\r\n\t * @generated ...
[ "0.6509416", "0.6434586", "0.64021504", "0.6370952", "0.59603286", "0.5887013", "0.57798886", "0.5746891", "0.5708072", "0.5660108", "0.56429255", "0.5576717", "0.55500287", "0.54162633", "0.5399628", "0.5389822", "0.53643405", "0.5348917", "0.53373", "0.53373", "0.53348744",...
0.0
-1
FIXME logic code move to core module
public void run() { int selected = 0; int logined = 0; Object[] objects = getSelectedObj(); if (objects instanceof Object[]) { for (Object object : objects) { if (object instanceof CubridDatabase) { selected++; CubridDatabase database = (CubridDatabase) object; if (database.isLogined()) { logined++; } } } } if (selected > 1) { CommonUITool.openWarningBox(com.cubrid.common.ui.cubrid.database.erwin.Messages.errERwinSelectOneDbToImport); return; } if (selected <= 0) { CommonUITool.openWarningBox(com.cubrid.common.ui.cubrid.database.erwin.Messages.errERwinSelectImportDbToImport); return; } if (logined <= 0) { CommonUITool.openWarningBox(com.cubrid.common.ui.cubrid.database.erwin.Messages.errERwinSelectLoginedDbToImport); return; } Object[] obj = getSelectedObj(); if (obj == null || obj.length != 1) { return; } if (!(obj[0] instanceof CubridDatabase)) { return; } database = (CubridDatabase) obj[0]; ERwinImportDialog dialog = new ERwinImportDialog(getShell(), database); int returnvalue = dialog.open(); if(returnvalue != IDialogConstants.OK_ID) { return; } ERXmlContainer container = dialog.getContainer(); if(container.getErrMsg() != null && !container.getErrMsg().equals("") ) { CommonUITool.openErrorBox(container.getErrMsg()); return; } Map<String, TableSchema> tableSchema = container.getTableSchemas(); Map<String, ERWinSchemaInfo> schemaInfos = container.getSchemaInfos(); String modelName = container.getDatabaseName(); createCompareModel(modelName, tableSchema, schemaInfos); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n public void perish() {\n \n }", "protected void additionalProcessing() {\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "private stendhal() {\n\t}", "@Ov...
[ "0.58028567", "0.55054784", "0.54913956", "0.54556984", "0.542844", "0.5413127", "0.5407457", "0.5372317", "0.5368562", "0.5366743", "0.53596807", "0.5358156", "0.5352394", "0.53505975", "0.53339946", "0.53319407", "0.53319407", "0.53197664", "0.53055704", "0.53051746", "0.53...
0.0
-1
Create a new database connection
public DatabaseConnection newConnection();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Connection createDatabase() {\n\t\tSystem.out.println(\"We are creating a database\");\n\t\ttry (\n\t\t\t\t// Step 1: Allocate a database \"Connection\" object\n\t\t\t\tConnection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:\" + PORT_NUMBER + \"/\", \n\t\t\t\t\t\t\"root\", \"root\"); // MyS...
[ "0.7701248", "0.7677755", "0.76506376", "0.74942476", "0.7462366", "0.7425061", "0.73988247", "0.73543054", "0.73171705", "0.7288598", "0.71684885", "0.7150174", "0.71371377", "0.712386", "0.70882785", "0.7062909", "0.70566213", "0.70315206", "0.7014429", "0.6991625", "0.6988...
0.78779936
0
Utility method to safely close any Closeable, null or not, catching and ignoring any exception.
public static <T extends Closeable> T closeSafe(T closeable) { if (null != closeable) { try { closeable.close(); } catch (IOException e) { // Ignore errors on close } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void silentlyClose(Closeable closeable)\n {\n try\n {\n if (closeable != null) closeable.close();\n }\n catch (IOException e)\n {\n // Ignore\n }\n }", "public static void closeQuietly(Closeable closeable) {\n\t\tif (closeable !...
[ "0.7438866", "0.6998559", "0.69656175", "0.6882885", "0.6834929", "0.6626055", "0.65758514", "0.6475221", "0.63827807", "0.6344851", "0.6300355", "0.6222894", "0.61909246", "0.6171478", "0.6147256", "0.6114819", "0.60891944", "0.60012746", "0.60012746", "0.5981811", "0.592819...
0.67950803
5
/ return network id for matrix position index
public long getIdForIndex(int index) throws ApplicationException { try { return networkIds[index]; } catch (IndexOutOfBoundsException e) { throw new ApplicationException("there is no id at index postion: " + index); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int netid() {\n\t\t\treturn address & (-1 << mask);\n\t\t}", "@Override public int getNodeId(String name) {\n\t\tint id = node_index_.tryGet(name);\n\t\tif (id == -1) System.err.println(\"Unknown node name=\" + name);\n\t\treturn id;\n\t}", "int getCellid();", "public long getNodeIndex();", "private String...
[ "0.62263876", "0.6128722", "0.6089225", "0.6072713", "0.60659766", "0.60326576", "0.60028833", "0.6001083", "0.5970463", "0.59307754", "0.58756185", "0.5868249", "0.58353955", "0.5783327", "0.5749445", "0.5747406", "0.5721146", "0.57069373", "0.57024693", "0.56839585", "0.567...
0.56697303
21
/ return matrix position index for network id
public int getIndexForId(long id) throws ApplicationException { checkReverseMap(); Integer index = reverseMap.get(id); if (index == null) { throw new ApplicationException("there is no index position for network id: " + id); } return index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void calculateIndex() {\n for(int i=0; i<matrix.length; i++) {\n for(int j=0; j<matrix.length; j++) {\n if(matrix[i][j] == 0) {\n index = (i*matrix.length)+(j+1);\n return;\n }\n }\n }\n }", "privat...
[ "0.6167982", "0.61429346", "0.6064703", "0.6062134", "0.6040362", "0.60259366", "0.6007594", "0.600305", "0.6001755", "0.59243375", "0.59195554", "0.5864708", "0.584373", "0.5804398", "0.5781336", "0.5772748", "0.57060784", "0.5693412", "0.56833154", "0.56646794", "0.56453615...
0.59218156
10
/ an id we know about?
public boolean containsId(long id) throws ApplicationException { checkReverseMap(); return reverseMap.containsKey(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "...
[ "0.7862016", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.786181", "0.7861...
0.0
-1
/ lazy creation of reverse lookup
private void checkReverseMap() throws ApplicationException { if (reverseMap == null) { reverseMap = Data.makeReverseMap(networkIds); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void createLookupCache() {\n }", "private void createLookup() {\r\n\t\tcreateLooupMap(lookupMap, objectdef, objectdef.getName());\r\n\t\tcreateChildIndex(childIndex, objectdef, objectdef.getName());\r\n\r\n\t}", "private LookupUtil(){}", "public void doLazyMatch() {}", "protected void createLo...
[ "0.6207884", "0.59173375", "0.5818747", "0.5760192", "0.5637792", "0.55250424", "0.5518883", "0.54762626", "0.5460995", "0.53969383", "0.53595215", "0.53570366", "0.52834344", "0.52803004", "0.5234048", "0.52077687", "0.51656854", "0.51645577", "0.5138429", "0.51249814", "0.5...
0.5126915
19
/ used to support user networks, where we update one network at a time instead of building the entire network list at once as for core networks. so this isn't the most efficient thing to do but not expected to be a bottleneck. we reallocate the entire array 1 larger (!) and clear the lookup map so it will get recreated on next use.
public int addNetwork(long id) { int nextIndex = networkIds.length; long [] newIds = new long[networkIds.length+1]; System.arraycopy(networkIds, 0, newIds, 0, networkIds.length); newIds[nextIndex] = id; networkIds = newIds; reverseMap = null; // force rebuild next time return nextIndex; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void clearCache() {\r\n for (int i = 1; i < neurons.length; i++) {\r\n for (int j = 0; j < neurons[i].length; j++) {\r\n neurons[i][j].clearCache();\r\n }\r\n }\r\n }", "private void rehash() {\n\t HashEntry[] oldArray = array;\n\n\t ...
[ "0.61484", "0.6056815", "0.5950113", "0.5910666", "0.59100753", "0.5848173", "0.5821909", "0.5752803", "0.574645", "0.5591456", "0.55412173", "0.5506105", "0.55011445", "0.54960454", "0.5480229", "0.54759544", "0.54605186", "0.5437983", "0.54377013", "0.5436227", "0.5432703",...
0.0
-1
/ remove the given network id from the list (not the network from the disk) awkward data structure, have to shift elements up. should really switch to a List. or use lib of data structures for primitive types.
public void removeNetwork(long id) throws ApplicationException { if (!containsId(id)) { return; } long [] newIds = new long[networkIds.length-1]; int j=0; for (int i=0; i<networkIds.length; i++) { if (networkIds[i] != id) { newIds[j] = networkIds[i]; j++; } } networkIds = newIds; reverseMap = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeIdFromList(Integer mCanalId);", "void remove(int id);", "void remover(Long id);", "void remover(Long id);", "void remove(String id);", "void remove(String id);", "void remove(String id);", "public void removeNetwork(int index) {\n netwList.get(index).delete();\n // remove it ...
[ "0.6656133", "0.6245754", "0.60919565", "0.60919565", "0.60766864", "0.60766864", "0.60766864", "0.5999371", "0.59900707", "0.59900707", "0.5949982", "0.5948196", "0.5891235", "0.5872537", "0.57607293", "0.57537675", "0.56761396", "0.56724846", "0.56721693", "0.566351", "0.56...
0.7585466
0
Ideally we should be knocking off the URLs from the tweet since they don't need to parsed.
private String filterOutURLFromTweet(final Status status) { final String tweet = status.getText(); final URLEntity[] urlEntities = status.getURLEntities(); int startOfURL; int endOfURL; String truncatedTweet = ""; if(urlEntities.length > 0) { for(final URLEntity urlEntity: urlEntities){ startOfURL = urlEntity.getStart(); endOfURL = urlEntity.getEnd(); truncatedTweet += tweet.substring(0, startOfURL) + tweet.substring(endOfURL); } return truncatedTweet; } else { return tweet; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void processUrls(){\n // Strip quoted tweet URL\n if(quotedTweetId > 0){\n if(entities.urls.size() > 0 &&\n entities.urls.get(entities.urls.size() - 1)\n .expandedUrl.endsWith(\"/status/\" + String.valueOf(quotedTweetId))){\n // ...
[ "0.6994812", "0.65795445", "0.6171901", "0.6169368", "0.6164568", "0.6096477", "0.60052586", "0.5937964", "0.59299004", "0.58634484", "0.5834314", "0.5806939", "0.57789415", "0.57028323", "0.5687742", "0.56530976", "0.56097436", "0.55837387", "0.5569974", "0.55630696", "0.554...
0.69140905
1
For some reason, some tweets contain two different types of URL's. One that is just a link, and another that is the Twitter link back to the tweet.
private String removeAllLinks(String commentstr) { String urlPattern = "((https?|ftp|gopher|telnet|file|Unsure|http):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)"; Pattern p = Pattern.compile(urlPattern,Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(commentstr); int i = 0; while (m.find()) { commentstr = commentstr.replaceAll(m.group(i),"").trim(); i++; } return commentstr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String getTweetLink(Status status) {\n \t\treturn \"http://twitter.com/\" + status.getUser().getScreenName()\n \t\t\t\t+ \"/status/\" + status.getId();\n \t}", "private String filterOutURLFromTweet(final Status status) {\n\t\tfinal String tweet = status.getText();\n\t\tfinal URLEntity[] urlEntities = sta...
[ "0.68701494", "0.6563455", "0.63917696", "0.61324555", "0.61078316", "0.59641945", "0.59327656", "0.5798987", "0.57413304", "0.57368433", "0.5689487", "0.5682581", "0.5676274", "0.5663691", "0.5658826", "0.5658774", "0.5641552", "0.5590448", "0.5575943", "0.55645066", "0.5563...
0.0
-1
Downloads all of a user's tweets to two files: ./data/username/username_tweets.txt (one tweet per line) ./data/username/username_tweets_single.txt (all tweets on one line) Creates the ./data/username directory if necessary. Set numTweets <= 0 to download all of the user's tweets.
public void downloadTweetsForItem(String item, int numTweets) throws IOException, TwitterException { /*if (numTweets <= 0) { numTweets = Integer.MAX_VALUE; }*/ File userDir = new File(String.format("%s/%s", DATA_DIR, item)); boolean success = false; try{ //success = userDir.mkdir(); Files.createDirectory(userDir.toPath()); } catch(IOException se) { System.out.println("****mkdir failed!!!!!!!!"); } String multiLineFile = String.format("%s/%s/%s_tweets.txt", DATA_DIR, item, item); String singleLineFile = String.format("%s/%s/%s_tweets_single.txt", DATA_DIR, item, item); String multiLineFileRaw = String.format("%s/%s/%s_tweets_multiRaw.txt", DATA_DIR, item, item); //item = "@" + item; List<String> allTweets = GetAllTweets(item, numTweets);//Query(item, numTweets); // Now do some pre-processing on allTweets. // Topic modelling prefers text with stop words removed etc. List<String> filteredTweets = new ArrayList<String>(); BufferedReader f = new BufferedReader(new FileReader("stopwords.txt")); String line = f.readLine(); List<String> stopwords = new ArrayList<String>(); while(line != null) { stopwords.add(line); line = f.readLine(); } f.close(); item = item.toLowerCase(); int i = 0; while(i < allTweets.size()) { String text = allTweets.get(i); // First, remove all non alphabetic characters. This removes a lot of junk! hash tags, prices, etc. text = text.replaceAll("[^a-zA-Z\\s]", "").toLowerCase(); // first, get rid of our actual search term. we do not want it to come up as a topic, // as we already know that we are searching for tweets of that item text = text.replace(item, ""); // Now, remove all words less than a certain length text = text.replaceAll("\\b\\w{1,3}\\b\\s?", ""); // The DMM package doesn't do stop word removal! So I have to do this manually. for(String word : stopwords){ text = text.replace(word+"\\s*", ""); } // Again, remove strings that are too short! if(text.length() > 14) { filteredTweets.add(text); i++; } else { // This string is too short, so it must get removed. allTweets.remove(i); // don't increment i, since we just deleted this one. } } // Sentiment analysis doesn't need pre-processing. saveTweetsToFile(allTweets, multiLineFileRaw, true); // But our topics needs some stuff removed. saveTweetsToFile(filteredTweets, multiLineFile, true); saveTweetsToFile(filteredTweets, singleLineFile, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public /*User*/ void createUser (String username) throws TwitterException, JAXBException{\n\t\t\n \tSystem.out.println(\"STEP 1 - \" + username);\n \ttwitter4j.User user1 = twitter.showUser(username);\n \ttwCount ++;\n \t\n \tList<Status> status = twitter.getHomeTimeline();\n \ttwCount ++;\n \...
[ "0.55261254", "0.54645556", "0.5352847", "0.53520644", "0.5335739", "0.52572554", "0.52554077", "0.5230535", "0.52187", "0.5196925", "0.5196571", "0.5109679", "0.50773567", "0.50772965", "0.5063505", "0.5046088", "0.50181735", "0.49671543", "0.49483645", "0.49202374", "0.4881...
0.6898213
0
Returns the location of an entity's texture.
public ResourceLocation getEntityTexture(T entity) { return MINECART_TEXTURES; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Nullable\n Identifier getTexture(Entity entity);", "@Override\n\tprotected ResourceLocation getEntityTexture(Entity entity) {\n\t\treturn texture;\n\t}", "protected ResourceLocation getEntityTexture(T entity) {\n\t\treturn ORECART_TEXTURES;\n\t}", "protected ResourceLocation getEntityTexture(EntityBat en...
[ "0.7737521", "0.7619333", "0.7490298", "0.7455634", "0.74226344", "0.7328879", "0.73101807", "0.7187027", "0.7158409", "0.71406746", "0.708092", "0.7079353", "0.7039698", "0.69801784", "0.6976762", "0.6961041", "0.6943826", "0.69399685", "0.6933451", "0.67301005", "0.66951555...
0.79677564
0
creates a new attribute definition with the given attribute names.
public DTOAttributesDefinition(final String[] attributeNames) { this.attributeNames = attributeNames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "AttributeDeclarations createAttributeDeclarations();", "@Function Attr createAttribute(String name);", "Attribute createAttribute();", "Attribute createAttribute();", "protected abstract void createAttributes();", "public Attribute_New(String _name, String _value)\n {\n name = _name;\n\n ...
[ "0.7331354", "0.7192693", "0.7035916", "0.7035916", "0.6717199", "0.66095084", "0.65224785", "0.62960255", "0.61565584", "0.6130941", "0.6079487", "0.6069633", "0.5978656", "0.59575516", "0.5941707", "0.58540696", "0.58306676", "0.58254105", "0.58114696", "0.579068", "0.57567...
0.72537154
1
The default Configuration constructor is deprecated as of FreeMarker 2.3.21, in favor of specifying a compatibility version which is a 2.3.21 feature. We won't be able to call that for a long while, but custom subclasses can.
protected freemarker.template.Configuration newConfiguration(TemplateLoader templateLoader) throws IOException, TemplateException { return enhance ? new Configuration(templateLoader) : new freemarker.template.Configuration(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public FtlConfig() {\n cfg = new Configuration(Configuration.VERSION_2_3_30);\n cfg.setClassLoaderForTemplateLoading(this.getClass().getClassLoader(), \"ftl\");\n cfg.setDefaultEncoding(\"UTF-8\");\n cfg.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);\n cfg...
[ "0.61184615", "0.59128326", "0.5538234", "0.5486565", "0.54402167", "0.5409958", "0.53638774", "0.5322882", "0.5248332", "0.5168763", "0.51415277", "0.51303697", "0.50960386", "0.50664973", "0.50342816", "0.50322944", "0.49805495", "0.4953239", "0.4945808", "0.49423164", "0.4...
0.6797687
0
given a length of a side & the number of sides in the geometric object return the perimeter
public static double perimeter(double length, double sideCount) { return (length * sideCount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public double perimeter() {\n return 2 * (width + length);\n }", "public int perimeter()\n\t{\n\t\treturn 2*(length+width);\n\t}", "@Override\n public double perimeter()\n {\n\treturn (double) (2 * length + 2 * width);\n }", "@Override\n\tpublic double getperimeter() {\n\t\t...
[ "0.7907919", "0.7889066", "0.7833233", "0.77491456", "0.77030146", "0.7692465", "0.7575009", "0.7559337", "0.75538796", "0.75184864", "0.75184864", "0.75184864", "0.75184864", "0.75168556", "0.7514622", "0.75038296", "0.749413", "0.74715114", "0.74578476", "0.74578476", "0.74...
0.82746834
0
checks for serverside and adventure mode
private boolean isAdventureMode(EntityPlayer player) { /*if(player.worldObj.isRemote) { return isAdventureMode_Client(player); }*/ //return !player.worldObj.isRemote && ((EntityPlayerMP) player).theItemInWorldManager.getGameType().isAdventure(); return !(player instanceof FakePlayer) && !player.worldObj.isRemote && ((EntityPlayerMP) player).theItemInWorldManager.getGameType() != GameType.CREATIVE && !player.canCommandSenderUseCommand(2, "cv"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isServer() {\n return FMLCommonHandler.instance().getEffectiveSide().isServer();\n }", "private boolean getStandalone( HttpServletRequest request )\r\n {\r\n String strStandalone = request.getParameter( PARAMETER_STANDALONE );\r\n if ( strStandalone != null && ( s...
[ "0.6116218", "0.58993447", "0.5859084", "0.58256197", "0.5811633", "0.5797934", "0.5699095", "0.5687181", "0.56836194", "0.56824744", "0.56775844", "0.5591657", "0.5580736", "0.5543228", "0.5510845", "0.5458382", "0.5440485", "0.5425857", "0.5398703", "0.53731394", "0.5369662...
0.737766
0
TODO Autogenerated method stub
@Override public void start() { System.out.println(); if (showtimes.isFull()) { System.out.println("No seats are available!"); this.home(); return; } System.out.println("Seats available:"); this.showtimes.viewSeat(); System.out.println("0 : Proceed with booking"); System.out.println("1 : Back to menu"); int choice = this.getInputChoice(0, 1); this.run(choice); }
{ "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
method to allow user to choose whether to book a seat and purchase a ticket or not choice '0' calls method startBook() to prompt user on the steps to purchase a ticket choice '1' displays initial menu for users, under UserUI class
public void run(int choice) { switch(choice) { case 0: this.startBook(); break; case 1: this.home(); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void checkUserChoice(int userChoice) {\n\t\tif (userChoice == 1) {\n\t\t\tNewBookRecord goToEnterABook = new NewBookRecord();\n\t\t\tgoToEnterABook.enterNewRecordForAbook();\n\t\t\tuserChoosesFromMainMenu();\n\t\t}\n\t\telse if(userChoice == 2) {\n\t\t\tRecordUpdater updateBook = new RecordUpdater();\n\t\t\tupdate...
[ "0.67591155", "0.671611", "0.6673932", "0.66557485", "0.64555573", "0.63839155", "0.63338387", "0.63270855", "0.63262993", "0.6298189", "0.62923574", "0.6259524", "0.625233", "0.6227962", "0.62168676", "0.6202168", "0.62016696", "0.61931884", "0.6187759", "0.6173826", "0.6171...
0.0
-1
method for user to input their details: name, mobile number and email
public void startInfo() { System.out.println(); System.out.println("Enter your name:"); String name = this.getInputString(); System.out.println("Enter your mobile number:"); int number = this.getInputInteger(); System.out.println("Enter your email:"); String email = this.getInputString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Contact getContactDetails() {\n System.out.println(\"enter contact details ----\");\n Scanner scan = new Scanner(System.in);\n System.out.println(\"enter first name\");\n String firstName = scan.nextLine();\n\n System.out.println(\"enter last name\");\n Stri...
[ "0.6737787", "0.66835207", "0.66251427", "0.6594014", "0.6548709", "0.6434856", "0.6432407", "0.63160294", "0.6303022", "0.6263119", "0.6240302", "0.62374246", "0.62310666", "0.6219554", "0.61542326", "0.61351806", "0.6107951", "0.6099821", "0.607235", "0.60460347", "0.602649...
0.690724
0
method to prompt user to input the following details: number of tickets to purchase, which seat to book and moviegoer's age
public void startBook() { this.startInfo(); System.out.println(); int maxNoSeat = this.showtimes.getNoSeatAvailable(); System.out.println("How many tickets do you want to purchase? (Max:"+maxNoSeat+"):"); int choice = this.getInputChoice(1, maxNoSeat); // Array to store age of Movie-goers int[] ageArray = new int[choice]; for (int i=0; i< choice; ++i) { System.out.println(); this.showtimes.viewSeat(); System.out.println("Please choose your seat(s) (e.g. A1):"); int[] seat = this.getInputSeat(); this.showtimes.takeSeat(seat[0], seat[1]); System.out.println("Enter movie-goer's age:"); int age = this.getInputInteger(); ageArray[i] = age; } this.runBook(choice, ageArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void input() {\r\n System.out.print(\"Enter your employee ID number: \");\r\n ID = enter.nextDouble();\r\n \r\n System.out.print(\"Enter your Gross Pay: \");\r\n grosspay = enter.nextDouble();\r\n \r\n System.out.print(\"Enter your State Tax: \");\r\n ...
[ "0.65880466", "0.6392831", "0.63848937", "0.6347236", "0.6330825", "0.6305407", "0.6270314", "0.62604177", "0.6255567", "0.6246824", "0.6198384", "0.61519074", "0.61313707", "0.6118578", "0.6098021", "0.60922503", "0.60576767", "0.60540825", "0.60414445", "0.6020119", "0.5966...
0.69885296
0
method to show the total price of the user's purchase and calls method to update number of tickets sold as well as calculation of the price
public void runBook(int sales, int[] ageArray) { // Update ticket sales of movie MovieCRUD<Movie> movieCRUD = new MovieCRUD<>(Movie.class); movieCRUD.updateTicketSales(this.showtimes.getMovieId(), sales); double totalPrice =0; for (int i=0; i<sales; ++i) { System.out.println(); System.out.println("Ticket "+(i+1)+" : "); totalPrice += this.runPrice(ageArray[i]); } System.out.println("----------------"); System.out.println("Total Price: "+totalPrice); System.out.println("Transaction successful! Thank you for booking with MOBLIMA!"); // Create Booking History BookingCRUD<Booking> bookingCRUD = new BookingCRUD<>(Booking.class); bookingCRUD.createBooking(Cache.getUsername(), this.showtimes.getMovieId(), sales, DateTimeHelper.getTodayDate(), DateTimeHelper.getCurrentTime(), Showtimes.getCineplexId(), this.showtimes.getCinemaId()); this.home(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double purchasePrice();", "private void calcPrice() {\n double itemPrice = 0;\n \n //get price of burger (base)\n if (singleRad.isSelected())\n {\n itemPrice = 3.50;\n }\n else \n {\n itemPrice = 4.75;\n }\n \n //c...
[ "0.6901838", "0.6806877", "0.67966026", "0.67698157", "0.6735839", "0.66766644", "0.66392773", "0.6634149", "0.65862036", "0.65855086", "0.65470994", "0.6538788", "0.6531651", "0.65140754", "0.65097153", "0.64818394", "0.6480075", "0.6448438", "0.6442959", "0.6435658", "0.642...
0.0
-1