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
Validate whether the JWT id replayed and replaying is accepted based on given conditions
public boolean validateJTI(SignedJWT signedJWT, String jti, long currentTimeInMillis, long timeStampSkewMillis, long expTime, long issuedTime) throws IdentityOAuth2Exception { //check whether the token is already used //check JWT ID in cache if (jti == null) { return true; } if (enableJTICache) { JWTCacheEntry entry = jwtCache.getValueFromCache(jti); if (!validateJTIInCache(jti, signedJWT, entry, currentTimeInMillis, timeStampSkewMillis, this.jwtCache)) { return false; } } // check JWT ID in DB if (!validateJwtInDataBase(jti, currentTimeInMillis, timeStampSkewMillis)) { return false; } persistJWTID(jti, expTime, issuedTime); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isValid(String jwt);", "@Test\r\n\tpublic void TestvalidateTokenWithUserIdFalse() {\r\n\t\tlog.info(env.getProperty(\"log.start\"));\r\n\t\tudetails = new User(\"admin\", \"admin\", new ArrayList<>());\r\n\t\tUserDetails user1 = new User(\"admin1\", \"admin1\", new ArrayList<>());\r\n\t\tString generateT...
[ "0.61233944", "0.57613766", "0.5687895", "0.566122", "0.5580901", "0.55418", "0.5479183", "0.5450592", "0.54471177", "0.5434269", "0.543278", "0.54258543", "0.5401053", "0.53773654", "0.5368222", "0.53551483", "0.5351598", "0.532151", "0.527202", "0.52589244", "0.5230022", ...
0.49136394
47
Check whether the Token is indented for the server
public boolean validateAudience(String currentAudience, List<String> audience) throws IdentityOAuth2Exception { for (String aud : audience) { if (StringUtils.equals(currentAudience, aud)) { return logAndReturnTrue(currentAudience + " is found in the list of audiences."); } } return logAndReturnFalse("None of the audience values matched the tokenEndpoint Alias:" + currentAudience); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "boolean hasToken();", "public boolean hasToken(){\n return (!clozerrtoken.isEmpty());\n }", "boolean hasFirstToken();", "public boolean isToken(String token){\n if(cur...
[ "0.6309969", "0.6309969", "0.6309969", "0.6309969", "0.6309969", "0.6309969", "0.5958879", "0.5696653", "0.56001216", "0.5542265", "0.5462456", "0.54608893", "0.5448393", "0.54345024", "0.54345024", "0.54345024", "0.54345024", "0.5412804", "0.54104936", "0.54104936", "0.54104...
0.0
-1
Return globally set audience or the token endpoint of the server
public String getValidAudience(String tenantDomain) throws IdentityOAuth2Exception { if (isNotEmpty(validAudience)) { return validAudience; } String audience = null; IdentityProvider residentIdP; try { residentIdP = IdentityProviderManager.getInstance() .getResidentIdP(tenantDomain); FederatedAuthenticatorConfig oidcFedAuthn = IdentityApplicationManagementUtil .getFederatedAuthenticator(residentIdP.getFederatedAuthenticatorConfigs(), IdentityApplicationConstants.Authenticator.OIDC.NAME); audience = IdentityApplicationManagementUtil.getProperty(oidcFedAuthn.getProperties(), IdentityApplicationConstants.Authenticator.OIDC.OAUTH2_TOKEN_URL).getValue(); } catch (IdentityProviderManagementException e) { handleException("Error while loading OAuth2TokenEPUrl of the resident IDP of tenant:" + tenantDomain, e); } if (isEmpty(audience)) { audience = IdentityUtil.getServerURL(IdentityConstants.OAuth.TOKEN, true, false); } return audience; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Object getAudience();", "public String getAudienceFromToken(String token) {\n\t\tString audience;\n\t\ttry {\n\t\t\tfinal Claims claims = this.getClaimsFromToken(token);\n\t\t\taudience = (String) claims.get(\"audience\");\n\t\t} catch (Exception e) {\n\t\t\taudience = null;\n\t\t}\n\t\treturn audience;\n\t}", ...
[ "0.6580335", "0.61094725", "0.6040904", "0.5920774", "0.59090227", "0.58606976", "0.56870955", "0.56845886", "0.56388533", "0.5609705", "0.55990434", "0.5585436", "0.5579224", "0.55472064", "0.55472064", "0.5488021", "0.5484767", "0.5475567", "0.54750276", "0.5468783", "0.543...
0.5905601
5
Message is logged and returns false
private boolean logAndReturnFalse(String errorMessage) { if (log.isDebugEnabled()) { log.debug(errorMessage); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean log() {\n\t\tif ((xml == null) || (log == null)) return false;\n\t\treturn log.equals(\"yes\");\n\t}", "public boolean logAccess() {\n Map<String, String> response;\n try {\n response = logMessageService.sendRequestMessage(\"\");\n } catch (Exception exceptio...
[ "0.70083106", "0.6913246", "0.6897601", "0.6897601", "0.6897601", "0.6897601", "0.6897601", "0.6897601", "0.6897601", "0.6897601", "0.6756101", "0.6744779", "0.6668592", "0.65775144", "0.6563811", "0.6489756", "0.6425832", "0.6399047", "0.63957155", "0.6394588", "0.62184966",...
0.6348971
20
Message is logged and returns true
private boolean logAndReturnTrue(String errorMessage) { if (log.isDebugEnabled()) { log.debug(errorMessage); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean log() {\n\t\tif ((xml == null) || (log == null)) return false;\n\t\treturn log.equals(\"yes\");\n\t}", "public boolean logAccess() {\n Map<String, String> response;\n try {\n response = logMessageService.sendRequestMessage(\"\");\n } catch (Exception exceptio...
[ "0.69269466", "0.6858619", "0.6845886", "0.6789111", "0.6782716", "0.66341853", "0.66341853", "0.66341853", "0.66341853", "0.66341853", "0.66341853", "0.66341853", "0.66341853", "0.6496187", "0.64883363", "0.6463641", "0.63802", "0.6343903", "0.6320837", "0.6309317", "0.63021...
0.65793544
13
Get the claimset from JWT
public ReadOnlyJWTClaimsSet getClaimSet(SignedJWT signedJWT) throws IdentityOAuth2Exception { ReadOnlyJWTClaimsSet claimsSet; try { claimsSet = signedJWT.getJWTClaimsSet(); } catch (ParseException e) { String errorMsg = "Error when trying to retrieve claimsSet from the JWT."; log.error(errorMsg, e); throw new IdentityOAuth2Exception(errorMsg, e); } return claimsSet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Map<String,Object> getCustomClaims();", "private Claims extractAllClaims(String token) {\t\n\t\treturn Jwts.parser().setSigningKey(Base64.getEncoder().encode(SECERATE_KEY.getBytes())).parseClaimsJws(token).getBody();\n\t}", "private Claims getClaimsFromToken(String authToken) {\n Claims claims = ...
[ "0.6436951", "0.6380652", "0.6377721", "0.6243542", "0.62128484", "0.6138311", "0.6113784", "0.6113784", "0.6109577", "0.6041966", "0.6007895", "0.59929675", "0.59374976", "0.5854873", "0.5814161", "0.57577026", "0.5625493", "0.55842876", "0.5567798", "0.5528932", "0.5522155"...
0.7179384
0
the default implementation creates the subject from the Sub attribute. To translate between the federated and local user store, this may need some mapping. Override if needed
public String resolveSubject(ReadOnlyJWTClaimsSet claimsSet) { return claimsSet.getSubject(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Subject getSubject(){\n\t\treturn sub;\n\t}", "public void setSubject(String subj) {\n/* 296 */ getCOSObject().setString(COSName.SUBJ, subj);\n/* */ }", "public String getSubject() {\n/* 286 */ return getCOSObject().getString(COSName.SUBJ);\n/* */ }", "public abstract I_SessionName...
[ "0.6526971", "0.6399166", "0.6355274", "0.6236086", "0.62198555", "0.6129825", "0.61153394", "0.61153394", "0.61153394", "0.6039651", "0.587644", "0.5808914", "0.5806943", "0.5806943", "0.5798108", "0.5798108", "0.57966053", "0.57966053", "0.57915646", "0.5757156", "0.5757156...
0.0
-1
Get the X509CredentialImpl object for a particular tenant and alias
public static X509Certificate getCertificate(String tenantDomain, String alias) throws IdentityOAuth2Exception { int tenantId; try { tenantId = JWTServiceComponent.getRealmService().getTenantManager().getTenantId(tenantDomain); } catch (org.wso2.carbon.user.api.UserStoreException e) { String errorMsg = "Error getting the tenant ID for the tenant domain : " + tenantDomain; throw new IdentityOAuth2Exception(errorMsg, e); } KeyStoreManager keyStoreManager; // get an instance of the corresponding Key Store Manager instance keyStoreManager = KeyStoreManager.getInstance(tenantId); KeyStore keyStore; try { if (tenantId != MultitenantConstants.SUPER_TENANT_ID) {// for tenants, load key from their generated key store keyStore = keyStoreManager.getKeyStore(generateKSNameFromDomainName(tenantDomain)); } else { // for super tenant, load the default pub. cert using the config. in carbon.xml keyStore = keyStoreManager.getPrimaryKeyStore(); } return (X509Certificate) keyStore.getCertificate(alias); } catch (KeyStoreException e) { String errorMsg = "Error instantiating an X509Certificate object for the certificate alias:" + alias + " in tenant:" + tenantDomain; log.error(errorMsg, e); throw new IdentityOAuth2Exception(errorMsg, e); } catch (Exception e) { //keyStoreManager throws Exception log.error("Unable to load key store manager for the tenant domain:" + tenantDomain, e); throw new IdentityOAuth2Exception("Unable to load key store manager for the tenant domain:" + tenantDomain, e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "X509Certificate getCertAlias(String alias) throws KeyStoreException\n\t{\n\t\tX509Certificate x509 = (X509Certificate) keyStore.getCertificate(alias);\n\t\treturn x509;\n\t}", "public interface X509Credential\n{\n\t/**\n\t * Returns the credential in a keystore.\n\t * @return the KeyStore\n\t */\n\tpublic KeySto...
[ "0.6330608", "0.59814596", "0.59503496", "0.5699163", "0.5483761", "0.5483761", "0.5483761", "0.53720784", "0.5318919", "0.52865005", "0.5265385", "0.5249059", "0.52338886", "0.5213295", "0.52045643", "0.513473", "0.502096", "0.50158256", "0.49883607", "0.49865064", "0.489647...
0.6776367
0
Generate the key store name from the domain name
public static String generateKSNameFromDomainName(String tenantDomain) { String ksName = tenantDomain.trim().replace(FULLSTOP_DELIMITER, DASH_DELIMITER); return ksName + KEYSTORE_FILE_EXTENSION; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String generateStorageHADomainKey(StorageSystem storageSystem, String directorName) {\n return String.format(\"%s-%s\", storageSystem.getNativeGuid(), directorName);\n }", "private String generateStoragePortKey(StorageHADomain vplexDirector, String objectName) {\n return String.format(\"...
[ "0.69536483", "0.62005377", "0.6171887", "0.5958103", "0.5830088", "0.5828426", "0.57289743", "0.5630456", "0.5616757", "0.549362", "0.549043", "0.54518795", "0.54210263", "0.53653455", "0.5317443", "0.52850634", "0.52849466", "0.52772135", "0.5265066", "0.5252363", "0.520882...
0.7304906
0
Method to validate the signature of the JWT
public boolean validateSignature(SignedJWT signedJWT, X509Certificate x509Certificate) throws JOSEException, IdentityOAuth2Exception { JWSVerifier verifier; ReadOnlyJWSHeader header = signedJWT.getHeader(); if (x509Certificate == null) { return logAndReturnFalse("Unable to locate certificate for JWT " + header.toString()); } String alg = signedJWT.getHeader().getAlgorithm().getName(); if (isEmpty(alg)) { return false; } else { if (log.isDebugEnabled()) { log.debug("Signature Algorithm found in the JWT Header: " + alg); } if (alg.indexOf(RS) == 0) { // At this point 'x509Certificate' will never be null. PublicKey publicKey = x509Certificate.getPublicKey(); if (publicKey instanceof RSAPublicKey) { verifier = new RSASSAVerifier((RSAPublicKey) publicKey); } else { return logAndReturnFalse("Public key is not an RSA public key."); } } else { return logAndReturnFalse("Signature Algorithm not supported yet : " + alg); } } // At this point 'verifier' will never be null; return signedJWT.verify(verifier); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean isValid(String jwt);", "protected boolean validateSignature(SignedJWT jwtToken) {\n boolean valid = false;\n if (JWSObject.State.SIGNED == jwtToken.getState()) {\n LOG.debug(\"JWT token is in a SIGNED state\");\n if (jwtToken.getSignature() != null) {\n LOG.debug(\"JWT token signat...
[ "0.7393565", "0.7363535", "0.71593016", "0.68922144", "0.65824676", "0.6537565", "0.64914674", "0.64905375", "0.64054745", "0.64054745", "0.63949096", "0.6349903", "0.6347236", "0.6223876", "0.6026942", "0.6016393", "0.5999425", "0.5967481", "0.59659654", "0.59198743", "0.591...
0.6952458
3
The JWT MUST contain an exp (expiration) claim that limits the time window during which the JWT can be used. The authorization server MUST reject any JWT with an expiration time that has passed, subject to allowable clock skew between systems. Note that the authorization server may reject JWTs with an exp claim value that is unreasonably far in the future.
public boolean validateExpirationTime(Date expirationTime, long currentTimeInMillis, long timeStampSkewMillis) throws IdentityOAuth2Exception { long expirationTimeInMillis = expirationTime.getTime(); if ((currentTimeInMillis + timeStampSkewMillis) > expirationTimeInMillis) { return logAndReturnFalse("JSON Web Token is expired. Expiration Time(ms) : " + expirationTimeInMillis + ". JWT Rejected and validation terminated"); } return logAndReturnTrue("Expiration Time(exp) of JWT was validated successfully."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean validateExpiration(SignedJWT jwtToken) {\n boolean valid = false;\n try {\n Date expires = jwtToken.getJWTClaimsSet().getExpirationTime();\n if (expires == null || new Date().before(expires)) {\n LOG.debug(\"JWT token expiration date has been \"\n + \"successfull...
[ "0.6627377", "0.64699966", "0.64511156", "0.6408455", "0.6305161", "0.6105236", "0.60894233", "0.60671175", "0.59945095", "0.5932848", "0.59325707", "0.5868421", "0.57947606", "0.5793465", "0.5749558", "0.5734698", "0.5687374", "0.5660028", "0.5657788", "0.5647442", "0.563337...
0.6110046
5
The JWT MAY contain an nbf (not before) claim that identifies the time before which the token MUST NOT be accepted for processing.
public boolean checkNotBeforeTime(Date notBeforeTime, long currentTimeInMillis, long timeStampSkewMillis) throws IdentityOAuth2Exception { if (notBeforeTime == null) { return true; } long notBeforeTimeMillis = notBeforeTime.getTime(); return currentTimeInMillis + timeStampSkewMillis >= notBeforeTimeMillis || logAndReturnFalse("NotBeforeTime check is failed. Token is used before the intended time."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Boolean ignoreTokenExpiration(String token) {\n return false;\r\n }", "private boolean hasCoolOffPeriodExpired(Jwt jwt) {\n\n Date issuedAtTime = jwt.getClaimsSet().getIssuedAtTime();\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n c...
[ "0.6345664", "0.58660203", "0.58600724", "0.584182", "0.58324975", "0.5787996", "0.5670445", "0.5618167", "0.5540446", "0.5471819", "0.53722787", "0.53510785", "0.53406256", "0.53406256", "0.53406256", "0.5319285", "0.5308687", "0.5308687", "0.5308687", "0.5289914", "0.528715...
0.52084816
41
The JWT MAY contain an iat (issued at) claim that identifies the time at which the JWT was issued. Note that the authorization server may reject JWTs with an iat claim value that is unreasonably far in the past
public boolean validateAgeOfTheToken(Date issuedAtTime, long currentTimeInMillis, long timeStampSkewMillis) throws IdentityOAuth2Exception { if (issuedAtTime == null) { return true; } if (notAcceptBeforeTimeInMins > 0) { long issuedAtTimeMillis = issuedAtTime.getTime(); long rejectBeforeMillis = 1000L * 60 * notAcceptBeforeTimeInMins; if (currentTimeInMillis + timeStampSkewMillis - issuedAtTimeMillis > rejectBeforeMillis) { String logMsg = getTokenTooOldMessage(currentTimeInMillis, timeStampSkewMillis, issuedAtTimeMillis, rejectBeforeMillis); return logAndReturnFalse(logMsg); } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "org.hl7.fhir.Instant getIssued();", "Optional<Instant> getTokenInvalidationTimestamp();", "@JsonGetter(\"initiated_at\")\r\n public String getInitiatedAt() {\r\n return initiatedAt;\r\n }", "private boolean hasCoolOffPeriodExpired(Jwt jwt) {\n\n Date issuedAtTime = jwt.getClaimsSet().getI...
[ "0.5957998", "0.5624512", "0.54977226", "0.5465236", "0.5390113", "0.5269322", "0.5239266", "0.5235939", "0.52298796", "0.5221581", "0.5187428", "0.51558954", "0.5147111", "0.51383686", "0.5113771", "0.5098567", "0.5083641", "0.5060572", "0.50589484", "0.5025106", "0.5015121"...
0.47571647
59
Build and return a string
private String getTokenTooOldMessage(long currentTimeInMillis, long timeStampSkewMillis, long issuedAtTimeMillis, long rejectBeforeMillis) { StringBuilder tmp = new StringBuilder(); tmp.append("JSON Web Token is issued before the allowed time."); tmp.append(" Issued At Time(ms) : "); tmp.append(issuedAtTimeMillis); tmp.append(", Reject before limit(ms) : "); tmp.append(rejectBeforeMillis); tmp.append(", TimeStamp Skew : "); tmp.append(timeStampSkewMillis); tmp.append(", Current Time : "); tmp.append(currentTimeInMillis); tmp.append(". JWT Rejected and validation terminated"); return tmp.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String build();", "public String build();", "public String buildingString() {\r\n\t\twhichBuild = 1 - whichBuild;\r\n\t\tif (whichBuild == 1) {\r\n\r\n\t\t}\r\n\t\treturn \"420 400;10 10 140 60 60 60 10;140 10 240 60 180 60 10;240 10 400 60 320 60 20 ;10 90 120 180 40 90 15;120 90 280 180 160 90 10;280 ...
[ "0.790352", "0.790352", "0.74545074", "0.7126986", "0.69694984", "0.68606925", "0.672159", "0.6718374", "0.6604232", "0.65775406", "0.6517982", "0.6416535", "0.63375103", "0.6325875", "0.63003206", "0.6292649", "0.62774605", "0.6151407", "0.61332816", "0.613312", "0.61256236"...
0.0
-1
Method to check whether the JTI is already in the cache.
private boolean validateJTIInCache(String jti, SignedJWT signedJWT, JWTCacheEntry entry, long currentTimeInMillis, long timeStampSkewMillis, JWTCache jwtCache) throws IdentityOAuth2Exception { if (entry == null) { // Update the cache with the new JWT for the same JTI. jwtCache.addToCache(jti, new JWTCacheEntry(signedJWT)); } else if (preventTokenReuse) { return logAndReturnFalse("JWT Token with jti: " + jti + "Has been replayed"); } else { try { SignedJWT cachedJWT = entry.getJwt(); long cachedJWTExpiryTimeMillis = cachedJWT.getJWTClaimsSet().getExpirationTime().getTime(); if (checkJTIValidityPeriod(jti, cachedJWTExpiryTimeMillis, currentTimeInMillis, timeStampSkewMillis)) { // Update the cache with the new JWT for the same JTI. jwtCache.addToCache(jti, new JWTCacheEntry(signedJWT)); } else { return false; } } catch (ParseException e) { return handleException("Unable to parse the cached jwt assertion : " + entry.getEncodedJWt(), e); } } return logAndReturnTrue("JWT id: " + jti + " not found in the cache and the JWT has been validated " + "successfully in cache."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean existCache() {\n return false;\n }", "public boolean isInCache(Class clazz) {\n if (mappingCache == null) {\n return false;\n }\n return mappingCache.indexOf(clazz) != -1;\n }", "boolean isKeyInCache(Object key);", "private static boolean assetInfoI...
[ "0.7105166", "0.6599319", "0.6572476", "0.6570283", "0.6474542", "0.6466498", "0.6462222", "0.6388458", "0.6378593", "0.6373546", "0.63370806", "0.63293135", "0.62539625", "0.6220643", "0.6209365", "0.6151793", "0.6143337", "0.6046355", "0.6045767", "0.6032722", "0.60285366",...
0.67610705
1
Check whether the validity period is OK
public boolean checkJTIValidityPeriod(String jti, long jwtExpiryTimeMillis, long currentTimeInMillis, long timeStampSkewMillis) throws IdentityOAuth2Exception { if (currentTimeInMillis + timeStampSkewMillis > jwtExpiryTimeMillis) { return logAndReturnTrue("JWT Token with jti: " + jti + "has been reused after the allowed expiry time:" + jwtExpiryTimeMillis); } else { return logAndReturnFalse("JWT Token with jti: " + jti + " Has been replayed before the allowed expiry time:" + jwtExpiryTimeMillis); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isValid() {\n if (this.month >= 1 && this.month <= 12 && this.day >= 1 && this.day < 32) {\n\n if ((this.month == 1 || this.month == 3 || this.month == 5 || this.month == 7 || this.month == 8\n || this.month == 10 || this.month == 12) && this.day > 30) {\n ...
[ "0.68754035", "0.68614453", "0.67790973", "0.6777457", "0.6665947", "0.65291655", "0.64912915", "0.64798695", "0.6462261", "0.646103", "0.64433986", "0.64318717", "0.6411968", "0.6402588", "0.6388338", "0.63799876", "0.6356815", "0.6342857", "0.6320044", "0.6311078", "0.63044...
0.0
-1
Method to validate the claims other than iss Issuer sub Subject aud Audience exp Expiration Time nbf Not Before iat Issued At typ Type in order to write your own way of validation and use the JWT grant handler, you can extend this class and override this method
public boolean validateCustomClaims(Map<String, Object> customClaims) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean isValid(Claim claim, ConstraintValidatorContext constraintValidatorContext) {\n if (claim == null || claim.getType() == null) \n return true; \n if (claim.getType().equals(ClaimType.Auto) && claim.getAutoCl...
[ "0.6123062", "0.6070446", "0.56694186", "0.54913294", "0.5469745", "0.5404451", "0.5310351", "0.53066987", "0.5272341", "0.52134097", "0.5208862", "0.520292", "0.51973355", "0.51923984", "0.5174348", "0.515917", "0.508811", "0.5081354", "0.5058039", "0.50106436", "0.49895182"...
0.508676
17
Validate whether the Jti is exist in db if exists whether it's replayed after expiry time only when allowed
public boolean validateJwtInDataBase(String jti, long currentTimeInMillis, long timeStampSkewMillis) throws IdentityOAuth2Exception { JWTEntry jwtEntry = null; try { jwtEntry = jwtStorageManager.getJwtFromDB(jti); } catch (IdentityOAuth2Exception e) { return handleException("Error while loading jwt with jti: " + jti + " from database", e); } if (jwtEntry == null) { return logAndReturnTrue("JWT id: " + jti + " not found in the Storage the JWT has been validated " + "successfully."); } else if (preventTokenReuse) { return logAndReturnFalse("JWT Token with jti: " + jti + " has been replayed"); } else { if (!checkJTIValidityPeriod(jti, jwtEntry.getExp(), currentTimeInMillis, timeStampSkewMillis)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean validateJTIInCache(String jti, SignedJWT signedJWT, JWTCacheEntry entry, long currentTimeInMillis,\n long timeStampSkewMillis, JWTCache jwtCache) throws IdentityOAuth2Exception {\n if (entry == null) {\n // Update the cache with the new JWT fo...
[ "0.6488008", "0.6397573", "0.6357847", "0.62924784", "0.62715656", "0.6166942", "0.59223706", "0.59181994", "0.59142214", "0.5908389", "0.5895338", "0.58837616", "0.58425903", "0.58425903", "0.58425903", "0.58425903", "0.58425903", "0.58425903", "0.583325", "0.58091503", "0.5...
0.6336873
3
Persist a reference to JWT in database
public void persistJWTID(final String jti, long expiryTime, long issuedTime) { try { jwtStorageManager.persistJWTIdInDB(jti, expiryTime, issuedTime); } catch (IdentityOAuth2Exception e) { log.error("Error while persisting JWT reference with jti: " + jti, e); //continue validation } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void storeToken(AuthorizationToken token);", "public void saveToken(String token, long passTime) {\n }", "void saveAuthData(AuthenticationBean authenData);", "public void setIDToken(JWT token) {\n this.idToken = token;\n }", "public User saveUser(User user);", "User setTokenForUser(St...
[ "0.63300264", "0.5922447", "0.57911104", "0.5718514", "0.57105464", "0.5687153", "0.56405073", "0.56110656", "0.5598196", "0.55750054", "0.5574726", "0.55708015", "0.5563352", "0.55111086", "0.55014", "0.5489768", "0.54890084", "0.5462559", "0.5433273", "0.54301816", "0.53773...
0.642223
0
TODO Autogenerated method stub
@Override public String InterfaceName() { return "b2c.order.get_delivery"; }
{ "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
Inflate the layout for this fragment
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { myView = inflater.inflate(R.layout.fragment_search, container, false); GoogleAdsMob adsMob = new GoogleAdsMob(); adsMob.loadBanner(myView, getContext(), getActivity()); search = myView.findViewById(R.id.search); tvMovie = myView.findViewById(R.id.tv_movie); tvSeries = myView.findViewById(R.id.tv_series); rcvMovie = myView.findViewById(R.id.rcv_movie); rcvSeries = myView.findViewById(R.id.rcv_series); db = FirebaseFirestore.getInstance(); movieRef = db.collection(getString(R.string.movie_ref)); seriesRef = db.collection(getString(R.string.series_ref)); loadData(); search.addTextChangedListener(new TextWatcher() { private AlertDialog.Builder recyclerView; @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 (search.getText().toString().trim().equals("")) { loadData(); } else { movieRef.orderBy("title") .startAt(search.getText().toString().trim()) .endAt(search.getText().toString().trim()+"\uf8ff") .addSnapshotListener(new EventListener<QuerySnapshot>() { @Override public void onEvent(@Nullable QuerySnapshot queryDocumentSnapshots, @Nullable FirebaseFirestoreException e) { ArrayList<Movie> movies = new ArrayList<>(); for (DocumentSnapshot snapshot: queryDocumentSnapshots) { movies.add(snapshot.toObject(Movie.class)); } MovieAdapter adapter = new MovieAdapter(movies, getContext(), getFragmentManager()); LinearLayoutManager lm = new LinearLayoutManager(getContext(), RecyclerView.HORIZONTAL, false); rcvMovie.setAdapter(adapter); rcvMovie.setLayoutManager(lm); tvMovie.setText(search.getText().toString().trim() + " Movies (" + movies.size() + ")"); } }); seriesRef.orderBy("title") .startAt(search.getText().toString().trim()) .endAt(search.getText().toString().trim()+"\uf8ff") .addSnapshotListener(new EventListener<QuerySnapshot>() { @Override public void onEvent(@Nullable QuerySnapshot queryDocumentSnapshots, @Nullable FirebaseFirestoreException e) { ArrayList<Series> series = new ArrayList<>(); for (DocumentSnapshot snapshot: queryDocumentSnapshots) { series.add(snapshot.toObject(Series.class)); } SeriesAdapter adapter = new SeriesAdapter(series, getContext(), getFragmentManager()); LinearLayoutManager lm = new LinearLayoutManager(getContext(), RecyclerView.HORIZONTAL, false); rcvSeries.setAdapter(adapter); rcvSeries.setLayoutManager(lm); tvSeries.setText(search.getText().toString().trim() + " Series (" + series.size() + ")"); } }); } } @Override public void afterTextChanged(Editable s) { } }); return myView; }
{ "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
Scanner sc = new Scanner(System.in); String str = sc.nextLine(); revised one time.
public static void main(String args[]){ String str = "aabcadceklmeb"; HashMap<Character, Integer> map = new HashMap<>(); for(int i = 0; i < str.length();i++){ if(!map.containsKey(str.charAt(i))){ map.put(str.charAt(i), 1); }else{ int value = map.get(str.charAt(i)); value++; map.put(str.charAt(i), value); } } for( char c : map.keySet()){ if(map.get(c) == 2){ System.out.println(c); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n System.out.println(str);\n }", "public static void main(String args[])\n {\n Scanner in=new Scanner(System.in);\n String str=in.nextLine();\n System.out.prin...
[ "0.8367559", "0.810968", "0.7893042", "0.7815504", "0.7544439", "0.7485203", "0.74736905", "0.74592024", "0.7439302", "0.7437921", "0.7370577", "0.73664874", "0.73338825", "0.7305868", "0.73053986", "0.7203901", "0.7203243", "0.7137446", "0.71244746", "0.70905757", "0.708949"...
0.0
-1
means vector is unique and cmp by vectorId
public PredicateVector(int id) { super(); flagged = false; vectorId = id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public VectorEquality compareTo(PredicateVector vectorCmp) {\n try {\n PredicateVector vectorLarge;\n PredicateVector vectorSmall;\n VectorEquality cmpResult;\n \n if (flagged || vectorCmp.flagged) {\n return VectorEquality...
[ "0.658102", "0.62458557", "0.5999794", "0.57754177", "0.57216096", "0.5625552", "0.5475335", "0.5467697", "0.5463226", "0.5459988", "0.54276246", "0.54263735", "0.54206073", "0.5418309", "0.5379253", "0.5344667", "0.5319711", "0.5312547", "0.5302328", "0.53015155", "0.5296299...
0.5383714
14
Determine if vectorCmp is a subset, superset or unique relative to this vector Subset => Object states are a subset of vectorCmp(object states form a sequence in comparable vector states) Superset => Object states are a superset of vectorCmp(vector states form a sequence in object states) Unique => both vectors are unique and can be distinguished
@Override public VectorEquality compareTo(PredicateVector vectorCmp) { try { PredicateVector vectorLarge; PredicateVector vectorSmall; VectorEquality cmpResult; if (flagged || vectorCmp.flagged) { return VectorEquality.UNIQUE; } // TODO: add size check if (this.size() > vectorCmp.size() && !this.values().iterator().next().isEmpty()) { vectorLarge = this; vectorSmall = vectorCmp; cmpResult = VectorEquality.SUPERSET; } else { vectorLarge = vectorCmp; vectorSmall = this; cmpResult = VectorEquality.SUBSET; } int largeVectorIter = 0; int numEq = 0; List<Integer> vectorSmallKeys = new ArrayList<Integer>(vectorSmall.keySet()); Collections.sort(vectorSmallKeys); List<Integer> vectorLargeKeys = new ArrayList<Integer>(vectorLarge.keySet()); Collections.sort(vectorLargeKeys); int i = 0; for (Integer smallVectorKey: vectorSmallKeys) { StateVector smallVectorState = vectorSmall.get(smallVectorKey); // Check if we have not iterated over all large vector states if (largeVectorIter >= vectorLargeKeys.size() && !smallVectorState.isEmpty()) { cmpResult = VectorEquality.UNIQUE; break; } for (i = largeVectorIter; i < vectorLargeKeys.size(); i++) { StateVector largeVectorState = vectorLarge.get(vectorLargeKeys.get(i)); VectorEquality cmpVectorResult = smallVectorState.compareTo(largeVectorState); if (cmpVectorResult == VectorEquality.EQUAL) { numEq += 1; break; } if (cmpVectorResult == VectorEquality.SUPERSET || cmpVectorResult == VectorEquality.SUBSET) { cmpResult = cmpVectorResult; numEq += 1; break; } } largeVectorIter = i + 1; // TODO: double check i+1 } if (numEq < vectorSmall.size() && !vectorSmall.values().iterator().next().isEmpty()) cmpResult = VectorEquality.UNIQUE; return cmpResult; } catch (ArrayIndexOutOfBoundsException e) { e.printStackTrace(); } return VectorEquality.UNIQUE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setEqualTo(Vector v){ components = v.getVectorAsArray(); }", "public static boolean isSubset(Vector v1, Vector v2) {\n\t\tif (v1 == null || v2 == null || v1.equals(v2) || v1.size() >= v2.size()) {\n\t\t\treturn false;\n\t\t}\n\t\tfor (Object o1 : v1) {\n\t\t\tif (!v2.contains(o1)) {\n\t\t\t\treturn f...
[ "0.56934166", "0.5398621", "0.53246033", "0.5277017", "0.52523625", "0.52190334", "0.5190059", "0.51809776", "0.5162967", "0.5157911", "0.5077955", "0.5048202", "0.5040101", "0.5032596", "0.49664223", "0.49342576", "0.49293673", "0.49232405", "0.48779264", "0.48720637", "0.48...
0.7677207
0
Inflate the layout for this fragment
@Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_naming, container, false); FragmentActivity activity = getActivity(); assert activity != null; assert getContext() != null; viewModel = ViewModelProviders.of(activity).get(NamingFragmentViewModel.class); names = view.findViewById(R.id.naming_names); namesAdapter = new NameListArrayAdapter(getContext(), new ArrayList<>()); names.setAdapter(namesAdapter); names.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { Name mn = namesAdapter.getItem(position); if (mn != null) viewModel.currName.postValue(mn); } @Override public void onNothingSelected(AdapterView<?> parent) { } }); ListView ancestors = view.findViewById(R.id.naming_ancestors); ancestorsAdapter = new RelationshipListArrayAdapter(getContext(), new ArrayList<>()); ancestors.setAdapter(ancestorsAdapter); ancestors.setOnItemClickListener((parent, view1, position, id) -> viewModel.currName.postValue(ancestorsAdapter.getItem(position))); ListView parents = view.findViewById(R.id.naming_parents); parentsAdapter = new RelationshipListArrayAdapter(getContext(), new ArrayList<>()); parents.setAdapter(parentsAdapter); parents.setOnItemClickListener((parent, view1, position, id) -> viewModel.currName.postValue(parentsAdapter.getItem(position))); ListView children = view.findViewById(R.id.naming_children); childrenAdapter = new RelationshipListArrayAdapter(getContext(), new ArrayList<>()); children.setAdapter(childrenAdapter); children.setOnItemClickListener((parent, v, position, id) -> viewModel.currName.postValue(childrenAdapter.getItem(position))); ListView descendants = view.findViewById(R.id.naming_descendants); descendantsAdapter = new RelationshipListArrayAdapter(getContext(), new ArrayList<>()); descendants.setAdapter(descendantsAdapter); descendants.setOnItemClickListener((parent, view1, position, id) -> viewModel.currName.postValue(descendantsAdapter.getItem(position))); ToggleButton namespaceSwitch = view.findViewById(R.id.naming_namespace_switch); namespaceSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> viewModel.usingMessagingNamespace.postValue(isChecked)); updateNames(); viewModel.currName.observe(this, this::setName); viewModel.usingMessagingNamespace.observe(this, usingNamespace -> { assert usingNamespace != null; namespaceSwitch.setChecked(usingNamespace); updateNames(); }); // listen to context events Context.getContext(MessagingNamespace.CONTEXT_MESSAGINGNAMESPACE).registerReceiver( onNamespaceChangeReceived, new IntentFilter().addAction(MessagingNamespace.ACTION_NAMESPACE_CHANGED)); Context.getContext(MessagingNamespace.CONTEXT_MESSAGINGNAMESPACE).registerReceiver( onAppNameChangeReceived, new IntentFilter().addAction(MessagingNamespace.ACTION_APPNAME_CHANGED)); Context.getContext(Namespace.CONTEXT_NAMESPACE).registerReceiver( onNamespaceChangeReceived, new IntentFilter().addAction(Namespace.ACTION_NAME_CHANGED).addAction(Namespace.ACTION_RELATIONSHIP_CHANGED) ); return view; }
{ "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
SETTING UP DEFAULT DATA:
public void setDefaultData() { //Creating demo/default ADMIN: User testAdmin = new User("ADMIN", "YAGYESH", "123", 123, Long.parseLong("7976648278")); data.userMap.put(testAdmin.getUserId(), testAdmin); //Creating demo/default CUSTOMER: User tempCustomer = new User("CUSTOMER", "JOHN", "124", 124, Long.parseLong("9462346459")); data.userMap.put(tempCustomer.getUserId(), tempCustomer); //Creating Airports: Airport airport1 = new Airport("Mumbai Chattrapathi Shivaji International Airport", "MUMBAI", "BOM"); Airport airport2 = new Airport("Bangalore Bengaluru International Airport ", "Bangalore", "BLR"); Airport airport3 = new Airport("New Delhi Indira Gandhi International Airport", "New Delhi ", "DEL"); Airport airport4 = new Airport("Hyderabad Rajiv Gandhi International Airport", "Hyderabad", "HYD"); data.airportMap.put(airport1.getAirportCode(), airport1); data.airportMap.put(airport2.getAirportCode(), airport2); data.airportMap.put(airport3.getAirportCode(), airport3); data.airportMap.put(airport4.getAirportCode(), airport4); //Creating DateTime Objects: Date dateTime1 = null; Date dateTime2 = null; Date dateTime3 = null; Date dateTime4 = null; try { dateTime1 = dateFormat.parse("12-01-2020 05:12:00"); dateTime2 = dateFormat.parse("02-02-2020 23:45:00"); dateTime3 = dateFormat.parse("12-01-2020 07:12:00"); dateTime4 = dateFormat.parse("03-02-2020 01:45:00"); } catch (ParseException e) { e.getMessage(); } //Creating Schedules: Schedule schedule1 = new Schedule(airport1, airport2, dateTime3, dateTime1, dateFormat); Schedule schedule2 = new Schedule(airport2, airport3, dateTime3, dateTime1, dateFormat); Schedule schedule3 = new Schedule(airport4, airport1, dateTime4, dateTime2, dateFormat); Schedule schedule4 = new Schedule(airport3, airport4, dateTime4, dateTime2, dateFormat); //Creating Flights: Flight flight1 = new Flight("AB3456", "INDIGO", "A330", 293); Flight flight2 = new Flight("BO6789", "JET AIRWAYS", "777", 440); data.flightMap.put(flight1.getFlightNumber(), flight1); data.flightMap.put(flight2.getFlightNumber(), flight2); //Creating Scheduled Flights: ScheduledFlight scheduledFlight1 = new ScheduledFlight(flight1, 293, schedule1); ScheduledFlight scheduledFlight2 = new ScheduledFlight(flight2, 440, schedule2); ScheduledFlight scheduledFlight3 = new ScheduledFlight(flight1, 293, schedule3); ScheduledFlight scheduledFlight4 = new ScheduledFlight(flight2, 440, schedule4); //Creating List of Scheduled Flights: data.listScheduledFlights.add(scheduledFlight1); data.listScheduledFlights.add(scheduledFlight2); data.listScheduledFlights.add(scheduledFlight3); data.listScheduledFlights.add(scheduledFlight4); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initData() {\n\t}", "public void initDefaultValues() {\n }", "private void initData() {\n }", "private void InitData() {\n\t}", "private void initData() {\n\n }", "public void loadDefaultValues() {\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\...
[ "0.7295564", "0.7236205", "0.72175026", "0.71904165", "0.7097326", "0.70818543", "0.7036298", "0.7036298", "0.7036298", "0.7036298", "0.7036298", "0.7036298", "0.70010984", "0.70010984", "0.6946069", "0.69315714", "0.6927905", "0.6926616", "0.6913039", "0.6867812", "0.6858345...
0.74285406
0
An invocation is planning an action on a breakpoint
public interface BreakpointActionItem { /** * Compute a range from an address and length * * @param address the min address * @param length the length * @return the range */ default AddressRange range(Address address, long length) { try { return new AddressRangeImpl(address, length); } catch (AddressOverflowException e) { throw new AssertionError(e); } } /** * Perform the action * * @return the future for the action. Synchronous invocations can just return * {@link AsyncUtils#NIL}. */ public CompletableFuture<Void> execute(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void wantToGoOnBreak() {\n\t\t\n\t}", "void execute()\n\t{\n\t\tVM.top++;\n\t\tVM.opStack[VM.top] = arg();\n\t\tVM.pc++;\n\t}", "public boolean performAction(int action) {\n/* 567 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void dobefore(JoinPoint jp) {\r\n\t\...
[ "0.5848176", "0.57308245", "0.5675533", "0.5670053", "0.5589841", "0.5587651", "0.554207", "0.5498312", "0.5469889", "0.5469889", "0.5455568", "0.545312", "0.5449338", "0.5393945", "0.5392446", "0.5348359", "0.5331125", "0.5324936", "0.5324936", "0.5315319", "0.5312971", "0...
0.0
-1
Compute a range from an address and length
default AddressRange range(Address address, long length) { try { return new AddressRangeImpl(address, length); } catch (AddressOverflowException e) { throw new AssertionError(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public AddressInfo getRange() {\r\n return range;\r\n }", "private boolean checkRangeAddress(int address) {\r\n return (address >= startAddress && address < endAddress);\r\n }", "String getPortRange();", "Range createRange();", "int getRange();", "protected abstract R toRange(D lower, D upp...
[ "0.6396421", "0.6240117", "0.60520905", "0.6016039", "0.598943", "0.59653187", "0.5791125", "0.5784366", "0.57772106", "0.5768598", "0.5750998", "0.5734995", "0.5725391", "0.5665804", "0.56306124", "0.56291854", "0.5622732", "0.56188756", "0.56061137", "0.5545928", "0.5498895...
0.733134
0
Marker interface for a target resolver that supports lazy operations.
public interface LazyResolver { LazyResolveContext getLazyResolveContext(); void setLazyResolveContext(LazyResolveContext context); /** * Base class of {@link ObjectResolver} instances that are owned by a parent {@link LazyResolver}. */ abstract class ObjectResolverImpl<T extends UniqueIdentifiable> implements ObjectResolver<T>, DeepResolver { private final LazyResolver _parent; private final ObjectResolver<T> _underlying; public ObjectResolverImpl(final LazyResolver parent, final ObjectResolver<T> underlying) { _parent = parent; _underlying = underlying; } protected ObjectResolver<T> getUnderlying() { return _underlying; } protected abstract T lazy(T object, LazyResolveContext.AtVersionCorrection context); @Override public T resolveObject(final UniqueId uniqueId, final VersionCorrection versionCorrection) { final T underlying = _underlying.resolveObject(uniqueId, versionCorrection); if (underlying == null) { return null; } return lazy(underlying, _parent.getLazyResolveContext().atVersionCorrection(versionCorrection)); } @Override public ChangeManager changeManager() { return getUnderlying().changeManager(); } @Override public DeepResolver deepResolver() { return this; } } /** * Base class of {@link Resolver} instances that are owned by a parent {@link LazyResolver}. */ abstract class ResolverImpl<T extends UniqueIdentifiable> extends ObjectResolverImpl<T> implements Resolver<T> { public ResolverImpl(final LazyResolver parent, final Resolver<T> underlying) { super(parent, underlying); } @Override protected Resolver<T> getUnderlying() { return (Resolver<T>) super.getUnderlying(); } @Override public UniqueId resolveExternalId(final ExternalIdBundle identifiers, final VersionCorrection versionCorrection) { return getUnderlying().resolveExternalId(identifiers, versionCorrection); } @Override public Map<ExternalIdBundle, UniqueId> resolveExternalIds(final Collection<ExternalIdBundle> identifiers, final VersionCorrection versionCorrection) { return getUnderlying().resolveExternalIds(identifiers, versionCorrection); } @Override public UniqueId resolveObjectId(final ObjectId identifier, final VersionCorrection versionCorrection) { return getUnderlying().resolveObjectId(identifier, versionCorrection); } @Override public Map<ObjectId, UniqueId> resolveObjectIds(final Collection<ObjectId> identifiers, final VersionCorrection versionCorrection) { return getUnderlying().resolveObjectIds(identifiers, versionCorrection); } } /** * Lazy resolution of portfolios. */ class LazyPortfolioResolver extends ResolverImpl<Portfolio> { public LazyPortfolioResolver(final LazyResolver parent, final Resolver<Portfolio> underlying) { super(parent, underlying); } // ObjectResolverImpl @Override public Portfolio lazy(final Portfolio object, final LazyResolveContext.AtVersionCorrection context) { return new LazyResolvedPortfolio(context, object); } // DeepResolver @Override public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) { if (underlying instanceof Portfolio) { return new LoggedResolutionPortfolio((Portfolio) underlying, logger); } return null; } } /** * Lazy resolution of portfolio nodes. */ class LazyPortfolioNodeResolver extends ResolverImpl<PortfolioNode> { public LazyPortfolioNodeResolver(final LazyResolver parent, final Resolver<PortfolioNode> underlying) { super(parent, underlying); } // ObjectResolverImpl @Override public PortfolioNode lazy(final PortfolioNode object, final LazyResolveContext.AtVersionCorrection context) { return new LazyResolvedPortfolioNode(context, object); } // DeepResolver @Override public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) { if (underlying instanceof PortfolioNode) { return new LoggedResolutionPortfolioNode((PortfolioNode) underlying, logger); } return null; } } /** * Lazy resolution of positions. */ class LazyPositionResolver extends ResolverImpl<Position> { public LazyPositionResolver(final LazyResolver parent, final Resolver<Position> underlying) { super(parent, underlying); } // ResolverImpl @Override public Position lazy(final Position object, final LazyResolveContext.AtVersionCorrection context) { return new LazyResolvedPosition(context, object); } // DeepResolver @Override public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) { if (underlying instanceof Position) { return new LoggedResolutionPosition((Position) underlying, logger); } return null; } } /** * Lazy resolution of trades. */ class LazyTradeResolver extends ResolverImpl<Trade> { public LazyTradeResolver(final LazyResolver parent, final Resolver<Trade> underlying) { super(parent, underlying); } // ObjectResolverImpl @Override public Trade lazy(final Trade object, final LazyResolveContext.AtVersionCorrection context) { return new LazyResolvedTrade(context, object); } // DeepResolver @Override public UniqueIdentifiable withLogger(final UniqueIdentifiable underlying, final ResolutionLogger logger) { if (underlying instanceof Trade) { return new LoggedResolutionTrade((Trade) underlying, logger); } return null; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static interface Resolver {\n\t\t\n\t\t/**\n\t\t * Registers an injection manager with a resolver.\n\t\t * \n\t\t * The resolver can asynchronously update the relation to modify the\n\t\t * binding.\n\t\t * \n\t\t * @see fr.imag.adele.apam.apform.impl.InterfaceInjectionManager.addTarget\n\t\t * @see fr.imag...
[ "0.59917504", "0.57380813", "0.5670793", "0.55226284", "0.55033016", "0.54179436", "0.53845084", "0.5311395", "0.5259771", "0.5214623", "0.5198651", "0.5077487", "0.50651705", "0.5050648", "0.50314754", "0.50302845", "0.5016423", "0.5000428", "0.49884924", "0.497038", "0.4966...
0.6592614
0
EFFECTS: constructs a new monster called "Vampire"
public Vampire() { super(); this.name = "Vampire"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void makeMonster(int lvl)\r\n {\r\n maxHealth = lvl*12;\r\n health = maxHealth;\r\n \r\n Equip tempWeapon = null;\r\n Equip tempArmor = null;\r\n if (type == GOLEM)\r\n {\r\n tempWeapon = new Equip(\"roll smash\", Equip.WEAPON, lvl*7);\r\n ...
[ "0.6591268", "0.6511912", "0.6410411", "0.63549775", "0.6302236", "0.6283221", "0.62556034", "0.6235057", "0.6179672", "0.6136587", "0.6084309", "0.6082392", "0.6069348", "0.60602707", "0.6017768", "0.6015008", "0.59911853", "0.59777015", "0.5974702", "0.5962129", "0.59575236...
0.57329994
43
MODIFIES: this EFFECTS: performs special monster move, recovers a small amount of health
@Override public String performSpecialEffect() { this.health += HEALTH_STEAL_AMOUNT; return "The vampire stole a bit of health after it attacked."; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void attackMonster(World world){\n\t\tif ((UnitManager.unitNearPlayer(world.getPlayer(),this,PLAYER_RANGE) == true \n\t\t\t\t\t&& RPG.isAttacking()) && world.getPlayer().isAttack()) {\n\t\t\tthis.getUnitStats().reduceHP(world.getPlayer().damageAmount());\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t}\n\t}", "private ...
[ "0.7245967", "0.7222984", "0.7196667", "0.70079976", "0.6989659", "0.69781286", "0.69760376", "0.69732106", "0.6907494", "0.6844963", "0.6827251", "0.6793976", "0.6771389", "0.67410666", "0.6732358", "0.6715547", "0.67076635", "0.6700134", "0.6695756", "0.66867834", "0.667947...
0.67084634
16
TODO: Warning this method won't work in the case the id fields are not set
@Override public boolean equals(Object object) { if (!(object instanceof DetalleCompras)) { return false; } DetalleCompras other = (DetalleCompras) object; if ((this.detalleComprasPK == null && other.detalleComprasPK != null) || (this.detalleComprasPK != null && !this.detalleComprasPK.equals(other.detalleComprasPK))) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void setId(Integer id) { this.id = id; }", "private Integer getId() { return this.id; }", "public void setId(int id){ this.id = id; }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "public void setID(String idIn) {this.id = idIn;}", "public void se...
[ "0.6896886", "0.6838461", "0.67056817", "0.66419715", "0.66419715", "0.6592331", "0.6579151", "0.6579151", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.6574321", "0.65624106", "0.65624106", "0.65441847", "0.65243006", "0.65154546", "0.6487427", "0.64778...
0.0
-1
Create test values before main tests starts.
@BeforeAll public static void beforeEverything() { //Fraction objects / Arguments //Create valid positive fractions oneHalf = new FractionImpl(1,2); oneFourth = new FractionImpl(1,4); twoThirds = new FractionImpl(2,3); //Create valid fractions with negative numerator negOneHalf = new FractionImpl(-1, 2); negOneFourth = new FractionImpl(-1, 4); //Create valid fractions with negative denominator negThreeNinths = new FractionImpl(3, -9); negEightTwelfths = new FractionImpl(8,-12); //Create valid fractions with zero value zeroTenth = new FractionImpl(0, 10); //Create valid fraction with whole number zero = new FractionImpl(0); one = new FractionImpl(1); negOne = new FractionImpl(-1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setUpTestdata() {\n\t\tsetDefaultUserName(Config.getProperty(\"defaultUserName\"));\r\n\t\tsetDefaultPassword(Config.getProperty(\"defaultPassword\"));\r\n\t\tsetTestsiteurl(Config.getProperty(\"testsiteurl\"));\r\n\t\tsetChromeDriverPath(Config.getProperty(\"chromeDriverPath\"));\r\n\t\tsetGeckoDriver...
[ "0.68564737", "0.6856166", "0.6778148", "0.6758542", "0.6707337", "0.6617951", "0.65917087", "0.658783", "0.65675235", "0.656498", "0.65332043", "0.65228784", "0.648047", "0.64670765", "0.6466746", "0.64643115", "0.64643115", "0.6461543", "0.6457783", "0.64570946", "0.6419491...
0.0
-1
Clears values after each test cases.
@AfterAll public static void afterEverything() { //Set all instance variable to null oneHalf = null; oneFourth = null; twoThirds = null; negOneHalf = null; negOneFourth = null; negThreeNinths = null; negEightTwelfths = null; zeroTenth = null; zero = null; one = null; negOne = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void resetTesting() {\r\n\t\tcompanyCars.clear();\r\n\t\trentDetails.clear();\r\n\t}", "private void clearTemporaryData() {\n\n numbers.stream().forEach(n -> {\n n.setPossibleValues(null);\n n.setUsedValues(null);\n });\n }", "void reset()\n {\n reset(values);\n...
[ "0.73839724", "0.71589255", "0.7132536", "0.70347553", "0.70099634", "0.6992359", "0.68841106", "0.6860783", "0.6843774", "0.68174666", "0.666863", "0.6649719", "0.66398686", "0.66303074", "0.6617992", "0.6617992", "0.66138077", "0.66138077", "0.6602991", "0.6575023", "0.6574...
0.0
-1
Valid integer fraction but division by zero
@Test public void testFractionImplZeroDivisionException() { assertThrows(ArithmeticException.class, () -> { new FractionImpl(1,0); }); //Valid string fraction but division by zero assertThrows(ArithmeticException.class, () -> { new FractionImpl("1/0"); }); //Test inverse method resulting in denominator = 0 assertThrows(ArithmeticException.class, () -> { zeroTenth.inverse(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Fraction(){\n numerator = 0;\n denominator = 1;\n }", "public Fraction()\r\n {\r\n this.numerator = 0;\r\n this.denominator = 1;\r\n }", "public static int parseFractionForNumerator(String fraction) {\n int length = fraction.length();\n int underscore = fract...
[ "0.64410526", "0.6437774", "0.64230347", "0.64054996", "0.63849413", "0.637827", "0.6274526", "0.62329954", "0.6160836", "0.6083578", "0.6070373", "0.6052836", "0.60295355", "0.6028321", "0.602484", "0.60127676", "0.59921795", "0.5957226", "0.59537584", "0.59445083", "0.59431...
0.68427974
0
Input value with blanks within integers
@Test public void testStringFractionImplInvalidStrings() { assertThrows(NumberFormatException.class, () -> { new FractionImpl("9 9 0/2"); }); //Input value which is not a number assertThrows(NumberFormatException.class, () -> { new FractionImpl("One"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setOnlyInteger() {\r\n\t\tPlatform.runLater(() -> {\r\n\t\t\ttextfield.textProperty().addListener(new ChangeListener<String>() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\r\n\t\t\t\t\tif (!newValue.matches(\"^\\...
[ "0.605247", "0.57435703", "0.5679715", "0.5639033", "0.5610357", "0.556984", "0.5518486", "0.55175865", "0.5472334", "0.54558885", "0.54356545", "0.5425263", "0.54054785", "0.54020756", "0.5391493", "0.5385936", "0.5381784", "0.5368145", "0.5362912", "0.5361547", "0.53560203"...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
public EqpmentLogExample() { oredCriteria = new ArrayList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.5306466", "0.5278364", "0.5224397", "0.5180511", "0.51603675", "0.51533455", "0.5152701", "0.51418954", "0.5038122", "0.5036989", "0.50364083", "0.4947865", "0.49212947", "0.49128425", "0.4907929", "0.49066576", "0.48649895", "0.4858347", "0.48422268", "0.48139176", "0.480...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
protected EqpmentLogExample(EqpmentLogExample example) { this.orderByClause = example.orderByClause; this.oredCriteria = example.oredCriteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.5306466", "0.5278364", "0.5224397", "0.5180511", "0.51603675", "0.51533455", "0.5152701", "0.51418954", "0.5038122", "0.5036989", "0.50364083", "0.4947865", "0.49212947", "0.49128425", "0.4907929", "0.49066576", "0.48649895", "0.4858347", "0.48422268", "0.48139176", "0.480...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.5306867", "0.52793145", "0.52231914", "0.5179527", "0.51615417", "0.5153139", "0.5153112", "0.5141047", "0.50389344", "0.50375855", "0.5036446", "0.49458945", "0.4920286", "0.49122536", "0.4908194", "0.49072245", "0.4865769", "0.4860364", "0.48424968", "0.4814254", "0.4807...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
public String getOrderByClause() { return orderByClause; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.53047764", "0.52772194", "0.5221662", "0.51772225", "0.515969", "0.51524496", "0.5151498", "0.5139081", "0.50367755", "0.5035072", "0.5034878", "0.49445572", "0.49196905", "0.491156", "0.49074033", "0.49057078", "0.4863878", "0.48569855", "0.48396394", "0.4813608", "0.4808...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
public List getOredCriteria() { return oredCriteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.5306466", "0.5278364", "0.5224397", "0.5180511", "0.51603675", "0.51533455", "0.5152701", "0.51418954", "0.5038122", "0.5036989", "0.50364083", "0.4947865", "0.49212947", "0.49128425", "0.4907929", "0.49066576", "0.48649895", "0.4858347", "0.48422268", "0.48139176", "0.480...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
public void or(Criteria criteria) { oredCriteria.add(criteria); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.5306466", "0.5278364", "0.5224397", "0.5180511", "0.51603675", "0.51533455", "0.5152701", "0.51418954", "0.5038122", "0.5036989", "0.50364083", "0.4947865", "0.49212947", "0.49128425", "0.4907929", "0.49066576", "0.48649895", "0.4858347", "0.48422268", "0.48139176", "0.480...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.5306867", "0.52793145", "0.52231914", "0.5179527", "0.51615417", "0.5153139", "0.5153112", "0.5141047", "0.50389344", "0.50375855", "0.5036446", "0.49458945", "0.4920286", "0.49122536", "0.4908194", "0.49072245", "0.4865769", "0.4860364", "0.48424968", "0.4814254", "0.4807...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.53047764", "0.52772194", "0.5221662", "0.51772225", "0.515969", "0.51524496", "0.5151498", "0.5139081", "0.50367755", "0.5035072", "0.5034878", "0.49445572", "0.49196905", "0.491156", "0.49074033", "0.49057078", "0.4863878", "0.48569855", "0.48396394", "0.4813608", "0.4808...
0.0
-1
This method was generated by Abator for iBATIS. This method corresponds to the database table eqplistlog
public void clear() { oredCriteria.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public ArrayList<PepDetailsHistory> getPepHistoryDetails(String orinNo) throws PEPPersistencyException{\n LOGGER.info(\"inside getPepHistoryDetails()\");\n List<PepDetailsHistory> pepList = new ArrayList<PepDetailsHistory>();\n Session session = this.sessionFactory.openSession()...
[ "0.5306466", "0.5278364", "0.5224397", "0.5180511", "0.51603675", "0.51533455", "0.5152701", "0.51418954", "0.5038122", "0.5036989", "0.50364083", "0.4947865", "0.49212947", "0.49128425", "0.4907929", "0.49066576", "0.48649895", "0.4858347", "0.48422268", "0.48139176", "0.480...
0.0
-1
Draws the AVG to the canvas.
void draw(@NonNull Canvas canvas, int w, int h, @NonNull IBitmapFactory bitmapFactory) { mScaledWidth = w / mViewportWidth; mScaledHeight = h / mViewportHeight; // Traverse the tree in pre-order to draw. drawGraphicElement(mScaledWidth, mScaledHeight, IDENTITY_MATRIX, mRootGroup, canvas, (float)mRootAlpha / 255, bitmapFactory); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void draw()\n {\n Canvas canvas = Canvas.getCanvas();\n canvas.draw(this, color, new Ellipse2D.Double(xPosition, yPosition, \n diameter, diameter));\n canvas.wait(10);\n }", "public void draw() {\n \n // TODO\n }", "public void draw(Canvas canv...
[ "0.6528532", "0.6479005", "0.6413149", "0.6413149", "0.639967", "0.6399581", "0.6376537", "0.63426965", "0.6288863", "0.6286135", "0.62687564", "0.62514365", "0.62445325", "0.6225946", "0.620802", "0.61878127", "0.618668", "0.61275095", "0.6102603", "0.6077209", "0.6072078", ...
0.0
-1
APL Spec for AVG Gradient:
private static Shader getShader(@NonNull final Gradient graphicGradient, @NonNull final Rect graphicBounds, @NonNull final Matrix transform, @NonNull final RenderingContext renderingContext ) { return ShaderFactory.getInstance().getShader(graphicGradient, graphicBounds, transform, renderingContext); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void computeGradient(GradientCalc calc);", "public float getGradPoint() { return gradientPoint; }", "private void gradientMagnitude(float[] img, float[] mag) {\r\n int row, col, cIndex;\r\n float lVal, rVal, tVal, bVal;\r\n for (row = 0; row < yDim; row++) {\r\n cIndex = row * xDim;\r\n for ...
[ "0.6060135", "0.5830389", "0.578547", "0.5778475", "0.57758385", "0.57316077", "0.5697584", "0.56404424", "0.5630024", "0.5606873", "0.55921423", "0.55462474", "0.5497978", "0.54414195", "0.54178375", "0.54013574", "0.5397239", "0.5368701", "0.5299072", "0.5280456", "0.525185...
0.0
-1
Calculate current group's matrix by preConcat the parent's and and the current one on the top of the stack. Basically the Mfinal = Mviewport M0 M1 M2; Mi the local matrix at level i of the group tree.
private static void drawGroupTree(final float xScale, final float yScale, @NonNull final Matrix currentTransform, @NonNull final GraphicGroupElement currentGroup, @NonNull final Canvas canvas, final float currentOpacity, @NonNull final IBitmapFactory bitmapFactory) { currentGroup.getStackedMatrix().set(currentTransform); currentGroup.getStackedMatrix().preConcat(currentGroup.getLocalMatrix()); // Save the current clip information, which is local to this group. canvas.save(); // If VClipPath is set on this VGroup, then it needs to be processed before // any children. if (currentGroup.getClipPathNodes() != null) { drawClipPath(xScale, yScale, currentGroup, canvas); } // Calculate new stacked opacity. float stackedOpacity = currentOpacity * currentGroup.getOpacity(); // Draw the group tree in the same order as the AVG tree. for (GraphicElement child : currentGroup.getChildren()) { drawGraphicElement(xScale, yScale, currentGroup.getStackedMatrix(), child, canvas, stackedOpacity, bitmapFactory); } canvas.restore(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Stack<Cell> rebuildMovements(PDMatrix mat, Point p, Movement m)\n\t{\n\t\tStack<Cell> cell = new Stack<Cell>();\n\t\tm = m.inverse();\n\t\tdo {\n\t\t\tp = m.applyTo(p);\n\t\t\tCell last = mat.get(p);\n\t\t\tcell.add(last);\n\t\t\tm = last.NextDir(m);\n\t\t}\n\t\twhile(mat.get(p) != Cell.START);\n\t\treturn...
[ "0.50397897", "0.49602294", "0.48805124", "0.4874576", "0.47898442", "0.47737613", "0.47594562", "0.47082737", "0.46959296", "0.46958876", "0.46755955", "0.46593708", "0.4632221", "0.46314642", "0.46190906", "0.46142465", "0.45975345", "0.45951322", "0.45704955", "0.4570478", ...
0.4318003
50
Returns a new bitmap or clears an existing one to be used temporarily to apply filters. A group cannot reuse a bitmap from another group in case of nested groups since we cannot clear a bitmap before we finished drawing.
private static Bitmap getFilterBitmap(int width, int height, GraphicElement graphicElement, @NonNull IBitmapFactory bitmapFactory) { if(!graphicElement.containsFilters()) { return null; } GraphicGroupElement groupElement = null; if(graphicElement instanceof GraphicGroupElement) { groupElement = (GraphicGroupElement) graphicElement; } FilterBitmapKey key = FilterBitmapKey.create(width, height, groupElement == null ? 0 : groupElement.hashCode()); Bitmap bitmap = mBitmapCache.getBitmap(key); if(bitmap != null) { bitmap.eraseColor(Color.TRANSPARENT); return bitmap; } try { bitmap = bitmapFactory.createBitmap(width, height); } catch (BitmapCreationException e) { if (BuildConfig.DEBUG) { Log.e(TAG, "Error creating filter bitmap.", e); } return null; } mBitmapCache.putBitmap(key, bitmap); return bitmap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void updateGroupImage(Group group, Bitmap bitmap) {\n SharedPreferences sharedPreferences = getSharedPreferences(GROUPS_SHARED_PREFERENCES, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n ExecutorService executorService = Executors.newSingleThread...
[ "0.58481604", "0.556783", "0.55171764", "0.54713356", "0.5226134", "0.5214386", "0.51955104", "0.5166285", "0.5158527", "0.5130553", "0.5064231", "0.50560343", "0.5053175", "0.50412077", "0.4971877", "0.49646115", "0.49550912", "0.4952854", "0.4940457", "0.49163166", "0.49117...
0.6217849
0
Given unit vectors A = (0, 1) and B = (1, 0). After matrix mapping, we got A' and B'. Let theta = the angel b/t A' and B'. Therefore, the final scale we want is min(|A'| sin(theta), |B'| sin(theta)), which is (|A'| |B'| sin(theta)) / max (|A'|, |B'|); If max (|A'|, |B'|) = 0, that means either x or y has a scale of 0. For nonskew case, which is most of the cases, matrix scale is computing exactly the scale on x and y axis, and take the minimal of these two. For skew case, an unit square will mapped to a parallelogram. And this function will return the minimal height of the 2 bases.
private static float getMatrixScale(@NonNull final Matrix groupStackedMatrix) { float[] unitVectors = new float[]{0, 1, 1, 0}; groupStackedMatrix.mapVectors(unitVectors); float scaleX = (float) Math.hypot(unitVectors[0], unitVectors[1]); float scaleY = (float) Math.hypot(unitVectors[2], unitVectors[3]); float crossProduct = cross(unitVectors[0], unitVectors[1], unitVectors[2], unitVectors[3]); float maxScale = Math.max(scaleX, scaleY); float matrixScale = 0; if (maxScale > 0) { matrixScale = Math.abs(crossProduct) / maxScale; } return matrixScale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static double absScale( double val, double min, double max, double a, double b){\n double result;\n result = ((b - a) * (val - min) / (max - min)) + a;\n return result;\n }", "public float mi(float [] a, float [] b)\n\t{\n\t\tzeroHistograms();\n\t\tn = 0;\n\t\t// Compute histograms...
[ "0.47992092", "0.47979996", "0.47758487", "0.472059", "0.47171533", "0.4692234", "0.46632007", "0.46462908", "0.46324283", "0.46315724", "0.45716363", "0.45653576", "0.45518583", "0.45314375", "0.45207518", "0.44926193", "0.44801825", "0.44678146", "0.44562843", "0.44533992", ...
0.41453096
47
boolean TF=IsMonefyAppOpen(); Assert.assertEquals(TF, true);
@BeforeMethod public void openAppp() throws IOException { System.out.println("Monefy Application launched successfully:"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(priority = 2)\n public void verifyAppIsInstalled(){\n Assert.assertTrue(driver.isAppInstalled(bundleId), \"The App is not installed\");\n Log.info(\"App is installed\");\n }", "private static boolean m23465a(Context context) {\n try {\n if (C1428a.m5906b() || C1428a.m5905a(C1428a....
[ "0.62157303", "0.61222845", "0.6104886", "0.6088888", "0.605852", "0.6030785", "0.5971647", "0.59556687", "0.59548587", "0.5912124", "0.59103894", "0.5888806", "0.5866339", "0.5860303", "0.58578235", "0.5843409", "0.5843377", "0.5829033", "0.5821402", "0.5819985", "0.58119625...
0.5774727
29
Also considers fields as id that are of supported id type and name.
@Override public boolean isIdProperty() { if (super.isIdProperty()) { return true; } // We need to support a wider range of ID types than just the ones that can be // converted to an ObjectId // but still we need to check if there happens to be an explicit name set return SUPPORTED_ID_PROPERTY_NAMES.contains(getName()) && !hasExplicitFieldName(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void handleIdFields(JFieldVar field, JsonNode propertyNode) {\n if (propertyNode.has(JpaConstants.IS_ID_COLUMN) && propertyNode.get(JpaConstants.IS_ID_COLUMN).asBoolean(true)) {\n field.annotate(Id.class);\n }\n\n if (propertyNode.has(JpaConstants.GENERATED_VALUE)) {\n ...
[ "0.68071616", "0.6432057", "0.625183", "0.57979476", "0.5773207", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.57554", "0.575...
0.649915
1
TODO Autogenerated method stub
@Override public void sort(Integer[] input) { for(int i = 1; i < input.length; i++ ) { int key = input[i]; int j = i - 1; for( ; j >= 0; j--) { if(key < input[j]) { input[j + 1] = input[j]; } else break; } input[j + 1] = key; } print(input); }
{ "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
/ original node list: [array] 1 2 3 4 a > b > c > d [map] pointer to idx a > b ==> 1 > 2 [map] idx to idx (random pointer) new node list: array2
public Node copyRandomList(Node head) { if (head == null) { return null; } LinkedList<Node> nodes = new LinkedList<>(); Node p = head; while (p != null) { nodes.add(p); p = p.next; } Node[] arr = nodes.toArray(new Node[]{}); Map<Node, Integer> refToIdxMap = new HashMap<>(); for (int i = 0; i < arr.length; i++) { Node node = arr[i]; refToIdxMap.put(node, i); } Map<Integer, Integer> idxMap = new HashMap<>(); for (int i = 0; i < arr.length; i++) { Node ref = arr[i].random; if (ref != null) { Integer randomNodeIdx = refToIdxMap.get(ref); idxMap.put(i, randomNodeIdx); } } Node newHead = null; Node prev = null; for (int i = 0; i < arr.length; i++) { Node curr = new Node(arr[i].val); if (prev == null) { newHead = curr; } else { prev.next = curr; } prev = curr; arr[i] = curr; } idxMap.forEach((i, j) -> arr[i].random = arr[j]); return newHead; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void reIndex()\n {\n for(int i = 0; i < NodeList.size(); i++)\n NodeList.get(i).setID(i);\n ID = NodeList.size();\n }", "public static Node copyRandomList2(Node head) {\n\n\t\t//setting up duplicate nodes in between\n\t\tif (head == null) return head;\n\t\tNode curr = head;...
[ "0.5570156", "0.54833585", "0.5438854", "0.5435746", "0.5408473", "0.53154844", "0.52866936", "0.5262", "0.52561796", "0.5244375", "0.5225606", "0.5213601", "0.51946884", "0.5192109", "0.5159938", "0.514616", "0.5143748", "0.51165056", "0.51107275", "0.50913596", "0.50780666"...
0.5081711
20
TODO : sharp? flat?
public Note() { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void flatten()\n\t{\n\t}", "public void flatten();", "@Test\n public void flatMap() {\n\n }", "public void flatten (){\n // Don't need to do anything\n }", "public String flatten() {\n\t\tString data;\n\t\t// We use simple name, because the fleshed out version of this class is\n\t\t/...
[ "0.5709193", "0.55318284", "0.5418769", "0.54178977", "0.5256931", "0.51927507", "0.506513", "0.49829054", "0.49763995", "0.49511138", "0.4945449", "0.49297568", "0.48853305", "0.48800018", "0.4879936", "0.4878164", "0.48776218", "0.48718944", "0.48613924", "0.48378366", "0.4...
0.0
-1
Test the constructor and toString method by creating a new TestManager object and then calling the toString() method which should return the following: Current Test Scores:\n\tThere are no current test scores
@Test public void testCreateNewTestManager() { TestManager theTestManager = new TestManager(); String report = theTestManager.toString(); assertEquals("There are no current test scores", report); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String toString() {\n\t\treturn name+\" : \"+test;\n\t}", "@Test\n void testToString() {\n Tests tests = new Tests();\n String result = tests.toString();\n assertTrue(result.contains(\"total=\"));\n\n\n }", "@Test\n public void testGetManagerTypeString() {\n ...
[ "0.66419864", "0.64915013", "0.6197959", "0.6045127", "0.60020643", "0.5998015", "0.59878", "0.59514344", "0.5930751", "0.5903545", "0.5873055", "0.58704376", "0.58546937", "0.58528817", "0.583858", "0.5829709", "0.58127666", "0.5805416", "0.57855594", "0.57797194", "0.577112...
0.7677874
0
C++ TO JAVA CONVERTER NOTE: This static local variable declaration (not allowed in Java) has been moved just prior to the method: static char str[501];
public static int Main() { int len; int i; int j; int p; int l; Main_str = new Scanner(System.in).nextLine(); for (len = 0;Main_str.charAt(len) != '\0';len++) { ; } for (l = 2;l <= len;l++) { for (i = 0;i <= len - l;i++) { for (j = 0;j < l / 2;j++) { if (Main_str.charAt(i + j) != Main_str.charAt(i + l - 1 - j)) { //C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java: goto here; } } for (p = i;p < i + l;p++) { System.out.printf("%c",Main_str.charAt(p)); } System.out.print("\n"); //C++ TO JAVA CONVERTER TODO TASK: There are no gotos or labels in Java: here: continue; } } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract String mo1747a(String str);", "void mo1791a(String str);", "void mo9697a(String str);", "void mo12635a(String str);", "void mo37759a(String str);", "String mo38972c();", "void mo1935c(String str);", "public static /* synthetic */ String m109037a(String str) {\n return str;\n }", ...
[ "0.6236026", "0.61030835", "0.6042414", "0.60024863", "0.59962845", "0.5945061", "0.5930387", "0.5916549", "0.58966637", "0.58747363", "0.5849656", "0.584634", "0.58347523", "0.58218145", "0.5794077", "0.5791024", "0.5786949", "0.5779538", "0.5740857", "0.5739751", "0.5732667...
0.0
-1
TODO Autogenerated method stub
@Override public States getPacketState() { 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
/ renamed from: a
public static ExecutorService m21543a() { return f19854a; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface C4521a {\n /* renamed from: a */\n void mo12348a();\n }", "public interface C1423a {\n /* renamed from: a */\n void mo6888a(int i);\n }", "interface bxc {\n /* renamed from: a */\n void mo2508a(bxb bxb);\n}", "interface C33292a {\n /* renamed fr...
[ "0.62497115", "0.6242887", "0.61394435", "0.61176854", "0.6114027", "0.60893", "0.6046901", "0.6024682", "0.60201293", "0.5975212", "0.59482527", "0.59121317", "0.5883635", "0.587841", "0.58703005", "0.5868436", "0.5864884", "0.5857492", "0.58306104", "0.5827752", "0.58272064...
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Scanner op=new Scanner(System.in); byte s=1; byte c; double n=0.0, t=0.0; System.out.println("Bienvenidos"); System.out.println("¿Cauntos productos desea registrar?"); c=op.nextByte(); do{ System.out.println("Ingrese el precio del producto" + s); n=op.nextDouble(); t=t+n; s++; }while(s<=c); System.out.println("El monto total es: "+t); if(t>=1500){ t=t*1.11; }else{ t=t*1.10; } System.out.println("El precio total es: "+t); }
{ "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
Hibernate will ignore this field
@Transient public Double getTotalOrderPrice() { double sum = 0; for (OrderItem oi : getOrderItems()) { sum += oi.getTotalPrice(); } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean isMapped() {\n return false;\n }", "@Override\n\tprotected String[] ignoreFields() {\n\t\treturn null;\n\t}", "public PimsSysReqFieldDaoHibernate() {\n super(PimsSysReqField.class);\n }", "@Override\n public boolean isDisableMetadataField() {\n...
[ "0.63925284", "0.62099916", "0.61063546", "0.6094424", "0.58367956", "0.5786132", "0.5772239", "0.5702418", "0.5683743", "0.5609182", "0.56028277", "0.55210286", "0.5517169", "0.54815227", "0.5472805", "0.54649794", "0.54527783", "0.5418155", "0.54101276", "0.54012454", "0.53...
0.0
-1
Get all the stockReports.
@Override @Transactional(readOnly = true) public Page<StockReportDTO> findAll(Pageable pageable) { log.debug("Request to get all StockReports"); return stockReportRepository.findAll(pageable) .map(stockReportMapper::toDto); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(method = RequestMethod.GET, value = \"/getReports\")\r\n public List<Reports> getReports() {\r\n\r\n List<Reports> results = reportsRepository.getReportsByDate();\r\n return results;\r\n\r\n }", "@Override\r\n\tpublic List<ReportAndSummary> findAll() {\n\t\tList<ReportAndSumma...
[ "0.74910647", "0.6880167", "0.6794152", "0.6763524", "0.6690024", "0.6492549", "0.63876325", "0.6309494", "0.6235359", "0.6224822", "0.6207696", "0.6207614", "0.61999685", "0.6190303", "0.6157812", "0.6143751", "0.612507", "0.60877323", "0.6039447", "0.60347587", "0.599738", ...
0.65897256
5
Get one stockReport by id.
@Override @Transactional(readOnly = true) public Optional<StockReportDTO> findOne(Long id) { log.debug("Request to get StockReport : {}", id); return stockReportRepository.findById(id) .map(stockReportMapper::toDto); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic TAnalysisReport findById(Integer id) {\n\t\treturn analysisreportdao.getById(id);\r\n\t}", "@Override\r\n\tpublic ReportAndSummary findById(int id) {\n\t\tReportAndSummary result = reportAndSummaryDao.findById(id);\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic Stock Find(Integer id)...
[ "0.7704913", "0.7458764", "0.72953063", "0.72335744", "0.70842856", "0.6981604", "0.6905717", "0.6834783", "0.68331784", "0.68009824", "0.6643509", "0.6517432", "0.649395", "0.6458358", "0.64159554", "0.6346967", "0.63393193", "0.6273497", "0.62688833", "0.624805", "0.6247988...
0.7938101
0
Delete the stockReport by id.
@Override public void delete(Long id) { log.debug("Request to delete StockReport : {}", id); stockReportRepository.deleteById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete CaseReport : {}\", id);\n caseReportRepository.deleteById(id);\n }", "@Override\n\tpublic void Delete(Integer id) {\n\t\t_stockDao.deleteByPrimaryKey(id);\n\t}", "@Delete({\n \"delete from SWMS_stock_out_record...
[ "0.7387813", "0.7378407", "0.7069687", "0.70561266", "0.7023058", "0.6825087", "0.672776", "0.67014724", "0.66571397", "0.6582177", "0.65782976", "0.65694034", "0.6552681", "0.6542832", "0.65337497", "0.6468559", "0.64377487", "0.64277333", "0.6418601", "0.6347039", "0.632028...
0.8750369
0
TODO Autogenerated method stub
public static void main(String[] args) { int x = 5; int z = 12; diplayTwiceTheNumber(x,z); displayNumberPlusFive(x,z); displayNumberSquared(x,z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
@Override public CursorFactory getCursorFactory() { 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
TODO Autogenerated method stub
@Override public NativeIM getNativeIM() { 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
TODO Autogenerated method stub
@Override public NativeMouseInfo getNativeMouseInfo() { 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
TODO Autogenerated method stub
@Override public NativeRobot getNativeRobot(GraphicsDevice screen) { 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
TODO Autogenerated method stub
@Override public SystemProperties getSystemProperties() { 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
TODO Autogenerated method stub
@Override public WindowFactory getWindowFactory() { 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
TODO Autogenerated method stub
private void init(Context context) { FilterParam.context = this.getContext(); this.setEGLContextClientVersion(2);// @see android.opengl.GLSurfaceView this.mRender = new MyRenderer(this); this.setRenderer(this.mRender);//@see android.opengl.GLSurfaceView this.setZOrderMediaOverlay(true);//@see android.opengl.GLSurfaceView this.setRenderMode(RENDERMODE_WHEN_DIRTY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public int makesurfaceTextureId() { int[] textures = new int[1]; GLES20.glGenTextures(1, textures, 0); int SurfaceTextId = textures[0]; GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, SurfaceTextId); // Can't do mipmapping with camera source GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); // Clamp to edge is the only option GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); BitmapFactory.Options options = new BitmapFactory.Options(); options.inScaled = false; Bitmap bitmap = BitmapFactory.decodeResource(this.getContext().getResources(), R.drawable .grey, options); GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); bitmap.recycle(); // Log.d("MyRender", "SurfaceTextId is Created"); return SurfaceTextId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public void Rotation(int i) { mRender.Rotation(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExr...
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.608016...
0.0
-1
TODO Autogenerated method stub
public void setCameraId(int currentId) { mRender.setCameraId(currentId); }
{ "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
Only method, prints 3 statements
public static void main (String[] args) { System.out.println("Hello World."); System.out.println("Me llamo Stephen Morris."); System.out.println("Tom Brady is back in two days #USAgainstTheWorld."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void show3() {\n\t\tSystem.out.println(\"This is show3\");\n\t}", "public void show3() {\n\t\t\n\t}", "public void printStatement() {\n\t\t\n\t}", "public void show() {\n\n System.out.println(a);\n System.out.println(b);\n System.out.println(c);\n System.ou...
[ "0.69329286", "0.6534284", "0.652857", "0.65243787", "0.64883465", "0.6271018", "0.6202638", "0.61716145", "0.61607164", "0.6148651", "0.61483014", "0.6147777", "0.6134514", "0.6126035", "0.61247903", "0.61017454", "0.6096162", "0.6093783", "0.60604244", "0.60526216", "0.6052...
0.0
-1
Returns the Cell value by taking row and Column values as argument
public static String readCell(int row, int column) { return wrksheet.getCell(row, column).getContents(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getValue(int row, int column);", "Value evaluateCellAt(int col, int row);", "public abstract T getCell(int row, int column);", "protected abstract double getCell(\r\n int row,\r\n int col);", "String getValue(String column, int row);", "public int get_cell(int row,int col...
[ "0.810236", "0.8090842", "0.7847081", "0.77587986", "0.77193934", "0.7683174", "0.73742193", "0.7347814", "0.7301569", "0.7298404", "0.7282543", "0.72135043", "0.72091335", "0.7151536", "0.7089892", "0.70539546", "0.7027438", "0.7017739", "0.7016635", "0.6984538", "0.6965318"...
0.0
-1
Create Column Dictionary to hold all the Column Names
public static void columnDictionary(String xlsPath, String sheet, Hashtable<String, Integer> columns) throws BiffException, IOException { wrkbook = Workbook.getWorkbook(new File(xlsPath)); wrksheet = wrkbook.getSheet(sheet); //Iterate through all the columns in the Excel sheet and store the value in Hashtable for(int col=0; col < wrksheet.getColumns(); col++) { columns.put(readCell(col,0), col); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static HashMap<String,String> buildColumnMap() {\n HashMap<String,String> map = new HashMap<String,String>();\n map.put( STATE_NAME, STATE_NAME );\n map.put( CAPITAL_NAME, CAPITAL_NAME );\n map.put( STATE_ABBR, STATE_ABBR );\n map.put( STATE_FOUNDING_DATE, STATE_FOUNDING_...
[ "0.7797901", "0.72878325", "0.72545046", "0.7088502", "0.7007414", "0.6971746", "0.67562586", "0.6676572", "0.6660053", "0.65314186", "0.64727724", "0.6401619", "0.63059723", "0.629911", "0.6261692", "0.624461", "0.6222085", "0.62204283", "0.62105024", "0.6183459", "0.6141053...
0.0
-1
Read the Test Case from TestCases Sheet.
public static void xlRead_TC(String xlPath, String sheet) throws Exception{ columnDictionary(xlPath, sheet, columns_TC); // To get All columns Text in Hashtable corresponding to sheet. File myxl = new File(xlPath); FileInputStream myStream = new FileInputStream(myxl); hssfWorkbook = new HSSFWorkbook(myStream); hssfWorkSheet = hssfWorkbook.getSheet(sheet); // Referring to 1st sheet of Test Case xTCRows = hssfWorkSheet.getLastRowNum()+1; xTCCols = hssfWorkSheet.getRow(0).getLastCellNum(); xTCdata = new String[xTCRows][xTCCols]; for (int i = 0; i < xTCRows; i++) { HSSFRow row = hssfWorkSheet.getRow(i); for (int j = 0; j < xTCCols; j++) { HSSFCell cell = row.getCell(j); // To read value from each column in each row try { String value = cellToString(cell); xTCdata[i][j] = value; } catch (Exception e) {} } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void readFromExcel_ApachePOI(String testCase) throws Exception{\n\t\tString fileName = \"TestData.xlsx\";\n\t\tString SAMPLE_XLSX_FILE_PATH = System.getProperty(\"user.dir\")+\"\\\\src\\\\test\\\\resources\\\\TestData\\\\TestData.xlsx\";\n\t\tFile file = new File(SAMPLE_XLSX_FILE_PATH);\n\t\tFileInpu...
[ "0.659788", "0.65288556", "0.63044363", "0.6123895", "0.61235124", "0.6104964", "0.60367763", "0.6035764", "0.5999226", "0.5974463", "0.5954814", "0.5911916", "0.5902354", "0.5896718", "0.5861391", "0.5795588", "0.5786662", "0.57842535", "0.5775044", "0.5727152", "0.5694659",...
0.62082964
3
Read the Test Steps from TestSteps Sheet corresponding to Test Cases.
public static void xlRead_TS(String xlPath, String sheet) throws Exception{ columnDictionary(xlPath, sheet, columns_TS); // To get All columns Text in Hashtable corresponding to sheet. File myxl = new File(xlPath); FileInputStream myStream = new FileInputStream(myxl); hssfWorkbook = new HSSFWorkbook(myStream); hssfWorkSheet = hssfWorkbook.getSheet(sheet); // Referring to 2nd sheet of Test Steps xTSRows = hssfWorkSheet.getLastRowNum()+1; xTSCols = hssfWorkSheet.getRow(0).getLastCellNum(); xTSdata = new String[xTSRows][xTSCols]; for (int i = 0; i < xTSRows; i++) { HSSFRow row = hssfWorkSheet.getRow(i); for (int j = 0; j < xTSCols; j++) { HSSFCell cell = row.getCell(j); // To read value from each column in each row try{ String value = cellToString(cell); xTSdata[i][j] = value; } catch (Exception e) {} } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<TestStep> getTestSteps() {\n return ImmutableList.copyOf(testSteps);\n }", "public ProofStep [ ] getSteps ( ) ;", "@AfterMethod\n\tpublic void getResult(ITestResult result) throws IOException {\n\t\tString cellContent = this.getClass().getSimpleName();\n\t\tSystem.out.println(cellContent)...
[ "0.6262134", "0.5654458", "0.56495684", "0.56333303", "0.5514896", "0.5502248", "0.54199153", "0.54115427", "0.54088485", "0.53969765", "0.5375468", "0.5322492", "0.5310592", "0.5296037", "0.5272861", "0.524523", "0.52343756", "0.5195119", "0.5184553", "0.5173269", "0.5157837...
0.0
-1
Read the Data from Data Sheet corresponding to Test Cases.
public static void xlRead_TD(String xlPath, String sheet) throws Exception{ columnDictionary(xlPath, sheet, columns_TD); // To get All columns Text in Hashtable corresponding to sheet. File myxl = new File(xlPath); FileInputStream myStream = new FileInputStream(myxl); hssfWorkbook = new HSSFWorkbook(myStream); hssfWorkSheet = hssfWorkbook.getSheet(sheet); // Referring to Test Data Sheet corresponding to Test Case. xTDRows = hssfWorkSheet.getLastRowNum()+1; xTDCols = hssfWorkSheet.getRow(0).getLastCellNum(); xTDdata = new String[xTDRows][xTDCols]; for (int i = 1; i < xTDRows; i++) { HSSFRow row = hssfWorkSheet.getRow(i); for (int j = 0; j < xTDCols; j++) { HSSFCell cell = row.getCell(j); // To read value from each column in each row try{ String value = cellToString(cell); xTDdata[i][j] = value; } catch (Exception e) {} } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public HashMap<String, String> readTestData() {\n\t\trequiredRow = getRequiredRow();\n\t\tif(requiredRow!=0) {\n\t\t\tfor(int i = 0 ; i < sheet.getRow(requiredRow).getLastCellNum(); i++) {\n\t\t\t\tif(sheet.getRow(requiredRow).getCell(i)==null)\n\t\t\t\t\tsheet.getRow(requiredRow).createCell(i).setCellType(CellTyp...
[ "0.69588876", "0.69296193", "0.69279873", "0.68974936", "0.6788292", "0.67155254", "0.6687785", "0.65992546", "0.6573661", "0.65037453", "0.647675", "0.6415691", "0.6394819", "0.6382079", "0.627331", "0.62114155", "0.6200227", "0.6158122", "0.6132911", "0.6098142", "0.6066264...
0.5844046
34
Update Execution of Test Case Status in Excel sheet.
public static void xlWrite_TC(String xlPath, String statusTC, int rowNum) throws Exception { FileInputStream fis= new FileInputStream(xlPath); hssfWorkbook = new HSSFWorkbook(fis); hssfWorkSheet = hssfWorkbook.getSheet("TestCases"); HSSFRow row = hssfWorkSheet.getRow(rowNum); row.createCell(getCell(columns_TC, "TestStatus")).setCellValue(statusTC); row.createCell(getCell(columns_TC, "TimeStamp")).setCellValue(DateFormatUtilities.getCurrentDateTimeFormatted()); row.createCell(getCell(columns_TC, "Tester")).setCellValue(SetObjectProperties.appConfig.getPropertyValue("TesterName")); FileOutputStream fileOut = new FileOutputStream(xlPath); hssfWorkbook.write(fileOut); fileOut.flush(); fileOut.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateMultiRunInventory() {\n\n\t\tExcelFileUtils excelFileUtils = new ExcelFileUtils();\n\t\texcelFileUtils.setSpreadsheetFilePath(spreadsheetFilePath);\n\t\texcelFileUtils.setSheetFormat(sheetFormat);\n\t\texcelFileUtils.setSheetName(sheetName);\n\t\texcelFileUtils.setDebug(true /* this.debug */ );\n...
[ "0.628521", "0.625013", "0.6193655", "0.61174953", "0.5919094", "0.5912495", "0.586197", "0.5811609", "0.5786079", "0.5774015", "0.57261753", "0.5650674", "0.5606438", "0.5578446", "0.5529447", "0.5501597", "0.54852927", "0.5476319", "0.5421934", "0.5394378", "0.53824514", ...
0.5451988
18
Update Execution of test Step Status in Excel sheet.
public static void xlWrite_TS(String xlPath, String statusTS, String errorStatus, int rowNum) throws Exception { FileInputStream fis= new FileInputStream(xlPath); hssfWorkbook = new HSSFWorkbook(fis); hssfWorkSheet = hssfWorkbook.getSheet("TestSteps"); HSSFRow row = hssfWorkSheet.getRow(rowNum); row.createCell(getCell(columns_TS, "Proceed_on_Fail")).setCellValue(errorStatus); row.createCell(getCell(columns_TS, "TestStepStatus")).setCellValue(statusTS); FileOutputStream fileOut = new FileOutputStream(xlPath); hssfWorkbook.write(fileOut); fileOut.flush(); fileOut.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void SheetResultcellupdatetoskipped(int row) {\n\n\t\tString dataFilePath = \"Resources/[3DBroadCastSales]-Script_Result.xlsx\";\n\t\tFile datafile = new File(dataFilePath);\n\t\tString fullpath = datafile.getAbsolutePath();\n\t\tSheet firstSheet = null;\n\n\t\ttry {\n\t\t\t// System.out.println(\"fu...
[ "0.6150616", "0.6132322", "0.6042015", "0.6037868", "0.60323334", "0.5740701", "0.5683726", "0.5652035", "0.56517756", "0.5618705", "0.54896796", "0.5482881", "0.5482094", "0.5481041", "0.5476317", "0.5463456", "0.53937984", "0.5363146", "0.5346433", "0.5333523", "0.5321729",...
0.54609686
16
Update Execution of test Data Status in Excel sheet.
public static void xlWrite_TD(String xlPath, String sheet, String statusTD, int rowNum) throws Exception { FileInputStream fis= new FileInputStream(xlPath); hssfWorkbook = new HSSFWorkbook(fis); hssfWorkSheet = hssfWorkbook.getSheet(sheet); HSSFRow row = hssfWorkSheet.getRow(rowNum); row.createCell(getCell(columns_TD, "TestDataStatus")).setCellValue(statusTD); FileOutputStream fileOut = new FileOutputStream(xlPath); hssfWorkbook.write(fileOut); fileOut.flush(); fileOut.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void updateMultiRunInventory() {\n\n\t\tExcelFileUtils excelFileUtils = new ExcelFileUtils();\n\t\texcelFileUtils.setSpreadsheetFilePath(spreadsheetFilePath);\n\t\texcelFileUtils.setSheetFormat(sheetFormat);\n\t\texcelFileUtils.setSheetName(sheetName);\n\t\texcelFileUtils.setDebug(true /* this.debug */ );\n...
[ "0.6771357", "0.6342131", "0.61770225", "0.5928827", "0.5921589", "0.58849865", "0.5785482", "0.5766416", "0.5759085", "0.5709533", "0.56732714", "0.5637344", "0.5630465", "0.56067103", "0.5508515", "0.5485397", "0.5443221", "0.5441815", "0.5420386", "0.5411394", "0.5392546",...
0.0
-1
get the test data from properties file for corresponding test steps.
public static String readProperties_TD(String data) throws Exception{ return SetObjectProperties.appConfig.getPropertyValue(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Properties loadProperties(String filename) {\n return testProperties;\n }", "private void loadData() {\n\n \tInputStream inputStream = this.getClass().getResourceAsStream(propertyFilePath);\n \n //Read configuration.properties file\n try {\...
[ "0.6990664", "0.6890211", "0.66535383", "0.65562445", "0.6523845", "0.6504", "0.6274158", "0.6128611", "0.61047506", "0.6060649", "0.60272783", "0.60162926", "0.5994718", "0.5955388", "0.59354234", "0.5924614", "0.58893263", "0.5862727", "0.5856902", "0.5836631", "0.58364844"...
0.5741708
28
This function will convert an object of type excel cell to a string value
public static String cellToString(HSSFCell cell) throws NullPointerException{ // This function will convert an object of type excel cell to a string value int type = cell.getCellType(); Object result; switch (type) { case HSSFCell.CELL_TYPE_NUMERIC: //0 result = cell.getNumericCellValue(); break; case HSSFCell.CELL_TYPE_STRING: //1 result = cell.getStringCellValue(); break; case HSSFCell.CELL_TYPE_FORMULA: //2 throw new RuntimeException("We can't evaluate formulas in Java"); case HSSFCell.CELL_TYPE_BLANK: //3 result = "-"; break; case HSSFCell.CELL_TYPE_BOOLEAN: //4 result = cell.getBooleanCellValue(); break; case HSSFCell.CELL_TYPE_ERROR: //5 throw new RuntimeException ("This cell has an error"); default: throw new RuntimeException("We don't support this cell type: " + type); } return result.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String cellToString(HSSFCell cell){\n\t\t//This function will convert an object of type excell cell to string value\n\t\tint type = cell.getCellType();\n\t\tObject result;\n\t\tswitch(type){\n\t\tcase HSSFCell.CELL_TYPE_NUMERIC: //0\n\t\t\tresult = cell.getNumericCellValue();\n\t\t\tbreak;\n\t\tcase ...
[ "0.7717233", "0.7481494", "0.72720623", "0.71714514", "0.6981818", "0.6782036", "0.67812526", "0.6595556", "0.6575884", "0.64307237", "0.6427783", "0.6324664", "0.6245587", "0.617433", "0.6173349", "0.61571217", "0.613972", "0.6119913", "0.6087174", "0.60249406", "0.6024665",...
0.7455037
2
Setup actions registered for the view.
public void setupActions() { getActionManager().setup(getView()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void init_actions()\n {\n action_obj = new CUP$ParserForms$actions(this);\n }", "@Override\r\n\tpublic void initActions() {\n\t\t\r\n\t}", "private void setupActionButtons() {\n setupLikeActionButton();\n setupRepostActionButton();\n setupMoreActionButton()...
[ "0.68550724", "0.6822139", "0.6766026", "0.6694501", "0.66406596", "0.65686005", "0.6522442", "0.64855474", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", "0.64822453", ...
0.8383095
0
This will show the action and extra's associated to intent that called this activity
private void showIntentInfo(Intent intent, TextView textView){ StringBuilder infoBuilder = new StringBuilder(); String action = intent.getAction(); infoBuilder.append("Action="); infoBuilder.append(action != null ? action : "** NO Action **"); infoBuilder.append("\n"); Bundle extras = intent.getExtras(); if(extras == null){ infoBuilder.append("** NO Extras **"); } else { infoBuilder.append("** Extras **\n"); Set<String> keySet = extras.keySet(); for(String key : keySet) { String value = extras.get(key).toString(); infoBuilder.append(key); infoBuilder.append("="); infoBuilder.append(value); infoBuilder.append("\n"); } } textView.setText(infoBuilder.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void performAction(View view) {\n startActivity(new Intent(MainActivity.this, MyInfoActivity.class));\n }", "@Override\r\n\t public void onClick(View v) {\n\t\tBundle bundle = new Bundle();\r\n\t\tbundle.putString(\"ms...
[ "0.68123794", "0.6504855", "0.6473238", "0.6433824", "0.63928217", "0.63913125", "0.6356797", "0.6306997", "0.62821764", "0.6272354", "0.6265236", "0.6263863", "0.6263809", "0.62537926", "0.6241506", "0.6230603", "0.6217875", "0.61889654", "0.6161711", "0.61424345", "0.611753...
0.71894485
0
Creates a new Driver instance.
public Driver(String patchType, String authors) { this.patchType = patchType; this.authors = authors; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void createDriver(Driver driver);", "public DriverConfig createDriver()\n {\n DriverConfig driver = new DriverConfig(this);\n \n _driverList.add(driver);\n \n return driver;\n }", "public DriverForCreateBuilder() {\r\n driverForCreate = new DriverForCreate();\r\n }", "protected WebD...
[ "0.8089242", "0.7674143", "0.7316937", "0.6909222", "0.6819728", "0.6786582", "0.677957", "0.65374094", "0.6376184", "0.6322917", "0.6295822", "0.62250507", "0.6178609", "0.6110803", "0.61062413", "0.60134274", "0.59741324", "0.59554875", "0.59221065", "0.5902765", "0.5857208...
0.0
-1
Compares the header & size of a Patch to this driver to see if this driver is the correct one to support the patch.
public boolean supportsPatch(String patchString, byte[] sysex) { // check the length of Patch if ((patchSize != sysex.length) && (patchSize != 0)) return false; if (sysexID == null || patchString.length() < sysexID.length()) return false; StringBuffer compareString = new StringBuffer(); for (int i = 0; i < sysexID.length(); i++) { switch (sysexID.charAt(i)) { case '*': compareString.append(patchString.charAt(i)); break; default: compareString.append(sysexID.charAt(i)); } } // ErrorMsg.reportStatus(toString()); // ErrorMsg.reportStatus("Comp.String: " + compareString); // ErrorMsg.reportStatus("DriverString:" + driverString); // ErrorMsg.reportStatus("PatchString: " + patchString); return (compareString.toString().equalsIgnoreCase (patchString.substring(0, sysexID.length()))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasPatch();", "@java.lang.Override\n public boolean hasPatch() {\n return instance.hasPatch();\n }", "public boolean canCreatePatch() {\n try {\n getClass().getDeclaredMethod(\"createNewPatch\", null);\n return true;\n } catch (Exception ex) {\n ...
[ "0.5937281", "0.56373954", "0.53896254", "0.53393567", "0.5287227", "0.52847165", "0.5233497", "0.5217393", "0.5189428", "0.5138966", "0.51223433", "0.5116908", "0.50512886", "0.5027782", "0.4998072", "0.4965405", "0.49564856", "0.49517933", "0.49129614", "0.48940474", "0.488...
0.6061061
0
These are not 'final' because BankDriver and Converter class override them. Synth drivers should not override these.
public boolean isSingleDriver() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String getDriver();", "public interface DriverExtMethods\r\n extends DriverExtMethodsStubI\r\n{\r\n\r\n\r\n}", "public interface InternalsDriver {\n Optional<String> getStatisticsProviderName();\n Optional<String> getStatisticsProviderSetup();\n Optional<String> refreshStatisticsPro...
[ "0.5818882", "0.57512367", "0.557015", "0.5549967", "0.5529263", "0.55098176", "0.5505488", "0.54709744", "0.5461159", "0.5457425", "0.5454622", "0.5412792", "0.5400782", "0.540003", "0.53983396", "0.53960395", "0.53792727", "0.5378324", "0.53739595", "0.5370247", "0.5358876"...
0.0
-1
end of IDriver interface methods IPatchDriver interface methods
public int getPatchSize() { return patchSize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void startDriver();", "public void selectDriver();", "public interface IDriver {\n\n /** Get Device Name. */\n public String getDevice();\n\n /** Get Device Id. */\n public String getDeviceId();\n\n /** Get Device version. */\n public String getVersion();\n \n /** Execute command...
[ "0.6085307", "0.6044909", "0.602361", "0.5864818", "0.5774309", "0.57375765", "0.5686427", "0.5666951", "0.5651409", "0.5597489", "0.54175466", "0.53613055", "0.53379166", "0.5333312", "0.53125876", "0.5305618", "0.5278168", "0.5273008", "0.5265708", "0.5218953", "0.52021843"...
0.0
-1
All patches assumed to be writable by default
public String[] getPatchNumbersForStore() { return patchNumbers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean getSupportsPatchWrites() { return true; }", "public boolean getSupportsPatchWrites() { return true; }", "public boolean getSupportsPatchWrites() \n {\n return false; \n }", "public boolean getShouldChangePatchAfterWrite()\n {\n return false; \n }", "...
[ "0.669242", "0.669242", "0.65148294", "0.59410113", "0.5453922", "0.54126567", "0.5294025", "0.5218469", "0.52006847", "0.51183426", "0.51110446", "0.50956", "0.50736386", "0.5059016", "0.5041638", "0.5038156", "0.49995372", "0.49668568", "0.4950812", "0.49473953", "0.4941189...
0.0
-1
Check if this driver supports creating a new patch. By default it uses reflection to test if the method createNewPatch() is overridden by the subclass of Driver.
public boolean canCreatePatch() { try { getClass().getDeclaredMethod("createNewPatch", null); return true; } catch (Exception ex) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@java.lang.Override\n public boolean hasPatch() {\n return instance.hasPatch();\n }", "boolean hasPatch();", "protected Patch createNewPatch() { // overridden by subclass\n return null;\n }", "@Override\n public BankPatch createNewPatch() {\n return super.createNewPatch...
[ "0.61535096", "0.6141221", "0.5817483", "0.5724787", "0.55532795", "0.5279909", "0.52624387", "0.52624387", "0.5185988", "0.5178548", "0.5122955", "0.5102558", "0.50330454", "0.49942967", "0.4968044", "0.49454856", "0.49205884", "0.4912364", "0.4831544", "0.48281997", "0.4807...
0.83056283
0
Create a new Patch. Don't override this unless your driver properly implement this method.
protected Patch createNewPatch() { // overridden by subclass return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public BankPatch createNewPatch() {\n return super.createNewPatch();\n }", "@Override\n protected Patch createNewPatch() {\n Patch p = getPatchFactory().createNewPatch(Constants.NEW_SYSEX, this);\n return p;\n }", "Patch createNewPatch(IDriver driver, String fileNam...
[ "0.76799554", "0.6884251", "0.6742151", "0.6528568", "0.6377104", "0.6308366", "0.6227392", "0.62265027", "0.61203295", "0.61103296", "0.60360396", "0.5975318", "0.59511995", "0.5863856", "0.5811203", "0.5749783", "0.57424337", "0.57251555", "0.57073003", "0.5705796", "0.5705...
0.80452436
0
Look for a proper driver and trim the patch.
private IPatch fixPatch(Patch pk, String patchString) { byte[] sysex = pk.getByteArray(); for (int i = 0; i < AppConfig.deviceCount(); i++) { // first check the requested device. // then starting index '1'. (index 0 is 'generic driver') // XXX pk.getDevice() -> getDevice()? Device device = (i == 0) ? pk.getDevice() : AppConfig.getDevice(i); for (int j = 0; j < device.driverCount(); j++) { IDriver d = device.getDriver(j); if (d instanceof Driver && d.supportsPatch(patchString, sysex)) { // driver found Driver driver = (Driver) d; pk.setDriver(driver); driver.trimSysex(pk); JOptionPane .showMessageDialog(null, "You requested a " + driver.toString() + " patch!" + "\nBut you got a " + pk.getDriver().toString() + " patch.", "Warning", JOptionPane.WARNING_MESSAGE); return pk; } } // end of driver (j) loop } // end of device (i) loop // driver not found pk.setDriver(null); //reset pk.setComment("Probably a " + pk.lookupManufacturer() + " Patch, Size: " + pk.getByteArray().length); JOptionPane.showMessageDialog(null, "You requested a " + this.toString() + " patch!" + "\nBut you got a not supported patch!\n" + pk.getComment(), "Warning", JOptionPane.WARNING_MESSAGE); return pk; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public export.serializers.avro.DeviceInfo.Builder clearDriver() {\n driver = null;\n fieldSetFlags()[6] = false;\n return this;\n }", "public static void setEmptyDriver() {\n\t\tdriver = null;\n\t}", "public void checkAndCleanPatch() {\n Tinker tinker = Tinker.with(context);\n /...
[ "0.5487341", "0.51529574", "0.51294655", "0.4982268", "0.49635372", "0.49568716", "0.49377355", "0.49181396", "0.49018005", "0.4868948", "0.48652026", "0.48361474", "0.48156843", "0.48073065", "0.47784725", "0.4752889", "0.47407106", "0.47208807", "0.46816784", "0.4680966", "...
0.6338041
0
This method trims a patch, containing more than one real patch to a correct size. Useful for files containg more than one bank for example. Some drivers are incompatible with this method so it reqires explicit activation with the trimSize variable.
protected int trimSysex(Patch patch) { // no driver overrides this now. if (trimSize > 0 && patch.sysex.length > trimSize && patch.sysex[trimSize - 1] == (byte) 0xf7) { byte[] sysex = new byte[trimSize]; System.arraycopy(patch.sysex, 0, sysex, 0, trimSize); patch.sysex = sysex; } return patch.sysex.length; // == trimSize }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void trimToSize();", "private void trim() {\n while (size > maxSize) {\n if (major.isEmpty() && minor.isEmpty()) {\n break;\n }\n K key;\n V value;\n Map.Entry<K, V> next;\n synchronized (this) {\n if (m...
[ "0.6194107", "0.6015611", "0.6000597", "0.56152856", "0.5472068", "0.54141885", "0.52490157", "0.51104915", "0.5052417", "0.49733818", "0.49721828", "0.49158758", "0.47710887", "0.46715456", "0.4668329", "0.46650258", "0.4661831", "0.46221587", "0.46125135", "0.45431557", "0....
0.6036012
1
Request the synth to send a patch dump. If sysexRequestDump is not null, a request dump message is sent. Otherwise a dialog window will prompt users.
public void requestPatchDump(int bankNum, int patchNum) { //clearMidiInBuffer(); now done by SysexGetDialog.GetActionListener. setBankNum(bankNum); setPatchNum(patchNum); if (sysexRequestDump == null) { JOptionPane.showMessageDialog (PatchEdit.getInstance(), "The " + toString() + " driver does not support patch getting.\n\n" + "Please start the patch dump manually...", "Get Patch", JOptionPane.WARNING_MESSAGE); } else send(sysexRequestDump.toSysexMessage(getDeviceID(), new SysexHandler.NameValue("bankNum", bankNum), new SysexHandler.NameValue("patchNum", patchNum))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void requestPatchDump(int bankNum, int patchNum) {\n send(SYS_REQ.toSysexMessage(getChannel(), new SysexHandler.NameValue(\n \"channel\", getChannel())));\n }", "public void performRequestCurrentDump()\n {\n // This asks the synth to dump the currently...
[ "0.7561731", "0.7146549", "0.70224357", "0.6799762", "0.6222573", "0.6059395", "0.57086295", "0.56045187", "0.5565098", "0.5560561", "0.5475089", "0.52426606", "0.519856", "0.50894135", "0.50552624", "0.50348717", "0.500941", "0.46626812", "0.459427", "0.44749025", "0.4470718...
0.726612
1
MIDI in/out mothods to encapsulate lower MIDI layer
public final void send(MidiMessage msg) { device.send(msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface MidiDevice\n{\n}", "public interface IMidiView extends IView{\n /**\n * Plays the note.\n * @param pitch The pitch to play at\n * @param volume The volume of the note\n * @param length the length of the note\n * @param tempo The tempo of the note\n * @param instrument the instrument...
[ "0.65503097", "0.64867085", "0.6372318", "0.61498886", "0.60364646", "0.5801129", "0.5690183", "0.5622772", "0.55759895", "0.555957", "0.54948246", "0.5441857", "0.5424648", "0.5397598", "0.53471994", "0.5333314", "0.5314775", "0.5314529", "0.5278345", "0.52367234", "0.522117...
0.4750711
81
Subclasses of Driver should use SysexSenders, no this.
public void sendParameter(IPatch patch, SysexWidget.IParameter param) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void send(byte[] sysex) {\n try {\n SysexMessage[] a = MidiUtil.byteArrayToSysexMessages(sysex);\n for (int i = 0; i < a.length; i++)\n device.send(a[i]);\n } catch (InvalidMidiDataException e) {\n ErrorMsg.reportStatus(e);\n ...
[ "0.6320309", "0.5391796", "0.5328203", "0.5296042", "0.5260092", "0.51149887", "0.50928795", "0.50809544", "0.5059643", "0.5020492", "0.5006173", "0.49893942", "0.4988319", "0.4982166", "0.49800485", "0.49730843", "0.49696064", "0.49633056", "0.4955756", "0.49548525", "0.4946...
0.0
-1