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 |
|---|---|---|---|---|---|---|
MCBans/MCBans | src/main/java/com/mcbans/plugin/request/AltLookupRequest.java | [
"public class ActionLog {\n private final Logger logger = Logger.getLogger(\"Minecraft\");\n private final String logPrefix = \"[MCBans] \";\n\n private final MCBans plugin;\n private static ActionLog instance;\n\n public ActionLog(final MCBans plugin){\n instance = this;\n this.plugin ... | import java.util.UUID;
import org.bukkit.ChatColor;
import com.mcbans.plugin.ActionLog;
import com.mcbans.plugin.MCBans;
import com.mcbans.plugin.api.data.AltLookupData;
import com.mcbans.plugin.callBacks.AltLookupCallback;
import com.mcbans.plugin.org.json.JSONException;
import com.mcbans.plugin.org.json.JSONObject; | package com.mcbans.plugin.request;
public class AltLookupRequest extends BaseRequest<AltLookupCallback>{
private String playerName;
private UUID playerUUID;
public AltLookupRequest(final MCBans plugin, final AltLookupCallback callback, final UUID playerUUID, final String playerName) {
super... | JSONObject result = this.request_JOBJ(); | 5 |
yuxiangping/mongodb-orm | src/main/java/org/yy/mongodb/orm/executor/parser/ResultExecutor.java | [
"public class MongoORMException extends RuntimeException {\r\n\r\n private static final long serialVersionUID = 3988706952509457604L;\r\n\r\n private static final Logger logger = LoggerFactory.getLogger(MongoORMException.class);\r\n\r\n private String message;\r\n\r\n public MongoORMException(String message) {\... | import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.yy.mongodb.exception.MongoORMException;
import org.yy.mongodb.orm.MqlMapConfiguration;
import org.yy.mongodb.orm.engine.config.MappingConfig;
import org.yy.mongodb.orm.engine.entry.Entry;
import o... | package org.yy.mongodb.orm.executor.parser;
/**
* Mongodb MQL field result executor.
*
* <select>
* <field>
* ......
* </field>
* </select>
*
* @author yy
*/
@SuppressWarnings("unchecked")
public class ResultExecutor implements MqlExecutor<Object> {
@Override
| public Object parser(String namespace, MqlMapConfiguration configuration, NodeEntry entry, Object target) throws MongoORMException {
| 1 |
LithidSoftware/android_Findex | src/com/lithidsw/findex/widget/WidgetViews.java | [
"public class FileInfoActivity extends Activity {\n\n private Context mContext;\n private EditText editText;\n private ListView mListView;\n private InfoTagListAdapter mAdapter;\n private TextView mNoListText;\n private TextView mFileName;\n private LinearLayout mFileNameLayout;\n\n private... | import android.appwidget.AppWidgetManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.util.Log;
import android.widget.RemoteViews;
import android.widget.RemoteViewsService;
import co... | package com.lithidsw.findex.widget;
public class WidgetViews implements RemoteViewsService.RemoteViewsFactory {
private Context mContext;
private ArrayList<FileInfo> mFiles = new ArrayList<FileInfo>();
private int mThemeStyle;
private int mAppWidgetId;
private WidgetInfo mWidgetInfo;
priv... | if (tag.contains(C.TAG_PICTURES)) { | 4 |
XYScience/StopApp | app/src/main/java/com/sscience/stopapp/fragment/ComponentDetailsFragment.java | [
"public class ComponentDetailsActivity extends BaseActivity {\n\n public static final String EXTRA_APP_NAME = \"app_name\";\n public static final String EXTRA_APP_PACKAGE_NAME = \"app_package_name\";\n public CoordinatorLayout mCoordinatorLayout;\n public ViewPager mViewPager;\n\n public static void ... | import android.os.Bundle;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.science.baserecyclerviewadapter.interfaces.OnItemClickListener;
import com.sscience.stopapp.R;
impor... | package com.sscience.stopapp.fragment;
/**
* @author SScience
* @description
* @email chentushen.science@gmail.com
* @data 2017/4/4
*/
public class ComponentDetailsFragment extends BaseFragment implements ComponentDetailsContract.View {
private ComponentDetailsContract.Presenter mPresenter; | private ComponentDetailsAdapter mComponentDetailsAdapter; | 1 |
tevjef/Vapor | vapor-app/src/main/java/com/tevinjeffrey/vapor/okcloudapp/CloudAppService.java | [
"public class AccountModel {\n\n private static final String TAG = \"AccountModel\";\n private long id;\n private String email;\n private String domain;\n private String domain_home_page;\n private boolean private_items;\n private boolean subscribed;\n private String subscription_expires_at;... | import com.squareup.okhttp.RequestBody;
import com.tevinjeffrey.vapor.okcloudapp.model.AccountModel;
import com.tevinjeffrey.vapor.okcloudapp.model.AccountStatsModel;
import com.tevinjeffrey.vapor.okcloudapp.model.CloudAppJsonAccount;
import com.tevinjeffrey.vapor.okcloudapp.model.CloudAppJsonItem;
import com.tevinjeff... | package com.tevinjeffrey.vapor.okcloudapp;
public interface CloudAppService {
@Headers("Accept: application/json")
@GET("/{item-id}")
Observable<ItemModel> getItem(@Path("item-id") String itemId);
@Headers("Accept: application/json")
@GET("/items")
Observable<List<ItemModel>> listItems(@Que... | Observable<UploadModel> newUpload(@QueryMap Map<String, String> parts); | 5 |
hecoding/Pac-Man | src/jeco/core/algorithm/ga/SimpleGeneticAlgorithm.java | [
"public abstract class Algorithm<V extends Variable<?>> extends AlgObservable {\n\n protected Problem<V> problem = null;\n // Attribute to stop execution of the algorithm.\n protected boolean stop = false;\n \n /**\n * Allows to stop execution after finishing the current generation; must be\n * taken into ... | import java.util.Collections;
import java.util.HashMap;
import java.util.logging.Logger;
import jeco.core.algorithm.Algorithm;
import jeco.core.operator.comparator.SimpleDominance;
import jeco.core.operator.crossover.CrossoverOperator;
import jeco.core.operator.mutation.MutationOperator;
import jeco.core.operator.selec... | package jeco.core.algorithm.ga;
public class SimpleGeneticAlgorithm<V extends Variable<?>> extends Algorithm<V> {
protected static final Logger logger = Logger.getLogger(SimpleGeneticAlgorithm.class.getName());
/////////////////////////////////////////////////////////////////////////
protected Boolean s... | public SimpleGeneticAlgorithm(Problem<V> problem, Integer maxPopulationSize, Integer maxGenerations, Boolean stopWhenSolved, MutationOperator<V> mutationOperator, CrossoverOperator<V> crossoverOperator, SelectionOperator<V> selectionOperator) { | 3 |
xdevs23/Cornowser | app/src/main/java/io/xdevs23/cornowser/browser/browser/xwalk/CornResourceClient.java | [
"public class AssetHelper {\n\n public static String getAssetString(@RawRes String assetPath, @NonNull Context context) {\n try {\n return InputStreamUtils.readToString(context.getAssets().open(assetPath));\n } catch(IOException ex) {\n return \"\";\n }\n }\n\n}",
... | import android.net.http.SslError;
import android.webkit.ValueCallback;
import android.webkit.WebResourceResponse;
import org.xdevs23.android.content.res.AssetHelper;
import org.xdevs23.debugutils.Logging;
import org.xdevs23.debugutils.StackTraceParser;
import org.xdevs23.net.http.HttpStatusCodeHelper;
import org.xwalk.... | package io.xdevs23.cornowser.browser.browser.xwalk;
/**
* A cool "resource client" for our crunchy view
*/
public class CornResourceClient extends XWalkResourceClient {
public String currentWorkingUrl = "about:blank";
public static Pattern urlRegEx = Pattern.compile(
"(" +
... | if (AdBlockParser.isHostListed(CrunchyWalkView.fromXWalkView(view).getUrlAlt(), | 6 |
aredee/accumulo-mesos | accumulo-mesos-common/src/main/java/aredee/mesos/frameworks/accumulo/initialize/AccumuloInitializer.java | [
"public final class Constants {\n\n // bundler used for items defined by Maven\n private static final ResourceBundle rb = ResourceBundle.getBundle(\"accumulo-mesos\");\n public static final String FRAMEWORK_VERSION = rb.getString(\"application.version\");\n public static final String EXE_NAME = rb.getSt... | import aredee.mesos.frameworks.accumulo.configuration.Constants;
import aredee.mesos.frameworks.accumulo.configuration.Environment;
import aredee.mesos.frameworks.accumulo.model.Accumulo;
import aredee.mesos.frameworks.accumulo.model.ServerProfile;
import aredee.mesos.frameworks.accumulo.process.AccumuloProcessFactory;... | package aredee.mesos.frameworks.accumulo.initialize;
public class AccumuloInitializer {
private static final Logger LOGGER = LoggerFactory.getLogger(AccumuloInitializer.class);
private Accumulo config;
private String accumuloHome;
public AccumuloInitializer(Accumulo config) {
this.confi... | File inputFile = new File(mesosDirectory+File.separator+ Constants.ACCUMULO_NATIVE_LIB); | 0 |
dirk/hummingbird2 | src/main/java/org/hummingbirdlang/nodes/frames/CreateBindingsNode.java | [
"@NodeInfo(language = \"HB\")\npublic abstract class HBNode extends Node {\n // Execute with a generic unspecialized return value.\n public abstract Object executeGeneric(VirtualFrame frame);\n\n // Execute without a return value.\n public void executeVoid(VirtualFrame frame) {\n executeGeneric(frame);\n }\... | import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.NodeField;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.frame.VirtualFrame;
import java.util.ArrayList;
import java.util.List;
import org.hummingbirdlang.... | package org.hummingbirdlang.nodes.frames;
// Assembles the `Bindings` for a function.
@NodeField(name = "type", type = FunctionType.class)
public abstract class CreateBindingsNode extends HBNode {
protected abstract FunctionType getType();
public abstract Bindings executeCreateBindings(VirtualFrame frame);
... | Binding binding = fetcher.fetch(materializedFrame, ownBindings); | 1 |
glenrobson/SimpleAnnotationServer | src/test/java/uk/org/llgc/annotation/store/test/TestUtils.java | [
"public class IDConflictException extends Exception {\n\tpublic IDConflictException() {\n\t\tsuper();\n\t}\n\n\tpublic IDConflictException(final String pMessage) {\n\t\tsuper(pMessage);\n\t}\n}",
"public interface StoreAdapter {\n\n\tpublic void init(final AnnotationUtils pAnnoUtils);\n\n // CRUD annotations\n... | import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Rule;
import org.junit.Before;
import org.junit.After;
import org.junit.rules.TemporaryFolder;
import org.junit.rules.TestWatcher;
import java.util.List;
import j... | package uk.org.llgc.annotation.store.test;
public class TestUtils {
protected static Logger _logger = LogManager.getLogger(TestUtils.class.getName());
protected AnnotationUtils _annotationUtils = null;
protected StoreAdapter _store = null;
@Rule
public TemporaryFolder _testFolder = new TemporaryFolder... | StoreConfig tConfig = new StoreConfig(_props); | 5 |
Kesshou/Kesshou-Android | app/src/main/java/kesshou/android/daanx/views/MainActivity.java | [
"public class BaseActivity extends AppCompatActivity{\n\t@Override\n\tprotected void onCreate(Bundle savedInstanceState){\n\t\tsuper.onCreate(savedInstanceState);\n\t}\n\n\t@Override\n\tprotected void attachBaseContext(Context newBase) {\n\t\tsuper.attachBaseContext(MyContextWrapper.wrap(newBase,\"fr\"));\n\t}\n}",... | import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.graphics.drawable.DrawableCompat;
impo... |
package kesshou.android.daanx.views;
/*
Author: Charles Lien (lienching)
Description: This is the main activity of this app.
*/
public class MainActivity extends BaseActivity {
public FirebaseAnalytics mFirebaseAnalytics;
@Override
protected void onCreate(Bundle savedInstanceState) {
s... | fragments.add(new NewsFragment()); | 5 |
weiboad/fiery | server/src/main/java/org/weiboad/ragnar/server/controller/web/ShowTracePage.java | [
"@Component\n@ConfigurationProperties(prefix = \"fiery\")\npublic class FieryConfig {\n\n private int keepdataday;\n\n private String dbpath;\n\n private String indexpath;\n\n private Boolean kafkaenable;\n\n private String kafkaserver;\n\n private String kafkagroupid;\n\n private String mailfr... | import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.commons.lang.StringUtils;
import org.apache.lucene.index.Term;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.apac... | package org.weiboad.ragnar.server.controller.web;
@Controller
public class ShowTracePage {
Logger log = LoggerFactory.getLogger(ShowTracePage.class);
@Autowired
DBManage dbmanager;
@Autowired
IndexService indexHelper;
@Autowired
FieryConfig fieryConfig;
private Map<String, Map<St... | DBSharder dbhelper = dbmanager.getDB(timestampLong); | 5 |
Spade-Editor/Spade | src/heroesgrave/spade/io/ImageImporter.java | [
"public class Document\n{\n\tpublic static int MAX_DIMENSION = 4096;\n\t\n\tprivate LinkedList<IDocChange> changes = new LinkedList<IDocChange>();\n\tprivate LinkedList<IDocChange> reverted = new LinkedList<IDocChange>();\n\t\n\tprivate int width, height;\n\tprivate File file;\n\tprivate Metadata info;\n\tprivate L... | import javax.imageio.ImageIO;
import javax.swing.filechooser.FileFilter;
import com.alee.laf.filechooser.WebFileChooser;
import heroesgrave.spade.image.Document;
import heroesgrave.spade.image.Layer;
import heroesgrave.spade.image.RawImage;
import heroesgrave.spade.main.Popup;
import heroesgrave.utils.misc.Metadata;
im... | // {LICENSE}
/*
* Copyright 2013-2015 HeroesGrave and other Spade developers.
*
* This file is part of Spade
*
* Spade 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, ... | RawImage image = RawImage.fromBufferedImage(ImageIO.read(file)); | 2 |
jentrata/jentrata | ebms-msh-rest/src/test/java/org/jentrata/ebms/rest/internal/routes/RepositoryServiceRouteBuilderTest.java | [
"public class EbmsConstants {\n\n public static final String JENTRATA_VERSION = \"JentrataVersion\";\n\n //Jentrata Message Header keys\n public static final String SOAP_VERSION = \"JentrataSOAPVersion\";\n public static final String EBMS_VERSION = \"JentrataEBMSVersion\";\n public static final Strin... | import org.apache.camel.Exchange;
import org.apache.camel.Header;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultExchange;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.jentrata.ebms.EbmsConstants;
import org.jentrata.ebms.MessageStatusType;
import org.jentrata.ebms... | package org.jentrata.ebms.rest.internal.routes;
/**
* Unit test for org.jentrata.ebms.rest.internal.routes.RepositoryServiceRouteBuilder
*
* @author aaronwalker
*/
public class RepositoryServiceRouteBuilderTest extends CamelTestSupport {
@Test
public void testFindByMessageID() {
Exchange reques... | return new DefaultMessage(messageId); | 2 |
tassioauad/GameCheck | app/src/main/java/com/tassioauad/gamecheck/dagger/DaoModule.java | [
"public interface GameRatingDao {\n boolean insert(Game game, float rating);\n\n boolean update(Game game, float rating);\n\n Float getRatingOf(Game game);\n}",
"public interface PlatformRatingDao {\n boolean insert(Platform platform, float rating);\n\n boolean update(Platform platform, float ratin... | import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import com.tassioauad.gamecheck.model.database.GameRatingDao;
import com.tassioauad.gamecheck.model.database.PlatformRatingDao;
import com.tassioauad.gamecheck.model.database.impl.DatabaseConnection;
import com.tassioauad.gamecheck.model.dat... | package com.tassioauad.gamecheck.dagger;
@Module(library = true, includes = AppModule.class)
public class DaoModule {
@Singleton
@Provides
public SQLiteDatabase provideSQLiteDatabase(Context context) {
return new DatabaseConnection(context).getWritableDatabase();
}
@Provides | public PlatformRatingDao providePlatformRatingDao(SQLiteDatabase database) { | 1 |
plusonelabs/calendar-widget | app/src/main/java/org/andstatus/todoagenda/task/dmfs/DmfsOpenTasksProvider.java | [
"public class EventSource {\n private static final String TAG = EventSource.class.getSimpleName();\n public final static EventSource EMPTY = new EventSource(EventProviderType.EMPTY, 0, \"Empty\", \"\", 0, false);\n public static final String STORE_SEPARATOR = \",\";\n\n private static final String KEY_P... | import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.text.TextUtils;
import org.andstatus.todoagenda.prefs.EventSource;
import org.andstatus.todoagenda.prefs.FilterMode;
import org.andstatus.todoagenda.p... | package org.andstatus.todoagenda.task.dmfs;
public class DmfsOpenTasksProvider extends AbstractTaskProvider {
public DmfsOpenTasksProvider(EventProviderType type, Context context, int widgetId) {
super(type, context, widgetId);
}
@Override
public List<TaskEvent> queryTasks() {
myC... | if (getFilterMode() == FilterMode.NORMAL_FILTER) { | 1 |
yyxhdy/ManyEAs | src/jmetal/problems/DTLZ/DTLZ3.java | [
"public abstract class Problem implements Serializable {\n\n\t/**\n\t * Defines the default precision of binary-coded variables\n\t */\n\tprivate final static int DEFAULT_PRECISSION = 16;\n\n\t/**\n\t * Stores the number of variables of the problem\n\t */\n\tprotected int numberOfVariables_;\n\n\t/**\n\t * Stores t... | import jmetal.core.Problem;
import jmetal.core.Solution;
import jmetal.core.Variable;
import jmetal.encodings.solutionType.BinaryRealSolutionType;
import jmetal.encodings.solutionType.RealSolutionType;
import jmetal.util.JMException; | // DTLZ3.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public Licen... | Variable[] gen = solution.getDecisionVariables(); | 2 |
roncoo/roncoo-adminlte-springmvc | src/main/java/com/roncoo/adminlte/controller/admin/EmailAccountInfoController.java | [
"public class RcDataDictionaryList implements Serializable {\r\n private Long id;\r\n\r\n private String statusId;\r\n\r\n @JsonFormat(pattern = \"yyyy-MM-dd HH:mm:ss\")\r\n private Date createTime;\r\n\r\n @JsonFormat(pattern = \"yyyy-MM-dd HH:mm:ss\")\r\n private Date updateTime;\r\n\r\n priv... | import com.roncoo.adminlte.util.base.BaseController;
import com.roncoo.adminlte.util.base.Page;
import com.roncoo.adminlte.util.base.PageBean;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model... | /*
* Copyright 2015-2016 RonCoo(http://www.roncoo.com) Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | Result<Page<RcEmailAccountInfo>> result = biz.listForPage(pageCurrent, pageSize,search,date);
| 5 |
R2RML-api/R2RML-api | r2rml-api-rdf4j-binding/src/test/java/rdf4jTest/NTriplesSyntax2_Test.java | [
"public class RDF4JR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static RDF4JR2RMLMappingManager INSTANCE = new RDF4JR2RMLMappingManager(new RDF4J());\n\n private RDF4JR2RMLMappingManager(RDF4J rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import org.eclipse.rdf4j.rio.helpers.StatementCollector;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.RefObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.model.Template;
import eu.optique.r2rml.api.model.TriplesMap;
import java.io.Inpu... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | Iterator<RefObjectMap> gmit=pom.getRefObjectMaps().iterator();
| 2 |
apache/commons-fileupload | src/main/java/org/apache/commons/fileupload2/servlet/ServletFileUpload.java | [
"public interface FileItem extends FileItemHeadersSupport {\n\n // ------------------------------- Methods from javax.activation.DataSource\n\n /**\n * Returns an {@link java.io.InputStream InputStream} that can be\n * used to retrieve the contents of the file.\n *\n * @return An {@link java.i... | import java.io.IOException;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.fileupload2.FileItem;
import org.apache.commons.fileupload2.FileItemFactory;
import org.apache.commons.fileupload2.FileItemIterator;
import org.apache.commons.fileupload2.File... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | public ServletFileUpload(final FileItemFactory fileItemFactory) { | 1 |
mslosarz/nextrtc-signaling-server | src/test/java/org/nextrtc/signalingserver/cases/LeftConversationTest.java | [
"@ContextConfiguration(classes = {TestConfig.class})\n@RunWith(SpringJUnit4ClassRunner.class)\npublic abstract class BaseTest {\n\n @Autowired\n private CreateConversation create;\n\n @Autowired\n private JoinConversation join;\n\n @Autowired\n private Members members;\n\n @Autowired\n priva... | import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.nextrtc.signalingserver.BaseTest;
import org.nextrtc.signalingserver.domain.Member;
import org.nextrtc.signalingserver.domain.Signal;
import org.nextrtc.signalingserver.repository.Conversations;
import org.nextrtc.signali... | package org.nextrtc.signalingserver.cases;
public class LeftConversationTest extends BaseTest {
@Rule
public ExpectedException exception = ExpectedException.none();
@Autowired
private Members members;
@Autowired
private Conversations conversations;
@Autowired
private LeftConversat... | leftConversation.execute(create() | 5 |
lewisd32/authrite | authrite-service/src/main/java/com/lewisd/authrite/resources/UsersResource.java | [
"public class JWTConfiguration {\n private String jwtSecret = \"secret\";\n private int jwtExpirySeconds = 3600;\n private String cookieName = \"jwtToken\";\n\n @JsonProperty\n public String getJwtSecret() {\n return jwtSecret;\n }\n\n public void setJwtSecret(final String jwtSecret) {\n... | import com.lewisd.authrite.auth.JWTConfiguration;
import com.lewisd.authrite.errors.Exceptions;
import com.lewisd.authrite.resources.model.User;
import com.lewisd.authrite.resources.requests.CreateUserRequest;
import com.lewisd.authrite.resources.requests.LoginRequest;
import com.lewisd.authrite.resources.requests.Pass... | package com.lewisd.authrite.resources;
@Path("/users")
@Produces(MediaType.APPLICATION_JSON)
public class UsersResource {
private final UsersService usersService;
private final JWTConfiguration jwtConfiguration;
@Inject
public UsersResource(final UsersService usersService, final JWTConfiguration jw... | public Response loginUser(@Valid final LoginRequest loginRequest) { | 4 |
icecondor/android | src/com/icecondor/nest/service/AlarmReceiver.java | [
"public class Condor extends Service {\n\n private Client api;\n private boolean clientAuthenticated;\n private String authApiCall;\n private Database db;\n private Prefs prefs;\n private PendingIntent wake_alarm_intent;\n private AlarmManager alarmManager;\n private BatteryReceiver batteryR... | import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.util.Log;
import com.icecondor.nest.Condor;
import com.icecondor.nest.Constants;
import com.icecondor.nest.Prefs;
import com.icecondor.ne... | package com.icecondor.nest.service;
public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// can we always assume context is Condor? | Condor condor = (Condor)context; | 0 |
iloveeclipse/anyedittools | AnyEditTools/src/de/loskutov/anyedit/actions/replace/ReplaceWithAction.java | [
"public class AnyEditToolsPlugin extends AbstractUIPlugin {\n\n private static AnyEditToolsPlugin plugin;\n\n private static boolean isSaveHookInitialized;\n\n /**\n * The constructor.\n */\n public AnyEditToolsPlugin() {\n super();\n if(plugin != null) {\n throw new Ill... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.io.Writer;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse... | /*******************************************************************************
* Copyright (c) 2009 Andrey Loskutov.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at... | protected AbstractEditor editor; | 3 |
jimmoores/quandl4j | core/src/test/java/com/jimmoores/quandl/classic/tests/EqualsTests.java | [
"public final class DataSetRequest implements Request {\n private static final String START_DATE_PARAM = \"start_date\";\n private static final String END_DATE_PARAM = \"end_date\";\n private static final String COLUMN_INDEX_PARAM = \"column_index\";\n private static final String FREQUENCY_PARAM = \"collapse\";... | import java.util.Arrays;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.time.LocalDate;
import com.jimmoores.quandl.DataSetRequest;
import com.jimmoores.quandl.Frequency;
import com.jimmoores.quandl.HeaderDe... | package com.jimmoores.quandl.classic.tests;
/**
* Unit tests testing null checking.
*/
@Test(groups = { "unit" })
public class EqualsTests {
//CHECKSTYLE:OFF
@Test
public final void testSimpleDataSetRequestEqualsAndHashCode() {
DataSetRequest request1 = DataSetRequest.Builder.of("Hello").build();
D... | .withFrequency(Frequency.NONE) | 1 |
trivago/triava | src/examples/java/com/trivago/examples/TimeSourceExample.java | [
"public class TriavaNullLogger implements TriavaLogger\n{\n\n\t@Override\n\tpublic void info(String message)\n\t{\n\t}\n\n\t@Override\n\tpublic void error(String message)\n\t{\n\t}\n\n\t@Override\n\tpublic void error(String message, Throwable exc)\n\t{\n\t}\n\n}",
"public class EstimatorTimeSource extends Thread ... | import java.io.PrintStream;
import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import com.trivago.triava.logging.TriavaNullLogger;
import com.trivago.triava.time.EstimatorTimeSource;
import com.trivago.triava.time.OffsetTimeSource;
import com.trivago.triava.time.SystemTimeSource;
import c... | /*********************************************************************************
* Copyright 2015-present trivago 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:/... | TimeSource tsToday = new SystemTimeSource(); | 3 |
codecentric/conference-app | app/src/main/java/de/codecentric/controller/AddCommentsController.java | [
"public interface CommentDao {\r\n\r\n public List<Comment> getCommentsBySessionId(Long sessionId);\r\n\r\n public List<TimelineEntry> getRecentComments();\r\n\r\n public void saveComment(Comment comment);\r\n\r\n}",
"public interface SessionDao {\n\n List<Session> getAllSessions();\n\n List<String... | import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
... | package de.codecentric.controller;
@Controller
@RequestMapping("/addComment")
public class AddCommentsController {
private static final String USERNAME = "username";
@Autowired
private CommentDao commentDao;
@Autowired
private SessionDao sessionDao;
@RequestMapping(met... | CommentFormData commentFormData = new CommentFormData();
| 4 |
ThexXTURBOXx/BlockHelper | de/thexxturboxx/blockhelper/integration/ForgeIntegration.java | [
"public class BlockHelperCommonProxy {\n\n protected static Configuration cfg;\n\n public static boolean showHealth;\n public static boolean advMachinesIntegration;\n public static boolean appEngIntegration;\n public static boolean bcIntegration;\n public static boolean ccIntegration;\n public ... | import buildcraft.factory.TileTank;
import de.thexxturboxx.blockhelper.BlockHelperCommonProxy;
import de.thexxturboxx.blockhelper.api.BlockHelperBlockState;
import de.thexxturboxx.blockhelper.api.BlockHelperInfoProvider;
import de.thexxturboxx.blockhelper.api.InfoHolder;
import de.thexxturboxx.blockhelper.i18n.I18n;
im... | package de.thexxturboxx.blockhelper.integration;
public class ForgeIntegration extends BlockHelperInfoProvider {
public static final ForgeDirection[] DIRECTIONS = ForgeDirection.values();
@Override
public void addInformation(BlockHelperBlockState state, InfoHolder info) {
if (iof(state.te, "net.... | ? "" : I18n.format("liquid_format", "", liquidName); | 4 |
dubboclub/dubbo-plus | tracing-client/src/main/java/net/dubboclub/tracing/client/support/DefaultSyncTransfer.java | [
"public class Span implements Serializable {\n private String id;\n private String parentId;\n private String traceId;\n private String name;\n private String serviceName;\n private List<Annotation> annotationList;\n private List<BinaryAnnotation> binaryAnnotationList;\n\n public Span() {\n ... | import com.alibaba.dubbo.common.Constants;
import com.alibaba.dubbo.common.URL;
import com.alibaba.dubbo.common.extension.ExtensionFactory;
import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.alibaba.d... | package net.dubboclub.tracing.client.support;
/**
* Created by zetas on 2016/7/8.
*/
public class DefaultSyncTransfer implements SyncTransfer {
private static Logger logger = LoggerFactory.getLogger(DefaultSyncTransfer.class);
private Protocol protocol;
| private volatile TracingCollector collector; | 1 |
kristian/JDigitalSimulator | src/main/java/lc/kra/jds/components/buildin/register/ShiftRegister.java | [
"public final class Utilities {\n\tpublic static enum TranslationType { TEXT, ALTERNATIVE, TITLE, EXTERNAL, TOOLTIP, DESCRIPTION; }\n\n\tpublic static final String\n\t\tCONFIGURATION_LOCALIZATION_LANGUAGE = \"localization.language\",\n\t\tCONFIGURATION_LOOK_AND_FEEL_CLASS = \"lookandfeel.class\",\n\t\tCONFIGURATION... | import static lc.kra.jds.Utilities.*;
import java.awt.Graphics;
import java.awt.Point;
import java.beans.PropertyVetoException;
import java.util.Map;
import lc.kra.jds.Utilities.TranslationType;
import lc.kra.jds.contacts.Contact;
import lc.kra.jds.contacts.ContactUtilities;
import lc.kra.jds.contacts.InputContact;
imp... | /*
* JDigitalSimulator
* Copyright (C) 2017 Kristian Kraljic
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*... | private Contact[] contacts; | 2 |
mzlogin/guanggoo-android | app/src/main/java/org/mazhuang/guanggoo/data/task/GetCommentsTask.java | [
"public class App extends MultiDexApplication {\n\n private static App sInstance;\n public GlobalData mGlobal;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n sInstance = this;\n\n if (ConfigUtil.isDebug() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {\n ... | import org.jsoup.Connection;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.mazhuang.guanggoo.App;
import org.mazhuang.guanggoo.data.OnResponseListener;
import org.mazhuang.guanggoo.data.entity.Comment;
import org.mazhuang.guanggoo.data.entity.User;
import ... | package org.mazhuang.guanggoo.data.task;
/**
*
* @author mazhuang
* @date 2017/9/18
*/
public class GetCommentsTask extends BaseTask<Map<Integer, Comment>> {
private String mUrl;
| GetCommentsTask(String url, OnResponseListener<Map<Integer, Comment>> listener) { | 1 |
metno/metadata-editor | src/test/java/no/met/metadataeditor/EditorConfigurationFactoryTest.java | [
"@XmlRootElement(name=\"editor\", namespace=\"http://www.met.no/schema/metadataeditor/editorConfiguration\")\npublic class EditorConfiguration implements Serializable {\n\n private static final long serialVersionUID = -6228315858621721527L;\n\n private List<EditorPage> pages;\n\n public EditorConfiguration... | import no.met.metadataeditor.EditorConfiguration;
import no.met.metadataeditor.EditorPage;
import no.met.metadataeditor.widget.EditorWidget;
import no.met.metadataeditor.widget.ListWidget;
import no.met.metadataeditor.widget.StringWidget;
import org.junit.Test;
import static org.junit.Assert.*;
import static no.met.met... | package no.met.metadataeditor;
public class EditorConfigurationFactoryTest {
@Test
public void testUnmarshalling() {
String configString = fileAsString("/editorconfiguration/config1.xml"); | EditorConfiguration config = EditorConfigurationFactory.unmarshallConfiguration(configString); | 0 |
MHAVLOVICK/Sketchy | src/main/java/com/sketchy/server/action/SaveDrawingSettings.java | [
"public enum SketchyContext {\n\tINSTANCE;\n\t\n\tprivate static NumberFormat nf = NumberFormat.getInstance();\n\n\tpublic static final Map<String, String> PEN_SIZES = new LinkedHashMap<String, String>();\n\tstatic{\n\t\tnf.setMinimumIntegerDigits(1);\n\t\tnf.setMinimumFractionDigits(1);\n\t\t\n\t\tfor (double penS... | import javax.servlet.http.HttpServletRequest;
import com.sketchy.SketchyContext;
import com.sketchy.drawing.DrawingProperties;
import com.sketchy.drawing.DrawingSize;
import com.sketchy.metadata.MetaDataObject;
import com.sketchy.server.HttpServer;
import com.sketchy.server.JSONServletResult;
import com.sketchy.server.... | /*
Sketchy
Copyright (C) 2015 Matthew Havlovick
http://www.quickdrawbot.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your op... | JSONServletResult jsonServletResult = new JSONServletResult(Status.SUCCESS); | 7 |
jlaw90/Grimja | liblab/src/com/sqrt/liblab/codec/SetCodec.java | [
"public class GrimBitmap extends LabEntry {\n /**\n * The images contained within this bitmap\n */\n public final List<BufferedImage> images;\n\n public GrimBitmap(LabFile container, String name) {\n super(container, name);\n images = new LinkedList<BufferedImage>();\n }\n}",
"pu... | import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.sqrt.liblab.entry.graphics.GrimBitmap;
import com.sqrt.liblab.entry.model.ColorMap;
import com.sqrt.liblab.entry.model.set.Light;
import com.sqrt.liblab.entry.model.set.Sector;
import com.sqrt.liblab.entry.model.set.Set;
import co... | t.skipWhitespace();
t.expectString("object");
String name = t.readString();
System.out.println("Object: " + name);
}
}
t.skipWhitespace();
t.expectString("section: setups");
t.skipWhitespace();
t.expectS... | List<Sector> sectors = new ArrayList<>(); | 3 |
ddf/Minim | src/main/java/ddf/minim/javasound/JSBaseAudioRecordingStream.java | [
"public interface AudioListener\n{\n /**\n * Called by the audio object this AudioListener is attached to \n * when that object has new samples.\n * \n * @example Advanced/AddAndRemoveAudioListener\n * \n * @param samp \n * \ta float[] buffer of samples from a MONO sound stream\n * \n * @related ... | import ddf.minim.AudioListener;
import ddf.minim.AudioMetaData;
import ddf.minim.Minim;
import ddf.minim.MultiChannelBuffer;
import ddf.minim.spi.AudioRecordingStream;
import java.io.IOException;
import java.util.Arrays;
import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioInputStream;
import javax.s... | /*
* Copyright (c) 2007 - 2008 by Damien Di Fede <ddf@compartmental.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your o... | AudioRecordingStream | 4 |
esmasui/deb-kitkat-storage-access-framework | KitKatStorageProject/KitKatStorage/src/main/java/com/uphyca/kitkat/storage/internal/impl/LiveSdkDocumentsColumnMapper.java | [
"public interface DocumentsColumnMapper<T> {\n\n /**\n * @see DocumentsContract.Document#COLUMN_DOCUMENT_ID\n * <p>\n * Type: STRING\n * @param source\n */\n String mapDocumentId(T source);\n\n /**\n * @see DocumentsContract.Document#COLUMN_MIME_TYPE\n * <p>\n ... | import com.uphyca.kitkat.storage.skydrive.SkyDrivePhoto;
import com.uphyca.kitkat.storage.skydrive.SkyDriveVideo;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import android.provider.DocumentsContract;
import com.uphyca.kitkat.storage.intern... | /*
* Copyright (C) 2013 uPhyca Inc. http://www.uphyca.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 ... | public void visit(SkyDriveAudio audio) { | 3 |
Rai220/Telephoto | app/src/main/java/com/rai220/securityalarmbot/commands/MotionDetectCommand.java | [
"public class BotService extends Service implements MotionDetectorController.MotionDetectorListener, IStartService {\n public static final String TELEPHOTO_SERVICE_STOPPED = \"TELEPHOTO_SERVICE_STOPPED\";\n\n private TelegramService telegramService;\n private BatteryReceiver batteryReceiver;\n private S... | import com.pengrad.telegrambot.model.Message;
import com.rai220.securityalarmbot.BotService;
import com.rai220.securityalarmbot.R;
import com.rai220.securityalarmbot.commands.types.MdSwitchType;
import com.rai220.securityalarmbot.prefs.Prefs;
import com.rai220.securityalarmbot.prefs.PrefsController;
import com.rai220.s... | package com.rai220.securityalarmbot.commands;
public class MotionDetectCommand extends AbstractCommand {
private final BotService service;
public MotionDetectCommand(BotService service) {
super(service);
this.service = service;
}
@Override
public String getCommand() {
ret... | public boolean execute(Message message, Prefs prefs) { | 2 |
Beloumi/PeaFactory | src/peafactory/peas/editor_pea/PswDialogEditor.java | [
"public class PeaSettings {\n\n\tprivate static JDialog keyboard = null;\n\tprivate static final JDialog pswGenerator = null;\n\t\n\tprivate static final boolean BOUND = true;\n\tprivate static final String EXTERNAL_FILE_PATH = null;\n\tprivate static final boolean EXTERN_FILE = true;\n\tprivate static final String... | import cologne.eck.peafactory.peas.PswDialogBase;
import cologne.eck.peafactory.peas.gui.NewPasswordDialog;
import cologne.eck.peafactory.peas.gui.PswDialogView;
import cologne.eck.peafactory.tools.Attachments;
import cologne.eck.peafactory.tools.Converter;
import cologne.eck.peafactory.tools.ReadResources;
import colo... | package cologne.eck.peafactory.peas.editor_pea;
/*
* Peafactory - Production of Password Encryption Archives
* Copyright (C) 2015 Axel von dem Bruch
*
* This library 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 Softw... | if(PeaSettings.getExternFile() == false && | 0 |
INVASIS/Viola-Jones | test/process/features/TestFeatureExtractor.java | [
"public class ImageHandler {\n\n private BufferedImage bufferedImage;\n private int width;\n private int height;\n private int[][] crGrayImage;// Centered & reduced gray image\n private int[][] integralImage;\n private final String filePath;\n\n private void init() {\n this.crGrayImage =... | import GUI.ImageHandler;
import org.junit.Assert;
import org.junit.Test;
import process.Conf;
import utils.Serializer;
import utils.Utils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import static org.junit.Assert.assertEquals;
import static process.features.FeatureExtractor.*; | package process.features;
public class TestFeatureExtractor {
public final static String TRAIN_DIR = "tmp/test/";
public final static String ORGANIZED_FEATURES = TRAIN_DIR + "/organizedFeatures.data";
public final static String ORGANIZED_SAMPLE = TRAIN_DIR + "/organizedSample.data";
@Test
pub... | if (Conf.USE_CUDA) | 1 |
Naoghuman/SokubanFX | src/main/java/com/github/naoghuman/sokubanfx/view/preview/PreviewPresenter.java | [
"public interface IActionConfiguration {\r\n \r\n public final static String ON_ACTION__CHANGE_TO_GAMEVIEW = \"ON_ACTION__CHANGE_TO_GAMEVIEW\"; // NOI18N\r\n public final static String ON_ACTION__DISPLAY_MAP = \"ON_ACTION__DISPLAY_MAP\"; // NOI18N\r\n public final static String ON_ACTION__HIDE_MAINMENU ... | import com.github.naoghuman.lib.action.api.ActionFacade;
import com.github.naoghuman.lib.action.api.IRegisterActions;
import com.github.naoghuman.lib.action.api.TransferData;
import com.github.naoghuman.lib.logger.api.LoggerFacade;
import com.github.naoghuman.lib.preferences.api.PreferencesFacade;
import com.githu... | /*
* Copyright (C) 2016 Naoghuman
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is ... | final MapModel mm = MapFacade.INSTANCE.loadMap(randomMapIndex);
| 3 |
petitparser/java-petitparser | petitparser-xml/src/test/java/org/petitparser/grammar/xml/XmlParserTest.java | [
"public class XmlAttribute extends XmlNode {\n\n private final XmlName name;\n private final String value;\n\n public XmlAttribute(XmlName name, String value) {\n this.name = name;\n this.value = value;\n }\n\n public XmlName getName() {\n return name;\n }\n\n public String getValue() {\n return ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.petitparser.grammar.xm... | + " <xsd:element name=\"item\" minOccurs=\"0\" maxOccurs=\"UNBOUNDED\">\n"
+ " <xsd:complexType>\n"
+ " <xsd:sequence>\n"
+ " <xsd:element name=\"productName\" type=\"xsd:string\"/>\n"
+ " <xsd:element name=\"quantity\">\n"
+ " ... | if (node instanceof XmlElement) { | 2 |
makemyownlife/newdda-client | src/main/java/com/elong/pb/newdda/client/jdbc/ShardingPreparedStatement.java | [
"public final class PreparedStatementExecutor {\n\n private final static Logger logger = LoggerFactory.getLogger(PreparedStatementExecutor.class);\n\n private final Object flushLock = new Object();\n\n private final static int MAX_SIZE = ThreadPoolConstants.CORE_SIZE * 2 + 1;\n\n private final static in... | import com.elong.pb.newdda.client.executor.PreparedStatementExecutor;
import com.elong.pb.newdda.client.executor.wrapper.PreparedStatementExecutorWrapper;
import com.elong.pb.newdda.client.jdbc.adapter.AbstractPreparedStatementAdapter;
import com.elong.pb.newdda.client.router.PreparedSqlRouter;
import com.elong.pb.newd... | package com.elong.pb.newdda.client.jdbc;
/**
* Created by zhangyong on 2016/7/26.
*/
public class ShardingPreparedStatement extends AbstractPreparedStatementAdapter {
private final static Logger logger = LoggerFactory.getLogger(ShardingPreparedStatement.class);
private final Map<PreparedStatement, Prepar... | rs = ResultSetFactory.getResultSet(resultSetList, mergeContext); | 8 |
InMobi/api-monetization | java/src/main/java/com/inmobi/monetization/ads/Native.java | [
"public interface AdFormatListener {\n\n\tpublic void onSuccess(AdFormat adFormat, ArrayList<? extends AdResponse> response);\n\n\tpublic void onFailure(AdFormat adFormat, ErrorCode error);\n}",
"public class ErrorCode {\n\n\t/**\n\t * The error is unknown. Please look at responseMsg for any further details.\n\t ... | import java.util.ArrayList;
import main.java.com.inmobi.monetization.ads.listener.AdFormatListener;
import main.java.com.inmobi.monetization.api.net.ErrorCode;
import main.java.com.inmobi.monetization.api.request.ad.Request;
import main.java.com.inmobi.monetization.api.request.enums.AdRequest;
import main.java.com.inmo... | package main.java.com.inmobi.monetization.ads;
/**
* Publishers may use this class to request Native ads from InMobi.
*
* @author rishabhchowdhary
*
*/
public class Native extends AdFormat {
private JSONNativeResponseParser jsonParser = new JSONNativeResponseParser();
public Native() {
requestType = AdR... | errorCode = new ErrorCode(ErrorCode.NO_FILL, | 1 |
ehanoc/xwallet | app/src/main/java/com/bytetobyte/xwallet/BaseFragment.java | [
"public class BlockDownloaded {\n\n private final int _coin;\n private final double _pct;\n private final int _blocksLeft;\n private final Date _lastBlockDate;\n\n /**\n *\n * @param coin\n * @param pct\n * @param blocksSoFar\n * @param date\n */\n public BlockDownloaded(Cu... | import android.content.Context;
import android.support.v4.app.Fragment;
import com.bytetobyte.xwallet.service.ipcmodel.BlockDownloaded;
import com.bytetobyte.xwallet.service.ipcmodel.CoinTransaction;
import com.bytetobyte.xwallet.service.ipcmodel.MnemonicSeedBackup;
import com.bytetobyte.xwallet.service.ipcmodel.SpentV... | package com.bytetobyte.xwallet;
/**
* Created by bruno on 12.04.17.
*/
public abstract class BaseFragment extends Fragment implements BlockchainClientListener {
private XWalletBaseActivity _baseActivity;
/**
*
* @param context
*/
@Override
public void onAttach(Context context) {
... | public void onSyncReady(SyncedMessage syncedMessage) { | 4 |
kakao/hbase-tools | hbase0.98/hbase-table-stat-0.98/src/main/java/com/kakao/hbase/stat/load/TableInfo.java | [
"public abstract class Args {\n public static final String OPTION_REGION = \"region\";\n public static final String OPTION_OUTPUT = \"output\";\n public static final String OPTION_SKIP_EXPORT = \"skip-export\";\n public static final String OPTION_VERBOSE = \"verbose\";\n public static final String OP... | import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import com.kakao.hbase.common.Args;
import com.kakao.hbase.common.util.Util;
import com.kakao.hbase.specific.CommandAdapter;
import com.kakao.hbase.specific.RegionLoadAdapter;
import com.kakao.hbase.specific.RegionLoadDelegator;
import com.kak... | /*
* 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... | ExecutorService executorService = Executors.newFixedThreadPool(RegionLocationCleaner.THREAD_POOL_SIZE); | 5 |
twak/campskeleton | src/org/twak/camp/debug/SkeletonPointEditor.java | [
"public class Edge\n{\n public Corner start, end;\n\n // 0 is straight up, positive/-ve is inwards/outwards, absolute value must be less than Math.PI/2\n private double angle = Math.PI/4;\n \n // orthogonal vector pointing uphill\n public Vector3d uphill;\n public LinearForm3D linearForm;\n ... | import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
import javax.swing.JButton;
import javax.vecmath.Point2d;
import javax.vecmath.Point3d;
import org.w3c.dom.DOMImplem... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.twak.camp.debug;
//import org.apache.batik.dom.GenericDOMImplementation;
//import org.apache.batik.svggen.SVGGraphics2D;
/**
*
* @author
* twak
*/
public class SkeletonPointEditor extends PointEditor
{
... | Output output; | 2 |
rvt/cnctools | cnctools/src/main/java/com/rvantwisk/cnctools/controllers/CNCToolsController.java | [
"public class BallMill extends Toolbase {\n\n private final DimensionProperty diameter = new DimensionProperty();\n\n public BallMill() {\n }\n\n public BallMill(DimensionProperty diameter) {\n this.diameter.set(diameter);\n }\n\n public DimensionProperty diameterProperty() {\n retur... | import com.rvantwisk.cnctools.ScreensConfiguration;
import com.rvantwisk.cnctools.data.*;
import com.rvantwisk.cnctools.data.tools.BallMill;
import com.rvantwisk.cnctools.data.tools.EndMill;
import com.rvantwisk.cnctools.misc.*;
import com.rvantwisk.cnctools.operations.createRoundStock.RoundStockModel;
import com.rvant... | /*
* Copyright (c) 2013, R. van Twisk
* All rights reserved.
* Licensed under the The BSD 3-Clause License;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://opensource.org/licenses/BSD-3-Clause
*
* Redistribution and use in source and bina... | final GCodeCollection gCode = p.getGCode(toolDBManager); | 5 |
andrey7mel/android-step-by-step | app/src/test/java/com/andrey7mel/stepbystep/view/fragments/RepoInfoFragmentTest.java | [
"@RunWith(RobolectricGradleTestRunner.class)\n@Config(application = TestApplication.class,\n constants = BuildConfig.class,\n sdk = 21)\n@Ignore\npublic class BaseTest {\n\n public TestComponent component;\n public TestUtils testUtils;\n\n @Before\n public void setUp() throws Exception {\n... | import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.andrey7mel.stepbystep.R;
import com.andrey7mel.stepbystep.other.BaseTest;
import com.andrey7mel.stepbystep.other.TestConst;
import com.andrey7mel.stepbystep.presenter.RepoInfoPresenter;
import com.andrey7mel.stepbyst... | package com.andrey7mel.stepbystep.view.fragments;
public class RepoInfoFragmentTest extends BaseTest {
@Inject
RepoInfoPresenter repoInfoPresenter;
private RepoInfoFragment repoInfoFragment;
private Repository repository;
| private MainActivity activity; | 4 |
synapticloop/routemaster | src/main/java/synapticloop/nanohttpd/example/servant/ModulesRouteServant.java | [
"public abstract class Routable {\n\t// the route that this routable is bound to\n\tprotected String routeContext = null;\n\t// the map of option key values\n\tprotected Map<String, String> options = new HashMap<String, String>();\n\n\t/**\n\t * Create a new routable class with the bound routing context\n\t *\n\t *... | import java.io.File;
import java.util.Iterator;
import synapticloop.nanohttpd.router.Routable;
import synapticloop.nanohttpd.router.RouteMaster;
import synapticloop.nanohttpd.utils.HttpUtils;
import fi.iki.elonen.NanoHTTPD.IHTTPSession;
import fi.iki.elonen.NanoHTTPD.Response; | package synapticloop.nanohttpd.example.servant;
/*
* Copyright (c) 2013-2020 synapticloop.
*
* All rights reserved.
*
* This source code and any derived binaries are covered by the terms and
* conditions of the Licence agreement ("the Licence"). You may not use this
* source code or any derived binaries excep... | public Response serve(File rootDir, IHTTPSession httpSession) { | 3 |
goodow/realtime-channel | src/main/java/com/goodow/realtime/channel/impl/WebSocketBus.java | [
"@JsType\npublic interface Bus {\n String ON_OPEN = \"@realtime/bus/onOpen\";\n String ON_CLOSE = \"@realtime/bus/onClose\";\n String ON_ERROR = \"@realtime/bus/onError\";\n\n /**\n * Close the Bus and release all resources.\n */\n void close();\n\n /* The state of the Bus. */\n State getReadyState();\n\... | import com.goodow.realtime.channel.Bus;
import com.goodow.realtime.channel.Message;
import com.goodow.realtime.channel.State;
import com.goodow.realtime.core.Handler;
import com.goodow.realtime.core.Platform;
import com.goodow.realtime.core.WebSocket;
import com.goodow.realtime.json.Json;
import com.goodow.realtime.jso... | /*
* Copyright 2013 Goodow.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 applicable law or agreed to in wr... | public State getReadyState() { | 2 |
docbleach/DocBleach | module/module-office/src/main/java/xyz/docbleach/module/ole2/ObjectRemover.java | [
"public class BleachSession implements Serializable {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(BleachSession.class);\n private static final int MAX_ONGOING_TASKS = 10;\n private final transient Bleach bleach;\n private final Collection<Threat> threats = new ArrayList<>();\n /**\n * Co... | import java.util.Set;
import org.apache.poi.poifs.filesystem.DirectoryEntry;
import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.poifs.filesystem.Entry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import xyz.docbleach.api.BleachSession;
import xyz.docbleach.api.threat.Threat;
import... | package xyz.docbleach.module.ole2;
public class ObjectRemover extends EntryFilter {
private static final Logger LOGGER = LoggerFactory.getLogger(ObjectRemover.class);
private static final String COMPOUND_OBJECT_ENTRY = "\u0001CompObj";
private static final String OBJECT_POOL_ENTRY = "ObjectPool";
public Obj... | .severity(ThreatSeverity.HIGH) | 3 |
lrtdc/light_drtc | src/main/java/org/light/rtc/admin/AdminNodeKafkaRun.java | [
"@SuppressWarnings({\"cast\", \"rawtypes\", \"serial\", \"unchecked\"})\r\n@Generated(value = \"Autogenerated by Thrift Compiler (0.9.3)\", date = \"2016-03-16\")\r\npublic class TDssService {\r\n\r\n public interface Iface {\r\n\r\n public int addMqinfoToAdminQu(List<String> uLogs) throws org.apache.thrift.TEx... | import java.util.Timer;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TThreadPoolServer;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TServerTransport;
import org.apache.thrift.transport.TTransportExce... | package org.light.rtc.admin;
public class AdminNodeKafkaRun {
/**
* your self defending function for parsing your data stream logs
* @param slp
*/
public void setSteamParser(StreamLogParser slp){
AdminNodeTimer.setStreamLogParser(slp);
}
private class DataCollect implements Runnable{
@Override
publ... | KafkaMqCollect kmc = new KafkaMqCollect(); | 2 |
idega/com.idega.block.email | src/java/com/idega/block/email/client/presentation/MailClient.java | [
"public class EmailConstants {\n\n\tpublic static final String IW_BUNDLE_IDENTIFIER = \"com.idega.block.email\";\n\t\n\tpublic static final String MAILING_LIST_MESSAGE_RECEIVER = CoreConstants.PROP_SYSTEM_ACCOUNT;\n\t\n\tpublic static final String MULTIPART_MIXED_TYPE = \"multipart/Mixed\";\n\tpublic static final S... | import java.util.Iterator;
import java.util.Map;
import javax.faces.component.UIComponent;
import com.idega.block.email.EmailConstants;
import com.idega.block.email.business.EmailAccount;
import com.idega.block.email.client.business.EmailParams;
import com.idega.block.email.client.business.EmailSubjectPatternFinder;
im... | package com.idega.block.email.client.presentation;
/**
* Title: Description: Copyright: Copyright (c) 2001 Company:
*
* @author <br>
* <a href="mailto:aron@idega.is">Aron Birkir</a><br>
* @version 1.0
*/
public class MailClient extends Block {
private final static String prmMsgNum = "em_cl_msg_num";... | EmailSubjectPatternFinder emailFinder = ELUtil.getInstance().getBean(EmailSubjectPatternFinder.BEAN_IDENTIFIER); | 3 |
eckig/graph-editor | core/src/test/java/de/tesis/dynaware/grapheditor/core/utils/GModelUtilsTest.java | [
"public final class ConnectionCopier\n{\n\n /**\n * Static class.\n */\n private ConnectionCopier()\n {\n }\n\n /**\n * Copies connection information from one set of nodes to another.\n *\n * <p>\n * Connections between nodes in the <b>keys</b> of the input map are copied\n ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Test;
import de.tesis.dynaware.grapheditor.core.connections.ConnectionCopier;
import de.tesis.dynaware.grapheditor.m... | package de.tesis.dynaware.grapheditor.core.utils;
public class GModelUtilsTest {
@Test
public void copyConnections() {
| final List<GNode> nodes = createNodes(); | 3 |
palominolabs/benchpress | examples/multi-db/hbase/src/main/java/com/palominolabs/benchpress/example/multidb/hbase/HbaseJobTypePlugin.java | [
"public final class KeyGeneratorFactoryFactoryRegistry extends IdRegistry<KeyGeneratorFactoryFactory> {\n\n @Inject\n KeyGeneratorFactoryFactoryRegistry(Set<KeyGeneratorFactoryFactory> instances) {\n super(instances);\n }\n}",
"public final class ValueGeneratorFactoryFactoryRegistry extends IdRegi... | import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectReader;
import com.google.inject.Inject;
import com.palominolabs.benchpress.example.multidb.key.KeyGeneratorFactoryFactoryRegistry;
import com.palominolabs.benchpress.example.multidb.value.ValueGeneratorFactoryFactoryRegistry;
i... | package com.palominolabs.benchpress.example.multidb.hbase;
final class HbaseJobTypePlugin implements JobTypePlugin {
static final String TASK_TYPE = "HBASE";
private final KeyGeneratorFactoryFactoryRegistry keyGeneratorFactoryFactoryRegistry; | private final ValueGeneratorFactoryFactoryRegistry valueGeneratorFactoryFactoryRegistry; | 1 |
Qyotta/axon-eventstore | eventstore-client/src/main/java/de/qyotta/eventstore/EventStoreClient.java | [
"public interface ESContext {\n\n ESReader getReader();\n\n EventStoreSettings getSettings();\n\n ESWriter getWriter();\n\n}",
"@Getter\n@Setter\n@Builder(toBuilder = true)\n@ToString\n@EqualsAndHashCode\n@NoArgsConstructor(access = AccessLevel.PUBLIC)\n@AllArgsConstructor(access = AccessLevel.PUBLIC)\npubl... | import de.qyotta.eventstore.communication.ESContext;
import de.qyotta.eventstore.model.Event;
import de.qyotta.eventstore.utils.EventStreamReader;
import de.qyotta.eventstore.utils.EventStreamReaderImpl;
import de.qyotta.eventstore.utils.EventStreamReaderImpl.EventStreamReaderCallback;
import static de.qyotta.eventstor... | package de.qyotta.eventstore;
public class EventStoreClient {
private final ESContext context;
public EventStoreClient(ESContext context) {
this.context = context;
}
/**
* Creates a new {@link EventStreamReaderImpl}. Catch up is scheduled at the given interval. If the given interval is 0 or ... | public EventStreamReader newEventStreamReader(final String streamName, final int intervalMillis, final EventStreamReaderCallback callback) { | 4 |
bourgesl/marlin-fx | src/main/java/com/sun/marlin/DRendererContext.java | [
" public class Path2D extends Shape implements PathConsumer2D {\n\n static final int curvecoords[] = {2, 2, 4, 6, 0};\n\n public enum CornerPrefix {\n CORNER_ONLY,\n MOVE_THEN_CORNER,\n LINE_THEN_CORNER\n }\n\n /**\n * An even-odd winding rule for determining the interior... | import com.sun.marlin.DTransformingPathConsumer2D.CurveBasicMonotonizer;
import com.sun.marlin.DTransformingPathConsumer2D.CurveClipSplitter;
import com.sun.util.reentrant.ReentrantContext;
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicInteger;
import com.sun.javafx.geom.Path2D;
import co... | /*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free ... | stats.cacheStats = new CacheStats[] { cleanIntCache.stats, | 1 |
calrissian/flowmix | src/test/java/org/calrissian/flowmix/core/storm/bolt/SelectorBoltIT.java | [
"public class Flow implements Serializable{\n\n String id;\n String name;\n String description;\n\n Map<String,StreamDef> streams = new HashMap<String, StreamDef>();\n\n public String getId() {\n return id;\n }\n\n public String getName() {\n return name;\n }\n\n public Stri... | import backtype.storm.Config;
import backtype.storm.LocalCluster;
import backtype.storm.generated.StormTopology;
import org.calrissian.flowmix.api.Flow;
import org.calrissian.flowmix.api.FlowTestCase;
import org.calrissian.flowmix.api.builder.FlowBuilder;
import org.calrissian.flowmix.api.kryo.EventSerializer;
import o... | /*
* Copyright (C) 2014 The Calrissian Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | Flow flow = new FlowBuilder() | 2 |
campaignmonitor/createsend-java | src/com/createsend/Subscribers.java | [
"public class SubscriberWithJoinedDate {\r\n public String ListID;\r\n public String EmailAddress;\r\n public String Name;\r\n public Date Date;\r\n public Date ListJoinedDate;\r\n public String State; // TODO: Probably want to move this to an enum\r\n public CustomField[] CustomFields;\r\n ... | import com.createsend.util.exceptions.CreateSendException;
import com.sun.jersey.core.util.MultivaluedMapImpl;
import javax.ws.rs.core.MultivaluedMap;
import com.createsend.models.subscribers.EmailToUnsubscribe;
import com.createsend.models.subscribers.HistoryItem;
import com.createsend.models.subscribers.ImportRe... | /**
* Copyright (c) 2011 Toby Brain
*
* 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, mer... | public Subscribers(AuthenticationDetails auth, String listID) {
| 2 |
lewisd32/authrite | authrite-service/src/main/java/com/lewisd/authrite/resources/UsersResource.java | [
"public class JWTConfiguration {\n private String jwtSecret = \"secret\";\n private int jwtExpirySeconds = 3600;\n private String cookieName = \"jwtToken\";\n\n @JsonProperty\n public String getJwtSecret() {\n return jwtSecret;\n }\n\n public void setJwtSecret(final String jwtSecret) {\n... | import com.lewisd.authrite.auth.JWTConfiguration;
import com.lewisd.authrite.errors.Exceptions;
import com.lewisd.authrite.resources.model.User;
import com.lewisd.authrite.resources.requests.CreateUserRequest;
import com.lewisd.authrite.resources.requests.LoginRequest;
import com.lewisd.authrite.resources.requests.Pass... | package com.lewisd.authrite.resources;
@Path("/users")
@Produces(MediaType.APPLICATION_JSON)
public class UsersResource {
private final UsersService usersService;
private final JWTConfiguration jwtConfiguration;
@Inject
public UsersResource(final UsersService usersService, final JWTConfiguration jw... | final Optional<LoginResult> maybeResult = usersService.loginUser(email, password); | 7 |
segator/proxylive | src/main/java/com/github/segator/proxylive/controller/FrontendController.java | [
"public class ProxyLiveUtils {\n\n private static Pattern pattern = Pattern.compile(\"^(tvh|hls|dash)(s)?:\\\\/\\\\/(.+)$\");\n public static String getOS() {\n\n String OS = System.getProperty(\"os.name\").toLowerCase();\n\n if (OS.contains(\"win\")) {\n return \"win\";\n } el... | import com.github.segator.proxylive.ProxyLiveUtils;
import com.github.segator.proxylive.config.ProxyLiveConfiguration;
import com.github.segator.proxylive.entity.ApiChannel;
import com.github.segator.proxylive.entity.Channel;
import com.github.segator.proxylive.service.AuthenticationService;
import com.github.segator.p... | package com.github.segator.proxylive.controller;
@Controller
@RequestMapping("/api")
public class FrontendController {
private final Logger logger = LoggerFactory.getLogger(FrontendController.class);
private final ApplicationContext context; | private final ProxyLiveConfiguration config; | 1 |
commonsguy/cwac-netsecurity | netsecurity/src/test/java/com/commonsware/cwac/netsecurity/test/DomainMatchRuleTests.java | [
"public static DomainMatchRule allOf(DomainMatchRule... rules) {\n return(new Composite(false, rules));\n}",
"public static DomainMatchRule anyOf(DomainMatchRule... rules) {\n return(new Composite(true, rules));\n}",
"public static DomainMatchRule blacklist(String... globs) {\n List<DomainMatchRule> rules=ne... | import org.junit.Test;
import java.util.regex.Pattern;
import static com.commonsware.cwac.netsecurity.DomainMatchRule.allOf;
import static com.commonsware.cwac.netsecurity.DomainMatchRule.anyOf;
import static com.commonsware.cwac.netsecurity.DomainMatchRule.blacklist;
import static com.commonsware.cwac.netsecurity.Doma... | /***
Copyright (c) 2017 CommonsWare, 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 in writing, s... | assertTrue(allOf(is("foo.com")).matches("foo.com")); | 0 |
carlphilipp/stock-tracker | website/src/main/java/fr/cph/stock/controller/HomeController.java | [
"@Component\n@ConfigurationProperties(prefix = \"app\")\n@Data\npublic class AppProperties {\n\tprivate String name;\n\tprivate String protocol;\n\tprivate String url;\n\tprivate List<String> admins;\n\n\tprivate final Db db = new Db();\n\tprivate final Rest rest = new Rest();\n\tprivate final Dropbox dropbox = new... | import javax.validation.Valid;
import java.util.Calendar;
import static fr.cph.stock.util.Constants.*;
import fr.cph.stock.config.AppProperties;
import fr.cph.stock.entities.Portfolio;
import fr.cph.stock.entities.User;
import fr.cph.stock.enumtype.Currency;
import fr.cph.stock.exception.NotFoundException;
import fr.cp... | /**
* Copyright 2017 Carl-Philipp Harmant
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable... | @Valid @ModelAttribute final User user, | 2 |
CodeCrafter47/BungeeTabListPlus | bungee/src/main/java/codecrafter47/bungeetablistplus/command/CommandDebug.java | [
"public class BungeeTabListPlus {\n\n /**\n * Holds an INSTANCE of itself if the plugin is enabled\n */\n private static BungeeTabListPlus INSTANCE;\n @Getter\n private final Plugin plugin;\n\n public PlayerProvider playerProvider;\n @Getter\n private EventExecutor mainThreadExecutor;\n... | import codecrafter47.bungeetablistplus.BungeeTabListPlus;
import codecrafter47.bungeetablistplus.command.util.CommandBase;
import codecrafter47.bungeetablistplus.command.util.CommandExecutor;
import codecrafter47.bungeetablistplus.data.BTLPBungeeDataKeys;
import codecrafter47.bungeetablistplus.player.BungeePlayer;
impo... | /*
* Copyright (C) 2020 Florian Stober
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
*... | BungeePlayer player = btlp.getBungeePlayerProvider().getPlayerIfPresent(target); | 4 |
x7hub/Calendar_lunar | src/edu/bupt/calendar/agenda/AgendaWindowAdapter.java | [
"public class CalendarController {\n private static final boolean DEBUG = false;\n private static final String TAG = \"CalendarController\";\n private static final String REFRESH_SELECTION = Calendars.SYNC_EVENTS + \"=?\";\n private static final String[] REFRESH_ARGS = new String[] { \"1\" };\n priva... | import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.res.Resources;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;
import android.provider.CalendarContract;
import ... | /*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | mTimeZone = Utils.getTimeZone(mContext, this); | 4 |
kaif-open/kaif-android | app/src/androidTest/java/io/kaif/mobile/view/daemon/ArticleDaemonTest.java | [
"public class Article implements Serializable {\n\n public enum ArticleType {\n EXTERNAL_LINK, SPEAK\n }\n\n private final String zone;\n\n private final String zoneTitle;\n\n private final String articleId;\n\n private final String title;\n\n private final Date createTime;\n\n private final String link;... | import static java.util.Arrays.asList;
import static org.mockito.Mockito.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import android.test.AndroidTestCase;
import io.kaif.mobile.model.Article;
import io.ka... | package io.kaif.mobile.view.daemon;
public class ArticleDaemonTest extends AndroidTestCase implements ModelFixture {
@Mock
private ArticleService mockArticleService;
@Mock
private VoteService mockVoteService;
@Mock
private DebateService mockDebateService;
private ArticleDaemon daemon;
@Overrid... | assertTrue(e.getCause() instanceof DuplicateArticleUrlException); | 2 |
dmfs/uri-toolkit | rfc3986-uri/src/test/java/org/dmfs/rfc3986/uris/TextTest.java | [
"public final class EncodedAuthority implements Authority, Parsed\n{\n private final UriEncoded mAuthority;\n private OptionalLazyUserInfo mUserInfo;\n private UriEncoded mHost;\n private Optional<Integer> mPort;\n private int mEnd;\n\n\n public EncodedAuthority(UriEncoded authority)\n {\n ... | import org.dmfs.rfc3986.authorities.EncodedAuthority;
import org.dmfs.rfc3986.encoding.Precoded;
import org.dmfs.rfc3986.fragments.SimpleFragment;
import org.dmfs.rfc3986.paths.EncodedPath;
import org.dmfs.rfc3986.queries.SimpleQuery;
import org.dmfs.rfc3986.schemes.StringScheme;
import org.junit.Test;
import static or... | /*
* Copyright 2017 dmfs 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 applicable law or agreed to in... | new StructuredUri(new StringScheme("http"), new EncodedAuthority(new Precoded("example.com")), new EncodedPath(new Precoded("/test")), | 5 |
KoperGroup/koper | koper-dataevent/src/main/java/koper/event/DataEventMessageDispatcher.java | [
"public class DefaultMessageDispatcher implements MessageDispatcher {\n\n private static Logger log = LoggerFactory.getLogger(DefaultMessageDispatcher.class);\n\n private ListenerRegistry listenerRegistry;\n\n private MessageCenter messageCenter;\n\n private BlockingQueue<MsgBean> mailBox;\n\n @Overr... | import java.util.Optional;
import com.alibaba.fastjson.JSON;
import koper.DefaultMessageDispatcher;
import koper.Listen;
import koper.MsgBean;
import koper.MsgBeanListener;
import koper.convert.ConverterCenter;
import koper.util.ReflectUtil;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import or... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | if (listener.getClass().getAnnotation(Listen.class) != null || listener instanceof MsgBeanListener) { | 2 |
csf-ngs/fastqc | uk/ac/bbsrc/babraham/FastQC/Modules/PerSequenceGCContent.java | [
"public class LineGraph extends JPanel {\r\n\r\n\tprivate String [] xTitles;\r\n\tprivate String xLabel;\r\n\tprivate String [] xCategories;\r\n\tprivate double [][] data;\r\n\tprivate String graphTitle;\r\n\tprivate double minY;\r\n\tprivate double maxY;\r\n\tprivate double yInterval;\r\n\tprivate int height = -1;... | import uk.ac.bbsrc.babraham.FastQC.Modules.GCModel.GCModel;
import uk.ac.bbsrc.babraham.FastQC.Modules.GCModel.GCModelValue;
import uk.ac.bbsrc.babraham.FastQC.Report.HTMLReportArchive;
import uk.ac.bbsrc.babraham.FastQC.Sequence.Sequence;
import uk.ac.bbsrc.babraham.FastQC.Statistics.NormalDistribution;
import ja... | /**
* Copyright Copyright 2010-11 Simon Andrews
*
* This file is part of FastQC.
*
* FastQC 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
* ... | return new LineGraph(new double [][] {gcDistribution,theoreticalDistribution}, 0d, max, "Mean GC content (%)", new String [] {"GC count per read","Theoretical Distribution"}, xCategories, "GC distribution over all sequences");
| 0 |
kpavlov/fixio | core/src/test/java/fixio/FixConversationIT.java | [
"public enum DataType {\n INT,\n CHAR,\n MULTIPLECHARVALUE,\n STRING,\n FLOAT,\n BOOLEAN,\n AMT,\n QTY,\n PRICE,\n PRICEOFFSET,\n SEQNUM,\n LENGTH,\n NUMINGROUP,\n MONTHYEAR,\n UTCTIMESTAMP,\n UTCDATEONLY,\n UTCTIMEONLY,\n PERCENTAGE,\n CURRENCY,\n COUNTRY... | import fixio.events.LogonEvent;
import fixio.fixprotocol.DataType;
import fixio.fixprotocol.FixMessage;
import fixio.fixprotocol.FixMessageBuilder;
import fixio.fixprotocol.FixMessageBuilderImpl;
import fixio.fixprotocol.MessageTypes;
import fixio.handlers.FixApplicationAdapter;
import fixio.netty.pipeline.InMemorySess... | /*
* Copyright 2014 The FIX.io Project
*
* The FIX.io Project 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
*
* Unles... | FixMessageBuilder userRequest = new FixMessageBuilderImpl(MessageTypes.USER_REQUEST); | 3 |
KasperFranz/BetterChunkLoader | src/main/java/guru/franz/mc/bcl/datastore/DatabaseDataStore.java | [
"@Plugin(id = BetterChunkLoaderPluginInfo.ID,\n name = BetterChunkLoaderPluginInfo.NAME,\n description = BetterChunkLoaderPluginInfo.DESCRIPTION,\n version = BetterChunkLoaderPluginInfo.VERSION,\n authors = BetterChunkLoaderPluginInfo.AUTHORS\n)\npublic class BetterChunkLoader {\n\n p... | import guru.franz.mc.bcl.BetterChunkLoader;
import guru.franz.mc.bcl.config.Config;
import guru.franz.mc.bcl.datastore.database.DatabaseInterface;
import guru.franz.mc.bcl.datastore.exceptions.MySQLConnectionException;
import guru.franz.mc.bcl.exception.Exception;
import guru.franz.mc.bcl.exception.NegativeValueExcepti... | package guru.franz.mc.bcl.datastore;
public abstract class DatabaseDataStore extends AHashMapDataStore {
protected DatabaseInterface database;
public void load() throws MySQLConnectionException { | String serverName = Config.getInstance().getServerName(); | 1 |
NickToony/scrAI | src/main/java/com/nicktoony/scrAI/Managers/EnergyManager.java | [
"public class Lodash {\n public static void forIn(Object object, LodashCallback iteratee, Object bind) {\n\n };\n\n public static Array<?> sortBy(Object collection, LodashSortCallback iteratee, Object bind) {\n return null;\n };\n}",
"@JavascriptFunction\npublic interface LodashCallback1<T> ext... | import com.nicktoony.helpers.Lodash;
import com.nicktoony.helpers.LodashCallback1;
import com.nicktoony.scrAI.Controllers.RoomController;
import com.nicktoony.scrAI.World.Tasks.TaskPickupEnergy;
import com.nicktoony.screeps.Energy;
import com.nicktoony.screeps.global.FindTypes;
import com.nicktoony.screeps.global.Globa... | package com.nicktoony.scrAI.Managers;
/**
* Created by nick on 26/07/15.
*/
public class EnergyManager extends Manager {
public EnergyManager(RoomController roomController, Map<String, Object> memory) {
super(roomController, memory);
}
@Override
protected void init() {
}
public vo... | Array<Energy> foundEnergy = (Array<Energy>) this.roomController.getRoom().find(FindTypes.FIND_DROPPED_ENERGY, | 4 |
msoute/vertx-deploy-tools | vertx-deploy-agent/src/main/java/nl/jpoint/vertx/deploy/agent/service/DeployApplicationService.java | [
"public class DeployConfig {\n\n private static final Logger LOG = LoggerFactory.getLogger(AwsDeployApplication.class);\n\n private static final String MAVEN_CENTRAL = \"https://repo1.maven.org/maven/\";\n private static final String DEFAULT_SERVICE_CONFIG_LOCATION = \"/etc/default/\";\n\n private stati... | import io.vertx.core.Vertx;
import io.vertx.rxjava.core.file.FileSystem;
import nl.jpoint.vertx.deploy.agent.DeployConfig;
import nl.jpoint.vertx.deploy.agent.command.RunApplication;
import nl.jpoint.vertx.deploy.agent.command.StopApplication;
import nl.jpoint.vertx.deploy.agent.request.DeployApplicationRequest;
import... | package nl.jpoint.vertx.deploy.agent.service;
public class DeployApplicationService implements DeployService<DeployApplicationRequest, DeployApplicationRequest> {
private static final Logger LOG = LoggerFactory.getLogger(DeployApplicationService.class);
private final DeployConfig config;
private final V... | StopApplication stopApplicationCommand = new StopApplication(vertx, config); | 2 |
evgeniyosipov/facshop | facshop-store/src/main/java/ru/evgeniyosipov/facshop/store/web/AdministratorController.java | [
"@Stateless\npublic class AdministratorBean extends AbstractFacade<Administrator> {\n\n @PersistenceContext(unitName = \"facshopPU\")\n private EntityManager em;\n\n private boolean lastAdministrator;\n\n @Override\n protected EntityManager getEntityManager() {\n return em;\n }\n\n publi... | import ru.evgeniyosipov.facshop.store.ejb.AdministratorBean;
import ru.evgeniyosipov.facshop.entity.Administrator;
import ru.evgeniyosipov.facshop.store.web.util.AbstractPaginationHelper;
import ru.evgeniyosipov.facshop.store.web.util.JsfUtil;
import ru.evgeniyosipov.facshop.store.web.util.PageNavigation;
import java.i... | package ru.evgeniyosipov.facshop.store.web;
@Named(value = "administratorController")
@SessionScoped
public class AdministratorController implements Serializable {
private static final String BUNDLE = "bundles.Bundle";
private static final long serialVersionUID = -2691147357609941284L;
private Administr... | private AbstractPaginationHelper pagination; | 2 |
TerryHowe/SIP-Voice-Quality-Report-Reaper | test/com/tt/reaper/call/TestStateTerminating.java | [
"public class Reaper {\n\tprivate static boolean initialized = false;\n\tpublic static Reaper instance = new Reaper();\n\t\n\tprivate Reaper() {\n\t}\n\n\tpublic synchronized void init() {\n\t\tif (initialized == true)\n\t\t\treturn;\n\t\tinitialized = true;\n\t\tReaperLogger.init();\n\t\tCollectorManager.instance.... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Date;
import org.junit.Before;
import org.junit.Test;
import com.tt.reaper.Reaper;
import com.tt.reaper.message.TestMessageFactory;
import com.tt.reaper.message.TestRtpPacket;
import com.... | package com.tt.reaper.call;
public class TestStateTerminating {
CallContext context;
Date remoteEndTime;
private String getExpectedData(double packetLoss) {
return
"VQSessionReport : CallTerm\r\n" +
"LocalMetrics:\r\n" +
"SessionDesc:PT=0 PD=pcmu SR=8000\r\n" + | "Timestamps:START=" + Metrics.formatDate(context.startTime) + " STOP=" + Metrics.formatDate(context.endTime) + "\r\n" + | 5 |
pangliang/MirServer-Netty | GameServer/src/main/java/com/zhaoxiaodan/mirserver/gameserver/handler/MagicKeyChangeHandler.java | [
"public class DB {\n\n\tprivate static SessionFactory ourSessionFactory;\n\tprivate static ServiceRegistry serviceRegistry;\n\n\tpublic static void init() throws Exception {\n\t\tConfiguration configuration = new Configuration();\n\t\tconfiguration.configure();\n\n\t\tserviceRegistry = new StandardServiceRegistryB... | import com.zhaoxiaodan.mirserver.db.DB;
import com.zhaoxiaodan.mirserver.gameserver.entities.Player;
import com.zhaoxiaodan.mirserver.gameserver.entities.PlayerMagic;
import com.zhaoxiaodan.mirserver.gameserver.GameClientPackets;
import com.zhaoxiaodan.mirserver.network.packets.ClientPacket; | package com.zhaoxiaodan.mirserver.gameserver.handler;
public class MagicKeyChangeHandler extends PlayerHandler {
@Override | public void onPacket(ClientPacket packet, Player player) throws Exception { | 1 |
cloudera/flume | flume-core/src/main/java/com/cloudera/flume/handlers/debug/ConsoleEventSink.java | [
"public class Context {\n Map<String, Object> table = new HashMap<String, Object>();\n final Context parent;\n\n final public static Context EMPTY = new Context(null);\n\n public Context(Context parent) {\n this.parent = parent;\n }\n\n /**\n * This should only be used rarely. You probably want\n * Log... | import com.cloudera.flume.handlers.text.output.DebugOutputFormat;
import com.cloudera.flume.handlers.text.output.OutputFormat;
import com.google.common.base.Preconditions;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cloudera.flume.conf.Context;
import com.cloudera.flu... | /**
* Licensed to Cloudera, Inc. under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Cloudera, Inc. licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use th... | public void append(Event e) throws IOException, InterruptedException { | 3 |
ltettoni/logic2j | src/main/java/org/logic2j/core/api/model/TermApiExt.java | [
"public interface TermAdapter {\n\n enum FactoryMode {\n /**\n * Result will always be an atom (a {@link Struct} of 0-arity), will never be a {@link Var}iable.\n * In the case of null, will create an empty-string atom.\n */\n ATOM,\n\n /**\n * Result will be either an atom (a {@link Struct... | import static java.lang.Math.max;
import static java.lang.Math.min;
import static org.logic2j.engine.model.Var.strVar;
import java.util.List;
import java.util.function.Function;
import org.logic2j.core.api.TermAdapter;
import org.logic2j.core.api.TermAdapter.FactoryMode;
import org.logic2j.core.api.TermUnmarshaller;
im... | if (!functor.isEmpty()) {
// Make sure the root name matches the struct at level 0
if (!s.getName().equals(functor)) {
throw new InvalidTermException("Term \"" + theTerm + "\" does not start with functor \"" + functor + '"');
}
}
if (position >= 1) {
final String levelsTail ... | return valueOf(theObject, TermAdapter.FactoryMode.ANY_TERM); | 1 |
michaelliao/warpdb | src/test/java/com/itranswarp/warpdb/WarpDbConfigTest.java | [
"@Entity\npublic class DupColNameEntity {\n\n\t@Id\n\tpublic long id;\n\n\t@Column(length = 100, nullable = false, updatable = false)\n\tpublic String email;\n\n\t@Column(name = \"Email\", length = 100, nullable = false, updatable = false)\n\tpublic String mailAddress;\n\n\t@Version\n\t@Column(nullable = false)\n\t... | import java.util.Arrays;
import org.junit.Test;
import com.itranswarp.warpdb.invalid.dupcol.DupColNameEntity;
import com.itranswarp.warpdb.invalid.dupprop.DupPropNameEntity;
import com.itranswarp.warpdb.invalid.duptable.DupTableNameEntity;
import com.itranswarp.warpdb.invalid.missingid.MissingIdEntity;
import com.itran... | package com.itranswarp.warpdb;
public class WarpDbConfigTest {
@Test(expected = ConfigurationException.class)
public void testInvalidForMissingId() {
WarpDb warpdb = new WarpDb();
warpdb.basePackages = Arrays.asList(MissingIdEntity.class.getPackage().getName());
warpdb.init();
}
@Test(expected = Configu... | warpdb.basePackages = Arrays.asList(MultiPreUpdateEntity.class.getPackage().getName()); | 5 |
5GSD/AIMSICDL | AIMSICD/src/main/java/zz/aimsicd/lite/ui/fragments/CellInfoFragment.java | [
"public class BaseInflaterAdapter<T> extends BaseAdapter {\n\n private final List<T> m_items = new ArrayList<>();\n\n private IAdapterViewInflater<T> m_viewInflater;\n\n public BaseInflaterAdapter(IAdapterViewInflater<T> viewInflater) {\n m_viewInflater = viewInflater;\n }\n\n public BaseInfla... | import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.text.TextUtils;
import android.view.View;
import andr... | /* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project
* -----------------------------------------------------------
* LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o
* -----------------------------------------------------------
*/
/* This was introduced by Aussie in the Pull Request Commit: ... | private BaseInflaterAdapter<CardItemData> mBaseInflaterAdapter; | 1 |
softwarespartan/TWS | src/apidemo/TicketDlg.java | [
"public class HtmlButton extends JLabel {\n\tstatic Color light = new Color( 220, 220, 220);\n\t\n\tprivate String m_text;\n\tprotected boolean m_selected;\n\tprivate ActionListener m_al;\n\tprivate Color m_bg = getBackground();\n\n\tpublic boolean isSelected() { return m_selected; }\n\t\n\tpublic void setSelected(... | import static com.ib.controller.Formats.fmt;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Box;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
imp... | /* Copyright (C) 2013 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
* and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. */
package apidemo;
public class TicketDlg extends JDialog {
private boolean m_editContract;
private fin... | NewTabbedPanel tabbedPanel = new NewTabbedPanel(true); | 1 |
vmi/indylisp | src/test/java/jp/vmi/indylisp/importer/ImporterTest.java | [
"public class Engine {\n\n public static final String NAMESPACE = \"Engine\";\n\n private static final Class<?>[] DEFAULT_IMPORTS = {\n Nil.class,\n Cell.class,\n StringWrapper.class,\n NumberWrapper.class,\n BufferedReaderWrapper.class,\n PrintStreamWrapper.class,\n ... | import java.math.BigDecimal;
import org.junit.Test;
import jp.vmi.indylisp.Engine;
import jp.vmi.indylisp.bindings.BoundEntry;
import jp.vmi.indylisp.objects.IndyObject;
import jp.vmi.indylisp.objects.JavaMethod;
import jp.vmi.indylisp.objects.NumberWrapper;
import jp.vmi.indylisp.objects.StringWrapper;
import static j... | package jp.vmi.indylisp.importer;
public class ImporterTest {
@Test
public void testImportMethods() {
Engine engine = Engine.newInstance();
NumberWrapper a = NumberWrapper.getInstance(1);
NumberWrapper b = NumberWrapper.getInstance(10);
BoundEntry entry = engine.getCurrentB... | StringWrapper sa = (StringWrapper) StringWrapper.getInstance("[%s]"); | 5 |
Doctoror/Pure-File-Manager | purefm/src/main/java/com/docd/purefm/operations/DeleteOperation.java | [
"public final class Environment {\n \n private Environment() {}\n\n @NonNull\n private static final ActivityMonitorListener sActivityMonitorListener = new ActivityMonitorListener();\n\n @NonNull\n public static final File sRootDirectory = File.listRoots()[0];\n\n @NonNull\n public static fin... | import android.content.Context;
import android.util.Log;
import com.docd.purefm.Environment;
import com.docd.purefm.commandline.CommandLine;
import com.docd.purefm.commandline.CommandRemove;
import com.docd.purefm.commandline.ShellHolder;
import com.docd.purefm.file.CommandLineFile;
import com.docd.purefm.file.FileObse... | /*
* Copyright 2014 Yaroslav Mytkalyk
* 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... | if (!ShellHolder.getInstance().hasShell()) { | 3 |
berict/Tapad | app/src/main/java/com/bedrock/padder/activity/LauncherActivity.java | [
"@TargetApi(14)\npublic class AnimateHelper {\n private WindowHelper window = new WindowHelper();\n\n static String TAG = \"AnimateHelper\";\n\n // Fade animations\n\n public static String getViewId(View view) {\n String name = view.toString();\n return name.substring(name.lastIndexOf(\"/\... | import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.bedrock.padder.R;
import com.bedrock.padder.helper.AnimateHelper;
import com.bedrock.padder.helper.IntentHelper;
import com.bedrock.padder.helper.Toolbar... | package com.bedrock.padder.activity;
public class LauncherActivity extends AppCompatActivity {
private AnimateHelper anim = new AnimateHelper();
private IntentHelper intent = new IntentHelper();
private WindowHelper window = new WindowHelper(); | private ToolbarHelper toolbar = new ToolbarHelper(); | 2 |
idega/com.idega.cluster | src/java/com/idega/cluster/net/pipe/ApplicationPeerGroupPipe.java | [
"public class JxtaConfigSettings {\n\t\n\tpublic static final String COM_IDEGA_CLUSTER_LOG4J_LEVEL = \"log4jLevel_com.idega.cluster_net.jxta\";\n\t\n\t//how to configure the JXTA client\n\t\n\t// step 1\n\t// if true the system looks up an existing one in jxta home else go to step 2\n\tpublic static final boolean U... | import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.log4j.Logger;
import net.jxta.discovery.DiscoveryService;
import net.jxta.endpoint.Message;
import net.jxta.endpoint.MessageElement;
import... | /*
* $Id: ApplicationPeerGroupPipe.java,v 1.6 2007/05/07 14:07:17 thomas Exp $
* Created on Dec 21, 2006
*
* Copyright (C) 2006 Idega Software hf. All Rights Reserved.
*
* This software is the proprietary information of Idega hf.
* Use is subject to license terms.
*/
package com.idega.cluster.net.pipe;
publi... | MessageListener messageListener = (MessageListener) iterator.next(); | 3 |
R2RML-api/R2RML-api | r2rml-api-rdf4j-binding/src/test/java/rdf4jTest/NTriplesSyntax_Test.java | [
"public class RDF4JR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static RDF4JR2RMLMappingManager INSTANCE = new RDF4JR2RMLMappingManager(new RDF4J());\n\n private RDF4JR2RMLMappingManager(RDF4J rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import eu.optique.r2rml.api.binding.rdf4j.RDF4JR2RMLMappingManager;
import eu.optique.r2rml.api.model.impl.SQLBaseTableOrViewImpl;
import org.apache.commons.rdf.api.IRI;
import org.junit.Assert;
import org.junit.Test;
import org... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | SubjectMap s=current.getSubjectMap();
| 6 |
Samistine/BloodMoon | src/main/java/uk/co/jacekk/bukkit/bloodmoon/feature/mob/MaxHealthListener.java | [
"public final class BloodMoon extends BasePlugin {\n\n public static boolean DEBUG = false;\n\n private ArrayList<String> activeWorlds;\n private HashMap<String, PluginConfig> worldConfig;\n protected ArrayList<String> forceWorlds;\n\n @Override\n public void onEnable() {\n super.onEnable(t... | import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.metadata.FixedMetadataValue;
import uk.co.j... | package uk.co.jacekk.bukkit.bloodmoon.feature.mob;
public class MaxHealthListener implements Listener {
private final BloodMoon plugin;
private final String metaKey = "Bloodmoon-" + getClass().getSimpleName();
public MaxHealthListener(BloodMoon plugin) {
this.plugin = plugin;
}
@EventH... | if (worldConfig.getStringList(Config.FEATURE_MAX_HEALTH_MOBS).contains(entity.getType().name())) { | 1 |
LyashenkoGS/analytics4github | src/test/java/com/rhcloud/analytics4github/service/UniqueContributorsServiceTest.java | [
"@SpringBootApplication\npublic class TestApplicationContext {\n\n public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }\n\n}",
"public class Author {\n private final String name;\n private final String email;\n\n /**\n * @param name represent au... | import com.fasterxml.jackson.databind.JsonNode;
import com.rhcloud.analytics4github.TestApplicationContext;
import com.rhcloud.analytics4github.domain.Author;
import com.rhcloud.analytics4github.dto.RequestFromFrontendDto;
import com.rhcloud.analytics4github.dto.ResponceForFrontendDto;
import com.rhcloud.analytics4gith... | package com.rhcloud.analytics4github.service;
/**
* @author lyashenkogs.
*/
@RunWith(SpringRunner.class)
@ActiveProfiles("test") | @SpringBootTest(classes = TestApplicationContext.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | 0 |
bit-man/SwissArmyJavaGit | javagit/src/main/java/edu/nyu/cs/javagit/client/cli/CliGitBranch.java | [
"public final class JavaGitConfiguration {\n\n /*\n * The path to our git binaries. Default to null, which means that the git command is available\n * via the system PATH environment variable.\n */\n private static File gitPath = null;\n\n /*\n * The version string fpr the locally-installed git binaries.... | import edu.nyu.cs.javagit.client.IGitBranch;
import edu.nyu.cs.javagit.utilities.CheckUtilities;
import edu.nyu.cs.javagit.utilities.ExceptionMessageMap;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import edu.nyu.cs.javagit.api.Ja... | /*
* ====================================================================
* Copyright (c) 2008 JavaGit Project. All rights reserved.
*
* This software is licensed using the GNU LGPL v2.1 license. A copy
* of the license is included with the distribution of this source
* code in the LICENSE.txt file. The text o... | cmd.add(JavaGitConfiguration.getGitCommand()); | 0 |
MFlisar/StorageManager | lib/src/main/java/com/michaelflisar/storagemanager/MediaStoreUpdateManager.java | [
"public class MediaStoreFileData\n{\n private StorageDefinitions.MediaType mType;\n\n // MediaStore\n private Uri mUri;\n private long mId;\n private String mName;\n private String mData;\n private long mDateTaken;\n private long mDateModified;\n private String mMimeType;\n private int... | import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.location.Location;
import com.michaelflisar.storagemanager.data.MediaStoreFileData;
import com.michaelflisar.storagemanager.exceptions.StorageException;
import com.michaelflisar.storagemanager.files.StorageFile... | package com.michaelflisar.storagemanager;
/**
* Created by flisar on 07.03.2016.
*/
public class MediaStoreUpdateManager
{
private static MediaStoreUpdateManager INSTANCE = null;
public static MediaStoreUpdateManager get()
{
if (INSTANCE == null)
INSTANCE = new MediaStoreUpdateMan... | operations.add(MediaStoreUtil.deleteOperation(mediaType, path)); | 5 |
Samistine/BloodMoon | src/main/java/uk/co/jacekk/bukkit/bloodmoon/feature/mob/ZombieWeaponListener.java | [
"public final class BloodMoon extends BasePlugin {\n\n public static boolean DEBUG = false;\n\n private ArrayList<String> activeWorlds;\n private HashMap<String, PluginConfig> worldConfig;\n protected ArrayList<String> forceWorlds;\n\n @Override\n public void onEnable() {\n super.onEnable(t... | import java.util.Random;
import java.util.logging.Level;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event... | package uk.co.jacekk.bukkit.bloodmoon.feature.mob;
public class ZombieWeaponListener implements Listener {
private final BloodMoon plugin;
private final Random random = new Random();
public ZombieWeaponListener(BloodMoon plugin) {
this.plugin = plugin;
}
private void giveWeapon(Living... | if (plugin.isFeatureEnabled(world, Feature.ZOMBIE_WEAPON)) { | 2 |
jgilfelt/Novocation | core/src/main/java/com/novoda/location/locator/DefaultLocator.java | [
"public interface Constants {\n\t\n boolean USE_GPS = true;\n boolean REFRESH_DATA_ON_LOCATION_CHANGED = true;\n boolean ENABLE_PASSIVE_UPDATES = false;\n \n int UPDATES_MAX_DISTANCE = 100;\n long UPDATES_MAX_TIME = 5 * 60 * 1000;\n\t\n long DEFAULT_INTERVAL_PASSIVE = 15 * 60 * 1000;\n\tint DEF... | import com.novoda.location.Constants;
import com.novoda.location.Locator;
import com.novoda.location.LocatorSettings;
import com.novoda.location.exception.NoProviderAvailable;
import com.novoda.location.provider.LocationProviderFactory;
import com.novoda.location.provider.LocationUpdateManager;
import com.novoda.locati... | /**
* Copyright 2011 Novoda Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | } catch (NoProviderAvailable npa) { | 3 |
raj10071997/Alexa-Voice-Service | app/src/main/java/com/game/dhanraj/myownalexa/MainActivity.java | [
"public class CodeVerifierandChallengeMethods {\r\n\r\n public static String generateCodeVerifier() {\r\n byte[] randomOctetSequence = generateRandomOctetSequence();\r\n String codeVerifier = base64UrlEncode(randomOctetSequence);\r\n return codeVerifier;\r\n }\r\n\r\n public static S... | import android.app.ActivityManager;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.provider.Settings;
import android.support.design.widget.Snackb... | package com.game.dhanraj.myownalexa;
//The authorization code changes everytime you open the app for the first time so you have to get the authorization code everytime you login till your access
public class MainActivity extends AppCompatActivity {
//Fill in the Device type ID here or Application type ID
... | private CircleImageView Loginbtn; | 3 |
Bpazy/finalspeed | src/main/java/net/fs/rudp/Route.java | [
"public class CapEnv {\n\n private final int COUNT = -1;\n private final int READ_TIMEOUT = 1;\n private final int SNAPLEN = 10 * 1024;\n public MacAddress gateway_mac;\n public MacAddress local_mac;\n public PcapHandle sendHandle;\n public boolean tcpEnable = false;\n public boolean fwSucce... | import net.fs.cap.CapEnv;
import net.fs.cap.VDatagramSocket;
import net.fs.rudp.message.MessageType;
import net.fs.utils.ByteIntConvert;
import net.fs.utils.MLog;
import net.fs.utils.MessageCheck;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAd... | package net.fs.rudp;
public class Route {
public static ThreadPoolExecutor es;
public static int mode_server = 2;
public static int mode_client = 1;
public static int localDownloadSpeed, localUploadSpeed;
private static List<Trafficlistener> listenerList = new Vector<>();
stat... | MLog.info("Listen udp port: " + CapEnv.toUnsigned(routePort));
| 4 |
guillaume-alvarez/ShapeOfThingsThatWere | core/src/com/galvarez/ttw/rendering/InfluenceRenderSystem.java | [
"public final class InfluenceSource extends Component {\n\n private float power = InfluenceSystem.INITIAL_POWER;\n\n /** In per mille. */\n public int growth;\n\n /** Usually compared to power. */\n public int health = InfluenceSystem.INITIAL_POWER;\n\n public final Set<MapPosition> influencedTiles = new Hash... | import static java.lang.Math.min;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.utils.Immutabl... | package com.galvarez.ttw.rendering;
@Wire
public final class InfluenceRenderSystem extends AbstractRendererSystem {
private ComponentMapper<Empire> empires;
private final GameMap map;
private final EnumMap<Border, AtlasRegion> borderTexture = new EnumMap<>(Border.class);
private final AtlasRegion blank;... | super(with(InfluenceSource.class), camera, batch); | 0 |
antonyms/AntonymPipeline | src/edu/antonym/develtest/CheckLinearVectorMetric.java | [
"public class NormalizedTextFileEmbedding extends TextFileEmbedding implements NormalizedVectorEmbedding {\n\n\tpublic NormalizedTextFileEmbedding(File f, Vocabulary vocab)\n\t\t\tthrows FileNotFoundException {\n\t\tsuper(f, vocab);\n\t\t\n\t\t//Normalize embeddings\n\t\tfor (int i = 0; i < embeddings.length; i++) ... | import java.io.File;
import java.io.FileNotFoundException;
import java.util.Random;
import cc.mallet.optimize.tests.TestOptimizable;
import edu.antonym.NormalizedTextFileEmbedding;
import edu.antonym.SimpleThesaurus;
import edu.antonym.SimpleVocab;
import edu.antonym.metric.LinearVectorMetric;
import edu.antonym.nn.tra... | package edu.antonym.develtest;
public class CheckLinearVectorMetric {
public static void main(String[] args) throws FileNotFoundException {
Vocabulary vocab = new SimpleVocab(new File("data/huangvocab.txt"));
Thesaurus th = new SimpleThesaurus(vocab,
new File("data/simplesyn.txt"), new File("data/simpleant.... | NormalizedVectorEmbedding origEmbed = new NormalizedTextFileEmbedding( | 0 |
Lambda-3/DiscourseSimplification | src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/rules/PurposePostExtractor.java | [
"public enum Relation {\n\n UNKNOWN,\n\n // Coordinations\n UNKNOWN_COORDINATION, // the default for coordination\n CONTRAST,\n CAUSE_C,\n RESULT_C,\n LIST,\n DISJUNCTION,\n TEMPORAL_AFTER_C,\n TEMPORAL_BEFORE_C,\n\n // Subordinations\n UNKNOWN_SUBORDINATION, // the default for s... | import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeExtractionUtils;
import org.lambda3.text.simplification.discourse.utils.words.WordsUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import edu.stanford.nlp.ling.Word;
import edu.stanfor... | /*
* ==========================License-Start=============================
* DiscourseSimplification : EnablementPostExtractor
*
* Copyright © 2017 Lambda³
*
* GNU General Public License 3
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public Licens... | leftConstituentWords.addAll(ParseTreeExtractionUtils.getPrecedingWords(leaf.getParseTree(), matcher.getNode("s"), false)); | 5 |
haogefeifei/odoo-mobile-building | app/src/main/java/com/haogefeifei/odoo/service/UserServiceImpl.java | [
"public class OdooApi implements RpcApiInf{\n\n private static String TAG = \"OdooApi\";\n\n private static OdooApi instance = new OdooApi();\n\n public URL mUrl;\n private OdooConnect conn; //XML-RPC连接对象\n private HashMap<String, Object> contexts ; //上下文\n\n public static OdooApi getInstance() {... | import com.haogefeifei.odoo.api.OdooApi;
import com.haogefeifei.odoo.api.inf.OdooRpcException;
import com.haogefeifei.odoo.api.inf.RpcApiInf;
import com.haogefeifei.odoo.entity.User;
import com.haogefeifei.odoo.service.inf.UserServiceInf;
import java.util.HashMap; | package com.haogefeifei.odoo.service;
/**
* 用户业务实现接口
* Created by feifei on 15/12/28.
*/
public class UserServiceImpl implements UserServiceInf {
private static String TAG = "UserServiceImpl";
| private RpcApiInf rpc; | 2 |
pangliang/MirServer-Netty | LoginServer/src/main/java/com/zhaoxiaodan/mirserver/loginserver/handlers/QueryCharacterHandler.java | [
"public class DB {\n\n\tprivate static SessionFactory ourSessionFactory;\n\tprivate static ServiceRegistry serviceRegistry;\n\n\tpublic static void init() throws Exception {\n\t\tConfiguration configuration = new Configuration();\n\t\tconfiguration.configure();\n\n\t\tserviceRegistry = new StandardServiceRegistryB... | import com.zhaoxiaodan.mirserver.db.DB;
import com.zhaoxiaodan.mirserver.gameserver.entities.User;
import com.zhaoxiaodan.mirserver.loginserver.LoginClientPackets;
import com.zhaoxiaodan.mirserver.loginserver.LoginServerPackets;
import com.zhaoxiaodan.mirserver.network.Handler;
import com.zhaoxiaodan.mirserver.network.... | package com.zhaoxiaodan.mirserver.loginserver.handlers;
/**
* +-------------------------------------------------+
* | 0 1 2 3 4 5 6 7 8 9 a b c d e f |
* +--------+-------------------------------------------------+----------------+
* |00000000| 01 00 00 00 08 02 00 00 01 00 00 00 2a c5 d6 c1 |...... | session.sendPacket(new ServerPacket(Protocol.SM_CERTIFICATION_FAIL)); | 7 |
daneren2005/Subsonic | app/src/main/java/github/daneren2005/dsub/util/UpdateHelper.java | [
"public class DownloadFile implements BufferFile {\n private static final String TAG = DownloadFile.class.getSimpleName();\n private static final int MAX_FAILURES = 5;\n private final Context context;\n private final MusicDirectory.Entry song;\n private final File partialFile;\n private final File... | import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.View;
import android.widget.RatingBar;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import github.da... | /*
This file is part of Subsonic.
Subsonic is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Subsonic is distributed in the hope that i... | MusicService musicService = MusicServiceFactory.getMusicService(context); | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.