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 |
|---|---|---|---|---|---|---|
mikolajmitura/java-properties-to-json | src/main/java/pl/jalokim/propertiestojson/PropertyArrayHelper.java | [
"public static final String ARRAY_END_SIGN = \"]\";",
"public static final String ARRAY_START_SIGN = \"[\";",
"public static final String EMPTY_STRING = \"\";",
"public static final String SIMPLE_ARRAY_DELIMITER = \",\";",
"public static final String INDEXES_PATTERN = \"\\\\s*(\\\\[\\\\s*((\" + NUMBER_PATTE... | import static pl.jalokim.propertiestojson.Constants.ARRAY_END_SIGN;
import static pl.jalokim.propertiestojson.Constants.ARRAY_START_SIGN;
import static pl.jalokim.propertiestojson.Constants.EMPTY_STRING;
import static pl.jalokim.propertiestojson.Constants.SIMPLE_ARRAY_DELIMITER;
import static pl.jalokim.propertiestojso... | package pl.jalokim.propertiestojson;
@Getter
public class PropertyArrayHelper {
private List<Integer> dimensionalIndexes;
private String arrayFieldName;
public PropertyArrayHelper(String field) {
arrayFieldName = getNameFromArray(field);
dimensionalIndexes = getIndexesFromArrayField(fie... | .replace(ARRAY_END_SIGN, SIMPLE_ARRAY_DELIMITER) | 3 |
iostackproject/SDGen | src/com/ibm/test/CompressionAndPerformanceMotifGeneratorTest.java | [
"public abstract class AbstractChunkCharacterization implements Serializable, Cloneable{\n\t\n\tprivate static final long serialVersionUID = 1L;\n\t/*Size of the chunk during the scan process*/\n\tprotected int size = 0; \n\t/*Amount of non unique data of this chunk across a dataset*/\n\tprotected int deduplicatedD... | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import ja... | /*
* Copyright (C) 2014 Raul Gracia-Tinedo
*
* 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 progr... | Utils.createDirectory(testPath); | 8 |
agorava/agorava-twitter | agorava-twitter-cdi/src/main/java/org/agorava/twitter/impl/TwitterGeoServiceImpl.java | [
"public abstract class TwitterBaseService extends ProviderApiService {\n\n protected static final char MULTI_VALUE_SEPARATOR = ',';\n\n public static final String API_ROOT = \"https://api.twitter.com/1.1/\";\n\n public Map<String, String> buildPagingParametersWithCount(int page, int pageSize, long sinceId,... | import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.agorava.TwitterBaseService;
import org.agorava.twitter.Twitter;
import org.agorava.twitter.TwitterGeoService;
import org.agorava.twitter.jackson.PlacesList;
import org.agorava.twitter.model.Place;
import org.agorava.twitter.model.PlacePro... | /*
* Copyright 2013 Agorava
*
* 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 wri... | public class TwitterGeoServiceImpl extends TwitterBaseService implements TwitterGeoService { | 0 |
mauriciogracia/DGuitarSoftware | DGuitar/src/dguitar/codecs/midi/MidiOutputStream.java | [
"public class GPAdaptor {\r\n private static String className = GPAdaptor.class.toString();\r\n\r\n private static Logger logger = Logger.getLogger(className);\r\n\r\n // The following definition of pulses per quarter note is for high\r\n // resolution,\r\n // supporting up to dotted 128th notes and ... | import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import javax.sound.midi.MidiEvent;
import javax.sound.midi.MidiSystem;
import javax.sound.midi.Sequence;
import javax.sound.midi.Track;
import dguitar.adaptors.guitarPro.GPAda... | /*
* Created on Mar 19, 2005
*/
package dguitar.codecs.midi;
/**
* @author Chris
*/
public class MidiOutputStream implements CodecOutputStream
{
OutputStream out;
public MidiOutputStream(OutputStream out)
{
this.out = out;
}
public void close() throws IOExce... | public int write(Object obj) throws IOException, CodecFormatException
| 1 |
boothen/Json-Eclipse-Plugin | jsonedit-outline/src/main/java/com/boothen/jsonedit/outline/JsonContentOutlinePage.java | [
"public static class JsonContext extends ParserRuleContext {\n public ValueContext value() {\n return getRuleContext(ValueContext.class,0);\n }\n public JsonContext(ParserRuleContext parent, int invokingState) {\n super(parent, invokingState);\n }\n @Override public int getRuleIndex() {... | import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.antlr.v4.runtime.tree.ParseTree;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.Position;
import org.eclipse.jface.... | /*******************************************************************************
* Copyright 2014 Boothen Technology Ltd.
*
* Licensed under the Eclipse Public License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*... | Segment segment = ParseTreeInfo.getSegment(treeNode);
| 3 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/LocalDateTime.java | [
"public final class DateTimeFormatter {\n\n //-----------------------------------------------------------------------\n /**\n * Returns the ISO date formatter that prints/parses a date without an offset,\n * such as '2011-12-03'.\n * <p>\n * This returns an immutable formatter capable of print... | import static org.threeten.bp.LocalTime.HOURS_PER_DAY;
import static org.threeten.bp.LocalTime.MICROS_PER_DAY;
import static org.threeten.bp.LocalTime.MILLIS_PER_DAY;
import static org.threeten.bp.LocalTime.MINUTES_PER_DAY;
import static org.threeten.bp.LocalTime.NANOS_PER_DAY;
import static org.threeten.bp.LocalTime.N... | *
* @param days the days to subtract, may be negative
* @return a {@code LocalDateTime} based on this date-time with the days subtracted, not null
* @throws DateTimeException if the result exceeds the supported date range
*/
public LocalDateTime minusDays(long days) {
return (days ... | if (query == TemporalQueries.localDate()) { | 6 |
aNNiMON/HotaruFX | app/src/test/java/com/annimon/hotarufx/bundles/NodesBundleTest.java | [
"public final class Context {\n\n private final Map<String, Value> variables;\n private final Map<String, Function> functions;\n private Composition composition;\n\n public Context() {\n variables = new ConcurrentHashMap<>();\n functions = new ConcurrentHashMap<>();\n }\n\n public Ma... | import com.annimon.hotarufx.lib.Context;
import com.annimon.hotarufx.lib.MapValue;
import com.annimon.hotarufx.lib.NodeValue;
import com.annimon.hotarufx.lib.NumberValue;
import com.annimon.hotarufx.lib.StringValue;
import com.annimon.hotarufx.lib.Value;
import com.annimon.hotarufx.visual.objects.CircleNode;
import jav... | package com.annimon.hotarufx.bundles;
class NodesBundleTest {
@Test
void testBundle() {
final var context = new Context();
BundleLoader.load(context, Arrays.asList(
CompositionBundle.class,
NodesBundle.class
));
assertThat(context.functions(), ... | final var value = context.functions().get("circle").execute(new MapValue(map)); | 1 |
Merck/Halyard | tools/src/main/java/com/msd/gin/halyard/tools/HalyardPreSplit.java | [
"public final class HalyardTableUtils {\n\n private static final byte[] EMPTY = new byte[0];\n private static final byte[] CF_NAME = \"e\".getBytes(StandardCharsets.UTF_8);\n private static final String MD_ALGORITHM = \"SHA1\";\n private static final Base64.Encoder ENC = Base64.getUrlEncoder().withoutPa... | import com.msd.gin.halyard.common.HalyardTableUtils;
import static com.msd.gin.halyard.tools.HalyardBulkLoad.DEFAULT_CONTEXT_PROPERTY;
import static com.msd.gin.halyard.tools.HalyardBulkLoad.OVERRIDE_CONTEXT_PROPERTY;
import com.msd.gin.halyard.tools.HalyardBulkLoad.RioFileInputFormat;
import static com.msd.gin.halyard... | /*
* Copyright 2016 Merck Sharp & Dohme Corp. a subsidiary of Merck & Co.,
* Inc., Kenilworth, NJ, USA.
*
* 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/l... | if (cmd.hasOption('g')) getConf().set(DEFAULT_CONTEXT_PROPERTY, cmd.getOptionValue('g')); | 1 |
LMAX-Exchange/angler | src/test/java/com/lmax/angler/monitoring/network/monitor/example/ExampleApplication.java | [
"public interface SocketMonitoringLifecycleListener\n{\n /**\n * Socket is available for monitoring.\n * @param inetAddress the ip address\n * @param port the port\n * @param inode the inode of the socket\n */\n void socketMonitoringStarted(final InetAddress inetAddress, final int port, fi... | import com.lmax.angler.monitoring.network.monitor.socket.SocketMonitoringLifecycleListener;
import com.lmax.angler.monitoring.network.monitor.socket.udp.UdpSocketMonitor;
import com.lmax.angler.monitoring.network.monitor.socket.udp.UdpSocketStatisticsHandler;
import com.lmax.angler.monitoring.network.monitor.system.snm... | package com.lmax.angler.monitoring.network.monitor.example;
public final class ExampleApplication implements SocketMonitoringLifecycleListener
{
private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
private final UdpSocketMonitor udpSocketMonitor = new UdpSoc... | private final SoftnetStatsMonitor softnetStatsMonitor = new SoftnetStatsMonitor(); | 6 |
princeofgiri/f-droid | F-Droid/src/org/fdroid/fdroid/AppDetails.java | [
"public static class CommaSeparatedList implements Iterable<String> {\n private String value;\n\n private CommaSeparatedList(String list) {\n value = list;\n }\n\n public static CommaSeparatedList make(List<String> list) {\n if (list == null || list.size() == 0)\n return null;\n... | import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.bluetooth.BluetoothAdapter;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
i... | holder.version = (TextView) convertView.findViewById(R.id.version);
holder.status = (TextView) convertView.findViewById(R.id.status);
holder.size = (TextView) convertView.findViewById(R.id.size);
holder.api = (TextView) convertView.findViewById(R.id.api);
... | private Installer installer; | 4 |
5GSD/AIMSICDL | AIMSICD/src/main/java/zz/aimsicd/lite/utils/RequestTask.java | [
"public final class AIMSICDDbAdapter extends SQLiteOpenHelper {\n\n public static final int DATABASE_VERSION = 1; // Is this \"pragma user_version;\" ?\n\n public static final String TAG = \"AICDL\";\n public static final String mTAG = \"DB: \";\n\n // TODO: This should be implemented as a SharedPrefere... | import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.Multipart... |
switch (mType) {
case DBE_DOWNLOAD_REQUEST:
// if `result` is null, it will evaluate to false, no need to check for null
if ("Successful".equals(result)) {
if (mDbAdapter.populateDBeImport()) {
Helpers.msgShort(mAppContext... | Fragment myFragment = lActivity.getSupportFragmentManager().findFragmentByTag(String.valueOf(DrawerMenu.ID.MAIN.ALL_CURRENT_CELL_DETAILS)); | 1 |
AndyGu/ShanBay | src/com/shanbay/words/review/experience/ExpModeActivity.java | [
"public class Model\n{\n public static <T> T create(JsonElement paramJsonElement, Class<T> paramClass)\n {\n return gson().fromJson(paramJsonElement, paramClass);\n }\n\n public static <T> List<T> createList(JsonElement paramJsonElement, Class<T> paramClass)\n {\n\t Log.e(\"createList\", \"createList=\"+pa... | import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.RelativeL... | package com.shanbay.words.review.experience;
public class ExpModeActivity extends WordsActivity
implements CompoundButton.OnCheckedChangeListener, View.OnClickListener
{
public static final int REQUEST_CODE_OPTIONS = 35;
public static final int RESULT_CODE_CONFIRM = 34;
private Button mBtnGoExP;
private Che... | private WordbookCategory mWordbookCategory; | 4 |
Slikey/EffectLib | src/main/java/de/slikey/effectlib/effect/ConeEffect.java | [
"public abstract class Effect implements Runnable {\n\n /**\n * Handles the type, the effect is played.\n *\n * @see {@link de.slikey.effectlib.EffectType}\n */\n public EffectType type = EffectType.INSTANT;\n\n /**\n * Can be used to colorize certain particles. As of 1.8, those\n *... | import de.slikey.effectlib.Effect;
import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.EffectType;
import de.slikey.effectlib.util.MathUtils;
import org.bukkit.Particle;
import de.slikey.effectlib.util.RandomUtils;
import de.slikey.effectlib.util.VectorUtils;
import org.bukkit.Location;
import org.bukk... | package de.slikey.effectlib.effect;
public class ConeEffect extends Effect {
/**
* ParticleType of spawned particle
*/
public Particle particle = Particle.FLAME;
/**
* Growing per iteration in the length (0.05)
*/
public float lengthGrow = .05f;
/**
* Radials per iterat... | type = EffectType.REPEATING; | 2 |
maxpower47/DeliciousDroid | src/com/deliciousdroid/action/IntentHelper.java | [
"public class AddBookmark extends FragmentBaseActivity implements OnBookmarkSaveListener {\n\n\tprivate AddBookmarkFragment frag;\n\tprivate Bookmark bookmark = null;\n\tprivate Bookmark oldBookmark = null;\n\tprivate Boolean update = false;\n\t\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState){\n\t\t... | import com.deliciousdroid.Constants.BookmarkViewType;
import com.deliciousdroid.providers.BookmarkContent.Bookmark;
import com.deliciousdroid.providers.BookmarkContentProvider;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import java.io.Unsuppo... | /*
* DeliciousDroid - http://code.google.com/p/DeliciousDroid/
*
* Copyright (C) 2010 Matt Schmidt
*
* DeliciousDroid 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,
* ... | public static Intent ViewBookmark(Bookmark b, BookmarkViewType type, String account, Context context) { | 6 |
limdingwen/space-cubes | src/com/github/limdingwen/SpaceCubes/SaveTask.java | [
"public class ChunkLevelEncoder {\n\tpublic static void encodeChunk(String worldName, Chunk chunk, int x, int y) throws FileNotFoundException, IOException {\n\t\tFileOutputStream chunkStream = null;\n\t\tFile file = new File(SystemNativesHelper.defaultDirectory() + \"/saves/\" + worldName + \"/c\" + x + \"|\" + y +... | import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.TimerTask;
import com.github.limdingwen.SpaceCubes.File.ChunkLevelEncoder;
import com.github.limdingwen.SpaceCubes.File.LevelDataEncoder;
import com.github.limdingwen.SpaceCubes.Rendering.RenderEngine;
import com.github.limdingwen.SpaceC... | package com.github.limdingwen.SpaceCubes;
public class SaveTask extends TimerTask {
@Override
public void run() { | Chunk chunk = RenderEngine.world.getChunkAtBlockCoords( | 3 |
kbase/kb_sdk | src/java/us/kbase/mobu/tester/ModuleTester.java | [
"public abstract class CallbackServer extends JsonServerServlet {\n //TODO NJS_SDK move to common repo\n \n // should probably go in java_common or make a common repo for shared\n // NJSW & KB_SDK code, since they're tightly coupled\n private static final long serialVersionUID = 1L;\n \n privat... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.URL;
import java.... | package us.kbase.mobu.tester;
public class ModuleTester {
private File moduleDir;
protected Map<String,Object> kbaseYmlConfig;
private Map<String, Object> moduleContext;
public ModuleTester() throws Exception {
this(null);
}
public ModuleTester(File dir) throws Exception {
... | String kbaseYml = TextUtils.readFileText(new File(moduleDir, "kbase.yml")); | 3 |
Squarespace/jersey2-guice | jersey2-guice-impl/src/test/java/com/squarespace/jersey2/guice/resource/ResourceWithNamedInjectionTest.java | [
"public static final String ANNOTATED_HELLO = \"hello (annotaded)\";",
"public static final String DEFAULT_HELLO = \"hello\";",
"public static final String NAMED_HELLO = \"hello (named)\";",
"public class JerseyGuiceUtils {\n \n private static final Logger LOG = LoggerFactory.getLogger(JerseyGuiceUtils.clas... | import static com.squarespace.jersey2.guice.resource.HelloServiceImpl.ANNOTATED_HELLO;
import static com.squarespace.jersey2.guice.resource.HelloServiceImpl.DEFAULT_HELLO;
import static com.squarespace.jersey2.guice.resource.HelloServiceImpl.NAMED_HELLO;
import static org.testng.Assert.assertEquals;
import static org.t... | /*
* Copyright 2014-2016 Squarespace, 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 a... | SERVER = HttpServerUtils.newHttpServer(HelloResource.class); | 6 |
fauu/HelixEngine | editor/src/com/github/fauu/helix/editor/ui/HEAreaPassageSettingsPanel.java | [
"public enum TilePermission {\n\n OBSTACLE(\"Obstacle\", -1),\n PASSAGE(\"Area Passage\", -1),\n RAMP(\"Ramp\", -1),\n LEVEL0(\"Level 0\", 0),\n LEVEL1(\"Level 1\", 1),\n LEVEL2(\"Level 2\", 2),\n LEVEL3(\"Level 3\", 3),\n LEVEL4(\"Level 4\", 4),\n LEVEL5(\"Level 5\", 5),\n LEVEL6(\"Level 6\", 6),\n LEVE... | import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.SelectBox;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.github.fauu.helix.TilePermission;
import com.github.fauu.helix.editor.HelixEditor;
import com.github.fauu.helix.editor.event.TilePassageAreaListState... | /*
* Copyright (C) 2014-2016 Helix Engine Developers
* (http://github.com/fauu/HelixEngine)
*
* This software is licensed under the GNU General Public License
* (version 3 or later). See the COPYING file in this distribution.
*
* You should have received a copy of the GNU Library General Public License
* along ... | HelixEditor.getInstance().getUIEventBus().register(this); | 1 |
adyliu/jafka | src/main/java/io/jafka/consumer/FetcherRunnable.java | [
"@ClientSide\n@ServerSide\npublic class FetchRequest implements Request {\n\n /**\n * message topic\n */\n public final String topic;\n\n /**\n * partition of log file\n */\n public final int partition;\n\n /**\n * ofset of topic(log file)\n */\n public final long offset;\n... | import com.github.zkclient.ZkClient;
import io.jafka.api.FetchRequest;
import io.jafka.api.MultiFetchResponse;
import io.jafka.api.OffsetRequest;
import io.jafka.cluster.Broker;
import io.jafka.cluster.Partition;
import io.jafka.common.ErrorMapping;
import io.jafka.common.annotations.ClientSide;
import io.jafka.message... | /**
* 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... | List<FetchRequest> fetches = new ArrayList<FetchRequest>(); | 0 |
saltedge/saltedge-android | saltedge-library/src/main/java/com/saltedge/sdk/connector/ConsentsConnector.java | [
"public interface FetchConsentsResult {\n\n /**\n * Callback method is invoked when Fetch Consents operation finished with success\n *\n * @param consents List of SEConsent objects\n */\n void onSuccess(List<SEConsent> consents);\n\n /**\n * Callback method is invoked when Fetch Consent... | import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import com.saltedge.sdk.interfaces.FetchConsentsResult;
import com.saltedge.sdk.model.SEConsent;
import com.saltedge.sdk.model.response.ConsentsResponse;
import com.saltedge.sdk.network.SERestClient;
import com.saltedge.sdk.utils.SEErrorTools;... | /*
Copyright © 2019 Salt Edge. https://saltedge.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | private ArrayList<SEConsent> consentsList = new ArrayList<>(); | 1 |
pnoker/mybatisGenerator | src/main/java/org/mybatis/generator/codegen/mybatis3/xmlmapper/elements/UpdateByPrimaryKeyWithoutBLOBsElementGenerator.java | [
"public class IntrospectedColumn {\n protected String actualColumnName;\n\n protected int jdbcType;\n\n protected String jdbcTypeName;\n\n protected boolean nullable;\n\n protected int length;\n\n protected int scale;\n\n protected boolean identity;\n\n protected boolean isSequenceColumn;\n\... | import java.util.Iterator;
import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.dom.OutputUtilities;
import org.mybatis.generator.api.dom.xml.Attribute;
import org.mybatis.generator.api.dom.xml.TextElement;
import org.mybatis.generator.api.dom.xml.XmlElement;
import org.mybatis.generato... | /**
* Copyright 2006-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
*
* Unle... | iter = ListUtilities.removeGeneratedAlwaysColumns(introspectedTable.getNonPrimaryKeyColumns()).iterator(); | 3 |
kkucherenkov/FxCameraApp | src/com/af/experiments/FxCameraApp/View/CameraView.java | [
"public interface CameraHelper {\n static final int DEFAULT_CAMERA_ID = 0;\n\n int getNumberOfCameras();\n\n int getCameraId();\n\n public static class CameraInfoCompat {\n public static final int CAMERA_FACING_BACK = 0;\n public static final int CAMERA_FACING_FRONT = 1;\n\n public ... | import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.hardware.Camera;
import android.util.AttributeSet;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View... | package com.af.experiments.FxCameraApp.View;
public class CameraView extends ViewGroup implements SurfaceHolder.Callback {
public interface Preview {
void setCameraHelper(CameraHelper helper);
boolean isSquareFrameSupported();
void onOpenCamera();
void onReleaseCamera();
... | private PreviewSurfaceHelper mPreviewSurfaceHelper; | 3 |
aginsun/Journey-of-Legends | Journey of Legends/aginsun/journey/client/guis/GuiStats.java | [
"public class LevelKeeper \n{\n\tprivate static HashMap<String, Integer> LevelMap = new HashMap<String, Integer>();\n\tprivate static HashMap<String, Integer> StatPointsMap = new HashMap<String, Integer>();\n\t\n\tpublic static void setLevel(EntityPlayer player, int amount)\n\t{\n\t\tLevelMap.put(player.username, a... | import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import aginsun.journey.server.api.LevelKeeper;
import aginsun.journey.server.api.QuestHandler;
import aginsun.j... | package aginsun.journey.client.guis;
public class GuiStats extends GuiScreen
{ | private StatKeeper stats; | 2 |
teivah/TIBreview | src/main/java/com/tibco/exchange/tibreview/processor/processrule/JavaProcessor.java | [
"public class TIBProcess {\n\tprivate String filePath;\n\tprivate String fullProcessName;\n\tprivate String processName;\n\tprivate String packageName;\n\tprivate List<PartnerLinkModel> partners;\n\tprivate static final String PROCESSES_PACKAGE = \"Processes\";\n\tprivate static final String PROCESS_EXTENSION = \".... | import java.util.List;
import org.apache.log4j.Logger;
import com.tibco.exchange.tibreview.common.TIBProcess;
import com.tibco.exchange.tibreview.engine.Context;
import com.tibco.exchange.tibreview.exception.ProcessorException;
import com.tibco.exchange.tibreview.model.pmd.Violation;
import com.tibco.exchange.tibreview... | package com.tibco.exchange.tibreview.processor.processrule;
public class JavaProcessor implements PRProcessable, PRConditionProcessable, PRGloballyProcessable {
private static final Logger LOGGER = Logger.getLogger(JavaProcessor.class);
private static final String BASE = "com.tibco.exchange.tibreview.processor.pr... | Class<PRJava> c = (Class<PRJava>)Class.forName(BASE + el.getValue()); | 6 |
philliphsu/ClockPlus | app/src/main/java/com/philliphsu/clock2/alarms/data/AlarmCursor.java | [
"@AutoValue\npublic abstract class Alarm extends ObjectWithId implements Parcelable {\n private static final int MAX_MINUTES_CAN_SNOOZE = 30;\n\n // =================== MUTABLE =======================\n private long snoozingUntilMillis;\n private boolean enabled;\n private final boolean[] recurringDa... | import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.WEDNESDAY;
import android.database.Cursor;
import com.philliphsu.clock2.alarms.Alarm;
import com.philliphsu.clock2.data.BaseItemCursor;
import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.FRIDAY;
import static com.philliphsu.clock2.alarms.misc.DaysOfWeek... | /*
* Copyright 2017 Phillip Hsu
*
* This file is part of ClockPlus.
*
* ClockPlus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later versio... | alarm.setRecurring(SUNDAY, isTrue(AlarmsTable.COLUMN_SUNDAY)); | 5 |
matejdro/PebbleAndroidCommons | src/main/java/com/matejdro/pebblecommons/pebble/DataReceiver.java | [
"public static final String APP_UUID = \"uuid\";",
"public static final String MSG_DATA = \"msg_data\";",
"public static final String TRANSACTION_ID = \"transaction_id\";",
"public final class PebbleKit {\n\n /**\n * The Constant NAME_MAX_LENGTH.\n */\n private static final int NAME_MAX_LENGTH =... | import static com.getpebble.android.kit.Constants.APP_UUID;
import static com.getpebble.android.kit.Constants.MSG_DATA;
import static com.getpebble.android.kit.Constants.TRANSACTION_ID;
import java.util.UUID;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import... | package com.matejdro.pebblecommons.pebble;
public class DataReceiver extends BroadcastReceiver {
public void receiveData(final Context context, final int transactionId, final String jsonPacket, Class<? extends PebbleTalkerService> talkerClass)
{
PebbleKit.sendAckToPebble(context, transactionId);
... | final int transactionId = intent.getIntExtra(TRANSACTION_ID, -1); | 2 |
lukas-krecan/JsonUnit | json-unit-spring/src/test/java/net/javacrumbs/jsonunit/spring/testit/MockMvcTest.java | [
"public enum Option {\n /**\n * Treats null nodes in actual value as absent. In other words\n * if you expect {\"test\":{\"a\":1}} this {\"test\":{\"a\":1, \"b\": null}} will pass the test.\n * When using within {@link ConfigurationWhen#then(Option, Option...)}, exact path to such nodes should be pas... | import net.javacrumbs.jsonunit.core.Option;
import net.javacrumbs.jsonunit.core.listener.Difference;
import net.javacrumbs.jsonunit.core.listener.DifferenceContext;
import net.javacrumbs.jsonunit.core.listener.DifferenceListener;
import net.javacrumbs.jsonunit.spring.testit.demo.SpringConfig;
import org.junit.jupiter.a... | /**
* Copyright 2009-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | exec("/sampleProduces").andExpect(json().isEqualTo(CORRECT_JSON)); | 5 |
JOML-CI/JOML | test/org/joml/test/Matrix4fTest.java | [
"public class Matrix3f implements Externalizable, Cloneable, Matrix3fc {\n\n private static final long serialVersionUID = 1L;\n\n public float m00, m01, m02;\n public float m10, m11, m12;\n public float m20, m21, m22;\n\n /**\n * Create a new {@link Matrix3f} and set it to {@link #identity() iden... | import org.joml.Math;
import junit.framework.TestCase;
import org.joml.Matrix3f;
import org.joml.Matrix4f;
import org.joml.Matrix4fc;
import org.joml.Vector3f;
import org.joml.Vector4f; | /*
* The MIT License
*
* Copyright (c) 2015-2021 JOML.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, m... | m.frustumPlane(Matrix4fc.PLANE_NX, left); | 2 |
idega/se.idega.idegaweb.commune.accounting | src/java/se/idega/idegaweb/commune/accounting/export/ifs/business/IFSCreateExcelFileUtil.java | [
"public class PaymentComparator implements Comparator {\n\n\tprivate Collator collator;\n\tprivate String compareString1;\n\tprivate String compareString2;\n\t/** \n\t * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)\n\t */\n\t\n\tpublic int compare(Object o1, Object o2) {\t\t\n\t\tthis.colla... | import java.io.FileOutputStream;
import java.io.IOException;
import java.rmi.RemoteException;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Locale;
import javax.ejb.FinderException;
import org.apache.poi.... | /*
* $Id: IFSCreateExcelFileUtil.java,v 1.2 2006/04/09 11:53:33 laddi Exp $ Created on Jan
* 21, 2005
*
* Copyright (C) 2005 Idega Software hf. All Rights Reserved.
*
* This software is the proprietary information of Idega hf. Use is subject to
* license terms.
*/
package se.idega.idegaweb.commune.accounting.... | ((InvoiceRecordHome) IDOLookup.getHome(InvoiceRecord.class)).findByInvoiceHeader(iHead)); | 2 |
mszubert/2048 | src/main/java/put/ci/cevo/games/serializers/StandardSymmetryExpanderSerializer.java | [
"public class StandardSymmetryExpander implements SymmetryExpander {\r\n\r\n\tprivate final int boardSize;\r\n\r\n\tpublic StandardSymmetryExpander(int boardSize) {\r\n\t\tthis.boardSize = boardSize;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic int[] getSymmetries(int location) {\r\n\t\tPreconditions.checkArgument(BoardUt... | import java.io.IOException;
import put.ci.cevo.games.encodings.ntuple.expanders.StandardSymmetryExpander;
import put.ci.cevo.util.serialization.ObjectSerializer;
import put.ci.cevo.util.serialization.SerializationException;
import put.ci.cevo.util.serialization.SerializationInput;
import put.ci.cevo.util.serialization.... | package put.ci.cevo.games.serializers;
@AutoRegistered(defaultSerializer = true)
public final class StandardSymmetryExpanderSerializer implements ObjectSerializer<StandardSymmetryExpander> {
@Override
public void save(SerializationManager manager, StandardSymmetryExpander object, SerializationOutput output)
th... | public StandardSymmetryExpander load(SerializationManager manager, SerializationInput input) throws IOException, | 2 |
boybeak/DelegateAdapter | adapter/src/main/java/com/github/boybeak/adapter/annotation/AnnotationDelegate.java | [
"public abstract class AbsDelegate<Data, AVH extends AbsViewHolder> implements DelegateImpl<Data, AVH> {\n\n private Data data;\n\n private Bundle bundle;\n\n private OnViewEventListener<Data, AVH> onViewEventListener;\n\n /**\n * @param data the source data item\n */\n public AbsDelegate (Da... | import android.os.Bundle;
import com.github.boybeak.adapter.AbsDelegate;
import com.github.boybeak.adapter.AbsViewHolder;
import com.github.boybeak.adapter.DelegateAdapter;
import com.github.boybeak.adapter.OnViewEventListener;
import static com.github.boybeak.adapter.DelegateAdapter.getLayoutFromAnnotation; | package com.github.boybeak.adapter.annotation;
/**
*
* In a subclass of this, you must provide {@link DelegateInfo} for fields with annotation
* {@link LayoutID} and {@link HolderClass}.
* In library project, you can not use {@link DelegateInfo}
* For example, a subclass as below:
* {@link DelegateInfo()}
* ... | holderClass = DelegateAdapter.getHolderClassFromAnnotation(this); | 2 |
hillfly/WifiChat | src/hillfly/wifichat/common/socket/tcp/TcpService.java | [
"public class BaseApplication extends Application {\n \n public static boolean isDebugmode = false;\n private boolean isPrintLog = true;\n private int logLevel = Log.DEBUG;\n\n /** 静音、震动默认开关 **/\n private static boolean isSlient = false;\n private static boolean isVIBRATE = true;\n\n /** 新消息... | import hillfly.wifichat.common.BaseApplication;
import hillfly.wifichat.consts.Constant;
import hillfly.wifichat.model.FileState;
import hillfly.wifichat.model.Message;
import hillfly.wifichat.model.Message.CONTENT_TYPE;
import hillfly.wifichat.util.Logger;
import java.io.BufferedOutputStream;
import java.io.DataInputS... | package hillfly.wifichat.common.socket.tcp;
public class TcpService implements Runnable {
private static final Logger logger = Logger.getLogger(TcpService.class);
private ServerSocket serviceSocket;
private boolean SCAN_FLAG = false; // 接收扫描标识
private Thread mThread; | ArrayList<FileState> receivedFileNames; | 2 |
betroy/xifan | app/src/main/java/com/troy/xifan/api/ApiFactory.java | [
"public class Constants {\n public static class FanFou {\n //Consumer key\n public static final String CONSUMER_KEY = \"f44caedd9890e6c2dff609314544245a\";\n //Consumer secret\n public static final String CONSUMER_SECRET = \"376efb84d711a7e59a9792c1ab8ba1ef\";\n //fanfou URL\n ... | import com.troy.xifan.config.Constants;
import com.troy.xifan.http.response.HttpResponseData;
import com.troy.xifan.model.response.DirectMessagesListRes;
import com.troy.xifan.model.response.DirectMessagesRes;
import com.troy.xifan.model.response.NotificationRes;
import com.troy.xifan.model.response.StatusRes;
import c... | package com.troy.xifan.api;
/**
* Created by chenlongfei on 2016/11/19.
*/
public interface ApiFactory {
//获取token
@POST
Observable<HttpResponseData<String>> getAccessToken(@Url String url);
//获取home timeline
@GET(Constants.FanFou.HOME_TIMELINE_URL) | Observable<HttpResponseData<List<StatusRes>>> getHomeTimeline( | 5 |
Medo42/Gmk-Splitter | src/com/ganggarrison/gmdec/xml/ActionXmlFormat.java | [
"public class XmlReader {\r\n\tprivate final Document domDocument;\r\n\tprivate Element currentParent = null;\r\n\tprivate Element currentChild = null;\r\n\r\n\tpublic XmlReader(File xmlFile) throws IOException {\r\n\t\ttry {\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\t\t\tf... | import java.util.ArrayList;
import java.util.List;
import org.lateralgm.file.GmFile;
import org.lateralgm.resources.GmObject;
import org.lateralgm.resources.InstantiableResource;
import org.lateralgm.resources.Resource;
import org.lateralgm.resources.ResourceReference;
import org.lateralgm.resources.library.LibAction;
... | /*
* Copyright (C) 2010 Medo <smaxein@googlemail.com>
* Copyright (C) 2008, 2009 IsmAvatar <IsmAvatar@gmail.com>
*
* This file is part of GmkSplitter.
* GmkSplitter is free software and comes with ABSOLUTELY NO WARRANTY.
* See LICENSE for details.
*/
package com.ganggarrison.gmdec.xml;
public class ActionXm... | public Action read(XmlReader reader, DeferredReferenceCreatorNotifier notifier) { | 3 |
bushidowallet/bushido-java-core | src/main/java/com/bushidowallet/core/bitcoin/script/Script.java | [
"public class Address {\n\n public static String PAY_TO_PUBLIC_KEY_HASH = \"pubkeyhash\";\n public static String PAY_TO_SCRIPT_HASH = \"scripthash\";\n\n private String type;\n //either public key hash or script hash, depends on type\n private byte[] hash;\n private int addressFlag;\n\n /**\n ... | import com.bushidowallet.core.bitcoin.Address;
import com.bushidowallet.core.bitcoin.bip32.ECKey;
import com.bushidowallet.core.bitcoin.bip32.Hash;
import com.bushidowallet.core.bitcoin.util.ByteReader;
import com.bushidowallet.core.bitcoin.util.ByteWriter;
import com.bushidowallet.core.crypto.util.ByteUtil;
import org... | package com.bushidowallet.core.bitcoin.script;
/**
* Created by Jesion on 2015-03-26.
*/
public class Script {
private List<Chunk> chunks;
public Script() {
chunks = new ArrayList<Chunk>();
}
public void removeCodeSeparators() {
List<Chunk> c = new ArrayList<Chunk>();
for... | public static Script buildScriptHashOut(Address address) throws Exception { | 0 |
andrey7mel/android-step-by-step | app/src/main/java/com/andrey7mel/stepbystep/model/ModelImpl.java | [
"public interface ApiInterface {\n\n @GET(\"/users/{user}/repos\")\n Observable<List<RepositoryDTO>> getRepositories(@Path(\"user\") String user);\n\n @GET(\"/repos/{owner}/{repo}/contributors\")\n Observable<List<ContributorDTO>> getContributors(@Path(\"owner\") String owner, @Path(\"repo\") String rep... | import com.andrey7mel.stepbystep.model.api.ApiInterface;
import com.andrey7mel.stepbystep.model.dto.BranchDTO;
import com.andrey7mel.stepbystep.model.dto.ContributorDTO;
import com.andrey7mel.stepbystep.model.dto.RepositoryDTO;
import com.andrey7mel.stepbystep.other.App;
import com.andrey7mel.stepbystep.other.Const;
im... | package com.andrey7mel.stepbystep.model;
public class ModelImpl implements Model {
private final Observable.Transformer schedulersTransformer;
@Inject
protected ApiInterface apiInterface;
@Inject
@Named(Const.UI_THREAD)
Scheduler uiThread;
@Inject
@Named(Const.IO_THREAD)
Sch... | public Observable<List<RepositoryDTO>> getRepoList(String name) { | 3 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/fragment/ListReadLaterFragment.java | [
"public abstract class BenihRecyclerAdapter<Data, Holder extends BenihItemViewHolder> extends\n RecyclerView.Adapter<Holder>\n{\n protected Context context;\n protected List<Data> data;\n protected OnItemClickListener itemClickListener;\n protected OnLongItemClickListener longItemClickListener;\n... | import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import java.util.List;
import butterknife.Bind;
impo... | /*
* Copyright (c) 2015 Zelory.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | protected GeneralArticleAdapter adapter; | 7 |
pokowaka/android-geom | geom/src/main/java/math/geom2d/curve/PolyCurve2D.java | [
"public class AffineTransform2D implements Bijection2D, GeometricObject2D,\r\n Cloneable {\r\n\r\n // coefficients for x coordinate.\r\n protected double m00, m01, m02;\r\n\r\n // coefficients for y coordinate.\r\n protected double m10, m11, m12;\r\n\r\n // ====================================... | import math.geom2d.Box2D;
import math.geom2d.Point2D;
import math.geom2d.Shape2D;
import math.geom2d.Vector2D;
import math.geom2d.polygon.Polyline2D;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import java.util.ArrayList;
import java.util.Collection;
import mat... | @Override
public PolyCurve2D<? extends ContinuousCurve2D> reverse() {
// create array for storing reversed curves
int n = curves.size();
ContinuousCurve2D[] curves2 = new ContinuousCurve2D[n];
// reverse each curve
for (int i = 0; i < n; i++)
curves2[... | if (start.distance(current) > Shape2D.ACCURACY)
| 3 |
chukanov/mnp | src/com/eyeline/mnp/example/SpeedTest.java | [
"public class Builder {\n private static final Logger log = Logger.getLogger(Builder.class);\n\n\n private List<MasksParser> masksParsers = new ArrayList<>();\n private List<MnpParser> mnpParsers = new ArrayList<>();\n\n private Filter.Chain titleFilter = new Filter.Chain();\n private Filter.Chain re... | import com.eyeline.mnp.Builder;
import com.eyeline.mnp.Mno;
import com.eyeline.mnp.Storage;
import com.eyeline.mnp.parser.CustomMasksParser;
import com.eyeline.mnp.parser.RossvyazMasksParser;
import com.eyeline.mnp.parser.ZniisMnpParser;
import java.io.IOException;
import java.nio.file.Paths; | package com.eyeline.mnp.example;
public class SpeedTest {
public static void main(String[] args) throws Exception {
Storage storage = Builder.
builder().
add(new RossvyazMasksParser(Paths.get("config/rossvyaz/Kody_DEF-9kh.csv"))). | add(new CustomMasksParser(Paths.get("config/mnos.xml"))). | 3 |
FuckBoilerplate/base_app_android | app/src/main/java/app/presentation/sections/user_demo/search/SearchUserPresenter.java | [
"public interface UIUtils {\n String getLang();\n String getString(@StringRes int idResource);\n File getFilesDir();\n}",
"public class WireframeRepository extends Repository {\n\n @Inject public WireframeRepository(RestApi restApi, RxProviders rxProviders, UIUtils uiUtils) {\n super(restApi, r... | import javax.inject.Inject;
import app.data.foundation.UIUtils;
import app.data.sections.WireframeRepository;
import app.data.sections.user_demo.UserRepository;
import app.domain.user_demo.User;
import app.presentation.foundation.PresenterFragment;
import rx.Observable; | package app.presentation.sections.user_demo.search;
/**
* Created by victor on 08/04/16.
*/
public class SearchUserPresenter extends PresenterFragment {
private final UserRepository userRepository;
| @Inject public SearchUserPresenter(WireframeRepository wireframeRepository, UserRepository userRepository, UIUtils uiUtils) { | 0 |
threerings/game-gardens | toybox/src/main/java/com/threerings/toybox/client/ToyBoxDirector.java | [
"public class LobbyConfig extends PlaceConfig\n{\n /**\n * A default constructor used when unserializing.\n */\n public LobbyConfig ()\n {\n }\n\n /**\n * Creates the config for a new lobby that will match-make games with\n * the specified configuration.\n */\n public LobbyConf... | import java.io.File;
import java.security.MessageDigest;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.samskivert.util.StringUtil;
impor... | //
// ToyBox library - framework for matchmaking networked games
// Copyright (C) 2005-2012 Three Rings Design, Inc., All Rights Reserved
// http://github.com/threerings/game-gardens
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License... | log.info("Configured game class loader", "game", ident, "loader", _gameLoader); | 5 |
paspiz85/nanobot | src/main/java/it/paspiz85/nanobot/platform/AbstractPlatform.java | [
"public class BotConfigurationException extends BotException {\n\n private static final long serialVersionUID = 1L;\n\n public BotConfigurationException(final String msg) {\n super(msg);\n }\n\n public BotConfigurationException(final String msg, final Throwable t) {\n super(msg, t);\n }... | import it.paspiz85.nanobot.exception.BotConfigurationException;
import it.paspiz85.nanobot.util.Area;
import it.paspiz85.nanobot.util.Pixel;
import it.paspiz85.nanobot.util.Point;
import it.paspiz85.nanobot.util.Size;
import it.paspiz85.nanobot.util.Utils;
import java.awt.Color;
import java.awt.image.BufferedImage;
imp... | package it.paspiz85.nanobot.platform;
/**
* Abstract implementation of {@link Platform}.
*
* @author paspiz85
*
*/
public abstract class AbstractPlatform implements Platform {
private static final Area FULLSCREEN = Area.bySize(new Point(0, 0), GAME_SIZE);
private static final String IMG_FOLDER = "img... | p = new Point(p.x() - 1 + Utils.RANDOM.nextInt(3), p.y() - 1 + Utils.RANDOM.nextInt(3)); | 5 |
cettia/asity | example-vertx2/src/main/java/io/cettia/asity/example/vertx2/EchoServerVerticle.java | [
"@FunctionalInterface\npublic interface Action<T> {\n\n /**\n * Some action is taken.\n */\n void on(T object);\n\n}",
"public class AsityRequestHandler implements Handler<HttpServerRequest> {\n\n private Actions<ServerHttpExchange> httpActions = new ConcurrentActions<>();\n\n @Override\n public void han... | import io.cettia.asity.action.Action;
import io.cettia.asity.bridge.vertx2.AsityRequestHandler;
import io.cettia.asity.bridge.vertx2.AsityWebSocketHandler;
import io.cettia.asity.example.echo.HttpEchoServer;
import io.cettia.asity.example.echo.WebSocketEchoServer;
import io.cettia.asity.http.ServerHttpExchange;
import ... | /*
* Copyright 2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | Action<ServerHttpExchange> httpAction = new HttpEchoServer(); | 3 |
alabeduarte/mypodcasts-android | app/src/test/java/com/mypodcasts/episodes/EpisodeFeedsActivityTest.java | [
"public class UserFeedsRepository {\n\n private final HttpClient httpClient;\n\n @Inject\n public UserFeedsRepository(HttpClient httpClient) {\n this.httpClient = httpClient;\n }\n\n public List<Feed> getFeeds() {\n return httpClient.getApi().getUserFeeds();\n }\n\n public Feed getFeed(String id) {\n ... | import android.app.ProgressDialog;
import android.content.Intent;
import android.widget.ListView;
import android.widget.TextView;
import com.android.volley.toolbox.NetworkImageView;
import com.google.inject.AbstractModule;
import com.mypodcasts.BuildConfig;
import com.mypodcasts.R;
import com.mypodcasts.repositories.Us... | package com.mypodcasts.episodes;
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class)
public class EpisodeFeedsActivityTest {
EpisodeFeedsActivity activity;
UserLatestEpisodesRepository userLatestEpisodesRepositoryMock = mock(UserLatestEpisodesRepository.class);
UserFeedsRepository... | List<Episode> episodes = asList(anEpisode()); | 4 |
MHAVLOVICK/Sketchy | src/main/java/com/sketchy/plotter/impl/XYPlotterController.java | [
"public enum SketchyContext {\n\tINSTANCE;\n\t\n\tprivate static NumberFormat nf = NumberFormat.getInstance();\n\n\tpublic static final Map<String, String> PEN_SIZES = new LinkedHashMap<String, String>();\n\tstatic{\n\t\tnf.setMinimumIntegerDigits(1);\n\t\tnf.setMinimumFractionDigits(1);\n\t\t\n\t\tfor (double penS... | import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.List;
import com.sketchy.SketchyContext;
import com.sketchy.plotter.PlotterController;
import com.sketchy.plotter.PlotterControllerProperties;
import com.sketchy.utils.Range;
import com.sketchy.utils.RangeHook;
import com.sketchy.utils.RangeSet; | /*
Sketchy
Copyright (C) 2015 Matthew Havlovick
http://www.quickdrawbot.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your op... | SketchyContext.hardwareController.penUp(); | 0 |
jenkinsci/plugin-compat-tester | plugins-compat-tester/src/main/java/org/jenkins/tools/test/hook/MultiParentCompileHook.java | [
"public static String getMavenModule(String plugin, File pluginPath, MavenRunner runner, MavenRunner.Config mavenConfig) throws PomExecutionException, IOException {\n String absolutePath = pluginPath.getAbsolutePath();\n if (absolutePath.endsWith(plugin)) {\n return plugin;\n }\n String module = ... | import static org.jenkins.tools.test.PluginCompatTester.getMavenModule;
import static org.jenkins.tools.test.model.hook.PluginCompatTesterHooks.getHooksFromStage;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.... | package org.jenkins.tools.test.hook;
public class MultiParentCompileHook extends PluginCompatTesterHookBeforeCompile {
protected MavenRunner runner;
protected MavenRunner.Config mavenConfig;
public static final String ESLINTRC = ".eslintrc";
public MultiParentCompileHook() {
System.out.p... | runner = new ExternalMavenRunner(config.getExternalMaven()); | 3 |
zhenglu1989/web-sso | ki4so-web/src/main/java/com/github/ebnew/ki4so/web/action/KnigtDefaultLoginResultToView.java | [
"public class StringUtils {\r\n\t\r\n\t/**\r\n\t * 判断字符串是否为空。\r\n\t * @param str 源字符串。\r\n\t * @return\r\n\t */\r\n\tpublic static boolean isEmpty(String str){\r\n\t\treturn str == null || str.length()==0;\r\n\t}\r\n\r\n}\r",
"public interface KnightAuthentication {\n\n public Map<String,Object> getAttrbutes()... | import com.github.ebnew.ki4so.common.utils.StringUtils;
import com.github.ebnew.ki4so.core.authentication.KnightAuthentication;
import com.github.ebnew.ki4so.core.authentication.KnightAuthenticationPostHandler;
import com.github.ebnew.ki4so.core.authentication.handlers.AuthenticationHandler;
import com.github.ebnew.ki4... | package com.github.ebnew.ki4so.web.action;
/**
* 默认的实现类
* @author zhenglu
* @since 15/4/30
*/
public class KnigtDefaultLoginResultToView implements KnightLoginResultToView{
@Override | public ModelAndView loginResultToView(ModelAndView mav, LoginResult result, HttpServletRequest request, HttpServletResponse response) { | 5 |
cereda/nightingale | application/src/main/java/com/github/cereda/nightingale/utils/DisplayUtils.java | [
"public class ConfigurationController {\n\n // the controller itself, since we have a singleton;\n // this is the reference instance, instantiated once\n private static final ConfigurationController instance =\n new ConfigurationController();\n \n // the configuration settings are stored i... | import com.github.cereda.nightingale.controller.ConfigurationController;
import com.github.cereda.nightingale.controller.LanguageController;
import com.github.cereda.nightingale.model.NightingaleException;
import com.github.cereda.nightingale.model.Conditional;
import com.github.cereda.nightingale.model.Messages;
impor... | /**
* Nightingale
* Copyright (c) 2014, Paulo Roberto Massa Cereda
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above... | public static void printException(NightingaleException exception) { | 2 |
XiaoMi/misound | src/com/xiaomi/mitv/soundbarapp/player/PlayerFragment.java | [
"public class MainActivity2 extends FragmentActivity implements PanelFragment.PanelListener, PlayerFragment.OnPlayerStateListener{\n private static final String PANEL_TAG = \"panel\";\n private static final String ENTRY_WITH_PLAYER_TAG = \"entry_player\";\n private static final String ENTRY_TAG = \"entry\"... | import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.content.*;
import android.graphics.Bitmap;
import android.os.*;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import an... | }
}
@Override
public void onResume() {
mPaused = false;
super.onResume();
IntentFilter f = new IntentFilter();
f.addAction(PlayerService.META_CHANGED);
f.addAction(PlayerService.QUEUE_CHANGED);
f.addAction(PlayerService.PLAYSTATE_CHANGED);
get... | A2dpDlg dlg = new A2dpDlg(context, new A2dpProfile(context)); | 2 |
tsy12321/LeanoteAndroid | app/src/main/java/com/tsy/leanote/greendao/DaoSession.java | [
"@Entity\npublic class NoteFile {\n @Id\n private Long id;\n\n private String noteid;\n private String fileId;\n private String localFileId;\n private String type;\n private String title;\n private boolean hasBody;\n private boolean isAttach;\n @Generated(hash = 2026444157)\n public... | import java.util.Map;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;
import com.tsy.leanote.feature.note.be... | package com.tsy.leanote.greendao;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
/**
* {@inheritDoc}
*
* @see org.greenrobot.greendao.AbstractDaoSession
*/
public class DaoSession extends AbstractDaoSession {
private final DaoConfig noteFileDaoConfig;
private final DaoConfig notebookDaoConfig;
... | registerDao(UserInfo.class, userInfoDao); | 3 |
chanedi/QuickProject | QuickProject-Generator/src/main/java/chanedi/generator/file/sqlparser/CreateTableListenerImpl.java | [
"public final class GlobalConfig {\n\n @Getter\n private static GlobalConfig instance = new GlobalConfig();\n private ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver();\n @Setter@Getter\n private String outProjectPath = \"D:/gen\";\n @Setter\n private String inputSqlPath... | import chanedi.generator.file.GlobalConfig;
import chanedi.generator.file.PropertyTypeContext;
import chanedi.generator.model.Bean;
import chanedi.generator.model.Property;
import chanedi.generator.file.sqlparser.gen.CreateTableBaseListener;
import chanedi.generator.file.sqlparser.gen.CreateTableParser;
import chanedi.... | package chanedi.generator.file.sqlparser;
/**
* @author Chanedi
*/
@NotThreadSafe
public class CreateTableListenerImpl extends CreateTableBaseListener {
@Getter
private Map<String, Bean> tableMap = new HashMap<String, Bean>(); // key 为 tableName
private GlobalConfig globalConfig;
private Bean curr... | Property column = new Property(); | 3 |
basgren/railways | test/net/bitpot/railways/parser/RailsRoutesParserTest.java | [
"public class RailsEngine {\n\n private final String myEngineClassName;\n private final String myRootPath;\n private final String myNamespace;\n\n public RailsEngine(String engineClassName, String rootPath, String namespace) {\n myEngineClassName = engineClassName;\n myRootPath = rootPath;... | import net.bitpot.railways.models.RailsEngine;
import net.bitpot.railways.models.RequestMethods;
import net.bitpot.railways.models.Route;
import net.bitpot.railways.models.RouteList;
import net.bitpot.railways.models.routes.RedirectRoute;
import net.bitpot.railways.models.routes.SimpleRoute;
import net.bitpot.railways.... | package net.bitpot.railways.parser;
/**
* Tests for RailsRoutesParser.
*/
public class RailsRoutesParserTest
{
private RailsRoutesParser parser = null;
@Before
public void setUp() {
parser = new RailsRoutesParser();
}
@Test
public void testParse() throws Exception
{
... | List<RailsEngine> enginesList = parser.getMountedEngines(); | 0 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestsShare.java | [
"public abstract class BoxCollaborationItem extends BoxItem {\n\n private static final long serialVersionUID = 4876182952114609430L;\n\n public static final String FIELD_HAS_COLLABORATIONS = \"has_collaborations\";\n public static final String FIELD_ALLOWED_INVITEE_ROLES = \"allowed_invitee_roles\";\n p... | import com.box.androidsdk.content.BoxConstants;
import com.box.androidsdk.content.BoxFutureTask;
import com.box.androidsdk.content.models.BoxCollaborationItem;
import com.box.androidsdk.content.models.BoxIteratorCollaborations;
import com.box.androidsdk.content.models.BoxSession;
import com.box.androidsdk.content.model... | super.handleUpdateCache(response);
}
}
/**
* Request for adding a collaboration
*/
public static class AddCollaboration extends BoxRequest<BoxCollaboration, AddCollaboration> {
private static final long serialVersionUID = 8123965031279971574L;
public static f... | if (SdkUtils.isBlank(mCollaborationTargetId) || SdkUtils.isBlank(target.getType())){ | 6 |
DarkLBP/Krothium-Launcher | src/kml/game/version/Versions.java | [
"public class Console {\n private final DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n private boolean enabled = true;\n private PrintWriter writer;\n private final File log;\n\n public Console() {\n File[] logFiles = Kernel.APPLICATION_LOGS.listFiles();\n if (... | import kml.Console;
import kml.Kernel;
import kml.utils.Utils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.util.*; | package kml.game.version;
/**
* @author DarkLBP
* website https://krothium.com
*/
public class Versions {
private final Set<VersionMeta> versions = new LinkedHashSet<>();
private final Collection<Version> version_cache = new HashSet<>();
private final Console console;
private final Kernel... | String response = Utils.readURL(versionManifest); | 2 |
wesabe/grendel | src/main/java/com/wesabe/grendel/entities/Document.java | [
"public class CryptographicException extends Exception {\n\tprivate static final long serialVersionUID = 7018291212808057570L;\n\t\n\tpublic CryptographicException(String message) {\n\t\tsuper(message);\n\t}\n\t\n\tpublic CryptographicException(Throwable cause) {\n\t\tsuper(cause);\n\t}\n\t\n\tpublic CryptographicE... | import static com.google.common.base.Objects.*;
import java.io.Serializable;
import java.security.SecureRandom;
import java.util.Set;
import javax.persistence.*;
import javax.ws.rs.core.MediaType;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import com.google.... | package com.wesabe.grendel.entities;
/**
* A document with an abritrary body, stored as an encrypted+signed OpenPGP
* message.
*
* @author coda
*/
@Entity
@Table(name="documents")
@IdClass(DocumentPK.class)
@NamedQueries({
@NamedQuery(
name="com.wesabe.grendel.entities.Document.ByOwnerAndName",
query="... | final MessageReader reader = new MessageReader(owner.getKeySet(), unlockedKeySet); | 2 |
lifedemons/photoviewer | app/src/main/java/com/photoviewer/presentation/presenter/PhotoDetailsPresenter.java | [
"@Accessors(prefix = \"m\")\npublic class Photo {\n\n @Getter\n @Setter\n private int mId;\n\n @Getter\n @Setter\n private String mTitle;\n\n @Getter\n @Setter\n private String mUrl;\n\n @Getter\n @Setter\n private String mThumbnailUrl;\n}",
"@Accessors(prefix = \"m\") public c... | import android.support.annotation.NonNull;
import com.photoviewer.domain.Photo;
import com.photoviewer.domain.usecases.GetPhotoDetails;
import com.photoviewer.domain.usecases.SimpleSubscriber;
import com.photoviewer.presentation.mapper.photo.PhotoToPhotoModel;
import com.photoviewer.presentation.model.PhotoModel;
impor... | package com.photoviewer.presentation.presenter;
/**
* {@link Presenter} that controls communication between views and models of the presentation
* layer.
*/
public class PhotoDetailsPresenter extends SimplePresenter {
private final GetPhotoDetails mGetPhotoDetailsUseCase;
private final PhotoToPhotoModel ... | private PhotoDetailsView mViewDetailsView; | 5 |
pearson-enabling-technologies/elasticsearch-approx-plugin | src/main/java/com/pearson/entech/elasticsearch/search/facet/approx/termlist/InternalStringTermListFacet.java | [
"public static BytesRefHash deserialize(final StreamInput in) throws IOException {\n final BytesRefHash output = new BytesRefHash();\n final int entries = in.readVInt();\n byte[] scratch = null;\n for(int i = 0; i < entries; i++) {\n final int length = in.readVInt();\n // Reuse previous by... | import static com.pearson.entech.elasticsearch.plugin.approx.BytesRefUtils.deserialize;
import static com.pearson.entech.elasticsearch.plugin.approx.BytesRefUtils.merge;
import static com.pearson.entech.elasticsearch.plugin.approx.BytesRefUtils.process;
import static com.pearson.entech.elasticsearch.plugin.approx.Bytes... | package com.pearson.entech.elasticsearch.search.facet.approx.termlist;
public class InternalStringTermListFacet extends InternalTermListFacet {
private static final BytesReference STREAM_TYPE = new HashedBytesArray(Strings.toUTF8Bytes("tTermList"));
private Constants.FIELD_DATA_TYPE _dataType = Const... | _bytesRefs = deserialize(in); | 0 |
teocci/YouTube-In-Background | app/src/main/java/com/teocci/ytinbg/ui/fragments/FavoritesFragment.java | [
"public class BackgroundExoAudioService extends Service implements PlaybackServiceCallback\n{\n\n private MediaBrowserServiceCompat a;\n private static final String TAG = LogHelper.makeLogTag(BackgroundExoAudioService.class);\n\n // Delay stopSelf by using a handler.\n private static final int STOP_DELA... | import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.TextView;
import android.widget.Toast;
import com.teocci.ytinbg.BackgroundExoAudioService;
import com.teocci.ytin... | package com.teocci.ytinbg.ui.fragments;
/**
* Created by teocci.
*
* @author teocci@yandex.com on 2017-Mar-21
*/
public class FavoritesFragment extends RecyclerFragment
{
private static final String TAG = FavoritesFragment.class.getSimpleName();
private List<YouTubeVideo> favoriteVideos;
public ... | return new DividerDecoration(getActivity()); | 4 |
pnoker/mybatisGenerator | src/main/java/org/mybatis/generator/codegen/mybatis3/xmlmapper/elements/SimpleSelectAllElementGenerator.java | [
"public class IntrospectedColumn {\n protected String actualColumnName;\n\n protected int jdbcType;\n\n protected String jdbcTypeName;\n\n protected boolean nullable;\n\n protected int length;\n\n protected int scale;\n\n protected boolean identity;\n\n protected boolean isSequenceColumn;\n\... | import java.util.Iterator;
import org.mybatis.generator.api.IntrospectedColumn;
import org.mybatis.generator.api.dom.xml.Attribute;
import org.mybatis.generator.api.dom.xml.TextElement;
import org.mybatis.generator.api.dom.xml.XmlElement;
import org.mybatis.generator.codegen.mybatis3.MyBatis3FormattingUtilities;
import... | /**
* Copyright 2006-2016 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
*
* Unle... | sb.append(MyBatis3FormattingUtilities.getSelectListPhrase(iter | 3 |
huyongli/TigerVideo | TigerVideo/src/main/java/cn/ittiger/video/activity/MainActivity.java | [
"public final class PlayerManager implements IPlayer.PlayCallback {\n private static final String TAG = \"PlayerManager\";\n private static volatile PlayerManager sPlayerManager;\n private AbsSimplePlayer mPlayer;\n private PlayStateObservable mPlayStateObservable;\n private String mVideoUrl;\n pr... | import com.readystatesoftware.systembartint.SystemBarTintManager;
import android.annotation.TargetApi;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTran... | package cn.ittiger.video.activity;
public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener {
@BindView(R.id.toolbar)
Toolbar mToolbar;
@BindView(R.id.drawer_layout)
DrawerLayout mDrawerLayout;
@BindView(R.id.nav_view)
NavigationView mNa... | BaseFragment fragment = FragmentFactory.createMainFragment(DataType.NET_EASY); | 2 |
lvonasek/Open4speed | src/com/lvonasek/o4s/game/GameActivity.java | [
"public class HWKeys {\n\n /**\n * Remap Android key codes into GLUT key codes. This method is used for game pads and USB keys.\n * @param code is received code from controller\n * @return code for GLUT\n */\n public static int mapKeyCode(int code) {\n switch (code) {\n case ... | import android.content.Intent;
import android.content.res.AssetFileDescriptor;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.view.KeyEvent;
import android.view.V... | package com.lvonasek.o4s.game;
/**
* Runnable class - it sets environment and run everything needed. It also manages interruptions of
* sounds and game loop(e.g.during incoming call)
* @author Lubos Vonasek
*/
public class GameActivity extends FragmentActivity {
//various instances
public TextView ... | public static BigText place = null; | 3 |
BeYkeRYkt/LightAPI | bukkit-example/src/main/java/ru/beykerykt/minecraft/lightapi/bukkit/example/DebugListener.java | [
"public final class LightAPI {\n\n private static volatile LightAPI singleton;\n private final IPlatformImpl mInternal;\n\n private LightAPI(IPlatformImpl internal) {\n if (singleton != null) {\n throw new RuntimeException(\"Use get() method to get the single instance of this class.\");\n... | import java.util.HashMap;
import java.util.Map;
import ru.beykerykt.minecraft.lightapi.common.LightAPI;
import ru.beykerykt.minecraft.lightapi.common.api.ResultCode;
import ru.beykerykt.minecraft.lightapi.common.api.engine.EditPolicy;
import ru.beykerykt.minecraft.lightapi.common.api.engine.LightFlag;
import ru.beykery... | /*
* The MIT License (MIT)
*
* Copyright 2021 Vladimir Mikhailov <beykerykt@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitati... | private final LightAPI mAPI; | 0 |
m4rciosouza/ponto-inteligente-api | src/main/java/com/kazale/pontointeligente/api/controllers/CadastroPFController.java | [
"public class CadastroPFDto {\n\t\n\tprivate Long id;\n\tprivate String nome;\n\tprivate String email;\n\tprivate String senha;\n\tprivate String cpf;\n\tprivate Optional<String> valorHora = Optional.empty();\n\tprivate Optional<String> qtdHorasTrabalhoDia = Optional.empty();\n\tprivate Optional<String> qtdHorasAlm... | import java.math.BigDecimal;
import java.security.NoSuchAlgorithmException;
import java.util.Optional;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springf... | package com.kazale.pontointeligente.api.controllers;
@RestController
@RequestMapping("/api/cadastrar-pf")
@CrossOrigin(origins = "*")
public class CadastroPFController {
private static final Logger log = LoggerFactory.getLogger(CadastroPFController.class);
@Autowired
private EmpresaService empresaService;
... | public ResponseEntity<Response<CadastroPFDto>> cadastrar(@Valid @RequestBody CadastroPFDto cadastroPFDto, | 0 |
winzillion/FluxJava | demo-eventbus/src/sharedTest/java/com/example/fluxjava/eventbus/StubAppConfig.java | [
"public class Bus implements IFluxBus {\n\n private EventBus mBus = EventBus.getDefault();\n\n @Override\n public void register(final Object inSubscriber) {\n this.mBus.register(inSubscriber);\n }\n\n @Override\n public void unregister(final Object inSubscriber) {\n this.mBus.unregis... | import android.app.Application;
import com.example.fluxjava.eventbus.domain.Bus;
import com.example.fluxjava.eventbus.domain.StubActionHelper;
import com.example.fluxjava.eventbus.domain.stores.StubTodoStore;
import com.example.fluxjava.eventbus.domain.stores.StubUserStore;
import io.wzcodes.fluxjava.FluxContext;
impor... | /*
* Copyright (C) 2016 Bugs will find a way (https://wznote.blogspot.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | FluxContext.getBuilder() | 4 |
jjhesk/KickAssSlidingMenu | slideOutMenu/menux/src/main/java/mxh/kickassmenu/layoutdesigns/app/SlidingAppCompactActivity.java | [
"public class ControlableFrame extends FrameLayout {\n public ControlableFrame(Context context) {\n super(context);\n }\n\n protected boolean enable_block = false;\n\n public ControlableFrame(Context context, AttributeSet attrs) {\n super(context, attrs);\n }\n\n public ControlableFr... | import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.support.annotation.IdRes;
import android.support.annotation.LayoutRes;
import android.support.... |
/* public void setRightSideFragment(F fragment, Bundle savedstate) {
currentFragmentNow = fragment;
// set the Behind View
setBehindContentView(R.layout.menu_frame);
if (savedstate == null) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
/... | if (rightMenuFragment instanceof materialMenuConstructorFragmentBase) { | 5 |
slide-lig/jlcm | src/test/java/fr/liglab/jlcm/tests/PlcmTest.java | [
"public class PLCM {\n\tfinal List<PLCMThread> threads;\n\tprivate ProgressWatcherThread progressWatch;\n\tprotected static long chrono;\n\n\tprivate final PatternsCollector collector;\n\n\tprivate final long[] globalCounters;\n\t\n\tpublic PLCM(PatternsCollector patternsCollector, int nbThreads) {\n\t\tthis(patter... | import static org.junit.Assert.*;
import java.util.Iterator;
import org.junit.Test;
import fr.liglab.jlcm.PLCM;
import fr.liglab.jlcm.internals.ExplorationStep;
import fr.liglab.jlcm.internals.TransactionReader;
import fr.liglab.jlcm.io.AllFISConverter;
import fr.liglab.jlcm.io.FileReader;
import fr.liglab.jlcm.io.Patt... | package fr.liglab.jlcm.tests;
public class PlcmTest {
private void minerInvocation(int minsup, String path, PatternsCollector collector) {
ExplorationStep init = new ExplorationStep(minsup, path);
PLCM algo = new PLCM(collector, 1);
algo.lcm(init);
collector.close();
}
@Test
public void testFiles()... | private static class StupidIterable implements Iterable<TransactionReader> { | 2 |
googleapis/java-pubsublite-spark | src/test/java/com/google/cloud/pubsublite/spark/PslMicroBatchReaderTest.java | [
"public static PslSourceOffset createPslSourceOffset(long... offsets) {\n Map<Partition, Offset> map = new HashMap<>();\n int idx = 0;\n for (long offset : offsets) {\n map.put(Partition.of(idx++), Offset.of(offset));\n }\n return PslSourceOffset.builder().partitionOffsetMap(map).build();\n}",
"public sta... | import com.google.cloud.pubsublite.spark.internal.PerTopicHeadOffsetReader;
import com.google.common.collect.ImmutableMap;
import java.util.Optional;
import org.junit.Test;
import static com.google.cloud.pubsublite.spark.TestingUtils.createPslSourceOffset;
import static com.google.cloud.pubsublite.spark.TestingUtils.cr... | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | private final PerTopicHeadOffsetReader headOffsetReader = mock(PerTopicHeadOffsetReader.class); | 4 |
jvdb/derric | src/org/derric_lang/validator/interpreter/Interpreter.java | [
"public class ParseResult {\n\t\n\tprivate boolean _result;\n\tprivate long _lastLocation;\n\tprivate long _lastRead;\n\tprivate String _symbol;\n\tprivate String _sequence;\n\n\tpublic boolean isSuccess() {\n\t\treturn _result;\n\t}\n\n\tpublic long getLastLocation() {\n\t\treturn _lastLocation;\n\t}\n\t\n\tpublic... | import java.io.IOException;
import java.net.URI;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.derric_lang.validator.ParseResult;
import org.derric_lang.validator.Validator;
import org.derric_lang.validator.ValidatorInputStream;
import org.derric_lang.validator.ValidatorInputStreamFa... | package org.derric_lang.validator.interpreter;
public class Interpreter extends Validator {
private final String _format;
private final List<Symbol> _sequence;
private final List<Structure> _structures;
private final Map<String, Type> _globals;
private Sentence _current;
private URI _inputFile;
public In... | public ValidatorInputStream getInput() { | 2 |
Bleuzen/Blizcord | src/com/github/bleuzen/blizcord/bot/AudioPlayerThread.java | [
"public class Config {\n\n\tpublic static final String CONTROL_CHANNEL = \"CONTROL_CHANNEL\";\n\tpublic static final String VOICE_CHANNEL = \"VOICE_CHANNEL\";\n\tpublic static final String BOT_TOKEN = \"BOT_TOKEN\";\n\tpublic static final String COMMAND_PREFIX = \"COMMAND_PREFIX\";\n\tpublic static final String DIS... | import java.io.File;
import java.util.Arrays;
import java.util.List;
import com.github.bleuzen.blizcord.Config;
import com.github.bleuzen.blizcord.Log;
import com.github.bleuzen.blizcord.Utils;
import com.github.bleuzen.blizcord.Values;
import com.github.bleuzen.blizcord.a;
import com.github.bleuzen.blizcord.gu... | if(!quiet) {
channel.sendMessage("Added playlist to queue: ``" + playlist.getName() + "``").queue();
}
}
}
}
@Override
public void noMatches() {
if(trackUrl.startsWith(Values.SEARCH_PREFIX_YOUTUBE)) {
channel.sendMessage("No search results for: ``" + trackUrl... | GUI_Main.settglbtnPauseSelected(p);
| 5 |
esmasui/deb-kitkat-storage-access-framework | KitKatStorageProject/KitKatStorage/src/main/java/com/uphyca/kitkat/storage/internal/impl/LiveSdkDocumentsColumnMapper.java | [
"public interface DocumentsColumnMapper<T> {\n\n /**\n * @see DocumentsContract.Document#COLUMN_DOCUMENT_ID\n * <p>\n * Type: STRING\n * @param source\n */\n String mapDocumentId(T source);\n\n /**\n * @see DocumentsContract.Document#COLUMN_MIME_TYPE\n * <p>\n ... | import com.uphyca.kitkat.storage.skydrive.SkyDrivePhoto;
import com.uphyca.kitkat.storage.skydrive.SkyDriveVideo;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.TimeZone;
import android.provider.DocumentsContract;
import com.uphyca.kitkat.storage.intern... | /*
* Copyright (C) 2013 uPhyca Inc. http://www.uphyca.com/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | public void visit(SkyDriveFile file) { | 4 |
trigor74/travelers-diary | app/src/main/java/com/travelersdiary/activities/GalleryAlbumActivity.java | [
"public final class Constants {\n // firebase\n public static final String FIREBASE_URL = BuildConfig.FIREBASE_ROOT_URL;\n public static final String FIREBASE_USERS = \"users\";\n public static final String FIREBASE_USER_EMAIL = \"email\";\n public static final String FIREBASE_USER_NAME = \"name\";\n... | import android.content.Intent;
import android.database.Cursor;
import android.os.Build;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widge... | package com.travelersdiary.activities;
public class GalleryAlbumActivity extends AppCompatActivity {
@Bind(R.id.gallery_albums_activity_toolbar)
Toolbar mToolbar;
@Bind(R.id.albums_list)
RecyclerView mRecyclerView;
@Bind(R.id.fragment_no_items_container)
LinearLayout mNoItemsContainer;
... | Utils.setStatusBarColor(this, ContextCompat.getColor(this, R.color.colorPrimaryDark)); | 1 |
lacuna/bifurcan | src/io/lacuna/bifurcan/durable/codecs/TempStream.java | [
"public class Util {\n public final static Charset UTF_16 = Charset.forName(\"utf-16\");\n public static final Charset UTF_8 = Charset.forName(\"utf-8\");\n public static final Charset ASCII = Charset.forName(\"ascii\");\n\n public static <V, E> Iterator<IList<V>> partitionBy(\n Iterator<V> it,\n int ... | import io.lacuna.bifurcan.*;
import io.lacuna.bifurcan.durable.Util;
import io.lacuna.bifurcan.durable.allocator.IBuffer;
import io.lacuna.bifurcan.durable.io.DurableBuffer;
import io.lacuna.bifurcan.utils.Iterators;
import java.util.Iterator;
import java.util.NoSuchElementException;
import static io.lacuna.bifurcan.du... | package io.lacuna.bifurcan.durable.codecs;
/**
* A means of spilling {@link io.lacuna.bifurcan.durable.ChunkSort} data to disk. This data has a much more narrowly
* defined lifecyle, since it will only be decoded long enough to be written elsewhere. As such, we can save ourselves
* the overhead of fully doubl... | block -> (Iterator<V>) decodeBlock(block, null, elementEncoding) | 4 |
wso2/carbon-commons | components/logging/org.wso2.carbon.logging.view.ui/src/main/java/org/wso2/carbon/logging/view/ui/LogViewerClient.java | [
"public class LogEvent {\n private String key;\n private String tenantId;\n private String serverName;\n private String appName;\n private String logTime;\n private String logger;\n private String priority;\n private String message;\n private String ip;\n private String stacktrace;\n ... | import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axis2.AxisFault;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.activation.DataHandler;
import javax.ser... | List<LogEvent> result = new ArrayList<>();
for (LogEvent event : logMsgList) {
if (applicationName.equals(event.getAppName())) {
result.add(event);
}
}
return getPaginatedLogEvent(pageNumber, result);
}
r... | public PaginatedLogFileInfo getLocalLogFiles(int pageNumber, String tenantDomain, String serverKey) { | 3 |
evmcl/erudite | src/main/java/com/evanmclean/erudite/pocket/Pocket.java | [
"public class Articles\n{\n private final ImmutableList<? extends Article> articles;\n private final ImmutableList<String> errors;\n\n public Articles( final ImmutableList<? extends Article> articles )\n {\n this(articles, ImmutableList.<String> of());\n }\n\n public Articles( final ImmutableList<? extends... | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jsoup.Connection;
... | package com.evanmclean.erudite.pocket;
/**
* Represents a login to the Pocket service.
*
* @author Evan M<sup>c</sup>Lean, <a href="http://evanmclean.com/"
* target="_blank">M<sup>c</sup>Lean Computer Services</a>
*/
public class Pocket
{
public static class Authoriser
{
private final String ke... | final Connection conn = Conn.connect(url); | 2 |
jakobadam/rdp | src/net/propero/rdp/rdp5/VChannels.java | [
"public abstract class Input {\r\n\r\n\tprotected static Logger logger = Logger.getLogger(Input.class);\r\n\r\n\tKeyCode_FileBased newKeyMapper = null;\r\n\r\n\tprotected Vector pressedKeys;\r\n\r\n\tprotected static boolean capsLockOn = false;\r\n\r\n\tprotected static boolean numLockOn = false;\r\n\r\n\tprotected... | import java.lang.reflect.Array;
import net.propero.rdp.Input;
import net.propero.rdp.MCS;
import net.propero.rdp.Options;
import net.propero.rdp.RdesktopException;
import net.propero.rdp.RdpPacket_Localised;
import net.propero.rdp.crypto.CryptoException;
import org.apache.log4j.Logger;
import java.io.IOExceptio... | /* VChannels.java
* Component: ProperJavaRDP
*
* Revision: $Revision: 13 $
* Author: $Author: miha_vitorovic $
* Date: $Date: 2007-05-11 14:14:45 +0200 (Fri, 11 May 2007) $
*
* Copyright (c) 2005 Propero Limited
*
* Purpose: Static store for all registered channels
*
* This program is free soft... | public void channel_process(RdpPacket_Localised data, int mcsChannel)
| 4 |
ferstl/pedantic-pom-enforcers | src/main/java/com/github/ferstl/maven/pomenforcers/PedanticDependencyScopeEnforcer.java | [
"public class ArtifactModel {\r\n\r\n private static final Joiner TO_STRING_JOINER = Joiner.on(\":\").useForNull(\"\");\r\n private static final String WILDCARD = \"*\";\r\n private static final char WILDCARD_CHAR = WILDCARD.charAt(0);\r\n\r\n @XmlElement(namespace = \"http://maven.apache.org/POM/4.0.0\")\r\n ... | import java.util.Collection;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.maven.model.Dependency;
import com.github.ferstl.maven.pomenforcers.model.ArtifactModel;
import com.github.ferstl.maven.pomenforcers.model.DependencyScope;
import com.github.ferstl.maven.pomenforcers.model.functions.StringT... | /*
* Copyright (c) 2012 - 2020 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 ... | Collection<Dependency> dependencies = EnforcerRuleUtils.getMavenProject(getHelper()).getDependencies(); | 4 |
recoilme/freemp | app/src/main/java/org/freemp/droid/playlist/MakePlaylistFS.java | [
"public class BASS {\n public static final int BASSVERSION = 0x204; // API version\n public static final String BASSVERSIONTEXT = \"2.4\";\n\n // Error codes returned by BASS_ErrorGetCode\n public static final int BASS_OK = 0; // all is OK\n public static final int BASS_ERROR_MEM = 1; // mem... | import android.content.Context;
import android.os.Environment;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.util.Log;
import com.androidquery.util.AQUtility;
import com.un4seen.bass.BASS;
import com.un4seen.bass.TAGS;
import org.freemp.droid.ClsTrack;
import org.freemp.droi... | package org.freemp.droid.playlist;
/**
* Created by recoilme on 05/12/13.
*/
public class MakePlaylistFS extends MakePlaylistAbstract {
//base tags for scan
private static final int[] formats = {BASS.BASS_TAG_ID3V2, BASS.BASS_TAG_OGG, BASS.BASS_TAG_APE, BASS.BASS_TAG_MP4, BASS.BASS_TAG_ID3};
//encod... | private FillMediaStoreTracks fillMediaStoreTracks; | 4 |
MindscapeHQ/raygun4java | core/src/test/java/com/mindscapehq/raygun4java/core/handlers/requestfilters/RaygunRequestHttpStatusFilterTest.java | [
"public interface IRaygunOnBeforeSend extends IRaygunSentEvent {\n RaygunMessage onBeforeSend(RaygunClient client, RaygunMessage message);\n}",
"public class RaygunRequestHttpStatusFilter extends RaygunExcludeRequestFilter {\n\n public RaygunRequestHttpStatusFilter(final Integer... excludeHttpCodes) {\n ... | import com.mindscapehq.raygun4java.core.IRaygunOnBeforeSend;
import com.mindscapehq.raygun4java.core.handlers.requestfilters.RaygunRequestHttpStatusFilter;
import com.mindscapehq.raygun4java.core.messages.RaygunMessage;
import com.mindscapehq.raygun4java.core.messages.RaygunRequestMessage;
import com.mindscapehq.raygun... | package com.mindscapehq.raygun4java.core.handlers.requestfilters;
public class RaygunRequestHttpStatusFilterTest {
@Test
public void shouldFilterOutOnHttpStatusCode() {
IRaygunOnBeforeSend filter = new RaygunRequestHttpStatusFilter(200, 404, 400);
| RaygunMessage message = new RaygunMessage(); | 2 |
drtrang/druid-spring-boot | druid-spring-boot/druid-spring-boot-autoconfigure/src/main/java/com/github/trang/druid/autoconfigure/DruidStatConfiguration.java | [
"public static final String DRUID_AOP_STAT_PREFIX = \"spring.datasource.druid.aop-stat\";",
"public static final String DRUID_WEB_STAT_PREFIX = \"spring.datasource.druid.web-stat\";",
"@ConfigurationProperties(prefix = DRUID_DATA_SOURCE_PREFIX)\n@Getter\n@Setter\npublic class DruidDataSourceProperties {\n\n ... | import static com.github.trang.druid.autoconfigure.properties.DruidDataSourceProperties.DruidConstants.DRUID_AOP_STAT_PREFIX;
import static com.github.trang.druid.autoconfigure.properties.DruidDataSourceProperties.DruidConstants.DRUID_WEB_STAT_PREFIX;
import javax.servlet.Filter;
import org.aopalliance.aop.Advice;
impo... | package com.github.trang.druid.autoconfigure;
/**
* Druid 监控配置
*
* @author trang
*/
@Configuration
@Slf4j
public class DruidStatConfiguration {
/**
* 用于采集 Spring 和 JDBC 关联监控的数据
*/
@Configuration
@ConditionalOnClass(Advice.class)
@ConditionalOnProperty(prefix = DRUID_AOP_STAT_PREFIX,... | @ConditionalOnProperty(prefix = DRUID_WEB_STAT_PREFIX, name = "enabled", havingValue = "true") | 1 |
aw20/MongoWorkBench | src/org/aw20/mongoworkbench/eclipse/Activator.java | [
"public class StreamUtil extends Object {\n\t\n\tpublic static InputStream getResourceStream(String resource, ClassLoader classLoader) throws IOException {\n\t\tURL url = classLoader.getResource(resource);\n\t\treturn url.openStream();\n\t}\n\n\tpublic static InputStream getResourceStream(String resource) throws IO... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.... | /*
* MongoWorkBench is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Free Software Foundation,version 3.
*
* MongoWorkBench is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implie... | MPrefManager.getInstance().init(); | 1 |
utluiz/spring-examples | agenda-web-completa-springboot/src/main/java/br/com/starcode/agenda/controller/EntradaController.java | [
"public class Entrada {\r\n\r\n\tprivate Integer id;\r\n\tprivate Date horario;\r\n\tprivate String descricao;\r\n\tprivate Prioridade prioridade;\r\n\tprivate Integer idUsuario;\r\n\t\r\n\tpublic Integer getId() {\r\n\t\treturn id;\r\n\t}\r\n\t\r\n\tpublic void setId(Integer id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\t... | import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVa... | package br.com.starcode.agenda.controller;
@Controller
public class EntradaController {
/**
* Injeta o serviço de entradas (camada Service)
*/
@Autowired EntradaService entradaService;
/**
* Mapeia a URL "/entradas", lista as entradas da agenda através do método search
* e recebe doi... | entrada.setPrioridade(Prioridade.NadaDeMais);
| 3 |
xnx3/xunxian | xunxianAutoFight/src/action/UIFunc.java | [
"public class Com {\r\n\tpublic ActiveXComponent activeDm=null;\t\t//大漠\r\n\tpublic ActiveXComponent activeDb_MouseKey=null;\t//大兵键鼠对象\r\n\tpublic ActiveXComponent activeDb_Window=null;\t\t//大兵窗口对象\r\n\t\r\n\tpublic Com() {\r\n\t\tComThread.InitSTA();\r\n\t}\r\n\r\n\t\r\n\t/**\r\n\t * 创建DM并进行绑定\r\n\t */\r\n\tpublic... | import java.awt.event.MouseEvent;
import javax.swing.ListSelectionModel;
import javax.swing.table.TableModel;
import com.jacob.com.Variant;
import Func.Com;
import Func.Message;
import Func.Mouse;
import Func.Press;
import Func.Sleep;
import Func.Window;
import include.Command;
| package action;
public class UIFunc {
/**
* 提示框,可用户鼠标跟随提示、软件加载loading提示等
* @param startX jframe开始出位于屏幕的坐标
* @param startY
* @param width jframe的宽度
* @param height
* @param content 传入html格式字符串
*/
public void showMessage(int startX,int startY,int width,int height,String content){
if(... | Window window=new Func.Window(com.activeDm,com.activeDb_Window);
| 5 |
poli-libras/poli-libras | poli-libras-core/src/br/usp/libras/syntax/transforms/SecondPersonTransform.java | [
"public class SubjectFinder {\n\n /**\n * \n * @param tokens\n * @return\n */\n\tpublic List<TokenMorph> findSubject(List<TokenMorph> tokens) {\n\t\t\n\t\tList<TokenMorph> subject = new ArrayList<TokenMorph>();\n\t\tfor (TokenMorph tk : tokens) {\n\t\t\tif (tk.getSyntaticTag().equals(SyntacticTag... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import br.usp.libras.syntax.SubjectFinder;
import br.usp.libras.syntax.TokenMorph;
import br.usp.libras.... | package br.usp.libras.syntax.transforms;
/**
*
* Sets "second person" to the verb if subject is "você" or equivalent
*
* @author leonardo, koga, guilherme
*
*/
public class SecondPersonTransform implements TokensTransform {
private static final String PRONOUNS_FILE = "pronomes2p.list";
private Set... | ResourceLoader loader = new ResourceLoader(PRONOUNS_FILE); | 4 |
Samistine/BloodMoon | src/main/java/uk/co/jacekk/bukkit/bloodmoon/BloodMoon.java | [
"public class EntityRegistrationException extends Exception {\n\n private static final long serialVersionUID = 5269865836575653186L;\n\n public EntityRegistrationException(String message) {\n super(message);\n }\n\n public EntityRegistrationException(String message, Exception cause) {\n su... | import uk.co.jacekk.bukkit.bloodmoon.exceptions.EntityRegistrationException;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import org.apache.commons.lang.Validate;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.Crea... | package uk.co.jacekk.bukkit.bloodmoon;
public final class BloodMoon extends BasePlugin {
public static boolean DEBUG = false;
private ArrayList<String> activeWorlds;
private HashMap<String, PluginConfig> worldConfig;
protected ArrayList<String> forceWorlds;
@Override
public void onEnable(... | getCommandManager().registerCommandExecutor(new BloodMoonExecuter(this)); | 1 |
RunsCode/AppFacadeMVC | puremvc_appfacade/src/main/java/com/example/puremvc_appfacade/Runs/core/View.java | [
"public class Observer implements IObserver{\n private String Tag = this.getClass().getName();\n\n private Method method = null;\n private Object context = null;\n\n public static IObserver withNotifyMethod(Method method, Object context) {\n return new Observer(method, context);\n }\n\n pub... | import android.util.Log;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import com.example.puremvc_appfacade.Runs.observer.Observer;
import com.example.puremvc_appfacade.Runs.protocol.IMediator;
import com.example.puremvc_appfacade.Runs.protocol.INotification;
import com.example.... | package com.example.puremvc_appfacade.Runs.core;
/**
* Created by dev_wang on 2017/1/23.
*/
public class View implements IView{
protected String TAG = Controller.class.getName();
private HashMap<String, IMediator> iMediatorMap = new HashMap<>(); | private HashMap<String, ArrayList<IObserver>> iObserverMap = new HashMap<>(); | 3 |
shevek/tftp4j | tftp-protocol/src/test/java/org/anarres/tftp/protocol/engine/AbstractTftpReadTransferTest.java | [
"public class TftpAckPacket extends TftpPacket {\n\n /** Cheat for an unsigned 2-byte value. */\n private char blockNumber;\n\n @Override\n public TftpOpcode getOpcode() {\n return TftpOpcode.ACK;\n }\n\n /**\n * @param blockNumber The block number, indexed from 1.\n */\n public ... | import com.google.common.primitives.Chars;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;
import org.anarres.tftp.protocol.packet.TftpAckPacket;
import org.anarres.tftp.protocol.packet.TftpDataPacket;
import org.anarres.tftp.... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.anarres.tftp.protocol.engine;
/**
*
* @author shevek
*/
public class AbstractTftpReadTransferTest {
private static final Logger LOG = LoggerFactory.getLogger(AbstractTftpReadTransferTest.class);
... | public TftpReadTransfer(TftpData source, int blockSize) throws IOException { | 4 |
TheTemportalist/CountryGamer_PlantsVsZombies | java/com/countrygamer/pvz/items/ItemNightPlants.java | [
"@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)\npublic class PvZ implements IFuelHandler, IGuiHandler {\n\t\n\tpublic static final Logger log = Logger.getLogger(Reference.MOD_ID);\n\t@Mod.Instance(Reference.MOD_ID)\n\tpublic static PvZ instance = new PvZ();\n\t@SidedProxy(cl... | import net.minecraft.block.Block;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import com.countrygamer.core.Base.common.item.ItemMetadataBase;
import com.countrygamer.pv... | package com.countrygamer.pvz.items;
public class ItemNightPlants extends ItemMetadataBase {
public static final String[] itemGameNames = { "Puff-shroom Plant",
"Scaredy-shroom Plant", "Fume-shroom Plant", "Moon-shroom Plant" };
public boolean onGround = false;
public ItemNightPlants(String modid) {
super(m... | ent = new EntitySunflower(world); | 5 |
Martin20150405/Pano360 | vrlib/src/main/java/com/martin/ads/vrlib/filters/vr/VideoHotspot.java | [
"public class AdjustingMode {\n public static final int ADJUSTING_MODE_STRETCH=1;\n public static final int ADJUSTING_MODE_CROP=2;\n public static final int ADJUSTING_MODE_FIT_TO_SCREEN=3;\n\n}",
"public class PositionOrientation {\n private float mX;\n private float mY;\n private float mZ;\n ... | import android.content.Context;
import android.graphics.SurfaceTexture;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.net.Uri;
import android.opengl.GLES20;
import android.util.Log;
import android.view.Surface;
import com.martin.ads.vrlib.constant.AdjustingMode;
import com.martin.a... | package com.martin.ads.vrlib.filters.vr;
/**
* Created by Ads on 2017/4/11.
*/
public class VideoHotspot extends AbsHotspot implements
SurfaceTexture.OnFrameAvailableListener,
MediaPlayer.OnPreparedListener,
MediaPlayer.OnVideoSizeChangedListener {
private SurfaceTexture mSurfaceText... | private GLOESTexture glOESTexture; | 4 |
Velli20/Tachograph | app/src/main/java/com/velli20/tachograph/ActivityAddNewEvent.java | [
"public class DataBaseHandler extends SQLiteOpenHelper implements OnDatabaseActionCompletedListener {\n public static final String TAG = \"DataBaseHandler \";\n public static final boolean DEBUG = false;\n\n public static final int DATABASE_VERSION = 3;\n public static final String DATABASE_NAME = \"dri... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ArgbEvaluator;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator.AnimatorUpdateListener;
import android.annotation.TargetApi;
import android.app.TimePickerDialog;
import android.con... | /*
*
* * MIT License
* *
* * Copyright (c) [2017] [velli20]
* *
* * Permission is hereby granted, free of charge, to any person obtaining a copy
* * of this software and associated documentation files (the "Software"), to deal
* * in the Software without restriction, including without limitation the righ... | DataBaseHandler.getInstance().getEvent(rowId, new OnGetEventTaskCompleted() { | 1 |
bazaarvoice/ostrich | examples/calculator/user/src/main/java/com/bazaarvoice/ostrich/examples/calculator/user/CalculatorUser.java | [
"public class ZooKeeperHostDiscovery implements HostDiscovery {\n private static final Logger LOG = LoggerFactory.getLogger(ZooKeeperHostDiscovery.class);\n\n /**\n * The root path in ZooKeeper for where service registrations are stored.\n * <p/>\n * WARNING: Do not modify this without also modify... | import com.bazaarvoice.ostrich.ServicePool;
import com.bazaarvoice.ostrich.discovery.zookeeper.ZooKeeperHostDiscovery;
import com.bazaarvoice.ostrich.dropwizard.healthcheck.ContainsHealthyEndPointCheck;
import com.bazaarvoice.ostrich.examples.calculator.client.CalculatorService;
import com.bazaarvoice.ostrich.examples.... | package com.bazaarvoice.ostrich.examples.calculator.user;
public class CalculatorUser {
private static final Logger LOG = LoggerFactory.getLogger(CalculatorUser.class);
private final Random _random = new Random();
private final ServicePool<CalculatorService> _calculatorPool;
public CalculatorUser(S... | CalculatorServiceFactory serviceFactory = new CalculatorServiceFactory(httpClientConfiguration, metrics); | 2 |
ralscha/eds-starter6-mongodb | src/main/java/ch/rasc/eds/starter/service/UserService.java | [
"@Component\npublic class MongoDb {\n\n\tprivate final MongoDatabase mongoDatabase;\n\n\tpublic MongoDb(final MongoDatabase mongoDatabase) {\n\t\tthis.mongoDatabase = mongoDatabase;\n\t}\n\n\t@PostConstruct\n\tpublic void createIndexes() {\n\n\t\tif (!indexExists(User.class, CUser.email)) {\n\t\t\tthis.getCollectio... | import static ch.ralscha.extdirectspring.annotation.ExtDirectMethodType.STORE_MODIFY;
import static ch.ralscha.extdirectspring.annotation.ExtDirectMethodType.STORE_READ;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.uti... | package ch.rasc.eds.starter.service;
@Service
@RequireAdminAuthority
public class UserService {
private final MessageSource messageSource;
private final Validator validator;
private final MongoDb mongoDb;
private final MailService mailService;
public UserService(MongoDb mongoDb, Validator validator, Me... | || !updatedEntity.getAuthorities().contains(Authority.ADMIN.name()))) { | 1 |
emop/EmopAndroid | src/com/emop/client/io/WeiboLoginService.java | [
"public static final String TAG_EMOP = \"emop\";\r",
"public class SslError {\r\n\r\n /**\r\n * Individual SSL errors (in the order from the least to the most severe):\r\n */\r\n\r\n /**\r\n * The certificate is not yet valid\r\n */\r\n public static final int SSL_NOTYETVALID = 0;\r\n /*... | import static com.emop.client.Constants.TAG_EMOP;
import java.util.Date;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
im... | package com.emop.client.io;
public class WeiboLoginService {
private WebView web = null;
| private Weibo mWeibo = null;
| 4 |
privacyidea/privacyidea-authenticator | app/src/main/java/it/netknights/piauthenticator/utils/Endpoint.java | [
"public interface EndpointCallback {\n void updateStatus(int statusCode);\n\n void responseReceived(String response, int responseCode);\n}",
"public static final int CONNECT_TIMEOUT = 15000;",
"public static final int READ_TIMEOUT = 10000;",
"public static final int STATUS_ENDPOINT_ERROR = 4005;",
"pu... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
im... | /*
privacyIDEA Authenticator
Authors: Nils Behlen <nils.behlen@netknights.it>
Copyright (c) 2017-2019 NetKnights GmbH
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apac... | callback.updateStatus(STATUS_ENDPOINT_SSL_ERROR); | 5 |
kefik/MsPacMan-vs-Ghosts-AI | Exercises/E4/src/game/controllers/pacman/exercises/e4/path/uninformed/IDS.java | [
"public class Graph {\n\n\tprivate Maze maze;\n\t\n\t/**\n\t * Node index -> Node\n\t */\n\tprivate Map<Integer, Node> nodes = new HashMap<Integer, Node>();\n\t\n\t/**\n\t * Set of all existing links.\n\t */\n\tprivate Set<Link> links = new HashSet<Link>();\n\t\n\t/**\n\t * Node index -> Link\n\t */\n\tprivate Map<... | import java.util.Collection;
import game.controllers.pacman.exercises.e4.graph.Graph;
import game.controllers.pacman.exercises.e4.graph.Node;
import game.controllers.pacman.exercises.e4.path.Path;
import game.controllers.pacman.exercises.e4.path.PathFinderState;
import game.controllers.pacman.exercises.e4.path.uninform... | package game.controllers.pacman.exercises.e4.path.uninformed;
/**
* ITERATIVE DEEPENING SEARCH
*
* TODO: implement me!
*
* To make this work you need to:
* 1) implement {@link DLS},
* 2) which means to implement {@link DFS},
* 3) which means to implement {@link UninformedGraphSearch#step()}.
*/
public cla... | public PathFinderState step() { | 3 |
FernandoOrtegaMartinez/Planket | app/src/main/java/com/fomdeveloper/planket/data/api/FlickrService.java | [
"public class CommentsResponse {\n\n @Expose\n @SerializedName(\"comments\")\n private CommentsContainer commentsContainer;\n\n public CommentsContainer getCommentsContainer() {\n return commentsContainer;\n }\n}",
"public class FavesResponse {\n\n @Expose\n @SerializedName(\"photo\")\... | import com.fomdeveloper.planket.data.model.transportmodel.CommentsResponse;
import com.fomdeveloper.planket.data.model.transportmodel.FavesResponse;
import com.fomdeveloper.planket.data.model.transportmodel.SearchPhotosResponse;
import com.fomdeveloper.planket.data.model.transportmodel.StatusResponse;
import com.fomdev... | package com.fomdeveloper.planket.data.api;
/**
* Created by Fernando on 09/05/16.
*/
public interface FlickrService {
String ENDPOINT = "https://api.flickr.com/services/rest/";
String PARAM_API_KEY = "api_key";
String PARAM_FORMAT = "format";
String PARAM_JSONCALLBACK = "nojsoncallback";
Strin... | Single<SearchPhotosResponse> searchInterestingness(@Query("page") int page); | 2 |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/JresBulkRequestorTest.java | [
"@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)\npublic class JresIndexDocument extends JresJsonRequest<JresIndexDocumentReply> implements JresBulkable {\n\n private final @Nullable String index;\n private final @Nullable String type;\n\n private final @Nullable String id;\n private ... | import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import com.blacklocus.jres.request.index.JresIndexDocument;
import com.blacklocus.jres.request.index.JresRefresh;
import com.blacklocus.jres.request.index.JresUpdateDocument;
import com.blacklocus.jres.request.sea... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | JresSearchReply searchReply = jres.quest(new JresSearch(index)); | 4 |
apache/geronimo-gshell | gshell-core/src/main/java/org/apache/geronimo/gshell/commandline/ExecutingVisitor.java | [
"public class ASTQuotedString\n extends StringSupport\n{\n public ASTQuotedString(final int id) {\n super(id);\n }\n\n public ASTQuotedString(final CommandLineParser p, final int id) {\n super(p, id);\n }\n\n public String getValue() {\n return unquote(super.getValue());\n ... | import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.lang.NullArgumentException;
import java.util.List;
import java.util.ArrayList;
import org.apache.geronimo.gshell.commandline.parser.CommandLineParserVisitor;
import org.apache.geronimo.gshell.commandline.parse... | /*
* 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 ... | public Object visit(final ASTQuotedString node, final Object data) { | 0 |
alleveenstra/Mujina | mujina-sp/src/main/java/nl/surfnet/mujina/spring/SAMLAuthenticationEntryPoint.java | [
"public interface SpConfiguration extends CommonConfiguration {\n public void setSingleSignOnServiceURL(String singleSignOnServiceURL);\n public String getSingleSignOnServiceURL();\n}",
"public class AuthnRequestGenerator {\n\n private XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFact... | import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.Validate;
import org.opensaml.saml2.core.AuthnRequest;
import org.opensaml.saml2.metadata.Endpoint;
import org.opensaml.saml2.met... | /*
* Copyright 2012 SURFnet bv, The Netherlands
*
* 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 ... | private final TimeService timeService; | 5 |
mleoking/LeoTask | leotask/src/core/org/leores/net/mod/Model.java | [
"public abstract class RandomEngine extends PersistentObject {\r\n\t/**\r\n\t * Makes this class non instantiable, but still let's others inherit from\r\n\t * it.\r\n\t */\r\n\tprotected RandomEngine() {\r\n\t}\r\n\r\n\t/**\r\n\t * Equivalent to <tt>raw()</tt>.\r\n\t * This has the effect that random engines can no... | import org.leores.math.rand.RandomEngine;
import org.leores.net.Link;
import org.leores.net.Network;
import org.leores.net.Networks;
import org.leores.net.Node;
import org.leores.util.Logger;
import org.leores.util.able.NewInstanceable;
| package org.leores.net.mod;
public abstract class Model extends Logger {
public RandomEngine rand;
public NewInstanceable<Node> nIaNode;
public NewInstanceable<Link> nIaLink;
public Integer nNode;
public void initialize(RandomEngine rand, Integer nNode, NewInstanceable<Node> nIaNode, NewInstanceable<Li... | public Network newNetwork() {
| 2 |
zhouchaoyi/springMVC_mybatis_angularjs_HUI | src/main/java/com/dawn/bgSys/filter/LoginFilter.java | [
"public class Consts {\n\n /**\n * 推送种类:每天九点推送\n */\n public static final String PUSH_AT_9 = \"PUSH_AT_9\";\n\n /**\n * 推送种类:每天九点推送\n */\n public static final String PUSH_PER_HOUR = \"PUSH_PER_HOUR\";\n\n /**\n * 通用apk版本上传配置文件中,版本key开头标识\n */\n public static final String C... | import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dawn.bgSys.common.*;
import com.dawn.bgSys.common.consts.Consts;
import com.dawn.bgSys.domain.Module;
import com.dawn.bgSys.domain.User;
import com.dawn.bgSys.exception.GenericException;
import com.dawn.bgSys.exception.OperateFail... | package com.dawn.bgSys.filter;
/**
* Date: 13-9-26
* Time: 下午1:38
*/
public class LoginFilter extends BaseFilter {
private Logger logger= Logger.getLogger(LoginFilter.class);
private static final String[] IGNORE_URI = {"/login.do"};
private String appTK;
public void doSelfFilter(HttpServletRequ... | if (ex instanceof GenericException) { | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.