query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns the session that is registered with the calling thread. If none is currently registered, this method uses the given session factory to create one; it registers the created session with the calling thread and returns it.
public static Session currentSession(SessionFactory fac) throws HibernateException { Session s; if((s = (Session) _sessionRef.get()) == null) { s = fac.openSession(); _sessionRef.set(s); } else{ if(!s.isConnected())s.reconnect(); } return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Session currentSession() {\n \tif (sessionFactory == null) {\n \t\tinitialize();\n \t}\n \tif (singleSessionMode) {\n \t\tif (singleSession == null) {\n \t\t\tsingleSession = sessionFactory.openSession();\n \t\t}\n \t\treturn singleSession;\n \t} else {\n\t Session s...
[ "0.7035961", "0.6875407", "0.67117393", "0.66389877", "0.64866173", "0.63912433", "0.6311359", "0.6268478", "0.62540275", "0.6206162", "0.613382", "0.61072135", "0.6000505", "0.59759045", "0.59009326", "0.5876282", "0.5873759", "0.58671695", "0.5852798", "0.5810027", "0.58036...
0.5659282
37
Calls the reconnect() method on the given session and registers it with the calling thread.
public static void reconnect(Session session){ Session current = (Session)_sessionRef.get(); if(current != null){ if(current.equals(session)){ if(!current.isConnected())current.reconnect(); } else{ throw new IllegalStateException("Thread already registered with " + "another session; call unregister() or disconnect() prior to " + "calling this method"); } } else{ if(!session.isConnected()){ session.reconnect(); _sessionRef.set(session); } else{ _sessionRef.set(session); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void join(Session session){\n _sessionRef.set(session); \n if(!session.isConnected())session.reconnect();\n }", "@OnWebSocketConnect\n\tpublic void onConnect(Session session) {\n\t\tthis.session = session;\n\t\tlatch.countDown();\n\t}", "@Override\n\tpublic void reconnect() {\n\n\t}", ...
[ "0.6925233", "0.6325509", "0.6237023", "0.6064656", "0.6031797", "0.59831357", "0.5701897", "0.5542344", "0.55352354", "0.5509074", "0.5492861", "0.54885554", "0.5479821", "0.5473712", "0.54708606", "0.5421359", "0.54012316", "0.53940535", "0.53859484", "0.5336148", "0.531596...
0.8182437
0
Calls the disconnect() method on the session that is currently registered with the calling thread also unregisters that session from it.
public static void disconnect(){ Session session = (Session)_sessionRef.get(); if(session != null && session.isConnected()){ session.disconnect(); _sessionRef.set(null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void deRegister()\n {\n // stop the thread running...\n logger.debug(\"deregister called - invalidating session\");\n\n // remove from registered listeners and then invalidate the ScriptSession\n clients.remove(wctx.getScriptSession().getId());\n wctx.getSc...
[ "0.7126156", "0.66908985", "0.6469191", "0.6387686", "0.6359863", "0.63299197", "0.63043636", "0.6264877", "0.6252717", "0.6134835", "0.61180806", "0.61030525", "0.60908586", "0.60626453", "0.60538214", "0.60527533", "0.60470486", "0.60018677", "0.600117", "0.5994639", "0.599...
0.7266749
0
TODO Autogenerated method stub
@Override public void shoot(Plateau p) { if(!noMunition()) { useMunition(); //complete } }
{ "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
Constructor for the Address class initializing the variables to a predefined value
public Address() { City = "?"; State = "?"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Address() {\r\n\t\tsuper();\r\n\t}", "public Address() {\n\t\tsuper();\n\n\t}", "public Address() {\n \t\n }", "public Address() {\n\t}", "public Address() {\n\t\tthis.street = \"\";\n\t\tthis.city = \"\";\n\t\tthis.state= \"\";\n\t\tthis.zipCode = \"\";\n\t}", "public Address() {}", "publ...
[ "0.8208037", "0.81943715", "0.8069089", "0.78771204", "0.7832388", "0.7831862", "0.7686036", "0.7686036", "0.76774997", "0.7594384", "0.75885534", "0.7432772", "0.7246302", "0.7217801", "0.71546334", "0.7152588", "0.7142819", "0.70728004", "0.69884974", "0.6951749", "0.695168...
0.8206958
1
Returns the city string called through parameter of another method
public String getCity() { return City; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getCity();", "java.lang.String getCityName();", "public abstract String getCity();", "String askForCity();", "public void getCity(){\n }", "java.lang.String getArrivalAirportCity();", "java.lang.String getTransitAirportCity();", "java.lang.String getDepartureAirportCity();", "String getCi...
[ "0.78522444", "0.7501365", "0.73054296", "0.72447217", "0.7186835", "0.7029886", "0.6950338", "0.67935824", "0.6688535", "0.66802424", "0.66802067", "0.66767025", "0.6631003", "0.65808177", "0.6561517", "0.6543213", "0.64494544", "0.64335483", "0.64088106", "0.64084035", "0.6...
0.62491757
48
Returns the state string called through parameter of another method
public String getState() { return State; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getState();", "String getState();", "String getState();", "String getState();", "public abstract String getState();", "String getCalled();", "String getSelectedStateName();", "protected String getStatus()\n { return call_state; \n }", "public String getState( )\r\n {\r\n ...
[ "0.6927278", "0.6660126", "0.6660126", "0.6660126", "0.66309434", "0.6379986", "0.6356667", "0.62625194", "0.620275", "0.6079386", "0.6059298", "0.6049621", "0.60065836", "0.5991275", "0.59838367", "0.59838367", "0.59838367", "0.59838367", "0.5951505", "0.593513", "0.5911737"...
0.0
-1
Sets the value of the city which is called from the bankParser class
public void setCity(String city) { City = city; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setCity(String sValue);", "public void setCity(String city);", "public void setCity(String city){\n this.city = city;\n }", "public void setCity(String city) {\r\n this.city = city;\r\n }", "public void setCity(String city) {\r\n this.city = city;\r\n }", ...
[ "0.8043238", "0.79768586", "0.7891267", "0.7871812", "0.7871812", "0.77798015", "0.77798015", "0.77798015", "0.77798015", "0.77798015", "0.77798015", "0.77785", "0.77535295", "0.7732943", "0.7731622", "0.76667434", "0.7657522", "0.76567715", "0.76567715", "0.7609436", "0.7585...
0.7752981
13
Sets the value of the state which is called from the bankParser clss
public void setState(String state) { State = state; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract void setState(String sValue);", "public void SetState(int s) {\n this.state=LS[s];\n }", "void setState(int state);", "public void setState(String s) {\r\n\t\tstate = s;\t\t\r\n\t}", "public void setState(int state);", "public void setState(int state);", "public void setState(...
[ "0.73685354", "0.73223925", "0.7257586", "0.7193629", "0.7158969", "0.7158969", "0.7118256", "0.7107526", "0.71010035", "0.70165384", "0.7000848", "0.69997466", "0.69997466", "0.6974618", "0.69702667", "0.696421", "0.69555765", "0.69240993", "0.6921509", "0.6921509", "0.69215...
0.6932922
17
Outputs the bank location data to a nicely formatted string value
public String toString() { return String.format(City+","+State); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String LocationToString(Location location){\n StringBuilder sb = new StringBuilder();\n sb.append(\"( \").append(location.getBlockX()).append(\", \").append(location.getBlockY()).append(\", \").append(location.getBlockZ()).append(\" )\");\n return sb.toString();\n }", "publi...
[ "0.67994624", "0.67578155", "0.66681564", "0.6571989", "0.6545048", "0.6506311", "0.63950837", "0.6352846", "0.6300185", "0.6279846", "0.62747526", "0.6202055", "0.6198531", "0.61793274", "0.61575943", "0.61111903", "0.61104727", "0.610471", "0.6097348", "0.60972595", "0.6091...
0.5875602
51
POST /api/v1/blob API to upload image.
@PostMapping public ResponseEntity<BlobImage> saveImage(@RequestBody BlobStoreRequest request) { logger.info("Got a request to save an image: {}", request.getMd5()); BlobImage blob = BlobImage.builder() .build(); blob = repository.save(blob); String storageLocation = properties.getStorageLocation(); String uploadDir = storageLocation + "/" + blob.getId(); blob.setImageUri(ServletUriComponentsBuilder.fromCurrentContextPath().path("/api/v1/blob/{id}") .buildAndExpand(blob.getId()).toUriString()); blob.setFileNameWithAbsolutePath(uploadDir); repository.save(blob); return ResponseEntity.ok(blob); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@PostMapping\n @PreAuthorize(KekRoles.USER_ADMIN)\n public ResponseEntity<String> addData(@RequestBody String image) {\n logger.info(\"Accepted requested to upload data to Cloud Storage for user\");\n\n byte[] encodedByte = Base64.decodeBase64(image.getBytes());\n\n ICloudStorageObject c...
[ "0.6580682", "0.6558491", "0.63637364", "0.6309801", "0.6256247", "0.61002934", "0.60574996", "0.6008862", "0.5974822", "0.59278476", "0.5920919", "0.5915843", "0.5854843", "0.57947624", "0.5777175", "0.57125294", "0.5634185", "0.56316656", "0.5630732", "0.5624866", "0.559931...
0.72778815
0
A > B B > C B > D
@Test public void checkAlreadyMinimal() { Set<FunctionalDependency> input = set( new FunctionalDependency(set("A"), set("B")), new FunctionalDependency(set("B"), set("C")), new FunctionalDependency(set("B"), set("D"))); Set<FunctionalDependency> output = minimalBasisSolver.findMinimal(input); assertEquals(input, output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n void test_check_order_properly_increased_and_decreased() {\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"C\");\r\n graph.addVertex(\"D\");\r\n graph.addVertex(\"C\");\r\n if(graph.order() != 3) {\r\n fail();\r\n } \r\n graph.removeVer...
[ "0.49892274", "0.48917753", "0.48543546", "0.48262545", "0.4672898", "0.46662152", "0.46632472", "0.46603048", "0.4657978", "0.46387768", "0.4611793", "0.4610984", "0.46011242", "0.45968136", "0.4592379", "0.45912254", "0.4585043", "0.45848504", "0.4575448", "0.4571792", "0.4...
0.0
-1
here we did not use "void" because we want to get something which is string(get message) so we used String in the declaration.
public String confirmationMessage() { return confMessageLabel.getText(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String Message ();", "Object getMessage();", "java.lang.String getMsg();", "java.lang.String getTheMessage();", "public void getMessage() {\n\r\n\t}", "private void showMsg1(String string) { TODO Auto-generated method stub\n//\n }", "private void showMsg1(String string) { TODO Auto-generated met...
[ "0.73819363", "0.7211914", "0.7192173", "0.7175878", "0.7059235", "0.6890137", "0.6890137", "0.68800956", "0.68753684", "0.68435013", "0.68435013", "0.6819042", "0.6811645", "0.6793354", "0.67803466", "0.67474073", "0.6743045", "0.6743045", "0.6743045", "0.6692773", "0.662031...
0.0
-1
we are not defining any object inside ChangePasswordLinkText() because we are going to click the linktext.
public void changePasswordLinkText() { changePasswordLinkText.click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\r\n public static void tc_ClickChange_Password()\t\r\n {\n\t GenericFunctions.launchApplication(\"firefox\");\r\n\t \r\n\t //We get business logic here as we used page factory\r\n\t Admin_ClickChangePassword clk_passwword = PageFactory.initElements(driver, Admin_ClickChangePassword.class);\r\n\t...
[ "0.6662004", "0.6605517", "0.6513483", "0.651224", "0.64974606", "0.6493783", "0.64904684", "0.63113135", "0.6299191", "0.62974924", "0.6260728", "0.6209351", "0.61176986", "0.60733163", "0.60688376", "0.6064031", "0.60469556", "0.60257035", "0.60141337", "0.6000121", "0.5958...
0.84287953
0
keep call for getLogLevel() instead of logLevel for inheritance
public boolean isLoggingEnabled() { return !Level.OFF.equals(getLogLevel()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LogLevel getLogLevel();", "TreeLogger.Type getLogLevel() {\n return logLevel;\n }", "public static int getLevel(){\n\treturn logLevel;\n }", "public int getLogLevel() {\n return logLevel;\n }", "private void changeLogLevel(String level){\n\n }", "@Override\n public Level getLevel()...
[ "0.7521969", "0.7317561", "0.7262226", "0.71782446", "0.70462537", "0.7000493", "0.6963774", "0.6883398", "0.687079", "0.6865582", "0.6841571", "0.6780279", "0.6773985", "0.6737658", "0.66974616", "0.66675895", "0.66657096", "0.6598572", "0.6521975", "0.6494592", "0.6488346",...
0.0
-1
/ Search for the init file using the system property, then the current directory, then the home directory. It need not exist at all.
private String searchForInitFileName() { String homeDirectoryInitFileName = System.getProperty("user.home") + File.separatorChar + DEFAULT_INIT_FILE_NAME; String currentDirectoryInitFileName = System.getProperty("user.dir") + File.separatorChar + DEFAULT_INIT_FILE_NAME; String systemPropertyInitFileName = System.getProperty(INIT_FILE_PROPERTY); String[] initFileNames = {systemPropertyInitFileName, currentDirectoryInitFileName, homeDirectoryInitFileName}; for (String initFileName : initFileNames) { if (IOUtils.isExistingPathname(initFileName)) { return initFileName; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init() {\r\n\t\t// check system property\r\n\t\tif (System.getProperty(TACOS_HOME) != null) {\r\n\t\t\tFile customHome = new File(System.getProperty(TACOS_HOME));\r\n\t\t\tif (initHome(customHome)) {\r\n\t\t\t\thomeDir = customHome;\r\n\t\t\t\tlogger.info(\"Using custom home directory ('\" + homeDir +...
[ "0.7188391", "0.6532036", "0.6503692", "0.6439489", "0.6067845", "0.6056374", "0.6019784", "0.600603", "0.59715086", "0.59539455", "0.58866143", "0.58373153", "0.58350086", "0.577915", "0.57418114", "0.57310313", "0.5709284", "0.5705879", "0.56847227", "0.5643674", "0.5621035...
0.7629849
0
Avanzamos el atributo indice hasta que encontramos una posicion en el array set.bv con el valor cierto.
protected int findNonEmptyPosition() { while (!set.bv[++indice]) { } return indice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public E get(int idx, E b) {\n assert idx >= 0;\n\n if(v == array[idx]){\n\t\treturn v;\n\t}\n\t\n\tif(array[idx] == null){\n\t\treturn b;\n\t}\n\treturn b;\n }", "private int AttrIndex(String val)\n {\n int ret = MainGUI.ComboBoxIndexOf(m_Attributes[0],val);\n return ret;\n }", "int...
[ "0.57663304", "0.55560815", "0.5535961", "0.54146546", "0.53574544", "0.52944005", "0.52562296", "0.5211704", "0.5176696", "0.51176506", "0.50464815", "0.5035144", "0.49962297", "0.49953154", "0.4977104", "0.49655852", "0.49539298", "0.49501568", "0.49313936", "0.49308306", "...
0.53878504
4
Created by atursunov on 12.01.17.
public interface ResourceItemDao { ResourceItemEntity getResourceById(Integer id); List<ResourceItemEntity> listResources(); void addResourceItem(ResourceItemEntity resourceItemEntity); void updateResourceItem(ResourceItemEntity resourceItemEntity); void removeResourceItem(Integer id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private voi...
[ "0.58142096", "0.5696292", "0.5687053", "0.56123704", "0.56123704", "0.56091046", "0.5597723", "0.55874693", "0.5561962", "0.5515567", "0.5502064", "0.54887855", "0.54886574", "0.54830515", "0.5478956", "0.5475745", "0.5474781", "0.54727757", "0.5455471", "0.54539806", "0.545...
0.0
-1
This interface defines a strategy containing method for calculating strategy percent
public interface Strategy { /** * This method is used to fetch the strategy percent for given two files * @return strategy percent for given two files */ int calcPlagiarismPercent() throws ParserException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface DiscountStrategy {\n\n /**\n * Returns the discount amount given a quantity and a price.\n * @param qty\n * @param price\n * @return a double value for discount amount\n */\n public abstract double getDiscount(int qty, double price);\n \n /**\n * A getter for th...
[ "0.6874303", "0.6662423", "0.6650926", "0.66287726", "0.6570766", "0.65522045", "0.64989513", "0.64414024", "0.6345835", "0.6340947", "0.6276729", "0.6189903", "0.61841214", "0.616882", "0.6151481", "0.6122867", "0.60421634", "0.6041517", "0.603415", "0.60310423", "0.60247785...
0.7418374
0
This method is used to fetch the strategy percent for given two files
int calcPlagiarismPercent() throws ParserException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Strategy {\n\n /**\n * This method is used to fetch the strategy percent for given two files\n * @return strategy percent for given two files\n */\n int calcPlagiarismPercent() throws ParserException;\n}", "@Test\n public void testGetPercentageForN() throws FileNotFoundExcep...
[ "0.67881125", "0.6200499", "0.6031513", "0.59916997", "0.5894061", "0.57423353", "0.57283586", "0.57256913", "0.57229775", "0.5666554", "0.56662816", "0.5638283", "0.5615517", "0.5554109", "0.5546421", "0.5515382", "0.5508907", "0.55084443", "0.5494237", "0.5455921", "0.54280...
0.51016366
47
/ [2,1,3,4,1,2,1,5,4], Output: 6 Explanation: [4,1,2,1]
public int maxSubArray(int[] nums) { int maxValue = Integer.MIN_VALUE; int currentSum = 0; for(int i = 0; i < nums.length;i++){ currentSum = Math.max(currentSum + nums[i],nums[i]); maxValue = Math.max(maxValue,currentSum); } return maxValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static int pickingNumbers(List<Integer> a) {\n Collections.sort(a);\n List<Integer> result = new ArrayList<>();\n int counter = 0;\n\n for (int i = 0; i < a.size(); i++) {\n for (int j = i; j < a.size(); j++) {\n if(a.get(i)+1 >= a.get(j)){\n ...
[ "0.62684816", "0.61721796", "0.604816", "0.5990299", "0.5969708", "0.59382087", "0.58960897", "0.5858332", "0.58409184", "0.58340085", "0.580907", "0.57953084", "0.57925534", "0.57790774", "0.57765186", "0.5762605", "0.57622546", "0.57403433", "0.57402176", "0.5738099", "0.57...
0.0
-1
Creates an instance of the ship
protected Ship(int length) { this.length = length; size = 0; cells = new Cell[length]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Ship newShip(GameScreen screen){\n\t\tthis.ship = new Ship(screen);\n\t\treturn ship;\n\t}", "public Ship(){\n\t}", "private void placeShip() {\r\n\t\t// Expire the ship ship\r\n\t\tParticipant.expire(ship);\r\n\r\n\t\tclipShip.stop();\r\n\r\n\t\t// Create a new ship\r\n\t\tship = new Ship(SIZE / 2, SIZ...
[ "0.7917552", "0.7415041", "0.72906184", "0.7119289", "0.6982989", "0.68298453", "0.67919093", "0.67712665", "0.67259884", "0.67079604", "0.66618955", "0.6651204", "0.6423363", "0.6350574", "0.6325597", "0.62632793", "0.62286276", "0.6205866", "0.61837274", "0.6175724", "0.616...
0.5762717
57
Returns the size of the ship.
protected int getLength() { return length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getSize(){\n\t\treturn shipSize;\n\t}", "public int getShipLength() {\n return shipLength;\n }", "@Override\r\n\tpublic int getPegCount() {\r\n\t\tint shipSize = 3;\r\n\t\treturn shipSize;\r\n\t}", "public static Integer getNumberOfships() {\n\t\treturn NUMBEROFSHIPS;\n\t}", "public st...
[ "0.9081778", "0.83131707", "0.72653717", "0.6936789", "0.690914", "0.68614966", "0.6843067", "0.6841321", "0.6805163", "0.6797511", "0.679412", "0.6785266", "0.67811537", "0.67734516", "0.6773265", "0.6760098", "0.6742312", "0.67396677", "0.6731091", "0.6669141", "0.66632456"...
0.0
-1
Gives a name of a Battleship.
@Override public String toString() { return "Ship"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getShipName() {\n return shipName;\n }", "public java.lang.String getShipName() {\n\t\treturn _tempNoTiceShipMessage.getShipName();\n\t}", "@Override\r\n\tpublic String getName() {\r\n\t\tString shipName = \"Destroyer\";\r\n\t\treturn shipName;\r\n\t}", "java.lang.String getGameName()...
[ "0.720346", "0.6951002", "0.686475", "0.66525096", "0.66525096", "0.65139717", "0.64379764", "0.6269275", "0.6251613", "0.624946", "0.6208104", "0.6141288", "0.5967893", "0.59668237", "0.5958212", "0.5937763", "0.59138584", "0.5884067", "0.5834524", "0.5834524", "0.5834524", ...
0.62821805
7
Adds new cell that ship occupies.
protected void addCell(Cell cell) { cells[size] = cell; ++size; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addCell(Cell cell) \n {\n cells.add(cell);\n }", "public void addCell(TCell cell) {\n\tcell.Owner = this;\n\tcolorize(cell);\n\tCells.add(cell);\n }", "public void addCell(Cell cell) {\r\n int cellNum = cells.size() + 1;\r\n cell.updateCellNum(cellNum);\r\n cells.add(cell);...
[ "0.6970897", "0.6477376", "0.64752126", "0.6320551", "0.62395585", "0.61964273", "0.6137263", "0.60992014", "0.6046389", "0.60068446", "0.5992857", "0.5973878", "0.59008616", "0.5895551", "0.58692336", "0.586284", "0.583429", "0.5830692", "0.58153594", "0.5808483", "0.5795345...
0.6506573
1
Check if the ship still alive. If not, all cells will be marked as Sunk.
protected void checkIfAfloat() { boolean isAllHit = Arrays.stream(cells).allMatch(val -> val.getType() == CellType.FiredHit); if(isAllHit) { for (var cell : cells) { cell.setType(CellType.Sunk); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isSunk() {\n\t\tfor (Coordinate coordinate : shipPositions) {\n\t\t\tif (!coordinate.getIsHit()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public void checkShipsSunk() {\n int sunkships = 0;\n int pos = 0; \n Ship ship;\n for(int i =0; i<5; i++)...
[ "0.732688", "0.70689666", "0.6888555", "0.68714094", "0.6823438", "0.68115973", "0.6785698", "0.67023635", "0.66979134", "0.66209245", "0.661264", "0.65645427", "0.6554825", "0.653517", "0.6527153", "0.6480167", "0.6443168", "0.6358635", "0.63513523", "0.63317674", "0.6301037...
0.0
-1
Initialize the contents of the frame.
private void initialize() { pop.connect(); frame = new JFrame(); frame.setBounds(100, 100, 500, 400); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().setLayout(null); lblNewLabel = new JLabel("Hello "+ pop.first+ " " + pop.last); lblNewLabel.setFont(new Font("Lucida Grande", Font.PLAIN, 24)); lblNewLabel.setBounds(18, 6, 350, 20); frame.getContentPane().add(lblNewLabel); JLabel lblNewLabel_1 = new JLabel("Server"); lblNewLabel_1.setBounds(395, 90, 75, 40); lblNewLabel_1.setFont(new Font("Lucida Grande", Font.PLAIN, 14)); frame.getContentPane().add(lblNewLabel_1); JButton btnNewButton = new JButton("Start"); btnNewButton.setBounds(380, 120, 75, 40); frame.getContentPane().add(btnNewButton); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Socket client = new Socket("mastacademy.ddns.net", 80); OutputStream out = client.getOutputStream(); out.write("serverStatus:on".getBytes()); out.flush(); out.close(); client.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); JButton btnNewButton_1 = new JButton("Stop"); btnNewButton_1.setBounds(380, 160, 75, 40); frame.getContentPane().add(btnNewButton_1); btnNewButton_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { Socket client = new Socket("mastacademy.ddns.net", 80); OutputStream out = client.getOutputStream(); out.write("serverStatus:off".getBytes()); out.flush(); out.close(); client.close(); } catch (IOException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } } }); JButton btnEditSettings = new JButton("Edit Settings"); btnEditSettings.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { editConnection.newFrame(null); } }); btnEditSettings.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); btnEditSettings.setBounds(370, 302, 95, 40); frame.getContentPane().add(btnEditSettings); JButton btnEditStudents = new JButton("Edit Students"); btnEditStudents.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { EditWindow.NewWindow(); } }); btnEditStudents.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); btnEditStudents.setBounds(370, 265, 95, 40); frame.getContentPane().add(btnEditStudents); JButton btnRefresh = new JButton("Refresh"); btnRefresh.setFont(new Font("Lucida Grande", Font.PLAIN, 12)); btnRefresh.setBounds(370, 227, 95, 40); frame.getContentPane().add(btnRefresh); btnRefresh.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Thread t = new Thread(new Runnable() { @Override public void run() { frame.setTitle("Working"); graphMaker.getGraphs(); //Updates all the images in the tabs to the recently made ones mathLbl.setIcon(getImageIcon(new File("mathPieChart.png"))); socialStudiesLbl.setIcon(getImageIcon(new File("socialPieChart.png"))); scienceLbl.setIcon(getImageIcon(new File("sciencePieChart.png"))); languageLbl.setIcon(getImageIcon(new File("languagePieChart.png"))); englishLbl.setIcon(getImageIcon(new File("englishPieChart.png"))); artLbl.setIcon(getImageIcon(new File("artPieChart.png"))); peLbl.setIcon(getImageIcon(new File("pePieChart.png"))); frame.setTitle(""); } }); t.start(); } }); JLabel lblNewLabel_9 = new JLabel("Today is:"); lblNewLabel_9.setBounds(420, -20, 100, 100); frame.getContentPane().add(lblNewLabel_9); GregorianCalendar gcalendar = new GregorianCalendar(); String day = ("" + gcalendar.get(Calendar.DATE) + "/"); String month = ("" + (gcalendar.get(Calendar.MONTH)+1) + "/"); String year = ("" + gcalendar.get(Calendar.YEAR)); JLabel lblNewLabel_8 = new JLabel(month + day + year); lblNewLabel_8.setBounds(420, 0, 100, 100); frame.getContentPane().add(lblNewLabel_8); tabbedPane = new JTabbedPane(JTabbedPane.TOP); tabbedPane.setBounds(5, 50, 350, 300); frame.getContentPane().add(tabbedPane); mathLbl = new JLabel(); mathLbl.setIcon(getImageIcon(new File("mathPieChart.png"))); tabbedPane.add("Math", mathLbl); socialStudiesLbl = new JLabel(); tabbedPane.addTab("Social Studies", socialStudiesLbl); socialStudiesLbl.setIcon(getImageIcon(new File("socialPieChart.png"))); scienceLbl = new JLabel(); tabbedPane.addTab("Science", scienceLbl); scienceLbl.setIcon(getImageIcon(new File("sciencePieChart.png"))); englishLbl = new JLabel(); tabbedPane.addTab("English", englishLbl); englishLbl.setIcon(getImageIcon(new File("englishPieChart.png"))); languageLbl = new JLabel(); tabbedPane.addTab("Language", languageLbl); languageLbl.setIcon(getImageIcon(new File("languagePieChart.png"))); artLbl = new JLabel(); tabbedPane.addTab("Art", artLbl); artLbl.setIcon(getImageIcon(new File("artPieChart.png"))); peLbl = new JLabel(); tabbedPane.addTab("PE", peLbl); peLbl.setIcon(getImageIcon(new File("pePieChart.png"))); JButton btnResort = new JButton("Sort"); btnResort.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { //pop.makeStudents();//TAKE THIS OUT FOR FINAL RELEASE (new Thread((new pop()))).start(); //sorts students and makes graphs } }); btnResort.setBounds(286, 18, 97, 25); frame.getContentPane().add(btnResort); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public BreukFrame() {\n super();\n initialize();\n }", "public MainFrame() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "private void initialize() {\n\t\tthis.setSize(211, 449);\n\t\tthis.setContentPane(getJContentPane());\n\t\tthis.setTitle(\"JFrame\");\n\t}", "public SiscobanFrame() {\r\n\t\tsuper();\r...
[ "0.77704835", "0.75652915", "0.7442664", "0.7369101", "0.7366378", "0.7358479", "0.73146075", "0.73096764", "0.72987294", "0.72978777", "0.7278321", "0.72729623", "0.7269468", "0.7269468", "0.7215727", "0.7180792", "0.71682984", "0.7140954", "0.7140953", "0.7126852", "0.71079...
0.0
-1
pop.makeStudents();//TAKE THIS OUT FOR FINAL RELEASE
public void actionPerformed(ActionEvent arg0) { (new Thread((new pop()))).start(); //sorts students and makes graphs }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static Student[] makeStudents() {\n\t\treturn null;\n\t}", "public void setStudents() {\n\t}", "public static void main(String[] args) {\n Student s1 = new Student(\"Azat\");\n Student s2 = new Student(\"Saida\");\n Student s3 = new Student(\"Adil\");\n Student s4 = new Stud...
[ "0.70931107", "0.69833297", "0.6794665", "0.6662871", "0.65992737", "0.65363187", "0.64836425", "0.6373245", "0.6333821", "0.6333522", "0.6324619", "0.62854826", "0.6140017", "0.6138683", "0.6130075", "0.61154974", "0.6112689", "0.6102154", "0.60656345", "0.60090333", "0.6008...
0.0
-1
RETORNA UMA LISTA DE POST.
@Override public List<Post> findAll() { return codeblogRepository.findAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void postulerFormateur(List<Session> list) {// OK\r\n\r\n\t\tfor (Session session : list) {\r\n\t\t\tString valID = String.valueOf(session.getId());\r\n\t\t\tString prio = String.valueOf(session.getPrio());\r\n\r\n\t\t\tservice.path(idConnexion + \"/submit\").queryParam(\"role\", \"Formateur\").queryParam(\...
[ "0.6476477", "0.6439051", "0.6274939", "0.6195895", "0.6192016", "0.6081358", "0.6066594", "0.60580295", "0.59502906", "0.5943687", "0.59327084", "0.58956623", "0.5861612", "0.58192664", "0.5797677", "0.57964766", "0.57949233", "0.57872164", "0.57833004", "0.5781804", "0.5757...
0.0
-1
better load from SharedPreference
@Override public void init(Context context) { mShowBorder = true; mShowDp = false; mShowSp = true; mShowColor = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadPreferences() {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n boolean lm = sp.getBoolean(getString(R.string.live_match), true);\n boolean ls = sp.getBoolean(getString(R.string.live_score), true);\n\n if(lm) live_match.se...
[ "0.7581072", "0.72034067", "0.7149026", "0.7071774", "0.69896436", "0.696677", "0.694355", "0.693843", "0.6904328", "0.6902917", "0.6891415", "0.6811136", "0.6780917", "0.6729046", "0.67217296", "0.6692077", "0.66833705", "0.66833705", "0.6680789", "0.66693604", "0.66511416",...
0.0
-1
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_login, container, false); email = (EditText) rootView.findViewById(R.id.email); password = (EditText) rootView.findViewById(R.id.password); submitBtn = (Button) rootView.findViewById(R.id.submitBtn); forgotbtn = rootView.findViewById(R.id.forgotbtn); forgotbtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { forgotPassword(); } }); submitBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (!TextUtils.isEmpty(email.getText().toString()) && !TextUtils.isEmpty(password.getText().toString())) getData(email.getText().toString(), password.getText().toString()); else Toast.makeText(getContext(), "Please fill all of the required fields.", Toast.LENGTH_LONG).show(); } }); return rootView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_main_allinfo, container, false);\n }", "@Override\r\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup...
[ "0.6739604", "0.67235583", "0.6721706", "0.6698254", "0.6691869", "0.6687986", "0.66869223", "0.6684548", "0.66766286", "0.6674615", "0.66654444", "0.66654384", "0.6664403", "0.66596216", "0.6653321", "0.6647136", "0.66423255", "0.66388357", "0.6637491", "0.6634193", "0.66251...
0.0
-1
Marker interface for an exception that is an expected part of the application flow. Hoist may log exceptions of this type minimally or not at all. They primarily exist to provide outofband responses from the server to the client. They specifically do NOT indicate unexpected or unhandled bugs in serverside code or processing that should trigger alerts or require fixing. For example usages of this interface within Hoist:
public interface RoutineException {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface ExceptionHandler\n{\n //TODO not sure how to handle this\n}", "public interface Thrower {\n\n String throwing();\n}", "protected interface ProvideError {\n Exception getError();\n }", "public interface UserExceptionMessage {\n String getMessage();\n}", "public interface Exceptio...
[ "0.67008084", "0.63740844", "0.63106334", "0.6229851", "0.6107058", "0.5972165", "0.5967594", "0.59655625", "0.595868", "0.5946195", "0.59427214", "0.5933558", "0.5924907", "0.5910117", "0.5885617", "0.5825704", "0.5790866", "0.57783914", "0.5776139", "0.57753927", "0.5692794...
0.55220234
43
Solves an optimisation problem: Optimal transportation costs with respect to The required products and the required amount The available products and their provided amount per providing store The distances between the requiring and the providing store
public Hashtable<StoreTO, Collection<ProductAmountTO>> solveOptimization( Collection<ProductAmountTO> requiredProductAmounts, Hashtable<Store, Collection<StockItem>> storeStockItems, Hashtable<Store, Integer> storeDistances) { Hashtable<StoreTO, Collection<ProductAmountTO>> returnTable = new Hashtable<StoreTO, Collection<ProductAmountTO>>(); StringBuffer output = new StringBuffer(); Ampl ampl = null; //grant pre-conditions of the solver: requiredProductAmounts = removeUnavailableProducts(requiredProductAmounts, storeStockItems); // pre-condition: > 0 product remain required after removeUnavailableProducts() if(requiredProductAmounts.size() > 0) { //else empty hashtable is returned try { // create the data input file createTmpFile(amplDir + "cocome.dat", createDataString(requiredProductAmounts, storeStockItems, storeDistances) ); // set up commands for ampl: String amplCommands = "option solver " + "cplex.exe;\n" + "model " + amplDir + "cocome.mod;\n" + "data " + amplDir + "cocome.dat;\n" + "solve;\n" + "display shipping_amount;\n"; // execute the command line solver: AMPL / CPLEX ampl = new Ampl(amplCmd); ampl.send(amplCommands); output.append(ampl.rcv()); } catch (Exception e) { System.err.println(e + " starting " + amplCmd); e.printStackTrace(); } System.out.println(output); returnTable = parseOutput(output.toString()); } return returnTable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void solveUsingLeastCostMethod() {\n\n this.solution = new Solution();\n\n Source[] proxySources = Arrays.copyOf(sources, sources.length);\n Destination[] proxyDestinations = Arrays.copyOf(destinations, destinations.length);\n int[][] matrix = new int[costs.length][costs[0].lengt...
[ "0.6802888", "0.65086156", "0.6492173", "0.62890464", "0.61817396", "0.61543304", "0.61490756", "0.60627323", "0.6043718", "0.604001", "0.601181", "0.5884631", "0.5875609", "0.58612984", "0.5857556", "0.5855236", "0.5834004", "0.58331555", "0.5832462", "0.58223087", "0.581862...
0.7314188
0
CPLEX (solver) is not able to handle suboptimal solutions where not all required products are available with a suffient amount. Products that are not available at all are removed from the requiredProductAmounts. Used to grant preconditions of CPLEX: there must be a solution to make CPLEX deliver results.
private Collection<ProductAmountTO> removeUnavailableProducts( Collection<ProductAmountTO> requiredProductAmounts, Hashtable<Store, Collection<StockItem>> storeStockItems) { Collection<ProductAmountTO> foundProductAmounts = new ArrayList<ProductAmountTO>(); Iterator<ProductAmountTO> requiredProductAmountsIterator = requiredProductAmounts.iterator(); while(requiredProductAmountsIterator.hasNext()) { ProductAmountTO currentProductAmountTO = requiredProductAmountsIterator.next(); Iterator<Collection<StockItem>> storeStockItemCollectionsIterator = storeStockItems.values().iterator(); while(storeStockItemCollectionsIterator.hasNext()) { //iterate over stock of stores Collection<StockItem> currentStockItemCollection = storeStockItemCollectionsIterator.next(); StockItem stockItem = searchForProductOffered(currentStockItemCollection, currentProductAmountTO); if (stockItem != null && currentStockItemCollection.contains(stockItem)) { foundProductAmounts.add(currentProductAmountTO); } else { //TODO: remove debug: // System.out.println("KK: NOT found"); } //no need to search for the same product at other stores: found --> available break; } } return foundProductAmounts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Hashtable<StoreTO, Collection<ProductAmountTO>> solveOptimization(\n\t\t\tCollection<ProductAmountTO> requiredProductAmounts,\n \t\tHashtable<Store, Collection<StockItem>> storeStockItems,\n \t\tHashtable<Store, Integer> storeDistances) {\n\t\t\n\t\tHashtable<StoreTO, Collection<ProductAmountTO>> retu...
[ "0.61846095", "0.5883697", "0.55410284", "0.55383354", "0.5537547", "0.5491542", "0.5386442", "0.5344335", "0.5310048", "0.5304817", "0.5280531", "0.52437854", "0.5189599", "0.51872283", "0.5176644", "0.51716036", "0.51505995", "0.5149949", "0.51172626", "0.5102865", "0.50951...
0.5817967
2
Creates the AMPL input data format string. Typical output: param: STORE: dist := "KA" 20 "OL" 32 "FFM" 74 "M" 30 "B" 50 ; param: PRODUCT: amount := "Nutella" 5 "Snickers" 3 ; param stock (tr): "Nutella" "Snickers" := "KA"302 "OL" 440 "FFM" 010 "M"100 "B"257 ;
private static String createDataString( Collection<ProductAmountTO> requiredProductAmounts, Hashtable<Store, Collection<StockItem>> storeStockItems, Hashtable<Store, Integer> storeDistances) { StringBuffer output = new StringBuffer(); appendStoreDistances(storeDistances, output); appendRequiredProductAmounts(requiredProductAmounts, output); appendOfferingStoresProductsAmountsMatrix(storeStockItems, requiredProductAmounts, output); return output.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String testString() {\n\t return\n\t \"CPLEX 10.1.0: optimal integer solution; objective 0\\n\" +\n\t \"0 MIP simplex iterations\\n\" +\n\t \"0 branch-and-bound nodes\\n\" +\n\t \"shipping_amount [*,*] (tr)\\n\" +\n\t \"# $1 = Product98464\\n\" +\n\t \"# $2 = Product9...
[ "0.5446827", "0.5234872", "0.5112053", "0.49452254", "0.48796684", "0.48325172", "0.47571486", "0.471947", "0.46177992", "0.46118045", "0.46020895", "0.4591047", "0.45527282", "0.45353648", "0.45302045", "0.45296392", "0.45290345", "0.4527166", "0.4507465", "0.44995892", "0.4...
0.6356555
0
Searches offeredStockItems for currentRequiredProduct
private static StockItem searchForProductOffered(Collection<StockItem> offeredStockItems, ProductAmountTO currentRequiredProduct) { Iterator<StockItem> stockItemIterator = offeredStockItems.iterator(); StockItem currentStockItem; while(stockItemIterator.hasNext()) { currentStockItem = stockItemIterator.next(); ProductTO productTO = FillTransferObjects.fillProductTO(currentStockItem.getProduct()); if(productTO.equals(currentRequiredProduct.getProduct())) { return currentStockItem; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Collection<ProductAmountTO> removeUnavailableProducts(\n\t\t\tCollection<ProductAmountTO> requiredProductAmounts,\n\t\t\tHashtable<Store, Collection<StockItem>> storeStockItems) {\n\t\t\n\t\tCollection<ProductAmountTO> foundProductAmounts = new ArrayList<ProductAmountTO>();\n\t\t\n\t\tIterator<ProductAmoun...
[ "0.67921466", "0.6500642", "0.63037413", "0.61410004", "0.6017453", "0.5917665", "0.5863155", "0.58031946", "0.5776207", "0.57257825", "0.5684685", "0.56596804", "0.56464833", "0.561087", "0.5588932", "0.55850583", "0.5584709", "0.55805224", "0.55789816", "0.55337286", "0.553...
0.83365035
0
Data input for AMPL
private String testString() { return "CPLEX 10.1.0: optimal integer solution; objective 0\n" + "0 MIP simplex iterations\n" + "0 branch-and-bound nodes\n" + "shipping_amount [*,*] (tr)\n" + "# $1 = Product98464\n" + "# $2 = Product98783\n" + "# $4 = Product98989\n" + "# $6 = Product99172\n" + "# $7 = Product98911\n" + "# $8 = Product98970\n" + "# $9 = Product98991\n" + "# $10 = Product99022\n" + "# $11 = Product98803\n" + ": $1 $2 Product98731 $4 Product99036 $6 $7 $8 $9 $10 $11 :\n" + "=\n" + "Store65536 9 9 0 9 19 11 11 16 12 12 17\n" + "Store65583 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65581 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65627 0 0 18 0 0 0 0 0 0 0 0\n" + "Store65542 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65631 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65546 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65625 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65610 0 0 0 3 4 0 0 0 0 0 0\n" + "Store65620 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65603 0 0 0 0 0 0 0 0 0 0 0\n" + "Store65634 0 1 0 0 0 0 0 0 0 0 222\n" + ";\n"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tvoid getData() {\n\t\tSystem.out.println(\"Enter Brand\");\n\t\tbrand=a.next();\n\t\tSystem.out.println(\"Enter model\");\n\t\tmodel=a.next();\n\t\tSystem.out.println(\"Enter CC\");\n\t\tcc=a.nextDouble();\n\t}", "@DataProvider(name = \"InputData\")\n\t \n\t public static Object[][] inputData() {\n...
[ "0.62585896", "0.5830961", "0.57600254", "0.5552511", "0.55346227", "0.55295306", "0.5467921", "0.54672533", "0.5449619", "0.54382956", "0.53607357", "0.53472376", "0.53310573", "0.5292221", "0.52766347", "0.5263004", "0.52394086", "0.52374816", "0.52291197", "0.52277946", "0...
0.0
-1
Called if InstanceID token is updated. This may occur if the security of the previous token had been compromised. Note that this is called when the InstanceID token is initially generated so this is where you would retrieve the token.
@Override public void onNewToken(String token) { Log.d(TAG, "Refreshed token: " + token); // If you want to send messages to this application instance or // manage this apps subscriptions on the server side, send the // Instance ID token to your app server. enviaTokenParaServidor(token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onTokenRefresh() {\n // Fetch updated Instance ID token and notify our app's server of any changes (if applicable).\n startService(new Intent(this, RegistrationIntentService.class));\n }", "@Override\n public void onTokenRefresh() {\n // Get updated InstanceI...
[ "0.7013902", "0.6900666", "0.67575175", "0.6719837", "0.6716476", "0.66981506", "0.6677508", "0.6571162", "0.6566649", "0.6564576", "0.6518826", "0.65123296", "0.6500154", "0.648365", "0.6459216", "0.644074", "0.6427149", "0.6354455", "0.63450587", "0.6340049", "0.63200146", ...
0.67028403
5
TODO Autogenerated method stub
@Override public IBinder onBind(Intent arg0) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
FragmentTransaction ft; darkDialog.setVisibility(View.VISIBLE); payment = Payment.newInstance(false); ft = getFragmentManager().beginTransaction(); ft.setCustomAnimations(R.animator.enter_from_right, R.animator.exit_to_right); ft.add(android.R.id.content, payment).commit(); isOpen = false;
@Override public void onClick(View view) { cardDialog = new Dialog(ChatPageActivity.this, R.style.PauseDialog); cardDialog.setContentView(R.layout.group_payment_layout); edtAmount = (EditText) cardDialog.findViewById(R.id.payAmount); edtAmount.requestFocus(); edtAmount.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { edtAmount.setHint(""); edtAmount.setGravity(Gravity.LEFT); } else if (edtAmount.getText().length() == 0) { edtAmount.setGravity(Gravity.CENTER); edtAmount.setHint("مبلغ پرداختی"); } } }); edtAmount.addTextChangedListener(new TextWatcher() { private static final char space = ','; @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { if (edtAmount.getText().length() == 0) { edtAmount.setGravity(Gravity.CENTER); edtAmount.setHint("مبلغ پرداختی"); } else { edtAmount.setHint(""); edtAmount.setGravity(Gravity.LEFT); if (s.length() > 0 && (s.length() % 4) == 0) { final char c = s.charAt(s.length() - 3); if (space == c) { s.delete(s.length() - 3, s.length() - 2); } } // && TextUtils.split(s.toString(), String.valueOf(space)).length <= 5 if (s.length() > 0 && (s.length() % 4) == 0) { char c = s.charAt(s.length() - 3); // Only if its a digit where there should be a space we insert a space Log.e("iffffffffff", "afterTextChanged: "); if (Character.isDigit(c)) { s.insert(s.length() - 3, String.valueOf(space)); } } } } }); edtAmount.addTextChangedListener(new NumberTextWatcher(edtAmount)); edtComment = (EditText) cardDialog.findViewById(R.id.comments); edtComment.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { edtComment.setGravity(Gravity.RIGHT); edtComment.setHint(""); } else { if (edtComment.getText().length() == 0) { edtComment.setGravity(Gravity.CENTER); edtComment.setHint("توضیحات"); } } } }); edtComment.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (edtComment.getText().length() == 0) { edtComment.setGravity(Gravity.CENTER); edtComment.setHint("توضیحات"); } else { edtComment.setGravity(Gravity.RIGHT); edtComment.setHint(""); } } @Override public void afterTextChanged(Editable s) { } }); TextView contactDetail = (TextView) cardDialog.findViewById(R.id.texx); contactDetail.setText("پرداخت وجه به " + contactName); Button btnCancel = (Button) cardDialog.findViewById(R.id.cancel); btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { cardDialog.dismiss(); } }); Button btnConfirm = (Button) cardDialog.findViewById(R.id.confirm); btnConfirm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (edtAmount.getText().toString().length() == 0) { Toast.makeText(ChatPageActivity.this, "مبلغ وارد شده نمیتواند خالی باشد!", Toast.LENGTH_SHORT).show(); } else if (edtComment.getText().toString().length() == 0) { Toast.makeText(ChatPageActivity.this, "توضیحات نمیتواند خالی باشد!", Toast.LENGTH_SHORT).show(); } else if (!validate_number(edtAmount.getText().toString().replace(",", ""))) { Toast.makeText(ChatPageActivity.this, "مبلغ وارد شده صحیح نمیباشد!", Toast.LENGTH_SHORT).show(); } else { mAmount = edtAmount.getText().toString().replace(",", ""); mComment = edtComment.getText().toString(); hideKey(edtComment); payDialog = new Dialog(ChatPageActivity.this, R.style.PauseDialog); payDialog.setContentView(R.layout.group_card_layout); edtCardNumber = (EditText) payDialog.findViewById(R.id.payAmount); edtCardNumber.requestFocus(); edtCardNumber.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { edtCardNumber.setSelection(edtCardNumber.getText().length()); } }); edtCardPassword = (EditText) payDialog.findViewById(R.id.comments); edtCardPassword.setCursorVisible(false); edtCardPassword.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { edtCardPassword.setGravity(Gravity.LEFT); edtCardPassword.setHint(""); } else { if (edtCardPassword.getText().length() == 0) { edtCardPassword.setGravity(Gravity.CENTER); edtCardPassword.setHint("رمز دوم"); } } } }); edtCardPassword.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (s.length() == 0) { edtCardPassword.setGravity(Gravity.CENTER); edtCardPassword.setHint("رمز دوم"); } else { edtCardPassword.setGravity(Gravity.LEFT); edtCardPassword.setHint(""); } } @Override public void afterTextChanged(Editable s) { } }); edtCardNumber.addTextChangedListener(new TextWatcher() { private static final char space = '-'; @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void afterTextChanged(Editable s) { if (s.length() == 0) { edtCardNumber.setGravity(Gravity.RIGHT); edtCardNumber.setHint("شماره کارت"); } else { edtCardNumber.setHint(""); edtCardNumber.setGravity(Gravity.LEFT); if (s.length() == 19) { edtCardPassword.requestFocus(); } if (s.length() > 0 && (s.length() % 5) == 0) { final char c = s.charAt(s.length() - 1); if (space == c) { s.delete(s.length() - 1, s.length()); } } if (s.length() > 0 && (s.length() % 5) == 0) { char c = s.charAt(s.length() - 1); // Only if its a digit where there should be a space we insert a space if (Character.isDigit(c) && TextUtils.split(s.toString(), String.valueOf(space)).length <= 3) { s.insert(s.length() - 1, String.valueOf(space)); } } } } }); Button btnCancel = (Button) payDialog.findViewById(R.id.cancel); btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { payDialog.dismiss(); } }); Button btnConfirm = (Button) payDialog.findViewById(R.id.confirm); btnConfirm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { new ChatPageActivity.sendPaymentRequest().execute(phone , edtCardNumber.getText().toString().replace("-", "") + edtCardPassword.getText().toString() , mComment, mAmount); payDialog.dismiss(); } }); payDialog.show(); cardDialog.dismiss(); } } }); cardDialog.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void goMainStampCard() {\n FragmentManager fragmentManager = getSupportFragmentManager();\n FragmentTransaction fragmentTransaction = fragmentManager\n .beginTransaction();\n fragmentTransaction.setCustomAnimations(R.anim.abc_fade_in,\n R.anim.abc_fade_out)...
[ "0.69985396", "0.69021636", "0.66653085", "0.6655989", "0.64752305", "0.64109397", "0.6351365", "0.6340267", "0.63273335", "0.626727", "0.62627393", "0.62005395", "0.6199033", "0.6189234", "0.61837125", "0.6166972", "0.6141432", "0.6129437", "0.6116756", "0.6114167", "0.61017...
0.0
-1
Log.e("Receive", "onClick: "); FragmentTransaction ft; darkDialog.setVisibility(View.VISIBLE); request = Request.newInstance(); ft = getFragmentManager().beginTransaction(); ft.setCustomAnimations(R.animator.enter_from_right, R.animator.exit_to_right); ft.add(android.R.id.content, request).commit(); isOpen = false;
@Override public void onClick(View view) { dialog = new Dialog(ChatPageActivity.this, R.style.PauseDialog); dialog.setContentView(R.layout.group_request_payment_layout); final EditText payAmount = (EditText) dialog.findViewById(R.id.payAmount); final EditText commment = (EditText) dialog.findViewById(R.id.comments); payAmount.requestFocus(); payAmount.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { payAmount.setGravity(Gravity.LEFT); payAmount.setHint(""); } else if (payAmount.getText().length() == 0) { payAmount.setGravity(Gravity.CENTER); payAmount.setHint("مبلغ پرداختی"); } } }); payAmount.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (payAmount.getText().length() == 0) { payAmount.setGravity(Gravity.CENTER); payAmount.setHint("مبلغ پرداختی"); } else { payAmount.setGravity(Gravity.LEFT); payAmount.setHint(""); } } @Override public void afterTextChanged(Editable s) { } }); commment.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (hasFocus) { commment.setGravity(Gravity.RIGHT); commment.setHint(""); } else if (commment.getText().length() == 0) { commment.setGravity(Gravity.CENTER); commment.setHint("توضیحات"); } } }); commment.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (commment.getText().length() == 0) { commment.setGravity(Gravity.CENTER); commment.setHint("توضیحات"); } else { commment.setGravity(Gravity.RIGHT); commment.setHint(""); } } @Override public void afterTextChanged(Editable s) { } }); Button btnCancel = (Button) dialog.findViewById(R.id.cancel); Button btnConfirm = (Button) dialog.findViewById(R.id.confirm); payAmount.addTextChangedListener(new NumberTextWatcher(payAmount)); btnCancel.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { dialog.dismiss(); } }); btnConfirm.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (payAmount.getText().toString().length() == 0) { Toast.makeText(ChatPageActivity.this, "مبلغ وارد شده نمیتواند خالی باشد!", Toast.LENGTH_SHORT).show(); } else if (commment.getText().toString().length() == 0) { Toast.makeText(ChatPageActivity.this, "توضیحات نمیتواند خالی باشد!", Toast.LENGTH_SHORT).show(); } else if (!validate_number(payAmount.getText().toString().replace(",", ""))) { Toast.makeText(ChatPageActivity.this, "مبلغ وارد شده صحیح نمیباشد!", Toast.LENGTH_SHORT).show(); } else { hideKey(commment); new ChatPageActivity.requestFromAnother().execute(phone, payAmount.getText().toString(), commment.getText().toString()); dialog.dismiss(); } } }); dialog.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onWaitFragmentInteractionShow() {\n getSupportFragmentManager()\n .beginTransaction()\n .add(R.id.main_container, new WaitFragment(), \"WAIT\")\n .addToBackStack(null)\n .commit();\n }", "@Override\n publi...
[ "0.71143293", "0.70183426", "0.6973905", "0.68925965", "0.679835", "0.6768577", "0.67099166", "0.6671583", "0.6657965", "0.66390836", "0.6634469", "0.6592124", "0.6579149", "0.6569341", "0.64644194", "0.64577675", "0.64546347", "0.6394374", "0.6374981", "0.6358547", "0.635401...
0.0
-1
Created by charles on 2017/11/21.
@Mapper public interface SentenceMapper { Long save(Sentence sentence); void update(Sentence sentence); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", ...
[ "0.59418535", "0.5752481", "0.5690459", "0.5672767", "0.5657136", "0.56178606", "0.56178606", "0.5545844", "0.55429596", "0.5529672", "0.55295527", "0.5516174", "0.5482836", "0.547498", "0.5466091", "0.54540634", "0.5452536", "0.5445152", "0.5445152", "0.5445152", "0.5445152"...
0.0
-1
Type your code here
public static void main (String[] args){ int a, rem, rev = 0; Scanner ip = new Scanner(System.in); a = ip.nextInt(); while(a>0) { rem = a%10; rev = rev + rem; a = a/10; } System.out.println(rev); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void generateCode()\n {\n \n }", "@Override\r\n\tpublic void code() {\n\t\tus.code();\r\n\t\tSystem.out.println(\"我会java...\");\r\n\t}", "@Override\r\n\tpublic void code() {\n\t\tSystem.out.println(\"我会C语言....\");\r\n\t}", "CD withCode();", "Code getCode();", "private void sear...
[ "0.67529005", "0.65678793", "0.641418", "0.6334503", "0.6230944", "0.62127316", "0.6207898", "0.60968196", "0.6072467", "0.606349", "0.606349", "0.606349", "0.606349", "0.606349", "0.59795964", "0.58908486", "0.58157927", "0.5754923", "0.57194966", "0.57184726", "0.5709211", ...
0.0
-1
read COA.xml file and get all symbols that begin w/ a number
private static List<String> readCoaXmlFile(File file) { List<String> shapeNames = new ArrayList<String>(); BufferedReader br = null; String line = ""; String token = ""; int firstQuotePos = -1; int secondQuotePos = -1; StringTokenizer st = null; try { // initialize the reader br = new BufferedReader(new FileReader(file)); // read each line until no more left line = br.readLine(); while (line != null) { // process shape name lines if (line.contains("<shape name") && line.contains("_")) { // initialize tokenizer st = new StringTokenizer(line); // process desired tokens st.nextToken(); token = st.nextToken(); // get positions of quotes firstQuotePos = token.indexOf('"'); secondQuotePos = token.indexOf('"', firstQuotePos+1); // add shape name shapeNames.add(token.substring(firstQuotePos+1, secondQuotePos)); } line = br.readLine(); } } catch (FileNotFoundException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } finally { // close the buffered object try { br.close(); } catch (IOException ex) { ex.printStackTrace(); } } return shapeNames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void testParseExternalCodes() throws Exception {\r\n \t\tCObject node = archetype.node(\"/types[at0001]/items[at10002]/value\");\r\n \t\tString[] codes = { \"F43.00\", \"F43.01\", \"F32.02\" };\r\n \t\tassertCCodePhrase(node, \"icd10\", codes, \"F43.01\");\r\n \t}", "private void loadFile() {\n Str...
[ "0.55612427", "0.5155659", "0.49886054", "0.4974004", "0.4968376", "0.49661088", "0.496309", "0.48353344", "0.482147", "0.47986326", "0.47975624", "0.47857454", "0.477745", "0.4756698", "0.47388077", "0.47344452", "0.47082236", "0.46974322", "0.46727023", "0.46676403", "0.466...
0.56839687
0
TODO Autogenerated method stub syncAndroid.dataCenter.handleSingleMessages= insert into t_a_messages2(message,createdate,transactionid,status,ifext) values(?,sysdate,?,?,?)
public void handleSingleMessages(String transactionId,String messages,String status,String ifext) throws DAOException { String sql = "syncAndroid.dataCenter.handleSingleMessages"; Object[] paras = {messages,transactionId,status,ifext}; DB.getInstance().executeBySQLCode(sql, paras); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void addMessage(Integer receive_id, Integer send_id, String content,Timestamp createtime) {\n\t\tString sql=\"insert into message(receive_id,send_id,content,createtime,isread,result) values(?,?,?,?,?,?)\";\r\n\t\tObject[] args=new Object[] {receive_id,send_id,content,createtime,0,0};\r\n\t\tt...
[ "0.6700915", "0.65279436", "0.61947954", "0.6147944", "0.6143387", "0.61011624", "0.59610206", "0.5953801", "0.5911372", "0.5850646", "0.5767107", "0.57666206", "0.57550144", "0.5752673", "0.57234377", "0.5710975", "0.57068086", "0.5702434", "0.5700669", "0.56948334", "0.5616...
0.6796056
0
TODO Autogenerated method stub
public List<MessageVO> getNoTranMessage(int noTranLimit) { List list = new ArrayList(); String sqlCode="syncAndroid.dataCenter.getNoTranMessage"; //select * from (select * from t_a_messages m where m.status=-1 and m.transactionid is null order by m.createdate asc,m.transactionid asc,m.id asc) where rownum<? try { Object[] paras = {noTranLimit}; RowSet rs = DB.getInstance().queryBySQLCode(sqlCode, paras); while(rs.next()) { MessageVO vo = new MessageVO(); vo.setId(rs.getInt("ID")); vo.setType(rs.getString("TYPE")); vo.setMessage(rs.getString("MESSAGE")); vo.setStatus(rs.getInt("STATUS")); vo.setTransactionId(rs.getString("TRANSACTIONID")); vo.setLupdate(rs.getDate("LUPDATE")); list.add(vo); } } catch (Exception e) { logger.debug("根据状态-1查询getNoTranMessage信息失败..."); } return list; }
{ "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
Resets the "selected" attribute of any parent Entity controllers.
public void resetParents() { idEmpleadoController.setSelected(null); idEquipoController.setSelected(null); idUsuarioController.setSelected(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void resetParents() {\n businessentityController.setSelected(null);\n }", "public void resetParents() {\n oferenteController.setSelected(null);\n expedienteprocesoController.setSelected(null);\n }", "public void resetParents() {\r\n servicioIdController.setSelected(null...
[ "0.76650393", "0.7534451", "0.73539287", "0.7280383", "0.72471625", "0.7238065", "0.7206758", "0.7148984", "0.71272284", "0.7003519", "0.69074196", "0.6807132", "0.5925203", "0.5890661", "0.5857201", "0.5826842", "0.57976145", "0.5762226", "0.56932205", "0.56463844", "0.56396...
0.74119014
2
Sets the "selected" attribute of the Empleado controller in order to display its data in its View dialog.
public void prepareIdEmpleado(ActionEvent event) { Rentadevolucion selected = this.getSelected(); if (selected != null && idEmpleadoController.getSelected() == null) { idEmpleadoController.setSelected(selected.getIdEmpleado()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSelectedItem( final T selectedEntity ) {\n this.selectedEntity = selectedEntity;\n }", "@Override\n\tpublic void selecciona() {\n\t\tClienteProxy bean = grid.getSelectionModel().getSelectedObject();\n\t\tif(bean!=null){\t\t\t\t\n\t\tuiHomePrestamo.getHeader().getLblTitulo().setText(\"Dev...
[ "0.6697407", "0.6656698", "0.6414294", "0.6390768", "0.63801396", "0.61961925", "0.6196054", "0.6178767", "0.6154575", "0.613819", "0.6113332", "0.6101836", "0.6069334", "0.60620457", "0.60538405", "0.6047531", "0.60261667", "0.6008901", "0.5995867", "0.5995763", "0.5994839",...
0.6601734
2
Sets the "selected" attribute of the Equipo controller in order to display its data in its View dialog.
public void prepareIdEquipo(ActionEvent event) { Rentadevolucion selected = this.getSelected(); if (selected != null && idEquipoController.getSelected() == null) { idEquipoController.setSelected(selected.getIdEquipo()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSelectedItem( final T selectedEntity ) {\n this.selectedEntity = selectedEntity;\n }", "@FXML\n\tpublic void setSelectedItem(MouseEvent event) {\n\t\ttry {\n\t\t\tString s=inventoryList.getSelectionModel().getSelectedItem();\t// Get selected item\n\t\t\tItem i=Item.getItem(ItemList, s);\...
[ "0.6520011", "0.63472235", "0.63162684", "0.6232418", "0.6226999", "0.6216409", "0.61717737", "0.6149779", "0.61188877", "0.6103463", "0.6067548", "0.6060232", "0.6053437", "0.6052546", "0.600842", "0.5942677", "0.5917406", "0.5891192", "0.58909637", "0.5868797", "0.58647096"...
0.63458633
2
Sets the "selected" attribute of the Usuario controller in order to display its data in its View dialog.
public void prepareIdUsuario(ActionEvent event) { Rentadevolucion selected = this.getSelected(); if (selected != null && idUsuarioController.getSelected() == null) { idUsuarioController.setSelected(selected.getIdUsuario()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setSelectedUser(ch.ivyteam.ivy.security.IUser _selectedUser)\n {\n selectedUser = _selectedUser;\n }", "public void setSelectedUser(String selected) {\n selectedUser = selected;\n\n //this.removeAllEvents();\n //loadEvents();\n }", "protected void Userselect(ActionEvent...
[ "0.704478", "0.67048794", "0.63478756", "0.63443464", "0.6235186", "0.6067576", "0.603794", "0.6010875", "0.6002091", "0.5937049", "0.5929058", "0.5919068", "0.58868456", "0.58711666", "0.58413035", "0.58299524", "0.5776769", "0.5748598", "0.5743637", "0.57305974", "0.5717919...
0.6279692
4
DAO for User entity.
public interface UserDao { /** * Creating new User. * * @param user * user * * @throws NullPointerException * if user null * */ void create(User user); /** * Updating a user. * * @param user * user * * @throws NullPointerException * if user null * @throws IllegalArgumentException * if DB hasn't this user. * */ void update(User user); /** * Removing user. * * @param user * user * * @throws NullPointerException * if user null * @throws IllegalArgumentException * if DB hasn't this user. * */ void remove(User user); /** * Removing user by id. * * @param id * id of user * * @throws NullPointerException * if user null * @throws IllegalArgumentException * if DB hasn't this user. * */ void remove(Long id); /** * Finding all users. * * @return users. */ List<User> findAll(); /** * finding user by login. * * @param login * login * @return user */ User findByLogin(String login); /** * Finding user by Е-mail * * @param email * Е-mail * @return user */ User findByEmail(String email); /** * Is exist user with this login. * * @param login * login of user * @return {@code true} if exist */ boolean isUserByLogin(String login); /** * Is exist user with this e-mail. * * @param email * e-nail of user * @return {@code true} if exist */ public boolean isUserByEmail(String email); /** * Find user by id. * * @param id * id of user * @return user */ public User findById(Long id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface UserDAO {\n\t\n\tUser getById(Integer id) throws DaoException;\n\t\n\tUser getByEmail(String email) throws DaoException;\n\t\n\tBoolean addUser(User user) throws DaoException;\n\t\n\tBoolean updateUser(Integer id, User user) throws DaoException;\n\t\n\tvoid setToken(User user) throws DaoException;...
[ "0.8024704", "0.79093236", "0.78467786", "0.7805201", "0.77743983", "0.7733625", "0.7724205", "0.76941466", "0.76806056", "0.76693845", "0.7664774", "0.7604622", "0.7598799", "0.7569479", "0.7556606", "0.7536719", "0.75338805", "0.7531256", "0.7523995", "0.7519499", "0.751204...
0.7636586
11
Removing user by id.
void remove(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void removeUser(Long id);", "@Override\n\tpublic void removeUser(int id) {\n\t\t\n\t}", "void deleteUserById(Integer id);", "void deleteUserById(Long id);", "@ApiMethod(name = \"removeUser\")\n\tpublic void removeUser(@Named(\"id\") Long id) {\n\t\tEntityManager mgr = getEntityManager();\n\t\ttry {\n\t\t\t...
[ "0.90686625", "0.8456308", "0.83985204", "0.83933115", "0.83480763", "0.82310367", "0.8213471", "0.81785524", "0.8139176", "0.81368595", "0.8112103", "0.8111907", "0.8103343", "0.808604", "0.80585504", "0.80506206", "0.8037807", "0.80282474", "0.8011851", "0.7961808", "0.7944...
0.0
-1
finding user by login.
User findByLogin(String login);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public EOSUser findUser(String login) throws EOSNotFoundException;", "public User findUserByLogin(final String login);", "User getUserByLogin(String login);", "User findUserByLogin(String login);", "public User loadUserByLogin(String login);", "public User findByLogin(String login) {\n LOGGER.debu...
[ "0.8294879", "0.81850755", "0.81192243", "0.80683494", "0.77612364", "0.76414305", "0.7638673", "0.7579053", "0.7537634", "0.737051", "0.71977186", "0.71800363", "0.71732527", "0.7139482", "0.7116881", "0.7017548", "0.69526786", "0.69375765", "0.6880711", "0.6855477", "0.6842...
0.7697017
5
Find user by id.
public User findById(Long id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic Userinfo findbyid(int id) {\n\t\treturn userDAO.searchUserById(id);\r\n\t}", "public User findUser(int id) {\n for (int i = 0; i < allUsers.size(); i++) {\n if (allUsers.get(i).getId() == id) {\n return allUsers.get(i);\n }\n }\n ret...
[ "0.8338237", "0.83019376", "0.8266137", "0.825916", "0.8237722", "0.8215482", "0.8132252", "0.8120669", "0.8117385", "0.80564517", "0.8026342", "0.7998461", "0.79949665", "0.79861474", "0.7978887", "0.7948027", "0.7947411", "0.7921249", "0.79197687", "0.79191744", "0.79044956...
0.7546214
53
Configure View Presenters with the provided inflated view. Set up any necessary event listeners.
private void configureViewPresenters(View inflatedView) { // Instantiate the Event Listener listener = new PresenterListener(this); actionToolbarPresenter = new ActionToolbarPresenter(inflatedView); actionToolbarPresenter.setListener(listener); actionToolbarPresenter.setBattery(sharedPrefs.getInt(BATTERY_RECEIVED, 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init() {\n //set view to presenter\n presenter.setView(this, service);\n\n setupView();\n }", "protected void setInflatedView(View inflatedView) {\n if (inflatedView == null) throw new IllegalStateException(\"Inflated view must not be null\");\n mInflatedView = inflatedView;\...
[ "0.61762744", "0.5824159", "0.5717124", "0.56996673", "0.56701946", "0.5659374", "0.5654838", "0.56493324", "0.5647835", "0.5645106", "0.56267583", "0.5619468", "0.5614292", "0.5613531", "0.5586021", "0.5571085", "0.55585206", "0.55540305", "0.5522884", "0.5501204", "0.549884...
0.7525252
0
Constructor, which allows you to pass number of RadioButton instances, making a group.
public GRadioGroup(RadioButton... radios) { super(); for (RadioButton rb : radios) { this.radios.add(rb); rb.setOnClickListener(onClick); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Alunos() {\n initComponents();\n ButtonGroup bg = new ButtonGroup(); \n \n//Agora basta vc adicionar os seus RadioButtons ao objeto desta classe. \n \nbg.add(rdNome); \nbg.add(rdID); \nbg.add(rdNomeEditar);\nbg.add(rdIdEditar);\n }", "public GRadioGroup(View activity, int... radiosI...
[ "0.7220849", "0.72119564", "0.70706815", "0.68628937", "0.66987795", "0.6661367", "0.6654792", "0.64579386", "0.62344325", "0.6234259", "0.613699", "0.61348885", "0.6125499", "0.6101813", "0.6032076", "0.60311365", "0.60184985", "0.59567326", "0.595621", "0.5951397", "0.59507...
0.77300817
0
Constructor, which allows you to pass number of RadioButtons represented by resource IDs, making a group.
public GRadioGroup(View activity, int... radiosIDs) { super(); String nightMode = sharedPrefs.getString(SettingsActivity.NIGHTMODE); if (nightMode==null) nightMode="disable"; int radioCount=0; for (int radioButtonID : radiosIDs) { RadioButton rb = (RadioButton)activity.findViewById(radioButtonID); if (rb != null) { this.radios.add(rb); rb.setTypeface(TypefaceUtil.get(getApplicationContext())); rb.setOnClickListener(onClick); } rb.setChecked(false); if (radioCount==0 && nightMode.equals("enable")) rb.setChecked(true); else if (radioCount==1 && nightMode.equals("disable")) rb.setChecked(true); radioCount++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Alunos() {\n initComponents();\n ButtonGroup bg = new ButtonGroup(); \n \n//Agora basta vc adicionar os seus RadioButtons ao objeto desta classe. \n \nbg.add(rdNome); \nbg.add(rdID); \nbg.add(rdNomeEditar);\nbg.add(rdIdEditar);\n }", "public GRadioGroup(RadioButton... radios) {\n ...
[ "0.7062288", "0.68633467", "0.6739084", "0.6409344", "0.6357027", "0.6354536", "0.6088896", "0.5915726", "0.58628935", "0.5831178", "0.57773733", "0.57452416", "0.5731739", "0.57273525", "0.56381655", "0.5636936", "0.5615184", "0.5543801", "0.55162996", "0.5506322", "0.550468...
0.7117773
0
Compares this address to another for magnitude. The value returned will be: &lt; 0, if this address is less than other; = 0, if this address is equal to other; &gt; 0, if this address is greater than other. Comparison proceeds as follows: Compare zip codes; if not equal we're done; else: Compare states; if not equal we're done; else: Compare cities; if not equal we're done; else: Compare addr1 fields; if not equal we're done; else: Compare addr2 fields.
public int compareTo( Address_orig other ) { int result = zipCode.compareTo( other.zipCode ); if ( result != 0 ) return result; result = state.compareTo( other.state ); if ( result != 0 ) return result; result = city.compareTo( other.city ); if ( result != 0 ) return result; result = addr1.compareTo( other.addr1 ); if ( result != 0 ) return result; result = addr2.compareTo( other.addr2 ); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void compareAddress()\n {\n Address a = new Address(\"Amapolas\",1500,\"Providencia\",\"Santiago\");\n Address b = new Address(\"amapolas\",1500, \"providencia\",\"santiago\");\n Address c = new Address(\"Hernando Aguirre\",1133,\"Providencia\", \"Santiago\");\n \n bool...
[ "0.60685843", "0.58855665", "0.56863856", "0.5565389", "0.5531931", "0.5397017", "0.537234", "0.53022647", "0.52938265", "0.5247271", "0.52459645", "0.5229642", "0.52235013", "0.52213037", "0.52009356", "0.51875377", "0.51571184", "0.5153088", "0.511351", "0.5103847", "0.5091...
0.62334806
0
Test the 3 methods 'hasNext', 'next' and 'remove' from the implemented Iterator interface
@Test public void testIterator() { SessionCache sessionCache = SessionCache.getInstance(); Iterator<Session> iterator0 = sessionCache.iterator(); assertFalse(iterator0.hasNext()); try { testSession = iterator0.next(); fail("Expected NoSuchElementException to be thrown"); } catch (NoSuchElementException e) { // This exception is expected. } sessionCache.put(sessionId1, session1); Iterator<Session> iterator1 = sessionCache.iterator(); assertTrue(iterator1.hasNext()); testSession = iterator1.next(); assertEquals(testSession, session1); assertFalse(iterator1.hasNext()); try { testSession = iterator1.next(); fail("Expected NoSuchElementException to be thrown"); } catch (NoSuchElementException e) { // This exception is expected. } iterator1.remove(); assertEquals(sessionCache.size(), 0); assertFalse(iterator1.hasNext()); try { testSession = iterator1.next(); fail("Expected NoSuchElementException to be thrown"); } catch (NoSuchElementException e) { // This exception is expected. } try { iterator1.remove(); fail("Expected IllegalStateException to be thrown"); } catch (IllegalStateException e) { // This exception is expected. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(expected = UnsupportedOperationException.class)\n public void remove() {\n iterator.next();\n iterator.remove();\n }", "@Test\n\tpublic void testRemove() {\n\t\tboolean expResult = true;\n\t\tboolean result = false;\n\n\t\tIntArrayIterator instance = createIterator();\n\t\ttry {\n\t\t\t...
[ "0.78438413", "0.7704371", "0.74011713", "0.7330616", "0.72456473", "0.71928006", "0.7136998", "0.7134522", "0.70785934", "0.70300645", "0.69802666", "0.6960976", "0.69277775", "0.69249034", "0.6919027", "0.6919027", "0.69127816", "0.6899077", "0.6859975", "0.6840704", "0.683...
0.69717264
11
Set the PrivateKey to be used for Decryption.
public void setPrivateKey(PrivateKey privateKey) { this.privateKey = privateKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Accessor(qualifier = \"privateKey\", type = Accessor.Type.SETTER)\n\tpublic void setPrivateKey(final String value)\n\t{\n\t\tgetPersistenceContext().setPropertyValue(PRIVATEKEY, value);\n\t}", "public void setPrivateKey(java.nio.ByteBuffer privateKey) {\n this.privateKey = privateKey;\n }", "private...
[ "0.665673", "0.6587013", "0.6556297", "0.65486234", "0.6483307", "0.64607084", "0.6382286", "0.6277892", "0.6277892", "0.6277892", "0.62117714", "0.6174733", "0.6091945", "0.58667064", "0.5817213", "0.5681798", "0.5647012", "0.55902636", "0.5550842", "0.5526125", "0.55219936"...
0.6457603
6
Constructor. It takes the byte stream of X509SubjectKeyIdentifier.
public X509SubjectKeyIdentifierBasedRequest( byte[] x509SubjectKeyIdentifier) { this.x509SubjectKeyIdentifier = x509SubjectKeyIdentifier; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Builder setSubjectKeyIDBytes(\n com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n checkByteStringIsUtf8(value);\n \n subjectKeyID_ = value;\n onChanged();\n return this;\n }", "public Builder setSu...
[ "0.7077527", "0.7077527", "0.67329353", "0.63206124", "0.63206124", "0.60560447", "0.60560447", "0.59689444", "0.59689444", "0.5960739", "0.5928749", "0.5913093", "0.5913093", "0.58049476", "0.58049476", "0.5804645", "0.5804645", "0.57325596", "0.57325596", "0.5469449", "0.54...
0.7431876
0
Get the byte stream of X509SubjectKeyIdentifier set on this request.
public byte[] getSubjectKeyIdentifier() { return x509SubjectKeyIdentifier; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "com.google.protobuf.ByteString\n getSubjectKeyIDBytes();", "com.google.protobuf.ByteString\n getSubjectKeyIDBytes();", "public com.google.protobuf.ByteString\n getSubjectKeyIDBytes() {\n java.lang.Object ref = subjectKeyID_;\n if (ref instanceof java.lang.String) {\n com.g...
[ "0.8046632", "0.8046632", "0.75399476", "0.75399476", "0.7532266", "0.7532266", "0.71014583", "0.71014583", "0.7093304", "0.7093304", "0.7053424", "0.7053424", "0.68028694", "0.67347574", "0.67347574", "0.6547083", "0.6547083", "0.65164196", "0.65164196", "0.65016073", "0.650...
0.81369716
0
Constructor. It takes the byte stream of X509ThumbPrint.
public ThumbprintBasedRequest( byte[] x509Thumbprint) { this.x509Thumbprint = x509Thumbprint; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "X509CertificateInfo()\n {\n }", "public PDStream(COSStream str) {\n/* 78 */ this.stream = str;\n/* */ }", "public DerParser( byte[] bytes ) throws IOException {\n this( new ByteArrayInputStream( bytes ) );\n }", "public byte[] getThumbprintIdentifier() {\n return x...
[ "0.54354805", "0.5296069", "0.5167833", "0.51536554", "0.5135813", "0.5118156", "0.51052856", "0.5056465", "0.49171522", "0.49146336", "0.49058995", "0.48864475", "0.4877385", "0.48066783", "0.48003513", "0.47942662", "0.47803947", "0.4751855", "0.47477517", "0.4727434", "0.4...
0.7047446
0
Get the byte stream of X509ThumbPrint set on this request.
public byte[] getThumbprintIdentifier() { return x509Thumbprint; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ThumbprintBasedRequest(\n byte[] x509Thumbprint) {\n this.x509Thumbprint = x509Thumbprint;\n }", "public List<ClientCertificateThumbprint> clientCertificateThumbprints() {\n return this.clientCertificateThumbprints;\n }", "public String thumbprint() {\n retu...
[ "0.64948624", "0.6066758", "0.556125", "0.5048426", "0.491051", "0.4867791", "0.48080295", "0.48056328", "0.47336975", "0.47324085", "0.47147977", "0.46683392", "0.46283075", "0.46054316", "0.4602155", "0.45839626", "0.45788622", "0.45735407", "0.4568175", "0.455962", "0.4558...
0.7016295
0
Get the issuer name.
public String getIssuerName() { return issuerName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public java.lang.String getIssuer() {\n java.lang.Object ref = issuer_;\n if (!(ref instanceof java.lang.String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n issuer_ = s;\n ...
[ "0.7906128", "0.78239465", "0.77935714", "0.7773523", "0.7369986", "0.72547793", "0.72279465", "0.72185606", "0.70423144", "0.7001305", "0.68647116", "0.66073835", "0.6433908", "0.64328957", "0.6374039", "0.63235754", "0.60979295", "0.6027583", "0.59894735", "0.59265393", "0....
0.843671
0
Get the Certificate Serial Number.
public BigInteger getSerialNumber() { return serialNumber; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getSerialNumber();", "java.lang.String getSerialNumber();", "public Integer getCertificateNo() {\n return certificateNo;\n }", "public java.lang.String getSerialNumber() {\n java.lang.Object ref = serialNumber_;\n if (ref instanceof java.lang.String) {\n return (ja...
[ "0.72130275", "0.72130275", "0.71110564", "0.7061854", "0.7061854", "0.70042866", "0.70042866", "0.68610233", "0.68479115", "0.6829344", "0.6774526", "0.67427063", "0.6699007", "0.6681512", "0.6673599", "0.6669585", "0.6635698", "0.6635698", "0.66289544", "0.66289544", "0.658...
0.65401495
22
Get the X509Certificate stored in this Request.
public X509Certificate getX509Certificate() { return certificate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public X509Certificate getCertificate();", "public X509Certificate getCertificate()\n {\n return this.cert;\n }", "public liubaninc.m0.pki.CertificateOuterClass.Certificate getCertificate() {\n return certificate_ == null ? liubaninc.m0.pki.CertificateOuterClass.Certificate.getDefaultInstance() : cer...
[ "0.76271003", "0.74453545", "0.7158065", "0.7088989", "0.7016679", "0.6930466", "0.6761769", "0.6581187", "0.65276414", "0.6478997", "0.6399219", "0.63542396", "0.63316613", "0.63121057", "0.6296166", "0.61844385", "0.6143396", "0.613081", "0.61305135", "0.61216575", "0.60850...
0.76581025
0
Get the SymmetricKey stored in this Request.
public SecretKey getSymmetricKey() { return symmetricKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Key getKey() {\n\t\treturn getKey(settings, url);\n\t}", "public Key getKey() {\n\t\tString fieldvalue = getValue(\"sys_id\");\n\t\tassert fieldvalue != null;\n\t\treturn new Key(fieldvalue);\n\t}", "java.lang.String getClientKey();", "public String getTlsKey();", "public CryptoKey getMyKey() {\n ...
[ "0.6244152", "0.61600995", "0.60290104", "0.59874237", "0.5977026", "0.5960587", "0.5900378", "0.58976716", "0.58695865", "0.5865392", "0.5837777", "0.5837777", "0.5837777", "0.5826903", "0.5826903", "0.5826903", "0.5826903", "0.5826903", "0.5826903", "0.5826903", "0.5826903"...
0.7270493
0
Get the alias stored in this Request.
public String getAlias() { return alias; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getAlias() {\n return alias;\n }", "public String getAlias() {\n return alias;\n }", "public String getAlias() {\n\t\treturn alias;\n\t}", "public String getAlias() {\n return alias;\n }", "@NotNull\n public String getAlias()\n {\n return alias;\n }", ...
[ "0.7456585", "0.7456585", "0.7415419", "0.74118686", "0.7399925", "0.7188797", "0.7147735", "0.71351695", "0.71197027", "0.7051264", "0.70222527", "0.6975792", "0.6956437", "0.6855007", "0.6813154", "0.6813154", "0.6813154", "0.6813154", "0.6736026", "0.6736026", "0.6722381",...
0.7494108
0
Get the PublicKey stored in this Request.
public PublicKey getPublicKey() { return pk; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public PublicKey getPublicKey() {\n return publicKey;\n }", "public PublicKey getPublicKey() {\r\n return publicKey;\r\n }", "public PublicKey getPublicKey(){\n\t\treturn this.publickey;\n\t}", "public PublicKey getPubKey(){\r\n\t\treturn this.myCert.getPublicKey();\r\n\t}", "java.lang.String getPu...
[ "0.7807145", "0.7758641", "0.7626556", "0.7555995", "0.7462421", "0.7447583", "0.7446015", "0.73904914", "0.73585695", "0.72302073", "0.70565355", "0.702199", "0.69782734", "0.6912648", "0.6874762", "0.6769404", "0.66429806", "0.6580532", "0.6563781", "0.6557845", "0.6526429"...
0.8015265
0
TODO Autogenerated method stub
public static void main(String[] args) { int[] 나이 = {99,10,100,88,33,24,10,77}; int[] 나이2 = 나이.clone(); //배열 복사할 때는 .clone()함수 사용! //깊은 복사, 배열은 깊은 복사를 해야한다. //깊은 복사를 해야 배열은 따로 따로 만들어진다. Arrays.sort(나이); //파괴함수 .sort(); 파.괘.한.다 for (int x : 나이) { System.out.print(x+" "); } System.out.println("\n----------------"); for (int x : 나이2) { System.out.print(x+" "); } System.out.println(""); 나이2[0]=999; for (int x : 나이2) { System.out.print(x+" "); } }
{ "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
Create the message data to be sent
private AppointmentItem createBasicAppt() throws HarnessException{ AppointmentItem appt = new AppointmentItem(); appt.setSubject("appointment" + ZimbraSeleniumProperties.getUniqueString()); appt.setContent("content" + ZimbraSeleniumProperties.getUniqueString()); // Open the new mail form FormApptNew apptForm = (FormApptNew) app.zPageCalendar.zToolbarPressButton(Button.B_NEW); ZAssert.assertNotNull(apptForm, "Verify the new form opened"); // Fill out the form with the data apptForm.zFill(appt); // Send the message apptForm.zSubmit(); return appt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static SimpleMessageObject createMessageObject(byte[] data) {\n SimpleMessageObject retVal = new SimpleMessageObject();\n \n // data is of the form:\n // byte(data type)|int(length of name)|name|int(length of value)|value\n boolean keepGoing = true;\n int currentPoi...
[ "0.6607098", "0.6570311", "0.65510374", "0.63545775", "0.63519853", "0.6213836", "0.6208159", "0.6198211", "0.60837305", "0.60777557", "0.6074967", "0.5999427", "0.5986371", "0.5969907", "0.59408945", "0.59131956", "0.5896938", "0.5867931", "0.5843312", "0.5837187", "0.583578...
0.0
-1
Create the message data to be sent
@Test( description = "Create a basic appointment", groups = { "sanity" } ) public void CheckApptCreatedOnServer() throws HarnessException { AppointmentItem appt = new AppointmentItem(); appt.setSubject("appointment" + ZimbraSeleniumProperties.getUniqueString()); appt.setContent("content" + ZimbraSeleniumProperties.getUniqueString()); appt.setStartTime(new ZDate(2014, 12, 25, 12, 0, 0)); appt.setEndTime(new ZDate(2014, 12, 25, 14, 0, 0)); // Open the new mail form FormApptNew apptForm = (FormApptNew) app.zPageCalendar.zToolbarPressButton(Button.B_NEW); ZAssert.assertNotNull(apptForm, "Verify the new form opened"); // Fill out the form with the data apptForm.zFill(appt); // Send the message apptForm.zSubmit(); //verify toasted message 'group created' String expectedMsg ="Appointment Created"; ZAssert.assertStringContains(app.zPageMain.zGetToaster().zGetToastMessage(), expectedMsg , "Verify toast message '" + expectedMsg + "'"); verifyApptCreatedOnServer(appt); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static SimpleMessageObject createMessageObject(byte[] data) {\n SimpleMessageObject retVal = new SimpleMessageObject();\n \n // data is of the form:\n // byte(data type)|int(length of name)|name|int(length of value)|value\n boolean keepGoing = true;\n int currentPoi...
[ "0.6607098", "0.6570311", "0.65510374", "0.63545775", "0.63519853", "0.6213836", "0.6208159", "0.6198211", "0.60837305", "0.60777557", "0.6074967", "0.5999427", "0.5986371", "0.5969907", "0.59408945", "0.59131956", "0.5896938", "0.5867931", "0.5843312", "0.5837187", "0.583578...
0.0
-1
Name : Chagit Stupel ID : 209089960 Course group : 04 the listeners.HitNotifier interface.
public interface HitNotifier { /** * @param hl a hit listener * Add hl as a listener to hit events. */ void addHitListener(HitListener hl); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface HitNotifier {\n\n /**\n * Add hl as a listener to hit events.\n * @param hl the hit listener\n */\n void addHitListener(HitListener hl);\n\n /**\n * Remove hl from the list of listeners to hit events.\n * @param hl the hit listener\n */\n void removeHitListener(...
[ "0.74873257", "0.72872174", "0.72762257", "0.7273854", "0.6983244", "0.69608885", "0.6601037", "0.6563337", "0.6563337", "0.65084606", "0.6508314", "0.64791155", "0.6461401", "0.6461401", "0.64335954", "0.63444793", "0.6329213", "0.6329213", "0.6329213", "0.6329213", "0.63037...
0.7591081
0
TODO Autogenerated method stub
@Override public void run() { File in = new File("input.txt"); String strLine; int k; Tree mytree = new Tree(); try { Scanner sc = new Scanner(in); while (sc.hasNext()) { mytree.insert(sc.nextInt()); } } catch (FileNotFoundException e) { e.printStackTrace(); } try(FileWriter fos=new FileWriter("output.txt")) { mytree.PreOrderTraversal(mytree.root, fos); } catch(IOException ex){ System.out.println(ex.getMessage()); } }
{ "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
Metodos de los botones
public void limpiarHistorial(View v){ //Borrar contenido del spinner y pasar el parametro RESULT_CANCELED al activity principal listaHistorial.clear(); adapt.notifyDataSetChanged(); sp.setAdapter(adapt); Intent i = new Intent(); setResult(RESULTADO_LIMPIAR,i); finish(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "int getTotalBotCount() {\n int t = 0;\n\n for (Integer i : m_botTypes.values())\n t += i;\n\n return t;\n }", "public void inicializarBotones() {\n\t\t\n\t\t// aņadimos listeners a los botones del panel 'login'\n\t\tthis.controladorLogin = new ControladorLogin(vista, modelo);\n...
[ "0.6091769", "0.56990606", "0.55429006", "0.5519154", "0.54878926", "0.54347056", "0.5277164", "0.527439", "0.5215084", "0.5178105", "0.51707166", "0.5101489", "0.5096515", "0.50936806", "0.5062257", "0.50578576", "0.502411", "0.5011241", "0.5006944", "0.5000893", "0.49831977...
0.0
-1
Checks whether a network connection exists and it is possible to send and retrieve date over the network
public static boolean hasNetwork(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (cm == null) return false; NetworkInfo netInfo = cm.getActiveNetworkInfo(); return netInfo != null && netInfo.isConnected(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isNetworkAvailable();", "private boolean checkConnection() {\n return InternetConnectivityReceiver.isConnected();\n }", "private void checkConnection(){\n NetworkInfo activeNetwork = connectivityManager.getActiveNetworkInfo();\n\n // if activeNetwork is not null, and a network c...
[ "0.6982695", "0.69566953", "0.6912324", "0.6908604", "0.6743304", "0.6743304", "0.6659702", "0.6624001", "0.6609554", "0.6572377", "0.6567173", "0.6564085", "0.65597343", "0.6544579", "0.65394324", "0.6536573", "0.6521619", "0.6520083", "0.6517666", "0.64877945", "0.6477277",...
0.0
-1
we don't want to serve too much memory.
private static Charset lookup(String enc) { try { if (enc != null && Charset.isSupported(enc)) { return Charset.forName(enc); } } catch (IllegalArgumentException ex) { // illegal charset name // unsupport charset } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public int getCacheSize() {\n return 4 * 1024 * 1024;\n }", "private void limitedMemoryWithoutEviction() {\n Jedis jedis = this.connector.connection();\n System.out.println(\"Collect: \" + jedis.get(\"0\")); // Redis still services read operations.\n System.out.println(jedis.set(\"0\", ...
[ "0.65068775", "0.63838536", "0.624998", "0.6247483", "0.6242955", "0.6180966", "0.61726403", "0.61726403", "0.6030883", "0.60265255", "0.5873799", "0.58672076", "0.5817187", "0.57785153", "0.57754385", "0.5768511", "0.5748093", "0.574265", "0.5702319", "0.56755275", "0.565116...
0.0
-1
Creates an instance of IntegerSummary with a given starting value and mode.
private IntegerSummary(final int value, final Mode mode) { value_ = value; mode_ = mode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IntegerSummary(final Mode mode) {\n mode_ = mode;\n switch (mode) {\n case Sum:\n value_ = 0;\n break;\n case Min:\n value_ = Integer.MAX_VALUE;\n break;\n case Max:\n value_ = Integer.MIN_VALUE;\n break;\n case AlwaysOne:\n value_ =...
[ "0.76358783", "0.6976555", "0.56717426", "0.56717426", "0.5622618", "0.5622618", "0.5325478", "0.5310018", "0.51797146", "0.5145675", "0.5131876", "0.50715166", "0.50681126", "0.5063852", "0.5014416", "0.5013224", "0.50039726", "0.4996902", "0.499194", "0.49886766", "0.497425...
0.8036184
0
Creates an instance of IntegerSummary with a given mode.
public IntegerSummary(final Mode mode) { mode_ = mode; switch (mode) { case Sum: value_ = 0; break; case Min: value_ = Integer.MAX_VALUE; break; case Max: value_ = Integer.MIN_VALUE; break; case AlwaysOne: value_ = 1; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private IntegerSummary(final int value, final Mode mode) {\n value_ = value;\n mode_ = mode;\n }", "public IntegerSummary(final int value) {\n value_ = value;\n }", "IntValue createIntValue();", "IntValue createIntValue();", "IntegerValue createIntegerValue();", "IntegerValue createIntegerValu...
[ "0.76745236", "0.6188673", "0.5218468", "0.5218468", "0.5077055", "0.5077055", "0.4949979", "0.49146178", "0.47574812", "0.47414154", "0.47150582", "0.4598823", "0.4572731", "0.45376238", "0.45249298", "0.45075282", "0.45062688", "0.446678", "0.44643477", "0.4447008", "0.4431...
0.7888121
0
Creates an instance of the IntegerSummary given a serialized representation
public static DeserializeResult<IntegerSummary> fromMemory(final Memory mem) { return new DeserializeResult<>(new IntegerSummary(mem.getInt(VALUE_INDEX), Mode.values()[mem.getByte(MODE_BYTE_INDEX)]), SERIALIZED_SIZE_BYTES); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IntegerSummary(final int value) {\n value_ = value;\n }", "private IntegerSummary(final int value, final Mode mode) {\n value_ = value;\n mode_ = mode;\n }", "public static DeserializeResult<IntegerSummary> fromMemory(final Memory mem) {\n return new DeserializeResult<>(new IntegerSummary(...
[ "0.6093963", "0.5515506", "0.54294604", "0.52685684", "0.52685684", "0.5251756", "0.5230547", "0.5161814", "0.50878406", "0.49806654", "0.49805218", "0.49489594", "0.49285015", "0.49211672", "0.49114978", "0.49099222", "0.4830618", "0.4830618", "0.48139206", "0.48128614", "0....
0.5212796
7
TODO: inflate a fragment view
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = super.onCreateView(inflater, container, savedInstanceState); unbinder = ButterKnife.bind(this, rootView); return rootView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n // Defines the xml file for the fragment\n return inflater.inflate(R.layout.show_program_fragment, parent, false);\n }", "@Override\n public View onCreateView(@NonNull LayoutInfla...
[ "0.75212604", "0.7492544", "0.7487358", "0.7479385", "0.74779814", "0.7466526", "0.7466328", "0.74526715", "0.7452614", "0.7443973", "0.7438898", "0.7434542", "0.74284536", "0.741808", "0.74093133", "0.7400632", "0.7394933", "0.73865515", "0.7384236", "0.73830897", "0.738306"...
0.0
-1
return " \u2657 ";
@Override public String toString() { return super.getCor().equals("Branco") ? " ♘ ": " ♞ "; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String unicodeEscaped(Character ch) {\n/* 380 */ if (ch == null) {\n/* 381 */ return null;\n/* */ }\n/* 383 */ return unicodeEscaped(ch.charValue());\n/* */ }", "public char getUnicode() {\n return unicode;\n }", "public static String unicodeEscaped(char ch) ...
[ "0.6569997", "0.6452739", "0.6382881", "0.62259173", "0.617083", "0.6127695", "0.61244595", "0.6084588", "0.6074646", "0.6057773", "0.59894925", "0.59667885", "0.59504473", "0.59151095", "0.5907884", "0.588904", "0.5864838", "0.5845782", "0.5834742", "0.5811482", "0.57936984"...
0.528766
95
Create a new dialog.
public Main() { this(DEFAULT_SIZE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Dialog createDialog(DialogDescriptor descriptor);", "public Dialog<String> createDialog() {\n\t\t// Creating a dialog\n\t\tDialog<String> dialog = new Dialog<String>();\n\n\t\tButtonType type = new ButtonType(\"Ok\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().add(type);\n\t...
[ "0.8112039", "0.7999543", "0.75056374", "0.71766335", "0.71189255", "0.7093577", "0.70913374", "0.70857054", "0.7072216", "0.70607746", "0.7056884", "0.69974726", "0.69952285", "0.69755596", "0.6973966", "0.69676816", "0.6950045", "0.6897643", "0.6892043", "0.68387604", "0.68...
0.0
-1
Create a new dialog of the given screen dimension.
public Main(Dimension dim) { super("Price Watcher"); setSize(dim); configureUI(); setLocationRelativeTo(null); setDefaultCloseOperation(DISPOSE_ON_CLOSE); setVisible(true); //setResizable(false); showMessage("Welcome!"); pack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract Dialog createDialog(DialogDescriptor descriptor);", "@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n //set new View to the builder and create the Dialog\n Dialog...
[ "0.618703", "0.6125357", "0.61079884", "0.6049516", "0.6017812", "0.59913474", "0.5980386", "0.5889137", "0.58109844", "0.56398636", "0.5592714", "0.55394155", "0.55095124", "0.54863673", "0.5454556", "0.5448312", "0.54481727", "0.5415187", "0.5355587", "0.5314035", "0.530165...
0.0
-1
Callback to be invoked when the refresh button is clicked. Find the current price of the watched item and display it along with a percentage price change.
private void refreshButtonClicked(ActionEvent event) { //-- //-- WRITE YOUR CODE HERE! //-- itemView.getItem().setPreviousPrice(itemView.getItem().getItemPrice()); //itemView.getItem().setItemPrice(randPrice.getRandomPrice()); itemView.getItem().setItemPrice(randPrice.getRandomPrice(itemView.getItem())); itemView.getItem().setItemChange(); super.repaint(); showMessage("Refresh clicked!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void refreshButtonClicked(ActionEvent event) {\n\n PriceFinder refreshedPrice = new PriceFinder(); // generates a new price to set as a temp item's new price\n\n itemView.testItem.setPrice(refreshedPrice.returnNewPrice());\n configureUI(); // essentially pushes the new item informatio...
[ "0.75575113", "0.6682735", "0.6490192", "0.64418846", "0.6317184", "0.6312379", "0.6297931", "0.6285428", "0.6207529", "0.61779964", "0.6167221", "0.60726273", "0.602091", "0.59554297", "0.5939739", "0.5925657", "0.5924306", "0.5893316", "0.5866209", "0.5859276", "0.57906216"...
0.7002874
1
Callback to be invoked when the viewpage icon is clicked. Launch a (default) web browser by supplying the URL of the item.
private void viewPageClicked() { //-- //-- WRITE YOUR CODE HERE! //-- try{ Desktop d = Desktop.getDesktop(); d.browse(new URI(itemView.getItem().getURL())); }catch(Exception e){ e.printStackTrace(); } showMessage("View clicked!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onItemClick(String url) {\n RxBus2.getInstance().post(Constants.SHOW_WEBVIEW, url);\n RxBus3.getInstance().post(Constants.SHOW_WEBVIEW, url);\n }", "private void viewPageClicked(ActionEvent event) {\n\n Item tempItem = new Item();\n String...
[ "0.7866457", "0.77673167", "0.7420062", "0.71227604", "0.70915425", "0.7073864", "0.6980001", "0.687825", "0.68360084", "0.6739992", "0.66830415", "0.6603505", "0.65943426", "0.6580144", "0.656472", "0.65353215", "0.6476274", "0.64530075", "0.6450423", "0.64148563", "0.640865...
0.7805422
1
creates the add button and allows it to be overriden in subclass
protected JButton createAddButton() { JButton butAdd = new JButton(); butAdd.setIcon(new ImageIcon(getClass().getClassLoader().getResource("image/add.jpg"))); butAdd.setToolTipText("Add a new item"); butAdd.addActionListener(new AddItemListener()); return butAdd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setAddButtonUI() {\n addButton = new JButton(\"Add\");\n addButton.setForeground(new Color(247, 37, 133));\n addButton.addActionListener(this);\n addButton.setContentAreaFilled(false);\n addButton.setFocusPainted(false);\n addButton.setFont(new Font(\"Nunito\"...
[ "0.7966086", "0.77896273", "0.7661302", "0.7626599", "0.75258493", "0.75054127", "0.74285704", "0.74099106", "0.7378287", "0.73501694", "0.7341121", "0.731487", "0.7238367", "0.7236257", "0.71888155", "0.7171653", "0.71233696", "0.7105003", "0.7102746", "0.7078395", "0.707532...
0.8064244
0
creates the refresh button and allows it to be overriden in the subclass
protected JButton createRefreshButton() { JButton butRefresh = new JButton(); butRefresh.setIcon(new ImageIcon(getClass().getClassLoader().getResource("image/refresh3.png"))); butRefresh.setToolTipText("Refresh All"); butRefresh.addActionListener(new refreshListener()); return butRefresh; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void Refresh_button() {\n\t\tthis.defaultSetup();\n\t}", "private VehicleMessageRefreshButton getRefresh() {\r\n\t\tif (refresh == null) {\r\n\t\t\trefresh = new VehicleMessageRefreshButton();\r\n\t\t\trefresh.setToolTipText(\"Refresh data\");\r\n\t\t\trefresh.setMargin(ViewHelper.getMinimalButtonMargin()...
[ "0.76290077", "0.75086987", "0.7485823", "0.74531794", "0.68966043", "0.6869161", "0.68014246", "0.6789831", "0.67849827", "0.6777451", "0.67757374", "0.67281806", "0.6724672", "0.672064", "0.6713756", "0.6692001", "0.6692001", "0.6676597", "0.66204363", "0.66183233", "0.6618...
0.78839785
0
Show briefly the given string in the message bar.
private void showMessage(String msg) { msgBar.setText(msg); new Thread(() -> { try { Thread.sleep(3 * 1000); // 3 seconds } catch (InterruptedException e) { } if (msg.equals(msgBar.getText())) { SwingUtilities.invokeLater(() -> msgBar.setText(" ")); } }).start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showMessage(String string) {\n\n }", "public void showMessage(String message);", "public void showMessage(String message) \r\n\t\t{\t\t\t\r\n\t\t}", "private void showMessageOnScreen(String message) {\n JOptionPane.showMessageDialog(this, message);\n }", "private void display(...
[ "0.75680953", "0.730118", "0.7298659", "0.72845817", "0.7217327", "0.70952564", "0.7092967", "0.7075913", "0.7068595", "0.70532244", "0.7016027", "0.6986334", "0.697986", "0.6974282", "0.69610804", "0.6939151", "0.6902395", "0.6887716", "0.6885516", "0.685741", "0.6850307", ...
0.7171583
6
check position for clicks
public boolean inside(int x, int y, Graphics graphics){ boolean clicked = false; if((x >= _x && x <= (_x + (_width * graphics.getScale())) && (y >= _y && y <= _y + (_height * graphics.getScale())))){ clicked = true; } return clicked; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkMouseClick()\n {\n MouseInfo userClick = Greenfoot.getMouseInfo();\n \n int columnNum;\n int rowNum;\n \n if( Greenfoot.mouseClicked(this) )\n {\n columnNum = userClick.getX() / ( getWidth() / 3 );\n rowNum = userClick.getY...
[ "0.7125675", "0.6965297", "0.6882175", "0.67674744", "0.6744025", "0.6609833", "0.6510712", "0.64514005", "0.6388995", "0.6365182", "0.63573825", "0.63194495", "0.62801653", "0.6268518", "0.6253858", "0.62148815", "0.6196628", "0.6191957", "0.6187463", "0.6187463", "0.6187463...
0.0
-1
========= Open / Close ========= Open file for read/write
public boolean open() { return open(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void openFiles() {\n\t\tthis.container = fso.openFile(prefix+EXTENSIONS[CTR_FILE],\"rw\");\n\t\tthis.metaData = fso.openFile(prefix+EXTENSIONS[MTD_FILE], \"rw\");\n\t\tthis.reservedBitMap = fso.openFile(prefix+EXTENSIONS[RBM_FILE], \"rw\");\n\t\tthis.updatedBitMap = fso.openFile(prefix+EXTENSIONS[UBM_FIL...
[ "0.69941217", "0.69472414", "0.67916125", "0.67761046", "0.66767424", "0.6559995", "0.6428549", "0.64208347", "0.6343103", "0.6306382", "0.6303722", "0.6271968", "0.6271968", "0.6271968", "0.62646186", "0.6259083", "0.62369263", "0.62062716", "0.6185748", "0.61543953", "0.611...
0.0
-1
========= Locking ====== Lock file
public boolean lock(final boolean readOnly) throws IOException { if (isOpen() && lock == null) { lock = fileChannel.lock(0L, Long.MAX_VALUE, readOnly); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void j_lock() {\r\n\t\tdo {\r\n\t\t\tLOCK_FILES_DIR.mkdirs();\r\n\t\t\ttry {\r\n\t\t\t\tRandomAccessFile raf = new RandomAccessFile(GLOBAL_LOCK_FILE,\r\n\t\t\t\t\t\t\"rw\");\r\n\t\t\t\tFileChannel channel = raf.getChannel();\r\n\t\t\t\tFileLock lock = channel.lock();\r\n\t\t\t\tglobalFileChannel = c...
[ "0.7833395", "0.72939837", "0.72502637", "0.71861035", "0.68612885", "0.6804109", "0.6804109", "0.6804109", "0.665155", "0.6538981", "0.65178376", "0.6515028", "0.6472558", "0.6438089", "0.6431774", "0.64094704", "0.6406203", "0.63699514", "0.636555", "0.6363989", "0.6351716"...
0.631225
22
========= Destroy ========= Truncate file
public void clear() { if (!validState) { throw new InvalidStateException(); } try { fileChannel.position(0).truncate(0); sync(); } catch (Exception e) { log.error("Exception in clear()", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void destroy(String filename) throws IOException {\n\t\t// only system calls are used\n\t\tFileChannel fc = (new RandomAccessFile(filename, \"rw\")).getChannel();\n\t\tlong size = fc.size();\n\t\tfc.truncate(0);\n\t\tfc.truncate(size);\n\t\tfc.close();\n\t}", "@Override\n public void destroy() {\n...
[ "0.7584115", "0.6966224", "0.6827921", "0.6708516", "0.659587", "0.652786", "0.6459588", "0.6455596", "0.6446434", "0.6385557", "0.63638544", "0.62610483", "0.6214066", "0.6166368", "0.6149133", "0.6098108", "0.60892487", "0.6082835", "0.6050678", "0.6028467", "0.60150445", ...
0.0
-1
========= Operations ========= set callback called when buffers where synched to disk
public void setCallback(final CallbackSync callback) { this.callback = callback; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void sync(){\n }", "void onBytesWritten(int bytesWritten);", "public interface BlobChangingCallback {\n\n /**\n * Informs the listener that a blob has changed and is ready to update and replace a localized blob that has been marked as tied to the\n * life cycle of the worker...
[ "0.6090025", "0.6043321", "0.58701783", "0.585973", "0.5837421", "0.5786464", "0.57823557", "0.57619", "0.5748618", "0.5721399", "0.56690836", "0.5664508", "0.5662655", "0.5659803", "0.5646178", "0.5643679", "0.5630082", "0.5624336", "0.56173974", "0.561603", "0.5564702", "...
0.5356062
36
Read block from file
public ByteBuffer get(final int index) { if (!validState) { throw new InvalidStateException(); } if (log.isDebugEnabled()) { log.debug("get(" + index + ")"); } try { if (useMmap) { final MappedByteBuffer mbb = getMmapForIndex(index); if (mbb != null) { return mbb; } // Fallback to RAF } final ByteBuffer buf = bufstack.pop(); fileChannel.position(index * blockSize).read(buf); buf.rewind(); return buf; } catch (Exception e) { log.error("Exception in get(" + index + ")", e); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void readBlock(int blockId, byte[] buffer) throws IOException;", "public String fileReadBlock(String path) throws IOException, FileNotFoundException{\n FileInputStream in = new FileInputStream(new File(path));\n int size = in.available();\n byte[] buffer = new byte[size];\n in.read(bu...
[ "0.7409527", "0.73208416", "0.7253288", "0.6643929", "0.652735", "0.64408034", "0.6250262", "0.6152287", "0.6098005", "0.6088202", "0.6072862", "0.60310763", "0.5984721", "0.59419674", "0.5929563", "0.58926105", "0.5845016", "0.58292913", "0.5790026", "0.57279986", "0.5668971...
0.0
-1
Write from buf to file
public boolean set(final int index, final ByteBuffer buf) { if (!validState) { throw new InvalidStateException(); } if (log.isDebugEnabled()) { log.debug("set(" + index + "," + buf + ")"); } try { if (buf.limit() > blockSize) { log.error("ERROR: buffer.capacity=" + buf.limit() + " > blocksize=" + blockSize); } if (useMmap) { final MappedByteBuffer mbb = getMmapForIndex(index); if (mbb != null) { mbb.put(buf); return true; } // Fallback to RAF } fileChannel.position(index * blockSize).write(buf); return true; } catch (Exception e) { log.error("Exception in set(" + index + ")", e); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void write(byte[] buf) throws IOException;", "private static void writeToBuffer(int index, RandomAccessFile fos) {\n\n try {\n\n // x is the current integer value to be written.\n int x;\n // loc is the current location in the buffer to be written.\n ...
[ "0.63429224", "0.6300878", "0.6166512", "0.60300606", "0.6028994", "0.59957665", "0.59564674", "0.5947915", "0.59202325", "0.59088624", "0.5907245", "0.5845781", "0.5735865", "0.57118607", "0.5648886", "0.5647598", "0.56085986", "0.5565382", "0.5548458", "0.5534001", "0.55274...
0.0
-1
Forces any updates to this file to be written to the storage device that contains it.
public void sync() { if (!validState) { throw new InvalidStateException(); } if (useMmap) { syncAllMmaps(); } if (fileChannel != null) { try { fileChannel.force(false); } catch (Exception ign) { } } if (callback != null) { callback.synched(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateFile() {\n try {\n this.taskStorage.save(this.taskList);\n this.aliasStorage.save(this.parser);\n } catch (IOException e) {\n System.out.println(\"Master i am unable to save the file!\");\n }\n }", "void flush() {\r\n synchronized...
[ "0.7020608", "0.6644659", "0.63116217", "0.6252696", "0.61101127", "0.6082896", "0.6046457", "0.6015774", "0.6007995", "0.59736574", "0.59129673", "0.59117097", "0.5906666", "0.5868131", "0.5838233", "0.58279234", "0.5825859", "0.5818404", "0.57027024", "0.5693223", "0.568487...
0.5355926
67
Save and release the buffer
public boolean save() { if (mmaped) { return true; } final boolean ret = storage.set(index, buf); storage.release(buf); buf = null; return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n protected void releaseBuffer() {\n }", "public void save() {\n DataBuffer.saveDataLocally();\n\n //TODO save to db must be done properly\n DataBuffer.save(session);\n\n //TODO recording saved confirmation\n }", "protected void saveBuffer(String name) {\r\n\t\tSt...
[ "0.6731081", "0.6676007", "0.66526574", "0.6494713", "0.6302305", "0.6055645", "0.6017981", "0.59639496", "0.5961257", "0.5960492", "0.5959196", "0.5852093", "0.58260185", "0.5760598", "0.5728478", "0.5727197", "0.5714491", "0.56900966", "0.56507814", "0.56478953", "0.5645582...
0.64165413
4
Is enabled mmap for this store?
public boolean useMmap() { return useMmap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isNativeMaps() {\n return internalNative != null;\n }", "public boolean getMappedFile();", "public Boolean getIsmap() {\n return (Boolean) attributes.get(\"ismap\");\n }", "public boolean isSmapDumped();", "public boolean isInMappedDmMode () {\n\t\tif( vo_resource != null...
[ "0.65403044", "0.65043813", "0.64804655", "0.6418216", "0.63685966", "0.63625956", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.63205624", "0.62910557",...
0.71679896
0