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
adyliu/jafka
src/main/java/io/jafka/log/Log.java
[ "public class ByteBufferMessageSet extends MessageSet{\n\n private final ByteBuffer buffer;\n private final long initialOffset;\n private final ErrorMapping errorCode;\n //\n private long shallowValidByteCount = -1L;\n //\n private long validBytes;\n public ByteBufferMessageSet(ByteBuffer bu...
import static java.lang.String.format; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.nio.ByteBuffer; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.List; import ...
/** * 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...
FileMessageSet messageSet = new FileMessageSet(f, false);
1
samicemalone/android-vlc-remote
src/org/peterbaldwin/vlcremote/service/StatusService.java
[ "public final class Preferences {\r\n\r\n /**\r\n * The server authority preference key\r\n */\r\n public static final String KEY_SERVER = \"server\";\r\n public static final String KEY_REMEMBERED_SERVERS = \"remembered_servers\";\r\n public static final String KEY_LIBRARIES = \"libraries\";\r\n...
import android.app.Service; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Handler; import android.os.HandlerThread; import android.os.IBinder; import android.os.Message; import android.os.Process; import android.util.Log; ...
mRemoteViewsHandler = startHandlerThread("RemoteViewsThread"); mStatusHandler = startHandlerThread("StatusThread"); // Create a separate thread for album art requests // because the request can be very slow. mAlbumArtHandler = startHandlerThread("AlbumArtThread"); // C...
Status status = server.status().read();
1
DevotedMC/ExilePearl
src/main/java/com/devotedmc/ExilePearl/core/PearlBoundaryTask.java
[ "public interface BorderHandler extends ExilePearlRunnable, Listener {\n\n}", "public interface ExilePearl {\n\n\t/**\n\t * Gets the pearl item name\n\t * @return The item name\n\t */\n\tString getItemName();\n\n\t/**\n\t * Gets the exiled player ID\n\t * @return The player ID\n\t */\n\tUUID getPlayerId();\n\n\t/...
import static vg.civcraft.mc.civmodcore.util.TextUtil.msg; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import java.util.UUID; import org.bukkit.Chunk; import org.bukkit.EntityEffect; import org.bukkit.GameMo...
int limTop = isNether ? 125 : (world.getMaxHeight() - 2); final int highestBlockBoundary = Math.min(world.getHighestBlockYAt(X, Z) + 1, limTop); // if Y is larger than the world can be and user can fly, return Y - Unless we are in the Nether, we might not want players on the roof if (flying && Y > limTop && !i...
public void onPlayerPearled(PlayerPearledEvent e) {
5
BoD/android-contentprovider-generator
etc/sample-generated-code/org/jraf/androidcontentprovidergenerator/sample/provider/SampleSQLiteOpenHelper.java
[ "public class BaseSQLiteOpenHelperCallbacks {\n private static final String TAG = BaseSQLiteOpenHelperCallbacks.class.getSimpleName();\n\n /**\n * Called when the database has been opened.\n * @see android.database.sqlite.SQLiteOpenHelper#onOpen(SQLiteDatabase) onOpen\n */\n public void onOpen(...
import android.database.sqlite.SQLiteOpenHelper; import android.os.Build; import android.util.Log; import org.jraf.androidcontentprovidergenerator.sample.provider.base.BaseSQLiteOpenHelperCallbacks; import org.jraf.androidcontentprovidergenerator.sample.provider.SampleSQLiteOpenHelperCallbacks; import org.jraf.androidc...
/* * This source is part of the * _____ ___ ____ * __ / / _ \/ _ | / __/___ _______ _ * / // / , _/ __ |/ _/_/ _ \/ __/ _ `/ * \___/_/|_/_/ |_/_/ (_)___/_/ \_, / * /___/ * repository. * * Copyright (C) 2012-2017 Benoit 'BoD' Lubek (BoD@JRAF.org) * * This program is fre...
mOpenHelperCallbacks = new SampleSQLiteOpenHelperCallbacks();
1
mszubert/2048
src/main/java/put/ci/cevo/util/serialization/SerializationManagerFactory.java
[ "@AutoRegistered(defaultSerializer = true)\npublic class DoubleArraySerializer implements ObjectSerializer<double[]> {\n\n\t@Override\n\tpublic void save(SerializationManager manager, double[] arr, SerializationOutput output) throws IOException {\n\t\toutput.writeInt(arr.length);\n\t\tfor (double element : arr) {\n...
import java.util.List; import org.apache.log4j.Logger; import put.ci.cevo.util.serialization.serializers.DoubleArraySerializer; import put.ci.cevo.util.serialization.serializers.DoubleSerializer; import put.ci.cevo.util.serialization.serializers.IntArraySerializer; import put.ci.cevo.util.serialization.serializers.Inte...
package put.ci.cevo.util.serialization; public class SerializationManagerFactory { private static final Logger logger = Logger.getLogger(SerializationManagerFactory.class); public static SerializationManager create(List<ObjectSerializer<?>> serializers) { SerializationManager manager = new SerializationManag...
serializers.add(new DoubleSerializer());
1
CollapsedDom/Stud.IP-Client
plugins/hello_world/src/main/java/de/danner_web/studip_client/plugins/hello_world/HelloWorldPlugin.java
[ "public class PluginSettings {\n\n\tprivate Map<String, String> settings;\n\tprivate PluginInformation info;\n\n\tprivate Preferences rootPref = Preferences\n\t\t\t.userNodeForPackage(Starter.class);\n\tprivate static Logger logger = LogManager.getLogger(PluginSettings.class);\n\n\tpublic PluginSettings(PluginInfor...
import javax.swing.JPanel; import de.danner_web.studip_client.data.PluginSettings; import de.danner_web.studip_client.data.TextPluginMessage; import de.danner_web.studip_client.model.Context; import de.danner_web.studip_client.plugin.Plugin; import de.danner_web.studip_client.utils.oauth.OAuthConnector;
package de.danner_web.studip_client.plugins.hello_world; public class HelloWorldPlugin extends Plugin { public HelloWorldPlugin(Context context, OAuthConnector con, PluginSettings settings) { super(context, con, settings); } @Override public int doWork() {
context.appendPopup(new TextPluginMessage("Hello World!", "This is a Hello World Message", null));
1
boybeak/DelegateAdapter
timepaper/src/main/java/com/github/boybeak/timepaper/fragment/RandomFragment.java
[ "public class SuperAdapter<Empty extends LayoutImpl, Tail extends LayoutImpl> extends DelegateAdapter {\n\n private Controller mController;\n\n private Empty empty;\n private Tail tail;\n\n public SuperAdapter(Context context) {\n super(context);\n }\n\n public SuperAdapter(Context context,...
import android.content.Context; import android.support.annotation.NonNull; import com.github.boybeak.adapter.extension.SuperAdapter; import com.github.boybeak.timepaper.retrofit.Api; import com.github.boybeak.timepaper.R; import com.github.boybeak.timepaper.adapter.delegate.EmptyDelegate; import com.github.boybeak.time...
package com.github.boybeak.timepaper.fragment; /** * Created by gaoyunfei on 2017/9/5. */ public class RandomFragment extends PaperFragment { protected boolean shouldClear = false; @Override public CharSequence getTitle(Context context) { return context.getString(R.string.title_pager_rando...
Api.randomPhotos(getContext(), Api.PORTRAIT).enqueue(this);
1
HumBuch/HumBuch
src/test/java/de/dhbw/humbuch/view/StudentInformationViewTest.java
[ "public class GuiceJUnitRunner extends BlockJUnit4ClassRunner {\n\tprivate Injector injector;\n\n\t/**\n\t * Specifies the Guice {@link Module} classes which should be used when\n\t * injecting a JUnit test class\n\t */\n\t@Target(ElementType.TYPE)\n\t@Retention(RetentionPolicy.RUNTIME)\n\t@Inherited\n\tpublic @int...
import org.junit.runner.RunWith; import com.google.inject.Inject; import de.dhbw.humbuch.guice.GuiceJUnitRunner; import de.dhbw.humbuch.guice.TestModule; import de.dhbw.humbuch.guice.GuiceJUnitRunner.GuiceModules; import de.dhbw.humbuch.model.DAO; import de.dhbw.humbuch.model.entity.TestPersistenceInitialiser; import d...
package de.dhbw.humbuch.view; @RunWith(GuiceJUnitRunner.class) @GuiceModules({ TestModule.class }) public class StudentInformationViewTest extends BaseTest { @Inject public void setInjected(MVVMConfig mvvmConfig, TestPersistenceInitialiser testPersistenceInitialiser, StudentInformationView view, Properties...
DAO<User> daoUser) {
4
TakWolf/CNode-Material-Design
app/src/main/java/org/cnodejs/android/md/presenter/implement/NotificationPresenter.java
[ "public final class ApiClient {\n\n private ApiClient() {}\n\n public static final ApiService service = new Retrofit.Builder()\n .baseUrl(ApiDefine.API_BASE_URL)\n .client(new OkHttpClient.Builder()\n .addInterceptor(createUserAgentInterceptor())\n ....
import android.app.Activity; import android.support.annotation.NonNull; import org.cnodejs.android.md.model.api.ApiClient; import org.cnodejs.android.md.model.api.ApiDefine; import org.cnodejs.android.md.model.api.SessionCallback; import org.cnodejs.android.md.model.entity.DataResult; import org.cnodejs.android.md.mode...
package org.cnodejs.android.md.presenter.implement; public class NotificationPresenter implements INotificationPresenter { private final Activity activity;
private final INotificationView notificationView;
8
futurice/vor
vor-android/mobile/src/main/java/com/futurice/vor/fragment/TrendingFragment.java
[ "public class Constants {\n public static final String SERVER_URL = \"http://rubix.futurice.com/\";\n\n public static final int CARDS_HAPPENING_NOW = 0;\n public static final int CARDS_TRENDING = 1;\n public static final int CARDS_MY_CARDS = 2;\n public static final int CARDS_NUMBER_OF_TABS = 3;\n\n ...
import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ExpandableListView; import android.widget.FrameLayout; import com.reactivecascade.i.CallOrig...
package com.futurice.vor.fragment; public class TrendingFragment extends BaseVorFragment { protected int lastExpanded = -1; @NonNull public static TrendingFragment newInstance() { return new TrendingFragment(); } @Override @NonNull public View onCreateView( @NonNul...
TopicListAdapter tla = new TopicListAdapter(getSourceTopicModel(),
1
enguerrand/xdat
src/main/java/org/xdat/gui/dialogs/ParallelCoordinatesDisplaySettingsDialog.java
[ "public class Main extends JFrame {\n\tpublic static final long serialVersionUID = 10L;\n\tprivate MainMenuBar mainMenuBar;\n\tprivate Session currentSession;\n\tprivate List<ChartFrame> chartFrames = new LinkedList<>();\n\tprivate final BuildProperties buildProperties;\n\tprivate final ClusterFactory clusterFactor...
import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; import javax.swing.JTabbedPane; import java.awt.BorderLayout; import java.awt.GridLayout; import org.xdat.Main; import org.xdat.chart.ParallelCoordinatesChart; import org.xdat.gui.UiDefines; import org.xdat.gui.WindowClosingAdapter; impo...
/* * Copyright 2014, Enguerrand de Rochefort * * This file is part of xdat. * * xdat 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 v...
JPanel mainButtonsPanel = new PaddedPanel(UiDefines.PADDING);
7
pimps/ysoserial-modified
src/main/java/ysoserial/payloads/CommonsCollections1.java
[ "public class CmdExecuteHelper {\n\t\n\tprivate String terminalType;\n\t\n\tprivate String[] commandArray;\n\t\n\tprivate String command;\n\n\tpublic CmdExecuteHelper(String terminalType, String command) {\n\t\tsuper();\n\t\tthis.terminalType = terminalType;\n\t\tthis.command = command;\n\t\t\n\t\tswitch (terminalT...
import java.lang.reflect.InvocationHandler; import java.util.HashMap; import java.util.Map; import org.apache.commons.collections.Transformer; import org.apache.commons.collections.functors.ChainedTransformer; import org.apache.commons.collections.functors.ConstantTransformer; import org.apache.commons.collections.func...
package ysoserial.payloads; /* Gadget chain: ObjectInputStream.readObject() AnnotationInvocationHandler.readObject() Map(Proxy).entrySet() AnnotationInvocationHandler.invoke() LazyMap.get() ChainedTransformer.transform() ConstantTransformer.transform() InvokerTransformer...
Reflections.setFieldValue(transformerChain, "iTransformers", transformers); // arm with actual transformer chain
4
InfinityRaider/NinjaGear
src/main/java/com/infinityraider/ninjagear/entity/EntityShuriken.java
[ "@Mod(Reference.MOD_ID)\npublic class NinjaGear extends InfinityMod<IProxy, Config> {\n public static NinjaGear instance;\n\n public NinjaGear() {\n super();\n }\n\n @Override\n public String getModId() {\n return Reference.MOD_ID;\n }\n\n @Override\n protected void onModConstr...
import com.infinityraider.infinitylib.entity.EntityThrowableBase; import com.infinityraider.ninjagear.NinjaGear; import com.infinityraider.ninjagear.reference.Names; import com.infinityraider.ninjagear.registry.EntityRegistry; import com.infinityraider.ninjagear.registry.ItemRegistry; import com.infinityraider.ninjagea...
package com.infinityraider.ninjagear.entity; public class EntityShuriken extends EntityThrowableBase { private float crit; private int timer; private Vector3d direction; //For client side spawning private EntityShuriken(EntityType<? extends EntityShuriken> type, World world) { super(type...
return new RenderEntityShuriken(manager);
4
copygirl/WearableBackpacks
src/main/java/net/mcft/copy/backpacks/block/BlockBackpack.java
[ "public final class BackpackHelper {\n\t\n\tprivate BackpackHelper() { }\n\t\n\t\n\t/** The maximum distance from which an equipped backpack can be opened. */\n\tpublic static double INTERACT_MAX_DISTANCE = 1.8;\n\t/** The maximum angle from which an equipped backpack can be opened. */\n\tpublic static double INTE...
import java.util.Random; import net.minecraft.block.BlockContainer; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.I...
package net.mcft.copy.backpacks.block; public class BlockBackpack extends BlockContainer { /** Number of ticks a backpack will be resistant * to explosions for after being placed. */ public static final int EXPLOSION_RESIST_TICKS = 10; private final AxisAlignedBB[] _boundsFromFacing = new AxisAlignedBB[4];...
return MiscUtils.getItemFromBlock(this).getTranslationKey();
4
yyxhdy/ManyEAs
src/jmetal/encodings/solutionType/IntRealSolutionType.java
[ "public abstract class Problem implements Serializable {\n\n\t/**\n\t * Defines the default precision of binary-coded variables\n\t */\n\tprivate final static int DEFAULT_PRECISSION = 16;\n\n\t/**\n\t * Stores the number of variables of the problem\n\t */\n\tprotected int numberOfVariables_;\n\n\t/**\n\t * Stores t...
import jmetal.core.Problem; import jmetal.core.SolutionType; import jmetal.core.Variable; import jmetal.encodings.variable.Int; import jmetal.encodings.variable.Real;
// IntRealSolutionType.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser Gener...
variables[var] = new Int((int)problem_.getLowerLimit(var), (int)problem_.getUpperLimit(var));
3
suragch/aePronunciation
app/src/main/java/com/aepronunciation/ipa/HistoryTimeActivity.java
[ "public static final String PREFS_NAME = \"MyPrefsFile\";", "public static final long TIME_DEFAULT = 0;", "public static final String TIME_LEARN_DOUBLE_KEY = \"timeLearnDouble\";", "public static final String TIME_LEARN_SINGLE_KEY = \"timeLearnSingle\";", "public static final String TIME_PRACTICE_DOUBLE_KEY...
import android.content.SharedPreferences; import android.os.Bundle; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import android.widget.TextView; import static com.aepronunciation.ipa.MainActivity.PREFS_NAME; import static com.aepronunciation.ipa.MainActivity.TIME_DEFAULT; i...
package com.aepronunciation.ipa; public class HistoryTimeActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_history_time); Toolbar toolbar = findViewById(R.id.toolb...
long learnDoubleTime = settings.getLong(TIME_LEARN_DOUBLE_KEY,
2
nerdammer/spash
core/src/main/java/it/nerdammer/spash/shell/command/spi/MkDirCommand.java
[ "public interface FileSystemFacade {\n\n /**\n * Returns the defaul filesystem.\n *\n * @return the filesystem\n */\n FileSystem getFileSystem();\n\n /**\n * Returns a collection of paths contained in the given path.\n *\n * @param path the base path\n * @return the sub path...
import it.nerdammer.spash.shell.api.fs.FileSystemFacade; import it.nerdammer.spash.shell.api.fs.SpashFileSystem; import it.nerdammer.spash.shell.command.AbstractCommand; import it.nerdammer.spash.shell.command.CommandResult; import it.nerdammer.spash.shell.command.ExecutionContext; import java.nio.file.Path; import jav...
package it.nerdammer.spash.shell.command.spi; /** * Command to create a directory. * * @author Nicola Ferraro */ public class MkDirCommand extends AbstractCommand { public MkDirCommand(String commandString) { super(commandString); } @Override
public CommandResult execute(ExecutionContext ctx) {
3
t28hub/json2java4idea
core/src/main/java/io/t28/json2java/core/JavaConverter.java
[ "public interface AnnotationPolicy {\n void apply(@Nonnull TypeSpec.Builder builder);\n}", "@SuppressWarnings(\"WeakerAccess\")\npublic abstract class ClassBuilder {\n protected final NamePolicy fieldNamePolicy;\n protected final NamePolicy methodNamePolicy;\n protected final NamePolicy parameterNameP...
import javax.annotation.Nonnull; import javax.lang.model.element.Modifier; import java.io.IOException; import java.util.List; import com.google.common.annotations.VisibleForTesting; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; import ...
/* * Copyright (c) 2017 Tatsuya Maki * * 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...
final ClassBuilder builder = configuration.classBuilder();
1
Sleeksnap/sleeksnap
src/org/sleeksnap/uploaders/url/IsgdShortener.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...
String contents = HttpUtil.executeGet(PAGE_URL, data);
0
Wondersoft/olaper
src/main/java/org/olap/server/processor/functions/CurlyBrackets.java
[ "public class ServerLevel implements Level {\n\n\tprivate ServerHierarchy hierarchy;\n\tprivate NamedElement definition;\n\tprivate int depth;\n\t\n\tprotected ServerLevel(ServerHierarchy hierarchy, NamedElement def, int depth){\n\t\tthis.hierarchy = hierarchy;\n\t\tthis.definition = def;\n\t\tthis.depth = depth;\n...
import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.olap.server.driver.metadata.ServerLevel; import org.olap.server.processor.LevelMemberSet; import org.olap.server.processor.sql.SetSubquery; import org.olap.server.processor.sql.TableMapping; import org.olap.server.processor.sql....
package org.olap.server.processor.functions; @OlapFunctionName(name = "{}") public class CurlyBrackets extends AbstractArgFunction { public CurlyBrackets(CallNode node, Cube cube) throws OlapException { super(node, cube); } @Override public List<LevelMemberSet> memberSet() throws OlapException { List<L...
LevelMapping lmap = mapping.getMapping(layer.getLevel());
4
pemessier/SoulEVSpy
app/src/androidTest/java/org/hexpresso/soulevspy/ObdMessageDataTest.java
[ "public class ObdMessageData {\r\n private ArrayList<String> mData = null;\r\n private String mRawData = null;\r\n private String mMessageIdentifier = null;\r\n\r\n public ObdMessageData(String rawData) {\r\n // Remove all whitespace characters but ...
import android.test.AndroidTestCase; import org.hexpresso.obd.ObdMessageData; import org.hexpresso.obd.ObdMessageFilter; import org.hexpresso.soulevspy.obd.BatteryChargingMessageFilter; import org.hexpresso.soulevspy.obd.EstimatedRangeMessageFilter; import org.hexpresso.soulevspy.obd.ParkingBrakeMessageFilter; im...
package org.hexpresso.soulevspy; /** * Created by Pierre-Etienne Messier <pierre.etienne.messier@gmail.com> on 2015-10-12. */ public class ObdMessageDataTest extends AndroidTestCase { private int testIntValue = 0; private double testDoubleValue1 = 0.0; private double testDoubleValue2 = 0....
filter.addObdMessageFilterListener(new ObdMessageFilter.ObdMessageFilterListener() {
1
contentful/discovery-app-android
app/src/main/java/discovery/contentful/preview/EntryListFragment.java
[ "public class AssetPreviewActivity extends CFListActivity {\n private AssetInfoAdapter adapter;\n private CDAAsset asset;\n\n @Override protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n // Extract arguments from Intent\n asset = (CDAAsset) getIntent().getSeri...
import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import android.widget.AdapterView; import discovery.contentful.activities.AssetPreviewActivity; import discovery.contentful.activities.EntryActivity; import discovery.contentful.activities.MapA...
package discovery.contentful.preview; public class EntryListFragment extends CFListFragment { private CDAEntry entry; private CDAContentType contentType; private EntryListAdapter adapter; private Map<String, CDAField> contentTypesFields; private Map<String, CDAContentType> contentTypesMap; public static ...
startActivity(new Intent(getActivity(), AssetPreviewActivity.class)
0
exoplatform/task
services/src/main/java/org/exoplatform/task/storage/impl/LabelStorageImpl.java
[ "public interface DAOHandler {\n public ProjectHandler getProjectHandler();\n\n public TaskHandler getTaskHandler();\n \n public LabelHandler getLabelHandler();\n \n public LabelTaskMappingHandler getLabelTaskMappingHandler();\n\n public CommentHandler getCommentHandler();\n\n public TaskLogHandler getTaskL...
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Pattern; import java.util.stream.Collectors; import javax.inject.Inject; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.security.Identity; import or...
package org.exoplatform.task.storage.impl; public class LabelStorageImpl implements LabelStorage { private static final Log LOG = ExoLogger.getExoLogger(LabelStorageImpl.class); private static final Pattern pattern = Pattern.compile("@([^\\s]+)|@([^\\s]+)$"); @Inject
private final DAOHandler daoHandler;
0
kdgregory/pathfinder
app-pathfinder/src/main/java/com/kdgregory/pathfinder/Main.java
[ "public interface Destination\n{\n /**\n * Returns an indication of whether this destination should be\n * displayed at all, given the current invocation options.\n */\n public boolean isDisplayed(Map<InvocationOptions, Boolean> options);\n\n /**\n * Returns a formatted description of th...
import com.kdgregory.pathfinder.core.impl.PathRepoImpl; import com.kdgregory.pathfinder.core.impl.WarMachineImpl; import com.kdgregory.pathfinder.servlet.ServletInspector; import com.kdgregory.pathfinder.spring.SpringInspector; import java.io.File; import java.io.PrintStream; import java.util.Map; import org.apache.log...
// Copyright (c) Keith D Gregory // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
return new WarMachineImpl(new File(warName[0]));
6
WonderBeat/vasilich
alice-src/bitoflife/chatterbean/AliceBot.java
[ "public class Category implements AIMLElement\n{\n /*\n Attributes\n */\n \n private Pattern pattern;\n private Template template;\n private That that;\n private Topic topic;\n \n /*\n Constructor\n */\n\n public Category()\n {\n }\n\n public Category(String pattern, Object... children)\n {\n th...
import bitoflife.chatterbean.aiml.Category; import bitoflife.chatterbean.text.Request; import bitoflife.chatterbean.text.Response; import bitoflife.chatterbean.text.Sentence; import bitoflife.chatterbean.text.Transformations;
/* Copyleft (C) 2004 Hio Perroni Filho xperroni@yahoo.com ICQ: 2490863 This file is part of ChatterBean. ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your o...
public Response respond(Request request)
1
softwarespartan/TWS
src/apidemo/ExercisePanel.java
[ "static class PortfolioModel extends AbstractTableModel {\n\tprivate HashMap<Integer,Position> m_portfolioMap = new HashMap<Integer,Position>();\n\tprivate ArrayList<Integer> m_positions = new ArrayList<Integer>(); // must store key because Position is overwritten\n\t\t\n\tvoid clear() {\n\t\tm_positions.clear();\n...
import javax.swing.BoxLayout; import javax.swing.DefaultListModel; import javax.swing.JCheckBox; import javax.swing.JList; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.border.TitledBorder; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; impor...
/* Copyright (C) 2013 Interactive Brokers LLC. All rights reserved. This code is subject to the terms * and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. */ package apidemo; public class ExercisePanel extends HorzPanel implements INewTab, IAccountHandler { pr...
HtmlButton but = new HtmlButton( "Go") {
1
rrauschenbach/mobi-api4java
src/main/java/org/rr/mobi4java/MobiContentHeader.java
[ "public static byte[] getBytes(byte[] buffer, int offset) {\n\tbyte[] b = new byte[buffer.length - offset];\n\tSystem.arraycopy(buffer, offset, b, 0, buffer.length - offset);\n\treturn b;\n}", "public static int getInt(byte[] buffer, int offset, int length) {\n\treturn getInt(getBytes(buffer, offset, length));\n}...
import static org.apache.commons.lang3.BooleanUtils.negate; import static org.rr.mobi4java.ByteUtils.getBytes; import static org.rr.mobi4java.ByteUtils.getInt; import static org.rr.mobi4java.ByteUtils.getString; import static org.rr.mobi4java.ByteUtils.write; import static org.rr.mobi4java.ByteUtils.writeInt; import st...
package org.rr.mobi4java; public class MobiContentHeader extends MobiContent { private static final int DEFAULT_HEADER_LENGTH = 264; /** Size of the extra bytes for the rest of mobi header*/ private static final int MOBI_HEADER_REST = 16; public static enum COMPRESSION_CODE { NONE(1), PALM_DOC(2), HUFF_C...
compression = getInt(content, 0, 2);
1
Ouyangan/hunt-admin
hunt-web/src/main/java/com/hunt/controller/JobController.java
[ "public class BaseController {\n private static final Logger log = LoggerFactory.getLogger(BaseController.class);\n @Autowired\n private SystemService systemService;\n\n /**\n * 极限验证码二次验证\n *\n * @param request\n * @return\n * @throws Exception\n */\n public boolean verifyCapt...
import com.hunt.controller.BaseController; import com.hunt.model.dto.PageInfo; import com.hunt.model.entity.SysRoleOrganization; import com.hunt.service.SysRoleOrganizationService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.shiro.authz.annotation.RequiresPermissions...
package com.hunt.controller; /** * 职位模块 */ @Api(value = "职位模块") @Controller @RequestMapping("job") public class JobController extends BaseController { @Autowired private SysRoleOrganizationService roleOrganizationService; /** * 跳转至职位页面 * * @return */ @ApiOperation(value = "跳转至职位...
SysRoleOrganization roleOrganization = new SysRoleOrganization();
2
zzwwws/RxZhihuDaily
app/src/main/java/com/github/zzwwws/rxzhihudaily/presenter/activity/DetailActivity.java
[ "public class WebUtils {\n public static final String MIME_TYPE = \"text/html\";\n public static final String ENCODING = \"utf-8\";\n\n private static final String CSS_LINK_PATTERN = \" <link href=\\\"%s\\\" type=\\\"text/css\\\" rel=\\\"stylesheet\\\" />\";\n private static final String NIGHT_DIV_TAG_S...
import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.design.widget.CollapsingToolbarLayout; import android.support.design.widget.CoordinatorLayout; import android.support.v4.widget.NestedScrollView; import android.support.v7.widget.Toolbar; import android.text.TextUti...
package com.github.zzwwws.rxzhihudaily.presenter.activity; /** * Created by zzwwws on 2016/2/22. */ public class DetailActivity extends BaseActivity implements StoryDetailView, OnClickListener{ @Bind(R.id.img_story_detail) ImageView imgStoryDetail; @Bind(R.id.toolbar) Toolbar toolbar; @Bind(R...
public void showStoryExtraInfo(StoryExtraInfo info) {
2
material-motion/material-motion-android
library/src/test/java/com/google/android/material/motion/sources/GestureSourceTests.java
[ "public class ConstraintApplicator<T> {\n\n private final Operation<T, T>[] constraints;\n\n public ConstraintApplicator(Operation<T, T>[] constraints) {\n this.constraints = constraints;\n }\n\n public MotionObservable<T> apply(MotionObservable<T> stream) {\n for (Operation<T, T> constraint : constraints...
import android.app.Activity; import android.view.View; import com.google.android.material.motion.ConstraintApplicator; import com.google.android.material.motion.MapOperation; import com.google.android.material.motion.MotionObservable; import com.google.android.material.motion.MotionRuntime; import com.google.android.ma...
/* * Copyright 2016-present The Material Motion Authors. 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 * * ...
TrackingMotionObserver<SimulatedGestureRecognizer> tracker = new TrackingMotionObserver<>();
5
ChyengJason/NanCanOlympic
app/src/main/java/com/jscheng/mr_horse/ui/SearchActivity.java
[ "public class SearchRecyclerAdapter extends RecyclerView.Adapter<SearchRecyclerAdapter.SearchRecyclerViewHolder> {\n\n private List<QuestionModel> searchList;\n private String searchWord;\n\n public SearchRecyclerAdapter(){\n searchList = new ArrayList<>();\n searchWord = \"\";\n }\n\n ...
import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.KeyEvent; import android.view.View; import android.view.inputmethod.EditorInfo; import android.vi...
package com.jscheng.mr_horse.ui; /** * Created by cheng on 2017/3/21. */ public class SearchActivity extends BaseActivity implements SearchView,SearchRecyclerAdapter.OnClickItemListener { @BindView(R.id.title_search_edit) EditText searchEditText; @BindView(R.id.progress_wheel) ProgressWheel prog...
presenter = new SearchPresenterImpl(this);
3
onesocialweb/osw-openfire-plugin
src/java/org/onesocialweb/openfire/handler/MessageEventInterceptor.java
[ "@SuppressWarnings(\"serial\")\npublic class AccessDeniedException extends Exception {\n\n\tpublic AccessDeniedException(String message) {\n\t\tsuper(message);\n\t}\n\t\n}", "@SuppressWarnings(\"serial\")\npublic class InvalidRelationException extends Exception {\n\n\tpublic InvalidRelationException(String messag...
import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import javax.activity.InvalidActivityException; import org.dom4j.Element; import org.jivesoftware.openfire.SessionManager; import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.interceptor.PacketInt...
/* * Copyright 2010 Vodafone Group Services Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
final ActivityDomReader reader = new PersistentActivityDomReader();
5
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 ...
KeyEntity key = KeySafe.getInstance(activity).get(
0
emina/kodkod
test/kodkod/test/unit/NativeSolverTest.java
[ "public static enum Outcome {\n\t/** The formula is satisfiable with respect to the specified bounds. */\n\tSATISFIABLE,\n\t/** The formula is unsatisfiable with respect to the specified bounds. */\n\tUNSATISFIABLE,\n\t/** \n\t * The formula is trivially satisfiable with respect to the specified bounds: \n\t * a se...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.util.ArrayList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.ut...
/** * */ package kodkod.test.unit; /** * A test that loads multiple native solvers into memory. * * @author Emian Torlak */ public class NativeSolverTest { private static final List<SATFactory> solvers = Solvers.allAvailableSolvers(); private final Formula formula; private final Bounds bounds; ...
assertEquals(Outcome.UNSATISFIABLE, solveWith(pl));
0
desht/ScrollingMenuSign
src/main/java/me/desht/scrollingmenusign/ScrollingMenuSign.java
[ "public class CommandParser {\n\n private static final Pattern promptPat = Pattern.compile(\"<\\\\$:(.+?)>\");\n private static final Pattern passwordPat = Pattern.compile(\"<\\\\$p:(.+?)>\");\n\n private enum RunMode {CHECK_PERMS, EXECUTE}\n\n private static Logger cmdLogger = null;\n\n private fina...
import com.comphenix.protocol.ProtocolLibrary; import me.desht.dhutils.*; import me.desht.dhutils.MetaFaker.MetadataFilter; import me.desht.dhutils.commands.CommandManager; import me.desht.dhutils.cost.EconomyCost; import me.desht.dhutils.responsehandler.ResponseHandler; import me.desht.scrollingmenusign.commandlets.*;...
package me.desht.scrollingmenusign; /** * ScrollingMenuSign * * @author desht */ public class ScrollingMenuSign extends JavaPlugin implements ConfigurationListener { public static final int BLOCK_TARGET_DIST = 4; public static final String CONSOLE_OWNER = "[console]"; public static final UUID CONSOL...
private final VariablesManager variablesManager = new VariablesManager(this);
4
XFY9326/FloatText
app/src/main/java/tool/xfy9326/floattext/View/ListViewAdapter.java
[ "public class FloatManage extends AppCompatActivity {\n private ListViewAdapter listadapter = null;\n private ArrayList<String> FloatDataName;\n private AlertDialog ag_loading;\n private Handler mHandler;\n\n //显示SnackBar\n public static void snackshow(Activity ctx, String str) {\n Coordina...
import android.app.Activity; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.graphics.Typeface; import android.preference.PreferenceManager; import android.support.v7.app.AlertDialog; import android.support.v...
package tool.xfy9326.floattext.View; /* 管理列表操作 */ public class ListViewAdapter extends RecyclerView.Adapter<ListViewAdapter.ViewHolder> { private final Context context; private final Activity activity; private ArrayList<String> textshow; private ArrayList<FloatTextView> floatdata; private Arr...
FloatManageMethod.restartApplication(context, context.getPackageManager().getLaunchIntentForPackage(context.getPackageName()));
1
czlee/debatekeeper
app/src/main/java/net/czlee/debatekeeper/debatemanager/DebatePhaseManager.java
[ "public class AlertManager\n{\n private static final long MAX_BELL_SCREEN_FLASH_TIME = 500;\n private static final int POI_VIBRATE_TIME = 350;\n private static final int NOTIFICATION_ID = 1;\n private static final int STROBE_PERIOD = 100;\n private static final in...
import android.os.Bundle; import android.util.Log; import net.czlee.debatekeeper.AlertManager; import net.czlee.debatekeeper.debateformat.BellInfo; import net.czlee.debatekeeper.debateformat.BellSoundInfo; import net.czlee.debatekeeper.debateformat.DebatePhaseFormat; import net.czlee.debatekeeper.debateformat.PeriodInf...
/* * Copyright (C) 2012 Chuan-Zheng Lee * * This file is part of the Debatekeeper app, which is licensed under the GNU * General Public Licence version 3 (GPLv3). You can redistribute and/or modify * it under the terms of the GPLv3, and you must not use this file except in * compliance with the GPLv3. * * This...
private PeriodInfo mCurrentPeriodInfo;
4
taskadapter/redmine-java-api
src/test/java/com/taskadapter/redmineapi/internal/RedmineJSONBuilderTest.java
[ "public class CustomField {\n\n private final PropertyStorage storage = new PropertyStorage();\n\n public final static Property<Integer> DATABASE_ID = new Property<>(Integer.class, \"id\");\n public final static Property<String> NAME = new Property<>(String.class, \"name\");\n public final static Proper...
import com.taskadapter.redmineapi.bean.CustomField; import com.taskadapter.redmineapi.bean.CustomFieldFactory; import com.taskadapter.redmineapi.bean.Group; import com.taskadapter.redmineapi.bean.Issue; import com.taskadapter.redmineapi.bean.User; import com.taskadapter.redmineapi.bean.Version; import org.junit.Test; i...
package com.taskadapter.redmineapi.internal; public class RedmineJSONBuilderTest { @Test public void priorityIdIsAddedToJsonIfProvided() { Issue issue = new Issue(); issue.setPriorityId(1); final String generatedJSON = RedmineJSONBuilder.toSimpleJSON( "some_project_key", issue, RedmineJSONB...
User user = new User(null)
4
abs-platform/abs-software
src/Android/payloadSDK/src/main/java/com/google/abs/payloadsdk/PayloadApp.java
[ "public class Arduino {\n\n private SDB sdb;\n\n /**\n * Arduino constructor\n * @param sdb\n */\n\n public Arduino(SDB sdb)\n {\n this.sdb = sdb;\n }\n\n /**\n * Write a 1 or a 0 value to a digital pin.\n *\n * @param pin the number of the digital pin you want to ...
import android.app.Service; import android.content.Intent; import android.os.IBinder; import com.google.abs.payloadsdk.Arduino.Arduino; import com.google.abs.payloadsdk.Measures.Attitude; import com.google.abs.payloadsdk.Measures.Energy; import com.google.abs.payloadsdk.Measures.OrbitalState; import com.google.abs.payl...
package com.google.abs.payloadsdk; public class PayloadApp extends Service { private SDB sdb; private Arduino arduino; public PayloadApp(String appName) { sdb = new SDB(); sdb.execute(); arduino = new Arduino(sdb); //sdb.send(new SDBPacket(SDBPacket.CMD.HANDSHAKE, a...
public OrbitalState orbitalState()
3
ThunderGemios10/Survival-Games
src/main/java/com/thundergemios10/survivalgames/commands/Enable.java
[ "public class Game {\n\n\tpublic static enum GameMode {\n\t\tDISABLED, LOADING, INACTIVE, WAITING,\n\t\tSTARTING, INGAME, FINISHING, RESETING, ERROR\n\t}\n\n\tprivate GameMode mode = GameMode.DISABLED;\n\tprivate ArrayList < Player > activePlayers = new ArrayList < Player > ();\n\tprivate ArrayList < Player > inact...
import org.bukkit.command.CommandSender; import com.thundergemios10.survivalgames.Game; import com.thundergemios10.survivalgames.MessageManager; import com.thundergemios10.survivalgames.Game.GameMode; import com.thundergemios10.survivalgames.MessageManager.PrefixType; import com.thundergemios10.survivalgames.GameManage...
package com.thundergemios10.survivalgames.commands; public class Enable implements ConsoleSubCommand{ public boolean onCommand(CommandSender sender, String[] args) { if(!sender.hasPermission(permission()) && !sender.isOp()){ MessageManager.getInstance().sendFMessage(PrefixType.ERROR, "error.nopermissio...
return "/sg enable <id> - " + SettingsManager.getInstance().getMessageConfig().getString("messages.help.enable", "Enables arena <id>");
5
tassioauad/GameCheck
app/src/main/java/com/tassioauad/gamecheck/model/api/asynctask/impl/PlatformSearchLastsAsyncTask.java
[ "public class AsyncTaskResult<T>\n{\n private T result;\n private Exception error;\n\n public AsyncTaskResult() {\n\n }\n\n public AsyncTaskResult(T result) {\n this.result = result;\n }\n\n public AsyncTaskResult(Exception error) {\n this.error = error;\n }\n\n public T get...
import android.content.Context; import com.tassioauad.gamecheck.model.api.asynctask.AsyncTaskResult; import com.tassioauad.gamecheck.model.api.asynctask.GenericAsyncTask; import com.tassioauad.gamecheck.model.api.asynctask.exception.BadRequestException; import com.tassioauad.gamecheck.model.api.resource.PlatformResourc...
package com.tassioauad.gamecheck.model.api.asynctask.impl; public class PlatformSearchLastsAsyncTask extends GenericAsyncTask<Integer, Void, List<Platform>> { private PlatformResource platformResource; private final String sort = "release_date:desc"; private final String format = "json"; public ...
return new AsyncTaskResult<>(new BadRequestException());
2
sastix/cms
server/src/main/java/com/sastix/cms/server/services/content/impl/ZipHandlerServiceImpl.java
[ "@Getter @Setter @NoArgsConstructor @ToString\npublic class CreateResourceDTO {\n\n /**\n * The media-type of this new resource.\n */\n @NotNull\n private String resourceMediaType;\n\n /**\n * The author creating this resource.\n */\n @NotNull\n private String resourceAuthor;\n\n ...
import com.sastix.cms.common.content.CreateResourceDTO; import com.sastix.cms.common.content.ResourceDTO; import com.sastix.cms.common.content.exceptions.ResourceAccessError; import com.sastix.cms.server.domain.entities.Resource; import com.sastix.cms.server.services.content.DistributedCacheService; import com.sastix.c...
/* * Copyright(c) 2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appl...
public ResourceDTO handleZip(Resource zipResource) {
3
michal-michaluk/ddd-wro-warehouse
warehouse-infrastructure/src/main/java/quality/QualityReportService.java
[ "public class EventMappings {\n\n private ProductStockAgentRepository stocks;\n private FifoRepository fifo;\n private OpsSupport support;\n\n public ExternalEvents externalEvents() {\n return new ExternalEvents();\n }\n\n public ProductStock.EventsContract productStocks() {\n return...
import warehouse.EventMappings; import warehouse.PaletteLabel; import warehouse.products.ProductStockEventStore; import warehouse.quality.Destroyed; import warehouse.quality.Locked; import warehouse.quality.Unlocked;
package quality; /** * Created by michal on 20.08.2016. */ public class QualityReportService { private final ProductStockEventStore stocks; private final EventMappings.ExternalEvents events; public QualityReportService(ProductStockEventStore stocks, EventMappings mappings) { this.stocks = stoc...
Unlocked event = new Unlocked(status.getLabel(), status.getRecovered(), status.getScraped());
5
Lambda-3/DiscourseSimplification
src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/rules/AdjectivalAdverbialMiddleFinalExtractor.java
[ "public enum Relation {\n\n UNKNOWN,\n\n // Coordinations\n UNKNOWN_COORDINATION, // the default for coordination\n CONTRAST,\n CAUSE_C,\n RESULT_C,\n LIST,\n DISJUNCTION,\n TEMPORAL_AFTER_C,\n TEMPORAL_BEFORE_C,\n\n // Subordinations\n UNKNOWN_SUBORDINATION, // the default for s...
import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeExtractionUtils; import org.lambda3.text.simplification.discourse.utils.words.WordsUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; import edu.stanford.nlp.ling.Word; import edu.stanfor...
/* * ==========================License-Start============================= * DiscourseSimplification : SubordinationPostExtractor * * Copyright © 2017 Lambda³ * * GNU General Public License 3 * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public Lic...
Relation relation = Relation.UNKNOWN_SUBORDINATION; //TODO
0
elvis-liu/dummie
src/main/java/com/exmertec/dummie/DummyBuilderFactory.java
[ "public abstract class DataGenerator {\n\n private final List<FieldValueGenerator> generators;\n\n private final Set<String> randomFieldKeys;\n\n private final Set<Class<?>> randomFieldType;\n\n protected DataCache dataCache;\n\n protected GenerationStrategy strategy;\n\n public DataGenerator(Gene...
import com.exmertec.dummie.generator.data.DataGenerator; import com.exmertec.dummie.generator.data.impl.DefaultGenerator; import com.exmertec.dummie.generator.data.impl.LevelGenerator; import com.exmertec.dummie.configuration.Configuration; import com.exmertec.dummie.configuration.CycleLogic; import com.exmertec.dummie...
package com.exmertec.dummie; public class DummyBuilderFactory { private Configuration configuration; public DummyBuilderFactory() { configuration = new Configuration(CycleLogic.CYCLE, GenerationStrategy.DEFAULT); } public DummyBuilderFactory cycleLogic(CycleLogic logic) { configurat...
private DataGenerator getDataGenerator() {
0
FedUni/caliko
caliko-demo/src/main/java/au/edu/federation/caliko/demo/CalikoDemo2D.java
[ "public class FabrikStructure2D implements FabrikStructure<FabrikChain2D,Vec2f>, Serializable\r\n{\r\n\tprivate static final long serialVersionUID = 1L;\r\n\t\r\n\tprivate static final Vec2f UP = new Vec2f(0.0f, 1.0f);\r\n\t\r\n\t// ---------- Private Properties ----------\r\n\t\r\n\t/** The string name of this Fab...
import au.edu.federation.caliko.FabrikStructure2D; import au.edu.federation.caliko.demo2d.CalikoDemoStructure2D; import au.edu.federation.caliko.demo2d.CalikoDemoStructure2DFactory; import au.edu.federation.caliko.visualisation.FabrikLine2D; import au.edu.federation.caliko.visualisation.Point2D; import au.edu.federatio...
package au.edu.federation.caliko.demo; /** * Class to demonstrate some of the features of the Caliko library in 2D. * * @author Al Lansley * @version 0.8 - 02/08/2016 */ public class CalikoDemo2D implements CalikoDemo { /** Each demo works with a single structure composed of one or more IK chains. */ static ...
FabrikLine2D.draw( mStructure, 4.0f, Application.window.getMvpMatrix() );
3
schnatterer/nusic
nusic-ui-android/src/main/java/info/schnatterer/nusic/android/activities/NusicPreferencesActivity.java
[ "@SuppressLint(\"NewApi\")\npublic class NusicPreferencesFragment extends RoboPreferenceFragment {\n\n @Inject\n private PreferenceReleasedTodayTimePickerListener releaseTodayTimePickerListener;\n @Inject\n private PreferenceVisibilityButtonListener preferenceVisibilityButtonListener;\n\n @Override\n...
import roboguice.activity.RoboAppCompatPreferenceActivity; import android.annotation.TargetApi; import android.app.Fragment; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.preference.Preference; import android.view.MenuItem; import info.schnatterer.nusic.android.fragmen...
/** * Copyright (C) 2013 Johannes Schnatterer * * See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * This file is part of nusic. * * nusic is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License a...
private PreferenceReleasedTodayTimePickerListener releaseTodayTimePickerListener;
1
lantunes/fixd
src/main/java/org/bigtesting/fixd/ServerFixture.java
[ "public interface CapturedRequest {\n\n String getPath();\n \n String getRequestLine();\n \n String getMethod();\n \n List<String> getHeaders();\n \n byte[] getBody();\n \n String getBody(String encoding);\n \n /**\n * Returns true if this request was broadcast to any subs...
import org.simpleframework.transport.connect.SocketConnection; import java.io.IOException; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.Collection; import org.bigtesting.fixd.capture.CapturedRequest; import org.bigtesting.fixd.core.FixdServer; import org.bigtesting.fixd.core.Reques...
/* * Copyright (C) 2015 BigTesting.org * * 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 ...
server = new FixdServer(new ContainerServer(container));
1
almondtools/rexlex
src/main/java/com/almondtools/rexlex/automaton/GenericAutomaton.java
[ "public interface Token {\n\n\tString getLiteral();\n\tTokenType getType();\n\t\n}", "public interface TokenFactory<T extends Token> {\n\n\tT createToken(String literal, TokenType type);\n\n}", "public interface TokenType {\n\n\tboolean error();\n\tboolean accept();\n\n}", "public enum DefaultTokenType implem...
import static com.almondtools.rexlex.automaton.AutomatonProperty.ACYCLIC; import static com.almondtools.rexlex.automaton.AutomatonProperty.CYCLIC; import static com.almondtools.rexlex.automaton.AutomatonProperty.LINEAR; import static com.almondtools.rexlex.automaton.AutomatonProperty.UNKNOWN; import static net.amygdalu...
package com.almondtools.rexlex.automaton; public class GenericAutomaton implements Automaton, Cloneable { private TokenTypeFactory tokenTypes; private State start; private State error; private AutomatonProperty property; public GenericAutomaton() {
this(new DefaultTokenTypeFactory());
4
pmarches/jStellarAPI
src/main/java/jstellarapi/keys/StellarWallet.java
[ "public class StellarAddressPublicInformation implements JSONSerializable {\n\tpublic String account;\n\tpublic BigDecimal STRBalance;\n\tpublic String urlgravatar;\n\tpublic long nextTransactionSequence;\n\tpublic String inflationDestination;\n\t\n\t@Override\n\tpublic void copyFrom(JSONObject jsonCommandResult) {...
import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.Serializable; import java.io.Writer; import java.math.BigInteger; import java.security.SecureRandom; import javax.xml.bind.DatatypeConverter; import jstellarapi.connection.StellarAddressPublicInformatio...
package jstellarapi.keys; public class StellarWallet implements Serializable { private static final long serialVersionUID = -4849034810727882329L; transient File walletFile; StellarSeedAddress seed; int nextTransactionSequenceNumber; byte[] pendingTransaction; protected StellarWallet(StellarSeedAddress see...
DenominatedIssuedCurrency amount = new DenominatedIssuedCurrency(STRAmount);
2
NessComputing/components-ness-httpclient
client/src/test/java/com/nesscomputing/httpclient/AbstractTestHttpClient.java
[ "public final class HttpClient implements Closeable\n{\n private final HttpClientFactory httpClientFactory;\n\n /**\n * Creates a new HTTP client with the default implementation (currently Apache HTTPClient 4) and default settings.\n */\n public HttpClient()\n {\n this(new HttpClientDefau...
import com.nesscomputing.httpclient.testsupport.StringResponseConverter; import com.nesscomputing.testing.lessio.AllowNetworkAccess; import static org.hamcrest.CoreMatchers.is; import java.io.IOException; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import com.nesscom...
/** * Copyright (C) 2012 Ness Computing, 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 ...
protected HttpClient httpClient = null;
0
ddarriba/jmodeltest2
src/main/java/es/uvigo/darwin/jmodeltest/exe/RunConsense.java
[ "public class ModelTest {\n\n\tprivate ApplicationOptions options = ApplicationOptions.getInstance();\n\n\t/** The MPJ rank of the process. It is only useful if MPJ is running. */\n\tpublic static int MPJ_ME;\n\t/** The MPJ size of the communicator. It is only useful if MPJ is running. */\n\tpublic static int MPJ_S...
import java.io.PrintWriter; import java.io.PushbackReader; import java.io.StringReader; import java.io.StringWriter; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.Set; import java.util.Vector; import pal.misc.Identifier; import pal.tree.ReadTree; import pal.tree.Tree; impo...
consensusThreshold = 0.5d; } ; Consensus consensus = new Consensus(treeList, consensusThreshold, Consensus.BRANCH_LENGTHS_MEDIAN); return consensus; } // doConsense /************** * buildConfidenceInterval ************************ * * Builds the confidence interval of selected models and thei...
Set<FixedBitSet> keySet = consensus.getCladeSupport().keySet();
7
marcusschiesser/openbahn-api
openbahn-api/test/de/marcusschiesser/dbpendler/test/BookingTest.java
[ "@JsonIgnoreProperties(ignoreUnknown=true)\r\npublic class StationVO implements Serializable {\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate static final long serialVersionUID = -4162834891520852561L;\r\n\r\n\tprivate String value;\r\n\tprivate String typeStr;\r\n\tprivate String type;\r\n\tprivate String weight;\r\n...
import java.io.IOException; import java.text.ParseException; import java.util.Date; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.xml.sax.SAXException; import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig; import com...
package de.marcusschiesser.dbpendler.test; public class BookingTest { private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig()); @Before public void setUp() { helper.setUp(); } @After public void tearDown() { helper.tearDown(); }...
HTTPSession session = Login.getInstance().login(LoginTest.TEST_USER_LOGIN, LoginTest.TEST_USER_PIN);
8
guardianproject/CameraV
cameraVApp/src/main/java/org/witness/informacam/app/screens/FullScreenViewFragment.java
[ "public class EditorActivity extends FragmentActivity implements EditorActivityListener, IRegionDisplayListener, InformaCamStatusListener, InformaCamEventListener\n{\n\tIntent init;\n\n\tFrameLayout rootMain;\n\tView rootForm;\n\tView bottomPart;\n\tView mediaHolderView;\n\tFragment fullscreenView, formView;\n\tOve...
import info.guardianproject.odkparser.FormWrapper.ODKFormListener; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.ArrayUtils; import org.witness.informacam.app.EditorActivity; import org.witness.informacam.app.R; import org.witness.informacam.app.screens.editors.FullScreenMJPEGPlayer...
package org.witness.informacam.app.screens; public class FullScreenViewFragment extends Fragment implements OnTouchListener, IRegionDisplayListener, ODKFormListener { public enum Mode { Normal, Edit, AddTags } protected Mode currentMode = Mode.Normal; protected View rootView; protected RelativeLayout med...
((EditorActivityListener) getActivity()).media().removeRegion(currentRegion);
3
yyxhdy/ManyEAs
src/jmetal/problems/Schaffer.java
[ "public abstract class Problem implements Serializable {\n\n\t/**\n\t * Defines the default precision of binary-coded variables\n\t */\n\tprivate final static int DEFAULT_PRECISSION = 16;\n\n\t/**\n\t * Stores the number of variables of the problem\n\t */\n\tprotected int numberOfVariables_;\n\n\t/**\n\t * Stores t...
import jmetal.core.Problem; import jmetal.core.Solution; import jmetal.core.Variable; import jmetal.encodings.solutionType.BinaryRealSolutionType; import jmetal.encodings.solutionType.RealSolutionType; import jmetal.util.JMException;
// Schaffer.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public Li...
solutionType_ = new BinaryRealSolutionType(this) ;
3
kasirgalabs/ETUmulator
src/test/java/com/kasirgalabs/etumulator/visitor/StackVisitorTest.java
[ "public class Assembler {\n private final Linker linker;\n private final Loader loader;\n\n /**\n * Constructs an Assembler object with the given {@link Memory}. Generated address space layout\n * and the data will be loaded in the memory.\n *\n * @param memory Memory for the allocated data...
import static org.junit.Assert.assertEquals; import com.kasirgalabs.etumulator.lang.Assembler; import com.kasirgalabs.etumulator.processor.BaseProcessor; import com.kasirgalabs.etumulator.processor.BaseProcessorUnits; import com.kasirgalabs.etumulator.processor.Processor; import com.kasirgalabs.etumulator.processor.Pro...
package com.kasirgalabs.etumulator.visitor; public class StackVisitorTest { private final ProcessorUnits processorUnits; private final Assembler assembler; private final RegisterFile registerFile; private final Stack stack; private final Processor processor; public StackVisitorTest() {
processorUnits = new BaseProcessorUnits();
2
witwall/sfntly-java
src/main/java/com/google/typography/font/tools/conversion/woff/WoffWriter.java
[ "public class Font {\n\n private static final Logger logger =\n Logger.getLogger(Font.class.getCanonicalName());\n\n /**\n * Offsets to specific elements in the underlying data. These offsets are relative to the\n * start of the table or the start of sub-blocks within the table.\n */\n private enum Offs...
import com.google.typography.font.sfntly.Font; import com.google.typography.font.sfntly.Tag; import com.google.typography.font.sfntly.data.FontData; import com.google.typography.font.sfntly.data.WritableFontData; import com.google.typography.font.sfntly.table.Table; import com.google.typography.font.sfntly.table.core.F...
/* * Copyright 2011 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 applicable ...
public WritableFontData convert(Font font) {
3
asebak/ui5-intellij-plugin
src/com/atsebak/ui5/filebuilder/CreateFileDialog.java
[ "public enum AppType {\n DESKTOP,\n MOBILE\n}", "public enum FileType {\n JS,\n XML,\n HTML,\n JSON,\n PROPERTIES\n}", "public class Controller extends UI5View {\n /**\n * generates code for the controller\n *\n * @param modulePath\n * @param controllerName\n * @retur...
import com.atsebak.ui5.AppType; import com.atsebak.ui5.FileType; import com.atsebak.ui5.autogeneration.Controller; import com.atsebak.ui5.autogeneration.UI5View; import com.atsebak.ui5.locale.UI5Bundle; import com.atsebak.ui5.util.ProjectHelper; import com.atsebak.ui5.util.UI5FileBuilder; import com.atsebak.ui5.util.Wr...
package com.atsebak.ui5.filebuilder; public class CreateFileDialog extends DialogWrapper { private final Project project; private final PsiDirectory psiDirectory; private JPanel contentPane; private JTextField name; private JLabel myKindLabel; private TemplateKindCombo kindCombo; protect...
String controllerCode = new Controller().getAutogenerateCode(modulePath, fileNameWithOutExt);
2
sct/HexxitGear
src/sct/hexxitgear/core/ArmorSet.java
[ "@Mod(modid = HexxitGear.modId, name = \"Hexxit Gear\", useMetadata = true, version = HexxitGear.version)\n@NetworkMod(serverSideRequired = false, clientSideRequired = true,\n clientPacketHandlerSpec = @NetworkMod.SidedPacketHandler(channels = { HexxitGear.modNetworkChannel }, packetHandler = HGPacketHandler...
import java.util.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import sct.hexxitgear.HexxitGear; import sct.hexxitgear.core.ability.Ability; import sct.hexxitgear.core.ability.AbilityInvisibility; import sct.hexxitgear.core.ability.AbilityKnockback; import sct.hexxitgear.core.abili...
/* * HexxitGear * Copyright (C) 2013 Ryan Cohen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This pro...
Arrays.asList(HexxitGear.tribalHelmet, HexxitGear.tribalChest, HexxitGear.tribalLeggings, HexxitGear.tribalShoes), new BuffTribalSet(), new AbilityKnockback());
0
cerner/beadledom
health/service/src/main/java/com/cerner/beadledom/health/HealthModule.java
[ "@Api(value = \"/health\",\n description = \"Health and dependency checks\")\n@io.swagger.annotations.Api(value = \"/health\",\n description = \"Health and dependency checks\")\n@Path(\"meta/availability\")\npublic interface AvailabilityResource {\n @GET\n @Produces(MediaType.TEXT_HTML)\n StreamingOutput g...
import com.cerner.beadledom.health.api.AvailabilityResource; import com.cerner.beadledom.health.api.DependenciesResource; import com.cerner.beadledom.health.api.DiagnosticResource; import com.cerner.beadledom.health.api.HealthResource; import com.cerner.beadledom.health.api.VersionResource; import com.cerner.beadledom....
package com.cerner.beadledom.health; /** * A Guice module that provides JAX-RS resources to implement the Health Check. * * <p>With the module installed, you can add new 'dependencies' to your service's health check by * adding bindings of {@link com.cerner.beadledom.health.HealthDependency} using the Multibinder...
bind(DependenciesResource.class).to(DependenciesResourceImpl.class);
1
PedroGomes/TPCw-benchmark
TPCW_Cassandra_Implementation/src/org/uminho/gsd/benchmarks/TPCW_Cassandra/database/TPCWCassandraExecutorFactory.java
[ "public class NodeKeyGenerator implements KeyGenerator {\n\n int nodeID;\n\n\n public NodeKeyGenerator(int nodeID) {\n this.nodeID = nodeID;\n }\n\n public synchronized Object getNextKey() {\n\n long timestamp = Long.MAX_VALUE - System.currentTimeMillis();\n //max long as 19 charact...
import org.apache.cassandra.thrift.ConsistencyLevel; import org.uminho.gsd.benchmarks.generic.helpers.NodeKeyGenerator; import org.uminho.gsd.benchmarks.benchmark.BenchmarkExecutor; import org.uminho.gsd.benchmarks.helpers.TPM_counter; import org.uminho.gsd.benchmarks.helpers.ThinkTime; import org.uminho.gsd.benchmarks...
/* * ********************************************************************* * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. * 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...
public DatabaseExecutorInterface getDatabaseClient() {
5
cqjjjzr/BiliLiveLib
BiliLiveLib/src/main/java/charlie/bililivelib/streamer/DirectStreamDownloader.java
[ "public class BiliLiveLib {\n public static final String PROJECT_NAME = \"BiliLiveLib\";\n\n public static final String VERSION = \"rv5\";\n public static String DEFAULT_USER_AGENT = PROJECT_NAME + \" \" + VERSION;\n}", "public class I18n {\n public static final String BUNDLE_NAME = \"BiliLiveLib\";\n...
import charlie.bililivelib.BiliLiveLib; import charlie.bililivelib.I18n; import charlie.bililivelib.internalutil.net.HttpHelper; import charlie.bililivelib.room.Room; import charlie.bililivelib.streamer.event.DownloadEvent; import org.apache.http.HttpResponse; import java.io.File; import java.io.InputStream; import jav...
package charlie.bililivelib.streamer; /** * 通过直接下载Http流进行保存的下载器,未压缩,但处理最快。 * * @author Charlie Jiang * @since rv1 */ public class DirectStreamDownloader extends AbstractThreadBasedDownloader { private static final int _1_KB = 1024; public DirectStreamDownloader(URL liveURL, Room room, File path) { ...
fireDownloadEvent(I18n.getString("msg.stream_starting"), DownloadEvent.Kind.STARTING);
1
NickToony/scrAI
src/main/java/com/nicktoony/scrAI/World/Tasks/TaskPickupEnergy.java
[ "@GlobalScope\npublic class Constants {\n public static int TIER_LOW = 1;\n public static int TIER_MEDIUM = 2;\n public static int TIER_HIGH = 3;\n\n public static int ALERT_STATUS_CRITICAL = 1; // 100% military, 0% economy\n public static int ALERT_STATUS_HIGH = 2; //\n public static int ALERT_ST...
import com.nicktoony.scrAI.Constants; import com.nicktoony.scrAI.Controllers.RoomController; import com.nicktoony.scrAI.World.Creeps.CreepWorker; import com.nicktoony.scrAI.World.Creeps.CreepWrapper; import com.nicktoony.screeps.Energy; import com.nicktoony.screeps.Game; import org.stjs.javascript.Global;
package com.nicktoony.scrAI.World.Tasks; /** * Created by nick on 02/08/15. */ public class TaskPickupEnergy extends Task { protected Energy energy; private int energyAvailable = 0;
public TaskPickupEnergy(RoomController roomController, String associatedId, Energy energy) {
1
jMotif/SAX
src/main/java/net/seninp/jmotif/sax/parallel/ParallelSAXImplementation.java
[ "public enum NumerosityReductionStrategy {\n\n /** No reduction at all - all the words going make it into collection. */\n NONE(0),\n\n /** Exact - the strategy based on the exact string match. */\n EXACT(1),\n\n /** Classic - the Lin's and Keogh's MINDIST based strategy. */\n MINDIST(2);\n\n private final i...
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit...
package net.seninp.jmotif.sax.parallel; /** * Implements a parallel SAX factory class. * * @author psenin */ public class ParallelSAXImplementation { // locale, charset, etc static final int COMPLETED_FLAG = -1; // logging stuff // private static final Logger LOGGER; private static final Level LOGGI...
public SAXRecords process(double[] timeseries, int threadsNum, int slidingWindowSize, int paaSize,
5
martinmarinov/TempestSDR
JavaGUI/src/martin/tempest/core/TSDRLibrary.java
[ "public class TSDRAlreadyRunningException extends TSDRException {\n\n\tprivate static final long serialVersionUID = 5365909402344178885L;\n\n\tpublic TSDRAlreadyRunningException(final Exception e) {\n\t\tsuper(e);\n\t}\n\t\n\tpublic TSDRAlreadyRunningException(final String msg) {\n\t\tsuper(msg);\n\t}\n}", "publi...
import java.awt.image.BufferedImage; import java.awt.image.DataBufferInt; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.List; import martin.t...
/******************************************************************************* * Copyright (c) 2014 Martin Marinov. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * h...
if (nativerunning) throw new TSDRAlreadyRunningException("");
0
cs2103jan2015-w13-3j/main
src/udo/logic/command/ModifyCommand.java
[ "public class Logic {\n private Gui gui;\n private static Logic logicObj = null;\n private Storage storage;\n private Reminder reminder;\n\n private static final String ERR_FORMAT = \"Error: %s\";\n public static final String ERR_INVALID_CMD_NAME = \"invalid command name\";\n public static fina...
import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Level; import java.util.logging.Logger; import udo.logic.Logic; import udo.storage.Task; import udo.storage.Task.TaskType; import udo.util.Config; import udo.util.Config.CommandName;
package udo.logic.command; //@author A0093587M public class ModifyCommand extends Command { public static final String STATUS_MODIFIED = "Task: %s modified successfully"; private static final Logger log = Logger. getLogger(ModifyCommand.class.getName()); public ModifyCommand() { ...
getOption(Config.OPT_DUR) != null;
3
lukas-krecan/mock-socket
core/src/test/java/net/javacrumbs/mocksocket/connection/StaticConnectionFactoryTest.java
[ "public static Matcher<RequestSocketData> address(Matcher<String> addressMatcher)\n{\n\treturn new CombinableMatcher<RequestSocketData>(new AddressMatcher(addressMatcher));\n}", "public static Matcher<SocketData> dataAre(InputStream data)\n{\n\treturn new CombinableMatcher<SocketData>(new DataMatcher(is(Utils.toB...
import static net.javacrumbs.mocksocket.MockSocket.address; import static net.javacrumbs.mocksocket.MockSocket.dataAre; import static net.javacrumbs.mocksocket.MockSocket.withData; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.startsWith; import static org.junit.Assert.assertEquals...
/** * Copyright 2009-2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
.andWhenRequest(address(is(ADDRESS1))).thenReturn(DATA1)
0
FabioZumbi12/PixelVip
PixelVip-Sponge-56/src/main/java/br/net/fabiozumbi12/pixelvip/sponge/PixelVip.java
[ "public class PackageManager {\n\n private PixelVip plugin;\n private PackagesCategory packages;\n private CommentedConfigurationNode packRoot;\n private ConfigurationLoader<CommentedConfigurationNode> packLoader;\n\n public PackageManager(PixelVip plugin, ObjectMapperFactory factory) {\n this...
import br.net.fabiozumbi12.pixelvip.sponge.Packages.PackageManager; import br.net.fabiozumbi12.pixelvip.sponge.PaymentsAPI.MercadoPagoHook; import br.net.fabiozumbi12.pixelvip.sponge.PaymentsAPI.PagSeguroHook; import br.net.fabiozumbi12.pixelvip.sponge.PaymentsAPI.PaymentModel; import br.net.fabiozumbi12.pixelvip.spong...
package br.net.fabiozumbi12.pixelvip.sponge; @Plugin(id = "pixelvip", name = "PixelVip", version = VersionData.VERSION, authors = "FabioZumbi12", description = "Plugin to give VIP to your players.", dependencies = { @Dependency(id = "pagseguroapi", optional = ...
private List<PaymentModel> payments;
3
ralscha/wampspring
src/main/java/ch/rasc/wampspring/broker/SimpleBrokerMessageHandler.java
[ "public interface WampMessageSelector {\n\tboolean accept(WampMessage message);\n}", "public class WampSession {\n\n\tprivate final static String PREFIXES = WampSession.class.getName() + \".PREFIXES\";\n\n\tprivate final static String AUTH_KEY = WampSession.class.getName() + \".AUTH_KEY\";\n\n\tprivate final stat...
import ch.rasc.wampspring.message.PublishMessage; import ch.rasc.wampspring.message.SubscribeMessage; import ch.rasc.wampspring.message.UnsubscribeMessage; import ch.rasc.wampspring.message.WampMessage; import ch.rasc.wampspring.message.WampMessageType; import java.util.Set; import org.apache.commons.logging.Log; impor...
/** * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appl...
sendMessageToSubscribers((EventMessage) wampMessage);
2
multi-os-engine/moe-plugin-gradle
src/main/java/org/moe/gradle/tasks/ResourcePackager.java
[ "public class MoeExtension extends AbstractMoeExtension {\n\n private static final Logger LOG = Logging.getLogger(MoeExtension.class);\n\n @NotNull\n public final PackagingOptions packaging;\n\n @NotNull\n public final ResourceOptions resources;\n\n @NotNull\n public final XcodeOptions xcode;\n...
import org.moe.gradle.utils.TaskUtils; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import org.gradle.api.Project; import org.gradle.api.Rule; import org.gradle.api.file.CopySpec; import org.gradle.api.tasks.SourceSet; import org.gradle.api.tasks.bundling.Jar; import org.moe.gradle.MoeE...
/* Copyright (C) 2016 Migeran 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 writing, software dis...
public static Rule addRule(@NotNull MoePlugin plugin) {
1
Rsgm/Hakd
core/src/game/Internet.java
[ "public class City {\n public static final int width = 150;\n public static final int height = 150;\n\n private final Vector2 position;\n private final Sprite icon;\n private final String name;\n private final float density;\n private final Map<String, Network> networks;\n\n public City(Vect...
import game.gameplay.City; import networks.BackboneProviderNetwork; import networks.InternetProviderNetwork; import networks.Network; import networks.Network.NetworkType; import networks.NetworkFactory; import networks.devices.Device; import java.util.*;
package game; public class Internet { /** * Contains all ISPs. Note: ISPs can only be public. */ private final Map<String, InternetProviderNetwork> internetProviderNetworksMap; /** * Contains all Backbone networks. Note: Backbone networks can only be * public. */ private fin...
public Internet(HashMap<String, City> cities) {
0
dpr-odoo/trainee-om-shop
app/src/main/java/com/odoo/addons/website_sale/ProductSubCategories.java
[ "public class Products extends BaseFragment implements EasyRecyclerViewAdapter.OnViewBindListener,\n EasyRecyclerViewAdapter.OnItemViewClickListener {\n\n public static final String KEY_FILTER_BY_CATEGORY = \"filter_by_category\";\n public static final String KEY_FILTER_DATA = \"filter_data\";\n pri...
import android.content.Context; import android.graphics.Bitmap; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.CollapsingToolbarLayout; import android.support.v7.graphics.Palette; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; im...
package com.odoo.addons.website_sale; public class ProductSubCategories extends BaseFragment implements EasyRecyclerViewAdapter.OnViewBindListener, EasyRecyclerViewAdapter.OnItemViewClickListener { private Bundle data; private ODataRow category; private EasyRecyclerView subCategories; @Nu...
OAppBarUtils.bindShopMenu(parent(), new int[]{}, toolbar.getMenu());
3
iminto/baicai
src/main/java/com/baicai/controller/user/UserController.java
[ "public abstract class BaseController implements HandlerInterceptor{\r\n\tprotected Logger logger = LoggerFactory.getLogger(this.getClass());\r\n\t\r\n\t/**\r\n\t * preHandle方法是进行处理器拦截用的,顾名思义,该方法将在Controller处理之前进行调用\r\n\t * @param request\r\n\t * @param response\r\n\t * @param handler\r\n\t * @return\r\n\t * @throw...
import java.util.HashMap; import java.util.Map; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframewor...
package com.baicai.controller.user; @Controller @RequestMapping("/site") public class UserController extends BaseController { @Autowired private UserService userService; @RequestMapping("/login") public String login(HttpServletRequest request, HttpServletResponse response) throws Exception { retur...
ErrorMsg errorMsg = new ErrorMsg();
2
Mpmart08/MusicPlayer
src/app/musicplayer/MusicPlayer.java
[ "public final class Album implements Comparable<Album> {\n\n private int id;\n private String title;\n private String artist;\n private Image artwork;\n private ArrayList<Song> songs;\n private SimpleObjectProperty<Image> artworkProperty;\n\n /**\n * Constructor for the Album class. \n ...
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; import java.net.URISyntaxException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collections; import java.util.List; import jav...
package app.musicplayer; public class MusicPlayer extends Application { private static MainController mainController; private static MediaPlayer mediaPlayer; private static ArrayList<Song> nowPlayingList; private static int nowPlayingIndex; private static Song nowPlaying; private static Tim...
MusicPlayer.stage.getIcons().add(new Image(this.getClass().getResource(Resources.IMG + "Icon.png").toString()));
4
Nanopublication/nanopub-java
src/main/java/org/nanopub/op/Topic.java
[ "public class MalformedNanopubException extends Exception {\n\n\tprivate static final long serialVersionUID = -1022546557206977739L;\n\n\tpublic MalformedNanopubException(String message) {\n\t\tsuper(message);\n\t}\n\n}", "public class MultiNanopubRdfHandler extends AbstractRDFHandler {\n\n\tpublic static void pr...
import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.List; import java.util.zip.GZIPOutputStream; import net.trustyuri.TrustyUriException; import org.n...
package org.nanopub.op; public class Topic { @com.beust.jcommander.Parameter(description = "input-nanopubs") private List<File> inputNanopubs = new ArrayList<File>(); @com.beust.jcommander.Parameter(names = "-o", description = "Output file") private File outputFile; @com.beust.jcommander.Parameter(names = ...
NanopubImpl.ensureLoaded();
5
juiser/juiser
spring/spring-boot-starter/src/main/java/org/juiser/spring/boot/config/JuiserDefaultAutoConfiguration.java
[ "public class JwtConfig {\n\n public static final long DEFAULT_CLOCK_SKEW_SECONDS = 3 * 60; // 3 minutes\n\n private boolean enabled; //true = a jwt is expected, false = simple string or json is expected\n\n private Long allowedClockSkewSeconds; //seconds by which the gateway and origin server clocks are a...
import io.jsonwebtoken.Claims; import org.juiser.jwt.config.JwtConfig; import org.juiser.model.User; import org.juiser.servlet.GuestFallbackUserFactory; import org.juiser.servlet.RequestGuestFactory; import org.juiser.servlet.RequestHeaderUserFactory; import org.juiser.spring.web.RequestContextUser; import org.juiser.s...
/* * Copyright 2017 Les Hazlewood and the respective Juiser contributors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * U...
return new RequestHeaderUserFactory(forwardedHeaderConfig().getName(), juiserJwsUserFactory());
4
eaftan/heapviz
src/test/java/edu/tufts/eaftan/heapviz/analzyer/SummarizersTest.java
[ "public class SummarizeHandler extends NullRecordHandler {\n\n private static final String BLACKLIST = \"/sun_blacklist.txt\";\n\n /* Instance variables */\n\n /**\n * Should we compute the summary?\n */\n private boolean doSummary;\n\n /**\n * Should we output pointer edges?\n */\n private boolean pr...
import edu.tufts.eaftan.heapviz.summarizer.IdentitySummarizer; import edu.tufts.eaftan.heapviz.summarizer.Softvis2010Summarizer; import edu.tufts.eaftan.heapviz.summarizer.TypeGraphSummarizer; import edu.tufts.eaftan.hprofparser.handler.RecordHandler; import edu.tufts.eaftan.hprofparser.parser.HprofParser; import java....
/* * Copyright 2014 Edward Aftandilian. 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...
RecordHandler summarizeHandler = new SummarizeHandler(
0
alfsch/workspacemechanic
parent/bundles/com.google.eclipse.mechanic/src/com/google/eclipse/mechanic/plugin/ui/MechanicPreferencePage.java
[ "public final class MechanicService implements IMechanicService {\n\n private static final MechanicService instance = new MechanicService();\n\n private final IMechanicPreferences mechanicPreferences;\n\n /**\n * Enumeration of the various states a task can be in.\n */\n public enum TaskStatus {\n PASSED...
import java.util.Arrays; import java.util.Collections; import java.util.List; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IntegerFieldEditor; import org.eclipse.jface.preference.ListEditor; import org.eclipse....
/******************************************************************************* * Copyright (C) 2007, Google Inc. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at ...
Collections.sort(unblockedTasks, TaskByTitleComparator.getInstance());
3
msteiger/jxmapviewer2
examples/src/sample3_interaction/Sample3.java
[ "public class JXMapViewer extends JPanel implements DesignMode\r\n{\r\n private static final long serialVersionUID = -3530746298586937321L;\r\n\r\n /**\r\n * The zoom level. Generally a value between 1 and 15 (TODO Is this true for all the mapping worlds? What does this\r\n * mean if some mapping syst...
import java.awt.BorderLayout; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.io.File; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.WindowConstants; import javax.swing.event.MouseInputListener; import org.jxmapviewer.JXMapViewer; import o...
package sample3_interaction; /** * A simple sample application that shows * a OSM map of Europe * @author Martin Steiger */ public class Sample3 { /** * @param args the program args (ignored) */ public static void main(String[] args) { // Create a TileFactoryInfo f...
MouseInputListener mia = new PanMouseInputListener(mapViewer);
5
wrey75/WaveCleaner
src/main/java/com/oxande/xmlswing/components/JPopupMenuUI.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.JPopupMenu; 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.AttributeDefinition.ClassType; import com.oxande.xmls...
package com.oxande.xmlswing.components; /** * * @author wrey75 * @version $Rev: 47 $ * */ public class JPopupMenuUI extends JComponentUI { public static final AttributeDefinition[] PROPERTIES = { new AttributeDefinition( "borderPainted", "setBorderPainted", ClassType.BOOLEAN ), new At...
public static final AttributesController CONTROLLER = new AttributesController( JComponentUI.CONTROLLER, PROPERTIES );
1
TheCount/jhilbert
src/main/java/jhilbert/expressions/impl/ExpressionFactory.java
[ "public interface Functor extends Term {\n\n\t/**\n\t * Returns an unmodifiable {@link List} of input {@link Kind}s.\n\t *\n\t * @return unmodifiable list of input kinds.\n\t */\n\tpublic List<? extends Kind> getInputKinds();\n\n\t/**\n\t * Returns the definition depth of this <code>Functor</code>.\n\t * This funct...
import jhilbert.data.Module; import jhilbert.data.Variable; import jhilbert.expressions.Expression; import jhilbert.expressions.ExpressionException; import jhilbert.scanners.TokenFeed; import java.util.List; import java.util.Map; import java.util.Set; import jhilbert.data.Functor; import jhilbert.data.Kind;
/* JHilbert, a verifier for collaborative theorem proving Copyright © 2008, 2009, 2011 The JHilbert Authors See the AUTHORS file for the list of JHilbert authors. See the commit logs ("git log") for a list of individual contributions. This program is free software: you can redistribute it and/...
public @Override ExpressionImpl createExpression(final Variable var) {
3
michaelmarconi/oncue
oncue-tests/src/test/java/oncue/tests/clients/AkkaClientTest.java
[ "public class AkkaClient implements Client {\n\n\tprivate LoggingAdapter log;\n\n\tprivate Settings settings;\n\n\tprivate ActorRef scheduler;\n\n\tpublic AkkaClient(ActorSystem system, ActorRef scheduler) {\n\t\tthis.scheduler = scheduler;\n\t\tlog = Logging.getLogger(system, this);\n\t\tsettings = SettingsProvide...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import oncue.client.AkkaClient; import oncue.common.messages.EnqueueJob; import oncue.common.messages.Job; import oncue.tests...
package oncue.tests.clients; public class AkkaClientTest extends ActorSystemTest { @Test public void enqueueJobWithWorkerTypeAndMapOfParamsEnqueuesAJob() throws Exception { new JavaTestKit(system) { { final JavaTestKit schedulerProbe = new JavaTestKit(system) { { new IgnoreMsg() { ...
AkkaClient client = new AkkaClient(system, scheduler);
0
marcosbarbero/spring-cloud-zuul-ratelimit
spring-cloud-zuul-ratelimit-core/src/main/java/com/marcosbarbero/cloud/autoconfigure/zuul/ratelimit/filters/AbstractRateLimitFilter.java
[ "public interface RateLimitUtils {\n\n /**\n * Returns the authenticated user from {@link HttpServletRequest}.\n *\n * @param request The {@link HttpServletRequest}\n * @return The authenticated user or annonymous\n */\n String getUser(HttpServletRequest request);\n\n /**\n * Return...
import java.util.List; import java.util.stream.Collectors; import static com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.support.RateLimitConstants.*; import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.RateLimitUtils; import com.marcosbarbero.cloud.autoconfigure.zuul.ratelimit.config.properties.Rat...
/* * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
protected List<Policy> policy(Route route, HttpServletRequest request) {
2
jgilfelt/Novocation
demo/src/com/novoda/locationdemo/activity/LocationUpdateList.java
[ "public interface Locator {\n\n\tvoid prepare(Context c, LocatorSettings settings);\n\n\tLocation getLocation();\n\n\tvoid setLocation(Location location);\n\n\tLocatorSettings getSettings();\n\n\tvoid startLocationUpdates() throws NoProviderAvailable;\n\n\tvoid stopLocationUpdates();\n\n\tboolean isNetworkProviderE...
import java.util.Date; import java.util.List; import roboguice.activity.RoboMapActivity; import roboguice.inject.InjectView; import android.app.AlertDialog; import android.app.Dialog; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content...
/* * Copyright 2011 Novoda 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 agreed to...
Log.v("Getting <accuracy,latitude,longitude>: " + location.getAccuracy() + " " + location.getLatitude() +
3
jimmc/HapiPodcastJ
src/info/xuluan/podcast/PlayerActivity.java
[ "public class FeedItem {\r\n\t\r\n\tpublic static final int MAX_DOWNLOAD_FAIL = 5;\r\n\t\r\n\tprivate final Log log = Log.getLog(getClass());\r\n\r\n\tpublic String url;\r\n\tpublic String title;\r\n\tpublic String author;\r\n\tpublic String date;\r\n\tpublic String content;\r\n\tpublic String resource;\r\n\tpublic...
import info.xuluan.podcast.provider.FeedItem; import info.xuluan.podcast.provider.ItemColumns; import info.xuluan.podcast.provider.Subscription; import info.xuluan.podcast.provider.SubscriptionColumns; import info.xuluan.podcast.service.PlayerService; import info.xuluan.podcast.utils.DialogMenu; import info.xulua...
package info.xuluan.podcast; public class PlayerActivity extends HapiListActivity implements PodcastTab, Flingable { protected static PlayerService mServiceBinder = null; protected final Log log = Log.getLog(getClass()); protected static ComponentName mService = null; private static final int M...
ItemColumns._ID, // 0
1
ls1110924/ImmerseMode
immerse/src/main/java/com/yunxian/immerse/impl/TlSbNNbImmerseMode.java
[ "public final class ImmerseConfiguration {\n\n final ImmerseType mImmerseTypeInKK;\n final ImmerseType mImmerseTypeInL;\n\n public final boolean lightStatusBar;\n public final boolean coverCompatMask;\n public final int coverMaskColor;\n\n private ImmerseConfiguration(@NonNull ImmerseType immerseT...
import android.annotation.TargetApi; import android.app.Activity; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; import android.view.View; import android.view.ViewGroup; import android.view.Window; import androidx.annotation.ColorInt; import androidx.annotation.ColorRe...
package com.yunxian.immerse.impl; /** * 半透明状态栏普通导航栏 * <p>半透明状态栏支持到4.4及以上,普通导航栏着色支持到5.0及以上</p> * * @author AShuai * @email ls1110924@gmail.com * @date 17/1/31 下午2:42 */ @TargetApi(KITKAT) public class TlSbNNbImmerseMode extends AbsImmerseMode { private final View mCompatStatusBarView; public TlSbNN...
DrawableUtils.setViewBackgroundDrawable(mCompatStatusBarView, drawable);
2
multi-os-engine/moe-plugin-gradle
src/main/java/org/moe/gradle/tasks/GenerateUIObjCInterfaces.java
[ "public class MoePlugin extends AbstractMoePlugin {\n\n private static final Logger LOG = Logging.getLogger(MoePlugin.class);\n\n private static final String MOE_ARCHS_PROPERTY = \"moe.archs\";\n\n @NotNull\n private MoeExtension extension;\n\n @NotNull\n @Override\n public MoeExtension getExte...
import org.gradle.api.GradleException; import org.gradle.api.file.ConfigurableFileCollection; import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputDirectory; import org.gradle.api.tasks.InputFiles; import org.gradle.api.tasks.Internal; import org.gradle.api.tasks.OutputFile; import org.gradle.api.tasks.S...
final IBActionAndOutletComposer composer = new IBActionAndOutletComposer(); FileUtils.classAndJarInputIterator(getInputFiles(), composer::read); final String composition = composer.compose(getMoeExtension().actionsAndOutlets); // Save to file FileUtils.write(getOutputSource(), c...
final Path out = Paths.get(MoePlugin.MOE, sourceSet.getName(), "ui-headers");
0
maxanier/MinecraftSecondScreenMod
src/main/java/de/maxgb/minecraft/second_screen/WebSocketListener.java
[ "@SuppressWarnings(\"rawtypes\")\npublic class ForceUpdateEvent extends Event {\n\tpublic final Class listener;\n\n\tpublic ForceUpdateEvent(Class updateListener) {\n\t\tlistener = updateListener;\n\t}\n}", "public class Logger {\r\n\r\n\tpublic static void d(String tag, String msg) {\r\n\t\tif(Configs.debug_mode...
import de.maxgb.minecraft.second_screen.util.ForceUpdateEvent; import de.maxgb.minecraft.second_screen.util.Logger; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.ServerTickEvent; import or...
package de.maxgb.minecraft.second_screen; /** * Manages the websocket and all handlers. * All communication runs through this class * @author Max * */ public class WebSocketListener { private class MSSWebSocketServer extends WebSocketServer { private final static String TAG = "MSSWebSocketServer"; public...
public void forceUpdate(ForceUpdateEvent e) {
0
JANNLab/JANNLab
examples/de/jannlab/examples/recurrent/SequentialParityExample.java
[ "public interface Net extends Serializable {\n //\n /**\n * Resets the network, which means that all inner\n * states (activations, derivations) are set to 0.0.\n * The method also resets the time index which is 0\n * after doing reset.\n */\n public void reset();\n /**\n * Initi...
import java.util.Random; import de.jannlab.Net; import de.jannlab.core.CellType; import de.jannlab.data.Sample; import de.jannlab.data.SampleSet; import de.jannlab.generator.RNNGenerator; import de.jannlab.training.RandomSearch; import de.jannlab.tools.ClassificationValidator; import de.jannlab.tools.NetTools;
/******************************************************************************* * JANNLab Neural Network Framework for Java * Copyright (C) 2012-2013 Sebastian Otte * * 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 * th...
final Net net,
0
aschaaff/savot
src/main/java/cds/savot/binary/DataBinaryWriter.java
[ "public final class FieldSet extends SavotSet<SavotField> {\n\n /**\n * Constructor\n */\n public FieldSet() {\n }\n}", "public final class SavotField extends MarkupComment implements IDSupport, NameSupport, RefSupport {\n\n // ID attribute\n private String id = null;\n // unit attribute...
import java.io.OutputStream; import java.util.zip.GZIPOutputStream; import cds.savot.model.FieldSet; import cds.savot.model.SavotField; import cds.savot.model.SavotTD; import cds.savot.model.SavotTR; import cds.savot.model.TDSet; import cds.savot.model.TRSet; import cds.savot.model.interpreter.BinaryFieldInterpreter; i...
package cds.savot.binary; //Copyright 2002-2014 - UDS/CNRS //The SAVOT library is distributed under the terms //of the GNU General Public License version 3. // //This file is part of SAVOT. // // SAVOT is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as pu...
public void writeTRSet(final TRSet rows) throws IOException, BinaryInterpreterException {
5
huyongli/TigerVideo
TigerVideoPlayer/src/main/java/cn/ittiger/player/PlayerManager.java
[ "public class BackPressedMessage extends Message {\n private int mScreenState;\n\n public BackPressedMessage(int screenState, int hash, String videoUrl) {\n\n super(hash, videoUrl);\n mScreenState = screenState;\n }\n\n public int getScreenState() {\n\n return mScreenState;\n }\n...
import android.text.TextUtils; import android.util.Log; import android.view.TextureView; import android.view.ViewGroup; import cn.ittiger.player.message.BackPressedMessage; import cn.ittiger.player.message.DurationMessage; import cn.ittiger.player.message.Message; import cn.ittiger.player.message.UIStateMessage; import...
package cn.ittiger.player; /** * 视频播放管理类,主要与视频展示展示UI进行交互,视频播放的具体操作交由播放器抽象类{@link AbsSimplePlayer}实现 * 通过此管理类达到视频播放控制与UI层的解耦,同时便于自定义播放器 * * @author: laohu on 2017/9/9 * @site: http://ittiger.cn */ public final class PlayerManager implements IPlayer.PlayCallback { private static final String TAG = "PlayerMa...
Utils.log("remove TextureView:" + mPlayer.getTextureView().toString());
6
chrisipa/cloud-portal
modules/cloud-portal-server/src/main/java/de/papke/cloud/portal/service/TerraformService.java
[ "public class Constants {\n\t\n\tpublic static final String CHAR_EMPTY = \"\";\n\tpublic static final String CHAR_STAR = \"*\";\n\tpublic static final String CHAR_DIAMOND = \"#\";\n\tpublic static final String CHAR_EQUAL = \"=\";\n\tpublic static final String CHAR_DASH = \"-\";\n\tpublic static final String CHAR_UN...
import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.OutputStream; import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.regex.Pattern; import javax.annotation.PostConstruct; import org.apac...
.append(Constants.CHAR_PARENTHESES_OPEN) .append(Constants.CHAR_DOT) .append(Constants.CHAR_STAR) .append(Constants.CHAR_PARENTHESES_CLOSE) .append(Constants.CHAR_WHITESPACE) .append(Constants.CHAR_EQUAL) .append(Constants.CHAR_WHITESPACE) .append(Constants.CHAR_PARENTHESES_OPEN) .ap...
CommandResult commandResult = commandExecutorService.execute(initCommand, initFolder, new ByteArrayOutputStream());
1
Bombe/jSite
src/main/java/de/todesbaum/jsite/application/Freenet7Interface.java
[ "public class Client implements ConnectionListener {\n\n\t/** The connection this client operates on. */\n\tprivate final Connection connection;\n\n\t/** The identifiers the client filters messages for. */\n\tprivate List<String> identifiers = new ArrayList<String>();\n\n\t/** The queued messages. */\n\tprivate fin...
import java.io.IOException; import de.todesbaum.util.freenet.fcp2.Client; import de.todesbaum.util.freenet.fcp2.Command; import de.todesbaum.util.freenet.fcp2.Connection; import de.todesbaum.util.freenet.fcp2.GenerateSSK; import de.todesbaum.util.freenet.fcp2.Message; import de.todesbaum.util.freenet.fcp2.Node;
/* * jSite - Freenet7Interface.java - Copyright © 2006–2019 David Roden * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later v...
GenerateSSK generateSSK = new GenerateSSK();
3
ScreamingHawk/fate-sheets
app/src/main/java/link/standen/michael/fatesheets/fragment/CoreCharacterEditStressFragment.java
[ "public class ConsequenceArrayAdapter extends ArrayAdapter<Consequence> {\n\n\tprivate static final String TAG = ConsequenceArrayAdapter.class.getName();\n\n\tprivate final Context context;\n\tprivate final int resourceId;\n\tprivate final List<Consequence> items;\n\n\tpublic ConsequenceArrayAdapter(@NonNull Contex...
import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import link.standen.michael.fatesheets.R; import link.standen.michael.fatesheets.adapter.ConsequenceArrayAdapt...
package link.standen.michael.fatesheets.fragment; /** * A fragment for managing a characters stress. */ public class CoreCharacterEditStressFragment extends CharacterEditAbstractFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ret...
((AdapterLinearLayout) rootView.findViewById(R.id.physical_stress_list)).setAdapter(physicalStressListAdapter);
2
tang-jie/AvatarMQ
src/com/newlandframework/avatarmq/broker/MessageBrokerHandler.java
[ "public class BrokerStrategyContext {\n\n public final static int AvatarMQProducerMessageStrategy = 1;\n public final static int AvatarMQConsumerMessageStrategy = 2;\n public final static int AvatarMQSubscribeStrategy = 3;\n public final static int AvatarMQUnsubscribeStrategy = 4;\n\n private Request...
import com.newlandframework.avatarmq.broker.strategy.BrokerStrategyContext; import com.newlandframework.avatarmq.model.RequestMessage; import com.newlandframework.avatarmq.model.ResponseMessage; import com.newlandframework.avatarmq.model.MessageSource; import com.newlandframework.avatarmq.netty.ShareMessageEventWrapper...
/** * Copyright (C) 2016 Newland Group Holding Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
BrokerStrategyContext strategy = new BrokerStrategyContext(request, response, ctx);
0
jeick/jamod
src/main/java/net/wimpi/modbus/cmd/TCPMasterTest.java
[ "public interface Modbus {\n\n\t/**\n\t * JVM flag for debug mode. Can be set passing the system property\n\t * net.wimpi.modbus.debug=false|true (-D flag to the jvm).\n\t */\n\tpublic static final boolean debug = \"true\".equals(System\n\t\t\t.getProperty(\"net.wimpi.modbus.debug\"));\n\n\t/**\n\t * Defines the cl...
import java.net.InetAddress; import net.wimpi.modbus.Modbus; import net.wimpi.modbus.ModbusCoupler; import net.wimpi.modbus.io.ModbusTCPTransaction; import net.wimpi.modbus.msg.*; import net.wimpi.modbus.net.TCPMasterConnection; import net.wimpi.modbus.procimg.Register;
/*** * Copyright 2002-2013 jamod development team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law...
int port = Modbus.DEFAULT_PORT;
0
carlphilipp/stock-tracker
website/src/main/java/fr/cph/stock/service/UserService.java
[ "@Builder\n@Data\n@AllArgsConstructor\n@NoArgsConstructor\npublic class Account {\n\n\tprivate int id;\n\tprivate int userId;\n\tprivate String name;\n\tprivate Currency currency;\n\tprivate Double liquidity;\n\t/**\n\t * is it allowed to delete it from db ?\n\t **/\n\tprivate Boolean del;\n\tprivate Double parity;...
import fr.cph.stock.entities.Account; import fr.cph.stock.entities.Portfolio; import fr.cph.stock.entities.User; import fr.cph.stock.exception.LoginException; import fr.cph.stock.exception.YahooException; import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; import java.util.Date; ...
/** * Copyright 2017 Carl-Philipp Harmant * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable...
Optional<User> getUser(String login);
2
RoRoche/AndroidStarterAlt
app/src/main/java/fr/guddy/androidstarteralt/ApplicationAndroidStarter.java
[ "@Module\r\npublic class ModuleAsync {\r\n\r\n @Provides\r\n @Singleton\r\n public JobManager provideJobManager(@NonNull final Context poContext) {\r\n final Configuration loConfiguration = new Configuration.Builder(poContext)\r\n .minConsumerCount(1) //always keep at least one consum...
import android.app.Application; import android.os.StrictMode; import com.facebook.stetho.Stetho; import com.novoda.merlin.Merlin; import com.orhanobut.hawk.Hawk; import com.orhanobut.logger.LogLevel; import com.orhanobut.logger.Logger; import com.scottyab.aescrypt.AESCrypt; import java.security.GeneralSecurityE...
package fr.guddy.androidstarteralt; @AutoComponent( modules = { ModuleAsync.class,
ModuleBus.class,
1
srinathwarrier/BrandstoreApp
app/src/main/java/com/brandstore1/activities/OutletDetailsActivity.java
[ "public class BrandstoreApplication extends Application {\r\n // model\r\n private static int numUnreadMessages;\r\n private static NotificationCompat.InboxStyle inboxStyle;\r\n\r\n private static BrandstoreApplication mInstance;\r\n\r\n private static NotificationStatus notificationStatus = Notifica...
import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.vie...
.defaultDisplayImageOptions(options) .build(); ImageLoader.getInstance().init(config); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setTitle(""); id = getIntent().getStringExtra("id"); ...
AddFavOutletAsyncTask mAddFavOutletAsyncTask = new AddFavOutletAsyncTask(id,operation);
1
jMotif/SAX
src/test/java/net/seninp/jmotif/sax/datastructures/TestSAXRecords.java
[ "public enum NumerosityReductionStrategy {\n\n /** No reduction at all - all the words going make it into collection. */\n NONE(0),\n\n /** Exact - the strategy based on the exact string match. */\n EXACT(1),\n\n /** Classic - the Lin's and Keogh's MINDIST based strategy. */\n MINDIST(2);\n\n private final i...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import org.junit.Test; import net.seninp.jmotif.sax.NumerosityReductionStrategy; import net.seninp.jmotif.sax.SAXPr...
package net.seninp.jmotif.sax.datastructures; /** * Testing SAX records store. * * @author psenin * */ public class TestSAXRecords { private static final String filenameTEK14 = "src/resources/test-data/TEK14.txt"; /** * Test the simple SAX conversion. * * @throws Exception if error occurs. *...
double[] ts1 = TSProcessor.readFileColumn(filenameTEK14, 0, 0);
2