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 |
|---|---|---|---|---|---|---|
GoogleCloudPlatform/weasis-chcapi-extension | src/main/java/org/weasis/dicom/google/api/ui/dicomstore/DicomStoreSelector.java | [
"public class GoogleAPIClient {\n\n private static final String APPLICATION_NAME = \"Weasis-GoogleDICOMExplorer/1.0\";\n\n /**\n * Directory to store user credentials.\n */\n private static final java.io.File DATA_STORE_DIR = new java.io.File(System.getProperty(\"user.home\"), \".weasis/google_auth... | import org.weasis.dicom.google.api.GoogleAPIClient;
import org.weasis.dicom.google.api.model.Dataset;
import org.weasis.dicom.google.api.model.DicomStore;
import org.weasis.dicom.google.api.model.Location;
import org.weasis.dicom.google.api.model.ProjectDescriptor;
import org.weasis.dicom.google.api.model.StudyQuery;
i... |
googleProjectCombobox.setRenderer(new ListRenderer<>(ProjectDescriptor::getName, DEFAULT_PROJECT_COMBOBOX_TEXT));
googleLocationCombobox.setRenderer(new ListRenderer<>(Location::getId, DEFAULT_LOCATION_COMBOBOX_TEXT));
googleDatasetCombobox.setRenderer(new ListRenderer<>(Dataset::getName, DEFAU... | public void updateTable(List<StudyView> studies) { | 7 |
monapu/monacoinj-multibit | core/src/test/java/com/google/bitcoin/store/WalletProtobufSerializerTest.java | [
"public enum ConfidenceType {\n /** If BUILDING, then the transaction is included in the best chain and your confidence in it is increasing. */\n BUILDING(1),\n\n /**\n * If PENDING, then the transaction is unconfirmed and should be included shortly, as long as it is being\n * announced and is cons... | import com.google.bitcoin.core.*;
import com.google.bitcoin.core.TransactionConfidence.ConfidenceType;
import com.google.bitcoin.params.MainNetParams;
import com.google.bitcoin.params.UnitTestParams;
import com.google.bitcoin.script.ScriptBuilder;
import com.google.bitcoin.utils.BriefLogFormatter;
import com.google.bit... | Transaction t1 = createFakeTx(params, v1, myAddress);
t1.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("1.2.3.4")));
t1.getConfidence().markBroadcastBy(new PeerAddress(InetAddress.getByName("5.6.7.8")));
t1.getConfidence().setSource(TransactionConfidence.Source.NE... | Threading.waitForUserCode(); | 4 |
berict/Tapad | app/src/main/java/com/bedrock/padder/model/preset/Preset.java | [
"public class SoundHelper {\n\n private static Preset previousPreset = null;\n\n private SoundPool sp = new SoundPool(16, AudioManager.STREAM_MUSIC, 0);\n\n private MediaMetadataRetriever mmr = new MediaMetadataRetriever();\n\n private Activity activity;\n\n private int buttonId[] = {\n R.... | import android.app.Activity;
import com.bedrock.padder.helper.SoundHelper;
import com.bedrock.padder.model.about.About;
import com.bedrock.padder.model.preferences.Preferences;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.File;
import static com.bedrock.padder.activity.MainActivity.is... | public String getTag() {
return tag;
}
public Boolean isGesture() {
return isGesture;
}
public Integer getSoundCount() {
return soundCount;
}
public Integer getBpm() {
return bpm;
}
public void setTag(String tag) {
this.tag = tag;
}
... | SoundHelper sound = new SoundHelper(); | 0 |
florian-mollin/loto-associatif-app | Loto/src/main/java/com/mollin/loto/gui/main/numberpane/LotoNumberPaneGUI.java | [
"public class AdaptativeText extends Text {\n\n /**\n * Constructeur du texte\n *\n * @param label Le label\n * @param fontSize Le binding correspondant à la taille de la police\n */\n public AdaptativeText(String label, NumberExpression fontSize) {\n super(label);\n Strin... | import com.mollin.loto.gui.main.utils.AdaptativeText;
import com.mollin.loto.gui.main.utils.FontSizeCalculator;
import com.mollin.loto.gui.utils.Utils;
import com.mollin.loto.logic.main.grid.Grid;
import com.mollin.loto.logic.main.grid.LotoGridListener;
import com.mollin.loto.logic.main.utils.Constants;
import javafx.b... | package com.mollin.loto.gui.main.numberpane;
/**
* Panneau d'affichage du dernier numéro tiré
*
* @author MOLLIN Florian
*/
public class LotoNumberPaneGUI extends StackPane implements LotoGridListener {
/**
* Paramètres du panneau
*/
private final LotoNumberPaneGUIParameters param;
/**
... | Constants.FontSize.FONT_SIZE_MAX_PANE_TEXT, | 5 |
mpusher/mpush-client-java | src/main/java/com/mpush/client/AckRequestMgr.java | [
"public interface Logger {\n\n void enable(boolean enabled);\n\n void d(String s, Object... args);\n\n void i(String s, Object... args);\n\n void w(String s, Object... args);\n\n void e(Throwable e, String s, Object... args);\n}",
"public interface AckCallback {\n void onSuccess(Packet response)... | import com.mpush.api.Logger;
import com.mpush.api.ack.AckCallback;
import com.mpush.api.ack.AckContext;
import com.mpush.api.ack.AckModel;
import com.mpush.api.ack.RetryCondition;
import com.mpush.api.connection.Connection;
import com.mpush.api.protocol.Packet;
import com.mpush.util.thread.ExecutorManager;
import java.... | /*
* (C) Copyright 2015-2016 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... | private RetryCondition retryCondition; | 4 |
ofelbaum/spb-transport-app | src/main/java/com/emal/android/transport/spb/activity/SearchActivity.java | [
"public enum VehicleType {\n BUS(\"vehicle_bus\", \"0\", \"A\", false, Color.BLUE),\n TROLLEY(\"vehicle_trolley\", \"1\", \"Ш\", true, Color.GREEN),\n TRAM(\"vehicle_tram\", \"2\", \"T\", false, Color.RED),\n SHIP(\"vehicle_ship\", \"46\", \"S\", false, Color.YELLOW);\n\n private String code;\n pr... | import android.app.Activity;
import android.graphics.*;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.*;
import android.view.MenuItem;
import android.widget.*;
import com.emal.android.transport.spb.R;
import com.emal.android.transport.spb.VehicleType;
import com.ema... | package com.emal.android.transport.spb.activity;
/**
* @author alexey.emelyanenko@gmail.com
* @since 1.5
*/
public class SearchActivity extends Activity {
private static final String TAG = SearchActivity.class.getName();
private SearchView searchView;
private ListView listView;
private AsyncTask... | private List<Route> findedRoutes; | 5 |
CaMnter/EasyGank | app/src/main/java/com/camnter/easygank/views/EasyWebViewActivity.java | [
"public abstract class BaseToolbarActivity extends BaseAppCompatActivity {\n\n @Bind(R.id.toolbar) protected Toolbar mToolbar;\n @Bind(R.id.app_bar_layout) protected AppBarLayout mAppBarLayout;\n\n protected ActionBarHelper mActionBarHelper;\n\n\n /**\n * Initialize the toolbar in the layout\n *... | import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.design.widget.Snackbar;
import a... | /*
* {EasyGank} Copyright (C) {2015} {CaMnter}
*
* This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
* This is free software, and you are welcome to redistribute it
* under certain conditions; type `show c' for details.
*
* The hypothetical commands `show w' and `show c' should show th... | WebViewUtils.injectCSS(EasyWebViewActivity.this, | 7 |
signalfx/signalfx-java | signalfx-java/src/main/java/com/signalfx/metrics/flush/AggregateMetricSender.java | [
"public class SignalFxMetricsException extends RuntimeException {\n private static final long serialVersionUID = 1L;\n\n public SignalFxMetricsException() {\n }\n\n public SignalFxMetricsException(String message) {\n super(message);\n }\n\n public SignalFxMetricsException(String message, Th... | import static java.util.Objects.requireNonNull;
import com.signalfx.metrics.SignalFxMetricsException;
import com.signalfx.metrics.auth.AuthToken;
import com.signalfx.metrics.auth.NoAuthTokenException;
import com.signalfx.metrics.connection.DataPointReceiver;
import com.signalfx.metrics.connection.DataPointReceiverFacto... | SignalFxProtocolBuffers.Datum.newBuilder().setDoubleValue(value).build())
.build());
return this;
}
@Override
public Session setDatapoint(SignalFxProtocolBuffers.DataPoint datapoint) {
check(datapoint.getM... | EventReceiver eventReceiver = eventReceiverFactory.createEventReceiver(); | 5 |
Derek-Ashmore/moneta | moneta-core/src/main/java/org/moneta/dao/MonetaSearchDAO.java | [
"public class MonetaEnvironment extends BaseType {\r\n\t\r\n\tprivate static MonetaConfiguration configuration;\r\n\r\n\tpublic static MonetaConfiguration getConfiguration() {\r\n\t\treturn configuration;\r\n\t}\r\n\r\n\tpublic static void setConfiguration(MonetaConfiguration configuration) {\r\n\t\tMonetaEnvironme... | import org.apache.commons.lang3.Validate;
import org.moneta.config.MonetaEnvironment;
import org.moneta.dao.sqlgen.SqlGeneratorFactory;
import org.moneta.dao.types.SqlStatement;
import org.moneta.types.search.SearchRequest;
import org.moneta.types.search.SearchResult;
import org.moneta.types.topic.MonetaDataSourc... | /*
* This software is licensed under the Apache License, Version 2.0
* (the "License") agreement; 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 agree... | Topic searchTopic = MonetaEnvironment.getConfiguration().getTopic(request.getTopic());
| 6 |
OvercastNetwork/Tracker | src/main/java/tc/oc/tracker/damage/resolvers/ProjectileDamageResolver.java | [
"public interface DamageInfo {\n /**\n * Gets the living entity most responsible for this damage.\n *\n * @return Resolved damager or null if none exists\n */\n @Nullable LivingEntity getResolvedDamager();\n}",
"public interface DamageResolver {\n @Nullable DamageInfo resolve(@Nonnull Liv... | import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import tc.oc.tracker.DamageInfo;
import t... | package tc.oc.tracker.damage.resolvers;
public class ProjectileDamageResolver implements DamageResolver {
private final ProjectileDistanceTracker projectileDistanceTracker;
public ProjectileDamageResolver(ProjectileDistanceTracker projectileDistanceTracker) {
this.projectileDistanceTracker = projec... | public @Nullable DamageInfo resolve(@Nonnull LivingEntity entity, @Nonnull Lifetime lifetime, @Nonnull EntityDamageEvent damageEvent) { | 0 |
release-engineering/pom-version-manipulator | src/test/java/com/redhat/rcm/version/mgr/ToolchainManagementTest.java | [
"public static void dumpModel( final Model model )\n throws IOException\n{\n final StringWriter writer = new StringWriter();\n new MavenXpp3Writer().write( writer, model );\n\n System.out.println( \"\\n\\n\" + writer.toString() + \"\\n\\n\" );\n}",
"public static File getResourceFile( final String pat... | import static com.redhat.rcm.version.testutil.PluginMatcher.mavenPlugin;
import static com.redhat.rcm.version.testutil.PluginMatcher.plugin;
import static com.redhat.rcm.version.testutil.TestProjectFixture.dumpModel;
import static com.redhat.rcm.version.testutil.TestProjectFixture.getResourceFile;
import static com.red... | /*
* Copyright (c) 2010 Red Hat, Inc.
*
* 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 di... | final SessionBuilder builder = | 7 |
open-erp-systems/erp-backend | erp-core/src/main/java/com/jukusoft/erp/core/module/base/service/cache/CacheController.java | [
"public interface CacheManager {\n\n /**\n * get instance of cache\n *\n * @param cacheName name of cache\n *\n * @return instance of cache or null, if cache doesnt exists\n */\n public ICache getCache (String cacheName);\n\n /**\n * get instance of cache or create an new one, if ... | import com.jukusoft.erp.lib.annotation.PermissionRequired;
import com.jukusoft.erp.lib.cache.CacheManager;
import com.jukusoft.erp.lib.message.StatusCode;
import com.jukusoft.erp.lib.message.request.ApiRequest;
import com.jukusoft.erp.lib.message.response.ApiResponse;
import com.jukusoft.erp.lib.route.Route;
import com... | package com.jukusoft.erp.core.module.base.service.cache;
public class CacheController extends AbstractController {
@Route(routes = "/clear-cache")
@PermissionRequired(requiredPermissions = "CAN_CLEAR_CACHE") | public void clearCache (Message<ApiRequest> event, ApiRequest req, ApiResponse response, Handler<AsyncResult<ApiResponse>> handler) { | 3 |
isisaddons/isis-app-todoapp | fixture/src/main/java/todoapp/fixture/scenarios/RecreateDickUserAndRolesAndToDoItems.java | [
"public class ToDoAppFixtureServiceRoleAndPermissions extends AbstractRoleAndPermissionsFixtureScript {\n\n public static final String ROLE_NAME = \"todoapp-fixture-scripts\";\n\n public ToDoAppFixtureServiceRoleAndPermissions() {\n super(ROLE_NAME, \"Execute the ToDoApp fixture scripts\");\n }\n\n ... | import java.util.Arrays;
import org.isisaddons.module.security.seed.scripts.IsisModuleSecurityRegularUserRoleAndPermissions;
import todoapp.dom.seed.roles.ToDoAppFixtureServiceRoleAndPermissions;
import todoapp.dom.seed.roles.ToDoAppRegularRoleAndPermissions;
import todoapp.fixture.module.DeleteUserAndUserRolesAndToDoI... | /*
* Copyright 2014 Dan Haywood
*
* Licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | ToDoAppRegularRoleAndPermissions.ROLE_NAME, | 1 |
ddoa/dea-code-examples | examples/simpleorder-javaee/src/test/java/oose/dea/services/rest/ItemRestServiceIT.java | [
"public interface IntegrationTest {\n}",
"public class Item {\n private String sku;\n private String category;\n private String title;\n\n public Item() {\n }\n\n public Item(String sku, String category, String title) {\n this.sku = sku;\n this.category = category;\n this.ti... | import oose.dea.IntegrationTest;
import oose.dea.dataaccess.Item;
import oose.dea.dataaccess.ItemDAO;
import org.glassfish.hk2.api.Factory;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.test.JerseyTest;
import org.junit.Test;
im... | package oose.dea.services.rest;
@Category(IntegrationTest.class)
public class ItemRestServiceIT extends JerseyTest {
@Test
public void findAll() throws Exception {
final String items = target("/items").request().get(String.class);
assertEquals("[{\"sku\":\"frik\",\"category\":\"Vette hap\"... | bindFactory(ServiceProvider.class).to(ItemDAO.class); | 2 |
leavjenn/Hews | app/src/test/java/com/leavjenn/hews/ui/search/SearchPresenterTest.java | [
"public class RxSchedulersOverrideRule implements TestRule {\n\n private final RxJavaSchedulersHook mRxJavaSchedulersHook = new RxJavaSchedulersHook() {\n @Override\n public Scheduler getIOScheduler() {\n return Schedulers.immediate();\n }\n\n @Override\n public Sche... | import com.leavjenn.hews.R;
import com.leavjenn.hews.RxSchedulersOverrideRule;
import com.leavjenn.hews.misc.SharedPrefsContract;
import com.leavjenn.hews.misc.UtilsContract;
import com.leavjenn.hews.model.HNItem;
import com.leavjenn.hews.data.remote.DataManager;
import org.junit.After;
import org.junit.Before;
import ... | package com.leavjenn.hews.ui.search;
@RunWith(MockitoJUnitRunner.class)
public class SearchPresenterTest {
private SearchPresenter mPresenter;
@Mock
private SearchView mSearchView;
@Mock
private DataManager mDataManager;
@Mock | private SharedPrefsContract mPrefsManager; | 1 |
juankysoriano/rainbow | rainbow-lib/src/main/java/com/juankysoriano/rainbow/core/graphics/RainbowGraphics2D.java | [
"public interface Modes {\n enum Arc {\n UNDEFINED,\n OPEN,\n CHORD,\n PIE\n }\n\n enum Blend {\n REPLACE,\n BLEND,\n ADD,\n SUBTRACT,\n LIGHTEST,\n DARKEST,\n DIFFERENCE,\n EXCLUSION,\n MULTIPLY,\n SCREEN,\n ... | import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
import com.juankysoriano.rainbow.core.drawing.Modes;
import com.juankysoriano.rainbow.core.drawing.RainbowTextureView;
import com.juankysoriano.rainbow.core.matrix.RMatrix;
import com.juankysoriano.rainbow.core.matri... | canvas.drawOval(rect, strokePaint);
}
}
/**
* Ignored (not needed)
*/
@Override
public void bezierDetail(int detail) {
}
/**
* Ignored (not needed)
*/
@Override
public void curveDetail(int detail) {
}
@Override
public void smooth() {... | public RMatrix getMatrix() { | 2 |
kihira/Tails | src/main/java/uk/kihira/tails/proxy/ClientProxy.java | [
"public class ClientEventHandler \n{\n private boolean sentPartInfoToServer = false;\n private boolean clearAllPartInfo = false;\n\n /*\n *** Tails Editor Button ***\n */\n @SubscribeEvent\n public void onScreenInitPost(GuiScreenEvent.InitGuiEvent.Post event) \n {\n if (event.getGui... | import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.PlayerRenderer;
import net.minecraftforge.common.MinecraftForge;
import uk.kihira.tails.client.ClientEventHandler;
import uk.kihira.tails.client.MountPoint;
import uk.kihira.tails.client.PartRenderer;
import uk.kihira.tails.client.render... | package uk.kihira.tails.proxy;
public class ClientProxy extends CommonProxy
{
public PartRenderer partRenderer;
@Override
public void preInit()
{
registerMessages();
registerHandlers(); | this.libraryManager = new LibraryManager.ClientLibraryManager(); | 4 |
Gocnak/Botnak | src/main/java/gui/listeners/PaneMenuListener.java | [
"public class ChatPane implements DocumentListener {\n\n private JFrame poppedOutPane = null;\n\n // The timestamp of when we decided to wait to scroll back down\n private long scrollbarTimestamp = -1;\n\n public void setPoppedOutPane(JFrame pane) {\n poppedOutPane = pane;\n }\n\n public JF... | import gui.ChatPane;
import gui.CombinedChatPane;
import gui.forms.GUIMain;
import gui.forms.GUIViewerList;
import util.Utils;
import util.settings.Settings;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; | package gui.listeners;
/**
* Created by Nick on 1/18/14.
*/
public class PaneMenuListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
JMenuItem source = (JMenuItem) e.getSource();
if (source != null && source.getText() != null) { | ChatPane pane = Utils.getChatPane(GUIMain.channelPane.getSelectedIndex()); | 4 |
JamesNorris/Ablockalypse | src/com/github/jamesnorris/ablockalypse/threading/inherent/ClaymoreActionTask.java | [
"public class Ablockalypse extends JavaPlugin {\n private static Ablockalypse instance;\n private static DataContainer data = new DataContainer();\n private static MainThread mainThread;\n private static External external;\n private static BaseCommand commandInstance;\n private static Tracker trac... | import com.github.jamesnorris.ablockalypse.Ablockalypse;
import com.github.jamesnorris.ablockalypse.DataContainer;
import com.github.jamesnorris.ablockalypse.aspect.Claymore;
import com.github.jamesnorris.ablockalypse.aspect.ZAMob;
import com.github.jamesnorris.ablockalypse.threading.RepeatingTask;
| package com.github.jamesnorris.ablockalypse.threading.inherent;
public class ClaymoreActionTask extends RepeatingTask {
private static final int INTERVAL = 20;
private Claymore claymore;
private DataContainer data = Ablockalypse.getData();
public ClaymoreActionTask(Claymore claymore, boolean ... | for (ZAMob mob : data.getObjectsOfType(ZAMob.class)) {
| 3 |
Ouyangan/hunt-admin | hunt-web/src/main/java/com/hunt/controller/BaseController.java | [
"public class GeetestLib {\n\n /**\n * 极验验证二次验证表单数据 chllenge\n */\n public static final String fn_geetest_challenge = \"geetest_challenge\";\n /**\n * 极验验证二次验证表单数据 validate\n */\n public static final String fn_geetest_validate = \"geetest_validate\";\n /**\n * 极验验证二次验证表单数据 seccode... | import com.google.gson.Gson;
import com.hunt.system.security.geetest.GeetestLib;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.authz.UnauthenticatedException;
import org.apache.shiro.authz.UnauthorizedException;
import org.slf... | package com.hunt.controller;
/**
* 基础controller,方便统一异常处理
*
* @Author: ouyangan
* @Date : 2016/10/8
*/
public class BaseController {
private static final Logger log = LoggerFactory.getLogger(BaseController.class);
@Autowired
private SystemService systemService;
/**
* 极限验证码二次验证
*
*... | log.error("exception occur : \n {}", StringUtil.exceptionDetail(exception)); | 4 |
alechenninger/monarch | bin/src/io/github/alechenninger/monarch/apply/ApplyChangesOptionsFromSerializableConfig.java | [
"public interface Change {\n static Change forVariables(Map<String, String> variables, Map<String, Object> set,\n Collection<String> remove) {\n return new DefaultChange(SourceSpec.byVariables(variables), set, remove);\n }\n\n static Change forPath(String path, Map<String, Object> set, Collection<String>... | import io.github.alechenninger.monarch.Change;
import io.github.alechenninger.monarch.Hierarchy;
import io.github.alechenninger.monarch.SerializableConfig;
import io.github.alechenninger.monarch.SourceSpec;
import io.github.alechenninger.monarch.yaml.YamlConfiguration;
import java.nio.file.FileSystem;
import java.nio.f... | /*
* monarch - A tool for managing hierarchical data.
* Copyright (C) 2016 Alec Henninger
*
* 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... | public Optional<SourceSpec> target() { | 3 |
mzlogin/guanggoo-android | app/src/main/java/org/mazhuang/guanggoo/topiclist/TopicListPresenter.java | [
"public class NetworkTaskScheduler {\n\n private ExecutorService mExecutor;\n\n private static class InstanceHolder {\n private static NetworkTaskScheduler sInstance = new NetworkTaskScheduler();\n }\n\n public static NetworkTaskScheduler getInstance() {\n return InstanceHolder.sInstance;\... | import org.mazhuang.guanggoo.data.NetworkTaskScheduler;
import org.mazhuang.guanggoo.data.OnResponseListener;
import org.mazhuang.guanggoo.data.entity.ListResult;
import org.mazhuang.guanggoo.data.entity.Topic;
import org.mazhuang.guanggoo.data.task.BaseTask;
import org.mazhuang.guanggoo.data.task.GetTopicListTask;
imp... | package org.mazhuang.guanggoo.topiclist;
/**
*
* @author mazhuang
* @date 2017/9/16
*/
public class TopicListPresenter implements TopicListContract.Presenter {
private TopicListContract.View mView;
private BaseTask mCurrentTask;
private int mPagination;
public TopicListPresenter(TopicListCo... | new OnResponseListener<ListResult<Topic>>() { | 3 |
mleoking/LeoTask | leotask/src/app/org/leores/demo/UtilDemo.java | [
"public class Logger {\r\n\tprotected final static int LOG_MAX = 100;\r\n\tprotected final static int LOG_CRITICAL = 80;\r\n\tprotected final static int LOG_ERROR = 70;\r\n\tprotected final static int LOG_WARNING = 60;\r\n\tprotected final static int LOG_INFO = 50; //default log level\r\n\tprotected final static in... | import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import org.leores.util.Logger;
import org.leores.util.ObjArray;
import org.leores.util.SysUtil;
import org.leores.util.SysUtil.Command;
import org.leores.util.U;
import org.leores.util.able.Processable2;
import org.leores.util.data... | package org.leores.demo;
public class UtilDemo extends Demo {
public void parseList() {
String str = "10@3;6;0;1:3:10}0.1:0.2:1;0.5@4;0.99;0.88;0.77";
List ls = U.parseList(String.class, str); // "}" block the string into two strings.
List l1 = U.parseList(Integer.class, (String) ls.get(0));
List... | String sMethodPattern1 = Statistics.sMethodPattern("-");
| 6 |
advantageous/ddp-client-java | ddp-client/src/main/java/io/advantageous/ddp/subscription/BaseSubscriptionAdapter.java | [
"public interface DDPMessageEndpoint {\n void disconnect() throws IOException;\n\n void connect(String address) throws IOException, InterruptedException;\n\n <T> void registerHandler(Class<T> messageType, DDPMessageHandler.Phase phase, DDPMessageHandler<T> handler);\n\n <T> void registerHandler(Class<T>... | import io.advantageous.ddp.DDPMessageEndpoint;
import io.advantageous.ddp.subscription.message.NoSubscriptionMessage;
import io.advantageous.ddp.subscription.message.ReadyMessage;
import io.advantageous.ddp.subscription.message.SubscribeMessage;
import io.advantageous.ddp.subscription.message.UnsubscribeMessage;
import... | /*
* Copyright (C) 2014. Geoffrey Chandler.
*
* 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 ag... | final UnsubscribeMessage message = new UnsubscribeMessage(); | 4 |
52North/SensorPlanningService | 52n-sps-api/src/main/java/org/n52/sps/service/SpsComponentProvider.java | [
"public interface SpsAdmin extends CapabilitiesInterceptor, SpsOperationExtension {\r\n \r\n final static String INSERT_SENSOR_OFFERING = \"InsertSensorOffering\";\r\n \r\n final static String INSERT_RESOURCE = \"insert\";\r\n \r\n final static String DELETE_SENSOR_OFFERING = \"DeleteSensorOfferin... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import net.opengis.ows.x11.AcceptVersionsType;
import net.opengis.sps.x20.CapabilitiesDocument;
import net.opengis.sps.x20.CapabilitiesType;
import net.opengis.sps.x20.GetCapabilitiesDocument;
import net.opengis.sps.x20.GetCapabilitiesTy... | /**
* Copyright (C) 2012-${latestYearOfContribution} 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as publishedby the Free
* Software Foundation.
*
... | private ReservationManager reservationManager;
| 6 |
qqq3/good-weather | app/src/main/java/org/asdtm/goodweather/MainActivity.java | [
"public class CitySearch\n{\n private String mCityName;\n private String mCountry;\n private String mLatitude;\n private String mLongitude;\n private String mCountryCode;\n\n public CitySearch(){}\n public CitySearch(String cityName, String countryCode, String latitude, String longitude)\n {... | import android.Manifest;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.Share... | package org.asdtm.goodweather;
public class MainActivity extends BaseActivity implements AppBarLayout.OnOffsetChangedListener {
private static final String TAG = "MainActivity";
private static final long LOCATION_TIMEOUT_IN_MS = 30000L;
private TextView mIconWeatherView;
private TextView mTemper... | CurrentWeatherService.ACTION_WEATHER_UPDATE_RESULT)); | 2 |
EndlessCodeGroup/RPGInventory | src/main/java/ru/endlesscode/rpginventory/RPGInventoryCommandExecutor.java | [
"@SuppressWarnings({\"unused\"})\npublic class InventoryAPI {\n /**\n * Checks if opened inventory is RPGInventory.\n *\n * @param inventory - opened inventory\n * @return true - if opened RPGInventory, false - otherwise\n */\n public static boolean isRPGInventory(@NotNull Inventory invent... | import ru.endlesscode.rpginventory.item.ItemManager;
import ru.endlesscode.rpginventory.pet.PetManager;
import ru.endlesscode.rpginventory.utils.ItemUtils;
import ru.endlesscode.rpginventory.utils.StringUtils;
import java.util.List;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.Bukkit;
import org.b... | } else if (args.length > 1 && perms.has(sender, "rpginventory.open.others")) {
this.openInventory(sender, args[1]);
} else {
this.missingRights(sender);
}
} else {
this.printHelp(sender);
}
return true;
}
pr... | ItemCommandEvent event = new ItemCommandEvent(player, item); | 1 |
WASdev/tool.lars | client-lib-tests/src/fat/java/com/ibm/ws/repository/test/EsaResourceTest.java | [
"public static Object reflectiveCallAnyTypes(Object targetObject, String methodName, @SuppressWarnings(\"rawtypes\") Class[] classes, Object[] values)\n throws ClassNotFoundException, NoSuchMethodException, SecurityException, IllegalAccessException, InstantiationException,\n IllegalArgumentException, ... | import static com.ibm.ws.lars.testutils.BasicChecks.checkCopyFields;
import static com.ibm.ws.lars.testutils.BasicChecks.populateResource;
import static com.ibm.ws.lars.testutils.BasicChecks.simpleUpload;
import static com.ibm.ws.lars.testutils.ReflectionTricks.reflectiveCallAnyTypes;
import static com.ibm.ws.lars.test... | /*******************************************************************************
* Copyright (c) 2014 IBM Corp.
*
* 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.or... | protected EsaResourceImpl createTestObject(RestRepositoryConnection loginInfo) throws IOException { | 3 |
vy/hrrs | servlet-filter/src/main/java/com/vlkan/hrrs/servlet/HrrsFilter.java | [
"public interface HttpRequestHeader {\n\n String getName();\n\n String getValue();\n\n Builder toBuilder();\n\n interface Builder {\n\n Builder setName(String name);\n\n Builder setValue(String value);\n\n HttpRequestHeader build();\n\n }\n\n}",
"public enum HttpRequestMethod {... | import com.vlkan.hrrs.api.HttpRequestHeader;
import com.vlkan.hrrs.api.HttpRequestMethod;
import com.vlkan.hrrs.api.HttpRequestPayload;
import com.vlkan.hrrs.api.HttpRequestRecord;
import com.vlkan.hrrs.api.HttpRequestRecordWriter;
import com.vlkan.hrrs.api.HttpRequestRecordWriterTarget;
import com.vlkan.hrrs.api.Immut... | package com.vlkan.hrrs.servlet;
public abstract class HrrsFilter implements Filter {
private static final Logger LOGGER = LoggerFactory.getLogger(HrrsFilter.class);
public static final String SERVLET_CONTEXT_ATTRIBUTE_KEY = HrrsFilter.class.getCanonicalName();
public static final String DEFAULT_FORM_... | return ImmutableHttpRequestRecord | 8 |
HumBuch/HumBuch | src/main/java/de/dhbw/humbuch/view/DunningView.java | [
"public class MessageEvent {\r\n\r\n\tpublic final String caption;\r\n\tpublic final String message;\r\n\tpublic final Type type;\r\n\r\n\tpublic enum Type {\r\n\t\tINFO, TRAYINFO, WARNING, ERROR;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an event with the specified caption and {@link Type}.INFO as\r\n\t * standard type\... | import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Set;
import com.google.common.eventbus.EventBus;
import com.google.inject.Inject;
import com.va... | package de.dhbw.humbuch.view;
/**
* Provides the {@link View} to display and manage {@link Dunning}s
* @author Johannes Idelhauser
* @author Martin Wentzel
*/
public class DunningView extends VerticalLayout implements View,
ViewInformation {
private static final long serialVersionUID = 1284094636968999625L;... | public final State<Collection<Dunning>> dunnings = new BasicState<>(Collection.class); | 3 |
paoding-code/jade-plugin-sql | src/main/java/net/paoding/rose/jade/plugin/sql/dialect/mysql/ConditionalGenerator.java | [
"public static enum Operator {\n\t\t\n\t/**\n\t * 等于\n\t */\n\tEQ,\n\t\t\n\t/**\n\t * 不等于\n\t */\n\tNE,\n\t\t\n\t/**\n\t * 大于\n\t */\n\tGE,\n\t\t\n\t/**\n\t * 小于\n\t */\n\tLE,\n\t\t\n\t/**\n\t * 大于等于\n\t */\n\tGT,\n\t\t\n\t/**\n\t * 小于等于\n\t */\n\tLT,\n\t\t\n\t/**\n\t * like\n\t */\n\tLIKE,\n\t\t\n\t/**\n\t * in\n\... | import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.paoding.rose.jade.plugin.sql.Plum.Operator;
import net.paoding.rose.jade.plugin.sql.dialect.ISQLGenerator;
import net.paoding.rose.jade.plugin.sql.mapper.ConditionalOperationMapper;
import net.paoding.rose.ja... | /**
*
*/
package net.paoding.rose.jade.plugin.sql.dialect.mysql;
/**
* @author Alan.Geng[gengzhi718@gmail.com]
*
*/
public abstract class ConditionalGenerator implements ISQLGenerator<ConditionalOperationMapper> {
private static final Map<Operator, String> OPERATORS;
static {
Map<Operator, String> opera... | List<IParameterMapper> parameters = operationMapper.getParameters(); | 4 |
nextopcn/xcalendar | src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/widget/impl/XCalendarSelectWidget.java | [
"public class XCalendar extends Canvas {\n\t//\n\tprotected final XCalendarModel model;\n\tprotected final XCalendarEventBus bus;\n\tprotected final XCalendarReactor reactor;\n\tprotected volatile boolean editable = true;\n\tprotected final Map<Object, Object> cookies;\n\tprotected Map<XCalendarState, List<XCalenda... | import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.XCalendar;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.bus.internal.*;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.XCalendarModel;
import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.XCalendarConfig;
import ... | package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.widget.impl;
/**
* @author chenby
*
*/
public class XCalendarSelectWidget extends AbstractXCalendarWidget {
/**
*
*/
public XCalendarSelectWidget(XCalendar popup) {
super(popup);
}
/**
*
*/
@Override
public Pair<Point> l... | final XCalendarModel model = popup.getModel(); | 1 |
pmarches/jStellarAPI | src/main/java/jstellarapi/keys/StellarWallet.java | [
"public class StellarAddressPublicInformation implements JSONSerializable {\n\tpublic String account;\n\tpublic BigDecimal STRBalance;\n\tpublic String urlgravatar;\n\tpublic long nextTransactionSequence;\n\tpublic String inflationDestination;\n\t\n\t@Override\n\tpublic void copyFrom(JSONObject jsonCommandResult) {... | import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Serializable;
import java.io.Writer;
import java.math.BigInteger;
import java.security.SecureRandom;
import javax.xml.bind.DatatypeConverter;
import jstellarapi.connection.StellarAddressPublicInformatio... | package jstellarapi.keys;
public class StellarWallet implements Serializable {
private static final long serialVersionUID = -4849034810727882329L;
transient File walletFile;
StellarSeedAddress seed;
int nextTransactionSequenceNumber;
byte[] pendingTransaction;
protected StellarWallet(StellarSeedAddress see... | public void sendSTR(BigInteger STRAmount, StellarAddress payee) throws Exception{ | 3 |
aponom84/MetrizedSmallWorld | src/main/java/org/latna/msw/evaluation/SingleAttributeDistributionTest.java | [
"public abstract class MetricElement {\n private final List<MetricElement> friends;\n\n public MetricElement() {\n friends = Collections.synchronizedList(new ArrayList());\n }\n \n /**\n * Calculate metric between current object and another.\n * @param gme any element for whose metric ... | import org.latna.msw.MetricElement;
import org.latna.msw.SearchResult;
import org.latna.msw.TestLib;
import org.latna.msw.EvaluatedElement;
import org.latna.msw.AbstractMetricStructure;
import org.latna.msw.TestResult;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayLis... | package org.latna.msw.evaluation;
/**
*
* @author Alexander Ponomarenko aponom84@gmail.com
*/
public class SingleAttributeDistributionTest {
public static final int NUMBER_OF_THREADS = 12;
public static final String resultsFolderPath = "evaluationResults\\SingleAttribute\\";
public static enum DISTRI... | Map<MetricElement, TreeSet<EvaluatedElement>> rightResultMap = new HashMap<MetricElement, TreeSet<EvaluatedElement>>(); | 3 |
agune/flyJenkins | flyAgent/src/main/java/com/agun/agent/adapter/TomcatService.java | [
"public class CommonFunction {\n\tstatic Logger log = Logger.getLogger(CommonFunction.class.getName());\n\t\n\tpublic static void deployComplete(AgentMeta agentMeta, FilePathHelper filePathHelper){\n\t\tString lastDeployPath = AgentInfoManager.checkProductionLastDeployDir(agentMeta.getServiceId());\n\t\tif(lastDepl... | import java.io.File;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.Defa... | @Override
public boolean monitoring(AgentMeta agentMeta){
if(agentMeta.getTestUrl() != null && agentMeta.getTestUrl().length() > 0){
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(agentMeta.getTestUrl());
try {
HttpResponse response1 = httpClient.execu... | CommonFunction.deployComplete(agentMeta, filePathHelper);
| 0 |
dkzwm/SmoothRefreshLayout | app/src/main/java/me/dkzwm/widget/srl/sample/ui/WithListViewActivity.java | [
"public abstract class RefreshingListenerAdapter implements SmoothRefreshLayout.OnRefreshListener {\n @Override\n public void onRefreshing() {}\n\n @Override\n public void onLoadingMore() {}\n}",
"public class SmoothRefreshLayout extends ViewGroup\n implements NestedScrollingParent3, NestedScro... | import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
impor... | package me.dkzwm.widget.srl.sample.ui;
/**
* Created by dkzwm on 2017/6/1.
*
* @author dkzwm
*/
public class WithListViewActivity extends AppCompatActivity implements View.OnClickListener {
private SmoothRefreshLayout mRefreshLayout;
private ListView mListView;
private ListViewAdapter mAdapter;
pr... | new RefreshingListenerAdapter() { | 0 |
utapyngo/owl2vcs | src/test/java/owl2vcs/changeset/FullChangeSetTest.java | [
"public class AddPrefixData extends PrefixChangeData {\r\n\r\n private static final long serialVersionUID = 2801228470061214801L;\r\n\r\n public AddPrefixData(String prefixName, String prefix) {\r\n super(prefixName, prefix);\r\n }\r\n\r\n @Override\r\n public <R, E extends Exception> R accept... | import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Collection;
import ja... | package owl2vcs.changeset;
public class FullChangeSetTest {
private static Map<String, String> loadMap(final String name) throws FileNotFoundException {
final Map<String, String> map = new HashMap<String, String>();
final Scanner scanner = new Scanner(new FileReader(FullChangeSetTest... | FunctionalChangesetSerializer serializer = new FunctionalChangesetSerializer();
| 4 |
ArcBees/gwtquery | samples/src/main/java/gwtquery/samples/client/GwtQuerySampleModule.java | [
"public static GQuery $() {\n return new GQuery(JsNodeArray.create());\n}",
"public static final Document document = GWT.isClient() ? Document.get() : null;",
"public static LazyGQuery<?> lazy() {\n return $().createLazy();\n}",
"public static final Class<Widgets> Widgets = Widgets.class;",
"public class ... | import static com.google.gwt.query.client.GQuery.$;
import static com.google.gwt.query.client.GQuery.document;
import static com.google.gwt.query.client.GQuery.lazy;
import static com.google.gwt.query.client.plugins.Widgets.Widgets;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
im... | /*
* Copyright 2011, The gwtquery team.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | lazy().css(CSS.COLOR.with(RGBColor.RED)).done(), | 2 |
turn/camino | src/test/java/com/turn/camino/render/RendererImplTest.java | [
"public interface Context {\n\n\t/**\n\t * Get system environment\n\t *\n\t * @return system environment\n\t */\n\tEnv getEnv();\n\n\t/**\n\t * Creates child context\n\t *\n\t * @return new context\n\t */\n\tContext createChild();\n\n\t/**\n\t * Gets parent context\n\t *\n\t * Returns a parent context, or null if c... | import static org.mockito.Mockito.*;
import static org.testng.Assert.*;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.turn.camino.Context;
import com.turn.camino.Env;
import com.turn.camino.EnvBuilder;
import com.turn.camino.WrongTypeException;
import java.uti... | /*
* Copyright (C) 2014-2018, Amobee Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | private Context context; | 0 |
shibing624/crf-seg | src/main/java/org/xm/xmnlp/seg/CRFSegment.java | [
"public class Xmnlp {\n /**\n * 日志组件\n */\n private static Logger logger = LogManager.getLogger();\n\n public static final class Config {\n /**\n * 默认关闭调试\n */\n public static boolean DEBUG = false;\n /**\n * 字符类型对应表\n */\n public static S... | import org.xm.xmnlp.Xmnlp;
import org.xm.xmnlp.dictionary.other.CharTable;
import org.xm.xmnlp.model.crf.CRFSegmentModel;
import org.xm.xmnlp.model.crf.Table;
import org.xm.xmnlp.seg.domain.Nature;
import org.xm.xmnlp.seg.domain.Term;
import org.xm.xmnlp.seg.domain.Vertex;
import org.xm.xmnlp.util.CharacterHelper;
impo... | package org.xm.xmnlp.seg;
/**
* 基于CRF的分词器
*
* @author XuMing
*/
public class CRFSegment extends Segment {
@Override
protected List<Term> segSentence(char[] sentence) {
if (sentence.length == 0) return Collections.emptyList();
char[] sentenceConverted = CharTable.convert(sentence);
... | } else if (CharacterHelper.isEnglishLetter(sentence[i]) || sentence[i] == ' ') { | 7 |
gallery/gallery-remote | com/gallery/GalleryRemote/Update.java | [
"public class GalleryProperties extends Properties implements PreferenceNames {\n\tpublic static final String MODULE = \"GalProps\";\n\n\tSimpleDateFormat dateFormat\n\t\t\t= new SimpleDateFormat(\"yyyy/MM/dd\");\n\n\t// caches\n\tprotected Dimension thumbnailSize = null;\n\tprotected Rectangle mainBounds = null;\n... | import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.net.URL;
import java.text.DateFormat;
import java.util.Date;
import com.gallery.GalleryRemote.prefs.GalleryProperties;
import com.gallery.GalleryRemote.prefs.PreferenceNames;
import com.gallery.Gall... | /*
* Gallery Remote - a File Upload Utility for Gallery
*
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2001 Bharat Mediratta
*
* 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 F... | BrowserLink jUrl = new BrowserLink(); | 5 |
stefanhaustein/expressionparser | demo/sets/src/main/java/org/kobjects/expressionparser/demo/sets/SetDemo.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.ParsingException;
import org.kobjects.expressionparser.Processor;
import org.kobjects.expressionparser.Tokenizer;
import java.io.BufferedReader;
import java.io.IOException;
impo... | package org.kobjects.expressionparser.demo.sets;
/**
* Demo for set expression operators.
*/
public class SetDemo {
static class SetProcessor extends Processor<Object> {
private Set<Object> assertSet(Object o) {
if (!(o instanceof Set)) {
throw new RuntimeException("Set expected for " + o);
... | ExpressionParser<Object> parser = new ExpressionParser<>(new SetProcessor()); | 0 |
gossi/eclipse-transpiler-plugin | si.gos.transpiler.ui/src/si/gos/transpiler/ui/dialogs/InstalledTranspilerDialog.java | [
"public class TranspilerPlugin extends AbstractUIPlugin {\n\n\t// The plug-in ID\n\tpublic static final String PLUGIN_ID = \"si.gos.transpiler.core\"; //$NON-NLS-1$\n\n\t// The shared instance\n\tprivate static TranspilerPlugin plugin;\n\t\n\tprivate TranspilerManager transpilerManager;\n\t\n\t/**\n\t * The constru... | import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.window.IShellProvider;
import org.ecl... | package si.gos.transpiler.ui.dialogs;
public class InstalledTranspilerDialog extends Dialog {
private Text cmd;
private Text path;
private Text name;
private boolean editing = false;
private boolean fillingFromPreset = false;
private InstalledTranspiler transpiler;
private Text sourceExtension;
private ... | TranspilerController controller; | 4 |
ForrestSu/CourseAssistant | CourseHelper/src/com/hunau/fragment/FragmentLeftMenu.java | [
"public class ShowGrade extends Activity {\n\n\t\n\tprivate DBManager db;\n\tpublic void onCreate(Bundle savedInstanceState) { \n\t super.onCreate(savedInstanceState); \n\t setContentView(R.layout.showgrade); \n\t //°ó¶¨XMLÖеÄListView£¬×÷ΪItemµÄÈÝÆ÷ \n\t ListView list = (ListView) findViewById(R.i... | import com.hunau.activity.ShowGrade;
import com.hunau.activity.ShowRank;
import com.hunau.coursehelper.R;
import com.hunau.dao.StuInfo;
import com.hunau.db.DBManager;
import com.slidingmenu.main.MainSlidingActivity;
import android.app.Fragment;
import android.content.Intent;
import android.graphics.Color;
import androi... | package com.hunau.fragment;
public class FragmentLeftMenu extends Fragment {
private TextView name;
private TextView motto;
private RelativeLayout courseList;
private TextView eaxm;
private TextView loginstate;
private RelativeLayout grade;
// private TextView all_grade;
private TextView rank;
private Rela... | Intent intent = new Intent(getActivity(), ShowRank.class); | 1 |
aw20/MongoWorkBench | src/org/aw20/mongoworkbench/eclipse/view/wizard/UpdateWizard.java | [
"public enum Event {\n\n\tDOCUMENT_VIEW,\n\tELEMENT_VIEW,\n\t\n\tWRITERESULT,\n\t\n\tEXCEPTION, \n\t\n\tTOWIZARD\n\t\n}",
"public class EventWorkBenchManager extends Object {\n\tprivate static EventWorkBenchManager thisInst;\n\t\n\tpublic static synchronized EventWorkBenchManager getInst(){\n\t\tif ( thisInst == ... | import java.io.IOException;
import org.aw20.mongoworkbench.Event;
import org.aw20.mongoworkbench.EventWorkBenchManager;
import org.aw20.mongoworkbench.MongoFactory;
import org.aw20.mongoworkbench.command.MongoCommand;
import org.aw20.mongoworkbench.command.UpdateMongoCommand;
import org.aw20.mongoworkbench.eclipse.view... | /*
* MongoWorkBench is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Free Software Foundation,version 3.
*
* MongoWorkBench is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implie... | private WizardParentI wizardparent; | 5 |
Nilhcem/frcndict-android | src/com/nilhcem/frcndict/core/layout/ClickableHanzi.java | [
"public final class HanziListener implements OnCompletionListener {\n\n\tprivate static final String TAG = \"HanziListener\";\n\tprivate static final String EXTENSION = \".mp3\";\n\n\tprivate int mCurIdx;\n\tprivate final File mVoicesDir;\n\tprivate List<File> mFiles;\n\tprivate final MediaPlayer mMediaPlayer;\n\n\... | import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPr... | package com.nilhcem.frcndict.core.layout;
@SuppressWarnings("deprecation")
public final class ClickableHanzi extends LinearLayout {
private static final String START_FONT_TAG = "<font";
private static final String END_FONT_TAG = "</font>";
private static final Integer ACTION_OPEN_CHAR = 0;
private static fina... | String formattedHanzi = ChineseCharsHandler.getInstance().formatHanzi(simplified, traditional, pinyin, prefs); | 4 |
swarmcom/jSynapse | src/main/java/org/swarmcom/jsynapse/controller/client/api/v1/AuthenticationRestApi.java | [
"public class JsynapseApi {\n\n public static final String CLIENT_V1_API = \"/_matrix/client/api/v1\";\n public static final String CONTENT_V1_API = \"/_matrix/media/v1\";\n\n @ExceptionHandler\n @ResponseStatus(NOT_FOUND)\n public String handleEntityNotFound(EntityNotFoundException ex) {\n re... | import org.springframework.web.bind.annotation.*;
import org.swarmcom.jsynapse.controller.JsynapseApi;
import org.swarmcom.jsynapse.domain.Authentication.AuthenticationResult;
import org.swarmcom.jsynapse.domain.Authentication.AuthenticationSubmission;
import org.swarmcom.jsynapse.domain.Authentication.AuthenticationFl... | /*
* (C) Copyright 2015 eZuce Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | public class AuthenticationRestApi extends JsynapseApi { | 0 |
kontalk/desktopclient-java | src/main/java/org/kontalk/view/ConfigurationDialog.java | [
"public final class PersonalKey {\n private static final Logger LOGGER = Logger.getLogger(PersonalKey.class.getName());\n\n /** (Server) Authentication key. */\n private final PGPPublicKey mAuthKey;\n /** (Server) Login key. */\n private final PrivateKey mLoginKey;\n /** Signing key. */\n priva... | import javax.swing.Box;
import javax.swing.JFrame;
import javax.swing.text.NumberFormatter;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt... | /*
* Kontalk Java client
* Copyright (C) 2016 Kontalk Devteam <devteam@kontalk.org>
*
* 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 ... | private final Config mConf = Config.getInstance(); | 4 |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/test/java/com/github/ulisesbocchio/spring/boot/security/saml/configurer/builder/MetadataManagerConfigurerTest.java | [
"public class ServiceProviderBuilder extends\n AbstractConfiguredSecurityBuilder<Void, ServiceProviderBuilder> {\n\n public ServiceProviderBuilder() {\n super(new ObjectPostProcessor<Object>() {\n @Override\n public <T> T postProcess(T object) {\n return object;... | import com.github.ulisesbocchio.spring.boot.security.saml.configurer.ServiceProviderBuilder;
import com.github.ulisesbocchio.spring.boot.security.saml.properties.ExtendedMetadataDelegateProperties;
import com.github.ulisesbocchio.spring.boot.security.saml.properties.IdentityProvidersProperties;
import com.github.ulises... | package com.github.ulisesbocchio.spring.boot.security.saml.configurer.builder;
/**
* @author Ulises Bocchio
*/
@SuppressWarnings("unchecked")
public class MetadataManagerConfigurerTest { | private ServiceProviderBuilder builder; | 0 |
NICTA/nicta-ner | nicta-ner/src/main/java/org/t3as/ner/classifier/feature/CaseSensitiveWordLookup.java | [
"public class Phrase {\n // TODO: getters and setters for these\n /** phrase text array */\n public final List<Token> phrase;\n /** corresponding name type */\n public EntityClass phraseType;\n /** the start position of the phase in a sentence */\n public final int phrasePosition;\n /** the ... | import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static org.t3as.ner.util.Strings.clean;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableSet;
import org.t3as.ner.Phrase;
import org.t3as.ner.Token;
import org.t3as.ner.util.IO;
import org.t3as.n... | /*
* #%L
* NICTA t3as Named-Entity Recognition library
* %%
* Copyright (C) 2010 - 2014 NICTA
* %%
* 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 ... | score += (words.contains(clean(word))) ? 1.0 : 0.0; | 4 |
ustramooner/gwt-geom | example/gwt/geom/example/client/Geom.java | [
"public class Polygon implements Shape, java.io.Serializable {\n\n /**\n * The total number of points. The value of <code>npoints</code>\n * represents the number of valid points in this <code>Polygon</code>\n * and might be less than the number of elements in\n * {@link #xpoints xpoints} or {@l... | import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import gwt.awt.Polygon;
import gwt.awt.ScanLineConverter;
import gwt.awt.Shape;
import gwt.awt.g2d.DirectShapeRendererScanlineConverter;
import gwt.awt.geom.Area;
import gwt.awt.geom.Rectangle2D;
import gwt.g2d.client.graphics.DirectShapeRenderer;... | package gwt.geom.example.client;
/**
* HelloWorld application.
*/
public class Geom implements EntryPoint {
Surface surface = new Surface();
DirectShapeRenderer path;
ScanLineConverter converter;
Random rnd = new Random(System.currentTimeMillis());
int polygonCounter = 0;
int areaCounter = 0;
HashMap<Strin... | Polygon p = new Polygon(); | 0 |
WojciechZankowski/iextrading4j-hist | iextrading4j-hist-api/src/main/java/pl/zankowski/iextrading4j/hist/api/message/auction/IEXAuctionInformationMessage.java | [
"public class IEXPrice implements Comparable<IEXPrice>, Serializable {\n\n private static final int SCALE = 4;\n\n private final long number;\n\n public IEXPrice(final long number) {\n this.number = number;\n }\n\n public long getNumber() {\n return number;\n }\n\n public BigDecim... | import pl.zankowski.iextrading4j.hist.api.field.IEXPrice;
import pl.zankowski.iextrading4j.hist.api.message.IEXMessage;
import pl.zankowski.iextrading4j.hist.api.message.auction.field.IEXAuctionType;
import pl.zankowski.iextrading4j.hist.api.message.auction.field.IEXSide;
import pl.zankowski.iextrading4j.hist.api.util.... | package pl.zankowski.iextrading4j.hist.api.message.auction;
public class IEXAuctionInformationMessage extends IEXMessage {
public static final int LENGTH = 80;
private final IEXAuctionType auctionType;
private final long timestamp;
private final String symbol;
private final int pairedShares;
... | private final IEXSide side; | 3 |
YiuChoi/MicroReader | app/src/main/java/name/caiyao/microreader/ui/activity/ZhihuStoryActivity.java | [
"public class GuokrArticle {\n @SerializedName(\"result\")\n private GuokrArticleResult result;\n\n public GuokrArticleResult getResult() {\n return result;\n }\n\n public void setResult(GuokrArticleResult result) {\n this.result = result;\n }\n}",
"public class ZhihuStory {\n ... | import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.NestedScrollView;
import android.supp... | public void onClick(View v) {
ZhihuStoryActivity.this.onBackPressed();
}
});
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
fabButton.setOnClickListener(new Vie... | String data = WebUtil.buildHtmlWithCss(zhihuStory.getBody(), zhihuStory.getCss(), Config.isNight); | 2 |
NoticEditorTeam/NoticEditor | src/com/noticeditorteam/noticeditor/controller/AttachmentImportController.java | [
"public final class IOUtil {\n\n private static final int FILENAME_LIMIT = 60;\n\n public static String readContent(File file) throws IOException {\n return stringFromStream(new FileInputStream(file));\n }\n\n public static void writeContent(File file, String content) throws IOException {\n ... | import com.noticeditorteam.noticeditor.io.IOUtil;
import com.noticeditorteam.noticeditor.model.Attachments;
import com.noticeditorteam.noticeditor.plugin.attachments.AttachmentImporter;
import com.noticeditorteam.noticeditor.plugin.attachments.FromURLImporter;
import com.noticeditorteam.noticeditor.view.Notification;
i... | package com.noticeditorteam.noticeditor.controller;
/**
* @author aNNiMON
*/
public class AttachmentImportController implements Initializable {
@FXML
private ComboBox<AttachmentImporter> importersBox;
@FXML
private Button importButton;
@FXML
private BorderPane container;
@FXML
pr... | importers.add(new FromURLImporter(resources)); | 3 |
txusballesteros/Android-Clean-Testing | app/src/test/java/com/txusballesteros/testing/domain/interactor/GetDashboardInteractorUnitTest.java | [
"@RunWith(JUnit4.class)\n@SmallTest\npublic abstract class UnitTest {\n @Before\n public final void setup() {\n initializeMocks();\n onSetup();\n }\n\n private void initializeMocks() {\n MockitoAnnotations.initMocks(this);\n }\n\n protected abstract void onSetup();\n}",
"pub... | import org.junit.Test;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import java.util.List;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.verify;
... | /* * Copyright Txus Ballesteros 2016 (@txusballesteros)
*
* This file is part of some open source application.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyrigh... | @Mock List<Image> repositoryResultMock; | 1 |
whiskeyfei/SimpleNews.io | app/src/main/java/com/kong/app/blog/BlogItemViewBinder.java | [
"public class Feed {\n\n private String title;\n private String description;\n private String home_page_url;\n private String feed_url;\n private boolean expired;\n private List<PostsBean> posts;\n\n public String getTitle() {\n return title;\n }\n\n public void setTitle(String tit... | import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.kong.R;
import com.kong.app.blog.model... | package com.kong.app.blog;
/**
* Created by CaoPengfei on 17/6/18.
*/
public class BlogItemViewBinder extends ItemViewBinder<Feed.PostsBean.ItemsBean,BlogItemViewBinder.ViewHolder> {
private static final String TAG = "BlogItemViewBinder";
@Override
protected ViewHolder onCreateViewHolder(@NonNull L... | ImageLoaderUtils.display(AppRun.get().getApplicationContext(), icon, itemModel.getCover(),R.drawable.ic_image_loading, R.drawable.ic_image_loadfail); | 3 |
cianfrocco-lab/COSMIC-CryoEM-Gateway | globus_sources/portal/src/main/java/edu/sdsc/globusauth/action/EndpointListAction.java | [
"public final class OauthConstants {\n\n public static final String SESSION_ERROR_MESSAGE = \"sessionErrorMsg\";\n public static final String ERROR = \"error\";\n public static final String OAUTH_PORPS = \"oauth_consumer.properties\";\n public static final String SCOPES = \"scopes\";\n public static ... | import com.google.api.client.auth.oauth2.Credential;
import edu.sdsc.globusauth.util.OauthConstants;
import edu.sdsc.globusauth.util.OauthUtils;
import org.apache.log4j.Logger;
import org.globusonline.transfer.Authenticator;
import org.globusonline.transfer.BaseTransferAPIClient;
import org.globusonline.transfer.Goauth... | package edu.sdsc.globusauth.action;
/**
* Created by cyoun on 06/19/17.
*/
public class EndpointListAction extends NgbwSupport {
private static final Logger logger = Logger.getLogger(EndpointListAction.class.getName());
private JSONTransferAPIClient client;
private List<Map<String,Object>> iplist;
... | Authenticator authenticator = new GoauthAuthenticator(accesstoken); | 2 |
xiprox/WaniKani-for-Android | WaniKani/src/tr/xip/wanikani/preference/SettingsActivity.java | [
"public class OpenSourceLicensesDialogFragment extends DialogFragment {\n\n private static final String LICENSES_URL = \"file:///android_asset/licenses.html\";\n\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n LayoutInflater inflater = getActivity().getLayoutInflater();\n ... | import android.content.DialogInterface;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widg... | mMuteButton.setOnClickListener(this);
mSRSIndication.setOnClickListener(this);
mHWAccel.setOnClickListener(this);
mDeveloperOpenSourceLicenses.setOnClickListener(this);
}
private void loadApiKey() {
String apiKey = PrefManager.getApiKey();
String maskedApiKey = "... | new RecentUnlocksNumberPreference().show(getFragmentManager(), | 4 |
scarletsky/Bangumi-Android | app/src/main/java/io/github/scarletsky/bangumi/ui/fragments/SubjectGradeFragment.java | [
"public class Collection {\n private Status status = new Status();\n private long lasttouch = 0;\n private int rating = 0;\n private String comment = \"\";\n private int ep_status = 0;\n\n public enum WatchStatus {\n WISH(1, \"wish\", \"想看\"),\n WATCHED(2, \"collect\", \"看过\"),\n ... | import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget... | package io.github.scarletsky.bangumi.ui.fragments;
/**
* Created by scarlex on 15-7-14.
*/
public class SubjectGradeFragment extends Fragment implements RadioGroup.OnCheckedChangeListener {
private static final String TAG = SubjectGradeFragment.class.getSimpleName();
private LinearLayout mSubjectGradeWr... | BusProvider.getInstance().register(this); | 4 |
Catherine22/MobileManager | app/src/main/java/com/itheima/mobilesafe/receivers/SMSReceiver.java | [
"public class GPSService extends Service {\n private final static String TAG = \"GPSService\";\n private LocationListener listener;\n\n @Nullable\n @Override\n public IBinder onBind(Intent intent) {\n CLog.d(TAG, \"onBind\");\n return null;\n }\n\n @Override\n public void onCre... | import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import android.text.TextUtils;
import c... | package com.itheima.mobilesafe.receivers;
/**
* Created by Catherine on 2016/8/19.
* Soft-World Inc.
* catherine919@soft-world.com.tw
*/
public class SMSReceiver extends BroadcastReceiver {
public static final String TAG = "SmsReceiver";
public static String address;
public static String content;
... | Intent i = new Intent(context, GPSService.class); | 0 |
spinnaker/fiat | fiat-web/src/main/java/com/netflix/spinnaker/fiat/controllers/RolesController.java | [
"@Data\npublic class UserPermission {\n private String id;\n\n private Set<Account> accounts = new LinkedHashSet<>();\n private Set<Application> applications = new LinkedHashSet<>();\n private Set<ServiceAccount> serviceAccounts = new LinkedHashSet<>();\n private Set<Role> roles = new LinkedHashSet<>();\n pri... | import com.netflix.spinnaker.fiat.model.UserPermission;
import com.netflix.spinnaker.fiat.model.resources.Role;
import com.netflix.spinnaker.fiat.permissions.ExternalUser;
import com.netflix.spinnaker.fiat.permissions.PermissionResolutionException;
import com.netflix.spinnaker.fiat.permissions.PermissionsRepository;
im... | /*
* Copyright 2016 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | @Autowired @Setter PermissionsRepository permissionsRepository; | 4 |
InstaList/instalist-android | app/src/main/java/org/noorganization/instalist/view/sidedrawermodelwrapper/implementation/SideDrawerListManager.java | [
"public interface IBaseActivity {\n /**\n * Changes the current Fragment to the given Fragment.\n * @param _NewFragment The Fragment to move to.\n */\n void changeFragment(Fragment _NewFragment);\n\n /**\n * Set the toolbar title to the given string.\n * @param _ToolbarTitle the stri... | import org.noorganization.instalist.view.sidedrawermodelwrapper.helper.implementation.ExpandableShoppingListHelper;
import org.noorganization.instalist.view.sidedrawermodelwrapper.helper.IShoppingListHelper;
import org.noorganization.instalist.view.sidedrawermodelwrapper.ISideDrawerListManager;
import org.noorganizatio... | /*
* Copyright 2016 Tino Siegmund, Michael Wodniok
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | private ExpandableShoppingListHelper mExpandableShoppingListHelper; | 1 |
imagej/imagej-server | src/main/java/net/imagej/server/ImageJServer.java | [
"public class ImageJServerHealthCheck extends HealthCheck {\n\n\t@Override\n\tprotected Result check() throws Exception {\n\t\t// NB: not implemented yet\n\t\treturn Result.healthy();\n\t}\n}",
"@Path(\"/admin\")\npublic class AdminResource {\n\t\n\t@Inject\n\tprivate Environment env;\t\n\n\t/**\n\t * Stop the im... | import net.imagej.server.health.ImageJServerHealthCheck;
import net.imagej.server.resources.AdminResource;
import net.imagej.server.resources.ModulesResource;
import net.imagej.server.resources.ObjectsResource;
import net.imagej.server.services.DefaultJsonService;
import net.imagej.server.services.DefaultObjectService;... | /*
* #%L
* ImageJ server for RESTful access to ImageJ.
* %%
* Copyright (C) 2013 - 2016 Board of Regents of the University of
* Wisconsin-Madison.
* %%
* 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... | environment.jersey().register(ModulesResource.class); | 2 |
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 BeautifulPhotosPresen... | private Api500pxService service; | 1 |
rholder/fauxflake | fauxflake-core/src/test/java/com/github/rholder/fauxflake/IdGeneratorTest.java | [
"public interface EncodingProvider {\n\n /**\n * Return a raw byte encoding of the given time and sequence number.\n *\n * @param time a time value to encode\n * @param sequence a sequence value to encode\n */\n public byte[] encodeAsBytes(long time, int sequence);\n\n /**\n *... | import com.github.rholder.fauxflake.api.EncodingProvider;
import com.github.rholder.fauxflake.api.IdGenerator;
import com.github.rholder.fauxflake.api.TimeProvider;
import com.github.rholder.fauxflake.provider.SystemTimeProvider;
import com.github.rholder.fauxflake.provider.twitter.SnowflakeEncodingProvider;
import org... | /*
* Copyright 2012-2014 Ray Holder
*
* 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 ... | TimeProvider timeProvider = mock(TimeProvider.class); | 2 |
pangliang/MirServer-Netty | LoginServer/src/main/java/com/zhaoxiaodan/mirserver/loginserver/handlers/LoginHandler.java | [
"public class DB {\n\n\tprivate static SessionFactory ourSessionFactory;\n\tprivate static ServiceRegistry serviceRegistry;\n\n\tpublic static void init() throws Exception {\n\t\tConfiguration configuration = new Configuration();\n\t\tconfiguration.configure();\n\n\t\tserviceRegistry = new StandardServiceRegistryB... | import com.zhaoxiaodan.mirserver.db.DB;
import com.zhaoxiaodan.mirserver.gameserver.entities.ServerInfo;
import com.zhaoxiaodan.mirserver.gameserver.entities.User;
import com.zhaoxiaodan.mirserver.network.Handler;
import com.zhaoxiaodan.mirserver.network.Session;
import com.zhaoxiaodan.mirserver.loginserver.LoginClient... | package com.zhaoxiaodan.mirserver.loginserver.handlers;
public class LoginHandler extends Handler {
@Override
public void onPacket(ClientPacket packet) throws Exception {
LoginClientPackets.Login loginRequest = (LoginClientPackets.Login) packet;
List<User> list = DB.query(User.class, Restrictions.eq("loginId... | session.sendPacket(new LoginServerPackets.LoginFail(LoginServerPackets.LoginFail.Reason.UserNotFound)); | 6 |
tsmarsh/UnderBar | underbar.ocho/src/test/java/com/tailoredshapes/underbar/ocho/DieTest.java | [
"public interface UnderBar {\r\n Map<Supplier<?>, Object> lazyCache = Collections.synchronizedMap(hash());\r\n\r\n /**\r\n * Asserts that a collection contains exactly one value and returns it\r\n */\r\n static <T> T nonce(Iterable<T> ts) {\r\n Iterator<T> i = ts.iterator();\r\n dieUn... | import com.tailoredshapes.underbar.ocho.UnderBar;
import com.tailoredshapes.underbar.ocho.exceptions.UnderBarred;
import com.tailoredshapes.underbar.ocho.function.ExceptionalFunctions;
import org.junit.Test;
import static com.tailoredshapes.underbar.ocho.Die.*;
import static com.tailoredshapes.underbar.ocho.UnderBar.*;... | package com.tailoredshapes.underbar.ocho;
public class DieTest {
@Test(expected = UnderBarred.class)
public void dieTest() throws Exception {
die(new RuntimeException(), "foop");
die("foop");
}
@Test(expected = UnderBarred.class)
public void dieIfTest() throws Exception {
... | rethrow(new ExceptionalFunctions.RunnableWithOops() { | 2 |
concordion/cubano | cubano-httpeasy/src/main/java/org/concordion/cubano/driver/http/HttpEasy.java | [
"public interface DataWriter {\n\n /**\n * Add data to Http request.\n *\n * @param logger Logger to write details to\n * @throws IOException If unable to read the response\n */\n public void write(LogManager logger) throws IOException;\n\n}",
"public class Field {\n public final Medi... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.InvalidParameterE... | package org.concordion.cubano.driver.http;
//TODO Can this be replaced by one of these?
//http://stackoverflow.com/questions/2793150/using-java-net-urlconnection-to-fire-and-handle-http-requests
// * https://github.com/kevinsawicki/http-request
// * http://http.jcabi.com/
/**
* Fluent wrapper around {@link Http... | private LogManager logManager = null; | 5 |
Cleveroad/LoopBar | sample/src/main/java/com/cleveroad/sample/fragments/AbstractLoopBarFragment.java | [
"public class MockedItemsFactory {\n\n private MockedItemsFactory() {}\n\n public static List<ICategoryItem> getCategoryItems(Context context) {\n List<ICategoryItem> items = new ArrayList<>();\n items.add(new CategoryItem(ContextCompat.getDrawable(context, R.drawable.enls_ic_local_taxi), \"auto... | import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment... | package com.cleveroad.sample.fragments;
public abstract class AbstractLoopBarFragment extends Fragment
implements
View.OnClickListener,
OnItemClickListener,
AdapterView.OnItemSelectedListener {
static final String EXTRA_ORIENTATION = "EXTRA_ORIENTATION";
private LoopBarVie... | SimpleFragmentStatePagerAdapter pagerAdapter = new SimpleFragmentStatePagerAdapter( | 5 |
kyle-liu/netty4study | transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java | [
"public interface Channel extends AttributeMap, Comparable<Channel> {\n\n /**\n * Return the {@link EventLoop} this {@link Channel} was registered too.\n */\n EventLoop eventLoop();\n\n /**\n * Returns the parent of this channel.\n *\n * @return the parent channel.\n * {@cod... | import io.netty.channel.Channel;
import io.netty.channel.ChannelConfig;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.chann... | /*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | p.addLast(new ChannelInitializer<Channel>() { | 3 |
uber-java/tally | example/src/main/java/com/uber/m3/tally/example/PrintStatsReporter.java | [
"@Deprecated\npublic interface Buckets<E> extends ImmutableBuckets, List<E> {\n /**\n * @deprecated DO NOT USE\n */\n @Deprecated\n Double[] asValues();\n\n /**\n * @deprecated DO NOT USE\n */\n @Deprecated\n Duration[] asDurations();\n\n}",
"public interface Capabilities {\n ... | import com.uber.m3.tally.Buckets;
import com.uber.m3.tally.Capabilities;
import com.uber.m3.tally.CapableOf;
import com.uber.m3.util.Duration;
import com.uber.m3.tally.StatsReporter;
import java.util.Map; | // Copyright (c) 2021 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... | public void reportHistogramValueSamples(String name, Map<String, String> tags, Buckets buckets, double bucketLowerBound, double bucketUpperBound, long samples) { | 0 |
rsgoncalves/ecco | src/main/java/uk/ac/manchester/cs/diff/output/xml/XMLUnifiedDiffReport.java | [
"public class CategorisedChange extends LogicalChange {\n\n\t/**\n\t * @param axiom\tChanged axiom\n\t * @param isEffectual\ttrue if change is effectual, false otherwise\n\t */\n\tpublic CategorisedChange(OWLAxiom axiom, boolean isEffectual) {\n\t\tsuper(axiom, isEffectual);\n\t}\n}",
"public class CategorisedEff... | import uk.ac.manchester.cs.diff.concept.change.ConceptChange;
import uk.ac.manchester.cs.diff.unity.changeset.AlignedChangeSet;
import uk.ac.manchester.cs.diff.unity.changeset.AlignedDirectChangeSet;
import uk.ac.manchester.cs.diff.unity.changeset.AlignedIndirectChangeSet;
import java.util.Map;
import java.util.Set;
im... | /*******************************************************************************
* This file is part of ecco.
*
* ecco is distributed under the terms of the GNU Lesser General Public License (LGPL), Version 3.0.
*
* Copyright 2011-2014, The University of Manchester
*
* ecco is free software: you can redistr... | appendEffectualChange((CategorisedEffectualChange)change, d, ele, sf); | 1 |
kimkevin/AndroidStarterKit | ask-remote-module/src/main/java/com/androidstarterkit/module/ui/adapter/MainBaseAdapter.java | [
"public class GridViewActivity extends AppCompatActivity {\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n setContentView(R.layout.activity_sample_main);\n\n if (savedInstanceState == null) {\n getSupportFragmentManager()\n .begin... | import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.androidstarterkit.module.sample.activity.GridViewActivity;
import com.androidstarterki... | package com.androidstarterkit.module.ui.adapter;
public class MainBaseAdapter extends BaseAdapter {
private Context context;
private List<SampleType> dataSet;
private LayoutInflater inflater;
public MainBaseAdapter(Context context, List<SampleType> dataSet) {
this.context = context;
this.dataSet = ... | intent = new Intent(context, GridViewActivity.class); | 0 |
atolcd/alfresco-audit-share | audit-share-platform/src/main/java/com/atolcd/alfresco/web/scripts/shareStats/AuditExportGet.java | [
"public class AuditObjectPopularity {\n\tprivate int popularity;\n\tprivate String auditObject; // 'audit_object' database field\n\tprivate String objectName;\n\tprivate String objectDisplayName;\n\tprivate String auditSite;\n\tprivate String siteComponent;\n\n\tpublic AuditObjectPopularity() {\n\n\t}\n\n\tpublic i... | import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.Charset;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
im... | /*
* Copyright (C) 2018 Atol Conseils et Développements.
* http://www.atolcd.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your o... | AuditQueryParameters params = wsSelectAudits.buildParametersFromRequest(req); | 1 |
RandoApp/Rando-android | src/main/java/com/github/randoapp/view/RandoOnLongTapListener.java | [
"public class Constants {\n\n public static final String ALBUM_NAME = \"Rando\";\n\n public static final String FILEPATH = \"FILEPATH\";\n public static final String TOTAL_RANDOS_NUMBER = \"TOTAL_RANDOS_NUMBER\";\n public static final String UPDATE_STATUS = \"UPDATE_STATUS\";\n public static final St... | import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.Toast;
import com.github.randoapp.Constants;
import com.github.randoapp.R;
import ... | package com.github.randoapp.view;
public class RandoOnLongTapListener implements View.OnLongClickListener {
private RandoListAdapter randoListAdapter;
private RandoListAdapter.RandoViewHolder holder;
private FirebaseAnalytics firebaseAnalytics;
public RandoOnLongTapListener(RandoListAdapter randoL... | if (holder.rando.status.equals(Rando.Status.IN)) { | 6 |
decatur/j2js-compiler | src/main/java/com/j2js/J2JSCompiler.java | [
"public class FileManager {\n\n private List<Object> path = new ArrayList<Object>();\n \n /**\n * Create a new FileManager.\n * \n * @param classPath list of file system directories or jar files.\n */\n public FileManager(List<File> classPath) {\n Log.getLogger().info(\"Resolving ... | import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.j2js.FileManager;
import com.j2js.Log;
import com.j2js.Utils;
import com.j2js.assembly.Project;
import com.j2js.visitors.JavaScriptGenerator; | // Copyright 2011 The j2js Authors. All Rights Reserved.
//
// This file is part of j2js.
//
// j2js 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) an... | public JavaScriptGenerator generator; | 4 |
evant/sres | sres-compile/src/main/java/me/tatarka/sres/impl/SResCodeLayoutGenerator.java | [
"public interface LayoutGenerator {\n void generate(RootView rootView, SResOutput output);\n}",
"public class SResOutput {\n public final SourceInfo sourceInfo;\n public final Writer writer;\n\n public SResOutput(SourceInfo sourceInfo, Writer writer) {\n this.sourceInfo = sourceInfo;\n t... | import com.google.common.base.CaseFormat;
import com.sun.codemodel.*;
import me.tatarka.sres.LayoutGenerator;
import me.tatarka.sres.SResOutput;
import me.tatarka.sres.ast.Binding;
import me.tatarka.sres.ast.Child;
import me.tatarka.sres.ast.RootView;
import me.tatarka.sres.ast.View;
import java.io.IOException;
import ... | package me.tatarka.sres.impl;
/**
* Created by evan on 3/6/14.
*/
public class SResCodeLayoutGenerator implements LayoutGenerator {
@Override | public void generate(RootView rootView, SResOutput output) { | 4 |
socrata/datasync | src/main/java/com/socrata/datasync/ui/SyntheticPointDialog.java | [
"@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = \"type\", include = JsonTypeInfo.As.PROPERTY)\n @JsonSubTypes(value = {\n @JsonSubTypes.Type(value = GeocodedPointColumn.class, name = \"geocoded\"),\n @JsonSubTypes.Type(value = ProvidedPointColumn.class, name = \"point\")\n })\npubl... | import com.socrata.datasync.config.controlfile.SyntheticPointColumn;
import com.socrata.datasync.config.controlfile.GeocodedPointColumn;
import com.socrata.datasync.config.controlfile.ProvidedPointColumn;
import com.socrata.datasync.model.CSVModel;
import com.socrata.datasync.model.ControlFileModel;
import com.socrata.... | package com.socrata.datasync.ui;
/**
* A dialog box which allows the customer to pick from columns in a CSV and then map them into
* a location column
*/
public class SyntheticPointDialog extends JDialog {
static class PointSpec {
enum Active {
GEOCODED, PROVIDED
}
Active ... | ControlFileModel model; | 4 |
groupon/Message-Bus | mbus-java/src/test/java/com/groupon/messagebus/client/test/StompServerFetcherTest.java | [
"public enum ConsumerAckType{\n AUTO_CLIENT_ACK,\n CLIENT_ACK;\n}",
"public class ConsumerConfig {\n\n // Set of servers to consume from.\n private Set<HostParams> hostParamsSet = null;\n\n // Consumer destination information.\n private String destinationName;\n private DestinationType destin... | import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
impor... | package com.groupon.messagebus.client.test;
/*
* Copyright (c) 2013, Groupon, Inc.
* 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 abov... | ConsumerConfig config = new ConsumerConfig(); | 1 |
geosolutions-it/geonetwork-manager | src/main/java/it/geosolutions/geonetwork/GNClient.java | [
"public class GNLibException extends GNException {\n\n public GNLibException(String message) {\n super(message);\n }\n\n public GNLibException(String message, Throwable cause) {\n super(message, cause);\n }\n\n}",
"public class GNServerException extends GNException {\n\n private int h... | import it.geosolutions.geonetwork.exception.GNServerException;
import it.geosolutions.geonetwork.op.gn3.GN3MetadataGetInfo.MetadataInfo;
import it.geosolutions.geonetwork.util.GNInsertConfiguration;
import it.geosolutions.geonetwork.util.GNPrivConfiguration;
import it.geosolutions.geonetwork.util.GNSearchRequest;
impor... | /*
* GeoNetwork-Manager - Simple Manager Library for GeoNetwork
*
* Copyright (C) 2007,2016 GeoSolutions S.A.S.
* http://www.geo-solutions.it
*
* 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 t... | HTTPUtils getConnection() throws GNLibException; | 7 |
PuffOpenSource/Puff-Android | app/src/main/java/sun/bob/leela/ui/activities/MainActivity.java | [
"public class AccountHelper {\n private static AccountHelper ourInstance;\n private Context context;\n private DaoMaster daoMaster;\n private DaoSession daoSession;\n private AccountDao accountDao;\n\n public static AccountHelper getInstance(Context context) {\n if (ourInstance == null) {\n... | import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.NavigationView;
import android.support.v4.view.GravityCompat;
import android.support.v... | package sun.bob.leela.ui.activities;
/**
* Created by bob.sun on 16/3/19.
*/
public class MainActivity extends AppCompatActivity
implements NavigationView.OnNavigationItemSelectedListener {
private AcctListFragment acctListFragment;
private AcctListFragment currentFragment;
private Toolbar t... | loadAccountByCategory(CategoryHelper.getInstance(this).getCategoryById(AppConstants.CAT_ID_RECENT)); | 2 |
UWFlow/flow-android | src/com/uwflow/flow_android/loaders/UserExamsLoader.java | [
"public class Constants {\n public static final String FLOW_DOMAIN = \"uwflow.com\";\n public static final String SESSION_COOKIE_DOMAIN = FLOW_DOMAIN;\n public static final String BASE_URL = \"https://uwflow.com/\";\n public static final String FBID = \"fbid\";\n public static final String FACEBOOK_A... | import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import com.crashlytics.android.Crashlytics;
import com.j256.ormlite.dao.Dao;
import com.uwflow.flow_android.constant.Constants;
import com.uwflow.flow_android.dao.Flo... | package com.uwflow.flow_android.loaders;
public class UserExamsLoader extends FlowAbstractDataLoader<Exams> {
private final static String TAG = UserExamsLoader.class.getSimpleName();
private LoaderUpdateReceiver userExamsLoadedReceiver;
public UserExamsLoader(Context context, FlowDatabaseHelper flowData... | userExamsLoadedReceiver = new LoaderUpdateReceiver(this, Constants.BroadcastActionId.PROFILE_DATABASE_USER_EXAM_LOADED); | 0 |
Ohohcakester/Any-Angle-Pathfinding | src/algorithms/sparsevgs/SparseVisibilityGraphAlgorithmFibHeap.java | [
"public class GridGraph {\n\n private boolean[] tiles; // Flattened 2D Array\n public final int sizeX;\n public final int sizeY;\n public final int sizeXplusOne;\n\n private static final float SQRT_TWO = (float)Math.sqrt(2);\n private static final double SQRT_TWO_DOUBLE = Math.sqrt(2);\n privat... | import grid.GridGraph;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import algorithms.PathFindingAlgorithm;
import algorithms.datatypes.Memory;
import algorithms.datatypes.SnapshotItem;
import algorithms.jgrapht.FibonacciHeap;
import algorithms.jgrapht.FibonacciHeapNode; | package algorithms.sparsevgs;
public class SparseVisibilityGraphAlgorithmFibHeap extends PathFindingAlgorithm {
protected SparseVisibilityGraph visibilityGraph;
protected boolean reuseGraph = false;
private static FibonacciHeapNode<Integer>[] nodeRefs; | private FibonacciHeap<Integer> pq = new FibonacciHeap<>(); | 4 |
amrmagdy4/kite | kite-core/src/main/java/edu/umn/cs/kite/indexing/memory/spatial/MemorySpatialIndex.java | [
"public class DebugFlagger {\n public enum DebuggingState {DEBUG_ON, DEBUG_OFF}\n public enum TestingState {TEST_ON, TEST_OFF}\n\n /*\n public static DebuggingState debugTimedExecution = DebuggingState.DEBUG_ON;\n\n public static DebuggingState debugMQL = DebuggingState.DEBUG_ON;\n\n public static... | import edu.umn.cs.kite.common.DebugFlagger;
import edu.umn.cs.kite.common.KiteInstance;
import edu.umn.cs.kite.datamodel.Attribute;
import edu.umn.cs.kite.indexing.disk.spatial.DiskSpatialIndex;
import edu.umn.cs.kite.indexing.memory.MemoryIndex;
import edu.umn.cs.kite.indexing.memory.MemoryIndexSegment;
import edu.umn... | ConstantsAndDefaults.MEMORY_INDEX_DEFAULT_SEGMENTS,
loadDiskIndex);
}
public int insert(GeoLocation key, Long value) {
int inserted = this.getActiveIndexSegment().insert(key, value);
totalIngestedDataSize += inserted;
inMemoryIngestedDataSize += inserted;... | public ArrayList<Long> search(GeoLocation key, Query query, | 6 |
davidmoten/rtree | src/main/java/com/github/davidmoten/rtree/internal/NonLeafDefault.java | [
"public final class Context<T, S extends Geometry> {\n\n private final int maxChildren;\n private final int minChildren;\n private final Splitter splitter;\n private final Selector selector;\n private final Factory<T, S> factory;\n\n /**\n * Constructor.\n * \n * @param minChildren\n ... | import java.util.List;
import com.github.davidmoten.guavamini.Preconditions;
import com.github.davidmoten.rtree.Context;
import com.github.davidmoten.rtree.Entry;
import com.github.davidmoten.rtree.Node;
import com.github.davidmoten.rtree.NonLeaf;
import com.github.davidmoten.rtree.geometry.Geometry;
import com.github.... | package com.github.davidmoten.rtree.internal;
public final class NonLeafDefault<T, S extends Geometry> implements NonLeaf<T, S> {
private final List<? extends Node<T, S>> children;
private final Rectangle mbr;
private final Context<T, S> context;
public NonLeafDefault(List<? extends Node<T, S>> ch... | Subscriber<? super Entry<T, S>> subscriber) { | 1 |
kdgregory/pathfinder | lib-spring/src/main/java/com/kdgregory/pathfinder/spring/SpringInspector.java | [
"public enum HttpMethod\n{\n ALL(\"\"),\n GET(\"GET\"),\n POST(\"POST\"),\n PUT(\"PUT\"),\n DELETE(\"DELETE\");\n\n private String stringValue;\n\n HttpMethod(String stringValue)\n {\n this.stringValue = stringValue;\n }\n\n @Override\n public String toString()\n {\n ... | import com.kdgregory.pathfinder.spring.inspectors.AnnotationInspector;
import com.kdgregory.pathfinder.spring.inspectors.BeanInspector;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.log4j.Logger;
import net.sf.kdgcommons.lang.StringUtil;
import com.... | // Copyright (c) Keith D Gregory
//
// 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 ... | if (!listeners2.contains(SpringConstants.CLASS_CONTEXT_LISTENER)) | 5 |
SevenSpikes/shopify-api-java-wrapper | src/main/java/com/storakle/shopify/ShopifyApiFactory.java | [
"public class ContentTypeRequestInterceptor implements RequestInterceptor\n{\n @Override\n public void apply(RequestTemplate template)\n {\n template.header(\"Content-Type\", \"application/json\");\n }\n}",
"public class OAuthRequestInterceptor implements RequestInterceptor\n{\n private fina... | import com.storakle.shopify.interceptors.ContentTypeRequestInterceptor;
import com.storakle.shopify.interceptors.OAuthRequestInterceptor;
import com.storakle.shopify.interceptors.RequestLimitInterceptor;
import com.storakle.shopify.jackson.ShopifyJacksonDecoder;
import com.storakle.shopify.redisson.ShopifyRedissonManag... | package com.storakle.shopify;
public class ShopifyApiFactory
{
public static ShopifyApiClient create(String accessToken, String myShopifyUrl, String nodeAddress)
{
ShopifyRedissonManager shopifyRedissonManager = new ShopifyRedissonManager(nodeAddress, myShopifyUrl);
// Prepare the request in... | requestInterceptors.add(new OAuthRequestInterceptor(accessToken)); | 1 |
nisovin/Shopkeepers | src/main/java/com/nisovin/shopkeepers/shopobjects/SignShop.java | [
"public class Log {\n\n\tpublic static Logger getLogger() {\n\t\treturn ShopkeepersPlugin.getInstance().getLogger();\n\t}\n\n\tpublic static void info(String message) {\n\t\tif (message == null || message.isEmpty()) return;\n\t\tgetLogger().info(message);\n\t}\n\n\tpublic static void debug(String message) {\n\t\tif... | import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.inventory.ItemStack;
import org.bukkit.materi... | return (Sign) signBlock.getState();
}
private BlockFace getSignFacingFromWorld() {
// try getting the current sign facing from the sign in the world:
Sign sign = this.getSign();
if (sign != null) {
return ((Attachable) sign.getData()).getFacing();
}
return null;
}
@Override
protected void onChunkL... | if (shopkeeper instanceof PlayerShopkeeper) { | 7 |
uber/rides-android-sdk | core-android/src/main/java/com/uber/sdk/android/core/auth/SsoDeeplink.java | [
"public interface Deeplink {\n\n String DEEPLINK_SCHEME = \"uber\";\n String APP_LINK_URI = \"https://m.uber.com/ul/\";\n String MOBILE_WEB_URI = \"https://m.uber.com/\";\n\n /**\n * Actually send the deeplink.\n */\n void execute();\n\n /**\n * @return true if deeplink is supported in... | import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import android.util.Log;
import co... | * {@code flowVersion} defaults to {@link FlowVersion#DEFAULT}
*
* @see #isSupported(FlowVersion)
*/
@Override
public boolean isSupported() {
return isSupported(FlowVersion.DEFAULT);
}
/**
* Check if SSO deep linking is supported in this device.
*
* @param flow... | Log.i(UBER_SDK_LOG_TAG, "Request code is not set, using default request code"); | 3 |
ihaolin/wechat | src/main/java/me/hao0/wechat/core/Materials.java | [
"public class WechatException extends RuntimeException {\n\n /**\n * 微信返回的errcode\n */\n private Integer code;\n\n public WechatException(Map<String, ?> errMap) {\n super(\"[\" + errMap.get(\"errcode\") + \"]\" + errMap.get(\"errmsg\"));\n code = (Integer)errMap.get(\"errcode\");\n ... | import com.fasterxml.jackson.databind.JavaType;
import com.google.common.collect.Maps;
import me.hao0.common.http.Http;
import me.hao0.common.json.Jsons;
import me.hao0.common.model.Page;
import me.hao0.wechat.exception.WechatException;
import me.hao0.wechat.model.material.CommonMaterial;
import me.hao0.wechat.model.ma... | /**
* 上传临时素材:
图片(image): 1M,bmp/png/jpeg/jpg/gif
语音(voice):2M,播放长度不超过60s,mp3/wma/wav/amr
视频(video):10MB,支持MP4格式
缩略图(thumb):64KB,bmp/png/jpeg/jpg/gif
媒体文件在后台保存时间为3天,即3天后media_id失效。
* @param type 文件类型
* @param fileName 文件名
* @param input 输入流
* @param cb 回调
*/
... | public String uploadPermNews(List<NewsContentItem> items){ | 5 |
fabioz/eclipse.spellchecker | src/eclipse/spellchecker/preferences/SpellingConfigurationBlock.java | [
"public class SpellCheckEngine implements ISpellCheckEngine, IPropertyChangeListener {\n\n\t/** The dictionary location */\n\tpublic static final String DICTIONARY_LOCATION= \"dictionaries/\"; //$NON-NLS-1$\n\n\t/** The singleton engine instance */\n\tprivate static ISpellCheckEngine fgEngine= null;\n\n\t/**\n\t * ... | import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.... | /*******************************************************************************
* Copyright (c) 2000, 2011 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, an... | Locale locale= SpellCheckEngine.convertToLocale(localeString); | 0 |
idugalic/micro-ecommerce | microservices-orders/src/main/java/com/idugalic/orders/payment/web/PaymentController.java | [
"@Embeddable\npublic class MonetaryAmount {\n\n\tpublic static Currency EURO = Currency.getInstance(\"EUR\");\n\tpublic static MonetaryAmount ZERO = new MonetaryAmount();\n\tprivate final Currency currency;\n\tprivate final BigDecimal value;\n\n\tpublic MonetaryAmount(Currency currency, double value) {\n\t\tthis(cu... | import static org.springframework.web.bind.annotation.RequestMethod.DELETE;
import static org.springframework.web.bind.annotation.RequestMethod.GET;
import static org.springframework.web.bind.annotation.RequestMethod.PUT;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.rep... | package com.idugalic.orders.payment.web;
/**
* Spring MVC controller to handle payments for an {@link Order}.
*
*/
@Controller
@RequestMapping("/orders/{id}")
@ExposesResourceFor(Payment.class)
public class PaymentController {
private PaymentService paymentService;
private EntityLinks entityLinks;
@Autowired... | ResponseEntity<PaymentResource> submitPayment(@PathVariable("id") Order order, | 1 |
Ahmed-Abdelmeged/ADAS | app/src/main/java/com/example/mego/adas/videos/ui/VideosFragments.java | [
"public final class Constants {\n\n /**\n * Key for get teh video item bundle extra\n */\n public static final String KEY_ITEM_VIDEO = \"item_video\";\n\n /**\n * key for get the accident id key bundle extra\n */\n public static final String ACCIDENT_ID_KEY = \"accident_id\";\n\n /**\... | import android.arch.lifecycle.LifecycleFragment;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.vi... | /*
* Copyright (c) 2017 Ahmed-Abdelmeged
*
* github: https://github.com/Ahmed-Abdelmeged
* email: ahmed.abdelmeged.vm@gamil.com
* Facebook: https://www.facebook.com/ven.rto
* Twitter: https://twitter.com/A_K_Abd_Elmeged
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this ... | youTubeApiInterface = YouTubeApiClient.getYoutubeApiClient() | 1 |
danicadamljanovic/freya | freya/freya-annotate/src/test/java/org/freya/service/FreyaServiceHelperTest.java | [
"public class Annotation implements Serializable {\r\n\r\n String text;\r\n HashMap features;\r\n Long startOffset;\r\n Long endOffset;\r\n\r\n public HashMap getFeatures() {\r\n return features;\r\n }\r\n\r\n public void setFeatures(HashMap features) {\r\n this.features = feature... | import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.freya.model.Annotation;
import org.freya.model.ClassElement;
import org.freya.model.Question;
import o... | package org.freya.service;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:META-INF/spring/freya-applicationContext.xml"})
@Configurable
public class FreyaServiceHelperTest {
private static final Log logger = LogFactory.getLog(FreyaServiceHelperTest.class);
@Autowired... | ClassElement element = new ClassElement(); | 1 |
pxb1988/dex2jar | dex-translator/src/main/java/com/googlecode/d2j/converter/IR2JConverter.java | [
"public class Method {\r\n /**\r\n * name of the method.\r\n */\r\n private String name;\r\n /**\r\n * owner class of the method, in TypeDescriptor format.\r\n */\r\n private String owner;\r\n /**\r\n * parameter types of the method, in TypeDescriptor format.\r\n */\r\n pri... | import com.googlecode.d2j.DexType;
import com.googlecode.d2j.Method;
import com.googlecode.d2j.Proto;
import com.googlecode.d2j.asm.LdcOptimizeAdapter;
import com.googlecode.d2j.dex.Dex2Asm;
import com.googlecode.dex2jar.ir.IrMethod;
import com.googlecode.dex2jar.ir.Trap;
import com.googlecode.dex2jar.ir.expr.*;... | if (isZeroOrNull(v1) || isZeroOrNull(v2)) { // IFx
if (isZeroOrNull(v2)) {// v2 is zero
accept(v1, asm);
} else {
accept(v2, asm);
}
switch (v.vt) {
case NE:
as... | reBuildE1Expression((E1Expr) value, asm);
| 2 |
centro/monitoring-center | src/test/java/net/centro/rtb/monitoringcenter/config/ConfiguratorTest.java | [
"public class SeparateClassloaderTestRunner extends BlockJUnit4ClassRunner {\n\n public SeparateClassloaderTestRunner(Class<?> clazz) throws InitializationError {\n super(getFromTestClassloader(clazz));\n }\n\n private static Class<?> getFromTestClassloader(Class<?> clazz) throws InitializationError... | import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import net.centro.rtb.monitoringcenter.SeparateClassloaderTestRunner;
import net.centro.rtb.mon... | package net.centro.rtb.monitoringcenter.config;
@RunWith(SeparateClassloaderTestRunner.class)
public class ConfiguratorTest {
private static ObjectMapper objectMapper = new ObjectMapper(new YAMLFactory())
.setSerializationInclusion(JsonInclude.Include.NON_NULL)
.disable(DeserializationFe... | ConfigFileUtil.createEffectiveConfigFile(monitoringCenterConfig); | 4 |
FedericoPecora/coordination_oru | src/main/java/se/oru/coordination/coordination_oru/tests/TestTrajectoryEnvelopeCoordinatorWithMotionPlanner19.java | [
"public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m... | import java.io.File;
import java.util.Comparator;
import org.metacsp.multi.spatioTemporal.paths.Pose;
import com.vividsolutions.jts.geom.Coordinate;
import se.oru.coordination.coordination_oru.ConstantAccelerationForwardModel;
import se.oru.coordination.coordination_oru.CriticalSection;
import se.oru.coordination.coord... | package se.oru.coordination.coordination_oru.tests;
@DemoDescription(desc = "Example showing hazard of deadlock breaking in combination with yielding-for-parking policy.")
public class TestTrajectoryEnvelopeCoordinatorWithMotionPlanner19 {
public static void main(String[] args) throws InterruptedException {
... | final TrajectoryEnvelopeCoordinatorSimulation tec = new TrajectoryEnvelopeCoordinatorSimulation(MAX_VEL,MAX_ACCEL); | 6 |
GlitchCog/ChatGameFontificator | src/main/java/com/glitchcog/fontificator/sprite/SpriteFont.java | [
"public class Message\n{\n private static final Logger logger = Logger.getLogger(Message.class);\n\n private static final long UNCOMPLETED_TIME = 0L;\n\n /**\n * A regex for checking for emoji keys in the text. Used in a String.split to divide the message into an array of\n * words and the spaces b... | import java.awt.Color;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.image.ImageObserver;
import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.Logger;
import com.glitchcog.fontificator.bot.Message;... | package com.glitchcog.fontificator.sprite;
/**
* A font that is drawn with a sprite
*
* @author Matt Yanos
*/
public class SpriteFont
{
private static final Logger logger = Logger.getLogger(SpriteFont.class);
public static final String NORMAL_ASCII_KEY = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL... | protected ConfigFont config; | 4 |
ShawnShoper/x-job | xjob-util/xjob-util-log/log-util/src/main/java/org/shoper/log/util/LogProcessor.java | [
"public class Constans {\n //主版本号\n public static final String MAJORVERSION = \"1\";\n //默认的logtopic\n public static final String LOGTOPIC = \"sys-log\";\n //Property\n public static final String PROPERTY = \"property\";\n public static final String FNAME = \"fname\";\n public static final S... | import org.shoper.log.core.config.Constans;
import org.shoper.log.core.serialize.Business;
import org.shoper.log.core.serialize.Log;
import org.shoper.log.util.annotation.Channel;
import org.shoper.log.util.annotation.ContentType;
import org.shoper.log.util.annotation.LogModel;
import org.shoper.log.util.appender.Appen... | package org.shoper.log.util;
/**
* Created by ShawnShoper on 2017/4/18.
* 日志处理类
* TODO 这里使用线程池,通过Runtime.getRuntime().addShutdownHook()的方式可以在程序被关闭的时候进行关闭
*/
public class LogProcessor {
private static int pid = Integer.valueOf(ManagementFactory.getRuntimeMXBean().getName().split("@")[0]);
private List<App... | Business business = new Business(); | 1 |
ganeshkamathp/killingspree | core/src/com/sillygames/killingSpree/networking/StateProcessor.java | [
"public interface PlatformServices {\r\n public void toast(String message);\r\n public void shortToast(String message);\r\n}\r",
"public class ClientBomb extends ClientEntity {\r\n \r\n private Sprite sprite;\r\n boolean markForDispose;\r\n private float deadTimer;\r\n private Animation explo... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import com.badlogic.gdx.Gdx;
import com.esotericsoftware.kryonet.Client;
import com.esotericsoftware.kryonet.Connection;
import com.esotericsoftware.kryonet.Liste... | package com.sillygames.killingSpree.networking;
public class StateProcessor extends Listener{
private static final int QUEUE_LENGTH = 6;
private Client client;
public ArrayList<GameStateMessage> stateQueue;
public long timeOffset = 0;
private GameStateMessage nextState;
int lag = ... | nextState = MessageObjectPool.instance.
| 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.