query
stringlengths
8
1.54M
document
stringlengths
9
312k
negatives
listlengths
19
20
metadata
dict
TODO identifier > Identifier() nodeToken > "." nodeToken1 > "isFirst" nodeToken2 > "(" nodeToken3 > ")"
public Snippet visit(DotIsFirst n, Snippet argu) { Snippet _ret= new Snippet("","",null,false); _ret = n.identifier.accept(this, argu); n.nodeToken.accept(this, argu); n.nodeToken1.accept(this, argu); n.nodeToken2.accept(this, argu); n.nodeToken3.accept(this, argu); //re...
[ "public void visit(DotIsFirst n, String argu) {\n\t n.identifier.accept(this, argu);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t n.nodeToken3.accept(this, argu);\n\t }", "private Expression primary () {\n Expre...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if the id is unique by comparing it with the past booking ids
private static Boolean bookingCheck(int id){ for(Booking booking:bookingArrayList){ if(booking.getBookingID().equals(String.valueOf(id))) return false; } return true; }
[ "private boolean bookingAlreadyExists(Long taxiId, Date date, Long id) {\n\t\tList<TaxiBooking> booking = null;\n\t\tTaxiBooking bookingWithId = null;\n\t try {\n\t \tbooking = crud1.findAllByTaxiId(taxiId);\n\t } catch (NoResultException e) {\n\t // ignore \n\t }\n\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the "inputEncoding" attribute
public org.apache.xmlbeans.XmlAnySimpleType getInputEncoding() { synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.XmlAnySimpleType target = null; target = (org.apache.xmlbeans.XmlAnySimpleType)get_store().find_attribute_user(INPUTENCODING$16); ...
[ "public String getInputEncoding()\n {\n return configuration.getInCharEncodingName();\n }", "@Override\n public String getInputEncoding() {\n return inputEncoding;\n }", "protected String getInputEncoding() {\n return (inputEncoding == null) ? ReaderFactory.FILE_ENCODING : inputEncoding...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Guess how to find a server object taken from ProvUtil::guessServerBy
public static ServerBy guessServerBy(String value) { if (Provisioning.isUUID(value)) return ServerBy.id; return ServerBy.name; }
[ "public Server getOneServer(ConObject obj1, ConObject obj2){\n\t if(obj1.name.compareTo(obj2.name) > 0){\n\t ConObject temp = obj1;\n\t obj1 = obj2;\n\t obj2 = temp;\n\t }\n\t System.out.println(\"get \"+obj1.name + \" \" + obj2.name);\n\t if(containsServer(obj1,obj2)){\n\t S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructs a new exception with the specified detail message, cause, and bean for JAXWS exception serialization.
public SaaSApplicationException(String message, ApplicationExceptionBean bean, Throwable cause) { super(message, cause); this.bean = bean; }
[ "public PriceModelException(String message, ApplicationExceptionBean bean,\n Throwable cause) {\n super(message, bean, cause);\n }", "public SerializationException(String msg, Throwable cause) {\n super(msg, cause);\n }", "public SaaSApplicationException(String message,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
method for save the list of cars in a file
public static void savecars(){ Cars xx = new Cars(); System.out.println("save cars"); String outtext; try { File rentfile = new File("cars.csv"); FileWriter out = new FileWriter(rentfile); for (int i = 0; i < listcars.size();i++) { xx =...
[ "private void saveCarListings() {\r\n try {\r\n Writer writer = new Writer(new File(CARLISTINGS_FILE));\r\n writer.write(cars);\r\n writer.close();\r\n System.out.println(\"Car Listings saved to file \" + CARLISTINGS_FILE);\r\n } catch (FileNotFoundException...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Represents the core of TinsPHP which defines the builtin primitive types, functions, classes and interfaces as well as available operator overloading and implicit/explicit casts.
public interface ICore { Map<Integer, IMinimalMethodSymbol> getOperators(); Map<String, ITypeSymbol> getPrimitiveTypes(); // IClassTypeSymbol getExceptionTypeSymbol(); // // ICastingMethod getStandardCastingMethod(ITypeSymbol formalParameterType); // // void addExplicitCastFromTo(ITypeSymbol actualPa...
[ "public interface CalcPrimitive<T extends Number> {\n\t/**\n\t * Basic arithmetic operation which adds two numbers\n\t * \n\t * @param first\n\t * the addition operand\n\t * @param second\n\t * the addition operand\n\t * @return first + second\n\t */\n\tpublic T sum(T first, T second);\n\n\t/*...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "rule__AstActor__Group_6__0__Impl" $ANTLR start "rule__AstActor__Group_6__1" ../org.caltoopia.frontend.ui/srcgen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:8016:1: rule__AstActor__Group_6__1 : rule__AstActor__Group_6__1__Impl ;
public final void rule__AstActor__Group_6__1() throws RecognitionException { int stackSize = keepStackSize(); try { // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:8020:1: ( rule__AstActor__Group_6__1__Impl ) ...
[ "public final void rule__AstActor__Group_6_1__1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.caltoopia.frontend.ui/src-gen/org/caltoopia/frontend/ui/contentassist/antlr/internal/InternalCal.g:8083:1: ( rule__AstActor__Group_6_1__...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Encode the aBuffer ByteBuffer and write the encoded result to the OutputStream aStream. The ByteBuffer's position will be advanced to ByteBuffer's limit.
public void encode(ByteBuffer aBuffer, OutputStream aStream) throws IOException { byte [] buf = getBytes(aBuffer); encode(buf, aStream); }
[ "public void encodeBuffer(ByteBuffer aBuffer, OutputStream aStream)\n throws IOException {\n byte [] buf = getBytes(aBuffer);\n encodeBuffer(buf, aStream);\n }", "public void encodeBuffer(byte aBuffer[], OutputStream aStream)\n throws IOException {\n ByteArrayInputStr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a job from output of updateActiveJobOnlyToDraft() Update Job Only save as Active Should have basic Filter and History from above transitions After update Job must move to Active History should have previous draftrecord no chnage in filter histiry hasBeenEdited should be true canEdit must be true everctive is tru...
@Test @Transactional public void updateDraftJobToActiveByOnlyChangingJobNotFilters() throws Exception { User user = new User();user.setEmail("abhinav@abhinav.com");user.setPassword("$2a$10$mE.qmcV0mFU5NcKh73TZx.z4ueI/.bDWbj0T1BYyqP481kGGarKLG");user.setLogin("abhinav"); user.setLangKey("en"); userRepository.sav...
[ "@Test\n\t@Transactional\n\tpublic void updateActiveJobFilterAndNotJob() throws Exception {\n\t\tUser user = new User();user.setEmail(\"abhinav@abhinav.com\");user.setPassword(\"$2a$10$mE.qmcV0mFU5NcKh73TZx.z4ueI/.bDWbj0T1BYyqP481kGGarKLG\");user.setLogin(\"abhinav\");\n\t\tuser.setLangKey(\"en\");\n\t\tuserReposit...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method returns the test command
public String getTestCommand() { return testCommand; }
[ "public String getCommand(){\n\t\treturn testResult.getCommand();\n\t}", "@Test\n\tpublic void getCommandTest() {\n\t\tString command = \"Hello World\";\n\t\tString expected = \"Hello\";\n\t\tString actual = Helper.getCommand(command);\n\t\tassertEquals(expected, actual);\n\n\t\tcommand = \"This is a line of comm...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method corresponds to the database table SALEORDERDETAIL
@Insert({ "insert into SALEORDERDETAIL (SOID, LINENO, ", "MID, MNAME, STANDARD, ", "UNITID, UNITNAME, ", "NUM, BEFOREDISCOUNT, ", "DISCOUNT, PRICE, ", "TOTALPRICE, TAXRATE, ", "TOTALTAX, TOTALMONEY, ", "BEFOREOUT, ESTIMATEDATE, ", "LEFTNUM, ISGIFT,...
[ "public List<SoDetailsDTO> Sodetails() {\n\n String query = \"select s.warehouse_id,s.gateway_order_id from base_order b join shipping_order s on b.id=s.base_order_id \" +\n \"where s.shipping_order_status_id=120 and b.gateway_order_id='\"+orderIdSoDetails+\"'\";\n\n\n\n\n return\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the result of interpreting the object as an instance of 'Regular Interval Schedule'. This implementation returns null; returning a nonnull result will terminate the switch.
public T caseRegularIntervalSchedule(RegularIntervalSchedule object) { return null; }
[ "public T caseBasicIntervalSchedule(BasicIntervalSchedule object) {\n\t\treturn null;\n\t}", "public T caseRegulationSchedule(RegulationSchedule object) {\n\t\treturn null;\n\t}", "public T caseSchedule(Schedule object) {\n\t\treturn null;\n\t}", "public T caseScheduleType(ScheduleType object) {\r\n\t\treturn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The major version of the API, as used in the package name. E.g., "v1".
public abstract String majorVersion();
[ "String getVersionMajor();", "String getApiVersion();", "String getClientVersion();", "public String getApiVersion();", "Version getApiVersion();", "protected int getMajorVersion() {\n return this.cluster.authenticate(this.passwordAuthenticator).clusterManager().info(5,TimeUnit.SECONDS).getMinVersi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return this instance of MainService so clients can call public methods
MainService getService() { return MainService.this; }
[ "public static MainService getInstance() {\n\n if (sInstance == null) {\n Log.e(TAG, \"getInstance(), Main service is null.\");\n startMainService();\n }\n\n return sInstance;\n }", "@Override\n public Main getMain() {\n return main;\n }", "public stati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds (or subtracts if the given number is negative) points to the character's hunger.
void addToHunger(int points);
[ "private void hunger(int pointValue) throws HealthStateException{\n Player player = state.getAdventurer();\n player.addHunger(pointValue);\n }", "public void addPoints(int points){\r\n\t\tthis.highscore = this.highscore + points;\r\n\t}", "public void addNegativePoints(int pts) {\r\n\t\t negati...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets chemical shift error to val in rows where it is null.
public static void addShiftError( LoopTable table, String val ) throws java.sql.SQLException { StringBuffer sql = new StringBuffer( "UPDATE LOOP SET SERROR='" ); sql.append( val ); sql.append( "' WHERE SERROR IS NULL" ); java.sql.Statement stat = table.getConnection().createStat...
[ "public static void addShiftError( LoopTable table, String type, int isotope,\n String val ) throws java.sql.SQLException {\n StringBuffer sql = new StringBuffer( \"UPDATE LOOP SET SERROR='\" );\n sql.append( val );\n sql.append( \"' WHERE ATOMTYPE='\" );\n sql.append( type );\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The name of the host for the database. Can be either a string (host.subdomain.domain.tld) or an IPv4 or IPv6 address.
public String getDatabaseHost() { return this.databaseHost; }
[ "public String getHost() {\n return m_database.getConfiguration().getHost();\n }", "public String getDbHost() {\r\n return dbHost;\r\n }", "public String getSQLhost() {\n return this.sqlConfig.getString(\"host\");\n }", "public String getDbHost() {\r\n return dbHost;\r\n }", "p...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds a TechGalleryUser by his/her email.
@Override public TechGalleryUser getUserByEmail(final String email) throws NotFoundException { TechGalleryUser tgUser = userDao.findByEmail(email); // TechGalleryUser tgUser = userDao.findByEmail("example@example.com"); if (tgUser == null) { throw new NotFoundException(ValidationMessageEnums.USER_NOT...
[ "User find(String email);", "public User findUserByEmail(final String email);", "CmUser findByEmail(final String email) throws EpServiceException;", "User findUserByEmail(String email) throws Exception;", "private String queryFlickrOnUserEmail(Flickr flickr, String presumedEmail)\n throws FlickrExcepti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
end getPublisherSelection Gets a valid Book from the user depending on existence (name and writing group)
public static String[] getBookSelection(Connection conn){ String[] validBook = new String[2]; Scanner in = new Scanner(System.in); try{ String sql = "SELECT booktitle FROM Books WHERE booktitle = ? AND groupname = ?"; PreparedStatement pstmt = conn.prepareStatement(sql); ...
[ "private static void queryBooksByPublisher(){\n\t\tSystem.out.println(\"===Query Books By Publisher===\");\n\t\tScanner string_input = new Scanner(System.in);\n\t\t\n\t\tSystem.out.println(\"Enter Publisher to Query Books by: \");\n\t\tString publisher = string_input.nextLine();\n\t\t\n\t\tif(ALL_PUBLISHERS.contain...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets StateOfGame to EXIT.
public void endGame(){ state = StateOfGame.GAME_OVER; }
[ "public static void exitGame() {\n exitGame = true;\n }", "public static void exitGame() {\n\t\tSystem.exit(0);\n\t}", "private void exitGame() {\n System.exit(0);\n }", "public void exitGame(){\n\t\t\tSystem.exit(0);//system command\n\t\t}", "public static void quitGame() {\n Sys...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END returns the result of END variable
public boolean END() { return END; }
[ "String getEnd();", "long getEnd();", "String getIfEnd();", "public Block getEnd () {\n\t\treturn end;\n\t}", "private String addEnd() {\n\t\t// NO PARAMETERS\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|End\");\n\t\treturn tag.toString();\n\t}", "public String getEnd()\r\n\t{\r\n\t\tr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
apksigner.jar sign ks key.jks kskeyalias releasekey kspass pass:pp123456 keypass pass:pp123456 out output.apk input.apk
public static void apkSignature(File unsignedApk, File signedApk, String keyStore, String keyPwd, String alias, String alisaPwd) throws IOException, InterruptedException { String v1Name = signature(unsignedApk, keyStore, keyPwd, alias, alisaPwd); String zipalignName =...
[ "void signEmbeddedApk(\n ModuleEntry apkEntry,\n SigningConfiguration signingConfig,\n Path outputApkPath,\n boolean signWithV3) {\n ZipPath targetPath = apkEntry.getPath();\n try (TempDirectory unsignedDir = new TempDirectory()) {\n // Input\n Path unsignedApk = unsignedDir.getP...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An interface for a clustering algorithm. This is for applying a clustering algorithm to a list of points.
public interface ClusteringAlgorithm { /** * Apply a clustering * algorithm for a given result * @param points * @return */ ClusterSet applyTo(List<Point> points); }
[ "protected abstract void executeClusteringAlgorithm();", "public interface ICluster<T> extends Iterable<T>, ISelfDescription {\n\n\t/**\n\t * number of elements in it\n\t * \n\t * @return\n\t */\n\tpublic int size();\n\n\t/**\n\t * allows the assessment of centroid distances and related stuff.\n\t * \n\t * Discus...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the properties to ignore.
public synchronized String[] getPropertiesToIgnore() { return (String[]) propertiesToIgnore .toArray(new String[propertiesToIgnore.size()]); }
[ "public Set<String> getExcludedProperties() {\r\n return this.excludeProperties;\r\n }", "public Properties getExcessProperties() {\n return excessProperties;\n }", "public Set<String> getIgnoreFields() {\n return ignoreFields;\n }", "public ArrayList<String> getUnRequestedPropertie...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets information of transformation jobs. If the job ID exists in the request, the information for that job is returned; Otherwise, information of all the jobs kept in table master will be returned.
public alluxio.grpc.table.GetTransformJobInfoPResponse getTransformJobInfo(alluxio.grpc.table.GetTransformJobInfoPRequest request) { return blockingUnaryCall( getChannel(), getGetTransformJobInfoMethod(), getCallOptions(), request); }
[ "alluxio.grpc.table.TransformJobInfo getInfo(int index);", "public com.google.common.util.concurrent.ListenableFuture<alluxio.grpc.table.GetTransformJobInfoPResponse> getTransformJobInfo(\n alluxio.grpc.table.GetTransformJobInfoPRequest request) {\n return futureUnaryCall(\n getChannel().newC...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Skip elements, values of which repeat in the given field. Only first elements will be included in the results. Note: This method must be called as last when constructing a query. When called it will project the query and create a filter to eliminate duplicates.
public LuceneQuery<T> skipSame(String field){ return skipSame(field, null); }
[ "public LuceneQuery<T> skipSame(String field, LuceneQuery<?> luceneQuery){\n\t\tString idPropertyName = getSession().getSessionFactory().getClassMetadata(getType()).getIdentifierPropertyName();\n\n\t\tFullTextQuery query = buildQuery();\n\t\tquery.setProjection(idPropertyName, field);\n\t\tList<Object[]> documents ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets side joint count.
public void setSideJointCount(final int sideJointCount) { this.sideJointCount = sideJointCount; }
[ "public int getSideJointCount() {\n return sideJointCount;\n }", "public void setJunctionCount(int value) {\r\n this.junctionCount = value;\r\n }", "public void setNb_joint(int Nb_joint) {\r\n this.Nb_joint = Nb_joint;\r\n }", "public int getNumberOfJoints()\n {\n return j...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Prepares the training and testing set.
private void prepareDataset() { ClassificationManager classifierManager = ClassificationManager .getInstance(filtersList, preprocessorsList); String path = classifierManager.getGoldenDataPath(username); DAO dao = DAO.getInstance("FileSystems:" + path); ArrayList<String> labels = dao.getClasses(); Ar...
[ "@Override\n public void prepareTest() {\n int trainingSetSize = 100;\n int inputSize = 10;\n int outputSize = 5;\n\n this.trainingSet = new DataSet(inputSize, outputSize);\n\n for (int i = 0; i < trainingSetSize; i++) {\n double[] input = new double[inputSize];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A hacky method for inflating menus from xml resources to an array of BottomBarTabs.
protected static BottomBarTab[] inflateMenuFromResource(Activity activity, @MenuRes int menuRes) { // A bit hacky, but hey hey what can I do PopupMenu popupMenu = new PopupMenu(activity, null); Menu menu = popupMenu.getMenu(); activity.getMenuInflater().inflate(menuRes, menu); i...
[ "private void createBottomBar(Bundle savedInstanceState){\n bottomBar = BottomBar.attach(this, savedInstanceState);\n\n bottomBar.setItemsFromMenu(R.menu.bottombar, new OnMenuTabClickListener() {\n @Override\n public void onMenuTabSelected(@IdRes int menuItemId) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns get the distribution group name
public String getDistributionGroupName() { return distributionGroupName; }
[ "java.lang.String getGrpNm();", "java.lang.String getGroupName();", "public String getGroupName() {\n return groupInfo.groupName;\n }", "default String getGroup() {\n return this.getModuleId().getGroup();\n }", "public String getDistributionName();", "java.lang.String getProductGroup();", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ Check if status is public
private boolean isPublic(String status) { if (status.equalsIgnoreCase("public")) { return true; } else { return false; } }
[ "private boolean isPrivate(String status) {\n if (status.equalsIgnoreCase(\"private\")) {\n return true;\n } else {\n return false;\n }\n }", "public boolean isPublic();", "boolean isPublic();", "public boolean isPublic() { return isPublic; }", "boolean isPublic...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the set of scripts.
@Override public Iterable<? extends Script> scripts() { return unmodifiableCollection(orderedScripts); }
[ "public Collection<Script> getScripts()\n\t{\n\t\treturn scripts.values();\n\t}", "public List<String> getScriptIncludes() {\n\t\treturn this.scripts;\n\t}", "public List<String> getPossibleScripts() {\n final List<String> res = new LinkedList<>();\n\n final LinkedList<File> dirs = new LinkedList<...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates the jackson ObjectMapper
public ObjectMapper createObjectMapper() { ObjectMapper objectMapper = new ObjectMapper(); objectMapper.enable(SerializationFeature.INDENT_OUTPUT); return objectMapper; }
[ "public static ObjectMapper build() {\n return mapper.copy();\n }", "public static ObjectMapper createDefaultJsonMapper() {\r\n return createDefaultJsonMapper(null);\r\n }", "public JacksonAdapter() {\n this.simpleMapper = ObjectMapperShim.createSimpleMapper();\n this.headerMap...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Indicates whether this account is subscribed to leverage IP address services in the target cloud.
@Override public boolean isSubscribed() throws CloudException, InternalException { return true; }
[ "public boolean upnpAvailable();", "boolean hasSatellites();", "boolean isWifiCallingAvailable();", "boolean isExposedWithClusterIP() {\n return ListenersUtils.hasClusterIPListener(listeners);\n }", "public boolean isSubscribedTo(String aUsername) { return subscribedTo.contains(aUsername); }", "...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run a connection event on all registered listeners.
private void runConnectionEvent(ServerConnectEvent l) { for (ServerConnectionListener l2 : listeners) { l2.serverConnectEvent(l); } }
[ "private void runConnectionEvent(ClientConnectEvent l) {\n for (ClientConnectionListener l2 : listeners) {\n l2.clientConnectEvent(l);\n }\n }", "public void addConnectionEventListener(ConnectionListener listener);", "public static void fireConnectionChange() {\n\t\tfor (SqlListener ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a random Direction.
static Direction randomDirection() { return directions[(int) (Math.random() * directions.length)]; }
[ "static Direction randomDirection() {\n\t\treturn new Direction((float)Math.random() * 2 * (float)Math.PI);\n\t}", "public Direction getRandomDirection() {\n Direction[] allDirections = new Direction[]{Direction.LEFT,Direction.TOP,Direction.BOTTOM,Direction.RIGHT};\n int index = new Random().nextInt...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get league codes and label from resources
public static String getLeague(Context context, int league_num) { int[] leagueCodes = context.getResources().getIntArray(R.array.league_codes); String[] leagueLabels = context.getResources().getStringArray(R.array.league_labels); // find the position of the league code and we get the league...
[ "String getLabelResource();", "com.google.ads.googleads.v1.resources.Label getLabel();", "com.google.ads.googleads.v6.resources.Label getLabel();", "public static String getLeague(Context context, int leagueNum)\n {\n // get the league codes and their corresponding\n // names from the app res...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Request an Application Signing Key. A token with scope read:signing_keys is needed. See
public Request<Key> get(String kid) { Asserts.assertNotNull(kid, "kid"); HttpUrl.Builder builder = baseUrl .newBuilder() .addPathSegments("api/v2/keys/signing") .addPathSegment(kid); String url = builder.build().toString(); return new BaseRequest<>(cl...
[ "private static Key getSigningKey()\n {\n byte[] apiKeySecretBytes = DatatypeConverter.parseBase64Binary(SIGNING_KEY);\n Key signingKey = new SecretKeySpec(apiKeySecretBytes, SignatureAlgorithm.HS256.getJcaName());\n return signingKey;\n\n }", "java.lang.String getAppKey();", "private...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test of getLastLaunchFile method, of class LauncherAprsJFrame.
@Test public void testGetLastLaunchFile() throws Exception { System.out.println("getLastLaunchFile"); File expResult = null; File result = LauncherAprsJFrame.getLastLaunchFile(); assertEquals(expResult, result); // TODO review the generated test code and remove the default ca...
[ "@Test\n public void testPrevSingleWithLaunchFile() throws Exception {\n System.out.println(\"prevSingleWithLaunchFile\");\n File launchFile = null;\n XFutureVoid expResult = null;\n XFutureVoid result = LauncherAprsJFrame.prevSingleWithLaunchFile(launchFile);\n assertEquals(ex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of oracle.
public void setOracle(boolean v) {this.oracle = v;}
[ "public Builder setOracleTypeValue(int value) {\n \n oracleType_ = value;\n onChanged();\n return this;\n }", "void setDataModelOracle( Path project,\n DataModelOracle oracle );", "public void setOracleId(long oracleId) {\n\t\tthis.oracleId = oracleId...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The isThreeOfKind method sets up a vectors that will contain the cards that match. It goes through the hand, if the hand contains equal cards it adds them to the myDiscards vector.
public boolean isThreeOfKind() { Vector<Integer> myMatches = new Vector<Integer>(); ranking = null; for (int i = 0; i < myCards.size() - 1; i++) { if (myCards.get(i).getType().getType() == myCards.get(i + 1).getType().getType()) { if (myMatches.contains(i)) { myMatches.add(i + 1); } ...
[ "public boolean hasThreeKind (){\n int flag = -1;\n //Sorted hand where same rank goes one by one\n PokerHand hand = this.handMergeSort();\n int[] temp = new int[Card.ranks.length];\n\n for (int i = 0; i < hand.cards.size() - 2; i++) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test the retrieval of the domain name.
@Test public void testGetDomainName() { assertThat(principal.getDomainName()).isEqualTo(domainName); }
[ "String getDomain();", "protected abstract String getDomainName();", "String getDomainTitle();", "String getSearchDomainName();", "public String getDomainName() {\n return domainName;\n }", "private void checkSearchDomain() {\n final HttpHelper.GetRequest request = new HttpHelper.GetReque...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Factory method for functors which use a TypedMode
@SuppressWarnings("unchecked") public <T,V> FunctorBase<T,V> makeFunctionalBase(InvokableState state, TypedMode<V> mode) { if (mode != null) { return (FunctorBase<T, V>) mode.makeBase(state); } return new BasicFunctor<T,V>(state); }
[ "ModeElementType createModeElementType();", "@SuppressWarnings(\"unchecked\")\n public <T,V> FunctorBase<T,V> makeFunctionalBase(InvokableState state, Mode mode) {\n if (mode != null) {\n return (FunctorBase<T,V>)mode.makeBase(state);\n }\n return new BasicFunctor<T,V>(state);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test spatial range query using index.
@Test public void testSpatialRangeQueryUsingIndex() throws Exception { RectangleRDD spatialRDD = new RectangleRDD(sc, InputLocation, offset, splitter, true,StorageLevel.MEMORY_ONLY()); spatialRDD.buildIndex(IndexType.RTREE,false); for(int i=0;i<loopTimes;i++) { long resultSize = RangeQuery...
[ "public void testRange() throws IOException, InvalidGeoException\r\n {\n LgteIndexSearcherWrapper searcher = new LgteIndexSearcherWrapper(path);\r\n\r\n //try find Jorge and Bruno documents in Lisbon the closest one is in Lisbon and the next is in Portalegre, in center of Portugal, Jorge home city\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Aassociation a= new Aassociation(); a.areaofRectangle(2, 3);
public static void main(String[] args) { BAssociation b= new BAssociation(); b.a= new Aassociation(); b.a.areaofRectangle(5, 6); }
[ "public void claShapeArea(){\r\n\t\tshape.calArea();\r\n\t}", "interface Area{\r\n \tint area(int i,int j);\r\n }", "@Test\n\tpublic void testArea1() {\n\t\trec = new Rectangle(4, 5);\n\t\tdouble ex = 20;\n\t\tdouble ac = rec.area();\n\t\tassertEquals(ex, ac, 0.1);\n\t}", "AREA createAREA();", "abstract voi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the connection user name.
@Nullable public String getConnectionUser() { return connectionUser; }
[ "protected String getUser(AbstractXMPPConnection connection) {\n return connection.getUser().toString().split(AT)[0];\n }", "public String getUser() {\n return m_database.getConfiguration().getUser();\n }", "public final String getUserName() {\n return properties.get(USER_NAME_PROPERTY);\n }", "pu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The following method is used to search and remove the empty pair of braces
public String processEmptyBraces (String redRandElofMt) { String stringAfterLeftBrace [] = processExpression.splitStringIntoTwo(redRandElofMt, "("); String stringBeforeRightBrace []; if(!stringAfterLeftBrace[1].equals("")) //stringAfterLeftBrace[1] != "" means '(' is found { stringBeforeRightBrace = p...
[ "public void deleteBrace(){\n String filePath = path + separator + objectName;\n File oldfile = new File(filePath);\n File newfile = new File(filePath);\n BufferedReader bufferedReader = null;\n PrintWriter printWriter = null;\n StringBuffer stringBuffer = new StringBuffer(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return az int in asec.
public double getAzRms() { return 3600.0 * Math.sqrt(1000.0 * azInt / (double) (updateTimeStamp - startTime)); }
[ "public double getAzInt() {\n\t\treturn 3600.0 * azInt;\n\t}", "public double getAzDiff() {\n\t\treturn azDiff;\n\t}", "public BigDecimal getACCRUAL_AMT() {\r\n return ACCRUAL_AMT;\r\n }", "public long getAlphaAtZeroDuration() {\n\treturn (long)(this.alphaAtZero * 1000f);\n }", "public long get...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the first bookmarks entry in the ordered set where groupId = &63; and status = &63;.
public BookmarksEntry fetchByG_S_First(long groupId, int status, com.liferay.portal.kernel.util.OrderByComparator<BookmarksEntry> orderByComparator);
[ "public BookmarksEntry fetchByG_NotS_First(long groupId, int status,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<BookmarksEntry> orderByComparator);", "public BookmarksEntry fetchByG_U_S_First(long groupId, long userId,\n\t\tint status,\n\t\tcom.liferay.portal.kernel.util.OrderByComparator<BookmarksEntr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialise a new parameter object with the given password characters. Additional initialisation vector and salt will be generated randomly. This constructor should be typically used during encryption, with a usersupplied password.
public EncryptionParameter(final char[] password) { iv = generateRandom(IV_LENGTH); salt = generateRandom(SALT_LENGTH); key = new SecretKeySpec(deriveKey(password, salt), CRYPTO_ALG); }
[ "public EncryptionParameter(final char[] password, final byte[] iv, final byte[] salt) {\n this.iv = iv;\n this.salt = salt;\n key = new SecretKeySpec(deriveKey(password, salt), CRYPTO_ALG);\n }", "public RandPass() {\n\t\tthis(new SecureRandom(), NONCONFUSING_ALPHABET);\n\t}", "public R...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Triggers inventory saving when player drops items
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onPlayerDropItemEvent(PlayerDropItemEvent ev) { ItemIdentifier itemId = ItemIdentifier.resolveItemIdentifier(ev.getItemDrop().getItemStack()); if (!itemId.isDroppable()) { ev.setCancelled(true); return; } ...
[ "private void dropItemMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_dropItemMouseReleased\n\n if (dropItem.isEnabled()) {\n Item item = (Item) playerItem.getSelectedValue();\n\n game.playerDrop(item);\n if (item instanceof Dynamite) {\n restor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the difference between two masses in ppm
public Double calcPPMDiff(Double mass1, Double mass2) { return (Math.abs(mass1 - mass2)/(mass2))*1000000; }
[ "static public double getBpmDifference(double sourceBpm, double targetBpm) {\n if ((sourceBpm == 0.0) || (targetBpm == 0.0)) return 0.0;\n if (sourceBpm == targetBpm) return 0.0;\n double diff_before_shift = targetBpm / sourceBpm * 100.0; // avoids calculating twice\n double diff = diff_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called when a value of concentration has been removed
public void concentrationRemoved(edu.mit.dig.saveface.model.Education.Education source, com.ibm.adtech.jastor.Thing oldValue);
[ "void removeEnergy(int amount);", "void unsetCValue();", "public void removeConductor(Contact value) {\r\n\t\tBase.remove(this.model, this.getResource(), CONDUCTOR, value);\r\n\t}", "void removeHasEnergyCF(EnergyCF oldHasEnergyCF);", "public void removeEnergyBattery(DimPos pos);", "void coinsRemoved(CoinR...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR start "where" C:\\Users\\asd\\workspaceBambrikii\\KBParser\\src\\test\\java\\org\\bambrikii\\kbParser\\dql\\grammar\\DqlGrammar.g:29:1: where : WHERE ( WS )+ condition_expr_aggr ( elements_delimiter condition_expr_aggr ) ;
public final DqlGrammarParser.where_return where() throws RecognitionException { DqlGrammarParser.where_return retval = new DqlGrammarParser.where_return(); retval.start = input.LT(1); int where_StartIndex = input.index(); Object root_0 = null; Token WHERE18=null; Token ...
[ "public final void where() throws RecognitionException {\r\n try {\r\n // D:\\\\entornotrabajo\\\\workspace-sgo\\\\persistance\\\\src\\\\main\\\\java\\\\es\\\\caser\\\\persistance\\\\sql\\\\antlr\\\\SQLGrammar.g:112:1: ( WHERE logicExpresions )\r\n // D:\\\\entornotrabajo\\\\workspace-s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Method for getting multiple rows. If a row cannot be found there will be a null value in the result list for that TGet at the same position. So the Results are in the same order as the TGets.
public List<TResult> getMultiple(ByteBuffer table, List<TGet> tgets) throws TIOError, org.apache.thrift.TException;
[ "@Override\n protected Result[] processMultiGet(ByteBuffer tableName, ByteBuffer regionName, List<Get> gets)\n throws IOException, IOError {\n if (Bytes.isNonEmpty(regionName)) {\n metrics.incDirectCalls();\n return rs.get(Bytes.getBytes(regionName), gets);\n } else {\n metr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
gets the outputs to this neuron
public ArrayList<NeuralConnection> getOutputs() { return outputs; }
[ "public double[] getOutput() {\r\n int i = 0;\r\n for (Neuron c : outputNeurons) {\r\n outputBuffer[i] = c.getOutput();\r\n i++;\r\n }\r\n\r\n return outputBuffer;\r\n }", "private float[] getOutputs() {\n\t\tfloat[] outputs = new float[getOutputNodes()];\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$ANTLR end "entryRuleSkillFakeDefinition" $ANTLR start "ruleSkillFakeDefinition" InternalGaml.g:2773:1: ruleSkillFakeDefinition : ( ( rule__SkillFakeDefinition__Group__0 ) ) ;
public final void ruleSkillFakeDefinition() throws RecognitionException { int ruleSkillFakeDefinition_StartIndex = input.index(); int stackSize = keepStackSize(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 194) ) { return ; } // InternalGa...
[ "public final void rule__SkillFakeDefinition__Group__0() throws RecognitionException {\n int rule__SkillFakeDefinition__Group__0_StartIndex = input.index();\n\n \t\tint stackSize = keepStackSize();\n \n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 954) ) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if this client should use SSL when connecting to the server described by the 'profile'. The result is stored in the private fields use_ssl and ssl_port.
protected void checkSSL() { if (!doSupportSSL) return; ssl_port = ((IIOPProfile) profile).getSslPortIfSupported( client_required, client_supported ); use_ssl = ssl_port != -1; }
[ "public boolean useSSL() {\n\t\treturn ssl;\n\t}", "public final boolean getIsSocketSSLConnection(){\r\n return isSocketSSL;\r\n }", "private boolean isSsl()\n {\n return _sslContext != null && _sslParameters != null;\n }", "public boolean isSsl() {\r\n\t\treturn ssl;\r\n\t}", "public boolean...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
base ^ exp mod (p q), p, q are primes
public static BigInteger modPow(BigInteger base, BigInteger p, BigInteger q, BigInteger exp) { BigInteger expP = exp.mod(p.subtract(BigInteger.ONE)), expQ = exp.mod(q.subtract(BigInteger.ONE)), resP = base.modPow(expP, p), resQ = base.modPow(expQ, q), ...
[ "public static long mod_exp(long base, long exp, long mod){\n long result = base%mod;\n for (long i=1;i<exp;i++){\n result = (result*base)%mod;\n }\n return result;\n }", "public static long fast_exp(long base, long exp, long mod){\n long result = 1;\n long x=base%mod;\n while (exp>0){\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Start & stop time getters for Away mode lights
public JSpinner getAwayLightsStartTime() { return awayLightsStartTime; }
[ "public double getStopTime();", "double getStaStart();", "int getStandTime();", "RampDownTimer getRampDownTimer();", "double getAcStallTimer();", "long getMonitoringTime();", "int getModelStartTime();", "public double getEventTime();", "int getStarttime();", "Object getOnClock();", "long getStop...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of stolenFlag
public String getStolenFlag() { return stolenFlag; }
[ "public Character getStolenFlag() {\n return stolenFlag;\n }", "public java.lang.Boolean getStolen() {\n return stolen;\n }", "public void setStolenFlag(String stolenFlag)\n\t{\n\t\tthis.stolenFlag = stolenFlag;\n\t}", "int getFlag();", "public boolean getSFlag() {\r\n return sFlag;...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Registers action serializers into provided registry.
public static void registerActionSerializers(final SerializerRegistry serializerRegistry) { // register OF v1.0 action serializers ActionSerializerRegistryHelper helper = new ActionSerializerRegistryHelper( EncodeConstants.OF_VERSION_1_0, serializerRegistry); helper.registerSeria...
[ "public static void registerActionSerializers(SerializerRegistry serializerRegistry) {\r\n Class<Action> actionClass = Action.class;\r\n // register OF v1.0 action serializers\r\n EnhancedKeyRegistryHelper<Action> helper =\r\n new EnhancedKeyRegistryHelper<>(EncodeConstants.OF10_...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array of Peers, where the peers are the Nodes responsible for the replica of a specific data item. The method takes the first N peers in the ring with key greater or equal to itemKey. In case the number of peers in the system is less or equal than N, then all peers are returned.
public ArrayList<Peer> getReplicasFromKey(Integer N, Integer itemKey){ // The nodes responsible for this item will be the N ones // with key >= itemKey Integer next = this.nextEqual(itemKey); ArrayList<Peer> replicas = new ArrayList<>(); // In case there are less nodes than N, a...
[ "@Override\n public Collection<Thing42orNull<K, D>> getPeersAsCollection(K key) {\n\n Collection<Thing42orNull<K, D>> col = new HashSet<>();\n\n for (Thing42orNull<K, D> peer : peers) {\n if (peer.getKey().equals(key)){\n col.add(peer);\n }\n }\n r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is the getter method this will return the attribute value. Rule group for the matching rule. Field introduced in 17.2.1. Allowed in enterprise edition with any value, essentials, basic, enterprise with cloud services edition. Default value when not specified in API or module is interpreted by Avi Controller as nul...
public String getRuleGroup() { return ruleGroup; }
[ "@JsonIgnore\n @Transient\n public RuleVersion getGroupRule() {\n return groupRule;\n }", "public String ruleGroupName() {\n return this.ruleGroupName;\n }", "@JsonIgnore\n @Transient\n RuleVersion doGetGroupRule(Evaluator evaluator) {\n if (getGroupRule() == null && evalu...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Resolving branch name points to commit.
@Test public void resolveBranch() throws Exception { ObjectId commitId = repo.resolve(Constants.MASTER); try (RevWalk walk = new RevWalk(repo)) { // Unknown type (any) RevObject object = walk.parseAny(commitId); assertThat(object.getType()).isEqualTo(Constants.OBJ_COMMIT); assertThat(o...
[ "@Test\n public void resolveCommitHash() throws Exception {\n String revStr = initialCommit.name();\n ObjectId commitId = repo.resolve(revStr);\n try (RevWalk walk = new RevWalk(repo)) {\n RevObject object = walk.parseAny(commitId);\n assertThat(object.getType()).isEqualTo(Constants.OBJ_COMMIT);...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the 'previousJob' field.
public com.epam.eco.commons.avro.data.TestJob getPreviousJob() { return previousJob; }
[ "public com.epam.eco.commons.avro.data.TestJob getPreviousJob() {\n return previousJob;\n }", "public Task.State getPrevJobTaskState() {\n return prevJobTaskState;\n }", "public String getPrevious() {\r\n\t\treturn previous;\r\n\t}", "public java.lang.String getPreviousValue() {\n return pr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return mImageNames == null ? 0 :mImageNames.size();
@Override public int getItemCount() { return mImageNames.size(); }
[ "public int getNumberOfImages() {\r\n\t\treturn (_dicom_files==null? 0 : _dicom_files.length);\r\n\t}", "private synchronized int getNumberOfImages() {\n return this.imageList.size();\n }", "public int getNoOfImages() {\n return noOfImages;\n }", "public int getTotalPics()\n {\n\t\t/*System.o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set long value in array
public static void setLong(Object array, int index, long l) throws IllegalArgumentException, ArrayIndexOutOfBoundsException { if (array == null) throw new NullPointerException(); if (array instanceof long[]) ArrayManager.longArrayChanged((long[]) array, index, l); else setFloat(array, index, l); }
[ "public TLongArray(long[] array) {\n\t\tthis.array = array;\n\t}", "public static void putLong(long value, byte[] array, int offset) {\n\t\tarray[offset] = (byte) (0xff & (value >>> 56));\n\t\tarray[offset + 1] = (byte) (0xff & (value >>> 48));\n\t\tarray[offset + 2] = (byte) (0xff & (value >>> 40));\n\t\tarray[o...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a new DFloat32 with name n.
public DFloat32 newDFloat32(String n) { return new asciiF32(n); }
[ "public DFloat32 newDFloat32(String n) {\n return new DFloat32(n);\n }", "public DFloat64 newDFloat64(String n) {\n return new DFloat64(n);\n }", "public DFloat32 newDFloat32() {\n return new DFloat32();\n }", "public DFloat32 newDFloat32() {\n return new asciiF32();\n }", "public DFloat64 n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the grade of a submission.
public void updateSubmission(Submission submission) throws SQLException { PreparedStatement statement = connection.prepareStatement(UPDATE_SUBMISSION); statement.setInt(1, submission.getGrade()); statement.setInt(2, submission.getId()); statement.executeUpdate(); }
[ "public void gradeAssignment(int grade) {\n assignments.update(grade);\n }", "public boolean updateGradebook(Grade grade, Forum forum);", "public boolean updateGradebook(Grade grade, Topic topic);", "public void gradeTests(int grade) {\n tests.update(grade);\n }", "public void updateGrad...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
the win method will override the win in the Critter class. if the leopard wins then increment its confidence variable.
public void win(){ //multiple of 10 to multiply by final int MULTIPLE_OF_TEN = 10; //if the confidence is less than 10 then increment the //confidence if(confidence < MULTIPLE_OF_TEN) confidence++; //if the confidence has reached 10 then stay at 10 else if(confidence >= MULTIPLE_OF_...
[ "public boolean eat(){\n //the total confidence as a percentage\n final int TOTAL_CONFIDENCE = 100;\n //the multiple of 10 to mutliply by \n final int MULTIPLE_OF_TEN = 10;\n //if the leopard is at 100 percent confidence then eat\n if(Math.abs(random.nextInt() % 10) < confidence/10){\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the IDL operation name for a java method
private String getOperation(String methodName) { if (interfaceInfo == null) { return methodName; } MethodInfo methodInfo = interfaceInfo.getMethod(methodName); if (methodInfo != null) { return methodInfo.getIDLName(); } else { return null; ...
[ "String getOperationName();", "public String getOperationName();", "String getJavaInvokeName();", "java.lang.String getOperation();", "String operationName() {\n return name().toLowerCase(Locale.ROOT);\n }", "public final String getName() {\n return javaMethod.name;\n }", "public <ReqT, Re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Transform item string into item, then if item weight is less than max weight return item object
private static Optional<Item> getItems(BigDecimal maxWeight, String itemStr) { itemCounter++; String temp = itemStr.replace("(", ""); temp = temp.replace(")", ""); String itemDataArr[] = temp.split(","); if (itemDataArr.length < 3) throw new RuntimeException(String.format("Invalid item data at posit...
[ "private static BigDecimal getMaxWeight(String data) {\n if (data.isEmpty()) throw new RuntimeException(\"No max weight provided at line: \" + lineCounter);\n if (!NumberUtils.isParsable(data)) throw new RuntimeException(\"Invalid max weight provided at line: \" + lineCounter);\n return new BigDecimal(data...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
NOTE: see(Asteroid) can be put here or when we add the object to the arraylist in getPercepts check if any asteroids are in range to be mined
private void checkRanges(float [] obj_pos){ //Euclidean distance float distance = (float)Math.sqrt(((obj_pos[0]-x)*(obj_pos[0]-x)) + ((obj_pos[1]-y)*(obj_pos[1]-y)) + ((obj_pos[2]-z)*(obj_pos[2]-z))); if (distance <= mining_range){ addBelief("within_range(Asteroid)");...
[ "private void avoidedSomeAsteroids() {\n\t\tint shieldDamageTaken = Misc.numberPlusMinusRandom(SHIELD_PARTIAL_DAMAGE, SHIELD_DAMAGE_RANDOM_RANGE);\n\t\tthis.environment.ship.addToSheildLevel(-shieldDamageTaken);\n\t\tMessageBox messageBoxPartialAsteroidCollision = new MessageBox(String.format(MESSAGE_ASTEROID_PARTI...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Properties related to a ObservationOffering
public String[] getProperties(int offeringID) { Cursor c = db.query(Property_TABLE, new String[] { Property_property }, Property_offering + "=" + offeringID, null, null, null, Property_Order); String[] ret = new String[c.getCount()]; if (c.moveToFirst()) { for (int i = 0; i < ret.length; i+...
[ "@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.String getBookOffering();", "Collection getUserDefinedOWLObjectProperties();", "public Map<String, String> getSessionOfferingDetail(String offeringId) throws Exception\n\t {throw new Exception(\"Not Implemented.\");\n\t }", "Collection getUserDe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes in an octal and converts it to a decimal number If the number has a 9 or an 8 in it (i.e. it was actually a decimal number) then it returns the original number
public int octalToDecimal(long octal) { int standardFormExponent = (int) (Math.pow(10, Math.floor(Math.log10(octal)))); int output = 0; int currentDigit = 0; for (int digit = standardFormExponent; digit >= 1; digit /= 10) { currentDigit = (int) (octal/digit - (octal/(digit*10))*10); ...
[ "public static int convertingOctalToDecimalNumber(int octalNumber){\n int i = 0;\n int decimalNumber = 0;\n int remainder;\n while (octalNumber!=0){\n remainder = octalNumber%10;\n octalNumber = octalNumber/10;\n decimalNumber += (int) (remainder*Math.pow...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The stage of the BlobServiceProperties update allowing to specify lastAccessTimeTrackingPolicy.
interface WithLastAccessTimeTrackingPolicy { /** * Specifies the lastAccessTimeTrackingPolicy property: The blob service property to configure last access * time based tracking policy.. * * @param lastAccessTimeTrackingPolicy The blob service property to c...
[ "interface WithLastAccessTimeTrackingPolicy {\n /**\n * Specifies the lastAccessTimeTrackingPolicy property: The blob service property to configure last access\n * time based tracking policy..\n *\n * @param lastAccessTimeTrackingPolicy The blob service pro...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Toast.makeText(context, "Imagen subida exitosamente", Toast.LENGTH_SHORT).show();
@Override public void onCompleted(Context context, UploadInfo uploadInfo, ServerResponse serverResponse) { Snackbar.make(mVista, "Imagen subida exitosamente", Snackbar.LENGTH_SHORT).show(); }
[ "private void exibe_mensagem(String msg){\n Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();\n }", "@Override\n public void onClick(View v) {\n new AlertDialog.Builder(PromocionesDisponibilidadActivity.this)\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
swipe refresh is performed, fetch the messages again
@Override public void onRefresh() { getInbox(); }
[ "private void onLoadMoreMessages() {\n if (mIsRefreshable) {\n mRefreshManager.loadMoreMessages(getAccountId(), getMailboxId());\n }\n }", "public void refreshContent() {\n observerSwipeRefreshing.set(true);\n if (mApplication.isInternetConnected()) {\n if (!ob...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the id property: The id of the phone number, e.g. 11234567890.
public AcquiredPhoneNumber setId(String id) { this.id = id; return this; }
[ "public Builder setIdNumber(String value) {\n validate(fields()[0], value);\n this.id_number = value;\n fieldSetFlags()[0] = true;\n return this;\n }", "public void setId(String id) {\n this.id = id + \"_\";\n }", "public void setId_number(String id_number) {\n\t\tthis.id_number...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Use AddRequestProto2.newBuilder() to construct.
private AddRequestProto2(com.google.protobuf.GeneratedMessage.Builder<?> builder) { super(builder); this.unknownFields = builder.getUnknownFields(); }
[ "private AddRequestProto(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = builder.getUnknownFields();\n }", "private EchoRequestProto2(com.google.protobuf.GeneratedMessage.Builder<?> builder) {\n super(builder);\n this.unknownFields = build...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check myAccountId first, than in session; may by set myAccountId in sub class, base event handler use this method to check request validity
public String getMyAccountId() { return (String) session.getAttribute("accountId"); }
[ "@Override\n\tpublic boolean isRequestedSessionIdValid() {\n\t\tString id = getRequestedSessionId();\n\t\treturn id != null ? sessionContext.checkValidation(id):false ;\n\t}", "public void setAccountId(long accountId) {\n this.accountId = accountId;\n }", "public void setAccountId(String accountId) {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find sensor on floor plan
@CrossOrigin(origins = "*") @GetMapping("buildings/{building_id}/floors/floor_plan") public @ResponseBody Iterable<Sensor> searchSensorByLocation( @PathVariable final long building_id, @RequestParam final Integer floor_number, @RequestParam final String x_coordinate, ...
[ "private Floor getFloorFromSensorId(String sensorId) throws Exception {\n String[] sensorIdParts = sensorId.split(\"-\");\n int floorNumber = Integer.parseInt(sensorIdParts[0]);\n Optional<Floor> floorOptional = hotel.getFloors().stream()\n .filter(floor -> floor.getNumber() == f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the list of correct answers.
public List<Integer> getCorrectAnswers() { return correctAnswers; }
[ "public List<Integer> getCorrectAnswers() {\n return correctAnswers;\n }", "public String[] getAnswers()\n\t{\n\t\treturn answers;\t\n\t}", "private void getCorrectAnswers() {\n\t\tfor(int i = 0; i < numberAmt; i++) {\n\t\t\tif(randomNumbers.get(i).equals(answers.get(i)))\n\t\t\t\tcorrectAnswers++;\n\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns top level contents of the document.
public Iterable<ContentElement> getTopLevelContents() { return topLevelContents; }
[ "public String getContent() throws BadLocationException {\n\t\treturn fDocument.get(offset, length);\n\t}", "java.lang.String getDocument();", "public String getPageContents(){ \n String content =super.getPageContents();\n int startPos;\n int EndPos;\n startPos = content.indexOf(\"</...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Run the boolean getEnable() method test
public void testGetEnable() { assertEquals(noise.getEnable(), true); noise.setEnable(false); assertEquals(noise.getEnable(), false); }
[ "boolean getEnable();", "boolean getEnabled();", "public void test2_0SetEnabledGetEnabled() throws Exception {\n getReverb(0);\n try {\n mReverb.setEnabled(true);\n assertTrue(\"invalid state from getEnabled\", mReverb.getEnabled());\n mReverb.setEnabled(false);\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the value of the 'field87' field
public java.lang.CharSequence getField87() { return field87; }
[ "public java.lang.CharSequence getField87() {\n return field87;\n }", "public java.lang.CharSequence getField987() {\n return field987;\n }", "public java.lang.CharSequence getField987() {\n return field987;\n }", "java.lang.String getField1371();", "public java.lang.CharSequence getField787...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns all rows from the quarter_planning table that match the criteria ''.
public QuarterPlanning[] findAll() throws QuarterPlanningDaoException;
[ "public QuarterPlanning[] findWhereCompetitionCodeEquals(String competitionCode) throws QuarterPlanningDaoException;", "public QuarterPlanning[] findByDynamicWhere(String sql, Object[] sqlParams) throws QuarterPlanningDaoException;", "public QuarterPlanning[] findWhereNameTrimesterEquals(String nameTrimester) t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the control in the top right corner of the tab folder. Typically this is a close button or a composite with a menu and close button.
public Control getTopRight() { checkWidget(); return topRight; }
[ "private WebElement getLocator_close_tab_button(){\n\n\t\treturn this.getBy(By.xpath(\"//*[@id=\\\"sitspagecontent\\\"]/form/div/div[2]/div/div/fieldset/div[8]/input[3]\"));\n\t}", "public Ellipse getRightButton() {\n return rightButton;\n }", "protected JComponent getAccessory() {\n re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns whether this substitution unit should use the same var name as another substitution unit. (For placeholders, this means the other placeholder is exactly the same as this one, i.e. it appears twice in the same message.)
boolean shouldUseSameVarNameAs(MsgSubstUnitNode other, ExprEquivalence exprEquivalence);
[ "@Test\n\tpublic void VarsWithSameNames() throws IOException, ParseException {\n\t\t//all combinations of variables.\n\t\tcheckFail(\"VarSameNameGlobalLocal\");\n\t\tcheckFail(\"VarSameNameGlobalLock\");\n\t\tcheckFail(\"VarSameNameLocalGlobal\");\n\t\tcheckFail(\"VarSameNameLocalLock\");\n\t\tcheckFail(\"VarSameNa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets portal delete enabled.
public void setPortalDeleteEnabled(final boolean portalDeleteEnabled) { this.portalDeleteEnabled = portalDeleteEnabled; }
[ "public boolean isPortalDeleteEnabled() {\n return portalDeleteEnabled;\n }", "public void setEnableDelete(java.lang.Boolean _enableDelete)\n {\n enableDelete = _enableDelete;\n }", "public void setDelete(boolean value) {\r\n this.delete = value;\r\n }", "void setDeleteButtonEnabled(b...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Serialized raw tensor content. bytes tensor_val = 13;
@java.lang.Override public com.google.protobuf.ByteString getTensorVal() { return tensorVal_; }
[ "@java.lang.Override\n public com.google.protobuf.ByteString getTensorVal() {\n return tensorVal_;\n }", "org.nd4j.ir.TensorNamespace.TensorProto getOutputValue();", "org.tensorflow.util.SavedSlice getData();", "public Serializable getRawValue();", "org.nd4j.ir.TensorNamespace.TensorProtoOrBuilder getO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test if a model is printable on a 3D printer, given an Appendable for errormessage output and specifying whether hollow objects are allowed. 3D printing technologies such as laser sintering do not allow one to print hollow objects because material would be trapped inside the object being printed. Note: this test does n...
public boolean printable(boolean hollow, Appendable out) throws IOException { return !notPrintable(hollow, out); }
[ "public boolean notPrintable(boolean hollow, Appendable out)\n\tthrows IOException\n {\n\tif (!cubics.isWellFormed(out, true)) {\n\t if (out != null) {\n\t\tString msg = (errorMsg(\"notWellFormed\"));\n\t\tout.append(msg + \"\\n\");\n\t }\n\t}\n\tList<Edge> edges = verifyClosed2DManifold();\n\tif (edges !=...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the current registration ID for application on GCM service. If result is empty, the app needs to register.
private String getRegistrationId(Context context) { final SharedPreferences prefs = getGCMPreferences(context); String registrationId = prefs.getString(PROPERTY_REG_ID, ""); if (registrationId.isEmpty()) { Log.i(TAG, "Registration not found."); return ""; } // Check if app was...
[ "private String getRegistrationId(Context context)\n {\n\t\tfinal SharedPreferences prefs = getGcmPreferences(context);\n\t\t\n\t\tString registrationId = prefs.getString(Globals.PREFS_PROPERTY_REG_ID, \"\");\n\t\t\n\t\tif (registrationId == null || registrationId.equals(\"\"))\n\t\t{\n\t\t Log.i(Globals.TAG,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toString method print the rank and suit of the card
@Override public String toString(){ return "Card R" + rank + " S" + suit; }
[ "public String toString(){\n\t\treturn \"\" + rank + \" of \" + suit;\n\t}", "public String toString() {\n // return \"Card {suit: \"+getSuitString()+\", rank: \"+getRankString()+\"}\";\n return \"{\"+getSuitString()+\",\"+getRankString()+\"}\";\n }", "public void printCard(){\n\t\tString rankn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the doc_No value for this PO_Details_ResponseGR_ITEMITEM.
public void setDoc_No(java.lang.String doc_No) { this.doc_No = doc_No; }
[ "public void setItemNo (java.lang.Long itemNo) {\n\t\tthis.itemNo = itemNo;\n\t}", "public void setItemNo(String itemNo) {\n this.itemNo = itemNo;\n }", "public void setNrDoc(java.lang.String nrDoc) {\n this.nrDoc = nrDoc;\n }", "public void setDocumentNo(String documentNo) {\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the reference identifier of the reference source model element instance
protected abstract void updateReference(ModelElementInstance referenceSourceElement, String oldIdentifier, String newIdentifier);
[ "protected abstract void setReferenceIdentifier(ModelElementInstance referenceSourceElement, String referenceIdentifier);", "public void setReferenceTargetElement(ModelElementInstance referenceSourceElement, T referenceTargetElement) {\n ModelInstance modelInstance = referenceSourceElement.getModelInstance();\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This method was generated by MyBatis Generator. This method corresponds to the database table mail_host
@Update({ "update mail_host", "set host_name = #{hostName,jdbcType=VARCHAR},", "smtp_host = #{smtpHost,jdbcType=VARCHAR},", "smtp_host_port = #{smtpHostPort,jdbcType=VARCHAR},", "pop3_host = #{pop3Host,jdbcType=VARCHAR},", "pop3_host_port = #{pop3HostPort,jdbcType...
[ "@Select({\n \"select\",\n \"id, host_name, smtp_host, smtp_host_port, pop3_host, pop3_host_port\",\n \"from mail_host\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n @Results({\n @Result(column=\"id\", property=\"id\", jdbcType=JdbcType.INTEGER, id=true),\n @Result...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the display by using the provided (nonnull) state object to draw the current set of buildings, explosions, and missiles.
public void update(GameState state) { Graphics graphics = null; synchronized (buffer) { // Only one thread should access the buffer's Graphics object... graphics = buffer.getGraphics(); } paintBuildings(state.buildings.iterator(), graphics); paintMissiles(state.missiles...
[ "private void displayBuildingInfo() {\r\n\t\tui.buildingInfoPanel.buildingName.setText(currentBuilding.type.label);\r\n\t\tui.buildingInfoPanel.completed.setText(\"\" + currentBuilding.buildProgress);\r\n\t\tui.buildingInfoPanel.completedTotal.setText(\"\" + currentBuilding.type.hitpoints);\r\n\t\tui.buildingInfoPa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }