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 |
|---|---|---|---|---|---|---|
BeYkeRYkt/LightAPI | craftbukkit-nms-v1_15_R1/src/main/java/ru/beykerykt/minecraft/lightapi/bukkit/internal/handler/craftbukkit/nms/v1_15_R1/VanillaNMSHandler.java | [
"public class BukkitPlatformImpl implements IPlatformImpl, IBukkitExtension {\n\n private static final String DEFAULT_IMPL_NAME = \"craftbukkit\";\n /**\n * CONFIG\n */\n private final String CONFIG_TITLE = \"general\";\n private final String CONFIG_DEBUG = CONFIG_TITLE + \".debug\";\n privat... | import com.google.common.collect.Lists;
import net.minecraft.server.v1_15_R1.BlockPosition;
import net.minecraft.server.v1_15_R1.Chunk;
import net.minecraft.server.v1_15_R1.ChunkCoordIntPair;
import net.minecraft.server.v1_15_R1.EntityPlayer;
import net.minecraft.server.v1_15_R1.EnumSkyBlock;
import net.minecraft.serve... | // ThreadedMailbox is closing. The light engine mailbox may also stop processing tasks.
// The light engine mailbox can be close due to server shutdown or unloading (closing) the world.
// I am not sure is it unsafe to process our tasks while the world is clos... | return ResultCode.CHUNK_NOT_LOADED; | 2 |
Kaysoro/KaellyBot | src/main/java/commands/classic/AlignmentCommand.java | [
"public abstract class FetchCommand extends AbstractCommand {\n\n protected DiscordException tooMuchServers;\n protected DiscordException notFoundServer;\n\n protected FetchCommand(String name, String pattern) {\n super(name, pattern);\n tooMuchServers = new TooMuchDiscordException(\"server\"... | import commands.model.FetchCommand;
import data.Guild;
import data.OrderUser;
import data.ServerDofus;
import discord4j.common.util.Snowflake;
import discord4j.core.event.domain.message.MessageCreateEvent;
import discord4j.core.object.entity.Member;
import discord4j.core.object.entity.Message;
import discord4j.core.spe... | package commands.classic;
/**
* Created by steve on 08/02/2018
*/
public class AlignmentCommand extends FetchCommand {
private DiscordException notFoundFilter;
private DiscordException tooMuchFilters;
private DiscordException tooMuchCities;
private DiscordException notFoundCity;
private Discor... | List<EmbedCreateSpec> embeds = OrderUser.getOrdersFromLevel(guild.get().getMembers() | 2 |
MagicMicky/HabitRPGJavaAPI | HabitRPGJavaAPI/src/com/magicmicky/habitrpglibrary/onlineapi/ReviveUser.java | [
"public abstract class HabitItem {\n\tprivate String id;\n\tprivate String notes;\n\tprivate Integer priority;\n\tprivate String text;\n\tprivate double value;\n\tprivate String attribute;\n\tprivate List<String> tagsId;\n\t/**\n\t * Create a new HabitItem from what is necessary\n\t * @param id the id of the habit\... | import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.json.JSONObject;
import com.magicmicky.habitrpglibrary.habits.HabitItem;
import com.magicmicky.habitrpglibrary.habits.User;
import com.magicmicky.habitrpglibrary.onlineapi.WebServiceInteraction.Answer;
impo... | package com.magicmicky.habitrpglibrary.onlineapi;
public class ReviveUser extends WebServiceInteraction {
private static final String CMD = "user/revive";
public ReviveUser(OnHabitsAPIResult callback,
HostConfig config) {
super(CMD, callback, config);
}
@Override
protected HttpRequestBase getRequest() {
... | User us=ParserHelper.parseUser(this.getObject()); | 4 |
LyashenkoGS/analytics4github | src/main/java/com/rhcloud/analytics4github/service/CommitsService.java | [
"public enum GitHubApiEndpoints {\n COMMITS, STARGAZERS\n}",
"@ApiModel\npublic class RequestFromFrontendDto {\n @ApiParam(required = true, example = \"mewo2\", value = \"a repository author. Example: mewo2\")\n private String author;\n @ApiParam(required = true, example = \"terrain\", value = \"a rep... | import com.fasterxml.jackson.databind.JsonNode;
import com.rhcloud.analytics4github.config.GitHubApiEndpoints;
import com.rhcloud.analytics4github.dto.RequestFromFrontendDto;
import com.rhcloud.analytics4github.dto.ResponceForFrontendDto;
import com.rhcloud.analytics4github.exception.GitHubRESTApiException;
import com.... | package com.rhcloud.analytics4github.service;
/**
* @author lyashenkogs.
*/
@Service
public class CommitsService {
private static Logger LOG = LoggerFactory.getLogger(CommitsService.class);
@Autowired
private RestTemplate template;
public List<LocalDate> getCommitsList(RequestFromFrontendDto reque... | GitHubApiEndpoints.COMMITS, Utils.getPeriodInstant(requestFromFrontendDto.getStartPeriod()), | 5 |
kinnla/eniac | src/eniac/menu/action/OpenSkin.java | [
"public class Manager {\n\n\t/*\n\t * ========================= applet lifecycle states =======================\n\t */\n\n\tpublic enum LifeCycle {\n\n\t\t/**\n\t\t * Default lifecycle state on startup\n\t\t */\n\t\tDEFAULT,\n\n\t\t/**\n\t\t * Livecycle state indicating a successful initialization\n\t\t */\n\t\tINI... | import java.awt.event.ActionEvent;
import java.util.List;
import eniac.Manager;
import eniac.io.Proxy;
import eniac.lang.Dictionary;
import eniac.menu.action.gui.OpenSkinPanel;
import eniac.skin.SkinIO; | /*******************************************************************************
* Copyright (c) 2003-2005, 2013 Till Zoppke.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available... | Manager.getInstance().makeDialog(panel, Dictionary.OPEN_SKIN_NAME.getText()); | 2 |
aw20/MongoWorkBench | src/org/aw20/mongoworkbench/eclipse/view/wizard/AggregateWizard.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.AggregateMongoCommand;
import org.aw20.mongoworkbench.command.MongoCommand;
import org.aw20.mongoworkbench.eclipse.v... | /*
* 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... | textPipe = MSwtUtil.createText( tabFolder ); | 7 |
oantajames/mdb-android-application | app/src/main/java/mdb/com/view/moviesgrid/MoviesGridActivity.java | [
"public class MovieEntity implements Parcelable {\n\n @SerializedName(\"vote_count\")\n @Expose\n public Integer voteCount;\n @SerializedName(\"id\")\n @Expose\n public Integer id;\n @SerializedName(\"video\")\n @Expose\n public Boolean video;\n @SerializedName(\"vote_average\")\n @... | import android.app.Fragment;
import android.app.FragmentManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import a... | package mdb.com.view.moviesgrid;
public class MoviesGridActivity extends BaseActivity
implements HasComponent<MoviesGridComponent>, OnItemSelectedListener {
public static Intent getCallingIntent(Context context) {
return new Intent(context, MoviesGridActivity.class);
}
public static S... | .moviesGridModule(new MoviesGridModule()) | 3 |
gjhutchison/pixelhorrorjam2016 | core/src/com/kowaisugoi/game/rooms/RoomHallway.java | [
"public class AudioManager implements Disposable {\n private static final Map<SoundId, Sound> _soundMap = new HashMap<SoundId, Sound>();\n private static final Map<MusicId, Music> _musicMap = new HashMap<MusicId, Music>();\n\n private static MusicId _currentSong = MusicId.NONE;\n\n public static void in... | import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.math.Rectangle;
import com.kowaisugoi.game.audio.AudioManager;
import com.kowaisugoi.game.audio.MusicId;
import com.kowaisugoi.game.audio.SoundId;
import com.k... | package com.kowaisugoi.game.rooms;
public class RoomHallway extends StandardRoom {
private static final String ROOM_URL = "rooms/hallway/hallway.png";
private static final String ROOM_URL2 = "rooms/hallway/hallway_night.png";
private static final String OH_HI = "rooms/hallway/hallway_hai.png";
pri... | GameUtil.Direction.DOWN) { | 6 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/main/presenter/HomePresenter.java | [
"public class BasePresenter {\n}",
"public class HomeRecyclerViewAdapter extends BaseRecyclerViewAdapter<HomeRecyclerViewAdapter.ViewHolder> {\n\n private List<HomeModel> list;\n\n public HomeRecyclerViewAdapter(List<HomeModel> list) {\n this.list = list;\n }\n\n @Override\n public ViewHolde... | import com.mgilangjanuar.dev.goscele.base.BasePresenter;
import com.mgilangjanuar.dev.goscele.modules.main.adapter.HomeRecyclerViewAdapter;
import com.mgilangjanuar.dev.goscele.modules.main.listener.HomeListener;
import com.mgilangjanuar.dev.goscele.modules.main.model.HomeModel;
import com.mgilangjanuar.dev.goscele.mod... | package com.mgilangjanuar.dev.goscele.modules.main.presenter;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class HomePresenter extends BasePresenter {
private HomeListener listener;
public HomePresenter(HomeListener listener) {
this.listener = listener;
... | new HomeProvider(listener).run(); | 4 |
SamuelGjk/GComic | app/src/main/java/moe/yukinoneko/gcomic/module/download/tasks/DownloadTasksPresenter.java | [
"public abstract class BasePresenter<T extends IBaseView> {\n protected CompositeSubscription mCompositeSubscription;\n protected Context mContext;\n protected T iView;\n\n public BasePresenter(Context context, T iView) {\n this.mContext = context;\n this.iView = iView;\n }\n\n publi... | import moe.yukinoneko.gcomic.utils.FileUtlis;
import moe.yukinoneko.gcomic.utils.Utils;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import android.content.Context;
import java.util.ArrayList;
import java.util.List;
import moe.yukinoneko.gcomic.R;
import moe.yukin... | /*
* Copyright (C) 2016 SamuelGjk <samuel.alva@outlook.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | Subscription subscription = DownloadTasksManager.getInstance(mContext) | 5 |
gibffe/fuse | src/main/java/com/sulaco/fuse/FuseServerImpl.java | [
"public interface AnnotationScanner {\n\n public void scan();\n}",
"public class RouteFinderActor extends FuseEndpointActor {\r\n\r\n @Autowired protected RoutesConfig routes;\r\n \r\n @Override\r\n protected void onRequest(final FuseRequestMessage message) {\r\n \r\n String uri = mes... | import com.sulaco.fuse.config.AnnotationScanner;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.ChannelOption;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
imp... | package com.sulaco.fuse;
@Component
public class FuseServerImpl implements FuseServer, InitializingBean, ApplicationContextAware {
protected ExecutorService exe = Executors.newSingleThreadExecutor();
protected ActorSystem actorSystem;
protected ApplicationContext appContext;
| @Autowired protected ActorFactory actorFactory;
| 4 |
cqyijifu/OpenFalcon-SuitAgent | src/main/java/com/yiji/falcon/agent/Agent.java | [
"@Getter\npublic enum AgentConfiguration {\n\n INSTANCE;\n\n //版本不能大于 x.9\n public static final float VERSION = (float) 11.8;\n\n /**\n * quartz配置文件路径\n */\n private String quartzConfPath = null;\n /**\n * push到falcon的地址\n */\n private String agentPushUrl = null;\n\n /**\n ... | import com.yiji.falcon.agent.config.AgentConfiguration;
import com.yiji.falcon.agent.jmx.JMXConnection;
import com.yiji.falcon.agent.plugins.util.PluginExecute;
import com.yiji.falcon.agent.plugins.util.PluginLibraryHelper;
import com.yiji.falcon.agent.util.*;
import com.yiji.falcon.agent.vo.HttpResult;
import com.yiji... | /*
* www.yiji.com Inc.
* Copyright (c) 2016 All Rights Reserved
*/
package com.yiji.falcon.agent;
/*
* 修订记录:
* guqiu@yiji.com 2016-06-22 17:48 创建
*/
/**
* agent服务
* @author guqiu@yiji.com
*/
@Slf4j
public class Agent extends Thread{
public static final PrintStream OUT = System.out;
public static f... | private HttpServer httpServer = null; | 7 |
jiang111/ZhiHu-TopAnswer | app/src/main/java/com/jiang/android/zhihu_topanswer/fragment/RecyclerViewFragment.java | [
"public abstract class BaseAdapter extends RecyclerView.Adapter<BaseViewHolder> {\n\n\n @Override\n public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n final BaseViewHolder holder = new BaseViewHolder(LayoutInflater.from(parent.getContext()).inflate(viewType, parent, false));\n... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.V... | package com.jiang.android.zhihu_topanswer.fragment;
/**
* Created by jiang on 2016/12/23.
*/
public class RecyclerViewFragment extends BaseFragment {
private static final String TAG = "RecyclerViewFragment";
public static final int PAGE_START = 1;
private int mPage = PAGE_START;
private stat... | private LoadMoreRecyclerView mRecyclerView; | 3 |
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/applications/sample_app4/FuzzyExperimentalNetworkModel.java | [
"public class SimManager extends SimEntity {\r\n\tprivate static final int CREATE_TASK = 0;\r\n\tprivate static final int CHECK_ALL_VM = 1;\r\n\tprivate static final int GET_LOAD_LOG = 2;\r\n\tprivate static final int PRINT_PROGRESS = 3;\r\n\tprivate static final int STOP_SIMULATION = 4;\r\n\t\r\n\tprivate String s... | import org.cloudbus.cloudsim.core.CloudSim;
import edu.boun.edgecloudsim.core.SimManager;
import edu.boun.edgecloudsim.core.SimSettings;
import edu.boun.edgecloudsim.edge_client.Task;
import edu.boun.edgecloudsim.network.NetworkModel;
import edu.boun.edgecloudsim.utils.Location;
import edu.boun.edgecloudsim.utils.SimLo... | /*
* Title: EdgeCloudSim - M/M/1 Queue model implementation
*
* Description:
* MM1Queue implements M/M/1 Queue model for WLAN and WAN communication
*
* Licence: GPL - http://www.gnu.org/copyleft/gpl.html
* Copyright (c) 2017, Bogazici University, Istanbul, Turkey
*/
package edu.boun.edgecloudsim... | wanClients = new int[SimSettings.getInstance().getNumOfEdgeDatacenters()]; //we have one access point for each datacenter | 1 |
WeDevelopTeam/HeroVideo-master | app/src/main/java/com/github/bigexcalibur/herovideo/mvp/live/ui/HomeLiveFragment.java | [
"public class LiveAppIndexAdapter extends RecyclerView.Adapter\n{\n\n private Context context;\n\n private LiveAppIndexInfo mLiveAppIndexInfo;\n\n private int entranceSize;\n\n //直播分类入口\n private static final int TYPE_ENTRANCE = 0;\n\n //直播Item\n private static final int TYPE_LIVE_ITEM = 1;\n\n... | import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.github.bigexcalibur.herovideo.LiveAppIndexAdapter;
... | package com.github.bigexcalibur.herovideo.mvp.live.ui;
/**
* 首页直播界面
*/
public class HomeLiveFragment extends RxLazyFragment
{
@BindView(R.id.recycle)
RecyclerView mRecyclerView;
@BindView(R.id.swipe_refresh_layout)
SwipeRefreshLayout mSwipeRefreshLayout;
@BindView(R.id.empty_layout)
Cus... | RetrofitHelper.getLiveAPI() | 2 |
jaquadro/ForgeMods | ModularPots/src/com/jaquadro/minecraft/modularpots/client/renderer/LargePotRenderer.java | [
"public class BlockLargePot extends BlockContainer\n{\n public static final String[] subTypes = new String[] { \"default\", \"raw\" };\n\n public enum Direction {\n North (1 << 0),\n East (1 << 1),\n South (1 << 2),\n West (1 << 3),\n NorthWest (1 << 4),\n NorthEast (... | import com.jaquadro.minecraft.modularpots.block.BlockLargePot;
import com.jaquadro.minecraft.modularpots.client.ClientProxy;
import com.jaquadro.minecraft.modularpots.tileentity.TileEntityLargePot;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.c... | package com.jaquadro.minecraft.modularpots.client.renderer;
public class LargePotRenderer implements ISimpleBlockRenderingHandler
{
private float[] baseColor = new float[3];
private float[] activeRimColor = new float[3];
private float[] activeInWallColor = new float[3];
private float[] activeBottomCo... | TileEntityLargePot tileEntity = block.getTileEntity(world, x, y, z); | 2 |
daquexian/chaoli-forum-for-android-2 | app/src/main/java/com/daquexian/chaoli/forum/utils/SignUpUtils.java | [
"public class ChaoliApplication extends Application {\n private static Context appContext;\n @Override\n public void onCreate() {\n super.onCreate();\n // train classifier on app start\n CodeProcessor.init(this);\n ChaoliApplication.appContext = getApplicationContext();\n ... | import android.util.Log;
import com.daquexian.chaoli.forum.ChaoliApplication;
import com.daquexian.chaoli.forum.meta.Constants;
import com.daquexian.chaoli.forum.model.BusinessQuestion;
import com.daquexian.chaoli.forum.model.Question;
import com.daquexian.chaoli.forum.network.MyOkHttp;
import com.daquexian.chaoli.foru... | package com.daquexian.chaoli.forum.utils;
/**
* Created by jianhao on 16-3-27.
*/
public class SignUpUtils {
private static final String TAG = "SignUpUtils";
public static final Map<String, String> subjectTags = new HashMap<String, String>(){{
put("数学", "math");
put("生物", "bio");
... | observer.onGetQuestionObjList(BusinessQuestion.fromList(response.body())); | 2 |
DeFuture/AmazeFileManager-master | src/main/java/com/amaze/filemanager/adapters/Recycleradapter.java | [
"public class Main extends android.support.v4.app.Fragment {\n public File[] file;\n public ArrayList<Layoutelements> list;\n public ArrayList<SmbFile> smbFiles;\n public Recycleradapter adapter;\n public Futils utils;\n public boolean selection;\n public boolean results = false,smbMode=false;\... | import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Typeface;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
import android.support.v7.widget.RecyclerView;
import android.util.Spa... | package com.amaze.filemanager.adapters;
/**
* Created by Arpit on 11-04-2015.
*/
public class Recycleradapter extends RecyclerArrayAdapter<String, RecyclerView.ViewHolder>
implements StickyRecyclerHeadersAdapter<RecyclerView.ViewHolder> {
Main main;
ArrayList<Layoutelements> items;
Context con... | public RoundedImageView viewmageV; | 4 |
sathipal/lwm2m_over_mqtt | src/com/ibm/lwm2m/client/LwM2MClient.java | [
"public class LwM2MServerObject extends MQTTResource {\n\t\n\tpublic static final String RESOURCE_NAME = \"1\";\n\tObserveSpec observeSpec = new ObserveSpec();\n\tprivate static final AtomicInteger instanceCounter = new AtomicInteger(0); \n\t\n\tpublic LwM2MServerObject(String name, boolean bInstance) {\n\t\tsuper(... | import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.Iterator;
import java.util.Properties;
import java.util.Scanner;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.ut... | System.out.println(" >> IPSO temperature Object - <3303/0> ");
System.out.println(" >> 3303/0/5700 - SensorValue ");
System.out.println(" >> 3303/0/5601 - Minimum Measured Value ");
System.out.println(" >> 3303/0/5602 - Maximum Measured Value ");
System.out.println(" >> 3303/0/5603 - Min Range Value ");
Sys... | AbstractRequestObserver { | 2 |
HackGSU/mobile-android | app/src/main/java/com/hackgsu/fall2016/android/HackGSUApplication.java | [
"public class FullscreenWebViewActivity extends AppCompatActivity {\n\tpublic static final String EXTRA_URL = \"extra_url\";\n\tprivate ContentLoadingProgressBar progressBar;\n\tprivate WebView webView;\n\n\t@Override\n\tprotected void onCreate (Bundle savedInstanceState) {\n\t\tsuper.onCreate(sav... | import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
imp... | package com.hackgsu.fall2016.android;
/**
* Created by Joshua King on 9/27/16.
*/
public class HackGSUApplication extends Application {
public static final String IS_IN_DEV_MODE = "is_in_dev_mode";
public static final String NOTIFICATIONS_ENABLED = "notifications_enabled";
private FirebaseAuth ... | final ArrayList<ScheduleEvent> scheduleEvents = new ArrayList<>(); | 5 |
timpalpant/java-genomics-toolkit | src/edu/unc/genomics/wigmath/ValueDistribution.java | [
"public abstract class CommandLineTool {\n\n /**\n * The default bite-size to use for applications that process files in chunks\n * TODO Read from a configuration file\n */\n public static final int DEFAULT_CHUNK_SIZE = 10_000_000;\n\n /**\n * Do the main computation of this tool\n * \n * @throws IOE... | import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import org.apache.log4j.Logger;
import com.beust.jcommander.Parameter;
import edu.unc.genomics.CommandLineTool;
import edu.unc.genomics.CommandLineToolException;
import edu.... | package edu.unc.genomics.wigmath;
/**
* Make a histogram of the values in a Wig file
*
* @author timpalpant
*
*/
public class ValueDistribution extends CommandLineTool {
private static final Logger log = Logger.getLogger(Autocorrelation.class);
@Parameter(names = { "-i", "--input" }, description = "Inp... | throw new CommandLineToolException("Error getting data from Wig file for chunk " + chunk); | 1 |
wakaleo/maven-schemaspy-plugin | src/main/java/net/sourceforge/schemaspy/view/DotFormatter.java | [
"public class Config\r\n{\r\n private static Config instance;\r\n private final List<String> options;\r\n private Map<String, String> dbSpecificOptions;\r\n private Map<String, String> originalDbSpecificOptions;\r\n private boolean helpRequired;\r\n private boolean dbHelpRequired;\r\n private F... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import net.sourceforge.schemaspy.Config;
import net.... | /*
* This file is a part of the SchemaSpy project (http://schemaspy.sourceforge.net).
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 John Currier
*
* SchemaSpy is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by th... | public Set<ForeignKeyConstraint> writeRealRelationships(Table table, boolean twoDegreesOfSeparation, WriteStats stats, LineWriter dot) throws IOException {
| 2 |
anroOfCode/hijack-infinity | android/freqSweep-app/src/umich/framjack/apps/freqsweep/MainActivity.java | [
"public class FramingEngine {\n\tprivate IncomingPacketListener _incomingListener;\n\tprivate OutgoingByteListener _outgoingListener;\n\t\n\tprivate final int _receiveMax = 18;\n\t\n\tprivate enum ReceiveState { START, SIZE, DATA, DATA_ESCAPE};\n\tprivate ReceiveState _receiveState = ReceiveState.START;\n\tprivate ... | import umich.framjack.core.FramingEngine;
import umich.framjack.core.OnByteSentListener;
import umich.framjack.core.OnBytesAvailableListener;
import umich.framjack.core.SerialDecoder;
import umich.framjack.core.FramingEngine.IncomingPacketListener;
import umich.framjack.core.FramingEngine.OutgoingByteListener;
import a... | package umich.framjack.apps.freqsweep;
public class MainActivity extends Activity {
private SerialDecoder _serialDecoder;
private FramingEngine _framer;
private boolean _nextFlag = false;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
se... | private OnByteSentListener _byteSentListener = new OnByteSentListener() { | 1 |
CaMnter/EasyGank | app/src/main/java/com/camnter/easygank/data/DataManager.java | [
"public class BaseGankData implements Serializable {\n\n // 发布人\n @SerializedName(\"who\") public String who;\n\n // 发布时间\n @SerializedName(\"publishedAt\") public Date publishedAt;\n\n // 标题\n @SerializedName(\"desc\") public String desc;\n\n // 类型, 一般都是\"福利\"\n @SerializedName(\"type\") pu... | import java.util.ArrayList;
import java.util.List;
import rx.Observable;
import com.camnter.easygank.bean.BaseGankData;
import com.camnter.easygank.bean.GankDaily;
import com.camnter.easygank.model.impl.DailyModel;
import com.camnter.easygank.model.impl.DataModel;
import com.camnter.easygank.presenter.MainPresenter;
im... | /*
* {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... | private DataModel dataModel; | 3 |
edouardhue/comeon | src/main/java/comeon/ui/actions/AddMediaAction.java | [
"public interface Core {\n\n String EXTERNAL_METADATA_KEY = \"external\";\n\n String[] PICTURE_EXTENSIONS = { \"jpg\", \"jpeg\" };\n\n String[] AUDIO_EXTENSIONS = { \"ogg\", \"flac\", \"wav\" };\n\n void addMedia(final File[] files, final Template defautTemplate, final ExternalMetadataSource<?> external... | import com.google.common.eventbus.Subscribe;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import comeon.core.Core;
import comeon.templates.Templates;
import comeon.templates.TemplatesChangedEvent;
import comeon.ui.add.AddMediaDialog;
import comeon.ui.add.AdderWorker;
import javax.swing.*;
import... | package comeon.ui.actions;
@Singleton
public final class AddMediaAction extends BaseAction {
private static final long serialVersionUID = 1L;
private final Templates templates;
private final Core core;
@Inject
public AddMediaAction(final Templates templates, final Core core) {
super("... | public void handleTemplatesChanged(final TemplatesChangedEvent event) { | 2 |
gizwits/GizOpenSource_AppKit_Android | src/com/gizwits/opensource/appkit/sharingdevice/SharedDeviceListAcitivity.java | [
"public class GosBaseActivity extends FragmentActivity {\n\n\t/** 设备热点默认密码 */\n\tpublic static String SoftAP_PSW = \"123456789\";\n\n\t/** 设备热点默认前缀 */\n\tpublic static String SoftAP_Start = \"XPG-GAgent\";\n\n\t/** 存储器默认名称 */\n\tpublic static final String SPF_Name = \"set\";\n\n\t/** Toast time */\n\tpublic int toa... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import com.gizwits.gizwifisdk.api.GizDeviceSharing;
import com.gizwits.gizwifisdk.api.GizDeviceSharingInfo;
import com.gizwits.gizwifisdk.api.GizMessage;
import com.gizwits.gizwifisdk.enumration.GizDeviceSharin... | package com.gizwits.opensource.appkit.sharingdevice;
public class SharedDeviceListAcitivity extends GosBaseActivity {
private List<String> tabList;
private List<Fragment> myfragmentlist;
private String token;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);... | myadapter getmyadapter = fragment.getmyadapter(); | 4 |
nloko/SyncMyPix | src/com/nloko/android/syncmypix/MainActivity.java | [
"public class PhotoStore {\n\n private final String TAG = PhotoStore.class.getSimpleName();\n\n // Directory name under the root directory for photo storage.\n private final String DIRECTORY = \"photos\";\n\n /** Map of keys to entries in the directory. */\n private final Map<Long, Entry> mEntries;\n... | import java.io.IOException;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import com.android.providers.contacts.PhotoStore;
import com.facebook.android.DialogError;
import com.facebook.android.Facebook;
import com.facebook.android.Facebook.DialogListener;
im... | fbClient.authorize(self, new DialogListener() {
public void onComplete(Bundle values) {sync();}
public void onFacebookError(FacebookError error) {try
{
loggedIn = false;
Toast.makeText(self, "Error on facebook sync again!",... | final LogCollector collector = new LogCollector(); | 4 |
maksim-m/Popular-Movies-App | app/src/main/java/me/maxdev/popularmoviesapp/ui/detail/MovieDetailFragment.java | [
"public class PopularMoviesApp extends Application {\n\n private NetworkComponent networkComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n networkComponent = DaggerNetworkComponent.builder()\n .appModule(new AppModule(this))\n .networkModu... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.CardView;
import android.s... | }
private void updateMovieReviewsCard() {
if (reviewsAdapter == null || reviewsAdapter.getItemCount() == 0) {
cardMovieReviews.setVisibility(View.GONE);
} else {
cardMovieReviews.setVisibility(View.VISIBLE);
}
}
private void setupCardElevation(View view)... | movieVideos.addItemDecoration(new ItemOffsetDecoration(getActivity(), R.dimen.movie_item_offset)); | 7 |
bit-man/SwissArmyJavaGit | javagit/src/main/java/edu/nyu/cs/javagit/client/cli/CliGitCheckout.java | [
"public final class JavaGitConfiguration {\n\n /*\n * The path to our git binaries. Default to null, which means that the git command is available\n * via the system PATH environment variable.\n */\n private static File gitPath = null;\n\n /*\n * The version string fpr the locally-installed git binaries.... | import java.util.List;
import java.util.Scanner;
import edu.nyu.cs.javagit.api.JavaGitConfiguration;
import edu.nyu.cs.javagit.api.JavaGitException;
import edu.nyu.cs.javagit.api.Ref;
import edu.nyu.cs.javagit.api.Ref.RefType;
import edu.nyu.cs.javagit.api.commands.GitCheckoutOptions;
import edu.nyu.cs.javagit.api.comm... | throw new JavaGitException(120, "Both --notrack and --track options are set");
}
if (options.optTrack()) {
command.add("--track");
}
if (options.optNoTrack()) {
command.add("--no-track");
}
command.ad... | throw new JavaGitException(406000, ExceptionMessageMap.getMessage("406000") + | 6 |
zeromq/jzmq-api | src/main/java/org/zeromq/api/Context.java | [
"public class CloneClientBuilder {\n public class Spec {\n public String primaryAddress;\n public String backupAddress;\n public int primaryPort;\n public int backupPort;\n public String subtree;\n public long heartbeatInterval = 1000L;\n }\n\n private ManagedConte... | import org.zeromq.jzmq.beacon.BeaconReactorBuilder;
import org.zeromq.jzmq.bstar.BinaryStarReactorBuilder;
import org.zeromq.jzmq.bstar.BinaryStarSocketBuilder;
import org.zeromq.jzmq.clone.CloneClientBuilder;
import org.zeromq.jzmq.clone.CloneServerBuilder;
import org.zeromq.jzmq.device.DeviceBuilder;
import org.zerom... | package org.zeromq.api;
/**
* A ØMQ context is thread safe and may be shared among as many application threads as necessary, without any additional
* locking required on the part of the caller.
*/
public interface Context extends Closeable {
/**
* Create a ØMQ Socket of type SocketType
*
* @pa... | CloneClientBuilder buildCloneClient(); | 0 |
karthicks/gremlin-ogm | gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/reflect/Label.java | [
"@Data\n@ToString\n@NoArgsConstructor\n@Accessors(fluent = true, chain = true)\n@EqualsAndHashCode(callSuper = true, of = {})\npublic abstract class Edge extends Element {\n\n /**\n * The object representation of the \"from\" vertex.\n */\n @Hidden\n private Vertex from;\n /**\n * The object representatio... | import org.apache.commons.lang3.text.WordUtils;
import org.apache.tinkerpop.gremlin.object.model.Alias;
import org.apache.tinkerpop.gremlin.object.structure.Edge;
import org.apache.tinkerpop.gremlin.object.structure.Element;
import static org.apache.tinkerpop.gremlin.object.reflect.Classes.is;
import static org.apache.... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ma... | label = name(elementType); | 3 |
5GSD/AIMSICDL | AIMSICD/src/main/java/zz/aimsicd/lite/ui/fragments/CellInfoFragment.java | [
"public class BaseInflaterAdapter<T> extends BaseAdapter {\n\n private final List<T> m_items = new ArrayList<>();\n\n private IAdapterViewInflater<T> m_viewInflater;\n\n public BaseInflaterAdapter(IAdapterViewInflater<T> viewInflater) {\n m_viewInflater = viewInflater;\n }\n\n public BaseInfla... | import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
import android.text.TextUtils;
import android.view.View;
import andr... | /* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project
* -----------------------------------------------------------
* LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o
* -----------------------------------------------------------
*/
/* This was introduced by Aussie in the Pull Request Commit: ... | Helpers.msgShort(mContext, mContext.getString(zz.aimsicd.lite.R.string.refreshing_every) + " " + | 7 |
ypresto/miniguava | miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/ImmutableList.java | [
"public static int checkElementIndex(int index, int size) {\n return checkElementIndex(index, size, \"index\");\n}",
"public static void checkPositionIndexes(int start, int end, int size) {\n // Carefully optimized for execution by hotspot (explanatory comment above)\n if (start < 0 || end < start || end > siz... | import java.util.Collections;
import java.util.List;
import java.util.RandomAccess;
import javax.annotation.Nullable;
import static net.ypresto.miniguava.base.Preconditions.checkElementIndex;
import static net.ypresto.miniguava.base.Preconditions.checkPositionIndexes;
import static net.ypresto.miniguava.collect.immutab... | /*
* Copyright (C) 2007 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | elements = arraysCopyOf(elements, length); | 2 |
atolcd/alfresco-audit-share | audit-share-platform/src/main/java/com/atolcd/alfresco/repo/jscript/ShareStats.java | [
"public class AtolVolumetryEntry {\n\tprivate long id = 0;\n\tprivate String siteId = \"\";\n\tprivate long siteSize = 0;\n\tprivate int folderCount = 0;\n\tprivate int fileCount = 0;\n\tprivate long atTime = 0;\n\n\tpublic AtolVolumetryEntry() {\n\t}\n\n\tpublic AtolVolumetryEntry(String siteId, long siteSize, int... | import java.io.Serializable;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.domain.node.ContentDataWithId;
import org.alfresco.repo.jscript.BaseScopableProcessorExtension;
import org.alfresco.service... | /*
* 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 = new AuditQueryParameters(); | 1 |
googleapis/google-oauth-java-client | samples/dailymotion-cmdline-sample/src/main/java/com/google/api/services/samples/dailymotion/cmdline/DailyMotionSample.java | [
"public class AuthorizationCodeFlow {\n\n /**\n * Method of presenting the access token to the resource server (for example {@link\n * BearerToken#authorizationHeaderAccessMethod}).\n */\n private final AccessMethod method;\n\n /** HTTP transport. */\n private final HttpTransport transport;\n\n /** JSON ... | import com.google.api.client.auth.oauth2.AuthorizationCodeFlow;
import com.google.api.client.auth.oauth2.BearerToken;
import com.google.api.client.auth.oauth2.ClientParametersAuthentication;
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeI... | /*
* Copyright (c) 2011 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 ... | LocalServerReceiver receiver = | 5 |
ResearchStack/ResearchStack | backbone/src/main/java/org/researchstack/backbone/ui/step/layout/SurveyStepLayout.java | [
"public abstract class ResourcePathManager {\n private static Gson gson = new GsonBuilder().setDateFormat(\"MMM yyyy\").create();\n\n private static ResourcePathManager instance;\n\n /**\n * Initializes the ResourcePathManager singleton. It is best to call this method inside your\n * {@link Applica... | import android.content.Context;
import android.content.Intent;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.text.Html;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.wi... | package org.researchstack.backbone.ui.step.layout;
public class SurveyStepLayout extends FixedSubmitBarLayout implements StepLayout {
public static final String TAG = SurveyStepLayout.class.getSimpleName();
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
... | BodyAnswer bodyAnswer = stepBody.getBodyAnswerState(); | 4 |
inouire/baggle | baggle-client/src/inouire/baggle/client/gui/ConnectionPanel.java | [
"public class Language {\n\n static String[] tooltip_fr = new String[]{\n \"Lister les serveurs sur le réseau officiel\",//0\n \"Lister les serveurs en réseau local\",//1\n };\n static String[] tooltip_en = new String[]{\n \"List servers of the official network\",//0\n \"List se... | import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import inouire.baggle.client.Language;
import inouire.baggle.client.Main;
import inouire.baggle.client.gui.modules.LANDiscoverPanel;
import inouire.baggle.client.gui.modules.OfficialServersPanel;
import ino... | package inouire.baggle.client.gui;
/**
*
* @author Edouard de Labareyre
*/
public class ConnectionPanel extends JPanel{
public SideConnectionPanel sideConnectionPane;
public OfficialServersPanel officialServersPane;
public LANDiscoverPanel lanDiscoverPane;
private NetworkTypeSelectionPanel ... | new LANDiscoverThread(lanDiscoverPane).start(); | 5 |
moxious/neoprofiler | src/main/java/org/mitre/neoprofiler/html/HTMLMaker.java | [
"public class MarkdownMaker {\n\tpublic MarkdownMaker() {\n\t\t\n\t}\n\t\n\tpublic String link(String text, String url) { return \"[\" + text + \"](\" + url + \")\"; } \n\tpublic String h1(String content) { return \"\\n# \" + content + \"\\n\"; }\n\tpublic String h2(String content) { return \"\\n## \" + content + \... | import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Collection;
import java.util.List;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;
import ... | package org.mitre.neoprofiler.html;
/**
* Class that renders a DBProfile as HTML.
* The general approach is to write a graph structure in JSON rendered via D3.js, and to populate the rest
* of the page with regular markdown from the MarkdownGenerator, rendered to HTML by strapdown.js.
* @author moxious
*/
publ... | for(NeoProfile p : profile.getProfiles()) { | 3 |
NanYoMy/mybatis-generator | src/main/java/org/mybatis/generator/config/Context.java | [
"public class GeneratedXmlFile extends GeneratedFile {\n private Document document;\n\n private String fileName;\n\n private String targetPackage;\n\n private boolean isMergeable;\n \n private XmlFormatter xmlFormatter;\n\n /**\n * \n * @param document\n * @param fileName\n * @p... | import static org.mybatis.generator.internal.util.StringUtility.composeFullyQualifiedTableName;
import static org.mybatis.generator.internal.util.StringUtility.isTrue;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import static org.mybatis.generator.internal.util.messages.Messages.getS... | /*
* Copyright 2005 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | IntrospectedTable it = null; | 3 |
immopoly/android | src/org/immopoly/android/app/UserLoginActivity.java | [
"public class C2DMessaging {\n\tpublic static final String EXTRA_SENDER = \"sender\";\n\tpublic static final String EXTRA_APPLICATION_PENDING_INTENT = \"app\";\n\tpublic static final String REQUEST_UNREGISTRATION_INTENT = \"com.google.android.c2dm.intent.UNREGISTER\";\n\tpublic static final String REQUEST_REGISTRAT... | import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import org.immopoly.android.R;
import org.immopoly.android.c2dm.C2DMessaging;
import org.immopoly.android.constants.Const;
import org.immopoly.android.helper.Settings;
import org.immopoly.android.helper.TrackingManager;
import org.i... | package org.immopoly.android.app;
public class UserLoginActivity extends Activity {
public static final int RESULT_REGISTER = 4321;
private GoogleAnalyticsTracker tracker;
private Handler toggleProgressHandler;
public static final int MIN_PASSWORTH_LENGTH = 4;
private static final int MIN_USERNAME_LENGTH = 1... | tracker.startNewSession(TrackingManager.UA_ACCOUNT, | 3 |
3pillarlabs/socialauth | socialauth/src/main/java/org/brickred/socialauth/provider/SalesForceImpl.java | [
"public abstract class AbstractProvider implements AuthProvider, Serializable {\n\n\tprivate static final long serialVersionUID = -7827145708317886744L;\n\n\tprivate Map<Class<? extends Plugin>, Class<? extends Plugin>> pluginsMap;\n\n\tprivate final Log LOG = LogFactory.getLog(this.getClass());\n\n\tpublic Abstrac... | import java.io.InputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.brickred.socialauth.AbstractProvider;
impor... | /*
===========================================================================
Copyright (c) 2010 BrickRed Technologies Limited
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 restric... | private OAuthConfig config; | 6 |
chanjarster/artemis-disruptor-miaosha | jms-server/src/main/java/me/chanjar/jms/server/config/OrderInsertProcessorConfiguration.java | [
"public class DisruptorLifeCycleContainer implements SmartLifecycle {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(DisruptorLifeCycleContainer.class);\n\n private volatile boolean running = false;\n\n private final String disruptorName;\n private final Disruptor disruptor;\n private final i... | import com.lmax.disruptor.dsl.Disruptor;
import me.chanjar.jms.base.lifecycle.DisruptorLifeCycleContainer;
import me.chanjar.jms.server.StartupOrderConstants;
import me.chanjar.jms.server.command.infras.CommandDispatcher;
import me.chanjar.jms.server.command.infras.disruptor.*;
import me.chanjar.jms.server.command.orde... | package me.chanjar.jms.server.config;
@Configuration
@EnableConfigurationProperties(OrderInsertProcessorConfiguration.Conf.class)
public class OrderInsertProcessorConfiguration implements ApplicationContextAware {
private static final Logger LOGGER = LoggerFactory.getLogger(OrderInsertProcessorConfiguration.class... | BeanRegisterUtils.registerSingleton( | 7 |
aeshell/aesh-extensions | aesh/src/test/java/org/aesh/extensions/rm/RmTest.java | [
"@CommandDefinition(name = \"cat\", description = \"concatenate files and print on the standard output\")\npublic class Cat implements Command<CommandInvocation> {\n\n @Option(shortName = 'A', name = \"show-all\", hasValue = false, description = \"equivalent to -vET\")\n private boolean showAll;\n\n @Optio... | import org.aesh.extensions.touch.Touch;
import org.aesh.readline.terminal.Key;
import org.aesh.terminal.utils.Config;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.Fil... | /*
* JBoss, Home of Professional Open Source
* Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Vers... | prepare(Touch.class, Mkdir.class, Cd.class, Cat.class, Ls.class, Rm.class); | 0 |
handexing/geekHome | geekHome-web-ui/src/main/java/com/geekhome/controller/LabelController.java | [
"public enum ErrorCode {\n\t\n\tEXCEPTION(\"程序异常\", \"00001\"),\n\tUSER_NOT_EXIST(\"用户未注册\", \"00002\"),\n VERIFY_CODE_WRONG(\"验证码错误\",\"00003\"),\n OLD_PWD_WRONG(\"旧密码错误\",\"00004\"),\n USERNAME_PASSWORD_WRONG(\"用户名或密码错误\",\"00005\"),\n TODAY_HAVE_SIGN(\"今日已签到\",\"00006\");\n\n\tprivate String errorMsg... | import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework... | package com.geekhome.controller;
@RestController
@RequestMapping("label")
public class LabelController {
Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired | LabelService labelService; | 5 |
tsaglam/EcoreMetamodelExtraction | src/main/java/eme/generator/EClassifierGenerator.java | [
"public class ExternalTypeHierarchy extends EPackageHierarchy {\n\n /**\n * Simple constructor, builds the base for the hierarchy.\n * @param root is the root {@link EPackage} of the metamodel.\n * @param properties is the instance of the {@link ExtractionProperties} class.\n */\n public Exter... | import java.util.HashMap;
import java.util.Map;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.EGenericType;
imp... | package eme.generator;
/**
* Generator class for Ecore classifiers ({@link EClassifier}s).
* @author Timur Saglam
*/
public class EClassifierGenerator {
private static final Logger logger = LogManager.getLogger(EClassifierGenerator.class.getName());
private final Map<EClass, ExtractedType> bareEClasses;
... | } else if (type.getClass() == ExtractedEnum.class) { // build enum: | 2 |
lazyparser/xbot_head | app/src/main/java/cn/ac/iscas/xlab/droidfacedog/mvp/commentary/CommentaryFragment.java | [
"public class ImagePreviewAdapter extends\n RecyclerView.Adapter<RecyclerView.ViewHolder> {\n\n // Store the context for later use\n private Context context;\n\n private ArrayList<Bitmap> bitmaps;\n private int check = 0;\n\n private ViewHolder.OnItemClickListener onItemClickListener;\n\n /... | import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.ImageFormat;
import android.graphics.PointF;
import android.graphics.RectF;
import android.grap... | public void setPresenter(CommentaryContract.Presenter presenter) {
this.presenter = presenter;
}
private void initCallbackAndListeners() {
cameraCallback = new CameraDevice.StateCallback() {
@Override
public void onOpened(@NonNull CameraDevice camera) {
... | Size previewSize = Util.getPreferredPreviewSize( | 4 |
vanniktech/espresso-utils | espresso-core-utils/src/androidTest/java/com/vanniktech/espresso/core/utils/AttributeMatcherTest.java | [
"@CheckResult public static AttributeMatcher withAttr(@AttrRes final int attr, @ColorInt final int color) {\n return new AttributeMatcher(attr, null, ColorChecker.from(color));\n}",
"@CheckResult public static AttributeMatcher withAttrRes(@AttrRes final int attr, @ColorRes final int colorRes) {\n return new Att... | import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.vanniktech.espresso.core.utils.test.R;
import junit.framework.AssertionFailedError;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import... | package com.vanniktech.espresso.core.utils;
@RunWith(AndroidJUnit4.class) public final class AttributeMatcherTest {
@Rule public final ExpectedException expectedException = ExpectedException.none();
@Rule public final ActivityTestRule<AttributeMatcherActivity> activityTestRule = new ActivityTestRule<>(Attribute... | onView(withId(VIEW_ID)).check(matches(withAttrRes(R.attr.colorError, R.color.blue))); | 6 |
Gikkman/Java-Twirk | src/main/java/com/gikk/twirk/types/usernotice/DefaultUsernoticeBuilder.java | [
"public interface TagMap extends Map<String, String>{\n //***********************************************************\n\t// \t\t\t\tPUBLIC\n\t//***********************************************************\n\t/**Fetches a certain field value that might have been present in the tag.\n\t * If the field was not prese... | import com.gikk.twirk.types.TagMap;
import com.gikk.twirk.types.TwitchTags;
import com.gikk.twirk.types.emote.Emote;
import com.gikk.twirk.types.twitchMessage.TwitchMessage;
import com.gikk.twirk.types.usernotice.subtype.Raid;
import com.gikk.twirk.types.usernotice.subtype.Ritual;
import com.gikk.twirk.types.usernotice... | package com.gikk.twirk.types.usernotice;
class DefaultUsernoticeBuilder implements UsernoticeBuilder{
String rawLine;
List<Emote> emotes;
String messageID;
int roomID;
long sentTimestamp;
String systemMessage;
Subscription subscription;
Raid raid;
Ritual ritual;
String message;
@Ov... | TagMap map = message.getTagMap(); | 0 |
cchao1024/TouchNews | app/src/main/java/com/github/cchao/touchnews/ui/fragment/JokeImageListFragments.java | [
"public interface JokeImageListContract {\n interface View {\n /**\n * 获取数据\n *\n * @param newsList newsList\n */\n void onRefreshData(List<Contentlist> newsList);\n\n /**\n * 添加数据\n *\n * @param newsList add newsList\n */\n ... | import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import com.apkfuns.logutils.LogUtils;
import com.github.cchao.touchnews.R;
imp... | package com.github.cchao.touchnews.ui.fragment;
/**
* Created by cchao on 2016/3/30.
* E-mail: cchao1024@163.com
* Description: 开心一刻- 图片类Fragment
*/
public class JokeImageListFragments extends BaseFragment implements JokeImageListContract.View, SwipeRefreshLayout.OnRefreshListener {
@Bind(R.id.swipe_refr... | SnackBarUtil.showLong(mRootView, R.string.none_net_show_action).setAction(R.string.set, new View.OnClickListener() { | 7 |
otale/tale | src/main/java/com/tale/service/CommentsService.java | [
"public class TaleConst {\n\n public static final String CLASSPATH = new File(AdminApiController.class.getResource(\"/\").getPath()).getPath() + File.separatorChar;\n\n public static final String REMEMBER_IN_COOKIE = \"remember_me\";\n public static final String LOGIN_ERROR_COUNT = \"login_error... | import com.blade.exception.ValidatorException;
import com.blade.ioc.annotation.Bean;
import com.blade.kit.BladeKit;
import com.blade.kit.DateKit;
import com.tale.bootstrap.TaleConst;
import com.tale.extension.Commons;
import com.tale.model.dto.Comment;
import com.tale.model.entity.Comments;
import com.tale.model.entity... | package com.tale.service;
/**
* 评论Service
*
* @author biezhi
* @since 1.3.1
*/
@Bean
public class CommentsService {
/**
* 保存评论
*
* @param comments
*/
public void saveComment(Comments comments) {
comments.setAuthor(TaleUtils.cleanXSS(comments.getAuthor()));
comments.... | public Page<Comment> getComments(Integer cid, int page, int limit) { | 2 |
kevinmmarlow/Dreamer | volley/src/main/java/com/android/fancyblurdemo/volley/toolbox/StringRequest.java | [
"public class NetworkResponse {\n /**\n * Creates a new network response.\n * @param statusCode the HTTP status code\n * @param data Response body\n * @param headers Headers returned with this response, or null for none\n * @param notModified True if the server returned a 304 and the data was... | import com.android.fancyblurdemo.volley.NetworkResponse;
import com.android.fancyblurdemo.volley.Request;
import com.android.fancyblurdemo.volley.Response;
import com.android.fancyblurdemo.volley.Response.ErrorListener;
import com.android.fancyblurdemo.volley.Response.Listener;
import java.io.UnsupportedEncodingExcepti... | /*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | protected Response<String> parseNetworkResponse(NetworkResponse response) { | 0 |
larusba/neo4j-jdbc | neo4j-jdbc-bolt/src/test/java/org/neo4j/jdbc/bolt/BoltNeo4jStatementTest.java | [
"public abstract class Neo4jStatement implements Statement, Loggable {\n\n\tprotected Neo4jConnection connection;\n\tprotected ResultSet currentResultSet;\n\tprotected int currentUpdateCount;\n\tprotected List<String> batchStatements;\n\tprotected boolean debug;\n\tprotected int ... | import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.internal.util.reflection.Whitebox;
import org.neo4j.driver.v1.Session;
import org.neo4j.driver.v1.Stat... | /*
* Copyright (c) 2016 LARUS Business Automation [http://www.larus-ba.it]
* <p>
* This file is part of the "LARUS Integration Framework for Neo4j".
* <p>
* The "LARUS Integration Framework for Neo4j" is licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complian... | BoltNeo4jConnectionImpl mockConnection = mockConnectionOpen(); | 2 |
Xilef11/runesofwizardry-classics | src/main/java/xilef11/mc/runesofwizardry_classics/runes/entity/RuneEntityProtection.java | [
"public final class Refs {\n\tprivate Refs(){}\n\tpublic static final String MODID = \"runesofwizardry_classics\";\n\tpublic static final String VERSION = \"@VERSION@\";\n\tpublic static final String NAME=\"Runes of Wizardry - Classic Dusts Pack\";\n\tpublic static final String GUI_FACTORY=\"xilef11.mc.runesofwizar... | import java.util.List;
import java.util.Set;
import com.zpig333.runesofwizardry.tileentity.TileEntityDustActive;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompou... | package xilef11.mc.runesofwizardry_classics.runes.entity;
public class RuneEntityProtection extends FueledRuneEntity {
public RuneEntityProtection(ItemStack[][] actualPattern, EnumFacing facing, | Set<BlockPos> dusts, TileEntityDustActive entity, RuneProtection creator) { | 2 |
Keridos/FloodLights | src/main/java/de/keridos/floodlights/tileentity/TileEntityMetaFloodlight.java | [
"public class NetworkDataList extends NonNullList<Object> {\n\n public NetworkDataList() {\n super();\n }\n}",
"public class ConfigHandler {\n private static ConfigHandler instance = null;\n\n public static boolean electricFloodlight;\n public static boolean smallElectricFloodlight;\n pub... | import de.keridos.floodlights.core.NetworkDataList;
import de.keridos.floodlights.handler.ConfigHandler;
import de.keridos.floodlights.init.ModBlocks;
import de.keridos.floodlights.reference.Names;
import de.keridos.floodlights.util.MathUtil;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.... | package de.keridos.floodlights.tileentity;
/**
* Created by Keridos on 06.05.2015.
* This Class
*/
@SuppressWarnings({"WeakerAccess", "NullableProblems"})
public abstract class TileEntityMetaFloodlight extends TileEntityFL implements ITickable {
protected boolean active;
protected boolean wasActive;
... | if (nbtTagCompound.hasKey(Names.NBT.WAS_ACTIVE)) | 3 |
cuberact/cuberact-json | src/main/java/org/cuberact/json/parser/JsonScanner.java | [
"public class JsonException extends RuntimeException {\r\n\r\n private static final long serialVersionUID = 1L;\r\n\r\n public JsonException(String message) {\r\n super(message);\r\n }\r\n\r\n public JsonException(Throwable t) {\r\n super(t);\r\n }\r\n\r\n public JsonException(String... | import org.cuberact.json.JsonException;
import org.cuberact.json.JsonNumber;
import org.cuberact.json.input.JsonInput;
import static org.cuberact.json.input.JsonInput.END_OF_INPUT;
import static org.cuberact.json.optimize.CharTable.hexBitShift;
import static org.cuberact.json.optimize.CharTable.toInt;
| /*
* Copyright 2017 Michal Nikodim
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | JsonNumber consumeNumber() {
| 1 |
MiniDigger/projecttd | core/src/me/minidigger/projecttd/screens/GameScreen.java | [
"public class GameGestureProcessor extends GestureDetector.GestureAdapter {\n\n private GameScreen gameScreen;\n\n public GameGestureProcessor(GameScreen gameScreen) {\n this.gameScreen = gameScreen;\n }\n\n @Override\n public boolean pan(float x, float y, float deltaX, float deltaY) {\n ... | import com.badlogic.ashley.core.PooledEngine;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Textur... | package me.minidigger.projecttd.screens;
/**
* Created by Martin on 01.04.2017.
*/
public class GameScreen implements Screen {
private TiledMap map;
private OrthogonalTiledMapRenderer tiledMapRenderer;
private OrthographicCamera camera;
private ShapeRenderer shapeRenderer = new ShapeRenderer();
... | multiplexer.addProcessor(new GestureDetector(new GameGestureProcessor(this))); | 0 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/request/team/TeamAppCreate.java | [
"public class App implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n String id;\n String name;\n Domain domain_name;\n String created_at;\n App.Owner owner;\n String web_url;\n App.Stack stack;\n String requested_stack;\n String git_url;\n String buil... | import com.heroku.api.App;
import com.heroku.api.Heroku;
import com.heroku.api.TeamApp;
import com.heroku.api.exception.RequestFailedException;
import com.heroku.api.http.Http;
import com.heroku.api.request.Request;
import com.heroku.api.request.RequestConfig;
import java.util.Collections;
import java.util.Map;
import ... | package com.heroku.api.request.team;
/**
* TODO: Javadoc
*
* @author Naaman Newbold
*/
public class TeamAppCreate implements Request<TeamApp> {
private final RequestConfig config;
public TeamAppCreate(TeamApp app) {
RequestConfig builder = new RequestConfig(); | builder = builder.with(Heroku.RequestKey.Team, app.getTeam().getName()); | 1 |
rprobinson/MediPi | MediPiPatient/MediPi/src/main/java/org/medipi/devices/drivers/Omron708BT.java | [
"public class MediPiMessageBox {\r\n\r\n private MediPi medipi;\r\n private HashMap<String, Alert> liveMessages = new HashMap<>();\r\n\r\n private MediPiMessageBox() {\r\n }\r\n\r\n /**\r\n * returns the one and only instance of the singleton\r\n *\r\n * @return singleton instance\r\n ... | import java.io.BufferedReader;
import java.util.ArrayList;
import java.util.Arrays;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.concurrent.Task;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import org.medipi.MediPiMessageBox;
import org.medip... | /*
Copyright 2016 Richard Robinson @ NHS Digital <rrobinson@nhs.net>
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... | if (cm.getReportedIdentifier() == ContinuaBloodPressure.MMHG) {
| 2 |
pugwoo/nimble-orm | src/main/java/com/pugwoo/dbhelper/impl/part/P5_DeleteOp.java | [
"public class DBHelperInterceptor {\n\n\t/**\n\t * select前执行。不会拦截getCount计算总数和getAllKey只查询key这2个接口。\n\t * @param clazz 查询的对象\n\t * @param sql 查询的完整sql\n\t * @param args 查询的完整参数。理论上,拦截器就有可能修改args里面的object的值的,请小心。不建议修改args的值。\n\t * @return 返回true,则查询继续; 返回false将终止查询并抛出NotAllowQueryException\n\t */\n\tpublic boolean b... | import com.pugwoo.dbhelper.DBHelperInterceptor;
import com.pugwoo.dbhelper.annotation.Column;
import com.pugwoo.dbhelper.exception.InvalidParameterException;
import com.pugwoo.dbhelper.exception.MustProvideConstructorException;
import com.pugwoo.dbhelper.exception.NotAllowQueryException;
import com.pugwoo.dbhelper.exce... | package com.pugwoo.dbhelper.impl.part;
public abstract class P5_DeleteOp extends P4_InsertOrUpdateOp {
/////// 拦截器
protected void doInterceptBeforeDelete(List<Object> tList) {
for (DBHelperInterceptor interceptor : interceptors) {
boolean isContinue = interceptor.beforeDelete(tList);
if (!isContinue) { | throw new NotAllowQueryException("interceptor class:" + interceptor.getClass()); | 3 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/forum/list/provider/ForumSearchProvider.java | [
"public abstract class BaseProvider extends AsyncTask<String, Integer, List<Elements>> {\n\n protected Map<String, String> cookies = new HashMap<>();\n\n public BaseProvider() {\n super();\n }\n\n @Override\n @Deprecated\n protected List<Elements> doInBackground(String... params) {\n ... | import com.mgilangjanuar.dev.goscele.base.BaseProvider;
import com.mgilangjanuar.dev.goscele.modules.common.model.CookieModel;
import com.mgilangjanuar.dev.goscele.modules.forum.list.adapter.ForumListRecyclerViewAdapter;
import com.mgilangjanuar.dev.goscele.modules.forum.list.listener.ForumListListener;
import com.mgil... | package com.mgilangjanuar.dev.goscele.modules.forum.list.provider;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class ForumSearchProvider extends BaseProvider {
private ForumListListener listener;
private String query;
public ForumSearchProvider(ForumListList... | return Constant.BASE_URL + "mod/forum/search.php?id=1&perpage=50&search=" + URLEncoder.encode(query, "UTF-8"); | 5 |
lijunyandev/MeetMusic | app/src/main/java/com/lijunyan/blackmusic/adapter/PlaylistAdapter.java | [
"public class DBManager {\n\n private static final String TAG = DBManager.class.getName();\n private DatabaseHelper helper;\n private SQLiteDatabase db;\n private static DBManager instance = null;\n\n\n /* 因为getWritableDatabase内部调用了mContext.openOrCreateDatabase(mName, 0,mFactory);\n * 需要一个context... | import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearL... | package com.lijunyan.blackmusic.adapter;
/**
* Created by lijunyan on 2017/3/28.
*/
public class PlaylistAdapter extends RecyclerView.Adapter<PlaylistAdapter.ViewHolder> {
private static final String TAG = PlaylistAdapter.class.getName();
private List<MusicInfo> musicInfoList;
private Context contex... | if (musicInfo.getId() == MyMusicUtil.getIntShared(Constant.KEY_ID)){ | 4 |
snowhow/cordova-plugin-gpstrack | src/android/org/java_websocket/WebSocketListener.java | [
"public abstract class Draft {\n\n\t/**\n\t * Enum which represents the states a handshake may be in\n\t */\n\tpublic enum HandshakeState {\n\t\t/** Handshake matched this Draft successfully */\n\t\tMATCHED,\n\t\t/** Handshake is does not match this Draft */\n\t\tNOT_MATCHED\n\t}\n\t/**\n\t * Enum which represents ... | import org.java_websocket.framing.CloseFrame;
import org.java_websocket.framing.Framedata;
import org.java_websocket.handshake.ClientHandshake;
import org.java_websocket.handshake.Handshakedata;
import org.java_websocket.handshake.ServerHandshake;
import org.java_websocket.handshake.ServerHandshakeBuilder;
import java.... | /*
* Copyright (c) 2010-2017 Nathan Rajlich
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify... | void onWebsocketHandshakeReceivedAsClient( WebSocket conn, ClientHandshake request, ServerHandshake response ) throws InvalidDataException; | 3 |
gambitproject/gte | lib-algo/src/lse/math/games/matrix/BimatrixSolver.java | [
"public class Rational \r\n{\r\n\tpublic static final Rational ZERO = new Rational(BigInteger.ZERO, BigInteger.ONE);\r\n\tpublic static final Rational ONE = new Rational(BigInteger.ONE, BigInteger.ONE);\r\n\tpublic static final Rational NEGONE = new Rational(BigInteger.ONE.negate(), BigInteger.ONE);\r\n\tpublic Big... | import java.io.PrintWriter;
import java.util.List;
import java.util.Random;
import java.util.logging.Logger;
import lse.math.games.Rational;
import lse.math.games.lrs.Lrs;
import lse.math.games.lrs.HPolygon;
import lse.math.games.lrs.VPolygon;
import lse.math.games.lcp.LCP;
import lse.math.games.lcp.LemkeAlgor... | package lse.math.games.matrix;
public class BimatrixSolver
{
private static final Logger log = Logger.getLogger(BimatrixSolver.class.getName());
public Rational[] computePriorBeliefs(int size, Random prng)
{
Rational[] priors = null;
if (prng != null) {
priors = Rational.probVector(... | LCP lcp = BimatrixSolver.generateLCP(a, b, xPriors, yPriors);
| 4 |
jramoyo/quickfix-messenger | src/main/java/com/jramoyo/qfixmessenger/ui/ProjectDialog.java | [
"public class ProjectTreeCellEditor extends DefaultTreeCellEditor\r\n{\r\n\tpublic ProjectTreeCellEditor(JTree tree)\r\n\t{\r\n\t\tsuper(tree, null);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean isCellEditable(EventObject event)\r\n\t{\r\n\t\tif (super.isCellEditable(event))\r\n\t\t{\r\n\t\t\tObject value = tree.g... | import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.tree.TreeSelectionModel;
import com.jramoyo.fix.xml.MessageType;
... | /*
* Copyright (c) 2011, Jan Amoyo
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list... | ((ProjectTreeModel) projectTree.getModel()).update();
| 2 |
OasisDigital/nges | src/test/java/com/oasisdigital/nges/event/EventStoreITest.java | [
"public interface MessageGroup {\n\n /**\n * Publish a message to the group.\n */\n public abstract void publish(Object message);\n\n /**\n * Register a subscriber for messages from the group. See documentation for a particular implementation to\n * learn more about its specifics.\n */\... | import static com.jayway.awaitility.Awaitility.await;
import static com.oasisdigital.nges.event.EventStore.AUTO_GENERATE_SEQUENCE;
import static com.oasisdigital.nges.event.EventStore.NEW_STREAM;
import static java.util.Arrays.asList;
import static java.util.UUID.randomUUID;
import static java.util.stream.Collectors.to... | IntStream.range(0, 10).parallel().forEach(i -> {
try {
save(textAppended(String.valueOf(i)), AUTO_GENERATE_SEQUENCE);
} catch (Exception e) {
throw new RuntimeException(e);
}
});
// Then expect it to write them all successfully... | @Test(expectedExceptions = EventStoreException.class) | 6 |
UweTrottmann/MovieTracker | SeriesGuideMovies/src/com/uwetrottmann/movies/util/TraktCredentialsDialogFragment.java | [
"public class ServiceManager {\n /** API key. */\n private String apiKeyValue;\n /** User email. */\n private String username;\n /** User password. */\n private String password_sha;\n /** Connection timeout (in milliseconds). */\n private Integer connectionTimeout;\n /** Read timeout (in ... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
impo... | /*
* Copyright 2012 Uwe Trottmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | final ServiceManager manager = new ServiceManager(); | 0 |
kihira/Tails | src/main/java/uk/kihira/tails/client/render/FallbackRenderHandler.java | [
"public class Model implements IDisposable\n{\n private final ArrayList<Node> allNodes;\n private final ArrayList<Node> rootNodes;\n private final HashMap<String, Animation> animations;\n private final ArrayList<ResourceLocation> textures;\n\n public Model(ArrayList<Node> allNodes, ArrayList<Node> ro... | import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderPlayerEvent;
import net.minecraftforge.eventbus.api.EventPriority;
impor... | package uk.kihira.tails.client.render;
/**
* Legacy renderer that uses the player render event.
* This is used for compatibility with certain mods
*/
public class FallbackRenderHandler
{
private static RenderPlayerEvent.Pre currentEvent = null;
private static Outfit currentOutfit = null;
private stat... | for (OutfitPart part : currentOutfit.parts) | 2 |
ppicas/android-clean-architecture-mvp | app/src/main/java/cat/ppicas/cleanarch/ui/presenter/CityListItemPresenter.java | [
"public class City {\n\n private String mId;\n private String mName;\n private String mCountry;\n private CurrentWeatherPreview mCurrentWeatherPreview;\n\n public City(String id, String name, String country) {\n mId = id;\n mName = name;\n mCountry = country;\n }\n\n public... | import cat.ppicas.cleanarch.model.City;
import cat.ppicas.cleanarch.task.GetElevationTask;
import cat.ppicas.cleanarch.text.NumberFormat;
import cat.ppicas.cleanarch.ui.vista.CityListItemVista;
import cat.ppicas.framework.task.SuccessTaskCallback;
import cat.ppicas.framework.task.TaskExecutor;
import cat.ppicas.framewo... | /*
* Copyright (C) 2015 Pau Picas Sans <pau.picas@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | vista.setCurrentTemp(NumberFormat.formatTemperature(temp)); | 2 |
irengrig/fossil4idea | src/org/github/irengrig/fossil4idea/checkin/CheckinUtil.java | [
"public class FossilConfigurable implements Configurable {\n private final Project myProject;\n private JPanel myPanel;\n private TextFieldWithBrowseButton myCommandLine;\n\n public FossilConfigurable(final Project project) {\n myProject = project;\n createUI();\n }\n\n private void createUI() {\n my... | import com.intellij.notification.Notifications;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.options.Configurable;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.ProgressM... | package org.github.irengrig.fossil4idea.checkin;
/**
* Created with IntelliJ IDEA.
* User: Irina.Chernushina
* Date: 2/24/13
* Time: 2:59 PM
*/
public class CheckinUtil {
public static final String QUESTION = "Commit anyhow (a=all/c=convert/y/N)?";
public static final String BREAK_SEQUENCE = "contains CR/NL... | final FossilUpdateConfigurable configurable = (FossilUpdateConfigurable) fossil.getUpdateEnvironment().createConfigurable(filePaths); | 7 |
lukas-krecan/JsonUnit | json-unit-json-path/src/main/java/net/javacrumbs/jsonunit/jsonpath/JsonPathAdapter.java | [
"public static Object jsonSource(Object json, String pathPrefix) {\n return jsonSource(json, pathPrefix, emptyList());\n}",
"public static Object missingNode() {\n return Node.MISSING_NODE;\n}",
"public static Node wrapDeserializedObject(Object source) {\n return GenericNodeBuilder.wrapDeserializedObje... | import com.jayway.jsonpath.EvaluationListener;
import com.jayway.jsonpath.PathNotFoundException;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import static com.jayway.jsonpath.Configuration.defaultConfiguration;
import static net.javacrumbs.jsonunit.core.internal.JsonUtil... | /**
* Copyright 2009-2019 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 a... | return jsonSource(missingNode(), normalizedPath); | 1 |
onyxbits/TradeTrax | src/main/java/de/onyxbits/tradetrax/pages/edit/NameEditor.java | [
"@Entity\n@Table(name = \"bookmarks\")\npublic class Bookmark implements Serializable{\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t/**\n\t * Reference to {@link Stock} id.\n\t */\n\t@Id\n\t@Column(name = \"id\", unique = true)\n\tprivate long id;\n\n\t/**\n\t * @return the id\n\t */\n\tpublic long ge... | import java.util.List;
import org.apache.tapestry5.alerts.AlertManager;
import org.apache.tapestry5.alerts.Duration;
import org.apache.tapestry5.alerts.Severity;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.InjectPage;
import ... | package de.onyxbits.tradetrax.pages.edit;
/**
* A simple editor page for changing or deleting a {@link Name} object and
* returning to the main page afterwards.
*
* @author patrick
*
*/
@Import(library = "context:js/mousetrap.min.js")
public class NameEditor {
@Property
private long nameId;
@Property
... | Bookmark bm = (Bookmark) session.get(Bookmark.class, s.getId()); | 0 |
GlitchCog/ChatGameFontificator | src/main/java/com/glitchcog/fontificator/gui/emoji/EmojiLoadProgressPanel.java | [
"public class ConfigEmoji extends Config\n{\n private static final Logger logger = Logger.getLogger(ConfigEmoji.class);\n\n public static final int MIN_SCALE = 10;\n public static final int MAX_SCALE = 500;\n\n public static final int MIN_BADGE_OFFSET = -32;\n public static final int MAX_BADGE_OFFSET... | import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.concurrent.ConcurrentLinkedQueue;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JProgr... | blankAllValues();
reset();
handleButtonEnables();
}
else if (report.isError())
{
emojiLogBox.log(report.getMessage());
blankAllValues();
if (currentWorker != null)
{
currentWorker.haltCurrentJob(... | synchronized public void removeWorkFromQueue(EmojiJob job) | 1 |
bitkylin/BitkyShop | Android/bitkyShop/app/src/main/java/cc/bitky/bitkyshop/fragment/userfragment/UserFragment.java | [
"public class KyUser extends BmobUser {\n private String pwdResumeQuestion;\n private String pwdResumeAnswer;\n private Boolean haveDetailInfo;\n\n public Boolean getHaveDetailInfo() {\n return haveDetailInfo;\n }\n\n public void setHaveDetailInfo(Boolean haveDetailInfo) {\n this.haveDetailInfo = haveDe... | import android.content.Intent;
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.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import cc.bitky.bitkyshop.R;
imp... | package cc.bitky.bitkyshop.fragment.userfragment;
public class UserFragment extends Fragment implements View.OnClickListener {
private TextView textViewUserNameShow;
private TextView textViewUserLogOut;
private Button btnLogout;
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container... | Intent intent = new Intent(getContext(), LoginActivity.class); | 2 |
koendeschacht/count-db | count-db-run/src/main/java/be/bagofwords/db/interfaces/rocksdb/RocksDBDataInterfaceFactory.java | [
"public abstract class CoreDataInterface<T> extends BaseDataInterface<T> {\n\n protected final UpdateListenerCollection<T> updateListenerCollection = new UpdateListenerCollection<>();\n\n public CoreDataInterface(String name, Class<T> objectClass, Combinator<T> combinator, ObjectSerializer<T> objectSerializer... | import be.bagofwords.db.CoreDataInterface;
import be.bagofwords.db.DataInterface;
import be.bagofwords.db.combinator.Combinator;
import be.bagofwords.db.impl.BaseDataInterfaceFactory;
import be.bagofwords.db.methods.ObjectSerializer;
import be.bagofwords.minidepi.ApplicationContext;
import be.bagofwords.util.Utils;
imp... | package be.bagofwords.db.interfaces.rocksdb;
/**
* Created by Koen Deschacht (koendeschacht@gmail.com) on 9/17/14.
*/
public class RocksDBDataInterfaceFactory extends BaseDataInterfaceFactory {
private final String directory;
private final boolean usePatch;
public RocksDBDataInterfaceFactory(Applicat... | protected <T> CoreDataInterface<T> createBaseDataInterface(String name, Class<T> objectClass, Combinator<T> combinator, ObjectSerializer<T> objectSerializer, boolean isTemporaryDataInterface) { | 0 |
AstartesGuardian/WebDAV-Server | WebDAV-Server/src/webdav/server/commands/light/WDL_Propfind.java | [
"public class FileSystemPath\r\n{\r\n public FileSystemPath(String fileName, FileSystemPath parent)\r\n {\r\n this.fileName = fileName;\r\n this.parent = parent;\r\n this.fileSystemPathManager = parent.fileSystemPathManager;\r\n }\r\n public FileSystemPath(String fileName, FileSyste... | import http.FileSystemPath;
import http.StringJoiner;
import http.server.HTTPCommand;
import http.server.message.HTTPResponse;
import java.time.Instant;
import webdav.server.resource.IResource;
import http.server.exceptions.NotFoundException;
import http.server.exceptions.UserRequiredException;
import http.serv... | package webdav.server.commands.light;
public class WDL_Propfind extends HTTPCommand
{
public WDL_Propfind()
{
super("lightpropfind");
}
private static String addString(String name, String value)
{
return "<" + name + ">" + value + "</" + name + ">";
}
pri... | private String getInfo(IResource resource, FileSystemPath path, String host, HTTPEnvRequest environment) throws UserRequiredException
| 7 |
nchambers/probschemas | src/main/java/nate/probschemas/EventPairScores.java | [
"public class Pair<A,B> {\n A first;\n B second;\n\n public Pair(A one, B two) {\n first = one;\n second = two;\n }\n\n public A first() { return first; }\n public B second() { return second; }\n public void setFirst(A obj) { first = obj; }\n public void setSecond(B obj) { second = obj; }\n \n publi... | import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import nate.util.Pair;
import nate.WordEvent;
import nate.Wor... | float bestscore = 0.0f;
for( String str : _scores.keySet() ) {
Map<String,Float> events = _scores.get(str);
for( String str2 : events.keySet() ) {
Float score = events.get(str2);
if( score > bestscore ) {
bestscore = score;
best = str;
}
}
}
... | Util.reportMemory(); | 4 |
MFlisar/StorageManager | lib/src/main/java/com/michaelflisar/storagemanager/utils/StorageDebugUtil.java | [
"public class StorageManager\n{\n public static final String TAG = StorageManager.class.getName();\n\n private static StorageManager INSTANCE = null;\n\n public static StorageManager get()\n {\n if (INSTANCE == null)\n INSTANCE = new StorageManager();\n return INSTANCE;\n }\n... | import com.michaelflisar.storagemanager.StorageManager;
import com.michaelflisar.storagemanager.StoragePermissionManager;
import com.michaelflisar.storagemanager.StorageUtil;
import com.michaelflisar.storagemanager.data.MediaStoreFileData;
import com.michaelflisar.storagemanager.interfaces.IFile;
import com.michaelflis... | package com.michaelflisar.storagemanager.utils;
/**
* Created by flisar on 10.03.2016.
*/
public class StorageDebugUtil
{
public static final ArrayList<String> debugAvailableInfos()
{
ArrayList<String> messages = new ArrayList<>();
// 1) add paths | IFolder sdCard = StorageManager.get().getSDCardRoot(); | 0 |
caligin/tinytypes | jackson/src/main/java/tech/anima/tinytypes/jackson/TinyTypesDeserializers.java | [
"public class BooleanTinyTypes implements MetaTinyType<BooleanTinyType> {\n\n public static boolean includes(Class<?> candidate) {\n if (candidate == null) {\n return false;\n }\n\n return BooleanTinyType.class.equals(candidate.getSuperclass());\n }\n\n @Override\n public... | import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.BeanDescription;
import com.fasterxml.jackson.databind.DeserializationConfig;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind... | package tech.anima.tinytypes.jackson;
public class TinyTypesDeserializers extends Deserializers.Base {
@Override
public JsonDeserializer<?> findBeanDeserializer(JavaType type, DeserializationConfig config, BeanDescription beanDesc) throws JsonMappingException {
Class<?> candidateTT = type.getRawClass... | if (LongTinyTypes.includes(type)) { | 3 |
cettia/asity | example-spring-webflux5/src/main/java/io/cettia/asity/example/spring/webflux5/EchoServer.java | [
"@FunctionalInterface\npublic interface Action<T> {\n\n /**\n * Some action is taken.\n */\n void on(T object);\n\n}",
"public class AsityHandlerFunction implements HandlerFunction<ServerResponse> {\n\n private Actions<ServerHttpExchange> httpActions = new ConcurrentActions<>();\n\n @Override\n public Mo... | import io.cettia.asity.action.Action;
import io.cettia.asity.bridge.spring.webflux5.AsityHandlerFunction;
import io.cettia.asity.bridge.spring.webflux5.AsityWebSocketHandler;
import io.cettia.asity.example.echo.HttpEchoServer;
import io.cettia.asity.example.echo.WebSocketEchoServer;
import io.cettia.asity.http.ServerHt... | /*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | AsityHandlerFunction asityHandlerFunction = new AsityHandlerFunction().onhttp(httpAction()); | 1 |
Ohohcakester/Any-Angle-Pathfinding | src/main/TextOutputVisualisation.java | [
"public class GridAndGoals {\r\n\tpublic final GridGraph gridGraph;\r\n\tpublic final StartGoalPoints startGoalPoints;\r\n\t\r\n\tpublic GridAndGoals(GridGraph gridGraph, StartGoalPoints startGoalPoints) {\r\n\t\tthis.gridGraph = gridGraph;\r\n\t\tthis.startGoalPoints = startGoalPoints;\r\n\t}\r\n\t\r\n\tpublic Gri... | import grid.GridAndGoals;
import grid.GridGraph;
import grid.StartGoalPoints;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import uiandio.GraphImporter;
import algorithms.datatypes.SnapshotItem;
import draw.DrawCanvas;
import draw.GridLineSet;
import draw.GridObjec... | package main;
public class TextOutputVisualisation {
public static void run() {
loadDefault();
//loadFromFile("anyacont2b.txt");
}
private static void loadFromFile(String mazeFileName) {
String textData = readStandardInput();
| GridGraph gridGraph = GraphImporter.importGraphFromFile(mazeFileName); | 3 |
ls1110924/ImmerseMode | immerse/src/main/java/com/yunxian/immerse/impl/TlSbNNbImmerseMode.java | [
"public final class ImmerseConfiguration {\n\n final ImmerseType mImmerseTypeInKK;\n final ImmerseType mImmerseTypeInL;\n\n public final boolean lightStatusBar;\n public final boolean coverCompatMask;\n public final int coverMaskColor;\n\n private ImmerseConfiguration(@NonNull ImmerseType immerseT... | import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.annotation.ColorInt;
import androidx.annotation.ColorRe... | package com.yunxian.immerse.impl;
/**
* 半透明状态栏普通导航栏
* <p>半透明状态栏支持到4.4及以上,普通导航栏着色支持到5.0及以上</p>
*
* @author AShuai
* @email ls1110924@gmail.com
* @date 17/1/31 下午2:42
*/
@TargetApi(KITKAT)
public class TlSbNNbImmerseMode extends AbsImmerseMode {
private final View mCompatStatusBarView;
public TlSbNN... | @Nullable ConsumeInsetsFrameLayout.OnInsetsChangeListener listener) { | 5 |
matburt/mobileorg-android | MobileOrg/src/main/java/com/matburt/mobileorg/orgdata/OrgProviderUtils.java | [
"public static class Files implements FilesColumns {\n\tpublic static final Uri CONTENT_URI =\n\t\t\tBASE_CONTENT_URI.buildUpon().appendPath(PATH_FILES).build();\n\n\tpublic static final String[] DEFAULT_COLUMNS = { ID, NAME, FILENAME,\n\t\t\tCOMMENT, NODE_ID };\n\tpublic static final String DEFAULT_SORT = NAME + \... | import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.text.TextUtils;
import com.matburt.mobileorg.orgdata.OrgContract.Files;
import com.matburt.mobileorg.orgdata.OrgContract.OrgData;
import com.matburt.mobileorg.orgd... | package com.matburt.mobileorg.orgdata;
public class OrgProviderUtils {
/**
*
* @param context
* @return the list of nodes corresponding to a file
*/
public static List<OrgNode> getFileNodes(Context context){
return OrgProviderUtils.getOrgNodeChildren(-1, context.getContentResolver());
}
pu... | resolver.delete(Priorities.CONTENT_URI, null, null); | 2 |
dgomezferro/pasc-paxos | src/main/java/com/yahoo/pasc/paxos/handlers/acceptor/AcceptorAccept.java | [
"public class Accept extends PaxosMessage implements Serializable, CloneableDeep<Accept>, EqualsDeep<Accept> {\n\n private static final long serialVersionUID = -3781061394615967506L;\n\n public static class Descriptor implements PaxosDescriptor, EqualsDeep<Descriptor> {\n\n private long iid;\n\n ... | import com.yahoo.pasc.paxos.state.IidRequest;
import com.yahoo.pasc.paxos.state.PaxosState;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.yahoo.pasc.Message;
import com.yahoo.pasc.paxos.handlers.PaxosHandler;
import com.yahoo.pasc.paxos.handlers.p... | /**
* Copyright (c) 2011 Yahoo! 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 ap... | IidAcceptorsCounts accepted = state.getAcceptedElement(iid); | 3 |
mikkeliamk/osa | src/fi/mamk/osa/stripes/RoleAction.java | [
"public class AccessRight implements Serializable {\n\t\n private static final long serialVersionUID = -8302724810061640050L;\n\n public static final int ACCESSRIGHTLEVEL_DENY_META = -1;\n public static final int ACCESSRIGHTLEVEL_READ_META = 10;\n public static final int ACCESSRIGHTLEVEL... | import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Vector;
import fi.mamk.osa.auth.AccessRight;
import fi.mamk.osa.auth.LdapManager;
import fi.mamk.osa.auth.Role;
import fi.m... | package fi.mamk.osa.stripes;
/**
* Role Action
*/
@UrlBinding("/Role.action")
public class RoleAction extends OsaBaseActionBean
{
private static final Logger logger = Logger.getLogger(RoleAction.class);
private String roleName;
private String roleOrganization;
private String messageAddSuccess;
... | boolean added = Osa.authManager.createRole(roleName, roleOrganization, accessrights); | 5 |
occi4java/occi4java | http/src/test/java/de/occi/test/TestRestCompute.java | [
"public class OcciConfig extends XMLConfiguration {\n\tprivate static final long serialVersionUID = 1L;\n\tprivate static final Logger LOGGER = LoggerFactory\n\t\t\t.getLogger(OcciConfig.class);\n\t/**\n\t * Instance of OcciConfig\n\t */\n\tprivate static OcciConfig instance = null;\n\tprivate static ConfigurationF... | import org.restlet.Response;
import org.restlet.data.Form;
import org.restlet.data.MediaType;
import org.restlet.representation.Representation;
import org.restlet.resource.ClientResource;
import org.testng.Assert;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.test... | /**
* Copyright (C) 2010-2011 Sebastian Heckmann, Sebastian Laag
*
* Contact Email: <sebastian.heckmann@udo.edu>, <sebastian.laag@udo.edu>
*
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obt... | occiApi.main(null);
| 1 |
moovida/STAGE | eu.hydrologis.stage.treeslicesviewer/src/eu/hydrologis/stage/treeslicesviewer/TreeSlicesViewerEntryPoint.java | [
"public class StageLogger {\n\n public static final boolean LOG_INFO = true;\n public static final boolean LOG_DEBUG = false;\n public static final boolean LOG_ERROR = true;\n\n private static final String SEP = \":: \";\n\n private static SimpleDateFormat f = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:... | import static java.lang.Math.max;
import static java.lang.Math.min;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicInteger;
import org.... | public void completed( ProgressEvent event ) {
addMapBrowserFunctions();
Rectangle clientArea = mapBrowser.getClientArea();
int w = clientArea.width;
int h = clientArea.height;
mapBrowser.evaluate("createMap(" + w + ", " + h + ... | String text = "<font color=\"" + StageUtils.TEXTCOLOR + "\">" + plotInfoSB.toString() + "</font>"; | 1 |
bodar/yatspec | test/com/googlecode/yatspec/rendering/html/HtmlResultRendererTest.java | [
"public class ContentAtUrl implements Content {\n private final URL url;\n\n public ContentAtUrl(URL url) {\n this.url = url;\n }\n\n @Override\n public String toString() {\n InputStream inputStream = null;\n try {\n inputStream = url.openStream();\n return ... | import com.googlecode.totallylazy.Strings;
import com.googlecode.yatspec.rendering.ContentAtUrl;
import com.googlecode.yatspec.rendering.Renderer;
import com.googlecode.yatspec.state.Scenario;
import com.googlecode.yatspec.state.TestResult;
import com.googlecode.yatspec.state.givenwhenthen.TestState;
import org.junit.T... | package com.googlecode.yatspec.rendering.html;
public class HtmlResultRendererTest {
public static final String CUSTOM_RENDERED_TEXT = "some crazy and likely random string that wouldn't appear in the html";
@Test
public void providesLinksToResultOutputRelativeToOutputDirectory() throws Exception {
... | withCustomHeaderContent(new ContentAtUrl(getClass().getResource("CustomHeaderContent.html"))). | 0 |
yyxhdy/ManyEAs | src/jmetal/encodings/solutionType/IntRealSolutionType.java | [
"public abstract class Problem implements Serializable {\n\n\t/**\n\t * Defines the default precision of binary-coded variables\n\t */\n\tprivate final static int DEFAULT_PRECISSION = 16;\n\n\t/**\n\t * Stores the number of variables of the problem\n\t */\n\tprotected int numberOfVariables_;\n\n\t/**\n\t * Stores t... | import jmetal.core.Problem;
import jmetal.core.SolutionType;
import jmetal.core.Variable;
import jmetal.encodings.variable.Int;
import jmetal.encodings.variable.Real; | // IntRealSolutionType.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser Gener... | public IntRealSolutionType(Problem problem, int intVariables, int realVariables) { | 0 |
DaiDongLiang/DSC | src/main/java/net/floodlightcontroller/core/internal/Controller.java | [
"public class ControllerId {\n private final short nodeId;\n\n private ControllerId(short nodeId) {\n if(nodeId == ClusterConfig.NODE_ID_UNCONFIGURED)\n throw new IllegalArgumentException(\"nodeId is unconfigured\");\n\n this.nodeId = nodeId;\n }\n\n public short getNodeId() {\n... | import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.lang.management.RuntimeMXBean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.ut... | void setRestApiService(IRestApiService restApi) {
this.restApiService = restApi;
}
void setThreadPoolService(IThreadPoolService tp) {
this.threadPoolService = tp;
}
IThreadPoolService getThreadPoolService() {
return this.threadPoolService;
}
public void se... | public void handleMessage(IOFSwitch sw, OFMessage m, | 2 |
tomdw/java-modules-context-boot | integration-tests/src/main/java/module-info.java | [
"@Configuration\n@Import(value = {IntegrationTestUsingConstructorInjectionService.class, IntegrationTestService.class})\npublic class IntegrationTestConfiguration {\n\n}",
"public interface FailingSpeakerService {\n\n\tString getSpeakerNameButThrowsRuntimeException();\n\n\tString getSpeakerNameButThrowsCheckedExc... | import io.github.tomdw.java.modules.context.boot.api.ModuleContext;
import io.github.tomdw.java.modules.spring.integration.tests.IntegrationTestConfiguration;
import io.github.tomdw.java.modules.spring.samples.basicapplication.speaker.api.FailingSpeakerService;
import io.github.tomdw.java.modules.spring.samples.basicap... |
@ModuleContext(mainConfigurationClass = IntegrationTestConfiguration.class)
module io.github.tomdw.java.modules.spring.integration.tests {
requires io.github.tomdw.java.modules.context.boot;
requires io.github.tomdw.java.modules.spring.samples.basicapplication.application;
requires io.github.tomdw.java.modules.spri... | uses MultipleSpeakerService; | 2 |
onesocialweb/osw-openfire-plugin | src/java/org/onesocialweb/openfire/handler/MessageEventInterceptor.java | [
"@SuppressWarnings(\"serial\")\npublic class AccessDeniedException extends Exception {\n\n\tpublic AccessDeniedException(String message) {\n\t\tsuper(message);\n\t}\n\t\n}",
"@SuppressWarnings(\"serial\")\npublic class InvalidRelationException extends Exception {\n\n\tpublic InvalidRelationException(String messag... | import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.activity.InvalidActivityException;
import org.dom4j.Element;
import org.jivesoftware.openfire.SessionManager;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.interceptor.PacketInt... | /*
* Copyright 2010 Vodafone Group Services Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | final RelationDomReader reader = new PersistentRelationDomReader(); | 6 |
sorinMD/MCTS | src/main/java/mcts/seeder/pdf/CatanTypePDFSeedTrigger.java | [
"public class GameFactory {\n\tpublic static final int TICTACTOE = 0;\n\tpublic static final int CATAN = 1;\n\t\n\tprivate GameConfig gameConfig;\n\tprivate Belief belief;\n\t\n\tpublic GameFactory(GameConfig gameConfig, Belief belief) {\n\t\tthis.gameConfig = gameConfig;\n\t\tthis.belief = belief;\n\t}\n\t\n\tpubl... | import java.util.ArrayList;
import java.util.Map;
import com.google.common.util.concurrent.AtomicDoubleArray;
import mcts.game.GameFactory;
import mcts.game.catan.Catan;
import mcts.game.catan.CatanConfig;
import mcts.game.catan.GameStateConstants;
import mcts.game.catan.typepdf.ActionTypePdf;
import mcts.game.catan.ty... | package mcts.seeder.pdf;
/**
* This uses the typed pdf to seed in the tree without launching new threads.
*
* @author sorinMD
*
*/
public class CatanTypePDFSeedTrigger extends SeedTrigger implements GameStateConstants{
public ActionTypePdf pdf = new UniformActionTypePdf();
public CatanTypePDFSeedTrigger... | if(((CatanConfig)factory.getConfig()).NEGOTIATIONS) { | 2 |
rolandkrueger/user-microservice | service/src/test/java/info/rolandkrueger/userservice/service/AuthenticationListenerTest.java | [
"@SpringBootApplication\n@PropertySource(\"userservice.properties\")\npublic class UserMicroserviceApplication {\n\n public static void main(String[] args) {\n SpringApplication.run(\n new Object[]{\n UserMicroserviceApplication.class,\n Develop... | import info.rolandkrueger.userservice.UserMicroserviceApplication;
import info.rolandkrueger.userservice.api.model.UserApiData;
import info.rolandkrueger.userservice.api.service.AuthenticationListener;
import info.rolandkrueger.userservice.api.service.StaticEndpointProvider;
import info.rolandkrueger.userservice.testsu... | package info.rolandkrueger.userservice.service;
/**
* @author Roland Krüger
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = UserMicroserviceApplication.class)
@WebIntegrationTest(randomPort = true)
public class AuthenticationListenerTest extends AbstractRestControllerTest {
... | UserApiData user = new UserApiData(); | 1 |
mutualmobile/Barricade | app/src/androidTest/java/com/mutualmobile/barricade/sample/BarricadeActivityTest.java | [
"public class Barricade {\n static final String TAG = \"Barricade\";\n private static final String ROOT_DIRECTORY = \"barricade\";\n private static final long DEFAULT_DELAY = 150;\n private static Barricade instance;\n\n private IBarricadeConfig barricadeConfig;\n private AssetFileManager fileManager;\n priv... | import androidx.test.InstrumentationRegistry;
import androidx.test.espresso.Espresso;
import androidx.test.espresso.contrib.RecyclerViewActions;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;
import androidx.test.runner.AndroidJUnit4;
import com.mutualmobile.barricade.Barricade;
imp... | package com.mutualmobile.barricade.sample;
/**
* Contains Espresso tests for the Barricade Activity UI. We verify the response and it's corresponding response sets in the UI. Functionality of
* delay and reset is verified as well
*/
@RunWith(AndroidJUnit4.class) @LargeTest public class BarricadeActivityTest {
... | Map<String, BarricadeResponseSet> hashMap = barricade.getConfig(); | 3 |
turn/sorcerer | src/main/java/com/turn/sorcerer/pipeline/executable/impl/PipelineFactory.java | [
"public class SorcererInjector {\n\tprivate static final Logger logger =\n\t\t\tLoggerFactory.getLogger(SorcererInjector.class);\n\n\t// We use Guice as the underlying binder\n\tprivate Injector INJECTOR;\n\n\t/**\n\t * Singleton pattern. A single instance of Sorcerer runs per JVM.\n\t */\n\tprivate static Sorcerer... | import com.turn.sorcerer.injector.SorcererInjector;
import com.turn.sorcerer.pipeline.Pipeline;
import com.turn.sorcerer.pipeline.executable.ExecutablePipeline;
import com.turn.sorcerer.pipeline.impl.CronPipeline;
import com.turn.sorcerer.pipeline.impl.DefaultPipeline;
import com.turn.sorcerer.pipeline.type.PipelineTyp... | /*
* Copyright (c) 2015, Turn Inc. All Rights Reserved.
* Use of this source code is governed by a BSD-style license that can be found
* in the LICENSE file.
*/
package com.turn.sorcerer.pipeline.executable.impl;
/**
* Class Description Here
*
* @author tshiou
*/
public class PipelineFactory {
private stat... | return new DefaultPipeline(type); | 4 |
Modbder/ThaumicBases | java/tb/init/TBTiles.java | [
"public class TileAuraLinker extends TileEntity implements IWandable,ITickable{\n\t\n\tpublic Coord3D linkCoord;\n\tpublic int syncTimer;\n\tpublic int instability;\n\tObject beam;\n\t@Override\n\tpublic void update() {\n\t\t\n\t\tif(syncTimer <= 0)\n\t\t{\n\t\t\tsyncTimer = 100;\n\t\t\tNBTTagCompound tg = new NBTT... | import net.minecraftforge.fml.common.registry.GameRegistry;
import tb.common.tile.TileAuraLinker;
import tb.common.tile.TileBraizer;
import tb.common.tile.TileCampfire;
import tb.common.tile.TileNodeManipulator;
import tb.common.tile.TileOverchanter; | package tb.init;
public class TBTiles {
public static void setup()
{
GameRegistry.registerTileEntity(TileOverchanter.class, "tb.overchanter");
GameRegistry.registerTileEntity(TileCampfire.class, "tb.campfire"); | GameRegistry.registerTileEntity(TileBraizer.class, "tb.brazier"); | 1 |
tavianator/sangria | sangria-listbinder/src/main/java/com/tavianator/sangria/listbinder/ListBinder.java | [
"public abstract class PotentialAnnotation {\n /**\n * A visitor interface to examine a {@link PotentialAnnotation}'s annotation, if it exists.\n *\n * @param <T> The type to return.\n * @author Tavian Barnes (tavianator@tavianator.com)\n * @version 1.1\n * @since 1.1\n */\n public... | import java.lang.annotation.Annotation;
import java.util.*;
import javax.inject.Inject;
import javax.inject.Provider;
import com.google.common.base.Function;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.FluentIterable;
import com.google.common.collect.ListMultimap;
import com.goo... | /****************************************************************************
* Sangria *
* Copyright (C) 2014 Tavian Barnes <tavianator@tavianator.com> *
* *
* Licen... | private final Priority initialPriority; | 2 |
MX-Futhark/hook-any-text | src/main/java/hextostring/convert/EncodingAgnosticConverter.java | [
"public class DebuggableDecodingAttempt {\n\n\tprivate DebuggableLineList attempt;\n\tprivate Charset encoding;\n\tprivate EvaluationResult encodingEvaluationResult;\n\tprivate boolean validEncoding = false;\n\n\tpublic DebuggableDecodingAttempt(DebuggableLineList attempt,\n\t\tCharset encoding) {\n\n\t\tthis.attem... | import hextostring.debug.DebuggableDecodingAttempt;
import hextostring.debug.DebuggableDecodingAttemptList;
import hextostring.debug.DebuggableLineList;
import hextostring.debug.DebuggableStrings;
import hextostring.evaluate.EvaluationResult;
import hextostring.evaluate.EvaluatorFactory;
import hextostring.evaluate.enc... | package hextostring.convert;
/**
* Converter choosing the right encoding by itself.
*
* @author Maxime PIA
*/
public class EncodingAgnosticConverter implements Converter {
private AbstractConverter[] converters = {
(AbstractConverter)
ConverterFactory.getConverterInstance(Charsets.SHIFT_JIS, null),
(Abst... | EvaluationResult encodingEvaluationResult = | 4 |
mokies/ratelimitj | ratelimitj-aerospike/src/test/java/es/moki/aerospike/request/AerospikeSlidingWindowRequestRateLimiterPerformanceTest.java | [
"public class AerospikeClientFactory {\n\n public static AerospikeClient getAerospikeClient() {\n\n Policy readPolicy = new Policy();\n readPolicy.maxRetries = 1;\n readPolicy.readModeAP = ReadModeAP.ONE;\n readPolicy.replica = Replica.MASTER_PROLES;\n readPolicy.sleepBetweenRetries = 5;\n readPo... | import com.aerospike.client.AerospikeClient;
import es.moki.aerospike.extensions.AerospikeClientFactory;
import es.moki.ratelimitj.aerospike.request.AerospikeContext;
import es.moki.ratelimitj.aerospike.request.AerospikeSlidingWindowRateLimiter;
import es.moki.ratelimitj.core.limiter.request.RequestLimitRule;
import es... | package es.moki.aerospike.request;
public class AerospikeSlidingWindowRequestRateLimiterPerformanceTest extends AbstractSyncRequestRateLimiterPerformanceTest {
private static AerospikeContext aerospikeContext;
@AfterAll
static void afterAll() {
aerospikeContext.aerospikeClient.close();
}
@BeforeAll
... | AerospikeClient aerospikeClient = AerospikeClientFactory.getAerospikeClient(); | 0 |
larusba/neo4j-jdbc | neo4j-jdbc-http/src/main/java/org/neo4j/jdbc/http/HttpNeo4jConnection.java | [
"public class CypherExecutor {\n\n\t/**\n\t * URL of the transaction endpoint.\n\t */\n\tfinal String transactionUrl;\n\n\t/**\n\t * If we are in https or not.\n\t */\n\tprivate Boolean secure;\n\n\t/**\n\t * Autocommit transaction.\n\t * Must be null at creation time.\n\t * Initiation of this property is made by i... | import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.neo4j.jdbc.*;
import org.neo4j.jdbc.http.driver.CypherExecutor;
import org.neo4j.jdbc.http.driver.Neo4jResponse;
import org.neo4j.jdbc.http.driver.Neo4jStatement;
import... | /*
* Copyright (c) 2016 LARUS Business Automation [http://www.larus-ba.it]
* <p>
* This file is part of the "LARUS Integration Framework for Neo4j".
* <p>
* The "LARUS Integration Framework for Neo4j" is licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in complian... | List<Neo4jStatement> neo4jStatements = new ArrayList<>(); | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.