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 |
|---|---|---|---|---|---|---|
cvtienhoven/graylog-plugin-aggregates | src/test/java/org/graylog/plugins/aggregates/report/ReportFactoryTest.java | [
"public interface HistoryAggregateItem {\n\tpublic String getMoment();\n\t\n public long getNumberOfHits();\n \n}",
"@AutoValue\n@JsonAutoDetect\npublic abstract class HistoryAggregateItemImpl implements HistoryAggregateItem{\n \n\t@JsonProperty(\"moment\")\n @Override\n public abstract String ... | import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.graylog.plugins.... | package org.graylog.plugins.aggregates.report;
@RunWith(MockitoJUnitRunner.class)
public class ReportFactoryTest {
@Test
public void testGenerateTimeSeriesChart() throws ParseException, FileNotFoundException{
Map<Rule, List<HistoryAggregateItem>> map = new HashMap<Rule, List<HistoryAggregateItem>>();
Cale... | ReportSchedule schedule = ReportScheduleImpl.create("1231231", "name", "expression", "P1D", false, 0L, reportReceivers); | 3 |
BorjaSanchidrian/DarkOrbitServer | src/com/darkorbit/assemblies/LoginAssembly.java | [
"public class Launcher extends Global {\n\n\tprivate static final int PORT = 8080;\n\tprivate static final int CHAT_PORT = 9338;\n\tpublic static final String clientVersion = \"4.1\";\n\t/***********************************************/\n\t\n\tprivate static String mysqlHost \t= null;\n\tprivate static String mysql... | import java.io.IOException;
import java.net.Socket;
import java.util.List;
import java.util.Map.Entry;
import com.darkorbit.main.Launcher;
import com.darkorbit.mysql.QueryManager;
import com.darkorbit.net.ConnectionManager;
import com.darkorbit.net.GameManager;
import com.darkorbit.net.Global;
import com.darkorbit.obje... | sendPacket(userSocket, "0|B|" + player.getAmmo().getLcb10() + "|" + player.getAmmo().getMcb25() + "|" + player.getAmmo().getMcb50() + "|" + player.getAmmo().getUcb100() + "|" + player.getAmmo().getSab50() + "|" + player.getAmmo().getRsb75());
}
//Carga los misiles y minas
private void setRocketsAndMin... | for(Entry<Integer, Portal> p : GameManager.portals.entrySet()) { | 7 |
robzenn92/peersimTutorial | src/main/java/epto/EpTODissemination.java | [
"public class Ball extends HashMap<UUID, Event> {\n\n}",
"public class Event implements Comparable<Event>{\n\n public UUID id;\n\n public LogicalClock timestamp;\n\n public int ttl;\n\n public long sourceId;\n\n public Event() {\n id = UUID.randomUUID();\n }\n\n public int compareTo(Ev... | import epto.utils.Ball;
import epto.utils.Event;
import epto.utils.Message;
import epto.utils.Utils;
import peersim.cdsim.CDProtocol;
import peersim.config.Configuration;
import peersim.config.FastConfig;
import peersim.core.Node;
import peersim.edsim.EDProtocol;
import peersim.transport.Transport;
import pss.IPeerSamp... | package epto;
/**
* The EpTO dissemination component
*
* The algorithm assumes the existence of a peer sampling service (PSS) responsible for keeping p’s view
* up-to-date with a random stream of at least K deemed correct processes allowing a fanout of size K.
* TTL (time to live) holds the number of rounds fo... | private LogicalClock lastLogicalClock; | 5 |
senseobservationsystems/sense-android-library | sense-android-library/src/nl/sense_os/service/external_sensors/ZephyrBioHarness.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.io.InputStream;
import java.io.OutputStream;
import java.util.Set;
import java.util.UUID;
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.External;
import nl.sense_os.serv... | // check that payload is not completely empty
boolean hasPayload = false;
for (int i = 12; i < 58; i++) {
if (buffer[i] != 0) {
hasPayload = true;
break;
}
}
if (false == hasPayload) {
Log.w(TAG, "No sensor data payload received");
// return true because the message t... | dataPoint.timeStamp = SNTP.getInstance().getTime(); | 4 |
opaluchlukasz/junit2spock | src/main/java/com/github/opaluchlukasz/junit2spock/core/feature/mockito/MatcherHandler.java | [
"@Component\npublic class ASTNodeFactory {\n\n private final AstProvider ast;\n\n @Autowired\n public ASTNodeFactory(AstProvider astProvider) {\n this.ast = astProvider;\n }\n\n public ImportDeclaration importDeclaration(Class<?> clazz) {\n return importDeclaration(clazz.getName(), fals... | import com.github.opaluchlukasz.junit2spock.core.ASTNodeFactory;
import com.github.opaluchlukasz.junit2spock.core.node.GroovyClosure;
import com.github.opaluchlukasz.junit2spock.core.node.GroovyClosureBuilder;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.ecli... | package com.github.opaluchlukasz.junit2spock.core.feature.mockito;
@Component
public class MatcherHandler {
private static final Logger LOG = LoggerFactory.getLogger(MatcherHandler.class);
private static final Map<String, String> MATCHER_TYPE_OVERRIDE = ImmutableMap.of("Char", "Character", "Int", "Integer... | return methodInvocation(argument).map(methodInvocation -> Match(methodInvocation.getName().getIdentifier()).of( | 6 |
wangchongjie/multi-engine | src/test/java/com/baidu/unbiz/multiengine/transport/DistributedTaskTest.java | [
"public class HostConf {\n\n private String host = System.getProperty(\"host\", \"127.0.0.1\");\n private int port = Integer.parseInt(System.getProperty(\"port\", \"8007\"));\n private boolean ssl = System.getProperty(\"ssl\") != null;\n\n public HostConf() {\n try {\n InetAddress addr... | import java.util.List;
import java.util.concurrent.CountDownLatch;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.Assert;
import com.baidu.unbiz.... | package com.baidu.unbiz.multiengine.transport;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "/applicationContext-test.xml")
public class DistributedTaskTest {
@Test
public void testRunDisTask() { | HostConf hostConf = new HostConf(); | 0 |
nutritionfactsorg/daily-dozen-android | app/src/main/java/org/nutritionfacts/dailydozen/widget/DateWeights.java | [
"public class Common {\n public static final String FILE_PROVIDER_AUTHORITY = \"org.nutritionfacts.dailydozen.fileprovider\";\n public static final String PREFERENCES_FILE = \"org.nutritionfacts.dailydozen.preferences\";\n\n public static final int MAX_SERVINGS = 24;\n public static final int MAX_TWEAKS... | import android.content.Context;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.inputmethod.EditorInfo;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import ... | package org.nutritionfacts.dailydozen.widget;
public class DateWeights extends LinearLayout {
private DateWeightsBinding binding;
private boolean initialized = false; | private Day day; | 4 |
holmes-org/holmes-validation | src/main/java/org/holmes/evaluator/DateEvaluator.java | [
"public interface Evaluator<T> {\n\n\t/**\n\t * Used to set the {@link Joint} on this Evaluator.\n\t * \n\t * @param joint\n\t */\n\tvoid setJoint(Joint joint);\n\n\t/**\n\t * Evaluates the target by specific logic.\n\t * \n\t * @return <code>true</code> if the target conforms to the logic,\n\t * <code>fals... | import java.util.Date;
import org.holmes.Evaluator;
import org.holmes.Joint;
import org.holmes.evaluator.support.Diff;
import org.holmes.evaluator.support.FutureNumber;
import org.holmes.evaluator.support.Interval; | package org.holmes.evaluator;
/**
* An {@link Evaluator} for the {@link Date} type.
*
* @author diegossilveira
*/
public class DateEvaluator extends ObjectEvaluator<Date> {
private static final int ZERO = 0;
public DateEvaluator(Date target) {
super(target);
}
/**
* Applies a diff between the target ... | public NumberEvaluator applying(final Diff diff) { | 2 |
kb10uy/Tencocoa | app/src/main/java/org/kb10uy/tencocoa/TimelineFragment.java | [
"public class GeneralReverseListAdapter<T> extends BaseAdapter {\n\n Context context;\n LayoutInflater inflater;\n List<T> list;\n GeneralListAdapterViewGenerator<T> viewGenerator;\n int layoutId;\n\n public GeneralReverseListAdapter(Context ctx, int layout, GeneralListAdapterViewGenerator<T> gene... | import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.net.Uri;... |
@Override
public void onRefresh() {
mHandler.postDelayed(() -> mSwipeRefreshLayout.setRefreshing(false), 2000);
}
public void clearStatuses() {
mTimeLineAdapter.clear();
}
public void setSourceUser(long user) {
currentUserId = user;
}
public void onStreamingSt... | for (TencocoaUriInfo info : status.getMedias()) { | 5 |
harryaskham/Twitter-L-LDA | eval/SimilarityMatrix.java | [
"public class FullAlchemyClassification {\r\n\t\r\n\tprivate long userID;\r\n\tprivate Map<String,Double> classifications;\r\n\t\r\n\tpublic FullAlchemyClassification(long userID) {\r\n\t\tthis.userID = userID;\r\n\t\tclassifications = new HashMap<String,Double>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFileInputStream fstr... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import... | package uk.ac.cam.ha293.tweetlabel.eval;
public class SimilarityMatrix implements Serializable {
private static final long serialVersionUID = 8293810632053185977L;
private double[][] sim;
private long[] userIDLookup;
private Map<Long,Integer> indexLookup;
private int d; //dimensions
private bool... | FullCalaisClassification[] classifications = new FullCalaisClassification[d];
| 1 |
Nilhcem/droidconde-2016 | app/src/main/java/com/nilhcem/droidconde/data/database/dao/SessionsDao.java | [
"@Singleton\npublic class LocalDateTimeAdapter {\n\n private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\", Locale.US);\n\n @Inject\n public LocalDateTimeAdapter() {\n }\n\n @ToJson\n public String toText(LocalDateTime dateTime) {\n return dateTime.for... | import android.database.Cursor;
import com.nilhcem.droidconde.core.moshi.LocalDateTimeAdapter;
import com.nilhcem.droidconde.data.app.SelectedSessionsMemory;
import com.nilhcem.droidconde.data.database.DbMapper;
import com.nilhcem.droidconde.data.database.model.SelectedSession;
import com.nilhcem.droidconde.data.databa... | package com.nilhcem.droidconde.data.database.dao;
@Singleton
public class SessionsDao {
private final BriteDatabase database;
private final DbMapper dbMapper;
private final SpeakersDao speakersDao;
private final LocalDateTimeAdapter adapter;
private final SelectedSessionsMemory selectedSessi... | Preconditions.checkNotOnMainThread(); | 5 |
bcgov/sbc-qsystem | QSystem/src/ru/apertum/qsystem/server/controller/AIndicatorBoard.java | [
"public enum CustomerState {\n // значени� �о�то�ни� \"очередника\"\n\n /**\n * 0 удален по не�вке :: Was deleted by default\n */\n STATE_DEAD,\n /**\n * 1 �тоит и ждет в очереди :: Standing and waiting in line\n */\n STATE_WA... | import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import ru.apertum.qsystem.common.CustomerState;
import ru.apertum.qsystem.common.QLog;
import ru.apertum.qsystem.common.model.ATalkingClock;
import ru.apertum.qsystem.common.model.QCustomer;
import ru.a... | /*
* Copyright (C) 2010 {Apertum}Projects. web: www.apertum.ru email: info@apertum.ru
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | protected LinkedList<Record> getShowRecords(QOffice office) { | 2 |
OfficeDev/O365-Android-Snippets | app/src/main/java/com/microsoft/office365/snippetapp/CalendarStories/CreateOrDeleteEventStory.java | [
"public class CalendarSnippets {\n\n OutlookClient mCalendarClient;\n\n public CalendarSnippets(OutlookClient mailClient) {\n mCalendarClient = mailClient;\n }\n\n /**\n * Return a list of calendar events from the default calendar and ordered by the\n * Start field. The range of events to... | import com.microsoft.office365.snippetapp.R;
import com.microsoft.office365.snippetapp.Snippets.CalendarSnippets;
import com.microsoft.office365.snippetapp.helpers.AuthenticationController;
import com.microsoft.office365.snippetapp.helpers.BaseUserStory;
import com.microsoft.office365.snippetapp.helpers.GlobalValues;
i... | /*
* Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
*/
package com.microsoft.office365.snippetapp.CalendarStories;
//This story handles both of the following stories that appear in the UI list
// based on strings passed in the constructor... | CalendarSnippets calendarSnippets = new CalendarSnippets( | 0 |
kristian/JDigitalSimulator | src/main/java/lc/kra/jds/components/buildin/alu/FullAdder.java | [
"public final class Utilities {\n\tpublic static enum TranslationType { TEXT, ALTERNATIVE, TITLE, EXTERNAL, TOOLTIP, DESCRIPTION; }\n\n\tpublic static final String\n\t\tCONFIGURATION_LOCALIZATION_LANGUAGE = \"localization.language\",\n\t\tCONFIGURATION_LOOK_AND_FEEL_CLASS = \"lookandfeel.class\",\n\t\tCONFIGURATION... | import lc.kra.jds.contacts.ContactUtilities;
import lc.kra.jds.contacts.InputContact;
import lc.kra.jds.contacts.OutputContact;
import static lc.kra.jds.Utilities.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Point;
impo... | /*
* JDigitalSimulator
* Copyright (C) 2017 Kristian Kraljic
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*... | private Contact[] contacts; | 4 |
htrc/HTRC-Portal | app/controllers/WorksetManagement.java | [
"@XmlAccessorType(XmlAccessType.FIELD)\n@XmlType(name = \"Property\", namespace = \"http://registry.htrc.i3.illinois.edu/entities/workset\")\npublic class Property {\n\n @XmlAttribute\n protected String name;\n @XmlAttribute\n protected String value;\n\n /**\n * Gets the value of the name propert... | import au.com.bytecode.opencsv.CSVWriter;
import com.fasterxml.jackson.databind.node.ObjectNode;
import edu.illinois.i3.htrc.registry.entities.workset.Property;
import edu.illinois.i3.htrc.registry.entities.workset.Volume;
import edu.illinois.i3.htrc.registry.entities.workset.Workset;
import edu.indiana.d2i.htrc.portal... | package controllers;
public class WorksetManagement extends JavaController {
private static Logger.ALogger log = play.Logger.of("application");
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
@RequiresAuthentication(clientName = "Saml2Client")
pu... | String userId = session(PortalConstants.SESSION_USERNAME); | 5 |
52inc/android-Showcase | app/src/main/java/com/ftinc/showcase/ui/screens/home/HomeActivity.java | [
"public class VideoListAdapter extends BetterListAdapter<Video, VideoViewHolder> {\n\n /**\n * Constructor\n */\n public VideoListAdapter(Context context, List<Video> objects) {\n super(context, R.layout.layout_video_item, objects);\n }\n\n\n @Override\n public VideoViewHolder createHo... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.database.DataSetObserver;
import android.net.Uri;
import android.os.Build;
import a... | return true;
}
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
switch (item.getItemId()){
case R.id.action_delete:
// Get the list of selected items
SparseArray<Video> checked = getSel... | .eventListener(new FabEventListener(mFab)) | 4 |
vjurenka/BWMirror-Generator | src/api/DefaultEventListener.java | [
"public interface CClass extends CDeclaration {\n\n public List<Field> getFields();\n\n public boolean isStatic();\n}",
"public interface CDeclaration {\n public String getName();\n public DeclarationType getDeclType();\n public void setJavadoc(String string);\n public String getJavadoc();\n\n}"... | import c.CClass;
import c.CDeclaration;
import c.Param;
import generator.Generator;
import generator.MirrorContext;
import generator.PackageProcessOptions;
import impl.Function;
import java.util.ArrayList;
import java.util.List; | package api;
/**
* User: PC
* Date: 19. 4. 2015
* Time: 16:06
*/
public class DefaultEventListener implements GeneratorEventListener {
@Override | public void onPackageProcessingStart(PackageProcessOptions packageProcessOptions, MirrorContext mirrorContext, Generator generator, List<CDeclaration> cDeclarationList) { | 1 |
CS-SI/Stavor | stavor/src/main/java/cs/si/stavor/model/ModelSimulation.java | [
"public class MainActivity extends ActionBarActivity implements\n\t\tNavigationDrawerFragment.NavigationDrawerCallbacks {\n\n\t/**\n\t * Fragment managing the behaviors, interactions and presentation of the\n\t * navigation drawer.\n\t */\n\tprivate NavigationDrawerFragment mNavigationDrawerFragment;\n\t\n\t/**\n\t... | import java.util.ArrayList;
import java.util.List;
import org.apache.commons.math3.geometry.euclidean.threed.Line;
import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;
import org.apache.commons.math3.geometry.euclidean.threed.Vector... | //Compute acceleration
if(tmp_time != null){
double delay = date.offsetFrom(tmp_time,utc);
Vector3D acceleration = new Vector3D(
(velocity.getX()-tmp_vel.getX())/delay,
(velocity.getY()-tmp_vel.getY())/delay,
(velocity.getZ()-tmp_vel.getZ())/delay);
new_state.value_acceleration[0] = ... | if(date_tmp == null || Math.abs(scs.getDate().durationFrom(date_tmp))>Parameters.Map.solar_terminator_threshold){ | 2 |
futurice/vor | vor-android/mobile/src/main/java/com/futurice/vor/fragment/TrendingFragment.java | [
"public class Constants {\n public static final String SERVER_URL = \"http://rubix.futurice.com/\";\n\n public static final int CARDS_HAPPENING_NOW = 0;\n public static final int CARDS_TRENDING = 1;\n public static final int CARDS_MY_CARDS = 2;\n public static final int CARDS_NUMBER_OF_TABS = 3;\n\n ... | import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ExpandableListView;
import android.widget.FrameLayout;
import com.reactivecascade.i.CallOrig... | package com.futurice.vor.fragment;
public class TrendingFragment extends BaseVorFragment {
protected int lastExpanded = -1;
@NonNull
public static TrendingFragment newInstance() {
return new TrendingFragment();
}
@Override
@NonNull
public View onCreateView(
@NonNul... | tla.setFilterFunction(topic -> ((Topic) topic).getLikes() > 0 || topic.isPrebuiltTopic()); | 4 |
operando/Garum | garum/src/main/java/com/os/operando/garum/models/PrefModel.java | [
"public class PrefInfo {\n\n private String prefName;\n private Map<Field, String> keyNames = new LinkedHashMap<>();\n\n public PrefInfo(Class<? extends PrefModel> type) {\n setPrefName(type);\n List<Field> fields = new LinkedList<>(ReflectionUtil.getDeclaredPrefKeyFields(type));\n for... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import com.os.operando.garum.PrefInfo;
import com.os.operando.garum.annotations.DefaultBoolean;
import com.os.operando.garum.annotat... | package com.os.operando.garum.models;
public abstract class PrefModel {
private final PrefInfo prefInfo;
private SharedPreferences.Editor editor;
public PrefModel() {
prefInfo = Cache.getPrefInfo(getClass());
load();
}
public void apply() {
setValuesEditor();
... | GarumLog.w(String.format("TypeSerializer returned wrong type: expected a %s but got a %s", | 4 |
bbottema/outlook-message-parser | src/main/java/org/simplejavamail/outlookmessageparser/model/OutlookMessage.java | [
"public class MessagingException extends Exception {\n\n /**\n * The next exception in the chain.\n *\n * @serial\n */\n private Exception next;\n\n private static final long serialVersionUID = -7569192289819959253L;\n\n /**\n * Constructs a MessagingException with no detail message.... | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.io.IOUtils;
import org.apache.poi.hmef.CompressedRTF;
import org.apache.poi.hsmf.datatypes.MAPIProperty;
import org.bbottema.rtftohtml.RTF2HTMLConverter;
import org.bbottema.rtftohtml.impl.util.CharsetHelper;
import org.jetbrains.annot... | // we simply try to decompress the RTF data if it's not compressed, the utils class is able to detect this anyway
if (this.bodyRTF == null && bodyRTF != null) {
if (bodyRTF instanceof byte[]) {
try {
final byte[] decompressedBytes = decompressRtfBytes((byte[]) bodyRTF);
if (decompressedBytes != nul... | final MailDateFormat formatter = new MailDateFormat(); | 4 |
lionsoul2014/ip2region | maker/java/src/org/lionsoul/ip2region/test/TestSearcher.java | [
"public class DataBlock \n{\n\t/**\n\t * city id \n\t*/\n\tprivate int city_id;\n\t\n\t/**\n\t * region address\n\t*/\n\tprivate String region;\n\t\n\t/**\n\t * region ptr in the db file\n\t*/\n\tprivate int dataPtr;\n\t\n\t/**\n\t * construct method\n\t * \n\t * @param city_id\n\t * @param region region string\... | import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.lionsoul.ip2region.DataBlock;
import org.lionsoul.ip2region.DbConfig;
import org.lionsoul.ip2region.DbMakerCon... | package org.lionsoul.ip2region.test;
/**
* project test script
*
* @author chenxin<chenxin619315@gmail.com>
*/
public class TestSearcher
{
public static void main(String[] argv)
{
if ( argv.length == 0 ) {
System.out.println("| Usage: java -jar ip2region-{version}.jar [ip2region ... | if ( Util.isIpAddress(line) == false ) { | 4 |
Earthblood/Toe | app/src/test/java/com/earthblood/tictactoe/guice/TestToeRoboModule.java | [
"public class ToeGame {\n\n private PreferenceHelper preferenceHelper;\n\n @Inject\n public ToeGame(PreferenceHelper preferenceHelper){\n this.preferenceHelper = preferenceHelper;\n }\n\n public String titleHack(String appName, String statusMessage){\n return \"<font color=#CD5C5C><b>\"... | import android.app.Application;
import com.earthblood.tictactoe.engine.ToeGame;
import com.earthblood.tictactoe.helper.CoinTossHelper;
import com.earthblood.tictactoe.helper.HapticFeedbackHelper;
import com.earthblood.tictactoe.helper.HtmlHelper;
import com.earthblood.tictactoe.helper.PreferenceHelper;
import com.googl... | /**
* @author John Piser developer@earthblood.com
*
* Copyright (C) 2014 EARTHBLOOD, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | bind(PreferenceHelper.class).toInstance(Mockito.mock(PreferenceHelper.class)); | 4 |
wooti/onedrive-java-client | src/main/java/com/wouterbreukink/onedrive/client/RWOneDriveProvider.java | [
"public interface AuthorisationProvider {\n\n String getAccessToken() throws IOException;\n\n void refresh() throws IOException;\n\n class FACTORY {\n public static AuthorisationProvider create(Path keyFile) throws IOException {\n return new OneDriveAuthorisationProvider(keyFile);\n ... | import com.google.api.client.http.*;
import com.google.api.client.http.json.JsonHttpContent;
import com.google.api.client.util.Key;
import com.wouterbreukink.onedrive.client.authoriser.AuthorisationProvider;
import com.wouterbreukink.onedrive.client.downloader.ResumableDownloader;
import com.wouterbreukink.onedrive.cli... | package com.wouterbreukink.onedrive.client;
class RWOneDriveProvider extends ROOneDriveProvider implements OneDriveProvider {
public RWOneDriveProvider(AuthorisationProvider authoriser) {
super(authoriser);
}
public OneDriveItem replaceFile(OneDriveItem parent, File file) throws IOException {
... | public void download(OneDriveItem item, File target, ResumableDownloaderProgressListener progressListener) throws IOException { | 2 |
RockinChaos/ItemJoin | src/me/RockinChaos/itemjoin/utils/sql/SQL.java | [
"public class ItemJoin extends JavaPlugin {\n\t\n \tprivate static ItemJoin instance;\n \tprivate boolean isStarted = false;\n \t\n /**\n * Called when the plugin is loaded.\n * \n */\n @Override\n public void onLoad() {\n \tinstance = this;\n }\n \n /**\n * Called when the plugin ... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import me.RockinChaos.itemjoin.ItemJoin;
import me.RockinChaos.itemjoin.handlers.ConfigHandler;
import me.RockinChaos.itemjoin.utils.SchedulerUtils;
import me.RockinChaos.itemjoin.utils.ServerUt... | /*
* ItemJoin
* Copyright (C) CraftationGaming <https://www.craftationgaming.com/>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | Database.getDatabase().executeStatement("DROP TABLE IF EXISTS " + ConfigHandler.getConfig().getTable() + table.tableName()); | 1 |
KostyaSha/github-integration-plugin | github-pullrequest-plugin/src/main/java/org/jenkinsci/plugins/github/pullrequest/events/impl/GitHubPRCommentEvent.java | [
"public class GitHubPRDecisionContext extends GitHubDecisionContext<GitHubPREvent, GitHubPRCause> {\n private final GHPullRequest remotePR;\n private final GitHubPRPullRequest localPR;\n private final GitHubPRUserRestriction prUserRestriction;\n private final GitHubPRRepository localRepo;\n\n protect... | import com.github.kostyasha.github.integration.generic.GitHubPRDecisionContext;
import hudson.Extension;
import hudson.model.TaskListener;
import org.jenkinsci.Symbol;
import org.jenkinsci.plugins.github.pullrequest.GitHubPRCause;
import org.jenkinsci.plugins.github.pullrequest.GitHubPRPullRequest;
import org.jenkinsci... | package org.jenkinsci.plugins.github.pullrequest.events.impl;
/**
* Trigger PR based on comment pattern.
*
* @author Kanstantsin Shautsou
*/
public class GitHubPRCommentEvent extends GitHubPREvent {
private static final String DISPLAY_NAME = "Comment matched to pattern";
private static final Logger LOG ... | final GitHubPRUserRestriction prUserRestriction = prDecisionContext.getPrUserRestriction(); | 4 |
Nike-Inc/wingtips | wingtips-spring/src/test/java/com/nike/wingtips/spring/util/WingtipsSpringUtilTest.java | [
"@SuppressWarnings(\"WeakerAccess\")\npublic class Tracer {\n\n /**\n * The options for how {@link Span} objects are represented when they are completed. To change how {@link Tracer} serializes spans when logging them\n * call {@link #setSpanLoggingRepresentation(SpanLoggingRepresentation)}.\n */\n ... | import com.nike.internal.util.Pair;
import com.nike.wingtips.Span;
import com.nike.wingtips.Span.SpanPurpose;
import com.nike.wingtips.Tracer;
import com.nike.wingtips.spring.interceptor.WingtipsAsyncClientHttpRequestInterceptor;
import com.nike.wingtips.spring.interceptor.WingtipsClientHttpRequestInterceptor;
import c... | package com.nike.wingtips.spring.util;
/**
* Tests the functionality of {@link WingtipsSpringUtil}.
*
* @author Nic Munroe
*/
@RunWith(DataProviderRunner.class)
public class WingtipsSpringUtilTest {
private HttpMessage httpMessageMock;
private HttpHeaders headersMock;
private SuccessCallback suc... | private HttpTagAndSpanNamingStrategy<HttpRequest, ClientHttpResponse> tagStrategyMock; | 4 |
AndyGu/ShanBay | src/com/shanbay/words/review/experience/ExpDataTransferHelper.java | [
"public class Example extends Model\n{\n public String annotation;\n public String first;\n public long id;\n public String last;\n public int likes;\n public String mid;\n public String nickname;\n public String translation;\n public int unlikes;\n public long userid;\n public String username;\n public... | import com.shanbay.words.model.Example;
import com.shanbay.words.model.ExampleContent;
import com.shanbay.words.model.ExampleData;
import com.shanbay.words.model.ExpReview;
import com.shanbay.words.model.Roots;
import com.shanbay.words.model.RootsContent;
import com.shanbay.words.model.RootsData;
import com.shanbay.wor... | package com.shanbay.words.review.experience;
public class ExpDataTransferHelper
{
public ExampleData getExampleData(ExpReview paramExpReview)
{
ExampleData localExampleData = new ExampleData();
ArrayList<ExampleContent> list = new ArrayList<ExampleContent>();
Iterator<Example> localIterator = paramExp... | RootsContent localRootsContent = new RootsContent(); | 5 |
Dynious/Biota | src/main/java/com/dynious/biota/config/PlantConfig.java | [
"@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION, dependencies = Reference.DEPENDENCIES, guiFactory = \"com.dynious.biota.config.GuiFactory\")\npublic class Biota\n{\n @Mod.Instance(Reference.MOD_ID)\n public static Biota instance;\n\n @SidedProxy(clientSide = Reference.CL... | import com.dynious.biota.Biota;
import com.dynious.biota.api.BlockAndMeta;
import com.dynious.biota.api.DefaultPlantSpreader;
import com.dynious.biota.api.IBiotaAPI;
import com.dynious.biota.api.IPlantSpreader;
import com.dynious.biota.biosystem.spreader.TallGrassSpreader;
import com.dynious.biota.lib.Reference;
import... | package com.dynious.biota.config;
public class PlantConfig
{
private static final float[][] NORMAL_NUTRIENTS = { { Settings.NORMAL_PHOSPHORUS }, { Settings.NORMAL_POTASSIUM }, { Settings.NORMAL_NITROGEN } };
private static Map<Block, PlantInfo> plantInfoMap = new HashMap<Block, PlantInfo>();
private stat... | IBiotaAPI.API.registerDeadPlant(Blocks.grass, -1, Blocks.dirt, -1); | 3 |
vasl-developers/vasl | src/VASL/build/module/map/DoubleBlindViewer.java | [
"public class LOSResult {\n\n\t// some useful constants\n\tpublic static final int UNKNOWN = -1;\n\n\t// private variables\n\tprotected Location sourceLocation;\n private Location targetLocation;\n\n\tprivate boolean blocked;\n\tprivate Point blockedAtPoint;\n\tprotected Point firstHindranceAt;\n\tprivate int\... | import VASL.LOS.Map.LOSResult;
import VASL.LOS.Map.Location;
import VASL.LOS.VASLGameInterface;
import VASL.build.module.ASLMap;
import VASL.build.module.map.EnableDoubleBlindCommand;
import VASL.counters.ASLProperties;
import VASSAL.build.AbstractConfigurable;
import VASSAL.build.AutoConfigurable;
import VASSAL.build.... | /*
* $Id: DoubleBlindViewer 3/30/14 davidsullivan1 $
*
* Copyright (c) 2014 by David Sullivan
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License (LGPL) as published by the Free Software Foundation.
*
* This library is distri... | protected VASLGameInterface VASLGameInterface; | 2 |
WeDevelopTeam/HeroVideo-master | app/src/main/java/com/github/bigexcalibur/herovideo/mvp/test/ui/TestFragment.java | [
"public class MediaPlayerActivity extends Activity {\n\n MediaPlayer player;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n requestWindowFeature(Window.FEATURE_NO_TITLE);\n super.onCreate(savedInstanceState);\n setRequestedOrientation(ActivityInfo.SCREEN_ORIENTA... | import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import com.bili... | package com.github.bigexcalibur.herovideo.mvp.test.ui;
/**
* Created by Xie.Zhou on 2017/1/4.
*/
public class TestFragment extends RxLazyFragment {
@BindView(R.id.tv_test)
TextView mTvTest;
@BindView(R.id.btn_test1)
Button mBtnTest1;
@BindView(R.id.btn_test2)
Button mBtnTest2;
@Bin... | String url = ApiConstants.VIDEO_SEARCH_HEAD +"av" +av_num; | 3 |
andrewoma/dexx | collection/src/test/java/com/github/andrewoma/dexx/collection/mutable/MutableTreeSet.java | [
"public interface Builder<E, R> {\n @NotNull\n Builder<E, R> add(E element);\n\n @NotNull\n Builder<E, R> addAll(@NotNull Traversable<E> elements);\n\n @NotNull\n Builder<E, R> addAll(@NotNull java.lang.Iterable<E> elements);\n\n @NotNull\n Builder<E, R> addAll(@NotNull Iterator<E> iterator)... | import java.util.Comparator;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.TreeSet;
import com.github.andrewoma.dexx.collection.Builder;
import com.github.andrewoma.dexx.collection.BuilderFactory;
import com.github.andrewoma.dexx.collection.SortedSet;
import com.github.andrewoma.d... | /*
* Copyright (c) 2014 Andrew O'Malley
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, pub... | static class MutableTreeSetBuilder<A> extends AbstractBuilder<A, SortedSet<A>> implements Builder<A, SortedSet<A>> { | 4 |
davidmoten/logan | src/main/java/com/github/davidmoten/logan/watcher/Watcher.java | [
"public interface Data {\n\n Buckets execute(BucketQuery query);\n\n Stream<String> getLogs(long startTime, long finishTime);\n\n Stream<LogEntry> find(long startTime, long finishTime);\n\n /**\n * Adds a {@link LogEntry} to the data.\n * \n * @param entry entry\n * @return this this\n ... | import java.io.File;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import j... | package com.github.davidmoten.logan.watcher;
/**
* Watches (tails) groups of files configured by persister configuration and
* reports lines to the <i>log-database</i>.
*
*/
public class Watcher {
private static final int DELAY_BETWEEN_CHECKS_FOR_NEW_CONTENT_MS = 500;
private static final int TERMINAT... | private final List<LogFile> logs = Lists.newArrayList(); | 1 |
citysearch/web-widgets | src/main/java/com/citysearch/webwidget/action/ConquestOffersAction.java | [
"public class HouseAd {\n private String title;\n private String tagLine;\n private String destinationUrl;\n private String imageURL;\n private String trackingUrl;\n private String displayUrl;\n\n public String getTrackingUrl() {\n return trackingUrl;\n }\n\n public void setTrackin... | import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import com.citysearch.webwidget.bean.HouseAd;
import com.citysearch.webwidget.bean.Offer;
import com.citysearch.webwidget.bean.RequestBean;
import com.citysearch.webwidget.exception.CitysearchException;
import com.citysea... | package com.citysearch.webwidget.action;
public class ConquestOffersAction extends AbstractCitySearchAction implements
ModelDriven<RequestBean> {
private static final Integer MAX_OFFER_DESCRIPTION_SIZE = 105;
private static final Integer MAX_OFFER_TITLE_SIZE = 40;
private static final Integer MAX_OFFER_LISTING... | private Offer offer; | 1 |
Catherine22/MobileManager | app/src/main/java/com/itheima/mobilesafe/receivers/SMSReceiver.java | [
"public class GPSService extends Service {\n private final static String TAG = \"GPSService\";\n private LocationListener listener;\n\n @Nullable\n @Override\n public IBinder onBind(Intent intent) {\n CLog.d(TAG, \"onBind\");\n return null;\n }\n\n @Override\n public void onCre... | import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.telephony.SmsMessage;
import android.text.TextUtils;
import c... | package com.itheima.mobilesafe.receivers;
/**
* Created by Catherine on 2016/8/19.
* Soft-World Inc.
* catherine919@soft-world.com.tw
*/
public class SMSReceiver extends BroadcastReceiver {
public static final String TAG = "SmsReceiver";
public static String address;
public static String content;
... | client.gotMessages(BroadcastActions.LOCATION_INFO); | 1 |
CS-SI/Stavor | stavor/src/main/java/cs/si/stavor/app/Installer.java | [
"public class MainActivity extends ActionBarActivity implements\n\t\tNavigationDrawerFragment.NavigationDrawerCallbacks {\n\n\t/**\n\t * Fragment managing the behaviors, interactions and presentation of the\n\t * navigation drawer.\n\t */\n\tprivate NavigationDrawerFragment mNavigationDrawerFragment;\n\t\n\t/**\n\t... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.commons.math3.util.FastMath;
import org.orekit.errors.OrekitException;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScalesFactory;
import cs.si.... | try {
values.put(MissionEntry.COLUMN_NAME_CLASS, SerializationUtil.serialize(mission));
} catch (IOException e) {
e.printStackTrace();
}
// Insert the new row, returning the primary key value of the new row
newRowId = db.insert(
MissionEntry.TABLE_NAME,
null,
values);
if(newRowId... | for(UserMission mis : activity.userMissions){ | 5 |
MasterAbdoTGM50/ThaumicWarden | src/main/java/matgm50/twarden/item/ItemWardenWeapon.java | [
"@Mod(modid = ModLib.ID, name = ModLib.NAME, version = ModLib.VERSION, dependencies = ModLib.DEPENDENCIES)\n\npublic class TWarden {\n\n @Instance(ModLib.ID)\n public static TWarden instance;\n\n @SidedProxy(serverSide = ModLib.COMMONPROXY, clientSide = ModLib.CLIENTPROXY)\n public static CommonProxy pr... | import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import matgm50.twarden.TWarden;
import matgm50.twarden.lib.ItemLib;
import matgm50.twarden.lib.ModLib;
import matgm50.twarden.util.DamageSourceWarden;
import matgm50.twarden.util.wardenic.WardenicChargeHelper;
import net.minecraft.client.rend... | package matgm50.twarden.item;
/**
* Created by MasterAbdoTGM50 on 6/24/2014.
*/
public class ItemWardenWeapon extends Item {
public ItemWardenWeapon() {
super();
setUnlocalizedName(ItemLib.WARDEN_WEAPON_NAME);
setCreativeTab(TWarden.tabTWarden);
setMaxStackSize(1);
s... | DamageSource damageSource = new DamageSourceWarden("warden", player); | 3 |
gustav9797/PowerfulPerms | PowerfulPerms/src/main/java/com/github/gustav9797/PowerfulPerms/command/UserPromoteCommand.java | [
"public interface ICommand {\n public boolean hasPermission(String name, String permission); \n}",
"public interface Group {\n\n public int getId();\n\n public String getName();\n\n public List<Group> getParents();\n\n public String getPrefix(String server);\n\n public String getSuffix(String... | import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import com.github.gustav9797.PowerfulPerms.common.ICommand;
import com.github.gustav9797.PowerfulPermsAPI.Group;
import com.github.gustav9797.PowerfulPermsAPI.PermissionManager;
import com.github.gu... | package com.github.gustav9797.PowerfulPerms.command;
public class UserPromoteCommand extends SubCommand {
public UserPromoteCommand(PowerfulPermsPlugin plugin, PermissionManager permissionManager) {
super(plugin, permissionManager);
usage.add("/pp user <user> promote <ladder>");
}
@Over... | Response response = permissionManager.promotePlayerBase(uuid, ladder); | 4 |
EpicEricEE/ShopChest | src/main/java/de/epiceric/shopchest/external/listeners/PlotSquaredListener.java | [
"public class ShopChest extends JavaPlugin {\n\n private static ShopChest instance;\n\n private Config config;\n private HologramFormat hologramFormat;\n private ShopCommand shopCommand;\n private Economy econ = null;\n private Database database;\n private boolean isUpdateNeeded = false;\n p... | import java.util.Set;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.plot.Plot;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import de.epiceric.shopchest.Sh... | package de.epiceric.shopchest.external.listeners;
public class PlotSquaredListener implements Listener {
private final ShopChest plugin;
public PlotSquaredListener(ShopChest plugin) {
this.plugin = plugin;
}
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) | public void onCreateShop(ShopCreateEvent e) { | 2 |
upenn-libraries/xmlaminar | integrator/src/main/java/edu/upenn/library/xmlaminar/integrator/IntegratorOutputNode.java | [
"public class InputSourceXMLReader extends VolatileXMLFilterImpl {\n\n private final InputSource source;\n private Reader ownReader;\n private final Resettable resetter;\n private boolean parsed = false;\n \n public InputSourceXMLReader(InputSource source) {\n this(null, source, null);\n ... | import edu.upenn.library.xmlaminar.parallel.InputSourceXMLReader;
import edu.upenn.library.xmlaminar.parallel.JoiningXMLFilter;
import edu.upenn.library.xmlaminar.parallel.QueueSourceXMLFilter;
import edu.upenn.library.xmlaminar.DumpingLexicalXMLFilter;
import edu.upenn.library.xmlaminar.SAXParserResetter;
import edu.u... | LinkedList<String> pathElements = new LinkedList<String>(Arrays.asList(pe));
return addDescendent(pathElements, source, requireForWrite);
}
private static final int DEPTH_LIMIT = 10;
public StatefulXMLFilter addDescendent(LinkedList<String> pathElements, XMLReader source, boolean requireFo... | } else if (SAXProperties.EXECUTOR_SERVICE_PROPERTY_NAME.equals(name)) { | 5 |
dnault/therapi-json-rpc | examples/src/main/java/com/github/therapi/example/ExampleJsonRpcServlet.java | [
"public class MethodRegistry {\n private static final Logger log = LoggerFactory.getLogger(MethodRegistry.class);\n\n private final HashMap<String, MethodDefinition> methodsByName = new HashMap<>();\n\n private MethodIntrospector scanner;\n private final ObjectMapper objectMapper;\n private String na... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.therapi.core.MethodRegistry;
import com.github.therapi.example.calculator.CalculatorServiceImpl;
import com.github.therapi.example.devilsdictionary.DictionaryService;
import com.github.therapi.jsonrpc.JsonRpcDispatcher;
import com.github.therapi.json... | package com.github.therapi.example;
public class ExampleJsonRpcServlet extends AbstractJsonRpcServlet {
@Override
public void init() throws ServletException {
super.init();
ObjectMapper objectMapper = newLenientObjectMapper();
MethodRegistry registry = new MethodRegistry(objectMapp... | setHandler(new JsonRpcServletHandler(dispatcher, ResponseFormat.PRETTY)); | 6 |
jonasrottmann/realm-browser | realm-browser/src/main/java/de/jonasrottmann/realmbrowser/browser/BrowserInteractor.java | [
"@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)\npublic abstract class BaseInteractorImpl<P extends BasePresenter> implements BaseInteractor {\n private final P presenter;\n\n protected P getPresenter() {\n return presenter;\n }\n\n protected BaseInteractorImpl(P presenter) {\n this.presenter... | import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RestrictTo;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.util.ArrayLi... | package de.jonasrottmann.realmbrowser.browser;
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
class BrowserInteractor extends BaseInteractorImpl<BrowserContract.Presenter> implements BrowserContract.Interactor {
@Nullable
private Class<? extends RealmModel> realmModelClass = null;
@Nullable
private Dy... | Field field = (Field) DataHolder.getInstance().retrieve(DATA_HOLDER_KEY_FIELD); | 5 |
begab/kpe | src/hu/u_szeged/kpe/features/SectionFeature.java | [
"public class NGram extends ArrayList<CoreLabel> implements Cloneable {\n\n private static PorterStemmer ps = new PorterStemmer();\n private static final long serialVersionUID = 3797853353962652098l;\n private static final CoreLabelComparator coreLabelComparator = new CoreLabelComparator();\n private static Wor... | import hu.u_szeged.kpe.candidates.NGram;
import hu.u_szeged.kpe.candidates.NGramStats;
import hu.u_szeged.kpe.main.KPEFilter;
import hu.u_szeged.kpe.readers.DocumentData;
import hu.u_szeged.utils.NLPUtils;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.ut... | package hu.u_szeged.kpe.features;
/**
* Calculates sf-isf (section frequency-inverted section frequency) in the form of sf(term, document)*isf(term).
*/
public class SectionFeature extends Feature {
private static final long serialVersionUID = 7606431493967247562L;
private int numSections;
public SectionF... | return NLPUtils.mean(values); | 4 |
Lambda-3/DiscourseSimplification | src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/rules/ListNP/ListNPExtractor.java | [
"public class Extraction {\n private String extractionRule;\n private boolean referring;\n private String cuePhrase; // optional\n private Relation relation;\n private boolean contextRight; // only for subordinate relations\n private List<Leaf> constituents;\n\n public Extraction(String extract... | 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.List;
import java.util.Optional;
import edu.stanford.nlp.ling.Word;
import edu.stanford.nlp.trees.tregex.Tregex... | /*
* ==========================License-Start=============================
* DiscourseSimplification : ListNPExtractor
*
* 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 pub... | public Optional<Extraction> extract(Leaf leaf) throws ParseTreeException { | 0 |
excella-core/excella-reports | src/test/java/org/bbreak/excella/reports/processor/ReportProcessorTest.java | [
"public class ReportsTestUtil {\n\n /**\n * ログ\n */\n private static Log log = LogFactory.getLog( ReportsTestUtil.class);\n\n /**\n * XSSF最大列数\n */\n public static final int XSSF_MAX_COLUMN_NUMBER = 16384; // 2^14\n\n /**\n * HSSF最大列数\n */\n public static final int HSSF_MAX... | import static org.junit.Assert.*;
import java.io.FileNotFoundException;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermod... | /*-
* #%L
* excella-reports
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licen... | ConvertConfiguration configuration = new ConvertConfiguration( "CUSTOM"); | 4 |
graywolf336/Jail | src/main/java/com/graywolf336/jail/listeners/CacheListener.java | [
"public class JailMain extends JavaPlugin {\n private CommandHandler cmdHand;\n private HandCuffManager hcm;\n private JailHandler jh;\n private JailIO io;\n private JailManager jm;\n private IJailPayManager jpm;\n private IJailStickManager jsm;\n private JailTimer jt;\n private JailVoteM... | import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import com.graywolf336.jail.JailMain;
import com.graywolf336.jail... | package com.graywolf336.jail.listeners;
/**
* The listen for all events which need to add/remove to the prisoner cache.
*
* <p>
*
* These listeners add and remove prisoner cache objects to the cache,
* this way we gain performance for servers which have a high amount
* of prisoners jailed. (500+)
*
* @au... | public void beforeReleaseListener(PrePrisonerReleasedEvent event) { | 4 |
jeick/jamod | src/main/java/net/wimpi/modbus/cmd/DOTest.java | [
"public class ModbusTCPTransaction implements ModbusTransaction {\n\n\t// class attributes\n\tprivate static AtomicCounter c_TransactionID = new AtomicCounter(\n\t\t\tModbus.DEFAULT_TRANSACTION_ID);\n\n\t// instance attributes and associations\n\tprivate TCPMasterConnection m_Connection;\n\tprivate ModbusTransport ... | import java.net.InetAddress;
import net.wimpi.modbus.io.ModbusTCPTransaction;
import net.wimpi.modbus.io.ModbusTransaction;
import net.wimpi.modbus.msg.ModbusRequest;
import net.wimpi.modbus.msg.WriteCoilRequest;
import net.wimpi.modbus.net.TCPMasterConnection;
import net.wimpi.modbus.Modbus; | /***
* Copyright 2002-2010 jamod development team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law... | int port = Modbus.DEFAULT_PORT; | 5 |
sastix/cms | server/src/test/java/com/sastix/cms/server/services/cache/CacheServiceTest.java | [
"@Getter @Setter @NoArgsConstructor\npublic class CacheDTO implements Serializable {\n\n /**\n * Serial Version UID.\n */\n private static final long serialVersionUID = 4215735359530723728L;\n\n /**\n * The key of the object to be cached\n */\n private String cacheKey;\n\n /**\n *... | import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import static org.junit.jupiter.api.Assertions.*;
import com.sastix.cms.common.cache.CacheDTO;
import com.sastix.cms.common.cache.QueryCacheDTO;
import com.sastix.cms.common.cache.RemoveCacheDTO;
import com.sa... | /*
* Copyright(c) 2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | } catch (DataNotFound e) { | 4 |
ChiralBehaviors/Kramer | kramer/src/main/java/com/chiralbehaviors/layout/PrimitiveLayout.java | [
"public static List<JsonNode> asList(JsonNode jsonNode) {\n List<JsonNode> nodes = new ArrayList<>();\n if (jsonNode == null) {\n return nodes;\n }\n if (jsonNode.isArray()) {\n jsonNode.forEach(node -> nodes.add(node));\n } else {\n return Collections.singletonList(jsonNode);\n ... | import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import javafx.geometry.Insets;
import javafx.scene.layout.Region;
import static com.chiralbehaviors.layout.schema.SchemaNode.asList;
import static com.chiralbehaviors.layout.style.Style.snap;
import java.ut... | /**
* Copyright (c) 2017 Chiral Behaviors, LLC, all rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | public LayoutCell<?> buildCell(FocusTraversal<?> pt) { | 2 |
mouton5000/DSTAlgoEvaluation | src/graphTheory/generators/RandomSteinerDirectedGraphGenerator2.java | [
"public class Arc implements Cloneable {\n\n\tprivate Integer input;\n\tprivate Integer output;\n\tprivate boolean isDirected;\n\n\tpublic Arc(Integer input, Integer output, boolean isDirected) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.isDirected = isDirected;\n\t}\n\n\tpublic Integer getInput... | import graphTheory.graph.Arc;
import graphTheory.graph.DirectedGraph;
import graphTheory.instances.steiner.classic.SteinerDirectedInstance;
import graphTheory.utils.probabilities.BooleanProbabilityLaw;
import graphTheory.utils.probabilities.DConstantLaw;
import graphTheory.utils.probabilities.DiscreteProbabilityLaw;
im... | package graphTheory.generators;
public class RandomSteinerDirectedGraphGenerator2 extends GraphGenerator<SteinerDirectedInstance> {
private static final String INPUT_NUMBER_OF_VERTICES_LAW = "RandomSteinerGraphGenerator2_numberOfVerticesLaw";
private static final String INPUT_PROBABILITY_OF_LINK_LAW = "RandomStein... | DirectedGraph dg = new DirectedGraph(); | 1 |
gustav9797/PowerfulPerms | PowerfulPerms/src/main/java/com/github/gustav9797/PowerfulPerms/command/UserAddGroupCommand.java | [
"public interface ICommand {\n public boolean hasPermission(String name, String permission); \n}",
"public interface Group {\n\n public int getId();\n\n public String getName();\n\n public List<Group> getParents();\n\n public String getPrefix(String server);\n\n public String getSuffix(String... | import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import com.github.gustav9797.PowerfulPerms.common.ICommand;
import com.github.gustav9797.PowerfulPermsAPI.Group;
import com.github.gustav9797.PowerfulPermsAPI.PermissionManage... | package com.github.gustav9797.PowerfulPerms.command;
public class UserAddGroupCommand extends SubCommand {
public UserAddGroupCommand(PowerfulPermsPlugin plugin, PermissionManager permissionManager) {
super(plugin, permissionManager);
usage.add("/pp user <user> addgroup <group> (server) (expires... | public CommandResult execute(final ICommand invoker, final String sender, final String[] args) throws InterruptedException, ExecutionException { | 0 |
seht/volumenotification | app/src/main/java/net/hyx/app/volumenotification/controller/NotificationServiceController.java | [
"public class NotificationFactory {\n\n private final String packageName;\n private final Context context;\n private final NotificationManager manager;\n private final SettingsModel settings;\n private final VolumeControlModel volumeControlModel;\n private final List<VolumeControl> items;\n\n p... | import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.util.Log;
import androidx.core.content.ContextCompat;
import net.hyx.app.volumenotification.factory.NotificationFactory;
import net.hyx.app.volumenotification.mod... | /*
* Copyright 2017 https://github.com/seht
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | NotificationFactory factory = new NotificationFactory(context); | 0 |
programingjd/okserver | src/main/java/info/jdavid/ok/server/handler/FileHandler.java | [
"@SuppressWarnings({ \"WeakerAccess\", \"unused\" })\npublic class MediaTypes {\n\n public static final MediaType CSS = MediaType.parse(\"text/css\");\n public static final MediaType CSV = MediaType.parse(\"text/csv\");\n public static final MediaType HTML = MediaType.parse(\"text/html\");\n public static final... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import javax.annotation.Nullable;
import info.jdavid.ok.server.MediaTypes;
import info.jdavid.o... | * @return the list of media types.
*/
protected Collection<MediaType> allowedMediaTypes() {
return MediaTypes.defaultAllowedMediaTypes();
}
@Override
public Handler setup() {
super.setup();
allowedMediaTypes.addAll(allowedMediaTypes());
return this;
}
private static final List<String... | final boolean gzip = compress && AcceptEncoding.supportsGZipEncoding(request.headers); | 3 |
AstartesGuardian/WebDAV-Server | WebDAV-Server/src/webdav/server/virtual/entity/standard/IRsGhost.java | [
"public class FileSystemPath\r\n{\r\n public FileSystemPath(String fileName, FileSystemPath parent)\r\n {\r\n this.fileName = fileName;\r\n this.parent = parent;\r\n this.fileSystemPathManager = parent.fileSystemPathManager;\r\n }\r\n public FileSystemPath(String fileName, FileSyste... | import http.FileSystemPath;
import http.server.exceptions.NotFoundException;
import http.server.exceptions.UserRequiredException;
import http.server.message.HTTPEnvRequest;
import java.time.Instant;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import j... | package webdav.server.virtual.entity.standard;
public abstract class IRsGhost extends Rs
{
public IRsGhost(FileSystemPath path)
{
this.path = path;
}
protected final FileSystemPath path;
@Override
public boolean isVisible(HTTPEnvRequest env) throws UserRequ... | public boolean canLock(LockKind lockKind, HTTPEnvRequest env) throws UserRequiredException
| 6 |
TakWolf/CNode-Material-Design | app/src/main/java/org/cnodejs/android/md/ui/widget/TopicWebView.java | [
"public class Reply {\n\n public enum UpAction {\n up,\n down\n }\n\n private String id;\n\n private Author author;\n\n private String content;\n\n @SerializedName(\"ups\")\n private List<String> upList;\n\n @SerializedName(\"reply_id\")\n private String replyId;\n\n @Ser... | import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Build;
import android.support.annotation.AttrRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.RequiresApi;
import android.support.annotation.StyleRes;
im... | package org.cnodejs.android.md.ui.widget;
public class TopicWebView extends CNodeWebView {
private static final String LIGHT_THEME_PATH = "file:///android_asset/topic_light.html";
private static final String DARK_THEME_PATH = "file:///android_asset/topic_dark.html";
private boolean pageLoaded = false;
... | addJavascriptInterface(new ImageJavascriptInterface(getContext()), ImageJavascriptInterface.NAME); | 4 |
xushaomin/apple-boot | apple-boot-core/src/main/java/com/appleframework/boot/core/ContainerHandle.java | [
"public class Log4jConfig implements LoggingConfigMXBean {\r\n\t\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic String[] getLoggers(String filter) {\r\n\t\tLoggerRepository r = LogManager.getLoggerRepository();\r\n\t\tEnumeration<Logger> enumList = r.getCurrentLoggers();\r\n\t\tLogger logger = null;\r\n\t\tList<... | import java.lang.management.ManagementFactory;
import java.util.Hashtable;
import java.util.List;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.appleframework.boot.core.logging.log4j.Log4jConfig;
import com.appleframe... | package com.appleframework.boot.core;
public class ContainerHandle {
private static Logger logger = LoggerFactory.getLogger(ContainerHandle.class);
public static void initLog4jContainer() {
try {
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
Container container = new Lo... | mbs.registerMBean(new MonitorConfig(), oname);
| 3 |
simo415/spc | src/com/sijobe/spc/command/Macro.java | [
"public class Constants {\n\n /**\n * Contains the version string of the current Minecraft version\n */\n public static final String VERSION = \"4.9\";\n \n /**\n * The name of the mod\n */\n public static final String NAME = \"Single Player Commands\";\n \n /**\n * The current version ... | import com.sijobe.spc.core.Constants;
import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterString;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandManager;
import com.sijobe.spc.wrapper.CommandSender;
impo... | package com.sijobe.spc.command;
/**
* Macro command allows you to write a file with a list of commands in it then
* run the file.
*
* @author simo_415
* @version 1.0
*/
@Command (
name = "macro",
description = "Macro based commands allow multiple commands to be run",
example = "test",
videoURL = "h... | public void execute(CommandSender sender, List<?> params) throws CommandException { | 6 |
MindscapeHQ/raygun4android | provider/src/main/java/com/raygun/raygun4android/RaygunMessageBuilder.java | [
"public class RaygunBreadcrumbMessage {\n private String message;\n private String category;\n private int level;\n private String type = \"Manual\";\n private Map<String, Object> customData;\n private Long timestamp = System.currentTimeMillis();\n private String className;\n private String ... | import android.content.Context;
import com.raygun.raygun4android.messages.crashreporting.RaygunBreadcrumbMessage;
import com.raygun.raygun4android.messages.crashreporting.RaygunClientMessage;
import com.raygun.raygun4android.messages.crashreporting.RaygunEnvironmentMessage;
import com.raygun.raygun4android.messages.cra... | package com.raygun.raygun4android;
public class RaygunMessageBuilder implements IRaygunMessageBuilder {
private RaygunMessage raygunMessage;
private RaygunMessageBuilder() {
raygunMessage = new RaygunMessage();
}
@Override
public RaygunMessage build() {
return raygunMessage;
... | raygunMessage.getDetails().setError(new RaygunErrorMessage(throwable)); | 3 |
milenkovicm/netty-kafka-producer | src/test/java/com/github/milenkovicm/kafka/ControlBrokerTest.java | [
"public class ControlKafkaBroker extends AbstractKafkaBroker {\n\n public ControlKafkaBroker(String host, int port, String topicName, EventLoopGroup workerGroup, ProducerProperties properties) {\n super(host, port, topicName, workerGroup, properties);\n }\n\n @Override\n protected ChannelInitiali... | import static org.hamcrest.CoreMatchers.is;
import com.github.milenkovicm.kafka.connection.ControlKafkaBroker;
import com.github.milenkovicm.kafka.connection.KafkaPromise;
import com.github.milenkovicm.kafka.protocol.Error;
import com.github.milenkovicm.kafka.protocol.KafkaException;
import com.github.milenkovicm.kafka... | /*
* Copyright 2015 Marko Milenkovic (http://github.com/milenkovicm)
*
* 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 requir... | ControlKafkaBroker controlKafkaChannel = new ControlKafkaBroker("localhost", START_PORT, topic, new NioEventLoopGroup(),properties); | 0 |
jboss-logging/jboss-logmanager | ext/src/test/java/org/jboss/logmanager/ext/PropertyConfigurationTests.java | [
"public abstract class ExtHandler extends Handler implements AutoCloseable, Flushable {\n\n private static final ErrorManager DEFAULT_ERROR_MANAGER = new OnlyOnceErrorManager();\n private static final Permission CONTROL_PERMISSION = new LoggingPermission(\"control\", null);\n\n private volatile boolean aut... | import java.io.PrintWriter;
import java.io.Reader;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Properties;
im... | testDefault(3, 1);
final Logger logger = logContext.getLoggerIfExists(loggerName);
Assert.assertNotNull(logger);
final TestHandler testHandler = findType(TestHandler.class, logger.getHandlers());
Assert.assertNotNull("Failed to find TestHandler", testHandler);
Assert.ass... | final Handler handler = findType(ConsoleHandler.class, handlers); | 4 |
ryanramage/couch-audio-recorder | src/main/java/com/googlecode/eckoit/audio/SplitAudioRecorderManager.java | [
"public class ConversionFinishedEvent {\n private File finishedFile;\n private File availableToStream;\n private int streamDuration;\n private String segmentCount;\n\n\n public ConversionFinishedEvent(File finishedFile) {\n this.finishedFile = finishedFile;\n }\n\n public File getFinishe... | import com.googlecode.eckoit.events.ConversionFinishedEvent;
import com.googlecode.eckoit.events.PostProcessingStartedEvent;
import com.googlecode.eckoit.events.RecordingCompleteEvent;
import com.googlecode.eckoit.events.RecordingSplitEvent;
import com.googlecode.eckoit.events.RecordingStartClickedEvent;
import com.goo... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.googlecode.eckoit.audio;
/**
*
* @author ryan
*/
public class SplitAudioRecorderManager {
SplitAudioRecorder recorder = SplitAudioRecorder.getSingletonObject();
ContinousAudioConvereter cac... | EventBus.subscribeStrongly(ConversionFinishedEvent.class, new EventSubscriber<ConversionFinishedEvent>() { | 0 |
release-engineering/pom-version-manipulator | src/main/java/com/redhat/rcm/version/mgr/VersionManager.java | [
"public static File writeModifiedPom( final Model model, final File pom, final ProjectKey coord,\n final String version, final File basedir, final VersionManagerSession session,\n final boolean relocatePom )\n{\n normalizeModel( model );\n\n... | import static com.redhat.rcm.version.mgr.mod.ProjectModder.IMPLIED_MODIFICATIONS;
import static com.redhat.rcm.version.util.InputUtils.getIncludedSubpaths;
import static com.redhat.rcm.version.util.PomUtils.writeModifiedPom;
import static org.apache.commons.io.IOUtils.closeQuietly;
import java.io.File;
import java.io.F... | /*
* Copyright (c) 2012 Red Hat, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is dist... | @Requirement( role = Report.class ) | 3 |
DigiArea/es5-model | com.digiarea.es5/src/com/digiarea/es5/TryStatement.java | [
"public abstract class Statement extends Node {\r\n\r\n Statement() {\r\n super();\r\n }\r\n\r\n Statement(JSDocComment jsDocComment, int posBegin, int posEnd) {\r\n super(jsDocComment, posBegin, posEnd);\r\n }\r\n\r\n}\r",
"public final class Block extends Statement {\r\n\r\n /** \r\... | import com.digiarea.es5.Statement;
import com.digiarea.es5.Block;
import com.digiarea.es5.CatchClause;
import com.digiarea.es5.JSDocComment;
import com.digiarea.es5.visitor.VoidVisitor;
import com.digiarea.es5.visitor.GenericVisitor;
| package com.digiarea.es5;
/**
* The Class TryStatement.
*/
public class TryStatement extends Statement {
/**
* The try block.
*/
private Block tryBlock;
/**
* The catch clause.
*/
private CatchClause catchClause;
/**
* The finally block.
*... | public <C> void accept(VoidVisitor<C> v, C ctx) throws Exception {
| 4 |
kovertopz/Paulscode-SoundSystem | src/main/java/paulscode/sound/libraries/LibraryJavaSound.java | [
"public class Channel\n{\n/**\n * The library class associated with this type of channel.\n */\n protected Class libraryType = Library.class;\n \n/**\n * Global identifier for the type of channel (normal or streaming). Possible \n * values for this varriable can be found in the \n * {@link paulscode.sound.So... | import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.Clip;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.FloatControl;
import javax.sound.sampled.Mixer;
import javax.sound.sampled.SourceDataLine;
import java.net.URL;
import java.util.HashMap;
impor... | package paulscode.sound.libraries;
/**
* The LibraryJavaSound class interfaces the JavaSound library.
* For more information about the JavaSound API, visit
* http://java.sun.com/products/java-media/sound/
*<br><br>
*<b><i> SoundSystem LibraryJavaSound License:</b></i><br><b><br>
* You are free to us... | public boolean loadSound( FilenameURL filenameURL ) | 1 |
paulrzcz/montecarlo | src/test/java/cz/paulrz/montecarlo/tests/PercentileTests.java | [
"public class MedianAccumulator implements Accumulator<Double, Double> {\n\n private final DescriptiveStatistics statistics;\n\n /**\n * Default constructor\n */\n public MedianAccumulator() {\n statistics = new DescriptiveStatistics();\n }\n\n /**\n * Copy constructor\n * @par... | import cz.paulrz.montecarlo.accumulator.MedianAccumulator;
import cz.paulrz.montecarlo.random.FastGaussianRandomGenerator;
import cz.paulrz.montecarlo.random.FastRandomFactory;
import cz.paulrz.montecarlo.random.ParallelPercentile;
import cz.paulrz.montecarlo.single.GeometricBrownianMotionProcess;
import cz.paulrz.mont... | package cz.paulrz.montecarlo.tests;
/**
* User: paul
* Date: 29/9/11
* Time: 16:03 PM
*/
public class PercentileTests extends TestCase {
private final int size = 1000000;
public void testPerformance() {
NormalizedRandomGenerator nrg = new FastGaussianRandomGenerator();
double[] values = ... | ParallelPercentile percentile = new ParallelPercentile(50.0); | 3 |
Rsgm/Hakd | core/src/game/pythonapi/PyDebug.java | [
"public class Hakd extends Game {\n public static Hakd HAKD;\n\n private Preferences prefs;\n // private static Preferences save1; // save this for later // Use kryo\n\n private GamePlay gamePlay;\n\n public static final AssetManager assets = new AssetManager(new HakdFileHandleResolver());\n\n pub... | import game.Hakd;
import game.Internet;
import game.gameplay.City;
import game.gameplay.Player;
import gui.windows.device.Terminal;
import networks.InternetProviderNetwork;
import networks.Network;
import networks.NetworkFactory; | package game.pythonapi;
public class PyDebug {
private final Terminal terminal;
public PyDebug(Terminal terminal) {
this.terminal = terminal;
}
public Internet getInternet() {
return terminal.getDevice().getNetwork().getInternet();
}
| public Player getPlayer() { | 3 |
tassioauad/GameCheck | app/src/main/java/com/tassioauad/gamecheck/view/activity/SearchGameActivity.java | [
"public class GameCatalogApplication extends Application {\n\n private ObjectGraph objectGraph;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n objectGraph = ObjectGraph.create(\n new Object[]{\n new AppModule(GameCatalogApplication.this)... | import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.su... | package com.tassioauad.gamecheck.view.activity;
public class SearchGameActivity extends AppCompatActivity implements SearchGameView {
@Inject
SearchGamePresenter presenter;
private final int numberOfColumns = 2;
private List<Game> gameList;
private String name;
private static final String... | ((GameCatalogApplication) getApplication()).getObjectGraph().plus(new SearchGameViewModule(this)).inject(this); | 0 |
pravinkmrr/PanoramaGL-Android | src/com/android/panoramagl/PLObject.java | [
"public enum UIDeviceOrientation \r\n{\r\n\tUIDeviceOrientationUnknown,\r\n\tUIDeviceOrientationPortrait,\r\n\tUIDeviceOrientationPortraitUpsideDown,\r\n\tUIDeviceOrientationLandscapeLeft,\r\n\tUIDeviceOrientationLandscapeRight,\r\n\tUIDeviceOrientationFaceUp,\r\n\tUIDeviceOrientationFaceDown\r\n}\r",
"public cla... | import com.android.panoramagl.iphone.enumeration.UIDeviceOrientation;
import com.android.panoramagl.iphone.structs.CGPoint;
import com.android.panoramagl.structs.PLPosition;
import com.android.panoramagl.structs.PLRange;
import com.android.panoramagl.structs.PLRotation;
| /*
* This file is part of the PanoramaGL library for Android.
*
* Authors: Javier Baez <javbaezga@gmail.com> and Miguel auay <mg_naunay@hotmail.com>
*
* $Id$
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* publishe... | protected UIDeviceOrientation oldOrientation, orientation;
| 0 |
limdingwen/space-cubes | src/com/github/limdingwen/SpaceCubes/SaveTask.java | [
"public class ChunkLevelEncoder {\n\tpublic static void encodeChunk(String worldName, Chunk chunk, int x, int y) throws FileNotFoundException, IOException {\n\t\tFileOutputStream chunkStream = null;\n\t\tFile file = new File(SystemNativesHelper.defaultDirectory() + \"/saves/\" + worldName + \"/c\" + x + \"|\" + y +... | import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.TimerTask;
import com.github.limdingwen.SpaceCubes.File.ChunkLevelEncoder;
import com.github.limdingwen.SpaceCubes.File.LevelDataEncoder;
import com.github.limdingwen.SpaceCubes.Rendering.RenderEngine;
import com.github.limdingwen.SpaceC... | package com.github.limdingwen.SpaceCubes;
public class SaveTask extends TimerTask {
@Override
public void run() {
Chunk chunk = RenderEngine.world.getChunkAtBlockCoords( | World.coordRealToBlock(Main.player.translation)); | 4 |
hecoding/Pac-Man | src/pacman/game/Game.java | [
"public enum DM {PATH, EUCLID, MANHATTAN};",
"public enum GHOST\n{\n\tBLINKY(40),\n\tPINKY(60),\n\tINKY(80),\n\tSUE(100);\n\t\t\n\tpublic final int initialLairTime;\n\t\t\n\tGHOST(int lairTime)\n\t{\n\t\tthis.initialLairTime=lairTime;\n\t}\n};",
"public enum MOVE \n{\n\tUP {\n\t\tpublic MOVE opposite() {\n\t\t\... | import java.util.BitSet;
import java.util.EnumMap;
import java.util.Random;
import java.util.Map.Entry;
import pacman.game.Constants.DM;
import pacman.game.Constants.GHOST;
import pacman.game.Constants.MOVE;
import pacman.game.internal.Ghost;
import pacman.game.internal.Maze;
import pacman.game.internal.Node;
import pa... | package pacman.game;
/**
* The implementation of Ms Pac-Man. This class contains the game engine and all methods required to
* query the state of the game. First, the mazes are loaded once only as they are immutable. The game
* then proceeds to initialise all variables using default values. The game class also pr... | pacman=new PacMan(currentMaze.initialPacManNodeIndex,MOVE.LEFT,NUM_LIVES,false); | 2 |
noboomu/proteus | proteus-core/src/test/java/io/sinistral/proteus/test/controllers/Tests.java | [
"public static <T> ServerResponse<T> response(Class<T> clazz)\n{\n return new ServerResponse<T>();\n}",
"public static AttachmentKey<String> DEBUG_TEST_KEY = AttachmentKey.create(String.class);",
"public class ServerRequest {\n\n private static final Logger logger = LoggerFactory.getLogger(ServerRequest.c... | import static io.sinistral.proteus.server.ServerResponse.response;
import static io.sinistral.proteus.test.wrappers.TestWrapper.DEBUG_TEST_KEY;
import java.io.File;
import java.math.BigDecimal;
import java.nio.ByteBuffer;
import java.sql.Timestamp;
import java.time.Instant;
import java.time.OffsetDateTime;
import java.... | /**
*
*/
package io.sinistral.proteus.test.controllers;
/**
* @author jbauer
*
*/
@SuppressWarnings("ALL")
@Path("/tests")
@Produces((MediaType.APPLICATION_JSON))
@Consumes((MediaType.MEDIA_TYPE_WILDCARD))
@Singleton
@Chain({TestClassWrapper.class})
public class Tests
{
private static final ByteBuffe... | public ServerResponse<User> responseUserJson(ServerRequest request) | 3 |
allegro/elasticsearch-reindex-tool | src/test/java/pl/allegro/tech/search/elasticsearch/tools/reindex/ReindexInvokerTest.java | [
"public class ElasticDataPointer {\n\n private final String host;\n private final String clusterName;\n private final String indexName;\n private final String typeName;\n private final int port;\n private final boolean sniff;\n\n ElasticDataPointer(String host, String clusterName, String indexName, String ty... | import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import pl.allegro.tech.search.elasticsearch.tools.reindex.connection.ElasticDataPointer;
import pl.allegro.tech.search.elastic... | package pl.allegro.tech.search.elasticsearch.tools.reindex;
public class ReindexInvokerTest {
private static final String SOURCE_INDEX = "sourceindex";
private static final String TARGET_INDEX = "targetindex";
public static final String DATA_TYPE = "type";
private static EmbeddedElasticsearchCluster embed... | ReindexInvoker.invokeReindexing(sourceDataPointer, targetDataPointer, EmptySegmentation.createEmptySegmentation(elasticSearchQuery)); | 5 |
Plinz/Hive_Game | src/main/java/model/piece/Ant.java | [
"public class Board implements Cloneable{\n\n\tprivate ArrayList<Column> columns;\n\tprivate int nbPieceOnTheBoard;\n\n\tpublic Board() {\n\t\tinit();\n\t\tnbPieceOnTheBoard = 0;\n\t}\n\n\tpublic Board(Board b) {\n\t\tcolumns = new ArrayList<Column>();\n\t\tfor (Column column : b.getBoard()) {\n\t\t\tColumn newColu... | import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import main.java.model.Board;
import main.java.model.Piece;
import main.java.model.Tile;
import main.java.utils.Consts;
import main.java.utils.CoordGene; | package main.java.model.piece;
public class Ant extends Piece {
public Ant(int id, int team) { | super(Consts.ANT_NAME, id, team, "La fourmi peut se déplacer d'autant d'espaces que le joueur le désire"); | 3 |
respoke/respoke-sdk-android | respokeSDKTest/src/androidTest/java/com/digium/respokesdktest/functional/ConnectionTests.java | [
"public class Respoke {\n\n public final static int GUID_STRING_LENGTH = 36; // The length of GUID strings\n\n private static Respoke _instance;\n private static boolean factoryStaticInitialized;\n private String pushToken;\n private ArrayList<RespokeClient> instances;\n private Context context;\n... | import android.util.Log;
import com.digium.respokesdk.Respoke;
import com.digium.respokesdk.RespokeCall;
import com.digium.respokesdk.RespokeClient;
import com.digium.respokesdk.RespokeDirectConnection;
import com.digium.respokesdk.RespokeEndpoint;
import com.digium.respokesdk.RespokeGroup;
import com.digium.respokesdk... | /**
* Copyright 2015, Digium, Inc.
* All rights reserved.
*
* This source code is licensed under The MIT License found in the
* LICENSE file in the root directory of this source tree.
*
* For all details and documentation: https://www.respoke.io
*/
package com.digium.respokesdktest.functional;
public cla... | public void onMessage(String message, RespokeEndpoint endpoint, RespokeGroup group, Date timestamp, Boolean didSend) { | 5 |
reflectoring/gitanizer | src/main/java/org/wickedsource/gitanizer/mirror/delete/DeleteMirrorController.java | [
"@ResponseStatus(HttpStatus.NOT_FOUND)\npublic class ResourceNotFoundException extends RuntimeException {\n}",
"@Configuration\npublic class WorkdirConfiguration {\n\n private Path applicationWorkdir;\n\n private MirrorRepository mirrorRepository;\n\n @Autowired\n public WorkdirConfiguration(Environme... | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.metrics.CounterService;
import org.springframework.boot.actuate.metrics.GaugeService;
import org.springframework.core.env.Environment;
import org.springframewor... | package org.wickedsource.gitanizer.mirror.delete;
@Controller
@Transactional
public class DeleteMirrorController {
public static final String COUNTER_ACTIVE_TASKS = "gitanizer.counter.deleteTasks.currentlyActive";
public static final String COUNTER_QUEUED_TASKS = "gitanizer.counter.deleteTasks.currentlyQue... | private MirrorRepository mirrorRepository; | 3 |
straumat/blockchain2graph | bitcoin-neo4j/project-back-end/src/main/java/com/oakinvest/b2g/service/BitcoinCoreServiceImplementation.java | [
"@SuppressWarnings(\"unused\")\n@JsonIgnoreProperties(ignoreUnknown = true)\npublic class GetBlockResponse extends BitcoinCoreResponse {\n\n\t/**\n\t * Result field.\n\t */\n\tprivate GetBlockResult result;\n\n\t/**\n\t * Getter of result.\n\t *\n\t * @return result\n\t */\n\tpublic final GetBlockResult getResult()... | import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.oakinvest.b2g.dto.bitcoin.core.getblock.GetBlockResponse;
import com.oakinvest.b2g.dto.bitcoin.core.getblockcount.GetBlockCountResponse;
import com.oakinvest.b2g.dto.bitcoin.core.getblockhash.GetBlo... | package com.oakinvest.b2g.service;
/**
* Default implementation of core call.
* <p>
* Created by straumat on 26/08/16.
*/
@Service
public class BitcoinCoreServiceImplementation implements BitcoinCoreService {
/**
* Logger.
*/
private final Logger log = LoggerFactory.getLogger(BitcoinCoreServic... | public GetRawTransactionResponse getRawTransaction(final String transactionHash) { | 3 |
sagemath/android | src/org/sagemath/droid/fragments/ManageInsertFragment.java | [
"public class InsertsAdapter extends BaseAdapter {\n private static final String TAG = \"SageDroid:InsertsAdapter\";\n\n private Context context;\n private LayoutInflater inflater;\n private SageSQLiteOpenHelper helper;\n private Typeface fontAwesome;\n\n private Highlighter highlighter;\n\n pr... | import android.annotation.TargetApi;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.ListFragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.SearchView;
import... | package org.sagemath.droid.fragments;
/**
* ListFragment which displays the Insert
*
* @author Nikhil Peter Raj
*/
public class ManageInsertFragment extends ListFragment implements SearchView.OnQueryTextListener {
private static final String TAG = "SageDroid:ManageInsertFragment";
private static final S... | ToastUtils.getAlertToast(getActivity() | 4 |
tinkerpop/frames | src/test/java/com/tinkerpop/frames/FramedVertexTest.java | [
"public interface NamedObject extends VertexFrame {\n\n @Property(\"name\")\n public String getName();\n\n @Property(\"name\")\n public void setName(final String name);\n}",
"public interface Person extends NamedObject {\n enum Gender {FEMALE, MALE};\n\n @Property(\"age\")\n public Integer ge... | import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph;
import com.tinkerpop.blueprints.impls.tg.TinkerGraphFactory;
import com.tinke... | package com.tinkerpop.frames;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
* @author Joshua Shinavier (http://fortytwo.net)
*/
public class FramedVertexTest {
private Graph graph;
private FramedGraph<Graph> framedGraph;
private Person marko;
private Person vadas;
private Pro... | private Knows markoKnowsVadas; | 6 |
SQiShER/java-object-diff | src/main/java/de/danielbechler/diff/access/CollectionItemAccessor.java | [
"public class EqualsIdentityStrategy implements IdentityStrategy\n{\n\tprivate static final EqualsIdentityStrategy instance = new EqualsIdentityStrategy();\n\n\tpublic boolean equals(final Object working, final Object base)\n\t{\n\t\treturn Objects.isEqual(working, base);\n\t}\n\n\tpublic static EqualsIdentityStrat... | import de.danielbechler.diff.identity.EqualsIdentityStrategy;
import de.danielbechler.diff.identity.IdentityStrategy;
import de.danielbechler.diff.selector.CollectionItemElementSelector;
import de.danielbechler.diff.selector.ElementSelector;
import de.danielbechler.util.Assert;
import java.util.Collection;
import java.... | /*
* Copyright 2012 Daniel Bechler
*
* 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 i... | this(referenceItem, EqualsIdentityStrategy.getInstance()); | 0 |
ChillingVan/AndroidInstantVideo | app/src/main/java/com/chillingvan/instantvideo/sample/test/publisher/TestCameraPublisherActivity.java | [
"public class CameraPreviewTextureView extends GLMultiTexProducerView {\n\n private H264Encoder.OnDrawListener onDrawListener;\n private IAndroidCanvasHelper drawTextHelper = IAndroidCanvasHelper.Factory.createAndroidCanvasHelper(IAndroidCanvasHelper.MODE.MODE_ASYNC);\n private Paint textPaint;\n\n publ... | import android.graphics.SurfaceTexture;
import android.hardware.Camera;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.w... | /*
*
* *
* * * Copyright (C) 2017 ChillingVan
* * *
* * * 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
*... | cameraPreviewTextureView.setOnDrawListener(new H264Encoder.OnDrawListener() { | 2 |
DeFuture/AmazeFileManager-master | src/main/java/com/amaze/filemanager/utils/Futils.java | [
"public class DbViewer extends ActionBarActivity {\n\n private SharedPreferences Sp;\n private String skin, path;\n private boolean rootMode;\n private ListView listView;\n private ArrayList<String> arrayList;\n private ArrayAdapter arrayAdapter;\n private Cursor c;\n private File pathFile;\... | import android.content.ActivityNotFoundException;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import... | public boolean deletefiles(File f) {
// make sure directory exists
if (!f.exists()) {
System.out.println("Directory does not exist.");
return false;
} else {
try {
if(f.isDirectory())
return deletedirectory(f);
... | Intent intent = new Intent(m, ExtractService.class); | 5 |
raulh82vlc/Transactions-Viewer | android/src/main/java/com/raulh82vlc/TransactionsViewer/ui/fragments/ProductsListFragment.java | [
"public class CustomException extends Exception {\n public CustomException(String detailMessage) {\n super(detailMessage);\n }\n}",
"public class ProductUI implements Parcelable {\n\n private String sku;\n private List<TransactionUI> transactions;\n\n public static final Creator<ProductUI> C... | import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.... | /*
* Copyright (C) 2017 Raul Hernandez Lopez @raulh82vlc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | } catch (CustomException e) { | 0 |
carlanton/mpd-tools | parser/src/test/java/io/lindstrom/mpd/data/DataTypeTest2.java | [
"public class GenericDescriptor extends Descriptor {\n @JacksonXmlProperty(isAttribute = true, localName = \"value\")\n private final String value;\n\n public GenericDescriptor(String schemeIdUri, String value, String id) {\n super(schemeIdUri, id);\n this.value = value;\n }\n\n public ... | import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.lindstrom.mpd.data.descriptor.GenericDescriptor;
import io.lindstrom.mpd.data.descriptor.Role;
import io.lindstrom.mpd.data.descriptor.protection.Mp4Protection;
import io.lindstrom.mpd.data.descriptor.protection.PlayReadyContentProtection;
impo... | package io.lindstrom.mpd.data;
public class DataTypeTest2 {
private Class<?> clazz;
private Class<?> builderClazz;
private Class<?> setClazz(Class<?> clazz) {
this.clazz = clazz;
return builderClass(clazz);
}
@ParameterizedTest
@MethodSource("params")
public void build... | GenericDescriptor.class, | 0 |
yunnet/kafkaEagle | src/main/java/org/smartloli/kafka/eagle/web/service/impl/ConsumerServiceImpl.java | [
"public class ConsumerDomain {\n\n\tprivate int id;\n\tprivate String group;\n\tprivate int topics;\n\tprivate String node;\n\tprivate int activeNumber;\n\n\tpublic int getActiveNumber() {\n\t\treturn activeNumber;\n\t}\n\n\tpublic void setActiveNumber(int activeNumber) {\n\t\tthis.activeNumber = activeNumber;\n\t}... | import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.smartloli.kafka.eagle.comm... | /**
* 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... | List<TopicConsumerDomain> kafkaConsumerDetails = new ArrayList<TopicConsumerDomain>(); | 2 |
hubinix/kamike.divide | kamikeDivide/src/com/kami/console/Console.java | [
"public class SysInit {\n\n public void startup() {\n String fileName = SysInit.class.getResource(\"\").toString() + SystemConstants.INITIAL_CONFIG_FILE;\n fileName = fileName.replaceAll(\"file:/\", \"\");\n Configuration conf = new Configuration(fileName);\n //SystemConfig.getInstanc... | import com.kami.misc.SysInit;
import com.kamike.config.SystemConfig;
import com.kamike.db.GenericCreator;
import com.kamike.db.Transaction;
import com.kamike.divide.KamiDbInst;
import com.kamike.message.EventInst;
import java.util.ArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.logging.Level;
im... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.kami.console;
/**
*
* @author THiNk
*/
public class Console {
/**
* @param args the command line arguments
... | SysInit sys = new SysInit(); | 0 |
axxepta/project-argon | src/main/java/de/axxepta/oxygen/actions/AddNewFileAction.java | [
"public enum BaseXSource {\r\n\r\n /**\r\n * Database.\r\n */\r\n DATABASE(\"argon\"),\r\n// /**\r\n// * RESTXQ.\r\n// */\r\n// RESTXQ(\"argonquery\"),\r\n /**\r\n * Repository.\r\n */\r\n REPO(\"argonrepo\");\r\n\r\n private final String protocol;\r\n\r\n BaseXSource... | import de.axxepta.oxygen.api.BaseXSource;
import de.axxepta.oxygen.tree.ArgonTree;
import de.axxepta.oxygen.tree.ArgonTreeNode;
import de.axxepta.oxygen.tree.TreeListener;
import de.axxepta.oxygen.tree.TreeUtils;
import de.axxepta.oxygen.utils.ConnectionWrapper;
import de.axxepta.oxygen.utils.DialogTools;
import... | package de.axxepta.oxygen.actions;
/**
* @author Markus on 20.10.2015.
*/
public class AddNewFileAction extends AbstractAction {
private static final Logger logger = LogManager.getLogger(AddNewFileAction.class);
private final ArgonTree tree;
private JDialog newFileDialog;
private J... | String urlString = ((ArgonTreeNode) path.getLastPathComponent()).getTag().toString();
| 2 |
spotify/hdfs2cass | src/main/java/com/spotify/hdfs2cass/LegacyHdfs2Cass.java | [
"public class CassandraParams implements Serializable {\n private static final Logger logger = LoggerFactory.getLogger(CassandraParams.class);\n\n public static final String SCRUB_CASSANDRACLUSTER_PARTITIONER_CONFIG = \"scrub.cassandracluster.com.spotify.cassandra.thrift.partitioner\";\n public static final Stri... | import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.spotify.hdfs2cass.cassandra.utils.CassandraParams;
import com.spotify.hdfs2cass.crunch.cql.CQLRecord;
impo... | /*
* Copyright 2014 Spotify AB. All rights reserved.
*
* The contents of this file are 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
*... | .write(new CQLTarget(outputUri, params)); | 2 |
petitparser/java-petitparser | petitparser-core/src/test/java/org/petitparser/PrimitiveTest.java | [
"public static <T> void assertFailure(Parser parser, String input) {\n assertFailure(parser, input, 0);\n}",
"public static <T> void assertSuccess(Parser parser, String input, T result) {\n assertSuccess(parser, input, result, input.length());\n}",
"public abstract class Parser {\n\n /**\n * Primitive meth... | import static org.petitparser.Assertions.assertFailure;
import static org.petitparser.Assertions.assertSuccess;
import org.junit.Test;
import org.petitparser.parser.Parser;
import org.petitparser.parser.primitive.EpsilonParser;
import org.petitparser.parser.primitive.FailureParser;
import org.petitparser.parser.primiti... | package org.petitparser;
/**
* Tests {@link EpsilonParser}, {@link FailureParser} and {@link StringParser}.
*/
public class PrimitiveTest {
@Test
public void testEpsilon() {
Parser parser = new EpsilonParser();
assertSuccess(parser, "", null);
assertSuccess(parser, "a", null, 0);
}
@Test
pu... | assertFailure(parser, "", "wrong"); | 0 |
8Yards/Nebula_Android | src/org/nebula/activities/Delete.java | [
"public class RESTGroupManager extends Resource {\r\n\r\n\tpublic RESTGroupManager() {\r\n\t\tsuper(\"RESTGroups\");\r\n\t}\r\n\r\n\tpublic List<Group> retrieveAllGroupsMembers() throws JSONException,\r\n\t\t\tClientProtocolException, IOException {\r\n\t\tResponse r = this.get(\"retrieveAllGroupsMembers\");\r\n\t\t... | import java.util.ArrayList;
import java.util.List;
import org.nebula.R;
import org.nebula.client.rest.RESTGroupManager;
import org.nebula.main.NebulaApplication;
import org.nebula.models.Group;
import org.nebula.models.Profile;
import org.nebula.models.Status;
import android.app.Activity;
import android.app.AlertDialog... | /*
* author: saad ali
* refactored by: saad, prajwol
*/
package org.nebula.activities;
public class Delete extends Activity implements OnItemSelectedListener,
DialogInterface.OnClickListener,
DialogInterface.OnMultiChoiceClickListener {
public static final int DELETEGROUP_SUCCESSFUL = 0;
public static fin... | private List<Group> myGroups; | 2 |
vgoldin/cqrs-eventsourcing-kafka | services-infrastructure-eventstore/src/main/java/io/plumery/eventstore/EventStoreAwareRepository.java | [
"public abstract class AggregateRoot {\n private static final Logger logger = LoggerFactory.getLogger(AggregateRoot.class);\n\n private static final String APPLY_METHOD_NAME = \"apply\";\n private final List<Event> changes = new ArrayList<>();\n\n public ID id;\n public int version;\n\n protected ... | import com.google.common.base.Preconditions;
import com.google.common.collect.Iterables;
import io.plumery.core.AggregateRoot;
import io.plumery.core.Event;
import io.plumery.core.ID;
import io.plumery.core.infrastructure.EventStore;
import io.plumery.core.infrastructure.Repository;
import io.plumery.eventstore.excepti... | package io.plumery.eventstore;
/**
* Generic Event Store aware Repository implementation
*/
public abstract class EventStoreAwareRepository<T extends AggregateRoot> implements Repository<T> {
protected EventStore store;
@Override
public void save(T aggregate, int version) {
Preconditions.check... | public T getById(ID id) { | 2 |
CreativeMD/IGCM | src/main/java/com/creativemd/igcm/machines/AdvancedWorkbench.java | [
"@Mod(modid = IGCM.modid, version = IGCM.version, name = \"InGameConfigManager\", acceptedMinecraftVersions = \"\", dependencies = \"required-before:creativecore\")\npublic class IGCM {\n\t\n\tpublic static Logger logger = LogManager.getLogger(IGCM.modid);\n\t\n\tpublic static final String modid = \"igcm\";\n\tpubl... | import java.util.ArrayList;
import java.util.List;
import com.creativemd.creativecore.common.gui.ContainerControl;
import com.creativemd.creativecore.common.gui.GuiControl;
import com.creativemd.creativecore.common.gui.controls.gui.GuiTextfield;
import com.creativemd.creativecore.common.utils.stack.InfoStack;
import co... | package com.creativemd.igcm.machines;
public class AdvancedWorkbench extends RecipeMachine<AdvancedGridRecipe> {
public AdvancedWorkbench(String id, String title, ItemStack avatar) {
super(id, title, avatar);
}
@Override
public int getWidth() {
return BlockAdvancedWorkbench.gridSize;
}
@Override
pu... | IGCM.overrideWorkbench = (Boolean) mainBranch.getValue("overrideWorkbench"); | 0 |
nullpointerexceptionapps/TeamCityDownloader | java/com/raidzero/teamcitydownloader/fragments/ProjectsListFragment.java | [
"public class ControllerActivity extends Activity {\n private static final String tag = \"ControllerActivity\";\n\n boolean showConfigs = false;\n boolean gotoStarred = false;\n\n TeamCityProject selectedProject;\n TeamCityItem selectedBuildConfig;\n TeamCityBuild selectedBuild;\n TeamCityArtif... | import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.TextView;
import com.... | package com.raidzero.teamcitydownloader.fragments;
/**
* Created by posborn on 6/26/14.
*/
public class ProjectsListFragment extends BaseTeamCityFragment implements AdapterView.OnItemClickListener {
private static final String tag = "ProjectsListFragment";
private ArrayList<TeamCityProject> projects = ne... | Intent i = new Intent(activity, ControllerActivity.class); | 0 |
gtri/typesafeconfig-extensions | factory/src/main/java/edu/gatech/gtri/typesafeconfigextensions/factory/ConfigSourceList.java | [
"public interface Function<A, B> {\n\n B apply(A a);\n}",
"public final class EqualsEquivalence<A>\nimplements Equivalence<A> {\n\n @Override\n public boolean equals(A x, A y) {\n return x.equals(y);\n }\n\n @Override\n public int hashCode(A x) {\n return x.hashCode();\n }\n\n ... | import edu.gatech.gtri.typesafeconfigextensions.internal.Function;
import edu.gatech.gtri.typesafeconfigextensions.internal.equivalence.EqualsEquivalence;
import edu.gatech.gtri.typesafeconfigextensions.internal.equivalence.Equivalence;
import java.util.ArrayList;
import java.util.List;
import static edu.gatech.gtri.ty... | /*
* Copyright 2013 Georgia Tech Applied Research Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | public Equivalence<ConfigSourceName> identifierEquivalence() { | 2 |
darrenfoong/candc | src/ParserBeamNN.java | [
"public class RuleInstancesParams {\n\tprivate boolean allRules;\n\tprivate boolean rightPunct;\n\tprivate boolean leftPunct;\n\tprivate boolean leftPunctConj;\n\tprivate boolean backwardComp;\n\tprivate boolean conj;\n\tprivate String directory;\n\n\tpublic RuleInstancesParams(boolean allRules, boolean rightPunct,... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import cat_combination.Rul... |
public class ParserBeamNN {
public static void main(String[] args) {
OptionParser optionParser = Params.getParserBeamNNOptionParser();
OptionSet options = null;
try {
options = optionParser.parse(args);
if ( options.has("help") ) {
optionParser.printHelpOn(System.out);
return;
}
} catch ( ... | parser = new ChartParserBeamNN(grammarDir, altMarkedup, | 2 |
3pillarlabs/spring-integration-aws | spring-integration-aws/src/main/java/org/springframework/integration/aws/sns/core/SnsExecutor.java | [
"public abstract class AwsUtil {\n\n\tpublic abstract static class AddPermissionHandler {\n\n\t\tpublic abstract void execute(Permission p);\n\t}\n\n\tpublic static void addPermissions(Map<String, String> attributes,\n\t\t\tSet<Permission> permissions, AddPermissionHandler handler) {\n\n\t\tString policyStr = attri... | import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.integration.Message;
impo... | if (regionId != null) {
client.setEndpoint(String.format("sns.%s.amazonaws.com",
regionId));
}
if (topicArn == null) {
createTopicIfNotExists();
}
processSubscriptions();
addPermissions();
}
}
private void createTopicIfNotExists() {
for (Topic topic : client.listTopics().getTopics... | AwsUtil.addPermissions(result.getAttributes(), permissions, | 0 |
mmonkey/Destinations | src/main/java/com/github/mmonkey/destinations/commands/WarpCommand.java | [
"public class WarpCommandElement extends SelectorCommandElement {\n\n /**\n * WarpCommandElement constructor\n *\n * @param key Text\n */\n public WarpCommandElement(@Nullable Text key) {\n super(key);\n }\n\n @Override\n protected Iterable<String> getChoices(CommandSource sour... | import com.github.mmonkey.destinations.commands.elements.WarpCommandElement;
import com.github.mmonkey.destinations.entities.AccessEntity;
import com.github.mmonkey.destinations.entities.PlayerEntity;
import com.github.mmonkey.destinations.entities.WarpEntity;
import com.github.mmonkey.destinations.events.PlayerTelepor... | package com.github.mmonkey.destinations.commands;
public class WarpCommand implements CommandExecutor {
public static final String[] ALIASES = {"warp", "w"};
/**
* Get the Command Specifications for this command
*
* @return CommandSpec
*/
public static CommandSpec getCommandSpec() {
... | WarpEntity warp = this.searchWarps(name); | 3 |
leerduo/travelinfo | DandelionPro/src/com/ustc/dystu/dandelion/FolderEditActivity.java | [
"public class FootInfo implements Serializable {\n\n\tprivate static final long serialVersionUID = 1L;\n\tpublic String id;\n\tpublic String text;\n\tpublic GeoInfo geo;\n\tpublic int comments_count;\n\n\tpublic String created_at;\n\tpublic String[] picIds;\n\tpublic String thumbnail_pic;\n\tpublic String bmiddle_p... | import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Layout... | package com.ustc.dystu.dandelion;
public class FolderEditActivity extends Activity {
private static final int REQUEST_UPDATE_NOTE_INFO = 0x1;
ImageView ivBack;
ImageView ivOk;
ImageView ivFolder;
TextView tvTitle;
TextView tvTime;
TextView tvTimeUsed;
GridView gvPics;
PicAdapter picAdapter;
ArrayLi... | new DandRequestListener(mHandler) { | 4 |
anselm94/Torchie-Android | app/src/main/java/in/blogspot/anselmbros/torchie/main/manager/VolumeKeyManager.java | [
"public interface InputDeviceListener extends DeviceListener {\n void onValueChanged(String deviceType, int eventConstant);\n}",
"public class VolumeKeyEvent extends KeyEvent {\n\n public static final int VOLUME_KEY_EVENT_NATIVE = 0;\n public static final int VOLUME_KEY_EVENT_ROCKER = 1;\n\n private f... | import android.content.Context;
import android.os.Build;
import in.blogspot.anselmbros.torchie.main.manager.device.input.InputDeviceListener;
import in.blogspot.anselmbros.torchie.main.manager.device.input.event.VolumeKeyEvent;
import in.blogspot.anselmbros.torchie.main.manager.device.input.key.volume.VolumeKeyDevice;
... | /*
* Copyright (C) 2017 Merbin J Anselm <merbinjanselm@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your optio... | volumeKeyType = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) ? volumeKeyType : VolumeKeyRocker.TYPE; | 4 |
simlar/simlar-android | app/src/main/java/org/simlar/service/SimlarCallState.java | [
"public final class ContactsProvider\n{\n\tprivate static final ContactsProviderImpl mImpl = new ContactsProviderImpl();\n\n\tprivate ContactsProvider()\n\t{\n\t\tthrow new AssertionError(\"This class was not meant to be instantiated\");\n\t}\n\n\t@FunctionalInterface\n\tpublic interface FullContactsListener\n\t{\n... | import org.simlar.logging.Lg;
import org.simlar.service.liblinphone.LinphoneCallState;
import org.simlar.utils.Util;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.SystemClock;
import androidx.annotation.NonNull;
import org.simlar.R;
import org.simlar.contactsprovider.ContactsProvider... | /**
* Copyright (C) 2013 The Simlar Authors.
*
* This file is part of Simlar. (https://www.simlar.org)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License... | Lg.i("new CallEndReason=", reason); | 3 |
tony-Shx/Swface | app/src/main/java/com/henu/swface/activity/ManageActivity.java | [
"public class ManageAdapter extends RecyclerView.Adapter<ManageAdapter.ViewHolder> {\n\n\tprivate static final String TAG = ManageAdapter.class.getSimpleName();\n\tprivate List<UserHasSigned> userHasSignedList;\n\tprivate int imageView_width = -1;\n\tprivate OnItemClickListener onItemClickListener;\n\tprivate OnIte... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.ContactsContract;
import android.support.v7.widget.Re... | // default is false
ptrFrame.setPullToRefresh(false);
// default is true
ptrFrame.setKeepHeaderWhenRefresh(true);
// scroll then refresh
// comment in base fragment
ptrFrame.postDelayed(new Runnable() {
@Override
public void run() {
// ptrFrame.autoRefresh();
ptrFrame.autoRefresh(true);
... | message.arg1 = FinalUtil.SYN_DATA_SUCCESS; | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.