id stringlengths 7 14 | text stringlengths 1 37.2k |
|---|---|
38108174_3 | public static AndroidRxBus create() {
return create(new AndroidQueueCache());
} |
38152816_7 | public Set<LanguageDirection> getLanguages() {
return languages;
} |
38174524_7 | public static <REQUEST extends com.google.protobuf.Message, RESPONSE extends com.google.protobuf.Message> Builder<REQUEST, RESPONSE> builder() {
return new Builder<>();
} |
38182304_61 | public static boolean match(final String rule, final String matchValue) {
boolean ismatch = false;
if (StringUtils.isNotEmpty(rule) && StringUtils.isNotEmpty(matchValue)) {
// match all
if (GlobalConstants.ASTERISK.equals(rule)) {
ismatch = true;
}
// not eq match
... |
38195479_4 | public boolean checkQuality(String quality) {
return (!quality.equals("") && ALLOWEDQUALITY.contains(quality));
} |
38215053_0 | public String readHOCRFile(final String pathOfHOCRFile) throws DCMAApplicationException {
final StringBuffer infoHOCRFile = new StringBuffer();
synchronized (object) {
String errMsg = null;
if (null == pathOfHOCRFile || RegexConstants.EMPTY.equals(pathOfHOCRFile)) {
errMsg = "Invalid HOCR file path.";
thro... |
38218145_182 | public void setGroupsController(TabbedGroupController groupsController) {
this.groupsController = groupsController;
} |
38254684_16 | @SuppressWarnings("unchecked")
public <T> Class<T> getClass(String key)
throws ClassNotFoundException {
if (containsKey(key)) {
return (Class<T>) Class.forName(get(key));
} else {
throw new IllegalArgumentException("Missing key " + key + ".");
}
} |
38261859_9 | @Nullable public static String getSharedPermission(Context context) {
Bundle metaData = getMetaData(context);
return getMetaValue(metaData, APP_SHARED_PERMISSION);
} |
38307113_24 | int run(String[] args) {
initJCommander();
try {
parseParams(jc, args);
if (help) {
printUsage(null);
return EXIT_CODE_OK;
}
if (debug) {
initializeDebugLogging();
}
if (jc.getParsedCommand() == null) {
return ha... |
38307688_3 | @Override
public int compare(TypeElement o1, TypeElement o2) {
return realComparator.compare(o1, o2);
} |
38311906_265 | @Override
public ImmutableSet<SubscriberMethod>
subscribersOf(EventClass eventClass, MessageClass originClass) {
return delegate.handlersOf(eventClass, originClass);
} |
38357506_0 | public static boolean testCorrelations(double correlation1, double correlation2, int n1, int n2,
double alpha)
throws MathException
{
double p = getSignificance(correlation1, correlation2, n1, n2);
if (p <= alpha) {
return true;
}
else {
return false;
}
} |
38417079_18 | @NonNull
public static <S extends DimensionAware & Named> List<ProductFlavorCombo<S>> createCombinations(
@Nullable List<String> flavorDimensions,
@NonNull Iterable<S> productFlavors) {
List <ProductFlavorCombo<S>> result = Lists.newArrayList();
if (flavorDimensions == null || flavorDimensions.... |
38424145_16 | public APICallVisitor(final CompilationUnit unit) {
this(unit, null);
} |
38443009_4 | public static String encrypt(String text) {
String base64EncryptedString = "";
if (!StringUtils.isBlank(text)) {
try {
String secretKey = getSecretKey();
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] digestOfPassword = md.digest(secretKey.getBytes("utf-8... |
38443555_124 | @Override
public Boolean get(DataFetchingEnvironment environment) {
final String username = environment.getArgument("username");
if (Strings.isNullOrEmpty(username)) {
throw new GraphQLValidationError("username cannot be empty");
}
try {
store.removeAll(username);
} catch (NotificationStoreException ... |
38482121_116 | public final String getType()
{
return type;
} |
38484146_8 | @Scheduled(fixedDelay = 1) // SUPPRESS CHECKSTYLE bug?
public void loop() { // NOPMD - cc
List<Message> messages = reveiveMessages();
if (messages.isEmpty()) {
log.trace("No SQS message received");
return;
}
log.debug("{} SQS messages are received", messages.size());
messages.stream().parallel().forEach(this::... |
38503932_0 | public Instant now() {
return Instant.now();
} |
38569235_8 | public Confirmation addConfirmation(@NotNull final String username, final long encounterId) {
Confirmation newConfirmation = new Confirmation();
newConfirmation.setUser(userService.getDukeEncountersUser(username));
newConfirmation.setDate(new Date());
newConfirmation.setEncounter(encounterService.getEnc... |
38588220_6 | public RTree<T> add(SplitterContext<T> splitterContext, T element, Rectangle2D bounds) {
// see if the root is not present (i.e. the RTree is empty
if (!root.isPresent()) {
// The first element addded to an empty RTree
// Return a new RTree with the new LeafNode as its root
return new RTree(LeafNode.cre... |
38597960_45 | public FormDatas toRight() {
return toRight( 0 );
} |
38608269_3 | public static Expression greaterEquals(final String l, final Number r) {
return new Expression(l + " >= " + r);
} |
38705594_523 | public static DateTimeFormatter forPrecision(Precision p) {
switch (p) {
case MILLISECOND:
return dateTime();
case SECOND:
return PointInTimeFormat.forPattern("yyyyMMddHHmmss");
case MINUTE:
return PointInTimeFormat.forPattern("yyyyMMddHHmm");
case... |
38706431_2 | public static void unsubscribe(Subscription subscription) {
if (subscription != null && !subscription.isUnsubscribed()) {
subscription.unsubscribe();
}
} |
38710489_1 | public String generateJson(Manifest manifest) throws JsonProcessingException {
ObjectMapper mapper = new IiifPresentationApiObjectMapper();
String json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(manifest);
return json;
} |
38710494_0 | @Override
public TransactionAssistant getTransactionAssistant() throws ResourceException {
//enlist a new resource into the transaction. it will be delisted, when its closed.
final CommitRollbackCallback commitRollbackCallback = TransactionConfigurator.getCommitRollbackCallback(jndiName);
MicroserviceXAResource ms =... |
38743792_67 | public static Instance run(Odps odps, String sql) throws OdpsException {
String project = odps.getDefaultProject();
if (project == null) {
throw new OdpsException("default project required.");
}
return run(odps, project, sql, "AnonymousSQLTask", null, null, "sql");
} |
38755419_7 | public static String completeDate(String date) {
if (date.endsWith("-")) {
date = date.substring(0, date.length()-1);
}
String val = "";
if (date.length() < 4) {
return val;
} else if (date.length() == 4) {
val = date + "-12-31";
} else if ((date.length() == 7) || (date.... |
38829639_38 | @Override
public String toString() {
StringBuilder b = new StringBuilder();
if (getAmount() != null) {
b.append(getAmount());
}
if (getFormat() != null) {
b.append(getFormat());
}
return b.toString();
} |
38830174_1 | public void loadPostIdList(String storyTypeUrl) {
mCompositeSubscription.add(mDataManager.getPostList(storyTypeUrl)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Action1<List<Long>>() {
@Override
public void call(List<Long> lo... |
38835213_2 | @NonNull
public SignInIntentBuilder createSignInIntentBuilder() {
return new SignInIntentBuilder();
} |
38846457_2 | @Override
public Bindings createBindings() {
return new SimpleBindings();
} |
38883479_7 | @Override
public Set<IntegerAxiom> apply(IntegerAxiom axiom) {
Objects.requireNonNull(axiom);
Set<IntegerAxiom> ret = Collections.emptySet();
if (axiom instanceof IntegerEquivalentClassesAxiom) {
ret = applyRule((IntegerEquivalentClassesAxiom) axiom);
}
return ret;
} |
38917208_1839 | public static Builder builder() {
return new Builder();
} |
38935102_44 | @Nullable
public static Point2D findRectEdgeIntersection(@Nonnull final Rectangle2D rect, final double outboundX, final double outboundY) {
final int detectedSide = rect.outcode(outboundX, outboundY);
if ((detectedSide & (Rectangle2D.OUT_TOP | Rectangle2D.OUT_BOTTOM)) != 0) {
final boolean top = (detectedSide ... |
38952211_1 | public static void mysort(Comparable[] a)
{
int sortedSize = 1;
int length = a.length;
//剩下未排序的队列
for (int i = 1; i < length; i++)
{
Comparable insertObject = a[i];
int insertIndex = sortedSize;
//遍历已经排好序的数组,找到比待插入元素大的位置
for (int j = 0... |
38958995_5 | ; |
39005675_10 | @Override
public void copyFrom(FloatBag from) {
copyFrom(from, true);
} |
39006243_14 | @RequestMapping(value = "/customers/create", method = RequestMethod.GET)
public String showCreateCustomerFormPage(ModelMap modelMap) {
modelMap.addAttribute("createCustomerForm", new Customer());
logger.info("Accessed Create Customer page");
logger.debug("Retrieved createCustomerForm");
return "customers/customers-... |
39013067_1 | public Calendar ceil(Calendar cal) {
if (contains(cal))
return cal;
Calendar cal2 = new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE));
if (!containsDayOfWeek(cal2))
do
cal2.add(Calendar.DAY_OF_WEEK, 1);
while (!containsDayOfWe... |
39063523_96 | public Observable<Object> doInventory(final String sign) {
return Observable.create(subscriber -> {
try {
List<StockMovementItem> newestEachMovementItems = movementRepository.queryEachStockCardNewestMovement();
Date now = new Date();
for (InventoryViewModel viewModel : in... |
39075884_0 | public static <T,R,C,V> Collector<T, ?, Table<R, C, V>> toTable(
Function<? super T, ? extends R> rowMapper,
Function<? super T, ? extends C> columnMapper,
Function<? super T, ? extends V> valueMapper) {
return toTable(rowMapper, columnMapper, valueMapper, throwingMerger());
} |
39091281_17 | @NonNull
@CheckReturnValue
public static <T> Single<T> dataOf(
@NonNull DatabaseReference ref, @NonNull Class<T> clazz) {
return data(ref).compose(new SingleTransformerOfClazz<>(clazz));
} |
39092083_1119 | @Override
public PriceModel getCartShippingTotal(final ShoppingCart cart) {
final String currency = cart.getCurrencyCode();
final BigDecimal deliveriesCount = new BigDecimal(cart.getShippingList().size());
final BigDecimal list = cart.getTotal().getDeliveryListCost();
final BigDecimal sale = cart.getT... |
39158944_4 | @Override
public NavigationPageItem getFooterNavigation() {
Page footerNavRoot = siteRoot.getRelativePage(FOOTERNAV_RELATIVE_PATH);
if (footerNavRoot != null) {
return getFooterNavigationSpecific(footerNavRoot);
}
else {
Page siteRootPage = siteRoot.getRootPage();
if (siteRootPage == null) {
s... |
39160554_85 | public @Nullable String getInclude() {
return include;
} |
39161492_0 | public Greeting greet(String salutation, String name) {
Assert.notNull(salutation, "salutation is required");
Assert.notNull(name, "name is required");
return rest.getForObject(URI_TEMPLATE, Greeting.class, salutation, name);
} |
39175817_2 | @NotNull
@Override
protected Map<String, String> getEnvVars(@NotNull Map<String, String> runConfigEnv, @NotNull String path) throws EnvFileErrorException {
Map<String, String> result = new LinkedHashMap<>();
try {
List<String> lines = Files.readAllLines(Paths.get(path), StandardCharsets.UTF_8);
... |
39183519_16 | public void disableBlurredLayers() {
blurBackground.setVisibility(View.GONE);
orginalBackground.setVisibility(View.GONE);
} |
39195736_55 | @VisibleForTesting
void setStartingCommentToken(String startingCommentToken) {
this.startingCommentToken = startingCommentToken;
} |
39197120_0 | static OMText getBinaryNode(OMElement document) {
Iterator<OMNode> childrenIterator = document.getChildren();
while (childrenIterator.hasNext())
{
OMNode container = childrenIterator.next();
if (container instanceof OMText && StringUtils.isNotBlank(((OMText)container).getText()))
{
return (OMText)container;... |
39198986_1 | public String getArgs(String agentId) {
return arguments.getProperty(agentId);
} |
39229420_6 | public static LongRange getIntersection(final LongRange range1, final LongRange range2) {
if (!range1.overlapsRange(range2)) {
return null;
} else {
// The intersection is the [larger min, smaller max].
final long min1 = range1.getMinimumLong();
final long max1 = range1.getMaximumLong();
final l... |
39244945_2 | public static void main(String[] args) {
System.out.println("Hello Subproject2!");
} |
39255205_0 | @Override
public void onClick(final View view) {
informHeaderListeners();
} |
39269291_1 | public static PushReport mapFromImportSummaryToPushReport(ImportSummary importSummary,
String importSummaryKey) {
PushReport pushReport = new PushReport();
List<PushConflict> conflictList = new ArrayList<>();
if (importSummary.getConflicts() != null) {
for (Conflict conflict : importSummary.... |
39285768_16 | void retrieveViewTableUsage() throws SQLException {
final InformationSchemaViews informationSchemaViews =
getRetrieverConnection().getInformationSchemaViews();
if (!informationSchemaViews.hasQuery(VIEW_TABLE_USAGE)) {
LOGGER.log(
Level.INFO, "Not retrieving additional view table usage, since this... |
39314095_2 | public Path calculatePathForNode(SimpleNode node, List<SimpleNode> simpleNodes) {
List<SimpleNode> parents = findParentsForNode(node, simpleNodes);
String path = "";
for (SimpleNode p : parents) {
String label = p.getLabel();
label = label.replaceAll("\\.", "\\/");
if (p.getType() ==... |
39342898_17 | public void clearGroup(K groupKey) {
Array<T> list = map.get(groupKey);
if (list != null) {
list.clear();
}
} |
39376231_5 | public static Date getTime(Date datetime) {
Date time = new Date(0);
time.setHours(datetime.getHours());
time.setMinutes(datetime.getMinutes());
time.setSeconds(datetime.getSeconds());
return time;
} |
39385621_3 | @Nonnull
@CheckReturnValue
public static <T, R> LifecycleTransformer<T> bindUntilEvent(@Nonnull final Observable<R> lifecycle,
@Nonnull final R event) {
checkNotNull(lifecycle, "lifecycle == null");
checkNotNull(event, "event == null");
return bind... |
39392321_43 | @SuppressWarnings("unchecked")
public static <T extends Type> Expr<T> simplify(final Expr<T> expr, final Valuation valuation) {
return (Expr<T>) TABLE.dispatch(expr, valuation);
} |
39411151_22 | @Override
public Collection<String> propertyNames() {
return getProperties().keySet();
} |
39412278_6 | public static String build(String id, String... additionalIds) {
return build(id, '-', additionalIds);
} |
39427174_36 | public void queryRefundStatusAsync(final BCReqParams.BCChannelTypes channel, final String refundNum,
final BCCallback callback) {
if (callback == null) {
Log.w(TAG, "请初始化callback");
return;
}
BCCache.executorService.execute(new Runnable() {
@Overri... |
39477878_2 | public static String escapeHtml(String input) {
// Avoid building a new string in the majority of cases (nothing to escape)
StringBuilder sb = null;
loop:
for (int i = 0; i < input.length(); i++) {
char c = input.charAt(i);
String replacement;
switch (c) {
case '&':
... |
39513536_41 | public static Constraint complexMembers()
{
return new PathConstraint("Complex/component*");
} |
39525650_3 | public static String get(Bundle bundle) {
return bundle.getHeaders().get(HEADER_APPLICATON_PATH);
} |
39526634_1 | public static EBarElementFilled[] calculateBarFill(final int numberOfParts, final float percentFilled) {
if (numberOfParts < 1) {
return null;
}
final EBarElementFilled[] fills = new EBarElementFilled[numberOfParts];
// how much should be in a part for it to be considered full?
final float filled100PercentPerPar... |
39530768_124 | @Override
public void handleCondition(Operation operation) {
synchronized (mutex) {
String name = operation.getOperationId().getValue();
Timer timer = new Timer("name");
ConditionMonitor conditionMonitor = new ConditionMonitor(intentResolver,userId,operation.getConditionSegment());
t... |
39570183_1 | public static String extractDirectory(String jvmOptions) {
if (jvmOptions == null || jvmOptions.trim().length() == 0) { return null; }
if (jvmOptions.indexOf(CLOUDUNIT_SHARED_DIR) == -1) { return null; }
// we get cloudunit.shared=...
String subStringFromStart = jvmOptions.substring(jvmOptions.indexOf(C... |
39583456_2 | String getBackupGuide() {
return "None available! Your backup guide is: Cookie";
} |
39676740_41 | public List<SvgPath> parseQRCodeMatrix(QRCode qrcode) {
Objects.requireNonNull(qrcode);
List<SvgPath> paths = Lists.newArrayList();
//We read line by line
for (int y = 0; y < qrcode.getMatrix().getHeight(); y++) {
//We read the point from the left to the right
for (int x = 0; x < qrcod... |
39683376_0 | @Scheduled(cron = "0 0 0 * * ?")
public void removeOldPersistentTokens() {
LocalDate now = new LocalDate();
persistentTokenRepository.findByTokenDateBefore(now.minusMonths(1)).stream().forEach(token ->{
log.debug("Deleting token {}", token.getSeries());
User user = token.getUser();
user.... |
39694047_5 | @Cacheable("github.commits")
public List<Commit> getRecentCommits(String organization, String project) {
ResponseEntity<Commit[]> response = doGetRecentCommit(organization, project);
return Arrays.asList(response.getBody());
} |
39705783_1 | public ThrowableProblem build() {
return new DefaultProblem(type, title, status, detail, instance, cause, new LinkedHashMap<>(parameters));
} |
39726618_3 | public static final void save(File file, Component c) {
save(file, c, c.getWidth(), c.getHeight());
} |
39727052_0 | public ListMatrix<ListMatrix<MapMatrix<String, Object>>> tag(String text) throws Exception {
ListMatrix<ListMatrix<MapMatrix<String, Object>>> sentenceList = new DefaultListMatrix<ListMatrix<MapMatrix<String, Object>>>();
Annotation document = new Annotation(text);
stanfordCoreNLP.annotate(document);
... |
39748950_1 | @Async("customFixedThreadPool")
public void async1() {
log.info("hi,springboot async,"
+Thread.currentThread().getName());
} |
39764417_15 | public @Nullable Connection get(@NotNull Channel channel) {
Peer peer = peers.get(channel.remoteAddress());
return peer == null ? null : peer.getConnection(channel.id());
} |
39770930_15 | public static String getFullSessionId(String uri) {
String tail = uri.substring(WD_HUB_SESSION.length());
int end = tail.indexOf('/');
if (end < 0) {
return tail;
}
return tail.substring(0, end);
} |
39772980_4 | public static IValidationResult ok() {
return OK;
} |
39793957_7 | protected static CharSequence format(long durationInSecondsSinceLoopStart, int count, int total, long durationLoopingStart, long countLoopingStart) {
StringBuilder result = new StringBuilder();
result.append(count).append("/").append(total);
if ((count > countLoopingStart) && (durationInSecondsSinceLoopSt... |
39800375_12 | public List<ZKAddress> validateZkUrl(final String zkUrl) {
final List<ZKAddress> zkList = new ArrayList<>();
// Ensure that string is prefixed with "zk://"
Matcher matcher = Pattern.compile(ZK_PREFIX_REGEX).matcher(zkUrl);
if (!matcher.matches()) {
throw new ZKAddressException(zkUrl);
}
... |
39875602_1 | protected static void quarterRound(int[] x, int a, int b, int c, int d) {
x[a] += x[b];
x[d] = ROTATE(x[d] ^ x[a], 16);
x[c] += x[d];
x[b] = ROTATE(x[b] ^ x[c], 12);
x[a] += x[b];
x[d] = ROTATE(x[d] ^ x[a], 8);
x[c] += x[d];
x[b] = ROTATE(x[b] ^ x[c], 7);
} |
39886553_0 | public static List<Integer> subtractWithDefaultLambda(List<Integer> list1, final List<Integer> list2) {
return list1.stream().filter(i -> !list2.contains(i)).collect(Collectors.toList());
} |
39894970_0 | @Override
public OutputInteraction createOutputInteraction()
throws ConnectorException {
return new SplunkLogOutputInteraction();
} |
39905749_2 | @Override
public Observable<Boolean> remove(String key) {
return underlyingCache.remove(key);
} |
39922362_104 | public double stddev() {
return Math.sqrt(variance());
} |
39924219_1 | public static double getSRM(double inEBC) {
return (int) Math.round(inEBC / SRM);
} |
39970786_0 | public void add(final Callback<Boolean> callback, final Todo todo) {
todoMap.put(todo.getId(), todo);
callback.resolve(true);
} |
39997974_2 | public Mono<String> fetchArticle(String articleName) {
return cache.lookup(articleName);
} |
40029062_1593 | @Override
public void afterMove(final List<Map<String, String>> components, final Repository destination) {
destination.facet(StorageFacet.class).txSupplier();
UnitOfWork.begin(destination.facet(StorageFacet.class).txSupplier());
try {
AptHostedFacet hostedFacet = destination.facet(AptHostedFacet.class);
... |
40049579_18 | @Override
public Result addCar(Car car) {
Preconditions.checkNotNull(car, "car should not be null");
Result result = FluentValidator.checkAll().failOver()
.on(car.getManufacturer(), new CarManufacturerValidator())
.on(car.getSeatCount(), new CarSeatCountValidator())
.on(car.g... |
40055799_111 | @Override
public String hash(String plaintext) {
return plaintext;
} |
40056997_27 | @Override
public HashType unmarshal(String str) throws Exception {
return HashType.valueOf(str.toUpperCase());
} |
40073915_5 | public Iterator<Scanned> iterator () {
if(scanFiles == null){
scanFiles = new LinkedList<Scanned>();
walkFiles(scanFiles, newDir);
}
return scanFiles.iterator();
} |
40111808_37 | public Set<String> keySet() {
return inner.keySet();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.