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 |
|---|---|---|---|---|---|---|
zqingyang521/qingyang | QingYangDemo/src/com/example/qingyangdemo/ui/IpSetDialog.java | [
"public class MainActivity extends BaseActivity implements OnClickListener {\n\n\tprivate onKeyDownListener keyDownListener;\n\n\t// 抽屉布局\n\tprivate DrawerLayout mDrawerLayout;\n\n\t// 抽屉list\n\tprivate ListView mDrawerList;\n\n\tprivate LinearLayout left_drawer_LinearLayout;\n\n\tprivate LinearLayout open_llt;\n\n... | import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import com.example.qingyangdemo.MainActivity;
import com.example.qingyangdemo.R;
import com.example.qingyangdemo.base.AppManager;... | package com.example.qingyangdemo.ui;
/**
* 设置Ip地址界面
*
* @author 赵庆洋
*
*/
public class IpSetDialog extends BaseActivity {
public final static String IS_STRAT_MAIN = "isStartMain";
private ImageButton closeButton;
private EditText edit1, edit2, edit3, edit4;
private Button submitButton;
| private BaseApplication application; | 3 |
raydac/jprol | examples/java/jprol-example-life/src/main/java/com/igormaznitsa/jprol/example/life/LifeLibrary.java | [
"public class Term {\n\n private final String text;\n\n Term(final String text) {\n this.text = requireNonNull(text);\n }\n\n public int getPriority() {\n return 0;\n }\n\n public String getText() {\n return this.text;\n }\n\n public TermType getTermType() {\n return ATOM;\n }\n\n public boole... | import com.igormaznitsa.jprol.annotations.JProlConsultText;
import com.igormaznitsa.jprol.annotations.JProlPredicate;
import com.igormaznitsa.jprol.data.Term;
import com.igormaznitsa.jprol.data.TermLong;
import com.igormaznitsa.jprol.data.TermStruct;
import com.igormaznitsa.jprol.data.Terms;
import com.igormaznitsa.jpr... | package com.igormaznitsa.jprol.example.life;
@SuppressWarnings("unused")
@JProlConsultText({
"process_cell(X,Y,live) :- count_neighbors(X,Y,N), ((N < 2 ; N > 3), !, reset_cell(X,Y) ; set_cell(X,Y)),!.",
"process_cell(X,Y,dead) :- count_neighbors(X,Y,N), N = 3, set_cell(X,Y),!.",
"life() :- field_width(W),... | public boolean fieldWidth(final JProlChoicePoint choicePoint, final TermStruct struct) { | 5 |
scop/portecle | src/main/net/sf/portecle/DImportKeyPair.java | [
"public static final ResourceBundle RB = ResourceBundle.getBundle(RB_BASENAME);",
"public final class KeyStoreUtil\n{\n\t/**\n\t * Dummy password to use for keystore entries in various contexts of keystores that do not support entry passwords.\n\t */\n\tpublic static final char[] DUMMY_PASSWORD = \"password\".toC... | import static net.sf.portecle.FPortecle.RB;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.security.GeneralSecurityException;
import java.security.Key;
import java.security.... |
initDialog();
getRootPane().getDefaultButton().requestFocusInWindow();
}
/**
* Populate the key pair list with the PKCS #12 keystore's key pair aliases.
*
* @throws CryptoException Problem accessing the keystore's entries
*/
private void populateList()
throws CryptoException
{
try
{
Vecto... | SwingHelper.showAndWait(dViewCertificate); | 3 |
ScreenBasedSimulator/ScreenBasedSimulator | sbs/src/main/java/edu/cmu/lti/bic/sbs/gson/Patient.java | [
"public class BloodPressure implements MedicalParameter {\n\n\tDouble systolicBloodPressure, diastolicBloodPressure;\n\n\tstatic Double systolicBloodPressureLowerBound,\n\t\t\tsystolicBloodPressureUpperBound, diastolicBloodPressureLowerBound,\n\t\t\tdiastolicBloodPressureUpperBound;\n\n\t\n\t\n\tpublic BloodPressur... | import edu.cmu.lti.bic.sbs.simulator.BloodPressure;
import edu.cmu.lti.bic.sbs.simulator.Condition;
import edu.cmu.lti.bic.sbs.simulator.GraphicDisplay;
import edu.cmu.lti.bic.sbs.simulator.HeartRate;
import edu.cmu.lti.bic.sbs.simulator.OxygenLevel;
import edu.cmu.lti.bic.sbs.simulator.RespirationRate; | package edu.cmu.lti.bic.sbs.gson;
enum Status {
great, good, not_good, bad, dying
}
// implements Cloneable for clone() function call to deep copy patient
// object for checkpoint function
public class Patient implements Cloneable {
private String basic; //eg: male, 35, white
private String description; //eg: ... | private BloodPressure bloodPressure = new BloodPressure(90.0, 60.0, 120.0, 60.0, 40.0, 80.0); | 0 |
mcxiaoke/Android-Next | samples/src/main/java/com/mcxiaoke/next/samples/core/TaskQueueSamples.java | [
"public final class NextClient {\n\n static class SingletonHolder {\n static NextClient INSTANCE = new NextClient();\n }\n\n public static NextClient getDefault() {\n return SingletonHolder.INSTANCE;\n }\n\n public static final String TAG = NextClient.class.getSimpleName();\n private... | import android.os.Bundle;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import com.mcxiaoke.next.cach... | package com.mcxiaoke.next.samples.core;
/**
* User: mcxiaoke
* Date: 14-5-22
* Time: 15:13
*/
public class TaskQueueSamples extends BaseActivity {
public static final String TAG = TaskQueueSamples.class.getSimpleName();
@BindView(R.id.input)
EditText mEditText;
@BindView(R.id.button1)
Butto... | TaskQueue.setDebug(true); | 5 |
digitalpetri/ethernet-ip | logix-services/src/main/java/com/digitalpetri/enip/logix/services/ReadTagFragmentedService.java | [
"public class CipResponseException extends Exception {\n\n private final int generalStatus;\n private final int[] additionalStatus;\n\n public CipResponseException(int generalStatus, int[] additionalStatus) {\n this.generalStatus = generalStatus;\n this.additionalStatus = additionalStatus;\n ... | import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import com.digitalpetri.enip.cip.CipResponseException;
import com.digitalpetri.enip.cip.epath.EPath.PaddedEPath;
import com.digitalpetri.enip.cip.services.CipService;
import co... | package com.digitalpetri.enip.logix.services;
public class ReadTagFragmentedService implements CipService<ByteBuf> {
public static final int SERVICE_CODE = 0x52;
private final Consumer<ByteBuf> dataEncoder = this::encode;
private final List<ByteBuf> buffers = Collections.synchronizedList(new ArrayList... | private final PaddedEPath requestPath; | 1 |
xzela/jastroblast | jastroblast-core/src/org/doublelong/jastroblast/screen/CreditsScreen.java | [
"public class JastroBlast extends Game\n{\n\tpublic final String WINDOW_TITLE = \"jAstroBlast\";\n\tpublic static final int WINDOW_WIDTH = 800;\n\tpublic static final int WINDOW_HEIGHT = 600;\n\n\tpublic static AssetManager manager = new AssetManager();\n\tpublic static final boolean DEBUG = true;\n\n\t@Override\n\... | import org.doublelong.jastroblast.JastroBlast;
import org.doublelong.jastroblast.controller.MenuController;
import org.doublelong.jastroblast.entity.CreditsMenu;
import org.doublelong.jastroblast.entity.Screens;
import org.doublelong.jastroblast.managers.ScreenManager;
import org.doublelong.jastroblast.managers.Texture... | package org.doublelong.jastroblast.screen;
public class CreditsScreen extends AbstractScreen
{
private Stage stage;
private Image logo;
private Table table;
private Image cursor;
public CreditsScreen()
{
this.stage = new Stage(); | this.logo = new Image(JastroBlast.manager.get(TextureManager.LOGO, Texture.class)); | 5 |
nextgis/nextgislogger | app/src/main/java/com/nextgis/logger/LoggerService.java | [
"public class ArduinoEngine extends BaseEngine {\n private final static byte DELIMITER = 10;\n private final static char GET_HEADER = 'h';\n private final static char GET_DATA = 'd';\n\n private BluetoothAdapter mBluetoothAdapter;\n private BluetoothDevice mDevice;\n private BluetoothSocket mSocke... | import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.BitmapFac... | /*
* *****************************************************************************
* Project: NextGIS Logger
* Purpose: Productive data logger for Android
* Author: Nikita Kirin
* Author: Stanislav Petriakov, becomeglory@gmail.com
* *****************************************************************************
... | private SensorEngine mSensorEngine; | 4 |
Tanaguru/Contrast-Finder | contrast-finder-api/src/main/java/org/opens/colorfinder/AbstractColorFinder.java | [
"public interface ColorCombinaison {\n \n \n /**\n * \n * @return \n */\n Float getGap();\n \n /**\n *\n * @return\n */\n Color getColor();\n\n /**\n *\n * @param color\n */\n void setColor(Color color);\n\n /**\n *\n * @return\n */\n ... | import java.awt.Color;
import org.apache.log4j.Logger;
import org.opens.colorfinder.result.ColorCombinaison;
import org.opens.colorfinder.result.ColorResult;
import org.opens.colorfinder.result.factory.ColorCombinaisonFactory;
import org.opens.colorfinder.result.factory.ColorResultFactory;
import org.opens.utils.contra... | /*
* Contrast Finder
* Copyright (C) 2008-2013 Open-S Company
*
* 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 ve... | + ContrastChecker.getConstrastRatio(newColor, colorToKeep)); | 4 |
mrico/creole-parser | src/test/java/eu/mrico/creole/test/HeadingsTest.java | [
"public class Creole {\r\n\r\n public static Document parse(String s) {\r\n try {\r\n CreoleParser parser = CreoleParserFactory.newInstance().newParser();\r\n return parser.parse(new StringReader(s));\r\n\r\n } catch (CreoleException e) {\r\n throw new RuntimeExcept... | import org.junit.Test;
import static org.junit.Assert.*;
import eu.mrico.creole.Creole;
import eu.mrico.creole.ast.Document;
import eu.mrico.creole.ast.Heading;
import eu.mrico.creole.ast.Paragraph;
import eu.mrico.creole.ast.Text;
| package eu.mrico.creole.test;
/**
* @see http://www.wikicreole.org/wiki/Creole1.0#section-Creole1.0-Headings
*/
public class HeadingsTest {
@Test
public void level1WithClosing() {
| Document is = Creole.parse("= Level 1 (largest) =");
| 0 |
cattaka/AdapterToolbox | example/src/main/java/net/cattaka/android/adaptertoolbox/example/NestedScrambleAdapterExampleActivity.java | [
"public class ScrambleAdapter<T> extends AbsScrambleAdapter<\n ScrambleAdapter<T>,\n ScrambleAdapter<?>,\n RecyclerView.ViewHolder,\n ForwardingListener<ScrambleAdapter<?>, RecyclerView.ViewHolder>,\n T\n > {\n private Context mContext;\n private List<T> mItems;\n\n ... | import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import net.cattaka.android.a... | package net.cattaka.android.adaptertoolbox.example;
/**
* Created by cattaka on 16/05/02.
*/
public class NestedScrambleAdapterExampleActivity extends AppCompatActivity {
ListenerRelay<ScrambleAdapter<?>, RecyclerView.ViewHolder> mListenerRelay = new ListenerRelay<ScrambleAdapter<?>, RecyclerView.ViewHolder>... | viewHolderViewHolderFactories.add(new SimpleStringViewHolderFactory()); | 5 |
byoutline/CachedField | ottocachedfield/src/main/java/com/byoutline/ottocachedfield/OttoCachedFieldWithArgBuilder.java | [
"public interface CachedFieldWithArg<RETURN_TYPE, ARG_TYPE> {\n\n FieldState getState();\n\n /**\n * Informs {@link SuccessListener} when value is ready.\n *\n * @param arg Argument needed to calculate value.\n */\n void postValue(ARG_TYPE arg);\n\n /**\n * Force value to refresh(be ... | import com.byoutline.cachedfield.CachedFieldWithArg;
import com.byoutline.cachedfield.ProviderWithArg;
import com.byoutline.cachedfield.dbcache.DbCacheArg;
import com.byoutline.cachedfield.dbcache.DbCachedValueProviderWithArg;
import com.byoutline.cachedfield.dbcache.DbWriterWithArg;
import com.byoutline.ibuscachedfiel... | package com.byoutline.ottocachedfield;
/**
* Fluent interface builder of {@link OttoCachedFieldWithArg}.
*
* @param <RETURN_TYPE> Type of object to be cached.
* @param <ARG_TYPE> Type of argument that needs to be passed to calculate value.
* @author Sebastian Kacprzak <sebastian.kacprzak at byoutline.com>
*... | ProviderWithArg<RETURN_TYPE, DbCacheArg<ARG_TYPE>> valueProvider = new DbCachedValueProviderWithArg<API_RETURN_TYPE, RETURN_TYPE, ARG_TYPE>(apiValueProvider, dbSaver, dbValueProvider); | 2 |
MindscapeHQ/raygun4java | core/src/main/java/com/mindscapehq/raygun4java/core/handlers/requestfilters/RaygunExcludeExceptionFilter.java | [
"public interface IRaygunOnBeforeSend extends IRaygunSentEvent {\n RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message);\n}",
"public interface IRaygunSendEventFactory<T> {\n T create();\n}",
"public class RaygunClient {\n\n protected static final String UNHANDLED_EXCEPTION = \"Unhand... | import com.mindscapehq.raygun4java.core.IRaygunOnBeforeSend;
import com.mindscapehq.raygun4java.core.IRaygunSendEventFactory;
import com.mindscapehq.raygun4java.core.RaygunClient;
import com.mindscapehq.raygun4java.core.messages.RaygunErrorMessage;
import com.mindscapehq.raygun4java.core.messages.RaygunMessage; | package com.mindscapehq.raygun4java.core.handlers.requestfilters;
/**
* Given a set of class names, this filter will drop errors that contain any of the classes to exclude in the exception chain.
* The intention is to remove exceptions like AccessDeniedException
*/
public class RaygunExcludeExceptionFilter impleme... | public RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message) { | 4 |
nerdammer/spash | core/src/main/java/it/nerdammer/spash/shell/command/spi/RmDirCommand.java | [
"public interface FileSystemFacade {\n\n /**\n * Returns the defaul filesystem.\n *\n * @return the filesystem\n */\n FileSystem getFileSystem();\n\n /**\n * Returns a collection of paths contained in the given path.\n *\n * @param path the base path\n * @return the sub path... | import it.nerdammer.spash.shell.api.fs.FileSystemFacade;
import it.nerdammer.spash.shell.api.fs.SpashFileSystem;
import it.nerdammer.spash.shell.command.AbstractCommand;
import it.nerdammer.spash.shell.command.CommandResult;
import it.nerdammer.spash.shell.command.ExecutionContext;
import java.nio.file.Path;
import jav... | package it.nerdammer.spash.shell.command.spi;
/**
* Command to remove a directory.
*
* @author Nicola Ferraro
*/
public class RmDirCommand extends AbstractCommand {
public RmDirCommand(String commandString) {
super(commandString);
}
@Override
public CommandResult execute(ExecutionContex... | FileSystemFacade fs = SpashFileSystem.get(); | 1 |
easyJsonApi/easyJsonApi | src/test/java/com/github/easyjsonapi/entities/JsonApiTest.java | [
"public final class Data implements Cloneable {\n\n @SerializedName(value = \"attributes\")\n private final Object attr;\n\n @SerializedName(value = \"id\")\n private final String id;\n\n // @SerializedName(value = \"links\")\n // private final Object links;\n\n @SerializedName(value = \"relati... | import com.github.easyjsonapi.entities.test.EntityDependencyTest;
import com.github.easyjsonapi.entities.test.EntityTestAttr1;
import java.math.BigDecimal;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import com.github.easyjsonapi.entities.Data;
import com.github.easyjsonapi.entities.Error;
im... | /*
* #%L
* EasyJsonApi
* %%
* Copyright (C) 2016 EasyJsonApi
* %%
* 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 re... | EntityDependencyTest testDependency = new EntityDependencyTest(); | 5 |
cattaka/AdapterToolbox | example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/TreeItemAdapterExampleActivityTest.java | [
"public class MyTreeItemAdapter extends AbsChoosableTreeItemAdapter<\n MyTreeItemAdapter,\n MyTreeItemAdapter.ViewHolder,\n MyTreeItem,\n MyTreeItemAdapter.WrappedItem\n > {\n public static ITreeItemAdapterRef<MyTreeItemAdapter, ViewHolder, MyTreeItem, WrappedItem> REF = new IT... | import android.support.test.rule.ActivityTestRule;
import android.view.View;
import net.cattaka.android.adaptertoolbox.example.adapter.MyTreeItemAdapter;
import net.cattaka.android.adaptertoolbox.example.data.MyTreeItem;
import net.cattaka.android.adaptertoolbox.example.test.MockSnackbarLogic;
import net.cattaka.androi... | package net.cattaka.android.adaptertoolbox.example;
/**
* Created by cattaka on 16/06/05.
*/
public class TreeItemAdapterExampleActivityTest {
@Rule
public ActivityTestRule<TreeItemAdapterExampleActivity> mActivityTestRule = new ActivityTestRule<>(TreeItemAdapterExampleActivity.class, false, true);
... | TestUtils.Entry<MyTreeItemAdapter.WrappedItem> entry = find(adapter.getItems(), MyTreeItemAdapter.WrappedItem.class, i); | 5 |
mathisdt/sdb2 | src/main/java/org/zephyrsoft/sdb2/StatisticsController.java | [
"@XmlRootElement(name = \"song\")\n@XmlAccessorType(XmlAccessType.NONE)\n@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)\npublic class Song implements Serializable, Comparable<Song>, Persistable {\n\t\n\tprivate static final long serialVersionUID = -7133402923581521674L;\n\t\n\t@XmlElement(name = \"title\")\n\tpriva... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.apache.poi.hssf.usermodel.HSSFDataFormat;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import o... | /*
* This file is part of the Song Database (SDB).
*
* SDB is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License 3.0 as published by
* the Free Software Foundation.
*
* SDB is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; wit... | private StatisticsModel statistics = null; | 3 |
raydac/jprol | engine/jprol-core/src/main/java/com/igormaznitsa/jprol/utils/Utils.java | [
"public static TermList newList(final Term term) {\n return new TermList(term);\n}",
"public static TermLong newLong(final String text) {\n return new TermLong(text);\n}",
"public class Term {\n\n private final String text;\n\n Term(final String text) {\n this.text = requireNonNull(text);\n }\n\n publi... | import static com.igormaznitsa.jprol.data.TermType.ATOM;
import static com.igormaznitsa.jprol.data.Terms.newList;
import static com.igormaznitsa.jprol.data.Terms.newLong;
import com.igormaznitsa.jprol.data.Term;
import com.igormaznitsa.jprol.data.TermList;
import com.igormaznitsa.jprol.data.TermLong;
import com.igormaz... | }).filter(Objects::nonNull).toArray(Throwable[]::new);
}
public static <T> CloseableIterator<T> makeCloseableIterator(final Iterator<T> iterator,
final Runnable onClose) {
return new CloseableIterator<T>() {
private final Iterator<T> wrap... | if (right instanceof TermLong && left.getTermType() == ATOM) { | 4 |
pengjianbo/SQLiteFinal | sqlitefinal/src/main/java/cn/finalteam/sqlitefinal/sqlite/SqlInfoBuilder.java | [
"public class DbHelper {\n\n //*************************************** create instance ****************************************************\n\n /**\n * key: dbName\n */\n private static HashMap<String, DbHelper> daoMap = new HashMap<>();\n\n private SQLiteDatabase database;\n private DaoConfi... | import cn.finalteam.sqlitefinal.DbHelper;
import cn.finalteam.sqlitefinal.exception.DbException;
import cn.finalteam.sqlitefinal.table.Column;
import cn.finalteam.sqlitefinal.table.ColumnUtils;
import cn.finalteam.sqlitefinal.table.Finder;
import cn.finalteam.sqlitefinal.table.Id;
import cn.finalteam.sqlitefinal.table.... | /*
* Copyright (c) 2013. wyouflf (wyouflf@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicabl... | List<KeyValue> keyValueList = entity2KeyValueList(db, entity); | 6 |
marcospassos/java-php-serializer | src/main/java/com/marcospassos/phpserializer/adapter/ObjectAdapter.java | [
"public class Context\n{\n /**\n * Maps objects to reference indexes.\n */\n private Map<Object, Integer> references;\n\n /**\n * The adapter registry.\n */\n private AdapterRegistry registry;\n\n /**\n * The naming strategy.\n */\n private NamingStrategy namingStrategy;\n\... | import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import com.marcospassos.phpserializer.Context;
import com.marcospassos.phpserializer.FieldExclusionStrategy;
import com.marcospassos.phpserializer.NamingStrategy;
import com.marcospassos.phpserializer.TypeAdapter;
import com.marcospassos... | package com.marcospassos.phpserializer.adapter;
/**
* Base adapter for {@code Object} type.
*
* @author Marcos Passos
* @since 1.0
*/
public class ObjectAdapter<T> implements TypeAdapter<T>
{
@Override
public void write(T object, Writer writer, Context context)
{
Class type = object.getClass(... | FieldExclusionStrategy exclusionStrategy | 1 |
EthanCo/Halo-Turbo | halo-turbo-mina/src/main/java/com/ethanco/halo/turbo/mina/MinaTcpServerSocket.java | [
"public abstract class AbstractSocket implements ISocket, ILog {\n protected Config config;\n protected ISession session = null;\n protected List<IHandler> handlers = new ArrayList<>();\n protected Handler M = new Handler(Looper.getMainLooper());\n protected ConvertManager convertManager;\n\n publ... | import com.ethanco.halo.turbo.ads.AbstractSocket;
import com.ethanco.halo.turbo.bean.Config;
import org.apache.mina.core.service.IoHandlerAdapter;
import org.apache.mina.core.session.IdleStatus;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mi... | package com.ethanco.halo.turbo.mina;
/**
* Mina Nio Tcp Server
*
* @author EthanCo
* @since 2017/1/17
*/
public class MinaTcpServerSocket extends AbstractSocket {
private NioSocketAcceptor acceptor;
private InetSocketAddress address;
public MinaTcpServerSocket(Config config) {
super(con... | acceptor.getFilterChain().addLast(HEARTBEAT, keepAliveFilter); | 3 |
Azure/azure-storage-android | microsoft-azure-storage-test/src/com/microsoft/azure/storage/blob/CloudAppendBlobTests.java | [
"public final class OperationContext {\n\n /**\n * The default log level, or null if disabled. The default can be overridden to turn on logging for an individual\n * operation context instance by using setLoggingEnabled.\n */\n private static Integer defaultLogLevel;\n\n /**\n * Indicates w... | import com.microsoft.azure.storage.AccessCondition;
import com.microsoft.azure.storage.OperationContext;
import com.microsoft.azure.storage.ResponseReceivedEvent;
import com.microsoft.azure.storage.RetryNoRetry;
import com.microsoft.azure.storage.SendingRequestEvent;
import com.microsoft.azure.storage.StorageErrorCodeS... | /**
* Copyright Microsoft Corporation
*
* 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... | OperationContext ctx = new OperationContext(); | 0 |
stefanhaustein/expressionparser | demo/cas/src/main/java/org/kobjects/expressionparser/demo/cas/TreeBuilder.java | [
"public class ExpressionParser<T> {\n\n private final HashMap<String,Symbol> prefix = new HashMap<>();\n private final HashMap<String,Symbol> infix = new HashMap<>();\n private final HashSet<String> otherSymbols = new HashSet<>();\n private final HashSet<String> primary = new HashSet<>();\n private final HashM... | import org.kobjects.expressionparser.ExpressionParser;
import org.kobjects.expressionparser.OperatorType;
import org.kobjects.expressionparser.Processor;
import org.kobjects.expressionparser.Tokenizer;
import org.kobjects.expressionparser.demo.cas.tree.Node;
import org.kobjects.expressionparser.demo.cas.tree.NodeFactor... | package org.kobjects.expressionparser.demo.cas;
public class TreeBuilder extends Processor<Node> {
@Override | public Node infixOperator(Tokenizer tokenizer, String name, Node left, Node right) { | 3 |
kercer/kerkee_android | kerkee/src/com/kercer/kerkee/webview/KCWebViewClient.java | [
"public class KCApiBridge\n{\n\n\tprivate final static KCRegister mRegister = new KCRegister();\n\tprivate static String mJS;\n\tprivate static boolean mIsOpenJSLog = true;\n\n\tpublic static void initJSBridgeEnvironment(KCWebView aWebview, KCScheme aScheme)\n\t{\n\t\tif (!aScheme.equals(KCScheme.FILE) && !KCHttpSe... | import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Build;
import android.util.Log;
import android.webkit.WebResourceRequest;
import android.webkit.WebResourceResponse;
import android.webkit.WebView;
import androi... | package com.kercer.kerkee.webview;
/**
* @author zihong
*/
@SuppressLint("DefaultLocale")
public class KCWebViewClient extends WebViewClient
{
private static KCWebViewClient mInstance;
private KCWebImageDownloader mImageDownloader;
private static KCDefaultImageStream mDefaultImageStream;
/**
... | private KCWebImageHandler mWebImageHandler; | 4 |
ccjeng/News | app/src/main/java/com/ccjeng/news/view/NewsRSSList.java | [
"public class RSSFeed {\n\n\tprivate String title = null; //news title\n\tprivate int itemCount; //count\n\tprivate List<RSSItem> itemList; //all items\n\t\n\t\n\tpublic RSSFeed() {\n\t\titemList = new ArrayList<RSSItem>();\n\t}\n\t\n\t/**\n\t * Add one RSSItem into RSSFeed\n\t * @param item\n\t * @return\n\t */\n\... | import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;... | package com.ccjeng.news.view;
public class NewsRSSList extends MVPBaseActivity<NewsRSSListView, NewsRSSListPresenter>
implements NewsRSSListView {
private static final String TAG = NewsRSSList.class.getSimpleName(); | private Analytics ga; | 3 |
jillesvangurp/jsonj | src/test/java/com/github/jsonj/tools/GeoJsonSupportTest.java | [
"public static @Nonnull JsonArray swapLatLon(@Nonnull JsonArray array) {\n if(array.isNotEmpty() && array.first().isArray()) {\n for(JsonElement e: array) {\n swapLatLon(e.asArray());\n }\n } else {\n if(array.size() < 2) {\n throw new IllegalArgumentException(\"need... | import static com.github.jsonj.tools.GeoJsonSupport.swapLatLon;
import static com.github.jsonj.tools.GeoJsonSupport.toJsonJLineString;
import static com.github.jsonj.tools.GeoJsonSupport.toJsonJPoint;
import static com.github.jsonj.tools.JsonBuilder.array;
import static org.hamcrest.MatcherAssert.assertThat;
import sta... | package com.github.jsonj.tools;
@Test
public class GeoJsonSupportTest {
@Nonnull double[] point1=new double[] {1.0,2.0};
@Nonnull double[] point2=new double[] {2.0,2.0};
@Nonnull double[] point3=new double[] {2.0,1.0};
@Nonnull double[][] lineString1=new double[][] {point1,point2,point3};
@Nonnul... | assertThat(swapLatLon(toJsonJPoint(point1)), is(array(2.0,1.0))); | 0 |
kristian/JDigitalSimulator | src/main/java/lc/kra/jds/components/buildin/general/Junction.java | [
"public static String getTranslation(String key) { return getTranslation(key, TranslationType.TEXT); }",
"public static enum TranslationType { TEXT, ALTERNATIVE, TITLE, EXTERNAL, TOOLTIP, DESCRIPTION; }",
"public abstract class Component implements Paintable, Locatable, Moveable, Cloneable, Serializable {\n\tpr... | import lc.kra.jds.contacts.OutputContact;
import static lc.kra.jds.Utilities.getTranslation;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Point;
import lc.kra.jds.Utilities.TranslationType;
import lc.kra.jds.components.Component;
import lc.kra.jds.components.Sociable;
impo... | /*
* JDigitalSimulator
* Copyright (C) 2017 Kristian Kraljic
*
* 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.
*... | public final InputContact input; | 5 |
messaginghub/pooled-jms | pooled-jms/src/test/java/org/messaginghub/pooled/jms/JmsPoolConnectionTest.java | [
"public class MockJMSConnection implements Connection, TopicConnection, QueueConnection, AutoCloseable {\n\n private static final Logger LOG = LoggerFactory.getLogger(MockJMSConnection.class);\n\n private final MockJMSConnectionStats stats = new MockJMSConnectionStats();\n private final Map<String, MockJMS... | import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNotSame;
import static org.junit.jupiter.api.Assertions.assertSame;
import static or... | /**
* @return true if test succeeded, false otherwise
*/
@Override
public Boolean call() {
Connection conn = null;
Session one = null;
JmsPoolConnectionFactory cf = null;
// wait at most 5 seconds for the call to createSession
... | public void onDeleteTemporaryTopic(MockJMSTemporaryTopic queue) throws JMSException { | 4 |
jesse-gallagher/frostillic.us-Blog | frostillicus-blog/frostillicus-blog-j2ee/src/main/java/api/atompub/BlogResource.java | [
"@RequestScoped\n@Named(\"userInfo\")\npublic class UserInfoBean {\n\tpublic static final String ROLE_ADMIN = \"admin\"; //$NON-NLS-1$\n\n\t@Inject @Named(\"darwinoContext\")\n\tDarwinoContext context;\n\n\t@SneakyThrows\n\tpublic String getImageUrl(final String userName) {\n\t\tString md5 = StringUtil.md5Hex(Strin... | import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.ResourceBundle;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import javax.annotation.security.RolesAllowed;
import javax.... | /*
* Copyright © 2012-2020 Jesse Gallagher
*
* 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... | PostRepository posts; | 4 |
jaychang0917/SimpleRecyclerView | app/src/main/java/com/jaychang/demo/srv/SpacingActivity.java | [
"public class BookCell extends SimpleCell<Book, BookCell.ViewHolder>\n implements Updatable<Book> {\n\n private static final String KEY_TITLE = \"KEY_TITLE\";\n private boolean showHandle;\n\n public BookCell(Book item) {\n super(item);\n }\n\n @Override\n protected int getLayoutRes() {\n return R.layo... | import android.os.Bundle;
import android.view.View;
import com.jaychang.demo.srv.cell.BookCell;
import com.jaychang.demo.srv.cell.NumberCell;
import com.jaychang.demo.srv.model.Book;
import com.jaychang.demo.srv.util.DataUtils;
import com.jaychang.srv.SimpleRecyclerView;
import java.util.ArrayList;
import java.util.Lis... | package com.jaychang.demo.srv;
public class SpacingActivity extends BaseActivity {
@BindView(R.id.linearVerRecyclerView) | SimpleRecyclerView linearVerRecyclerView; | 4 |
TomGrill/gdx-dialogs | ios-moe/src/de/tomgrill/gdxdialogs/iosmoe/IOSMOEGDXDialogs.java | [
"public abstract class GDXDialogs {\n\n\tprotected ArrayMap<String, String> registeredDialogs = new ArrayMap<String, String>();\n\n\tpublic <T> T newDialog(Class<T> cls) {\n\t\tString className = cls.getName();\n\t\tif (registeredDialogs.containsKey(className)) {\n\n\t\t\ttry {\n\t\t\t\tfinal Class<T> dialogClazz =... | import com.badlogic.gdx.Gdx;
import de.tomgrill.gdxdialogs.core.GDXDialogs;
import de.tomgrill.gdxdialogs.core.dialogs.GDXButtonDialog;
import de.tomgrill.gdxdialogs.core.dialogs.GDXProgressDialog;
import de.tomgrill.gdxdialogs.core.dialogs.GDXTextPrompt;
import de.tomgrill.gdxdialogs.iosmoe.dialogs.IOSMOEGDXButtonDial... | /*******************************************************************************
* Copyright 2015 See AUTHORS file.
*
* 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.apach... | registerDialog(GDXButtonDialog.class.getName(), IOSMOEGDXButtonDialog.class.getName()); | 1 |
Azure/azure-storage-android | microsoft-azure-storage/src/com/microsoft/azure/storage/blob/BlobRequest.java | [
"public final class Constants {\n /**\n * Defines constants for ServiceProperties requests.\n */\n public static class AnalyticsConstants {\n\n /**\n * The XML element for the CORS Rule AllowedHeaders\n */\n public static final String ALLOWED_HEADERS_ELEMENT = \"AllowedHe... | import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
import com.microsoft.azure.storage.AccessCondition;
import com.microsoft.azure.storage.Constants;
import com.microsoft.azure.storage.Constants.HeaderConstants;
import com.mic... | /**
* Copyright Microsoft Corporation
*
* 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... | throw new IllegalArgumentException(String.format(Utility.LOCALE_US, SR.ARGUMENT_OUT_OF_RANGE_ERROR, "accessType", publicAccess)); | 4 |
Nilhcem/droidcontn-2016 | app/src/main/java/com/nilhcem/droidcontn/ui/sessions/list/SessionsListActivity.java | [
"@DebugLog\npublic class DroidconApp extends Application {\n\n private AppComponent component;\n\n public static DroidconApp get(Context context) {\n return (DroidconApp) context.getApplicationContext();\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n AndroidTh... | import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.nilhcem.droidcontn.DroidconApp;
import com.nilhcem.droidcontn.R;
import com.nilhcem.droidcontn.data.app.SelectedSessionsMemory;
import com.nilhcem.droidcontn.data.app.model.ScheduleS... | package com.nilhcem.droidcontn.ui.sessions.list;
@IntentBuilder
public class SessionsListActivity extends BaseActivity<SessionsListPresenter> implements SessionsListView {
@Extra ScheduleSlot slot;
@Inject Picasso picasso;
@Inject SelectedSessionsMemory selectedSessionsMemory;
@Bind(R.id.sessio... | public void initSessionsList(List<Session> sessions) { | 3 |
tsauvine/omr | src/omr/gui/structure/SheetStructureEditor.java | [
"public class RegistrationMarker extends Observable {\n public enum RegistrationMarkerEvent {\n MARKER_CHANGED\n }\n \n private int x; // Middlepoint of the marker (center of the image) \n private int y;\n private int imageWidth; // Width of the marker image\n private in... | import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.util.AbstractList;
import java.util.LinkedList;
import javax.swing.AbstractAction;
import javax.swing.KeyStroke;
import javax.swing.... | package omr.gui.structure;
/**
* A component that allows user to define the structure of the answer sheet. A sheet image is displayed underneath, and question groups can be added on the sheet.
*/
public class SheetStructureEditor extends SheetEditor implements MouseListener, MouseMotionListener {
private sta... | for (QuestionGroup group : sheetStructure.getQuestionGroups()) { | 1 |
Gikkman/Java-Twirk | src/test/java/com/gikk/twirk/types/usernotice/TestUsernotice.java | [
"public class TestBiConsumer<T, U> {\n private BiFunction<T,U, Boolean> test;\n private TestResult res;\n\n public TestResult assign(BiFunction<T, U, Boolean> test){\n this.test = test;\n return res = new TestResult();\n }\n\n public void consume(T t, U u){\n if(test != null) {\n... | import com.gikk.twirk.TestBiConsumer;
import com.gikk.twirk.TestResult;
import com.gikk.twirk.enums.USER_TYPE;
import com.gikk.twirk.types.usernotice.subtype.Raid;
import com.gikk.twirk.types.usernotice.subtype.Ritual;
import com.gikk.twirk.types.usernotice.subtype.Subscription;
import com.gikk.twirk.types.usernotice.s... | package com.gikk.twirk.types.usernotice;
public class TestUsernotice {
//***********************************************************
// VARIABLES
//***********************************************************
private static final String SUB = "@badges=subscriber/0;color=#FF69B4;display-name=Gikkman;emotes=;... | public static void test(Consumer<String> twirkInput, TestBiConsumer<TwitchUser, Usernotice> test ) throws Exception{ | 0 |
kermitt2/grobid-ner | src/main/java/org/grobid/trainer/NERFrenchTrainer.java | [
"public class FeaturesVectorNER {\n\n public String string = null; // lexical feature\n public String label = null; // label if known\n\n public String capitalisation = null;// one of INITCAP, ALLCAPS, NOCAPS\n public String digit; // one of ALLDIGIT, CONTAINDIGIT, NODIGIT\n pu... | import com.ctc.wstx.stax.WstxInputFactory;
import org.codehaus.stax2.XMLStreamReader2;
import org.grobid.core.GrobidModels;
import org.grobid.core.exceptions.GrobidException;
import org.grobid.core.exceptions.GrobidResourceException;
import org.grobid.core.features.FeaturesVectorNER;
import org.grobid.core.layout.Layou... | package org.grobid.trainer;
/**
* Create the French NER tagging model
*
* @author Patrice Lopez
*/
public class NERFrenchTrainer extends AbstractTrainer {
private static Logger LOGGER = LoggerFactory.getLogger(NERFrenchTrainer.class);
private NERLexicon nerLexicon = NERLexicon.getInstance();
prote... | INRIALeMondeCorpusStaxHandler target = new INRIALeMondeCorpusStaxHandler(writer); | 3 |
Sciss/TreeTable | java/src/main/java/de/sciss/treetable/j/ui/BasicTreeTableUI.java | [
"public class TreeTable extends JComponent implements Scrollable {\r\n\r\n public TreeTable() {\r\n this(new DefaultTreeTableNode());\r\n }\r\n\r\n public TreeTable(TreeTableNode root) {\r\n this(new DefaultTreeModel(root), new DefaultTreeColumnModel(root));\r\n }\r\n\r\n public TreeTab... | import java.awt.AlphaComposite;
import java.awt.Color;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Composite;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import ja... | Rectangle dr = table.getCellRect(leadRow, col, true);
dr.x += header.getDraggedDistance();
clipR = r.intersection(dr);
clipR.x -= r.x;
}
}
}
if (!g.getClip().intersects(r))
return;
Component c = focusRenderer.getTreeTableCellRendererComponent(
treeTable, "", ... | public void configureCellEditor(DefaultTreeTableCellEditor editor,
| 3 |
yunnet/kafkaEagle | src/main/java/org/smartloli/kafka/eagle/web/service/impl/AlarmServiceImpl.java | [
"public class AlarmDomain {\n\n\tprivate String group = \"\";\n\tprivate String topics = \"\";\n\tprivate long lag = 0L;\n\tprivate String owners = \"\";\n\tprivate String modifyDate = \"\";\n\n\tpublic String getGroup() {\n\t\treturn group;\n\t}\n\n\tpublic void setGroup(String group) {\n\t\tthis.group = group;\n\... | import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.smartloli.kafka.eagle.common.domain.AlarmDomain;
import org.smartloli.kafka.eagle.core.factory.Ka... | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | public Map<String, Object> add(String clusterAlias, AlarmDomain alarm) { | 0 |
pasqualesalza/elephant56 | elephant56/src/main/java/it/unisa/elephant56/core/Driver.java | [
"public class IndividualWrapper<IndividualType extends Individual, FitnessValueType extends FitnessValue>\r\n implements Comparable<IndividualWrapper<IndividualType, FitnessValueType>>, Cloneable {\r\n\r\n private IndividualType individual;\r\n private FitnessValueType fitnessValue;\r\n private Bool... | import it.unisa.elephant56.core.common.IndividualWrapper;
import it.unisa.elephant56.core.common.Properties;
import it.unisa.elephant56.user.common.FitnessValue;
import it.unisa.elephant56.user.common.Individual;
import it.unisa.elephant56.user.operators.*;
import it.unisa.elephant56.user.operators.Initialisation;... | package it.unisa.elephant56.core;
/**
* Initialises and runs a complete Genetic Algorithm execution.
*/
@SuppressWarnings("rawtypes")
public abstract class Driver {
public static final FilesPathFilter avroFilesPathFilter = new FilesPathFilter(null, Constants.AVRO_FILE_EXTENSION);
// Driver ob... | protected Class<? extends Individual> individualClass;
| 3 |
Leviathan-Studio/CraftStudioAPI | src/dev/java/com/leviathanstudio/craftstudio/dev/util/UVMapCreator.java | [
"@SideOnly(Side.CLIENT)\npublic class CSResourceNotRegisteredException extends RuntimeException\n{\n private static final long serialVersionUID = -3495512420502365486L;\n\n /**\n * Create an exception for a resource not registered.\n *\n * @param resourceNameIn\n * The resource that... | import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import com.leviathanstudio.craftstudio.client.exception.CSResourceNotRegisteredException;
import com.leviathanstudio.craftstudio.client.json.CSReadedMode... | package com.leviathanstudio.craftstudio.dev.util;
/**
* Object to help generate a UV Map for a model.
*
* @since 0.3.0
*
* @author Timmypote
*/
@SideOnly(Side.CLIENT)
public class UVMapCreator
{
private CSReadedModel rModel;
private BufferedImage bi;
private int maxu = 0, maxv = 0;
... | this.rModel = RegistryHandler.modelRegistry.getObject(modelIn); | 4 |
aeshell/aesh-extensions | aesh/src/main/java/org/aesh/extensions/highlight/scanner/SQLScanner.java | [
"public interface Encoder {\n\n void textToken(String text, TokenType type);\n\n void beginGroup(TokenType type);\n\n void endGroup(TokenType type);\n\n void beginLine(TokenType type);\n\n void endLine(TokenType type);\n\n public enum Type {\n TERMINAL, DEBUG\n }\n\n public abstract s... | import org.aesh.extensions.highlight.Encoder;
import org.aesh.extensions.highlight.Scanner;
import org.aesh.extensions.highlight.StringScanner;
import org.aesh.extensions.highlight.TokenType;
import org.aesh.extensions.highlight.WordList;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.MatchResul... | /*
* 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... | public void scan(StringScanner source, Encoder encoder, Map<String, Object> options) { | 2 |
TakWolf/CNode-Material-Design | app/src/main/java/org/cnodejs/android/md/ui/adapter/MessageListAdapter.java | [
"public class Message {\n\n public enum Type {\n reply,\n at\n }\n\n private String id;\n\n private Type type;\n\n @SerializedName(\"has_read\")\n private boolean read;\n\n private Author author;\n\n private TopicSimple topic; // 这里不含Author字段,注意\n\n private Reply reply; // 这... | import android.app.Activity;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import org.c... | package org.cnodejs.android.md.ui.adapter;
public class MessageListAdapter extends RecyclerView.Adapter<MessageListAdapter.ViewHolder> {
private final Activity activity;
private final LayoutInflater inflater;
private final List<Message> messageList = new ArrayList<>();
public MessageListAdapter(@... | ContentWebView webContent; | 3 |
heremaps/here-aaa-java-sdk | here-oauth-client/src/main/java/com/here/account/oauth2/HereAccessTokenProvider.java | [
"public class ClientAuthorizationProviderChain implements ClientAuthorizationRequestProvider {\n\n private static final Logger LOG = Logger.getLogger(ClientAuthorizationProviderChain.class.getName());\n private ClientAuthorizationRequestProvider mostRecentProvider = null;\n private List<ClientAuthorization... | import java.io.Closeable;
import java.io.IOException;
import java.util.function.Supplier;
import com.here.account.auth.provider.ClientAuthorizationProviderChain;
import com.here.account.http.HttpProvider;
import com.here.account.http.apache.ApacheHttpClientProvider;
import com.here.account.oauth2.retry.NoRetryPolicy;
i... | /*
* Copyright (c) 2017 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | ClientAuthorizationProviderChain.getNewDefaultClientCredentialsProviderChain(clock); | 0 |
bluejoe2008/elfinder-2.x-servlet | src/main/java/org/grapheco/elfinder/servlet/ConnectorServlet.java | [
"@Controller\n@RequestMapping(\"connector\")\npublic class ConnectorController {\n Logger _logger = Logger.getLogger(this.getClass());\n @Resource(name = \"commandExecutorFactory\")\n private CommandExecutorFactory _commandExecutorFactory;\n\n @Resource(name = \"fsServiceFactory\")\n private FsServic... | import java.io.File;
import java.io.IOException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.grapheco.elfinder.controller.ConnectorController;
imp... | package org.grapheco.elfinder.servlet;
/**
* ConnectorServlet is an example servlet
* it creates a ConnectorController on init() and use it to handle requests on doGet()/doPost()
*
* users should extend from this servlet and customize required protected methods
*
* @author bluejoe
*
*/
public class Connec... | protected StaticFsServiceFactory createServiceFactory(ServletConfig config) | 7 |
kittylyst/ocelotvm | src/test/java/ocelot/classfile/TestClassReading.java | [
"public class OtMethod {\n\n private final String className;\n private final String nameAndType;\n private final byte[] bytecode;\n private final String signature;\n private final int flags;\n private int numParams = -1;\n\n private static final byte[] JUST_RETURN = {RETURN.B()};\n\n public ... | import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import ocelot.*;
import static org.junit.Assert.*;
import ocelot.rt.OtMethod;
import org.junit.Test;
import static ocelot.classfile.CPType.*;
import static ocelot.classfile.OtKlassParser.ACC_PUBLIC;
import static ocelot.classfile.OtKlassParser.... | package ocelot.classfile;
/**
*
* @author ben
*/
public class TestClassReading {
private OtKlassParser ce;
private byte[] buf;
@Test
public void check_cp_for_hello_world() throws IOException, ClassNotFoundException {
String fName = "Println.class";
buf = Utils.pullBytes(fName);
... | assertEquals("Flags should be public, static", ACC_PUBLIC | ACC_STATIC, meth.getFlags()); | 3 |
mitdbg/AdaptDB | src/main/java/core/common/index/JoinRobustTree.java | [
"public static class PartitionSplit {\n\tprivate int[] partitionIds;\n\tprivate PartitionIterator iterator;\n\n\tpublic PartitionSplit(int[] partitionIds, PartitionIterator iterator) {\n\t\tthis.partitionIds = partitionIds;\n\t\tthis.iterator = iterator;\n\t}\n\n\tpublic int[] getPartitions() {\n\t\treturn this.par... | import java.util.*;
import core.adapt.AccessMethod.PartitionSplit;
import core.adapt.JoinQuery;
import core.adapt.Predicate;
import core.adapt.iterator.JoinRepartitionIterator;
import core.adapt.iterator.PartitionIterator;
import core.common.globals.TableInfo;
import core.common.key.ParsedTupleList;
import core.common.... | package core.common.index;
/**
* Created by ylu on 1/21/16.
*/
public class JoinRobustTree implements MDIndex {
public TableInfo tableInfo;
public int maxBuckets;
public int numAttributes;
public int joinAttributeDepth;
public ParsedTupleList sample;
public TYPE[] dimensionTypes;
J... | public PartitionSplit delete(long delteSize, boolean deleteAll,JoinQuery query, int indexPartition, Map<Integer, Long> partitionIdSizeMap) { | 0 |
itsmartin/TesseractUHC | src/com/martinbrook/tesseractuhc/UhcConfiguration.java | [
"public abstract class UhcEvent {\n\tprotected long time;\n\tprivate Boolean handled;\n\tprotected UhcMatch match;\n\tprotected int countdownLength = 3;\n\t\n\tpublic UhcEvent(long time, UhcMatch match) {\n\t\tthis.time = time;\n\t\tthis.match = match;\n\t\tthis.handled = false;\n\t}\n\t\n\tpublic long getTime() {\... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.bukkit.ChatColor;
import org.bukkit.configuration.Configuration;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.inventory.ItemS... | package com.martinbrook.tesseractuhc;
public class UhcConfiguration {
private Configuration defaults;
private UhcMatch m;
private YamlConfiguration md; // Match data
public static String DEFAULT_MATCHDATA_FILE = "uhcmatch.yml";
public static String DEFAULT_TEAMDATA_FILE = "uhcteams.yml";
private ItemStack[]... | UhcEvent event = UhcEventFactory.newEvent(eventDataEntry, m); | 1 |
gejiaheng/Protein | app/src/main/java/com/ge/protein/main/MainPresenter.java | [
"public class AboutActivity extends BaseProteinActivity {\n\n private AboutPresenter aboutPresenter;\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n FirebaseCrashUtils.log(\"AboutActivity created\");\n\n setContentV... | import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import android.text.TextUtils;
import com.ge.protein.about.AboutActivity;
import com.ge.protein.data.ProteinAdapterFacto... | /*
* Copyright 2017 Jiaheng Ge
*
* 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 ... | .getSharedPreferences(Constants.DEFAULT_SHARED_PREFERENCES, Context.MODE_PRIVATE) | 7 |
xdevs23/Cornowser | app/src/main/java/io/xdevs23/cornowser/browser/updater/UpdateActivity.java | [
"public class XquidCompatActivity extends AppCompatActivity {\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n Logging.logd(\"INIT START\");\n super.onCreate(savedInstanceState);\n\n // Logging.logd only logs to logcat if debug mode is enabled\n // Disable deb... | import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v7.app.AlertDialog;
import android.support... | package io.xdevs23.cornowser.browser.updater;
@SuppressWarnings("unused")
public class UpdateActivity extends XquidCompatActivity {
public static ProgressView updateBar;
public static TextView updateStatus;
private static final String
mainAppActivity = ".CornBrowser",
upd... | DownloadUtils.setProgressBar(R.id.updateProgressBar, staticContext); | 2 |
honeybadger-io/honeybadger-java | honeybadger-java/src/integration/java/io/honeybadger/reporter/HoneybadgerReporterIT.java | [
"public class HoneybadgerNoticeLoader {\n private static final int RETRIES = 3;\n public static final int RETRY_DELAY_MILLIS = 5000;\n private final Logger logger = LoggerFactory.getLogger(getClass());\n\n private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper()\n .setDefaultPropertyInclu... | import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import io.honeybadger.loader.HoneybadgerNoticeLoader;
import io.honeybadger.reporter.config.ConfigContext;
import io.honeybadger.reporter.config.SystemSettingsConfigContext;
import io.honeybadger.reporter.dto.CgiData;
import ... | package io.honeybadger.reporter;
public class HoneybadgerReporterIT {
private Logger logger = LoggerFactory.getLogger(getClass());
private final HoneybadgerNoticeLoader loader;
private final NoticeReporter reporter;
public HoneybadgerReporterIT() {
ConfigContext config = new SystemSettingsC... | CgiData expectedCgi = expectedRequest.getCgiData(); | 3 |
AfterLifeLochie/fontbox | src/main/java/net/afterlifelochie/fontbox/layout/PageWriter.java | [
"public class Fontbox {\r\n\r\n\tprivate static Fontbox inst;\r\n\r\n\t/**\r\n\t * Get the current Fontbox instance. If the instance doesn't exist, a new\r\n\t * one will be created for the environment.\r\n\t *\r\n\t * @return The current global Fontbox instance\r\n\t */\r\n\tpublic static Fontbox instance() {\r\n\... | import java.io.IOException;
import java.util.ArrayList;
import net.afterlifelochie.fontbox.Fontbox;
import net.afterlifelochie.fontbox.document.Element;
import net.afterlifelochie.fontbox.layout.components.Page;
import net.afterlifelochie.fontbox.layout.components.PageProperties;
import net.afterlifelochie.io.Int... | package net.afterlifelochie.fontbox.layout;
public class PageWriter {
private ArrayList<Page> pages = new ArrayList<Page>();
private ArrayList<PageCursor> cursors = new ArrayList<PageCursor>();
private PageProperties attributes;
private PageIndex index;
private Object lock = new Object();
private b... | IntegerExclusionStream window = new IntegerExclusionStream(0, what.width);
| 4 |
Kuanghusing/Weather | app/src/main/java/com/kuahusg/weather/Presenter/base/BasePresenter.java | [
"public interface IBaseView {\n void init();\n\n void start();\n\n void error(String message);\n\n void finish();\n}",
"public interface IDataSource {\n void queryWeather(String woeid, RequestWeatherCallback callback);\n\n void queryWeather(RequestWeatherCallback callback);\n\n\n void saveWea... | import com.kuahusg.weather.UI.base.IBaseView;
import com.kuahusg.weather.data.IDataSource;
import com.kuahusg.weather.data.WeatherDataSource;
import com.kuahusg.weather.data.local.LocalForecastDataSource;
import com.kuahusg.weather.data.remote.RemoteForecastDataSource;
import java.lang.ref.WeakReference; | package com.kuahusg.weather.Presenter.base;
/**
* Created by kuahusg on 16-9-27.
*/
public abstract class BasePresenter implements IBasePresenter {
private IBaseView mView;
// private IDataSource dataSource;
private WeakReference<IDataSource> dataSourceWeakReference;
public BasePresenter(IBas... | this.dataSourceWeakReference = new WeakReference<IDataSource>(new WeatherDataSource(new RemoteForecastDataSource(), new LocalForecastDataSource())); | 2 |
TORU0239/ViperUsage | app/src/main/java/toru/io/my/viperusage/view/InitActivity.java | [
"public class InstagramItemModel {\n private String id;\n private String code;\n\n private UserModel user;\n\n private ImageModel images;\n\n @SerializedName(\"created_time\")\n private long createdTime;\n\n @SerializedName(\"caption\")\n private CaptionModel caption;\n\n @SerializedName(... | import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import toru.io.my.viperusage.R;
import toru.io.my.viperusage.databindin... | package toru.io.my.viperusage.view;
public class InitActivity extends AppCompatActivity implements InitView {
private static final String TAG = InitActivity.class.getSimpleName();
private InitPresenter presenter;
private ActivityInitBinding binding;
@Override
protected void onCreate(Bundle sa... | binding.initRecyclerview.setAdapter(new InitViewAdapter(new ArrayList<>())); | 4 |
MindscapeHQ/raygun4java | sampleapp/src/main/java/com/mindscapehq/raygun4java/sampleapp/SampleApp.java | [
"public interface IRaygunClientFactory {\n IRaygunClientFactory withBeforeSend(IRaygunSendEventFactory<IRaygunOnBeforeSend> onBeforeSend);\n IRaygunClientFactory withAfterSend(IRaygunSendEventFactory<IRaygunOnAfterSend> onAfterSend);\n IRaygunClientFactory withFailedSend(IRaygunSendEventFactory<IRaygunOnFa... | import com.mindscapehq.raygun4java.core.IRaygunClientFactory;
import com.mindscapehq.raygun4java.core.IRaygunOnAfterSend;
import com.mindscapehq.raygun4java.core.IRaygunOnBeforeSend;
import com.mindscapehq.raygun4java.core.IRaygunSendEventFactory;
import com.mindscapehq.raygun4java.core.RaygunClient;
import com.mindsca... | package com.mindscapehq.raygun4java.sampleapp;
/**
* To test with getting the version from the jar
* mvn clean package install
* java -jar sampleapp\target\sampleapp-3.0.0-SNAPSHOT-jar-with-dependencies.jar
*/
public class SampleApp {
public static final String API_KEY = "YOUR_API_KEY";
/**
* An e... | class BeforeSendImplementation implements IRaygunOnBeforeSend, IRaygunSendEventFactory<IRaygunOnBeforeSend> { | 3 |
dhbw-horb/forgetIT | forgetIT/src/forgetit/gui/MainWindow.java | [
"@javax.persistence.Entity\npublic class Entity implements Serializable {\n\n\tprivate int id;\n\tprivate String title;\n\tprivate String description;\n\n\tprivate Status status;\n\n\tprivate Function priority;\n\n\tprivate Date startDate;\n\n\tprivate Date endDate;\n\n\tprivate List<Tag> tags;\n\n\tprivate List<En... | import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Butt... | /*
* Copyright 2011 DHBW Stuttgart Campus Horb
*
* 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 la... | AddEntityDialog dialog = new AddEntityDialog(shell); | 1 |
socrata/datasync | src/main/java/com/socrata/datasync/publishers/GISPublisher.java | [
"public class SocrataConnectionInfo\n{\n public String url;\n public String user;\n public String password;\n private static String token;\n\n public SocrataConnectionInfo(String url, String user, String password)\n {\n this.url = url;\n this.user = user;\n this.password = pas... | import com.socrata.datasync.SocrataConnectionInfo;
import com.socrata.datasync.config.userpreferences.UserPreferences;
import com.socrata.datasync.imports2.*;
import com.socrata.datasync.job.GISJob;
import com.socrata.datasync.job.JobStatus;
import com.socrata.datasync.HttpUtility;
import org.apache.http.HttpEntity;
im... | package com.socrata.datasync.publishers;
public class GISPublisher {
private static final Logger logging = Logger.getLogger(GISJob.class.getName());
private static String ticket = "";
public static JobStatus replaceGeo(File file,
SocrataConnectionInfo connectionI... | HttpUtility httpUtility = new HttpUtility(userPrefs, true, 3, 2); | 4 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/fragment/QuotesFragment.java | [
"public abstract class BenihRecyclerListener extends RecyclerView.OnScrollListener\n{\n private int previousTotal = 0;\n private boolean loading = true;\n private int visibleThreshold = 3;\n private int firstVisibleItem;\n private int visibleItemCount;\n private int totalItemCount;\n private in... | import android.content.Intent;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import id.zelory.benih.view.BenihRecyclerListener;
import id.zelory.codepolitan.R;
import id.zelory.codepolitan.data.model.Article;
import id.zelory... | /*
* Copyright (c) 2015 Zelory.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | articleController.loadArticles(Article.TYPE_QUOTE, currentPage); | 1 |
cert-se/megatron-java | src/se/sitic/megatron/filter/CountryCodeFilter.java | [
"public class AppProperties {\n // -- Keys in properties file --\n\n // Implicit\n public static final String JOB_TYPE_NAME_KEY = \"implicit.jobTypeName\";\n\n // General\n public static final String LOG4J_FILE_KEY = \"general.log4jConfigFile\";\n public static final String LOG_DIR_KEY = \"general... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import se.sitic.megatron.core.AppProperties;
import se.sitic.megatron.core.JobContext;
import se.sitic.megatron.core.MegatronException;
import se.si... | package se.sitic.megatron.filter;
/**
* Filter log entries using the country code and TLD in the hostname.
* <p>
* If country code is missing, CountryCodeDecorator will be used to add one.
*/
public class CountryCodeFilter implements ILogEntryFilter {
private static final Logger log = Logger.getLogger(Cou... | String propertyKey = AppProperties.FILTER_EXCLUDE_COUNTRY_CODES_KEY; | 0 |
DDoS/JICI | src/main/java/ca/sapon/jici/parser/name/PrimitiveTypeName.java | [
"public class Environment {\n // TODO make me thread safe\n private static final Map<String, Class<?>> DEFAULT_CLASSES = new HashMap<>();\n private final Map<String, Class<?>> classes = new LinkedHashMap<>(DEFAULT_CLASSES);\n private final Map<String, Variable> variables = new LinkedHashMap<>();\n\n ... | import ca.sapon.jici.evaluator.Environment;
import ca.sapon.jici.evaluator.EvaluatorException;
import ca.sapon.jici.evaluator.type.LiteralType;
import ca.sapon.jici.evaluator.type.PrimitiveType;
import ca.sapon.jici.lexer.Keyword; | /*
* This file is part of JICI, licensed under the MIT License (MIT).
*
* Copyright (c) 2015-2016 Aleksi Sapon <http://sapon.ca/jici/>
*
* 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... | type = PrimitiveType.of(_class); | 3 |
alexandr85/javafx-ws-client | src/main/java/ru/testing/client/controllers/TabWsMessagesController.java | [
"public class FXApp extends Application {\n\n private static final Logger LOGGER = Logger.getLogger(FXApp.class);\n private static final double PRIMARY_STAGE_MIN_WIDTH = 730;\n private static final double PRIMARY_STAGE_MIN_HEIGHT = 540;\n private static Stage primaryStage;\n private static MainContro... | import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.concurrent.Task;
import javafx.fxml.FXML;
import javafx.scene.control.*;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCo... | }
/**
* Show time diff between first and last selected message
*
* @param change ListChangeListener.Change<? extends ReceivedMessage>
*/
private void selectedMessages(ListChangeListener.Change<? extends ReceivedMessage> change) {
if (change.next()) {
showAllMsgAndSel... | if (currentTab instanceof WsMessagesTab) { | 8 |
hageldave/ImagingKit | ImagingKit_Core/src/main/java/hageldave/imagingkit/core/scientific/ColorImg.java | [
"public class Img implements ImgBase<Pixel> {\n\n\t/** boundary mode that will return 0 for out of bounds positions.\n\t * @see #getValue(int, int, int)\n\t * @since 1.0\n\t */\n\tpublic static final int boundary_mode_zero = 0;\n\n\t/** boundary mode that will repeat the edge of of an Img for out of\n\t * bounds po... | import java.awt.Dimension;
import java.awt.color.ColorSpace;
import java.awt.image.BandedSampleModel;
import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.ComponentColorModel;
import java.awt.image.DataBuffer;
import java.awt.image.DataBufferDouble;
import java.awt.image.Raster;
... | /*
* Copyright 2017 David Haegele
*
* 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, publish, ... | dataR[i] = Pixel.r_normalized(val); | 2 |
casiez/libparamtuner | src/gui/src/main/java/fr/univ_lille1/libparamtuner/gui/parameters_panel/ParameterPanel.java | [
"public class MainFrame extends Application {\r\n\t\r\n\tprivate Stage stage;\r\n\tprivate Scene scene;\r\n\t\r\n\tfinal FileChooser fileChooser = new FileChooser();\r\n\tprivate VBox contentPanel;\r\n\tpublic ScrollPane contentScroll; // TODO private\r\n\tprivate MenuItem btnSave;\r\n\tMenu openrecent;\r\n\r\n\tpu... | import fr.univ_lille1.libparamtuner.gui.MainFrame;
import fr.univ_lille1.libparamtuner.parameters.BooleanParameter;
import fr.univ_lille1.libparamtuner.parameters.FloatParameter;
import fr.univ_lille1.libparamtuner.parameters.IntegerParameter;
import fr.univ_lille1.libparamtuner.parameters.Parameter;
import fr.uni... | /*
* libParamTuner
* Copyright (C) 2017 Marc Baloup, Veïs Oudjail
*
* 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... | if (p instanceof IntegerParameter) {
| 3 |
Jadyli/RetrofitClient | app/src/main/java/com/jady/sample/ui/fragment/BaseRequestFragment.java | [
"public class MainApplication extends Application {\n @Override\n public void onCreate() {\n super.onCreate();\n\n HttpManager.init(this, UrlConfig.BASE_URL);\n HttpManager.setOnGetHeadersListener(new HttpManager.OnGetHeadersListener() {\n @Override\n public Map<Stri... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.T... | package com.jady.sample.ui.fragment;
/**
* Created by lipingfa on 2017/6/16.
*/
public class BaseRequestFragment extends Fragment implements View.OnClickListener {
protected View rootView;
protected Button btnBaseRequestGet;
protected TextView tvBaseRequestGet;
protected EditText etBaseRequestPostN... | API.testGet(new ServerCallback<ServerCallbackModel<User>, User>() { | 4 |
NickAcPT/Lithium-Forge | src/main/java/net/nickac/lithium/frontend/mod/LithiumMod.java | [
"public class NetworkEventHandler {\n\n\tpublic static final NetworkEventHandler INSTANCE = new NetworkEventHandler();\n\n\t@SideOnly(Side.CLIENT)\n\t@SubscribeEvent\n\tpublic void clientConnectedToServer(FMLNetworkEvent.ClientConnectedToServerEvent event) {\n\t\tMinecraft.getMinecraft().addScheduledTask(() -> Mine... | import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitialization... | /*
* MIT License
*
* Copyright (c) 2017 NickAc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, m... | getSimpleNetworkWrapper().registerMessage(Handle.class, LithiumMessage.class, 0, Side.CLIENT); | 3 |
D-3/BS808 | libjt808/src/main/java/com/deew/jt808/auth/BasicAuthentication.java | [
"public class MessageCollector {\n\n private Connection mConnection;\n private MessageFilter mFilter;\n private BlockingQueue<Message> mQueue;\n\n private boolean mCancelled = false;\n\n /**\n * Creates a new message collector. If the message filter is {@code null}, then all messages wil... | import com.deew.jt808.conn.MessageCollector;
import com.deew.jt808.msg.Message;
import com.deew.jt808.msg.ServerGenericReply;
import com.deew.jt808.conn.Connection;
import com.deew.jt808.filter.MessageIdFilter;
import com.deew.jt808.msg.AuthenticateRequest; | package com.deew.jt808.auth;
public class BasicAuthentication {
private Connection mConnection;
public BasicAuthentication(Connection conn) {
mConnection = conn;
}
public boolean authenticate(String auth) {
MessageCollector collector = | mConnection.createMessageCollector(new MessageIdFilter(ServerGenericReply.ID)); | 2 |
sagemath/android | src/org/sagemath/droid/activities/CellActivity.java | [
"public class IntConstants {\n\n //New Group, hide Name and Desc\n public static final int DIALOG_NEW_GROUP = 0x000501;\n //Show Edit Specific Hints\n public static final int DIALOG_EDIT_CELL = 0x000502;\n //New cell, show everything\n public static final int DIALOG_NEW_CELL = 0x000503;\n}",
"pu... | import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.PopupMenu;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import androi... | package org.sagemath.droid.activities;
/**
* CellActivity - Main Activity, First Screen
*
* @author Rasmi.Elasmar
* @author Ralf.Stephan
* @author Nikhil Peter Raj
*/
public class CellActivity
extends ActionBarActivity
implements OnGroupSelectedListener,
PopupMenu.OnMenuItemClickListener... | groupDialog.setOnActionCompleteListener(new BaseActionDialogFragment.OnActionCompleteListener() { | 1 |
Nilhcem/devfestnantes-2016 | app/src/internal/java/com/nilhcem/devfestnantes/debug/stetho/AppDumperPlugin.java | [
"@Value\npublic class Session implements Parcelable {\n\n public static final Parcelable.Creator<Session> CREATOR = new Parcelable.Creator<Session>() {\n public Session createFromParcel(Parcel source) {\n return new Session(source);\n }\n\n public Session[] newArray(int size) {\n ... | import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Application;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Sy... | package com.nilhcem.devfestnantes.debug.stetho;
public class AppDumperPlugin implements DumperPlugin {
private final Context context;
private final ApiEndpoint endpoint;
private final SessionsDao sessionsDao; | private final ActivityProvider activityProvider; | 3 |
guillaume-alvarez/ShapeOfThingsThatWere | core/src/com/galvarez/ttw/rendering/FadingMessageRenderSystem.java | [
"public class EntityFactory {\n\n public static Entity createClick(World world, int x, int y, float startScale, float speed) {\n Entity e = world.createEntity();\n EntityEdit edit = e.edit();\n\n MutableMapPosition pos = edit.create(MutableMapPosition.class);\n pos.x = x;\n pos.y = y;\n\n Sprite ... | import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.systems.EntityProcessingSystem;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
... | package com.galvarez.ttw.rendering;
@Wire
public final class FadingMessageRenderSystem extends EntityProcessingSystem {
private ComponentMapper<MutableMapPosition> mmpm;
private ComponentMapper<FadingMessage> fmm;
private final Assets assets;
private final SpriteBatch batch;
private final OrthographicC... | FloatPair drawPosition = MapTools.world2window(position.x, position.y); | 7 |
free46000/MultiItem | demo/src/main/java/com/freelib/multiitem/demo/HeadFootActivity.java | [
"public class BaseItemAdapter extends RecyclerView.Adapter<BaseViewHolder> {\n private List<Object> dataItems = new ArrayList<>();\n private List<Object> headItems = new ArrayList<>();\n private List<Object> footItems = new ArrayList<>();\n private ItemTypeManager itemTypeManager;\n private LoadMoreM... | import android.content.Context;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;
import com.freelib.multiitem.adapter.BaseItemAdapter;
import com.freelib.multiitem.demo.bean.ImageBean;
im... | package com.freelib.multiitem.demo;
@EActivity(R.layout.layout_recycler)
public class HeadFootActivity extends AppCompatActivity {
@ViewById(R.id.recyclerView)
protected RecyclerView recyclerView;
public static void startActivity(Context context) {
HeadFootActivity_.intent(context).start();
... | adapter.register(ImageTextBean.class, new ImageAndTextManager()); | 2 |
wordpress-mobile/WordCamp-Android | app/src/main/java/org/wordcamp/android/wcdetails/SessionDetailsActivity.java | [
"public class SessionDetailAdapter extends BaseAdapter {\n\n private Context mContext;\n private List<MiniSpeaker> speakers;\n private LayoutInflater inflater;\n\n public SessionDetailAdapter(Context ctx, List<MiniSpeaker> speakerList){\n mContext = ctx;\n speakers = speakerList;\n ... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
impo... | package org.wordcamp.android.wcdetails;
/**
* Created by aagam on 12/2/15.
*/
public class SessionDetailsActivity extends AppCompatActivity {
private SessionDB sessionDB;
private org.wordcamp.android.objects.speaker.Session session;
private ArrayList<MiniSpeaker> speakerList; | private DBCommunicator communicator; | 1 |
ryantenney/metrics-spring | src/test/java/com/ryantenney/metrics/spring/MeteredClassTest.java | [
"static CachedGauge<?> forCachedGaugeMethod(MetricRegistry metricRegistry, Class<?> clazz, String methodName) {\n\tMethod method = findMethod(clazz, methodName);\n\tString metricName = forCachedGauge(clazz, method, method.getAnnotation(com.codahale.metrics.annotation.CachedGauge.class));\n\tlog.info(\"Looking up ca... | import static com.ryantenney.metrics.spring.TestUtil.forCachedGaugeMethod;
import static com.ryantenney.metrics.spring.TestUtil.forCountedMethod;
import static com.ryantenney.metrics.spring.TestUtil.forExceptionMeteredMethod;
import static com.ryantenney.metrics.spring.TestUtil.forGaugeField;
import static com.ryantenn... | /**
* Copyright (C) 2012 Ryan W Tenney (ryan@10e.us)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | Meter meteredMethod = forMeteredMethod(metricRegistry, MeteredClass.class, "meteredMethod"); | 5 |
IceReaper/DesktopAdventuresToolkit | src/net/eiveo/original/sections/todo/not_converted_yet/ZONE.java | [
"public class IZON {\r\n\tpublic short width;\r\n\tpublic short height;\r\n\tpublic short type;\r\n\tpublic short[] tiles;\r\n\tpublic Short world;\r\n\t\r\n\tpublic static IZON read(SmartByteBuffer data, boolean isYoda, short world) throws Exception {\r\n\t\tIZON instance = new IZON();\r\n\r\n\t\t// Somehow IZON i... | import java.util.ArrayList;
import java.util.List;
import net.eiveo.original.sections.IZON;
import net.eiveo.original.sections.todo.determine_values.IACT;
import net.eiveo.original.sections.todo.determine_values.IZAX;
import net.eiveo.original.sections.todo.determine_values.IZX4;
import net.eiveo.original.section... | package net.eiveo.original.sections.todo.not_converted_yet;
public class ZONE {
public List<Zone> zones = new ArrayList<>();
public static ZONE read(SmartByteBuffer data, boolean isYoda) throws Exception {
ZONE instance = new ZONE();
int length = 0;
int lengthStart = 0;
if (!isYoda) {
... | private List<IACT> IACT = new ArrayList<>();
| 1 |
jonasrottmann/realm-browser | realm-browser/src/main/java/de/jonasrottmann/realmbrowser/browser/BrowserInteractor.java | [
"@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)\npublic abstract class BaseInteractorImpl<P extends BasePresenter> implements BaseInteractor {\n private final P presenter;\n\n protected P getPresenter() {\n return presenter;\n }\n\n protected BaseInteractorImpl(P presenter) {\n this.presenter... | import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.util.ArrayLi... | package de.jonasrottmann.realmbrowser.browser;
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
class BrowserInteractor extends BaseInteractorImpl<BrowserContract.Presenter> implements BrowserContract.Interactor {
@Nullable
private Class<? extends RealmModel> realmModelClass = null;
@Nullable
private Dy... | this.realmModelClass = (Class<? extends RealmModel>) DataHolder.getInstance().retrieve(DATA_HOLDER_KEY_CLASS); | 1 |
juankysoriano/Zen | zen-android/src/main/java/zenproject/meditation/android/ui/menu/dialogs/brush/BrushOptionsDialog.java | [
"public enum AnalyticsTracker implements ZenAnalytics {\n INSTANCE;\n\n public static final String PARAM_NAME = \"name\";\n private FirebaseAnalytics analytics;\n\n public void inject(FirebaseAnalytics analytics) {\n this.analytics = analytics;\n }\n\n @Override\n public void trackBrushC... | import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle;
import com.afollestad.materialdialogs.MaterialDialog;
import com.afollestad.materialdialogs.Theme;
import androidx.annotation.NonNull;
import zenproject.meditation.android.ContextRetriever;
import... | package zenproject.meditation.android.ui.menu.dialogs.brush;
// TODO this class could be provided with the required collaborators and then tested.
public class BrushOptionsDialog extends ZenDialog implements ColorSelectedListener, SizeChangedListener {
public static final String TAG = "BrushOptionsDialog";
| private BrushColor selectedColor = BrushOptionsPreferences.newInstance().getBrushColor(); | 1 |
kraftek/awsdownload | src/main/java/ro/cs/products/ProductDownloader.java | [
"public enum DownloadMode {\n /**\n * Product will be downloaded from the remote site and the corresponding local product,\n * if exists, it will be overwritten\n */\n OVERWRITE,\n /**\n * Product will be downloaded from the remote site and, if a corresponding local product exists,\n * ... | import ro.cs.products.base.DownloadMode;
import ro.cs.products.base.ProductDescriptor;
import ro.cs.products.sentinel2.ProductStore;
import ro.cs.products.util.Logger;
import ro.cs.products.util.NetUtils;
import ro.cs.products.util.ReturnCode;
import ro.cs.products.util.Utilities;
import java.io.FileNotFoundException;
... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | protected ProductStore store; | 2 |
Nanopublication/nanopub-java | src/main/java/org/nanopub/trusty/MakeTrustyNanopub.java | [
"public class MalformedNanopubException extends Exception {\n\n\tprivate static final long serialVersionUID = -1022546557206977739L;\n\n\tpublic MalformedNanopubException(String message) {\n\t\tsuper(message);\n\t}\n\n}",
"public class MultiNanopubRdfHandler extends AbstractRDFHandler {\n\n\tpublic static void pr... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
i... | package org.nanopub.trusty;
public class MakeTrustyNanopub {
@com.beust.jcommander.Parameter(description = "input-nanopub-files", required = true)
private List<File> inputNanopubsFiles = new ArrayList<File>();
@com.beust.jcommander.Parameter(names = "-o", description = "Output file")
private File singleOutpu... | MultiNanopubRdfHandler.process(inFormat, inputFile, new NanopubHandler() { | 2 |
richardtynan/thornsec | src/profile/Router.java | [
"public interface INetworkData extends IData {\n\n\tpublic String[] getServerLabels();\n\n\tpublic String[] getDeviceLabels();\n\n\tpublic String[] getDeviceMacs();\n\n\tpublic String[] getServerProfiles(String server);\n\n\tpublic String getServerData(String server, String label);\n\n\tpublic String getServerUser(... | import java.util.Vector;
import core.iface.INetworkData;
import core.iface.IProfile;
import core.profile.AProfile;
import core.unit.SimpleUnit;
import profile.router.DHCP;
import profile.router.DNS;
import profile.router.PKI;
import profile.router.Subnets;
import singleton.IPTablesConf; | package profile;
public class Router extends AProfile {
public Router() {
super("router");
}
public Vector<IProfile> getUnits(String server, INetworkData data) {
Vector<IProfile> vec = new Vector<IProfile>();
// FWD
vec.addElement(new SimpleUnit("router_fwd", "proceed",
"sudo bash -c \"echo net.ipv... | DHCP dhcp = new DHCP(); | 4 |
jcgay/send-notification | send-notification/src/main/java/fr/jcgay/notification/notifier/anybar/AnyBarNotifier.java | [
"@AutoValue\npublic abstract class Application {\n\n /**\n * Uniquely identify an application. <br>\n * In order to ensure your application's signature is unique, the recommendation is to follow the Internet Media\n * type (also known as MIME content type) format as defined in IETF <a href=\"http://t... | import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import fr.jcgay.notification.Application;
import fr.jcgay.notification.DiscoverableNotifier;
import fr.jcgay.notification.Icon;
import fr.jcgay.notification.IconFileWriter;
import fr... | package fr.jcgay.notification.notifier.anybar;
public class AnyBarNotifier implements DiscoverableNotifier {
private static final Logger LOGGER = getLogger(AnyBarNotifier.class);
private final Application application;
private final AnyBarConfiguration configuration; | private final IconFileWriter iconWriter; | 3 |
sainttx/Auctions | Auctions/src/main/java/com/sainttx/auctions/command/AuctionCommands.java | [
"public enum MessagePath implements Message {\n // Auction formattable messages\n AUCTION_ITEMFORMAT(\"messages.auctionFormattable.itemFormat\"),\n AUCTION_ANTISNIPE_ADD(\"messages.auctionFormattable.antiSnipeAdd\"),\n AUCTION_AUTOWIN(\"messages.auctionFormattable.autowin\"),\n AUCTION_BID(\"messages... | import com.sainttx.auctions.MessagePath;
import com.sainttx.auctions.api.Auction;
import com.sainttx.auctions.api.AuctionManager;
import com.sainttx.auctions.api.AuctionPlugin;
import com.sainttx.auctions.api.MessageFactory;
import com.sainttx.auctions.api.event.AuctionPreBidEvent;
import com.sainttx.auctions.api.rewar... | /*
* Copyright (C) SainttX <http://sainttx.com>
* Copyright (C) contributors
*
* This file is part of Auctions.
*
* Auctions 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 Lice... | Reward reward = auction.getReward(); | 7 |
TorchPowered/OpenByte | src/main/java/net/openbyte/gui/WorkFrame.java | [
"public class LibraryDataFormat {\n public ArrayList<LibraryEntry> libraries;\n}",
"public class LibraryEntry {\n public String path;\n}",
"public enum ModificationAPI {\n MINECRAFT_FORGE,\n MCP,\n BUKKIT,\n}",
"public class UpdateFileEvent implements Event {\n private File fileUpdated;\n ... | import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import net.openbyte.data.file.json.LibraryDataFormat;
import net.openbyte.data.file.json.LibraryEntry;
import net.openbyte.data.file.json.LibrarySerializer;
import net.openbyte.en... | if(this.api == ModificationAPI.MCP) {
worker = new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
if(System.getProperty("os.name").startsWith("Windows")) {
Runtime.getRuntime().exec(... | UpdateFileEvent event = new UpdateFileEvent(selectedFile, rSyntaxTextArea1.getText()); | 3 |
BracketCove/Profiler | app/src/main/java/com/wiseass/profiler/profiledetail/ProfileDetailPresenter.java | [
"public interface AuthSource {\n\n Completable createAccount(Credentials cred);\n\n Completable attemptLogin(Credentials cred);\n\n Completable deleteUser();\n\n Maybe<User> getUser();\n\n Completable logUserOut();\n\n Completable reauthenticateUser(String password);\n\n void setReturnFail(bool... | import com.wiseass.profiler.R;
import com.wiseass.profiler.data.auth.AuthSource;
import com.wiseass.profiler.data.auth.User;
import com.wiseass.profiler.data.database.DatabaseSource;
import com.wiseass.profiler.data.database.Profile;
import com.wiseass.profiler.util.BaseSchedulerProvider;
import io.reactivex.disposable... | package com.wiseass.profiler.profiledetail;
/**
* Created by Ryan on 04/01/2017.
*/
public class ProfileDetailPresenter implements ProfileDetailContract.Presenter {
private AuthSource auth; | private DatabaseSource database; | 2 |
I8C/sonar-flow-plugin | sonar-flow-plugin/src/test/java/be/i8c/codequality/sonar/plugins/sag/webmethods/flow/visitor/check/QualifiedNameCheckTest.java | [
"public class FlowLanguage extends AbstractLanguage {\r\n\r\n public static final String KEY = \"flow\";\r\n public static final String NAME = \"flow\";\r\n\r\n private static Configuration config;\r\n\r\n public FlowLanguage(Configuration config) {\r\n super(KEY, NAME);\r\n FlowLanguage.config = config;\... | import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.FlowLanguage;
import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.squid.FlowAstScanner;
import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.visitor.SimpleMetricVisitor;
import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.visitor.chec... | /*
* i8c
* Copyright (C) 2016 i8c NV
* mailto:contact AT i8c DOT be
*
* 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 option... | SourceFile sfCorrect = FlowAstScanner.scanSingleFile(new File(validPath), checks, metrics);
| 1 |
zzz40500/ThemeDemo | baselibrary/src/main/java/com/dim/widget/ImageButton.java | [
"public class CircleRevealHelper {\n\n private ValueAnimator mValueAnimator;\n\n public CircleRevealHelper(View view) {\n mView = view;\n\n\n if (view instanceof CircleRevealEnable) {\n mCircleRevealEnable = (CircleRevealEnable) view;\n } else {\n throw new RuntimeEx... | import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import com.dim.circletreveal.CircleRevealHelper;
import com.dim.listener.SingleClickListener;
import com.dim.skin.SkinStyle;
import com.dim.skin.hepler.SkinHelper;
import com.dim.circletreveal.CircleRevealEnable;
import co... | package com.dim.widget;
/**
* Created by zzz40500 on 15/8/26.
*/
public class ImageButton extends android.widget.ImageButton implements CircleRevealEnable,SkinEnable {
private CircleRevealHelper mCircleRevealHelper ;
private SkinHelper mSkinHelper;
public ImageButton(Context context) {
supe... | public void setSkinStyle(SkinStyle skinStyle) { | 2 |
MinecraftForge/Srg2Source | src/test/java/net/minecraftforge/srg2source/test/SimpleTestBase.java | [
"public class RangeApplierBuilder {\n private PrintStream logStd = System.out;\n private PrintStream logErr = System.err;\n private List<InputSupplier> inputs = new ArrayList<>();\n private OutputSupplier output = null;\n private Consumer<RangeApplier> range = null;\n private List<Consumer<RangeAp... | import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
import java... | testExtract(original, root.resolve("original.range"), libraries, sourceVersion);
if (Files.exists(mapped)) {
Path range = root.resolve("mapped.range");
testExtract(mapped, range, libraries, sourceVersion);
testApply(original, range, mapped, root.resolve("mapped.tsrg")... | return Util.readStream(stream); | 5 |
uservoice/uservoice-android-sdk | UserVoiceSDK/src/com/uservoice/uservoicesdk/dialog/PasswordDialogFragment.java | [
"public class Session {\n\n private static Session instance;\n\n public static synchronized Session getInstance() {\n if (instance == null) {\n instance = new Session();\n }\n return instance;\n }\n\n public static void reset() {\n instance = null;\n }\n\n pr... | import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import com.uservoice.uservoicesdk.R;
import com.uservoice.user... | package com.uservoice.uservoicesdk.dialog;
@SuppressLint("ValidFragment")
public class PasswordDialogFragment extends DialogFragmentBugfixed {
private final SigninCallback callback;
private EditText password;
public PasswordDialogFragment(SigninCallback callback) {
this.callback = callback;
... | AccessToken.authorize(getActivity(), Session.getInstance().getEmail(getActivity()), password.getText().toString(), new DefaultCallback<AccessToken>(getActivity()) { | 2 |
baishui2004/common_gui_tools | src/main/java/bs/tool/commongui/plugins/FolderAndFileOperate.java | [
"public abstract class AbstractGuiJPanel extends JPanel {\n\n private static final long serialVersionUID = 1L;\n\n public AbstractGuiJPanel() {\n }\n\n /**\n * 获取当前面板.\n */\n public JPanel getContextPanel() {\n return this;\n }\n\n /**\n * 给面板增加指定标题及字体的Label.\n */\n pu... | import bs.tool.commongui.AbstractGuiJPanel;
import bs.tool.commongui.GuiUtils;
import bs.tool.commongui.utils.FileUtils;
import bs.tool.commongui.utils.SimpleMouseListener;
import bs.util.io.PropertiesUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener... | package bs.tool.commongui.plugins;
/**
* 文件(夹)操作.
*/
public class FolderAndFileOperate extends AbstractGuiJPanel {
private static final long serialVersionUID = 1L;
/**
* 路径表单.
*/
private JTextField pathTextField = new JTextField();
/**
* 目录选择.
*/
private JFileChooser searc... | Map<String, String> propsMap = PropertiesUtils.getPropertiesMap(GuiUtils.getActualPath(fileTypePropsPath)); | 4 |
TakWolf/CNode-Material-Design | app/src/main/java/org/cnodejs/android/md/presenter/implement/TopicHeaderPresenter.java | [
"public final class ApiClient {\n\n private ApiClient() {}\n\n public static final ApiService service = new Retrofit.Builder()\n .baseUrl(ApiDefine.API_BASE_URL)\n .client(new OkHttpClient.Builder()\n .addInterceptor(createUserAgentInterceptor())\n .... | import android.app.Activity;
import android.support.annotation.NonNull;
import org.cnodejs.android.md.model.api.ApiClient;
import org.cnodejs.android.md.model.api.SessionCallback;
import org.cnodejs.android.md.model.entity.Result;
import org.cnodejs.android.md.model.storage.LoginShared;
import org.cnodejs.android.md.pr... | package org.cnodejs.android.md.presenter.implement;
public class TopicHeaderPresenter implements ITopicHeaderPresenter {
private final Activity activity;
private final ITopicHeaderView topicHeaderView;
public TopicHeaderPresenter(@NonNull Activity activity, @NonNull ITopicHeaderView topicHeaderView) {... | ApiClient.service.collectTopic(LoginShared.getAccessToken(activity), topicId).enqueue(new SessionCallback<Result>(activity) { | 3 |
hss01248/DialogUtil | dialog/src/main/java/com/hss01248/dialog/StyledDialog.java | [
"public abstract class SuperLvHolder<T> implements View.OnAttachStateChangeListener,ILifeCycle{\n public View rootView;\n\n /*public SuperLvHolder(){\n\n }*/\n\n public SuperLvHolder(Context context){\n if(setLayoutRes() !=0){\n rootView = View.inflate(context,setLayoutRes(),null);\n ... | import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Looper;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import com.hss012... | package com.hss01248.dialog;
/**
* Created by Administrator on 2016/5/4 0004.
*/
public class StyledDialog {
//android.support.v7.app.
public static Context context;
private static int singleChosen;
//private static DialogInterface loadingDialog;//缓存加载中的dialog,便于以后可以不需要对象就让它消失
//private... | DefaultConfig.initBtnTxt(context); | 2 |
spotify/spydra | common/src/main/java/com/spotify/spydra/util/SpydraArgumentUtil.java | [
"public static final String OPTION_ACCOUNT = \"account\";",
"public static final String OPTION_CLUSTER = \"cluster\";",
"public static final String OPTION_MAX_IDLE = \"max-idle\";",
"public static final String OPTION_SERVICE_ACCOUNT = \"service-account\";",
"public enum ClusterType {\n ON_PREMISE,\n DATAP... | import java.io.InputStream;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.Map;
import java.util.Optional;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static com.spotify.spydra.model.Cluste... | /*-
* -\-\-
* Spydra
* --
* Copyright (C) 2016 - 2018 Spotify AB
* --
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unles... | outputConfig.getCluster().getOptions().put(OPTION_ACCOUNT, userId.get()); | 0 |
kovertopz/Paulscode-SoundSystem | src/main/java/paulscode/sound/libraries/SourceJavaSound.java | [
"public class Channel\n{\n/**\n * The library class associated with this type of channel.\n */\n protected Class libraryType = Library.class;\n \n/**\n * Global identifier for the type of channel (normal or streaming). Possible \n * values for this varriable can be found in the \n * {@link paulscode.sound.So... | import java.util.LinkedList;
import javax.sound.sampled.AudioFormat;
import paulscode.sound.Channel;
import paulscode.sound.FilenameURL;
import paulscode.sound.ListenerData;
import paulscode.sound.SoundBuffer;
import paulscode.sound.Source;
import paulscode.sound.SoundSystemConfig;
import paulscode.sound.Vector3D; | package paulscode.sound.libraries;
/**
* The SourceJavaSound class provides an interface to the JavaSound library.
* For more information about the Java Sound API, please visit
* http://java.sun.com/products/java-media/sound/
*<br><br>
*<b><i> SoundSystem LibraryJavaSound License:</b></i><br><b><br>
* ... | public void play( Channel c ) | 0 |
tedgueniche/IPredict | src/ca/ipredict/controllers/ComparePrediction.java | [
"public class Item implements Comparable<Item> {\n\n\tpublic Integer val;\n\t\n\tpublic Item(Integer value) {\n\t\tval = value;\n\t}\n\t\n\t@Override\n\tpublic Item clone() {\n\t\treturn new Item(val);\n\t}\n\t\n\tpublic Item() {\n\t\tval = -1;\n\t}\n\t\t\n\tpublic String toString() {\n\t\treturn val.toString();\n\... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import ca.ipredict.database.Item;
import ca.ipredict.database.Sequence;
import ca.ipredict.predictor.Predictor;
import ca.ipredict.predictor.CPT.CPTPlus.CPTPlusPredictor;
import ca.ipredict.predictor.DG.DGPredictor;
import ca.ipredict.predicto... | package ca.ipredict.controllers;
/**
* This controller demonstrates how to train multiple models and compare
* their predictions
*/
public class ComparePrediction {
public static void main(String...args) {
//Initializing the predictors
HashMap<String, Predictor> predictors = new HashMap<String, Predic... | List<Sequence> trainingSet = new ArrayList<Sequence>(); | 1 |
MHAVLOVICK/Sketchy | src/main/java/com/sketchy/server/action/RenderImage.java | [
"public enum SketchyContext {\n\tINSTANCE;\n\t\n\tprivate static NumberFormat nf = NumberFormat.getInstance();\n\n\tpublic static final Map<String, String> PEN_SIZES = new LinkedHashMap<String, String>();\n\tstatic{\n\t\tnf.setMinimumIntegerDigits(1);\n\t\tnf.setMinimumFractionDigits(1);\n\t\t\n\t\tfor (double penS... | import java.io.File;
import javax.servlet.http.HttpServletRequest;
import com.sketchy.SketchyContext;
import com.sketchy.image.ImageAttributes;
import com.sketchy.image.ImageProcessingThread;
import com.sketchy.image.RenderedImageAttributes;
import com.sketchy.server.HttpServer;
import com.sketchy.server.JSONServletRes... | /*
Sketchy
Copyright (C) 2015 Matthew Havlovick
http://www.quickdrawbot.com
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 2 of the License, or
(at your op... | RenderedImageAttributes renderImageAttributes = (RenderedImageAttributes) ImageAttributes.fromJson(responseBody); | 1 |
6ag/BaoKanAndroid | app/src/main/java/tv/baokan/baokanandroid/ui/activity/LoginActivity.java | [
"public class UserBean {\n\n private static final String TAG = \"UserBean\";\n\n // 用户id\n private String userid;\n\n // token\n private String token;\n\n // 用户名\n private String username;\n\n // 昵称\n private String nickname;\n\n // email\n private String email;\n\n // 用户组\n p... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.InputType;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.view.inpu... |
// 自动弹出键盘
Timer timer = new Timer();
timer.schedule(new TimerTask() {
public void run() {
InputMethodManager inputManager = (InputMethodManager) mUsernameEditText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.showSoftInput... | NetworkUtils.shared.post(APIs.LOGIN, parameters, new NetworkUtils.StringCallback() { | 1 |
mediashelf/fedora-client | fedora-client-core/src/main/java/com/yourmediashelf/fedora/client/request/ModifyObject.java | [
"public static String getXSDDateTime(Date date) {\n return getXSDDateTime(new DateTime(date));\n}",
"public class FedoraClient {\n\n private final org.slf4j.Logger logger = org.slf4j.LoggerFactory\n .getLogger(this.getClass());\n\n private final FedoraCredentials fc;\n\n private final Clien... | import com.yourmediashelf.fedora.client.response.FedoraResponseImpl;
import static com.yourmediashelf.fedora.util.DateUtility.getXSDDateTime;
import java.util.Date;
import org.joda.time.DateTime;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;
import com.yourmediashelf.fed... | /**
* Copyright (C) 2010 MediaShelf <http://www.yourmediashelf.com/>
*
* This file is part of fedora-client.
*
* fedora-client 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 ... | throws FedoraClientException { | 2 |
kraftek/awsdownload | src/main/java/ro/cs/products/sentinel2/amazon/AmazonSearch.java | [
"public abstract class AbstractSearch<T extends Object> {\n protected URI url;\n protected Polygon2D aoi;\n protected double cloudFilter;\n protected String sensingStart;\n protected String sensingEnd;\n protected int relativeOrbit;\n protected Set<String> tiles;\n protected T productType;\n... | import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
import ro.cs.products.base.AbstractSearch;
import ro.cs.products.base.ProductDescriptor;
import ro.cs.products.sentinel2.ProductType;
import ro.... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... | descriptor = new S2L1CProductDescriptor(); | 3 |
BudgetFreak/BudgetFreak | server/accounting/src/test/java/de/budgetfreak/accounting/service/AccountServiceTest.java | [
"public class AccountTestUtils {\n\n private AccountTestUtils() {\n }\n\n public static List<Account> createAccounts(User user) {\n return asList(createCheckingsAccount(user), createSavingsAccount(user));\n }\n\n public static Account createCheckingsAccount(User user) {\n return createA... | import de.budgetfreak.accounting.AccountTestUtils;
import de.budgetfreak.accounting.UserTestUtils;
import de.budgetfreak.accounting.domain.Account;
import de.budgetfreak.accounting.domain.AccountRepository;
import de.budgetfreak.usermanagement.domain.User;
import de.budgetfreak.usermanagement.domain.UserRepository;
imp... | package de.budgetfreak.accounting.service;
public class AccountServiceTest {
private AccountService testSubject;
private AccountRepository accountRepositoryMock;
private UserRepository userRepositoryMock;
@Before
public void setUp() {
accountRepositoryMock = mock(AccountRepository.clas... | User bob = UserTestUtils.createBob(); | 1 |
sputnikdev/bluetooth-manager | src/main/java/org/sputnikdev/bluetooth/manager/impl/AbstractBluetoothObjectGovernor.java | [
"public class BluetoothFatalException extends RuntimeException {\n\n public BluetoothFatalException() {\n\n }\n\n public BluetoothFatalException(String message) {\n super(message);\n }\n\n public BluetoothFatalException(String message, Throwable cause) {\n super(message, cause);\n }... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sputnikdev.bluetooth.URL;
import org.sputnikdev.bluetooth.manager.BluetoothFatalException;
import org.sputnikdev.bluetooth.manager.BluetoothGovernor;
import org.sputnikdev.bluetooth.manager.BluetoothInteractionException;
import org.sputnikdev.bluetooth... | }
@Override
public int hashCode() {
return Objects.hash(url);
}
public String getTransport() {
return transport;
}
@Override
public void init() {
update();
}
@Override
public void update() {
if (state != GovernorState.DISPOSED && updateLock... | throw new BluetoothInteractionException(message, ex); | 2 |
scriptkitty/SNC | unikl/disco/calculator/optimization/SimpleOptimizer.java | [
"public class Arrival implements Serializable {\r\n\t\r\n\t//Members\r\n\t\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate static final long serialVersionUID = 1079479343537123673L;\r\n\tprivate SymbolicFunction rho;\r\n\tprivate SymbolicFunction sigma;\r\n\tprivate Set<Integer> Arrivaldependencies;\r\n\tprivate Set<Intege... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import unikl.disco.calculator.symbolic_math.Arrival;
import unikl.disco.calculator.symbolic_math.Hoelder;
import unikl.disco.calculator.symbolic_math.ParameterMismatchException;
import unikl.disco.calculator.symbolic_math.ServerOverloadEx... | /*
* (c) 2017 Michael A. Beck, Sebastian Henningsen
* disco | Distributed Computer Systems Lab
* University of Kaiserslautern, Germany
* All Rights Reserved.
*
* This software is work in progress and is released in the hope that it will
* be useful to the scientific community. It is provided "as i... | public double minimize(double thetagranularity, double hoeldergranularity) throws ThetaOutOfBoundException, ParameterMismatchException, ServerOverloadException {
| 4 |
mgledi/DRUMS | src/test/java/com/unister/semweb/drums/api/SearchForTest.java | [
"public class DRUMSParameterSet<Data extends AbstractKVStorable> {\r\n /** My private Logger. */\r\n private static Logger logger = LoggerFactory.getLogger(DRUMSParameterSet.class);\r\n\r\n private static final String PROTOTYPE_FILE = \"prototype.dat\";\r\n private static final String PROPERTY_FILE = \"... | import com.unister.semweb.drums.api.DRUMSInstantiator;
import com.unister.semweb.drums.bucket.hashfunction.RangeHashFunction;
import com.unister.semweb.drums.storable.TestStorable;
import com.unister.semweb.drums.utils.RangeHashFunctionTestUtils;
import java.io.File;
import java.nio.ByteBuffer;
import java.util.A... | /*
* Copyright (C) 2012-2013 Unister GmbH
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This pro... | RangeHashFunction hashFunction = RangeHashFunctionTestUtils.createTestFunction(16, Integer.MAX_VALUE / 16,
| 5 |
mkopylec/errorest-spring-boot-starter | src/main/java/com/github/mkopylec/errorest/handling/errordata/generic/ThrowableErrorDataProvider.java | [
"@ConfigurationProperties(\"errorest\")\npublic class ErrorestProperties {\n\n /**\n * HTTP response body format.\n */\n private ResponseBodyFormat responseBodyFormat = FULL;\n /**\n * Properties responsible for handling validation errors.\n */\n private BeanValidationError beanValidatio... | import com.github.mkopylec.errorest.configuration.ErrorestProperties;
import com.github.mkopylec.errorest.handling.errordata.ErrorData;
import com.github.mkopylec.errorest.handling.errordata.ErrorData.ErrorDataBuilder;
import com.github.mkopylec.errorest.handling.errordata.ErrorDataProvider;
import com.github.mkopylec.... | package com.github.mkopylec.errorest.handling.errordata.generic;
public class ThrowableErrorDataProvider extends ErrorDataProvider<Throwable> {
public static final String UNEXPECTED_ERROR_CODE = "UNEXPECTED_ERROR";
public ThrowableErrorDataProvider(ErrorestProperties errorestProperties) {
super(er... | return responseHttpStatus.is4xxClientError() ? HTTP_CLIENT_ERROR_CODE : UNEXPECTED_ERROR_CODE; | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.