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 |
|---|---|---|---|---|---|---|
Sinton/BookStore | src/edu/zjut/servlet/CartServlet.java | [
"public class BookDaoImpl implements BookDao {\n\t\n\tprivate PreparedStatement pstmt = null;\n\tprivate ResultSet rs = null;\n\tprivate Connection connection = null;\n\tprivate DBHelp dbHelp = new DBHelp();\n\t\n\tpublic BookDaoImpl() {\n\t\tconnection = dbHelp.getConn();\n\t}\n\n\t/**\n\t * 添加书籍\n\t * @param book... | import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotatio... | package edu.zjut.servlet;
@WebServlet(name = "CartServlet", urlPatterns = { "/cart.do" }, description = "购物车")
public class CartServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
private static BookDaoImpl bookDao = new BookDaoImpl();
protected void doGet(HttpServletRequest re... | Book book = null; | 3 |
caoli5288/PlayerSQL | playersql/src/main/java/com/mengcraft/playersql/task/DailySaveTask.java | [
"public class Config {\n\n public static final Configuration CONF;\n\n public static final boolean SYN_CHEST;\n public static final boolean SYN_EFFECT;\n public static final boolean SYN_EXP;\n public static final boolean SYN_FOOD;\n public static final boolean SYN_HEALTH;\n public static final ... | import com.mengcraft.playersql.Config;
import com.mengcraft.playersql.PlayerData;
import com.mengcraft.playersql.PluginMain;
import com.mengcraft.playersql.UserManager;
import lombok.RequiredArgsConstructor;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.UUID;
import stati... | package com.mengcraft.playersql.task;
/**
* Created on 16-1-4.
*/
@RequiredArgsConstructor
public class DailySaveTask extends BukkitRunnable {
private UserManager manager = UserManager.INSTANCE;
private final Player player;
private int count;
@Override
public void run() {
PlayerData... | if (nil(user)) { | 4 |
fieldexpert/fbapi4j | src/com/fieldexpert/fbapi4j/CaseHandler.java | [
"public static String collectionToCommaDelimitedString(Collection<?> col) {\n\treturn collectionToDelimitedString(col, \",\");\n}",
"public class Assert {\n\n\tpublic static void notNull(Object object, String message) {\n\t\tif (object == null) {\n\t\t\tthrow new IllegalArgumentException(message);\n\t\t}\n\t}\n\n... | import static com.fieldexpert.fbapi4j.common.StringUtil.collectionToCommaDelimitedString;
import static java.util.Arrays.asList;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.w3c.dom.Docu... | package com.fieldexpert.fbapi4j;
class CaseHandler extends AbstractHandler<Case> {
private static final String cols = collectionToCommaDelimitedString(asList(Fbapi4j.S_PROJECT, Fbapi4j.S_AREA, Fbapi4j.S_SCOUT_DESCRIPTION, Fbapi4j.S_TITLE, Fbapi4j.S_EVENT, Fbapi4j.EVENTS));
| CaseHandler(Dispatch dispatch, Util util, String token) { | 6 |
Netflix/netflix-graph | src/main/java/com/netflix/nfgraph/build/NFBuildGraph.java | [
"public static final String CONNECTION_MODEL_GLOBAL = \"global\";",
"public abstract class NFGraph {\n\t\n protected final NFGraphSpec graphSpec;\n protected final NFGraphModelHolder modelHolder;\n\n\n protected NFGraph(NFGraphSpec graphSpec) {\n this.graphSpec = graphSpec;\n this.modelHold... | import static com.netflix.nfgraph.NFGraphModelHolder.CONNECTION_MODEL_GLOBAL;
import com.netflix.nfgraph.NFGraph;
import com.netflix.nfgraph.OrdinalIterator;
import com.netflix.nfgraph.OrdinalSet;
import com.netflix.nfgraph.compressed.NFCompressedGraph;
import com.netflix.nfgraph.compressor.NFCompressedGraphBuilder;
im... | /*
* Copyright 2013 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | NFCompressedGraphBuilder builder = new NFCompressedGraphBuilder(graphSpec, nodeCache, modelHolder); | 5 |
albertogiunta/justintrain-client-android | app/src/main/java/com/jaus/albertogiunta/justintrain_oraritreni/utils/sharedPreferences/NotificationPreferences.java | [
"@SuppressWarnings(\"unused\")\npublic class Journey implements PostProcessingEnabler.PostProcessable {\n\n private String journeyDepartureStationId;\n private String journeyArrivalStationId;\n private List<Solution> solutions;\n\n public String getJourneyDepartureStationId() {\n return journeyDe... | import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import android.content.Context;
import com.jaus.albertogiunta.justintrain_oraritreni.data.Journey;
import com.jaus.albertogiunta.justintrain_oraritreni.data.PreferredJourney;
import com.jaus.albertogiunta.justintrain_oraritreni.networking.DateTimeAdapter;... | package com.jaus.albertogiunta.justintrain_oraritreni.utils.sharedPreferences;
public class NotificationPreferences {
public static void setNotificationData(Context context, PreferredJourney preferredJourney, Journey.Solution solution) {
Gson gson = new GsonBuilder()
.registerTypeAda... | return gson.fromJson(getSharedPreferenceObject(context, SP_NOTIFICATION_PREF_JOURNEY), PreferredJourney.class); | 6 |
idega/is.idega.idegaweb.egov.cases | src/java/is/idega/idegaweb/egov/cases/presentation/CasesBoardViewer.java | [
"public interface BoardCasesManager {\n\t\n\tpublic static final String BEAN_NAME = \"boardCasesManager\";\n\n\t/**\n\t * \n\t * @author <a href=\"mailto:martynas@idega.is\">Martynas Stakė</a>\n\t * @param dateFrom is floor of {@link Case#getCreated()}, \n\t * skipped if <code>null</code>;\n\t * @param dateTo is ce... | import is.idega.idegaweb.egov.cases.business.BoardCasesManager;
import is.idega.idegaweb.egov.cases.media.CasesBoardViewerExporter;
import is.idega.idegaweb.egov.cases.presentation.beans.CaseBoardBean;
import is.idega.idegaweb.egov.cases.presentation.beans.CaseBoardTableBean;
import is.idega.idegaweb.egov.cases.present... | Layer container = new Layer();
container.setStyleClass("savedFormsViewer");
container.add(element);
container.add(new CSSSpacer());
add(container);
}
protected String getCaseIdentifier(IWContext iwc) {
if (iwc != null) {
return iwc.getParameter(PARAMETER_CASE_IDENTIFIER);
}
return null;
}
pro... | CaseBoardTableBean data = getBoardCasesManager().getTableData( | 3 |
Rise-Vision/player-raspberrypi | player/src/com/risevision/riseplayer/server/Worker.java | [
"public class Config {\n\n\tprivate static final String FILE_APPLICATION_PROPERTIES = Globals.APPLICATION_NAME + \".properties\";\n\tprivate static final String FILE_DISPLAY_PROPERTIES = \"RiseDisplayNetworkII.ini\";\n\t\n\tprivate static final String PROPERTY_DISPLAY_ID = \"displayid\";\n\tprivate static final S... | import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.net.Socket;
import java.net.URLDecoder;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;... |
Map<String, String> queryMap = getQueryMap(fullUrl);
String fileUrl = queryMap.get("url");
fileUrl = fileUrl == null ? "" : URLDecoder.decode(fileUrl, "UTF-8").trim();
requestedUrl = fileUrl;
boolean isCrossDomain = "crossdomain.xml".equalsIgnoreCase(fname);
boolean isPing = fname.startsWith("ping")... | return SystemInfo.asUrlParam(false); | 4 |
datenhahn/componentrenderer | componentrenderer/src/main/java/de/datenhahn/vaadin/componentrenderer/grid/ComponentGridDecorator.java | [
"public class ComponentCellKeyExtension extends Grid.AbstractGridExtension {\n\n private ComponentCellKeyExtension(final Grid grid) {\n super.extend(grid);\n }\n\n public static ComponentCellKeyExtension extend(Grid grid) {\n return new ComponentCellKeyExtension(grid);\n }\n\n}",
"public... | import com.vaadin.v7.data.util.BeanItemContainer;
import com.vaadin.v7.data.util.GeneratedPropertyContainer;
import com.vaadin.server.Extension;
import com.vaadin.v7.server.communication.data.RpcDataProviderExtension;
import com.vaadin.v7.ui.Grid;
import de.datenhahn.vaadin.componentrenderer.ComponentCellKeyExtension;
... | /**
* Licensed under the Apache License,Version2.0(the"License");you may not
* use this file except in compliance with the License.You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,software
* distributed under t... | public ComponentGridDecorator<T> generateHeaders(TextHeaderGenerator generator) { | 7 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/ZoneId.java | [
"public final class DateTimeFormatterBuilder {\n\n /**\n * Query for a time-zone that is region-only.\n */\n private static final TemporalQuery<ZoneId> QUERY_REGION_ONLY = new TemporalQuery<ZoneId>() {\n public ZoneId queryFrom(TemporalAccessor temporal) {\n ZoneId zone = temporal.qu... | import java.io.DataOutput;
import java.io.IOException;
import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import org.threeten.bp.format.DateTimeFormatterBuilder;
im... | /*
* Copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the abov... | return new DateTimeFormatterBuilder().appendZoneText(style).toFormatter(locale).format(new DefaultInterfaceTemporalAccessor() { | 0 |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/FetchTest.java | [
"public class SCuMD extends SshServer {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tif (args.length != 1) {\n\t\t\tSystem.err.println(\"Usage: SCuMD pathToConfigFile\");\n\t\t\treturn;\n\t\t}\n\t\tnew FileSystemXmlApplicationContext(args[0]);\n\t}\n\n\tpublic SCuMD() {\n\t\tif... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.Test;
import org.spearce.jgit.lib.Repository;
import org.spearce.jgit.transport.FetchResult;
import com.asolutions.scms... | package com.asolutions.scmsshd.test.integration;
public class FetchTest extends IntegrationTestCase {
@Test
public void testFetchLocal() throws Exception {
File gitDir = new File(".git");
String remoteName = "origin";
Repository db = createCloneToRepo();
addRemoteConfigForLocalGitDirectory(db, gitD... | factory.setProjectAuthorizor(new AlwaysPassProjectAuthorizer()); | 2 |
MatejVancik/amaroKontrol | amaroKontrol_wear/mobile/src/main/java/com/mv2studio/amarok/kontrol/tasks/GetCollectionPhotosTask.java | [
"public class Prefs {\n\t\n\tpublic static String ipPortKey = \"pref_remote_server\",\n\t\t\t\t\t\t useVolButtonsKey = \"pref_volume_change\",\n\t\t\t\t\t\t showNotifyKey = \"pref_show_notify\",\n\t\t\t\t\t\t notifyShowPhotoKey = \"pref_notify_photo\",\n\t\t\t\t\t\t closePlaylistKey = \"pref_close_playlist\",\n\t\t... | import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PointF;
import android.media.FaceDetector;
import android.media.FaceDetector.Face;
import android.os.AsyncTask;
import com.mv2studi... | package com.mv2studio.amarok.kontrol.tasks;
public class GetCollectionPhotosTask extends AsyncTask<Void, Integer, Void> {
private ArrayList<Artist> mArtistsList; | private BaseActivity mBaseActivity; | 6 |
lkoskela/maven-build-utils | src/test/java/com/lassekoskela/maven/timeline/GoalOrganizerTest.java | [
"public static final int COLUMN_WIDTH_PIXEL = 60;",
"public static Goal goal(String name, long duration, long startTime, String... dependencies) {\n\treturn new Goal(name, new Duration(duration), startTime, asList(dependencies));\n}",
"public static Phase phase(String name, Goal... goals) {\n\treturn new Phase(... | import static com.lassekoskela.maven.timeline.GoalOrganizer.COLUMN_WIDTH_PIXEL;
import static com.lassekoskela.maven.timeline.ObjectBuilder.goal;
import static com.lassekoskela.maven.timeline.ObjectBuilder.phase;
import static com.lassekoskela.maven.timeline.ObjectBuilder.project;
import static org.hamcrest.MatcherAsse... | package com.lassekoskela.maven.timeline;
public class GoalOrganizerTest {
private ConsoleLogger logger;
private GoalOrganizer goalOrganizer;
@Before
public void setUp() {
logger = new ConsoleLogger();
goalOrganizer = new GoalOrganizer(logger);
}
@Test(expected = IllegalArgumentException.class)
public ... | Columns columnOfGoals = new Columns(); | 6 |
spring-projects/eclipse-integration-tcserver | com.vmware.vfabric.ide.eclipse.tcserver.ui/src/com/vmware/vfabric/ide/eclipse/tcserver/internal/ui/TcServer21InstanceCreationFragment.java | [
"public class FileUtil {\n\n\tprivate static final int MAX_FILE_SIZE = 1024 * 1024;\n\n\tpublic static final int BUFFER_SIZE = 4096;\n\n\tpublic static void copyDirectory(File sourceDirectory, File targetDirectory, IProgressMonitor monitor)\n\t\t\tthrows CoreException {\n\t\tFile[] files = sourceDirectory.listFiles... | import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
im... | data = new GridData(GridData.FILL_HORIZONTAL);
locationPathField.setLayoutData(data);
locationPathField.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
validate();
((ServerWorkingCopy) wc).setAttribute(ITomcatServer.PROPERTY_INSTANCE_DIR, locationPathField.getText());
... | TcServerUtil.setTcServerDefaultName(wc); | 5 |
zsoltk/GameOfLife | app/src/test/java/hu/supercluster/gameoflife/game/cellularautomaton/AbstractCellularAutomatonTest.java | [
"public interface Cell {\n public static final int STATE_ALIVE = 1;\n public static final int STATE_DEAD = 0;\n\n void reset(int state);\n long getId();\n int getY();\n int getX();\n void setState(int state);\n int getState();\n boolean isAlive();\n boolean isDead();\n void onNeighb... | import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import hu.supercluster.gameoflife.game.cell.Cell;
import hu.supercluster.gameoflife.game.cell.CellFactory;
import hu.supercluster.gameoflife.game.grid.Grid;
import hu.supercluster.gameoflife.game.rule.Rule;
import hu.supercluster.gameoflife.game.te... | package hu.supercluster.gameoflife.game.cellularautomaton;
public class AbstractCellularAutomatonTest extends RobolectricTest {
TestAutomaton automaton;
@Before
public void setup() {
automaton = new TestAutomaton(5, 5);
EventBus.getInstance().register(this);
}
@After
public... | Grid<GrowableCell> emptyGrid = automaton.getGridHandler().createNew(); | 4 |
batsw/AndroidAnonymityChat | app/src/main/java/com/batsw/anonimitychat/mainScreen/tabs/TabContacts.java | [
"public class AppController {\n private static final String LOG = AppController.class.getSimpleName();\n\n private static AppController mInstance;\n\n private AppCompatActivity mMainScreenActivity = null;\n\n private boolean mIsBackended = false;\n\n private static Activity mCurrentActivityContext = ... | import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
impor... | package com.batsw.anonimitychat.mainScreen.tabs;
/**
* Created by tudor on 3/29/2017.
*/
public class TabContacts extends Fragment {
private static final String LOG = TabContacts.class.getSimpleName();
private List<ContactEntity> mContactsList;
private ContactsAdapter mContactsAdapter;
private... | Intent addContactActivityIntent = ContactAddActivity.makeIntent(getActivity()); | 2 |
fwix/java-gearman | src/org/gearman/ClientConnectionController.java | [
"public static enum SubmitCallbackResult implements GearmanCallbackResult{\n\t\t\n\t/**\n\t * The job was sucessfuly submitted to a job server \n\t */\n\tSUBMIT_SUCCESSFUL,\n\t\t\n\t/**\n\t * Failed to send the job due to there being no job servers to\n\t * submit to.\n\t */\n\tFAILED_TO_NO_SERVER,\n\t\t\n\t/**\n\t... | import java.util.Iterator;
import java.util.Queue;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;
import org.gearman.GearmanClient.SubmitCallbackResult;
import org.gearman.GearmanJob.Priority;
import org.gearman.JobServerPoolAbstract.ConnectionController;
import org.gear... | package org.gearman;
abstract class ClientConnectionController <K, C extends GearmanCallbackResult> extends ConnectionController<K, C> {
private static final int RESPONCE_TIMEOUT = 19000;
private static final int IDLE_TIMEOUT = 9000;
private Queue<Runnable> multiplexTasks = new LinkedBlockingQueue<Runnable>()... | this.getConnection().sendPacket(GearmanPacket.createSUBMIT_JOB_LOW_BG(funcName, uID, data), null/*TODO*/); | 5 |
ArcadiaPlugins/Arcadia-Spigot | src/main/java/me/redraskal/arcadia/game/RedLightGreenLightGame.java | [
"public class Arcadia extends JavaPlugin {\n\n private ArcadiaAPI api;\n public Configuration mainConfiguration;\n\n public void onEnable() {\n this.api = new ArcadiaAPI(this);\n new File(this.getDataFolder().getPath() + \"/translations/\").mkdirs();\n if(new File(this.getDataFolder().... | import me.redraskal.arcadia.Arcadia;
import me.redraskal.arcadia.Cuboid;
import me.redraskal.arcadia.Utils;
import me.redraskal.arcadia.api.game.BaseGame;
import me.redraskal.arcadia.api.game.GameState;
import me.redraskal.arcadia.api.map.GameMap;
import me.redraskal.arcadia.api.scoreboard.SidebarSettings;
import me.re... | package me.redraskal.arcadia.game;
public class RedLightGreenLightGame extends BaseGame {
private Location startPosition;
private Location targetPosition;
private String towards;
private Cuboid glass;
private boolean redLight = false;
private Random random = new Random();
public RedLigh... | new SidebarSettings(RelativeDistanceSidebar.class, | 8 |
JanWiemer/jacis | src/test/java/org/jacis/objectadapter/microstream/JacisStoreWithMicrostreamCloningAndTrackedViewMultithreadedTest.java | [
"@JacisApi\npublic class JacisContainer {\n\n /** {@link JacisTransactionAdapter} to bind the Jacis Store to externally managed transactions. */\n private final JacisTransactionAdapter txAdapter;\n /** Map assigning the stores (values of type {@link JacisStoreImpl}) to the store identifiers (keys of type {@link ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import org.jacis.container.JacisContainer;
import org.jacis.container.JacisTransactionHandle;
import org.jacis.plugin.JacisTran... | /*
* Copyright (c) 2016. Jan Wiemer
*/
package org.jacis.objectadapter.microstream;
public class JacisStoreWithMicrostreamCloningAndTrackedViewMultithreadedTest {
static final Logger log = LoggerFactory.getLogger(JacisStoreWithMicrostreamCloningAndTrackedViewMultithreadedTest.class);
protected... | store.getTrackedViewRegistry().registerTrackedView(new TrackedTestView());
| 7 |
andresth/Kandroid | app/src/main/java/in/andres/kandroid/ui/LoginActivity.java | [
"public interface Constants {\n String TAG = \"Kandroid\";\n int ResultChanged = 1;\n int RequestEditTask = 1;\n int FileSelectCode = 10;\n int RequestStoragePermission = 20;\n int[] minKanboardVersion = new int[] {1, 0, 38};\n}",
"@SuppressWarnings(\"unused\")\npublic class KanboardAPI {\n\n ... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.preference.Prefere... | /*
* Copyright 2017 Thomas Andres
*
* This file is part of Kandroid.
*
* Kandroid 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 versio... | Log.e(Constants.TAG, String.format("%s (%d; %d)", error.Message, error.Code, error.HTTPReturnCode)); | 0 |
desht/ScrollingMenuSign | src/main/java/me/desht/scrollingmenusign/listeners/SMSEntityListener.java | [
"public class SMSException extends DHUtilsException {\n\n private static final long serialVersionUID = 1L;\n\n public SMSException(String message) {\n super(message);\n }\n\n}",
"public class SMSMenu extends Observable implements SMSPersistable, SMSUseLimitable, ConfigurationListener, Comparable<S... | import java.util.Iterator;
import me.desht.dhutils.Debugger;
import me.desht.dhutils.LogUtils;
import me.desht.dhutils.MiscUtil;
import me.desht.scrollingmenusign.SMSException;
import me.desht.scrollingmenusign.SMSMenu;
import me.desht.scrollingmenusign.ScrollingMenuSign;
import me.desht.scrollingmenusign.enums.SMSUser... | package me.desht.scrollingmenusign.listeners;
public class SMSEntityListener extends SMSListenerBase {
public SMSEntityListener(ScrollingMenuSign plugin) {
super(plugin);
}
@EventHandler(ignoreCancelled = true)
public void onEntityExplode(EntityExplodeEvent event) {
boolean noExplo... | SMSMenu menu = view.getNativeMenu(); | 1 |
Amab/SWADroid | SWADroid/src/main/java/es/ugr/swad/swadroid/modules/rollcall/ContinuousCaptureActivity.java | [
"public class Constants {\n /**\n * URL of SWAD UGR Server\n */\n public static final String SWAD_UGR_SERVER = \"swad.ugr.es\";\n /**\n * URL of OpenSWAD Server\n */\n public static final String OPENSWAD_SERVER = \"openswad.org\";\n /**\n * Server URL\n */\n public static f... | import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import ... | package es.ugr.swad.swadroid.modules.rollcall;
/**
* This Activity performs continuous scanning, processing rollcalls whenever
* a barcode is scanned.
*
* @author Juan Miguel Boyero Corral <juanmi1982@gmail.com>
*/
public class ContinuousCaptureActivity extends AppCompatActivity {
private static final St... | User u = null; | 3 |
dakshj/TMDb_Sample | app/src/main/java/com/daksh/tmdbsample/movielist/MovieListPresenter.java | [
"public abstract class BasePresenterImpl<V> implements BasePresenter<V> {\n\n private WeakReference<V> viewRef;\n\n @Override\n public void attachView(V view) {\n viewRef = new WeakReference<>(view);\n }\n\n @Override\n public V getView() throws NullPointerException {\n if (viewRef !... | import android.support.annotation.NonNull;
import android.text.TextUtils;
import com.daksh.tmdbsample.base.BasePresenterImpl;
import com.daksh.tmdbsample.data.intdef.ListLoadType;
import com.daksh.tmdbsample.data.intdef.SortOrder;
import com.daksh.tmdbsample.data.model.Movie;
import com.daksh.tmdbsample.data.model.Movi... | package com.daksh.tmdbsample.movielist;
/**
* Created by daksh on 03-Sep-16.
*/
public class MovieListPresenter extends BasePresenterImpl<MovieListContract.View>
implements MovieListContract.Presenter {
@NonNull
private final TmdbApi api;
@NonNull
private final AppSettings appSettings;
... | loadMovies(getView().getSearchQuery(), null, new ListLoadType(ListLoadType.FIRST)); | 1 |
HRVBand/hrv-band | app/src/main/java/hrv/band/app/ui/view/fragment/MeasuringFragment.java | [
"public class ConnectionManager {\n private Activity activity;\n private SharedPreferences sharedPreferences;\n\n private static final String SELECTED_DEVICE_ID = \"selected_device_id\";\n\n public ConnectionManager(Activity activity) {\n this.activity = activity;\n this.sharedPreferences ... | import android.animation.ObjectAnimator;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Point;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.support.design.widget.Snackbar;
import andr... | package hrv.band.app.ui.view.fragment;
/**
* Copyright (c) 2017
* Created by Thomas Czogalik on 19.01.2017
* <p>
* Fragment allowing user to start measurement.
*/
public class MeasuringFragment extends Fragment implements HRVRRDeviceListener, HRVRRIntervalListener, HRVParameterChangedListener, IMeasuringView {... | private HRVRRIntervalDevice hrvRRIntervalDevice; | 1 |
tsy12321/LeanoteAndroid | app/src/main/java/com/tsy/leanote/feature/user/view/LoginActivity.java | [
"public class HomeActivity extends BaseActivity implements NavigationView.OnNavigationItemSelectedListener, Toolbar.OnMenuItemClickListener {\n\n @BindView(R.id.toolbar)\n Toolbar toolbar;\n\n @BindView(R.id.drawer_layout)\n DrawerLayout drawer_layout;\n\n @BindView(R.id.nav_view)\n NavigationView... | import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.method.PasswordTransformationMethod;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget... | package com.tsy.leanote.feature.user.view;
public class LoginActivity extends BaseActivity {
@BindView(R.id.edit_username)
EditText mEditUsername;
@BindView(R.id.edit_password)
EditText mEditPassword;
@BindView(R.id.img_pwd_visible)
ImageView mImgPwdVisible;
@BindView(R.id.txt_server)
... | startActivity(HomeActivity.createIntent(this)); | 0 |
onepf/OPFPush | samples/pushchat/src/main/java/org/onepf/pushchat/db/DatabaseHelper.java | [
"public static class ContactsContract {\n public static final String TABLE_NAME = \"contacts\";\n\n public static final Uri TABLE_URI = CONTENT_BASE_URI.buildUpon().appendPath(TABLE_NAME).build();\n public static final int ALL_URI_CODE = 2;\n public static final int URI_CODE = 3;\n\n public static cl... | import org.onepf.pushchat.model.db.Message;
import java.util.HashSet;
import java.util.Set;
import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabas... | /*
* Copyright 2012-2015 One Platform 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 applicable ... | public void addMessage(@NonNull final Message message) { | 6 |
aschaetzle/Sempala | sempala-translator/src/main/java/de/uni_freiburg/informatik/dbis/sempala/translator/op/ImpalaBgpComplexPropertyTable.java | [
"public class ImpalaComplexTripleGroup {\n\n\tprivate List<Triple> triples = new ArrayList<Triple>();\n\n\tprivate String name;\n\n\n\tpublic String getName() {\n\t\treturn name;\n\t}\n\n\t// choose triplestore as predicate unbound\n\tprivate boolean selectFromTripleStore = false;\n\n\tPrefixMapping prefixMapping;\... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.shared.PrefixMapping;
import com.hp.hpl.jena.sparql.algebra.op.OpBGP;
import de.uni_freiburg.informatik.dbis.sempala.translato... | package de.uni_freiburg.informatik.dbis.sempala.translator.op;
public class ImpalaBgpComplexPropertyTable extends ImpalaBGP {
public ImpalaBgpComplexPropertyTable(OpBGP opBGP, PrefixMapping prefixes) {
super(opBGP, prefixes);
}
@Override
public SQLStatement translate(String resultName) {
this.resultName ... | Join join = new Join(getResultName(), group.translate(), rights, onConditions, JoinType.INNER); | 1 |
bingyulei007/bingexcel | excel/src/test/java/com/chinamobile/excel/ReadTest8.java | [
"public interface ExcleBuilder<T> {\n\n\tExcleBuilder<BingExcel> addFieldConversionMapper(Class<?> clazz,\n\t\t\tString filedName, int index);\n\n\tExcleBuilder<BingExcel> addFieldConversionMapper(Class<?> clazz,\n\t\t\tString filedName, int index, String alias);\n\n\tExcleBuilder<BingExcel> addFieldConversionMappe... | import com.bing.common.ExcleBuilder;
import com.bing.excel.annotation.CellConfig;
import com.bing.excel.annotation.OutAlias;
import com.bing.excel.converter.AbstractFieldConvertor;
import com.bing.excel.core.BingExcel;
import com.bing.excel.core.BingExcelBuilder;
import com.bing.excel.core.handler.ConverterHandler;
imp... | package com.chinamobile.excel;
/**
* @author shizhongtao
*
* date 2016-3-23 Description:
*/
public class ReadTest8 {
@Test
public void readExcelTest() throws URISyntaxException {
// InputStream in = Person.class.getResourceAsStream("/person.xlsx");
URL url = Salary.class.getResource("/salary7.xlsx");
Fi... | ExcleBuilder<BingExcel> bingExcelExcleBuilder = BingExcelBuilder.toBuilder(); | 2 |
casid/jusecase-builders | src/main/java/org/jusecase/builders/time/LocalDateTimeBuilder.java | [
"public class Builders {\n\n public static <T> T a(final Builder<T> builder) {\n return builder.build();\n }\n\n public static <T> T an(final Builder<T> builder) {\n return builder.build();\n }\n\n public static <T> T of(final T entity) {\n return entity;\n }\n\n @SafeVarar... | import org.jusecase.Builders;
import org.jusecase.builders.Builder;
import org.jusecase.builders.BuilderException;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import static org.jusecase.Builders.a;
import static org.jusecase.Builders.localDate; | package org.jusecase.builders.time;
public class LocalDateTimeBuilder implements Builder<LocalDateTime> {
private static final String FORMAT = "yyyy-MM-dd HH:mm:ss";
private static final String SHORT_FORMAT = "yyyy-MM-dd";
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern(... | LocalDate localDate = a(localDate(string)); | 4 |
mikolajmitura/java-properties-to-json | src/main/java/pl/jalokim/propertiestojson/resolvers/primitives/PrimitiveJsonTypeResolver.java | [
"public abstract class AbstractJsonType {\r\n\r\n /**\r\n * This one simply concatenate to rest of json. Simply speaking when will not converted then will not create whole json correctly.\r\n *\r\n * @return string for part of json.\r\n */\r\n public abstract String toStringJson();\r\n\r\n ... | import java.util.Collections;
import java.util.List;
import java.util.Optional;
import pl.jalokim.propertiestojson.object.AbstractJsonType;
import pl.jalokim.propertiestojson.object.JsonNullReferenceType;
import pl.jalokim.propertiestojson.resolvers.PrimitiveJsonTypesResolver;
import pl.jalokim.propertiestojson.resolve... | package pl.jalokim.propertiestojson.resolvers.primitives;
@SuppressWarnings("unchecked")
@Deprecated
public abstract class PrimitiveJsonTypeResolver<T> implements HasGenericType<T> {
protected final Class<?> typeWhichCanBeResolved = resolveTypeOfResolver();
@InvokedFromAdapter
@InvokedFromDelegator | public AbstractJsonType returnJsonType(PrimitiveJsonTypesResolver primitiveJsonTypesResolver, Object propertyValue, String propertyKey) { | 2 |
huijimuhe/common-layout-android | CommonLayout/app/src/main/java/com/huijimuhe/commonlayout/adapter/render/xcCommentRender.java | [
"public class AppContext extends Application {\n private static AppContext INSTANCE=null;\n\n @Override\n public void onCreate() {\n super.onCreate();\n INSTANCE=this;\n }\n\n public static AppContext getInstance(){return INSTANCE;}\n}",
"public abstract class AbstractRender{\n\n p... | import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.huijimuhe.commonlayout.AppContext;
import com.huijimuhe.commonlayout.R;
import com... | package com.huijimuhe.commonlayout.adapter.render;
/**
* Created by Huijimuhe on 2016/6/11.
* This is a part of Homedev
* enjoy
*/
public class xcCommentRender extends AbstractRender {
private ViewHolder mHolder;
private AbstractRenderAdapter mAdapter;
public xcCommentRender(ViewGroup parent, Abstr... | xcComment data = (xcComment) mAdapter.getItem(position); | 5 |
cdecker/BitDroid-Network | src/main/java/net/bitdroid/network/BitcoinClientDriver.java | [
"public static enum EventType {\n\tINCOMING_CONNECTION_TYPE,\n\tOUTGOING_CONNECTION_TYPE,\n\tFAILED_CONNECTION_TYPE,\n\tDISCONNECTED_TYPE,\n\tVERSION_TYPE,\n\tVERACK_TYPE,\n\tADDR_TYPE,\n\tBLOCK_TYPE,\n\tGET_ADDR_TYPE,\n\tGET_DATA_TYPE,\n\tINVENTORY_TYPE,\n\tPING_TYPE,\n\tTRANSACTION_TYPE,\n\tUNKNOWN_TYPE,\n\tPART_... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
import net.bitdroid.network.Event.EventType;
import net.bitdroid.network.messages.PeerAddress;
import net.bitdroid.netwo... | /**
* Copyright 2011 Christian Decker
*
* 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... | VersionMessage version = new VersionMessage(); | 4 |
junicorn/java-china | src/main/java/com/javachina/service/impl/CodesServiceImpl.java | [
"public class TipException extends RuntimeException {\n\n public TipException() {\n }\n\n public TipException(String message) {\n super(message);\n }\n\n public TipException(String message, Throwable cause) {\n super(message, cause);\n }\n\n public TipException(Throwable cause) {\... | import com.blade.ioc.annotation.Inject;
import com.blade.ioc.annotation.Service;
import com.blade.jdbc.ActiveRecord;
import com.blade.kit.DateKit;
import com.blade.kit.StringKit;
import com.javachina.exception.TipException;
import com.javachina.kit.MailKit;
import com.javachina.model.Codes;
import com.javachina.model.U... | package com.javachina.service.impl;
@Service
public class CodesServiceImpl implements CodesService {
@Inject
private ActiveRecord activeRecord;
@Inject
private UserService userService;
@Inject
private UserInfoService userInfoService;
@Override
public Codes getActivecode(String code... | public String save(User user, String type) { | 3 |
JAYAndroid/whiteboard | client/src/com/yems/painter/control/ClientControl.java | [
"public class Commons\n{\n\t/** ·þÎñÆ÷IPµØÖ· */\n\tpublic static String SERVER_IP_ADDRESS = \"\";\n\t/** ¶Ë¿ÚºÅ */\n\tpublic static int SERVER_PORT = 8080;\n\t/** Ï̳߳شóС£¬Ä¬ÈÏΪ10¸ö */\n\tpublic static final int THREAD_COUNT = 10;\n\t/** ĬÈÏ»±Ê´óС */\n\tpublic static final float DEFAULT_BRUSH_SIZE = 2;\n\t/*... | import java.io.Serializable;
import java.net.InetSocketAddress;
import java.util.List;
import java.util.concurrent.Executors;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
import android.util.Log;
import... | package com.yems.painter.control;
/**
* @description: ÍøÂçµç×Ó°×°å-¿Í»§¶Ë(µ¥Àýģʽ),ÊÇ »ùÓÚC/SģʽµÄ½»»¥»æÍ¼°å
* @date: 2015-3-12 ÉÏÎç9:03:17
* @author: yems
*/
public class ClientControl implements Serializable
{
private String TAG = "ClientNetty";
/** ×Ô¶¨Òå¹ÜµÀ¹ÜÀí */
private MyChannelPipelineFactory myC... | SerializablePath path = new SerializablePath(); | 5 |
chetan/sewer | src/main/java/net/pixelcop/sewer/source/http/HttpPixelSource.java | [
"public interface Event extends Writable {\n\n}",
"public abstract class Sink extends Plumbing {\n\n private static final Logger LOG = LoggerFactory.getLogger(Sink.class);\n\n protected Sink subSink = null;\n\n /**\n * Append an Event to the Sink\n * @param event\n * @throws IOException\n */\n public ... | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.management.ManagementFactory;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.pixelcop.sewer.Event;
import net.pix... | package net.pixelcop.sewer.source.http;
/**
* Source that generates events from HTTP and responds with a "204 No Content" status
*
* @author chetan
*
*/
public class HttpPixelSource extends Source {
/**
* Simple handler that always returns HTTP/1.1 200 and does <em>not</em> log the request
*
* @au... | private Sink sink; | 1 |
napstr/SqlSauce | discord-entities/src/main/java/space/npstr/sqlsauce/jda/listeners/DiscordEntityCacheUtil.java | [
"public class DatabaseException extends RuntimeException {\n\n\n private static final long serialVersionUID = 4421127305934584766L;\n\n //force creation with a message\n private DatabaseException() {\n\n }\n\n public DatabaseException(final String message) {\n super(message);\n }\n\n pub... | import space.npstr.sqlsauce.entities.discord.BaseDiscordUser;
import space.npstr.sqlsauce.fp.types.EntityKey;
import space.npstr.sqlsauce.fp.types.Transfiguration;
import javax.persistence.PersistenceException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.a... | /*
* MIT License
*
* Copyright (c) 2017-2018, Dennis Neufeld
*
* 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, c... | public static <E extends BaseDiscordGuild<E> & CacheableGuild<E>> E cacheGuild(final DatabaseWrapper dbWrapper, | 2 |
raycoarana/awex | awex-core/src/main/java/com/raycoarana/awex/AwexCollectionPromise.java | [
"public interface CancelCallback {\n\n void onCancel();\n\n}",
"public interface DoneCallback<T> {\n\n void onDone(T result);\n\n}",
"public interface FailCallback {\n\n void onFail(Exception exception);\n\n}",
"public interface Filter<T> {\n boolean filter(T value);\n}",
"public interface Func<... | import com.raycoarana.awex.callbacks.CancelCallback;
import com.raycoarana.awex.callbacks.DoneCallback;
import com.raycoarana.awex.callbacks.FailCallback;
import com.raycoarana.awex.transform.Filter;
import com.raycoarana.awex.transform.Func;
import com.raycoarana.awex.transform.Mapper;
import java.util.Collection;
imp... | package com.raycoarana.awex;
class AwexCollectionPromise<Result, Progress> extends AwexPromise<Collection<Result>, Progress> implements CollectionPromise<Result, Progress> {
public AwexCollectionPromise(Awex awex) {
super(awex);
}
public <U> AwexCollectionPromise(Awex mAwex, Promise<U, Progress... | public CollectionPromise<Result, Progress> forEach(Func<Result> func) { | 4 |
winzillion/FluxJava | demo-rx/src/sharedTest/java/com/example/fluxjava/rx/StubAppConfig.java | [
"public class StubActionHelper extends ActionHelper {\n\n @Override\n public Object wrapData(final Object inData) {\n Object result = inData;\n\n if (inData instanceof Integer) {\n result = new ArrayList<>();\n }\n if (inData instanceof String) {\n result = ne... | import android.app.Application;
import com.example.fluxjava.rx.domain.StubActionHelper;
import com.example.fluxjava.rx.domain.stores.StubTodoStore;
import com.example.fluxjava.rx.domain.stores.StubUserStore;
import io.wzcodes.fluxjava.FluxContext;
import io.wzcodes.fluxjava.rx.RxBus;
import java.util.HashMap;
import st... | /*
* Copyright (C) 2016 Bugs will find a way (https://wznote.blogspot.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
*
* Unl... | .setBus(RxBus.getDefault()) | 4 |
carlphilipp/stock-tracker | website/src/main/java/fr/cph/stock/service/impl/CurrencyServiceImpl.java | [
"public interface CurrencyService {\n\n\t/**\n\t * Load a currency with its data\n\t *\n\t * @param currency the currency\n\t * @return a currency\n\t * @throws YahooException the yahoo exception\n\t */\n\tCurrency loadCurrencyData(Currency currency) throws YahooException;\n\n\t/**\n\t * Update all current currenci... | import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import fr.cph.stock.service.CurrencyService;
import fr.cph.stock.repository.CurrencyRepository;
import fr.cph.stock.entities.CurrencyData;
import fr.cph.stock.enumtype.Currency;
import fr.cph.stock.exce... | /**
* Copyright 2017 Carl-Philipp Harmant
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable... | public class CurrencyServiceImpl implements CurrencyService { | 0 |
cash1981/civilization-boardgame-rest | src/main/java/no/asgari/civilization/server/action/TurnAction.java | [
"@Data\n@JsonIgnoreProperties(ignoreUnknown = true)\n@NoArgsConstructor\n@JsonRootName(\"turn\")\npublic class TurnDTO {\n private int turnNumber;\n @NotEmpty\n private String order;\n @NotNull\n private String phase;\n private boolean locked;\n}",
"@Log4j\npublic class SendEmail {\n public s... | import com.mongodb.DB;
import lombok.extern.log4j.Log4j;
import no.asgari.civilization.server.dto.TurnDTO;
import no.asgari.civilization.server.email.SendEmail;
import no.asgari.civilization.server.misc.CivUtil;
import no.asgari.civilization.server.misc.SecurityCheck;
import no.asgari.civilization.server.model.GameLog;... | package no.asgari.civilization.server.action;
@Log4j
public class TurnAction extends BaseAction {
private final JacksonDBCollection<PBF, String> pbfCollection;
public TurnAction(DB db) {
super(db);
this.pbfCollection = JacksonDBCollection.wrap(db.getCollection(PBF.COL_NAME), PBF.class, Str... | public void updateSOT(String pbfId, String playerId, TurnDTO turnDTO) { | 0 |
mini2Dx/miniscript | lua/src/main/java/org/mini2Dx/miniscript/lua/LuaScriptExecutorPool.java | [
"public class InsufficientCompilersException extends Exception {\n\tprivate static final long serialVersionUID = 2947579725300422095L;\n\n\tpublic InsufficientCompilersException() {\n\t\tsuper(\"There were insufficient compilers available to compile the provided script\");\n\t}\n}",
"public class NoSuchScriptExce... | import org.luaj.vm2.lib.jse.JsePlatform;
import org.mini2Dx.miniscript.core.*;
import org.mini2Dx.miniscript.core.exception.InsufficientCompilersException;
import org.mini2Dx.miniscript.core.exception.NoSuchScriptException;
import org.mini2Dx.miniscript.core.exception.ScriptExecutorUnavailableException;
import org.mini... | /**
* The MIT License (MIT)
*
* Copyright (c) 2016 Thomas Cashman
*
* 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... | public int preCompileScript(String filepath, String scriptContent) throws InsufficientCompilersException { | 0 |
all4you/redant | redant-core/src/main/java/com/redant/core/common/util/HttpRenderUtil.java | [
"public class DefaultHtmlMaker implements HtmlMaker {\n\n @Override\n public String make(String htmlTemplate, Map<String, Object> contentMap) {\n String html = htmlTemplate;\n if(CollectionUtil.isNotEmpty(contentMap)){\n for(Map.Entry<String,Object> entry : contentMap.entrySet()){\n ... | import com.alibaba.fastjson.JSONObject;
import com.redant.core.common.html.DefaultHtmlMaker;
import com.redant.core.common.html.HtmlMaker;
import com.redant.core.common.html.HtmlMakerEnum;
import com.redant.core.common.html.HtmlMakerFactory;
import com.redant.core.common.view.Page404;
import com.redant.core.render.Rend... | package com.redant.core.common.util;
/**
* HttpRenderUtil
*
* @author houyi.wh
* @date 2017-10-20
*/
public class HttpRenderUtil {
public static final String EMPTY_CONTENT = "";
private HttpRenderUtil() {
}
/**
* response输出
*
* @param content 内容
* @param renderType 返回类型... | HtmlMaker htmlMaker = HtmlMakerFactory.instance().build(HtmlMakerEnum.STRING, DefaultHtmlMaker.class); | 0 |
dkunzler/masterpassword | app/src/main/java/de/devland/masterpassword/ui/drawer/AddCategoryDrawerItem.java | [
"public class App extends BaseApp {\n\n private Locale targetLocale;\n\n\n @Override\n @SneakyThrows(PackageManager.NameNotFoundException.class)\n public void onCreate() {\n super.onCreate();\n DefaultPrefs defaultPrefs = Esperandro.getPreferences(DefaultPrefs.class, this);\n InputS... | import android.annotation.SuppressLint;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.Lay... | package de.devland.masterpassword.ui.drawer;
/**
* Created by deekay on 02/11/14.
*/
public class AddCategoryDrawerItem extends DrawerItem {
private final BaseActivity activity;
| protected DefaultPrefs defaultPrefs; | 3 |
gems-uff/prov-viewer | src/main/java/br/uff/ic/graphmatching/GraphMerger.java | [
"public class SimpleHeuristic implements MatchingHeuristic{\n \n public boolean allowUndo = false;\n \n public SimpleHeuristic(boolean allowUndo_) {\n allowUndo = allowUndo_;\n }\n\n @Override\n public void MatchGraphs(DirectedGraph<Object, Edge> graph_01, DirectedGraph<Object, Edge> gra... | import java.util.Map;
import br.uff.ic.graphmatching.Heuristics.SimpleHeuristic;
import br.uff.ic.utility.AttributeErrorMargin;
import br.uff.ic.utility.Utils;
import br.uff.ic.utility.Vocabulary;
import br.uff.ic.utility.graph.Edge;
import edu.uci.ics.jung.graph.DirectedGraph;
import java.util.Collection; | /*
* The MIT License
*
* Copyright 2017 Kohwalter.
*
* 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, modif... | public DirectedGraph<Object, Edge> Merging( | 4 |
FedUni/caliko | caliko-visualisation/src/main/java/au/edu/federation/caliko/visualisation/FabrikLine2D.java | [
"public class FabrikBone2D implements FabrikBone<Vec2f,FabrikJoint2D>\r\n{\r\n\t/**\r\n\t * mJoint\tThe joint attached to this FabrikBone2D.\r\n\t * <p>\r\n\t * Each bone has a single FabrikJoint2D which controls the angle to which the bone is\r\n\t * constrained with regard to the previous (i.e. earlier / closer t... | import au.edu.federation.caliko.FabrikBone2D;
import au.edu.federation.caliko.FabrikChain2D;
import au.edu.federation.caliko.FabrikChain2D.BaseboneConstraintType2D;
import au.edu.federation.caliko.FabrikJoint2D.ConstraintCoordinateSystem;
import au.edu.federation.caliko.FabrikStructure2D;
import au.edu.federation.... | package au.edu.federation.caliko.visualisation;
/**
* A static class used to draw a 2D lines to represent FabrikBone2D, FabrikChain2D or FabrickStructure2D objects.
* <p>
* These draw methods are only provided to assist with prototyping and debugging.
* <p>
* The GLSL shaders used to draw the lines requi... | BaseboneConstraintType2D constraintType = chain.getBaseboneConstraintType();
| 2 |
hpgrahsl/kafka-connect-mongodb | src/test/java/at/grahsl/kafka/connect/mongodb/processor/field/projection/FieldProjectorTest.java | [
"public class MongoDbSinkConnectorConfig extends CollectionAwareConfig {\n\n public enum FieldProjectionTypes {\n NONE,\n BLACKLIST,\n WHITELIST\n }\n\n private static final Pattern CLASS_NAME = Pattern.compile(\"\\\\p{javaJavaIdentifierStart}\\\\p{javaJavaIdentifierPart}*\");\n pri... | import at.grahsl.kafka.connect.mongodb.MongoDbSinkConnectorConfig;
import at.grahsl.kafka.connect.mongodb.converter.SinkDocument;
import at.grahsl.kafka.connect.mongodb.processor.BlacklistKeyProjector;
import at.grahsl.kafka.connect.mongodb.processor.BlacklistValueProjector;
import at.grahsl.kafka.connect.mongodb.proce... | new BsonDocument() {{
put("key",new BsonString("abc"));
put("value",new BsonInt32(123));
}},
... | entry, BlacklistValueProjector.class, cfg)); | 3 |
jimmoores/quandl4j | core/src/test/java/com/jimmoores/quandl/tests/ResultChecker.java | [
"public final class HeaderDefinition {\n private static Logger s_logger = LoggerFactory.getLogger(HeaderDefinition.class);\n private final Map<String, Integer> _columnNamesToIndices = new LinkedHashMap<String, Integer>();\n private final List<String> _columnNames;\n\n private HeaderDefinition(final List<String>... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Asser... | package com.jimmoores.quandl.tests;
/**
* @deprecated this test covers the deprecated API.
* Class that either saves a sequence of results into files.
*/
public class ResultChecker implements ResultProcessor {
private static Logger s_logger = LoggerFactory.getLogger(ResultChecker.class);
private static fi... | ArgumentChecker.notNull(baseDir, "baseDir"); | 4 |
senseobservationsystems/sense-android-library | sense-android-library/src/nl/sense_os/service/phonestate/AppsSensor.java | [
"public class SensePrefs {\r\n /**\r\n * Keys for the authentication-related preferences of the Sense Platform\r\n */\r\n public static class Auth {\r\n /**\r\n * Key for login preference for session cookie.\r\n * \r\n * @see SensePrefs#AUTH_PREFS\r\n */\r\n ... | import java.util.ArrayList;
import java.util.List;
import nl.sense_os.service.R;
import nl.sense_os.service.constants.SenseDataTypes;
import nl.sense_os.service.constants.SensePrefs;
import nl.sense_os.service.constants.SensePrefs.Main.PhoneState;
import nl.sense_os.service.constants.SensorData.DataPoint;
import... | package nl.sense_os.service.phonestate;
public class AppsSensor extends BaseDataProducer implements PeriodicPollingSensor {
private static final String TAG = "Sense Apps Sensor";
private static AppsSensor instance;
public static AppsSensor getInstance(Context context) {
if (null == instance) {
... | i.putExtra(DataPoint.DATA_TYPE, SenseDataTypes.JSON);
| 2 |
googleapis/java-mediatranslation | samples/snippets/src/main/java/com/example/mediatranslation/TranslateFromMic.java | [
"@BetaApi\n@Generated(\"by gapic-generator-java\")\npublic class SpeechTranslationServiceClient implements BackgroundResource {\n private final SpeechTranslationServiceSettings settings;\n private final SpeechTranslationServiceStub stub;\n\n /** Constructs an instance of SpeechTranslationServiceClient with defau... | import javax.sound.sampled.AudioInputStream;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.TargetDataLine;
import com.google.api.gax.rpc.ClientStream;
import com.google.api.gax.rpc.ResponseObserver;
import com... | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... | StreamingTranslateSpeechConfig streamingRecognitionConfig = | 1 |
annefried/sitent | de.uni-saarland.coli.sitent/src/main/java/sitent/syntSemFeatures/verbs/VerbFeaturesAnnotator.java | [
"public class ClassificationAnnotation extends Annotation {\n /** @generated\n * @ordered \n */\n @SuppressWarnings (\"hiding\")\n public final static int typeIndexID = JCasRegistry.register(ClassificationAnnotation.class);\n /** @generated\n * @ordered \n */\n @SuppressWarnings (\"hiding\")\n public ... | import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.component.JCasAnnotator_ImplBas... | package sitent.syntSemFeatures.verbs;
/**
* @author afried (Annemarie Friedrich)
*
* Sets the tense and voice of all verbs in the JCas. Adds tense, voice, perfect, progressive
* and a coarse tense feature.
* Tense extraction follows:
*
* Loaiciga, Sharid, Thomas Meyer, and Andrei Popescu-Belis. "English-Frenc... | FeaturesUtil.addFeature("verb_tense", verbFeat.getTense(), jcas, annot); | 2 |
Ekryd/sortpom | sorter/src/main/java/sortpom/wrapper/WrapperFactoryImpl.java | [
"public class FailureException extends RuntimeException {\n public FailureException(String msg, Throwable cause) {\n super(msg, cause);\n }\n\n public FailureException(String msg) {\n super(msg);\n }\n}",
"public class PluginParameters {\n public final File pomFile;\n public final ... | import org.jdom.*;
import org.jdom.input.SAXBuilder;
import sortpom.exception.FailureException;
import sortpom.parameter.PluginParameters;
import sortpom.util.FileUtil;
import sortpom.wrapper.content.UnsortedWrapper;
import sortpom.wrapper.content.Wrapper;
import sortpom.wrapper.operation.HierarchyRootWrapper;
import s... | package sortpom.wrapper;
/**
* Concrete implementation of a wrapper factory that sorts xml according to
* sort order from fileUtil.
* <p>
* Thank you Christian Haelg for your sortProperties patch.
*
* @author Bjorn Ekryd
*/
public class WrapperFactoryImpl implements WrapperFactory {
/** How much the sort... | return new UnsortedWrapper<>(content); | 3 |
simon816/ChatUI | src/main/java/com/simon816/chatui/pagination/TabbedPaginationList.java | [
"public class ActivePlayerChatView implements PlayerChatView {\r\n\r\n private static final String PERM_CONFIG = ChatUI.ADMIN_PERMISSON + \".config\";\r\n private static final String PERM_PERMISSIONS = ChatUI.ADMIN_PERMISSON + \".permissions\";\r\n\r\n private PlayerContext playerContext;\r\n private fi... | import com.simon816.chatui.ActivePlayerChatView;
import com.simon816.chatui.ChatUI;
import com.simon816.chatui.impl.ImplementationPagination;
import com.simon816.chatui.lib.ChatUILib;
import com.simon816.chatui.lib.PlayerChatView;
import com.simon816.chatui.util.Utils;
import org.spongepowered.api.command.Command... | package com.simon816.chatui.pagination;
public class TabbedPaginationList implements PaginationList {
private final PaginationList list;
private final PaginationService service;
public TabbedPaginationList(PaginationList list, PaginationService service) {
this.list = list;
th... | ImplementationPagination.modify(this.service, newReceiver, sendTo);
| 2 |
adealjason/dtsopensource | dts-parent/dts-core/src/main/java/org/github/dtsopensource/core/protocol/http/HttpRemoteRuleProtocol.java | [
"public abstract class HttpProtoclCallback {\r\n\r\n /**\r\n * 设置请求参数\r\n * \r\n * @return\r\n */\r\n public abstract Map<String, Object> buildParams();\r\n\r\n}\r",
"@Data\r\npublic class ResultBase<T> implements Serializable {\r\n\r\n private static final long serialVersionUID = 2297155... | import java.util.Map;
import org.github.dtsopensource.core.protocol.http.protocol.impl.HttpProtoclCallback;
import org.github.dtsopensource.core.protocol.http.protocol.impl.HttpProtocolParent;
import org.github.dtsopensource.server.share.DTSResultCode;
import org.github.dtsopensource.server.share.ResultBase;
impor... | package org.github.dtsopensource.core.protocol.http;
/**
* @author ligaofeng 2016年12月16日 下午3:21:45
*/
@Slf4j
public class HttpRemoteRuleProtocol extends HttpProtocolParent implements IDTSProtocol, IDTSRule {
/**
* @param requestActivityRuleURL
*/
public HttpRemoteRuleProtocol(St... | public ResultBase<ActivityRuleEntity> checkBizType(final String bizType) {
| 5 |
supaldubey/storm | src/main/java/in/cubestack/android/lib/storm/core/QueryGenerator.java | [
"public enum FetchType {\r\n\r\n\tEAGER, LAZY;\r\n}\r",
"public enum SortOrder {\r\n ASC,\r\n DESC\r\n}\r",
"public class Order {\n\n\tprivate SortOrder sortOrder;\n\tprivate String orderSql;\n\tprivate TableInformation information;\n\tprivate QueryGenerator queryGenerator = new QueryGenerator();\n\n\tpub... | import in.cubestack.android.lib.storm.FetchType;
import in.cubestack.android.lib.storm.SortOrder;
import in.cubestack.android.lib.storm.criteria.Order;
import in.cubestack.android.lib.storm.criteria.Projection;
import in.cubestack.android.lib.storm.criteria.Restriction;
import in.cubestack.android.lib.storm.criter... | /**
*
*/
package in.cubestack.android.lib.storm.core;
/**
* A core Android SQLite ORM framework build for speed and raw execution.
* Copyright (c) 2014 CubeStack. Version built for Flash Back..
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software ... | public String rawQuery(Class<?> entityClass, Restriction restriction, Projection projection) throws IllegalArgumentException, IllegalAccessException, InstantiationException, StormException {
| 4 |
cilogi/gaeshiro | src/main/java/com/cilogi/shiro/web/oauth/OAuthLoginServlet.java | [
"@Cache\n@Entity\n//@JsonInclude(JsonInclude.Include.NON_NULL)\npublic class GaeUser implements Serializable {\n static final Logger LOG = Logger.getLogger(GaeUser.class.getName());\n\n static final int HASH_ITERATIONS = 1;\n static final String HASH_ALGORITHM = Sha256Hash.ALGORITHM_NAME;\n\n\n @Id\n ... | import com.cilogi.shiro.gae.GaeUser;
import com.cilogi.shiro.gae.GaeUserDAO;
import com.cilogi.shiro.gae.UserAuthType;
import com.cilogi.shiro.oauth.OAuthAuthenticationToken;
import com.cilogi.shiro.oauth.OAuthInfo;
import com.cilogi.shiro.oauth.provider.FacebookAuth;
import com.cilogi.shiro.oauth.provider.GoogleAuth;
... | // Copyright (c) 2012 Tim Niblett. All Rights Reserved.
//
// File: OAuthLoginServlet.java (05-Oct-2012)
// Author: tim
//
// Copyright in the whole and every part of this source file belongs to
// Tim Niblett (the Author) and may not be used, sold, licenced,
// transferred, copied or reproduced in whole ... | GaeUser user = dao.findUser(email); | 0 |
tfg13/LanXchange | modules/swing/src/main/java/de/tobifleig/lxc/plaf/swing/LXCPanel.java | [
"public class LXC {\n\n /**\n * The internal version id.\n * For automatic updates.\n */\n public static final int versionId = 170;\n /**\n * The external version id.\n */\n public static final String versionString = \"v1.50\";\n /**\n * Logger for core components\n */\n ... | import de.tobifleig.lxc.LXC;
import de.tobifleig.lxc.data.LXCFile;
import de.tobifleig.lxc.data.LXCJob;
import de.tobifleig.lxc.data.VirtualFile;
import de.tobifleig.lxc.data.impl.RealFile;
import de.tobifleig.lxc.log.LXCLogBackend;
import de.tobifleig.lxc.log.LXCLogger;
import de.tobifleig.lxc.plaf.GuiListener;
import... | /*
* Copyright 2009, 2010, 2011, 2012, 2013, 2014 Tobias Fleig (tobifleig gmail com)
*
* All rights reserved.
*
* This file is part of LanXchange.
*
* LanXchange 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 Fo... | private final LXCLogger logger; | 6 |
manolovn/cssdroid | cssdroid/src/main/java/com/manolovn/cssdroid/task/CssDroidGenerator.java | [
"public class CssDroidSyntaxParser {\n\n private final CssDroidLexer lexer;\n\n private StyleSheet styleSheet;\n private LinkedList<Token> tokens;\n private Token lookAhead;\n\n public CssDroidSyntaxParser() {\n this.lexer = new CssDroidLexer();\n }\n\n public StyleSheet parseTokens(Stri... | import com.manolovn.cssdroid.parser.CssDroidSyntaxParser;
import com.manolovn.cssdroid.parser.domain.StyleSheet;
import com.manolovn.cssdroid.translator.StylesheetToXMLTranslator;
import com.manolovn.cssdroid.util.CssDroidFileUtils;
import com.manolovn.cssdroid.util.Preconditions;
import org.apache.commons.io.FileUtils... | package com.manolovn.cssdroid.task;
/**
* Main CSS to android styles generator
*/
class CssDroidGenerator {
private final CssDroidSyntaxParser parser;
private final StylesheetToXMLTranslator translator;
CssDroidGenerator(CssDroidSyntaxParser parser,
StylesheetToXMLTranslator tr... | StyleSheet styleSheet = parser.parseTokens(content); | 1 |
akexorcist/Example-SamsungSDK | KNOXPolicyApp/app/src/main/java/com/akexorcist/knoxpolicyapp/ActivationActivity.java | [
"public interface ActivationCallback {\n void onDeviceAdminActivated();\n\n void onDeviceAdminActivationCancelled();\n\n void onDeviceAdminDeactivated();\n\n void onLicenseActivated();\n\n void onLicenseActivateFailed(int errorType, String errorMessage);\n}",
"public class KnoxActivationManager {\n... | import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import com.afollestad.materialdialogs.DialogAction;
import com.afollestad.materialdialogs.MaterialDialog;
import com.akexorcist.knoxactivator.ActivationCallback;
import co... | package com.akexorcist.knoxpolicyapp;
public class ActivationActivity extends AppCompatActivity {
private final String LICENSE_KEY = "YOUR_ELM_KEY";
private MaterialDialog dialogLoading;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
... | KnoxActivationManager.getInstance().register(activationCallback); | 1 |
dlcs/the-mathmos-server | the-mathmos-server/src/main/java/com/digirati/themathmos/web/controller/OATextSearchController.java | [
"public class AnnotationSearchConstants {\n\n public static final String FIELD_MOTIVATIONS = \"motivations\";\n\n public static final String PARAM_FIELD_MOTIVATION = \"motivation\";\n\n public static final String PARAM_FIELD_DATE = \"date\";\n public static final String PARAM_FIELD_USER = \"user\";\n\n ... | import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import ... | package com.digirati.themathmos.web.controller;
@RestController(OATextSearchController.CONTROLLER_NAME)
public class OATextSearchController {
public static final String CONTROLLER_NAME = "OATextSearchController";
private TextSearchService textSearchService;
private AnnotationAutocompleteService annotationAuto... | Map<String, Object> emptyMap = textUtils.returnEmptyResultSet(queryString, false, new PageParameters(), | 5 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritConnection.java | [
"public class Provider implements GerritJsonDTO {\n\n /**\n * The name of the Gerrit instance.\n */\n private String name;\n /**\n * The host name of the Gerrit instance that provided this event.\n */\n private String host;\n /**\n * The port where the Gerrit instance listens for ... | import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.CharBuffer;
import java.util.Collections;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;
import org.slf4j.Logger;
import org.slf4j.Lo... | /*
* The MIT License
*
* Copyright 2010 Sony Ericsson Mobile Communications. All rights reserved.
* Copyright 2012 Sony Mobile Communications AB. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "... | private AuthenticationUpdater authenticationUpdater = null; | 2 |
irq0/jext2 | src/fusejext2/tasks/Opendir.java | [
"public class Constants {\n\t// Special inode numbers\n\tpublic static final int\tEXT2_BAD_INO = 1; /* Bad blocks inode */\n\tpublic static final int EXT2_ROOT_INO = 2; /* Root inode */\n\tpublic static final int EXT2_BOOT_LOADER_INO = 5; /* Boot loader inode */\n\tpublic static final int EXT2_UNDEL_... | import jext2.Constants;
import jext2.Inode;
import jext2.exceptions.JExt2Exception;
import jext2.exceptions.NotADirectory;
import jlowfuse.FuseReq;
import jlowfuse.Reply;
import fuse.FileInfo;
import fusejext2.Jext2Context; | /*
* Copyright (c) 2011 Marcel Lauhoff.
*
* This file is part of jext2.
*
* jext2 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 vers... | if (ino == 1) ino = Constants.EXT2_ROOT_INO; | 0 |
heremaps/here-aaa-java-sdk | here-oauth-client/src/test/java/com/here/account/auth/provider/ClientAuthorizationProviderChainTest.java | [
"public class OAuth1ClientCredentialsProvider implements ClientCredentialsProvider {\n\n private final Clock clock;\n private final String tokenEndpointUrl;\n private final OAuth1Signer oauth1Signer;\n private final String scope;\n \n /**\n * Construct a new {@code OAuth1ClientCredentialsProvi... | import com.here.account.auth.OAuth1ClientCredentialsProvider;
import com.here.account.http.HttpConstants;
import com.here.account.http.HttpProvider;
import com.here.account.oauth2.ClientAuthorizationRequestProvider;
import com.here.account.oauth2.ClientCredentialsGrantRequest;
import org.junit.After;
import org.junit.T... | tokenEndpointUrl = System.getProperty(OAuth1ClientCredentialsProvider.FromProperties.TOKEN_ENDPOINT_URL_PROPERTY);
accessKeyId = System.getProperty(OAuth1ClientCredentialsProvider.FromProperties.ACCESS_KEY_ID_PROPERTY);
accessKeySecret = System.getProperty(OAuth1ClientCredentialsProvider.FromPro... | assertTrue("grantType should equal " + ClientCredentialsGrantRequest.CLIENT_CREDENTIALS_GRANT_TYPE, | 4 |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPTransport.java | [
"public interface AMQPConsumerCallback {\n ActionResponse handle(AMQPMessageBundle messageBundle);\n void notifyOfActionFailure(Exception e);\n void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);\n}",
"public class AMQPMessageBundle implements TransportMessageBundle {\n private Str... | import com.rabbitmq.client.AlreadyClosedException;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.MetricsCollector;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBund... | getChannel(),
(AMQPConsumerCallback) callback,
commonListenProperties.getThreshold(),
poisonPrefix,
commonListenProperties.isPoisonQueueEnabled()
);
}
@Override
protected AMQPCommonListenProperties getCommonListenProper... | protected boolean publishImpl(TransportMessageBundle bundle, TransportPublishProperties properties) | 6 |
docbleach/DocBleach | module/module-office/src/main/java/xyz/docbleach/module/ole2/MacroRemover.java | [
"public class BleachSession implements Serializable {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(BleachSession.class);\n private static final int MAX_ONGOING_TASKS = 10;\n private final transient Bleach bleach;\n private final Collection<Threat> threats = new ArrayList<>();\n /**\n * Co... | import java.util.Set;
import org.apache.poi.poifs.filesystem.DirectoryEntry;
import org.apache.poi.poifs.filesystem.DocumentEntry;
import org.apache.poi.poifs.filesystem.Entry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import xyz.docbleach.api.BleachSession;
import xyz.docbleach.api.threat.Threat;
import... | package xyz.docbleach.module.ole2;
public class MacroRemover extends EntryFilter {
private static final Logger LOGGER = LoggerFactory.getLogger(MacroRemover.class);
private static final String VBA_ENTRY = "VBA";
private static final String MACRO_ENTRY = "Macros";
public MacroRemover(BleachSession session) {... | .action(ThreatAction.REMOVE) | 2 |
fhussonnois/kafkastreams-cep | streams/src/test/java/com/github/fhuss/kafka/streams/cep/state/internal/SharedVersionedBufferStoreImplTest.java | [
"public class Event<K, V> implements Comparable<Event<K, V>> {\r\n\r\n private final K key;\r\n\r\n private final V value;\r\n\r\n private final long timestamp;\r\n\r\n private final String topic;\r\n\r\n private final int partition;\r\n\r\n private long offset;\r\n\r\n /**\r\n * Creates a ... | import static org.junit.Assert.assertNotNull;
import com.github.fhuss.kafka.streams.cep.core.Event;
import com.github.fhuss.kafka.streams.cep.core.Sequence;
import com.github.fhuss.kafka.streams.cep.core.nfa.DeweyVersion;
import com.github.fhuss.kafka.streams.cep.core.nfa.Stage;
import com.github.fhuss.kafka.streams.ce... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may n... | private SharedVersionedBufferStore<String, String> buffer = this.getInMemorySharedBuffer(Serdes.String(), Serdes.String()); | 4 |
takezoe/xlsbeans | src/main/java/com/github/takezoe/xlsbeans/XLSBeans.java | [
"public interface FieldProcessor {\r\n\r\n public void doProcess(WSheet wSheet, Object obj, Method setter, Annotation ann, AnnotationReader reader,\r\n XLSBeansConfig config, List<NeedPostProcess> needPostProcess) throws Exception;\r\n\r\n public void doProcess(WSheet wSheet, Object obj, Fi... | import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import com.... | package com.github.takezoe.xlsbeans;
/**
* This is the entry point of XLSBeans.
*
* @author Naoki Takezoe
*/
public class XLSBeans {
private XLSBeansConfig config = new XLSBeansConfig();
/**
* Constructor.
*/
public XLSBeans() {
super();
}
public void setConfig(XLSBeans... | FieldProcessor processor = FieldProcessorFactory.getProcessor(ann);
| 0 |
urandom/gearshift | gearshift/src/main/java/org/sugr/gearshift/ui/TorrentListMenuFragment.java | [
"public final class G {\n public static final String PREF_DEBUG = \"debug\";\n\n public static final String PREF_SHOW_STATUS = \"show_status\";\n public static final String PREF_SHOW_ADD_DIALOG = \"show_add_dialog\";\n public static final String PREF_DELETE_DATA = \"delete_data\";\n public static fin... | import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.database.Cursor;
import android.graphics.drawa... | package org.sugr.gearshift.ui;
public class TorrentListMenuFragment extends Fragment
implements TorrentListNotificationInterface, TransmissionProfileListNotificationInterface {
private RecyclerView filterList;
private FilterAdapter filterAdapter;
private enum Type {
PROFILE_SELECTOR, PROFI... | private TreeSet<String> directories = new TreeSet<>(G.SIMPLE_STRING_COMPARATOR); | 0 |
timothyb89/lifx-java | src/main/java/org/timothyb89/lifx/net/packet/response/MeshFirmwareResponse.java | [
"public abstract class Field<T> {\n\t\n\t@Getter\n\tprotected final int length;\n\n\t/**\n\t * Creates a new Field instance using the default length.\n\t */\n\tpublic Field() {\n\t\tlength = defaultLength();\n\t}\n\t\n\t/**\n\t * Creates a new Field instance using the specified length.\n\t * @param length the field... | import java.nio.ByteBuffer;
import lombok.Getter;
import lombok.ToString;
import org.timothyb89.lifx.net.field.Field;
import org.timothyb89.lifx.net.field.LittleField;
import org.timothyb89.lifx.net.field.StringField;
import org.timothyb89.lifx.net.field.UInt32Field;
import org.timothyb89.lifx.net.field.UInt8Field;
imp... | package org.timothyb89.lifx.net.packet.response;
/**
*
* @author tim
*/
@ToString(callSuper = true)
public class MeshFirmwareResponse extends Packet {
public static final int TYPE = 0x0F;
| public static final Field<Integer> FIELD_BUILD_SECOND = new UInt8Field(); | 4 |
sing-group/bicycle | src/test/java/es/cnio/bioinfo/bicycle/test/NonDirectionalPairedEndAnalysisTest.java | [
"public class Project {\n\n\tprivate static final Logger logger = Logger.getLogger(Project.class.getSimpleName());\n\n\tpublic static final String WORKING_DIRECTORY = \"workingDirectory\" + File.separator;\n\tpublic static final String OUTPUT_DIRECTORY = \"output\" + File.separator;\n\tpublic static final String CO... | import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;... | /*
Copyright 2012 Daniel Gonzalez Peña, Osvaldo Graña
This file is part of the bicycle Project.
bicycle Project is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... | for (Reference ref : p.getReferences()) { | 1 |
hitherejoe/AndroidTvBoilerplate | app/src/androidTest/java/com/hitherejoe/androidtvboilerplate/ContentActivityTest.java | [
"public class Cat {\n public String name;\n public String description;\n public String imageUrl;\n\n public Cat() {\n\n }\n\n public Cat(String name, String description, String imageUrl) {\n this.name = name;\n this.description = description;\n this.imageUrl = imageUrl;\n }... | import android.support.test.InstrumentationRegistry;
import android.support.test.espresso.contrib.RecyclerViewActions;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import com.hitherejoe.androidtvboilerplate.data.model.Cat;
import com.hitherejoe.androidtvboilerplat... | package com.hitherejoe.androidtvboilerplate;
@RunWith(AndroidJUnit4.class)
public class ContentActivityTest {
| public final TestComponentRule component = | 2 |
MizzleDK/Mizuu | app/src/main/java/com/miz/loader/MovieLoader.java | [
"public class DbAdapterMovieMappings extends AbstractDbAdapter {\n\n\tpublic static final String KEY_FILEPATH = \"filepath\";\n\tpublic static final String KEY_TMDB_ID = \"tmdbid\";\n\tpublic static final String KEY_IGNORED = \"ignored\";\n\n\tpublic static final String DATABASE_TABLE = \"moviemap\";\n\n\tpublic st... | import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import com.google.common.collect.Arra... | /*
* Copyright (C) 2014 Michell Bak
*
* 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 agree... | mDatabase = MizuuApplication.getMovieAdapter(); | 4 |
mvescovo/item-reaper | app/src/testMock/java/com/michaelvescovo/android/itemreaper/data/RepositoryTest.java | [
"final static List<Item> ITEMS = Lists.newArrayList();",
"public final static Item ITEM_1 = new Item(\"1\",\n 1453554000000L, // purchase: 24/01/2016\n 2000,\n 0,\n 1485176400000L, // expiry: 24/01/2017\n \"Clothing\", \"Casual\", \"T-shirt\",\n \"Short sleeve\", \"V-neck... | import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import java.util.ArrayList;
import java.util.List;
import static com.michaelvescovo.android.itemreaper.data.FakeDataSource.ITEMS;
import static co... | package com.michaelvescovo.android.itemreaper.data;
/**
* @author Michael Vescovo
*/
public class RepositoryTest {
private Repository mRepository;
@Mock
private DataSource mRemoteDataSource;
@Mock
private DataSource.GetItemsCallback mGetItemsCallback;
@Captor
private ArgumentCaptor<... | mRepository.getItem(ITEM_1.getId(), USER_ID, ITEM_DETAILS_CALLER, mGetItemCallback); | 1 |
jachness/blockcalls | app/src/androidTest/java/com/jachness/blockcalls/services/BlackListCheckerTest.java | [
"public abstract class AndroidTest {\n private Context targetContext;\n private AllComponentTest component;\n private AppPreferences appPreferences;\n private Context context;\n\n protected void setUp() throws Exception {\n targetContext = InstrumentationRegistry.getTargetContext();\n c... | import android.content.ContentValues;
import android.net.Uri;
import android.support.test.filters.SmallTest;
import android.support.test.runner.AndroidJUnit4;
import android.util.Log;
import com.jachness.blockcalls.AndroidTest;
import com.jachness.blockcalls.db.BlackListTable;
import com.jachness.blockcalls.db.dao.Blac... | package com.jachness.blockcalls.services;
@RunWith(AndroidJUnit4.class)
//@RunWith(MockitoJUnitRunner.class)
@SmallTest
public class BlackListCheckerTest extends AndroidTest {
private static final String TAG = BlackListCheckerTest.class.getSimpleName();
@Inject
BlackListChecker checker;
@Inject
| BlackListDAO blackListDAO; | 2 |
games647/FlexibleLogin | src/main/java/com/github/games647/flexiblelogin/config/Settings.java | [
"@SuppressWarnings(\"FieldMayBeFinal\")\npublic class General {\n\n @Setting(comment = \"FlexibleDatabase configuration\")\n private SQLConfig sqlConfiguration = new SQLConfig();\n\n @Setting(comment = \"Email configuration for password recovery\")\n private MailConfig emailConfiguration = new MailConfi... | import com.github.games647.flexiblelogin.config.node.General;
import com.github.games647.flexiblelogin.config.node.General.HashingAlgorithm;
import com.github.games647.flexiblelogin.config.node.SQLConfig.StorageType;
import com.github.games647.flexiblelogin.config.node.TextConfig;
import com.github.games647.flexiblelog... | /*
* This file is part of FlexibleLogin
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2018 contributors
*
* 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, incl... | serializers.registerType(TypeToken.of(HashingAlgorithm.class), enumSerializer); | 1 |
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... | List<Proxy> proxies = SkinIO.loadProxies(); | 1 |
karthicks/gremlin-ogm | gremlin-objects/src/test/java/org/apache/tinkerpop/gremlin/object/structure/ElementTest.java | [
"@Data\n@Builder\n@NoArgsConstructor\n@AllArgsConstructor\n@Alias(label = \"location\")\n@Accessors(fluent = true, chain = true)\n@EqualsAndHashCode(of = {}, callSuper = true)\npublic class Location extends Element {\n\n @OrderingKey\n @PropertyValue\n private String name;\n @OrderingKey\n private Instant star... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.apache.tinkerpop.gremlin.object.vertices.Locat... | /*
* 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... | ElementTo<Object> counter = compose( | 6 |
indvd00m/java-ascii-render | ascii-render/src/main/java/com/indvd00m/ascii/render/elements/plot/AxisLabels.java | [
"public class Point implements IPoint {\n\n\tprotected int x;\n\tprotected int y;\n\n\tpublic Point(int x, int y) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\t@Override\n\tpublic int getX() {\n\t\treturn x;\n\t}\n\n\t@Override\n\tpublic int getY() {\n\t\treturn y;\n\t}\n\n\t@Override\n\tpublic int ha... | import com.indvd00m.ascii.render.Point;
import com.indvd00m.ascii.render.api.ICanvas;
import com.indvd00m.ascii.render.api.IContext;
import com.indvd00m.ascii.render.api.IPoint;
import com.indvd00m.ascii.render.api.IRegion;
import com.indvd00m.ascii.render.elements.plot.api.AxisType;
import com.indvd00m.ascii.render.el... | package com.indvd00m.ascii.render.elements.plot;
/**
* Labels for {@link Axis}.
*
* @author indvd00m (gotoindvdum[at]gmail[dot]com)
* @since 1.0.0
*/
public class AxisLabels extends AbstractPlotObject<AxisLabels> {
protected int countX = 5;
protected int countY = 5;
protected List<AxisLabel> labels = new Ar... | public AxisLabels(List<IPlotPoint> points, IRegion region) { | 6 |
cernekee/ics-openconnect | app/src/main/java/com/stericson/RootTools/RootTools.java | [
"public class Mount {\n final File mDevice;\n final File mMountPoint;\n final String mType;\n final Set<String> mFlags;\n\n public Mount(File device, File path, String type, String flagsStr) {\n mDevice = device;\n mMountPoint = path;\n mType = type;\n mFlags = new LinkedH... | import android.content.Intent;
import android.util.Log;
import com.stericson.RootTools.containers.Mount;
import com.stericson.RootTools.containers.Permissions;
import com.stericson.RootTools.containers.Symlink;
import com.stericson.RootTools.exceptions.RootDeniedException;
import com.stericson.RootTools.execution.Comma... | /*
* This file is part of the RootTools Project: http://code.google.com/p/roottools/
*
* Copyright (c) 2012 Stephen Erickson, Chris Ravenscroft, Dominik Schuermann, Adam Shanks
*
* This code is dual-licensed under the terms of the Apache License Version 2.0 and
* the terms of the General Public License (GPL)... | public static Permissions getFilePermissionsSymlinks(String file) { | 1 |
adityayadav76/internet_of_things_simulator | AutoSIM-Automatski/src/com/automatski/autosim/automatski/SampleStreamerConnection.java | [
"public class AutoSIMConnectionConfig {\n\n\tpublic String name;\n\tpublic String host;\n\tpublic int port;\n\tpublic String username;\n\tpublic String password;\n\t\n\tpublic String connectorClassName;\n}",
"public interface IConnection {\n\n\tpublic void setConfig(Object object);\n\t\n\t\n\tpublic void connect(... | import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import com.automatski.autosim.automatski.config.AutoSIMConnectionConfig;
import com.automatski.autosim.environments.IConnection;
impo... | /*
* AutoSIM - Internet of Things Simulator
* Copyright (C) 2014, Aditya Yadav <aditya@automatski.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 Licens... | Tuple tuple = (Tuple) arg0; | 4 |
guillaume-alvarez/ShapeOfThingsThatWere | core/src/com/galvarez/ttw/rendering/DiplomacyRenderSystem.java | [
"public enum State {\n NONE, WAR, TREATY, PROTECTORATE, TRIBUTE;\n}",
"public final class Diplomacy extends Component {\n\n public final Map<Entity, State> relations = new HashMap<>();\n\n public final ObjectIntMap<Entity> lastChange = new ObjectIntMap<>();\n\n public final Map<Entity, Action> proposals = new... | import static com.badlogic.gdx.graphics.g2d.Batch.C1;
import static com.badlogic.gdx.graphics.g2d.Batch.C2;
import static com.badlogic.gdx.graphics.g2d.Batch.C3;
import static com.badlogic.gdx.graphics.g2d.Batch.C4;
import static com.badlogic.gdx.graphics.g2d.Batch.U1;
import static com.badlogic.gdx.graphics.g2d.Batch.... | package com.galvarez.ttw.rendering;
/**
* Displays arrows from vassals to overlords.
*
* @author Guillaume Alvarez
*/
@Wire
public final class DiplomacyRenderSystem extends AbstractRendererSystem {
/** Arrow height in pixels at standard zoom. */
private static final int ARROW_HEIGHT = 4;
/** Do not mas... | if (r1.getRelationWith(e2) == State.TRIBUTE) | 0 |
chedim/minedriod | src/main/java/com/onkiup/minedroid/gui/views/CheckBox.java | [
"public interface Context {\n /**\n * @return Context id\n */\n int contextId();\n\n}",
"@SideOnly(Side.CLIENT)\npublic class GuiManager {\n /**\n * Current MineDroid theme\n */\n public static HashMap<Integer, Style> themes = new HashMap<Integer, Style>();\n\n /**\n * Minecraft... | import com.onkiup.minedroid.Context;
import com.onkiup.minedroid.gui.GuiManager;
import com.onkiup.minedroid.gui.XmlHelper;
import com.onkiup.minedroid.gui.drawables.Drawable;
import com.onkiup.minedroid.gui.drawables.TextDrawable;
import com.onkiup.minedroid.gui.events.Event;
import com.onkiup.minedroid.gui.events.Mou... | package com.onkiup.minedroid.gui.views;
/**
* Created by chedim on 5/31/15.
*/
public class CheckBox extends ContentView {
protected Drawable check;
protected boolean value; | protected TextDrawable label; | 4 |
Slyce-Inc/SlyceMessaging | slyce-messaging/src/main/java/it/slyce/messaging/message/messageItem/master/text/MessageTextItem.java | [
"public enum MessageSource {\n LOCAL_USER,\n EXTERNAL_USER,\n GENERAL\n}",
"public class TextMessage extends Message {\n private String text;\n\n public String getText() {\n return text;\n }\n\n public void setText(String text) {\n this.text = text;\n }\n\n @Override\n ... | import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Vibrator;
import android.text.TextUtils;
import android.view.View;
import android.widget.Toast;
import com.bumptech.glide.Glide;
import it.slyce.messaging.R;
import it.slyce.messaging.message.Mess... | package it.slyce.messaging.message.messageItem.master.text;
/**
* Created by matthewpage on 6/27/16.
*/
public class MessageTextItem extends MessageItem {
private Context context;
private String avatarUrl;
public MessageTextItem(TextMessage textMessage, Context context) {
super(textMessage);
... | if (message.getSource() == MessageSource.EXTERNAL_USER) { | 0 |
jenetics/prngine | prngine/src/main/java/module-info.java | [
"public class KISS32Random extends Random32 implements SplittableRandom {\n\n\t/**\n\t * The internal state of random engine.\n\t *\n\t * @author <a href=\"mailto:franz.wilhelmstoetter@gmail.com\">Franz Wilhelmstötter</a>\n\t * @since 1.0\n\t * @version 2.0.0\n\t */\n\tprivate static final class State {\n\t\tprivat... | import java.util.random.RandomGenerator;
import io.jenetics.prngine.KISS32Random;
import io.jenetics.prngine.KISS64Random;
import io.jenetics.prngine.LCG64ShiftRandom;
import io.jenetics.prngine.MT19937_32Random;
import io.jenetics.prngine.MT19937_64Random;
import io.jenetics.prngine.XOR32ShiftRandom;
import io.jenetic... | /*
* PRNGine - Java PRNG Library (@__identifier__@).
* Copyright (c) @__year__@ Franz Wilhelmstötter
*
* 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/lic... | LCG64ShiftRandom, | 2 |
Lambda-3/DiscourseSimplification | src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/rules/ReferenceInitialConjunctionExtractor.java | [
"public enum Relation {\n\n UNKNOWN,\n\n // Coordinations\n UNKNOWN_COORDINATION, // the default for coordination\n CONTRAST,\n CAUSE_C,\n RESULT_C,\n LIST,\n DISJUNCTION,\n TEMPORAL_AFTER_C,\n TEMPORAL_BEFORE_C,\n\n // Subordinations\n UNKNOWN_SUBORDINATION, // the default for s... | import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeExtractionUtils;
import org.lambda3.text.simplification.discourse.utils.words.WordsUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import edu.stanford.nlp.ling.Word;
import edu.stanfor... | /*
* ==========================License-Start=============================
* DiscourseSimplification : ReferenceExtractor0
*
* Copyright © 2017 Lambda³
*
* GNU General Public License 3
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as... | Leaf rightConstituent = new Leaf(getClass().getSimpleName(), WordsUtils.wordsToProperSentenceString(words)); | 6 |
monster860/FastDMM | src/main/java/com/github/monster860/fastdmm/editing/placement/DefaultPlacementMode.java | [
"public class FastDMM extends JFrame implements ActionListener, TreeSelectionListener, ListSelectionListener {\n\tprivate static final long serialVersionUID = 1L;\n\tpublic File dme;\n\tpublic DMM dmm;\n\tpublic List<DMM> loadedMaps = new ArrayList<DMM>();\n\tpublic Map<String, ModifiedType> modifiedTypes = new Has... | import java.util.Set;
import javax.swing.JPopupMenu;
import com.github.monster860.fastdmm.FastDMM;
import com.github.monster860.fastdmm.dmirender.RenderInstance;
import com.github.monster860.fastdmm.dmmmap.Location;
import com.github.monster860.fastdmm.dmmmap.TileInstance;
import com.github.monster860.fastdmm.objtree.O... | package com.github.monster860.fastdmm.editing.placement;
public class DefaultPlacementMode implements PlacementMode {
@Override
public PlacementHandler getPlacementHandler(FastDMM editor, ObjInstance instance, Location initialLocation) {
if(instance == null)
return null;
if(editor.isCtrlPressed)
ret... | public void addToTileMenu(FastDMM editor, Location mapLocation, TileInstance instance, JPopupMenu menu) { | 3 |
heremaps/here-aaa-java-sdk | here-oauth-client/src/main/java/com/here/account/auth/provider/FromProperties.java | [
"public class OAuth1ClientCredentialsProvider implements ClientCredentialsProvider {\n\n private final Clock clock;\n private final String tokenEndpointUrl;\n private final OAuth1Signer oauth1Signer;\n private final String scope;\n \n /**\n * Construct a new {@code OAuth1ClientCredentialsProvi... | import com.here.account.auth.OAuth1ClientCredentialsProvider;
import com.here.account.http.HttpConstants;
import com.here.account.http.HttpProvider;
import com.here.account.oauth2.ClientAuthorizationRequestProvider;
import com.here.account.oauth2.ClientCredentialsProvider;
import com.here.account.util.Clock;
import jav... | /*
* Copyright (c) 2018 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | public FromProperties(Clock clock, String tokenEndpointUrl, String accessKeyId, String accessKeySecret) { | 5 |
BFergerson/Chronetic | src/test/java/io/chronetic/data/describe/ChronoDescriptorTest.java | [
"public class ChronoSeries {\n\n private final static Logger logger = LoggerFactory.getLogger(ChronoSeries.class);\n\n private final Cache<ChronoRange, Integer> cachePatternCount = CacheBuilder.newBuilder()\n .expireAfterAccess(5, TimeUnit.MINUTES)\n .build();\n private final Cache<In... | import static org.junit.Assert.*;
import io.chronetic.data.ChronoSeries;
import io.chronetic.data.measure.ChronoScaleUnit;
import io.chronetic.evolution.pool.ChronoGene;
import io.chronetic.evolution.pool.Chronosome;
import io.chronetic.evolution.pool.Chronotype;
import io.chronetic.evolution.pool.allele.ChronoAllele;
... | package io.chronetic.data.describe;
public class ChronoDescriptorTest {
@Test
public void chronoDescriptorTest1() {
ChronoSeries chronoSeries = testChronoSeries();
ISeq<ChronoAllele> alleleSeq = ISeq.of(
new ChronoFrequency(ChronoUnit.YEARS, 0, 1, 1, Instant.now()),
... | ISeq<ChronoGene> geneSeq = ISeq.of(alleleSeq.map(ChronoGene::new)); | 2 |
Azure/azure-storage-android | microsoft-azure-storage-test/src/com/microsoft/azure/storage/GenericTests.java | [
"public interface CloudTests {\n}",
"public interface DevFabricTests {\n}",
"public interface DevStoreTests {\n}",
"public final class CloudBlobContainer {\n\n /**\n * Converts the ACL string to a BlobContainerPermissions object.\n * \n * @param aclString\n * A <code>String</code... | import com.microsoft.azure.storage.TestRunners.CloudTests;
import com.microsoft.azure.storage.TestRunners.DevFabricTests;
import com.microsoft.azure.storage.TestRunners.DevStoreTests;
import com.microsoft.azure.storage.blob.BlobOutputStream;
import com.microsoft.azure.storage.blob.BlobRequestOptions;
import com.microso... | /**
* Copyright Microsoft Corporation
* <p/>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or a... | CloudBlobContainer container = blobClient.getContainerReference(generateRandomContainerName()); | 3 |
johndavidbustard/RoughWorld | src/ai/knowledge_representation/state_instance/ObjectLanguageInstance.java | [
"public class StateToXML \n{\n\tpublic static void objectToXMLFile(ObjectLanguageInstance o)\n\t{\n\t\tString concept = o.uniqueID;\n\t\tint ind = concept.indexOf(\"/\");\n\t\tString instance = concept.substring(ind+1);\n\t\tconcept = concept.substring(0,ind);\n\n\t\tString instancepath = \"Concepts/\"+concept+\"/i... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlRootElement;
import tools.visualisation.state_visualisation.ToXML.StateT... | package ai.knowledge_representation.state_instance;
//Most things are objects
//This class is intentionally as simple as possible so that it can be serialised to an from a database efficiently
//The assumption is that only part of an instance will be loaded at any one time
//References to other objects/rooms etc. t... | int ind = GeneralMatrixString.find(o.within, uniqueID); | 4 |
punkbrwstr/pinto | src/test/java/tech/pinto/tests/DateTester.java | [
"public class BusinessDay extends Period<BusinessDay> {\n\t\n\tstatic final LocalDate EPOCH = LocalDate.of(1970, 1, 1);\n\t\n\tBusinessDay(long value) {\n\t\tsuper(value);\n\t}\n\n\tBusinessDay(LocalDate day) {\n\t\tthis(distance(EPOCH,day));\n\t}\n\n\t@Override\n\tpublic LocalDate endDate() {\n\t\treturn offset(EP... | import java.time.LocalDate;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import tech.pinto.time.BusinessDay;
import tech.pinto.time.BusinessMonth;
import tech.pinto.time.BusinessQuarter;
import tech.pinto.time.WeekEndingFriday;
import tech.pinto.time.WeekEndingMonday;
... | package tech.pinto.tests;
public class DateTester {
private final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(this.getClass());
@Rule
public ExpectedException thrown = ExpectedException.none();
private LocalDate d(String s) {
return LocalDate.parse(s);
}
/**
*
... | Periodicity<BusinessQuarter> p = Periodicities.get("BQ-DEC");
| 2 |
horrorho/LiquidDonkey | src/main/java/com/github/horrorho/liquiddonkey/cloud/client/SnapshotClient.java | [
"static String path(String... parts) {\n return Arrays.asList(parts).stream().collect(Collectors.joining(\"/\"));\n}",
"public final class ICloud {\n private ICloud() {}\n public static void registerAllExtensions(\n com.google.protobuf.ExtensionRegistry registry) {\n }\n public interface MBSAccountOrB... | import static com.github.horrorho.liquiddonkey.cloud.client.Util.path;
import com.github.horrorho.liquiddonkey.cloud.protobuf.ICloud;
import com.github.horrorho.liquiddonkey.cloud.protobuf.ProtoBufArray;
import com.github.horrorho.liquiddonkey.http.ResponseHandlerFactory;
import com.github.horrorho.liquiddonkey.setting... | /*
* The MIT License
*
* Copyright 2015 Ahseya.
*
* Permission is hereby granted, free from charge, to any person obtaining a copy
* from this software and associated documentation list (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modif... | = ResponseHandlerFactory.of(inputStream -> ProtoBufArray.decode(inputStream, ICloud.MBSFile.PARSER)); | 2 |
unchartedsoftware/ensemble-clustering | ensemble-clustering/src/test/java/com/oculusinfo/ml/unsupervised/TestStringClusteringWithDPMeans.java | [
"public class DataSet implements Serializable, Iterable<Instance> {\r\n\tprivate static final long serialVersionUID = -544003860939601075L;\r\n\t\r\n\tprivate final Map<String, Instance> map = new LinkedHashMap<String, Instance>();\r\n\r\n\tprivate class DataSetIterator implements Iterator<Instance> {\r\n\t\tIterat... | import com.oculusinfo.ml.unsupervised.cluster.Cluster;
import com.oculusinfo.ml.unsupervised.cluster.ClusterResult;
import com.oculusinfo.ml.unsupervised.cluster.dpmeans.DPMeans;
import com.oculusinfo.ml.DataSet;
import com.oculusinfo.ml.Instance;
import com.oculusinfo.ml.feature.string.StringFeature;
import com.oculus... | /**
* Copyright (c) 2013 Oculus Info Inc.
* http://www.oculusinfo.com/
*
* Released under the MIT License.
*
* 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, inclu... | DPMeans clusterer = new DPMeans(5, false); | 5 |
devalexx/evilrain | Main/src/com/alex/rain/screens/BasicUIScreen.java | [
"public class RainGame extends Game {\n Stage stage;\n static RainGame instance = new RainGame();\n static float time;\n public static PolygonSpriteBatch polyBatch;\n public static ShapeRenderer shapeRenderer;\n public final static String VERSION = \"0.2.0\";\n\n private RainGame() {\n }\n\n... | import com.alex.rain.RainGame;
import com.alex.rain.managers.ResourceManager;
import com.alex.rain.managers.TextureManager;
import com.alex.rain.stages.BasicStage;
import com.alex.rain.viewports.GameViewport;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.Texture;
import c... | /*******************************************************************************
* Copyright 2013 See AUTHORS file.
*
* Licensed under the GNU GENERAL PUBLIC LICENSE V3
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.gnu.org/licenses/gpl.html
... | protected Texture backgroundTexture = TextureManager.getTexture("background.png"); | 2 |
junjunguo/PocketMaps | PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/activities/GeocodeActivity.java | [
"public class MessageDialog\n{\n public static void showMsg(Activity activity, String prefName, int msgId, boolean dontShowAgain)\n {\n SharedPreferences settings = activity.getSharedPreferences(\"DontShowAgain\", 0);\n Boolean skipMessage = settings.getBoolean(prefName, false);\n if (skipMessage.equals(... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.Map.Entry;
import java.util.Properties;
import org.oscim.core.GeoPoint;
import com.junjunguo.pocketmaps.R;
import... | else { return locations[2]; }
}
private String getTxtFromSpinner(Spinner sp)
{
if (sp.getSelectedItem().toString().equals(SEL_FROM)) { return locNames[0]; }
else if (sp.getSelectedItem().toString().equals(SEL_TO)) { return locNames[1]; }
else { return "GPS"; }
}
/** Fill the text of preA... | GeocoderGlobal.stopRunningActions(); | 3 |
handexing/vipsnacks | snacks_backend_web/src/main/java/com/snacks/menu/controller/MenuController.java | [
"@Entity\r\n@Table(name = \"ADMIN\")\r\npublic class Admin {\r\n\t\r\n\t@Id\r\n\t@GeneratedValue(strategy = GenerationType.AUTO)\r\n\t@Column(name = \"ID\")\r\n\tprivate Long id;\r\n\t@Column(name = \"NAME\")\r\n\tprivate String name;\r\n\t@Column(name = \"NICK\")\r\n\tprivate String nick;\r\n\t@Column(name = \"PSW... | import com.snacks.admin.entity.Admin;
import com.snacks.common.model.ErrorCode;
import com.snacks.common.model.ExecuteResult;
import com.snacks.menu.dao.MenuDao;
import com.snacks.menu.entity.Menu;
import com.snacks.menu.service.MenuService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sp... | package com.snacks.menu.controller;
@RestController
@RequestMapping("menu")
public class MenuController {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
MenuDao menuDao;
@Autowired
MenuService menuService;
@RequestMapping("delMenu")
public ExecuteResult<... | public ExecuteResult<List<Menu>> menuList(HttpSession session) {
| 4 |
klakegg/pkix-ocsp | src/test/java/net/klakegg/pkix/ocsp/issuer/PeppolTestMultiOcspTest.java | [
"public enum CertificateStatus {\n\n /**\n * The certificate is valid.\n */\n GOOD,\n\n /**\n * The certificate is temporarily or permanently revoked.\n */\n REVOKED,\n\n /**\n * Status of certificate is unknown.\n */\n UNKNOWN\n\n}",
"public class OcspException extends E... | import net.klakegg.pkix.ocsp.CertificateStatus;
import net.klakegg.pkix.ocsp.OcspException;
import net.klakegg.pkix.ocsp.OcspMultiClient;
import net.klakegg.pkix.ocsp.OcspResult;
import net.klakegg.pkix.ocsp.util.CertificateHelper;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.security.cert.... | package net.klakegg.pkix.ocsp.issuer;
/**
* @author erlend
*/
public class PeppolTestMultiOcspTest {
private X509Certificate subjectExpired =
CertificateHelper.parse(getClass().getResourceAsStream("/peppol-ap-test/certificate-expired.cer"));
private X509Certificate subjectValid =
... | OcspMultiClient ocspMultiClient = OcspMultiClient.builder() | 2 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/bolt/jdbc/CamelJdbcStoreBolt.java | [
"public abstract class AmConfigurationBolt extends BaseRichBolt\n{\n /** serialVersionUID */\n private static final long serialVersionUID = 103046340453102132L;\n\n /** StormConfig */\n @SuppressWarnings(\"rawtypes\")\n private Map stormConf;\n\n /** TopologyContext */\n private T... | import com.google.common.collect.Lists;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.camel.ProducerTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import acromusashi.stream.bolt.AmConfigurationBolt;
import acromus... | /**
* Copyright (c) Acroquest Technology Co, Ltd. All Rights Reserved.
* Please read the associated COPYRIGHTS file for more details.
*
* THE SOFTWARE IS PROVIDED BY Acroquest Technolog Co., Ltd.,
* WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,... | throw new InitFailException(ex);
| 5 |
zhihu/Matisse | matisse/src/main/java/com/zhihu/matisse/internal/ui/AlbumPreviewActivity.java | [
"public class Album implements Parcelable {\n public static final Creator<Album> CREATOR = new Creator<Album>() {\n @Nullable\n @Override\n public Album createFromParcel(Parcel source) {\n return new Album(source);\n }\n\n @Override\n public Album[] newArray(i... | import android.database.Cursor;
import android.os.Bundle;
import androidx.annotation.Nullable;
import com.zhihu.matisse.internal.entity.Album;
import com.zhihu.matisse.internal.entity.Item;
import com.zhihu.matisse.internal.entity.SelectionSpec;
import com.zhihu.matisse.internal.model.AlbumMediaCollection;
import com.z... | /*
* Copyright 2017 Zhihu 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 ... | PreviewPagerAdapter adapter = (PreviewPagerAdapter) mPager.getAdapter(); | 4 |
Alex1304/ultimategdbot | app/src/main/java/ultimategdbot/command/SetLanguageCommand.java | [
"public final class Strings {\n\n public static final String GENERAL = \"GeneralStrings\";\n public static final String GD = \"GDStrings\";\n\n private Strings() {\n throw new AssertionError();\n }\n}",
"@RdiService\npublic class UGDBEventProcessor implements InteractionEventProcessor {\n\n ... | import botrino.api.config.ConfigContainer;
import botrino.api.config.object.I18nConfig;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.context.ChatInputInteractionContext;
import botrino.interaction.listener.ChatInputInteractionListener;
import botrino.interaction.privilege.Privilege... | package ultimategdbot.command;
@RdiService
@ChatInputCommand(name = "set-language", description = "Configure the language of the bot for this server.")
public class SetLanguageCommand implements ChatInputInteractionListener {
| private final PrivilegeFactory privilegeFactory; | 3 |
lizardoluis/omtg-designer | src/com/omtg2sql/sql/postgis/PostgisGenerator.java | [
"public class OMTGAttribute implements Cloneable {\r\n\r\n\tprivate String name, type, length, scale, defaultt, size;\r\n\tprivate boolean isKey, isNotNull;\r\n\tprivate List<String> domain;\r\n\r\n\tpublic OMTGAttribute(String name, String type) {\r\n\t\tthis.name = name;\r\n\t\tthis.type = type;\r\n\t\tthis.isKey... | import java.io.IOException;
import java.io.StringWriter;
import java.util.List;
import com.omtg2sql.omtg.classes.OMTGAttribute;
import com.omtg2sql.omtg.classes.OMTGClass;
import com.omtg2sql.omtg.relationships.OMTGConceptualGeneralization;
import com.omtg2sql.omtg.relationships.OMTGConventionalGeneralization;
i... | OMTGClass omtgClassWhole, OMTGClass omtgClassPart,
List<OMTGClass> omtgClassWholeList,
List<OMTGClass> omtgClassPartList) {
if (omtgClassWholeList != null && omtgClassPartList != null) {
for (OMTGClass omtgClassA : omtgClassWholeList) {
for (OMTGClass omtgClassB : omtgClassPartList) {
c... | OMTGConventionalGeneralization omtgRel, OMTGClass superClass,
| 3 |
rapidpro/surveyor | app/src/main/java/io/rapidpro/surveyor/activity/CaptureVideoActivity.java | [
"public class Logger {\n\n private static final String TAG = \"Surveyor\";\n\n public static void e(String message, Throwable t) {\n Log.e(TAG, message, t);\n }\n\n public static void w(String message) {\n Log.w(TAG, message);\n }\n\n public static void d(String message) {\n L... | import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.hardware.Camera;
import android.hardware.Camera.CameraInfo;
import android.media.CamcorderProfile;
import android.media.MediaRecorder;
import andr... | package io.rapidpro.surveyor.activity;
/**
* Activity for capturing a video message
*/
public class CaptureVideoActivity extends PermisoActivity {
// camera settings
public static final int CAMERA_QUALITY = CamcorderProfile.QUALITY_480P;
public static final int MAX_DURATION = 600000; // 60s max dura... | private IconTextView toggleCameraButton; | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.