id stringlengths 7 14 | text stringlengths 1 37.2k |
|---|---|
45986064_19 | public static void evaluateOverlap(AnnotationFS gold, AnnotationFS sys,
RecognitionMeasures measures) {
if (gold.getEnd() <= sys.getBegin() || sys.getEnd() <= gold.getBegin()) {
throw new IllegalArgumentException(String.format(
"Annotations %s and %s do not... |
45997449_24 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
ResourceArgumentsUrn other = (ResourceArgumentsUrn) obj;
if (m_argument == null) {
if (other.m_argument != null)
... |
46000465_198 | SceneUpdate getApiKeyUpdate(String apiKey) {
return new SceneUpdate(STYLE_GLOBAL_VAR_API_KEY, apiKey);
} |
46007735_2 | public static boolean isEmpty(String string) {
return string == null || string.length() == 0;
} |
46035308_5 | public void startProximityDetection(ProximityListener proximityListener) {
startLibrarySensorDetection(new ProximityDetector(proximityListener), proximityListener);
} |
46045563_14 | public T reduce(BinaryOperator<T> f) {
return Iterators.reduce(this, f);
} |
46057717_11 | @Override
public boolean verify(CodeChallenge codeChallenge, String providedCodeVerifier) {
try {
//no code verifier was provided and no code challenge was saved so this is a normal OAuth2 code flow
if (providedCodeVerifier.isEmpty() && !codeChallenge.isProvided()) {
return true;
}
//there is a ... |
46072671_0 | public static Executable parse(String command) {
Objects.requireNonNull(command);
command = command.trim().replaceAll(" +", " ");
String[] commands = command.split(" ");
return parse(commands);
} |
46113606_80 | @Override
public boolean evaluate() {
if (!TextUtils.isEmpty(mType) && mType.equals(AppConstants.CUSTOM_SEGMENT)) {
return CustomSegmentEvaluateEnum.getEvaluator(mType, mSegmentOperator).evaluate(vwo, mOperandValue, lOperandValue);
}
return CustomSegmentEvaluateEnum.getEvaluator(mType, mSegmentOpera... |
46121851_23 | public @Nullable CommandChain visitProcess(MplProgram program, MplProcess process) {
if (process.getType() == INLINE) {
return null;
}
List<ChainPart> chainParts = new CopyScope().copy(process.getChainParts());
List<ChainLink> result = new ArrayList<>(chainParts.size());
boolean containsSkip = containsHig... |
46130071_18 | @Override
protected void doStart() throws Exception {
super.doStart();
executor = endpoint.getCamelContext().getExecutorServiceManager().newFixedThreadPool(this, endpoint.getEndpointUri(), 1);
listener = new Listener(endpoint, processor, socketFactory, contextFactory);
executor.submit(listener);
} |
46181665_20 | protected Namer getOneToManyNamerFromConf(OneToManyConfig o2m, Namer fromEntityNamer) {
if (o2m != null) {
if (o2m.hasElementVar() && !o2m.hasVar()) {
// the plural is calculated
return new AccessorNamer(fromEntityNamer, o2m.getElementVar());
}
if (o2m.hasElementVar... |
46187719_395 | public BorderRightWidth() {
setCssValue(MEDIUM);
} |
46204890_4 | public static AutomatorAction clearTextField() {
return new AutomatorAction() {
@Override
public void wrappedPerform(UiSelector selector, UiObject object) throws UiObjectNotFoundException {
object.clearTextField();
}
};
} |
46223235_0 | String encrypt(String randomStr, String text) throws AesException {
ByteGroup byteCollector = new ByteGroup();
byte[] randomStrBytes = randomStr.getBytes(CHARSET);
byte[] textBytes = text.getBytes(CHARSET);
byte[] networkBytesOrder = getNetworkBytesOrder(textBytes.length);
byte[] appidBytes = appId.getBytes(CHARSE... |
46251204_49 | public CredentialResolver build() throws IOException, GeneralSecurityException {
final KeyStore ks = KeyStore.getInstance(type);
try (InputStream is = open()) {
ks.load(is, password != null ? password.toCharArray() : null);
}
return new KeyStoreCredentialResolver(ks, keyPasswords);
} |
46256078_4 | public static void copyProperties(Object from, Object to) throws Exception {
copyPropertiesExclude(from, to, null);
} |
46297234_1 | public <C, V extends Node> FxControllerAndView<C, V> load(Class<C> controllerClass) {
return load(controllerClass, null);
} |
46308509_1 | public static void runSemanticAnalysis(AST ast) {
new SemanticAnalysis(ast).run();
Pass.printErrorsAndWarnings();
if (generatedSourceDirectory != null) {
if (AST.globalSymbolTable.getPackage().length() != 0)
generatedSourceDirectory +=
File.separator
... |
46324355_1 | public LiveData<RemoteResource<List<MoodleAssignmentCourse>>> getAssignmentCourses() {
if (filteredAssignmentCourses == null || filteredAssignmentCourses.getValue() == null
|| filteredAssignmentCourses.getValue().data == null) {
filteredAssignmentCourses = new MediatorLiveData<>();
filte... |
46344493_3 | public static List<Token> tokenize(final String input) {
return tokenize(input, GQLSourceInput.emptySource());
} |
46348026_2 | void checkPermission(PermissionListener listener, String permission, Thread thread) {
checkSinglePermission(listener, permission, thread);
} |
46368934_70 | public Config config() {
if (rollbar != null) {
return rollbar.config();
} else {
return null;
}
} |
46398595_6 | public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException
{
if(this.useRandomConnection)
{
throw new TargetDataSourceNotFoundException("setNetworkTimeout error,"+this.getTargetDataSourceNotFoundExceptionErrorMsg());
}
JdbcMethodUtils.invokeJdbcMethod(Connection.class,"setNetworkTimeo... |
46404009_117 | public HBaseAuditLogObject parse(String logLine) {
if(logLine == null || logLine.isEmpty()) return null;
HBaseAuditLogObject ret = new HBaseAuditLogObject();
String timestamp = "";
String user = "";
String scope = "";
String action = "";
String ip = "";
String request = "";
String f... |
46407295_1 | void initCalc(DynamicFactorModel dfm0, TsInformationSet data) {
this.dfm = dfm0;
this.data = data;
// dfm.getInitialization();
nobs = data.getCurrentDomain().getLength();
L = new Likelihood();
oldL = null;
conv = false;
maxiter = 30;
eps = 1e-6... |
46413020_56 | @Override
public URL getObject() {
final String object = model.getObject();
if (object == null) {
return null;
} else {
try {
if (URL_PATTERN.matcher(object).matches()) {
return new URL(object);
} else {
return new File(object).toURI().... |
46414758_1 | ; |
46427562_3 | @Override
public AvroData fromBytes(byte[] bytes) {
GenericRecord data;
try {
data = reader.read(null, DecoderFactory.get().binaryDecoder(bytes, null));
return getAvroData(data, avroSchema);
} catch (IOException e) {
String errMsg = "Cannot decode message.";
log.error(errMsg, e);
throw new Sa... |
46449357_47 | @NonNull
protected Activity getActivity() {
Context context = getContext();
while (!(context instanceof Activity) && context instanceof ContextWrapper) {
context = ((ContextWrapper) context).getBaseContext();
}
if (context instanceof Activity) {
return (Activity) context;
}
thr... |
46450575_19 | public static <T> Result<T> runTask(Task<T> task, Config config) {
return new Result<>(new FloRunner<T>(config).run(task), loadTerminationHooks(config));
} |
46457181_2 | @Override public Observable<UserDemoEntity> react() {
return repository.getSelectedUserDemoList();
} |
46464011_19 | public static Method findDestroyMethod(Class<?> targetBeanType, BindInfo<?> bindInfo) {
Method destroyMethod = null;
//a.注解形式(注解优先)
if (targetBeanType != null) {
List<Method> methodList = BeanUtils.findALLMethods(targetBeanType);
if (methodList != null) {
for (Method method : met... |
46504855_0 | @Override
public Set<ServiceInstance> listServiceInstances(Fqdn browsingDomain, CompoundLabel type, boolean secValidation)
throws LookupException, ConfigurationException
{
try {
ValidatorUtil.isValidDomainName(browsingDomain);
} catch(IllegalArgumentException exception) {
throw new Looku... |
46506858_32 | String generateHash(String timestamp, String publicKey, String privateKey)
throws MarvelApiException {
try {
String value = timestamp + privateKey + publicKey;
MessageDigest md5Encoder = MessageDigest.getInstance("MD5");
byte[] md5Bytes = md5Encoder.digest(value.getBytes());
StringBuilder md5 = n... |
46527824_9 | public <T> ObservableTransformer<? super T, T> transform(Observer<? super T> observer,
String observableTag) {
return new GroupSubscriptionTransformer<>(this, Utils.getObserverTag(observer),
observableTag);
} |
46547901_35 | @Override
public Feature getRoomByLocation(String appIdentifier, Double longitude, Double latitude, Integer floor) throws RoomNotFoundException {
// TODO Auto-generated method stub
List<Feature> featureRooms = mapRepository.searchByLocation(appIdentifier,longitude,latitude,floor);
List<SimplePolygon2D> simplePolyg... |
46555171_15 | @Override public V addOrUpdate(V value) throws Exception {
return addOrUpdate(value, WritePolicy.WRITE_ALL);
} |
46569013_6 | public boolean isPrime() {
return isPrimeInternal(this.value);
} |
46573609_80 | @ApiOperation(value = "Returns a release entity for the given project id. "
+ "The project id is read from planning.budget.projectID")
@RequestMapping(value = "/api/ocds/release/budgetProjectId/{projectId:^[a-zA-Z0-9]*$}",
method = { RequestMethod.POST, RequestMethod.GET },
produces = "applicati... |
46615164_4 | @Override
public void setNewBookNotificationSubscriptionStatus(final boolean onOff) {
checkViewAttached();
analytics.trackUserToggleNewBookNotifications(onOff);
settings.setNewBookNotificationStatus(onOff).subscribe(new Observer<Boolean>() {
@Override
public void onCompleted() {
}
... |
46621580_3 | public boolean isTracked(UUID uniqueId) {
return cooldowns.getIfPresent(uniqueId) != null;
} |
46654747_0 | public String getClassName() {
return className;
} |
46697033_1 | @Override
public Scanner update(Scanner scanner) {
return scannerDAO.saveAndFlush(scanner);
} |
46709421_0 | public static int treeCount() {
synchronized (FOREST) {
return FOREST.size();
}
} |
46713982_6 | @Override
public Options resolve(final String key, final JoinPoint joinPoint) throws OptionsException {
// find most specific @RateLimited annotation for invoked join point
final RateLimited rateLimited = findAnnotation(joinPoint, RateLimited.class);
if (rateLimited == null) {
// this should never happen
... |
46714751_4 | public final int getViewCount() {
return viewHolders.size();
} |
46727828_105 | void addFieldByType(XContentBuilder source,
String key,
String value,
Map<String, String> fieldTypeMapping) throws IOException, ParseException {
String fieldType = fieldTypeMapping.get(FIELD_TYPE);
if (equalsIgnoreCase(fieldType, "array")) {
Gson gson... |
46776191_4 | @Override
public Map<String, Object> getLimits() {
if (!isConnected()) {
return null;
}
String baseUrl = null;
try {
baseUrl = sfdcSession.getEndPoint() + REST_ENDPOINT_URI + "/limits";
HttpGet get = new HttpGet(baseUrl);
Object responseObject = handleRequest(get);
... |
46795972_1 | public String getHybrisConsoleOutput(String json, ServerAnwserTypes type) {
if(type == ServerAnwserTypes.EXECUTION_RESULT) {
return returnFromJSON(json, "executionResult");
}
if(type == ServerAnwserTypes.OUTPUT_TEXT) {
return returnFromJSON(json, "outputText");
}
if(type== ServerAnws... |
46803767_16 | public static <T, V> Collection<V> collectIf(
Iterable<T> iterable,
Predicate<? super T> predicate,
Function<? super T, V> function)
{
return FJIterate.collectIf(iterable, predicate, function, false);
} |
46804199_121 | @Override
public List<String> getPrintEntries() {
List<String> printIntimacies = new ArrayList<>();
for (Intimacy intimacy : getModel().getEntries()) {
String text = getTextForIntimacy(intimacy);
printIntimacies.add(text);
}
return printIntimacies;
} |
46847195_57 | public List<Map<String, Object>> selectAll(String sql, Object... args) throws SQLException {
PreparedStatement ps = connection.prepareStatement(sql);
try {
setParameters(ps, args);
ResultSet rs = ps.executeQuery();
return getResults(rs);
} finally {
try {
ps.close();
} catch (SQLExceptio... |
46855060_6 | public void unregister(Object object) {
if (object == null) {
throw new NullPointerException("Object to unregister must not be null.");
}
enforcer.enforce(this);
Map<EventType, ProducerEvent> producersInListener = finder.findAllProducers(object);
for (Map.Entry<EventType, ProducerEvent> ent... |
46898785_44 | public ConfigBuilder setTreeshake(ConfigBuilder configBuilder, String value) {
configBuilder.treeShakerMode(Config.TreeShakerMode.valueOf(value));
return configBuilder;
} |
46900323_10 | public static long parseDuration(String text) {
// Given a string like 1w3d4h5m, we will return a millisecond duration
long result = 0;
int numIdx = 0;
for (int i = 0; i < text.length(); i++) {
char at = text.charAt(i);
if (at == 'd' || at == 'w' || at == 'm' || at == 'h') {
... |
46920047_10 | public void skipAttribute() throws IOException {
nextAttributeName();
skipAttributeValue();
} |
46931835_0 | @Override
public void apply(Project project) {
project.getExtensions().create(GAUGE, GaugeExtension.class);
project.getTasks().create(GAUGE, GaugeTask.class);
} |
46981783_17 | @NotNull
@Override
public String create(@NotNull final UserCredentials userCredentials) {
final StringBuilder sb = new StringBuilder();
final String user = userCredentials.getUser();
if(!StringUtil.isEmptyOrSpaces(user)) {
sb.append(USER_CMD_KEY);
sb.append(userCredentials.getUser());
}
if(userCrede... |
47021168_25 | @Override
public void initialize(View view) {
this.view = view;
view.showLoading();
loadFavoritas();
} |
47023603_0 | @RequestMapping("/add")
@ResponseBody
public ReturnT<String> add(XxlJobInfo jobInfo) {
return xxlJobService.add(jobInfo);
} |
47053872_6 | public static String timeMillisToHumanString() {
return timeMillisToHumanString(System.currentTimeMillis());
} |
47058190_1 | @Override
public String generateCentralWalletHash() throws BlockchainException {
try {
final org.bitcoinj.core.Wallet receiver = this.centralWallet();
String freshHash = null;
Transaction transaction = null;
do {
freshHash = this.getFreshHash(freshHash, receiver);
... |
47133978_25 | public static Float getSaturation(Color color) {
float[] hsbValues = new float[MAX_COMPONENT];
Float saturation;
Color.RGBtoHSB(color.getRed(), color.getGreen(), color.getBlue(), hsbValues);
saturation = hsbValues[SATURATION];
return saturation;
} |
47149635_3 | public static Collection<String> run(String chaosCommand, boolean random,
CubeDockerConfiguration cubeDockerConfiguration) {
String[] runningCommand = new String[8];
runningCommand[PUMBA_INDEX] = "pumba";
runningCommand[RUN_INDEX] = "run";
runningCommand[CHAOS_INDEX] = "--chaos";
if (random) {... |
47161280_2 | public void flatten(String json, Properties props) {
JsonNode jsonNode;
try {
jsonNode = new ObjectMapper().configure(JsonParser.Feature.ALLOW_COMMENTS, true).readTree(json);
addKeys("", jsonNode, props);
} catch (IOException e) {
String errMsg = "Invalid json format\n"+json;
... |
47184968_47 | public void doFilter(final ServletRequest request,
final ServletResponse response,
final FilterChain chain)
throws IOException, ServletException {
formsHandlingServletHelper.handleFilter(request, response, chain, EXTENSION, SELECTOR);
} |
47219036_277 | public Subtag getExtension() {
for (Subtag subtag : this) {
switch (subtag.getType()) {
case PRIMARY:
case EXTLANG:
case SCRIPT:
case REGION:
case VARIANT:
break;
case EXTENSION:
return subtag.getPrevious();
default:
return null;
}
}
return null;
} |
47246080_3 | @SuppressWarnings({ "unchecked", "rawtypes" })
public static void addLaunchAttributes(EntitySpec<?> entity, Map<?,?> attributesMap) {
entity.configure(SaltConfig.SALT_SSH_LAUNCH_ATTRIBUTES, MapModifications.add((Map)attributesMap));
} |
47246081_831 | public static Builder builder() {
return new Builder();
} |
47301462_84 | public int indexOf(int bit) {
for (int i = nextSetBit(0), k = 0;; i = nextSetBit(i + 1), ++k) {
if (i < 0) {
return -1;
}
if (i == bit) {
return k;
}
}
} |
47309610_0 | public void sayHello() {
System.out.print("Hello World");
} |
47311500_2 | public static byte[] SHAEncrypt(String data) {
return encryptEncode(ALGORITHM_SHA, data);
} |
47317834_77 | @NotNull
public CheckResult<DeploymentCompleteSpec> perform(UUID correlationId) {
final String octopusUrl = props.get(OCTOPUS_URL);
if (StringUtil.isEmptyOrSpaces(octopusUrl)) {
return DeploymentCompleteSpecCheckResult.createErrorResult(String.format("%s settings are invalid (empty url) in build configu... |
47345553_3 | @Override
public void testBlockEnd(TestBlock testBlock, List<TestBlock> parents) {
reporters.forEach(r -> r.testBlockEnd(testBlock, parents));
} |
47404616_3 | @Override
public void setValueAt(Object value, int row, int column) {
// Here, we will check the type of the incoming input:
// Because the input is always a string, if the user wants to input a number
// we first convert it to a Double (we only use Doubles).
// The same happens for the Boolean type:
// TODO... |
47405371_1 | @Override public void onAspectEventTriggered(TrackEvent trackEvent, Map<String, Object> attributes) {
trackEvent(new Event(trackEvent, attributes, superAttributes));
} |
47419635_10 | public AcmeLazyLoadingException(AcmeResource resource, AcmeException cause) {
this(requireNonNull(resource).getClass(), requireNonNull(resource).getLocation(), cause);
} |
47428395_15 | public final StringSubstitutionException extend(String field) {
return extend(field, false);
} |
47442408_8 | public boolean getBackButtonNavigatesPages() {
return builder.backButtonNavigatesPages;
} |
47489502_6 | @Override
public void setView(MoviesListingView view) {
this.view = view;
displayMovies();
} |
47492058_4 | static Collection<Graph> buildGraphs(Map<String, Module> modules) throws ProcessorException {
LinkedList<Graph> graphs = new LinkedList<>();
for (Module module : modules.values()) {
if (module.isCompleted) {
Graph graph = buildGraph(modules, module);
validateGraph(graph);
graphs.add(graph);
}
}
return ... |
47502698_12 | public String getEncrypted() {
if (!isSuccess()) {
throw new IllegalAccessError("Fingerprint authentication was not successful, cannot access encryption result");
}
return encrypted;
} |
47536480_11 | public static UnSetCommand parse(String commandString, ExecutionContext sessionContext)
throws ODPSConsoleException {
if (StringUtils.isNullOrEmpty(commandString)) {
return null;
}
String[] tokens = new AntlrObject(commandString).getTokenStringArray();
if (tokens.length != 2) {
return null;
}
... |
47580276_135 | public static <N extends Number> Matcher<N> infinity() {
return IsInfinity.infinity();
} |
47582051_0 | protected void loadProperties() {
PropertyLoader.loadProperties(Property.class, "default.properties", "dumonitor.properties");
try {
proxyServer = URI.create(Property.QUERY_TURVASERVER_URL.getValue());
} catch (IllegalArgumentException e) {
ExceptionUtil.uncheck("Invalid security server URL", e);
}
} |
47585751_4 | public ZapReport parse(InputStream inputStream) {
SMInputFactory inputFactory = ZapUtils.newStaxParser();
try {
SMHierarchicCursor rootC = inputFactory.rootElementCursor(inputStream);
SMInputCursor owaspZapReportCursor = rootC.advance(); // <OWASPZAPReport>
String gererated = owaspZapReportCursor.getA... |
47607561_359 | @Override
public TopologyResponse activateTopology(String name) {
TopologyResponse topologyResponse = new TopologyResponse();
String id = getTopologyId(name);
if (id != null) {
Map result = restTemplate
.postForObject(getStormUiProperty() + TOPOLOGY_URL + "/" + id + "/activate", null,
Map.... |
47613863_6 | public static void visitProbes(final int classId, final int offset,
final boolean[] probes) { // NO_UCD
final boolean[] bs = CLASS_HITS.get(classId);
bs[CLASS_HIT_INDEX] = true;
for (int i = 0; i != probes.length; i++) {
if (probes[i]) {
bs[i + offset + 1] = true;
}
}
} |
47708092_17 | public void createProject(ProjectModel model) throws NameTakenException, RepositoryUnavailableException, RepositoryParsingException {
validateIfNameAvailable(model.getNamespace(), model.getName());
Namespace namespace = namespaceDao.findByName(model.getNamespace()).get();
Project project = new Project.Build... |
47718426_9 | public static void sendWakeOnLan(String ipStr, String macStr) throws IllegalArgumentException, IOException {
sendWakeOnLan(ipStr, macStr, DEFAULT_PORT, DEFAULT_TIMEOUT_MILLIS, DEFAULT_NO_PACKETS);
} |
47723400_14 | public void resetTo(Screen screen) {
if (tryHandleEmptyBackstack(screen)) {
return;
}
resetTo(screen, TransitionDirection.EXIT);
} |
47767967_0 | static Class<?> mainClass() {
for (Map.Entry<Thread, StackTraceElement[]> stackEntry : Thread.getAllStackTraces().entrySet()) {
// thread must be called "main"
if ("main".equals(stackEntry.getKey().getName())) {
StackTraceElement[] stack = stackEntry.getValue();
StackTrace... |
47773974_1 | public static List<DailyTotalCost> convertCostsToDailyCosts(List<Cost> costList) {
List<DailyTotalCost> result = new ArrayList<>();
if (costList == null || costList.size() == 0) {
// return an empty array if we have nothing to convert
return result;
}
// declare and initialize data va... |
47790264_0 | public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
logger.debug("Post process bean factory has been called");
findJaxrsApplications(beanFactory);
// This is done by finding their related Spring beans
findJaxrsResourcesAndProviderClasses(beanFactory)... |
47810463_2 | @Override
public void onJobStarted(String jobName, Map<String, Object> parameters, Consumer<Consumer<JobResult>> finishEventSource) {
JobMetrics metric = getOrCreateMetrics(jobName);
metric.getActiveCounter().inc();
Timer.Context requestTimerContext = metric.getTimer().time();
LOGGER.info("started jo... |
47840491_1 | @Override
public FootwearIndustryReports call() throws Exception {
final FootwearIndustryReports reports = new FootwearIndustryReports();
final FlatFileItemReader<FootwearIndustryReports> items = FootwearIndustryReportParserMapper.newItemReader(
firReportCsv, reports);
try {
items.open(n... |
47850278_13 | @GetMapping(value = "{customerId}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Customer> getCustomer(@PathVariable("customerId") @NotBlank Long customerId)
throws EntityNotFoundException {
log.info("Fetching Customer with id {}", customerId);
final Customer user = this.customerService.getCus... |
47873486_28 | public static <T extends Serializable> T getExtraSerializable(final Intent intent, final String key, final T defaultValue) {
//noinspection unchecked
final T extra = (T) intent.getSerializableExtra(key);
return extra != null ? extra : defaultValue;
} |
47885608_0 | @RequestMapping("/")
public String sayHello() {
return "Hello,World!";
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.