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 |
|---|---|---|---|---|---|---|
MaksTuev/ferro | sample/src/main/java/com/agna/ferro/sample/ui/screen/book/BookFragmentView.java | [
"public interface ScreenComponent<V extends BaseView> {\n void inject(V view);\n}",
"public abstract class MvpFragmentV4View extends PSSFragmentV4 implements BaseView {\n\n /**\n * @return unique screen name\n */\n public abstract String getName();\n\n /**\n * @return screen component\n ... | import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.wid... | package com.agna.ferro.sample.ui.screen.book;
/**
* View for Book screen
*/
public class BookFragmentView extends MvpFragmentV4View {
private static final String EXTRA_BOOK_ID = "EXTRA_BOOK_ID";
@Inject
BookPresenter presenter;
private TextView nameTv;
private ImageView coverIv;
private ... | return "Book"; | 3 |
adiyoss/StructED | src/com/structed/models/algorithms/ProbitLoss.java | [
"public class Consts {\n\n // GENERALS\n\tpublic static final String SPACE = \" \";\n public static final String TAB = \"\\t\";\n public static final String COMMA_NOTE = \",\";\n\tpublic static final String CLASSIFICATION_SPLITTER = \"-\";\n\tpublic static final String COLON_SPLITTER = \":\";\n public s... | import com.structed.models.ClassifierData;
import com.structed.constants.ErrorConstants;
import com.structed.data.entities.Example;
import com.structed.data.entities.Vector;
import com.structed.data.Logger;
import com.structed.utils.MathHelpers;
import java.util.ArrayList;
import java.util.Random;
import com.structed.c... | /*
* The MIT License (MIT)
*
* StructED - Machine Learning Package for Structured Prediction
*
* Copyright (c) 2015 Yossi Adi, E-Mail: yossiadidrum@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), t... | public Vector update(Vector currentWeights, Example example, ClassifierData classifierData) { | 1 |
MummyDing/Leisure | app/src/main/java/com/mummyding/app/leisure/support/adapter/ReadingAdapter.java | [
"public interface ICache<T>{\n void addToCollection(T object);\n void execSQL(String sql);\n List<T> getList();\n boolean hasData();\n void load();\n void loadFromCache();\n void cache();\n}",
"public class ReadingTable {\n public static final String NAME=\"reading_table\";\n public sta... | import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
im... | /*
* Copyright (C) 2015 MummyDing
*
* This file is part of Leisure( <https://github.com/MummyDing/Leisure> )
*
* Leisure 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 Lice... | if(Utils.hasString(bookBean.getEbook_url())) { | 5 |
alabeduarte/mypodcasts-android | app/src/main/java/com/mypodcasts/player/notification/AudioPlayerNotification.java | [
"public class AudioPlayerService extends RoboService {\n\n public static final int ONGOING_NOTIFICATION_ID = 1;\n\n public static final String ACTION_REWIND = \"com.mypodcasts.player.action.rewind\";\n public static final String ACTION_PAUSE = \"com.mypodcasts.player.action.pause\";\n public static final String... | import android.app.Notification;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Icon;
import android.os.Build;
import com.mypodcasts.R;
import com.mypodcasts.player.AudioPlayerService;
import com.mypodcasts.repositories.models.Episode;
i... | package com.mypodcasts.player.notification;
public class AudioPlayerNotification {
private final Context context;
private final Notification.Builder notificationBuilder;
protected static final String REWIND = "Rewind";
protected static final String PAUSE = "Pause";
protected static final String STOP = "... | Intent intent = new Intent(context, AudioPlayerService.class); | 0 |
jagrosh/GiveawayBot | src/main/java/com/jagrosh/giveawaybot/commands/StartCommand.java | [
"public class Bot extends ListenerAdapter\n{\n private ShardManager shards; // list of all logins the bot has\n \n private final WebhookLog webhook;\n private final ScheduledExecutorService threadpool; // threadpool to use for timings\n private final Database database; // database\n private final ... | import com.jagrosh.giveawaybot.Bot;
import com.jagrosh.giveawaybot.Constants;
import com.jagrosh.giveawaybot.entities.Giveaway;
import com.jagrosh.giveawaybot.entities.PremiumLevel;
import com.jagrosh.giveawaybot.util.FormatUtil;
import com.jagrosh.giveawaybot.util.OtherUtil;
import com.jagrosh.jdautilities.command.Com... | /*
* Copyright 2017 John Grosh (john.a.grosh@gmail.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 ap... | event.replyError("Giveaway time must not be shorter than " + FormatUtil.secondsToTime(Constants.MIN_TIME) | 4 |
KostyaSha/yet-another-docker-plugin | yet-another-docker-its/src/test/java/com/github/kostyasha/it/tests/ShortTLSKeyTest.java | [
"public class DockerRule extends ExternalResource {\n private static final long serialVersionUID = 1L;\n private static final Logger LOG = LoggerFactory.getLogger(DockerRule.class);\n\n public static final String CONTAINER_JAVA_OPTS = \"JAVA_OPTS=\"\n // hack crap https://issues.jenkins-ci.org/b... | import com.github.kostyasha.it.rule.DockerRule;
import com.github.kostyasha.yad.client.ClientBuilderForConnector;
import com.github.kostyasha.yad.other.ConnectorType;
import com.github.kostyasha.yad.other.VariableSSLConfig;
import com.github.kostyasha.yad_docker_java.com.github.dockerjava.api.DockerClient;
import com.g... | package com.github.kostyasha.it.tests;
/**
* @author Kanstantsin Shautsou
*/
@RunWith(Parameterized.class)
public class ShortTLSKeyTest {
private static final Logger LOG = LoggerFactory.getLogger(ShortTLSKeyTest.class);
private static final String DATA_IMAGE_TAG = ShortTLSKeyTest.class.getSimpleName().toL... | final int exposedPort = getExposedPort(inspect, CONTAINER_PORT); | 4 |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/javaAPI/Model.java | [
"public abstract class FormulaAbstract implements Comparable<FormulaAbstract>\n{\n private HashSet<VariableType> forVariables = new HashSet<VariableType>();\n private ArrayList<IfExpression> ifExpressions = new ArrayList<IfExpression>();\n private String name;\n priva... | import java.util.ArrayList;
import java.util.HashSet;
import com.googlecode.rockit.javaAPI.formulas.FormulaAbstract;
import com.googlecode.rockit.javaAPI.formulas.FormulaCardinality;
import com.googlecode.rockit.javaAPI.formulas.FormulaHard;
import com.googlecode.rockit.javaAPI.formulas.FormulaObjective;
import com.goo... | return sb.toString();
}
public String toTheBeastWeightString()
{
StringBuilder sb = new StringBuilder();
for(FormulaAbstract f : this.getFormulas()) {
if(f instanceof FormulaSoft) {
// >wf1
// -0.5
sb.append("\n>w").append... | } else if(f instanceof FormulaObjective) { | 2 |
quhfus/DoSeR-Disambiguation | doser-dis-core/src/main/java/doser/entitydisambiguation/algorithms/EntityCentricAlgorithmTableDefault.java | [
"public final class DisambiguationMainService {\n\n\tpublic final static int MAXCLAUSECOUNT = 4096;\n\n\tprivate static final int TIMERPERIOD = 10000;\n\n\tprivate static DisambiguationMainService instance = null;\n\n//\tprivate Model hdtdbpediaCats;\n//\tprivate Model hdtdbpediaCats_ger;\n//\tprivate Model hdtdbpe... | import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.log4j.Logger;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.search.IndexSearcher;
import or... | package doser.entitydisambiguation.algorithms;
public class EntityCentricAlgorithmTableDefault extends AbstractDisambiguationAlgorithm {
private EntityCentricKnowledgeBase eckb;
private DisambiguationTaskSingle task;
@Override
public boolean checkAndSetInputParameter(AbstractDisambiguationTask task) {
Abstr... | final List<DisambiguatedEntity> disList = new LinkedList<DisambiguatedEntity>(); | 3 |
googlearchive/androidtv-Leanback | app/src/main/java/com/example/android/tvleanback/ui/MainFragment.java | [
"public class FetchVideoService extends IntentService {\n private static final String TAG = \"FetchVideoService\";\n\n /**\n * Creates an IntentService with a default name for the worker thread.\n */\n public FetchVideoService() {\n super(TAG);\n }\n\n @Override\n protected void onH... | import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import androidx.leanback.app.BackgroundManager;
import androidx.leanback.... | if (id == CATEGORY_LOADER) {
return new CursorLoader(
getContext(),
VideoContract.VideoEntry.CONTENT_URI, // Table to query
new String[]{"DISTINCT " + VideoContract.VideoEntry.COLUMN_CATEGORY},
// Only categories
... | if (item instanceof Video) { | 2 |
anotherMe17/CommonAdapterSample | app/src/main/java/io/github/anotherme17/commonadaptersample/ui/ItemTouchActivity.java | [
"public abstract class BaseActivity extends AppCompatActivity {\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n supportRequestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏导航栏\n setContentView(getLayoutId());\n But... | import android.graphics.Canvas;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
imp... | package io.github.anotherme17.commonadaptersample.ui;
/**
* Created by Administrator on 2017/1/19.
*/
public class ItemTouchActivity extends BaseActivity {
@Bind(R.id.back)
ImageView mBack;
@Bind(R.id.title)
TextView mTitle;
@Bind(R.id.act_normal_toolbar)
Toolbar mActNormalToolbar;
... | .setItemTouchModel(BaseItemTouchHelper.DRAG_ENABLE | BaseItemTouchHelper.SWIP_ENABLE) | 6 |
lrscp/ControlAndroidDeviceFromPC | src/com/android/ddmuilib/log/event/EventLogPanel.java | [
"public interface IDevice {\n\n public final static String PROP_BUILD_VERSION = \"ro.build.version.release\";\n public final static String PROP_BUILD_API_LEVEL = \"ro.build.version.sdk\";\n public final static String PROP_BUILD_CODENAME = \"ro.build.version.codename\";\n\n public final static String PRO... | import com.android.ddmlib.Client;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.Log;
import com.android.ddmlib.Log.LogLevel;
import com.android.ddmlib.log.EventContainer;
import com.android.ddmlib.log.EventLogParser;
import com.android.ddmlib.log.LogReceiver;
import com.android.ddmlib.log.LogReceiver.ILo... | /*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | private ICommonAction mOptionsAction; | 3 |
SalmanTKhan/MyAnimeViewer | app/src/main/java/com/taskdesignsinc/android/myanimeviewer/DownloadListActivity.java | [
"public class DownloadListAdapter extends BaseAdapter {\n\n private Context mContext;\n private ArrayList<HashMap<Integer, String>> dataList;\n private HashMap<String, HashMap<Integer, String>> dataListCheck;\n\n public DownloadListAdapter(Context context) {\n mContext = context;\n dataLis... | import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.graphics.drawable.ColorDrawable;
import android.o... |
package com.taskdesignsinc.android.myanimeviewer;
public class DownloadListActivity extends SupportListActivity {
private DownloadListAdapter mAdapter;
private DownloadResultReceiver mReceiver;
private SharedPreferences mPrefs;
@Override
public void onCreate(Bundle savedInstanceState) {
mPrefs = Preferenc... | if (!StorageUtils.isSDCardPresent()) { | 5 |
flapdoodle-oss/de.flapdoodle.embed.process | src/main/java/de/flapdoodle/embed/process/extract/FilesToExtract.java | [
"@Value.Immutable\npublic interface FileSet {\n\n\tList<Entry> entries();\n\t\n\t@Check\n\tdefault void shouldContainOneMoreExecutable() {\n\t\tboolean oneOrMoreExecutableFound = entries().stream().anyMatch(e -> e.type()==FileType.Executable);\n\t\tif (!oneOrMoreExecutableFound) {\n\t\t\tthrow new IllegalArgumentEx... | import de.flapdoodle.embed.process.config.store.FileSet;
import de.flapdoodle.embed.process.config.store.FileSet.Entry;
import de.flapdoodle.embed.process.config.store.FileType;
import de.flapdoodle.embed.process.io.directories.Directory;
import de.flapdoodle.embed.process.io.file.FileAlreadyExistsException;
import de.... | /**
* Copyright (C) 2011
* Michael Mosmann <michael@mosmann.de>
* Martin Jöhren <m.joehren@googlemail.com>
*
* with contributions from
* konstantin-ba@github,
Archimedes Trajano (trajano@github),
Kevin D. Keck (kdkeck@github),
Ben McCann (benmccann@github)
*
* Licensed under the Apache License, Version ... | public FileType type() { | 2 |
luminis-ams/elastic-rest-spring-wrapper | src/test/java/eu/luminis/elastic/search/SearchServiceIT.java | [
"public class IndexDocumentHelper {\n @Autowired\n private DocumentService documentService;\n\n public void indexDocument(String index, String type, String id, String message) {\n indexDocument(index, type, id, message, 2000L);\n }\n\n public void indexDocument(String index, String type, Strin... | import eu.luminis.elastic.IndexDocumentHelper;
import eu.luminis.elastic.SingleClusterRestClientConfig;
import eu.luminis.elastic.TestConfig;
import eu.luminis.elastic.document.helpers.MessageEntity;
import eu.luminis.elastic.document.helpers.MessageEntityTypeReference;
import eu.luminis.elastic.index.IndexService;
imp... | package eu.luminis.elastic.search;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {SingleClusterRestClientConfig.class, TestConfig.class})
public class SearchServiceIT {
private final static String INDEX = "search_index";
private final static String TYPE = "search_type";
@Auto... | private IndexDocumentHelper indexDocumentHelper; | 0 |
SalmanTKhan/MyAnimeViewer | app/src/main/java/com/taskdesignsinc/android/myanimeviewer/model/helper/AnimeUtils.java | [
"public class AnimeDetailsActivity extends AppCompatActivity {\n\n private BroadcastReceiver mReceiver;\n IntentFilter mFilter;\n private boolean mInstanceStateSaved;\n\n private static Fragment mContent;\n\n final String mTAG = AnimeDetailsActivity.class.getSimpleName();\n\n // Does the user have... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.ActivityOptionsCompat;
import androi... | package com.taskdesignsinc.android.myanimeviewer.model.helper;
/**
* Created by Salman T. Khan on 11/30/2015.
*/
public class AnimeUtils {
public final static String mTag = AnimeUtils.class.getSimpleName();
public synchronized static void saveAsync(Anime... pAnime) {
if (pAnime == null || pAnime... | lIntent.setClass(context, AnimeDetailsActivity.class); | 0 |
eriq-augustine/jocr | src/com/eriqaugustine/ocr/drivers/PLOVEClassifierTest.java | [
"public abstract class CharacterClassifier\n extends VectorClassifier<WrapImage>\n implements OCRClassifier {\n private static Logger logger = LogManager.getLogger(CharacterClassifier.class.getName());\n\n public CharacterClassifier(int featureVectorLength) {\n super(featureVectorLength, \" \"); ... | import com.eriqaugustine.ocr.classifier.CharacterClassifier;
import com.eriqaugustine.ocr.classifier.PLOVEClassifier;
import com.eriqaugustine.ocr.classifier.reduce.FeatureVectorReducer;
import com.eriqaugustine.ocr.classifier.reduce.NoReducer;
import com.eriqaugustine.ocr.classifier.reduce.KLTReducer;
import com.eriqa... | package com.eriqaugustine.ocr.drivers;
/**
* Quck test for PLOVEClassifier.
*/
public class PLOVEClassifierTest extends ClassifierTest {
public static void main(String[] args) throws Exception {
PLOVEClassifierTest test = new PLOVEClassifierTest();
test.run();
}
private void run() throws Exc... | FeatureVectorReducer reduce = new KLTReducer(PLOVE.getNumberOfFeatures(), 400); | 5 |
TU-Berlin-SNET/jTR-ABE | src/main/java/trabe/lw14/policy/Lw14PolicyLeafNode.java | [
"public class AbeOutputStream extends DataOutputStream {\n \n private final AbePublicKey pubKey;\n\n public AbeOutputStream(OutputStream out, AbePublicKey pubKey) {\n super(out);\n this.pubKey = pubKey;\n }\n\n // only used for the curve parameters and attributes, no need for fancy enco... | import java.io.IOException;
import it.unisa.dia.gas.jpbc.ElementPowPreProcessing;
import it.unisa.dia.gas.jpbc.Pairing;
import trabe.AbeOutputStream;
import trabe.AbePrivateKey;
import trabe.AbePublicKey;
import trabe.AbeSettings;
import trabe.lw14.Lw14PrivateKeyComponent;
import trabe.lw14.Lw14Util;
import it... | package trabe.lw14.policy;
public class Lw14PolicyLeafNode extends Lw14PolicyAbstractNode {
private Lw14PrivateKeyComponent satisfyingComponent = null;
/** G1 **/
private Element hashedAttribute;
/** G1 **/
private Element p1;
/** G1 **/
private Element p2;
/** G1 **/
... | public Lw14PolicyLeafNode(String attribute, AbePublicKey publicKey) {
| 2 |
chrismoos/facebook-bb-sdk | src/samples/strawberry/FriendsListScreen.java | [
"public class FBUser implements User {\r\n\r\n\tprivate JSONObject jsonObject = null;\r\n\tprivate String root = \"me\";\r\n\tprivate String accessToken;\r\n\r\n\tprotected Logger log = Logger.getLogger(getClass());\r\n\r\n\t/**\r\n\t * Create a user instance.\r\n\t * \r\n\t * @param facebook\r\n\t * the... | import java.util.Hashtable;
import java.util.Vector;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.system.Display;
import net.rim.device.api.ui.DrawStyle;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.component.LabelField;
import net.... | /**
* Copyright (c) E.Y. Baskoro, Research In Motion Limited.
*
* 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... | FriendsListScreen(FacebookContext pfbc) {
| 2 |
stuart-warren/logit | src/main/java/com/stuartwarren/logit/logback/Layout.java | [
"public final class ExceptionField extends Field {\n \n private static final ExceptionField FIELD = new ExceptionField();\n \n private ExceptionField() {\n this.setSection(ROOT.EXCEPTION);\n Field.register(this);\n }\n \n public final static void put(final IFieldName key, final St... | import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.IThrowableProxy;
import ch.qos.logback.classic.spi.LoggingEvent;
import ch.qos.logback.core.LayoutBase;
import com.stuartwarren.logit.fields.ExceptionField;
import com.stuartwarren.logit.fields.Except... | /**
*
*/
package com.stuartwarren.logit.logback;
/**
* @author Stuart Warren
* @date 6 Oct 2013
*
*/
public class Layout extends LayoutBase<ILoggingEvent> implements IFrameworkLayout {
private String layoutType = "log";
private String detailThreshold = Level.ERROR.toString();
private Strin... | LocationField.put(LOCATION.CLASS, info.getClassName()); | 3 |
dariober/ASCIIGenome | src/test/java/tracks/TrackNarrowPeakTest.java | [
"public class Config {\n\t\n\t// C O N S T R U C T O R \n\t\n\tprivate static final Map<ConfigKey, String> config= new HashMap<ConfigKey, String>();\n\n\tpublic Config(String source) throws IOException, InvalidConfigException {\n\t\t\n\t\tnew Xterm256();\n\t\t\n\t\tString RawConfigFile= Config.getConfigFileAsString... | import static org.junit.Assert.*;
import java.io.IOException;
import java.sql.SQLException;
import org.junit.Before;
import org.junit.Test;
import coloring.Config;
import exceptions.InvalidColourException;
import exceptions.InvalidConfigException;
import exceptions.InvalidGenomicCoordsException;
import exceptions.Inval... | package tracks;
public class TrackNarrowPeakTest {
@Before
public void prepareConfig() throws IOException, InvalidConfigException{
new Config(null);
}
@Test | public void testCanInitNarrorPeakTrack() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordException, SQLException, InvalidColourException { | 1 |
matthewcmead/sleet | src/main/java/sleet/generators/reservedinstance/ZooKeeperReservedInstanceIdGenerator.java | [
"public class SleetException extends Exception {\n\n /**\n * generated by eclipse\n */\n private static final long serialVersionUID = -404982431470350032L;\n\n public SleetException(String message, Throwable cause) {\n super(message, cause);\n }\n\n public SleetException(String message) {\n super(mes... | import sleet.id.LongId;
import sleet.id.LongIdType;
import sleet.state.IdState;
import sleet.utils.zookeeper.InstanceIdManagerForwardReservationZooKeeper;
import sleet.utils.zookeeper.ZooKeeperClient;
import java.io.IOException;
import java.util.List;
import java.util.Properties;
import org.apache.zookeeper.WatchedEven... | /**
* 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... | public void beginIdSession(Properties config) throws SleetException { | 0 |
dalton/P2P-Project | src/main/java/edu/ufl/cise/cnt5106c/ConnectionHandler.java | [
"public class LogHelper {\r\n private static final String CONF = \"/edu/ufl/cise/cnt5106c/conf/logger.properties\";\r\n private static final LogHelper _log = new LogHelper (Logger.getLogger(\"CNT5106C\"));\r\n static {\r\n InputStream in = null;\r\n try{\r\n in = LogHelper.class.ge... | import edu.ufl.cise.cnt5106c.log.LogHelper;
import edu.ufl.cise.cnt5106c.io.ProtocolazibleObjectInputStream;
import edu.ufl.cise.cnt5106c.io.ProtocolazibleObjectOutputStream;
import edu.ufl.cise.cnt5106c.log.EventLogger;
import edu.ufl.cise.cnt5106c.messages.Handshake;
import edu.ufl.cise.cnt5106c.messages.Message... | package edu.ufl.cise.cnt5106c;
/**
* @author Giacomo Benincasa (giacomo@cise.ufl.edu)
*/
public class ConnectionHandler implements Runnable {
private static final int PEER_ID_UNSET = -1;
private final int _localPeerId;
private final Socket _socket;
private final ProtocolazibleObje... | final EventLogger eventLogger = new EventLogger(_localPeerId);
| 3 |
gamblore/AndroidPunk | sample/AndroidPunkTest/src/com/gamblore/androidpunk/entities/Bird.java | [
"public class Entity extends Tweener {\n\n\tprivate static final String TAG = \"Entity\";\n\t\n /**\n * If the Entity should render.\n */\n public boolean visible = true;\n\n /**\n * If the Entity should respond to collision checks.\n */\n public boolean collidable = true;\n\n /**\n ... | import net.androidpunk.Entity;
import net.androidpunk.FP;
import net.androidpunk.graphics.atlas.SpriteMap;
import net.androidpunk.graphics.opengl.SubTexture;
import net.androidpunk.tweens.motion.LinearPath;
import com.gamblore.androidpunk.Main;
import com.gamblore.androidpunk.OgmoEditorWorld;
| package com.gamblore.androidpunk.entities;
public class Bird extends Entity {
private static final String ANIM_FLAPPING = "flapping";
private SpriteMap mMap;
private LinearPath mPath;
public Bird(int x, int y) {
super(x, y);
| SubTexture bird = Main.mAtlas.getSubTexture("bird");
| 3 |
DaveRead/SequenceHunt | src/com/monead/games/android/sequence/Sequence.java | [
"public class SequenceHuntGameModel implements Serializable {\n /**\n * Serial Id required since this model is serializable.\n */\n private static final long serialVersionUID = 5685518061216785733L;\n\n /**\n * Maximum number of attempts to discover the sequence.\n */\n private static fi... | import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Locale;
import com.monead.games.android.sequence.model.SequenceHuntGameModel;
import com.monead.games.android.sequence.reporting.GameStatistics;
import com.monead.games.android.sequence.reporting.GameStatisticsEngine;
import com.monea... | package com.monead.games.android.sequence;
/**
* Copyright 2011, David S. Read
*
* This file is part of Sequence Hunt.
*
* Sequence Hunt is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either... | private GameStatisticsEngine gameStatistics; | 2 |
aleksandr-m/strutsclipse | strutsclipse-plugin/src/com/amashchenko/eclipse/strutsclipse/strutsxml/StrutsXmlCompletionProposalComputer.java | [
"public class CompletionProposalHelper {\n\tpublic CompletionProposalHelper() {\n\t}\n\n\tpublic static List<ICompletionProposal> createAttrCompletionProposals(\n\t\t\tString[][] proposalsData, String prefix, IRegion region,\n\t\t\tString valueSeparator, String attrvalue,\n\t\t\tCompletionProposalComparator proposa... | import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.ui.text.java.CompletionProposalComp... |
// other struts files
IPath currentPath = ProjectUtil.getCurrentDocumentPath(document);
List<ResourceDocument> resources = ProjectUtil
.findStrutsResources(document);
for (ResourceDocument rd : resources) {
if (!rd.getResource().getFullPath().equals(currentPath)) {
packageNames.addAll(strutsXmlParse... | List<PackageData> packages = strutsXmlParser | 7 |
tmills/PaperManager | src/bibtex/ExtractAuthors.java | [
"public final class BibtexEntry extends BibtexAbstractEntry {\n\n BibtexEntry(BibtexFile file, String entryType, String entryKey) {\n super(file);\n this.entryKey = entryKey;\n // we intern the entry type for space optimization.\n this.entryType = entryType.toLowerCase().intern();\n ... | import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Iterator;
import bibtex.dom.BibtexEntry;
import bibtex.dom.BibtexFile;
import bibtex.dom.BibtexString;
import bibtex.parser.BibtexParser;
import bibtex.parser.ParseException; | /*
* Created on Jul 26, 2004
*
* @author henkel@cs.colorado.edu
*
*/
package bibtex;
/**
* This is just for demonstrating how the parser works: the main method of this
* class parses a bibtex file and prints the values of all author fields.
* @author henkel
*/
public class ExtractAuthors {
public ... | BibtexFile file=new BibtexFile(); | 1 |
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... | * @see Polyline2D
*/
public Polyline2D asPolyline(int n) {
Point2D[] points = new Point2D[n + 1];
double t0 = this.t0();
double t1 = this.t1();
double dt = (t1 - t0) / n;
for (int i = 0; i < n; i++)
points[i] = this.point(i * dt + t0);
r... | public CurveSet2D<? extends ContinuousCurve2D> clip(Box2D box) {
| 1 |
LonamiWebs/Stringlate | src/app/src/main/java/io/github/lonamiwebs/stringlate/activities/repositories/RepositoriesActivity.java | [
"public class BrowserActivity extends AppCompatActivity {\n public final static String EXTRA_DO_SHOW_STRINGLATE_HELP = \"EXTRA_DO_SHOW_STRINGLATE_HELP\";\n public final static String EXTRA_LOAD_URL = \"EXTRA_LOAD_URL\";\n\n //region Initialization\n private WebView webview;\n private boolean isShowin... | import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewPager;
import android... | package io.github.lonamiwebs.stringlate.activities.repositories;
// aka MainActivity
public class RepositoriesActivity extends AppCompatActivity {
//region Members
private RepositoriesPagerAdapter mRepositoriesPagerAdapter;
private BottomNavigationView mBottomNavigationView;
private ViewPager mVie... | } else if (action.equals(StringlateApi.ACTION_TRANSLATE)) { | 7 |
l3nz/SlicedBread | classes/ch/loway/oss/sbDemos/helloWorld/HelloWorld.java | [
"public class MessagingConsole {\n\n private static final Logger logger = LoggerFactory.getLogger(MessagingConsole.class);\n private static final MessagingConsole me = new MessagingConsole();\n private final Map<PID,MsgQueue> mQueues = new ConcurrentHashMap<PID,MsgQueue>();\n\n private final static int ... | import ch.loway.oss.slicedbread.MessagingConsole;
import ch.loway.oss.slicedbread.SbTools;
import ch.loway.oss.slicedbread.containers.PID;
import ch.loway.oss.slicedbread.messages.Msg;
import ch.loway.oss.slicedbread.messages.common.MsgPleaseStop; |
package ch.loway.oss.sbDemos.helloWorld;
/**
* This class is an "Hello world" example in SlicedBread.
* Its aim is to start a couple of threads, ask them to print a string
* and then terminate them.
*
*
* @author l3nz
*/
public class HelloWorld {
public static void main( String args[] ) {
System.... | SbTools.sleep(100); | 1 |
baurine/instagram-material | app/src/main/java/com/baurine/instamaterial/ui/activity/MainActivity.java | [
"public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.CellFeedViewHolder>\n implements View.OnClickListener {\n\n private static final AccelerateInterpolator ACCELERATE_INTERPOLATOR =\n new AccelerateInterpolator();\n private static final OvershootInterpolator OVERSHOOT_INTERPOL... | import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.FloatingActionButton;
import ... | package com.baurine.instamaterial.ui.activity;
public class MainActivity extends BaseDrawerActivity
implements FeedAdapter.OnFeedItemClickListener,
FeedContextMenu.OnFeedContextMenuItemClickListener {
private static final String ACTION_SHOW_LOADING_ITEM = "action_show_loading_item";
privat... | int actionbarSize = CommonUtils.dpToPx(56); | 3 |
cckevincyh/FreshMarket | FreshMarket/src/com/greengrocer/freshmarket/service/CommodityService.java | [
"public interface CommodityDao {\n\n\t/**\n\t * 添加商品信息\n\t * @param commodity 商品实体\n\t */\n\tpublic void addCommodity(CommodityForm commodityForm);\n\t\n\t/**\n\t * 查询所有的商品信息,用于分页查询\n\t * @param pageCode 当前页码\n\t * @param pageSize 页面的记录数\n\t * @return\n\t */\n\tpublic PageBean<Commodity> findAllCommodity(int pageCo... | import java.util.List;
import com.greengrocer.freshmarket.dao.CommodityDao;
import com.greengrocer.freshmarket.dao.factory.DaoFactory;
import com.greengrocer.freshmarket.domain.Commodity;
import com.greengrocer.freshmarket.domain.PageBean;
import com.greengrocer.freshmarket.web.formbean.CommodityForm; | package com.greengrocer.freshmarket.service;
public class CommodityService {
private CommodityDao commodityDao= DaoFactory.getCommodityDao();
/**
* 添加商品信息实体
* @param commodity 商品信息实体
*/
public void addCommodity(CommodityForm commodityForm){
commodityDao.addCommodity(commodityForm);
}
/**
* 找到所... | public PageBean<Commodity> findAllCommodity(int pageCode,int pageSize){ | 2 |
integeruser/jgltut | src/integeruser/jgltut/tut12/GammaCorrection.java | [
"public class MousePoles {\n public enum MouseButtons {\n MB_LEFT_BTN,\n MB_RIGHT_BTN,\n MB_MIDDLE_BTN\n }\n\n public enum MouseModifiers {\n MM_KEY_SHIFT,\n MM_KEY_CTRL,\n MM_KEY_ALT\n }\n\n ////////////////////////////////\n public static class ObjectDat... | import integeruser.jglsdk.glutil.MousePoles;
import integeruser.jgltut.Tutorial;
import integeruser.jgltut.commons.ProjectionBlock;
import integeruser.jgltut.framework.Framework;
import integeruser.jgltut.framework.MousePole;
import integeruser.jgltut.framework.Timer;
import org.joml.*;
import org.lwjgl.opengl.GL15;
im... | LightManager.SunlightValueHDR values[] = {
new LightManager.SunlightValueHDR(
0.0f / 24.0f,
new Vector4f(0.6f, 0.6f, 0.6f, 1.0f),
new Vector4f(1.8f, 1.8f, 1.8f, 1.0f),
new Vector4f(skyDaylightColor),
... | private MousePoles.ViewData initialViewData = new MousePoles.ViewData( | 0 |
seven332/Nimingban | app/src/main/java/com/hippo/nimingban/ui/PostActivity.java | [
"public class GuideHelper {\n\n private static ViewGroup getParent(Activity activity) {\n ViewGroup parent = (ViewGroup) activity.getWindow().getDecorView();\n View view = ViewUtils.getChild(parent, android.R.id.content);\n if (view instanceof ViewGroup) {\n parent = (ViewGroup) v... | import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;
import com.hippo.nimingban.GuideHelper;... | /*
* Copyright 2015 Hippo Seven
*
* 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 PostLayout mPostLayout; | 5 |
pasqualesalza/elephant56 | elephant56/src/main/java/it/unisa/elephant56/core/generator/GridDistributedPrimaryGenerationsBlockExecutor.java | [
"public class IndividualWrapper<IndividualType extends Individual, FitnessValueType extends FitnessValue>\r\n implements Comparable<IndividualWrapper<IndividualType, FitnessValueType>>, Cloneable {\r\n\r\n private IndividualType individual;\r\n private FitnessValueType fitnessValue;\r\n private Bool... | import it.unisa.elephant56.core.common.IndividualWrapper;
import it.unisa.elephant56.core.common.Properties;
import it.unisa.elephant56.core.reporter.time.GenerationsBlockTimeReporter;
import it.unisa.elephant56.user.common.FitnessValue;
import it.unisa.elephant56.user.common.Individual;
import it.unisa.elephant56... | package it.unisa.elephant56.core.generator;
public class GridDistributedPrimaryGenerationsBlockExecutor extends GenerationsBlockExecutor {
private FileSystem fileSystem;
private String generationNameFormat;
public GridDistributedPrimaryGenerationsBlockExecutor(
FileSystem fileSyst... | List<IndividualWrapper<Individual, FitnessValue>> currentPopulation = this.inputPopulation;
| 0 |
maxpowa/AdvancedHUD | src/main/java/advancedhud/client/huditems/HudItemArmor.java | [
"public class HUDRegistry {\n protected static List<HudItem> hudItemList = new ArrayList<HudItem>();\n protected static boolean initialLoadComplete = false;\n protected static List<HudItem> hudItemListActive = new ArrayList<HudItem>();\n\n private static Logger log = LogManager.getLogger(\"AdvancedHUD-A... | import advancedhud.api.Alignment;
import advancedhud.api.HUDRegistry;
import advancedhud.api.HudItem;
import advancedhud.api.RenderAssist;
import advancedhud.client.ui.GuiAdvancedHUDConfiguration;
import advancedhud.client.ui.GuiScreenHudItem;
import advancedhud.client.ui.GuiScreenReposition;
import net.minecraft.clien... | package advancedhud.client.huditems;
public class HudItemArmor extends HudItem {
@Override
public String getName() {
return "armor";
}
@Override
public String getButtonLabel() {
return "ARMOR";
}
@Override
public Alignment getDefaultAlignment() {
if (rotated)... | if ((mc.currentScreen instanceof GuiAdvancedHUDConfiguration || mc.currentScreen instanceof GuiScreenReposition) && level == 0) { | 3 |
axxepta/project-argon | src/main/java/de/axxepta/oxygen/tree/TreeUtils.java | [
"public class ArgonConst {\n\n // PROTOCOL NAMES\n public static final String ARGON = \"argon\";\n public static final String ARGON_XQ = \"argonquery\";\n public static final String ARGON_REPO = \"argonrepo\";\n\n // DATABASE NAMES\n public static final String ARGON_DB = \"~argon\";\n\n public ... | import de.axxepta.oxygen.api.ArgonConst;
import de.axxepta.oxygen.api.BaseXSource;
import de.axxepta.oxygen.core.ClassFactory;
import de.axxepta.oxygen.customprotocol.CustomProtocolURLUtils;
import de.axxepta.oxygen.utils.Lang;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
i... | package de.axxepta.oxygen.tree;
/**
* Utility class for tree related operations
*/
public class TreeUtils {
private static final Logger logger = LogManager.getLogger(TreeUtils.class);
static final int DEPTH_ROOT = 1;
static final int DEPTH_SOURCE = 2;
static final int DEPTH_DB = 3;
... | path = pathByAddingChildAsStr(path, Lang.get(Lang.Keys.tree_DB));
| 4 |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/maven/ArtifactStoreFileSystem.java | [
"public abstract class BaseFileSystem\n implements FileSystem\n{\n /**\n * Ensure consistent serialization.\n *\n * @since 1.0\n */\n private static final long serialVersionUID = 1L;\n\n /**\n * The root entry.\n */\n private final DirectoryEntry root = new DefaultDirectoryEnt... | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Comparator;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeSet;
import java.util.reg... | /*
* Copyright 2011 Stephen Connolly
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | public Entry[] listEntries( DirectoryEntry directory ) | 2 |
bgandon/killbill-simple-tax-plugin | src/test/java/org/killbill/billing/plugin/simpletax/config/http/TestSimpleTaxServlet.java | [
"public static final class TaxCountryRsc {\n /** The identifier of the account this tax country belongs to. */\n // TODO: have immutable resources. Convert to final field?\n public UUID accountId;\n /** The tax country. */\n // TODO: have immutable resources. Convert to final field?\n public Count... | import static java.util.UUID.randomUUID;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static javax.servlet.http.HttpServletResponse.SC_CREATED;
import static javax.servlet.http.HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;... | /*
* Copyright 2015 Benjamin Gandon
*
* 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... | private static final VATIN FR_TEST6_VATIN = new VATIN(FR_TEST6_VATIN_NUM); | 3 |
reines/game | game-server/src/main/java/com/game/server/handlers/item/EdibleHandler.java | [
"public class Item implements Serializable {\n\tprivate static final Logger log = LoggerFactory.getLogger(Item.class);\n\tprivate static final long serialVersionUID = 1L;\n\n\tprotected static final Map<Integer, Definition> definitions;\n\n\tstatic {\n\t\tdefinitions = Item.loadDefinitions();\n\n\t\tif (log.isDebug... | import com.game.common.model.Item;
import com.game.common.model.Stat;
import com.game.server.Server;
import com.game.server.WorldManager;
import com.game.server.handlers.ItemHandler;
import com.game.server.model.Player; | package com.game.server.handlers.item;
public class EdibleHandler implements ItemHandler {
@Override | public void handleItem(Server server, WorldManager world, Player player, Item item, int index) { | 5 |
teivah/TIBreview | src/test/java/com/tibco/exchange/tibreview/processor/resourcerule/ConfigurationProcessorTest.java | [
"public final class Constants {\n\tpublic static final String[] PROCESSES_NAMESPACES = { \"bpws\",\n\t\t\t\"http://docs.oasis-open.org/wsbpel/2.0/process/executable\", \"tibex\",\n\t\t\t\"http://www.tibco.com/bpel/2007/extensions\", \"bwext\", \"http://tns.tibco.com/bw/model/core/bwext\", \"xsl\",\n\t\t\t\"http://w... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
import javax.xml.namespace.NamespaceContext;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathExpression;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
... | package com.tibco.exchange.tibreview.processor.resourcerule;
public class ConfigurationProcessorTest {
private static final Logger LOGGER = Logger.getLogger(ConfigurationProcessorTest.class);
@Test
public void testProcess() {
TIBResource fileresource;
try {
fileresource = new TIBResourc... | String eval2 = Util.xpathEval("src/test/resources/FileResources/ThreadPoolResource.threadPoolResource", Constants.RESOURCES_NAMESPACES,
| 3 |
carrotsearch/smartsprites | src/main/java/org/carrot2/labs/smartsprites/SpriteImageRenderer.java | [
"public enum PngDepth\n{\n AUTO, INDEXED, DIRECT;\n}",
"public enum Ie6Mode\n{\n /** No IE6-friendly image will be created for this sprite, even if needed */\n NONE,\n\n /** IE6-friendly image will be generated for this sprite if needed */\n AUTO;\n\n private String value;\n\n private Ie6Mode... | import java.awt.Color;
import java.awt.image.BufferedImage;
import org.carrot2.labs.smartsprites.SmartSpritesParameters.PngDepth;
import org.carrot2.labs.smartsprites.SpriteImageDirective.Ie6Mode;
import org.carrot2.labs.smartsprites.SpriteImageDirective.SpriteImageFormat;
import org.carrot2.labs.smartsprites.message.M... | package org.carrot2.labs.smartsprites;
/**
* Applies color quantization to the merged sprite image if required.
*/
public class SpriteImageRenderer
{
/** This builder's configuration */
public final SmartSpritesParameters parameters;
/** This builder's message log */
private final MessageLog messa... | messageLog.warning(MessageType.IGNORING_MATTE_COLOR_NO_SUPPORT, | 5 |
davidbecker/taloonerrl | core/src/main/java/de/brainstormsoftworks/taloonerrl/system/CameraSystem.java | [
"public class CameraFollowComponent extends Component {\n\n}",
"@Getter\n@Setter\npublic class PositionComponent extends PooledComponent implements ISetAbleComponent<PositionComponent> {\n\n\tprivate static final int VELOCITY_DEFAULT = 2;\n\tprivate int velocity = VELOCITY_DEFAULT;\n\n\tpublic int x = -1;\n\tpubl... | import com.artemis.Aspect;
import com.artemis.systems.IteratingSystem;
import de.brainstormsoftworks.taloonerrl.components.CameraFollowComponent;
import de.brainstormsoftworks.taloonerrl.components.PositionComponent;
import de.brainstormsoftworks.taloonerrl.core.engine.ComponentMappers;
import de.brainstormsoftworks.ta... | /*******************************************************************************
* Copyright (c) 2015-2018 David Becker.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v2.0
* which accompanies this distribution, and is available at
... | if (!PositionUtil.isValidPosition(positionComponent)) { | 4 |
PeterCxy/BlackLight | src/us/shandian/blacklight/cache/user/UserApiCache.java | [
"public class UserApi extends BaseApi\n{\n\tprivate static String TAG = UserApi.class.getSimpleName();\n\t\n\tpublic static UserModel getUser(String uid) {\n\t\tWeiboParameters params = new WeiboParameters();\n\t\tparams.put(\"uid\", uid);\n\t\t\n\t\ttry {\n\t\t\tJSONObject json = request(Constants.USER_SHOW, param... | import android.content.Context;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.util... | /*
* Copyright (C) 2014 Peter Cai
*
* This file is part of BlackLight
*
* BlackLight 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 ve... | model = UserApi.getUser(uid); | 0 |
JANNLab/JANNLab | examples/de/jannlab/examples/recurrent/SequentialXorExample.java | [
"public interface Net extends Serializable {\n //\n /**\n * Resets the network, which means that all inner\n * states (activations, derivations) are set to 0.0.\n * The method also resets the time index which is 0\n * after doing reset.\n */\n public void reset();\n /**\n * Initi... | import java.util.Random;
import de.jannlab.Net;
import de.jannlab.core.CellType;
import de.jannlab.data.Sample;
import de.jannlab.data.SampleSet;
import de.jannlab.generator.RNNGenerator;
import de.jannlab.misc.TimeCounter;
import de.jannlab.tools.ClassificationValidator;
import de.jannlab.training.GradientDescent; | /*******************************************************************************
* JANNLab Neural Network Framework for Java
* Copyright (C) 2012-2013 Sebastian Otte
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* th... | public static Net RNN(final int hidden) { | 0 |
toby1984/threadwatch | src/main/java/de/codesourcery/threadwatcher/ui/ThreadPanel.java | [
"public class UIConstants\n{\n // legend stuff\n public static final List<LegendItem> LEGEND_ITEMS = new ArrayList<>();\n \n private static final Color COLOR_RUNNABLE = Color.GREEN;\n private static final Color COLOR_BLOCKED = Color.RED;\n private static final Color COLOR_WAITING_GENERAL = Color.Y... | import static de.codesourcery.threadwatcher.ui.UIConstants.*;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.geom.Recta... | /**
* Copyright 2013 Tobias Gierke <tobias.gierke@code-sourcery.de>
*
* 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... | private final HorizontalSelectionHelper<HiResInterval> intervalHelper; | 3 |
SQiShER/java-object-diff | src/main/java/de/danielbechler/diff/comparison/ComparisonService.java | [
"public class ObjectDifferBuilder\n{\n\tprivate final IntrospectionService introspectionService = new IntrospectionService(this);\n\tprivate final CategoryService categoryService = new CategoryService(this);\n\tprivate final InclusionService inclusionService = new InclusionService(categoryService, this);\n\tprivate... | import de.danielbechler.diff.ObjectDifferBuilder;
import de.danielbechler.diff.introspection.ObjectDiffEqualsOnlyType;
import de.danielbechler.diff.introspection.ObjectDiffProperty;
import de.danielbechler.diff.node.DiffNode;
import de.danielbechler.diff.path.NodePath;
import de.danielbechler.diff.path.NodePathValueHol... | /*
* Copyright 2014 Daniel Bechler
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | public ComparisonStrategy resolveComparisonStrategy(final DiffNode node) | 1 |
lantunes/fixd | src/main/java/org/bigtesting/fixd/request/impl/SimpleHttpRequest.java | [
"public interface Unmarshaller {\n\n <T> T unmarshal(InputStream in, Class<T> type);\n}",
"public interface UnmarshallerProvider {\n\n /**\n * \n * Returns the Unmarshaller for the given content-type,\n * or null if there is no Unmarshaller for the given\n * content-type.\n * \n * @p... | import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Set;
import org.bigtesting.fixd.marshalling.Unmarshaller;
import org.bigtesting.fixd.marshalling.UnmarshallerProvider;
import org.bigtesting.fixd.request.HttpRequest;
import org.bigtesting.fixd.session.Session;
import org.bi... | /*
* Copyright (C) 2015 BigTesting.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | private final Session session; | 3 |
UweTrottmann/MovieTracker | SeriesGuideMovies/src/com/uwetrottmann/movies/ui/CancelCheckInDialogFragment.java | [
"public class ServiceManager {\n /** API key. */\n private String apiKeyValue;\n /** User email. */\n private String username;\n /** User password. */\n private String password_sha;\n /** Connection timeout (in milliseconds). */\n private Integer connectionTimeout;\n /** Read timeout (in ... | import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fr... | /*
* Copyright 2012 Uwe Trottmann
*
* 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 ... | r.status = TraktStatus.FAILURE; | 3 |
multi-os-engine/moe-plugin-gradle | src/main/java/org/moe/gradle/remote/ServerFileUploader.java | [
"public class DirectoryEntry extends Entry implements EntryParent {\n final List<Entry> entries = new ArrayList<>();\n\n DirectoryEntry(@NotNull String name, @NotNull EntryParent parent) {\n super(name, parent);\n }\n\n @Override\n protected void walk(@NotNull Walker walker) throws IOException... | import java.io.OutputStream;
import java.nio.file.Path;
import java.nio.file.Paths;
import static org.moe.gradle.utils.TermColor.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import org.gradle.api.GradleException;
import org.moe.gradle.anns.NotNull;
import org.moe.gradle.remote.file.DirectoryEn... | /*
Copyright (C) 2016 Migeran
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | private final FileList list; | 2 |
angelozerr/eclipse-wtp-webresources | org.eclipse.a.wst.html.webresources.core/src/org/eclipse/wst/html/webresources/internal/core/providers/PreferencesWebResourcesProvider.java | [
"public enum WebResourceType {\r\n\r\n\tcss, js, img;\r\n\r\n\tpublic static WebResourceType get(String value) {\r\n\t\tWebResourceType[] types = WebResourceType.values();\r\n\t\tWebResourceType type;\r\n\t\tfor (int i = 0; i < types.length; i++) {\r\n\t\t\ttype = types[i];\r\n\t\t\tif (type.name().equalsIgnoreCase... | import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platfor... | /**
* Copyright (c) 2013-2014 Angelo ZERR.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributor... | WebResourceType resourceType = context.getResourceType().getType();
| 0 |
ralscha/eds-starter6-mongodb | src/main/java/ch/rasc/eds/starter/service/SecurityService.java | [
"@Configuration\n@ComponentScan(basePackageClasses = { ExtDirectSpring.class, Application.class },\n\t\texcludeFilters = { @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE,\n\t\t\t\tvalue = ApiController.class) })\n@EnableAutoConfiguration(exclude = { MustacheAutoConfiguration.class,\n\t\tSpringDataWebAutoCo... | import static ch.ralscha.extdirectspring.annotation.ExtDirectMethodType.POLL;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Base64;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.... | package ch.rasc.eds.starter.service;
@Service
public class SecurityService {
public static final String AUTH_USER = "authUser";
private final MongoDb mongoDb;
private final PasswordEncoder passwordEncoder;
private final MailService mailService;
private final ApplicationEventPublisher applicationEventPub... | if (TotpAuthUtil.verifyCode(user.getSecret(), code, 3)) { | 5 |
hageldave/ImagingKit | ImagingKit_Core/src/test/java/hageldave/imagingkit/core/examples/CodeSnippets.java | [
"public class Img implements ImgBase<Pixel> {\n\n\t/** boundary mode that will return 0 for out of bounds positions.\n\t * @see #getValue(int, int, int)\n\t * @since 1.0\n\t */\n\tpublic static final int boundary_mode_zero = 0;\n\n\t/** boundary mode that will repeat the edge of of an Img for out of\n\t * bounds po... | import java.awt.Color;
import java.awt.image.BufferedImage;
import java.net.URL;
import hageldave.imagingkit.core.Img;
import hageldave.imagingkit.core.Pixel;
import hageldave.imagingkit.core.io.ImageLoader;
import hageldave.imagingkit.core.io.ImageSaver;
import hageldave.imagingkit.core.operations.ColorSpaceTransforma... | package hageldave.imagingkit.core.examples;
public class CodeSnippets {
public static void main(String[] args) {
}
static URL resource(String res){
return CodeSnippets.class.getResource(res);
}
static void ex1(){
Img img = ImageLoader.loadImgFromURL(resource("/lena.512.png").toString());
/////////... | ImageSaver.saveImage(buffimg,"myimage_grayscale.png"); | 3 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/VFSUtils.java | [
"public class FileURLStreamHandler extends AbstractLocalURLStreamHandler {\n @Override\n protected URLConnection openConnection(final URL url) throws IOException {\n ensureLocal(url);\n return new FileURLConnection(url);\n }\n}",
"public class VirtualFileURLStreamHandler extends AbstractLoc... | import static org.jboss.vfs.VFSMessages.MESSAGES;
import java.io.Closeable;
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.io.UnsupportedEncodingException;
import java.net.MalformedURL... | /*
* JBoss, Home of Professional Open Source
* Copyright 2006, JBoss Inc., and individual contributors as indicated
* by the @authors tag.
*
* 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
... | public static final URLStreamHandler FILE_URL_HANDLER = new FileURLStreamHandler(); | 0 |
lheido/LheidoSMS | app/src/main/java/com/lheidosms/fragment/SmsBaseFragment.java | [
"public abstract class SmsBaseAdapter extends BaseAdapter {\n protected final String mPhoneContact;\n protected LheidoUtils.UserPref userPref;\n protected ArrayList<Message> mList;\n protected Context mContext;\n\n public SmsBaseAdapter(Context context,String contactPhone, ArrayList<Message> conversa... | import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.t... | package com.lheidosms.fragment;
/**
* Created by lheido on 30/10/14.
*/
public abstract class SmsBaseFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener {
public static final String ARG_CONVERSATION_ID = "conversation_id";
public static final String ARG_CONVERSATION_COUNT = "convers... | protected LheidoUtils.UserPref userPref; | 3 |
HarryXR/SimpleNews | app/src/main/java/com/lauren/simplenews/news/widget/NewsDetailActivity.java | [
"public class NewsBean implements Serializable {\n\n /**\n * docid\n */\n public String docid;\n /**\n * 标题\n */\n public String title;\n /**\n * 小内容\n */\n public String digest;\n /**\n * 图片地址\n */\n public String imgsrc;\n /**\n * 来源\n */\n pub... | import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ProgressBar;
import com.lauren.simplenews.R;
import com.lauren.simplenews.beans.NewsBean;
import com.lauren.simplenews.news.presenter.NewsDeta... | package com.lauren.simplenews.news.widget;
/**
* Description : 新闻详情界面
* Author : lauren
* Email : lauren.liuling@gmail.com
* Blog : http://www.liuling123.com
* Date : 15/12/19
*/
public class NewsDetailActivity extends SwipeBackActivity implements NewsDetailView {
private NewsBean mNews;
privat... | ((GlideImageView) findViewById(R.id.ivImage)).setImageURL(mNews.imgsrc); | 5 |
juiser/juiser | spring/spring-boot-starter/src/main/java/org/juiser/spring/boot/config/JuiserAutoConfiguration.java | [
"public interface ResourceLoader {\n\n Resource getResource(String path) throws IOException;\n}",
"public class FallbackSigningKeyResolver extends SigningKeyResolverAdapter {\n\n private final SigningKeyResolver delegate;\n private final Key fallbackKey;\n\n public FallbackSigningKeyResolver(SigningKe... | import io.jsonwebtoken.Claims;
import io.jsonwebtoken.SigningKeyResolver;
import io.jsonwebtoken.lang.Strings;
import org.juiser.io.ResourceLoader;
import org.juiser.jwt.FallbackSigningKeyResolver;
import org.juiser.jwt.JwsClaimsExtractor;
import org.juiser.jwt.config.ConfigJwkResolver;
import org.juiser.jwt.config.Jwk... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | resolver = new FallbackSigningKeyResolver(resolver, key); | 1 |
UweTrottmann/Shopr | Android/Shopr/src/main/java/com/uwetrottmann/shopr/ui/ShopMapFragment.java | [
"public class ShopLoader extends GenericSimpleLoader<List<Shop>> {\n\n public ShopLoader(Context context) {\n super(context);\n }\n\n @Override\n public List<Shop> loadInBackground() {\n final Cursor query = getContext().getContentResolver().query(Shops.CONTENT_URI,\n new St... | import android.os.Bundle;
import android.support.v4.app.LoaderManager.LoaderCallbacks;
import android.support.v4.content.Loader;
import android.util.Log;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.BitmapDescript... |
package com.uwetrottmann.shopr.ui;
public class ShopMapFragment extends SupportMapFragment implements LoaderCallbacks<List<Shop>> {
private static final int RADIUS_METERS = 2000;
private static final int ZOOM_LEVEL_INITIAL = 14;
public static final String TAG = "Shops Map";
private static final i... | .registerSticky(this, LocationUpdateEvent.class, ShopUpdateEvent.class); | 3 |
InfinityRaider/NinjaGear | src/main/java/com/infinityraider/ninjagear/item/ItemShuriken.java | [
"@Mod(Reference.MOD_ID)\npublic class NinjaGear extends InfinityMod<IProxy, Config> {\n public static NinjaGear instance;\n\n public NinjaGear() {\n super();\n }\n\n @Override\n public String getModId() {\n return Reference.MOD_ID;\n }\n\n @Override\n protected void onModConstr... | import com.infinityraider.ninjagear.NinjaGear;
import com.infinityraider.ninjagear.api.v1.IHiddenItem;
import com.infinityraider.ninjagear.entity.EntityShuriken;
import com.infinityraider.ninjagear.handler.NinjaAuraHandler;
import com.infinityraider.ninjagear.reference.Reference;
import com.infinityraider.ninjagear.reg... | package com.infinityraider.ninjagear.item;
@MethodsReturnNonnullByDefault
public class ItemShuriken extends ItemBase implements IHiddenItem {
public ItemShuriken() {
super("shuriken", new Properties().group(ItemRegistry.CREATIVE_TAB));
}
@Override
@ParametersAreNonnullByDefault
public Ac... | tooltip.add(new TranslationTextComponent(Reference.MOD_ID + ".tooltip:" + this.getInternalName() + "_L1")); | 4 |
manuelsc/Raven-Messenger | Raven App/src/main/java/at/flack/activity/QRCreator.java | [
"public class KeyEntity implements Serializable{\n\n\tprivate static final long serialVersionUID = 1L;\n\t\n\tprivate byte [] key;\n\tprivate byte [] key2;\n\tprivate byte version;\n\tprivate long timestamp;\n\t\n\t// Format: HASH_ENCRYPTION_ENCRYPTION_VERSION\n\tpublic static final byte BLAKE_AES_NONE_1 \t\t= \t0x... | import safe.KeyEntity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.telephony.TelephonyMa... | /*
Copyright 2015 Philipp Adam, Manuel Caspari, Nicolas Lukaschek
contact@ravenapp.org
This file is part of Raven.
Raven is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | ExchangeInformation ei = null; | 5 |
zzz40500/ThemeDemo | baselibrary/src/main/java/com/dim/widget/Spinner.java | [
"public interface CircleRevealEnable {\n\n\n\n CRAnimation circularReveal(int centerX, int centerY, float startRadius, float endRadius);\n\n void superDraw(Canvas canvas);\n\n\n}",
"public class CircleRevealHelper {\n\n private ValueAnimator mValueAnimator;\n\n public CircleRevealHelper(View view) {\n... | import android.content.Context;
import android.graphics.Canvas;
import android.support.v7.widget.AppCompatSpinner;
import android.util.AttributeSet;
import com.dim.circletreveal.CircleRevealEnable;
import com.dim.circletreveal.CircleRevealHelper;
import com.dim.listener.SingleClickListener;
import com.dim.skin.SkinEnab... | package com.dim.widget;
/**
* Created by zzz40500 on 15/8/26.
*/
public class Spinner extends AppCompatSpinner implements CircleRevealEnable,SkinEnable {
private CircleRevealHelper mCircleRevealHelper ; | private SkinHelper mSkinHelper; | 5 |
LegendOnline/InventoryAPI | src/main/java/com/minecraftlegend/inventoryapi/McOptionPane.java | [
"public class GUIButton extends GUILabel {\n\n private boolean lock = true;\n\n public GUIButton( String title ) {\n super( title );\n }\n\n public GUIButton( ItemStack item ) {\n super( item );\n }\n\n public GUIButton( String title, Material icon ) {\n super( title, icon );\... | import com.minecraftlegend.inventoryapi.Elements.GUIButton;
import com.minecraftlegend.inventoryapi.Elements.GUILabel;
import com.minecraftlegend.inventoryapi.Events.ComponentClickEvent;
import com.minecraftlegend.inventoryapi.Events.ContainerCloseEvent;
import com.minecraftlegend.inventoryapi.Events.GUIEventCallback;
... | package com.minecraftlegend.inventoryapi;
/**
* @Author Sauerbier | Jan
* @Copyright 2016 by Jan Hof
* All rights reserved.
**/
public class McOptionPane {
/**
* Opens a confirm / deny dialog
* @param plugin to attach events to
* @param player the player to whom the dialog should be visible
... | public void onClose( ContainerCloseEvent event ) { | 3 |
cmusatyalab/elijah-provisioning | android/android/src/edu/cmu/cs/cloudlet/android/test/BatchSynthesisTest.java | [
"public class CloudletActivity extends Activity {\n\tpublic static String CLOUDLET_SYNTHESIS_IP = \"cloudlet.krha.kr\";\n\tpublic static int CLOUDLET_SYNTHESIS_PORT = 8021;\n\n\tprivate static final int SYNTHESIS_MENU_ID_SETTINGS = 11123;\n\tprivate static final int SYNTHESIS_MENU_ID_CLEAR = 12311;\n\n\tprotected B... | import java.io.File;
import java.util.ArrayList;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.M... | package edu.cmu.cs.cloudlet.android.test;
public class BatchSynthesisTest extends Activity {
private static String ADDRESS = "128.2.210.197";
private static final int PORT = 8021;
private ArrayList<VMInfo> overlayVMList;
private CloudletConnector connector;
private ProgressDialog progDialog;
@Override
pub... | CloudletCameraActivity.class); | 2 |
galan/jalita | src/main/java/net/sf/jalita/examples/login/LoginForm.java | [
"public class TerminalEvent extends EventObject {\n\n\t//--------------------------------------------------------------------------\n\t// constants\n\t//--------------------------------------------------------------------------\n\n\t/** represents key F1 */\n\tpublic final static int KEY_F01 = -1;\n\n\t/** represen... | import net.sf.jalita.io.TerminalEvent;
import net.sf.jalita.ui.automation.FormAutomationSet;
import net.sf.jalita.ui.forms.BasicForm;
import net.sf.jalita.ui.widgets.ButtonListener;
import net.sf.jalita.ui.widgets.ButtonWidget;
import net.sf.jalita.ui.widgets.LabelWidget;
import net.sf.jalita.ui.widgets.PasswordFieldWi... | /***********************************************************************
* This software is published under the terms of the LGPL
* License version 2.1, a copy of which has been included with this
* distribution in the 'lgpl.txt' file.
* Author: Daniel Galán y Martins
* Creation date: 05.08.2004 - 01:05:05
* Revi... | private PasswordFieldWidget textPass; | 6 |
diribet/aqdef-tools | src/main/java/cz/diribet/aqdef/parser/AqdefParser.java | [
"public interface AqdefConstants {\n\n\t/**\n\t * Separates lines of data file\n\t */\n\tString LINE_SEPARATOR = \"\\r\\n\";\n\n\t/**\n\t * Separates value from k-key on single line\n\t */\n\tString VALUES_SEPARATOR = \" \";\n\n\t/**\n\t * Separates fields of single characteristic in lines with measured values (not... | import cz.diribet.aqdef.AqdefConstants;
import cz.diribet.aqdef.KKey;
import cz.diribet.aqdef.model.AqdefObjectModel;
import cz.diribet.aqdef.parser.line.AbstractLineParser;
import cz.diribet.aqdef.parser.line.BinaryLineParser;
import cz.diribet.aqdef.parser.line.KKeyLineParser;
import org.apache.commons.io.input.BOMIn... | package cz.diribet.aqdef.parser;
/**
* Parses {@link AqdefObjectModel} from a AQDEF content (file or other data source)
*
* @author Vlastimil Dolejs
*
*/
public class AqdefParser implements AqdefConstants {
private static final Logger LOG = LoggerFactory.getLogger(AqdefParser.class);
private final AbstractL... | public void setSuppressInvalidKKeyLoggingFor(Set<KKey> suppressInvalidKKeyLoggingFor) { | 1 |
ibm-datapower/ertool | framework/src/com/ibm/datapower/er/ERTool.java | [
"public class AnalyticsProcessor {\n\tpublic enum PRINT_MET_CONDITIONS {\n\t\tHIDEALL, HIDEDEFAULT, SHOWALL\n\t}\n\n\tpublic enum REPORT_TYPE {\n\t\tUNKNOWN, DATAPOWER_REPORT, POSTMORTEM, // Todo: We need some sort of\n\t\t\t\t\t\t\t\t\t\t\t\t// break down, but I think most\n\t\t\t\t\t\t\t\t\t\t\t\t// post mortems ... | import com.ibm.datapower.er.mgmt.ERMgmtException;
import com.ibm.logging.icl.Level;
import com.ibm.logging.icl.Logger;
import com.ibm.logging.icl.LoggerFactory;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.ResourceBund... | for(int i=0;i<reports.size();i++)
fileNames.add(dirList + reports.get(i));
}
switch (gui.getPrintConditions()) {
case SHOWALL: {
printConditions = "showall";
break;
}
case HIDEDEFAULT: {
printConditions = "hidedefault";
break;
}
case HIDEALL: {
printConditions = "hi... | ParseTransx transx = new ParseTransx(); | 3 |
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_START_SIGN, EMPTY_STRING) | 1 |
xcltapestry/XCL-Charts | lib/src/main/java/org/xclcharts/renderer/AxesChart.java | [
"public interface IFormatterDoubleCallBack {\n\t\n\tpublic String doubleFormatter(Double value);\n\t\n\t\n}",
"public class CategoryAxis extends XYAxis {\n\t\n\t//分类轴分隔值\t\n\tprivate double mAxisSteps = 0.0d;\n\t\n\tprivate boolean mAxisBindStd = false;\n\t\n\tpublic CategoryAxis()\n\t{\n\t\t\n\t}\n\t\n\t/**\n\t... | import org.xclcharts.renderer.plot.AxisTitle;
import org.xclcharts.renderer.plot.AxisTitleRender;
import android.graphics.Canvas;
import android.graphics.Paint.Align;
import android.util.Log;
import java.util.ArrayList;
import org.xclcharts.common.IFormatterDoubleCallBack;
import org.xclcharts.renderer.axis.CategoryAxi... | /**
* Copyright 2014 XCL-Charts
*
* 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... | private IFormatterDoubleCallBack mItemLabelFormatter; | 0 |
canyapan/DietDiaryApp | app/src/main/java/com/canyapan/dietdiaryapp/helpers/DailyReminderServiceHelper.java | [
"public class DatabaseHelper extends SQLiteOpenHelper {\n public static final DateTimeFormatter DB_DATE_FORMATTER = DateTimeFormat.forPattern(\"yyyy-MM-dd\");\n public static final DateTimeFormatter DB_TIME_FORMATTER = DateTimeFormat.forPattern(\"HH:mm\");\n public static final String DBT_EVENT = \"[Event]... | import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.v7.preference.PreferenceManager;
import com.canyapan.dietdiaryapp.db.DatabaseHelper;
import com.canyapan.dietdiaryapp.services.DailyReminderService;
import com.firebase.jobdispatch... | package com.canyapan.dietdiaryapp.helpers;
public class DailyReminderServiceHelper {
private static final String DEFAULT_TIME = "19:00";
public static void setup(@NonNull final Context context) {
setup(context, PreferenceManager.getDefaultSharedPreferences(context));
}
public static void ... | .setService(DailyReminderService.class) | 1 |
enebo/racob | unittest/org/racob/test/vbscript/ScriptTest.java | [
"public class ActiveXComponent extends Dispatch {\n\n\t/**\n\t * Normally used to create a new connection to a microsoft application. The\n\t * passed in parameter is the name of the program as registered in the\n\t * registry. It can also be the object name.\n\t * <p>\n\t * This constructor causes a new Windows ob... | import org.racob.activeX.ActiveXComponent;
import org.racob.com.ComException;
import org.racob.com.ComThread;
import org.racob.com.Dispatch;
import org.racob.com.DispatchEvents;
import org.racob.com.Variant;
import org.racob.test.BaseTestCase; | package org.racob.test.vbscript;
/**
* In this case the component is created and used in the same thread and it's an
* Apartment Threaded component, so we call InitSTA.
* <p>
* May need to run with some command line options (including from inside
* Eclipse). Look in the docs area at the Jacob usage document for ... | Dispatch sControl = sC.getObject(); | 3 |
gresrun/jesque | src/main/java/net/greghaines/jesque/meta/dao/impl/QueueInfoDAORedisImpl.java | [
"public class Job implements Serializable {\n \n private static final long serialVersionUID = -1523425239512691383L;\n\n private String className;\n private Object[] args;\n private Map<String,Object> vars;\n private Map<String,Object> unknownFields = new HashMap<String,Object>();\n private Dou... | import static net.greghaines.jesque.utils.ResqueConstants.PROCESSED;
import static net.greghaines.jesque.utils.ResqueConstants.QUEUE;
import static net.greghaines.jesque.utils.ResqueConstants.QUEUES;
import static net.greghaines.jesque.utils.ResqueConstants.STAT;
import java.util.ArrayList;
import java.util.Collections... | return PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, List<QueueInfo>>() {
/**
* {@inheritDoc}
*/
@Override
public List<QueueInfo> doWork(final Jedis jedis) throws Exception {
final List<QueueInfo> queueInfos = new A... | final Job job = ObjectMapperFactory.get().readValue(elementWithScore.getElement(), Job.class); | 1 |
Chanven/CommonPullToRefresh | cptr_demo/src/com/chanven/cptr/demo/GridViewAtivity.java | [
"public class PtrClassicFrameLayout extends PtrFrameLayout {\n\n private PtrClassicDefaultHeader mPtrClassicHeader;\n\n public PtrClassicFrameLayout(Context context) {\n super(context);\n initViews();\n }\n\n public PtrClassicFrameLayout(Context context, AttributeSet attrs) {\n supe... | import com.chanven.lib.cptr.loadmore.OnLoadMoreListener;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.v... | /*
Copyright 2015 chanven
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribu... | ptrClassicFrameLayout.setOnLoadMoreListener(new OnLoadMoreListener() { | 4 |
bkimminich/kata-botwars | botwars-java/src/test/java/de/kimminich/kata/botwars/effects/negative/BombTest.java | [
"public class Bot {\n\n private final String name;\n private final double criticalHit;\n private final double effectiveness;\n private Random random = new Random();\n private Player owner;\n private int power;\n private int armor;\n private int speed;\n private double evasion;\n privat... | import de.kimminich.kata.botwars.Bot;
import de.kimminich.kata.botwars.Player;
import de.kimminich.kata.botwars.effects.Effect;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import static de.kimminich.kata.botwars.builders.BotBuilder.aBot;
import stati... | package de.kimminich.kata.botwars.effects.negative;
@DisplayName("A Bomb effect")
public class BombTest {
@Test
@DisplayName("causes damage when it expires")
void causesDamageWhenExpiring() { | Effect bomb = createEffectFactoryFor(anyBot(), | 2 |
jDramaix/SlidingPuzzle | src/be/dramaix/ai/slidingpuzzle/client/SlidingPuzzleApp.java | [
"public interface ResolveServiceAsync {\n\n\tpublic ResolveServiceAsync INSTANCE = GWT.create(ResolveService.class);\n\n\tvoid resolve(State start, State goal, AlgorithmType algorithmType,\n\t\t\tHeuristicType heuristicType, AsyncCallback<PuzzleSolution> callback);\n\n}",
"public enum AlgorithmType {\n\n\tBDF(\"B... | import static be.dramaix.ai.slidingpuzzle.client.MySelectors.SELECTOR;
import static com.google.gwt.query.client.GQuery.$;
import be.dramaix.ai.slidingpuzzle.client.rpc.ResolveServiceAsync;
import be.dramaix.ai.slidingpuzzle.shared.AlgorithmType;
import be.dramaix.ai.slidingpuzzle.shared.HeuristicType;
import be.dramai... | /*
* Copyright 2011 Julien Dramaix.
*
* 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 ... | ResolveServiceAsync.INSTANCE.resolve(start, | 0 |
icclab/cyclops-dashboard | src/main/java/ch/cyclops/BillingController.java | [
"public class Loader {\n// final static Logger logger = LogManager.getLogger(Loader.class.getName());\n\n // singleton pattern\n private static Loader singleton;\n\n // loaded settings and environment\n private Settings settings;\n\n /**\n * Constructor has to be private, as we are using singl... | import ch.cyclops.load.Loader;
import ch.cyclops.model.Cyclops.*;
import ch.cyclops.model.Data.CdrMeasurement;
import ch.cyclops.model.Data.GenericChargeData;
import ch.cyclops.model.Data.GenericUsageData;
import ch.cyclops.model.Data.UdrMeasurement;
import ch.cyclops.model.OpenStack.*;
import ch.cyclops.publish.APICal... | ClientResource cr = new ClientResource(url);
Request req = cr.getRequest();
// now header
Series<Header> headerValue = new Series<Header>(Header.class);
req.getAttributes().put(HeaderConstants.ATTRIBUTE_HEADERS, headerValue);
headerValue.add("X-Au... | APICaller.Response response = new APICaller().post(new URL(billingUrl), billRequest); | 5 |
8Yards/Nebula_Android | src/org/nebula/activities/AddGroup.java | [
"public class RESTConversationManager extends Resource {\r\n\r\n\tprivate double[] distances = { 0.02, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10, 20,\r\n\t\t\t50, 100, 250, 500 };\r\n\r\n\tpublic RESTConversationManager() {\r\n\t\tsuper(\"RESTConversations\");\r\n\t}\r\n\r\n\tpublic Status addNewConversation(Conversation c... | import java.util.ArrayList;
import org.nebula.R;
import org.nebula.client.rest.RESTConversationManager;
import org.nebula.client.rest.RESTGroupManager;
import org.nebula.main.NebulaApplication;
import org.nebula.models.Conversation;
import org.nebula.models.ConversationThread;
import org.nebula.models.Group;
im... | /*
* author: saad ali
* rearchitecture and programming: saad ali
*/
package org.nebula.activities;
public class AddGroup extends Activity implements OnSeekBarChangeListener {
public static final int ADDGROUP_SUCCESSFULL = 1;
public static final int ADDGROUP_FAILURE = 0;
private AbsoluteLayout ... | private MyIdentity myIdentity;
| 6 |
ggeorgovassilis/spring-rest-invoker | src/main/java/com/github/ggeorgovassilis/springjsonmapper/jaxrs/JaxRsAnnotationMethodInspector.java | [
"public class MappingDeclarationException extends RuntimeException {\n\tprotected Method method;\n\tprotected Annotation annotation;\n\tprotected int parameterIndex;\n\n\tpublic MappingDeclarationException(String message, Method method, Annotation annotation, int parameterIndex) {\n\t\tsuper(message);\n\t\tthis.met... | import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.BeanParam;
import javax.ws.rs.Consumes;
import javax.ws.rs.CookieParam;
import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderPa... | package com.github.ggeorgovassilis.springjsonmapper.jaxrs;
/**
* Looks at methods and extracts {@link Path}, {@link GET}, {@link QueryParam}
* etc annotations
*
* @author george georgovassilis
*
*/
public class JaxRsAnnotationMethodInspector extends BaseAnnotationMethodInspector {
/*
* RequestMapping -... | throw new MappingDeclarationException("Missing @Path on method " + method, method, path, -1); | 0 |
peterchenhdu/webbf | src/main/java/cn/edu/hdu/webbf/core/quartzjobs/AddUserJob.java | [
"public class BFConstant\n{\n\n public static final String TRUE = \"true\";\n public static final String FALSE = \"false\";\n}",
"public class Logger\n{\n private org.slf4j.Logger logger;\n\n /**\n * Default constructor\n * \n * @param clazz Name of the class to log.\n */\n public L... | import java.util.Properties;
import java.util.Random;
import java.util.UUID;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;
import cn.edu.hdu.webbf.common.constant.BFConstant;
import cn.edu.hdu.webbf.common.log.Logger;
import c... | /*
* File Name: DayEndJob.java
* Description:
* Author: Pi Chen
* Create Date: 2016年9月8日
*
*/
package cn.edu.hdu.webbf.core.quartzjobs;
/**
*
* 每天 执行一次
*
* @author Pi Chen
* @version webbf V1.0.0, 2016年9月8日
* @see
* @since webbf V1.0.0
*/
public class AddUserJob extends QuartzJobBean
{
... | Properties properties =ProjectConfigUtil.getConfig(); | 6 |
jentrata/jentrata | ebms-as4/src/test/java/org/jentrata/ebms/as4/internal/routes/WSSERouteBuilderTest.java | [
"public class EbmsConstants {\n\n public static final String JENTRATA_VERSION = \"JentrataVersion\";\n\n //Jentrata Message Header keys\n public static final String SOAP_VERSION = \"JentrataSOAPVersion\";\n public static final String EBMS_VERSION = \"JentrataEBMSVersion\";\n public static final Strin... | import org.apache.camel.Exchange;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultExchange;
import org.apache.camel.test.junit4.CamelTestSupport;
import org.apache.commons.io.IOUtils;
import org.apache.wss4j.common.crypto.Crypto;
import org.apache.wss4j.common.crypto.CryptoFactory;
imp... | request.getIn().setHeader(EbmsConstants.MESSAGE_PAYLOADS,payloads);
request.getIn().setHeader(EbmsConstants.MESSAGE_TYPE, MessageType.USER_MESSAGE);
Exchange response = context().createProducerTemplate().send("direct:wsseAddSecurityToHeader",request);
Document body = response.getIn().ge... | UsernameToken authorization = new UsernameToken(); | 6 |
longdivision/hex | app/src/main/java/com/hexforhn/hex/fragment/StoryListFragment.java | [
"public class HexApplication extends Application {\n\n private RequestQueue mRequestQueue;\n\n public final String apiBaseUrl = \"https://hex-api.herokuapp.com\";\n\n public void onCreate() {\n super.onCreate();\n setupAnalytics();\n }\n\n public RequestQueue getRequestQueue() {\n ... | import android.app.Fragment;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
im... | }
}
@Override
public void onClick(View v, int position, boolean isLongClick) {
openStoryAtPosition(position);
}
private List<Story> extractStories(Bundle savedInstanceState) {
if (savedInstanceState == null) { return null; }
List<Story> stories = null;
Stri... | List<StoryListItemViewModel> storyListItems = StoryListItemFactory.createItemListItems(stories); | 7 |
graywolf336/Jail | src/main/java/com/graywolf336/jail/command/CommandHandler.java | [
"public class JailMain extends JavaPlugin {\n private CommandHandler cmdHand;\n private HandCuffManager hcm;\n private JailHandler jh;\n private JailIO io;\n private JailManager jm;\n private IJailPayManager jpm;\n private IJailStickManager jsm;\n private JailTimer jt;\n private JailVoteM... | import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map.Entry;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.graywolf336.jail.JailMain;
import com.graywolf336.jail.JailManager;
import com.graywolf336.jai... | package com.graywolf336.jail.command;
/**
* Where all the commands are registered, handled, and processed.
*
* @author graywolf336
* @since 3.0.0
* @version 1.0.2
*
*/
public class CommandHandler {
private LinkedHashMap<String, Command> commands;
public CommandHandler(JailMain plugin) {
com... | load(ToggleJailDebugCommand.class); | 3 |
bourgesl/marlin-fx | src/main/java/com/sun/marlin/ByteArrayCache.java | [
"static final int[] ARRAY_SIZES = new int[BUCKETS];",
"static final int BUCKETS = 8;",
"static final int MAX_ARRAY_SIZE;",
"public static void logInfo(final String msg) {\n if (MarlinConst.USE_LOGGER) {\n LOG.info(msg);\n } else if (MarlinConst.ENABLE_LOGS) {\n System.out.print(\"INFO: \")... | import java.lang.ref.WeakReference;
import java.util.Arrays;
import com.sun.marlin.ArrayCacheConst.BucketStats;
import com.sun.marlin.ArrayCacheConst.CacheStats;
import static com.sun.marlin.ArrayCacheConst.ARRAY_SIZES;
import static com.sun.marlin.ArrayCacheConst.BUCKETS;
import static com.sun.marlin.ArrayCacheConst.M... | /*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free ... | buckets[i] = new Bucket(clean, ARRAY_SIZES[i], bucketCapacity, | 0 |
michel-kraemer/bson4jackson | src/test/java/de/undercouch/bson4jackson/serializers/BsonSerializersTest.java | [
"public class BsonFactory extends JsonFactory {\n private static final long serialVersionUID = 1991836957699496674L;\n\n /**\n * The BSON generator features enabled by default\n */\n protected static final int DEFAULT_BSON_GENERATOR_FEATURE_FLAGS = 0;\n\n /**\n * The BSON parser features ena... | import com.fasterxml.jackson.databind.ObjectMapper;
import de.undercouch.bson4jackson.BsonFactory;
import de.undercouch.bson4jackson.BsonModule;
import de.undercouch.bson4jackson.types.JavaScript;
import de.undercouch.bson4jackson.types.ObjectId;
import de.undercouch.bson4jackson.types.Symbol;
import de.undercouch.bson... | package de.undercouch.bson4jackson.serializers;
/**
* Tests {@link BsonSerializers}
* @author Michel Kraemer
*/
public class BsonSerializersTest {
private static Object generateAndParse(Object data) throws Exception {
Map<String, Object> m = new LinkedHashMap<>();
m.put("data", data);
... | JavaScript js = new JavaScript("code"); | 2 |
ivannov/predcomposer | src/test/java/com/nosoftskills/predcomposer/rest/resources/CompetitionResourceTest.java | [
"@Stateless\npublic class CompetitionsService implements Serializable {\n\n public static final String DEFAULT_COMPETITION_NAME = \"Champions League 2016-2017\";\n\n private static final long serialVersionUID = 7432416155835050214L;\n\n @PersistenceContext\n EntityManager entityManager;\n\n private s... | import com.nosoftskills.predcomposer.competition.CompetitionsService;
import com.nosoftskills.predcomposer.model.Competition;
import com.nosoftskills.predcomposer.rest.RestConfiguration;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient;
import org.jbo... | package com.nosoftskills.predcomposer.rest.resources;
/**
* @author Ivan St. Ivanov
*/
@RunWith(Arquillian.class)
@RunAsClient
public class CompetitionResourceTest {
private static final String COMPETITION_NAME = "Champions League 2015";
private static final String COMPETITION_DESCRIPTION = "Ils sont les... | .addClasses(CompetitionResource.class, RestConfiguration.class) | 2 |
jameskennard/mockito-collections | mockito-collections-core/src/main/java/uk/co/webamoeba/mockito/collections/internal/Initialiser.java | [
"public class CollectionFactory {\n\n\t/**\n\t * Creates a new {@link Collection} of the specified type and populates with the specified contents. If the contents\n\t * is <code>null</code> the new {@link Collection} will be empty. The returned {@link Collection} will retain the\n\t * order of the elements where ev... | import java.lang.reflect.Field;
import java.util.Collection;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import uk.co.webamoeba.mockito.collections.inject.CollectionFactory;
import uk.co.webamoeba.mockito.collections.inject.CollectionInjector;
import uk.co.webamoeba.m... | package uk.co.webamoeba.mockito.collections.internal;
/**
* Utility class, comparable to {@link MockitoAnnotations}, which orchestrates the injection of {@link Collection
* Collections} of Mockito Mocks. This class will scan an {@link Object}, typically a Mockito style unit test, and
* inject the values of {@lin... | GenericCollectionTypeResolver genericCollectionTypeResolver = new GenericCollectionTypeResolver(); | 8 |
KKorvin/uPods-android | app/src/androidTest/java/com/chickenkiller/upods2/NewEpisodesTest.java | [
"public class UpodsApplication extends Application {\n\n private static final int CHECK_NEW_EPISODS_INTENT_CODE = 2302;\n\n private static final String TAG = \"UpodsApplication\";\n private static Context applicationContext;\n private static SQLdatabaseManager databaseManager;\n private static boolea... | import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.SmallTest;
import com.chickenkiller.upods2.controllers.app.UpodsApplication;
import com.chickenkiller.upods2.models.Episode;
import com.chickenkiller.upods2.models.Feed;
import com.chickenkiller.upods2.models.Podcast;
import c... | package com.chickenkiller.upods2;
/**
* Created by Alon Zilberman on 3/8/16.
*/
@RunWith(AndroidJUnit4.class)
@SmallTest
public class NewEpisodesTest {
private static final String REAL_PODCAST_FEED_RU = "http://wylsa.com/PODCAST/podcast.xml";
private static final String REAL_PODCAST_FEED_ENG = "https... | Logger.printInfo("checkNoUpdatesENGScenario", "Feed saved locally..."); | 5 |
sworisbreathing/jpathwatch | jpathwatch-java/src/main/java/name/pachler/nio/file/impl/BSDPathWatchService.java | [
"public class ClosedWatchServiceException extends IllegalStateException {\n\n}",
"public abstract class Path implements Watchable {\n\n\tprotected Path(){\n\t}\n\n\t@Override\n\tpublic abstract boolean equals(Object obj);\n\n\t@Override\n\tpublic abstract int hashCode();\n\n\tpublic abstract WatchKey register(Wat... | import java.util.Set;
import java.util.concurrent.TimeUnit;
import name.pachler.nio.file.ClosedWatchServiceException;
import name.pachler.nio.file.Path;
import name.pachler.nio.file.WatchEvent.Kind;
import name.pachler.nio.file.WatchEvent.Modifier;
import name.pachler.nio.file.WatchKey;
import name.pachler.nio.file.ext... | }
// first poll to capture initial state
key.poll();
return key;
}
@Override
synchronized void cancel(PathWatchKey pathWatchKey) {
// request change lock
byte[] b = new byte[1];
write(closePipeWriteFd, b, 1);
synchronized(changeLock){
boolean eventsAdded = cancelImpl(pathWatchKey);
if(events... | public WatchKey poll() throws InterruptedException, ClosedWatchServiceException { | 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 EntityPuffShroom(world); | 3 |
ferstl/depgraph-maven-plugin | src/main/java/com/github/ferstl/depgraph/AggregatingDependencyGraphMojo.java | [
"public class AggregatingGraphFactory implements GraphFactory {\n\n private final MavenGraphAdapter mavenGraphAdapter;\n private final Supplier<Collection<MavenProject>> subProjectSupplier;\n private final ArtifactFilter globalFilter;\n private final GraphBuilder<DependencyNode> graphBuilder;\n private final b... | import java.util.EnumSet;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
imp... | /*
* Copyright (c) 2014 - 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 ... | DependencyNodeIdRenderer nodeIdRenderer = DependencyNodeIdRenderer.versionlessId() | 2 |
rapidftr/RapidFTR-Android | RapidFTR-Android/src/test/java/com/rapidftr/repository/ChildRepositoryTest.java | [
"public class CustomTestRunner extends RobolectricTestRunner {\n\n public static List<FormSection> formSectionSeed = Arrays.asList(\n new FormSection(new HashMap<String, String>() {{\n put(\"en\", \"Section 1\");\n }}, 1, true, new HashMap<String, String>() {{\n ... | import android.database.Cursor;
import com.rapidftr.CustomTestRunner;
import com.rapidftr.RapidFtrApplication;
import com.rapidftr.database.Database;
import com.rapidftr.database.DatabaseSession;
import com.rapidftr.database.ShadowSQLiteHelper;
import com.rapidftr.forms.FormField;
import com.rapidftr.forms.FormSection;... | @Test
public void shouldReturnRecordsBetweenSpecifiedLimits() throws JSONException {
session = mock(DatabaseSession.class);
repository = spy(new ChildRepository("user1", session, rapidFtrApplication));
doReturn(new ArrayList<Child>()).when(repository).toChildren(any(Cursor.class));
... | child.put(Database.ChildTableColumn.owner.getColumnName(), "new owner"); | 1 |
wmaop/wm-aop | src/main/java/org/wmaop/chainprocessor/AOPChainProcessor.java | [
"public class Advice {\n\n\tprivate final PointCut pointCut;\n\tprivate final Interceptor interceptor;\n\tprivate final String id;\n\tprivate AdviceState adviceState = AdviceState.NEW;\n\tprivate final Remit remit;\n\n\tpublic Advice(String id, Remit remit, PointCut pointCut, Interceptor interceptor) {\n\t\tthis.po... | import static org.wmaop.aop.advice.AdviceState.ENABLED;
import static org.wmaop.aop.interceptor.InterceptPoint.AFTER;
import static org.wmaop.aop.interceptor.InterceptPoint.BEFORE;
import static org.wmaop.aop.interceptor.InterceptPoint.INVOKE;
import java.util.Iterator;
import org.apache.commons.lang.builder.Refle... | package org.wmaop.chainprocessor;
public class AOPChainProcessor implements InvokeChainProcessor {
private static final InterceptResult NO_INTERCEPT = new InterceptResult(false);
private static final Logger logger = Logger.getLogger(AOPChainProcessor.class);
private static AOPChainProcessor insta... | adviceManager.reset(Scope.ALL);
| 2 |
Someone52/CS2-Decompiler | src/tests/TestProvider.java | [
"public class CS2 {\r\n\r\n\tprivate String name;\r\n\tprivate CS2Type[] argumentsTypes;\r\n\tprivate String[] argumentNames;\r\n\tprivate CS2Type returnType = CS2Type.UNKNOWN;\r\n\tprivate int intLocalsSize, stringLocalsSize, longLocalsSize;\r\n\tprivate int intArgumentsCount, stringArgumentsCount, longArgumentsCo... | import java.io.File;
import java.io.IOException;
import mgi.tools.jagdecs2.CS2;
import mgi.tools.jagdecs2.CS2Decoder;
import mgi.tools.jagdecs2.ICS2Provider;
import mgi.tools.jagdecs2.util.ConfigsDatabase;
import mgi.tools.jagdecs2.util.FunctionDatabase;
import mgi.tools.jagdecs2.util.InstructionsDatabase;
| /*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
... | public CS2 getCS2(InstructionsDatabase idb, ConfigsDatabase cdb, FunctionDatabase sdb, FunctionDatabase odb, int id) {
| 0 |
vibe-project/vibe-java-platform | bridge-atmosphere2/src/main/java/org/atmosphere/vibe/platform/bridge/atmosphere2/AtmosphereServerHttpExchange.java | [
"public interface Action<T> {\n\n /**\n * Some action is taken.\n */\n void on(T object);\n\n}",
"public interface Actions<T> {\n\n /**\n * Adds an action.\n */\n Actions<T> add(Action<T> action);\n\n /**\n * Disables any operation on the actions. This method is useful when\n ... | import java.io.IOException;
import java.io.OutputStream;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;
import org.atmosphere.... | if (version > 0) {
// 3.1+ asynchronous
new AsyncBodyReader(input, chunkAction, endActions, errorActions);
} else {
// 3.0 synchronous
new SyncBodyReader(input, chunkAction, endActions, errorActions);
}
} catch (... | protected void doSetStatus(HttpStatus status) { | 3 |
otto-de/edison-hal | src/test/java/de/otto/edison/hal/EmbeddedTest.java | [
"public static Builder copyOf(final Embedded embedded) {\n final Builder builder = new Builder();\n if (embedded != null && embedded.items != null) {\n builder._embedded.putAll(embedded.items);\n }\n return builder;\n}",
"@JsonSerialize(using = Embedded.EmbeddedSerializer.class)\n@JsonDeseriali... | import org.junit.Test;
import java.util.List;
import static de.otto.edison.hal.Embedded.Builder.copyOf;
import static de.otto.edison.hal.Embedded.*;
import static de.otto.edison.hal.Link.curi;
import static de.otto.edison.hal.Link.link;
import static de.otto.edison.hal.Links.linkingTo;
import static java.util.Arrays.as... | package de.otto.edison.hal;
public class EmbeddedTest {
@Test
public void shouldCreateEmptyEmbedded() {
Embedded embedded = emptyEmbedded();
assertThat(embedded.getItemsBy("foo"), is(emptyList()));
assertThat(embedded.getItemsBy("foo", HalRepresentation.class), is(emptyList()));
... | Embedded embedded = copyOf(embedded("foo", singletonList(new HalRepresentation()))) | 0 |
Anarchid/zkgbai | src/zkgbai/military/fighterhandlers/MiscHandler.java | [
"public class ZKGraphBasedAI extends com.springrts.ai.oo.AbstractOOAI {\n\tprivate static ZKGraphBasedAI instance = null;\n\n\tprivate OOAICallback callback;\n private List<Module> modules = new LinkedList<Module>();\n\tHashSet<Integer> enemyTeams = new HashSet<Integer>();\n\tHashSet<Integer> enemyAllyTeams = ne... | import com.springrts.ai.oo.AIFloat3;
import com.springrts.ai.oo.clb.*;
import zkgbai.ZKGraphBasedAI;
import zkgbai.graph.GraphManager;
import zkgbai.graph.MetalSpot;
import zkgbai.military.Enemy;
import zkgbai.military.MilitaryManager;
import zkgbai.military.tasks.DefenseTarget;
import zkgbai.military.unitwrappers.*;
i... | package zkgbai.military.fighterhandlers;
/**
* Created by haplo on 1/4/2016.
*/
public class MiscHandler {
ZKGraphBasedAI ai;
OOAICallback callback;
MilitaryManager warManager; | GraphManager graphManager; | 1 |
ceefour/webdav-servlet | src/main/java/net/sf/webdav/methods/DoHead.java | [
"public interface IMimeTyper {\n\n /**\n * Detect the mime type of this object\n * \n * @param transaction\n * @param path\n * @return \n */\n String getMimeType(ITransaction transaction, String path);\n}",
"public class StoredObject {\n\n private boolean isFolder;\n private Da... | import net.sf.webdav.locking.ResourceLocks;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.webdav.IMimeTyper;
import net.sf.webdav.StoredObject;
import net.sf.webdav.ITransaction;
import net.sf.webdav.WebdavStatus;
import net.sf.web... | /*
* Copyright 1999,2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | protected IWebdavStore _store; | 4 |
longdivision/hex | app/src/main/java/com/hexforhn/hex/fragment/StoryListFragment.java | [
"public class HexApplication extends Application {\n\n private RequestQueue mRequestQueue;\n\n public final String apiBaseUrl = \"https://hex-api.herokuapp.com\";\n\n public void onCreate() {\n super.onCreate();\n setupAnalytics();\n }\n\n public RequestQueue getRequestQueue() {\n ... | import android.app.Fragment;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
im... | package com.hexforhn.hex.fragment;
public class StoryListFragment extends Fragment implements ClickListener {
private final static String STORY_TITLE_INTENT_EXTRA_NAME = "storyTitle";
private final static String STORY_ID_INTENT_EXTRA_NAME = "storyId";
private final static String STORIES_KEY = "stories"... | HexApplication application = (HexApplication) getActivity().getApplication(); | 0 |
philborlin/CSSBox | src/main/java/org/fit/cssbox/demo/BoxBrowser.java | [
"public class CSSNorm \n{\n\n /**\n * Defines a standard HTML style sheet defining the basic style of the individual elements.\n * It corresponds to the CSS2.1 recommendation (Appendix D).\n * @return the style string\n */\n public static String stdStyleSheet()\n {\n return\n ... | import javax.swing.*;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Vector;
import org.fit.cssbox.css.CSSNorm;
import org.fit.cssbox.css.CSSUnits;
import org.fit.cssbox.css.DOMAnalyzer;
import org.fit.cssbox.io.DOMSource;
import org.fit.cssbox.io.... | /**
* BoxBrowser.java
* Copyright (c) 2005-2007 Radek Burget
*
* CSSBox is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
... | contentCanvas = new BrowserCanvas(da.getRoot(), da, docSource.getURL()); | 3 |
bafomdad/uniquecrops | com/bafomdad/uniquecrops/crops/Dirigible.java | [
"public abstract class BlockCropsBase extends BlockCrops {\n\t\n\tprivate EnumCrops type;\n\tprotected boolean extra;\n\tprotected boolean canPlant;\n\tprotected boolean clickHarvest;\n\n\tpublic BlockCropsBase(EnumCrops type, boolean extra, boolean canPlant) {\n\t\t\n\t\tthis.type = type;\n\t\tthis.extra = extra;\... | import java.util.Random;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import com.bafomdad.uniquecrops.blocks.BlockCropsBas... | package com.bafomdad.uniquecrops.crops;
public class Dirigible extends BlockCropsBase {
public Dirigible() {
super(EnumCrops.FLYINGPLANT, false, UCConfig.cropDirigible);
}
@Override
public Item getSeed() {
return UCItems.seedsDirigible;
}
@Override
public Item getCrop() {
return UCItems.g... | UCPacketHandler.sendToNearbyPlayers(world, pos, new PacketUCEffect(EnumParticleTypes.EXPLOSION_NORMAL, pos.getX(), pos.getY(), pos.getZ(), 4)); | 5 |
GaoGersy/LiveShow | app/src/main/java/com/gersion/pictureshow/ui/activity/MainActivity.java | [
"public abstract class BaseActivity extends AppCompatActivity {\n protected ProgressDialog mProgressDialog;\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(setResourceId());\n initView();\n ini... | import android.annotation.TargetApi;
import android.graphics.Color;
import android.os.Build;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.NavigationView;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.su... | package com.gersion.pictureshow.ui.activity;
public class MainActivity extends BaseActivity
implements NavigationView.OnNavigationItemSelectedListener, BottomNavigationView.OnNavigationItemSelectedListener {
private BottomNavigationView mBnvMenu;
private TextView mTvShow;
private FragmentManager... | transaction.replace(R.id.fl_container, new GirlsFragment()); | 1 |
scalyr/Scalyr-Java-Client | src/test/com/scalyr/api/tests/TestUtils.java | [
"public class Converter {\n /**\n * Convert any numeric type to Integer. If `parseSI` is set to true, try to parse SI units as well.\n * <p>\n * A null input is returned as-is. Non-numeric inputs trigger an exception. Out-of-range\n * values trigger undefined behavior.\n */\n public static Integer toInt... | import com.scalyr.api.json.RawJson;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import com.scalyr.api.Converter;
import co... | /*
* Scalyr client library
* Copyright 2012 Scalyr, 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 applic... | } else if (expected instanceof JSONArray) { | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.