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 |
|---|---|---|---|---|---|---|
MrCrayfish/MrCrayfishSkateboardingMod | src/main/java/com/mrcrayfish/skateboarding/tricks/flip/TrickVarialKickflip.java | [
"public enum Difficulty {\n\t\n\tEASY(6, 50), MEDIUM(8, 70), HARD(10, 100), IMPOSSIBLE(12, 150);\n\n\tprivate int performTime;\n\tprivate int extraComboTime;\n\n\tDifficulty(int performTime, int extraComboTime) {\n\t\tthis.performTime = performTime;\n\t\tthis.extraComboTime = extraComboTime;\n\t}\n\t\n\tpublic int ... | import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GlStateManager;
import com.mrcrayfish.skateboarding.api.Difficulty;
import com.mrcrayfish.skateboarding.api.trick.Flip;
import com.mrcrayfish.skateboarding.entity.EntitySkateboard;
import com.mrcrayfish.skateboarding.util.TrickHelper;... | package com.mrcrayfish.skateboarding.tricks.flip;
public class TrickVarialKickflip extends Flip
{
@Override
public void updateBoard(EntitySkateboard skateboard)
{
TrickHelper.flipBoard(skateboard, 360F, performTime(), Axis.Z);
TrickHelper.spinBoard(skateboard, 180F, performTime());
}
@Override
public Stri... | public Difficulty difficulty() | 0 |
tvportal/android | app/src/main/java/com/mitechlt/tvportal/play/fragments/FavoritesFragment.java | [
"public class RobotoCheckBox extends CheckBox {\n\n /**\n * Simple constructor to use when creating a widget from code.\n *\n * @param context The Context the widget is running in, through which it can\n * access the current theme, resources, etc.\n */\n public RobotoCheckBo... | import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.supp... | package com.mitechlt.tvportal.play.fragments;
/**
* A fragment containing a ListView and adapter to display a list of 'favorited' movies & TV shows
*/
@SuppressLint("NewApi")
public class FavoritesFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor>, ViewStub.OnInflateListener {
private... | if (mPrefs.getBoolean(Config.ARG_USE_PROXY, false)) {//proxyon change url to proxy | 7 |
xpenatan/gdx-bullet-gwt | gdx-bullet-gwt/src/com/badlogic/gdx/physics/bullet/gwt/emu/com/badlogic/gdx/physics/bullet/dynamics/btRigidBody.java | [
"public class BulletBase implements Disposable\r\n{\r\n\tpublic JavaScriptObject jsObject; // public to be able to easily access in js code.\r\n\tboolean disposed;\r\n\r\n\t@Override\r\n\tpublic void dispose()\r\n\t{\r\n\t\tdisposed = true;\r\n\t\tif(jsObject != null)\r\n\t\t\tinternaldispose();\r\n\t\tjsObject = n... | import com.badlogic.gdx.math.Matrix4;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.physics.bullet.BulletBase;
import com.badlogic.gdx.physics.bullet.collision.btCollisionObject;
import com.badlogic.gdx.physics.bullet.collision.btCollisionShape;
import com.badlogic.gdx.physics.bullet.linearmath.btM... | package com.badlogic.gdx.physics.bullet.dynamics;
public class btRigidBody extends btCollisionObject
{
| btMotionState motionState;
| 3 |
YagelNasManit/environment.monitor | environment.monitor.runner/src/test/java/org/yagel/monitor/runner/test/intergation/dao/AggregatedStatusDAOTest.java | [
"public interface Resource {\n\n String getId();\n\n String getName();\n\n}",
"public interface ResourceStatus {\n\n Resource getResource();\n\n void setResource(Resource resource);\n\n Status getStatus();\n\n void setStatus(Status status);\n\n Date getUpdated();\n\n void setUpdated(Date updated);\n}",
... | import org.apache.commons.lang3.time.DateUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.yagel.monitor.Resource;
import org.yagel.monitor.ResourceStatus;
import org.yagel.monitor.mongo.AggregatedStatusDAO;
import org.yagel.monitor.mongo.MongoCon... | package org.yagel.monitor.runner.test.intergation.dao;
public class AggregatedStatusDAOTest extends AbstractDAOTest {
private AggregatedStatusDAO aggregatedStatusDAO; | private ResourceStatusDetailDAO monthDetailDAO; | 4 |
cuba-platform/yarg | core/modules/core/test/smoketest/DocSpecificTest.java | [
"public class DefaultFormatterFactory implements ReportFormatterFactory {\n protected OfficeIntegrationAPI officeIntegration;\n protected DocumentConverter documentConverter;\n protected DefaultFormatProvider defaultFormatProvider;\n protected HtmlImportProcessor htmlImportProcessor;\n protected Html... | import com.haulmont.yarg.formatters.ReportFormatter;
import com.haulmont.yarg.formatters.factory.DefaultFormatterFactory;
import com.haulmont.yarg.formatters.factory.FormatterFactoryInput;
import com.haulmont.yarg.formatters.impl.DocFormatter;
import com.haulmont.yarg.formatters.impl.doc.connector.OfficeIntegration;
im... | html += "<tr><td>1234567</td></tr>";
}
html += "</table>";
html += "</body></html>";
letterTableData.put("html", html);
letterTable.setData(letterTableData);
HashMap<String, Object> creatorInfoData = new HashMap<>();
creatorInfoData.put("name", "1234... | DocFormatter docFormatter = new DocFormatter(formatterFactoryInput, officeIntegrationApiMock); | 2 |
taimos/GPSd4Java | src/test/java/de/taimos/gpsd4java/test/Tester.java | [
"public class GPSdEndpoint {\n\t\n\tprivate static final Logger LOG = LoggerFactory.getLogger(GPSdEndpoint.class);\n\t\n\tprivate Socket socket;\n\t\n\tprivate BufferedReader in;\n\t\n\tprivate BufferedWriter out;\n\t\n\tprivate SocketThread listenThread;\n\t\n\tprivate final boolean daemon;\n\t\n\tprivate final Li... | import de.taimos.gpsd4java.types.SKYObject;
import de.taimos.gpsd4java.types.TPVObject;
import de.taimos.gpsd4java.types.subframes.SUBFRAMEObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import de.taimos.gpsd4java.api.ObjectListener;
import de.taimos.gpsd4java.backend.GPSdEndpoint;
import de.taimos.gps... | package de.taimos.gpsd4java.test;
/*
* #%L
* GPSd4Java
* %%
* Copyright (C) 2011 - 2012 Taimos 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/li... | public void handleSUBFRAME(final SUBFRAMEObject subframe) { | 8 |
huijimuhe/common-layout-android | CommonLayout/app/src/main/java/com/huijimuhe/commonlayout/ui/TestActivity.java | [
"public abstract class AbstractRenderAdapter<T> extends RecyclerView.Adapter<AbstractViewHolder> {\n\n public static final int RENDER_TYPE_HEADER = 110 << 1;\n public static final int RENDER_TYPE_NORMAL = 110 << 2;\n public List<T> mDataset;\n\n public onItemClickListener mOnItemClickListener;\n publ... | import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import com.huijimuhe.commonlayout.R;
import com.huijimuhe.commonlayout.adapter.base.AbstractRenderAdapter;
impor... | package com.huijimuhe.commonlayout.ui;
public class TestActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
//Dummy data
final xcDetailRepository repo... | ToastUtils.show(TestActivity.this, "onRefresh"); | 5 |
komamj/KomaMusic | app/src/main/java/com/koma/music/detail/artistdetail/ArtistDetailFragment.java | [
"public class AlbumsAdapter extends RecyclerView.Adapter<AlbumsAdapter.AlbumsViewHolder> {\n private List<Album> mData;\n\n private Context mContext;\n\n private RequestOptions mRequestOptions;\n\n public AlbumsAdapter(Context context, List<Album> albumList) {\n mContext = context;\n\n mRe... | import java.util.List;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.widget.GridLayoutManager;
import android.view.View;
import com.koma.music.R;
import com.koma.mu... | /*
* Copyright (C) 2017 Koma MJ
*
* 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... | LogUtils.i(TAG, "onViewCreated"); | 6 |
AlexanderMisel/gnubridge | src/main/java/org/gnubridge/core/bidding/rules/RebidJacobyTransfer.java | [
"public class Hand {\n\tList<Card> cards;\n\n\t/**\n\t * Caching optimization for pruning played cards\n\t * and perhaps others\n\t */\n\tList<Card> orderedCards;\n\tSuit color;\n\tList<Card> colorInOrder;\n\n\tpublic Hand() {\n\t\tthis.cards = new ArrayList<Card>();\n\t}\n\n\tpublic Hand(Card... cards) {\n\t\tthis... | import org.gnubridge.core.Hand;
import org.gnubridge.core.bidding.Auctioneer;
import org.gnubridge.core.bidding.Bid;
import org.gnubridge.core.bidding.PointCalculator;
import org.gnubridge.core.deck.Diamonds;
import org.gnubridge.core.deck.Hearts;
import org.gnubridge.core.deck.NoTrump;
import org.gnubridge.core.deck.S... | package org.gnubridge.core.bidding.rules;
public class RebidJacobyTransfer extends PRebidNoTrump {
public RebidJacobyTransfer(Auctioneer a, Hand h) {
super(a, h);
}
@Override
protected boolean applies() {
return super.applies() && response.getValue() == level + 1
&& (response.getTrump().equals(Diamonds... | protected Bid prepareBid() { | 2 |
Anchormen/sql4es | src/main/java/nl/anchormen/sql4es/parse/sql/HavingParser.java | [
"public interface QueryState {\n\n\t/**\n\t * Provides the original query provided to the driver\n\t * @return\n\t */\n\tpublic String originalSql();\n\n\t/**\n\t * Returns the heading build for the query\n\t * @return\n\t */\n\tpublic Heading getHeading();\n\t\n\t/**\n\t * Adds exception to this state signaling so... | import com.facebook.presto.sql.tree.AstVisitor;
import com.facebook.presto.sql.tree.BooleanLiteral;
import com.facebook.presto.sql.tree.ComparisonExpression;
import com.facebook.presto.sql.tree.DereferenceExpression;
import com.facebook.presto.sql.tree.DoubleLiteral;
import com.facebook.presto.sql.tree.Expression;
impo... | package nl.anchormen.sql4es.parse.sql;
/**
* A Presto {@link AstVisitor} implementation that parses GROUP BY clauses
*
* @author cversloot
*
*/
public class HavingParser extends AstVisitor<IComparison, QueryState>{
@Override
protected IComparison visitExpression(Expression node, QueryState state) {
if( ... | return new SimpleComparison(leftCol, compareExp.getType(), (Number)value); | 5 |
optimaize/command4j | src/main/java/com/optimaize/command4j/ext/extensions/logging/LoggingExtensions.java | [
"public interface Command<A, R> {\n\n /**\n * Runs the remote command.\n *\n * <p>This method always blocks until either the command finishes successfully, aborts by throwing an\n * exception, or is cancelled early. (The {@link CommandExecutorService} allows you to execute\n * commands in a n... | import com.optimaize.command4j.Command;
import com.optimaize.command4j.commands.BaseCommand;
import com.optimaize.command4j.ext.extensions.logging.customlogging.CommandExecutionLogger;
import com.optimaize.command4j.ext.extensions.logging.customlogging.CustomLoggingExtension;
import com.optimaize.command4j.ext.extensio... | package com.optimaize.command4j.ext.extensions.logging;
/**
* A hub-class for easy access to built-in logging extensions.
*
* @author Fabian Kessler
*/
public class LoggingExtensions {
public static final LoggingExtensions INSTANCE = new LoggingExtensions();
private LoggingExtensions(){}
/**
*... | return new StdoutLoggingExtension.Interceptor<>(cmd); | 4 |
highway-to-urhell/highway-to-urhell | h2hell-core/src/main/java/com/highway2urhell/service/ThunderExporterService.java | [
"public class CoreEngine {\n\n\tprivate static CoreEngine instance;\n\n\tprivate Map<String, LeechService> leechPluginRegistry = new HashMap<String, LeechService>();\n\tprivate Set<ReporterService> reporterPluginRegistry = new HashSet<ReporterService>();\n\tprivate final static String H2H_CONFIG = \"H2H_CONFIG\";\n... | import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.highway2urhell.CoreEngine;
import com.highway2urhell.domain.EntryPathData;
import com.highway2urhell.domain.MessageBreaker;
import com.highway2urhell.domain.MessageMetrics;
import com.highway2urhell.domain.MessageThunderApp;
import com.sun.mana... | package com.highway2urhell.service;
public class ThunderExporterService {
private static ThunderExporterService instance; | private BlockingQueue<MessageBreaker> queueRemoteBreaker = new LinkedBlockingQueue<MessageBreaker>(10000); | 2 |
sfPlayer1/Matcher | src/matcher/gui/IGuiComponent.java | [
"public final class ClassInstance implements Matchable<ClassInstance> {\n\t/**\n\t * Create a shared unknown class.\n\t */\n\tClassInstance(String id, ClassEnv env) {\n\t\tthis(id, null, env, null, false, false, null);\n\n\t\tassert id.indexOf('[') == -1 : id;\n\t}\n\n\t/**\n\t * Create a known class (class path).\... | import java.util.Set;
import matcher.type.ClassInstance;
import matcher.type.FieldInstance;
import matcher.type.MatchType;
import matcher.type.MethodInstance;
import matcher.type.MethodVarInstance; | package matcher.gui;
public interface IGuiComponent {
default void onProjectChange() { }
default void onViewChange() { }
default void onMappingChange() { } | default void onMatchChange(Set<MatchType> types) { } | 2 |
sumeetchhetri/gatf | plugin/src/main/java/com/gatf/ui/GatfConfigToolMojo.java | [
"public interface GatfPlugin {\r\n\tvoid doExecute(GatfPluginConfig configuration, List<String> files) throws Exception;\r\n\tvoid setProject(Object project);\r\n\tvoid shutdown();\r\n\tvoid initilaizeContext(GatfExecutorConfig configuration, boolean flag) throws Exception;\r\n\tAcceptanceTestContext getContext();\... | import com.gatf.executor.core.AcceptanceTestContext;
import com.gatf.executor.core.GatfTestCaseExecutorMojo;
import com.gatf.executor.core.TestCase;
import com.gatf.executor.core.WorkflowContextHandler;
import com.gatf.generator.core.GatfTestGeneratorMojo;
import java.io.File;
import java.util.function.Function;
... | /*
Copyright 2013-2019, Sumeet Chhetri
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 ap... | gp = new GatfTestGeneratorMojo();
| 5 |
flyersa/MuninMX | src/com/clavain/jobs/CustomJobRunner.java | [
"public class MuninNode \r\n{\r\n private String str_nodename;\r\n private String str_hostname = \"unset\"; \r\n private int i_port = 4949;\r\n private String str_group;\r\n private boolean b_isRunning = false;\r\n private transient long l_lastFrontendQuery; \r\n private ... | import com.clavain.munin.MuninNode;
import com.clavain.munin.MuninPlugin;
import static com.clavain.muninmxcd.logger;
import static com.clavain.utils.Generic.getMuninPluginForCustomJob;
import static com.clavain.utils.Generic.getMuninNode;
import static com.clavain.utils.Generic.getUnixtime;
import static com.clavain.u... | /*
* MuninMX
* Written by Enrico Kern, kern@clavain.com
* www.clavain.com
*
* 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... | int iCurTime = getUnixtime(); | 5 |
CycloneAxe/phphub-android | app/src/main/java/org/estgroup/phphub/common/internal/di/component/AppComponent.java | [
"@Singleton\npublic class Navigator {\n @Inject\n public Navigator() {}\n\n public void navigateToTopicDetails(@NonNull Context context, int topicId) {\n Intent intentToLaunch = TopicDetailsActivity.getCallingIntent(context, topicId);\n context.startActivity(intentToLaunch);\n }\n\n pub... | import org.estgroup.phphub.common.Navigator;
import org.estgroup.phphub.common.internal.di.module.AppModule;
import org.estgroup.phphub.ui.view.RecommendedFragment;
import org.estgroup.phphub.ui.view.settings.SettingsFragment;
import org.estgroup.phphub.ui.view.user.UserSpaceActivity;
import javax.inject.Singleton;
imp... | package org.estgroup.phphub.common.internal.di.component;
@Singleton
@Component(modules = AppModule.class)
public interface AppComponent { | void inject(SettingsFragment settingsFragment); | 3 |
ivannov/predcomposer | src/main/java/com/nosoftskills/predcomposer/test/TestDataInserter.java | [
"@Stateless\npublic class CompetitionsService implements Serializable {\n\n public static final String DEFAULT_COMPETITION_NAME = \"Champions League 2016-2017\";\n\n private static final long serialVersionUID = 7432416155835050214L;\n\n @PersistenceContext\n EntityManager entityManager;\n\n private s... | import com.nosoftskills.predcomposer.competition.CompetitionsService;
import com.nosoftskills.predcomposer.model.Competition;
import com.nosoftskills.predcomposer.model.Game;
import com.nosoftskills.predcomposer.model.Prediction;
import com.nosoftskills.predcomposer.model.User;
import javax.annotation.PostConstruct;
im... | package com.nosoftskills.predcomposer.test;
/**
* @author Ivan St. Ivanov
*/
@Singleton
@Startup
public class TestDataInserter {
@PersistenceContext
private EntityManager entityManager;
@PostConstruct
public void insertTestData() {
TypedQuery<Competition> query = entityManager.createN... | Game game1 = new Game("Paris Saint-Germain", "Ludogorets", "2:2", LocalDateTime.of(2016, 12, 6, 21, 45), true); | 2 |
hanks-zyh/HTextView | htextview-scale/src/main/java/com/hanks/htextview/scale/ScaleText.java | [
"public class CharacterDiffResult {\n public char c;\n public int fromIndex;\n public int moveIndex;\n}",
"public class CharacterUtils {\n\n public static List<CharacterDiffResult> diff(CharSequence oldText, CharSequence newText) {\n\n List<CharacterDiffResult> differentList = new ArrayList<>... | import android.animation.Animator;
import android.animation.ValueAnimator;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.view.animation.AccelerateDecelerateInterpolator;
import com.hanks.htextview.base.CharacterDiffResult;
import com.hanks.htextview.base.CharacterUtils;
import com.han... | package com.hanks.htextview.scale;
/**
* Scale
* Created by hanks on 2017/3/15.
*/
public class ScaleText extends HText {
float mostCount = 20;
float charTime = 400; | private List<CharacterDiffResult> differentList = new ArrayList<>(); | 0 |
OpenChain-Project/Online-Self-Certification-Web-App | test/org/openchain/certification/TestUpdateSurvey.java | [
"public class SurveyDbDao {\n\t\n\tstatic final Logger logger = LoggerFactory.getLogger(SurveyDbDao.class);\n\t\n\tConnection connection = null;\n\tprivate PreparedStatement updateQuestionQuery;\n\tprivate PreparedStatement addQuestionQuery;\n\tprivate PreparedStatement getQuestionIdQuery;\n\tprivate PreparedStatem... | import org.openchain.certification.model.SurveyResponseException;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import static org.junit.Assert.*;
import java.io.File;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import org.junit.After;
import org.junit.Before;
impo... | /**
* Copyright (c) 2019 Source Auditor Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | builder.registerTypeAdapter(Question.class, new QuestionJsonDeserializer()); | 1 |
mguetlein/CheS-Mapper | src/main/java/org/chesmapper/view/gui/CompoundListPanel.java | [
"public class Cluster extends ZoomableCompoundGroup implements CompoundGroupWithProperties, DoubleNameElement,\r\n\t\tComparable<Cluster>\r\n{\r\n\tprivate ClusterData clusterData;\r\n\r\n\tHashMap<String, List<Compound>> compoundsOrderedByPropterty = new HashMap<String, List<Compound>>();\r\n\r\n\tprivate boolean ... | import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.Prope... | package org.chesmapper.view.gui;
public class CompoundListPanel extends JPanel
{
JScrollPane listScrollPane;
MouseOverList list;
DefaultListModel<Compound> listModel;
DoubleNameListCellRenderer listRenderer;
boolean selfBlock = false;
Clustering clustering;
ClusterController clusterControler... | public void clusterWatchedChanged(Cluster c)
| 0 |
sworisbreathing/jpathwatch | jpathwatch-java/src/main/java/name/pachler/nio/file/impl/PathWatchService.java | [
"public abstract class Path implements Watchable {\n\n\tprotected Path(){\n\t}\n\n\t@Override\n\tpublic abstract boolean equals(Object obj);\n\n\t@Override\n\tpublic abstract int hashCode();\n\n\tpublic abstract WatchKey register(WatchService watcher, Kind<?>... events) throws IOException;\n\n\tpublic abstract Watc... | import name.pachler.nio.file.Path;
import java.io.IOException;
import name.pachler.nio.file.StandardWatchEventKind;
import name.pachler.nio.file.WatchEvent;
import name.pachler.nio.file.WatchService;
import name.pachler.nio.file.ext.ExtendedWatchEventKind;
import name.pachler.nio.file.ext.ExtendedWatchEventModifier; | /*
* Copyright 2008-2011 Uwe Pachler
*
* 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 Software Foundation. This particular file ... | else if(kind == ExtendedWatchEventKind.ENTRY_RENAME_FROM) | 4 |
imageprocessor/cv4j-desktop | desktop/src/main/java/com/cv4j/core/filters/FloSteDitheringFilter.java | [
"public class ByteProcessor implements ImageProcessor {\n private int width;\n private int height;\n\n private byte[] GRAY;\n private int[] hist;\n private ImageData image;\n\n public ByteProcessor(int width, int height) {\n this.width = width;\n this.height = height;\n this.G... | import com.cv4j.core.datamodel.ByteProcessor;
import com.cv4j.core.datamodel.ColorProcessor;
import com.cv4j.core.datamodel.ImageData;
import com.cv4j.core.datamodel.ImageProcessor;
import com.cv4j.image.util.Tools; | /*
* Copyright (c) 2017-present, CV4J Contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | if(ImageData.SQRT_LUT[diff] < minDistanceSquared) { | 2 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/main/presenter/MainPresenter.java | [
"public class BasePresenter {\n}",
"public interface AuthListener {\n\n ProgressDialog getProgressDialog();\n\n void onUsernameOrPasswordEmpty();\n\n void onConnectionFailed();\n\n void onWrongCredential(String error);\n\n void onSuccess();\n}",
"public class AuthProvider extends BaseProvider {\n... | import android.app.ProgressDialog;
import com.mgilangjanuar.dev.goscele.R;
import com.mgilangjanuar.dev.goscele.base.BasePresenter;
import com.mgilangjanuar.dev.goscele.modules.auth.listener.AuthListener;
import com.mgilangjanuar.dev.goscele.modules.auth.provider.AuthProvider;
import com.mgilangjanuar.dev.goscele.modul... | package com.mgilangjanuar.dev.goscele.modules.main.presenter;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class MainPresenter extends BasePresenter {
private MainActivity activity;
private CheckLoginListener checkLoginListener;
public MainPresenter(MainActivi... | new AuthProvider(new AuthListener() { | 1 |
porscheinformatik/selenium-components | src/main/java/at/porscheinformatik/seleniumcomponents/clarity/ClarityTabLinkComponent.java | [
"public abstract class AbstractSeleniumComponent implements SeleniumComponent\n{\n\n private final SeleniumComponent parent;\n private final WebElementSelector selector;\n\n /**\n * Creates a new {@link SeleniumComponent} with the specified parent and the specified selector.\n *\n * @param pare... | import at.porscheinformatik.seleniumcomponents.AbstractSeleniumComponent;
import at.porscheinformatik.seleniumcomponents.SeleniumComponent;
import at.porscheinformatik.seleniumcomponents.SeleniumUtils;
import at.porscheinformatik.seleniumcomponents.WebElementSelector;
import at.porscheinformatik.seleniumcomponents.comp... | package at.porscheinformatik.seleniumcomponents.clarity;
public class ClarityTabLinkComponent extends AbstractSeleniumComponent
{
private final ButtonComponent button = | new ButtonComponent(this, WebElementSelector.selectByCss("button[role='tab']")); | 3 |
citerus/bookstore-cqrs-example | product-catalog-context/src/test/java/se/citerus/cqrs/bookstore/productcatalog/resource/ProductResourceTest.java | [
"public class ProductDto extends TransportObject {\n\n @NotEmpty\n @Pattern(regexp = ID_PATTERN)\n public String productId;\n\n @Valid\n public BookDto book;\n\n @Min(0)\n public long price;\n\n @NotEmpty\n @Pattern(regexp = ID_PATTERN)\n public String publisherContractId;\n\n}",
"public class ProductDt... | import io.dropwizard.testing.junit.ResourceTestRule;
import org.junit.After;
import org.junit.ClassRule;
import org.junit.Test;
import se.citerus.cqrs.bookstore.productcatalog.api.ProductDto;
import se.citerus.cqrs.bookstore.productcatalog.api.ProductDtoFactory;
import se.citerus.cqrs.bookstore.productcatalog.domain.Bo... | package se.citerus.cqrs.bookstore.productcatalog.resource;
public class ProductResourceTest {
private static final String PRODUCT_RESOURCE = "/products";
private static final GenericType<Collection<ProductDto>> PRODUCTS_COLLECTION_TYPE =
new GenericType<Collection<ProductDto>>() {
};
private sta... | Book book = new Book(UUID.randomUUID().toString(), "1234567890", "Book Title", ""); | 2 |
amrmagdy4/kite | kite-core/src/main/java/edu/umn/cs/kite/querying/metadata/StreamSourceInfo.java | [
"public class Scheme {\n private ArrayList<Attribute> attributes;\n\n public Scheme (ArrayList<Attribute> attributesList) {\n attributes = attributesList;\n }\n public int numAttributes() {return attributes.size();}\n\n public ArrayList<Attribute> getAttributes() {\n return attributes;\... | import edu.umn.cs.kite.datamodel.Scheme;
import edu.umn.cs.kite.preprocessing.Preprocessor;
import edu.umn.cs.kite.streaming.SocketStream;
import edu.umn.cs.kite.streaming.StreamingDataSource;
import edu.umn.cs.kite.util.microblogs.Microblog;
import edu.umn.cs.kite.util.serialization.ByteStream;
import java.util.HashSe... | package edu.umn.cs.kite.querying.metadata;
/**
* Created by amr_000 on 12/21/2016.
*/
public class StreamSourceInfo {
private String sourceType;
private Hashtable<String,Object> info;
private static final Pattern ipV4Pattern = Pattern.compile(
"^(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01... | public StreamingDataSource getStreamSource( Scheme scheme, | 3 |
jinahya/bit-io | src/main/java/com/github/jinahya/bit/io/AbstractBitInput.java | [
"static int mask(final int size) {\n return MASKS[size - 1];\n}",
"static int requireValidSizeByte(final boolean unsigned, final int size) {\n if (size <= 0) {\n throw new IllegalArgumentException(\"size(\" + size + \") <= 0\");\n }\n if (size > Byte.SIZE) {\n throw new IllegalArgumentEx... | import java.io.IOException;
import static com.github.jinahya.bit.io.BitIoConstants.mask;
import static com.github.jinahya.bit.io.BitIoConstraints.requireValidSizeByte;
import static com.github.jinahya.bit.io.BitIoConstraints.requireValidSizeChar;
import static com.github.jinahya.bit.io.BitIoConstraints.requireValidSize... | package com.github.jinahya.bit.io;
/*-
* #%L
* bit-io
* %%
* Copyright (C) 2014 - 2019 Jinahya, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.o... | requireValidSizeLong(unsigned, size); | 4 |
sweer/hex-image-compress | src/main/TryRoughDisplay.java | [
"public class Encoder {\n//@formatter:on\n /**\n * @author Aleksejs Truhans\n */\n public static class Statistics {\n private int compressedHeaderSizeBytes;\n private int compressedLatticeSizeBytes;\n private int remainderBitsSizeBytes;\n private int NanRunsSizeBytes;\n\n ... | import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import pipeline.Encoder;
import lattice.DoubleLattice;
import lattice.LongLattice;
import util.ImageUtils;
import display.HexagonalDisplay;
im... | package main;
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it ... | HexByteRavelet ravelet = new HexByteRavelet(LongLattice.fromLattice(doubleLattice)); | 2 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/ImportEvent.java | [
"public abstract class DICOMEventIdCodes extends CodedValueType\n{\n\t\n\tprotected DICOMEventIdCodes(String value, String meaning)\n\t{\n\t\tsetCodeSystemName(\"DCM\");\n\t\tsetCode(value);\n\t\tsetOriginalText(meaning);\n\t}\n\t\n\t/**\n\t * \"DCM\",\"110100\",\"Application Activity\"\n\t * \n\t *\n\t * @since E... | import org.openhealthtools.ihe.atna.auditor.codes.dicom.DICOMEventIdCodes;
import org.openhealthtools.ihe.atna.auditor.codes.ihe.IHETransactionEventTypeCodes;
import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes;
import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes.RFC3881E... | /*******************************************************************************
* Copyright (c) 2008 IBM Corporation and others.
* 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 a... | List<CodedValueType> purposesOfUse) | 4 |
bigjelly/AndFast | app/src/main/java/com/andfast/app/presenter/home/HomePresenter.java | [
"public class GeneralID {\n\n /**接口根地址*/\n public static final String BASE_SERVER_URL = \"http://is.snssdk.com/\";\n\n /**\n * 页面间参数传递KEY值\n */\n public class Extra {\n public static final String TAB = \"tab\";\n }\n\n public final static int TYPE_PULL_REFRESH = 1;\n public final... | import com.andfast.app.constant.GeneralID;
import com.andfast.app.model.Topic;
import com.andfast.app.net.ResultResponse;
import com.andfast.app.presenter.SubscriberCallBack;
import com.andfast.app.presenter.base.BasePresenter;
import com.andfast.app.view.home.Impl.IHomeListView;
import java.util.List; | package com.andfast.app.presenter.home;
/**
* Created by mby on 17-8-8.
*/
public class HomePresenter extends BasePresenter<IHomeListView> {
public HomePresenter(IHomeListView view) {
super(view);
}
public void getPullRefresh(){
addSubscription(mApiService.getTopicPage(1,20,true), new... | protected void onFailure(ResultResponse response) { | 2 |
tliron/jygments | components/jygments/source/com/threecrickets/jygments/grammar/def/ChangeStateTokenRuleDef.java | [
"public class ResolutionException extends Exception\n{\n\t//\n\t// Construction\n\t//\n\n\tpublic ResolutionException( String message )\n\t{\n\t\tsuper( message );\n\t}\n\n\tpublic ResolutionException( String message, Throwable cause )\n\t{\n\t\tsuper( message, cause );\n\t}\n\n\tpublic ResolutionException( Throwab... | import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import com.threecrickets.jygments.ResolutionException;
import com.threecrickets.jygments.grammar.Grammar;
import com.threecrickets.jygments.grammar.Rule;
import com.threecrickets.jygments.grammar.State;
import com.threecrickets.jygments.... | /**
* Copyright 2010-2016 Three Crickets LLC.
* <p>
* The contents of this file are subject to the terms of a BSD license. See
* attached license.txt.
* <p>
* Alternatively, you can obtain a royalty free commercial license with less
* limitations, transferable or non-transferable, directly from Three Crickets
*... | public boolean resolve( Grammar grammar ) throws ResolutionException | 1 |
domoinc/domo-java-sdk | domo-java-sdk-all/src/test/java/com/domo/sdk/tasks/UpdateExample.java | [
"public class ExampleBase {\n\n protected DomoClient client;\n\n @Before\n public void setup() {\n Config config = Config.with()\n .clientId(\"MY_CLIENT_ID\")\n .clientSecret(\"MY_CLIENT_SECRET\")\n .apiHost(\"api.domo.com\")\n .useHttps(true)\n .scope(US... | import com.domo.sdk.ExampleBase;
import com.domo.sdk.tasks.model.Project;
import com.domo.sdk.tasks.model.ProjectList;
import com.domo.sdk.tasks.model.Task;
import com.domo.sdk.users.UserClient;
import com.domo.sdk.users.model.User;
import org.junit.Test;
import java.io.*;
import java.util.Collections;
import java.util... | package com.domo.sdk.tasks;
public class UpdateExample extends ExampleBase {
@Test
public void tasksClient_smokeTest() throws IOException {
TasksClient tasksClient = new TasksClient(client.getUrlBuilder(), client.getTransport());
//Get User
UserClient userClient = client.userClient()... | ProjectList list = new ProjectList(); | 2 |
garbagemule/MobArena | src/main/java/com/garbagemule/MobArena/framework/Arena.java | [
"public class ArenaClass\n{\n private String configName;\n private String slug;\n private Thing helmet, chestplate, leggings, boots, offhand;\n private List<Thing> armor;\n private List<Thing> items;\n private List<Thing> effects;\n private List<Thing> perms;\n private List<Thing> lobbyperms... | import com.garbagemule.MobArena.ArenaClass;
import com.garbagemule.MobArena.ArenaListener;
import com.garbagemule.MobArena.ArenaPlayer;
import com.garbagemule.MobArena.ClassLimitManager;
import com.garbagemule.MobArena.MASpawnThread;
import com.garbagemule.MobArena.Messenger;
import com.garbagemule.MobArena.MobArena;
i... | package com.garbagemule.MobArena.framework;
public interface Arena
{
/*/////////////////////////////////////////////////////////////////////////
//
// NEW METHODS IN REFACTORING
//
/////////////////////////////////////////////////////////////////////////*/
ConfigurationSection getSettin... | MASpawnThread getSpawnThread(); | 2 |
iostackproject/SDGen | src/com/ibm/test/CompressionAndPerformanceMotifGeneratorTest.java | [
"public abstract class AbstractChunkCharacterization implements Serializable, Cloneable{\n\t\n\tprivate static final long serialVersionUID = 1L;\n\t/*Size of the chunk during the scan process*/\n\tprotected int size = 0; \n\t/*Amount of non unique data of this chunk across a dataset*/\n\tprotected int deduplicatedD... | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import ja... | /*
* Copyright (C) 2014 Raul Gracia-Tinedo
*
* 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 progr... | builder.append(((MotifChunkCharacterization) chunk).getCompressionRatio() + "\t"); | 2 |
magnifikus/modPLC | src/minecraft/de/squig/plc/logic/objects/LogicTimer.java | [
"public abstract class Circuit implements Serializable, ITickNotified {\n\tprotected List<CircuitObject> objects;\n\n\tprotected CircuitMap map;\n\n\tprotected TileController controller;\n\tprotected CircuitSimulator simulator;\n\n\tprotected List<CircuitElement> simulationList = null;\n\tprotected List<Object> com... | import java.util.ArrayList;
import java.util.List;
import de.squig.plc.logic.Circuit;
import de.squig.plc.logic.Signal;
import de.squig.plc.logic.elements.functions.ElementFunction;
import de.squig.plc.logic.helper.LogHelper;
import de.squig.plc.logic.objects.guiFunctions.GuiFunction;
import de.squig.plc.logic.objects.... | package de.squig.plc.logic.objects;
/**
*
* timeBase - starttime to be used
* timeTick - length of a tick
*
* long getNextActivated(long now) - to get next event
* boolean paused - no next, on deactivation timeBase needs shift
* long pauseStart - to restore timer after pause
*
* reset()
* pause(boolean p... | add(new GuiFunctionTime((short)dataMap.TIME_DURATION.ordinal(), "Interval",2, 32767)); | 5 |
davidbecker/taloonerrl | core/src/main/java/de/brainstormsoftworks/taloonerrl/internal/render/EntityAnimationsRenderer.java | [
"@Getter\npublic class AnimationComponent extends PooledComponent implements ISetAbleComponent<AnimationComponent> {\n\tprivate EEntity entityType = EEntity.NOTHING;\n\tprivate @Setter Animation animation = null;\n\n\t@Override\n\tprotected void reset() {\n\t\tentityType = EEntity.NOTHING;\n\t\tanimation = null;\n\... | import com.artemis.Aspect;
import com.badlogic.gdx.graphics.g2d.Animation;
import de.brainstormsoftworks.taloonerrl.components.AnimationComponent;
import de.brainstormsoftworks.taloonerrl.components.PositionComponent;
import de.brainstormsoftworks.taloonerrl.components.StateDecorationComponent;
import de.brainstor... | /*******************************************************************************
* Copyright (c) 2017-2018 David Becker.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v2.0
* which accompanies this distribution, and is available ... | private AnimationComponent spriteComponent;
| 0 |
axxepta/project-argon | src/main/java/de/axxepta/oxygen/actions/RollbackVersionAction.java | [
"public class BaseXConnectionWrapper {\n\n private static final Logger logger = LogManager.getLogger(BaseXConnectionWrapper.class);\n static Connection connection;\n private static String host = null;\n\n public static void refreshFromOptions(boolean defaults) {\n final String host = ArgonOptionP... | import de.axxepta.oxygen.api.BaseXConnectionWrapper;
import de.axxepta.oxygen.api.BaseXSource;
import de.axxepta.oxygen.api.Connection;
import de.axxepta.oxygen.customprotocol.CustomProtocolURLUtils;
import de.axxepta.oxygen.utils.WorkspaceUtils;
import de.axxepta.oxygen.versioncontrol.VersionHistoryTableModel;
i... | package de.axxepta.oxygen.actions;
/**
* @author Markus on 07.02.2016.
*/
public class RollbackVersionAction extends AbstractAction {
private static final Logger logger = LogManager.getLogger(RollbackVersionAction.class);
private final JTable table;
private WSEditor editorAccess;
pub... | return ((VersionHistoryTableModel) table.getModel()).getURL(table.getSelectedRows()[0]);
| 5 |
dogriffiths/hipster | src/dg/hipster/view/IdeaMap.java | [
"public final class IdeaMapController implements KeyListener, FocusListener,\n MouseListener, MouseMotionListener, PropertyChangeListener {\n /**\n * Internationalization strings.\n */\n private static ResourceBundle resBundle = ResourceBundle.getBundle(\n \"dg/hipster/resource/strin... | import dg.hipster.controller.IdeaMapController;
import dg.hipster.model.Idea;
import dg.hipster.model.IdeaDocument;
import dg.hipster.view.BranchView;
import dg.hipster.view.IdeaView;
import dg.hipster.view.LinkView;
import dg.hipster.view.MapComponent;
import dg.inx.XMLPanel;
import java.awt.BasicStroke;
import java.a... | /*
* IdeaMap.java
*
* Created on August 31, 2006, 6:03 PM
*
* Copyright (c) 2006, David Griffiths
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code mu... | Idea oldIdea = null; | 1 |
pmarques/SocketIO-Server | SocketIO-Netty/src/test/java/eu/k2c/socket/io/ci/usecases/UC11Handler.java | [
"public abstract class AbstractHandler extends AbstractSocketIOHandler {\n\t@Override\n\tpublic boolean validate(String URI) {\n\t\t// This isn't belongs to socketIO Spec AFAIK\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic void onConnect(final SocketIOOutbound outbound, final SocketIOSessionEventRegister eventReg... | import eu.k2c.socket.io.server.api.SocketIOSessionNSRegister;
import eu.k2c.socket.io.server.exceptions.SocketIOException;
import org.apache.log4j.Logger;
import eu.k2c.socket.io.ci.AbstractHandler;
import eu.k2c.socket.io.server.api.SocketIOOutbound;
import eu.k2c.socket.io.server.api.SocketIOSessionEventRegister; | /**
* Copyright (C) 2011 K2C @ Patrick Marques <patrickfmarques@gmail.com>
*
* 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 ... | public void onConnect(final SocketIOOutbound outbound, final SocketIOSessionEventRegister eventRegister, | 2 |
Techjar/VivecraftForgeExtensions | src/main/java/com/techjar/vivecraftforge/network/packet/PacketInitialize.java | [
"@Mod(modid = \"VivecraftForge\", name = \"Vivecraft Forge Extensions\", version = \"@VERSION@\", dependencies = \"required-after:Forge@[10.13.4.1558,)\", acceptableRemoteVersions = \"@RAW_VERSION@.*\")\npublic class VivecraftForge {\n\t@Instance(\"VivecraftForge\")\n\tpublic static VivecraftForge instance;\n\t\n\t... | import java.util.ArrayList;
import com.techjar.vivecraftforge.VivecraftForge;
import com.techjar.vivecraftforge.entity.EntityVRObject;
import com.techjar.vivecraftforge.network.IPacket;
import com.techjar.vivecraftforge.proxy.ProxyClient;
import com.techjar.vivecraftforge.proxy.ProxyServer;
import com.techjar.vivecraft... | package com.techjar.vivecraftforge.network.packet;
public class PacketInitialize implements IPacket {
public boolean installed;
public boolean newAPI;
public PacketInitialize() {
}
public PacketInitialize(boolean installed, boolean newAPI) {
this.installed = installed;
this.newAPI = newAPI;
}
@Overrid... | VRPlayerData data = new VRPlayerData(); | 5 |
jcommon/process | src/main/java/jcommon/process/platform/win32/Utils.java | [
"public interface IEnvironmentVariable {\n String getName();\n String getValue();\n}",
"public interface IEnvironmentVariableBlock extends Iterable<IEnvironmentVariable> {\n public static interface IVisitor {\n boolean visit(IEnvironmentVariable var);\n }\n\n public static abstract class Visitor implement... | import com.sun.jna.Pointer;
import com.sun.jna.WString;
import com.sun.jna.ptr.PointerByReference;
import jcommon.process.IEnvironmentVariable;
import jcommon.process.IEnvironmentVariableBlock;
import jcommon.process.api.win32.Userenv;
import jcommon.process.api.win32.Win32Library;
import java.nio.ByteBuffer;
import ja... | package jcommon.process.platform.win32;
final class Utils {
private static final AtomicInteger overlapped_pipe_serial_number = new AtomicInteger(0);
public static void gc() {
for(int i = 0; i <= 5; ++i) {
System.gc();
}
}
public static int indexOfAny(final String value, final String lookingF... | for(IEnvironmentVariable e : env) { | 0 |
hamadmarri/Biscuit | main/java/com/biscuit/factories/ProjectCompleterFactory.java | [
"public class Project {\n\n\tpublic String name;\n\tpublic String description;\n\tpublic Backlog backlog = new Backlog();\n\tpublic List<Release> releases = new ArrayList<>();\n\tpublic List<Sprint> sprints = new ArrayList<>();\n\n\n\tpublic void save() {\n\t\tModelHelper.save(this, name);\n\t}\n\n\n\tpublic void d... | import java.util.ArrayList;
import java.util.List;
import com.biscuit.models.Project;
import com.biscuit.models.Release;
import com.biscuit.models.Sprint;
import com.biscuit.models.UserStory;
import com.biscuit.models.services.Finder.Releases;
import com.biscuit.models.services.Finder.Sprints;
import com.biscuit.models... | package com.biscuit.factories;
public class ProjectCompleterFactory {
public static List<Completer> getProjectCompleters(Project project) {
List<Completer> completers = new ArrayList<Completer>();
// TODO: project commands
// completers.add(new ArgumentCompleter(new StringsCompleter("summary",
// "info",... | new StringsCompleter(Sprint.fields), new NullCompleter())); | 2 |
Esri/military-apps-library-java | source/MilitaryAppsLibrary/test/com/esri/militaryapps/controller/test/SpotReportControllerTest.java | [
"public abstract class LocationController {\n \n private double speedMultiplier = 0;\n\n /**\n * Location modes.\n */\n public enum LocationMode {\n /**\n * Use the location service, such as a GPS service, to get real locations.\n */\n LOCATION_SERVICE,\n /**... | import com.esri.militaryapps.controller.LocationController;
import com.esri.militaryapps.controller.MapController;
import com.esri.militaryapps.controller.MessageController;
import com.esri.militaryapps.controller.SpotReportController;
import com.esri.militaryapps.model.Location;
import com.esri.militaryapps.model.Loca... | /*******************************************************************************
* Copyright 2013-2014 Esri
*
* 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.... | protected LocationProvider createLocationServiceProvider() { | 5 |
jeasonlzy/okhttp-OkGo | okserver/src/main/java/com/lzy/okserver/download/DownloadTask.java | [
"public class DownloadManager extends BaseDao<Progress> {\n\n private DownloadManager() {\n super(new DBHelper());\n }\n\n public static DownloadManager getInstance() {\n return DownloadManagerHolder.instance;\n }\n\n private static class DownloadManagerHolder {\n private static ... | import android.content.ContentValues;
import android.text.TextUtils;
import com.lzy.okgo.db.DownloadManager;
import com.lzy.okgo.exception.HttpException;
import com.lzy.okgo.exception.OkGoException;
import com.lzy.okgo.exception.StorageException;
import com.lzy.okgo.model.HttpHeaders;
import com.lzy.okgo.model.Progress... | /*
* Copyright 2016 jeasonlzy(廖子尧)
*
* 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... | progress.folder = OkDownload.getInstance().getFolder(); | 7 |
IvoLimmen/mystart | server/src/main/java/org/limmen/mystart/server/servlet/HomeServlet.java | [
"@Getter\n@Setter\n@ToString\npublic class Link extends BaseObject implements Comparable<Link> {\n\n private static final String UNCATEGORIZED = \"Uncategorized\";\n\n private static final long serialVersionUID = -1267285018252976552L;\n\n public static String sanatizeUrl(String url) {\n Objects.requireNonNul... | import jakarta.servlet.MultipartConfigElement;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Map;
import java.util.Properties;
... | package org.limmen.mystart.server.servlet;
public class HomeServlet extends AbstractServlet {
private static final long serialVersionUID = 1L;
public HomeServlet(Storage storage,
MultipartConfigElement multipartConfigElement,
Path temporaryDirectory,
... | return new Or(left, right); | 5 |
spring-cloud/spring-cloud-connectors | spring-cloud-spring-service-connector/src/test/java/org/springframework/cloud/config/xml/DataSourceXmlConfigTest.java | [
"public class DataSourceCloudConfigTestHelper extends CommonPoolCloudConfigTestHelper {\n\n\tpublic static void assertPoolProperties(DataSource dataSource, int maxActive, int minIdle, long maxWait) {\n\t\tif (dataSource instanceof DelegatingDataSource) {\n\t\t\tdataSource = ((DelegatingDataSource) dataSource).getTa... | import java.util.Properties;
import javax.sql.DataSource;
import org.junit.Test;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.cloud.config.DataSourceCloudConfigTestHelper;
import org.springframework.cloud.service.ServiceInfo;
import org.springframework.cloud.service.relatio... | package org.springframework.cloud.config.xml;
/**
*
* @author Ramnivas Laddad
*
*/
public abstract class DataSourceXmlConfigTest extends AbstractServiceXmlConfigTest<DataSource> {
protected abstract String getDriverClassName();
protected abstract String getValidationQuery();
protected abstract ServiceInfo... | DataSourceCloudConfigTestHelper.assertPoolProperties(ds, 20, 0, 200); | 0 |
KasperFranz/BetterChunkLoader | src/main/java/guru/franz/mc/bcl/command/Purge.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.command.types.EnabledCommand;
import guru.franz.mc.bcl.config.Config;
import guru.franz.mc.bcl.datastore.DataStoreManager;
import guru.franz.mc.bcl.datastore.IDataStore;
import guru.franz.mc.bcl.model.CChunkLoader;
import guru.franz.mc.bcl.utils.Messa... | package guru.franz.mc.bcl.command;
public class Purge extends EnabledCommand {
protected CommandResult executeCommand(CommandSource commandSource, CommandContext commandContext) {
if (!BetterChunkLoader.instance().enabled) {
commandSource.sendMessage(Text.builder(Messages.PLUGIN_DISABLED_DA... | if (!commandSource.hasPermission(Permission.COMMAND_PURGE)) { | 8 |
Gigigo-Android-Devs/gigigo-utils-suite | ggglib/src/main/java/com/gigigo/ggglib/network/mappers/ApiGenericResponseMapper.java | [
"public enum BusinessContentType {\n NO_ERROR_CONTENT,\n EXCEPTION_CONTENT,\n BUSINESS_ERROR_CONTENT\n}",
"public class BusinessError<ExtraErrorInfo> {\n\n public static final int EXCEPTION_BUSINESS_ERROR_CODE = -222;\n public static final int NO_ERROR_BUSINESS_ERROR_CODE = 0;\n public static final String N... | import com.gigigo.gggjavalib.business.model.BusinessContentType;
import com.gigigo.gggjavalib.business.model.BusinessError;
import com.gigigo.gggjavalib.business.model.BusinessObject;
import com.gigigo.ggglib.mappers.ExternalClassToModelMapper;
import com.gigigo.ggglib.network.responses.ApiGenericExceptionResponse;
imp... | /*
* Created by Gigigo Android Team
*
* Copyright (C) 2016 Gigigo Mobile Services SL
*
* 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
*... | businessError.setBusinessContentType(BusinessContentType.BUSINESS_ERROR_CONTENT); | 0 |
apache/activemq-activeio | activeio-core/src/main/java/org/apache/activeio/journal/howl/HowlJournal.java | [
"public class InvalidRecordLocationException extends Exception {\n\n\t/**\n * Comment for <code>serialVersionUID</code>\n */\n private static final long serialVersionUID = 3618414947307239475L;\n\n /**\n\t * \n\t */\n\tpublic InvalidRecordLocationException() {\n\t\tsuper();\n\t}\n\n\t/**\n\t * @param ... | import org.objectweb.howl.log.LogConfigurationException;
import org.objectweb.howl.log.LogEventListener;
import org.objectweb.howl.log.LogRecord;
import org.objectweb.howl.log.Logger;
import java.io.IOException;
import java.io.InterruptedIOException;
import org.apache.activeio.journal.InvalidRecordLocationException;
im... | /**
*
* 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 ... | throws InvalidRecordLocationException, IOException { | 0 |
wangchongjie/multi-engine | src/main/java/com/baidu/unbiz/multiengine/transport/server/TaskServerHandler.java | [
"public class GossipInfo {\n\n // TODO version and sys/net infos sync\n private long version;\n private List<HostConf> hostConfs;\n\n public List<HostConf> getHostConfs() {\n return hostConfs;\n }\n\n public void setHostConfs(List<HostConf> hostConfs) {\n this.hostConfs = hostConfs;\... | import org.slf4j.Logger;
import com.baidu.unbiz.multiengine.endpoint.gossip.GossipInfo;
import com.baidu.unbiz.multiengine.endpoint.supervisor.DefaultEndpointSupervisor;
import com.baidu.unbiz.multiengine.task.TaskCommand;
import com.baidu.unbiz.multiengine.transport.dto.Signal;
import com.baidu.unbiz.multiengine.trans... | package com.baidu.unbiz.multiengine.transport.server;
/**
* Handler implementation for the echo server.
*/
@Sharable
public class TaskServerHandler extends ContextAwareInboundHandler {
private static final Logger LOG = AopLogFactory.getLogger(TaskServerHandler.class);
public TaskServerHandler() {
}
... | GossipInfo info = new GossipInfo(); | 0 |
cattaka/AdapterToolbox | example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/SpinnerScrambleAdapterExampleActivityTest.java | [
"public class ClassicScrambleAdapter<T> extends AdapterConverter<ScrambleAdapter<T>, RecyclerView.ViewHolder, T> {\n\n public ClassicScrambleAdapter(\n @NonNull Context context,\n @NonNull List<T> items,\n ClassicListenerRelay classicListenerRelay,\n AbsScrambleAdapter... | import android.support.test.rule.ActivityTestRule;
import android.view.View;
import net.cattaka.android.adaptertoolbox.classic.ClassicScrambleAdapter;
import net.cattaka.android.adaptertoolbox.example.test.MockSnackbarLogic;
import net.cattaka.android.adaptertoolbox.example.test.TestUtils.Entry;
import org.junit.Before... | package net.cattaka.android.adaptertoolbox.example;
/**
* Created by cattaka on 16/06/05.
*/
public class SpinnerScrambleAdapterExampleActivityTest {
@Rule
public ActivityTestRule<SpinnerScrambleAdapterExampleActivity> mActivityTestRule = new ActivityTestRule<>(SpinnerScrambleAdapterExampleActivity.class... | mActivity.mSnackbarLogic = spy(new MockSnackbarLogic()); | 1 |
uservoice/uservoice-android-sdk | UserVoiceSDK/src/com/uservoice/uservoicesdk/deflection/Deflection.java | [
"public class Session {\n\n private static Session instance;\n\n public static synchronized Session getInstance() {\n if (instance == null) {\n instance = new Session();\n }\n return instance;\n }\n\n public static void reset() {\n instance = null;\n }\n\n pr... | import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import android.content.Context;
import android.util.Log;
import com.uservoice.uservoicesdk.Session;
import com.uservoice.uservoicesdk.babayaga.Babayaga;
import com.use... | package com.uservoice.uservoicesdk.deflection;
public class Deflection {
private static int interactionIdentifier = Integer.parseInt(String.valueOf(new Date().getTime()).substring(4));
private static String searchText;
public static void trackDeflection(Context context, String kind, String deflecting... | params.put("deflector_type", (deflector instanceof Article) ? "Faq" : "Suggestion"); | 4 |
hss01248/DialogUtil | dialog/src/main/java/com/hss01248/dialog/StyledDialog.java | [
"public abstract class SuperLvHolder<T> implements View.OnAttachStateChangeListener,ILifeCycle{\n public View rootView;\n\n /*public SuperLvHolder(){\n\n }*/\n\n public SuperLvHolder(Context context){\n if(setLayoutRes() !=0){\n rootView = View.inflate(context,setLayoutRes(),null);\n ... | import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Looper;
import android.view.Gravity;
import android.view.View;
import android.widget.TextView;
import com.hss012... | package com.hss01248.dialog;
/**
* Created by Administrator on 2016/5/4 0004.
*/
public class StyledDialog {
//android.support.v7.app.
public static Context context;
private static int singleChosen;
//private static DialogInterface loadingDialog;//缓存加载中的dialog,便于以后可以不需要对象就让它消失
//private... | public static ConfigBean buildProgress(CharSequence msg, boolean isHorizontal) { | 1 |
Tonius/E-Mobile | src/main/java/tonius/emobile/gui/EMGuiHandler.java | [
"public class GuiCellphonePearls extends GuiCellphoneBase {\n \n public GuiCellphonePearls(ContainerCellphonePearls cellphone) {\n super(cellphone);\n }\n \n @Override\n protected void drawGuiContainerForegroundLayer(int param1, int param2) {\n super.drawGuiContainerForegroundLayer(p... | import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import tonius.emobile.gui.client.GuiCellphonePearls;
import tonius.emobile.gui.client.GuiCellphoneRF;
import tonius.emobile.gui.container.ContainerCellphonePearls;
import tonius.emobile.gui.container.... | package tonius.emobile.gui;
public class EMGuiHandler implements IGuiHandler {
public static final int CELLPHONE_PEARL = 0;
public static final int CELLPHONE_RF = 1;
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
switch (I... | return new ContainerCellphoneRF(player.inventory, cellphoneRF); | 3 |
gengo/gengo-java | examples/TestClient.java | [
"public class GengoClient extends JsonHttpApi\n{\n /** Strings used to represent TRUE and FALSE in requests */\n public static final int GENGO_TRUE = 1;\n public static final int GENGO_FALSE = 0;\n\n final private boolean usesSandbox;\n\n /**\n * Initialize the client.\n * @param publicKey yo... | import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.IllegalArgumentException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import com.gengo.client.GengoClient;
import com.gengo.client.exc... | }
System.out.println("[testAccount] end@" + this.sessionHash);
}
/**
* Test service functionalities.
*/
public void testService(Boolean verbose) {
verbose = verbose == null ? true : verbose;
System.out.println("[testService] start@" + this.sessionHash);
JSO... | response = this.client.getTranslationJobs(null, JobStatus.AVAILABLE, null, 5); | 5 |
strepsirrhini-army/chaos-loris | src/test/java/io/pivotal/strepsirrhini/chaosloris/destroyer/DestructionSchedulerTest.java | [
"@Entity\npublic class Schedule {\n\n @Column(nullable = false)\n private String expression;\n\n @Column(nullable = false)\n @GeneratedValue\n @Id\n @JsonIgnore\n private Long id;\n\n @Column(nullable = false, unique = true)\n private String name;\n\n /**\n * Create a new instance\... | import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.springframework.boot.actuate.health.Status.DOWN;
import static org.springframework.boot.actuate.health.Status.UP;
import i... | /*
* Copyright 2015-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | this.destructionScheduler.scheduleUpdated(new ScheduleUpdatedEvent(this, schedule)); | 4 |
ZhangFly/WTFSocket_Server_JAVA | src/wtf/socket/controller/WTFSocketControllersGroup.java | [
"public final class WTFSocketServer {\n\n /**\n * Spring 上下文\n */\n private ApplicationContext spring = new ClassPathXmlApplicationContext(\"spring.wtf.socket.xml\");\n\n /**\n * 消息调度组件\n * 根据消息的头信息将消息投递到指定的目的地\n */\n @Resource()\n private WTFSocketScheduler scheduler;\n\n /**\... | import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Scope;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Component;
imp... | package wtf.socket.controller;
/**
* 控制器组
* <p>
* Created by ZFly on 2017/4/29.
*/
@Component("wtf.socket.controllersGroup")
@Scope("prototype")
public class WTFSocketControllersGroup implements WTFSocketHandler {
private static final Log logger = LogFactory.getLog(WTFSocketControllersGroup.class);
pri... | public void handle(WTFSocketRoutingItem item, WTFSocketMsg request, List<WTFSocketMsg> responses) throws WTFSocketException { | 1 |
stefanhaustein/expressionparser | demo/cas/src/main/java/org/kobjects/expressionparser/demo/cas/TreeBuilder.java | [
"public class ExpressionParser<T> {\n\n private final HashMap<String,Symbol> prefix = new HashMap<>();\n private final HashMap<String,Symbol> infix = new HashMap<>();\n private final HashSet<String> otherSymbols = new HashSet<>();\n private final HashSet<String> primary = new HashSet<>();\n private final HashM... | import org.kobjects.expressionparser.ExpressionParser;
import org.kobjects.expressionparser.OperatorType;
import org.kobjects.expressionparser.Processor;
import org.kobjects.expressionparser.Tokenizer;
import org.kobjects.expressionparser.demo.cas.tree.Node;
import org.kobjects.expressionparser.demo.cas.tree.NodeFactor... | package org.kobjects.expressionparser.demo.cas;
public class TreeBuilder extends Processor<Node> {
@Override
public Node infixOperator(Tokenizer tokenizer, String name, Node left, Node right) {
switch (name.charAt(0)) {
case '+': return NodeFactory.add(left, right);
case '-':
case '−': ret... | public static ExpressionParser<Node> createParser() { | 0 |
JeffreyFalgout/ThrowingStream | throwing-stream/src/main/java/name/falgout/jeffrey/throwing/stream/terminal/ThrowingDoubleStreamTerminal.java | [
"public interface ThrowingBaseSpliterator<E, X extends Throwable, S extends ThrowingBaseSpliterator<E, X, S>> {\n public static interface ThrowingSpliterator<E, X extends Throwable>\n extends ThrowingBaseSpliterator<E, X, ThrowingSpliterator<E, X>> {}\n\n public static interface OfPrimitive<E, E_CONS, X exte... | import java.util.DoubleSummaryStatistics;
import java.util.OptionalDouble;
import java.util.function.BiConsumer;
import java.util.function.DoubleBinaryOperator;
import java.util.function.DoubleConsumer;
import java.util.function.DoublePredicate;
import java.util.function.ObjDoubleConsumer;
import java.util.function.Sup... | package name.falgout.jeffrey.throwing.stream.terminal;
public interface ThrowingDoubleStreamTerminal<X extends Throwable>
extends ThrowingBaseStreamTerminal<Double, X> {
@Override
public ThrowingIterator.OfDouble<X> iterator();
@Override
public ThrowingBaseSpliterator.OfDouble<X> spliterator();
defau... | public boolean anyMatch(ThrowingDoublePredicate<? extends X> predicate) throws X; | 4 |
DorsetProject/dorset-framework | agents/web-api/src/main/java/edu/jhuapl/dorset/agents/FlickrAgent.java | [
"public class Response {\n private final Type type;\n private final String text;\n private final String payload;\n private final ResponseStatus status;\n\n /**\n * Create a response\n *\n * @param text the text of the response\n */\n public Response(String text) {\n this.ty... | import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.bind.DatatypeConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson... | /*
* Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | private HttpClient client; | 6 |
nextgis/nextgislogger | app/src/main/java/com/nextgis/logger/UI/activity/ProgressBarActivity.java | [
"public class LoggerService extends Service implements ArduinoEngine.ConnectionListener {\n private static final int ID_MEASURING = 1;\n\n private ArduinoEngine mArduinoEngine;\n private SensorEngine mSensorEngine;\n private CellEngine mGsmEngine;\n private Thread mThread = null;\n private Notific... | import android.Manifest;
import android.accounts.Account;
import android.app.ActionBar;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Dia... | /*
* *****************************************************************************
* Project: NextGIS Logger
* Purpose: Productive data logger for Android
* Authors: Stanislav Petriakov, becomeglory@gmail.com
* *****************************************************************************
* Copyright © 2015-2017 N... | mSessionId = mPreferences.getString(LoggerConstants.PREF_SESSION_ID, null); | 3 |
felixb/callmeter | CallMeter3G/src/main/java/de/ub0r/android/callmeter/ui/prefs/PreferencesPlain.java | [
"public class ConsentManager {\n\n private static final String TAG = \"ConsentManager\";\n private static final String ADMOB_PUBLISHER_ID = \"pub-1948477123608376\";\n private static final String PRIVACY_URL = \"https://github.com/felixb/callmeter/blob/master/PRIVACY.md\";\n\n private final Activity mAc... | import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreference... | return true;
}
};
for (String k : keys) {
PreferenceScreen p = pm.createPreferenceScreen(PreferencesPlain.this);
p.setPersistent(false);
p.setKey(k);
p.setTitle(k)... | new ComponentName(this, LogsAppWidgetProvider.class)); | 4 |
374901588/PaperPlane | app/src/main/java/com/hut/zero/adapter/ZhihuDailyNewsAdapter.java | [
"public class ZhihuDailyNews {\n\n private String date;\n private ArrayList<Question> stories;\n\n public String getDate() {\n return date;\n }\n\n public void setDate(String date) {\n this.date = date;\n }\n\n public ArrayList<Question> getStories() {\n return stories;\n ... | import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.hut.zero.BR;
import com.hut.zero.R;
import com.hut.zero.bean.ZhihuDailyNews;
import com.hut.zero.other.OnRe... | package com.hut.zero.adapter;
/**
* Created by Zero on 2017/4/3.
*/
public class ZhihuDailyNewsAdapter extends RecyclerView.Adapter<BaseViewHolder> {
private static final int TYPE_NORMAL = 0;
private static final int TYPE_FOOTER = 1;
private OnRecyclerViewOnClickListener mListener;
private List... | holder.getBinding().setVariable(BR.imgUrl,(item.getImages().get(0) == null? DataBindingCustomAttr.NO_LOAD:item.getImages().get(0))); | 3 |
chedim/minedriod | src/main/java/com/onkiup/minedroid/gui/views/TextView.java | [
"public interface Context {\n /**\n * @return Context id\n */\n int contextId();\n\n}",
"@SideOnly(Side.CLIENT)\npublic class GuiManager {\n /**\n * Current MineDroid theme\n */\n public static HashMap<Integer, Style> themes = new HashMap<Integer, Style>();\n\n /**\n * Minecraft... | import java.awt.*;
import com.onkiup.minedroid.Context;
import com.onkiup.minedroid.gui.GuiManager;
import com.onkiup.minedroid.gui.XmlHelper;
import com.onkiup.minedroid.gui.drawables.TrueTypeDrawable;
import com.onkiup.minedroid.gui.primitives.Point;
import com.onkiup.minedroid.gui.resources.Style;
import com.onkiup.... | package com.onkiup.minedroid.gui.views;
/**
* Shows some text
*/
public class TextView extends ContentView {
protected TrueTypeDrawable text = new TrueTypeDrawable("", 0);
protected boolean multiline;
public TextView(Context context) {
super(context);
text.setTextSize(GuiManager.getTh... | protected Point getTextSize() { | 4 |
ajonkisz/TraVis | src/travis/controller/Controller.java | [
"public enum Mode {\n ATTACH, PLAYBACK\n}",
"public class ScriptHandler extends Observable {\n\n private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat(\n \"yyyy-MM-dd'T'HHmmssSSS\");\n private static final ScriptHandler INSTANCE = new ScriptHandler();\n private static ... | import travis.view.project.graph.connection.ConnectionPainter;
import travis.view.settings.Settings;
import travis.view.settings.Settings.Type;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Observable;
import java.util.Observer;
import javax.swing.Timer;
import travis.control... | /*
* Controller.java
*
* Copyright (C) 2011-2012, Artur Jonkisz, <travis.source@gmail.com>
*
* This file is part of TraVis.
* See https://github.com/ajonkisz/TraVis for more info.
*
* TraVis is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publis... | ConnectionPainter painter = UIHelper.getInstance().getGraph() | 3 |
Zhuinden/simple-stack | simple-stack/src/test/java/com/zhuinden/simplestack/BackstackTest.java | [
"public class ServiceProvider\n implements ScopedServices {\n @Override\n public void bindServices(@Nonnull ServiceBinder serviceBinder) {\n Object key = serviceBinder.getKey();\n if(key instanceof HasServices) {\n ((HasServices) key).bindServices(serviceBinder);\n r... | import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import static org.assertj.core.api.Assertions.assertThat;
import android.content.Context;
import android.os.Parcelable;
import android.view.View;
import... |
backstack.setHistory(History.of(key3), StateChange.REPLACE);
assertThat(service1.isActivatedCalled).isTrue();
assertThat(service1.isDeactivatedCalled).isTrue();
assertThat(service1.isRegisteredCalled).isTrue();
assertThat(service1.isUnregisteredCalled).isTrue();
assert... | Object key = new TestKeyWithOnlyParentServices("key", History.of("blah")) { | 3 |
CableIM/Cable-Android | src/org/thoughtcrime/securesms/WebRtcCallActivity.java | [
"public class WebRtcCallControls extends LinearLayout {\n\n private static final String TAG = WebRtcCallControls.class.getSimpleName();\n\n private AccessibleToggleButton audioMuteButton;\n private AccessibleToggleButton videoMuteButton;\n private AccessibleToggleButton speakerButton;\n private AccessibleToggl... | import android.app.Activity;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.res.Configuration;
import android.media.AudioManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.No... |
private void handleSetMuteAudio(boolean enabled) {
Intent intent = new Intent(this, WebRtcCallService.class);
intent.setAction(WebRtcCallService.ACTION_SET_MUTE_AUDIO);
intent.putExtra(WebRtcCallService.EXTRA_MUTE, enabled);
startService(intent);
}
private void handleSetMuteVideo(boolean muted) ... | TextSecureIdentityKeyStore identityKeyStore = new TextSecureIdentityKeyStore(WebRtcCallActivity.this); | 2 |
LMAX-Exchange/angler | src/main/java/com/lmax/angler/monitoring/network/monitor/system/snmp/SystemNetworkManagementMonitor.java | [
"public final class SnmpUdpStatisticsColumnHandler implements TokenHandler\n{\n private static final long HEADER_ROW_FIRST_COLUMN_VALUE = ByteBuffer.wrap(\"Udp: InD\".getBytes(UTF_8)).getLong();\n private static final int UDP_ROW_FIRST_COLUMN_VALUE = ByteBuffer.wrap(\"Udp:\".getBytes(UTF_8)).getInt();\n pr... | import com.lmax.angler.monitoring.network.monitor.system.snmp.udp.SnmpUdpStatisticsColumnHandler;
import com.lmax.angler.monitoring.network.monitor.system.snmp.udp.SnmpUdpStatisticsHandler;
import com.lmax.angler.monitoring.network.monitor.util.FileLoader;
import com.lmax.angler.monitoring.network.monitor.util.Parsers;... | package com.lmax.angler.monitoring.network.monitor.system.snmp;
/**
* Monitor for reporting changes in /proc/net/snmp.
*/
public final class SystemNetworkManagementMonitor
{
private final TokenHandler lineParser =
Parsers.rowColumnParser(new SnmpUdpStatisticsColumnHandler(this::onUpdate)); | private final FileLoader fileLoader; | 2 |
cojen/Cojen | src/main/java/org/cojen/classfile/attribute/InnerClassesAttr.java | [
"public abstract class Attribute {\n final static Attribute[] NO_ATTRIBUTES = new Attribute[0];\n\n public static final String CODE = \"Code\";\n public static final String CONSTANT_VALUE = \"ConstantValue\";\n public static final String DEPRECATED = \"Deprecated\";\n public static final String EXCEP... | import java.util.ArrayList;
import java.util.List;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import org.cojen.classfile.Attribute;
import org.cojen.classfile.ConstantPool;
import org.cojen.classfile.Modifiers;
import org.cojen.classfile.constant.ConstantClassInfo;
import org.cojen... | /*
* Copyright 2004-2010 Brian S O'Neill
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | mInnerClasses.add(new Info(inner, outer, innerName, Modifiers.getInstance(af))); | 2 |
open-io/oio-api-java | src/main/java/io/openio/sds/models/ObjectInfo.java | [
"public static final Charset OIO_CHARSET = Charset.forName(\"UTF-8\");",
"public class RequestContext {\n\n private DeadlineManager dm;\n\n private String reqId = null;\n private int reqStart = -1;\n private int rawTimeout = -1;\n private int deadline = -1;\n\n /**\n * Build a new {@link Req... | import static io.openio.sds.common.OioConstants.OIO_CHARSET;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import io.openio.sds.RequestContext;
import io.openio.sds.common.Hash;
import io.openio.sds.common.Mo... | package io.openio.sds.models;
public class ObjectInfo {
private OioUrl url;
private String oid;
private Long ctime;
private Boolean deleted = false;
private String policy;
private String hash;
private String hashMethod;
private String chunkMethod;
private Long size;
private ... | this.hash = Hash.md5() | 2 |
immopoly/android | src/org/immopoly/android/tasks/AddToPortfolioTask.java | [
"public class TrackingManager {\n\n\tpublic static final String UA_ACCOUNT = \"UA-25341313-1\";\n\n\t// Page views, basicly Activities where you can do events\n\tpublic static final String VIEW_SIGNUP = \"signup\";\n\tpublic static final String VIEW_REGISTER = \"register\";\n\tpublic static final String VIEW_LOGIN ... | import java.net.MalformedURLException;
import java.net.URL;
import org.immopoly.android.helper.TrackingManager;
import org.immopoly.android.helper.WebHelper;
import org.immopoly.android.model.Flat;
import org.immopoly.android.model.ImmopolyHistory;
import org.immopoly.android.model.ImmopolyUser;
import org.json.JSONExc... | package org.immopoly.android.tasks;
public class AddToPortfolioTask extends AbstractExposeTask {
public AddToPortfolioTask(Context context, GoogleAnalyticsTracker tracker) {
super(context, tracker, TrackingManager.ACTION_TOOK_EXPOSE);
}
protected JSONObject request(Flat flat) throws MalformedURLException, ... | return WebHelper.getHttpData(new URL(WebHelper.SERVER_URL_PREFIX + "/portfolio/add?token=" + ImmopolyUser.getInstance().getToken() | 4 |
adyliu/jafka | src/test/java/io/jafka/consumer/ZookeeperConsumerConnector2Test.java | [
"public abstract class BaseJafkaServer {\n\n static {\n //System.setProperty(\"jafka_mx4jenable\", \"true\");\n }\n\n protected Logger logger = LoggerFactory.getLogger(getClass());\n\n public Jafka createJafka() {\n Properties mainProperties = new Properties();\n return createJafka(... | import com.github.zkclient.ZkServer;
import io.jafka.BaseJafkaServer;
import io.jafka.DataLogCleaner;
import io.jafka.Jafka;
import io.jafka.PortUtils;
import io.jafka.TestUtil;
import io.jafka.ZkServerTestUtil;
import io.jafka.producer.Producer;
import io.jafka.producer.ProducerConfig;
import io.jafka.producer.StringP... | /**
* 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... | serverProperties.setProperty("log.dir", DataLogCleaner.defaultDataLogPath + "/jafka" + i); | 1 |
pdsoftplan/zap-maven-plugin | zap-client-api/src/main/java/br/com/softplan/security/zap/api/ZapClient.java | [
"public interface Analyzer {\n\n\t/**\n\t * Runs an analysis of the given target and generates the report. \n\t * \n\t * @param analysisInfo the information about the analysis to be executed.\n\t * @return the report of the analysis.\n\t */\n\tZapReport analyze(AnalysisInfo analysisInfo);\n}",
"public final class... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import br.com.softplan.security.zap.api.analysis.Analyzer;
import br.com.softplan.security.zap.api.analysis.AnalyzerFactory;
import br.com.softplan.security.zap.api.authentication.AuthenticationHandler;
import br.com.softplan.security.zap.api.authentication.Authe... | package br.com.softplan.security.zap.api;
/**
* The main client for starting a ZAP analysis.
*
* @author pdsec
*/
public class ZapClient {
private String apiKey;
private ClientApi api;
private AuthenticationHandler authenticationHandler;
private SessionManager sessionManager;
private static final Logg... | public ZapClient(ZapInfo zapInfo) { | 7 |
dragonite-network/dragonite-java | dragonite-mux/src/main/java/com/vecsight/dragonite/mux/frame/types/CloseConnectionFrame.java | [
"public class IncorrectFrameException extends MuxException {\n\n public IncorrectFrameException(final String msg) {\n super(msg);\n }\n\n}",
"public interface Frame {\n\n byte getVersion();\n\n FrameType getType();\n\n byte[] toBytes();\n\n int getFixedLength();\n\n int getExpectedLeng... | import com.vecsight.dragonite.mux.exception.IncorrectFrameException;
import com.vecsight.dragonite.mux.frame.Frame;
import com.vecsight.dragonite.mux.frame.FrameType;
import com.vecsight.dragonite.mux.misc.MuxGlobalConstants;
import com.vecsight.dragonite.utils.binary.BinaryReader;
import com.vecsight.dragonite.utils.b... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.mux.frame.types;
/*
* VERSION 1 SB
* TYPE 1 SB
* connID 2 SS
*/
public class CloseConnectionFrame implements Frame {
private static fin... | final BinaryReader reader = new BinaryReader(frame); | 4 |
lambdazen/pixy | src/main/java/com/lambdazen/pixy/pipemakers/Bool1.java | [
"public interface PipeMaker {\n\t/** Returns the signature as relationName + \"/\" + arity */\n\tpublic String getSignature();\n\n\t/** Given the bindings, this method returns a PixyPipe and adds any new replacements typically of the form x -> $x */\n\tpublic PixyPipe makePipe(List<PixyDatum> bindings, Map<String, ... | import java.util.List;
import java.util.Map;
import com.lambdazen.pixy.PipeMaker;
import com.lambdazen.pixy.PixyDatum;
import com.lambdazen.pixy.PixyDatumType;
import com.lambdazen.pixy.PixyPipe;
import com.lambdazen.pixy.VariableGenerator;
import com.lambdazen.pixy.pipes.ConnectPipe;
import com.lambdazen.pixy.pipes.Ev... | package com.lambdazen.pixy.pipemakers;
public class Bool1 implements PipeMaker {
@Override
public String getSignature() {
return "(bool)/1";
}
@Override
public PixyPipe makePipe(List<PixyDatum> bindings, Map<String, PixyDatum> replacements, VariableGenerator varGen) {
// Eval pipe, then as() if var, match... | return new ConnectPipe(new EvalPipe(null, list), new FilterPipe(null, new PixyDatum(PixyDatumType.SPECIAL_ATOM, "true"))); | 5 |
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")), | 0 |
caseydavenport/biermacht | src/com/biermacht/brews/frontend/AddMashStepActivity.java | [
"public abstract class AddEditActivity extends DriveActivity implements OnClickListener {\n\n // Main view - holds all the rows\n public ViewGroup mainView;\n\n // Alert builder\n public AlertBuilder alertBuilder;\n\n // Important things\n public OnClickListener onClickListener;\n\n // LayoutInflater\n publ... | import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.TextView;
import com.biermacht.brews.R;
import ... | package com.biermacht.brews.frontend;
public class AddMashStepActivity extends AddEditActivity {
// Views
public View stepTempView;
public View waterToGrainRatioView;
public View infuseTemperatureView;
public View stepAmountView;
public View rampTimeView;
// Titles
public TextView stepTempViewTitl... | MashProfile profile; | 2 |
codebling/VFSJFileChooser2 | src/net/sf/vfsjfilechooser/plaf/basic/BasicVFSDirectoryModel.java | [
"@SuppressWarnings(\"serial\")\r\npublic class VFSJFileChooser extends JComponent implements Accessible\r\n{\r\n private static final Frame SHARED_FRAME = new Frame();\r\n private static final FileObject[] EMPTY_FILEOBJECT_ARRAY = new FileObject[]{};\r\n\r\n // ******************************\r\n // ****... | import net.sf.vfsjfilechooser.VFSJFileChooser;
import net.sf.vfsjfilechooser.constants.VFSJFileChooserConstants;
import net.sf.vfsjfilechooser.filechooser.AbstractVFSFileSystemView;
import net.sf.vfsjfilechooser.plaf.metal.MetalVFSFileChooserUI;
import net.sf.vfsjfilechooser.utils.FileObjectComparatorFactory;
import or... | /*
*
* Copyright (C) 2008-2009 Yves Zoundi
*
* 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 ... | private static final Comparator<FileObject> fileNameComparator = FileObjectComparatorFactory.newFileNameComparator(true); | 4 |
kgilmer/org.openexchangerate.client | org.openexchangerates.client/src/org/openexchangerates/client/OERClient.java | [
"public interface ErrorHandler {\n\t/**\n\t * @param code the HTTP code of the error\n\t * @param human-readable error message\n\t * @throws IOException on I/O error\n\t */\n\tvoid handleError(int code, String message) throws IOException;\n}",
"public interface HttpGETCache {\n\t\t\n\t/**\n\t * @param key cache k... | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONT... | package org.openexchangerates.client;
/**
* openexchangerates.org (OER) client for Java. Deserializes OER JSON messages into native Java types.
*
* Depends on org.touge RestClient (a wrapper for HTTPUrlConnection) and org.json JSON library.
*
* @author kgilmer
*
*/
public final class OERClient {
/**
*... | public OERClient(HttpGETCache cache, String oerUrl, int connectTimeout, int readTimeout, PrintWriter debugWriter, ErrorHandler errorHandler, String apiKey) { | 0 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/InMemoryStructureCreation_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import eu.optique.r2rml.api.model.LogicalTable;
import eu.optique.r2rml.api.MappingFactory;
import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.m... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | ObjectMap obm = mfact.createObjectMap(templo);
| 3 |
ihongs/HongsCORE | hongs-core/src/main/java/io/github/ihongs/action/ActionDriver.java | [
"public final class Cnst {\n\n //** 默认取值 **/\n\n public static final String LANG_DEF = \"zh_CN\"; // 默认语言\n\n public static final String ZONE_DEF = \"GMT+8\"; // 默认时区\n\n public static final int RN_DEF = 20 ; // 默认每页行数\n\n //** 查询参数 **/\n\n public static final String ID_KEY = \"id\"; // 编号\n... | import io.github.ihongs.Cnst;
import io.github.ihongs.Core;
import io.github.ihongs.CoreConfig;
import io.github.ihongs.CoreLocale;
import io.github.ihongs.CoreLogger;
import io.github.ihongs.util.Dawn;
import io.github.ihongs.util.Syno;
import io.github.ihongs.util.Synt;
import io.github.ihongs.util.daemon.Chore;
impo... | package io.github.ihongs.action;
/**
* 动作驱动器
*
* <p>
* 其他的 Servlet,Filter 继承此类即可安全的使用 Core 请求对象;
* 也可以将其作为 Filter 加入到 web.xml,
* 其后的 Servlet,Filter 实例对象均可安全的使用 Core 请求对象.
* </p>
*
* <h3>配置选项:</h3>
* <pre>
* server.id 服务ID
* core.language.probing 探测语言
* core.language.default 默认语言
* core.timez... | v = Syno.inject(v,m); | 2 |
ground-context/ground | modules/postgres/app/edu/berkeley/ground/postgres/dao/version/PostgresTagDao.java | [
"public interface TagDao {\n\n List<Long> getVersionIdsByTag(String tag) throws GroundException;\n\n List<Long> getItemIdsByTag(String tag) throws GroundException;\n\n Map<String, Tag> retrieveFromDatabaseByVersionId(long id) throws GroundException;\n\n Map<String, Tag> retrieveFromDatabaseByItemId(long id) thr... | import edu.berkeley.ground.common.dao.version.TagDao;
import edu.berkeley.ground.common.exception.GroundException;
import edu.berkeley.ground.common.exception.GroundException.ExceptionType;
import edu.berkeley.ground.common.model.version.GroundType;
import edu.berkeley.ground.common.model.version.Tag;
import edu.berkel... | /**
* 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>
* <p>http://www.apache.org/licenses/LICENSE-2.0
* <p>
* <p>Unless required by applicable law or agreed to in writing, software dist... | throw new GroundException(ExceptionType.OTHER, String.format("Unidentified type: %s", type)); | 2 |
ghjansen/cas | cas-core/src/main/java/com/ghjansen/cas/core/simulation/Simulation.java | [
"public abstract class CellularAutomaton<R extends Rule, S extends Space, T extends Time, O extends Combination,\n N extends Transition> {\n\n private R rule;\n\n protected CellularAutomaton(R rule) throws InvalidRuleException {\n if (rule == null) {\n throw new InvalidRuleException()... | import com.ghjansen.cas.core.ca.CellularAutomaton;
import com.ghjansen.cas.core.exception.InvalidCellularAutomataException;
import com.ghjansen.cas.core.exception.InvalidCombinationException;
import com.ghjansen.cas.core.exception.InvalidStateException;
import com.ghjansen.cas.core.exception.InvalidTransitionException;... | /*
* CAS - Cellular Automata Simulator
* Copyright (C) 2016 Guilherme Humberto Jansen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at y... | public void simulateComplete() throws InvalidStateException, InvalidCombinationException, InvalidTransitionException, | 2 |
manuelsc/Lunary-Ethereum-Wallet | app/src/main/java/rehanced/com/simpleetherwallet/utils/Dialogs.java | [
"public class AddressDetailActivity extends SecureAppCompatActivity {\n\n public static final byte OWN_WALLET = 0;\n public static final byte SCANNED_WALLET = 1;\n\n private SectionsPagerAdapter mSectionsPagerAdapter;\n private ViewPager mViewPager;\n private Fragment[] fragments;\n private String... | import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import androidx.appcompat.app.AlertDialog;
import android.text.InputType;
import android.text.method.HideReturns... | myAddressname.setText(myName);
otherAddressname.setText(otherName);
errormsg.setVisibility(tx.isError() ? View.VISIBLE : View.GONE);
myAddressaddr.setText(tx.getFromAddress());
otherAddressaddr.setText(tx.getToAddress());
SimpleDateFormat dateformat = new SimpleDateForma... | public static void writeDownPassword(final WalletGenActivity c) { | 2 |
sandflow/regxmllib | src/main/java/com/sandflow/smpte/regxml/MXFFragmentBuilder.java | [
"public interface Group {\n\n /**\n * Retrieves the items of the Group\n * \n * @return Ordered collection of all items within the Group\n */\n Collection<Triplet> getItems();\n\n /**\n * Returns the Key of the Group\n * \n * @return Key of the Group\n */\n UL getKey();\n ... | import com.sandflow.smpte.klv.Group;
import com.sandflow.smpte.klv.KLVInputStream;
import com.sandflow.smpte.klv.LocalSet;
import com.sandflow.smpte.klv.LocalTagRegister;
import com.sandflow.smpte.klv.Triplet;
import com.sandflow.smpte.klv.exceptions.KLVException;
import com.sandflow.smpte.mxf.FillItem;
import com.sand... | /*
* Copyright (c) 2015, Pierre-Anthony Lemieux (pal@sandflow.com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notic... | HashMap<UUID, Set> setresolver = new HashMap<>(); | 4 |
oSoc14/Artoria | app/src/main/java/be/artoria/belfortapp/mixare/mgr/downloader/DownloadMgrImpl.java | [
"public class DataManager {\n\n public static int numberOfPOIs = 0;\n\n /* Check if the data should be refreshed after a resume or whatever,\n * make sure the data exists is reasonably fresh.\n */\n public static void refresh() {\n // TODO implement\n }\n\n public enum Language{\n ... | import android.util.Log;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import be.artoria.belfortapp.app.DataManager;
import be.artoria.belfortapp.mixare.MixContext;
import be.artoria.belfortapp.mixare.MixView;
import be... | /*
* Copyright (C) 2010- Peer internet solutions
*
* This file is part of be.artoria.belfortapp.mixare.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the Licen... | List<Marker> markers = DataConvertor.getInstance().load(DataManager.getAll()); | 0 |
nikkiii/java-webserver | src/org/nikki/http/fastcgi/FastCGIRequest.java | [
"public static final int FCGI_BEGIN_REQUEST = 1;",
"public static final int FCGI_KEEP_CONN = 1;",
"public static final int FCGI_PARAMS = 4;",
"public static final int FCGI_RESPONDER = 1;",
"public static final int FCGI_STDIN = 5;",
"public static final int FCGI_VERSION = 1;",
"public class HttpServer {\... | import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.nikki.http.HttpServer;
import org.nikki.http.net.HttpSession;
import static org.nikki.http.fastcgi.FastCGIConstants.FCGI_BEGIN_REQUEST;
import static org... | /**
* JavaHttpd, the flexible Java webserver
* Copyright (C) 2012 Nikki <nikki@nikkii.us>
*
* 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 ... | writeHeader(FCGI_BEGIN_REQUEST, 8); | 0 |
material-motion/material-motion-android | library/src/main/java/com/google/android/material/motion/sources/DynamicSpringSource.java | [
"public abstract class MotionBuilder<T> {\n\n public abstract void start(ReactiveProperty<T> property, T[] values);\n\n public abstract void stop();\n}",
"public abstract class MotionObserver<T> extends Observer<T> {\n\n @Override\n public abstract void next(T value);\n\n public abstract void build(MotionBui... | import android.annotation.SuppressLint;
import android.support.animation.DynamicAnimation;
import android.support.animation.DynamicAnimation.ViewProperty;
import android.support.animation.SpringAnimation;
import android.support.animation.SpringForce;
import android.support.v4.util.SimpleArrayMap;
import android.util.Pr... |
private void startBuild() {
if (initialized) {
for (MotionObserver<T> observer : observers) {
//noinspection unchecked
observer.build(
builder,
interaction.initialValue.read(),
interaction.initialVelocity.read(),
interaction.destination.read());
... | } else if (property == ViewProperties.SCROLL_X) { | 6 |
karsany/obridge | obridge-main/src/main/java/org/obridge/mappers/PojoMapper.java | [
"public class Procedure {\n\n private String objectName;\n private String procedureName;\n private String overload;\n private String methodType;\n private List<ProcedureArgument> argumentList;\n private List<BindParam> bindParams = null;\n private String callString;\n\n private Procedure() {... | import org.obridge.util.StringHelper;
import java.util.ArrayList;
import java.util.List;
import org.obridge.model.data.Procedure;
import org.obridge.model.data.ProcedureArgument;
import org.obridge.model.data.TypeAttribute;
import org.obridge.model.generator.Pojo;
import org.obridge.model.generator.PojoField; | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ferenc Karsany
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* us... | public static Pojo typeToPojo(String typeName, List<TypeAttribute> typeAttributes) { | 3 |
SiMolecule/centres | core/src/main/java/com/simolecule/centres/config/Atropisomeric.java | [
"public abstract class BaseMol<A, B> {\n\n private Fraction[] atomnums;\n\n public static final String CIP_LABEL_KEY = \"cip.label\";\n public static final String CONF_INDEX = \"conf.index\";\n\n public abstract Object getBaseImpl();\n\n public abstract int getNumAtoms();\n\n public abstract int getNumBond... | import com.simolecule.centres.Node;
import com.simolecule.centres.Stats;
import com.simolecule.centres.rules.Priority;
import com.simolecule.centres.rules.SequenceRule;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.simolecule.centres.BaseMol;
import com.simolecule.centres.Descripto... | /*
* Copyright (c) 2020 John Mayfield
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following d... | Node<A, B> root1 = digraph.getRoot(); | 2 |
MewX/light-novel-library_Wenku8_Android | studio-android/LightNovelLibrary/app/src/main/java/org/mewx/wenku8/adapter/NovelItemAdapterUpdate.java | [
"@SuppressWarnings({\"UnusedDeclaration\"})\npublic class GlobalConfig {\n\n // online arguments\n public static final String blogPageUrl = \"https://wenku8.mewx.org/\";\n public static final String versionCheckUrl = \"https://wenku8.mewx.org/version\";\n public static final String noticeCheckSc = \"htt... | import android.annotation.SuppressLint;
import android.os.AsyncTask;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TableRow;
import a... | package org.mewx.wenku8.adapter;
/**
* Created by MewX on 2015/1/20.
* Updated version of Novel Item Adapter.
*/
public class NovelItemAdapterUpdate extends RecyclerView.Adapter<NovelItemAdapterUpdate.ViewHolder> {
private MyItemClickListener mItemClickListener;
private MyOptionClickListener mMyOptionC... | if(!GlobalConfig.testInBookshelf()) | 0 |
lgvalle/Beautiful-Photos | app/src/test/java/com/lgvalle/beaufitulphotos/BeautifulPhotosPresenterTest.java | [
"public class PhotosAvailableEvent {\n\tprivate final List<? extends PhotoModel> photos;\n\n\tpublic PhotosAvailableEvent(List<? extends PhotoModel> photos) {\n\t\tthis.photos = photos;\n\t}\n\n\tpublic List<? extends PhotoModel> getPhotos() {\n\t\treturn photos;\n\t}\n}",
"@RestService\npublic interface Api500px... | import com.lgvalle.beaufitulphotos.events.PhotosAvailableEvent;
import com.lgvalle.beaufitulphotos.fivehundredpxs.Api500pxService;
import com.lgvalle.beaufitulphotos.fivehundredpxs.model.Feature;
import com.lgvalle.beaufitulphotos.fivehundredpxs.model.Photo500px;
import com.lgvalle.beaufitulphotos.fivehundredpxs.model.... | package com.lgvalle.beaufitulphotos;
/**
* Created by lgvalle on 23/07/14.
*/
@Config(emulateSdk = 18)
@RunWith(RobolectricTestRunner.class)
public class BeautifulPhotosPresenterTest {
Response<PhotosResponse> validResponse;
PhotosResponse photosResponse = new PhotosResponse();
| private BeautifulPhotosPresenter presenter; | 5 |
QuickServerLab/QuickCached | src/main/com/quickserverlab/quickcached/BinaryCommandProcessor.java | [
"public class BinaryPacket {\n\tprivate static final Logger logger = Logger.getLogger(BinaryPacket.class.getName());\n\t\n\tprivate Header header;\n\tprivate Extras extras;\n\t\n\tprivate String key;\n\tprivate String encodedKey;\n\tprivate byte[] value;\n\n\t/*\n\t Byte/ 0 | 1 | 2 ... | import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.quickserverlab.quickcached.... | package com.quickserverlab.quickcached;
/**
*
* @author akshath
*/
public class BinaryCommandProcessor {
private static final Logger logger = Logger.getLogger(BinaryCommandProcessor.class.getName());
private static byte[] version = null;
static {
try {
version = QuickCached.version.getBytes(HexUtil.getCh... | ResponseHeader rh = new ResponseHeader(); | 3 |
FedUni/caliko | caliko-demo/src/main/java/au/edu/federation/caliko/demo2d/MultipleConnectedChainsLocalRelativeBaseBoneConstraints.java | [
"public enum BoneConnectionPoint { START, END }",
"public class FabrikBone2D implements FabrikBone<Vec2f,FabrikJoint2D>\r\n{\r\n\t/**\r\n\t * mJoint\tThe joint attached to this FabrikBone2D.\r\n\t * <p>\r\n\t * Each bone has a single FabrikJoint2D which controls the angle to which the bone is\r\n\t * constrained ... | import au.edu.federation.caliko.BoneConnectionPoint;
import au.edu.federation.caliko.FabrikBone2D;
import au.edu.federation.caliko.FabrikChain2D;
import au.edu.federation.caliko.FabrikChain2D.BaseboneConstraintType2D;
import au.edu.federation.caliko.FabrikStructure2D;
import au.edu.federation.utils.Mat4f;
import au.edu... | package au.edu.federation.caliko.demo2d;
/**
* @author jsalvo
*/
public class MultipleConnectedChainsLocalRelativeBaseBoneConstraints extends CalikoDemoStructure2D {
@Override
public void setup() {
// Instantiate our FabrikStructure2D
this.structure = new FabrikStructure2D("Demo 5 - Multiple connected chains... | public void drawTarget(Mat4f mvpMatrix) { | 5 |
RGreenlees/JUMI-Java-Model-Importer | src/com/jumi/obj/OBJLoader.java | [
"public class JUMILoader {\r\n\r\n /** Load the supplied file and return a standardised JUMIScene data structure\r\n * \r\n * @param filename The file to load\r\n * @return JUMIScene - A simplified data structure containing key elements\r\n */\r\n public static JUMIScene loadModel(String filen... | import com.jumi.JUMILoader;
import com.jumi.data.Vector2;
import com.jumi.data.Vector3;
import com.jumi.obj.objects.definitions.OBJMatLibDefinition;
import com.jumi.obj.objects.definitions.OBJModelDefinition;
import com.jumi.scene.JUMIScene;
import com.jumi.scene.objects.JUMIMesh;
import java.io.BufferedReader;
... | /*
* (C) Copyright 2015 Richard Greenlees
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,... | OBJMatLibDefinition materialLibrary = null;
| 3 |
liyuanhust/LoadMoreHelper | testapp/src/main/java/com/lain/loadmoretest/Fragment4.java | [
"public interface IDataSwapper<DT> {\n /**\n * Swap all datas\n */\n void swapData(List<? extends DT> list);\n /**\n * Append data to the end of current list\n */\n void appendData(List<? extends DT> list);\n}",
"public abstract class LoadMoreHelper<DT> {\n\n /**\n * Call to loa... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.wi... | package com.lain.loadmoretest;
/**
* Created by liyuan on 17/4/6.
* Layout with {@link SwipeRefreshLayout}
* and {@link ListView}
*/
public class Fragment4 extends Fragment {
private List<Item> datas = new ArrayList<>();
private LoadMoreHelper<Item> loadHelper;
@Override
public void onCreate(... | DataLoader.loadData(pageIndex, null) | 3 |
hanhailong/VCL-Android | vlc-android/src/org/videolan/vlc/gui/MainActivity.java | [
"public final class BuildConfig {\n public static final boolean DEBUG = Boolean.parseBoolean(\"true\");\n public static final String APPLICATION_ID = \"org.videolan.vlc.debug\";\n public static final String BUILD_TYPE = \"debug\";\n public static final String FLAVOR = \"chromeARMv5\";\n public static final int... | import android.annotation.TargetApi;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android... | * any time after onCreate.
*/
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.media_library, menu);
if (AndroidUtil.isFroyoOrLater()) {
SearchManager searchManager =
(SearchManager) VLCApplication.getAppContext().getSystemServ... | VideoPlayerActivity.start(this, uri); | 4 |
sismics/home | home-web-common/src/main/java/com/sismics/util/filter/RequestContextFilter.java | [
"public class AppContext {\n /**\n * Singleton instance.\n */\n private static AppContext instance;\n\n /**\n * Event bus.\n */\n private EventBus eventBus;\n \n /**\n * Generic asynchronous event bus.\n */\n private EventBus asyncEventBus;\n\n /**\n * Sensor serv... | import java.io.File;
import java.io.IOException;
import java.text.MessageFormat;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.H... | package com.sismics.util.filter;
/**
* Filter used to process a couple things in the request context.
*
* @author jtremeaux
*/
public class RequestContextFilter implements Filter {
/**
* Logger.
*/
private static final Logger log = LoggerFactory.getLogger(RequestContextFilter.class);
@O... | EnvironmentUtil.setWebappContext(true); | 3 |
gjhutchison/pixelhorrorjam2016 | core/src/com/kowaisugoi/game/rooms/RoomHallway.java | [
"public class AudioManager implements Disposable {\n private static final Map<SoundId, Sound> _soundMap = new HashMap<SoundId, Sound>();\n private static final Map<MusicId, Music> _musicMap = new HashMap<MusicId, Music>();\n\n private static MusicId _currentSong = MusicId.NONE;\n\n public static void in... | import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Rectangle;
import com.kowaisugoi.game.audio.AudioManager;
import com.kowaisugoi.game.audio.MusicId;
import com.kowaisugoi.game.audio.SoundId;
import com.k... | package com.kowaisugoi.game.rooms;
public class RoomHallway extends StandardRoom {
private static final String ROOM_URL = "rooms/hallway/hallway.png";
private static final String ROOM_URL2 = "rooms/hallway/hallway_night.png";
private static final String OH_HI = "rooms/hallway/hallway_hai.png";
pri... | Passage passageMainRoom = new DirectionalPassage(RoomId.HALLWAY, | 3 |
denis-zhdanov/traute | core/test/src/test/java/tech/harmonysoft/oss/traute/test/suite/MethodReturnTest.java | [
"public class TrauteConstants {\n\n public static final String PLUGIN_NAME = \"Traute\";\n\n public static final Set<String> PRIMITIVE_TYPES = Collections.unmodifiableSet(new HashSet<>(asList(\n \"boolean\", \"byte\", \"short\", \"char\", \"int\", \"long\", \"float\", \"double\"\n )));\n\n pu... | import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.springframework.lang.NonNullApi;
import tech.harmonysoft.oss.traute.common.util.TrauteConstants;
import tech.harmonysoft.oss.traute.test.fixture.NN;
import tech.harmonysoft.oss.traute.test.i... | package tech.harmonysoft.oss.traute.test.suite;
public abstract class MethodReturnTest extends AbstractTrauteTest {
@Test
public void noDoubleEvaluation() {
String testSource = String.format(
"package %s;\n" +
"\n" +
"public class %s {\n" +
... | "}", PACKAGE, CLASS_NAME, NotNull.class.getName()); | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.