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 |
|---|---|---|---|---|---|---|
webdriverextensions/webdriverextensions | src/test/java/com/github/webdriverextensions/model/WebDriverExtensionRepository.java | [
"public abstract class WebRepository {\n\n public void initElements() {\n PageFactory.initElements(new WebDriverExtensionFieldDecorator(WebDriverExtensionsContext.getDriver()), this);\n }\n\n public void initElements(WebDriver driver) {\n PageFactory.initElements(new WebDriverExtensionFieldDe... | import com.github.webdriverextensions.WebRepository;
import com.github.webdriverextensions.generator.annotations.AddToRepository;
import com.github.webdriverextensions.generator.annotations.AddToWebSite;
import com.github.webdriverextensions.junitrunner.WebDriverRunner;
import com.github.webdriverextensions.junitrunner... | package com.github.webdriverextensions.model;
public class WebDriverExtensionRepository extends WebRepository {
public final String url = "file://" + getClass().getResource("/html/model-test.html").getPath();
Double delayTime = 0.0;
@FindBy(css = "div.btn-group")
Menu menu;
@FindBy(css = "html") | Body html; | 4 |
ZunoZap/zunozap | ZunoZap/src/main/java/com/zunozap/ZunoZap.java | [
"public static void addSwitch(String... toAdd) {\n switches.addAll(Arrays.asList(toAdd));\n}",
"public static VBox GENERAL = new VBox(), ADVANCED = new VBox(), BKMARK = new VBox(), DS = new VBox();",
"@DefaultProperty(value = \"content\")\npublic class JFXDialog extends StackPane {\n\n private StackPane c... | import static com.javazilla.chromium.BrowserPreferences.addSwitch;
import static com.zunozap.Settings.ADVANCED;
import static com.zunozap.Settings.BKMARK;
import static com.zunozap.Settings.DS;
import static com.zunozap.Settings.GENERAL;
import java.io.IOException;
import java.util.HashMap;
import com.jfoenix.controls.... | package com.zunozap;
public class ZunoZap extends Application {
public static final String NAME = "ZunoZap";
public static final String VERSION = "10.1";
public static TabPane tb;
public static boolean firstRun;
public static Settings s;
public static void main(String[] args) throws IOExc... | if (Options.PPS.b) addSwitch("--process-per-site"); | 0 |
syd711/mephisto_iii | src/main/java/de/calette/mephisto3/ui/AlbumBox.java | [
"public class Mephisto3 extends Application {\n public static final int WIDTH = Callete.getConfiguration().getInt(\"width\", 700);\n public static final int HEIGHT = Callete.getConfiguration().getInt(\"height\", 395);\n public static StackPane rootStack;\n\n public static void main(String[] args) {\n launch(... | import callete.api.Callete;
import callete.api.services.impl.music.network.Mp3Folder;
import callete.api.services.music.model.Album;
import callete.api.services.music.model.PlaylistItem;
import callete.api.services.music.model.Song;
import callete.api.services.music.player.PlaybackChangeEvent;
import callete.api.servic... | package de.calette.mephisto3.ui;
/**
* Pane this displays the album cover, name and artist for the slider.
*/
public class AlbumBox extends ControllableHBoxItemPanelBase<Album> implements ControlListener, PlaybackChangeListener {
private final static Logger LOG = LoggerFactory.getLogger(AlbumBox.class);
publ... | public static final int TRACKS_BOX_WIDTH = Mephisto3.WIDTH-COVER_WIDTH-10; | 0 |
l0s/fernet-java8 | fernet-jersey-auth/src/test/java/com/macasaet/fernet/jersey/example/tokeninjection/ExampleTokenInjectionApplication.java | [
"@SuppressWarnings({\"PMD.AvoidDuplicateLiterals\", \"PMD.TooManyMethods\"})\npublic class Key {\n\n private final byte[] signingKey;\n private final byte[] encryptionKey;\n\n /**\n * Create a Key from individual components.\n *\n * @param signingKey\n * a 128-bit (16 byte) key f... | import com.macasaet.fernet.jersey.example.common.KeySupplier;
import com.macasaet.fernet.jersey.example.common.Session;
import com.macasaet.fernet.jersey.example.common.SessionRepository;
import com.macasaet.fernet.jersey.example.common.UserRepository;
import java.util.Collection;
import java.util.function.Supplier;
im... | /**
Copyright 2018 Carlos Macasaet
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 ... | register(AuthenticationResource.class); | 3 |
google/mug | mug/src/test/java/com/google/mu/util/SelectionTest.java | [
"@SuppressWarnings(\"unchecked\")\nstatic <T> Selection<T> all() {\n return (Selection<T>) Selections.ALL;\n}",
"static <T> Selection<T> nonEmptyOrAll(Collection<? extends T> choices) {\n return choices.isEmpty() ? all() : choices.stream().collect(toSelection());\n}",
"@SuppressWarnings(\"unchecked\")\nstatic... | import org.junit.runners.JUnit4;
import com.google.common.collect.ImmutableSet;
import com.google.common.testing.EqualsTester;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.Truth8.assertThat;
import static com.google.mu.util.Selection.all;
import static com.google.mu.util... | /*****************************************************************************
* ------------------------------------------------------------------------- *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you may not use this file except in compliance with the License. *
* Y... | assertThat(nonEmptyOrAll(asList()).limited()).isEmpty(); | 1 |
Lzw2016/fastdfs-java-client | src/test/java/org/cleverframe/fastdfs/client/DefaultTrackerClientTest.java | [
"public class DefaultCommandExecutor implements CommandExecutor {\n /**\n * 日志\n */\n private static final Logger logger = LoggerFactory.getLogger(DefaultCommandExecutor.class);\n\n /**\n * Tracker定位\n */\n private TrackerLocator trackerLocator;\n\n /**\n * 连接池\n */\n priva... | import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;
import org.cleverframe.fastdfs.conn.DefaultCommandExecutor;
import org.cleverframe.fastdfs.model.GroupState;
import org.cleverframe.fastdfs.model.StorageNode;
import org.cleverframe.fastdfs.model.StorageNodeInfo;
import org.cleverframe.fastdfs.model.Sto... | package org.cleverframe.fastdfs.client;
/**
* 作者:LiZW <br/>
* 创建时间:2016/11/21 16:59 <br/>
*/
public class DefaultTrackerClientTest {
/**
* 日志
*/
private static final Logger logger = LoggerFactory.getLogger(DefaultTrackerClientTest.class);
private static ConnectionPool connectionPool;
pr... | StorageNodeInfo storageNodeInfo = trackerClient.getFetchStorage("group1", "M00/00/00/wKg4i1gxz_6AIPPsAAiCQSk77jI661.png"); | 3 |
tomayac/rest-describe-and-compile | src/com/google/code/apis/rest/client/GUI/RestCompilePanel.java | [
"public class CodeGenerator {\n // available languages\n public static final String php5 = \"PHP 5\";\n public static final String java = \"Java\";\n public static final String python = \"Python\";\n public static final String ruby = \"Ruby\";\n public static final String csharp = \"C#\"; \n public static... | import java.util.Iterator;
import java.util.Vector;
import com.google.code.apis.rest.client.CodeGeneration.CodeGenerator;
import com.google.code.apis.rest.client.Wadl.Analyzer;
import com.google.code.apis.rest.client.Wadl.ApplicationNode;
import com.google.code.apis.rest.client.Wadl.MethodNode;
import com.google.code.a... | VerticalPanel requestClassesContainerPanel = new VerticalPanel();
requestClassesContainerPanel.add(new HTML("<br />"));
requestClassesContainerPanel.add(new HTML("<h2>" + GuiFactory.strings.generatedClasses() + ":</h2>"));
usedClassesPanel.add(requestClassesPanel);
usedClassesPanel.setStyleName... | ApplicationNode application = Analyzer.application; | 2 |
teivah/TIBreview | src/test/java/com/tibco/exchange/tibreview/processor/resourcerule/CProcessorIdentifyProviderTest.java | [
"public class TIBResource {\n\tprivate String filePath;\n\tprivate String type;\n\t\n\tprivate static final String REQUEST_GET_TYPE = \"/jndi:namedResource/@type\";\n\t\n\tpublic TIBResource(String filePath) throws Exception {\n\t\tthis.filePath = filePath;\n\t\tthis.type = Util.xpathEval(filePath, Constants.RESOUR... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.junit.Test;
import com.tibco.exchange.tibreview.common.TIBResource;
import com.tibco.exchange.tibreview.engine.Context;
import com.tibco.exchange.tibreview.mod... | package com.tibco.exchange.tibreview.processor.resourcerule;
public class CProcessorIdentifyProviderTest {
private static final Logger LOGGER = Logger.getLogger(CProcessorIdentifyProviderTest.class);
@Test
public void testCProcessorIdentifyProviderTest() {
TIBResource fileresource;
try {
... | Tibrules tibrules= RulesParser.getInstance().parseFile("src/test/resources/FileResources/xml/IdentityProvider.xml");
| 6 |
gustavomondron/twik | app/src/main/java/com/reddyetwo/hashmypass/app/tutorial/TutorialActivity.java | [
"public class TwikApplication extends Application {\n\n public static final String LOG_TAG = \"TWIK\";\n private char[] mCachedMasterKey;\n private boolean mTutorialDismissed = false;\n private static TwikApplication mInstance;\n\n @Override\n public void onCreate() {\n super.onCreate();\n ... | import android.animation.ArgbEvaluator;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.sup... | /*
* Copyright 2014 Red Dye No. 2
*
* This file is part of Twik.
*
* Twik 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.
*
*... | ApiUtils.drawBehindStatusBar(getWindow()); | 5 |
dbdkmezz/true-sight-dota | app/src/main/java/com/carver/paul/truesight/Ui/MainActivity.java | [
"public class AbilityDebuffPresenter implements IInfoPresenter_Data, IInfoPresenter_P {\n private AbilityInfoFragment mView;\n\n public AbilityDebuffPresenter() {}\n\n public void setView(AbilityInfoFragment view) {\n mView = view;\n }\n\n public void reset() {\n mView.reset();\n }\n... | import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.suppor... | /**
* True Sight for Dota 2
* Copyright (C) 2016 Paul Broadbent
*
* 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.... | AbilityInfoPresenter abilityInfoPresenter = adapter.getAbilityInfoPresenter(); | 1 |
mock4aj/mock4aj | mock4aj-acceptancetests/src/test/java/info/rubico/mock4aj/acceptance/SimulateCallsComingFromAnExistingClassAccTest.java | [
"public final class Mock4AspectJ {\n\n private static final WeavedProxyFactory DEFAULT_PROXY_FACTORY = new CglibWeavedProxyFactory();\n private static final Weaver DEFAULT_WEAVER = new AspectJWeaver();\n\n private static WeavedProxyFacade weavedProxyFacade;\n\n static {\n weavedProxyFacade = new ... | import static info.rubico.mock4aj.Mock4AspectJ.*;
import static org.mockito.Mockito.*;
import info.rubico.mock4aj.acceptance.testdata.Target;
import info.rubico.mock4aj.api.calls.CallContext;
import info.rubico.mock4aj.testdata.ASource;
import info.rubico.mock4aj.testdata.ParentInterfaceSource;
import org.aspectj.lang.... | package info.rubico.mock4aj.acceptance;
/**
* <h1>Simulate calls originating from an existing source class</h1>
*
* <h2>Story</h2>
* <p>
* As a developer, I want to be able to simulate a class originating from a given existing class so
* that, I can test "call" primitives with restrictions on the source name ... | public void markTargetOnRetInt(Target target) { | 1 |
1014277960/DailyReader | app/src/main/java/com/wulinpeng/daiylreader/rank/view/RankDetailActivity.java | [
"public class BookShortAdapter extends RecyclerView.Adapter {\n private Context context;\n\n private List<BookShort> data;\n\n private LayoutInflater inflater;\n\n public static final int TYPE_NORMAL = 0;\n\n public static final int TYPE_FOOTER = 1;\n\n public BookShortAdapter(Context context, Lis... | import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
... | package com.wulinpeng.daiylreader.rank.view;
/**
* @author wulinpeng
* @datetime: 17/2/20 下午4:16
* @description:
*/
public class RankDetailActivity extends BaseActivity implements IRankDetailView {
@BindView(R.id.common_toolbar)
public Toolbar toolbar;
@BindView(R.id.refresh_layout)
public Sw... | private List<BookShort> data = new ArrayList<>(); | 1 |
AKSW/TripleCheckMate | src/main/java/org/aksw/TripleCheckMate/server/storage/DemoStorageService.java | [
"public class ClassItem implements Comparable<ClassItem>, Serializable {\n\n /**\n * Auto-generated for serialization\n */\n private static final long serialVersionUID = -2115169797941126082L;\n\n public long ID = 0;\n public long parentID = 0;\n public String name = \"\";\n public String ... | import org.aksw.TripleCheckMate.shared.evaluate.ClassItem;
import org.aksw.TripleCheckMate.shared.evaluate.ErrorItem;
import org.aksw.TripleCheckMate.shared.evaluate.EvaluateResource;
import org.aksw.TripleCheckMate.shared.evaluate.UserRecord;
import org.aksw.TripleCheckMate.shared.exceptions.StorageServiceException;
i... | /*******************************************************************************
* Copyright 2013 Agile Knowledge Engineering and Semantic Web (AKSW) Group
*
* 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 List<Endpoint> getCampaigns() throws StorageServiceException { | 5 |
BracketCove/Profiler | app/src/test/java/com/wiseass/profiler/ProfileDetailPresenterTest.java | [
"public class AuthInjection {\n\n public static AuthSource provideAuthSource(){\n return FirebaseAuthService.getInstance();\n }\n\n}",
"public interface AuthSource {\n\n Completable createAccount(Credentials cred);\n\n Completable attemptLogin(Credentials cred);\n\n Completable deleteUser();... | import com.wiseass.profiler.data.auth.AuthInjection;
import com.wiseass.profiler.data.auth.AuthSource;
import com.wiseass.profiler.data.database.DatabaseInjection;
import com.wiseass.profiler.data.database.DatabaseSource;
import com.wiseass.profiler.data.scheduler.SchedulerInjection;
import com.wiseass.profiler.profile... | package com.wiseass.profiler;
/**
* Responsible for Displaying a User's bio and interests based on their profile. The user may then
* change those fields. The result is then written to the Database.
* Created by Ryan on 13/01/2017.
*/
@RunWith(MockitoJUnitRunner.class)
public class ProfileDetailPresenterTest {
... | private ProfileDetailContract.View view; | 5 |
zhoufenglokki/mappingrpc | mappingrpc-connector/src/main/java/github/mappingrpc/core/CoreEngine.java | [
"public interface ClientSideConnectedBizListener extends EventListener {\n\tpublic void connectedBizCallback();\n}",
"public class SiteConfigConstant {\n\tpublic static final String client_fixture_savePath = \"client.fixture_savePath\";\n\tpublic static final String client_connectionName = \"client.connectionName... | import github.mappingrpc.api.annotation.RequestMapping;
import github.mappingrpc.api.callback.ClientSideConnectedBizListener;
import github.mappingrpc.api.constant.SiteConfigConstant;
import github.mappingrpc.core.io.custompackage.MappingPackageClient;
import github.mappingrpc.core.io.custompackage.MappingPackageServer... | package github.mappingrpc.core;
public class CoreEngine implements BeanNameAware, Closeable {
static Logger log = LoggerFactory.getLogger(CoreEngine.class);
private boolean isListenEngine = false;
private long feature1 = 0;
private String listenIp; // TODO
private short listenPort = 6200;
private Map<String,... | public void setClientSideConnectedBizListener(ClientSideConnectedBizListener listener) { | 0 |
yyxhdy/ManyEAs | src/jmetal/problems/IntRealProblem.java | [
"public abstract class Problem implements Serializable {\n\n\t/**\n\t * Defines the default precision of binary-coded variables\n\t */\n\tprivate final static int DEFAULT_PRECISSION = 16;\n\n\t/**\n\t * Stores the number of variables of the problem\n\t */\n\tprotected int numberOfVariables_;\n\n\t/**\n\t * Stores t... | import jmetal.core.Problem;
import jmetal.core.Solution;
import jmetal.core.Variable;
import jmetal.encodings.solutionType.IntRealSolutionType;
import jmetal.util.JMException; | // IntRealProblem.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Pub... | public void evaluate(Solution solution) throws JMException { | 1 |
pmarches/jStellarAPI | src/test/java/jstellarapi/keys/StellarSignerTest.java | [
"public class TestUtilities {\n\tstatic StellarSeedAddress stellarAccount;\n\t\n\tpublic static StellarSeedAddress getTestSeed() throws Exception {\n\t\tif(stellarAccount==null){\n\t\t\tJSONObject jsonWallet = (JSONObject) new JSONParser().parse(new FileReader(\"secrets/jStellarAPI-wallet.json\"));\n\t\t\tString se... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.FileReader;
import java.nio.ByteBuffer;
import javax.xml.bind.DatatypeConverter;
import jstellarapi.TestUtilities;
import jstellarapi.connection.GenericJSONSerializable;
import jstellarapi.connection.StellarDaemonWebs... | package jstellarapi.keys;
public class StellarSignerTest {
@Test
public void testSubmitSignedTransaction() throws Exception{
StellarBinarySerializer binSer=new StellarBinarySerializer();
StellarPrivateKey privateKey = TestUtilities.getTestSeed().getPrivateKey();
StellarSigner signer = new StellarSigner(pr... | StellarBinaryObject originalSignedRBO = binSer.readBinaryObject(inputBytes); | 5 |
Esri/vehicle-commander-java | source/VehicleCommander/src/com/esri/vehiclecommander/controller/MapController.java | [
"public class IdentifiedItem {\r\n \r\n private final Geometry geometry;\r\n private final int layerId;\r\n private final Map<String, Object> attributes;\r\n private final Object value;\r\n \r\n public IdentifiedItem(Geometry geometry, int layerId, Map<String, Object> attributes, Object value) ... | import com.esri.client.local.ArcGISLocalDynamicMapServiceLayer;
import com.esri.client.local.LayerDetails;
import com.esri.client.local.LocalFeatureService;
import com.esri.client.local.LocalServer;
import com.esri.client.local.LocalServerStatus;
import com.esri.client.local.LocalServiceStartCompleteEvent;
import... | * @return the removed layer's former index, or -1 if the layer was not present.
*/
public int removeLayer(Layer layer) {
int layerIndex = -1;
synchronized (map) {
layerIndex = map.getLayers().indexOf(layer);
map.getLayers().remove(layer);
}
b... | private void processResults(IdentifyResultList results) {
| 1 |
rongzhu8888/magic-dao | src/main/java/pers/zr/opensource/magic/dao/action/ConditionalAction.java | [
"public enum ConditionType {\n\n AND, OR\n\n}",
"public enum MatchType {\n\n EQUALS(\"=\"),\n\n GREATER(\">\"),\n\n LESS(\"<\"),\n\n NOT_EQUALS(\"!=\"),\n\n GREATER_OR_EQUALS(\">=\"),\n\n LESS_OR_EQUALS(\"<=\"),\n\n IN(\"IN\"),\n\n LIKE(\"LIKE\"),\n\n BETWEEN_AND(\"BETWEEN ? AND\");... | import org.springframework.util.CollectionUtils;
import pers.zr.opensource.magic.dao.constants.ConditionType;
import pers.zr.opensource.magic.dao.constants.MatchType;
import pers.zr.opensource.magic.dao.matcher.Matcher;
import pers.zr.opensource.magic.dao.shard.TableShardHandler;
import pers.zr.opensource.magic.dao.sha... | package pers.zr.opensource.magic.dao.action;
/**
* Created by zhurong on 2016/4/30.
*/
public abstract class ConditionalAction extends Action {
private Collection<Matcher> conditions = new ArrayList<Matcher>();
private String conSql = null;
private List<Object> conParams = null;
private String re... | conditionSqlBuilder.append(ConditionType.AND).append(" ") | 0 |
TeamAmeriFrance/Guide-API | src/main/java/amerifrance/guideapi/gui/GuiSearch.java | [
"@Mod(modid = GuideMod.ID, name = GuideMod.NAME, version = GuideMod.VERSION)\npublic class GuideMod {\n\n public static final String NAME = \"Guide-API\";\n public static final String ID = \"guideapi\";\n public static final String CHANNEL = \"GuideAPI\";\n public static final String VERSION = \"@VERSIO... | import amerifrance.guideapi.GuideMod;
import amerifrance.guideapi.api.impl.Book;
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
import amerifrance.guideapi.api.util.GuiHelper;
import amerifrance.guideapi.button.ButtonBack;
import amerif... | package amerifrance.guideapi.gui;
public class GuiSearch extends GuiBase {
private Book book;
private ResourceLocation outlineTexture;
private ResourceLocation pageTexture;
private ButtonNext buttonNext; | private ButtonPrev buttonPrev; | 7 |
cereda/nightingale | application/src/main/java/com/github/cereda/nightingale/utils/DirectiveUtils.java | [
"public class ConfigurationController {\n\n // the controller itself, since we have a singleton;\n // this is the reference instance, instantiated once\n private static final ConfigurationController instance =\n new ConfigurationController();\n \n // the configuration settings are stored i... | import com.github.cereda.nightingale.controller.ConfigurationController;
import com.github.cereda.nightingale.controller.LanguageController;
import com.github.cereda.nightingale.model.NightingaleException;
import com.github.cereda.nightingale.model.Conditional;
import com.github.cereda.nightingale.model.Directive;
impo... | /**
* Nightingale
* Copyright (c) 2014, Paulo Roberto Massa Cereda
* All rights reserved.
*
* 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... | Conditional conditional = new Conditional(); | 3 |
tarzasai/Flucso | src/net/ggelardi/flucso/data/SubscrListAdapter.java | [
"public class Commons {\n\t// we better don't tell FF and other sites we are a phone, if we want to receive all images as supposed:\n\tpublic static final String USER_AGENT = \"Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0\";\n\t\n\tpublic static class PK {\n\t\tpublic static final String USERNA... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import net.ggelardi.flucso.R;
import net.ggelardi.flucso.R.drawable;
import net.ggelardi.flucso.R.id;
import net.ggelardi.flucso.R.layout;
import net.ggelardi.flucso.R.string;
import ne... | }
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder vh;
View view = convertView;
if (view == null) {
view = inflater.inflate(R.layout.item_subscr, parent, false);
vh = new ViewHolder();
... | Callback<SimpleResponse> callback = new Callback<SimpleResponse>() { | 6 |
android-cjj/MousePaint | app/src/main/java/com/cjj/mousepaint/fragment/CardFragment.java | [
"public class DetialActivity extends AppCompatActivity implements View.OnClickListener,AdapterView.OnItemClickListener{\n @Bind(R.id.toolbar)\n Toolbar mToolbar;\n @Bind(R.id.collapsing_toolbar)\n CollapsingToolbarLayout mCollapsingToolbarLayout;\n @Bind(R.id.backdrop)\n ImageView mImageView;\n ... | import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com... | package com.cjj.mousepaint.fragment;
public class CardFragment extends AbsBaseFragment implements View.OnClickListener{
protected Card mCard;
protected TextView mAuthorText;
protected ImageView mBottomEdgeImageView;
protected TextView mBravoNumText;
protected RelativeLayout mCardLayout;
prot... | int coverWidth = AppUtils.getScreenDisplayMetrics(getActivity()).widthPixels - 2 * getResources().getDimensionPixelSize(R.dimen.card_margin); | 4 |
AstartesGuardian/WebDAV-Server | WebDAV-Server/src/webdav/server/commands/light/LightInformationStructure.java | [
"public class FileSystemPath\r\n{\r\n public FileSystemPath(String fileName, FileSystemPath parent)\r\n {\r\n this.fileName = fileName;\r\n this.parent = parent;\r\n this.fileSystemPathManager = parent.fileSystemPathManager;\r\n }\r\n public FileSystemPath(String fileName, FileSyste... | import http.FileSystemPath;
import http.server.exceptions.UserRequiredException;
import http.server.message.HTTPEnvRequest;
import java.time.Instant;
import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javafx.util.Pair;
import webdav.server.resource.IRe... | package webdav.server.commands.light;
public class LightInformationStructure implements IResource
{
public LightInformationStructure(IResource resource)
{
// TODO : transfer 'resource' information into object fields
visible = false;
resourceType = null;
webName = null... | private final ResourceType resourceType;
| 6 |
y1j2x34/spring-influxdb-orm | spring-influxdb-orm/src/main/java/com/vgerbot/orm/influxdb/exec/InfluxQLAnnotExecutor.java | [
"public class InfluxDBException extends RuntimeException {\n\n\tprivate static final long serialVersionUID = -4410268653794610252L;\n\n\tpublic InfluxDBException() {\n\t\tsuper();\n\t}\n\n\tpublic InfluxDBException(String message, Throwable cause) {\n\t\tsuper(message, cause);\n\t}\n\n\tpublic InfluxDBException(Str... | import java.util.Map;
import org.springframework.util.StringUtils;
import com.vgerbot.orm.influxdb.InfluxDBException;
import com.vgerbot.orm.influxdb.annotations.InfluxQL;
import com.vgerbot.orm.influxdb.binding.MapperMethod;
import com.vgerbot.orm.influxdb.param.ParameterValue;
import com.vgerbot.orm.influxdb.ql.Influ... | package com.vgerbot.orm.influxdb.exec;
public class InfluxQLAnnotExecutor extends AnnotationExecutor<InfluxQL> {
public InfluxQLAnnotExecutor(InfluxDBRepository repository, InfluxQL annotation) {
super(repository, annotation);
}
@Override
public ResultContext execute(MapperMethod method, Map<String, Paramet... | throw new InfluxDBException("Statement not found: " + key); | 0 |
Sonoport/freesound-java | src/main/java/com/sonoport/freesound/query/sound/SoundCommentsQuery.java | [
"public enum HTTPRequestMethod {\n\n\t/** HTTP GET. */\n\tGET,\n\n\t/** HTTP POST. */\n\tPOST,\n\n\t/** HTTP PUT. */\n\tPUT,\n\n\t/** HTTP DELETE. */\n\tDELETE,\n\n\t/** HTTP PATCH. */\n\tPATCH,\n\n\t/** HTTP HEAD. */\n\tHEAD,\n\n\t/** HTTP OPTIONS. */\n\tOPTIONS;\n}",
"public abstract class PagingQuery<Q extends... | import java.util.HashMap;
import java.util.Map;
import com.sonoport.freesound.query.HTTPRequestMethod;
import com.sonoport.freesound.query.PagingQuery;
import com.sonoport.freesound.response.Comment;
import com.sonoport.freesound.response.mapping.CommentMapper;
import com.sonoport.freesound.response.mapping.PagingRespo... | /*
* Copyright 2014 Sonoport (Asia) Pte Ltd
*
* 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 o... | super(HTTPRequestMethod.GET, PATH, new PagingResponseMapper<>(new CommentMapper())); | 4 |
JANNLab/JANNLab | examples/de/jannlab/examples/recurrent/SequentialXorExample.java | [
"public interface Net extends Serializable {\n //\n /**\n * Resets the network, which means that all inner\n * states (activations, derivations) are set to 0.0.\n * The method also resets the time index which is 0\n * after doing reset.\n */\n public void reset();\n /**\n * Initi... | import java.util.Random;
import de.jannlab.Net;
import de.jannlab.core.CellType;
import de.jannlab.data.Sample;
import de.jannlab.data.SampleSet;
import de.jannlab.generator.RNNGenerator;
import de.jannlab.misc.TimeCounter;
import de.jannlab.tools.ClassificationValidator;
import de.jannlab.training.GradientDescent; | /*******************************************************************************
* JANNLab Neural Network Framework for Java
* Copyright (C) 2012-2013 Sebastian Otte
*
* 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
* th... | RNNGenerator gen = new RNNGenerator(); | 4 |
greengrowapps/ggaforms | GGAForms/ggaforms/src/main/java/com/greengrowapps/ggaforms/validation/validator/AnnotatedValidator.java | [
"public interface FormInput<T> {\n\n void setOnInputChangedListener(OnInputChangedListener listener);\n\n void setError(ValidationError error);\n\n Class<T> getType();\n T getValue();\n void setValue(T value);\n\n ValidationError getError();\n}",
"public interface IntrospectedObject<T>{\n\n T... | import com.greengrowapps.ggaforms.fields.FormInput;
import com.greengrowapps.ggaforms.introspection.IntrospectedObject;
import com.greengrowapps.ggaforms.validation.TypedFormValidator;
import com.greengrowapps.ggaforms.validation.annotations.MaxLength;
import com.greengrowapps.ggaforms.validation.annotations.MinLength;... | package com.greengrowapps.ggaforms.validation.validator;
public class AnnotatedValidator implements TypedFormValidator {
Map<String,ValidatorProvider> validatorMap = new HashMap<>();
private AnnotatedValidator(final ValidationErrorProvider errorProvider){
validatorMap.put(NotNull.class.getCanonica... | public ValueValidator buildValidator(Annotation annotation, FormInput input) { | 0 |
ChristopherMann/2FactorWallet | wallet_lib/src/test/java/de/uni_bonn/bit/ProtocolAttackTest.java | [
"public class EncryptedSignatureWithProof {\n\n @Stringable\n private BigInteger sigma;\n @Stringable\n private BigInteger alphaPhone;\n private ZKProofPhone proof;\n\n public EncryptedSignatureWithProof(){}\n\n public EncryptedSignatureWithProof(BigInteger sigma, BigInteger alphaPhone, ZKProof... | import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Sha256Hash;
import com.google.common.collect.Lists;
import com.google.common.math.DoubleMath;
import de.uni_bonn.bit.wallet_protocol.EncryptedSignatureWithProof;
import de.uni_bonn.bit.wallet_protocol.EphemeralPublicValueWithProof;
import de.uni_bonn.bit.wallet_p... | /*
* Copyright 2014 Christopher Mann
*
* 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 writi... | public SignatureParts computeSignatureParts() { | 3 |
rec-framework/rec-core | src/main/java/net/kimleo/rec/v2/model/impl/BufferedCachingTee.java | [
"public class Pair<K, V> {\n public final K first;\n public final V second;\n\n\n public Pair(K first, V second) {\n this.first = first;\n this.second = second;\n }\n\n public K getFirst() {\n return first;\n }\n\n public V getSecond() {\n return second;\n }\n\n}"... | import net.kimleo.rec.common.Pair;
import net.kimleo.rec.common.concept.Mapped;
import net.kimleo.rec.common.exception.ResourceAccessException;
import net.kimleo.rec.v2.model.Source;
import net.kimleo.rec.v2.model.Tee;
import net.kimleo.rec.v2.stream.adapter.GeneratingSpliteratorAdapter;
import org.slf4j.Logger;
import... | package net.kimleo.rec.v2.model.impl;
public class BufferedCachingTee implements Tee<Mapped<String>> {
private static final Logger LOGGER = LoggerFactory.getLogger(BufferedCachingTee.class);
private final Path tempFile;
private final ByteBuffer buffer;
private List<String> keys;
private int w... | throw new ResourceAccessException("Unable to create new temporary file.", e); | 2 |
cereda/nightingale | application/src/main/java/com/github/cereda/nightingale/model/Interpreter.java | [
"public class ConfigurationController {\n\n // the controller itself, since we have a singleton;\n // this is the reference instance, instantiated once\n private static final ConfigurationController instance =\n new ConfigurationController();\n \n // the configuration settings are stored i... | import com.github.cereda.nightingale.controller.ConfigurationController;
import com.github.cereda.nightingale.controller.LanguageController;
import com.github.cereda.nightingale.utils.CommonUtils;
import com.github.cereda.nightingale.utils.DisplayUtils;
import com.github.cereda.nightingale.utils.InterpreterUtils;
impor... | /**
* Nightingale
* Copyright (c) 2014, Paulo Roberto Massa Cereda
* All rights reserved.
*
* 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... | ConfigurationController. | 0 |
wangshufu/mmall | src/main/java/com/mmall/controller/portal/CartController.java | [
"public class Const {\n\n public static final String CURRENT_USER = \"currentUser\";\n public static final String EMAIL = \"email\";\n public static final String USERNAME = \"username\";\n\n public interface Cart{\n int CHECKED = 1;//即购物车选中状态\n int UN_CHECKED = 0;//购物车中未选中状态\n\n Str... | import com.mmall.common.Const;
import com.mmall.common.ResponseCode;
import com.mmall.common.ServerResponse;
import com.mmall.pojo.User;
import com.mmall.service.ICartService;
import com.mmall.vo.CartVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
imp... | package com.mmall.controller.portal;
/**
* Created by wangshufu on 2017/8/6.
*/
@Controller
@RequestMapping("/cart/")
public class CartController {
@Autowired
private ICartService iCartService;
/**
* 获取这个用户购物车中所有的商品
* @param session
* @return
*/
@RequestMapping("list.do")
... | return ServerResponse.createByErrorCodeMessage(ResponseCode.NEED_LOGIN.getCode(),ResponseCode.NEED_LOGIN.getDesc()); | 1 |
simo415/spc | src/com/sijobe/spc/command/SetSpawn.java | [
"public enum FontColour {\n \n BLACK(\"\\2470\"),\n DARK_BLUE(\"\\2471\"),\n DARK_GREEN(\"\\2472\"),\n DARK_AQUA(\"\\2473\"),\n DARK_RED(\"\\2474\"),\n PURPLE(\"\\2475\"),\n ORANGE(\"\\2476\"),\n GREY(\"\\2477\"),\n DARK_GREY(\"\\2478\"),\n BLUE(\"\\2479\"),\n GREEN(\"\\247a\"),\n AQUA(\"\... | import com.sijobe.spc.util.FontColour;
import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterInteger;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.Coordinate;
import... | package com.sijobe.spc.command;
/**
* Sets the players spawn based on the player position or the arguments
* provided
*
* @author simo_415
* @version 1.0
*/
@Command (
name = "setspawn",
description = "Sets the spawn point of the world the player is in",
videoURL = "http://www.youtube.com/watch?v=2Z... | Player player = getSenderAsPlayer(sender); | 7 |
PuffOpenSource/Puff-Android | app/src/main/java/sun/bob/leela/ui/fragments/SecureStepTypeSelect.java | [
"public class FragmentSlide extends RestorableSlide {\n\n private Fragment fragment;\n @ColorRes\n private final int background;\n @ColorRes\n private final int backgroundDark;\n\n private final boolean canGoForward;\n\n private final boolean canGoBackward;\n\n private FragmentSlide(Builder ... | import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.v7.widget.AppCompatCheckBox;
import android.support.v7.widget.AppCompatEditText;
import android.view.L... | package sun.bob.leela.ui.fragments;
/**
* Created by bob.sun on 16/4/21.
*/
public class SecureStepTypeSelect extends FragmentSlide.FragmentSlideFragment {
private SlideListener slideListener;
private AppCompatCheckBox easy, numbers, secure;
private AppCompatEditText word1, word2, word3, word4;
... | public PasswordGenActivity.PasswordType getType() { | 1 |
davidmoten/state-machine | state-machine-test/src/test/java/com/github/davidmoten/fsm/AccountTest.java | [
"public final class Account {\n\n public final String id;\n public final BigDecimal balance;\n\n @JsonCreator\n public Account(@JsonProperty(\"id\") String id, @JsonProperty(\"balance\") BigDecimal balance) {\n this.id = id;\n this.balance = balance;\n }\n\n @Override\n public Str... | import java.math.BigDecimal;
import org.junit.Test;
import com.github.davidmoten.fsm.example.account.Account;
import com.github.davidmoten.fsm.example.account.event.ChangeBalance;
import com.github.davidmoten.fsm.example.account.event.Deposit;
import com.github.davidmoten.fsm.example.account.event.Transfer;
import com.... | package com.github.davidmoten.fsm;
public class AccountTest {
@Test
public void testAccount() throws InterruptedException {
AccountBehaviourBase<String> behaviour = new AccountBehaviourBase<String>() {
@Override
public AccountStateMachine<String> create(String id) {
System.out.println("created empt... | Processor<String> processor = Processor // | 7 |
yammer/tenacity | tenacity-client/src/test/java/com/yammer/tenacity/client/tests/TenacityResources.java | [
"public class TenacityClient {\n private static final Logger LOGGER = LoggerFactory.getLogger(TenacityClient.class);\n protected final Client client;\n protected final Timer fetchPropertyKeys;\n protected final Timer fetchConfiguration;\n protected final Timer fetchCircuitBreakers;\n\n public Tena... | import com.google.common.collect.ImmutableList;
import com.netflix.hystrix.HystrixCommandProperties;
import com.yammer.tenacity.client.TenacityClient;
import com.yammer.tenacity.core.TenacityCommand;
import com.yammer.tenacity.core.config.TenacityConfiguration;
import com.yammer.tenacity.core.core.CircuitBreaker;
impor... | package com.yammer.tenacity.client.tests;
public abstract class TenacityResources {
@Rule
public final TenacityTestRule tenacityTestRule = new TenacityTestRule();
protected static TenacityClient CLIENT;
protected static URI URI_ROOT;
protected static Client JERSEY_CLIENT;
private Response ... | .path(TenacityConfigurationResource.PATH) | 6 |
JanSvoboda/aeonsend-randomizer | app/src/main/java/com/games/boardgames/aeonsend/fragments/CharactersFragment.java | [
"public class GeneratedMarketGridViewAdapter extends BaseAdapter {\n\n private Context mContext;\n private List<Card> cards;\n\n // Important for ImageView refresh per View - alternative way of GridView refresh. Stores all ImageViews\n final private List<ImageView> imageViewList = new ArrayList<>();\n\n... | import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.... | package com.games.boardgames.aeonsend.fragments;
/**
* Created by honza on 21.9.17.
*/
public class CharactersFragment extends Fragment {
private GridView gridView;
private GeneratedMarketGridViewAdapter generatedMarketGridViewAdapter;
private List<Card> characterCards;
private SwipeRefreshLayou... | CharacterCard characterCard = (CharacterCard) cards.get(value); | 2 |
drbild/c2dm4j | src/test/java/org/whispercomm/c2dm4j/impl/C2dmHttpResponseHandlerTest.java | [
"public interface Message {\n\n\t/**\n\t * Gets the identifier for the client to whom the message will be sent.\n\t * \n\t * @return the registration id of the client.\n\t */\n\tpublic String getRegistrationId();\n\n\t/**\n\t * Gets the collapse key for the message. The collapse key is used to\n\t * collapse simila... | import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.util.Locale;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.EnglishReasonPhraseCatalog;
import org.apache.http.mes... | /*
* Copyright 2012 The Regents of the University of Michigan
*
* 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 b... | assertThat(result.getResponseType(), is(ResponseType.Success)); | 3 |
Monits/android-linters | src/main/java/com/monits/linters/MonitsIssueRegistry.java | [
"public class ViewInflateDetector extends Detector implements JavaScanner {\n\n\t/* default */ static final String VIEW_INFLATE_MSG = \"View.inflate does not apply \"\n\t\t\t+ \"theme / defaults to inflated views on pre-lollipop.\";\n\t\n\tpublic static final Issue VIEW_INFLATE_IGNORES_THEME = Issue.create(\"ViewIn... | import java.util.Arrays;
import java.util.List;
import javax.annotation.Nonnull;
import com.android.tools.lint.client.api.IssueRegistry;
import com.android.tools.lint.detector.api.Issue;
import com.monits.linters.ast.ViewInflateDetector;
import com.monits.linters.bc.FactoryMethodDetector;
import com.monits.linters.ast.... | /**
* Copyright 2010 - 2016 - Monits
*
* 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 agr... | ViewInflateDetector.VIEW_INFLATE_IGNORES_THEME); | 0 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/events/CommentAdded.java | [
"public enum GerritEventType {\n\n /**\n * A patchset-created event.\n */\n PATCHSET_CREATED(\"patchset-created\", true, PatchsetCreated.class),\n /**\n * A draft-published event.\n */\n DRAFT_PUBLISHED(\"draft-published\", true, DraftPublished.class),\n /**\n * A change-abandoned... | import net.sf.json.JSONArray;
import static com.sonymobile.tools.gerrit.gerritevents.GerritJsonEventFactory.getString;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.AUTHOR;
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.APPROVALS;
import static com.sonymobile.too... | /*
* The MIT License
*
* Copyright 2012 Hewlett-Packard Development Company, L.P.
*
* 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 limitati... | private List<Approval> approvals = new ArrayList<Approval>(); | 2 |
patrickfav/Dali | dali/src/main/java/at/favre/lib/dali/Dali.java | [
"public class ContextWrapper {\n private Context context;\n private RenderScript renderScript;\n private RenderScript.ContextType renderScriptContextType = RenderScript.ContextType.NORMAL;\n\n public ContextWrapper(Context context) {\n this.context = context;\n }\n\n public ContextWrapper(C... | import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.util.Log;
import android.view.View;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.Toolbar;
import androidx.drawerlayout.widget.DrawerLayout... | package at.favre.lib.dali;
public final class Dali {
public static final int NO_RESID = -1;
private static final String TAG = Dali.class.getSimpleName();
private static TwoLevelCache DISK_CACHE_MANAGER;
private static ExecutorManager EXECUTOR_MANAGER;
private static Config GLOBAL_CONFIG = new C... | return new BlurBuilder(contextWrapper, new ImageReference(bitmap), DISK_CACHE_MANAGER); | 2 |
hlavki/g-suite-identity-sync | services/facade/src/main/java/eu/hlavki/identity/services/rest/service/GoogleSettingsService.java | [
"public interface GSuiteDirectoryService {\n\n /**\n * Retrieve all groups for a member.\n *\n * @param userKey The userKey can be the user's primary email address, the user's alias email address, a\n * group's primary email address, a group's email alias, or the user's unique id.\n * @return... | import eu.hlavki.identity.services.google.GSuiteDirectoryService;
import eu.hlavki.identity.services.google.ResourceNotFoundException;
import eu.hlavki.identity.services.google.config.Configuration;
import eu.hlavki.identity.services.google.model.GroupMembership;
import eu.hlavki.identity.services.rest.model.ServiceAcc... | package eu.hlavki.identity.services.rest.service;
@Path("google/settings")
public class GoogleSettingsService {
private static final Logger LOG = LoggerFactory.getLogger(GoogleSettingsService.class);
@Context
private OidcClientTokenContext oidcContext;
private final Configuration googleConfig;
p... | private final GSuiteDirectoryService gsuiteDirService; | 0 |
christophersmith/summer-mqtt | summer-mqtt-paho/src/test/java/com/github/christophersmith/summer/mqtt/paho/service/PublishMessageTest.java | [
"public enum MqttClientConnectionType\n{\n /**\n * Represents a connection type that can only publish messages.\n */\n PUBLISHER,\n /**\n * Represents a connection type that can both publish and receive messages.\n */\n PUBSUB,\n /**\n * Rep... | import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.context.Applic... | /*******************************************************************************
* Copyright (c) 2019 Christopher Smith - https://github.com/christophersmith
*
* 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 ... | if (event instanceof MqttMessagePublishFailureEvent) | 2 |
alexmojaki/boxes | src/main/java/alex/mojaki/boxes/View.java | [
"public class BoxParticipantException extends RuntimeException {\n\n public Box<ParticipationDetails> details = box();\n\n public BoxParticipantException(String message, Exception cause) {\n super(message, cause);\n }\n\n public BoxParticipantException withDetails(ParticipationDetails details) {\... | import alex.mojaki.boxes.exceptions.BoxParticipantException;
import alex.mojaki.boxes.middleware.change.ChangeMiddleware;
import alex.mojaki.boxes.middleware.get.GetMiddleware;
import alex.mojaki.boxes.observers.change.ChangeObserver;
import alex.mojaki.boxes.observers.change.TargetedChangeObserver;
import alex.mojaki.... | package alex.mojaki.boxes;
/**
* A {@link PowerBox} whose value is calculated based on the values of other {@code PowerBox}es and knows when those
* boxes change, allowing it to safely cache its own value to save computation and notify {@link ChangeObserver}s
* that the result of its calculation is now different.
... | public View<T> addGetObserver(GetObserver... observers) { | 5 |
TGAC/statsdb | Java/statsdb-api/src/main/java/uk/ac/tgac/statsdb/run/consumer/D3PlotConsumer.java | [
"public class ConsumerException extends Exception {\n public ConsumerException(String s) {\n super(s);\n }\n\n public ConsumerException(String s, Throwable cause) {\n super(s);\n if (cause != null) {\n initCause(cause);\n }\n }\n}",
"public interface ReportTable {\n /**\n * Returns a Str... | import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import uk.ac.tgac.statsdb.exception.ConsumerException;
import uk.ac.tgac.statsdb.run.ReportTable;
import uk.ac.tgac.statsdb.run.Reports;
import uk.ac.t... | package uk.ac.tgac.statsdb.run.consumer;
/**
* Consumer that is able to easily generate D3.js compliant JSON for plotting common QC graphs
*
* @author Rob Davey
* @date 25/10/13
* @since 1.1
*/
public class D3PlotConsumer {
protected static final Logger log = LoggerFactory.getLogger(D3PlotConsumer.class);
... | Map<String, ReportTable> resultMap = reportsDecorator.getPerPositionBaseSequenceQuality(map); | 1 |
yarolegovich/wellsql | wellsql/src/main/java/com/yarolegovich/wellsql/DefaultWellConfig.java | [
"public abstract class Binder {\n public static final String PACKAGE = \"com.wellsql.generated\";\n public static final String LOOKUP_CLASS = \"GeneratedLookup\";\n}",
"public interface Identifiable {\n void setId(int id);\n int getId();\n}",
"public interface TableClass {\n String createStatemen... | import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import com.yarolegovich.wellsql.core.Binder;
import com.yarolegovich.wellsql.core.Identifiable;
import com.yarolegovich.wellsql.core.TableClass;
import com.yarolegovich.wellsql.core.TableLookup... | package com.yarolegovich.wellsql;
/**
* Created by yarolegovich on 26.11.2015.
*/
@SuppressWarnings("unchecked")
public abstract class DefaultWellConfig implements WellConfig,
WellConfig.OnUpgradeListener, WellConfig.OnCreateListener, WellConfig.OnDowngradeListener {
private Context mContext;
pri... | public TableClass getTable(Class<? extends Identifiable> token) { | 1 |
CyclopsMC/EverlastingAbilities | src/main/java/org/cyclops/everlastingabilities/network/packet/MoveAbilityPacket.java | [
"public class AbilityHelpers {\n\n /**\n * This value is synced with {@link GeneralConfig#maxPlayerAbilities} from the server.\n * This is to ensure that clients can not hack around the ability limit.\n */\n public static int maxPlayerAbilitiesClient = -1;\n\n public static final int[] RARITY_C... | import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.cyclops.cyclopscore.network.Cod... | package org.cyclops.everlastingabilities.network.packet;
/**
* Packet from server to client to update capabilities.
* @author rubensworks
*
*/
public class MoveAbilityPacket extends PacketCodec {
@CodecField
private String abilityName;
@CodecField
private int abilityLevel;
@CodecField
private int movement;... | if (AbilityHelpers.canExtract(ability, playerAbilityStore) | 0 |
notabadminer/UniversalCoins | src/main/java/universalcoins/tileentity/TileVendor.java | [
"@Mod(modid = UniversalCoins.MODID, name = UniversalCoins.NAME, version = UniversalCoins.VERSION, acceptedMinecraftVersions = \"@MC_VERSION@\", updateJSON = \"https://raw.githubusercontent.com/notabadminer/UniversalCoins/master/version.json\", dependencies = \"required-after:forge@14.21.0.2368,)\")\n\n@Mod.EventBus... | import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ItemStackHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tilee... | if (inventory.get(itemTradeSlot).isEmpty()) {
buyButtonActive = false;
return;
}
// use the card if we have it
if (!inventory.get(itemUserCardSlot).isEmpty() && getUserAccountBalance() > itemPrice) {
useCard = true;
}
if (userCoinSum < itemPrice && !useCard) { // can't buy even one
buyButtonActi... | && inventory.get(itemUserCardSlot).getItem() instanceof ItemEnderCard | 4 |
Aurilux/Cybernetica | src/main/java/com/vivalux/cyb/item/implant/ImplantCyberneticArm.java | [
"@Mod(modid = CYBModInfo.MOD_ID,\n name = CYBModInfo.MOD_NAME,\n guiFactory = CYBModInfo.GUI_FACTORY,\n version = CYBModInfo.MOD_VERSION)\npublic class Cybernetica {\n\t@Instance(CYBModInfo.MOD_ID)\n\tpublic static Cybernetica instance;\n\n\t@SidedProxy(clientSide = CYBModInfo.CLIENT_PROXY, serverSide = CY... | import com.vivalux.cyb.Cybernetica;
import com.vivalux.cyb.api.Implant;
import com.vivalux.cyb.client.model.ModelArmImplant;
import com.vivalux.cyb.init.CYBItems;
import com.vivalux.cyb.item.module.ModuleArmorPlate;
import com.vivalux.cyb.item.module.ModuleBlastResist;
import com.vivalux.cyb.item.module.ModuleFireResis... | package com.vivalux.cyb.item.implant;
public class ImplantCyberneticArm extends Implant {
// this implant provides modules equipped to the arm
public ImplantCyberneticArm(String str, String str2, int renderIndex) {
super(renderIndex, ImplantType.TORSO, 1);
CYBItems.setItem(this, str, str2);
}
@Over... | ModelArmImplant model = (ModelArmImplant) Cybernetica.proxy.modelArm; | 2 |
Simperium/simperium-android | Simperium/src/androidTestSupport/java/com/simperium/ChangeTest.java | [
"public class Change {\n\n public static final String TAG=\"Simperium.Change\";\n\n public interface OnRetryListener {\n public void onRetry(Change change);\n }\n\n public interface OnAcknowledgedListener {\n public void onAcknowledged(Change change);\n }\n\n public interface OnCompl... | import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.simperium.client.Change;
import com.simperium.client.Bucket;
import com.simperium.client.Syncable;
import com.simperium.client.Ghost;
import com.simperium.models.Note;
import com.simperium.test.MockBucket;
import junit.framework.TestCase;... | package com.simperium;
public class ChangeTest extends TestCase {
private Bucket<Note> mBucket;
private Note mNote;
protected void setUp()
throws Exception {
mBucket = MockBucket.buildBucket(new Note.Schema());
mNote = mBucket.newObject();
mNote.setTitle("Hello world");
... | public static void assertValidChangeObject(Syncable object, Ghost ghost, Change change) | 2 |
jlinn/riot-api-java | src/main/java/net/joelinn/riot/Riot.java | [
"public class ChampionClient extends AbstractClient{\n\n public ChampionClient(String apiKey, Region region) {\n super(apiKey, region);\n }\n\n @Override\n protected String getVersion() {\n return \"1.2\";\n }\n\n /**\n * @see <a href=\"https://developer.riotgames.com/api/methods... | import net.joelinn.riot.champion.ChampionClient;
import net.joelinn.riot.game.GameClient;
import net.joelinn.riot.league.LeagueClient;
import net.joelinn.riot.staticdata.StaticDataClient;
import net.joelinn.riot.stats.StatsClient;
import net.joelinn.riot.summoner.SummonerClient;
import net.joelinn.riot.team.TeamClient;... | package net.joelinn.riot;
/**
* Joe Linn
* 12/17/13
*/
public class Riot {
protected String apiKey;
protected Region region;
protected Map<Class<? extends AbstractClient>, AbstractClient> clients = new HashMap<>();
public Riot(String apiKey){
this.apiKey = apiKey;
}
public Riot... | public SummonerClient summoner(){ | 5 |
beyondckw/SynchronizeOfPPT | Android_v5/src/com/newppt/android/ui/SvgView.java | [
"public class AnimUtils2 {\n\n\tpublic AnimUtils2() {\n\t\t// TODO Auto-generated constructor stub\n\t}\n\n\t/**\n\t * 动画隐藏上下布局\n\t *\n\t * @param relativeLayoutTop\n\t * @param linearLayoutButtom\n\t * @param offest\n\t */\n\tpublic void startAnimOut(View relativeLayoutTop, View linearLayoutButtom,\n\t\t\tint offe... | import java.io.File;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
impor... | package com.newppt.android.ui;
public class SvgView extends Activity {
Button _renewButton = null;
// ImageView _connect = null;
Button _loadButton = null;
Button _controlButton = null;
Button _handPaintButton = null;
Button _clearButton = null;
Button _eraserButton = null;
Button _undobButton = null;
B... | HMessage hMessage = null; // JPG鍚屾绾跨▼浼犺緭淇℃伅瀵硅薄 | 4 |
documaster/noark-extraction-validator | noark-extraction-validator/src/main/java/com/documaster/validator/validation/noark5/parsers/ArchiveStructureHandler.java | [
"public abstract class Storage {\n\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(Storage.class);\n\n\tprivate static Storage instance;\n\n\tprivate StorageWriter writerThread;\n\n\tprivate LinkedBlockingQueue<Persistable> queue = new LinkedBlockingQueue<>();\n\n\t/**\n\t * < item definition full n... | import org.slf4j.LoggerFactory;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import java.io.File;
import java.io.IOException;
import java.util.Map;
import com.documaster.validator.storage.core.Storage;
import com.documaster.validator.storage.model.Field;
import com.docum... | /**
* Noark Extraction Validator
* Copyright (C) 2016, Documaster AS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any la... | Storage.get().write(getItem()); | 0 |
NasaGeek/utexas-utilities | app/src/main/java/com/nasageek/utexasutilities/fragments/UTilitiesPreferenceFragment.java | [
"public class PasswordEditTextPreferenceDialogFragmentCompat extends EditTextPreferenceDialogFragmentCompat {\n\n public static PasswordEditTextPreferenceDialogFragmentCompat newInstance(String key) {\n final PasswordEditTextPreferenceDialogFragmentCompat\n fragment = new PasswordEditTextPr... | import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.CheckBoxPreference;
import android.support.v7.preference.Preference... | package com.nasageek.utexasutilities.fragments;
/**
* Created by chris on 9/3/15.
*/
public class UTilitiesPreferenceFragment extends PreferenceFragmentCompat {
private Preference loginfield;
private Preference passwordfield;
private CheckBoxPreference autologin;
private RecyclerView.Adapter ba;... | DialogFragment f = PasswordEditTextPreferenceDialogFragmentCompat.newInstance(preference.getKey()); | 0 |
52North/geoar-app | src/main/java/org/n52/geoar/ar/view/overlay/ARCanvasSurfaceView.java | [
"public class ARObject implements OpenGLCallable {\r\n\r\n\tprivate static float getScaleByDistance(float distance) {\r\n\t\t// XXX TODO FIXME reworking scaling function\r\n\t\tint x = org.n52.geoar.view.geoar.Settings.BUFFER_MAPINTERPOLATION;\r\n\t\tif (distance > x) {\r\n\t\t\treturn 0.5f;\r\n\t\t}\r\n\t\tfloat s... | import java.util.ArrayList;
import java.util.List;
import org.n52.geoar.R;
import org.n52.geoar.ar.view.ARObject;
import org.n52.geoar.ar.view.ARView;
import org.n52.geoar.newdata.PluginActivityContext;
import org.n52.geoar.tracking.camera.RealityCamera.CameraUpdateListener;
import org.n52.geoar.tracking.locatio... | /**
* Copyright 2012 52°North Initiative for Geospatial Open Source Software GmbH
*
* 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... | private List<ARObject> mARObjects = new ArrayList<ARObject>(0);
| 0 |
goshippo/shippo-java-client | src/main/java/com/shippo/model/CustomsItem.java | [
"public class APIConnectionException extends ShippoException {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic APIConnectionException(String message) {\n\t\tsuper(message);\n\t}\n\n\tpublic APIConnectionException(String message, Throwable e) {\n\t\tsuper(message, e);\n\t}\n\n}",
"public class AP... | import java.util.Map;
import com.shippo.exception.APIConnectionException;
import com.shippo.exception.APIException;
import com.shippo.exception.AuthenticationException;
import com.shippo.exception.InvalidRequestException;
import com.shippo.net.APIResource; | package com.shippo.model;
public class CustomsItem extends APIResource {
String objectState;
String objectStatus;
String object_purpose;
String objectId;
String objectOwner;
Object objectCreated;
Object objectUpdated;
Object description;
Object quantity;
Object netWeight;
... | InvalidRequestException, APIConnectionException, APIException { | 0 |
SQLPower/power-architect | src/main/java/ca/sqlpower/architect/ddl/critic/CriticAndSettings.java | [
"public class ArchitectProject extends AbstractSPObject {\n \n /**\n * Defines an absolute ordering of the child types of this class.\n * \n * IMPORTANT!: When changing this, ensure you maintain the order specified by {@link #getChildren()}\n */\n public static final List<Class<? extends SP... | import java.util.Collections;
import java.util.List;
import ca.sqlpower.architect.ArchitectProject;
import ca.sqlpower.architect.ddl.DB2DDLGenerator;
import ca.sqlpower.architect.ddl.DDLGenerator;
import ca.sqlpower.architect.ddl.H2DDLGenerator;
import ca.sqlpower.architect.ddl.HSQLDBDDLGenerator;
import ca.sqlpower.ar... | /*
* Copyright (c) 2010, SQL Power Group Inc.
*
* This file is part of SQL Power Architect.
*
* SQL Power Architect 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
*... | GENERIC("Generic", DDLGenerator.class), | 1 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/request/config/ConfigUpdate.java | [
"public class Heroku {\n\n\n public enum Config {\n ENDPOINT(\"HEROKU_HOST\", \"heroku.host\", \"heroku.com\");\n public final String environmentVariable;\n public final String systemProperty;\n public final String defaultValue;\n public final String value;\n\n Config(St... | import com.heroku.api.Heroku;
import com.heroku.api.exception.RequestFailedException;
import com.heroku.api.http.Http;
import com.heroku.api.parser.Json;
import com.heroku.api.request.Request;
import com.heroku.api.request.RequestConfig;
import com.heroku.api.response.Unit;
import java.util.Collections;
import java.uti... | package com.heroku.api.request.config;
/**
* TODO: Javadoc
*
* @author James Ward
*/
public class ConfigUpdate implements Request<Unit> {
private final RequestConfig config;
private final Map<String,?> configVars;
public ConfigUpdate(String appName, Map<String, String> configVars) {
this.c... | return Json.encode(configVars); | 3 |
patrickfav/planb-android | planb-core/src/main/java/at/favre/lib/planb/PlanB.java | [
"public class InMemoryCrashDataHandler implements CrashDataHandler {\n private List<CrashData> crashDataList = new ArrayList<>();\n private boolean unhandled = false;\n\n @Nullable\n @Override\n public CrashData getLatest() {\n unhandled = false;\n if (crashDataList.isEmpty()) {\n ... | import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import at.favre.lib.planb.data.InMemoryCrashDataHandler;
import at.favre.l... | package at.favre.lib.planb;
/**
* PlanB is a local crash reporting and recovery library.
* <p>
* This is the main API of the library.
* <p>
* Note: if the app crashes with an unhandled exception, all classes
* will lose their state. So any code executed after handling he exception
* will be called with a new ... | return new SharedPrefCrashDataHandler(ctx); | 1 |
nikacotAndroid/Weather-Guru-MVP | app/src/test/java/mk/petrovski/weathergurumvp/data/ApiHelperTest.java | [
"public class TestModels {\n\n public static WeatherResponseModel getWeatherResponseModel(int weatherListSize) {\n List<WeatherModel> list = new ArrayList<>();\n for (int i = 0; i < weatherListSize; i++) {\n list.add(newWeatherModel());\n }\n\n WeatherResponseModel responseModel = new WeatherRespo... | import io.reactivex.Observable;
import io.reactivex.observers.TestObserver;
import mk.petrovski.weathergurumvp.TestModels;
import mk.petrovski.weathergurumvp.data.remote.ApiInterface;
import mk.petrovski.weathergurumvp.data.remote.AppApiHelper;
import mk.petrovski.weathergurumvp.data.remote.helper.error.ErrorHandlerHel... | package mk.petrovski.weathergurumvp.data;
/**
* Created by Nikola Petrovski on 4/3/2017.
*/
@RunWith(MockitoJUnitRunner.class) public class ApiHelperTest {
@Mock ApiInterface apiInterface;
@Mock ErrorHandlerHelper errorHandlerHelper;
private AppApiHelper appApiHelper;
@Before public void setUp() {
... | SearchApiResponseModel responseModel = TestModels.getSearchResponseModel(5); | 4 |
ewidgetfx/ewidgetfx | ewidgets/ConferenceTour/src/main/java/org/ewidgetfx/widget/conferencetour/ConferenceTourWidget.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.scene.paint.Color;
import javafx.scene.shape.SVGPath;
import org.ewidgetfx.core.DefaultWidget;
import org.ewidgetfx.core.LaunchInfo;
import org.ewidgetfx.core.TextIconOverlay;
import org.ewidgetfx.core.WidgetIcon;
import org.ewidgetfx.util.Demo; | /*
* 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 ... | TextIconOverlay tio = new TextIconOverlay(); | 2 |
liuhangyang/StormMQ | src/main/java/com/ystruct.middleware/stormmq/broker/netty/AckSendThread.java | [
"public class AckManager {\n //ConcurrentLinkedQueue是一个非阻塞的线程安全的队列,注意不要使用ConcurrentLinkQueue的size()方法,此方法会遍历所有的元素\n private static ConcurrentLinkedQueue<SendResult> ackQueue = new ConcurrentLinkedQueue<SendResult>();\n private static ConcurrentHashMap<String/*requestId*/,Channel> producerMap = new Concurre... | import broker.AckManager;
import broker.SemaphoreManager;
import io.netty.channel.Channel;
import model.RequestResponseFromType;
import model.ResponseType;
import model.StormResponse;
import smq.SendResult; | package broker.netty;
/**
* Created by yang on 16-12-1.
*/
public class AckSendThread implements Runnable {
@Override
public void run() {
while (true){
// System.out.println("得到一个ack");
SemaphoreManager.descrease("Ack");//获取一个ACK的信号量
// System.out.println("得到一个ack1"... | response.setResponseType(ResponseType.SendResult); | 3 |
canyapan/DietDiaryApp | app/src/main/java/com/canyapan/dietdiaryapp/CreateEditEventActivity.java | [
"public class EventTypeArrayAdapter extends ArrayAdapter<EventTypeItem> {\n @LayoutRes\n private static final int RES_ITEM_LAYOUT = R.layout.spinner_dropdown_item;\n\n private final LayoutInflater mInflater;\n\n public EventTypeArrayAdapter(final Context context, final List<EventTypeItem> items) {\n ... | import android.app.DatePickerDialog;
import android.app.TimePickerDialog;
import android.content.Intent;
import android.content.res.TypedArray;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.Bundle;
import android.support.... | package com.canyapan.dietdiaryapp;
public class CreateEditEventActivity extends AppCompatActivity {
private static final String TAG = "CreateEditEventActivity";
public static final String SHORTCUT_KEY_FOOD = "com.canyapan.dietdiaryapp.shortcut.food";
public static final String SHORTCUT_KEY_DRINK = "co... | return EventHelper.getCursorOfDescriptionsByPartial(CreateEditEventActivity.this, description.toString()); | 3 |
CalebKussmaul/GIFKR | src/filter/base/ImageFilter.java | [
"public class FieldControl extends JPanel {\n\n\tprivate static final long serialVersionUID = -7830243454843123445L;\n\t\n\tprivate Field field;\n\tprivate Object obj;\n\tprivate ChangeListener listener; //refreshes display\n\t\n\tprivate boolean animationMode = false;\n\tprivate float time = 0f;\n\t\n\tprivate JCh... | import java.awt.image.BufferedImage;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import filter.base.ControlOverride.ControlType;
import gui.FieldControl;
import gui.FieldControlsPanel;
import kuss... | package filter.base;
public abstract class ImageFilter implements Comparable<ImageFilter> {
@ControlOverride(max = "360")
public double angle = 0;
@ControlOverride(animationControl = ControlType.STATIC)
public static boolean rotateCorrection;
@ControlOverride(animationControl = ControlType.STATIC)
public bool... | BufferedImage filtered = apply(ImageTools.rotate(img, angle, false)); | 3 |
eltrueno/TruenoNPC | src/es/eltrueno/npc/TruenoNPCApi.java | [
"public interface PacketListener {\n\n public void startListening(Plugin plugin);\n\n}",
"public class ProtocolLibListener implements PacketListener{\n\n private static ProtocolManager protocolManager;\n\n private static ArrayList<Player> playerswhointeract = new ArrayList<Player>();\n\n public static... | import es.eltrueno.npc.nms.*;
import es.eltrueno.npc.packetlistener.PacketListener;
import es.eltrueno.npc.packetlistener.ProtocolLibListener;
import es.eltrueno.npc.packetlistener.TinyProtocolListener;
import es.eltrueno.npc.protocollib.TruenoNPC_ProtocolLib;
import es.eltrueno.npc.skin.TruenoNPCSkin;
import org.bukki... | package es.eltrueno.npc;
public class TruenoNPCApi {
/**
*
*
* @author el_trueno
*
*
**/
private static String version;
private static Plugin plugin;
private static ArrayList<TruenoNPC> npcs = new ArrayList<TruenoNPC>();
private static Boolean cache = true;
pr... | TruenoNPC_ProtocolLib.startTask(plugin); | 3 |
txusballesteros/Android-Clean-Testing | app/src/test/java/com/txusballesteros/testing/data/DashboardRepositoryUnitTest.java | [
"@RunWith(JUnit4.class)\n@SmallTest\npublic abstract class UnitTest {\n @Before\n public final void setup() {\n initializeMocks();\n onSetup();\n }\n\n private void initializeMocks() {\n MockitoAnnotations.initMocks(this);\n }\n\n protected abstract void onSetup();\n}",
"pub... | import com.txusballesteros.testing.domain.repository.DashboardRepository;
import org.junit.Test;
import org.mockito.Mock;
import java.util.List;
import static org.mockito.Matchers.anyListOf;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.doThrow;
imp... | /*
* Copyright Txus Ballesteros 2016 (@txusballesteros)
*
* This file is part of some open source application.
*
* 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 copyrig... | @Mock DashboardCache cacheMock; | 1 |
alabeduarte/mypodcasts-android | app/src/test/java/com/mypodcasts/episodes/EpisodeFeedsActivityTest.java | [
"public class UserFeedsRepository {\n\n private final HttpClient httpClient;\n\n @Inject\n public UserFeedsRepository(HttpClient httpClient) {\n this.httpClient = httpClient;\n }\n\n public List<Feed> getFeeds() {\n return httpClient.getApi().getUserFeeds();\n }\n\n public Feed getFeed(String id) {\n ... | import android.app.ProgressDialog;
import android.content.Intent;
import android.widget.ListView;
import android.widget.TextView;
import com.android.volley.toolbox.NetworkImageView;
import com.google.inject.AbstractModule;
import com.mypodcasts.BuildConfig;
import com.mypodcasts.R;
import com.mypodcasts.repositories.Us... | package com.mypodcasts.episodes;
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class EpisodeFeedsActivityTest {
EpisodeFeedsActivity activity;
UserLatestEpisodesRepository userLatestEpisodesRepositoryMock = mock(UserLatestEpisodesRepository.class);
UserFeedsRepository... | Feed feed = aFeed("Awesome Feed"); | 3 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/bolt/jdbc/CamelJdbcStoreBolt.java | [
"public abstract class AmConfigurationBolt extends BaseRichBolt\n{\n /** serialVersionUID */\n private static final long serialVersionUID = 103046340453102132L;\n\n /** StormConfig */\n @SuppressWarnings(\"rawtypes\")\n private Map stormConf;\n\n /** TopologyContext */\n private T... | import com.google.common.collect.Lists;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.camel.ProducerTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import acromusashi.stream.bolt.AmConfigurationBolt;
import acromus... | /**
* 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,... | protected AbstractMessageConverter converter;
| 2 |
captain-miao/bleYan | example/src/main/java/com/github/captain_miao/android/bluetoothletutorial/fragment/BleDevicesFragment.java | [
"public class BleScanner {\n private final static String TAG = BleScanner.class.getName();\n public BaseBleScanner bleScanner;\n\n public BleScanner(Context context, final SimpleScanCallback callback) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n bleScanner = new Loll... | import android.Manifest;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.content.Intent;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Se... | package com.github.captain_miao.android.bluetoothletutorial.fragment;
/**
* @author Yan Lu
* @since 2015-07-23
*/
public class BleDevicesFragment extends BaseFragment implements SimpleScanCallback, PermissionListener {
private static final String TAG = BleDevicesFragment.class.getSimpleName();
private... | rssi, HexUtil.encodeHexStr(scanRecord), favourite.isFavourite); | 4 |
Vhati/OpenUHS | desktop-reader/src/main/java/net/vhati/openuhs/desktopreader/reader/HotSpotNodePanel.java | [
"public interface ByteReference {\n\tpublic long length();\n\n\tpublic InputStream getInputStream() throws IOException;\n}",
"public class HotSpot {\n\tpublic int zoneX;\n\tpublic int zoneY;\n\tpublic int zoneW;\n\tpublic int zoneH;\n\tpublic int x;\n\tpublic int y;\n\n\n\tpublic HotSpot( int zX, int zY, int zW, ... | import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.Stroke;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.aw... | package net.vhati.openuhs.desktopreader.reader;
/**
* A reusable panel that represents a UHSHotSpotNode.
*
* @see net.vhati.openuhs.core.UHSHotSpotNode
*/
public class HotSpotNodePanel extends NodePanel {
private final Logger logger = LoggerFactory.getLogger( HotSpotNodePanel.class );
protected UHSHotSpotN... | public boolean accept( UHSNode node ) { | 4 |
liuling07/QiQuYing | app/src/main/java/com/lling/qiqu/activitys/SplashActivity.java | [
"public class App extends Application {\n\tprivate static App mAppApplication;\n\tpublic static final String SP_FILE_NAME = \"qiquying_msg_sp\";\n\tprivate static SharePreferenceUtil mSpUtil;\n\tpublic static User currentUser = null;\n\tpublic static List<Activity> activities = new ArrayList<Activity>(); //用于记录已经开启... | import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.StrictMode;
import android.util.Log;
import android.view.KeyEvent;
import android.widget.FrameLayout;
import cn.smssdk.SMSSDK;
import com.lidroid.xutils.ViewUtils;
import com.lid... | package com.lling.qiqu.activitys;
/**
* @ClassName: SplashActivity
* @Description: 应用开机界面
* @author lling
* @date 2015年7月15日
*/
@ContentView(R.layout.activity_splash)
public class SplashActivity extends BaseActivity {
private static final String TAG = "SplashActivity";
@SuppressLint("NewApi")
@Override
p... | TencentUtils.initTencent(this, spUtil); | 4 |
pangliang/MirServer-Netty | LoginServer/src/main/java/com/zhaoxiaodan/mirserver/loginserver/handlers/SelectServerHandler.java | [
"public class DB {\n\n\tprivate static SessionFactory ourSessionFactory;\n\tprivate static ServiceRegistry serviceRegistry;\n\n\tpublic static void init() throws Exception {\n\t\tConfiguration configuration = new Configuration();\n\t\tconfiguration.configure();\n\n\t\tserviceRegistry = new StandardServiceRegistryB... | import com.zhaoxiaodan.mirserver.db.DB;
import com.zhaoxiaodan.mirserver.gameserver.entities.ServerInfo;
import com.zhaoxiaodan.mirserver.gameserver.entities.User;
import com.zhaoxiaodan.mirserver.loginserver.LoginClientPackets;
import com.zhaoxiaodan.mirserver.loginserver.LoginServerPackets;
import com.zhaoxiaodan.mir... | package com.zhaoxiaodan.mirserver.loginserver.handlers;
public class SelectServerHandler extends UserHandler {
@Override
public void onPacket(ClientPacket packet, User user) throws Exception {
LoginClientPackets.SelectServer selectServer = (LoginClientPackets.SelectServer) packet;
| List<ServerInfo> list = DB.query(ServerInfo.class);//, Restrictions.eq("name", selectServer.serverName)); | 1 |
scriptkitty/SNC | unikl/disco/calculator/gui/AnalyzeDialog.java | [
"public class SNC {\r\n\r\n private final UndoRedoStack undoRedoStack;\r\n private static SNC singletonInstance;\r\n private final List<Network> networks;\r\n private final int currentNetworkPosition;\r\n\r\n private SNC() {\r\n networks = new ArrayList<>();\r\n undoRedoStack = new Undo... | import java.awt.GridLayout;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import unikl.disco.calculator.SNC;
import unikl.disco.calculator.network.AbstractAnalysis;
import unikl.disco.calculator.network.AnalysisType;
import unikl.disco.calculator.net... | /*
* (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 is" with... | boundSelector = new JComboBox(AbstractAnalysis.Boundtype.values()); | 1 |
senseobservationsystems/sense-android-library | sense-android-library/src/nl/sense_os/service/phonestate/AppInfoSensor.java | [
"public static class DataPoint implements BaseColumns {\n\n public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE\n + \"/vnd.sense_os.data_point\";\n public static final String CONTENT_ITEM_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE\n + \"/vnd.sense_os.data_poi... | import org.json.JSONException;
import org.json.JSONObject;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.u... | package nl.sense_os.service.phonestate;
/**
* Represents the app info sensor. It subscribes itself to the following broadcasts:
* <ul>
* <li> LOCALE_CHANGED (sent by Android whenever the language is changed in Android settings)</li>
* <li> PACKAGE_REPLACED (sent by Android whenever an app is updated)</li>
* <l... | i.putExtra(DataPoint.DATA_TYPE, SenseDataTypes.JSON); | 0 |
Laity000/ChatRoom-JavaFX | ChatClient/src/main/java/com/chatroom/client/ChatController.java | [
"public enum BubbleSpec {\n\n\t/*Copyright {2015} {Terah Laweh}\n\n\t Licensed under the Apache License, Version 2.0 (the \"License\");\n\t you may not use this file except in compliance with the License.\n\t You may obtain a copy of the License at\n\n\t http://www.apache.org/licenses/LICENSE-2.0\n\n\t ... | import java.io.IOException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.LinkedList;
import java.util.ResourceBundle;
import com.chatroom.bubble.BubbleSpec;
import com.chatroom.bubble.BubbledTextFlow;
import com.chatroom.communication.Comm;
import com.chatroom.emojis.E... | usernameLabel.setText(userName);
}
/**
* 设置在线用户列表,并显示在线人数(需要在列表中排除本机用户)
* @param userInfolist 用户集
*/
public void setUserList(LinkedList<UserInfo> userInfolist) {
this.userInfoList = userInfolist;
/*
System.out.print("UserList:");
for(UserInfo user: userInfolist){
System.out.println(user.getUsern... | public void addOtherMessges(Message message){ | 4 |
aeshell/aesh-extensions | aesh/src/test/java/org/aesh/extensions/mv/MvTest.java | [
"@CommandDefinition(name = \"cat\", description = \"concatenate files and print on the standard output\")\npublic class Cat implements Command<CommandInvocation> {\n\n @Option(shortName = 'A', name = \"show-all\", hasValue = false, description = \"equivalent to -vET\")\n private boolean showAll;\n\n @Optio... | import org.aesh.terminal.utils.Config;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import org.aesh.command.registry.CommandRegistryException;
import org.aesh.extensions.cat.... | /*
* JBoss, Home of Professional Open Source
* Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Vers... | prepare(Touch.class, Mkdir.class, Echo.class, Cd.class, Cat.class, Mv.class); | 5 |
jcommon/process | src/main/java/jcommon/process/platform/unix/ProcessLauncher.java | [
"public interface IEnvironmentVariable {\n String getName();\n String getValue();\n}",
"public interface IEnvironmentVariableBlock extends Iterable<IEnvironmentVariable> {\n public static interface IVisitor {\n boolean visit(IEnvironmentVariable var);\n }\n\n public static abstract class Visitor implement... | import jcommon.core.platform.IPlatformImplementation;
import jcommon.core.platform.unix.UnixPlatformProvider;
import jcommon.process.IEnvironmentVariable;
import jcommon.process.IEnvironmentVariableBlock;
import jcommon.process.IProcess;
import jcommon.process.IProcessListener;
import jcommon.process.platform.IProcessL... | /*
Copyright (C) 2013 the original author or authors.
See the LICENSE.txt file distributed with this work for additional
information regarding copyright ownership.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtai... | public IProcess launch(final boolean inherit_parent_environment, final IEnvironmentVariableBlock environment_variables, final String[] command_line, final IProcessListener[] listeners) { | 3 |
adridadou/eth-contract-api | src/main/java/org/adridadou/ethereum/SmartContract.java | [
"public class EthAccount {\n private final BigInteger privateKey;\n\n public EthAccount(BigInteger privateKey) {\n this.privateKey = privateKey;\n }\n\n public EthAddress getAddress() {\n Credentials credentials = Credentials.create(ECKeyPair.create(privateKey));\n return EthAddress... | import java.util.Arrays;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import com.google.common.collect.Lists;
import org.adridadou.ethereum.values.EthAccount;
import org.adridadou.ethereum.values.EthAddress;
import org.adridadou.ethereum.values.EthData;
impor... | package org.adridadou.ethereum;
/**
* Created by davidroon on 20.04.16.
* This code is released under Apache 2 license
*/
public class SmartContract {
private final EthAddress address;
private final EthereumBackend ethereum;
private final Contract contract;
private final EthereumProxy proxy;
... | public Object[] callConstFunction(String functionName, EthValue value, Object... args) { | 3 |
bluejoe2008/elfinder-2.x-servlet | src/main/java/org/grapheco/elfinder/controller/executors/UploadCommandExecutor.java | [
"public class MultipleUploadItems {\n Logger _logger = Logger.getLogger(this.getClass());\n List<FileItemStream> _items = new ArrayList<FileItemStream>();\n File _tempDir;\n\n public List<FileItemStream> items() {\n return _items;\n }\n\n public MultipleUploadItems(File tempDir) {\n ... | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.apache.... | package org.grapheco.elfinder.controller.executors;
public class UploadCommandExecutor extends AbstractJsonCommandExecutor
implements CommandExecutor
{
Logger _logger = Logger.getLogger(this.getClass());
// large file will be splitted into many parts
class Part
{
long _start;
long _size;
FileItemStrea... | MultipleUploadItems uploads = MultipleUploadItems.loadFrom(request); | 0 |
DeFuture/AmazeFileManager-master | src/main/java/com/amaze/filemanager/fragments/TabFragment.java | [
"public class MainActivity extends AppCompatActivity implements\n ConnectionCallbacks, OnConnectionFailedListener, GoogleApiClient.ConnectionCallbacks,\n GoogleApiClient.OnConnectionFailedListener {\n public Integer select;\n Futils utils;\n private boolean backPressedToExitOnce = false;\n ... | import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.Menu;
import... | package com.amaze.filemanager.fragments;
/**
* Created by Arpit on 15-12-2014.
*/
public class TabFragment extends android.support.v4.app.Fragment {
public List<Fragment> fragments = new ArrayList<Fragment>();
public ScreenSlidePagerAdapter mSectionsPagerAdapter;
Futils utils = new Futils();
pub... | MainActivity mainActivity; | 0 |
marcio-da-silva-arantes/MINLP | MINLP/src/minlp/samples/non_linear/EquationXY.java | [
"public interface Expr {\n public Expr prod(double coef) throws Exception;\n public Expr prod(Expr expr2) throws Exception;\n \n public Expr sum(Expr expr2) throws Exception;\n public Expr sum(double constant) throws Exception;\n public Expr minus(Expr expr2) throws Exception;\n public Expr min... | import minlp.Expr;
import minlp.MINLP;
import minlp.Var;
import minlp.cplex.CPLEX;
import minlp.glpk.GLPK;
import minlp.gurobi.Gurobi;
import minlp.nlVar; | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package minlp.samples.non_linear;
/**
*
* @author marcio
*/
public class EquationXY {
/**
* This code solve the minimum v... | nlVar x = new nlVar(mip, -3, +9, 32, "x"); | 6 |
release-engineering/pom-version-manipulator | src/test/java/com/redhat/rcm/version/mgr/mod/ExtensionsRemovalModderTest.java | [
"public static File getResourceFile( final String path )\n{\n final URL resource = Thread.currentThread()\n .getContextClassLoader()\n .getResource( path );\n if ( resource == null )\n {\n fail( \"Resource not found: \" + path );\n }\n\n... | import static com.redhat.rcm.version.testutil.TestProjectFixture.getResourceFile;
import static com.redhat.rcm.version.testutil.TestProjectFixture.loadModel;
import static com.redhat.rcm.version.testutil.TestProjectFixture.newVersionManagerSession;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.juni... | /*
* Copyright (C) 2011 John Casey.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This prog... | final Model model = loadModel( BASE + "pom-removable.xml" ); | 1 |
cjdaly/fold | net.locosoft.fold.channel.vitals/src/net/locosoft/fold/channel/vitals/DynamicVitals.java | [
"public class ChannelUtil {\n\n\tpublic static IChannelService getChannelService() {\n\t\treturn FoldUtil.getService(IChannelService.class);\n\t}\n}",
"public interface IChannelService {\n\n\tIChannel[] getAllChannels();\n\n\tIChannel getChannel(String channelId);\n\n\t<T extends IChannel> T getChannel(Class<T> c... | import java.util.List;
import net.locosoft.fold.channel.ChannelUtil;
import net.locosoft.fold.channel.IChannelService;
import net.locosoft.fold.channel.times.ITimesChannel;
import net.locosoft.fold.sketch.pad.neo4j.HierarchyNode;
import net.locosoft.fold.sketch.pad.neo4j.MultiPropertyAccessNode;
import net.locosoft.fol... | /*****************************************************************************
* Copyright (c) 2015 Chris J Daly (github user cjdaly)
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and ... | PropertyAccessNode props = new PropertyAccessNode(subId); | 5 |
Grover-c13/PokeGOAPI-Java | library/src/main/java/com/pokegoapi/api/player/PlayerProfile.java | [
"public class PokemonGo {\n\tprivate static final java.lang.String TAG = PokemonGo.class.getSimpleName();\n\tprivate final Time time;\n\tprivate News news;\n\t@Getter\n\tpublic long startTime;\n\t@Getter\n\tpublic final byte[] sessionHash = new byte[32];\n\t@Getter\n\tpublic RequestHandler requestHandler;\n\t@Gette... | import POGOProtos.Data.Player.CurrencyOuterClass;
import POGOProtos.Data.Player.PlayerStatsOuterClass;
import POGOProtos.Data.PlayerBadgeOuterClass.PlayerBadge;
import POGOProtos.Data.PlayerDataOuterClass.PlayerData;
import POGOProtos.Enums.BadgeTypeOuterClass.BadgeType;
import POGOProtos.Enums.TutorialStateOuterClass;... | /*
* 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 distributed in the hope... | ItemBag bag = api.inventories.itemBag; | 1 |
vgoldin/cqrs-eventsourcing-kafka | services-infrastructure-messaging/src/main/java/io/plumery/messaging/kafka/KafkaCommandListener.java | [
"public interface Action extends Serializable {\n\n}",
"public interface ActionHandler<T extends Action> {\n public void handle(T action);\n}",
"public abstract class ApplicationException extends RuntimeException {\n private final int version;\n private ID aggregateRootId;\n private String action;\... | import com.fasterxml.jackson.databind.ObjectMapper;
import io.dropwizard.lifecycle.Managed;
import io.plumery.core.Action;
import io.plumery.core.ActionHandler;
import io.plumery.core.exception.ApplicationException;
import io.plumery.core.exception.SystemException;
import io.plumery.core.infrastructure.CommandListener;... | package io.plumery.messaging.kafka;
public class KafkaCommandListener implements CommandListener, Managed {
private static final Logger LOG = LoggerFactory.getLogger(KafkaCommandListener.class);
public static final String APPLICATION_EVENTS = ".ApplicationEvents";
private final KafkaConsumer consumer;
... | if (!(ex instanceof ApplicationException)) { | 2 |
Bigkoo/Android-PickerView | pickerview/src/main/java/com/bigkoo/pickerview/builder/TimePickerBuilder.java | [
"public class PickerOptions {\n\n //constant\n private static final int PICKER_VIEW_BTN_COLOR_NORMAL = 0xFF057dff;\n private static final int PICKER_VIEW_BG_COLOR_TITLE = 0xFFf5f5f5;\n private static final int PICKER_VIEW_COLOR_TITLE = 0xFF000000;\n private static final int PICKER_VIEW_BG_COLOR_DEFAU... | import android.content.Context;
import android.support.annotation.ColorInt;
import android.view.View;
import android.view.ViewGroup;
import com.bigkoo.pickerview.configure.PickerOptions;
import com.bigkoo.pickerview.listener.CustomListener;
import com.bigkoo.pickerview.listener.OnTimeSelectChangeListener;
import com.bi... | package com.bigkoo.pickerview.builder;
/**
* Created by xiaosongzeem on 2018/3/20.
*/
public class TimePickerBuilder {
private PickerOptions mPickerOptions;
//Required | public TimePickerBuilder(Context context, OnTimeSelectListener listener) { | 2 |
karsany/obridge | obridge-main/src/main/java/org/obridge/generators/EntityObjectGenerator.java | [
"public class OBridgeConfiguration {\n\n public static final boolean GENERATE_SOURCE_FOR_PLSQL_TYPES = false;\n public static final boolean ADD_ASSERT = false;\n\n private String jdbcUrl;\n private String sourceRoot;\n private String rootPackageName;\n private Packages packages;\n private Loggi... | import org.obridge.util.CodeFormatter;
import org.obridge.util.DataSourceProvider;
import org.obridge.util.MustacheRunner;
import org.obridge.util.OBridgeException;
import java.beans.PropertyVetoException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apa... | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ferenc Karsany
*
* 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
* us... | Pojo pojo = PojoMapper.typeToPojo(typeName, typeAttributes); | 4 |
CyclopsMC/IntegratedTunnels | src/main/java/org/cyclops/integratedtunnels/part/aspect/TunnelAspectReadBuilders.java | [
"@Mod(Reference.MOD_ID)\npublic class IntegratedTunnels extends ModBaseVersionable<IntegratedTunnels> {\n \n /**\n * The unique instance of this mod.\n */\n public static IntegratedTunnels _instance;\n\n public IntegratedTunnels() {\n super(Reference.MOD_ID, (instance) -> _instance = inst... | import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fluids.FluidStack;
import org.apache.commons.lang3.tuple.Pair;
import org.cyclops.commoncapabilities.api.ingredient.storage.IIngredientComponentStorage;
import or... | package org.cyclops.integratedtunnels.part.aspect;
/**
* @author rubensworks
*/
public class TunnelAspectReadBuilders {
public static final class Network {
public static <T, M> Optional<IIngredientComponentStorage<T, M>> getChannel(Capability<? extends IPositionedAddonsNetworkIngredients<T, M>> netwo... | BUILDER_LIST = AspectReadBuilders.BUILDER_LIST.byMod(IntegratedTunnels._instance) | 0 |
bafomdad/realfilingcabinet | com/bafomdad/realfilingcabinet/utils/AutocraftingUtils.java | [
"@Mod(modid=RealFilingCabinet.MOD_ID, name=RealFilingCabinet.MOD_NAME, version=RealFilingCabinet.VERSION, dependencies = \"after:forge@[\" + RealFilingCabinet.FORGE_VER + \",);\")\npublic class RealFilingCabinet {\n\n\tpublic static final String MOD_ID = \"realfilingcabinet\";\n\tpublic static final String MOD_NAME... | import java.util.Iterator;
import java.util.stream.Collectors;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafti... | package com.bafomdad.realfilingcabinet.utils;
public class AutocraftingUtils {
private static int outputSize;
private static IRecipe getRecipeFor(ItemStack stack) {
if (!stack.isEmpty()) {
IRecipe recipe;
if (RealFilingCabinet.crtLoaded) {
recipe = CraftTweakerRFC.getTweakedRecipe(stack);
if... | if (!folder.isEmpty() && folder.getItem() == RFCItems.folder) { | 2 |
Comcast/flume2storm | dynamic-location-service/src/main/java/com/comcast/viper/flume2storm/location/DynamicLocationService.java | [
"public interface TestCondition {\n\t/**\n\t * @return True when the condition is fulfilled, false otherwise\n\t */\n\tboolean evaluate();\n}",
"public class TestUtils {\n private static final int DEFAULT_RETRY_TIMEOUT = 100;\n private static Random random = new Random();\n\n /**\n * @return An ephemeral por... | import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.WatchedEvent;
import org.apac... | /**
* Copyright 2014 Comcast Cable Communications Management, 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 requir... | String lastNodeName = new ZkOperation(zkClient, p).createNode(new ZkNodeCreationArg().setCreateMode( | 4 |
MovieNetwork/Wubble | app/src/main/java/com/proxima/Wubble/adapters/OtherProfileRecyclerAdapter.java | [
"public class FollowActivity extends ToolbarActivity {\n\n private Context context;\n private RecyclerView mRecyclerView;\n private RecyclerView.Adapter mAdapter;\n private RecyclerView.LayoutManager mLayoutManager;\n private List<ParseUser> mFollowUserList;\n private ArrayList<String> followList ... | import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.w... |
@Override
public int getItemViewType(int position) {
return position;
}
// Create new views (invoked by the layout manager)
@Override
public OtherProfileRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
// create a new view
View v = null;
... | } else if (!curUsername.equals(username) && !(mContext instanceof OtherProfileActivity)) { | 1 |
RockinChaos/ItemJoin | src/me/RockinChaos/itemjoin/ChatToggleExecutor.java | [
"public class PlayerHandler {\n\t\n\tprivate static HashMap<String, ItemStack[]> craftingItems = new HashMap<String, ItemStack[]>();\n\tprivate static HashMap<String, ItemStack[]> craftingOpenItems = new HashMap<String, ItemStack[]>();\n\tprivate static HashMap<String, ItemStack[]> creativeCraftingItems = new HashM... | import org.bukkit.command.*;
import org.bukkit.entity.Player;
import me.RockinChaos.itemjoin.handlers.PlayerHandler;
import me.RockinChaos.itemjoin.item.ItemMap;
import me.RockinChaos.itemjoin.item.ItemUtilities;
import me.RockinChaos.itemjoin.utils.ServerUtils;
import me.RockinChaos.itemjoin.utils.StringUtils;
import ... | /*
* 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 ... | ServerUtils.messageSender(player, toggleMessage); | 3 |
hillfly/WifiChat | src/hillfly/wifichat/activity/ImageFactoryActivity.java | [
"public abstract class BaseActivity extends FragmentActivity {\n\n protected Context mContext;\n protected ActionBar mActionBar;\n protected UDPMessageListener mUDPListener;\n protected FlippingLoadingDialog mLoadingDialog;\n\n /**\n * 屏幕的宽度、高度、密度\n */\n protected int mScreenWidth;\n pr... | import hillfly.wifichat.R;
import hillfly.wifichat.common.BaseActivity;
import hillfly.wifichat.common.BaseApplication;
import hillfly.wifichat.common.view.imagefactory.ImageFactoryCrop;
import hillfly.wifichat.common.view.imagefactory.ImageFactoryFliter;
import hillfly.wifichat.util.ImageUtils;
import android.content.... | package hillfly.wifichat.activity;
public class ImageFactoryActivity extends BaseActivity {
private ViewFlipper mVfFlipper;
private Button mBtnLeft;
private Button mBtnRight;
| private ImageFactoryCrop mImageFactoryCrop; | 2 |
otto-de/jlineup | core/src/main/java/de/otto/jlineup/report/ScreenshotsComparator.java | [
"public class RunStepConfig {\n\n private final String reportDirectory;\n private final String workingDirectory;\n private final String screenshotsDirectory;\n private final Step step;\n private final Map<String, String> urlReplacements;\n private final List<String> chromeParameters;\n private ... | import de.otto.jlineup.RunStepConfig;
import de.otto.jlineup.browser.BrowserUtils;
import de.otto.jlineup.browser.ScreenshotContext;
import de.otto.jlineup.config.JobConfig;
import de.otto.jlineup.config.Step;
import de.otto.jlineup.config.UrlConfig;
import de.otto.jlineup.file.FileService;
import de.otto.jlineup.image... | package de.otto.jlineup.report;
public class ScreenshotsComparator {
private final static Logger LOG = LoggerFactory.getLogger(lookup().lookupClass());
private final RunStepConfig runStepConfig;
private final JobConfig jobConfig; | private final FileService fileService; | 5 |
ojacquemart/vlilleChecker | app/src/com/vlille/checker/ui/fragment/adapter/StationsAdapter.java | [
"@Table(name = DB.Table.STATION)\npublic class Station extends Entity {\n\n public static final String ID = \"_id\";\n public static final String NAME = \"suggest_text_1\";\n public static final String LATITUDE = \"latitude\";\n public static final String LATITUDE_E6 = \"latitudeE6\";\n public static... | import android.content.Context;
import android.content.res.Resources;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.*;
import com.vlille.checker.R;
import com.vlille.checker.model.Station;
import com.vlille.checker.ui.delegate... | package com.vlille.checker.ui.fragment.adapter;
/**
* A generic adapter for a stations ListView.
*/
public class StationsAdapter extends ArrayAdapter<Station> {
private static final String TAG = StationsAdapter.class.getSimpleName();
private StationUpdateDelegate stationUpdateDelegate;
private List<S... | StationPreferences stationPreferences = ContextHelper.getPreferences(getContext()); | 3 |
uchicago/shibboleth-oidc | idp-oidc-impl/src/main/java/net/shibboleth/idp/oidc/util/OIDCUtils.java | [
"public final class AuthorizeEndpoint {\n /** URL endpoint for authorization used to map requests. */\n public static final String URL = \"/oidc/authorize\";\n\n /**\n * Instantiates a new authZ endpoint.\n */\n private AuthorizeEndpoint() {}\n}",
"public final class DynamicRegistrationEndpoin... | import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Map;
import net.shibboleth.idp.oidc.endpoints.AuthorizeEndpoint;
import net.shibboleth.idp.oidc.endpoints.DynamicRegistrationEndpoint;
import net.shibboleth.idp.oidc.endpo... | /*
* Licensed to the University Corporation for Advanced Internet Development,
* Inc. (UCAID) under one or more contributor license agreements. See the
* NOTICE file distributed with this work for additional information regarding
* copyright ownership. The UCAID licenses this file to You under the Apache
* Lice... | m.put("revocation_endpoint", baseUrl + "profile" + RevocationEndpoint.URL); | 4 |
ReactiveX/RxJavaJoins | src/main/java/rx/joins/operators/OperatorJoinPatterns.java | [
"public abstract class ActivePlan0 {\n protected final Map<JoinObserver, JoinObserver> joinObservers = new HashMap<JoinObserver, JoinObserver>();\n\n protected abstract void match();\n\n protected void addJoinObserver(JoinObserver joinObserver) {\n joinObservers.put(joinObserver, joinObserver);\n ... | import rx.joins.Pattern2;
import rx.joins.Plan0;
import rx.subscriptions.CompositeSubscription;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Observer;
import rx.Subscriber;
im... | /**
* Copyright 2014 Netflix, Inc.
*
* 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... | public static <T1, T2> Pattern2<T1, T2> and(/* this */Observable<T1> left, Observable<T2> right) { | 3 |
irccloud/android | src/com/irccloud/android/fragment/IgnoreListFragment.java | [
"public class ColorScheme {\n private static ColorScheme instance = new ColorScheme();\n\n public static ColorScheme getInstance() {\n return instance;\n }\n\n public static String getUserTheme() {\n String theme = PreferenceManager.getDefaultSharedPreferences(IRCCloudApplication.getInstan... | import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.PorterDuff;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.Wind... | /*
* Copyright (c) 2015 IRCCloud, Ltd.
*
* 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 ... | Server server = s.getServer(cid); | 4 |
paspiz85/nanobot | src/test/java/it/paspiz85/nanobot/test/steps/AttackScreenSteps.java | [
"public class BotBadBaseException extends BotException {\n\n private static final long serialVersionUID = 1L;\n\n public BotBadBaseException(final String msg) {\n super(msg);\n }\n\n public BotBadBaseException(final String msg, final Throwable t) {\n super(msg, t);\n }\n}",
"public cl... | import it.paspiz85.nanobot.exception.BotBadBaseException;
import it.paspiz85.nanobot.exception.BotException;
import it.paspiz85.nanobot.game.AttackScreen;
import it.paspiz85.nanobot.game.EnemyInfo;
import it.paspiz85.nanobot.game.Screen;
import it.paspiz85.nanobot.util.Point;
import org.junit.Assert;
import cucumber.ap... | package it.paspiz85.nanobot.test.steps;
public class AttackScreenSteps {
@Then("^collectors is (.*)$")
public void thenCollectorIs(final Boolean full) {
final Boolean isCollectorsFull = ScenarioContext.get("isCollectorsFull", Boolean.class);
Assert.assertEquals(full, isCollectorsFull);
... | final Boolean isCollectorsFull = Screen.getInstance(AttackScreen.class).isCollectorFullBase(); | 4 |
zegerhoogeboom/flysystem-java | src/test/java/com/flysystem/cache/CachedAdapterTest.java | [
"public interface Adapter extends Read, Write\n{\n}",
"public class Config\n{\n\tprotected Map<String, Object> settings = new HashMap<String, Object>();\n\tprotected Config fallback;\n\n\tpublic Config(Map<String, Object> settings)\n\t{\n\t\tthis.settings = settings;\n\t}\n\n\tpublic Config()\n\t{\n\t\tthis.setti... | import com.flysystem.core.Adapter;
import com.flysystem.core.Config;
import com.flysystem.core.FileMetadata;
import com.flysystem.core.Visibility;
import com.flysystem.core.cache.Cache;
import com.flysystem.core.cache.CacheCommands;
import com.flysystem.core.cache.CachedAdapter;
import org.hamcrest.CoreMatchers;
import... | /*
* Copyright (c) 2013-2015 Frank de Jonge
*
* 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, merge,... | Cache mockedCache; | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.