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 |
|---|---|---|---|---|---|---|
tusharm/go-artifactory-plugin | src/main/java/com/tw/go/plugins/artifactory/model/GoArtifactFactory.java | [
"public static ConfigElement<Map<String, String>> buildProperties = new BuildPropertiesConfigElement();",
"public static ConfigElement<String> path = new PathConfigElement();",
"public static ConfigElement<UriConfig> uriConfig = new UriConfigElement();",
"public class UriConfig {\n private String uri;\n ... | import static com.google.common.collect.Collections2.transform;
import static com.tw.go.plugins.artifactory.task.config.ConfigElement.buildProperties;
import static com.tw.go.plugins.artifactory.task.config.ConfigElement.path;
import static com.tw.go.plugins.artifactory.task.config.ConfigElement.uriConfig;
import java.... | package com.tw.go.plugins.artifactory.model;
public class GoArtifactFactory {
public Collection<GoArtifact> createArtifacts(final TaskConfig config, TaskExecutionContext context) { | DirectoryScanner scanner = new DirectoryScanner(context.workingDir()); | 4 |
threerings/game-gardens | toybox/src/main/java/com/threerings/toybox/lobby/table/TableListView.java | [
"public class TableMatchConfig extends MatchConfig\n{\n /** The minimum number of seats at this table. */\n public int minSeats;\n\n /** The starting setting for the number of seats at this table. */\n public int startSeats;\n\n /** The maximum number of seats at this table. */\n public int maxSea... | import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import com.samskivert.swing.HGroupLayout;
import com.samskivert.swing.SimpleSlider;
import com.samskivert.swing.VGroupLayout;
impor... | //
// ToyBox library - framework for matchmaking networked games
// Copyright (C) 2005-2012 Three Rings Design, Inc., All Rights Reserved
// http://github.com/threerings/game-gardens
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License... | public TableListView (ToyBoxContext ctx, ToyBoxGameConfig config) | 2 |
zhaoxuyang/koala--Android-Plugin-Runtime- | MainApp/src/com/example/mainapp/MainActivity.java | [
"public class ApkFile {\n\n public String name;\n \n public String apkName;\n \n public ArrayList<String> nativeLibs = new ArrayList<String>();\n \n public float version;\n \n}",
"public interface CopyPluginListener {\n\n\t/**\n\t * 扫描开始\n\t */\n\tvoid onCopyStart();\n\n\t/**\n\t * 扫描结束\n\... | import java.io.File;
import java.util.ArrayList;
import android.app.Activity;
import android.app.ApkFile;
import android.app.CopyPluginListener;
import android.app.InstallPluginListener;
import android.app.PluginInfo;
import android.app.PluginManager;
import android.app.ProgressDialog;
import android.app.ScanPluginList... | package com.example.mainapp;
public class MainActivity extends Activity implements ScanPluginListener, OnItemClickListener, InstallPluginListener, CopyPluginListener{
private ProgressDialog mDialog;
private ListView mListView;
private PluginsAdapter mAdapter;
private ArrayList<ApkFile> apks = new... | public void onScanEnd(ArrayList<PluginInfo> arg0) { | 3 |
shagwood/micro-genie | micro-genie-dw-service/src/main/java/io/microgenie/service/AppConfiguration.java | [
"public abstract class ApplicationFactory implements Closeable{\n\n\tpublic ApplicationFactory(){}\n\n\tpublic abstract EventFactory events();\n\tpublic abstract QueueFactory queues();\n\tpublic abstract FileStoreFactory blobs();\n\tpublic abstract <T extends DatabaseFactory> T database();\n}",
"public class ... | import io.dropwizard.Configuration;
import io.microgenie.application.ApplicationFactory;
import io.microgenie.application.StateChangeConfiguration;
import io.microgenie.aws.AwsApplicationFactory;
import io.microgenie.aws.config.AwsConfig;
import io.microgenie.service.commands.CommandConfiguration;
import com.fasterxml.... | package io.microgenie.service;
/***
* Application Configuration Factory
* <p>
* This class contains common configuration elements to configure micro-genie service
* functionality
* @author shawn
*/
public class AppConfiguration extends Configuration {
private static final String ISO_8601_DATE_FORMAT = "yyyy... | this.appFactory = new AwsApplicationFactory(this.getAws(), mapper); | 2 |
d-plaindoux/suitcase | src/test/java/org/smallibs/suitcase/match/ListMatcherTest.java | [
"static <T> Case.WithoutCapture<T, T> Any() {\n return new Case0<T, T>(Optional::of).$();\n}",
"static <T> Case.WithoutCapture<T, T> Constant(T value) {\n return new Case0<T, T>(p -> Objects.deepEquals(p, value) ? Optional.of(p) : Optional.empty()).$();\n}",
"static <T> Var.WithoutInnerCapture<T, T> Var()... | import static org.smallibs.suitcase.utils.Functions.function;
import junit.framework.TestCase;
import org.junit.Test;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static org.smallibs.suitcase.cases.core.Cases.Any;
import static org.smallibs.suitcase.cases.core.Cases.Constant;
imp... | /*
* Copyright (C)2015 D. Plaindoux.
*
* 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 2, or (at your option) any
* later version.
*
* This program is distributed i... | isEmpty.caseOf(Cons(Constant(1), Any())).then(true); | 1 |
joshsh/rdfagents | rdfagents-demos/src/main/java/net/fortytwo/rdfagents/SparqlDescribeQueryProvider.java | [
"public class Commitment {\n\n public enum Decision {\n AGREE_AND_NOTIFY, // Query and Subscribe\n AGREE_SILENTLY, // Query only\n REFUSE // Query and Subscribe\n }\n\n private final Decision decision;\n private final ErrorExplanation explanation;\n\n public Commi... | import info.aduna.iteration.CloseableIteration;
import net.fortytwo.rdfagents.messaging.Commitment;
import net.fortytwo.rdfagents.messaging.LocalFailure;
import net.fortytwo.rdfagents.messaging.query.QueryProvider;
import net.fortytwo.rdfagents.model.AgentId;
import net.fortytwo.rdfagents.model.Dataset;
import net.fort... | package net.fortytwo.rdfagents;
/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class SparqlDescribeQueryProvider extends QueryProvider<Value, Dataset> {
private static final String BASE_URI = "http://example.org/baseURI#";
private final Repository repo;
| public SparqlDescribeQueryProvider(final RDFAgent agent, | 5 |
YagelNasManit/environment.monitor | environment.monitor.runner/src/main/java/org/yagel/monitor/ScheduleRunnerImpl.java | [
"public class ScheduleRunnerException extends RuntimeException {\n\n public ScheduleRunnerException(String message) {\n super(message);\n }\n}",
"public class MongoConnector {\n\n private final static String MONITOR_DB = \"monitor_tmp_newDomain\";\n private final static Logger log = Logger.getLogger(MongoC... | import org.apache.log4j.Logger;
import org.yagel.monitor.exception.ScheduleRunnerException;
import org.yagel.monitor.mongo.MongoConnector;
import org.yagel.monitor.plugins.JarScanner;
import org.yagel.monitor.status.collector.MonitorStatusCollectorLoader;
import org.yagel.monitor.status.collector.ProxyCollectorLoader;
... | package org.yagel.monitor;
public class ScheduleRunnerImpl implements ScheduleRunner {
private static Logger log = Logger.getLogger(ScheduleRunnerImpl.class);
private static ScheduleRunnerImpl scheduleRunnerImpl;
private MonitorStatusCollectorLoader collectorLoader;
private ClassLoader classLoader;
priv... | this.collectorLoader = new ProxyCollectorLoader(jarScanner.getStatusCollectorLoader()); | 4 |
kakao/hbase-tools | hbase0.98/hbase-manager-0.98/src/test/java/com/kakao/hbase/manager/ManagerTest.java | [
"@SuppressWarnings(\"unused\")\npublic class TestBase extends SecureTestUtil {\n protected static final String TEST_TABLE_CF = \"d\";\n protected static final String TEST_TABLE_CF2 = \"e\";\n protected static final String TEST_NAMESPACE = \"unit_test\";\n protected static final int MAX_WAIT_ITERATION = ... | import org.junit.Test;
import com.kakao.hbase.TestBase;
import com.kakao.hbase.common.Args;
import com.kakao.hbase.common.HBaseClient;
import com.kakao.hbase.common.InvalidTableException;
import com.kakao.hbase.common.util.AlertSender;
import com.kakao.hbase.common.util.AlertSenderTest;
import com.kakao.hbase.common.ut... | /*
* Copyright 2015 Kakao 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 agre... | Util.validateTable(admin, tableName); | 6 |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/visitor/KeepMarkedVisitor.java | [
"@JsonPropertyOrder(alphabetic=true)\npublic class Context extends NodeImpl implements ContextHierarchyNode{\n\n public static final String TYPE = \"Context\";\n\n private List<Task> tasks = new LinkedList<>();\n\n private List<Context> contexts = new LinkedList<>();\n\n private String parentContextId;\... | import org.psidnell.omnifocus.model.Context;
import org.psidnell.omnifocus.model.ContextHierarchyNode;
import org.psidnell.omnifocus.model.Folder;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.model.Project;
import org.psidnell.omnifocus.model.ProjectHierarchyNode;
import org.psidnell.omnifocu... | /*
* Copyright 2015 Paul Sidnell
*
* 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... | ((ProjectHierarchyNode)node).getProjectPath().stream().forEach((n)->n.setMarked(true)); | 5 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/auth/provider/AuthProvider.java | [
"public abstract class BaseProvider extends AsyncTask<String, Integer, List<Elements>> {\n\n protected Map<String, String> cookies = new HashMap<>();\n\n public BaseProvider() {\n super();\n }\n\n @Override\n @Deprecated\n protected List<Elements> doInBackground(String... params) {\n ... | import android.app.ProgressDialog;
import android.text.TextUtils;
import com.mgilangjanuar.dev.goscele.base.BaseProvider;
import com.mgilangjanuar.dev.goscele.modules.auth.listener.AuthListener;
import com.mgilangjanuar.dev.goscele.modules.common.model.CookieModel;
import com.mgilangjanuar.dev.goscele.modules.common.mo... | package com.mgilangjanuar.dev.goscele.modules.auth.provider;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class AuthProvider extends BaseProvider {
private String username;
private String password; | private AuthListener authListener; | 1 |
fralalonde/iostream | src/main/java/ca/rbon/iostream/channel/part/ByteIn.java | [
"public class BufferedInputOf<T> extends BufferedInputStream implements WrapperOf<T> {\n\n final Resource<T> closer;\n\n /**\n * <p>\n * Constructor for BufferedInputOf.\n * </p>\n *\n * @param cl a {@link ca.rbon.iostream.resource.Resource} object.\n * @param is a {@link java.io.Input... | import java.io.IOException;
import java.nio.charset.Charset;
import ca.rbon.iostream.wrap.BufferedInputOf;
import ca.rbon.iostream.wrap.BufferedReaderOf;
import ca.rbon.iostream.wrap.DataInputOf;
import ca.rbon.iostream.wrap.InputStreamOf;
import ca.rbon.iostream.wrap.ObjectInputOf;
import ca.rbon.iostream.wrap.ReaderO... | package ca.rbon.iostream.channel.part;
public interface ByteIn<T> {
InputStreamOf<T> inputStream() throws IOException;
BufferedInputOf<T> bufferedInputStream(int bufferSize) throws IOException;
BufferedInputOf<T> bufferedInputStream() throws IOException;
ZipInputOf<T> zipInputStream(Charset chars... | ReaderOf<T> reader(Charset charset) throws IOException; | 5 |
Consoar/zhangshangwuda | src/zq/whu/zhangshangwuda/ui/lessons/LessonsLoginActivity.java | [
"public class SwipeBackSherlockActivity extends UmengSherlockActivity implements\n\t\tSwipeBackActivityBase {\n\tprivate SwipeBackActivityHelper mHelper;\n\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tmHelper = new SwipeBackActivityHelper(this);\... | import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache... | package zq.whu.zhangshangwuda.ui.lessons;
public class LessonsLoginActivity extends SwipeBackSherlockActivity {
private Button LoginButton = null;
private EditText AccountView;
private EditText PasswordView;
public String Account;
public String Password;
private ProgressDialog pd = null;
private EditText Y... | ToastUtil.showToast(LessonsLoginActivity.this, "要先连上网哦~"); | 7 |
marpies/vk-ane | android/src/com/marpies/ane/vk/functions/AuthFunction.java | [
"public interface IAIRVKActivityResultCallback extends AndroidActivityWrapper.ActivityResultCallback {\n\n}",
"public class AIRVKEvent {\n\n\tpublic static final String VK_AUTH_ERROR = \"vkAuthError\";\n\tpublic static final String VK_AUTH_SUCCESS = \"vkAuthSuccess\";\n\tpublic static final String VK_TOKEN_UPDATE... | import java.util.ArrayList;
import android.content.Intent;
import com.adobe.air.AndroidActivityWrapper;
import com.adobe.air.IAIRVKActivityResultCallback;
import com.adobe.fre.FREArray;
import com.adobe.fre.FREContext;
import com.adobe.fre.FREObject;
import com.marpies.ane.vk.data.AIRVKEvent;
import com.marpies.ane.vk.... | /*
* Copyright 2016 Marcel Piestansky (http://marpies.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 appli... | VKSdk.login( AIR.getContext().getActivity(), (permissions != null) ? permissions.toArray( new String[0] ) : null ); | 5 |
jeick/jamod | src/main/java/net/wimpi/modbus/io/ModbusUDPTransport.java | [
"public interface Modbus {\n\n\t/**\n\t * JVM flag for debug mode. Can be set passing the system property\n\t * net.wimpi.modbus.debug=false|true (-D flag to the jvm).\n\t */\n\tpublic static final boolean debug = \"true\".equals(System\n\t\t\t.getProperty(\"net.wimpi.modbus.debug\"));\n\n\t/**\n\t * Defines the cl... | import java.io.DataOutput;
import java.io.IOException;
import java.io.InterruptedIOException;
import net.wimpi.modbus.Modbus;
import net.wimpi.modbus.ModbusIOException;
import net.wimpi.modbus.msg.ModbusMessage;
import net.wimpi.modbus.msg.ModbusRequest;
import net.wimpi.modbus.msg.ModbusResponse;
import net.wimpi.modb... | /***
* Copyright 2002-2010 jamod development team
*
* 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... | public ModbusResponse readResponse() throws ModbusIOException { | 4 |
ceylon/ceylon-js | src/main/java/com/redhat/ceylon/compiler/js/Stitcher.java | [
"public class MetamodelVisitor extends Visitor {\n\n final MetamodelGenerator gen;\n\n public MetamodelVisitor(Module module) {\n this.gen = new MetamodelGenerator(module);\n }\n\n /** Returns the in-memory model as a collection of maps.\n * The top-level map represents the module. */\n pu... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.nio.file.Files;
i... | }
final TypeChecker tc = langmodtc.getTypeChecker();
tc.process(true);
if (tc.getErrors() > 0) {
return 1;
}
//Compile these files
final List<File> includes = new ArrayList<File>();
for (String filename : line.split(",")) {
filenam... | ShaSigner.sign(file, new JsJULLogger(), true); | 3 |
braintree/braintree_android_encryption | BraintreeAndroidEncryption/src/androidTest/java/com/braintreegateway/encryption/test/AesTest.java | [
"public class Base64\n{\n private static final Encoder encoder = new Base64Encoder();\n \n /**\n * encode the input data producing a base 64 encoded byte array.\n *\n * @return a byte array containing the base 64 encoded data.\n */\n public static byte[] encode(\n byte[] data)\... | import java.util.Arrays;
import java.security.InvalidAlgorithmParameterException;
import java.security.NoSuchAlgorithmException;
import java.security.InvalidKeyException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.BadPaddingException;
import javax.crypto.NoSuchPaddingException;
import android.te... | package com.braintreegateway.encryption.test;
public class AesTest extends AndroidTestCase {
private byte[] aesKey;
private byte[] aesIV;
private final String dataToEncrypt = "test data";
@Override
public void setUp() { | aesKey = Random.secureRandomBytes(Aes.KEY_LENGTH); | 2 |
liucijus/jinsist | mock/src/main/java/jinsist/mock/Mock.java | [
"public interface Expectations {\n <ReturnType, MockType> void recordStub(\n Class<MockType> classToMock,\n MockType instance,\n Method method,\n Arguments arguments,\n ReturnType result\n );\n\n <MockType> Object execute(\n Class<MockType> ... | import jinsist.expectations.Expectations;
import jinsist.mock.delegators.MockExecutor;
import jinsist.mock.delegators.SetupRecorder;
import jinsist.proxy.Delegator;
import jinsist.proxy.Proxy; | package jinsist.mock;
public class Mock<MockType> {
private Class<MockType> mockClass;
public MockType getInstance() {
return instance;
}
private MockType instance;
private Expectations expectations;
public Mock(Class<MockType> mockClass, Expectations expectations) { | MockType instance = new Proxy<>(mockClass).instance(new MockExecutor<>(expectations, mockClass)); | 4 |
Leaking/WeGit | app/src/main/java/com/quinn/githubknife/ui/adapter/EventAdapter.java | [
"public enum OctIcon implements Icon {\n\n\t\n\t\n\tSTAR(0xf02a),\n FORK(0xf002),\n FILE(0xf011),\n\tFOLDER(0xf016),\n\tSEARCH(0xf02e),\n\tBRANCH(0xf020),\n\tEMAIL(0xf03b),\n\tLOCATE(0xf060),\n\tCOMPANY(0xf037),\n\tBLOG(0xf05C),\n\tJOIN(0xf046),\n\tREPO(0xf001),\n\tPUSH(0xf01f),\n\tCOMMIT(0xf07e),\n\tCODE(0xf... | import android.content.Context;
import android.graphics.Bitmap;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
... | package com.quinn.githubknife.ui.adapter;
/**
* Created by Quinn on 7/25/15.
*/
public class EventAdapter extends
RecyclerView.Adapter<EventAdapter.ViewHolder>{
private static final String TAG = "EventAdapter";
private Context context;
private List<Event> dataItems;
private ImageLoader i... | MenberPayload payload = (MenberPayload)dataItems.get(position).getPayload(); | 5 |
PushOCCRP/Push-Android | app/src/main/java/com/pushapp/press/adapter/PostListAdapter.java | [
"public class HomeActivity extends AppCompatActivity implements OnFragmentInteractionListener, LanguageListener, ImageCacheDelegate, ArticlesDelegate {\n\n private Toolbar mToolbarView;\n private ObservableListView mListView;\n private AQuery aq;\n static boolean isSearchShown = false;\n private Menu... | import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
imp... | package com.pushapp.press.adapter;
/**
* @author Bryan Lamtoo.
* Heavily edited by Christopher Guess
*/
public class PostListAdapter extends ArrayAdapter<Article> implements ImageCacheDelegate {
// Android's "findItemByID request is really really expensive apparently.
// This is the standard "ViewHolder... | private TypefaceManager fontManager; | 6 |
witwall/sfntly-java | src/main/java/com/google/typography/font/sfntly/table/core/HorizontalDeviceMetricsTable.java | [
"public class ReadableFontData extends FontData {\n\n public static ReadableFontData createReadableFontData(byte[] b) {\n ByteArray<?> ba = new MemoryByteArray(b);\n return new ReadableFontData(ba);\n }\n\n\n /**\n * Flag on whether the checksum has been set.\n */\n private volatile boolean checksumSe... | import com.google.typography.font.sfntly.data.ReadableFontData;
import com.google.typography.font.sfntly.data.WritableFontData;
import com.google.typography.font.sfntly.table.Header;
import com.google.typography.font.sfntly.table.Table;
import com.google.typography.font.sfntly.table.TableBasedTableBuilder; | /*
* Copyright 2011 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | private HorizontalDeviceMetricsTable(Header header, ReadableFontData data, int numGlyphs) { | 0 |
slide-lig/jlcm | src/main/java/fr/liglab/jlcm/internals/ExplorationStep.java | [
"public final class ExtensionsIterator {\n\tprivate final AtomicInteger index;\n\tprivate final int max;\n\n\t/**\n\t * will provide an iterator on frequent items (in increasing order) in\n\t * [0,to[\n\t */\n\tpublic ExtensionsIterator(final int to) {\n\t\tthis.index = new AtomicInteger(0);\n\t\tthis.max = to;\n\t... | import java.util.Arrays;
import java.util.Calendar;
import fr.liglab.jlcm.internals.Counters.ExtensionsIterator;
import fr.liglab.jlcm.internals.Dataset.TransactionsIterable;
import fr.liglab.jlcm.internals.Selector.WrongFirstParentException;
import fr.liglab.jlcm.io.FileReader;
import fr.liglab.jlcm.util.ItemsetsFacto... | /*
This file is part of jLCM - see https://github.com/martinkirch/jlcm/
Copyright 2013,2014 Martin Kirchgessner, Vincent Leroy, Alexandre Termier, Sihem Amer-Yahia, Marie-Christine Rousset, Université Joseph Fourier and CNRS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this fil... | throw new WrongFirstParentException(candidate, greatest); | 2 |
pierre/collector | src/test/java/com/ning/metrics/collector/guice/TestHealthChecksModule.java | [
"public interface CollectorConfig\n{\n @Config(\"collector.dfs.block.size\")\n @Default(\"134217728\")\n long getHadoopBlockSize();\n\n @Config(\"collector.hadoop.ugi\")\n @Default(\"nobody,nobody\")\n String getHadoopUgi();\n\n // Whether to forward events to ActiveMQ\n\n @Config(\"collecto... | import com.google.inject.Injector;
import com.yammer.metrics.reporting.AdminServlet;
import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.ning.metrics.collector.binder.config.CollectorConfig;
import com.ning.metrics.collector.hadoop.processing.EventSpoolDispatcher;
import... | /*
* Copyright 2010-2012 Ning, Inc.
*
* Ning licenses this file to you 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 a... | bind(WriterStats.class).toInstance(Mockito.mock(WriterStats.class)); | 3 |
senseobservationsystems/sense-android-library | sense-android-library/src/nl/sense_os/service/motion/StandardMotionSensor.java | [
"public static class DataPoint implements BaseColumns {\n\n public static final String CONTENT_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE\n + \"/vnd.sense_os.data_point\";\n public static final String CONTENT_ITEM_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE\n + \"/vnd.sense_os.data_poi... | import java.util.List;
import nl.sense_os.service.R;
import nl.sense_os.service.constants.SenseDataTypes;
import nl.sense_os.service.constants.SensorData.DataPoint;
import nl.sense_os.service.provider.SNTP;
import nl.sense_os.service.shared.SensorDataPoint;
import nl.sense_os.service.shared.SensorDataPoint.DataType;
im... | package nl.sense_os.service.motion;
public class StandardMotionSensor extends BaseDataProducer implements DataConsumer {
private static final String TAG = "StandardMotionSensor";
private Context context;
private long[] lastSampleTimes = new long[50];
private final List<Sensor> sensors;
//private... | public void onNewData(SensorDataPoint dataPoint) { | 2 |
Bernardo-MG/repository-pattern-java | src/test/java/com/wandrell/pattern/test/integration/repository/access/postgresql/springjdbc/ITQueryPostgreSqlSpringJdbcRepository.java | [
"public class PersistenceContextPaths {\n\n /**\n * Eclipselink JPA persistence.\n */\n public static final String ECLIPSELINK = \"classpath:context/persistence/jpa-eclipselink.xml\";\n\n /**\n * Hibernate JPA persistence.\n */\n public static final String HIBERNATE = \"classpath:context... | import com.wandrell.pattern.test.util.config.properties.DatabaseScriptsPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.JdbcPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.PersistenceProviderPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.QueryPr... | /**
* The MIT License (MIT)
* <p>
* Copyright (c) 2015 the original author or authors.
* <p>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limi... | PersistenceProviderPropertiesPaths.SPRING_JDBC, | 4 |
ProjectInfinity/ReportRTS | src/main/java/com/nyancraft/reportrts/command/sub/ClaimTicket.java | [
"public class RTSFunctions {\n\n private static ReportRTS plugin = ReportRTS.getPlugin();\n private static DataProvider data = plugin.getDataProvider();\n\n private static final int SECOND_MILLIS = 1000;\n private static final int MINUTE_MILLIS = 60 * SECOND_MILLIS;\n private static final int HOUR_MI... | import com.nyancraft.reportrts.RTSFunctions;
import com.nyancraft.reportrts.RTSPermissions;
import com.nyancraft.reportrts.ReportRTS;
import com.nyancraft.reportrts.data.NotificationType;
import com.nyancraft.reportrts.event.TicketClaimEvent;
import com.nyancraft.reportrts.persistence.DataProvider;
import com.nyancraft... | package com.nyancraft.reportrts.command.sub;
public class ClaimTicket {
private static ReportRTS plugin = ReportRTS.getPlugin();
private static DataProvider data = plugin.getDataProvider();
/**
* Initial handling of the Claim sub-command.
* @param sender player that sent the command
* @p... | BungeeCord.globalNotify(Message.ticketClaim(name, args[1]), ticketId, NotificationType.MODIFICATION); | 3 |
Ctrip-DI/Hue-Ctrip-DI | di-data-service/src/main/java/com/ctrip/di/ganglia/GangliaMetricService.java | [
"@Component\r\npublic class MetricConfigParser {\r\n\t@Value(\"${METRIC_CONFIG_FILE}\")\r\n\tprivate String metricConfigFile;\r\n\r\n\tpublic Clusters getClusters() throws JAXBException {\r\n\t\tJAXBContext jc = JAXBContext.newInstance(Clusters.class);\r\n\t\tUnmarshaller unmarshaller = jc.createUnmarshaller();\r\n... | import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import javax.inject.Singleton;
import javax.xml.bind.JAXBException;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.a... | package com.ctrip.di.ganglia;
/**
*
* Ganglia Metric Service: Provide all the metric information from ganglia
* @author xgliao
*
*/
@Service
@Singleton
public class GangliaMetricService {
private static Log logger = LogFactory.getLog(GangliaMetricService.class);
@Autowired
private Gan... | List<Cluster> clusterList = clusters.getCluster();
| 2 |
neva-dev/felix-search-webconsole-plugin | src/main/java/com/neva/felix/webconsole/plugins/search/rest/BundleAssembleServlet.java | [
"public enum MessageType {\n SUCCESS,\n ERROR\n}",
"public static void writeMessage(HttpServletResponse response, MessageType type, String text)\n throws IOException {\n writeMessage(response, type, text, Collections.<String, Object>emptyMap());\n}",
"public class BundleJar {\n\n private Bund... | import static com.neva.felix.webconsole.plugins.search.utils.JsonUtils.MessageType;
import static com.neva.felix.webconsole.plugins.search.utils.JsonUtils.writeMessage;
import com.google.common.collect.Lists;
import com.neva.felix.webconsole.plugins.search.core.BundleJar;
import com.neva.felix.webconsole.plugins.search... | package com.neva.felix.webconsole.plugins.search.rest;
public class BundleAssembleServlet extends RestServlet {
private static final Logger LOG = LoggerFactory.getLogger(BundleAssembleServlet.class);
public static final String ALIAS_NAME = "bundle-assemble";
private final SearchMonitor<BundleAssembleJ... | private final OsgiExplorer osgiExplorer; | 3 |
czy1121/sdk3rd | ezy.sdk3rd.social/src/main/java/ezy/sdk3rd/social/share/media/MoImage.java | [
"public class BitmapResource implements ImageResource {\n public final Bitmap bitmap;\n\n public BitmapResource(Bitmap bitmap) {\n this.bitmap = bitmap;\n }\n\n @Override\n public String toUri() {\n return null;\n }\n\n @Override\n public Bitmap toBitmap() {\n return bit... | import android.graphics.Bitmap;
import android.support.annotation.NonNull;
import java.io.File;
import ezy.sdk3rd.social.share.image.resource.BitmapResource;
import ezy.sdk3rd.social.share.image.resource.BytesResource;
import ezy.sdk3rd.social.share.image.resource.FileResource;
import ezy.sdk3rd.social.share.image.reso... | package ezy.sdk3rd.social.share.media;
public class MoImage implements IMediaObject {
public ImageResource resource;
public MoImage(@NonNull ImageResource resource) {
this.resource = resource;
}
public MoImage(String url) {
resource = new UrlResource(url);
}
public MoImag... | resource = new BytesResource(bytes); | 1 |
jMotif/SAX | src/test/java/net/seninp/jmotif/sax/datastructures/TestSAXRecords.java | [
"public enum NumerosityReductionStrategy {\n\n /** No reduction at all - all the words going make it into collection. */\n NONE(0),\n\n /** Exact - the strategy based on the exact string match. */\n EXACT(1),\n\n /** Classic - the Lin's and Keogh's MINDIST based strategy. */\n MINDIST(2);\n\n private final i... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import org.junit.Test;
import net.seninp.jmotif.sax.NumerosityReductionStrategy;
import net.seninp.jmotif.sax.SAXPr... | package net.seninp.jmotif.sax.datastructures;
/**
* Testing SAX records store.
*
* @author psenin
*
*/
public class TestSAXRecords {
private static final String filenameTEK14 = "src/resources/test-data/TEK14.txt";
/**
* Test the simple SAX conversion.
*
* @throws Exception if error occurs.
*... | SAXRecords res = sp.ts2saxViaWindow(ts1, 400, 6, na.getCuts(3), | 5 |
flyingrub/TamTime | app/src/main/java/flying/grub/tamtime/fragment/AllLinesFragment.java | [
"public class OneLineActivity extends AppCompatActivity {\n\n private static final String TAG = OneLineActivity.class.getSimpleName();\n private Toolbar toolbar;\n private ViewPager viewPager;\n private SlidingTabLayout slidingTabLayout;\n\n private int linePosition;\n private Line line;\n\n pr... | import android.app.Activity;
import android.support.v4.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
imp... | package flying.grub.tamtime.fragment;
public class AllLinesFragment extends Fragment {
private RecyclerView recyclerView;
private AllLinesAdapter adapter;
private RecyclerView.LayoutManager layoutManager;
private ArrayList<Line> lines;
@Override
public View onCreateView(LayoutInflater in... | public void onEvent(MessageUpdate event){ | 5 |
JAYAndroid/whiteboard | client/src/com/yems/painter/handler/PainterHandler.java | [
"public class Painter extends BasePainter\n\n{\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState)\n\t{\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.painter_main);\n\n\t\t// ³õʼ»¯²¼¾ÖÊÓͼ\n\t\tsetView();\n\t\t// ³õʼ»¯¼àÌýÆ÷\n\t\tinitListener();\n\t\t// ³õʼ»¯²ÎÊý\n\t\tsetVal... | import java.io.File;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.graphics.BitmapFactor... | package com.yems.painter.handler;
/**
* @ClassName: PainterHandler
* @Description: »°åÒµÎñ²Ù×÷Àà
* @author lwtx-yems
* @date 2015-3-10 ÏÂÎç01:51:10
*
*/
public class PainterHandler {
private Context mContext;
/** »²¼¹ÜÀí¶ÔÏó*/
private PainterCanvasControl mCanvas;
/** */
private PainterSettings mSetti... | intent.setClass(mContext, PainterPreferences.class); | 2 |
EsupPortail/esup-papercut | src/main/java/org/esupportail/papercut/services/EsupPaperCutService.java | [
"public class EsupPapercutContext {\n\n\tString papercutContext = \"univ-ville\";\n\t\n String numCommandePrefix = \"EsupPaperCut-\";\n\t\n\tString papercutUserUidAttr = \"uid\";\n\t\n\tString userEmail = \"email\";\n\t\n\tString validatePayboxJustWithRedirection = \"false\";\n\t\n\tString requeteNbTransactions ... | import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.esupportail.papercut.config.EsupPapercutContext;
import org.esupportail.p... | /**
* Licensed to EsupPortail under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* EsupPortail licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file ... | public UserPapercutInfos getUserPapercutInfos(EsupPapercutContext context, String uid) { | 5 |
GoogleCloudPlatform/bigquery-data-lineage | src/test/java/com/google/cloud/solutions/datalineage/converter/LineageTagPropagationConverterFactoryTest.java | [
"public static <T extends Message> ImmutableList<T>\nparseAsList(Collection<String> jsons, Class<T> protoClass) {\n return jsons\n .stream()\n .map(json -> ProtoJsonConverter.parseJson(json, protoClass))\n .filter(Objects::nonNull)\n .collect(toImmutableList());\n}",
"@SuppressWarnings(\"unch... | import org.junit.runners.JUnit4;
import static com.google.cloud.solutions.datalineage.converter.ProtoJsonConverter.parseAsList;
import static com.google.cloud.solutions.datalineage.converter.ProtoJsonConverter.parseJson;
import static com.google.common.truth.Truth.assertThat;
import com.google.cloud.datacatalog.v1beta1... | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | .lineage(parseJson(TestResourceLoader.load( | 1 |
Doist/JobSchedulerCompat | library/src/test/java/com/doist/jobschedulercompat/scheduler/alarm/AlarmContentObserverServiceTest.java | [
"public class JobInfo {\n private static final String LOG_TAG = \"JobInfoCompat\";\n\n @IntDef({\n NETWORK_TYPE_NONE,\n NETWORK_TYPE_ANY,\n NETWORK_TYPE_UNMETERED,\n NETWORK_TYPE_NOT_ROAMING,\n NETWORK_TYPE_CELLULAR\n })\n @Retention(RetentionPolicy... | import com.doist.jobschedulercompat.JobInfo;
import com.doist.jobschedulercompat.job.JobStatus;
import com.doist.jobschedulercompat.job.JobStore;
import com.doist.jobschedulercompat.util.DeviceTestUtils;
import com.doist.jobschedulercompat.util.JobCreator;
import org.junit.After;
import org.junit.Before;
import org.jun... | package com.doist.jobschedulercompat.scheduler.alarm;
@RunWith(RobolectricTestRunner.class)
@Config(sdk = Build.VERSION_CODES.KITKAT)
public class AlarmContentObserverServiceTest {
private Application application; | private JobStore jobStore; | 2 |
miurahr/tmpotter | src/main/java/org/tmpotter/filters/tmx/TmxFilter.java | [
"@SuppressWarnings(\"serial\")\npublic class Document {\n\n private final ArrayList<String> documentSegments;\n\n public Document() {\n documentSegments = new ArrayList<>();\n }\n\n public Document(List<String> sentences) {\n documentSegments = new ArrayList<>(sentences);\n }\n\n pub... | import org.tmpotter.util.TmxWriter2;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.tmpotter.core.Document;
import org.tmpotter.core.TmxEntry;
import org.tmpotter.filters.FilterContext;
import org.tmpotter.filters.IFilter;
import org.tmpotter.filters.IParseCallback;
import org.tmpotter.... | /* *************************************************************************
*
* TMPotter - Bi-text Aligner/TMX Editor
*
* Copyright (C) 2016 Hiroshi Miura
*
* This file is part of TMPotter.
*
* TMPotter is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public... | public void saveFile(File outFile, Document docOriginal, Document docTranslation, | 0 |
el-groucho/jsRules | src/test/java/org/grouchotools/jsrules/loader/RuleLoaderTest.java | [
"public enum Operator {\n GT {\n @Override\n public Boolean compare(Object left, Object right) throws InvalidParameterException {\n Number leftNumber = getNumber(left);\n Number rightNumber = getNumber(right);\n return leftNumber.doubleValue() > rightNumber.doubleVa... | import org.grouchotools.jsrules.Operator;
import org.grouchotools.jsrules.Parameter;
import org.grouchotools.jsrules.Rule;
import org.grouchotools.jsrules.config.ParamConfig;
import org.grouchotools.jsrules.config.ResponseConfig;
import org.grouchotools.jsrules.config.RuleConfig;
import org.grouchotools.jsrules.excepti... | /*
* The MIT License
*
* Copyright 2015 Paul.
*
* 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, me... | Operator operator = Operator.GT; | 0 |
karsany/obridge | obridge-main/src/main/java/org/obridge/generators/EntityObjectGenerator.java | [
"public class OBridgeConfiguration {\n\n public static final boolean GENERATE_SOURCE_FOR_PLSQL_TYPES = false;\n public static final boolean ADD_ASSERT = false;\n\n private String jdbcUrl;\n private String sourceRoot;\n private String rootPackageName;\n private Packages packages;\n private Loggi... | import org.obridge.util.CodeFormatter;
import org.obridge.util.DataSourceProvider;
import org.obridge.util.MustacheRunner;
import org.obridge.util.OBridgeException;
import java.beans.PropertyVetoException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apa... | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ferenc Karsany
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* us... | Pojo pojo = PojoMapper.typeToPojo(typeName, typeAttributes); | 2 |
yammer/telemetry | telemetry-agent/src/test/java/com/yammer/telemetry/agent/TelemetryTransformerTest.java | [
"public interface ClassInstrumentationHandler {\n boolean transformed(CtClass cc, ClassPool pool);\n}",
"public abstract class SubTypeInstrumentationHandler implements ClassInstrumentationHandler {\n private static final Logger LOGGER = Logger.getLogger(SubTypeInstrumentationHandler.class.getName());\n p... | import com.yammer.telemetry.instrumentation.ClassInstrumentationHandler;
import com.yammer.telemetry.agent.handlers.SubTypeInstrumentationHandler;
import com.yammer.telemetry.test.TransformingClassLoader;
import com.yammer.telemetry.instrumentation.TelemetryTransformer;
import javassist.*;
import org.junit.Test;
import... | package com.yammer.telemetry.agent;
public class TelemetryTransformerTest {
@Test
public void testUnmodifiedWhenNoHandlersAdded() throws Exception {
TelemetryTransformer transformer = new TelemetryTransformer();
assertNull(transformer.transform(getClass().getClassLoader(), "com/yammer/teleme... | transformer.addHandler(new SubTypeInstrumentationHandler("com.yammer.telemetry.agent.test.SimpleBean") { | 1 |
rust-keylock/rust-keylock-ui | java/src/main/java/org/rustkeylock/ui/callbacks/ShowEntryCb.java | [
"public interface RklController {\n /**\n * Sets a native callback to the Rust world that can be used to send data to Rust on actions\n * @param consumer\n */\n void setCallback(Consumer<Object> consumer);\n}",
"public class ShowEntryController extends BaseController implements RklController, In... | import javafx.application.Platform;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import org.astonbitecode.j4rs.api.invocation.NativeCallbackToRustChannelSupport;
import org.rustkeylock.controllers.RklController;
import org.rustkeylock.controllers.ShowEntryController;
import org.... | // Copyright 2019 astonbitecode
// This file is part of rust-keylock password manager.
//
// rust-keylock 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 optio... | private RklStage stage; | 2 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/main/view/HomeFragment.java | [
"public abstract class BaseFragment extends Fragment {\n\n @LayoutRes\n public abstract int findLayout();\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(findLayout(), ... | import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import androi... | package com.mgilangjanuar.dev.goscele.modules.main.view;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class HomeFragment extends BaseFragment implements HomeListener {
@BindView(R.id.toolbar_home)
Toolbar toolbar;
@BindView(R.id.recycler_view_home)
Recycl... | HomePresenter presenter = new HomePresenter(this); | 5 |
CrazyBBB/tenhou-visualizer | src/main/java/tenhouvisualizer/app/main/MjlogTreeControl.java | [
"public class Analyzer implements IAnalyzer, SceneContainer {\r\n private final static String[] haiStr = {\r\n \"1m\", \"1m\", \"1m\", \"1m\", \"2m\", \"2m\", \"2m\", \"2m\", \"3m\", \"3m\", \"3m\", \"3m\",\r\n \"4m\", \"4m\", \"4m\", \"4m\", \"赤5m\", \"5m\", \"5m\", \"5m\", \"6m\", \"6m\",... | import javafx.scene.control.TreeView;
import tenhouvisualizer.domain.analyzer.Analyzer;
import tenhouvisualizer.domain.analyzer.ParseHandler;
import tenhouvisualizer.domain.model.Kyoku;
import tenhouvisualizer.domain.model.MahjongScene;
import tenhouvisualizer.domain.model.Mjlog;
import javax.xml.parsers.SAXParser;
imp... | package tenhouvisualizer.app.main;
public class MjlogTreeControl extends TreeView<Mjlog> {
public MjlogTreeControl() {
this.setShowRoot(false);
}
public void showMjlogContent(byte[] xml, int position) {
List<Kyoku> scenesList;
try {
SAXParserFactory saxParserFactory... | ParseHandler parseHandler = new ParseHandler(analyzer); | 1 |
blind-coder/SpaceTrader | SpaceTrader/src/main/java/de/anderdonau/spacetrader/FragmentSystemInformation.java | [
"public class CrewMember implements Serializable {\n\tpublic int nameIndex;\n\tpublic int pilot;\n\tpublic int fighter;\n\tpublic int trader;\n\tpublic int engineer;\n\tpublic int curSystem;\n\n\tpublic CrewMember() {\n\t\tnameIndex = 1;\n\t\tpilot = 1;\n\t\tfighter = 1;\n\t\ttrader = 1;\n\t\tengineer = 1;\n\t\tcur... | import de.anderdonau.spacetrader.DataTypes.Politics;
import de.anderdonau.spacetrader.DataTypes.Popup;
import de.anderdonau.spacetrader.DataTypes.Shields;
import de.anderdonau.spacetrader.DataTypes.ShipTypes;
import de.anderdonau.spacetrader.DataTypes.SolarSystem;
import de.anderdonau.spacetrader.DataTypes.SpecialEvent... | /*
* Copyright (c) 2014 Benjamin Schieder
*
* 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 program is ... | textView.setText(Politics.mPolitics[CURSYSTEM.politics].name); | 2 |
keeps/roda-in | src/main/java/org/roda/rodain/core/Constants.java | [
"public class BagitSipCreator extends SimpleSipCreator implements SIPObserver, ISipCreator {\n private static final Logger LOGGER = LoggerFactory.getLogger(BagitSipCreator.class.getName());\n private int countFilesOfZip;\n private int currentSIPsize = 0;\n private int currentSIPadded = 0;\n private int repProc... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.roda.rodain.core.creation.BagitSipCreator;
import org.roda.rodain.core.creation.EarkSip2Creator;
import org.roda.rodain.core.creation.EarkSipCr... | public static final String I18N_METADATA_DIFF_FOLDER_DESCRIPTION = "metadata.diffFolder.description";
public static final String I18N_METADATA_DIFF_FOLDER_TITLE = "metadata.diffFolder.title";
public static final String I18N_METADATA_EMPTY_FILE_DESCRIPTION = "metadata.emptyFile.description";
public static final ... | private List<RepresentationContentType> representationContentTypes; | 6 |
lob/lob-java | src/main/java/com/lob/model/USVerification.java | [
"public class APIException extends LobException {\n\n private static final long serialVersionUID = 1L;\n\n @JsonCreator\n public APIException(@JsonProperty(\"error\") final Map<String, Object> error) {\n super((String)error.get(\"message\"), (Integer)error.get(\"status_code\"));\n }\n\n}",
"pub... | import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.lob.exception.APIException;
import com.lob.exception.AuthenticationException;
import com.lob.exception.InvalidRequestException;
import com.lob.exception.RateLimitException;
import com.lob.net.APIR... | this.secondaryLine = secondaryLine;
this.urbanization = urbanization;
this.lastLine = lastLine;
this.deliverability = deliverability;
this.components = components;
this.deliverabilityAnalysis = deliverabilityAnalysis;
this.lobConfidenceScore = lobConfidenceS... | public LobResponse<USVerification> verify() throws APIException, IOException, AuthenticationException, InvalidRequestException, RateLimitException {
| 3 |
wesabe/grendel | src/test/java/com/wesabe/grendel/openpgp/tests/SubKeyTest.java | [
"public enum AsymmetricAlgorithm implements IntegerEquivalent {\n\t/**\n\t * Elgamal (Encrypt-Only)\n\t * \n\t * @see <a href=\"http://en.wikipedia.org/wiki/ElGamal_encryption\">Wikipedia</a>\n\t */\n\tELGAMAL(\t\"ElGamal\",\t\tPublicKeyAlgorithmTags.ELGAMAL_ENCRYPT) {\n\t\t@Override\n\t\tpublic AlgorithmParameterS... | import static org.fest.assertions.Assertions.*;
import java.io.FileInputStream;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunW... | package com.wesabe.grendel.openpgp.tests;
@RunWith(Enclosed.class)
public class SubKeyTest {
public static class A_Sub_Key {
private MasterKey masterKey; | private SubKey key; | 4 |
witwall/sfntly-java | src/main/java/com/google/typography/font/tools/conversion/eot/HdmxEncoder.java | [
"public class Font {\n\n private static final Logger logger =\n Logger.getLogger(Font.class.getCanonicalName());\n\n /**\n * Offsets to specific elements in the underlying data. These offsets are relative to the\n * start of the table or the start of sub-blocks within the table.\n */\n private enum Offs... | import com.google.typography.font.sfntly.Font;
import com.google.typography.font.sfntly.Tag;
import com.google.typography.font.sfntly.data.WritableFontData;
import com.google.typography.font.sfntly.table.core.FontHeaderTable;
import com.google.typography.font.sfntly.table.core.HorizontalDeviceMetricsTable;
import com.g... | /*
* Copyright 2011 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | MaximumProfileTable maxp = sourceFont.getTable(Tag.maxp); | 6 |
fairSIM/fairSIM | org/fairsim/fiji/SimPatternSimulator.java | [
"public class OtfProvider {\n \n // --- internal parameters ----\n\n public enum APPROX_TYPE {\n\tEXPONENTIAL,\n\tSPHERICAL,\n\tNONE\n };\n\n // vals[band][idx], where idx = cycles / cyclesPerMicron\n private Cplx.Float [][] vals\t= null; \n private Cplx.Float [][] valsAtt\t= null; \n priv... | import javax.swing.filechooser.FileNameExtensionFilter;
import java.util.Random;
import ij.plugin.PlugIn;
import ij.ImageStack;
import ij.ImagePlus;
import ij.IJ;
import ij.gui.GenericDialog;
import ij.process.ImageProcessor;
import org.fairsim.utils.Args;
import org.fairsim.sim_algorithm.OtfProvider;
import org.fairsi... | /*
This file is part of Free Analysis and Interactive Reconstruction
for Structured Illumination Microscopy (fairSIM).
fairSIM 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
(... | Tool.trace(" Abbe (um): "+abbeLimit+" sim spacing (um): "+simPttrLen+" k0 (len): "+k0); | 3 |
Tonius/SimplyJetpacks | src/main/java/tonius/simplyjetpacks/gui/GuiPack.java | [
"@Mod(modid = SimplyJetpacks.MODID, version = SimplyJetpacks.VERSION, dependencies = SimplyJetpacks.DEPENDENCIES, guiFactory = SimplyJetpacks.GUI_FACTORY)\npublic class SimplyJetpacks {\n \n public static final String MODID = \"simplyjetpacks\";\n public static final String VERSION = \"@VERSION@\";\n pu... | import net.minecraft.util.ResourceLocation;
import tonius.simplyjetpacks.SimplyJetpacks;
import tonius.simplyjetpacks.gui.element.ElementEnergyStoredAdv;
import tonius.simplyjetpacks.gui.element.ElementFluidTankAdv;
import tonius.simplyjetpacks.network.PacketHandler;
import tonius.simplyjetpacks.network.message.Message... | package tonius.simplyjetpacks.gui;
public class GuiPack extends GuiBase {
private final ContainerPack container;
public GuiPack(ContainerPack container) { | super(container, new ResourceLocation(SimplyJetpacks.RESOURCE_PREFIX + "textures/gui/pack.png")); | 0 |
Multiplayer-italia/AuthMe-Reloaded | src/main/java/uk/org/whoami/authme/commands/UnregisterCommand.java | [
"public class Utils {\r\n //private Settings settings = Settings.getInstance();\r\n private Player player;\r\n private String currentGroup;\r\n private static Utils singleton;\r\n private String unLoggedGroup = Settings.getUnloggedinGroup;\r\n /* \r\n public Utils(Player player) {\r\n t... | import java.security.NoSuchAlgorithmException;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.Bukki... | /*
* Copyright 2011 Sebastian Köhler <sebkoehler@whoami.org.uk>.
*
* 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
*
* Unle... | int id = sched.scheduleSyncDelayedTask(plugin, new TimeoutTask(plugin, name), delay);
| 7 |
Keridos/FloodLights | src/main/java/de/keridos/floodlights/FloodLights.java | [
"@SuppressWarnings(\"WeakerAccess\")\npublic class ModCompatibility {\n private static ModCompatibility instance = null;\n\n public static boolean IC2Loaded = false;\n public static boolean BCLoaded = false;\n public static boolean CofhCoreLoaded = false;\n public static boolean NEILoaded = false;\n ... | import de.keridos.floodlights.compatability.ModCompatibility;
import de.keridos.floodlights.core.proxy.CommonProxy;
import de.keridos.floodlights.handler.ConfigHandler;
import de.keridos.floodlights.handler.GuiHandler;
import de.keridos.floodlights.handler.PacketHandler;
import de.keridos.floodlights.init.ModBlocks;
im... | package de.keridos.floodlights;
/**
* Created by Keridos on 28.02.14.
* This Class is the Main Class of the Mod.
*/
@SuppressWarnings("unused")
@Mod.EventBusSubscriber | @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, dependencies = Reference.DEPENDENCIES) | 7 |
Ouyangan/hunt-admin | hunt-service/src/main/java/com/hunt/service/impl/SysRoleServiceImpl.java | [
"public interface SysPermissionMapper {\n //新增\n public Long insert(SysPermission SysPermission);\n\n //更新\n public void update(SysPermission SysPermission);\n\n //通过对象进行查询\n public SysPermission select(SysPermission SysPermission);\n\n //通过id进行查询\n public SysPermission selectById(@Param(\"i... | import com.hunt.dao.SysPermissionMapper;
import com.hunt.dao.SysRoleMapper;
import com.hunt.dao.SysRolePermissionMapper;
import com.hunt.model.dto.PageInfo;
import com.hunt.model.dto.SysRoleDto;
import com.hunt.model.entity.SysPermission;
import com.hunt.model.entity.SysRole;
import com.hunt.model.entity.SysRolePermiss... | package com.hunt.service.impl;
/**
* @Author ouyangan
* @Date 2016/10/14/14:53
* @Description
*/
@Service
@Transactional
public class SysRoleServiceImpl implements SysRoleService {
private static Logger log = LoggerFactory.getLogger(SysRoleServiceImpl.class);
@Autowired | private SysRoleMapper sysRoleMapper; | 1 |
ZhangFly/WTFSocket_Server_JAVA | test/controller/RegisterController.java | [
"public class ApplicationMsg {\n\n private Integer flag;\n private Integer cmd;\n private Integer errCode;\n private JSONArray params;\n private String version = \"1.0\";\n private String cause = null;\n\n public static ApplicationMsg failure(int errCode, String cause) {\n return new App... | import model.ApplicationMsg;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import wtf.socket.controller.WTFSocketController;
import wtf.socket.exception.WTFSocketException;
import wtf.socket.exception.fatal.WTFSocketInvalidSourceException;
import wtf.socket.protocol.WTFSo... | package controller;
/**
* 注册功能
*/
@Controller
public class RegisterController implements WTFSocketController {
@Override
public boolean isResponse(WTFSocketMsg msg) { | ApplicationMsg body = msg.getBody(ApplicationMsg.class); | 0 |
jlaw90/Grimja | liblab/src/com/sqrt/liblab/entry/model/GrimModel.java | [
"public class LabFile {\n /**\n * The collection that this LabFile belongs to\n */\n public final LabCollection container;\n /**\n * The names and data for the entries of this LabFile\n */\n public final List<DataSource> entries = new LinkedList<DataSource>();\n private int version = ... | import com.sqrt.liblab.LabFile;
import com.sqrt.liblab.entry.LabEntry;
import com.sqrt.liblab.threed.Angle;
import com.sqrt.liblab.threed.Bounds3;
import com.sqrt.liblab.threed.Vector3f;
import java.util.LinkedList;
import java.util.List; | /*
* Copyright (C) 2014 James Lawrence.
*
* This file is part of LibLab.
*
* LibLab 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 o... | node.animYaw = node.animRoll = node.animPitch = Angle.zero; | 2 |
hosuaby/example-restful-project | src/test/java/io/hosuaby/restful/tests/config/WebMvcTestsConfig.java | [
"@Component\npublic class PortHolder implements ApplicationListener<EmbeddedServletContainerInitializedEvent> {\n\n private int port;\n\n @Override\n public void onApplicationEvent(\n EmbeddedServletContainerInitializedEvent event) {\n port = event.getEmbeddedServletContainer().getPort()... | import io.hosuaby.restful.PortHolder;
import io.hosuaby.restful.domain.Teapot;
import io.hosuaby.restful.mappers.TeapotMapper;
import io.hosuaby.restful.mappers.TeapotMapperImpl;
import io.hosuaby.restful.services.TeapotCommandService;
import io.hosuaby.restful.services.TeapotCrudService;
import io.hosuaby.restful.serv... | package io.hosuaby.restful.tests.config;
/**
* Configuration for tests of MVC controllers.
*/
@Configuration
@ComponentScan(basePackages = {
"io.hosuaby.restful.controllers",
"io.hosuaby.restful.domain.validators" })
public class WebMvcTestsConfig {
/** Teapot "Mouse" */
private static f... | public TeapotMapper teapotMapper() { | 2 |
AVMf/avmf | src/test/java/org/avmframework/ObjectiveFunctions.java | [
"public class NumericObjectiveValue extends ObjectiveValue<NumericObjectiveValue> {\n\n protected double value;\n protected boolean higherIsBetter;\n\n protected boolean haveOptimum = false;\n protected double optimum;\n\n public NumericObjectiveValue(double value, boolean higherIsBetter) {\n this.value = v... | import org.avmframework.objective.NumericObjectiveValue;
import org.avmframework.objective.ObjectiveFunction;
import org.avmframework.objective.ObjectiveValue;
import org.avmframework.variable.IntegerVariable;
import org.avmframework.variable.Variable; | package org.avmframework;
public class ObjectiveFunctions {
public static ObjectiveFunction flat() {
ObjectiveFunction objFun =
new ObjectiveFunction() {
@Override | protected ObjectiveValue computeObjectiveValue(Vector vector) { | 2 |
echocat/adam | src/main/java/org/echocat/adam/profile/UserProfileMacro.java | [
"public class LocalizationHelper implements DisposableBean {\n\n @Nonnull\n public static final Locale DEFAULT_LOCALE = US;\n\n @Nullable\n private static LocalizationHelper c_instance;\n\n @Nonnull\n public static LocalizationHelper localizationHelper() {\n final LocalizationHelper result ... | import com.atlassian.confluence.content.render.xhtml.ConversionContext;
import com.atlassian.confluence.languages.LocaleManager;
import com.atlassian.confluence.macro.Macro;
import com.atlassian.confluence.macro.MacroExecutionException;
import com.atlassian.confluence.security.PermissionManager;
import com.atlassian.co... | /*****************************************************************************************
* *** BEGIN LICENSE BLOCK *****
*
* echocat Adam, Copyright (c) 2014 echocat
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as publi... | private final ElementRenderer _elementRenderer; | 1 |
Ouyangan/hunt-admin | hunt-service/src/main/java/com/hunt/service/SystemService.java | [
"public class PageInfo {\n private int total;\n private Object rows;\n\n public PageInfo(int total, Object rows) {\n this.total = total;\n this.rows = rows;\n }\n\n @Override\n public String toString() {\n return \"PageInfo{\" +\n \"total=\" + total +\n ... | import com.hunt.model.dto.PageInfo;
import com.hunt.model.entity.SysDataGroup;
import com.hunt.model.entity.SysDataItem;
import com.hunt.model.entity.SysIpForbidden;
import com.hunt.model.entity.SysLog;
import java.util.List; | package com.hunt.service;
/**
* @Author: ouyangan
* @Date : 2016/10/21
*/
public interface SystemService {
void forceLogout(long userId);
void clearAuthorizationInfoCacheByUserId(long userId);
void clearAuthorizationInfoALL();
void clearAuthorizationInfoByRoleId(long roleId);
PageInfo sele... | long insertSysDataItem(SysDataItem sysDataItem); | 2 |
google/ftc-object-detection | TFObjectDetector/tfod/src/main/java/com/google/ftcresearch/tfod/detection/RecognizeImageRunnable.java | [
"public class AnnotatedYuvRgbFrame {\n\n private final YuvRgbFrame frame;\n private final List<Recognition> recognitions;\n private final long frameTimeNanos;\n\n public AnnotatedYuvRgbFrame(@NonNull YuvRgbFrame frame, @NonNull List<Recognition> recognitions,\n long frameTimeNanos) ... | import java.util.List;
import java.util.Map;
import org.tensorflow.lite.Interpreter;
import android.graphics.RectF;
import android.util.Log;
import com.google.ftcresearch.tfod.util.AnnotatedYuvRgbFrame;
import com.google.ftcresearch.tfod.util.Recognition;
import com.google.ftcresearch.tfod.util.Size;
import com.google.... | /*
* Copyright (C) 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | private final AnnotatedYuvRgbFrame annotatedFrame; | 0 |
TGAC/RAMPART | src/main/java/uk/ac/tgac/rampart/stage/analyse/asm/AnalyseAssembliesArgs.java | [
"public class Mecq extends RampartProcess {\n\n private static Logger log = LoggerFactory.getLogger(Mecq.class);\n\n public Mecq(ConanExecutorService ces) {\n this(ces, new Args());\n }\n\n public Mecq(ConanExecutorService ces, Args args) {\n super(ces, args);\n }\n\n\n public Args g... | import org.apache.commons.cli.CommandLine;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import uk.ac.ebi.fgpt.conan.core.process.AbstractProcessArgs;
import uk.ac.ebi.fgpt.conan.model.ConanProcess;
import uk.ac.ebi.fgpt.conan.model.param.ConanParameter;
import uk.ac.ebi.fgpt.conan.model.param.ParamMap;
impo... | /*
* RAMPART - Robust Automatic MultiPle AssembleR Toolkit
* Copyright (C) 2015 Daniel Mapleson - TGAC
*
* 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, o... | private SpiFactory<AssemblyAnalyser> assemblyAnalyserFactory; | 5 |
OpenNTF/DomSQL | domsql/eclipse/plugins/com.ibm.domino.domsql.sqlite/src/com/ibm/domino/domsql/sqlite/driver/Database.java | [
"public class DomSQLConnection extends DomSQLObject implements Connection {\r\n\t\r\n private Database db;\r\n private String userName;\r\n\r\n private DomSQLDatabaseMetaData meta;\r\n private boolean autoCommit = true;\r\n private int timeout;\r\n\r\n // Indicates if a transaction was started whi... | import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import com.ibm.commons.Platform;
import com.ibm.commons.util.StringUtil;
import com.ibm.domino.domsql.sqlite.driver.jdbc.DomSQLConnection;
import com.ibm.domino.domsql.sqlite.dr... | /*
* © Copyright IBM Corp. 2010
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | if(DomSQL.debug.TRACE_DATABASE_LIFECYCLE) {
| 2 |
TheCount/jhilbert | src/main/java/jhilbert/Main.java | [
"public class CommandException extends JHilbertException {\n\n\t/**\n\t * Creates a new <code>CommandException</code> with the specified\n\t * detail message.\n\t *\n\t * @param message detail message.\n\t */\n\tpublic CommandException(final String message) {\n\t\tthis(message, null);\n\t}\n\n\t/**\n\t * Creates a ... | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.UnknownHostException;
import jhilbert.commands.CommandException;
import jhilbert.commands.CommandFactory;
import jhilbert.d... | /*
JHilbert, a verifier for collaborative theorem proving
Copyright © 2008, 2009, 2011 The JHilbert Authors
See the AUTHORS file for the list of JHilbert authors.
See the commit logs ("git log") for a list of individual contributions.
This program is free software: you can redistribute it and/... | final Module mainInterface = DataFactory.getInstance().createModule(inputFileName); | 2 |
RockinChaos/ItemJoin | src/me/RockinChaos/itemjoin/listeners/triggers/PlayerGuard.java | [
"public class PlayerHandler {\n\t\n\tprivate static HashMap<String, ItemStack[]> craftingItems = new HashMap<String, ItemStack[]>();\n\tprivate static HashMap<String, ItemStack[]> craftingOpenItems = new HashMap<String, ItemStack[]>();\n\tprivate static HashMap<String, ItemStack[]> creativeCraftingItems = new HashM... | import me.RockinChaos.itemjoin.item.ItemUtilities;
import me.RockinChaos.itemjoin.item.ItemUtilities.TriggerType;
import me.RockinChaos.itemjoin.utils.SchedulerUtils;
import me.RockinChaos.itemjoin.utils.ServerUtils;
import me.RockinChaos.itemjoin.utils.api.DependAPI;
import java.util.ArrayList;
import java.util.Arrays... | /*
* ItemJoin
* Copyright (C) CraftationGaming <https://www.craftationgaming.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | String regions = DependAPI.getDepends(false).getGuard().getRegionAtLocation(location); | 5 |
TeamAmeriFrance/Guide-API | src/main/java/amerifrance/guideapi/gui/GuiHome.java | [
"public class Book {\n\n private static final String GUITEXLOC = \"guideapi:textures/gui/\";\n\n private List<CategoryAbstract> categories = Lists.newArrayList();\n private String title = \"item.GuideBook.name\";\n private String header = title;\n private String itemName = title;\n private String ... | import amerifrance.guideapi.api.impl.Book;
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
import amerifrance.guideapi.button.ButtonNext;
import amerifrance.guideapi.button.ButtonPrev;
import amerifrance.guideapi.button.ButtonSearch;
import amerifrance.guideapi.network.PacketHandler;
import amerifran... | package amerifrance.guideapi.gui;
public class GuiHome extends GuiBase {
public ResourceLocation outlineTexture;
public ResourceLocation pageTexture;
public Book book;
public HashMultimap<Integer, CategoryWrapper> categoryWrapperMap = HashMultimap.create();
public ButtonNext buttonNext; | public ButtonPrev buttonPrev; | 3 |
uber-java/tally | example/src/main/java/com/uber/m3/tally/example/PrintStatsReporterExample.java | [
"public interface Counter {\n /**\n * Increment this {@link Counter} by delta.\n * @param delta amount to increment this {@link Counter} by\n */\n void inc(long delta);\n}",
"public class ScopeCloseException extends Exception {\n public ScopeCloseException() {\n super();\n }\n\n ... | import com.uber.m3.tally.Counter;
import com.uber.m3.tally.ScopeCloseException;
import com.uber.m3.util.Duration;
import com.uber.m3.tally.Gauge;
import com.uber.m3.tally.RootScopeBuilder;
import com.uber.m3.tally.Scope;
import com.uber.m3.tally.StatsReporter;
import com.uber.m3.tally.Timer; | // Copyright (c) 2021 Uber Technologies, Inc.
//
// 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... | Counter exampleCounter = subScope.counter("ticks"); | 0 |
Ericliu001/Weather2016 | app/src/main/java/com/example/ericliu/weather2016/repo/RemoteWeatherRepo.java | [
"public class MyApplication extends Application {\n\n private static RepoComponent component;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n RepoComponent repoComponent = DaggerRepoComponent.builder()\n .repoModule(new RepoModule())\n .appModule... | import android.app.Application;
import android.util.Log;
import com.example.ericliu.weather2016.application.MyApplication;
import com.example.ericliu.weather2016.common.NetworkConstants;
import com.example.ericliu.weather2016.framework.repository.Repository;
import com.example.ericliu.weather2016.framework.repository.R... | package com.example.ericliu.weather2016.repo;
/**
* Created by ericliu on 12/04/2016.
*/
public class RemoteWeatherRepo implements Repository<WeatherResult> {
private static final String TAG = RemoteWeatherRepo.class.getSimpleName();
@Inject
Application mApplication;
@Inject
Gson mGson;
... | public WeatherResult get(Specification specification) throws IOException { | 4 |
Team254/FRC-2013 | src/com/team254/frc2013/auto/ThreeDiscAutoMode.java | [
"public class ResetDriveEncodersCommand extends CommandBase {\n protected void initialize() {\n drive.resetEncoders();\n }\n\n protected void execute() {\n }\n\n protected boolean isFinished() {\n return true;\n }\n\n protected void end() {\n }\n\n protected void interrupted() {\n }\n}",
"public c... | import com.team254.frc2013.commands.ResetDriveEncodersCommand;
import com.team254.frc2013.commands.ResetGyroCommand;
import com.team254.frc2013.commands.RunIntakeCommand;
import com.team254.frc2013.commands.SetIntakeDownCommand;
import com.team254.frc2013.commands.ShootSequenceCommand;
import com.team254.frc2013.comman... | package com.team254.frc2013.auto;
/**
* Shoots three preloaded discs from the back of the pyramid
*
* @author jonathan.chang13@gmail.com (Jonathan Chang)
*/
public class ThreeDiscAutoMode extends CommandGroup {
public ThreeDiscAutoMode() {
addSequential(new ResetDriveEncodersCommand()); | addSequential(new ResetGyroCommand()); | 1 |
tastybento/askygrid | src/com/wasteofplastic/askygrid/commands/SkyGridCmd.java | [
"public class ASkyGrid extends JavaPlugin {\n // This plugin\n private static ASkyGrid plugin;\n // The ASkyGrid world\n private static World gridWorld = null;\n private static World netherWorld = null;\n private static World endWorld = null;\n // Player folder file\n private File playersFol... | import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import net.milkbowl.vault.economy.EconomyResponse;
import or... | /*******************************************************************************
* This file is part of ASkyGrid.
*
* ASkyGrid 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 ... | if (VaultHelper.econ == null) { | 5 |
Atmosphere/wasync | wasync/src/test/java/org/atmosphere/tests/SSETest.java | [
"public class ClientFactory {\n\n private final static ClientFactory factory = new ClientFactory();\n private final String clientClassName;\n\n public ClientFactory() {\n clientClassName = System.getProperty(\"wasync.client\");\n }\n\n /**\n * Return the default Factory.\n *\n * @r... | import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
import java.io.IOException;
import java.net.ServerSocket;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBo... | /*
* Copyright 2008-2022 Async-IO.org
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | AtmosphereClient client = ClientFactory.getDefault().newClient(AtmosphereClient.class); | 6 |
longkai/catnut | src/org/catnut/plugin/fantasy/Photo.java | [
"public class CatnutApp extends Application {\n\n\tpublic static final String TAG = \"CatnutApp\";\n\n\t/** singleton */\n\tprivate static CatnutApp sApp;\n\t/** http request header for weibo' s access token */\n\tprivate static Map<String, String> sAuthHeaders;\n\n\tprivate RequestQueue mRequestQueue;\n\tprivate S... | import android.content.ContentValues;
import android.content.Context;
import android.content.SharedPreferences;
import android.provider.BaseColumns;
import android.util.Log;
import org.catnut.R;
import org.catnut.core.CatnutApp;
import org.catnut.core.CatnutMetadata;
import org.catnut.core.CatnutProcessor;
import org.c... | /*
* The MIT License (MIT)
* Copyright (c) 2014 longkai
* The software shall be used for good, not evil.
*/
package org.catnut.plugin.fantasy;
/**
* fantasy
*
* @author longkai
*/
public class Photo implements CatnutMetadata<JSONObject, ContentValues> {
public static final String TAG = "Photo";
public stat... | ) && System.currentTimeMillis() - pref.getLong(LAST_FANTASY_MILLIS, 0) > DateTime.DAY_MILLIS; | 5 |
qubole/presto-kinesis | src/test/java/com/qubole/presto/kinesis/decoder/json/TestRFC2822JsonKinesisFieldDecoder.java | [
"@VisibleForTesting\nstatic final DateTimeFormatter FORMATTER = DateTimeFormat.forPattern(\"EEE MMM dd HH:mm:ss Z yyyy\").withLocale(Locale.ENGLISH).withZoneUTC();",
"public static void checkIsNull(Set<KinesisFieldValueProvider> providers, KinesisColumnHandle handle)\n{\n KinesisFieldValueProvider provider = f... | import static com.qubole.presto.kinesis.decoder.json.RFC2822JsonKinesisFieldDecoder.FORMATTER;
import static com.qubole.presto.kinesis.decoder.util.DecoderTestUtil.checkIsNull;
import static com.qubole.presto.kinesis.decoder.util.DecoderTestUtil.checkValue;
import static java.lang.String.format;
import static org.testn... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | private static Map<KinesisColumnHandle, KinesisFieldDecoder<?>> map(List<KinesisColumnHandle> columns) | 4 |
kendzi/kendzi-math | kendzi-straight-skeleton/src/main/java/kendzi/math/geometry/skeleton/debug/display/DisplayLav2.java | [
"abstract public class DisplayObject {\n\n\tabstract public void draw(Graphics2D g2d, EquationDisplay disp, boolean selected);\n\n\tabstract public Object drawObject();\n\n\tabstract public DisplayRectBounds getBounds();\n\n}",
"public class DisplayRectBounds {\r\n double minX = Double.MAX_VALUE;\r\n double... | import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Stroke;
import javax.vecmath.Point2d;
import kendzi.math.geometry.debug.DisplayObject;
import kendzi.math.geometry.debug.DisplayRectBounds;
import kendzi.math.geometry.skeleton.circular.CircularList;
import kendzi.ma... | package kendzi.math.geometry.skeleton.debug.display;
/**
*
* @author Tomasz Kędziora (kendzi)
*/
public class DisplayLav2 extends DisplayObject {
private CircularList<Vertex> lav;
private Color color;
/**
* @param LAV
* @param pColor
*/
public DisplayLav2(Cir... | public void draw(Graphics2D g2d, EquationDisplay disp, boolean selected) {
| 4 |
flyingrub/TamTime | app/src/main/java/flying/grub/tamtime/adapter/HomeAdapter.java | [
"public class OneStopActivity extends AppCompatActivity {\n private Toolbar toolbar;\n private ViewPager viewPager;\n private SlidingTabLayout slidingTabLayout;\n\n private FavoriteStops favoriteStops;\n private FavoriteStopLine favoriteStopLine;\n\n private int stop_zone_id;\n private StopZone... | import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.UiThread;
import android.support.v4.app.FragmentActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.v... | package flying.grub.tamtime.adapter;
public class HomeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
private static final String TAG = HomeAdapter.class.getSimpleName();
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
private static final int TYP... | private FavHomeView favHomeView; | 4 |
offa/NBCndUnit | src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteStartedHandlerTest.java | [
"public class CndTestSuite extends TestSuite\n{\n private final TestFramework framework;\n \n public CndTestSuite(String name, TestFramework framework)\n {\n super(name);\n this.framework = framework;\n }\n\n \n /**\n * Returns the framework.\n * \n * @return Framewor... | import bv.offa.netbeans.cnd.unittest.api.CndTestSuite;
import bv.offa.netbeans.cnd.unittest.api.ManagerAdapter;
import bv.offa.netbeans.cnd.unittest.api.TestFramework;
import static bv.offa.netbeans.cnd.unittest.testhelper.Helper.checkedMatch;
import static bv.offa.netbeans.cnd.unittest.testhelper.Helper.createCurrentT... | /*
* NBCndUnit - C/C++ unit tests for NetBeans.
* Copyright (C) 2015-2021 offa
*
* This file is part of NBCndUnit.
*
* NBCndUnit 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... | private ManagerAdapter manager; | 1 |
TooTallNate/Java-WebSocket | src/test/java/org/java_websocket/issues/Issue677Test.java | [
"public interface WebSocket {\n\n /**\n * sends the closing handshake. may be send in response to an other handshake.\n *\n * @param code the closing code\n * @param message the closing message\n */\n void close(int code, String message);\n\n /**\n * sends the closing handshake. may be send in res... | import org.java_websocket.WebSocket;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.framing.CloseFrame;
import org.java_websocket.handshake.ClientHandshake;
import org.java_websocket.handshake.ServerHandshake;
import org.java_websocket.server.WebSocketServer;
import org.java_websocket.util.... | /*
* Copyright (c) 2010-2020 Nathan Rajlich
*
* 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... | WebSocketClient webSocket0 = new WebSocketClient(new URI("ws://localhost:" + port)) { | 1 |
daneren2005/Subsonic | app/src/main/java/github/daneren2005/dsub/util/UserUtil.java | [
"public class DownloadService extends Service {\n\tprivate static final String TAG = DownloadService.class.getSimpleName();\n\n\tpublic static final String CMD_PLAY = \"github.daneren2005.dsub.CMD_PLAY\";\n\tpublic static final String CMD_TOGGLEPAUSE = \"github.daneren2005.dsub.CMD_TOGGLEPAUSE\";\n\tpublic static f... | import android.app.Activity;
import android.support.v7.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widge... | public static void changeEmail(final Activity context, final User user) {
View layout = context.getLayoutInflater().inflate(R.layout.change_email, null);
final TextView emailView = (TextView) layout.findViewById(R.id.new_email);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(... | public void onItemClicked(UpdateView<User.Setting> updateView, User.Setting item) { | 4 |
HarryXR/SimpleNews | app/src/main/java/com/lauren/simplenews/news/presenter/NewsPresenterImpl.java | [
"public class NewsBean implements Serializable {\n\n /**\n * docid\n */\n public String docid;\n /**\n * 标题\n */\n public String title;\n /**\n * 小内容\n */\n public String digest;\n /**\n * 图片地址\n */\n public String imgsrc;\n /**\n * 来源\n */\n pub... | import com.lauren.simplenews.beans.NewsBean;
import com.lauren.simplenews.commons.Urls;
import com.lauren.simplenews.news.model.NewsModel;
import com.lauren.simplenews.news.model.NewsModelImpl;
import com.lauren.simplenews.news.view.NewsView;
import com.lauren.simplenews.news.widget.NewsFragment;
import com.lauren.simp... | package com.lauren.simplenews.news.presenter;
/**
* Description :
* Author : lauren
* Email : lauren.liuling@gmail.com
* Blog : http://www.liuling123.com
* Date : 15/12/18
*/
public class NewsPresenterImpl implements NewsPresenter, NewsModelImpl.OnLoadNewsListListener {
private static final String TA... | LogUtils.d(TAG, url); | 6 |
kaif-open/kaif-android | app/src/main/java/io/kaif/mobile/service/ServiceModule.java | [
"public class ApiConfiguration {\n\n private String endPoint;\n\n private String clientId;\n\n private String redirectUri;\n\n private String clientSecret;\n\n public ApiConfiguration(String endPoint,\n String clientId,\n String clientSecret,\n String redirectUri) {\n this.endPoint = endPoint... | import android.app.Application;
import android.net.ConnectivityManager;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import javax.inject.Singleton;
import dagger.Module;
import dagger.Provides;
import io.kaif.mobile.BuildConfig;
import... | package io.kaif.mobile.service;
@Module
public class ServiceModule {
private final Application application;
private static final int CACHE_SIZE = 10 * 1024 * 1024;
public ServiceModule(Application application) {
this.application = application;
}
@Provides
@Singleton
public FeedService provid... | final AccessTokenInfo accountTokenInfo = accessTokenManager.findAccount(); | 2 |
4FunApp/4Fun | client/FourFun/app/src/main/java/com/joker/fourfun/di/component/ActivityComponent.java | [
"@Module\npublic class ActivityModule {\n private AppCompatActivity mActivity;\n\n public ActivityModule(AppCompatActivity appCompatActivity) {\n mActivity = appCompatActivity;\n }\n\n @Provides\n @PerActivity\n AppCompatActivity provideActivity() {\n return mActivity;\n }\n}",
... | import android.support.v7.app.AppCompatActivity;
import com.joker.fourfun.di.PerActivity;
import com.joker.fourfun.di.module.ActivityModule;
import com.joker.fourfun.ui.LoginActivity;
import com.joker.fourfun.ui.MainActivity;
import com.joker.fourfun.ui.MovieDetailActivity;
import com.joker.fourfun.ui.PictureDetailActi... | package com.joker.fourfun.di.component;
/**
* Created by joker on 2016/11/28.
*/
@PerActivity
@Component(dependencies = AppComponent.class, modules = ActivityModule.class)
public interface ActivityComponent {
AppCompatActivity activity();
void inject(SplashActivity activity);
void inject(MainActivit... | void inject(RegisterActivity activity); | 5 |
teivah/TIBreview | src/test/java/com/tibco/exchange/tibreview/processor/resourcerule/CProcessorProxyConfigurationTest.java | [
"public class TIBResource {\n\tprivate String filePath;\n\tprivate String type;\n\t\n\tprivate static final String REQUEST_GET_TYPE = \"/jndi:namedResource/@type\";\n\t\n\tpublic TIBResource(String filePath) throws Exception {\n\t\tthis.filePath = filePath;\n\t\tthis.type = Util.xpathEval(filePath, Constants.RESOUR... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.junit.Test;
import com.tibco.exchange.tibreview.common.TIBResource;
import com.tibco.exchange.tibreview.engine.Context;
import com.tibco.exchange.tibreview.mod... | package com.tibco.exchange.tibreview.processor.resourcerule;
public class CProcessorProxyConfigurationTest {
private static final Logger LOGGER = Logger.getLogger(CProcessorProxyConfigurationTest.class);
@Test
public void testCProcessorLDAPConfigurationTest() {
TIBResource fileresource;
try {
... | Configuration Configuracion = resource.getRule().get(0).getConfiguration();
| 3 |
indvd00m/java-ascii-render | ascii-render/src/test/java/com/indvd00m/ascii/render/tests/TestOverlay.java | [
"public class Canvas implements ICanvas {\n\n\tpublic static final char NULL_CHAR = '\\0';\n\n\tprotected final int width;\n\tprotected final int height;\n\tprotected final List<StringBuilder> lines;\n\n\t// cache\n\tprotected String cachedText;\n\tprotected String cachedLines;\n\tprotected boolean needUpdateCache ... | import com.indvd00m.ascii.render.Canvas;
import com.indvd00m.ascii.render.Render;
import com.indvd00m.ascii.render.api.ICanvas;
import com.indvd00m.ascii.render.api.IContext;
import com.indvd00m.ascii.render.api.IContextBuilder;
import com.indvd00m.ascii.render.api.IRender;
import com.indvd00m.ascii.render.elements.Dot... | package com.indvd00m.ascii.render.tests;
/**
* @author indvd00m (gotoindvdum[at]gmail[dot]com)
* @since 1.4.0
*/
public class TestOverlay {
@Test
public void test01() {
IRender render = new Render();
IContextBuilder builder = render.newBuilder();
builder.width(21).height(10); | builder.element(new Rectangle()); | 8 |
KeithYokoma/LGTMCamera | app/src/main/java/jp/yokomark/lgtm/app/preference/ui/PreferenceActivity.java | [
"@Module(\n\t\tcomplete = false,\n\t\tlibrary = true\n)\npublic class ActivityModule {\n\tprivate final Activity mActivity;\n\n\tpublic ActivityModule(Activity activity) {\n\t\tmActivity = activity;\n\t}\n\n\t@Provides\n\t@Singleton\n\tObjectGraph provideActivityGraph() {\n\t\tif (mActivity instanceof DaggerFragmen... | import android.os.Bundle;
import android.view.MenuItem;
import com.anprosit.android.dagger.ActivityModule;
import com.anprosit.android.dagger.ui.DaggerActivity;
import java.util.Arrays;
import java.util.List;
import javax.inject.Inject;
import jp.yokomark.lgtm.R;
import jp.yokomark.lgtm.app.preference.ui.helper.Prefere... | package jp.yokomark.lgtm.app.preference.ui;
/**
* @author yokomakukeishin
* @version 1.0.0
* @since 1.0.0
*/
public class PreferenceActivity extends DaggerActivity {
public static final String TAG = PreferenceActivity.class.getSimpleName(); | @Inject PreferenceListHelper mHelper; | 2 |
beckchr/juel | modules/impl/src/main/java/de/odysseus/el/tree/impl/ast/AstIdentifier.java | [
"public abstract class ELContext {\r\n\tprivate Map<Class<?>, Object> context;\r\n\tprivate Locale locale;\r\n\tprivate boolean resolved;\r\n\r\n\t/**\r\n\t * Returns the context object associated with the given key. The ELContext maintains a\r\n\t * collection of context objects relevant to the evaluation of an ex... | import de.odysseus.el.tree.IdentifierNode;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
import javax.el.ELContext;
import javax.el.ELException;
import javax.el.MethodExpression;
import javax.el.MethodInfo;
import javax.el.MethodNotFoundException;
... | /*
* Copyright 2006-2009 Odysseus Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | ValueExpression expression = bindings.getVariable(index);
| 4 |
yammer/telemetry | telemetry-agent/src/test/java/com/yammer/telemetry/agent/TelemetryTransformerTest.java | [
"public interface ClassInstrumentationHandler {\n boolean transformed(CtClass cc, ClassPool pool);\n}",
"public abstract class SubTypeInstrumentationHandler implements ClassInstrumentationHandler {\n private static final Logger LOGGER = Logger.getLogger(SubTypeInstrumentationHandler.class.getName());\n p... | import com.yammer.telemetry.instrumentation.ClassInstrumentationHandler;
import com.yammer.telemetry.agent.handlers.SubTypeInstrumentationHandler;
import com.yammer.telemetry.test.TransformingClassLoader;
import com.yammer.telemetry.instrumentation.TelemetryTransformer;
import javassist.*;
import org.junit.Test;
import... | package com.yammer.telemetry.agent;
public class TelemetryTransformerTest {
@Test
public void testUnmodifiedWhenNoHandlersAdded() throws Exception {
TelemetryTransformer transformer = new TelemetryTransformer();
assertNull(transformer.transform(getClass().getClassLoader(), "com/yammer/teleme... | transformer.addHandler(new ClassInstrumentationHandler() { | 0 |
Protino/Fad-Flicks | app/src/main/java/com/calgen/prodek/fadflicks/Fragment/GridFragment.java | [
"public class MainActivity extends AppCompatActivity implements GridFragment.ReloadCallback {\n\n //re-enable usage of vectors for devices(API 19 and lower)\n static {\n AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);\n }\n\n public static final String MOVIE_DETAIL_FRAGMENT_TAG = \"M... | import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.DefaultItemAnimator;
import a... | context = getContext();
if (savedInstanceState == null) {
movieList = new ArrayList<>();
}
movieAdapter = new GridMovieAdapter(context, movieList);
RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(context, getSpanCount());
recyclerView.setLay... | if (MainActivity.twoPane && firstLaunch && fragmentDataType.equals(popularData)) { | 0 |
WebcamStudio/webcamstudio | src/webcamstudio/externals/ProcessRenderer.java | [
"public static int audioFreq = 22050;",
"public static int outFMEbe = 1;",
"public static String wsDistroWatch() {\n String distro = null;\n Runtime rt = Runtime.getRuntime();\n String distroCmd = \"uname -a\";\n try {\n Process distroProc = rt.exec(distroCmd);\n Tools.sleep(10);\n ... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.reflect.Field;
import java.net.MalformedURLException;
import java.net.SocketException;
import java.net.URL;
import java.util.... | }
break;
case KEYINT:
if (fme != null) {
command = command.replaceAll(Tags.KEYINT.toString(), "" + fme.getKeyInt());
} else {
command = command.replaceAll(Tags.KEYINT.toString... | public Frame getFrame() { | 5 |
adyliu/jafka | src/main/java/io/jafka/consumer/ZookeeperConsumerConnector.java | [
"public class Broker {\n\n /**\n * the global unique broker id\n */\n public final int id;\n\n /**\n * the broker creator (hostname with created time)\n *\n * @see ServerRegister#registerBrokerInZk()\n */\n public final String creatorId;\n\n /**\n * broker hostname\n *... | import com.github.zkclient.IZkChildListener;
import com.github.zkclient.IZkStateListener;
import com.github.zkclient.ZkClient;
import com.github.zkclient.exception.ZkNoNodeException;
import com.github.zkclient.exception.ZkNodeExistsException;
import io.jafka.api.OffsetRequest;
import io.jafka.cluster.Broker;
import io.... | consumerIdString,curBrokerPartitions.size(),topic,curBrokerPartitions,curConsumers.size(),curConsumers
);
if (logger.isDebugEnabled()) {
StringBuilder buf = new StringBuilder(1024);
buf.append("[").append(topic).appe... | throw new InvalidConfigException("Wrong value in autoOffsetReset in ConsumerConfig"); | 2 |
dotcool/coolreader | src/com/dotcool/reader/service/UpdateService.java | [
"public class Constants {\n\n\t// public static final String BaseURL = \"http://www.baka-tsuki.org/project/\";\n\tpublic static final String BASE_URL_HTTPS = \"http://fiction.icoolxue.com/index.php\";\n\tpublic static final String BASE_URL = \"http://fiction.icoolxue.com/index.php\";\n\tpublic static final String B... | import java.util.ArrayList;
import java.util.Date;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPrefe... | package com.dotcool.reader.service;
public class UpdateService extends Service {
private final IBinder mBinder = new MyBinder();
public boolean force = false;
public final static String TAG = UpdateService.class.toString();
private static boolean isRunning; | public ICallbackNotifier notifier; | 3 |
loklak/loklak_server | src/org/loklak/api/search/InstagramProfileScraper.java | [
"public class JSONObject {\n /**\n * JSONObject.NULL is equivalent to the value that JavaScript calls null,\n * whilst Java's null is equivalent to the value that JavaScript calls\n * undefined.\n */\n private static final class Null {\n\n /**\n * There is only intended to be a ... | import org.loklak.data.DAO;
import org.loklak.harvester.BaseScraper;
import org.loklak.harvester.Post;
import org.loklak.server.BaseUserRole;
import java.io.BufferedReader;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Map;
import org.apache.http.client.utils.URIBuilder;
import java.u... | /**
* Instagram Profile Scraper
* Copyright 08.08.2016 by Jigyasa Grover, @jig08
*
* This library 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 2.1 of the License, or (at... | public JSONArray scrapeInstagram(BufferedReader br, String url) { | 1 |
martino2k6/StoreBox | storebox-lib/src/main/java/net/orange_box/storebox/StoreBoxInvocationHandler.java | [
"public interface StoreBoxTypeAdapter<F, T> {\n \n StoreType getStoreType();\n \n T getDefaultValue();\n\n T adaptForPreferences(F value);\n\n F adaptFromPreferences(T value);\n}",
"public enum PreferencesMode {\n\n /**\n * Default.\n * \n * @see android.content.Context#MODE_PRIVA... | import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
import android.util.TypedValue;
import net.orange_box.storebox.adapters.StoreBoxTypeAdapter;
i... | /*
* Copyright 2015 Martin Bella
*
* 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... | final StoreBoxTypeAdapter adapter = TypeUtils.getTypeAdapter( | 8 |
filosganga/geogson | core/src/test/java/com/github/filosganga/geogson/gson/FeatureAdapterTest.java | [
"public final class FeatureUtils {\n\n public static Feature featureWithId(String id) {\n return Feature.builder().withGeometry(Point.from(12.3, 45.3)).withId(id).build();\n }\n\n public static Feature featureWithGeometry(Geometry<?> geometry) {\n return Feature.builder().withGeometry(Point.f... | import com.github.filosganga.geogson.gson.utils.FeatureUtils;
import com.github.filosganga.geogson.gson.utils.JsonUtils;
import com.github.filosganga.geogson.model.Feature;
import com.github.filosganga.geogson.model.Point;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonEleme... | package com.github.filosganga.geogson.gson;
public class FeatureAdapterTest {
private Gson toTest;
@Before
public void initToTest() {
toTest = new GsonBuilder().registerTypeAdapterFactory(new GeometryAdapterFactory()).create();
}
@Test
public void shouldHandleFeaturesWithId() { | Feature feature = FeatureUtils.featureWithId("testid"); | 2 |
CyclopsMC/EverlastingAbilities | src/main/java/org/cyclops/everlastingabilities/command/CommandModifyAbilities.java | [
"public class AbilityHelpers {\n\n /**\n * This value is synced with {@link GeneralConfig#maxPlayerAbilities} from the server.\n * This is to ensure that clients can not hack around the ability limit.\n */\n public static int maxPlayerAbilitiesClient = -1;\n\n public static final int[] RARITY_C... | import com.mojang.brigadier.Command;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.context.CommandContext;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleComm... | package org.cyclops.everlastingabilities.command;
/**
* Command for modifying abilities to players.
* @author rubensworks
*/
public class CommandModifyAbilities implements Command<CommandSource> {
private final boolean checkAbility;
private final boolean checkLevel;
public CommandModifyAbilities(bool... | .then(Commands.argument("ability", new ArgumentTypeAbility()) | 5 |
bretthshelley/Maven-IIB9-Plug-In | src/main/java/ch/sbb/maven/plugins/iib/utils/SkipUtil.java | [
"@Mojo(name = \"apply-bar-overrides\", defaultPhase = LifecyclePhase.PROCESS_CLASSES)\npublic class ApplyBarOverridesMojo extends AbstractMojo {\n\n\n /**\n * Whether the applybaroverride command should be executed or not\n */\n @Parameter(property = \"applyBarOverrides\", defaultValue = \"true\", req... | import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.regex.Pattern;
import ch.sbb.maven.plugins.iib.mojos.ApplyBarOverridesMojo;
import ch.sbb.maven.plugins.iib.mojos.DeployBarMojo;
import ch.sbb.maven.plugins.iib.mojos.InitializeBarBuildWorkspaceMojo;
import ch.sbb.maven.... | /*
* Copyright (C) Schweizerische Bundesbahnen SBB, 2015.
*/
package ch.sbb.maven.plugins.iib.utils;
/**
*
*
*
* @author Brett (user_vorname user_nachname)
* @version $Id: $
* @since pom_version, 2015
*/
public class SkipUtil {
@SuppressWarnings("rawtypes")
static LinkedHashMap<Class, String> clas... | classGoalMap.put(ApplyBarOverridesMojo.class, "process-classes"); | 0 |
FedUni/caliko | caliko-visualisation/src/main/java/au/edu/federation/caliko/visualisation/FabrikLine2D.java | [
"public class FabrikBone2D implements FabrikBone<Vec2f,FabrikJoint2D>\r\n{\r\n\t/**\r\n\t * mJoint\tThe joint attached to this FabrikBone2D.\r\n\t * <p>\r\n\t * Each bone has a single FabrikJoint2D which controls the angle to which the bone is\r\n\t * constrained with regard to the previous (i.e. earlier / closer t... | import au.edu.federation.caliko.FabrikBone2D;
import au.edu.federation.caliko.FabrikChain2D;
import au.edu.federation.caliko.FabrikChain2D.BaseboneConstraintType2D;
import au.edu.federation.caliko.FabrikJoint2D.ConstraintCoordinateSystem;
import au.edu.federation.caliko.FabrikStructure2D;
import au.edu.federation.... | package au.edu.federation.caliko.visualisation;
/**
* A static class used to draw a 2D lines to represent FabrikBone2D, FabrikChain2D or FabrickStructure2D objects.
* <p>
* These draw methods are only provided to assist with prototyping and debugging.
* <p>
* The GLSL shaders used to draw the lines requi... | Vec2f baseboneConstraintUV;
| 8 |
fralalonde/iostream | src/test/java/ca/rbon/iostream/channel/filter/CipherFilterTest.java | [
"public class IOUtils {\n // NOTE: This class is focused on InputStream, OutputStream, Reader and\n // Writer. Each method should take at least one of these as a parameter,\n // or return one of them.\n\n /**\n * The default buffer size ({@value}) to use in copy methods.\n */\n public static ... | import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import ca.rbon.iostream.utils.IOUtils;
import org.assertj.core.api.Assertions;
import org.junit.Before;
import org.junit.Test;
import ca.rbon.iostream.IO;
import ca.rbon.iostream.wrap.BufferedReaderOf;
import c... | package ca.rbon.iostream.channel.filter;
public class CipherFilterTest {
static final String AES_CBC_PKCS5PADDING = "AES/CBC/PKCS5PADDING";
final String s = "Using IoStream for encryption";
// SECRETS
final String key = "Bar12345Bar12345";
final String initVector = "RandomInitVector";
... | IOUtils.copy(in, bytes); | 0 |
hlavki/g-suite-identity-sync | services/facade/src/main/java/eu/hlavki/identity/services/rest/service/GoogleSettingsService.java | [
"public interface GSuiteDirectoryService {\n\n /**\n * Retrieve all groups for a member.\n *\n * @param userKey The userKey can be the user's primary email address, the user's alias email address, a\n * group's primary email address, a group's email alias, or the user's unique id.\n * @return... | import eu.hlavki.identity.services.google.GSuiteDirectoryService;
import eu.hlavki.identity.services.google.ResourceNotFoundException;
import eu.hlavki.identity.services.google.config.Configuration;
import eu.hlavki.identity.services.google.model.GroupMembership;
import eu.hlavki.identity.services.rest.model.ServiceAcc... | package eu.hlavki.identity.services.rest.service;
@Path("google/settings")
public class GoogleSettingsService {
private static final Logger LOG = LoggerFactory.getLogger(GoogleSettingsService.class);
@Context
private OidcClientTokenContext oidcContext;
private final Configuration googleConfig;
p... | GroupMembership admins = gsuiteDirService.getGroupMembers(adminGroup); | 3 |
garfieldon757/video_management_system | src/com/adp/dao/impl/UserDAOImpl.java | [
"public interface UserDAO {\r\n\t\r\n\tpublic void testDaoAspect();\r\n\tpublic void fuck(int a, String s);\r\n\tpublic void addUser(User user);\r\n\tpublic User getUserByEmail(String email);\r\n\tpublic User getUserByID(int userID);\r\n\tpublic Role getRole(int roleID);\r\n\tpublic AuthorizationList findAuthList(i... | import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.junit.Test;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
impo... | package com.adp.dao.impl;
@Repository("ud")
@Transactional
public class UserDAOImpl implements UserDAO{
@PersistenceContext(name="un")
private EntityManager em ;
@Override
public void testDaoAspect(){
System.out.println("This is userDAOIpml.testDaoAspect().");
return ;
}
@Override... | public Role getRole(int roleID) {
| 5 |
vsite-hr/hive | src/main/java/hr/vsite/hive/dao/PostgresDao.java | [
"public class Sensor implements Comparable<Sensor> {\n\n\t/** Hive's ID of this Sensor */\n\tpublic UUID getId() { return id; }\n\tpublic void setId(UUID id) { this.id = id; }\n\t\n\t/** Sensor's own ID */\n\tpublic String getDeviceId() { return deviceId; }\n\tpublic void setDeviceId(String deviceId) { this.deviceI... | import java.sql.Array;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.UUI... | }
}
private void modify(Sensor sensor) {
try (PreparedStatement statement = getConn().prepareStatement("UPDATE sensors SET sensor_name = ? WHERE sensor_id = ?", Statement.RETURN_GENERATED_KEYS)) {
statement.setString(1, sensor.getName());
statement.execute();
try (ResultSet resultSet ... | public void persist(ToggleTick tick) { | 5 |
novarto-oss/sane-dbc | sane-dbc-examples/src/test/java/com/novarto/sanedbc/examples/MapExample1.java | [
"public class SyncDbInterpreter\n{\n private final Try0<Connection, SQLException> ds;\n\n /**\n * Construct an interpreter, given a piece of code which knows how to spawn connections, e.g. a Data Source, Connection Pool,\n * Driver Manager, etc.\n * @param ds - the data source, which can spawn con... | import com.novarto.sanedbc.core.interpreter.SyncDbInterpreter;
import com.novarto.sanedbc.core.ops.EffectOp;
import com.novarto.sanedbc.core.ops.SelectOp;
import com.novarto.sanedbc.core.ops.UpdateOp;
import fj.Unit;
import fj.control.db.DB;
import fj.data.Option;
import org.junit.Test;
import java.sql.DriverManager;
i... | package com.novarto.sanedbc.examples;
public class MapExample1
{
public static class User
{
public final String user;
public final String hash;
public User(String user, String hash)
{
this.user = user;
this.hash = hash;
}
}
public st... | public static final DB<Unit> CREATE_USER_TABLE = new EffectOp( | 1 |
AURIN/online-whatif | src/main/java/au/org/aurin/wif/impl/AsyncProjectServiceImpl.java | [
"@ResponseStatus(value = HttpStatus.SERVICE_UNAVAILABLE, \nreason = \"Spatial DataStore creation failed!\")\npublic class DataStoreCreationException extends Exception {\n\n /** The Constant serialVersionUID. */\n private static final long serialVersionUID = 1124576769564144835L;\n\n /**\n * Instantiates a new ... | import java.io.IOException;
import java.util.HashSet;
import java.util.concurrent.Future;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;
import org.geotools.feature.FeatureCollection;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.r... | package au.org.aurin.wif.impl;
/**
* The Class AsyncProjectServiceImpl.
*/
@Service
@Qualifier("asyncProjectService")
public class AsyncProjectServiceImpl implements AsyncProjectService {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 213432423433L;
/** The Constant LO... | LOGGER.trace("Initializing version: " + WifKeys.WIF_KEY_VERSION); | 5 |
oSoc14/Artoria | app/src/main/java/be/artoria/belfortapp/mixare/plugin/remoteobjects/RemoteDataHandler.java | [
"public class POI {\n\n\n private static final int BOAT = 0;\n private static final int CIVIL = 1;\n private static final int RELIGIOUS = 2;\n private static final int TOWER = 3;\n private static final int THEATRE = 4;\n private static final int CASTLE = 5;\n private static final int... | import be.artoria.belfortapp.mixare.lib.marker.Marker;
import be.artoria.belfortapp.mixare.lib.marker.draw.ParcelableProperty;
import be.artoria.belfortapp.mixare.lib.marker.draw.PrimitiveProperty;
import be.artoria.belfortapp.mixare.lib.service.IDataHandlerService;
import be.artoria.belfortapp.mixare.plugin.PluginLoad... | /*
* Copyright (C) 2012- Peer internet solutions & Finalist IT Group
*
* This file is part of be.artoria.belfortapp.mixare.
*
* 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 ve... | public List<Marker> load(List<POI> rawData, int taskId, int colour) { | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.