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 |
|---|---|---|---|---|---|---|
dedyk/JaponskiPomocnik | app/src/main/java/pl/idedyk/android/japaneselearnhelper/kanji/hkr/KanjiTestOptionsActivity.java | [
"public class JapaneseAndroidLearnHelperApplication extends MultiDexApplication {\n\n\tpublic static final ThemeType defaultThemeType = ThemeType.BLACK;\n\t\n\tprivate static JapaneseAndroidLearnHelperApplication singleton;\n\n\tpublic static JapaneseAndroidLearnHelperApplication getInstance() {\n\t\treturn singlet... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import pl.idedyk.android.japaneselearnhelper.JapaneseAndroidLearnHelperApplication;
import pl.idedyk.android.japan... | return true;
} else if (item.getItemId() == R.id.kanji_test_options_clear_selected_kanji) {
for (CheckBox currentCheckBox : kanjiGroupList) {
currentCheckBox.setChecked(false);
}
kanjiList.clearUserSelectedKanjiList();
showSelectedKanji();
Toast.makeText(KanjiTestOptionsActivity.this,
... | final KanjiTestConfig kanjiTestConfig = JapaneseAndroidLearnHelperApplication.getInstance() | 1 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Constraints.java | [
"public class ConjunctiveConstraint<Type> implements Constraint<Type> {\n\n /**\n * A array, which contains the single constraints, the constraint consists of.\n */\n private Constraint<Type>[] constraints;\n\n /**\n * Creates a new constraint, which allows to combine multiple constraints in a ... | import androidx.annotation.NonNull;
import java.util.regex.Pattern;
import de.mrapp.android.validation.constraints.ConjunctiveConstraint;
import de.mrapp.android.validation.constraints.DisjunctiveConstraint;
import de.mrapp.android.validation.constraints.NegateConstraint;
import de.mrapp.android.validation.constraints.... | /*
* Copyright 2015 - 2019 Michael Rapp
*
* 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... | return new ContainsNumberConstraint(); | 4 |
FlareBot/FlareBot | src/main/java/stream/flarebot/flarebot/scheduler/FutureAction.java | [
"public class FlareBot {\n\n public static final Logger LOGGER;\n public static final Gson GSON = new GsonBuilder().create();\n private static final AtomicBoolean RUNNING = new AtomicBoolean(false);\n public static final AtomicBoolean EXITING = new AtomicBoolean(false);\n public static final AtomicBo... | import com.datastax.driver.core.PreparedStatement;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Period;
import stream.flarebot.flarebot.FlareBot;
import stream.flarebot.flarebot.FlareBotManager;
import stream.flarebot.flarebot.Getters;
import stream.flarebot.flarebot.database.C... | package stream.flarebot.flarebot.scheduler;
public class FutureAction {
private static PreparedStatement update;
private static PreparedStatement delete;
/*
* Ok so this will work with a few things, due to this it will have quite a few weird fields.
*
* CREATE TABLE future_tasks (guild_id... | ModlogHandler.getInstance().handleAction(gw, | 5 |
fedefernandez/MyAppList | application/src/main/java/com/projectsexception/myapplist/work/SaveListService.java | [
"public class MyAppListPreferenceActivity extends PreferenceActivity implements Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener {\n\n static final String KEY_EMAIL = \"mail\";\n public static final String KEY_HIDE_SYSTEM_APPS = \"hide_system_apps\";\n public static final String ... | import android.app.AlarmManager;
import android.app.IntentService;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.projectsexception.myapplist.MyAppListPreferenceActivity;
i... | package com.projectsexception.myapplist.work;
public class SaveListService extends IntentService {
private static final String TAG = "SaveListService";
private static final String SERVICE_NAME = TAG;
public SaveListService() {
super(SERVICE_NAME);
}
@Override
protected void onHand... | } catch (ParserException e) { | 6 |
apache/commons-exec | src/test/java/org/apache/commons/exec/issues/Exec41Test.java | [
"public class CommandLine {\n\n /**\n * The arguments of the command.\n */\n private final Vector<Argument> arguments = new Vector<>();\n\n /**\n * The program to execute.\n */\n private final String executable;\n\n /**\n * A map of name value pairs used to expand command line arg... | import static org.junit.Assert.assertTrue;
import java.io.File;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteException;
import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.commons.exec.OS;
import org.apache.commons.exec.P... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | final ExecuteWatchdog watchdog = new ExecuteWatchdog(2 * 1000); // allow process no more than 2 seconds | 3 |
jrimum/domkee | src/main/java/org/jrimum/domkee/financeiro/banco/Pessoa.java | [
"public class NumeroDeTelefone{\r\n\r\n\tprivate int ddi;\r\n\r\n\tprivate int ddd;\r\n\r\n\tprivate int prefixo;\r\n\r\n\tprivate int sufixo;\r\n\t\r\n\tprivate String telefone;\r\n\r\n\tpublic NumeroDeTelefone() {}\r\n\t\r\n\tpublic int getDDI() {\r\n\t\treturn ddi;\r\n\t}\r\n\r\n\tpublic void setDDI(int ddi) {\r... | import static org.jrimum.utilix.Objects.isNull;
import java.util.ArrayList;
import java.util.Collection;
import org.jrimum.domkee.comum.pessoa.contato.NumeroDeTelefone;
import org.jrimum.domkee.comum.pessoa.endereco.Endereco;
import org.jrimum.domkee.comum.pessoa.id.cprf.AbstractCPRF;
import org.jrimum.domkee.com... | /*
* Copyright 2008 JRimum Project
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by
* applicable law or agreed to in ... | private Collection<NumeroDeTelefone> telefones;
| 0 |
urbanairship/datacube | src/test/java/com/urbanairship/datacube/HBaseBackfillIntegrationTest.java | [
"enum CommitType {\n READ_COMBINE_CAS,\n INCREMENT,\n OVERWRITE\n}",
"public class HBaseBackfillMerger implements Runnable {\n private static final Logger log = LoggerFactory.getLogger(HBaseBackfillMerger.class);\n\n static final String CONFKEY_COLUMN_FAMILY = \"hbasebackfiller.cf\";\n static fi... | import com.google.common.collect.ImmutableList;
import com.urbanairship.datacube.DbHarness.CommitType;
import com.urbanairship.datacube.backfill.HBaseBackfillMerger;
import com.urbanairship.datacube.backfill.HBaseSnapshotter;
import com.urbanairship.datacube.bucketers.EnumToOrdinalBucketer;
import com.urbanairship.data... | } else {
return 0L;
}
}
public long getDayCount(DateTime day) throws IOException, InterruptedException {
Optional<LongOp> countOpt = dataCubeIo.get(new ReadBuilder(newCube)
.at(timeDimension, HourDayMonthBucketer.days, day));
... | DbHarness<LongOp> dbHarness = new HBaseDbHarness<LongOp>(pool, ArrayUtils.EMPTY_BYTE_ARRAY, | 5 |
diffplug/durian-swt | durian-swt/src/test/java/com/diffplug/common/swt/dnd/StructuredDndMappingTest.java | [
"public class InteractiveTest {\n\tprivate InteractiveTest() {}\n\n\t/** Returns an optional of the proper autoclose delay. */\n\tprivate static Optional<Integer> autoCloseMs() {\n\t\tString value = System.getProperty(AUTOCLOSE_KEY);\n\t\tif (value == null) {\n\t\t\treturn Optional.empty();\n\t\t} else {\n\t\t\tret... | import com.diffplug.common.base.Converter;
import com.diffplug.common.base.Errors;
import com.diffplug.common.base.Preconditions;
import com.diffplug.common.base.Throwing;
import com.diffplug.common.rx.Rx;
import com.diffplug.common.rx.RxBox;
import com.diffplug.common.swt.InteractiveTest;
import com.diffplug.common.sw... | /*
* Copyright 2020 DiffPlug
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | Rx.sync(box, SwtRx.textImmediate(txt)); | 3 |
maruohon/minihud | src/main/java/fi/dy/masa/minihud/gui/GuiShapeManager.java | [
"public class Reference\n{\n public static final String MOD_ID = \"minihud\";\n public static final String MOD_NAME = \"MiniHUD\";\n public static final String MOD_VERSION = \"@MOD_VERSION@\";\n\n public static final ModInfo MOD_INFO = new ModInfo(MOD_ID, MOD_NAME);\n}",
"public class Configs\n{\n ... | import javax.annotation.Nullable;
import net.minecraft.client.gui.GuiScreen;
import fi.dy.masa.malilib.gui.BaseListScreen;
import fi.dy.masa.malilib.gui.widget.DropDownListWidget;
import fi.dy.masa.malilib.gui.widget.LabelWidget;
import fi.dy.masa.malilib.gui.widget.button.BooleanConfigButton;
import fi.dy.masa.malilib... | package fi.dy.masa.minihud.gui;
public class GuiShapeManager extends BaseListScreen<DataListWidget<ShapeBase>>
{
protected final DropDownListWidget<ShapeType> widgetDropDown;
public GuiShapeManager()
{
super(10, 82, 20, 88, "minihud", ConfigScreen.ALL_TABS, ConfigScreen.SHAPES);
// The p... | listWidget.setEntryWidgetFactory(WidgetShapeEntry::new); | 3 |
operando/Garum | garum/src/main/java/com/os/operando/garum/ModelInfo.java | [
"public abstract class PrefModel {\n\n private final PrefInfo prefInfo;\n\n private SharedPreferences.Editor editor;\n\n public PrefModel() {\n prefInfo = Cache.getPrefInfo(getClass());\n load();\n }\n\n public void apply() {\n setValuesEditor();\n editor.apply();\n }\n... | import android.net.Uri;
import com.os.operando.garum.models.PrefModel;
import com.os.operando.garum.serializers.CalendarSerializer;
import com.os.operando.garum.serializers.DateSerializer;
import com.os.operando.garum.serializers.DoubleSerializer;
import com.os.operando.garum.serializers.FileSerializer;
import com.os.o... | package com.os.operando.garum;
public class ModelInfo {
private Map<Class<? extends PrefModel>, PrefInfo> prefInfos = new HashMap<>(); | private Map<Class<?>, TypeSerializer> typeSerializers = new HashMap<Class<?>, TypeSerializer>() { | 6 |
avram/zandy | src/main/java/com/gimranov/zandy/app/task/APIRequest.java | [
"public class ServerCredentials {\n /**\n * Application key -- available from Zotero\n */\n static final String CONSUMERKEY = \"93a5aac13612aed2a236\";\n static final String CONSUMERSECRET = \"196d86bd1298cb78511c\";\n\n /**\n * This is the zotero:// protocol we intercept\n * It probably... | import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteStatement;
import android.os.Handler;
import android.util.Log;
import com.gimranov.zandy.app.ServerCredentials;
import com.gimranov.zandy.app.XMLResponseParser;
import com... | // Entry mode if the request is an update (PUT) or if it is a request
// for a single item by key (ITEM_BY_KEY)
int mode = ("put".equals(method) || type == APIRequest.ITEM_BY_KEY) ?
XMLResponseParser.MODE_ENTRY : XMLResponseParser.M... | ItemCollection coll = ItemCollection.load( | 5 |
HumBuch/HumBuch | src/main/java/de/dhbw/humbuch/view/DunningView.java | [
"public class MessageEvent {\r\n\r\n\tpublic final String caption;\r\n\tpublic final String message;\r\n\tpublic final Type type;\r\n\r\n\tpublic enum Type {\r\n\t\tINFO, TRAYINFO, WARNING, ERROR;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an event with the specified caption and {@link Type}.INFO as\r\n\t * standard type\... | import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Set;
import com.google.common.eventbus.EventBus;
import com.google.inject.Inject;
import com.va... | package de.dhbw.humbuch.view;
/**
* Provides the {@link View} to display and manage {@link Dunning}s
* @author Johannes Idelhauser
* @author Martin Wentzel
*/
public class DunningView extends VerticalLayout implements View,
ViewInformation {
private static final long serialVersionUID = 1284094636968999625L;... | if(item.getType() == Dunning.Type.TYPE1) { | 1 |
Guichaguri/BetterFps | src/main/java/guichaguri/betterfps/transformers/MathTransformer.java | [
"public class BetterFpsConfig {\r\n\r\n public AlgorithmType algorithm = AlgorithmType.RIVENS_HALF;\r\n\r\n public boolean updateChecker = true;\r\n\r\n public boolean preallocateMemory = false;\r\n\r\n public boolean fog = true;\r\n\r\n public boolean beaconBeam = true;\r\n\r\n public boolean fas... | import guichaguri.betterfps.BetterFpsConfig;
import guichaguri.betterfps.BetterFpsConfig.AlgorithmType;
import guichaguri.betterfps.BetterFpsHelper;
import guichaguri.betterfps.tweaker.BetterFpsTweaker;
import guichaguri.betterfps.tweaker.Mappings;
import java.io.InputStream;
import java.util.LinkedHashMap;
impo... | package guichaguri.betterfps.transformers;
/**
* @author Guilherme Chaguri
*/
public class MathTransformer implements IClassTransformer {
// Config Name, Class Name
private static final LinkedHashMap<AlgorithmType, String> algorithmClasses = new LinkedHashMap<AlgorithmType, String>();
stati... | InputStream in = BetterFpsTweaker.getResourceStream(algorithmClass + ".class");
| 3 |
simo415/spc | src/com/sijobe/spc/command/Difficulty.java | [
"public enum FontColour {\n \n BLACK(\"\\2470\"),\n DARK_BLUE(\"\\2471\"),\n DARK_GREEN(\"\\2472\"),\n DARK_AQUA(\"\\2473\"),\n DARK_RED(\"\\2474\"),\n PURPLE(\"\\2475\"),\n ORANGE(\"\\2476\"),\n GREY(\"\\2477\"),\n DARK_GREY(\"\\2478\"),\n BLUE(\"\\2479\"),\n GREEN(\"\\247a\"),\n AQUA(\"\... | import com.sijobe.spc.util.FontColour;
import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterInteger;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.World;
import java... | package com.sijobe.spc.command;
/**
* Changes the World's current difficulty setting
*
* @author simo_415
* @version 1.0
*/
@Command (
name = "difficulty",
description = "Sets the difficulty of the game. Valid values 0-3",
example = "0",
videoURL = "http://www.youtube.com/watch?v=jkXYM8S41uY",
ve... | World world = super.getSenderAsPlayer(sender).getWorld(); | 6 |
nextgis/android_maplib | src/main/java/com/nextgis/maplib/map/LayerGroup.java | [
"public interface ILayer\n{\n /**\n * @return Application context\n */\n Context getContext();\n\n /**\n * @return User readable layer name\n */\n String getName();\n\n /**\n * Set layer name\n * @param newName New name\n */\n void setName(String newName);\n\n /**\n ... | import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import android.util.Log;
import com.nextgis.maplib.api.ILayer;
import com.nextgis.maplib.api.ILayerView;
import com.nextgis.maplib.api.IRenderer;
import com.nextgis.maplib.datasource.GeoEnvelope;
import com.nex... | }
public void moveLayer(
int newPosition,
ILayer layer)
{
if (layer != null) {
synchronized (this) {
mLayers.remove(layer);
mLayers.add(newPosition, layer);
}
onLayersReordered();
}
}
pub... | if (Constants.NOT_FOUND != visibleTopLayerId) { | 7 |
google/agera | extensions/database/src/test/java/com/google/android/agera/database/SqlDatabaseFunctionsTest.java | [
"@NonNull\npublic static <T> Result<T> success(@NonNull final T value) {\n return new Result<>(checkNotNull(value), null);\n}",
"@NonNull\npublic static <T> Supplier<T> staticSupplier(@NonNull final T object) {\n return new StaticProducer<>(object);\n}",
"@NonNull\npublic static Function<SqlDeleteRequest, Res... | import static android.database.sqlite.SQLiteDatabase.CONFLICT_FAIL;
import static android.database.sqlite.SQLiteDatabase.CONFLICT_IGNORE;
import static android.database.sqlite.SQLiteDatabase.CONFLICT_NONE;
import static android.database.sqlite.SQLiteDatabase.CONFLICT_REPLACE;
import static android.database.sqlite.SQLit... | /*
* Copyright 2015 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | staticSupplier(Result.<SQLiteDatabase>failure(new Exception())); | 1 |
onepf/OPFPush | samples/pushchat/src/main/java/org/onepf/pushchat/PushChatApplication.java | [
"public final class OPFPush {\n\n private static volatile OPFPushHelper helper;\n\n private OPFPush() {\n throw new UnsupportedOperationException();\n }\n\n /**\n * Returns the {@link org.onepf.opfpush.OPFPushHelper} instance.\n *\n * @return The {@link org.onepf.opfpush.OPFPushHelper... | import android.app.Application;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import org.onepf.opfpush.OPFPush;
import org.onepf.opfpush.adm.ADMProvider;
import org.onepf.opfpush.configuration.Configuration;
import org.onepf.opfpush.gcm.GCMProvider;
import org.onepf.opfpush.nokia... | /*
* Copyright 2012-2015 One Platform Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | new NokiaNotificationsProvider(this, NOKIA_SENDER_ID) | 4 |
komamitsu/fluency | fluency-fluentd/src/test/java/org/komamitsu/fluency/fluentd/ingester/sender/TCPSenderTest.java | [
"public class MockTCPServer\n{\n private static final Logger LOG = LoggerFactory.getLogger(MockTCPServer.class);\n private final boolean sslEnabled;\n private final AtomicLong lastEventTimeStampMilli = new AtomicLong();\n private final AtomicInteger threadSeqNum = new AtomicInteger();\n private Execu... | import org.hamcrest.Matcher;
import org.junit.jupiter.api.Test;
import org.komamitsu.fluency.fluentd.MockTCPServer;
import org.komamitsu.fluency.fluentd.MockTCPServerWithMetrics;
import org.komamitsu.fluency.fluentd.ingester.sender.failuredetect.FailureDetector;
import org.komamitsu.fluency.fluentd.ingester.sender.fail... | /*
* Copyright 2019 Mitsunori Komatsu (komamitsu)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... | MockTCPServerWithMetrics server = new MockTCPServerWithMetrics(false); | 1 |
rebane621/e621-android | src/main/java/de/e621/rebane/activities/CoverShowActivity.java | [
"public class FilterManager {\r\n\r\n String[] Blacklist = new String[0];\r\n Context context;\r\n String Filter = \"\";\r\n static boolean isRunning = false;\r\n\r\n private static Pattern numericFilter = null;\r\n\r\n public FilterManager(Context context, String... blacklists) {\r\n if (n... | import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.text.Html;
import android.view.View;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.TextView;
import com.itwookie.XMLreade... | package de.e621.rebane.activities;
public class CoverShowActivity extends DrawerWrapper implements View.OnClickListener {
TextView name, meta, desc, seekPos;
Button read;
| WebImageView preview;
| 4 |
sing-group/bicycle | src/test/java/es/cnio/bioinfo/bicycle/test/AlignmentTest.java | [
"public class Project {\n\n\tprivate static final Logger logger = Logger.getLogger(Project.class.getSimpleName());\n\n\tpublic static final String WORKING_DIRECTORY = \"workingDirectory\" + File.separator;\n\tpublic static final String OUTPUT_DIRECTORY = \"output\" + File.separator;\n\tpublic static final String CO... | import es.cnio.bioinfo.bicycle.Project;
import es.cnio.bioinfo.bicycle.Reference;
import es.cnio.bioinfo.bicycle.Sample;
import es.cnio.bioinfo.bicycle.operations.BowtieAlignment;
import es.cnio.bioinfo.bicycle.operations.BowtieAlignment.Bowtie1Quals;
import es.cnio.bioinfo.bicycle.operations.BowtieAlignment.Bowtie2Qua... | /*
Copyright 2012 Daniel Gonzalez Peña, Osvaldo Graña
This file is part of the bicycle Project.
bicycle Project is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... | 0, Bowtie2Quals.BEFORE_1_3); | 5 |
fau-amos-2014-team-2/root | WoundManagement/src/main/java/com/fau/amos/team2/WoundManagement/ui/PatientSelectionView.java | [
"@SuppressWarnings(\"serial\")\n@Entity\n@Table(name = \"BEWOPE07\")\n@NamedQueries({\n\t\t@NamedQuery(name = \"Patient.findAll\", query = \"SELECT p FROM Patient p\"),\n\t\t@NamedQuery(name = \"Patient.deleteAll\", query = \"DELETE FROM Patient\") })\npublic class Patient implements BusinessObject {\n\t@Id\n\t@Col... | import java.sql.Date;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.Locale;
import com.fau.amos.team2.WoundManagement.model.Patient;
import com.fau.amos.team2.WoundManagement.model.Ward;
import com.fau.amos.team2.WoundManagement.provider.PatientProvider;
import com.fau.amos.team2.WoundManag... | package com.fau.amos.team2.WoundManagement.ui;
@PreserveOnRefresh
@SuppressWarnings("serial")
public class PatientSelectionView extends SessionedNavigationView implements WardChangeListener {
private static PatientProvider patientProvider = PatientProvider.getInstance();
| private List<Patient> allPatients; | 0 |
basgren/railways | src/net/bitpot/railways/utils/RailwaysUtils.java | [
"public class ErrorInfoDlg extends JDialog {\n private JPanel contentPane;\n private JButton buttonOK;\n private JLabel errorTitleLbl;\n private JTextPane errorText;\n private JScrollPane scrollPane;\n\n\n public ErrorInfoDlg() {\n setContentPane(contentPane);\n setModal(true);\n ... | import com.intellij.execution.ExecutionModes;
import com.intellij.execution.process.ProcessOutput;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.dia... | package net.bitpot.railways.utils;
/**
* Class that contains all API methods for Railways plugin.
*/
public class RailwaysUtils {
@SuppressWarnings("unused")
private final static Logger log = Logger.getInstance(RailwaysUtils.class.getName());
public final static StringFormatter STRIP_REQUEST_FORMAT = R... | for (Route route: routeList) | 2 |
davidmoten/rtree | src/test/java/com/github/davidmoten/rtree/fbs/SerializerFlatBuffersTest.java | [
"public interface Entry<T, S extends Geometry> extends HasGeometry {\n\n T value();\n\n @Override\n S geometry();\n\n}",
"public class GreekEarthquakes {\n\n public static Observable<Entry<Object, Point>> entries(final Precision precision) {\n Observable<String> source = Observable.using(new Fu... | import static org.junit.Assert.assertEquals;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;
import com.github.davidmoten.rtree.Entry;
import com.github.davidmoten.rt... | package com.github.davidmoten.rtree.fbs;
public class SerializerFlatBuffersTest {
private static final byte[] EMPTY = new byte[] {};
@Test
public void testSerializeRoundTripToFlatBuffersSingleArray() throws Exception {
roundTrip(InternalStructure.SINGLE_ARRAY, false);
}
@Test
pu... | tree = tree.add(GreekEarthquakes.entries(Precision.SINGLE)).last().toBlocking().single(); | 1 |
krujos/data-lifecycle-service-broker | src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/service/LCServiceInstanceBindingService.java | [
"public class InstancePair {\n\n\tprivate String sourceInstance;\n\tprivate String copyInstance;\n\n\tpublic InstancePair(String sourceInstance, String copyInstance) {\n\t\tthis.sourceInstance = sourceInstance;\n\t\tthis.copyInstance = copyInstance;\n\t}\n\n\tpublic String getSource() {\n\t\treturn sourceInstance;\... | import static org.cloudfoundry.community.servicebroker.datalifecycle.model.BrokerActionState.COMPLETE;
import static org.cloudfoundry.community.servicebroker.datalifecycle.model.BrokerActionState.FAILED;
import static org.cloudfoundry.community.servicebroker.datalifecycle.model.BrokerActionState.IN_PROGRESS;
import jav... | package org.cloudfoundry.community.servicebroker.datalifecycle.service;
@Service
public class LCServiceInstanceBindingService implements
ServiceInstanceBindingService {
private CopyProvider provider;
private Logger logger = Logger
.getLogger(LCServiceInstanceBindingService.class);
private LCServiceInstan... | private void log(String id, String msg, BrokerActionState state) { | 2 |
marcelothebuilder/webpedidos | src/main/java/com/github/marcelothebuilder/webpedidos/controller/RelatorioPedidosEmitidosBean.java | [
"public interface EmissorRelatorio {\n\n\tvoid setConnection(Connection connection);\n\n\tvoid emitir() throws IOException, JRException;\n\n\tboolean isRelatorioGerado();\n\n}",
"public interface ExecutorRelatorio {\n\n\tvoid emite();\n\n\tvoid setEmissor(EmissorRelatorio emissor);\n\n}",
"public interface Rela... | import java.io.IOException;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http... | /**
*
*/
package com.github.marcelothebuilder.webpedidos.controller;
/**
* Este bean é responsável pela emissão de relatórios dos pedidos emitidos.
* Fornece limitações de data e exporta o relatório para o navegador
* diretamente, validando erros de entrada do usuário.
*
* @author Marcelo Paixao Resende
... | EmissorRelatorio emissor = new EmissorRelatorioServlet(relatorioPedidos, response); | 0 |
Dynious/Biota | src/main/java/com/dynious/biota/command/CommandBiota.java | [
"public class BioSystem\n{\n private static final Random RANDOM = new Random();\n\n public final WeakReference<Chunk> chunkReference;\n private int tick = RANDOM.nextInt(Settings.TICKS_PER_BIOSYSTEM_UPDATE);\n\n /**\n * Stores the amount of plants in the chunk. Plant blocks can have different amount... | import com.dynious.biota.biosystem.BioSystem;
import com.dynious.biota.biosystem.BioSystemHandler;
import com.dynious.biota.biosystem.BioSystemInitThread;
import com.dynious.biota.lib.Commands;
import com.dynious.biota.network.NetworkHandler;
import com.dynious.biota.network.message.MessageBioSystemUpdate;
import net.m... | package com.dynious.biota.command;
public class CommandBiota extends CommandBase
{
@Override
public String getCommandName()
{
return Commands.BIOTA;
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public String getCommandUsage(ICom... | BioSystem bioSystem = BioSystemHandler.getBioSystem(world, chunk); | 1 |
jitsi/otr4j | src/main/java/net/java/otr4j/session/AuthContext.java | [
"@SuppressWarnings(\"serial\")\npublic class OtrException extends Exception {\n\tpublic OtrException(Exception e) {\n\t\tsuper(e);\n\t}\n}",
"public abstract class AbstractMessage {\n\n\t// Unencoded\n\tpublic static final int MESSAGE_ERROR = 0xff;\n\tpublic static final int MESSAGE_QUERY = 0x100;\n\tpublic stati... | import java.math.BigInteger;
import java.security.KeyPair;
import java.security.PublicKey;
import javax.crypto.interfaces.DHPublicKey;
import net.java.otr4j.OtrException;
import net.java.otr4j.io.messages.AbstractMessage;
import net.java.otr4j.io.messages.DHCommitMessage;
import net.java.otr4j.io.messages.DHKeyMessage;... | /*
* Copyright @ 2015 Atlassian Pty Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | abstract DHCommitMessage getDHCommitMessage() throws OtrException; | 2 |
CheataClient/CheataClientSrc | com/lunix/cheata/gui/GuiManager.java | [
"public abstract class AbstractGuiManager implements GuiManager {\n\tprivate final List<Frame> frames;\n\n\tprotected Theme theme;\n\n\tpublic AbstractGuiManager() {\n\t\tframes = new CopyOnWriteArrayList<Frame>();\n\t}\n\n\t@Override\n\tpublic abstract void setup();\n\n\t@Override\n\tpublic void addFrame(Frame fra... | import java.awt.Dimension;
import java.awt.Rectangle;
import java.util.concurrent.atomic.AtomicBoolean;
import org.darkstorm.minecraft.gui.AbstractGuiManager;
import org.darkstorm.minecraft.gui.component.Button;
import org.darkstorm.minecraft.gui.component.Component;
import org.darkstorm.minecraft.gui.component.Frame;
... | worldFrame.setVisible(true);
worldFrame.setMinimized(true);
} else {
worldFrame.setMinimized(true);
worldFrame.setVisible(false);
}
}
private void createPlayerFrame(boolean making) {
if (!hasMadePlayerFrame) {
hasMadePlayerFrame = true;
playerFrame.setTheme(theme);
playerFrame.setLayoutMan... | for(ModValue value : ModValueManager.values){ | 4 |
otto-de/jlineup | core/src/main/java/de/otto/jlineup/browser/JLineupHttpClient.java | [
"@JsonDeserialize(builder = Cookie.Builder.class)\npublic class Cookie {\n\n public static final String COOKIE_TIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ssXXX\";\n\n public final String name;\n public final String value;\n public final String domain;\n public final String path;\n @JsonFormat(shape = Json... | import com.google.common.net.InternetDomainName;
import de.otto.jlineup.config.Cookie;
import de.otto.jlineup.config.HttpCheckConfig;
import de.otto.jlineup.config.JobConfig;
import org.apache.hc.client5.http.classic.methods.HttpGet;
import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.h... | package de.otto.jlineup.browser;
class JLineupHttpClient {
private final static Logger LOG = LoggerFactory.getLogger(lookup().lookupClass());
void callUrl(ScreenshotContext screenshotContext) throws Exception {
CookieStore cookieStore = prepareCookieStore(screenshotContext);
try (Closeable... | void checkPageAccessibility(ScreenshotContext screenshotContext, JobConfig jobConfig) throws Exception { | 2 |
android-notes/SwissArmyKnife | saklib/src/main/java/com/wanjian/sak/view/OptPanelView.java | [
"public class Config {\n\n private int minRange;\n private int maxRange;\n// private List<AbsLayer> mLayerViews = new ArrayList<>();\n private List<ISizeConverter> mSizeConverterList = new ArrayList<>();\n private int startRange;\n private int endRange;\n private boolean clipDraw;\n List<Ite... | import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widg... | startRange.setMaxValue(config.getMaxRange());
startRange.setValue(config.getStartRange());
startRange.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() {
@Override
public void onValueChange(NumberPicker picker, int oldVal, int newVal) {
config.setStartRange(newVal);
... | Item item = config.getLayerList().get(position); | 1 |
aleksandr-m/strutsclipse | strutsclipse-plugin/src/com/amashchenko/eclipse/strutsclipse/validators/StrutsValidatorsXmlCompletionProposalComputer.java | [
"public class CompletionProposalHelper {\n\tpublic CompletionProposalHelper() {\n\t}\n\n\tpublic static List<ICompletionProposal> createAttrCompletionProposals(\n\t\t\tString[][] proposalsData, String prefix, IRegion region,\n\t\t\tString valueSeparator, String attrvalue,\n\t\t\tCompletionProposalComparator proposa... | import com.amashchenko.eclipse.strutsclipse.ResourceDocument;
import com.amashchenko.eclipse.strutsclipse.xmlparser.TagRegion;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.ui.text.java.CompletionProposalComparator;
impo... | /*
* Copyright 2015-2018 Aleksandr Mashchenko.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... | List<ResourceDocument> resources = ProjectUtil | 3 |
jedwards1211/Jhrome | src/main/java/org/sexydock/tabs/demos/GettingStarted.java | [
"public class DefaultTabDropFailureHandler implements ITabDropFailureHandler\r\n{\r\n\tpublic DefaultTabDropFailureHandler( ITabbedPaneWindowFactory windowFactory )\r\n\t{\r\n\t\tthis.windowFactory = windowFactory;\r\n\t}\r\n\t\r\n\tfinal ITabbedPaneWindowFactory\twindowFactory;\r\n\t\r\n\t@Override\r\n\tpublic voi... | import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Window;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.UIManager;
import org.sexydock.tabs.DefaultTabDropFailureHandler;
import o... | package org.sexydock.tabs.demos;
public class GettingStarted implements ISexyTabsDemo
{
// NOTE: This guide demonstrates how to enable all the special Google Chrome-like behavior
// in a step-by-step manner. However, in practice, a tabbed application should be structured a bit
// differently. See Notepa... | tabbedPane.addContainerListener( new DefaultTabsRemovedHandler( ) );
| 1 |
Semx11/Autotip | src/main/java/me/semx11/autotip/api/request/impl/LogoutRequest.java | [
"public class GetBuilder {\n\n private static final String BASE_URL = \"https://api.autotip.pro/\";\n\n private final RequestBuilder builder;\n\n private GetBuilder(Request request) {\n this.builder = RequestBuilder.get().setUri(BASE_URL + request.getType().getEndpoint());\n }\n\n public stati... | import java.util.Optional;
import me.semx11.autotip.api.GetBuilder;
import me.semx11.autotip.api.RequestHandler;
import me.semx11.autotip.api.RequestType;
import me.semx11.autotip.api.SessionKey;
import me.semx11.autotip.api.reply.Reply;
import me.semx11.autotip.api.reply.impl.LogoutReply;
import me.semx11.autotip.api.... | package me.semx11.autotip.api.request.impl;
public class LogoutRequest implements Request<LogoutReply> {
private final SessionKey sessionKey;
private LogoutRequest(SessionKey sessionKey) {
this.sessionKey = sessionKey;
}
public static LogoutRequest of(SessionKey sessionKey) {
return... | HttpUriRequest request = GetBuilder.of(this) | 0 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/fragment/NewsFragment.java | [
"public abstract class BenihRecyclerListener extends RecyclerView.OnScrollListener\n{\n private int previousTotal = 0;\n private boolean loading = true;\n private int visibleThreshold = 3;\n private int firstVisibleItem;\n private int visibleItemCount;\n private int totalItemCount;\n private in... | import id.zelory.codepolitan.data.LocalDataManager;
import id.zelory.codepolitan.ui.ListArticleActivity;
import id.zelory.codepolitan.ui.ReadActivity;
import id.zelory.codepolitan.ui.adapter.NewsAdapter;
import timber.log.Timber;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.... | /*
* Copyright (c) 2015 Zelory.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | } else if (o instanceof NewsHeaderEvent) | 2 |
EthanCo/Halo-Turbo | sample/src/main/java/com/ethanco/sample/MinaTcpClientActivity.java | [
"public class Halo extends AbstractHalo {\n private ISocket haloImpl;\n\n public Halo() {\n this(new Builder());\n }\n\n public Halo(Builder builder) {\n this.haloImpl = SocketFactory.create(builder);\n }\n\n @Override\n public boolean start() {\n return this.haloImpl.start... | import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.Toast;
import com.ethanco.halo.turbo.Halo;
import com.ethanco.halo.turbo.ads.IHandlerAdapter;
import com.ethanco.halo.turb... | package com.ethanco.sample;
public class MinaTcpClientActivity extends AppCompatActivity {
private static final String TAG = "Z-MinaTcpClientActivity";
private ActivityMinaTcpClientBinding binding;
private ScrollBottomTextWatcher watcher;
private ISession session;
private Halo halo;
@Overri... | .addConvert(new ObjectJsonConvertor()) //增加转换器 -> write的时候自动转换为Json字符串 | 5 |
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/edge_orchestrator/BasicEdgeOrchestrator.java | [
"public class CloudVM extends Vm {\r\n\tprivate SimSettings.VM_TYPES type;\r\n\r\n\tpublic CloudVM(int id, int userId, double mips, int numberOfPes, int ram,\r\n\t\t\tlong bw, long size, String vmm, CloudletScheduler cloudletScheduler) {\r\n\t\tsuper(id, userId, mips, numberOfPes, ram, bw, size, vmm, cloudletSchedu... | import java.util.List;
import org.cloudbus.cloudsim.Host;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.core.SimEvent;
import edu.boun.edgecloudsim.cloud_server.CloudVM;
import edu.boun.edgecloudsim.core.SimManager;
import edu.boun.edgecloudsim.core.SimSetting... | /*
* Title: EdgeCloudSim - Basic Edge Orchestrator implementation
*
* Description:
* BasicEdgeOrchestrator implements basic algorithms which are
* first/next/best/worst/random fit algorithms while assigning
* requests to the edge devices.
*
* Licence: GPL - http://www.gnu.org/copyle... | double requiredCapacity = ((CpuUtilizationModel_Custom)task.getUtilizationModelCpu()).predictUtilization(vmArray.get(vmIndex).getVmType()); | 4 |
belaban/jgroups-raft | tests/junit-functional/org/jgroups/tests/ReplicatedStateMachineTest.java | [
"@MBean(description=\"Protocol performing leader election according to the RAFT paper\")\npublic class ELECTION extends Protocol {\n // when moving to JGroups -> add to jg-protocol-ids.xml\n protected static final short ELECTION_ID = 520;\n\n // When moving to JGroups -> add to jg-magic-map.xml\n pro... | import org.jgroups.Global;
import org.jgroups.JChannel;
import org.jgroups.protocols.raft.ELECTION;
import org.jgroups.protocols.raft.RAFT;
import org.jgroups.protocols.raft.REDIRECT;
import org.jgroups.raft.blocks.ReplicatedStateMachine;
import org.jgroups.tests.VoteTest.DummyStateMachine;
import org.jgroups.util.Util... | package org.jgroups.tests;
@Test(groups=Global.FUNCTIONAL,singleThreaded=true)
public class ReplicatedStateMachineTest {
protected static final String CLUSTER=ReplicatedStateMachineTest.class.getSimpleName();
protected static final List<String> mbrs=Arrays.asList("A", "B", "C", "D");
public void testEquals() th... | RAFT raft=new RAFT().members(mbrs).raftId(name).stateMachine(new DummyStateMachine()) | 1 |
ceaseless-prayer/CeaselessAndroid | app/src/main/java/org/theotech/ceaselessandroid/note/NoteManagerImpl.java | [
"public interface PersonManager {\n\n RealmList<Person> getPersonFromPersonPOJO(List<PersonPOJO> people);\n\n void setRealm(Realm realm);\n\n List<PersonPOJO> getNextPeopleToPrayFor(int n) throws AlreadyPrayedForAllContactsException;\n\n List<PersonPOJO> getActivePeople();\n\n List<PersonPOJO> getFav... | import android.app.Activity;
import android.content.ContentResolver;
import org.theotech.ceaselessandroid.person.PersonManager;
import org.theotech.ceaselessandroid.person.PersonManagerImpl;
import org.theotech.ceaselessandroid.realm.Note;
import org.theotech.ceaselessandroid.realm.Person;
import org.theotech.ceaseless... | package org.theotech.ceaselessandroid.note;
/**
* Created by chrislim on 11/3/15.
*/
public class NoteManagerImpl implements NoteManager {
private static final String TAG = NoteManagerImpl.class.getSimpleName();
private static NoteManager instance;
private Activity activity;
private Realm realm;
... | PersonManager pm = PersonManagerImpl.getInstance(activity); | 1 |
winterDroid/android-drawable-importer-intellij-plugin | src/main/java/de/mprengemann/intellij/plugin/androidicons/controllers/batchscale/additem/IAddItemBatchScaleImporterController.java | [
"public interface IController<T> {\n void addObserver(T observer);\n\n void removeObserver(T observer);\n\n void tearDown();\n}",
"public enum Destination {\n DRAWABLE(\"drawable\"),\n MIPMAP(\"mipmap\");\n\n\n private final String folderName;\n\n Destination(String folderName) {\n thi... | import com.intellij.openapi.project.Project;
import de.mprengemann.intellij.plugin.androidicons.controllers.IController;
import de.mprengemann.intellij.plugin.androidicons.images.ResizeAlgorithm;
import de.mprengemann.intellij.plugin.androidicons.model.Destination;
import de.mprengemann.intellij.plugin.androidicons.mod... | package de.mprengemann.intellij.plugin.androidicons.controllers.batchscale.additem;
public interface IAddItemBatchScaleImporterController extends IController<AddItemBatchScaleDialogObserver> {
String getExportName();
String getExportPath();
| Set<Resolution> getTargetResolutions(); | 4 |
msgpack-rpc/msgpack-rpc-java | src/main/java/org/msgpack/rpc/Server.java | [
"public class DefaultDispatcherBuilder implements DispatcherBuilder {\n\n public Dispatcher build(Object handler, MessagePack messagePack) {\n return new MethodDispatcher(\n new Reflect(messagePack), handler);\n }\n}",
"public interface DispatcherBuilder {\n\n public Dispatcher buil... | import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import org.msgpack.rpc.builder.DefaultDispatcherBuilder;
import org.msgpack.rpc.builder.DispatcherBuilder;
import org.msgpack.rpc.reflect.Reflect;
import org.msgpack.type.NilValue;
import org.msgpack.type.Value;
import ... | //
// MessagePack-RPC for Java
//
// Copyright (C) 2010 FURUHASHI Sadayuki
//
// 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... | public void onRequest(MessageSendable channel, int msgid, String method, Value args) { | 7 |
el-groucho/jsRules | src/test/java/org/grouchotools/jsrules/loader/RuleLoaderTest.java | [
"public enum Operator {\n GT {\n @Override\n public Boolean compare(Object left, Object right) throws InvalidParameterException {\n Number leftNumber = getNumber(left);\n Number rightNumber = getNumber(right);\n return leftNumber.doubleValue() > rightNumber.doubleVa... | import org.grouchotools.jsrules.Operator;
import org.grouchotools.jsrules.Parameter;
import org.grouchotools.jsrules.Rule;
import org.grouchotools.jsrules.config.ParamConfig;
import org.grouchotools.jsrules.config.ResponseConfig;
import org.grouchotools.jsrules.config.RuleConfig;
import org.grouchotools.jsrules.excepti... | /*
* The MIT License
*
* Copyright 2015 Paul.
*
* 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, me... | private RuleLoaderImpl ruleLoader; | 7 |
KoperGroup/koper | koper-dataevent/src/main/java/koper/event/DataEventMessageDispatcher.java | [
"public class DefaultMessageDispatcher implements MessageDispatcher {\n\n private static Logger log = LoggerFactory.getLogger(DefaultMessageDispatcher.class);\n\n private ListenerRegistry listenerRegistry;\n\n private MessageCenter messageCenter;\n\n private BlockingQueue<MsgBean> mailBox;\n\n @Overr... | import java.util.Optional;
import com.alibaba.fastjson.JSON;
import koper.DefaultMessageDispatcher;
import koper.Listen;
import koper.MsgBean;
import koper.MsgBeanListener;
import koper.convert.ConverterCenter;
import koper.util.ReflectUtil;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import or... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | protected void triggerMessageListener(MsgBean<String, String> msgBean, Object listener) { | 1 |
rodolfodpk/myeslib | myeslib-jdbi/src/test/java/org/myeslib/jdbi/storage/JdbiSnapshotReaderTest.java | [
"public interface Event extends Serializable {\n\t\n}",
"@SuppressWarnings(\"serial\")\n@Data\npublic class AggregateRootHistory implements Serializable {\n\n\tprivate final List<UnitOfWork> unitsOfWork;\n\tprivate final Set<UnitOfWork> persisted;\n\n\tpublic AggregateRootHistory() {\n\t\tthis.unitsOfWork = new L... | import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.sameInstance;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import... | package org.myeslib.jdbi.storage;
@RunWith(MockitoJUnitRunner.class)
public class JdbiSnapshotReaderTest {
@Mock
Map<UUID, Snapshot<InventoryItemAggregateRoot>> lastSnapshotMap ;
@Mock
Function<Void, InventoryItemAggregateRoot> newInstanceFunction;
@Mock | AggregateRootHistoryReaderDao<UUID> arReader ; | 6 |
Techjar/VivecraftForgeExtensions_110 | src/main/java/com/techjar/vivecraftforge/core/asm/handler/ASMHandlerIncreaseReachDistance.java | [
"public class ObfNames {\n\tpublic static final String ENTITYAICREEPERSWELL = \"ut\";\n\tpublic static final String ENTITYLIVINGBASE = \"sf\";\n\tpublic static final String ENTITYENDERMAN = \"yq\";\n\tpublic static final String ENTITYPLAYER = \"zs\";\n\tpublic static final String VEC3D = \"bcb\";\n\tpublic static f... | import com.techjar.vivecraftforge.core.asm.ObfNames;
import net.minecraftforge.fml.relauncher.FMLLaunchHandler;
import net.minecraftforge.fml.relauncher.Side;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldIns... | package com.techjar.vivecraftforge.core.asm.handler;
public class ASMHandlerIncreaseReachDistance extends ASMClassHandler {
@Override
public ClassTuple getDesiredClass() {
return new ClassTuple("net.minecraft.network.NetHandlerPlayServer", ObfNames.NETHANDLERPLAYSERVER);
}
@Override
public ASMMethodHandler[]... | public MethodTuple getDesiredMethod() { | 4 |
ivanhe/termolator | src/main/java/FuseJet/Utils/Console.java | [
"public interface FuseJetAnnotator {\n public void initialize(String[] resourceInformation);\n public void annotate(FuseDocument doc);\n}",
"public interface FuseDocumentReader {\n public FuseDocument read(String fileIdentifier);\n}",
"public interface FuseDocumentWriter {\n public void write(FuseDo... | import AceJet.Gazetteer;
import FuseJet.Annotators.FuseJetAnnotator;
import FuseJet.IO.FuseDocumentReader;
import FuseJet.IO.FuseDocumentWriter;
import FuseJet.IO.InitializableFuseDocumentWriter;
import FuseJet.Models.FuseDocument;
import Jet.Lex.EnglishLex;
import Jet.Lex.Lexicon;
import Jet.Pat.Pat;
import Jet.Pat.Pa... | package FuseJet.Utils;
/**
* Created with IntelliJ IDEA.
* User: yhe
* Date: 6/22/12
* Time: 2:45 PM
* To change this template use File | Settings | File Templates.
*/
public class Console {
private static Properties props = new Properties();
// @Deprecated
// private static MENameTagger nameTagger ... | private static List<FuseJetAnnotator> annotators = new ArrayList<FuseJetAnnotator>(); | 0 |
fengyouchao/sockslib | src/main/java/sockslib/server/Socks5Handler.java | [
"public class SocksSocket extends Socket {\n\n protected static final Logger logger = LoggerFactory.getLogger(SocksSocket.class);\n\n private SocksProxy proxy;\n\n private String remoteServerHost;\n\n private int remoteServerPort;\n\n /**\n * Socket that will connect to SOCKS server.\n */\n private Socket... | import java.util.concurrent.CountDownLatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import sockslib.client.SocksProxy;
import sockslib.client.SocksSocket;
import sockslib.common.ProtocolErrorException;
import sockslib.common.SocksException;
import sockslib.common.methods.SocksMethod;
import sockslib.se... | /*
* Copyright 2015-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | Pipe pipe = new SocketPipe(session.getSocket(), socket); | 3 |
MindscapeHQ/raygun4java | core/src/test/java/com/mindscapehq/raygun4java/core/handlers/requestfilters/RaygunDuplicateErrorFilterTest.java | [
"public class RaygunDuplicateErrorFilter implements IRaygunOnBeforeSend, IRaygunOnAfterSend {\n\n private Map<Throwable, Throwable> sentErrors = new WeakHashMap<Throwable, Throwable>();\n\n /**\n * @param message to check if the error has already been sent\n * @return message\n */\n public Rayg... | import com.mindscapehq.raygun4java.core.handlers.requestfilters.RaygunDuplicateErrorFilter;
import com.mindscapehq.raygun4java.core.handlers.requestfilters.RaygunDuplicateErrorFilterFactory;
import com.mindscapehq.raygun4java.core.messages.RaygunErrorMessage;
import com.mindscapehq.raygun4java.core.messages.RaygunMessa... | package com.mindscapehq.raygun4java.core.handlers.requestfilters;
public class RaygunDuplicateErrorFilterTest {
@Test
public void shouldFilterSameException() {
RaygunDuplicateErrorFilter filter = new RaygunDuplicateErrorFilter();
Exception exception = new Exception();
| RaygunMessage message = new RaygunMessage(); | 3 |
AVMf/avmf | src/main/java/org/avmframework/examples/inputdatageneration/triangle/TriangleTestObject.java | [
"public class Vector extends AbstractVector {\n\n public void addVariable(Variable variable) {\n variables.add(variable);\n }\n\n public List<Variable> getVariables() {\n return new ArrayList<>(variables);\n }\n\n public void setVariablesToInitial() {\n for (Variable var : variables) {\n var.setV... | import org.avmframework.Vector;
import org.avmframework.examples.inputdatageneration.Branch;
import org.avmframework.examples.inputdatageneration.BranchTargetObjectiveFunction;
import org.avmframework.examples.inputdatageneration.TestObject;
import org.avmframework.variable.IntegerVariable; | package org.avmframework.examples.inputdatageneration.triangle;
public class TriangleTestObject extends TestObject {
static final int NUM_BRANCHING_NODES = 8;
static final int INITIAL_VALUE = 0;
static final int MIN = 0;
static final int MAX = 1000;
@Override
public Vector getVector() {
Vector vecto... | public BranchTargetObjectiveFunction getObjectiveFunction(Branch target) { | 1 |
inaiat/jqplot4java | src/main/java/br/com/digilabs/jqplot/chart/BarSeriesChart.java | [
"public class ChartConfiguration<T extends Serializable> implements Serializable {\n\n\t/** The Constant serialVersionUID. */\n\tprivate static final long serialVersionUID = 7082325039222592701L;\n\n\t/** The series. */\n\tprotected Collection<Serie> series;\n\n\t/** The axes. */\n\tprotected Axes<T> axes;\n\n\t/**... | import br.com.digilabs.jqplot.ChartConfiguration;
import br.com.digilabs.jqplot.JqPlotResources;
import br.com.digilabs.jqplot.data.LineSeriesData;
import br.com.digilabs.jqplot.data.item.LineSeriesItem;
import br.com.digilabs.jqplot.elements.Title;
import br.com.digilabs.jqplot.metadata.JqPlotPlugin;
import java.util.... | /*
* Copyright 2011 Inaiat H. Moraes.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | private final ChartConfiguration<String> chartConfig; | 0 |
cmongis/psfj | src/knop/psfj/graphics/ShiftHeatMap.java | [
"public class BeadFrame extends Observable {\n\n\t/** The bead id. */\n\tInteger id;\n\n\t/** The boundaries. */\n\tRectangle2D boundaries;\n\n\t/** The ImagePlus stack containing the bead. */\n\tImagePlus ip;\n\n\t/** The BeadImage object from where the BeadFrame has been extracted. */\n\tBeadImage source;\n\n\t... | import knop.psfj.utils.MathUtils;
import ij.process.ColorProcessor;
import ij.process.ImageProcessor;
import java.awt.Color;
import javax.swing.ImageIcon;
import knop.psfj.BeadFrame;
import knop.psfj.BeadImage;
import knop.psfj.FovDataSet;
import knop.psfj.heatmap.HeatMapGenerator; | /*
This file is part of PSFj.
PSFj 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.
PSFj is distributed in the hope ... | generator.setUnit(MathUtils.MICROMETERS); | 4 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/Template_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import eu.optique.r2rml.api.model.LogicalTable;
import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.model.Template;
import eu.optique.r2rml.api.m... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | Template t=s.getTemplate();
| 7 |
sosiouxme/LogMyLife | src/net/sosiouxme/logmylife/custom/AlertEditActivity.java | [
"public final class R {\n public static final class array {\n public static final int alertIntervals=0x7f050008;\n public static final int dateFormatStored=0x7f050003;\n public static final int dateFormatVisible=0x7f050002;\n public static final int logValueTypes=0x7f050009;\n ... | import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import net.sosiouxme.logmylife.R;
import net.sosiouxme.logmylife.Util;
import net.sosiouxme.logmylife.domain.DbAdapter;
import net.sosiouxme.logmylife.domain.dto.Alert;
import net.sosiouxme.logmylife.domain.dto.LogEntry;
import net.sosiouxme.logm... | /*
This file is part of LogMyLife, an application for logging events.
Copyright (C) 2011 Luke Meyer
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... | private List<Alert> mAlertList = null; | 3 |
winzillion/FluxJava | demo-rx2/src/sharedTest/java/com/example/fluxjava/rx2/StubAppConfig.java | [
"public class StubActionHelper extends ActionHelper {\n\n @Override\n public Object wrapData(final Object inData) {\n Object result = inData;\n\n if (inData instanceof Integer) {\n result = new ArrayList<>();\n }\n if (inData instanceof String) {\n result = ne... | import android.app.Application;
import com.example.fluxjava.rx2.domain.StubActionHelper;
import com.example.fluxjava.rx2.domain.stores.StubTodoStore;
import com.example.fluxjava.rx2.domain.stores.StubUserStore;
import io.wzcodes.fluxjava.FluxContext;
import io.wzcodes.fluxjava.rx.RxBus;
import java.util.HashMap;
import... | /*
* Copyright (C) 2016 Bugs will find a way (https://wznote.blogspot.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | .setActionHelper(new StubActionHelper()) | 0 |
wrey75/WaveCleaner | src/main/java/com/oxande/xmlswing/components/JRadioButtonUI.java | [
"public class AttributeDefinition {\r\n\t\r\n\tpublic final static Map<String, String> ALIGNS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CLOSE_OPERATIONS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CURSORS = new HashMap<String, String>();\r\n\tpub... | import javax.swing.JRadioButton;
import org.w3c.dom.Element;
import com.oxande.xmlswing.AttributeDefinition;
import com.oxande.xmlswing.AttributesController;
import com.oxande.xmlswing.Parser;
import com.oxande.xmlswing.UnexpectedTag;
import com.oxande.xmlswing.jcode.JavaClass;
import com.oxande.xmlswing.jcode.J... | package com.oxande.xmlswing.components;
/**
* The JRadioButton implementation.
*
* @author wrey75
* @version $rev$
*
*
*/
public class JRadioButtonUI extends JToggleButtonUI {
public static final AttributeDefinition[] PROPERTIES = {
};
public static final AttributesController CONTRO... | public String parse(JavaClass jclass, JavaMethod initMethod, Element root ) throws UnexpectedTag{
| 6 |
Neutrinet/ISP-ng | src/main/java/be/neutrinet/ispng/vpn/api/RestletServlet.java | [
"public class SessionManager {\n private static SessionManager instance = new SessionManager();\n\n public static SessionToken createSessionToken(User user, String address) {\n return new SessionToken(user.id, address);\n }\n\n public static boolean validateToken(String token, String address) {\n... | import be.neutrinet.ispng.security.SessionManager;
import be.neutrinet.ispng.security.SessionToken;
import be.neutrinet.ispng.security.SessionTokens;
import be.neutrinet.ispng.vpn.User;
import be.neutrinet.ispng.vpn.Users;
import be.neutrinet.ispng.vpn.admin.Registration;
import be.neutrinet.ispng.vpn.admin.Registratio... | /*
* 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 be.neutrinet.ispng.vpn.api;
/**
* @author wannes
*/
public class RestletServlet extends HttpServlet {
private Servlet... | SessionToken st = new SessionToken(reg.user, request.getClientInfo().getAddress()); | 1 |
tony-Shx/Swface | app/src/main/java/com/henu/swface/activity/FaceDetailActivity.java | [
"public class FaceDetailAdapter extends RecyclerView.Adapter<FaceDetailAdapter.ViewHolder> {\n\n\tprivate List<Uri> imageList;\n\tprivate OnItemLongClickListener onItemLongClickListener;\n\tprivate static final String TAG = FaceDetailAdapter.class.getSimpleName();\n\tprivate OnDeleteClickListener onDeleteClickListe... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Inten... | package com.henu.swface.activity;
public class FaceDetailActivity extends Activity implements View.OnClickListener {
private ImageView imageView_face_detail_head, delete_picture, detail_picture, expandedImageView,imageView_thumView;
private TextView textView_face_detail_name, textView_face_detail_register_time;
... | Response response = FaceSetUtil.removeFaceFormFaceSet(FinalUtil.API_KEY, FinalUtil.API_Secret, getOutId(), sb.toString()); | 4 |
VisualDataWeb/OWL2VOWL | src/main/java/de/uni_stuttgart/vis/vowl/owl2vowl/parser/vowl/property/ObjectPropertyVisitor.java | [
"public enum VowlAttribute {\n\tINTERSECTION(\"intersection\"),\n\tOBJECT(\"object\"),\n\tDEPRECATED(\"deprecated\"),\n\tEXTERNAL(\"external\"),\n\tRDF(\"rdf\"),\n\tUNION(\"union\"),\n\tCOMPLEMENT(\"complement\"),\n\tDATATYPE(\"datatype\"),\n\tTRANSITIVE(\"transitive\"),\n\tFUNCTIONAL(\"functional\"),\n\tINVERSE_FU... | import de.uni_stuttgart.vis.vowl.owl2vowl.constants.VowlAttribute;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.data.VowlData;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.entities.nodes.AbstractNode;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.entities.nodes.classes.NullClass;
import de.uni_stuttgart.vis.vow... | package de.uni_stuttgart.vis.vowl.owl2vowl.parser.vowl.property;
public class ObjectPropertyVisitor extends PropertyVisitor {
private Logger logger = LogManager.getLogger(ObjectPropertyVisitor.class);
public ObjectPropertyVisitor(VowlData vowlData, OWLProperty owlObjectProperty) {
super(vowlData, owlObjectProp... | prop.addAttribute(VowlAttribute.INVERSE_FUNCTIONAL); | 0 |
EndlessCodeGroup/RPGInventory | src/main/java/ru/endlesscode/rpginventory/utils/ItemUtils.java | [
"public class BackpackManager {\n\n private static final String CONFIG_NAME = \"backpacks.yml\";\n\n private static final HashMap<String, BackpackType> BACKPACK_TYPES = new HashMap<>();\n private static final HashMap<UUID, Backpack> BACKPACKS = new HashMap<>();\n private static int BACKPACK_LIMIT;\n\n ... | import ru.endlesscode.rpginventory.item.ItemManager;
import ru.endlesscode.rpginventory.misc.config.Config;
import ru.endlesscode.rpginventory.misc.config.TexturesType;
import ru.endlesscode.rpginventory.pet.PetFood;
import ru.endlesscode.rpginventory.pet.PetManager;
import ru.endlesscode.rpginventory.pet.PetType;
impo... | /*
* This file is part of RPGInventory.
* Copyright (C) 2015-2017 Osip Fatkullin
*
* RPGInventory 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) a... | } else if (PetFood.isFoodItem(item)) { | 6 |
nullpointerexceptionapps/TeamCityDownloader | java/com/raidzero/teamcitydownloader/activities/BuildInfoActivity.java | [
"public class TeamCityBuild implements Parcelable {\n private static final String tag = \"TeamCityBuild\";\n\n private String number;\n private String status;\n private String url;\n private String webUrl;\n private String branch;\n\n public TeamCityBuild(String number, String status, String ur... | import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.raidzero.teamcitydownloader.R;
import com.raidzero.teamcitydownloader.data.TeamCityBuild;
import com.r... | package com.raidzero.teamcitydownloader.activities;
/**
* Created by raidzero on 8/14/14.
*/
public class BuildInfoActivity extends TeamCityActivity {
private static final String tag = "BuildInfoActivity";
private TeamCityBuild build;
private QueryUtility queryUtility;
private TextView txt_trig... | public void onQueryComplete(WebResponse response) { | 1 |
mslosarz/nextrtc-signaling-server | src/main/java/org/nextrtc/signalingserver/modules/NextRTCBeans.java | [
"@Slf4j\n@Service(Names.EVENT_BUS)\n@Scope(\"singleton\")\npublic class NextRTCEventBus {\n private EventBus eventBus;\n\n public NextRTCEventBus() {\n this.eventBus = new EventBus();\n }\n\n public void post(NextRTCEvent event) {\n if (event.type() != NextRTCEvents.MESSAGE) {\n ... | import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import org.nextrtc.signalingserver.api.NextRTCEventBus;
import org.nextrtc.signalingserver.cases.SignalHandler;
import org.nextrtc.signalingserver.domain.DefaultMessageSender;
import org.nextrtc.signalingserver.domain.MessageSender;
import org.nextrtc.s... | package org.nextrtc.signalingserver.modules;
@Module
public abstract class NextRTCBeans {
@Provides
@Singleton
static NextRTCEventBus NextRTCEventBus() {
return new NextRTCEventBus();
}
@Provides
@Singleton
static ScheduledExecutorService ScheduledExecutorService(NextRTCProperti... | abstract MessageSender messageSender(DefaultMessageSender messageSender); | 3 |
TechzoneMC/NPCLib | nms-v1_7_R3/src/main/java/net/techcable/npclib/nms/versions/v1_7_R3/NMS.java | [
"public interface HumanNPC extends LivingNPC {\r\n\r\n /**\r\n * Return this npc's skin\r\n * <p/>\r\n * A value of null represents a steve skin\r\n *\r\n * @return this npc's skin\r\n */\r\n public UUID getSkin();\r\n\r\n /**\r\n * Set the npc's skin\r\n * <p/>\r\n * A ... | import java.util.Collection;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import net.minecraft.server.v1_7_R3.EntityLiving;
import net.minecraft.server.v1_7_R3.EntityPlayer;
imp... | package net.techcable.npclib.nms.versions.v1_7_R3;
public class NMS implements net.techcable.npclib.nms.NMS {
private static NMS instance;
public NMS() {
if (instance == null) instance = this;
}
public static NMS getInstance() {
return instance;
}
@Override
public I... | public static LivingNPCHook getHook(LivingNPC npc) { | 1 |
xia-st/JPython | src/pers/xia/jpython/compiler/PySTEntryObject.java | [
"public final class Py\n{\n public final static PyNone None = new PyNone();\n public final static PyBoolean True = new PyBoolean(true);\n public final static PyBoolean False = new PyBoolean(false);\n\n public static String encoding = \"utf-8\";\n\n private final static PyLong[] integerCache = new PyL... | import pers.xia.jpython.object.Py;
import pers.xia.jpython.object.PyDict;
import pers.xia.jpython.object.PyList;
import pers.xia.jpython.object.PyLong;
import pers.xia.jpython.object.PyObject;
import pers.xia.jpython.object.PySet; | package pers.xia.jpython.compiler;
class PySTEntryObject extends PyObject
{
PyLong steId; /* int: key in ste_table->st_blocks */
PyDict steSymbols; /* dict: variable names to flags */
String steName; /* string: name of current block */
PyList steVarnames; /* list of function parameters */
PyList s... | k = Py.newInteger(key.hashCode()); | 0 |
Flibio/JobsLite | src/main/java/me/flibio/jobslite/creation/task/PlaceTask.java | [
"public class Reward {\n\n private double currency;\n private double exp;\n\n public Reward(double currency, double exp) {\n this.currency = currency;\n this.exp = exp;\n }\n\n public double getCurrency() {\n return currency;\n }\n\n public double getExp() {\n return... | import org.spongepowered.api.Sponge;
import org.spongepowered.api.block.BlockSnapshot;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.ev... | /*
* This file is part of JobsLite, licensed under the MIT License (MIT).
*
* Copyright (c) 2015 - 2018 Flibio
* Copyright (c) Contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the So... | Sponge.getEventManager().registerListeners(JobsLite.getInstance(), this); | 1 |
moorkop/mccy-engine | src/test/java/me/itzg/mccy/services/assets/WorldAssetsServiceTest.java | [
"@Document(indexName = DocumentCommon.INDEX, type = Asset.TYPE)\n@JsonTypeInfo(use = JsonTypeInfo.Id.MINIMAL_CLASS, property = \"type\")\npublic abstract class Asset<DT> {\n public static final String TYPE = \"asset\";\n\n @Id\n @NotNull\n private String id;\n\n @NotNull\n private AssetCategory ca... | import me.itzg.mccy.model.Asset;
import me.itzg.mccy.model.AssetObjectPurpose;
import me.itzg.mccy.model.ServerType;
import me.itzg.mccy.model.WorldDescriptor;
import me.itzg.mccy.repos.AssetRepo;
import me.itzg.mccy.services.ZipMiningService;
import me.itzg.mccy.types.ComparableVersion;
import me.itzg.mccy.types.MccyE... | package me.itzg.mccy.services.assets;
/**
* @author Geoff Bourne
* @since 0.2
*/
public class WorldAssetsServiceTest {
private WorldAssetsService worldAssetsService; | private ZipMiningService zipMiningService; | 3 |
7upcat/agile-wroking-backend | src/test/java/org/catframework/agileworking/web/TeamControllerTest.java | [
"@Entity\npublic class Team implements Serializable {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t@Id\n\t@GeneratedValue\n\tprivate Long id;\n\n\t@Column(nullable = false)\n\tprivate String name;\n\n\t// desc 和 mysql 中的关键字有冲突,所以使用了 'team_desc'\n\t@Column(name = \"team_desc\")\n\tprivate String desc;\... | import java.util.List;
import org.catframework.agileworking.domain.Team;
import org.catframework.agileworking.domain.TeamFactory;
import org.catframework.agileworking.domain.TeamRepository;
import org.catframework.agileworking.domain.User;
import org.catframework.agileworking.domain.UserFactory;
import org.catframework... | package org.catframework.agileworking.web;
@RunWith(SpringRunner.class)
@SpringBootTest
public class TeamControllerTest {
@Autowired | private TeamRepository teamRepository; | 2 |
apache/geronimo-gshell | gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/UnsetCommand.java | [
"public interface Command\n{\n /** Standard command success status code. */\n int SUCCESS = 0;\n\n /** Standard command failure status code. */\n int FAILURE = -1;\n\n String getName();\n\n void init(CommandContext context); // throws Exception ?\n\n Object execute(Object... args) throws Except... | import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.geronimo.gshell.command.Command;
import org.apache.geronimo.gshell.command.CommandSupport;
import org.apache.geronimo.gshell.command.Variables;
import org.apache.geronimo.gshe... | /*
* 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 ... | MessageSource messages = getMessageSource(); | 4 |
DorsetProject/dorset-framework | components/reporters/file-reporter/src/test/java/edu/jhuapl/dorset/reporting/FileReporterTest.java | [
"public class Request {\n /** Maximum length of the identifier string ({@value #MAX_ID_LENGTH}) */\n public static final int MAX_ID_LENGTH = 36;\n\n private String text;\n private final String id;\n private final User user;\n\n /**\n * Create a request\n * <p>\n * Automatically sets th... | import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.ut... | /*
* Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... | Reporter reporter = new FileReporter(file.toString()); | 3 |
statefulj/statefulj | statefulj-framework/statefulj-framework-tests/src/test/java/org/statefulj/framework/tests/ddd/DomainEntityTest.java | [
"public interface ReferenceFactory {\n\t\n\tString getBinderId(String key);\n\n\tString getFinderId();\n\t\n\tString getFSMHarnessId(); \n\n\tString getPersisterId(); \n\n\tString getFactoryId();\n\n\tString getStatefulFSMId();\n\t\n\tString getFSMId();\n\t\n\tString getStateId(String state);\n\t\n\tString getTrans... | import org.statefulj.framework.core.model.impl.ReferenceFactoryImpl;
import org.statefulj.fsm.TooBusyException;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import static org.statefulj.framework.tests.utils.ReflectionUtils.*;
import java.lang.reflect.InvocationTargetException;
import javax.ann... | /***
*
* Copyright 2014 Andrew Hall
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | ReferenceFactory refFactory = new ReferenceFactoryImpl("domainEntity"); | 2 |
manuelsc/Raven-Messenger | Raven App/src/main/java/at/flack/SMSMainActivity.java | [
"public class KeyEntity implements Serializable{\n\n\tprivate static final long serialVersionUID = 1L;\n\t\n\tprivate byte [] key;\n\tprivate byte [] key2;\n\tprivate byte version;\n\tprivate long timestamp;\n\t\n\t// Format: HASH_ENCRYPTION_ENCRYPTION_VERSION\n\tpublic static final byte BLAKE_AES_NONE_1 \t\t= \t0x... | import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import safe.KeyEntity;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bund... | /*
Copyright 2015 Philipp Adam, Manuel Caspari, Nicolas Lukaschek
contact@ravenapp.org
This file is part of Raven.
Raven 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
... | public ArrayList<ContactModel> getNames(ArrayList<SMSItem> contacts2, Activity activity) { | 4 |
liuyanggithub/Hi | src/com/ly/hi/im/ui/AddFriendActivity.java | [
"public class AddFriendAdapter extends BaseListAdapter<BmobChatUser> {\n\n\tpublic AddFriendAdapter(Context context, List<BmobChatUser> list) {\n\t\tsuper(context, list);\n\t\t// TODO Auto-generated constructor stub\n\t}\n\n\t@Override\n\tpublic View bindView(int arg0, View convertView, ViewGroup arg2) {\n\t\t// TO... | import java.util.ArrayList;
import java.util.List;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemCli... | package com.ly.hi.im.ui;
/** Ìí¼ÓºÃÓÑ
* @ClassName: AddFriendActivity
* @author liuy
*/
public class AddFriendActivity extends ActivityBase implements IXListViewListener,OnItemClickListener{
EditText et_find_name;
// Button btn_search;
List<BmobChatUser> users = new ArrayList<BmobChatUser>();
XListView... | if (CollectionUtils.isNotNull(arg0)) { | 2 |
taimos/GPSd4Java | src/main/java/de/taimos/gpsd4java/api/IObjectListener.java | [
"public class ATTObject implements IGPSObject {\n\t\n\t/**\n\t * the GPSd internal name\n\t */\n\tpublic static final String NAME = \"ATT\";\n\t\n\tprivate String tag = null;\n\t\n\tprivate String device = null;\n\t\n\tprivate double timestamp = Double.NaN;\n\t\n\tprivate double heading = Double.NaN;\n\t\n\tprivate... | import de.taimos.gpsd4java.types.ATTObject;
import de.taimos.gpsd4java.types.DeviceObject;
import de.taimos.gpsd4java.types.DevicesObject;
import de.taimos.gpsd4java.types.SKYObject;
import de.taimos.gpsd4java.types.TPVObject;
import de.taimos.gpsd4java.types.subframes.SUBFRAMEObject; | package de.taimos.gpsd4java.api;
/*
* #%L
* GPSd4Java
* %%
* Copyright (C) 2011 - 2012 Taimos GmbH
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/lic... | void handleSKY(SKYObject sky); | 3 |
rodolfodpk/myeslib | inventory-hazelcast/src/main/java/org/myeslib/example/hazelcast/HzExample.java | [
"@AllArgsConstructor\npublic class CamelModule extends AbstractModule {\n\n int jettyMinThreads;\n int jettyMaxThreads;\n int eventsQueueConsumers;\n\n @Provides\n @Singleton\n @Named(\"commandsDestinationUri\")\n public String commandsDestinationUri() {\n return \"direct:processCommand\... | import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.impl.SimpleRegistry;
import org.apache.camel.main.Main;
import org.myeslib.example.hazelcast.modules.CamelModule;
import org.myeslib.example.hazel... | package org.myeslib.example.hazelcast;
@Slf4j
public class HzExample {
final Main main;
final SimpleRegistry registry;
final CamelContext context;
static int jettyMinThreads;
static int jettyMaxThreads;
static int dbPoolMinConnections;
static int dbPoolMaxConnections;
static int eventsQueueConsumers... | new InventoryItemModule()); | 3 |
jchampemont/WTFDYUM | src/test/java/com/jeanchampemont/wtfdyum/service/CronServiceTest.java | [
"@SpringBootApplication\n@EnableScheduling\npublic class WTFDYUMApplication {\n\n @Bean\n public Clock clock() {\n return Clock.systemDefaultZone();\n }\n\n public static void main(final String[] args) {\n SpringApplication.run(WTFDYUMApplication.class, args);\n }\n}",
"public class E... | import com.jeanchampemont.wtfdyum.WTFDYUMApplication;
import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.dto.Principal;
import com.jeanchampemont.wtfdyum.dto.type.EventType;
import com.jeanchampemont.wtfdyum.dto.type.UserLimitType;
import com.je... | /*
* Copyright (C) 2015, 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*... | verify(userService, times(1)).addEvent(1L, new Event(EventType.INVALID_TWITTER_CREDENTIALS, "")); | 4 |
Sleeksnap/sleeksnap | src/org/sleeksnap/uploaders/url/TUrlShortener.java | [
"public class HttpUtil {\n\n\t/**\n\t * Attempt to encode the string silenty\n\t * \n\t * @param string\n\t * The string\n\t * @return The encoded string\n\t */\n\tpublic static String encode(String string) {\n\t\ttry {\n\t\t\treturn URLEncoder.encode(string, \"UTF-8\");\n\t\t} catch (UnsupportedEncoding... | import org.sleeksnap.http.HttpUtil;
import org.sleeksnap.http.RequestData;
import org.sleeksnap.upload.URLUpload;
import org.sleeksnap.uploaders.UploadException;
import org.sleeksnap.uploaders.Uploader; | /**
* Sleeksnap, the open source cross-platform screenshot uploader
* Copyright (C) 2014 Nikki <nikki@nikkii.us>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the L... | RequestData data = new RequestData(); | 1 |
mjuhasz/BDSup2Sub | src/main/java/bdsup2sub/gui/conversion/ConversionDialogController.java | [
"public enum ForcedFlagState {\n KEEP {\n @Override\n public String toString() {\n return \"keep\";\n }\n },\n SET {\n @Override\n public String toString() {\n return \"set all\";\n }\n },\n CLEAR {\n @Override\n public Str... | import bdsup2sub.core.ForcedFlagState;
import bdsup2sub.core.Resolution;
import bdsup2sub.utils.SubtitleUtils;
import bdsup2sub.utils.ToolBox;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.*;
import static bdsup2sub.core.Configuration.*;
impo... | /*
* Copyright 2014 Miklos Juhasz (mjuhasz)
*
* 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... | model.setFpsTrg(SubtitleUtils.getDefaultFramerateForResolution(resolution)); | 2 |
AndyGu/ShanBay | src/com/shanbay/words/view/TestView.java | [
"public class WordsActivity extends ShanbayActivity<WordsClient>\n{\n\tprotected final String ACTION_HOME_INIT = \"home_init\";\n\tprotected final String ACTION_HOME_INIT_KEY = \"session_date\";\n\tprotected final String ACTION_HOME_NORMAL = \"home_normal\";\n\tprotected final String ACTION_HOME_LOGOUT = \"home_log... | import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.TextView;
import com.shanbay.words.R;
import com.shanbay.words.activity.WordsActivity;
import com.shanbay.words.model.ExampleContent;
import com.shanbay.words.model.ExampleData;
imp... | package com.shanbay.words.view;
public class TestView extends WordView
{
public static final int VIEW_DEFINITION = 4;
public static final int VIEW_EXAMPLE = 8;
public static final int VIEW_SOUND = 2;
public static final int VIEW_WORD = 1;
private ExampleView mExampleView;
protected SpellView mSpellView;
... | private void handleMode(ReviewData reviewData) | 3 |
k0shk0sh/FastAccess | app/src/main/java/com/fastaccess/ui/modules/apps/device/DeviceAppsView.java | [
"public class DeviceAppsEventModel {\n\n public DeviceAppsEventModel() {}\n}",
"public class InputHelper {\n\n\n private static boolean isWhiteSpaces(String s) {\n return s != null && s.matches(\"\\\\s+\");\n }\n\n public static boolean isEmpty(String text) {\n return text == null || Tex... | import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.Loader;
import android.support.v4.widget.NestedScrollView;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.view.Ac... | package com.fastaccess.ui.modules.apps.device;
/**
* Created by Kosh on 10 Oct 2016, 11:47 PM
*/
public class DeviceAppsView extends BaseFragment<DeviceAppsMvp.View, DeviceAppsPresenter> implements DeviceAppsMvp.View {
public static final String TAG = "DeviceAppsView";
@BindView(R.id.recycler) DynamicR... | if (InputHelper.isEmpty(text)) { | 1 |
wpilibsuite/EclipsePlugins | edu.wpi.first.wpilib.plugins.cpp/src/main/java/edu/wpi/first/wpilib/plugins/cpp/wizards/examples/ExampleCPPWizard.java | [
"public class WPILibCore extends AbstractUIPlugin {\n\n\t// The plug-in ID\n\tpublic static final String PLUGIN_ID = \"edu.wpi.first.wpilib.plugins.core\"; //$NON-NLS-1$\n\n\t// The shared instance\n\tprivate static WPILibCore plugin;\n\n\t/**\n\t * The constructor\n\t */\n\tpublic WPILibCore() {\n\t}\n\n\t/*\n\t *... | import java.net.URL;
import java.util.List;
import java.util.Properties;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.wizard.IWizardPage;
import edu.wpi.first.wpilib.plugins.core.WPILibCore;
import edu.wpi.first.wpilib.plugins.core.wizards.ExampleWizard;
import edu.wpi.first.wpilib.plugins.co... | package edu.wpi.first.wpilib.plugins.cpp.wizards.examples;
public class ExampleCPPWizard extends ExampleWizard {
private NewProjectMainPage detailsPage;
/**
* Constructor for SampleNewWizard.
*/
public ExampleCPPWizard() {
super();
setNeedsProgressMonitor(true);
}
@Override
protected void doFinish(I... | ProjectCreationUtils.createProject(new WPIRobotCPPProjectCreator(projectName, ex, detailsPage.getWorld())); | 8 |
OOjDREW/OOjDREW | src/main/java/org/ruleml/oojdrew/GUI/Translator.java | [
"public class Config implements Configuration {\r\n /**\r\n * This variable specifies the default output format that is produced when\r\n * toString() calls are made on Term and DefiniteClause Objects. If this is\r\n * true then output is in POSL syntax, otherwise RuleML syntax is produced.\r\n *... | import java.awt.Component;
import java.awt.Dialog;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.Byt... |
if (selectedValue != null) {
String toWrite;
if (selectedValue.equals("RuleML")) {
toWrite = rmltext.getText();
} else {
toWrite = posltext.getText();
}
try {
Util.selectAndSaveToFile(toWrite,... | POSLParser pp = new POSLParser();
| 2 |
antest1/kcanotify | app/src/main/java/com/antest1/kcanotify/ShipInfoSortActivity.java | [
"public static void loadTranslationData(Context context) {\n loadTranslationData(context, false);\n}",
"public static final String PREF_KCA_LANGUAGE = \"kca_language\";",
"public static final String PREF_SHIPINFO_SORTKEY = \"shipinfo_sortkey\";",
"public static String getStringPreferences(Context ctx, Stri... | import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.PorterDuff;
import android.os.Build;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.To... | package com.antest1.kcanotify;
public class ShipInfoSortActivity extends AppCompatActivity {
Toolbar toolbar;
static Gson gson = new Gson();
LinearLayout listview;
TextView listcounter;
public int count;
public List<Integer> sort_items = new ArrayList<>();
public SparseArray<String> so... | String pref_sort_list = getStringPreferences(getApplicationContext(), PREF_SHIPINFO_SORTKEY); | 3 |
thshdw/lixia-javardp | src/com/lixia/rdp/keymapping/KeyCode_FileBased.java | [
"public abstract class InputJPanel {\r\n\r\n protected static Logger logger = Logger.getLogger(InputJPanel.class);\r\n \r\n\tKeyCode_FileBased newKeyMapper = null;\r\n\r\n\tprotected Vector pressedKeys;\r\n\r\n\tprotected static boolean capsLockOn = false;\r\n\tprotected static boolean numLockOn = false;\r\n\... | import java.awt.event.KeyEvent;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Hashtable;
import java.util.Iterator;
impo... |
if (applies) {
int d = current.modifierDistance(e, capsLockDown);
if ((smallestDist == -1) || (d < smallestDist)) {
smallestDist = d;
best = current;
}
}
}
if (e.getID() == KeyEven... | } catch (CryptoException e1) {
| 5 |
ehanoc/xwallet | app/src/main/java/com/bytetobyte/xwallet/ui/fragment/SendFragment.java | [
"public class BaseDialogFragment extends DialogFragment implements BlockchainClientListener {\n\n private MainActivity _baseActivity;\n\n /**\n *\n * @param context\n */\n @Override\n public void onAttach(Context context) {\n super.onAttach(context);\n\n _baseActivity = (MainAc... | import android.content.ClipboardManager;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewG... | package com.bytetobyte.xwallet.ui.fragment;
/**
* Created by bruno on 14.04.17.
*/
public class SendFragment extends BaseDialogFragment {
// post delay changes
private Handler _handler;
private Runnable _textHandlerRunnable;
private SpentValueMessage _feeToSpend;
private ClipboardManager _c... | private SendFragmentViewContract _sendViewContract; | 4 |
centralperf/centralperf | src/main/java/org/centralperf/service/RunStatisticsService.java | [
"@Entity\npublic class Run {\n\n\t@Id\n\t@GeneratedValue\n\tprivate Long id;\n\n\t@NotNull\n\t@Size(min = 1, max = 33)\n\tprivate String label;\n\n\t@ManyToOne\n\tprivate ScriptVersion scriptVersion;\n\t\n\tprivate boolean launched = false;\n\t\n\tprivate boolean running = false;\n\t\n\tprivate Date startDate;\n\t\... | import java.util.Iterator;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.centralperf.model.dao.Run;
import org.central... | /*
* Copyright (C) 2014 The Central Perf authors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* T... | private LoadingCache<Long, RunStats> runStatsCache; | 4 |
achellies/AtlasForAndroid | src/android/taobao/atlas/runtime/BundleLifecycleHandler.java | [
"public final class BundleImpl implements Bundle {\n static final Logger log;\n Archive archive;\n final File bundleDir;\n BundleClassLoader classloader;\n private final BundleContextImpl context;\n int currentStartlevel;\n ProtectionDomain domain;\n Hashtable<String, String> headers;\n f... | import android.annotation.SuppressLint;
import android.app.Application;
import android.os.AsyncTask;
import android.os.Build.VERSION;
import android.os.Looper;
import android.taobao.atlas.framework.BundleImpl;
import android.taobao.atlas.framework.Framework;
import android.taobao.atlas.hack.AtlasHacks;
import android.t... | }
@SuppressLint({"NewApi"})
public void bundleChanged(BundleEvent bundleEvent) {
switch (bundleEvent.getType()) {
case DeviceSecuritySDK.ENVIRONMENT_ONLINE /*0*/:
loaded(bundleEvent.getBundle());
case OpenBase.OAUTH_CREATE /*1*/:
installed(bun... | AtlasHacks.Application_attach.invoke(application, RuntimeVariables.androidApplication); | 2 |
USCDataScience/AgePredictor | age-predictor-cli/src/main/java/edu/usc/irds/agepredictor/cmdline/spark/authorage/AgeClassifySparkTrainerTool.java | [
"public class CLI {\n public static final String CMD = \"bin/authorage\";\n public static final String DEFAULT_FORMAT = AuthorAgeSample.FORMAT_NAME;\n \n private static Map<String, CmdLineTool> toolLookupMap;\n \n static {\n\ttoolLookupMap = new LinkedHashMap<String, CmdLineTool>();\n \n\tLi... | import opennlp.tools.cmdline.ObjectStreamFactory;
import opennlp.tools.cmdline.StreamFactoryRegistry;
import opennlp.tools.cmdline.TerminateToolException;
import opennlp.tools.ml.authorage.AgeClassifyTrainerFactory;
import opennlp.tools.util.TrainingParameters;
import opennlp.tools.util.model.ModelUtil;
import java.io.... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | AgeClassifyModel model; | 3 |
CST-Group/cst | src/main/java/br/unicamp/cst/core/entities/Codelet.java | [
"public class MemoryObjectNotFoundException extends Exception {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = -6845401281653737754L;\n\n\t/**\n\t * \n\t */\n\tpublic MemoryObjectNotFoundException() {\n\t}\n\n\t/**\n\t * @param message the message\n\t */\n\tpublic MemoryObjectNotFoundExcepti... | import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import br.unicamp.cst.core.exceptions.CodeletActivationBoundsException;
import br.unicamp.cst.core.exceptions.CodeletThresholdBo... | return timeStep;
}
/**
* Sets the Codelet's timestep.
*
* @param timeStep
* the timeStep to set.
*/
public synchronized void setTimeStep(long timeStep) {
this.timeStep = timeStep;
}
/**
* Gets if this Codelet is profiling.
*
* @return the isProfiling.
*/
public synchronized bo... | ExecutionTimeWriter executionTimeWriter = new ExecutionTimeWriter(); | 3 |
badvision/jace | src/main/java/jace/hardware/CardThunderclock.java | [
"public class EmulatorUILogic implements Reconfigurable {\r\n\r\n static Debugger debugger;\r\n\r\n static {\r\n debugger = new Debugger() {\r\n @Override\r\n public void updateStatus() {\r\n enableDebug(true);\r\n MOS65C02 cpu = (MOS65C02) Emulator.c... | import jace.EmulatorUILogic;
import jace.apple2e.MOS65C02;
import jace.config.ConfigurableField;
import jace.config.Name;
import jace.core.Card;
import jace.core.Computer;
import jace.core.Motherboard;
import jace.core.PagedMemory;
import jace.core.RAMEvent;
import jace.core.RAMEvent.TYPE;
import jace.core.Utility;
imp... | /*
* Copyright (C) 2012 Brendan Robert (BLuRry) brendan.robert@gmail.com.
*
* This library 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 2.1 of the License, or (at your option) ... | protected void handleIOAccess(int register, TYPE type, int value, RAMEvent e) { | 6 |
ra4king/LWJGL-OpenGL-Tutorials | src/com/ra4king/opengl/arcsynthesis/gl33/chapter16/example1/Example16_1.java | [
"public abstract class GLProgram {\r\n\tprivate int fps;\r\n\t\r\n\t/**\r\n\t * Initializes the application in fullscreen mode.\r\n\t * \r\n\t * @param vsync Enables/disables the vertical-sync feature, where the rendering is in sync with the monitor's refresh rate.\r\n\t * With v-sync off, there is no framer... | import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL12.*;
import static org.lwjgl.opengl.GL13.*;
import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.opengl.GL21.*;
import static org.lwjgl.opengl.GL30.*;
import static org.lwjgl.opengl.GL31.*;
... | package com.ra4king.opengl.arcsynthesis.gl33.chapter16.example1;
/**
* @author ra4king
*/
public class Example16_1 extends GLProgram {
public static void main(String[] args) {
new Example16_1().run(true);
}
private ShaderProgram gammaProgram;
private ShaderProgram noGammaProgram;
priv... | decoder.decode(buffer, decoder.getWidth() * 4, Format.RGBA);
| 2 |
unofficial/npr-android-app | src/org/npr/android/news/PodcastActivity.java | [
"public class Tracker {\n private static Tracker tracker;\n private static final String LOG_TAG = Tracker.class.getName();\n private static final boolean OMNITURE_PRESENT;\n private static final String OMNITURE_APP_MEASUREMENT =\n \"com.omniture.android.AppMeasurement\";\n @SuppressWarnings(\"unchecked\")... | import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
... | // Copyright 2009 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | podcast = PodcastFactory.downloadPodcast(url); | 6 |
xyxyLiu/PluginM | PluginManager/src/main/java/com/reginald/pluginm/core/HostInstrumentation.java | [
"public class ActivityThreadCompat {\n private static final String TAG = \"ActivityThreadCompat\";\n private static final boolean DEBUG = true;\n\n private static Class<?> sClass_ActivityThread;\n private static Method sMtd_currentActivityThread;\n private static Method sMtd_getProcessName;\n priv... | import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import com.android.common.ActivityThreadCompat;
import com.android.common.ContextCompat;
import com.reginald.pluginm.PluginInfo;
import com.reginald.pluginm.reflect.Fi... | package com.reginald.pluginm.core;
/**
* Created by lxy on 17-8-9.
*/
public class HostInstrumentation extends Instrumentation {
public static final String TAG = "HostInstrumentation";
private static Class<?> sIAppTaskClazz;
private static Instrumentation sBase;
private static Instrumentation m... | Logger.i(TAG, "HostInstrumentation has already installed!"); | 7 |
irengrig/fossil4idea | test/org/github/irengrig/test/BaseTwoRootedFossilTest.java | [
"@State(\n name = \"FossilConfiguration\",\n storages = {\n @Storage(file = StoragePathMacros.WORKSPACE_FILE)\n }\n)\npublic class FossilConfiguration implements PersistentStateComponent<Element> {\n public String FOSSIL_PATH = \"\";\n private final Map<File, String> myRemoteUrls = new HashMap<Fil... | import com.intellij.ide.startup.impl.StartupManagerImpl;
import com.intellij.openapi.command.WriteCommandAction;
import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.util.Ref;
import com.inte... | package org.github.irengrig.test;
public class BaseTwoRootedFossilTest {
protected LocalFileSystem myLocalFileSystem;
protected IdeaProjectTestFixture myProjectFixture;
protected Project myProject;
protected File myBase;
protected VirtualFile myBaseVf;
protected ChangeListManager myChangeListManager;
... | protected FossilVcs myVcs; | 1 |
tino1b2be/DTMF-Decoder | source/com/tino1b2be/dtmfdecoder/FileUtil.java | [
"public interface AudioFile {\n\t\n\t/**\n\t * Enum for the types of audio files that are supported by the dtmf decoder.\n\t * \n\t * @author tino1b2be\n\t */\n\tpublic enum AudioType{\n\t\t// More audio types can be added as they are implemented.\n\t\tMP3, WAV;\n\t}\n\t\n\t/**\n\t * Read samples from an audio file... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.concurrent.ArrayBlockingQueue;
impor... | /* The MIT License (MIT)
*
* Copyright (c) 2015 Tinotenda Chemvura
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to... | public static void writeToFile(AudioTestResult[] dataOut, String filename) throws IOException { | 6 |
paolodongilli/SASAbus | src/it/sasabz/android/sasabus/fragments/LineaFragment.java | [
"public class SASAbus extends Application {\n private int dbDownloadAttempts;\n \n private static Context context = null;\n \n @Override\n public void onCreate() \n {\n // Init values which could be loaded from files stored in res/raw\n setDbDownloadAttempts(0);\n super.onCrea... | import java.util.Locale;
import java.util.Vector;
import it.sasabz.android.sasabus.R;
import it.sasabz.android.sasabus.SASAbus;
import it.sasabz.android.sasabus.R.id;
import it.sasabz.android.sasabus.R.layout;
import it.sasabz.android.sasabus.R.menu;
import it.sasabz.android.sasabus.R.string;
import it.sasabz.a... | /**
*
* SelectLineaActivity.java
*
* Created: Jan 16, 2011 11:41:06 AM
*
* Copyright (C) 2011 Paolo Dongilli and Markus Windegger
*
* This file is part of SasaBus.
* SasaBus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publishe... | MyListAdapter linee = new MyListAdapter(SASAbus.getContext(), R.id.text, R.layout.linea_row, list);
| 1 |
programingjd/okserver | src/test/java/info/jdavid/ok/server/handler/BasicAuthHandlerTest.java | [
"@SuppressWarnings({ \"WeakerAccess\" })\npublic class HttpServer {\n\n final AtomicBoolean started = new AtomicBoolean();\n final AtomicBoolean setup = new AtomicBoolean();\n int port = 8080; // 80\n int securePort = 8181; // 443\n String hostname = null;\n long maxRequestSize = 65536;\n Dispatcher dispatch... | import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import info.jdavid.ok.server.HttpServer;
import info.jdavid.ok.server.Https;
import info.jdavid.ok.server.HttpsTest;
import inf... | package info.jdavid.ok.server.handler;
@SuppressWarnings("ConstantConditions")
public class BasicAuthHandlerTest {
private static final HttpServer SERVER = new HttpServer(); //.dispatcher(new Dispatcher.Logged());
@BeforeClass
public static void startServer() throws IOException {
final File root = getW... | @Override public Response.Builder handle(final Request request, final String[] params) { | 4 |
mechero/code-quality-game | sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/retriever/service/SonarDataRetriever.java | [
"public interface SonarServerConfigurationService {\n SonarServerStatus checkServerDetails(SonarServerConfiguration config);\n\n boolean checkServerAuthentication(SonarServerConfiguration config);\n\n SonarServerConfiguration getConfiguration();\n}",
"@JsonInclude(JsonInclude.Include.NON_NULL)\n@JsonProp... | import com.thepracticaldeveloper.devgame.modules.configuration.service.SonarServerConfigurationService;
import com.thepracticaldeveloper.devgame.modules.sonarapi.resultbeans.Issue;
import com.thepracticaldeveloper.devgame.modules.sonarapi.resultbeans.Issues;
import com.thepracticaldeveloper.devgame.modules.sonarapi.res... | package com.thepracticaldeveloper.devgame.modules.retriever.service;
@Service
@EnableAsync
@EnableScheduling
public final class SonarDataRetriever {
private static final Log log = LogFactory.getLog(SonarDataRetriever.class);
private static final String GET_ISSUES_COMMAND = "/api/issues/search?organizations=... | httpHeaders = (ApiHttpUtils.getHeaders(token)); | 8 |
jenkinsci/priority-sorter-plugin | src/main/java/jenkins/advancedqueue/sorter/ItemInfo.java | [
"static public void logBlockedItem(@NonNull ItemInfo info) {\n\tLOGGER.fine(\"Blocking: \" + info.toString());\n}",
"static public void logBuilableItem(@NonNull ItemInfo info) {\n\tLOGGER.fine(\"Buildable: \" + info.toString());\n}",
"public interface DecisionLogger {\n\n\tDecisionLogger addDecisionLog(int inde... | import hudson.model.Queue.Item;
import jenkins.advancedqueue.DecisionLogger;
import jenkins.advancedqueue.PriorityConfigurationCallback;
import jenkins.advancedqueue.priority.PriorityStrategy;
import static jenkins.advancedqueue.ItemTransitionLogger.logBlockedItem;
import static jenkins.advancedqueue.ItemTransitionLogg... | /*
* The MIT License
*
* Copyright (c) 2013, Magnus Sandberg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, c... | private PriorityStrategy priorityStrategy; | 4 |
signalfx/signalfx-java | signalfx-yammer/src/test/java/com/signalfx/codahale/metrics/SignalFxReporterTest.java | [
"public interface MetricMetadata {\n public static final String SOURCE = \"source\";\n public static final String METRIC = \"metric\";\n public Map<String, String> getTags(Metric metric);\n public Optional<SignalFxProtocolBuffers.MetricType> getMetricType(Metric metric);\n\n /**\n * Create an obj... | import static org.junit.Assert.*;
import org.junit.Test;
import com.yammer.metrics.core.Counter;
import com.yammer.metrics.core.Gauge;
import com.yammer.metrics.core.MetricName;
import com.yammer.metrics.core.MetricsRegistry;
import com.yammer.metrics.core.MetricPredicate;
import com.yammer.metrics.core.Histogram;
impo... | package com.signalfx.codahale.metrics;
public class SignalFxReporterTest {
private void testReporter(){
StoredDataPointReceiver dbank = new StoredDataPointReceiver();
assertEquals(0, dbank.addDataPoints.size());
MetricsRegistry metricRegistery = new MetricsRegistry(); | SignalFxReporter reporter = new SignalFxReporter.Builder(metricRegistery, new StaticAuthToken(""), "myserver") | 2 |
shaunlebron/flex-fov | src/main/java/mod/render360/coretransform/classtransformers/LoadingScreenRendererTransformer.java | [
"public class ClassName {\n\n private final String deobfuscatedName;\n private final String obfuscatedName;\n\n public ClassName(String deobfuscatedName, String obfuscatedName) {\n this.deobfuscatedName = deobfuscatedName;\n this.obfuscatedName = obfuscatedName;\n }\n\n public String ge... | import mod.render360.coretransform.classtransformers.name.ClassName;
import mod.render360.coretransform.classtransformers.name.MethodName;
import mod.render360.coretransform.classtransformers.name.Names;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.Cl... | package mod.render360.coretransform.classtransformers;
public class LoadingScreenRendererTransformer extends ClassTransformer {
@Override
public ClassName getName() {
return Names.LoadingScreenRenderer;
}
@Override
public MethodTransformer[] getMethodTransformers() {
MethodTransformer t... | "renderMethod", "L" + Type.getInternalName(RenderMethod.class) + ";")); //renderMethod
| 6 |
droidstealth/droid-stealth | DroidStealth/src/main/java/com/stealth/content/ContentAdapter.java | [
"public class FileUtils {\n\tprivate FileUtils() {} //private constructor to enforce Singleton pattern\n\n\t/** TAG for log messages. */\n\tstatic final String TAG = \"FileUtils\";\n\tprivate static final boolean DEBUG = false; // Set to true to enable logging\n\n\tpublic static final String MIME_TYPE_AUDIO = \"aud... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.BaseAdapter;
import andr... | package com.stealth.content;
/**
* Simple class to display previews of the files. For now it just instantiates ImageView with an icon Created by Alex on
* 3/6/14.
*/
public class ContentAdapter extends BaseAdapter implements IContentManager.ContentChangedListener {
private IContentManager mContentMana... | styleFileView((IndexedFile) item, view);
| 1 |
BottleRocketStudios/Android-GroundControl | GroundControl/groundcontrol/src/main/java/com/bottlerocketstudios/groundcontrol/convenience/StandardExecutionBuilder.java | [
"public class AgentExecutor implements InactivityCleanupListener {\n\n private static final String TAG = AgentExecutor.class.getSimpleName();\n\n public static final String DEFAULT_AGENT_EXECUTOR_ID = \"<def>\";\n\n private static final ConcurrentHashMap<String, AgentExecutor> sAgentExecutorMap = new Concu... | import android.text.TextUtils;
import android.util.Log;
import com.bottlerocketstudios.groundcontrol.AgentExecutor;
import com.bottlerocketstudios.groundcontrol.agent.Agent;
import com.bottlerocketstudios.groundcontrol.executor.JobPriority;
import com.bottlerocketstudios.groundcontrol.listener.AgentListener;
import com... | agentPolicyBuilder = mAgentPolicyBuilderClass.newInstance();
} catch (InstantiationException e) {
Log.e(TAG, "Caught java.lang.InstantiationException", e);
} catch (IllegalAccessException e) {
Log.e(TAG, "Caught java.lang.IllegalAccessException", e);
}
... | public ExecutionBuilder<ResultType, ProgressType> priority(JobPriority jobPriority) { | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.