repo_name stringlengths 7 104 | file_path stringlengths 11 238 | context list | import_statement stringlengths 103 6.85k | code stringlengths 60 38.4k | next_line stringlengths 10 824 | gold_snippet_index int32 0 8 |
|---|---|---|---|---|---|---|
krasa/EclipseCodeFormatter | src/java/krasa/formatter/plugin/EclipseCodeStyleManager.java | [
"public class JavaCodeFormatterFacade extends CodeFormatterFacade {\n\n\tprivate static final Logger LOG = Logger.getInstance(JavaCodeFormatterFacade.class.getName());\n\n\tprivate final Settings settings;\n\tprivate Project project;\n\n\tprotected EclipseFormatterAdapter codeFormatter;\n\n\tprivate LanguageLevel e... | import java.util.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com... | package krasa.formatter.plugin;
public class EclipseCodeStyleManager {
private final Logger LOG = Logger.getInstance(this.getClass().getName());
@NotNull
protected final CodeStyleManager original;
@NotNull
protected volatile Settings settings;
@NotNull
protected Notifier notifier;
@Nullable
private vola... | Notification notification = ProjectComponent.GROUP_DISPLAY_ID_ERROR.createNotification( | 3 |
growbit/turbogwt-http | src/test/java/org/turbogwt/net/http/client/MultipleSerdesByClassTest.java | [
"public class Book {\n\n private final Integer id;\n private String title;\n private String author;\n\n public Book(Integer id, String title, String author) {\n this.id = id;\n this.title = title;\n this.author = author;\n }\n\n public Integer getId() {\n return id;\n ... | import org.turbogwt.net.http.client.mock.ServerStub;
import org.turbogwt.net.serialization.client.Serdes;
import com.google.gwt.core.client.GWT;
import com.google.gwt.junit.client.GWTTestCase;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.turbogwt.core.future.shared.DoneCall... | /*
* Copyright 2014 Grow Bit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | final Serdes<Book> jsonSerdes = new BookJsonSerdes(); | 6 |
davidmoten/rxjava2-jdbc | rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/callable/internal/Getter2.java | [
"public static final class CallableResultSets2Builder<T1, T2> implements Getter3<T1, T2> {\n\n private final CallableBuilder b;\n private final Function<? super ResultSet, ? extends T1> f1;\n private final Function<? super ResultSet, ? extends T2> f2;\n\n CallableResultSets2Builder(CallableBuilder b, Fu... | import java.sql.ResultSet;
import javax.annotation.Nonnull;
import org.davidmoten.rx.jdbc.CallableBuilder.CallableResultSets2Builder;
import org.davidmoten.rx.jdbc.Util;
import org.davidmoten.rx.jdbc.tuple.Tuple2;
import org.davidmoten.rx.jdbc.tuple.Tuple3;
import org.davidmoten.rx.jdbc.tuple.Tuple4;
import org.davidmo... | package org.davidmoten.rx.jdbc.callable.internal;
public interface Getter2<T1> {
<T2> CallableResultSets2Builder<T1, T2> get(Function<? super ResultSet, ? extends T2> function);
default <T2> CallableResultSets2Builder<T1, T2> getAs(@Nonnull Class<T2> cls) {
Preconditions.checkNotNull(cls, "cls c... | return get(rs -> Util.mapObject(rs, cls, 1)); | 1 |
Karumi/Dexter | sample/src/androidTest/java/com/karumi/dexter/sample/DexterTest.java | [
"public final class Dexter\n implements DexterBuilder, DexterBuilder.Permission, DexterBuilder.SinglePermissionListener,\n DexterBuilder.MultiPermissionListener {\n\n private static DexterInstance instance;\n\n private Collection<String> permissions;\n private MultiplePermissionsListener listener = new Bas... | import android.Manifest;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
import androidx.test.rule.ActivityTestRule;
import androidx.test.rule.GrantPermissionRule;
import com.karumi.dexter.Dexter;
import com.karumi.dexter.DexterBuilder;
import com.karumi.dexter.listener.PermissionDe... | package com.karumi.dexter.sample;
public class DexterTest {
private static final String TAG = "DexterTest";
private final AtomicBoolean unblock = new AtomicBoolean(false);
private final PermissionListener permissionListener = new BasePermissionListener() { | @Override public void onPermissionGranted(PermissionGrantedResponse response) { | 3 |
Catalysts/cat-boot | cat-boot-report-pdf/src/test/java/cc/catalysts/boot/report/pdf/impl/TablePaddingTest.java | [
"public class PdfReport implements AutoCloseable {\n private static final Logger LOG = getLogger(PdfReport.class);\n\n private final String fileName;\n private final DocumentWithResources documentWithResources;\n\n public PdfReport(String fileName, DocumentWithResources documentWithResources) {\n ... | import cc.catalysts.boot.report.pdf.PdfReport;
import cc.catalysts.boot.report.pdf.PdfReportService;
import cc.catalysts.boot.report.pdf.config.DefaultPdfStyleSheet;
import cc.catalysts.boot.report.pdf.config.PdfFont;
import cc.catalysts.boot.report.pdf.config.PdfPageLayout;
import cc.catalysts.boot.report.pdf.config.P... | package cc.catalysts.boot.report.pdf.impl;
/**
* Created by sfarcas on 7/21/2016.
*/
public class TablePaddingTest {
private static final Logger LOG = getLogger(TablePaddingTest.class);
public static final int IMAGE_SIZE_TOO_BIG_FOR_CELL = 1000;
public static final int IMAGE_SIZE_SMALL = 50;
priv... | styleSheet.setBodyText(new PdfTextStyle(10, PdfFont.HELVETICA, BLACK, "regular")); | 5 |
pac4j/jax-rs-pac4j | jersey225/src/test/java/org/pac4j/jax/rs/rules/JerseyInMemoryRule.java | [
"public class JaxRsConfigProvider implements ContextResolver<Config> {\n\n private final Config config;\n\n public JaxRsConfigProvider(Config config) {\n this.config = config;\n }\n \n @Override\n public Config getContext(Class<?> type) {\n return config;\n }\n\n}",
"public clas... | import java.util.Set;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.DeploymentContext;
import org.glassfish.jersey.test.inmemory.InMemoryTestContainerFactory;
import org.glassfish.jersey.test.spi.TestContainerFactory;
import org.mockito.Mockito;
import org.pac4j.core.config.Config;... | package org.pac4j.jax.rs.rules;
public class JerseyInMemoryRule extends JerseyRule {
@Override
public Set<Class<?>> getResources() {
Set<Class<?>> resources = super.getResources();
resources.add(JerseyResource.class);
return resources;
}
@Override
protected TestContainer... | .register(new Pac4JValueFactoryProvider.Binder()) | 3 |
liuhangyang/StormMQ | src/main/java/com/ystruct.middleware/stormmq/broker/netty/ProducerMessageListener.java | [
"public class LogTask {\n private SendTask task;\n /**\n * status: 0代表message 已经被接收到了\n * status: 1代表消息已经成功的发送给了客户端\n */\n private int status;\n\n public LogTask(SendTask task,int status){\n this.task = task;\n this.status = status;\n }\n\n public SendTask getTask() {\n ... | import broker.*;
import com.sun.javafx.tk.Toolkit;
import file.LogTask;
import io.netty.channel.Channel;
import model.SendTask;
import smq.Message;
import smq.SendResult;
import smq.SendStatus;
import tool.MemoryTool;
import tool.Tool;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; | package broker.netty;
/**
* Created by yang on 16-11-24.
*/
//broker收到producer的消息的时候的监听类
public class ProducerMessageListener extends MessageListener {
@Override
void onProducerMessageReceived(Message msg, String requestId, Channel channel) {
//把一个请求对应的requestId对应的channel放入队列.
AckManager.... | ack.setStatus(SendStatus.SUCCESS); | 4 |
einsteinsci/betterbeginnings | src/main/java/net/einsteinsci/betterbeginnings/config/json/SmelterConfig.java | [
"public class JsonSmelterRecipe\n{\n\tprivate JsonLoadedItem input;\n\tprivate JsonLoadedItemStack output;\n\tprivate float experience;\n\tprivate int boosterCount;\n\tprivate int bonusPerBoostLevel;\n\n\tpublic JsonSmelterRecipe(JsonLoadedItem input, JsonLoadedItemStack output, float xp, int boosters, int bonus)\n... | import net.einsteinsci.betterbeginnings.config.json.recipe.JsonSmelterRecipe;
import net.einsteinsci.betterbeginnings.config.json.recipe.JsonSmelterRecipeHandler;
import net.einsteinsci.betterbeginnings.register.recipe.SmelterRecipeHandler;
import net.einsteinsci.betterbeginnings.util.FileUtil;
import net.einsteinsci.b... | package net.einsteinsci.betterbeginnings.config.json;
public class SmelterConfig implements IJsonConfig
{
public static final SmelterConfig INSTANCE = new SmelterConfig();
public static final List<ItemStack> AFFECTED_INPUTS = new ArrayList<>();
private static JsonSmelterRecipeHandler initialRecipes = new JsonSm... | List<String> inputNames = RegistryUtil.getOreNames(kvp.getKey()); | 4 |
el-groucho/jsRules | src/main/java/org/grouchotools/jsrules/util/RulesetTypeHandler.java | [
"public abstract class Executor {\n private static final Logger LOG = LoggerFactory.getLogger(Executor.class);\n\n /**\n * Validate that parameter is present (not null) and is an instance of the correct\n * class\n *\n * @param key the name of the parameter\n * @param parameter ... | import org.grouchotools.jsrules.Executor;
import org.grouchotools.jsrules.RulesetExecutor;
import org.grouchotools.jsrules.impl.AllTrueRulesetExecutorImpl;
import org.grouchotools.jsrules.impl.AllTrueRulesetListExecutorImpl;
import org.grouchotools.jsrules.impl.FirstTrueRulesetExecutorImpl;
import org.grouchotools.jsru... | package org.grouchotools.jsrules.util;
/**
* Created by Paul Richardson 5/14/2015
*/
public enum RulesetTypeHandler {
ALLTRUE {
@Override
@SuppressWarnings("unchecked")
public RulesetExecutor getRulesetExecutor(String name, List<Executor> ruleSet, Object response) {
return n... | return new AllTrueRulesetListExecutorImpl(name, ruleSet, response); | 3 |
houxg/Leamonax | app/src/main/java/org/houxg/leamonax/ui/AboutActivity.java | [
"@Database(name = \"leanote_db\", version = 4)\npublic class AppDataBase {\n\n private static final String TAG = \"AppDataBase:\";\n\n @Migration(version = 2, database = AppDataBase.class)\n public static class UpdateTag extends BaseMigration {\n\n @Override\n public void migrate(DatabaseWrap... | import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.TextView;
import com.raizlabs.android.dbflow.config.FlowManager;
import com.raizlabs.android.dbflow.structure.database.transaction.ProcessModelTransaction;
import com.raizlabs.android.dbflow.structure.dat... | package org.houxg.leamonax.ui;
public class AboutActivity extends BaseActivity {
@BindView(R.id.tv_version)
TextView mVersionTv;
@BindView(R.id.ll_debug)
View mDebugPanel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
... | OpenUtils.openUrl(this, "https://github.com/houxg/Leamonax"); | 3 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/DataType_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.TriplesMap;
import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import eu.optique.r2rml.api.binding.... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | Collection<TriplesMap> coll = mm.importMappings(m);
| 4 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/TimeEntryManager.java | [
"public class TimeEntry implements Identifiable, FluentStyle {\n\n private final PropertyStorage storage = new PropertyStorage();\n\n /**\n * database numeric Id\n */\n public final static Property<Integer> DATABASE_ID = new Property<>(Integer.class, \"id\");\n\n /**\n * database Id of the I... | import com.taskadapter.redmineapi.bean.TimeEntry;
import com.taskadapter.redmineapi.bean.TimeEntryActivity;
import com.taskadapter.redmineapi.internal.DirectObjectsSearcher;
import com.taskadapter.redmineapi.internal.RequestParam;
import com.taskadapter.redmineapi.internal.ResultsWrapper;
import com.taskadapter.redmine... | package com.taskadapter.redmineapi;
/**
* Class to operate on Time Entry instances.
* <p>
* Sample usage:
* <pre>
RedmineManager redmineManager = RedmineManagerFactory.createWithUserAuth(redmineURI, login, password);
redmineManager.getTimeEntryManager();
* </pre>
*/
public final class TimeEntryManager {
... | new RequestParam("issue_id", Integer.toString(issueId))); | 3 |
ccascone/JNetMan | src/jnetman/network/IfCardAgent.java | [
"public final class MIB {\n\n\t/*\n\t * MIB-II Root\n\t */\n\tpublic static final OID Mib2Root = new OID(\".1.3.6.1.2.1\");\n\t/*\n\t * System\n\t */\n\tpublic static final OID System = new OID(Mib2Root).append(1);\n\tpublic static final OID sysDescr = new OID(System).append(\".1.0\");\n\tpublic static final OID sy... | import java.util.HashMap;
import java.util.HashSet;
import jnetman.snmp.MIB;
import jnetman.snmp.MibHelper;
import jnetman.snmp.SnmpClient;
import jnetman.snmp.SnmpErrorException;
import jnetman.snmp.SnmpHelper;
import jnetman.snmp.SnmpSyntaxException;
import jnetman.snmp.TimedValues;
import jnetman.snmp.TimeoutExcepti... | package jnetman.network;
public class IfCardAgent {
public static final int BW_IN = 0;
public static final int BW_OUT = 1;
public static final int BW_MAX_IN_OUT = 2;
private IfCard ifCard;
private NodeAgent agent;
protected MibHelper mibHelper; | protected SnmpHelper snmpHelper; | 4 |
bmelnychuk/outlay | outlay/app/src/main/java/app/outlay/view/activity/base/BaseActivity.java | [
"public interface Analytics {\n void trackGuestSignIn();\n\n void trackEmailSignIn();\n\n void trackSignUp();\n\n void trackSingOut();\n\n void trackLinkAccount();\n\n void trackExpenseCreated(Expense e);\n\n void trackExpenseDeleted(Expense e);\n\n void trackExpenseUpdated(Expense e);\n\n ... | import android.view.View;
import app.outlay.App;
import app.outlay.analytics.Analytics;
import app.outlay.di.component.AppComponent;
import app.outlay.impl.AppPreferences;
import app.outlay.utils.ResourceHelper;
import app.outlay.view.OutlayTheme; | package app.outlay.view.activity.base;
/**
* Created by bmelnychuk on 12/14/16.
*/
public interface BaseActivity {
App getApp();
View getRootView(); | OutlayTheme getOutlayTheme(); | 4 |
SecUSo/privacy-friendly-pedometer | app/src/main/java/org/secuso/privacyfriendlyactivitytracker/utils/StepDetectionServiceHelper.java | [
"public class Factory {\n\n /**\n * Returns the class of the step detector service which should be used\n *\n * The used step detector service depends on different soft- and hardware preferences.\n * @param context An instance of the calling Context\n * @return The class of step detector\n ... | import org.secuso.privacyfriendlyactivitytracker.receivers.StepCountPersistenceReceiver;
import org.secuso.privacyfriendlyactivitytracker.receivers.WidgetReceiver;
import org.secuso.privacyfriendlyactivitytracker.services.AccelerometerStepDetectorService;
import org.secuso.privacyfriendlyactivitytracker.services.Hardwa... | /*
Privacy Friendly Pedometer is licensed under the GPLv3.
Copyright (C) 2017 Tobias Neidig
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | Intent hardwareStepDetectorServiceIntent = new Intent(context, HardwareStepService.class); | 6 |
yasuflatland-lf/liferay-dummy-factory | src/main/java/com/liferay/support/tools/portlet/actions/CommonMVCRenderCommand.java | [
"public class LDFPortletKeys {\n public static final String EOL = System.getProperty(\"line.separator\");\n\n\t// Portlet Name\n\tpublic static final String LIFERAY_DUMMY_FACTORY = \"com_liferay_support_tools_portlet_LiferayDummyFactoryPortlet\";\n\t\n\tpublic static final String DUMMY_FACTORY_CONFIG = \"com.lif... | import com.liferay.frontend.js.loader.modules.extender.npm.NPMResolver;
import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCRenderCommand;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.support.tools.... | package com.liferay.support.tools.portlet.actions;
/**
* Render command for all jsps
*
* @author Yasuyuki Takeo
*/
@Component(
immediate = true,
property = {
"javax.portlet.name=" + LDFPortletKeys.LIFERAY_DUMMY_FACTORY,
"mvc.command.name=" + LDFPortletKeys.ORGANIZAION,
"mvc.co... | private WikiCommons _wikiCommons; | 5 |
paspiz85/nanobot | src/main/java/it/paspiz85/nanobot/logic/StateIdle.java | [
"public class AttackScreen extends Screen {\n\n private static final Area AREA_NEXT_BUTTON = Area.byEdges(692, 488, 739, 547);\n\n private static final Point BUTTON_END_BATTLE = getPoint(\"point.button.end_battle\");\n\n private static final Point BUTTON_END_BATTLE_QUESTION_OK = getPoint(\"point.button.end... | import it.paspiz85.nanobot.game.AttackScreen;
import it.paspiz85.nanobot.game.BattleBeginScreen;
import it.paspiz85.nanobot.game.BattleEndScreen;
import it.paspiz85.nanobot.game.MainScreen;
import it.paspiz85.nanobot.game.ManageTroopsScreen;
import it.paspiz85.nanobot.game.PlatformScreen;
import it.paspiz85.nanobot.gam... | package it.paspiz85.nanobot.logic;
/**
* This state is when bot sleeps.
*
* @author paspiz85
*
*/
public final class StateIdle extends State<Screen> {
public static StateIdle instance() {
return Utils.singleton(StateIdle.class, () -> new StateIdle());
}
private final MainScreen mainScreenP... | } else if (Screen.getInstance(BattleBeginScreen.class).isDisplayed()) { | 1 |
suguru/mongo-java-async-driver | src/main/java/jp/ameba/mongo/MongoConnection.java | [
"public class Delete extends Request {\n\t\n\tprivate int flags;\n\t\n\tprivate BSONObject selector;\n\t\n\t/**\n\t * Update\n\t * \n\t * @param collectionName\n\t * @param upsert\n\t * @param multiUpdate\n\t * @param selector\n\t * @param update\n\t */\n\tpublic Delete(\n\t\t\tString databaseName,\n\t\t\tString co... | import jp.ameba.mongo.protocol.Delete;
import jp.ameba.mongo.protocol.GetMore;
import jp.ameba.mongo.protocol.Insert;
import jp.ameba.mongo.protocol.KillCursors;
import jp.ameba.mongo.protocol.Query;
import jp.ameba.mongo.protocol.Response;
import jp.ameba.mongo.protocol.Update; | package jp.ameba.mongo;
/**
* MongoDB に対する接続および通信を行うためのインターフェイス
* 低レイヤーのプロトコル処理を実行するためのメソッドを提供します。
*
* @author suguru
*/
public interface MongoConnection {
/**
* この接続を識別するための ID を取得します。
* @return
*/
int getChannelId();
/**
* 接続をオープンします。
* @throws MongoException
*/
void open() throws MongoExce... | Response query(Query query); | 5 |
StumbleUponArchive/hbase | src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java | [
"public final class HConstants {\n /**\n * Status codes used for return values of bulk operations.\n */\n public enum OperationStatusCode {\n NOT_RUN,\n SUCCESS,\n BAD_FAMILY,\n SANITY_CHECK_FAILURE,\n FAILURE;\n }\n\n /** long constant for zero */\n public static final Long ZERO_L = Long.va... | import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentSkipListSet;
import ja... | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | hfs = fs.listStatus(cfDir, new HFileFilter(fs)); // use same filter as scanner. | 3 |
nkarasch/ChessGDX | core/src/nkarasch/chessgdx/view/renderers/PerspectiveRenderer.java | [
"public class Camera extends PerspectiveCamera {\n\n\tprivate final OrbitCamera mFPCameraController;\n\n\t/**\n\t * Creates 60 degree field of view PerspectiveCamera and instantiates its\n\t * controller.\n\t */\n\tpublic Camera() {\n\t\tsuper(60, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\n\t\tthis.mFPCam... | import nkarasch.chessgdx.camera.Camera;
import nkarasch.chessgdx.logiccontroller.frontend.BoardController;
import nkarasch.chessgdx.logiccontroller.frontend.ChessPieceGraveyard;
import nkarasch.chessgdx.perspectiveview.gameobjects.ChessPiece;
import nkarasch.chessgdx.perspectiveview.gameobjects.GridSpaceHighlighter;
im... | package nkarasch.chessgdx.view.renderers;
public class PerspectiveRenderer {
private final ModelBatch mShadowBatch;
private final ModelBatch mCubeMapBatch;
private final ModelBatch mBackgroundBatch;
private final Environment mEnvironment;
private final Environment mBackgroundEnvironment;
private final Array<A... | private final ChessPieceGraveyard mGraveyard; | 2 |
MCBans/MCBans | src/main/java/com/mcbans/plugin/request/LookupRequest.java | [
"public class Client {\n private Socket client;\n private OutputStream outputStream;\n private InputStream inputStream;\n\n public static class ResponseHandler {\n public void bans(List<Ban> bans){}\n public void err(String error){}\n public void ack(){}\n public void partial... | import com.mcbans.client.Client;
import com.mcbans.client.ConnectionPool;
import com.mcbans.client.PlayerLookupClient;
import com.mcbans.domain.models.client.Ban;
import com.mcbans.plugin.util.Util;
import org.bukkit.ChatColor;
import com.mcbans.plugin.ActionLog;
import com.mcbans.plugin.MCBans;
import com.mcbans.plugi... | package com.mcbans.plugin.request;
public class LookupRequest extends BaseRequest<LookupCallback> {
private String targetName = null;
public LookupRequest(
final MCBans plugin,
final LookupCallback callback,
final String playerName,
final String playerUUID,
final String senderName,
Strin... | Util.message(callback.getSender(), "Not a valid player name or UUID."); | 4 |
Derek-Ashmore/moneta | moneta-core/src/main/java/org/moneta/Moneta.java | [
"public class MonetaEnvironment extends BaseType {\r\n\t\r\n\tprivate static MonetaConfiguration configuration;\r\n\r\n\tpublic static MonetaConfiguration getConfiguration() {\r\n\t\treturn configuration;\r\n\t}\r\n\r\n\tpublic static void setConfiguration(MonetaConfiguration configuration) {\r\n\t\tMonetaEnvironme... | import java.util.ArrayList;
import java.util.List;
import org.moneta.config.MonetaEnvironment;
import org.moneta.dao.MonetaSearchDAO;
import org.moneta.types.Record;
import org.moneta.types.Value;
import org.moneta.types.search.SearchRequest;
import org.moneta.types.search.SearchResult;
import org.moneta.types.... | /*
* This software is licensed under the Apache License, Version 2.0
* (the "License") agreement; you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | List<Record> recordList = new ArrayList<Record>();
| 2 |
Gogolook-Inc/GogoMonkeyRun | UICompareRunnerApp/src/com/gogolook/uicomparerunner/GmMainActivity.java | [
"public class SocketClient {\n\tpublic static final int STAUTS_WAITING = 0x1000;\n\tpublic static final int STAUTS_CONNECTED = 0x1001;\n\tpublic static final int STAUTS_DISCONNECTED = 0x1002;\n\tprivate int status = STAUTS_WAITING;\n\n\tprivate String address = \"192.168.23.21\";// 連線的ip\n\tprivate int port = 8765;... | import java.util.ArrayList;
import android.app.Activity;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Pair;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;... |
package com.gogolook.uicomparerunner;
public class GmMainActivity extends Activity implements OnClickListener {
private GmMainLayout mainLayout;
private FreeEditText addressEdit;
private FreeEditText portEdit;
private FreeTextButton connectButton;
private FreeTextView deviceText;
private FreeTextView socketT... | socketClient = new SocketClient(address, port, new SocketStatusListener() { | 2 |
google/ftc-object-detection | TFObjectDetector/tfod/src/main/java/com/google/ftcresearch/tfod/detection/TfodFrameManager.java | [
"public interface FrameGenerator {\n\n /**\n * Get the next frame in the sequence, blocking if none are available.\n *\n * @return The next frame. Never null.\n */\n @NonNull YuvRgbFrame getFrame() throws InterruptedException;\n\n /** Method to serve as a destructor to release any important resources (e.... | import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.Log;
import com.google.ftcresearch.tfod.generators.FrameGenerator;
import com.google.ftcresearch.tfod.util.AnnotatedYuvRgbFrame;
import com.goo... | /*
* Copyright (C) 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | private volatile AnnotatedYuvRgbFrame lastRecognizedFrame; // The most recent returned frame | 1 |
wmora/openfeed | app/src/main/java/com/williammora/openfeed/services/TwitterService.java | [
"public class OpenFeed extends Application {\n\n private static OpenFeed application;\n\n public OpenFeed() {\n application = this;\n }\n\n public static OpenFeed getApplication() {\n return application;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n ... | import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import android.util.Log;
import com.williammora.openfeed.BuildConfig;
import com.williammora.openfeed.OpenFeed;
import com.williammora.openfeed.R;
import com.williammora.openfeed.events.NotificationEvent;
import com... | package com.williammora.openfeed.services;
public class TwitterService {
private static final String TAG = TwitterService.class.getSimpleName();
private static TwitterService ourInstance = new TwitterService();
private RequestToken requestToken;
private Context context;
private AsyncTwitter tw... | BusProvider.getInstance().post(new TwitterEvents.OAuthRequestTokenEvent(token), true); | 2 |
evmcl/erudite | src/main/java/com/evanmclean/erudite/cli/Args.java | [
"public interface Version\n{\n public static final String VERSION = \"2.4\";\n}",
"public enum ConsoleLogging\n{\n /**\n * Log all debug level and above messages.\n */\n VERBOSE,\n /**\n * Log all info level and above messages.\n */\n NORMAL,\n /**\n * Only write logs to the console if there was a... | import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import com.evanmclean.erudit... | package com.evanmclean.erudite.cli;
/**
* Parses the command line arguments.
*
* @author Evan M<sup>c</sup>Lean,
* <a href="http://evanmclean.com/" target="_blank">M<sup>c</sup>Lean
* Computer Services</a>
*/
public class Args
{
/**
* Returns the user data folder used by the application. ... | System.out.println(Version.VERSION); | 0 |
nitindhar7/kampr | src/com/nitindhar/kampr/async/CommentsTask.java | [
"public final class R {\n public static final class attr {\n }\n public static final class color {\n /** ActionBar \n */\n public static final int actionbar_separator_dark=0x7f04000e;\n public static final int actionbar_separator_light=0x7f04000f;\n public static final ... | import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.os.AsyncTask;
import android.widget.ListView;
import com.nitindhar.forrst.model.Comment;
import com.nitindhar.kampr.R;
import com.nitindhar.kampr.adapters.CommentsAdapter;
import com.nitindhar.kampr.data.SessionDao;
import... | package com.nitindhar.kampr.async;
public class CommentsTask extends
AsyncTask<Integer, Integer, List<CommentsDecorator>> {
private final Context context;
private final ListView comments;
public CommentsTask(Context context, ListView comments) {
this.context = context;
this.com... | SessionDao sessionDao = SessionSharedPreferencesDao.instance(); | 3 |
rwitzel/streamflyer | streamflyer-core/src/main/java/com/github/rwitzel/streamflyer/regex/addons/stateful/StateMachine.java | [
"public interface MatchProcessor {\r\n\r\n /**\r\n * Processes the given match. The match processor is allowed to modify the given character buffer but it must not\r\n * modify the characters before the first modifiable character in the buffer because the characters before that\r\n * position are con... | import java.util.regex.MatchResult;
import com.github.rwitzel.streamflyer.regex.MatchProcessor;
import com.github.rwitzel.streamflyer.regex.MatchProcessorResult;
import com.github.rwitzel.streamflyer.regex.OnStreamMatcher;
import com.github.rwitzel.streamflyer.regex.RegexModifier;
import com.github.rwitzel.streamf... | /**
* Copyright (C) 2011 rwitzel75@googlemail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... | private DelegatingMatcher delegatingMatcher;
| 4 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/MultiplePredicateObjectMap_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import eu.optique.r2rml.api.model.LogicalTable;
import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.model.Template;
import eu.optique.r2rml.api.m... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | Iterator<PredicateMap> pmit=pom.getPredicateMaps().iterator();
| 4 |
mathisdt/sdb2 | src/main/java/org/zephyrsoft/sdb2/presenter/SongView.java | [
"public class AddressableLine implements Addressable {\n\t\n\tprivate String text;\n\tprivate int indentation;\n\tprivate Integer position;\n\t\n\tpublic AddressableLine(SongElement element, Integer position) {\n\t\tthis.text = element == null || element.getContent() == null\n\t\t\t? \"\"\n\t\t\t: element.getConten... | import static org.zephyrsoft.sdb2.model.SongElementEnum.CHORDS;
import static org.zephyrsoft.sdb2.model.SongElementEnum.COPYRIGHT;
import static org.zephyrsoft.sdb2.model.SongElementEnum.LYRICS;
import static org.zephyrsoft.sdb2.model.SongElementEnum.NEW_LINE;
import static org.zephyrsoft.sdb2.model.SongElementEnum.TIT... | ((DefaultCaret) text.getCaret()).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
text.setRequestFocusEnabled(false);
text.setEditable(false);
text.setEnabled(false);
setLayout(new BorderLayout());
add(text, BorderLayout.CENTER);
setBackground(backgroundColor);
setOpaque(true);
text.setForeground(foregr... | AddressableLine currentLine = new AddressableLine(back1, position); | 0 |
ForeverWJY/CoolQ_Java_Plugin | src/main/java/com/wjyup/coolq/controller/TestController.java | [
"public class CQSDK {\n\tprivate static Logger log = LogManager.getLogger(\"CQSDK\");\n\n\t/////////////////////// 静态API/////////////////////////\n\n\t/**\n\t * 发送 @某人\n\t */\n\tpublic static String sendAt(String qq) {\n\t\tif (StringUtils.isNotBlank(qq)) {\n\t\t\tif (\"-1\".equals(qq)) {\n\t\t\t\tqq = \"all\";\n\t... | import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.wjyup.coolq.util.CQSDK;
import com.wjyup.coolq.vo.FriendListVO;
import com.wjyup.coolq.vo.GroupListVO;
import com.wjyup.coolq.vo.GroupMemberInfoVO;
import com.wjyup.coolq.vo... | package com.wjyup.coolq.controller;
/**
* 供测试用的Controller
* @author WJY
*/
@Controller
@RequestMapping(value = "testAction")
public class TestController {
//获取群成员的信息
@RequestMapping(value = "getGroupMemberInfo")
public void getGroupMemberInfo(){
GroupMemberInfoVO info = CQSDK.getGroupMemberInfo("215400054"... | List<GroupListVO> list = CQSDK.getGroupList(); | 2 |
shapesecurity/shape-functional-java | src/main/java/com/shapesecurity/functional/data/HashTable.java | [
"@FunctionalInterface\npublic interface Effect<A> extends F<A, Unit> {\n void e(@Nonnull A a);\n\n @Nonnull\n default Unit apply(@Nonnull A a) {\n this.e(a);\n return Unit.unit;\n }\n}",
"@CheckReturnValue\n@FunctionalInterface\npublic interface F<A, R> {\n @Nonnull\n static <A ext... | import java.util.Map;
import java.util.NoSuchElementException;
import java.util.function.Consumer;
import com.shapesecurity.functional.Effect;
import com.shapesecurity.functional.F;
import com.shapesecurity.functional.F2;
import com.shapesecurity.functional.Pair;
import com.shapesecurity.functional.Unit;
import javax.a... | return HashTable.<K, V>emptyUsingIdentity().putAll(list);
}
@Nonnull
public static <K, V> HashTable<K, V> from(@Nonnull Hasher<K> hasher, @Nonnull Iterable<Pair<K, V>> list) {
return HashTable.<K, V>empty(hasher).putAll(list);
}
@Nonnull
public final HashTable<K, V> put(@Nonnul... | return new ImmutableSet<>(this.map(F.constant(Unit.unit))); | 4 |
freenet/plugin-FlogHelper | src/main/java/plugins/floghelper/ui/flog/FlogFactory.java | [
"public class FlogHelper implements FredPlugin, FredPluginThreadless, FredPluginBaseL10n, FredPluginL10n, FredPluginThemed, FredPluginVersioned, FredPluginRealVersioned, FredPluginTalker {\n\n\tpublic static final String l10nFilesBasePath = \"l10n/\";\n\tpublic static final String l10nFilesMask = \"UI_${lang}.l10n\... | import freenet.client.DefaultMIMETypes;
import freenet.client.async.ClientContext;
import freenet.support.api.ManifestElement;
import freenet.client.async.PersistenceDisabledException;
import freenet.client.async.PersistentJob;
import freenet.client.async.TooManyFilesInsertException;
import freenet.clients.fcp.ClientPu... | /* FlogHelper, Freenet plugin to create flogs
* Copyright (C) 2009 Romain "Artefact2" Dalmaso
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at yo... | InputStream res = FlogHelper.class.getClassLoader().getResourceAsStream(resource); | 0 |
alleveenstra/Mujina | mujina-idp/src/main/java/nl/surfnet/mujina/saml/xml/AssertionGenerator.java | [
"@XmlRootElement\npublic class AuthenticationMethod implements Serializable {\n private static final long serialVersionUID = 1L;\n\n private String value;\n\n public String getValue() {\n return value;\n }\n\n @XmlElement\n public void setValue(final String value) {\n this.value = va... | import java.util.HashMap;
import java.util.Map;
import org.joda.time.DateTime;
import org.opensaml.saml2.core.Assertion;
import org.opensaml.saml2.core.AuthnStatement;
import org.opensaml.saml2.core.Issuer;
import org.opensaml.saml2.core.Subject;
import org.opensaml.saml2.core.impl.AssertionBuilder;
import org.opensaml... | /*
* Copyright 2012 SURFnet bv, The Netherlands
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | public Assertion generateAssertion(String remoteIP, SimpleAuthentication authToken, String recepientAssertionConsumerURL, int validForInSeconds, String inResponseTo, DateTime authnInstant) { | 2 |
headwirecom/aemdc | src/main/java/com/headwire/aemdc/gui/Model.java | [
"public class Config {\n\n private static final Logger LOG = LoggerFactory.getLogger(Config.class);\n\n /* This cannot be final as the IntelliJ Plugin need to be able to set it after the launch **/\n private static File PROJECT_ROOT_DIR = new File(\".\");\n\n private File baseFolder;\n private String configPro... | import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementMap;
import com.headwire.aemdc.companion.Config;
import com.headwire.aemdc.companion.Reflection;
import com.headwire.aemdc.companion.Res... | package com.headwire.aemdc.gui;
/**
* Created by rr on 12/29/2016.
*/
public class Model {
private transient Config config = new Config();
// setup of types that will be available
private ArrayList<String> types = new ArrayList<String>();
public Model() {
}
@ElementMap(entry = "config", key = "ty... | final Reflection reflection = new Reflection(config); | 1 |
nicoulaj/checksum-maven-plugin | src/main/java/net/nicoulaj/maven/plugins/checksum/mojo/AbstractChecksumMojo.java | [
"public class Constants\n{\n /**\n * The CRC/checksum digest algorithms supported by checksum-maven-plugin.\n */\n public static final String[] SUPPORTED_ALGORITHMS = {\n \"Cksum\",\n \"CRC32\",\n \"BLAKE2B-160\",\n \"BLAKE2B-256\",\n \"BLAKE2B-384\",\n \"BLAK... | import net.nicoulaj.maven.plugins.checksum.Constants;
import net.nicoulaj.maven.plugins.checksum.artifacts.ArtifactAttacher;
import net.nicoulaj.maven.plugins.checksum.artifacts.ArtifactListener;
import net.nicoulaj.maven.plugins.checksum.execution.Execution;
import net.nicoulaj.maven.plugins.checksum.execution.Executi... | /*
* checksum-maven-plugin - http://checksum-maven-plugin.nicoulaj.net
* Copyright © 2010-2021 checksum-maven-plugin contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ... | Execution execution = ( failOnError ) ? new FailOnErrorExecution() : new NeverFailExecution( getLog() ); | 6 |
Talon876/RSIRCBot | src/org/nolat/rsircbot/commands/HiscoreCommand.java | [
"public class RSIRCBot extends ListenerAdapter<PircBotX> {\n\n private PircBotX bot;\n\n public static final String VERSION = \"1.3.1a\";\n\n private final Settings settings;\n\n public RSIRCBot(Settings settings) {\n this.settings = settings;\n Configuration.Builder<PircBotX> builder = ne... | import java.io.IOException;
import org.nolat.rsircbot.RSIRCBot;
import org.nolat.rsircbot.data.HiscoreData;
import org.nolat.rsircbot.data.RankLevelXp;
import org.nolat.rsircbot.tools.Calculate;
import org.nolat.rsircbot.tools.Names;
import org.nolat.rsircbot.tools.RSFormatter;
import org.nolat.rsircbot.tools.Spellchec... | package org.nolat.rsircbot.commands;
public class HiscoreCommand extends Command {
public HiscoreCommand() {
super("hiscore");
addAlternativeCommand("highscore");
setArgString("<username> <skill>");
setHelpMessage("Retrieves the hiscore data for the given username and skill");
... | + RSFormatter.format(Calculate.xpUntilLevelUp(rlx.getXp())) | 3 |
felixb/callmeter | CallMeter3G/src/main/java/de/ub0r/android/callmeter/ui/prefs/PreferencesPlain.java | [
"public class ConsentManager {\n\n private static final String TAG = \"ConsentManager\";\n private static final String ADMOB_PUBLISHER_ID = \"pub-1948477123608376\";\n private static final String PRIVACY_URL = \"https://github.com/felixb/callmeter/blob/master/PRIVACY.md\";\n\n private final Activity mAc... | import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreference... | @Override
public boolean onPreferenceClick(final Preference preference) {
consentManager.askForConsent();
return true;
}
});
} else {
PreferenceScreen ps = (PreferenceS... | .exportData(this, null, null, null, ExportProvider.EXPORT_RULESET_FILE, null); | 1 |
cestella/streaming_outliers | core/src/test/java/com/caseystella/analytics/timeseries/tsdb/TSDBIntegrationTest.java | [
"public class DataPoint {\n private long timestamp;\n private double value;\n private Map<String, String> metadata;\n private String source;\n\n public DataPoint() {\n\n }\n\n public DataPoint(long timestamp, double value, Map<String, String> metadata, String source) {\n this.timestamp =... | import com.caseystella.analytics.DataPoint;
import com.caseystella.analytics.distribution.SimpleTimeRange;
import com.caseystella.analytics.integration.ComponentRunner;
import com.caseystella.analytics.integration.UnableToStartException;
import com.caseystella.analytics.integration.components.TSDBComponent;
import com.... | package com.caseystella.analytics.timeseries.tsdb;
public class TSDBIntegrationTest {
@Test
public void test() throws UnableToStartException, IOException, InterruptedException {
Random r = new Random(0);
List<DataPoint> points = new ArrayList<>();
long offset = System.currentTimeMil... | DistributionUtil.INSTANCE.summary("TSDB Latency Stats", latencyStats); | 7 |
tresorit/ZeroKit-Android-SDK | adminapi/src/main/java/com/tresorit/zerokit/AdminApi.java | [
"public interface Call<T, S> extends CallAsync<T, S> {\n Response<T, S> execute();\n}",
"public abstract class CallBase<T, S> extends CallAsyncBase<T, S> implements Call<T, S> {\n}",
"public interface Callback<T, S> {\n\n void onSuccess(T result);\n\n void onError(S e);\n\n}",
"public class Response<... | import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.support.test.espresso.IdlingResource;
import com.google.gson.Gson;
import com.tresorit.zerokit.call.Call;
import com.tresorit.zerokit.call.CallBase;
import com.treso... | package com.tresorit.zerokit;
public class AdminApi {
private static final String AUTHORIZATION = "Authorization";
private static final String AUTHORIZATION_HEADER = AUTHORIZATION + ": Bearer %s";
@SuppressWarnings("WeakerAccess")
final AdminApiService adminApiService;
private String clientI... | public Call<String, ResponseAdminApiError> getUserId(final String userName) { | 0 |
mock4aj/mock4aj | mock4aj-core/src/test/java/info/rubico/mock4aj/codegen/cglib/proxies/CglibWeavedProxyFactoryTest.java | [
"public class NotAnInstanceToProxy extends Mock4AjException {\n\n // @formatter:off\n private static final String MESSAGE = \n \"It is not possible to create directly a proxy of a class. You must \"\n + \"use an instance of the class you want to proxy instea... | import static org.junit.Assert.*;
import static org.junit.matchers.JUnitMatchers.*;
import static org.mockito.BDDMockito.*;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
import info.rubico.mock4aj.api.exceptions.NotAnInstanceToProxy;
import info.rubico.mock4aj.api.exceptions.UnproxiableType... | package info.rubico.mock4aj.codegen.cglib.proxies;
@SuppressWarnings("unused")
public class CglibWeavedProxyFactoryTest { // NOPMD
private WeavedProxyFactory factory; | private Weaver noWeavingAdapter; | 3 |
GoogleCloudPlatform/gcs-uploader | app-desktop/src/main/java/com/google/ce/media/contentuploader/exec/BlobUploadTask.java | [
"public class AnalyticsMessage {\n //required fields\n private String guid;\n private Type type;\n private String timestamp;\n private Integer index;\n private String username;\n private TaskStatus status;\n private Event event;\n private String blobId;\n private String bucket;\n private String objectNam... | import com.google.ce.media.contentuploader.message.AnalyticsMessage;
import com.google.ce.media.contentuploader.message.TaskInfo;
import com.google.ce.media.contentuploader.message.TaskStatus;
import com.google.ce.media.contentuploader.message.Tasklet;
import com.google.ce.media.contentuploader.utils.DateUtils;
import ... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | m1.setStartTime(DateUtils.time(startTime)); | 4 |
spotify/java-hamcrest | future/src/test/java/com/spotify/hamcrest/future/CompletableFutureMatchersTest.java | [
"public static Matcher<CompletionStage<?>> stageCompletedWithException() {\n return stageCompletedWithExceptionThat(is(any(Throwable.class)));\n}",
"public static Matcher<CompletionStage<?>> stageCompletedWithExceptionThat(\n final Matcher<? extends Throwable> matcher) {\n return new ExceptionallyCompletedCo... | import static org.hamcrest.CoreMatchers.isA;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.junit.Assert.assertThat;
import java.util.concurrent.... | /*-
* -\-\-
* hamcrest-future
* --
* Copyright (C) 2016 Spotify AB
* --
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | assertThat(cf, stageCompletedWithValueThat(not(nullValue()))); | 3 |
f2prateek/dart | dart-processor/src/main/java/dart/processor/ExtraBinderGenerator.java | [
"public static final String DART_MODEL_SUFFIX = \"NavigationModel\";",
"public class Dart {\n public static final String EXTRA_BINDER_SUFFIX = \"__ExtraBinder\";\n\n static final Map<Class<?>, Method> EXTRA_BINDERS = new LinkedHashMap<>();\n static final Map<Class<?>, Method> NAVIGATION_MODEL_BINDERS = new Lin... | import java.util.Collection;
import java.util.List;
import javax.lang.model.element.Modifier;
import javax.lang.model.type.TypeMirror;
import static dart.common.util.DartModelUtil.DART_MODEL_SUFFIX;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
i... | /*
* Copyright 2013 Jake Wharton
* Copyright 2014 Prateek Srivastava (@f2prateek)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0... | return target.className + DART_MODEL_SUFFIX + Dart.EXTRA_BINDER_SUFFIX; | 0 |
alexmojaki/boxes | src/test/java/alex/mojaki/boxes/test/ViewTest.java | [
"public class BoxFamily {\n\n private static final InstanceStore<BoxFamily> INSTANCE_STORE = new InstanceStore<BoxFamily>() {\n @Override\n public BoxFamily getNew(Object... args) {\n return new BoxFamily((Class<?>) args[0], (String) args[1]);\n }\n };\n\n private final Stri... | import alex.mojaki.boxes.BoxFamily;
import alex.mojaki.boxes.CommonBox;
import alex.mojaki.boxes.PowerBox;
import alex.mojaki.boxes.middleware.get.GetMiddleware;
import alex.mojaki.boxes.observers.change.ChangeObserver;
import alex.mojaki.boxes.View;
import alex.mojaki.boxes.observers.get.GetObserver;
import org.junit.... | package alex.mojaki.boxes.test;
public class ViewTest {
@Rule
public ExpectedException exception = ExpectedException.none();
| private class Product extends View<Integer> { | 5 |
ZevenFang/zevencourse | src/main/java/com/zeven/course/action/AccessAction.java | [
"@Entity\npublic class Student {\n private int id;\n private String sno;\n private String password;\n private String name;\n private byte gender;\n private String notes;\n private int clazzId;\n\n @Id\n @Column(name = \"id\", nullable = false)\n public int getId() {\n return id;... | import com.zeven.course.model.Student;
import com.zeven.course.model.Teacher;
import com.zeven.course.service.StudentService;
import com.zeven.course.service.TeacherService;
import com.zeven.course.util.Auth;
import com.zeven.course.util.MD5Encoder;
import com.zeven.course.util.Message;
import com.zeven.course.util.Tok... | package com.zeven.course.action;
/**
* Created by fangf on 2016/5/20.
*/
@RequestMapping("/Access")
@Controller
public class AccessAction {
@Resource
private StudentService sService;
@Resource
private TeacherService tService;
@ResponseBody
@RequestMapping("signin")
public Message sign... | Teacher teacher = tService.login(name,password); | 1 |
horrorho/LiquidDonkey | src/main/java/com/github/horrorho/liquiddonkey/cloud/keybag/FileKeyFactory.java | [
"public final class ICloud {\n private ICloud() {}\n public static void registerAllExtensions(\n com.google.protobuf.ExtensionRegistry registry) {\n }\n public interface MBSAccountOrBuilder extends\n // @@protoc_insertion_point(interface_extends:com.github.horrorho.liquiddonkey.cloud.protobuf.MBSAccou... | import java.util.function.Supplier;
import net.jcip.annotations.Immutable;
import net.jcip.annotations.ThreadSafe;
import org.bouncycastle.crypto.InvalidCipherTextException;
import org.bouncycastle.crypto.digests.SHA256Digest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.horrorho.liquiddon... | /*
* The MIT License
*
* Copyright 2015 Ahseya.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify,... | public ByteString fileKey(KeyBag keyBag, ICloud.MBSFile file) { | 0 |
isisaddons/isis-app-todoapp | fixture/src/main/java/todoapp/fixture/scenarios/RecreateBillUserAndRolesAndToDoItems.java | [
"public class ToDoAppRegularRoleAndPermissions extends AbstractRoleAndPermissionsFixtureScript {\n\n public static final String ROLE_NAME = \"todoapp-regular-role\";\n\n public ToDoAppRegularRoleAndPermissions() {\n super(ROLE_NAME, \"Read/write access to todoapp dom\");\n }\n\n @Override\n pr... | import java.util.Arrays;
import org.isisaddons.module.security.seed.scripts.IsisModuleSecurityRegularUserRoleAndPermissions;
import todoapp.dom.seed.roles.ToDoAppRegularRoleAndPermissions;
import todoapp.dom.seed.roles.ToDoAppToDoItemVetoSelectedMembersPermissions;
import todoapp.fixture.module.DeleteUserAndUserRolesAn... | /*
* Copyright 2014 Dan Haywood
*
* Licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | ToDoAppToDoItemVetoSelectedMembersPermissions.ROLE_NAME) | 1 |
jacobhyphenated/PokerServer | src/main/java/com/hyphenated/card/service/PlayerActionServiceImpl.java | [
"public interface HandDao extends BaseDao<HandEntity>{\n\n}",
"public interface PlayerDao extends BaseDao<Player>{\n\n}",
"@Entity\n@Table(name=\"game\")\npublic class Game implements Serializable {\n\n\tprivate static final long serialVersionUID = -495064662454346171L;\n\tprivate long id;\n\tprivate int player... | import com.hyphenated.card.dao.PlayerDao;
import com.hyphenated.card.domain.Game;
import com.hyphenated.card.domain.HandEntity;
import com.hyphenated.card.domain.Player;
import com.hyphenated.card.domain.PlayerHand;
import com.hyphenated.card.domain.PlayerStatus;
import com.hyphenated.card.util.PlayerUtil;
import com.h... | /*
The MIT License (MIT)
Copyright (c) 2013 Jacob Kanipe-Illig
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, m... | public Player getPlayerById(String playerId){ | 4 |
tesseract4java/tesseract4java | ocrevalUAtion/src/main/java/eu/digitisation/Main.java | [
"public class Batch {\n\n int size;\n File[] files1;\n File[] files2;\n\n /**\n * Create a a batch of file pairs\n *\n * @param dir1\n * the first directory of files\n * @param dir2\n * the second directory of files\n * @throws InvalidObjectException\n ... | import eu.digitisation.input.Batch;
import eu.digitisation.input.Parameters;
import eu.digitisation.input.SchemaLocationException;
import eu.digitisation.input.WarningException;
import eu.digitisation.log.Messages;
import eu.digitisation.output.Report;
import java.io.File;
import java.io.InvalidObjectException;
import ... | package eu.digitisation;
/**
* Main class for ocrevalUAtion: version 0.92
*/
public class Main {
static final String helpMsg = "Usage:\t"
+ "ocrevalUAtion -gt file1"
+ "-ocr file2"
+ "[-e encoding]"
+ " [-o output_file_or_dir ] [-r equivalences_file]"
... | public static void main(String[] args) throws WarningException { | 2 |
R2RML-api/R2RML-api | r2rml-api-core/src/main/java/eu/optique/r2rml/api/model/impl/TriplesMapImpl.java | [
"@W3C_R2RML_Recommendation(R2RMLVocabulary.TYPE_LOGICAL_TABLE)\r\npublic interface LogicalTable extends MappingComponent {\r\n\r\n\t/**\r\n\t * Returns the effective SQL query of this LogicalTable. The effective SQL\r\n\t * query of a R2RMLView is it's own SQL query. For a SQLBaseTableOrView it's\r\n\t * \"SELECT *... | import eu.optique.r2rml.api.model.TriplesMap;
import eu.optique.r2rml.api.model.TermMap;
import org.apache.commons.rdf.api.BlankNodeOrIRI;
import org.apache.commons.rdf.api.RDF;
import org.apache.commons.rdf.api.Triple;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
impor... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ... | private ArrayList<PredicateObjectMap> pomList;
| 1 |
michal-michaluk/ddd-wro-warehouse | warehouse-infrastructure/src/main/java/warehouse/picklist/FifoViewProjection.java | [
"public class MultiMethod<T, R> {\n\n public static final Consumer<Exception> IGNORE = e -> {\n };\n public static final Consumer<Exception> PRINT_STACK_TRACE = Exception::printStackTrace;\n public static final Consumer<Exception> RETHROW = e -> {\n if (e instanceof RuntimeException) {\n ... | import tools.MultiMethod;
import warehouse.OpsSupport;
import warehouse.locations.Location;
import warehouse.products.ProductStockAgentRepository;
import warehouse.products.ProductStockEventStore;
import java.lang.invoke.MethodHandles;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentH... | package warehouse.picklist;
/**
* Manages in memory projection of fifo ordered picklists.
* Domain charatceristics of fifo ordered picklists view:
* <ul>
* <li>there is a lot of stored products without any activity, neither query nor update</li>
* <li>products scheduled today for delivery (limited subset of pro... | private final OpsSupport support; | 1 |
scriptkitty/SNC | unikl/disco/calculator/optimization/SimpleGradient.java | [
"public class Arrival implements Serializable {\r\n\t\r\n\t//Members\r\n\t\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate static final long serialVersionUID = 1079479343537123673L;\r\n\tprivate SymbolicFunction rho;\r\n\tprivate SymbolicFunction sigma;\r\n\tprivate Set<Integer> Arrivaldependencies;\r\n\tprivate Set<Intege... | import java.util.HashMap;
import java.util.Map;
import unikl.disco.calculator.symbolic_math.Arrival;
import unikl.disco.calculator.symbolic_math.Hoelder;
import unikl.disco.calculator.symbolic_math.ParameterMismatchException;
import unikl.disco.calculator.symbolic_math.ServerOverloadException;
import unikl.disco.... | /*
* (c) 2017 Michael A. Beck, Sebastian Henningsen
* disco | Distributed Computer Systems Lab
* University of Kaiserslautern, Germany
* All Rights Reserved.
*
* This software is work in progress and is released in the hope that it will
* be useful to the scientific community. It is provided "as i... | Map<Integer, Hoelder> allparameters = bound.getHoelderParameters();
| 1 |
PedroGomes/TPCw-benchmark | src/org/uminho/gsd/benchmarks/interfaces/Workload/AbstractWorkloadGeneratorFactory.java | [
"public class BenchmarkExecutor {\n\n //Node id\n private BenchmarkNodeID nodeId;\n\n //Benchmark interfaces\n private AbstractWorkloadGeneratorFactory workloadInterface;\n private AbstractDatabaseExecutorFactory databaseInterface;\n\n /**\n * number of clients on each benchmarking node *\n ... | import java.util.logging.Level;
import java.util.logging.Logger;
import org.uminho.gsd.benchmarks.benchmark.BenchmarkExecutor;
import org.uminho.gsd.benchmarks.benchmark.BenchmarkNodeID;
import org.uminho.gsd.benchmarks.dataStatistics.ResultHandler;
import org.uminho.gsd.benchmarks.helpers.JsonUtil;
import org.uminho.g... | /*
* *********************************************************************
* Copyright (c) 2010 Pedro Gomes and Universidade do Minho.
* All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy... | public abstract void finishExecution(List<ResultHandler> collected_results); | 2 |
dvanherbergen/robotframework-formslibrary | src/main/java/org/robotframework/formslibrary/operator/ButtonOperator.java | [
"public class FormsLibraryException extends RuntimeException {\n\n private static final long serialVersionUID = 1L;\n\n public static final boolean ROBOT_SUPPRESS_NAME = true;\n\n public FormsLibraryException(String message) {\n super(message);\n }\n\n public FormsLibraryException(Throwable t)... | import java.awt.Component;
import javax.swing.AbstractButton;
import org.robotframework.formslibrary.FormsLibraryException;
import org.robotframework.formslibrary.chooser.ByNameChooser;
import org.robotframework.formslibrary.util.ComponentType;
import org.robotframework.formslibrary.util.Logger;
import org.robotf... | package org.robotframework.formslibrary.operator;
/**
* Operator for working with (push)buttons.
*/
public class ButtonOperator extends AbstractComponentOperator {
/**
* Initialize a ButtonOperator with the specified button component.
*/
public ButtonOperator(Component component) {
super(co... | super(new ByNameChooser(identifier, ComponentType.ALL_BUTTON_TYPES));
| 1 |
talklittle/reddit-is-fun | src/com/andrewshu/android/reddit/browser/BrowserActivity.java | [
"public class CommentsListActivity extends ListActivity\n\t\timplements View.OnCreateContextMenuListener {\n\n\tprivate static final String TAG = \"CommentsListActivity\";\n\t\n // Group 2: subreddit name. Group 3: thread id36. Group 4: Comment id36.\n private final Pattern COMMENT_PATH_PATTERN = Pattern.comp... | import java.lang.reflect.Method;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import... | package com.andrewshu.android.reddit.browser;
public class BrowserActivity extends Activity {
private static final String TAG = "BrowserActivity";
private WebView webview;
private Uri mUri = null;
private String mThreadUrl = null;
private String mTitle = null;
// Common settings are stored here
pr... | if (Util.isLightTheme(mSettings.getTheme())) | 3 |
TritonHo/supportsmallshop-android | src/com/marspotato/supportsmallshop/CreateShopActivity.java | [
"public class CreateShopSubmission implements Serializable {\r\n\tprivate static final long serialVersionUID = 1L;\r\n\t\r\n\r\n\t\r\n\t@Expose\r\n\tpublic String id;\r\n\t@Expose\r\n\tpublic String helperId;\r\n\t@Expose\r\n\tpublic String name;\r\n\t@Expose\r\n\tpublic String shortDescription;\r\n\t@Expose\r\n\tp... | import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.net.URLEncoder;
import org.joda.time.DateTime;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.NetworkError;
import com.android.volley.NoConnectionError;
import com.androi... | package com.marspotato.supportsmallshop;
public class CreateShopActivity extends Activity implements GooglePlayServicesClient.ConnectionCallbacks, GooglePlayServicesClient.OnConnectionFailedListener, AuthCodeRequester
{
private static final String DRAFT_SUBMISSION = "draftSubmission";
private Bro... | LocalBroadcastManager.getInstance(this).registerReceiver(authCodeIntentReceiver, new IntentFilter(GcmIntentService.GCM_AUTH_CODE));
| 1 |
gamblore/AndroidPunk | sample/AndroidPunkTripZone/src/com/gamblore/tripzone/objects/tripzone/Spawner.java | [
"public class Main extends Engine {\r\n\r\n\tpublic static final String DATA_CURRENT_LEVEL = \"current_level\";\r\n\tpublic static final String DATA_DEATHS = \"deaths\";\r\n\t\r\n\tpublic static Atlas mAtlas;\r\n\t\r\n\tpublic static View view;\r\n\tpublic static Player player;\r\n\t\r\n\tpublic static boolean rest... | import com.gamblore.tripzone.Main;
import net.androidpunk.Entity;
import net.androidpunk.FP;
import net.androidpunk.graphics.atlas.SpriteMap;
import net.androidpunk.graphics.opengl.SubTexture;
| package com.gamblore.tripzone.objects.tripzone;
public class Spawner extends Entity {
public Spawner(int x, int y) {
super(x, y);
SubTexture spawner = Main.mAtlas.getSubTexture("Spawner");
| SpriteMap sm = new SpriteMap(spawner, spawner.getWidth()/3, spawner.getHeight());
| 3 |
spring-cloud/spring-cloud-cli | spring-cloud-cli/src/main/java/org/springframework/cloud/cli/command/CloudCommandFactory.java | [
"public class DecryptCommand extends OptionParsingCommand {\n\n\tpublic DecryptCommand() {\n\t\tsuper(\"decrypt\", \"Decrypt a string previsouly encrypted with the same key (or key pair)\",\n\t\t\t\tnew DecryptOptionHandler());\n\t}\n\n\t@Override\n\tpublic String getUsageHelp() {\n\t\treturn \"[options] <text>\";\... | import java.util.Arrays;
import java.util.Collection;
import org.springframework.boot.cli.command.Command;
import org.springframework.boot.cli.command.CommandFactory;
import org.springframework.cloud.cli.command.encrypt.DecryptCommand;
import org.springframework.cloud.cli.command.encrypt.EncryptCommand;
import org.spri... | /*
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | return Arrays.<Command>asList(new EncryptCommand(), new DecryptCommand(), new UrlEncodeCommand(), new UrlDecodeCommand(), new LauncherCommand()); | 4 |
mthli/Type | app/src/main/java/io/github/mthli/type/widget/adapter/TypeAdapter.java | [
"public class TypeBlockHolder extends RecyclerView.ViewHolder {\n private View quote;\n private View bullet;\n private KnifeText content;\n private TypeBlock type;\n\n public TypeBlockHolder(@NonNull View view) {\n super(view);\n this.quote = view.findViewById(R.id.quote);\n this... | import io.github.mthli.type.widget.model.TypeTitle;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import java.util.List;
import io.github.mthli.type.R;
import io.github.mthli.ty... | /*
* Copyright 2016 Matthew Lee
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | return new TypeBlockHolder(inflater.inflate(R.layout.recycler_item_block, parent, false)); | 0 |
Doist/JobSchedulerCompat | library/src/test/java/com/doist/jobschedulercompat/scheduler/jobscheduler/JobSchedulerJobServiceTest.java | [
"public class JobInfo {\n private static final String LOG_TAG = \"JobInfoCompat\";\n\n @IntDef({\n NETWORK_TYPE_NONE,\n NETWORK_TYPE_ANY,\n NETWORK_TYPE_UNMETERED,\n NETWORK_TYPE_NOT_ROAMING,\n NETWORK_TYPE_CELLULAR\n })\n @Retention(RetentionPolicy... | import com.doist.jobschedulercompat.JobInfo;
import com.doist.jobschedulercompat.job.JobStatus;
import com.doist.jobschedulercompat.job.JobStore;
import com.doist.jobschedulercompat.util.DeviceTestUtils;
import com.doist.jobschedulercompat.util.JobCreator;
import com.doist.jobschedulercompat.util.ShadowJobParameters;
i... | package com.doist.jobschedulercompat.scheduler.jobscheduler;
@RunWith(RobolectricTestRunner.class)
@Config(sdk = {Build.VERSION_CODES.LOLLIPOP, Build.VERSION_CODES.N, Build.VERSION_CODES.O, Build.VERSION_CODES.P},
shadows = {ShadowJobParameters.class, ShadowNetworkInfo.class})
public class JobSchedulerJob... | DeviceTestUtils.advanceTime(LATENCY_MS); | 3 |
guzhigang001/QNewsDemo | app/src/main/java/com/example/administrator/ggcode/Activity/MainActivity.java | [
"@SuppressWarnings(\"unused\") public class ActivityUtils {\n\n // 使用弱引用,避免不恰当地持有Activity或Fragment的引用。\n // 持有Activity的引用会阻止Activity的内存回收,增大OOM的风险。\n private WeakReference<Activity> activityWeakReference;\n private WeakReference<Fragment> fragmentWeakReference;\n\n private Toast toast;\n\n public ... | import android.Manifest;
import android.annotation.TargetApi;
import android.content.ContentUris;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Bitmap;
import androi... | package com.example.administrator.ggcode.Activity;
public class MainActivity extends AppCompatActivity {
private static final String TAG = "MainActivity------>";
@BindView(R.id.fl_content)
FrameLayout flContent;
@BindView (R.id.nv_left)
NavigationView nvLeft;
@BindView (R.id.dl_activity_m... | private AboutFragment aboutFragment; //关于 | 2 |
openshopio/openshop.io-android | app/src/main/java/bf/io/openshop/UX/fragments/PageFragment.java | [
"public class CONST {\n\n // TODO update this variable\n /**\n * Specific organization ID, received by successful integration.\n */\n public static final int ORGANIZATION_ID = 4;\n /**\n * ID used for simulate empty/null value\n */\n public static final int DEFAULT_EMPTY_ID = -131;\n\... | import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.Tex... | package bf.io.openshop.UX.fragments;
/**
* Fragment allow displaying useful information content like web page.
* Requires input argument - id of selected page. Pages are created in OpenShop server administration.
*/
public class PageFragment extends Fragment {
/**
* Name for input argument.
*/
... | url = String.format(EndPoints.PAGES_TERMS_AND_COND, SettingsMy.getActualNonNullShop(getActivity()).getId()); | 2 |
azinik/ADRMine | release/v1/java_src/rnlp/src/main/java/rainbownlp/machineLearning/featurecalculator/link/LinkGeneralFeatures.java | [
"@Entity\n@Table( name = \"FeatureValuePair\" )\npublic class FeatureValuePair {\n\tpublic enum FeatureName {\n\t\t// Document Features\n\t\tJournalTitle,\n\t\tCompletedYear,\n\t\tCreatedYear,\n\t\tRevisedYear,\n\t\tMESHHeading,\n\t\t\n\n\t\t// Paragraph Features\n\t\t// PositionInDoc,\n\n\t\t// Sentence Features\n... | import java.util.List;
import rainbownlp.core.FeatureValuePair;
import rainbownlp.core.Phrase;
import rainbownlp.core.PhraseLink;
import rainbownlp.core.FeatureValuePair.FeatureName;
import rainbownlp.machineLearning.IFeatureCalculator;
import rainbownlp.machineLearning.MLExample;
import rainbownlp.machineLearning.MLEx... | /**
*
*/
package rainbownlp.machineLearning.featurecalculator.link;
/**
* @author Azadeh
*
*/
public class LinkGeneralFeatures implements IFeatureCalculator {
public static void main (String[] args) throws Exception
{
String experimentgroup = "LinkClassificationEventEvent";
List<MLExample> trainExampl... | FileUtil.logLine(null, "Processed : "+counter +"/"+trainExamples.size()); | 7 |
Wootric/WootricSDK-Android | androidsdk/src/test/java/com/wootric/androidsdk/network/tasks/CheckEligibilityTaskTest.java | [
"public class SurveyValidator implements CheckEligibilityTask.Callback, GetRegisteredEventsTask.Callback {\n\n private OnSurveyValidatedListener onSurveyValidatedListener;\n private User user;\n private EndUser endUser;\n private Settings settings;\n private WootricRemoteClient wootricRemoteClient;\n... | import com.wootric.androidsdk.SurveyValidator;
import com.wootric.androidsdk.network.WootricRemoteClient;
import com.wootric.androidsdk.objects.EndUser;
import com.wootric.androidsdk.objects.Settings;
import com.wootric.androidsdk.objects.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.... | package com.wootric.androidsdk.network.tasks;
@RunWith(RobolectricTestRunner.class)
public class CheckEligibilityTaskTest {
@Mock WootricRemoteClient wootricRemoteClient;
@Test
public void testGet_RequestWithProperties() throws Exception {
EndUser endUser = new EndUser();
Settings sett... | SurveyValidator surveyValidator = new SurveyValidator(testUser(), endUser, settings, | 5 |
calibre2opds/calibre2opds | OpdsOutput/src/main/java/com/gmail/dpierron/calibre/gui/ReprocessEpubMetadataDialog.java | [
"public class ConfigurationManager {\r\n\r\n public static final String PROFILES_SUFFIX = \".profile.xml\";\r\n private final static String PROFILE_FILENAME = \"profile.xml\";\r\n private final static String DEFAULT_PROFILE = \"default\";\r\n public static final String LOGGING_PREFIX = \"log4j2.\";\r\n public ... | import com.gmail.dpierron.calibre.configuration.ConfigurationManager;
import com.gmail.dpierron.calibre.datamodel.Book;
import com.gmail.dpierron.calibre.datamodel.DataModel;
import com.gmail.dpierron.calibre.datamodel.Tag;
import com.gmail.dpierron.calibre.opds.Catalog;
import com.gmail.dpierron.tools.i18n.Locali... | package com.gmail.dpierron.calibre.gui;
/**
* @author David
*/
public class ReprocessEpubMetadataDialog extends javax.swing.JDialog {
private final static Logger logger = LogManager.getLogger(Catalog.class);
int maxScale;
double to30000;
int pos;
int position;
boolean stopThread = false;
... | java.util.List<Book> books = null;
| 1 |
tkrajina/10000sentences | 10000sentencesapp/src/main/java/info/puzz/a10000sentences/activities/EditAnnotationActivity.java | [
"public class Application extends android.app.Application {\n\n public static DiComponent COMPONENT;\n\n @Override\n public void onCreate() {\n super.onCreate();\n initIconify();\n initActiveAndroid();\n initDagger();\n }\n\n private void initDagger() {\n COMPONENT ... | import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import com.activeandroid.query.Select;
import org.apache.commons.la... | package info.puzz.a10000sentences.activities;
public class EditAnnotationActivity extends BaseActivity {
private static final String TAG = EditAnnotationActivity.class.getSimpleName();
private static final String ARG_ANNOTATION_ID = "arg_annotation_id";
@Inject
AnnotationService annotationServ... | Application.COMPONENT.injectActivity(this); | 0 |
googleapis/java-trace | google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/GrpcTraceServiceStub.java | [
"public static class ListTracesPagedResponse\n extends AbstractPagedListResponse<\n ListTracesRequest,\n ListTracesResponse,\n Trace,\n ListTracesPage,\n ListTracesFixedSizeCollection> {\n\n public static ApiFuture<ListTracesPagedResponse> createAsync(\n PageContext<ListT... | import static com.google.cloud.trace.v1.TraceServiceClient.ListTracesPagedResponse;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.core.BackgroundResourceAggregation;
import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | private static final MethodDescriptor<PatchTracesRequest, Empty> patchTracesMethodDescriptor = | 4 |
jjhesk/ToolBarLib | app/src/main/java/com/hkm/toolbarlib/TopBarManagerExample.java | [
"@Deprecated\npublic enum LayoutAsset {\n classic_1(R.layout.material_search_ios_classic),\n classic_2(R.layout.material_search_ios),\n classic_3(R.layout.material_search_ios_simple),\n //button title/logo button button\n i_logo_ii(R.layout.i_t_ii),\n //button title/logo button dynamic_button\n ... | import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view... | package com.hkm.toolbarlib;
/**
* Created by hesk on 31/7/15.
*/
public class TopBarManagerExample extends AppCompatActivity {
private ActionBar actionbar;
private TopBarManager worker; | private LiveIcon dynamic_icon; | 1 |
stoussaint/spring-data-marklogic | src/test/java/com/_4dconcept/springframework/data/marklogic/repository/query/PartTreeMarklogicQueryTest.java | [
"public interface MarklogicOperations {\n\n /**\n * Insert the given object.\n * Content will be converted if not one of supported type.\n * Uri will be computed as well as creation options (such as defaultCollection)\n * Insert is used to initially store the object into the database. To update a... | import com._4dconcept.springframework.data.marklogic.core.MarklogicOperations;
import com._4dconcept.springframework.data.marklogic.core.convert.MappingMarklogicConverter;
import com._4dconcept.springframework.data.marklogic.core.convert.MarklogicConverter;
import com._4dconcept.springframework.data.marklogic.core.mapp... | /*
* Copyright 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | private MarklogicOperations marklogicOperationsMock; | 0 |
bourgesl/marlin-fx | src/main/java/com/sun/marlin/ByteArrayCache.java | [
"static final int[] ARRAY_SIZES = new int[BUCKETS];",
"static final int BUCKETS = 8;",
"static final int MAX_ARRAY_SIZE;",
"public static void logInfo(final String msg) {\n if (MarlinConst.USE_LOGGER) {\n LOG.info(msg);\n } else if (MarlinConst.ENABLE_LOGS) {\n System.out.print(\"INFO: \")... | import java.lang.ref.WeakReference;
import java.util.Arrays;
import com.sun.marlin.ArrayCacheConst.BucketStats;
import com.sun.marlin.ArrayCacheConst.CacheStats;
import static com.sun.marlin.ArrayCacheConst.ARRAY_SIZES;
import static com.sun.marlin.ArrayCacheConst.BUCKETS;
import static com.sun.marlin.ArrayCacheConst.M... | /*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free ... | buckets = new Bucket[BUCKETS]; | 1 |
apache/commons-proxy | cglib/src/main/java/org/apache/commons/proxy2/cglib/CglibProxyFactory.java | [
"public interface Interceptor extends Serializable\n{\n //******************************************************************************************************************\n // Other Methods\n //***************************************************************************************************************... | import org.apache.commons.proxy2.Invocation;
import org.apache.commons.proxy2.Invoker;
import org.apache.commons.proxy2.ObjectProvider;
import org.apache.commons.proxy2.ProxyUtils;
import org.apache.commons.proxy2.impl.AbstractSubclassingProxyFactory;
import java.io.Serializable;
import java.lang.reflect.Method;
import... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | public <T> T createInvokerProxy(ClassLoader classLoader, Invoker invoker, Class<?>... proxyClasses) | 2 |
norbertmartin12/site-monitor | app/src/main/java/org/site_monitor/receiver/internal/NetworkBroadcastReceiver.java | [
"@DatabaseTable\npublic class SiteCall implements Parcelable {\n public static final Creator<SiteCall> CREATOR = new Creator<SiteCall>() {\n @Override\n public SiteCall createFromParcel(Parcel in) {\n return new SiteCall(in);\n }\n\n @Override\n public SiteCall[] new... | import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.ConnectivityManager;
import android.util.Log;
import org.site_monitor.BuildConfig;
import org.site_monitor.model.bo.SiteCall;
import org.site_monitor.model.bo.SiteS... | /*
* Copyright (c) 2016 Martin Norbert
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | } else if (FavIconService.ACTION_FAVICON_UPDATED.equals(intent.getAction())) { | 2 |
Idrinths-Stellaris-Mods/Mod-Tools | src/test/java/de/idrinth/stellaris/modtools/process2prepatchcleaning/RemoveOverwrittenFilePatchTest.java | [
"@NamedQueries({\n @NamedQuery(\n name = \"patch.any\",\n query = \"select f from Patch f\"\n )\n})\n@Entity\npublic class Patch extends EntityCompareAndHash {\n\n @Id\n @GeneratedValue\n private long aid;\n @ManyToOne(fetch = FetchType.LAZY)\n protected Modification mod;\... | import de.idrinth.stellaris.modtools.persistence.entity.Patch;
import de.idrinth.stellaris.modtools.abstract_cases.TestATask;
import de.idrinth.stellaris.modtools.persistence.entity.Modification;
import de.idrinth.stellaris.modtools.persistence.entity.Original;
import de.idrinth.stellaris.modtools.process.ProcessTask;
... | /*
* Copyright (C) 2017 Björn Büttner
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is dist... | Modification mod1 = new Modification("",1); | 2 |
xushaomin/apple-boot | apple-boot-tomcat9/src/main/java/com/appleframework/boot/Main.java | [
"public interface Container {\r\n\t\r\n\tpublic static final String DEFAULT_TYPE = \"container\";\r\n\tpublic static final String TYPE_KEY = \"type\";\r\n\tpublic static final String ID_KEY = \"id\";\r\n\t\t\r\n\t/**\r\n * name.\r\n */\r\n\tpublic String getName();\r\n \r\n\t/**\r\n * type.\r\n *... | import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.appleframework.boot.core.Container;
import com.appleframework.boot.core.ContainerFactory;
import com.appleframework.boot.core.Container... | package com.appleframework.boot;
/**
* spring+Jetty的容器
*
* @author Cruise.Xu
*/
public class Main {
private static Logger logger = LoggerFactory.getLogger(Main.class);
public static final String SHUTDOWN_HOOK_KEY = "shutdown.hook";
protected static volatile boolean runni... | containers.add(ContainerFactory.create(SpringContainer.class));
| 5 |
dannormington/appengine-cqrs | src/main/java/com/cqrs/appengine/sample/handlers/commands/RegisterAttendeeCommandHandler.java | [
"public class AggregateNotFoundException extends AggregateException {\n\n\tprivate static final String ERROR_TEXT = \"The aggregate you requested cannot be found.\";\n\t\n\tprivate static final long serialVersionUID = 1L;\n\n\t/**\n\t * Constructor\n\t * \n\t * @param aggregateId\n\t */\n\tpublic AggregateNotFoundE... | import com.cqrs.appengine.core.exceptions.AggregateNotFoundException;
import com.cqrs.appengine.core.exceptions.EventCollisionException;
import com.cqrs.appengine.core.exceptions.HydrationException;
import com.cqrs.appengine.core.messaging.CommandHandler;
import com.cqrs.appengine.core.persistence.EventRepository;
impo... | package com.cqrs.appengine.sample.handlers.commands;
public class RegisterAttendeeCommandHandler implements CommandHandler<RegisterAttendee> {
@Override
public void handle(RegisterAttendee command) throws EventCollisionException, HydrationException {
Repository<Attendee> repository = new EventReposi... | } catch (AggregateNotFoundException e) { | 0 |
hidekatsu-izuno/wmf2svg | src/main/java/net/arnx/wmf2svg/gdi/wmf/WmfParser.java | [
"public interface Gdi {\r\n public static final int OPAQUE = 2;\r\n public static final int TRANSPARENT = 1;\r\n\r\n public static final int TA_BASELINE = 24;\r\n public static final int TA_BOTTOM = 8;\r\n public static final int TA_TOP = 0;\r\n public static final int TA_CENTER = 6;\r\n public... | import java.io.BufferedInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteOrder;
import java.util.logging.Logger;
import net.arnx.wmf2svg.gdi.Gdi;
import net.arnx.wmf2svg.gdi.GdiBrush;
import net.arnx.wmf2svg.gdi.GdiObject;
import net.arnx.wmf2svg.gdi.G... | if (id == RECORD_EOF) {
break; // Last record
}
in.setCount(0);
switch (id) {
case RECORD_REALIZE_PALETTE: {
gdi.realizePalette();
break;
}
case RECORD_SET_PALETTE_ENTRIES: {
int[] entries = new int[in.readUint16()];
int startIndex = in.readUint16();
int objID... | gdi.fillRgn((GdiRegion) objs[rgnID], (GdiBrush) objs[brushID]); | 1 |
aurbroszniowski/Rainfall-core | src/main/java/io/rainfall/execution/RunsDuring.java | [
"public abstract class Configuration {\n\n public abstract List<String> getDescription();\n\n}",
"public abstract class Execution {\n\n public enum ExecutionState {\n UNKNOWN,\n BEGINNING,\n ENDING\n }\n\n /**\n * Provide an easy way to mark all operations as underway.\n *\n * @param scenario t... | import io.rainfall.AssertionEvaluator;
import io.rainfall.Configuration;
import io.rainfall.Execution;
import io.rainfall.Scenario;
import io.rainfall.TestException;
import io.rainfall.configuration.ConcurrencyConfig;
import io.rainfall.statistics.StatisticsHolder;
import io.rainfall.unit.Over;
import io.rainfall.unit.... | /*
* Copyright (c) 2014-2022 Aurélien Broszniowski
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | public RunsDuring(final int nb, final TimeDivision timeDivision) { | 5 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/fragment/NewsFragment.java | [
"public abstract class BenihRecyclerListener extends RecyclerView.OnScrollListener\n{\n private int previousTotal = 0;\n private boolean loading = true;\n private int visibleThreshold = 3;\n private int firstVisibleItem;\n private int visibleItemCount;\n private int totalItemCount;\n private in... | import id.zelory.codepolitan.data.LocalDataManager;
import id.zelory.codepolitan.ui.ListArticleActivity;
import id.zelory.codepolitan.ui.ReadActivity;
import id.zelory.codepolitan.ui.adapter.NewsAdapter;
import timber.log.Timber;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.... | /*
* Copyright (c) 2015 Zelory.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | LocalDataManager.saveArticles(newsHeaderEvent.getArticles()); | 5 |
boybeak/BeMusic | app/src/main/java/com/nulldreams/bemusic/activity/PlayDetailActivity.java | [
"public abstract class Intents {\n\n public static void viewMyAppOnStore (Context context) {\n viewAppOnStore(context, context.getPackageName());\n }\n\n public static void viewAppOnStore (Context context, String packageName) {\n Uri uri = Uri.parse(\"market://details?id=\" + packageName);\n ... | import android.Manifest;
import android.animation.ObjectAnimator;
import android.app.WallpaperManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.media.RingtoneM... |
dialog.setContentView(rv);
dialog.show();
}
}
private boolean isSeeking = false;
private SeekBar.OnSeekBarChangeListener mSeekListener = new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fr... | Intents.shareImage(PlayDetailActivity.this, getResources().getString(R.string.title_dialog_send_to), album.getAlbumArt()); | 0 |
taskadapter/redmine-java-api | src/test/java/com/taskadapter/redmineapi/internal/RedmineJSONDefaultsTest.java | [
"public class Issue implements Identifiable, FluentStyle {\n\n private final PropertyStorage storage = new PropertyStorage();\n\n public final static Property<Integer> DATABASE_ID = new Property<>(Integer.class, \"id\");\n public final static Property<String> SUBJECT = new Property<>(String.class, \"subjec... | import com.taskadapter.redmineapi.bean.Issue;
import com.taskadapter.redmineapi.bean.IssueRelation;
import com.taskadapter.redmineapi.bean.Project;
import com.taskadapter.redmineapi.bean.TimeEntry;
import com.taskadapter.redmineapi.internal.json.JsonObjectParser;
import org.json.JSONException;
import org.json.JSONObjec... | package com.taskadapter.redmineapi.internal;
/**
* Tests for default values for redmine parser.
*/
public class RedmineJSONDefaultsTest {
@Test
public void testProjectDefaults() throws JSONException {
final String MINIMAL_PROJECT = "{\"project\":{\"created_on\":\"2012/05/16 01:08:56 -0700\",\"identifier\":\"te... | final Issue issue = parse(MINIMAL_ISSUE, "issue", RedmineJSONParser::parseIssue); | 0 |
undertow-io/jastow | src/main/java/org/apache/jasper/servlet/JspServlet.java | [
"public class Constants {\n\n /**\n * The servlet context attribute under which we record the Servlet API version\n * support declared for this webapp.\n */\n public static final String SERVLET_VERSION =\n \"org.apache.jasper.SERVLET_VERSION\";\n\n\n /**\n * The servlet context attri... | import static org.apache.jasper.JasperMessages.MESSAGES;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.net.MalformedURLException;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedEx... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | private final transient JasperLogger log = JasperLogger.SERVLET_LOGGER; | 2 |
openshopio/openshop.io-android | app/src/main/java/bf/io/openshop/UX/fragments/PageFragment.java | [
"public class CONST {\n\n // TODO update this variable\n /**\n * Specific organization ID, received by successful integration.\n */\n public static final int ORGANIZATION_ID = 4;\n /**\n * ID used for simulate empty/null value\n */\n public static final int DEFAULT_EMPTY_ID = -131;\n\... | import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.Tex... | package bf.io.openshop.UX.fragments;
/**
* Fragment allow displaying useful information content like web page.
* Requires input argument - id of selected page. Pages are created in OpenShop server administration.
*/
public class PageFragment extends Fragment {
/**
* Name for input argument.
*/
... | GsonRequest<Page> getPage = new GsonRequest<>(Request.Method.GET, url, null, Page.class, | 5 |
2fast2fourier/something.apk | Something/src/main/java/net/fastfourier/something/SomeApplication.java | [
"public class SomeDatabase extends FastDatabase {\n public static final int DB_VERSION = 4;\n\n public static final String TABLE_SAVED_DRAFT = \"saved_reply\";\n public static final String TABLE_FORUM = \"forum\";\n public static final String TABLE_STARRED_FORUM = \"starred_forum\";\n\n public static... | import android.app.Application;
import android.webkit.CookieSyncManager;
import com.salvadordalvik.fastlibrary.request.FastVolley;
import com.squareup.otto.Bus;
import net.fastfourier.something.data.SomeDatabase;
import net.fastfourier.something.util.MustCache;
import net.fastfourier.something.util.OkHttpStack;
import ... | package net.fastfourier.something;
/**
* Created by matthewshepard on 1/17/14.
*/
public class SomeApplication extends Application {
public static final Bus bus = new Bus();
@Override
public void onCreate() {
super.onCreate(); | SomeDatabase.init(this); | 0 |
RockinChaos/ItemJoin | src/me/RockinChaos/itemjoin/listeners/Commands.java | [
"public class ItemHandler {\n\t\n /**\n * Adds a list of lores to the specified ItemStack.\n * \n * @param item - The ItemStack to be modified.\n * @param lores - The list of lores to be added to the item.\n * @return The ItemStack with its newly added lores.\n */\n\tpublic static ItemStack addL... | import java.util.HashMap;
import java.util.ListIterator;
import java.util.Set;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;... | /*
* ItemJoin
* Copyright (C) CraftationGaming <https://www.craftationgaming.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | if (ServerUtils.hasSpecificUpdate("1_16")) { | 5 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/component/infinispan/bolt/InfinispanStoreBolt.java | [
"public abstract class AmBaseBolt extends AmConfigurationBolt\n{\n /** serialVersionUID */\n private static final long serialVersionUID = 1546366821557201305L;\n\n /** Logger */\n private static final Logger logger = LoggerFactory.getLogger(AmBaseBolt.class)... | import java.text.MessageFormat;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import acromusashi.stream.bolt.AmBaseBolt;
import acromusashi.stream.component.infinispan.CacheHelper;
import acromusashi.stream.component.infinispan.TupleCacheMapper;
import acromusashi.stream.entity.StreamMe... | /**
* Copyright (c) Acroquest Technology Co, Ltd. All Rights Reserved.
* Please read the associated COPYRIGHTS file for more details.
*
* THE SOFTWARE IS PROVIDED BY Acroquest Technolog Co., Ltd.,
* WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FIT... | catch (ConvertFailException ex) | 4 |
INVASIS/Viola-Jones | src/process/ImageEvaluator.java | [
"public class ImageHandler {\n\n private BufferedImage bufferedImage;\n private int width;\n private int height;\n private int[][] crGrayImage;// Centered & reduced gray image\n private int[][] integralImage;\n private final String filePath;\n\n private void init() {\n this.crGrayImage =... | import GUI.ImageHandler;
import cuda.AnyFilter;
import cuda.HaarDetector;
import javafx.util.Pair;
import org.jgrapht.UndirectedGraph;
import org.jgrapht.alg.ConnectivityInspector;
import org.jgrapht.graph.DefaultEdge;
import org.jgrapht.graph.SimpleGraph;
import process.features.Face;
import process.features.Rectangle... | package process;
public class ImageEvaluator {
private static final float SCALE_COEFF = 1.25f;
private int trainWidth;
private int trainHeight;
private int layerCount;
private int confidenceThreshold = 0;
private ArrayList<ArrayList<StumpRule>> cascade;
private ArrayList<Float> twea... | public ArrayList<Face> getFaces(String fileName, boolean postProcess) { | 3 |
kinnla/eniac | src/eniac/menu/action/gui/OpenConfigurationPanel.java | [
"public class Manager {\n\n\t/*\n\t * ========================= applet lifecycle states =======================\n\t */\n\n\tpublic enum LifeCycle {\n\n\t\t/**\n\t\t * Default lifecycle state on startup\n\t\t */\n\t\tDEFAULT,\n\n\t\t/**\n\t\t * Livecycle state indicating a successful initialization\n\t\t */\n\t\tINI... | import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import... | /*******************************************************************************
* Copyright (c) 2003-2005, 2013 Till Zoppke.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available... | _textArea = new JTextArea(StringConverter.toInt(EProperties.getInstance().getProperty("TEXT_AREA_ROWS")), | 4 |
d-sauer/JCalcAPI | src/main/java/org/jdice/calc/internal/CacheExtension.java | [
"public class CalculatorException extends RuntimeException {\n\n private static final long serialVersionUID = 1L;\n\n \n public CalculatorException(Throwable t) {\n super(t);\n }\n\n public CalculatorException(String message) {\n super(message);\n }\n\n public CalculatorException(... | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map.Entry;
import org.jdice.calc.CalculatorException;
import org.jdice.calc.Function;
import org.jdice.calc.NumConverter;
import org.jdice.calc.Operator;
import org.jdice.calc.Properties;... | /*
* Copyright 2014 Davor Sauer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | throw new CalculatorException(e);
| 0 |
spring-cloud/spring-cloud-zookeeper | spring-cloud-zookeeper-discovery/src/main/java/org/springframework/cloud/zookeeper/discovery/configclient/ZookeeperConfigServerBootstrapper.java | [
"public abstract class CuratorFactory {\n\n\tprivate static final Log log = LogFactory.getLog(ZookeeperAutoConfiguration.class);\n\n\tpublic static CuratorFramework curatorFramework(ZookeeperProperties properties, RetryPolicy retryPolicy,\n\t\t\tSupplier<Stream<CuratorFrameworkCustomizer>> optionalCuratorFrameworkC... | import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.x.discovery.ServiceDiscovery;
import org.apache.curator.x.discovery.ServiceDiscoveryBuilder;
import org.apache.curator.x.discovery.details.InstanceSerializer;
import org.apache.curator.x.discovery.details.JsonInstanceSerializer;
import org.... | /*
* Copyright 2015-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | return new JsonInstanceSerializer<>(ZookeeperInstance.class); | 3 |
ewidgetfx/ewidgetfx | ewidgets/Ticker/src/main/java/org/thehecklers/ticker/Ticker.java | [
"public abstract class DefaultWidget extends Pane implements Widget {\n\n private final StringProperty name = new SimpleStringProperty();\n private final StringProperty version = new SimpleStringProperty();\n private String description;\n private String vendor;\n private String vendorUrl;\n privat... | import javafx.animation.AnimationTimer;
import javafx.geometry.Bounds;
import javafx.geometry.Rectangle2D;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.shape.SVGPath;
import javafx.scene.text.Font... | /*
* Copyright 2013 eWidgetFX.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | public WidgetIcon buildWidgetIcon() { | 3 |
lemberg/d8androidsdk | DrupalSDK/src/main/java/com/ls/util/image/DrupalImageView.java | [
"public abstract class AbstractBaseDrupalEntity implements DrupalClient.OnResponseListener, ICharsetItem\n{\n\ttransient private DrupalClient drupalClient; \n\n\ttransient private Snapshot snapshot;\n\n\t/**\n\t * In case of request canceling - no method will be triggered.\n\t * \n\t * @author lemberg\n\t * \n\t */... | import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.widget.ImageView;
import com.android.volley.VolleyError;
import com.ls.drupal.AbstractBaseDrupalEntity;
import com.ls.drupal.D... | }
public ImageLoadingListener getImageLoadingListener() {
return imageLoadingListener;
}
public void setImageLoadingListener(ImageLoadingListener imageLoadingListener) {
this.imageLoadingListener = imageLoadingListener;
}
public DrupalClient getLocalClient() {
return ... | public void onRequestCompleted(AbstractBaseDrupalEntity entity, Object tag, ResponseData data) { | 3 |
peshkira/c3po | c3po-core/src/main/java/com/petpet/c3po/analysis/ProfileGenerator.java | [
"public interface PersistenceLayer {\n\n /**\n * Clears the current cache of the application. This includes the\n * {@link Cache}, but also any other cached information that the backend\n * provider might have stored (e.g. cached statistics and aggregations).\n */\n void clearCache();\n\n /**\n * This ... | import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
impo... | /*******************************************************************************
* Copyright 2013 Petar Petrov <me@petarpetrov.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | List<FilterCondition> conditions = filter.getConditions(); | 4 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/ConditionFormatterFactory.java | [
"public interface Callback<T> {\r\n\r\n /**\r\n * 適用可能なロケールかどうか。\r\n * @since 0.5\r\n * @param locale ロケール情報。\r\n * @return\r\n */\r\n boolean isApplicable(Locale locale);\r\n\r\n /**\r\n * フォーマットの後に実行する処理。\r\n * @param data 変換元のデータ\r\n * @param value フォーマットされた値。\r\n * @... | import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.mygreen.cellformatter.callback.Callback;
import com.github.mygreen.cellformatter.callback.DBNum1;
import com.github.mygreen.cellformatter.callback.DBNum2;
import com.github.m... | package com.github.mygreen.cellformatter;
/**
* 条件付きの書式の組み立てるための抽象クラス。
* <p>主にテンプレートメソッドの実装を行う。
*
* @version 0.10
* @author T.TSUCHIE
* @param <F> 組み立てるフォーマッタクラス
*/
public abstract class ConditionFormatterFactory<F> {
private static Logger logger = LoggerFactory.getLogger(ConditionForma... | protected boolean isConditionOperator(final Token.Condition token) {
| 6 |
upenn-libraries/solrplugins | src/main/java/org/apache/solr/handler/component/FacetComponent.java | [
"public interface FacetParams {\n\n /**\n * Should facet counts be calculated?\n */\n public static final String FACET = \"facet\";\n\n /**\n * Numeric option indicating the maximum number of threads to be used\n * in counting facet field vales \n */\n public static final String FACET_THREADS = FACET ... | import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import... | throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
"No pivot refinement response from shard: " + srsp.getShard());
}
for (Entry<String,List<NamedList<Object>>> pivotFacetResponseFromShard : pivotFacetResponsesFromShard) {
PivotFacet masterPi... | env = new DistribEnv(dff.offset, dff.limit, targetIdx, | 3 |
zer0Black/zer0MQTTServer | zer0MQTTServer/src/com/syxy/protocol/mqttImp/process/Impl/dataHandler/MapDBPersistentStore.java | [
"public enum QoS {\n\tAT_MOST_ONCE (0),\n\tAT_LEAST_ONCE (1),\n\tEXACTLY_ONCE (2),\n\tRESERVE(3);\n\t\n\tfinal public int val;\n\t\n\tQoS(int val) {\n\t\tthis.val = val;\n\t}\n\t\n\t/**\n\t * 获取类型对应的值\n\t * @return int\n\t * @author zer0\n\t * @version 1.0\n\t * @date 2016-3-3\n\t */\n\tpublic int value() {\n\t\t... | import io.netty.buffer.ByteBuf;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import org.apach... | package com.syxy.protocol.mqttImp.process.Impl.dataHandler;
/**
* 对数据进行保存,视情况决定是临时保存还是持久化保存
*
* @author zer0
* @version 1.0
* @date 2015-7-7
*/
public class MapDBPersistentStore implements IMessagesStore, ISessionStore {
private final static Logger Log = Logger.getLogger(MapDBPersistentStore.class);
/... | private ConcurrentMap<String, List<PublishEvent>> persistentOfflineMessage; | 4 |
trustsystems/elfinder-java-connector | src/main/java/br/com/trustsystems/elfinder/command/SearchCommand.java | [
"public final class ElFinderConstants {\n\n //global constants\n public static final int ELFINDER_TRUE_RESPONSE = 1;\n public static final int ELFINDER_FALSE_RESPONSE = 0;\n\n //options\n public static final String ELFINDER_VERSION_API = \"2.1\";\n\n //security\n // regex that matches any chara... | import br.com.trustsystems.elfinder.ElFinderConstants;
import br.com.trustsystems.elfinder.core.Target;
import br.com.trustsystems.elfinder.core.Volume;
import br.com.trustsystems.elfinder.core.VolumeSecurity;
import br.com.trustsystems.elfinder.service.ElfinderStorage;
import br.com.trustsystems.elfinder.service.Volum... | /*
* #%L
* %%
* Copyright (C) 2015 Trustsystems Desenvolvimento de Sistemas, LTDA.
* %%
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice... | VolumeSecurity volumeSecurity = elfinderStorage.getVolumeSecurity(volumeRoot); | 3 |
poolik/classfinder | src/main/java/com/poolik/classfinder/ClassFinder.java | [
"public interface ClassFilter {\n /**\n * Tests whether a class name should be included in a class name\n * list.\n * @return <tt>true</tt> if and only if the name should be included\n * in the list; <tt>false</tt> otherwise\n */\n public boolean accept(ClassInfo classInfo, ClassHierarchyResolver hierar... | import com.poolik.classfinder.filter.ClassFilter;
import com.poolik.classfinder.info.ClassInfo;
import com.poolik.classfinder.resourceLoader.AdditionalResourceLoader;
import com.poolik.classfinder.resourceLoader.JarClasspathEntriesLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
imp... | /*---------------------------------------------------------------------------*\
$Id$
---------------------------------------------------------------------------
This software is released under a BSD-style license:
Copyright (c) 2004-2007 Brian M. Clapper. All rights reserved.
Redistribution and use in sourc... | private static Collection<AdditionalResourceLoader> resourceLoaders = Arrays.<AdditionalResourceLoader>asList(new JarClasspathEntriesLoader()); | 3 |
mfornos/humanize | humanize-slim/src/main/java/humanize/spi/context/DefaultContext.java | [
"public static final String EMPTY = \"\";",
"public static final String SPACE = \" \";",
"public class MessageFormat extends ExtendedMessageFormat\n{\n\n private static final long serialVersionUID = -5384364921909539710L;\n\n private final static Map<String, FormatFactory> formatFactories = loadFormatFact... | import static humanize.util.Constants.EMPTY;
import static humanize.util.Constants.SPACE;
import humanize.spi.MessageFormat;
import humanize.spi.cache.CacheProvider;
import humanize.text.MaskFormat;
import humanize.time.PrettyTimeFormat;
import humanize.util.UTF8Control;
import java.text.DateFormat;
import java.text.De... | package humanize.spi.context;
/**
* Default implementation of {@link Context}.
*
* @author mfornos
*
*/
public class DefaultContext implements Context, StandardContext
{
private static final String BUNDLE_LOCATION = "i18n.Humanize";
private static final String ORDINAL_SUFFIXES = "ordinal.suffixes";
... | private final static CacheProvider sharedCache = loadCacheProvider(); | 3 |
googlearchive/androidtv-Leanback | app/src/main/java/com/example/android/tvleanback/ui/VideoDetailsFragment.java | [
"public final class VideoContract {\n\n // The name for the entire content provider.\n public static final String CONTENT_AUTHORITY = \"com.example.android.tvleanback\";\n\n // Base of all URIs that will be used to contact the content provider.\n public static final Uri BASE_CONTENT_URI = Uri.parse(\"co... | import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import androidx.leanba... | /*
* Copyright (c) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | args.putString(VideoContract.VideoEntry._ID, videoId); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.