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 |
|---|---|---|---|---|---|---|
tticoin/JointER | src/jp/tti_coin/main/java/data/nlp/relation/RelationDocument.java | [
"public class Parameters {\n\tstatic class CustomConstructor extends Constructor {\n\t\t@Override\n\t\tprotected List<Object> createDefaultList(int initSize) {\n\t\t\treturn new Vector<Object>();\n\t\t}\n\t\t\n\t\t@Override\n\t\tprotected Map<Object, Object> createDefaultMap() {\n\t\t\treturn new TreeMap<Object, Ob... | import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Vector;
import java.util.Map.Entry;
import com.google.common.collect.Ordering;
import config.Parameters;
import data.Instance;
import data.Label;
import da... | package data.nlp.relation;
public class RelationDocument extends Document {
protected List<Relation> relations;
public RelationDocument(Parameters params, String id) {
this(params, null, null, id, "", "");
}
public RelationDocument(Parameters params, Document document, Offset offset, String id, String typ... | Instance instance = new RelationInstance(params, seq, label, sentence); | 1 |
iconmaster5326/Source | src/com/iconmaster/source/assemble/Assembler.java | [
"public class CompileUtils {\n\n\tpublic static interface CodeTransformer {\n\n\t\tpublic ArrayList<Operation> transform(SourcePackage pkg, Object workingOn, ArrayList<Operation> code);\n\t}\n\n\tpublic static abstract class FunctionCallTransformer implements CodeTransformer {\n\n\t\tpublic Function function;\n\n\t... | import com.iconmaster.source.compile.CompileUtils;
import com.iconmaster.source.compile.CompileUtils.CodeTransformer;
import com.iconmaster.source.link.Linker;
import com.iconmaster.source.link.Platform;
import com.iconmaster.source.prototype.SourcePackage; | package com.iconmaster.source.assemble;
/**
*
* @author iconmaster
*/
public class Assembler {
public static AssembledOutput assemble(String platform, SourcePackage pkg) { | Platform p = Linker.platforms.get(platform); | 3 |
Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/ParticlesDrawable.java | [
"@Keep\npublic interface SceneConfiguration {\n\n /**\n * Set number of particles to draw per scene.\n *\n * @param density the number of particles to draw per scene\n * @throws IllegalArgumentException if density is negative\n */\n void setDensity(@IntRange(from = 0) int density);\n\n ... | import android.content.res.Resources;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.os.SystemClock;
import android.util.AttributeSet;
import com.doctoror.par... | /*
* Copyright (C) 2017 Yaroslav Mytkalyk
*
* 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... | private final SceneRenderer renderer = new DefaultSceneRenderer(canvasRenderer); | 8 |
SalmanTKhan/MyAnimeViewer | app/src/main/java/com/taskdesignsinc/android/myanimeviewer/fragment/OfflineVideoDetailsFragment.java | [
"public class MAVApplication extends MultiDexApplication {\n\n static {\n AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);\n }\n\n private static MAVApplication application = null;\n\n private RefWatcher refWatcher;\n private BoxStore boxStore;\n private DataRepository mDataRepo... | import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import android.support... | package com.taskdesignsinc.android.myanimeviewer.fragment;
/**
* Created by etiennelawlor on 1/3/17.
* https://github.com/lawloretienne/Loop
* Modified by salmantkhan on 7/20/17.
*/
public class OfflineVideoDetailsFragment extends BaseFragment {
// ExoPlayer Guide
// https://google.github.io/ExoPlay... | private PlaybackLocation location; | 1 |
StumbleUponArchive/hbase | src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java | [
"public final class HConstants {\n /**\n * Status codes used for return values of bulk operations.\n */\n public enum OperationStatusCode {\n NOT_RUN,\n SUCCESS,\n BAD_FAMILY,\n SANITY_CHECK_FAILURE,\n FAILURE;\n }\n\n /** long constant for zero */\n public static final Long ZERO_L = Long.va... | import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.client.Delete;
import or... | /*
* Copyright 2010 The Apache Software Foundation
*
* 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 ... | KeyValue lastKV = null; | 1 |
encircled/Joiner | joiner-core/src/test/java/cz/encircled/joiner/core/JoinGraphTest.java | [
"public class JoinerException extends RuntimeException {\n\n public JoinerException(String message) {\n super(message);\n }\n\n public JoinerException(String message, Exception exception) {\n super(message, exception);\n }\n}",
"@Entity\n@Table(name = \"test_group\")\npublic class Group ... | import cz.encircled.joiner.exception.JoinerException;
import cz.encircled.joiner.model.Group;
import cz.encircled.joiner.model.QAddress;
import cz.encircled.joiner.model.User;
import cz.encircled.joiner.query.JoinerQuery;
import cz.encircled.joiner.query.Q;
import cz.encircled.joiner.query.join.DefaultJoinGraphRegistry... | package cz.encircled.joiner.core;
/**
* @author Vlad on 15-Aug-16.
*/
@Transactional
public class JoinGraphTest extends AbstractTest {
private DefaultJoinGraphRegistry mockRegistry;
@BeforeEach
public void before() {
mockRegistry = new DefaultJoinGraphRegistry();
try {
j... | mockRegistry.registerJoinGraph("test", Collections.singletonList(J.left(user1)), User.class); | 2 |
nchambers/probschemas | src/main/java/nate/probschemas/DataSimplifier.java | [
"public class Directory {\n\n public static String stripGZ(String filename) {\n if( filename.endsWith(\".gz\") )\n return filename.substring(0, filename.length()-3);\n else return filename;\n }\n \n /**\n * @return True if the given path is an existing file. False otherwise.\n */\n public stati... | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.u... |
/**
* Extract all entities from the given documents, and create their list of entity mentions.
* This returns a list of all entities, with their mentions represented by a TextEntity
* object that simply contains the head word and the dependency relation in which it is a dependent.
* @param data
* @ret... | public Pair<List<String>,List<List<TextEntity>>> getCachedEntityList(String path) { | 4 |
Gocnak/Botnak | src/main/java/irc/account/AccountManager.java | [
"public class BotnakTrayIcon extends TrayIcon implements ActionListener, ItemListener {\n\n public BotnakTrayIcon() {\n super(new ImageIcon(BotnakTrayIcon.class.getResource(\"/image/icon.png\")).getImage());\n setImageAutoSize(true);\n String version = \"Botnak v\" + String.valueOf(Constants... | import gui.BotnakTrayIcon;
import gui.forms.GUIMain;
import irc.IRCBot;
import irc.IRCViewer;
import lib.pircbot.PircBot;
import lib.pircbot.PircBotConnection;
import util.settings.Settings;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue; | package irc.account;
/**
* Created by Nick on 6/12/2014.
*/
public class AccountManager extends Thread {
private Queue<Task> tasks;
private Map<String, ReconnectThread> reconnectThreads;
private Account userAccount, botAccount;
| private PircBot viewer, bot; | 4 |
pktczwd/tcc-transaction | tcc-transaction-core/src/main/java/org/pankai/tcctransaction/repository/RedisTransactionRepository.java | [
"public class Transaction implements Serializable {\n\n private static final Logger logger = LoggerFactory.getLogger(Transaction.class);\n\n private TransactionXid xid;\n private TransactionStatus status;\n private TransactionType transactionType;\n private volatile int retriedCount = 0;\n private... | import org.pankai.tcctransaction.Transaction;
import org.pankai.tcctransaction.common.TransactionType;
import org.pankai.tcctransaction.repository.helper.JedisCallback;
import org.pankai.tcctransaction.repository.helper.RedisHelper;
import org.pankai.tcctransaction.repository.helper.TransactionSerializer;
import org.pa... | package org.pankai.tcctransaction.repository;
/**
* Created by pktczwd on 2016/12/7.
* <p/>
* As the storage of transaction need safely durable,make sure the redis server is set as AOF mode and always fsync.
* set below directives in your redis.conf
* appendonly yes
* appendfsync always
*/
public class RedisT... | private ObjectSerializer serializer = new JdkSerializationSerializer(); | 5 |
gems-uff/prov-viewer | src/test/java/br/uff/ic/graphmatching/MergerTest.java | [
"public class GuiRun {\n \n /**\n * Main loop of the program\n */\n public static void Run()\n {\n \n java.awt.EventQueue.invokeLater(new Runnable() {\n \n @Override\n public void run() {\n new GraphFrame().setVisible(true... | import br.uff.ic.provviewer.GUI.GuiRun;
import br.uff.ic.utility.AttributeErrorMargin;
import br.uff.ic.utility.GraphAttribute;
import br.uff.ic.utility.IO.BasePath;
import br.uff.ic.utility.IO.UnityReader;
import br.uff.ic.utility.IO.XMLWriter;
import br.uff.ic.utility.graph.ActivityVertex;
import br.uff.ic.utility.gr... | /*
* The MIT License
*
* Copyright 2017 Kohwalter.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modif... | resultEdges += "(" + e.getID() + ") " + ((Vertex)e.getTarget()).getID() + "->" + ((Vertex)e.getSource()).getID() + " || "; | 8 |
wmz7year/Redis-Synyed | Redis-Synyed-common/src/main/java/com/wmz7year/synyed/packet/redis/command/RedisPacketCommandParser.java | [
"public class RedisCommandSymbol {\n\t/**\n\t * 数组类型数据包\n\t */\n\tpublic static final String ARRAY = \"ARRAY\";\n\t/**\n\t * 验证身份命令\n\t */\n\tpublic static final String AUTH = \"AUTH\";\n\t/**\n\t * 空格\n\t */\n\tpublic static final byte BLANK = ' ';\n\t/**\n\t * 复合类型的字符串\n\t */\n\tpublic static final String BULKSTR... | import static com.wmz7year.synyed.constant.RedisCommandSymbol.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.wmz7year.synyed.entity.RedisCommand;
import com.wmz7year.synyed.packet.redis.... | package com.wmz7year.synyed.packet.redis.command;
/**
* redis数据包语法生成Redis命令的解析器<br>
*
* @author jiangwei (ydswcy513@gmail.com)
* @since 2015年12月25日 下午3:37:45
* @version V1.0
*/
public class RedisPacketCommandParser {
private static Logger logger = LoggerFactory.getLogger(RedisPacketCommandParser.class);
... | public List<RedisCommand> parseRedisPacket(RedisPacket redisPacket) { | 6 |
proxytoys/proxytoys | proxytoys/src/main/java/com/thoughtworks/proxy/toys/pool/Pool.java | [
"public interface ProxyFactory extends Serializable {\n\n /**\n * Create a new proxy instance.\n * \n * @param <T> The proxy's type. \n * @param invoker the invocation handler.\n * @param types the types the proxy must emulate.\n * @return the new proxy instance.\n * @since 1.0\n ... | import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.H... | /*
* (c) 2003-2005, 2009, 2010 ThoughtWorks Ltd. All rights reserved.
* (c) 2015 ProxyToys Committers. All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on... | private Resetter<? super T> resetter; | 5 |
greengrowapps/ggarest | GgaRestJavaLib/ggarest/src/main/java/com/greengrowapps/ggarest/RequestBuilder.java | [
"public class AlreadyExecutingException extends RuntimeException{\n}",
"public interface OnExceptionListener {\n void onExceptionThrown(Exception e);\n}",
"public interface OnListResponseListener<T> {\n\n void onResponse(int code, List<T> object, Response fullResponse);\n}",
"public interface OnObjRespo... | import com.greengrowapps.ggarest.exceptions.AlreadyExecutingException;
import com.greengrowapps.ggarest.listeners.OnExceptionListener;
import com.greengrowapps.ggarest.listeners.OnListResponseListener;
import com.greengrowapps.ggarest.listeners.OnObjResponseListener;
import com.greengrowapps.ggarest.listeners.OnRespons... | package com.greengrowapps.ggarest;
public interface RequestBuilder {
RequestBuilder withBody(Object body);
RequestBuilder withPlainBody(String body);
RequestBuilder addHeader(String key, String value);
RequestBuilder addHeaders(Collection<? extends RequestHeader> headers);
RequestBuilder withT... | RequestBuilder onException(OnExceptionListener onExceptionListener); | 1 |
captain-miao/bleYan | example/src/main/java/com/github/captain_miao/android/bluetoothletutorial/ble/AppBleService.java | [
"public abstract class BaseBleService extends Service implements SimpleScanCallback{\n\tprivate final static String TAG = BaseBleService.class.getName();\n\n\tprotected final BleServiceHandle mHandler;\n\tprivate final Messenger mMessenger;\n\n\tprivate BluetoothGatt mGatt = null;\n\tpublic BleConnectState mState =... | import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattService;
import com.github.captain_miao.android.ble.BaseBleService;
import com.github.captain_miao.android.ble.constant.BleConnectState;
import co... | package com.github.captain_miao.android.bluetoothletutorial.ble;
/**
* @author YanLu
* @since 15/9/15
*/
public class AppBleService extends BaseBleService {
private final static String TAG = AppBleService.class.getName();
//发现服务之后,可以做一些初始化
@Override
public void onDiscoverServices(BluetoothGatt ... | if (mState != BleConnectState.SCANNING) { | 1 |
egetman/ibm-bpm-rest-client | src/test/ru/bpmink/bpm/api/client/ExposedClientTest.java | [
"@Immutable\npublic final class BpmClientFactory {\n\n private static final String HTTP_SCHEME = \"http\";\n private static final String HTTPS_SCHEME = \"https\";\n\n private BpmClientFactory() {\n }\n\n /**\n * Creates the Bpm client object with given parameters.\n *\n * @param serverUri... | import com.google.common.io.ByteSource;
import com.google.common.io.Closeables;
import com.google.common.io.Resources;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Tes... | package ru.bpmink.bpm.api.client;
public class ExposedClientTest {
private BpmClient bpmClient;
private Logger logger = LoggerFactory.getLogger(getClass());
@BeforeClass
public void initializeClient() {
final URL url = Resources.getResource("server.properties");
final ByteSource... | RestRootEntity<ExposedItems> entity = bpmClient.getExposedClient().listItems(ItemType.PROCESS); | 4 |
emop/EmopAndroid | src/com/emop/client/fragment/ShopListFragment.java | [
"public class Constants {\r\n\tpublic static final String APP_ID = \"\";\r\n\tpublic static final String TAG_EMOP = \"emop\";\r\n\t\r\n\tpublic static final String PREFS_NAME = \"taodianhuo_perfs\";\r\n\t\r\n\tpublic static final String PREFS_OAUTH_ID = \"fmei_user_id\";\r\n\tpublic static final String PREFS_TRACK_... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.database.ContentObserver;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler... | package com.emop.client.fragment;
public class ShopListFragment extends ListFragment{
public int cateId = 0;
private CursorAdapter adapter = null;
protected Handler handler = new Handler();
private String dataSource = "";
private String dataFrom = "";
private boolean isRunning = false;
... | final FmeiClient client = FmeiClient.getInstance(null);
| 3 |
jenshadlich/s3srv | src/main/java/de/jeha/s3srv/operations/AbstractOperation.java | [
"@XmlRootElement(name = \"Error\")\npublic class ErrorResponse {\n\n @XmlElement(name = \"Code\")\n private String code;\n\n @XmlElement(name = \"Message\")\n private String message;\n\n @XmlElement(name = \"Resource\")\n private String resource;\n\n @XmlElement(name = \"RequestId\")\n priva... | import de.jeha.s3srv.api.ErrorResponse;
import de.jeha.s3srv.common.errors.ErrorCodes;
import de.jeha.s3srv.common.http.Headers;
import de.jeha.s3srv.common.security.AuthorizationContext;
import de.jeha.s3srv.common.security.AuthorizationUtils;
import de.jeha.s3srv.model.S3User;
import de.jeha.s3srv.storage.StorageBack... | package de.jeha.s3srv.operations;
/**
* @author jenshadlich@googlemail.com
*/
public abstract class AbstractOperation {
private static final Logger LOG = LoggerFactory.getLogger(AbstractOperation.class);
private final StorageBackend storageBackend;
protected AbstractOperation(StorageBackend storageB... | ErrorResponse error = new ErrorResponse(errorCode.getCode(), errorCode.getDescription(), resource, requestId); | 0 |
neo4j/docker-neo4j | src/test/java/com/neo4j/docker/neo4jadmin/TestDumpLoad.java | [
"public class DatabaseIO\n{\n\tprivate static Config TEST_DRIVER_CONFIG = Config.builder().withoutEncryption().build();\n\tprivate static final Logger log = LoggerFactory.getLogger( DatabaseIO.class );\n\n\tprivate GenericContainer container;\n\tprivate String boltUri;\n\n\tpublic DatabaseIO( GenericContainer conta... | import com.github.dockerjava.api.command.CreateContainerCmd;
import com.neo4j.docker.utils.DatabaseIO;
import com.neo4j.docker.utils.HostFileSystemOperations;
import com.neo4j.docker.utils.Neo4jVersion;
import com.neo4j.docker.utils.SetContainerUser;
import com.neo4j.docker.utils.TestSettings;
import org.junit.jupiter.... | package com.neo4j.docker.neo4jadmin;
public class TestDumpLoad
{
private static Logger log = LoggerFactory.getLogger( TestDumpLoad.class );
@BeforeAll
static void beforeAll()
{
Assumptions.assumeTrue( TestSettings.NEO4J_VERSION.isAtLeastVersion( new Neo4jVersion( 4, 4, 0 )),
... | Path testOutputFolder = HostFileSystemOperations.createTempFolder( "dumpandload-" ); | 1 |
kaif-open/kaif-android | app/src/main/java/io/kaif/mobile/view/daemon/VoteDaemon.java | [
"public class EventPublishSubject<T> {\n\n private final PublishSubject<T> subject;\n\n public EventPublishSubject() {\n this.subject = PublishSubject.create();\n }\n\n public Observable<T> getSubject(Class<?>... classes) {\n return subject.asObservable().filter(event -> {\n for (Class<?> clazz : cla... | import javax.inject.Inject;
import javax.inject.Singleton;
import io.kaif.mobile.event.EventPublishSubject;
import io.kaif.mobile.event.vote.VoteArticleSuccessEvent;
import io.kaif.mobile.event.vote.VoteDebateSuccessEvent;
import io.kaif.mobile.event.vote.VoteEvent;
import io.kaif.mobile.model.Vote;
import io.kaif.mobi... | package io.kaif.mobile.view.daemon;
@Singleton
public class VoteDaemon {
| private final EventPublishSubject<VoteEvent> subject; | 0 |
leonardoanalista/java2word | java2word/src/test/java/word/w2004/TableTest.java | [
"public class TestUtils {\n\n\tpublic static int regexCount(String text, String regex){\n\t\tif(text == null || regex == null){\n\t\t\tthrow new IllegalArgumentException(\"Can't be null.\");\n\t\t}\n\t\tPattern pattern = Pattern.compile(regex);\n\t\tMatcher matcher = pattern.matcher(text);\n\t\t\n\t\tint total = 0;... | import junit.framework.Assert;
import org.junit.Test;
import word.utils.TestUtils;
import word.w2004.elements.Paragraph;
import word.w2004.elements.ParagraphPiece;
import word.w2004.elements.Table;
import word.w2004.elements.tableElements.TableCol;
import word.w2004.elements.tableElements.TableDefinition;
import word.w... | package word.w2004;
public class TableTest extends Assert {
@Test
// New table has to return ""
public void testCreateEmptyTable() { | Table tbl01 = new Table(); | 3 |
flexgp/flexgp | comm-library/src/test/ArgParserTest.java | [
"public class Control extends AbstractThread implements Publisher {\n\t// the ID of this node\n\tpublic final NodeDescriptor desc;\n\t// the NodeList\n\tpublic NodeList nodeList;\n\t// the loop control variable\n\tpublic boolean go;\n\n\t// a Set of outstanding Ping message IDs\n\tpublic Map<MsgID, MessageWrapper<A... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import node.Control;
import node.NodeList.NoSuchNodeIDException;
import node.NodeList.Status;
import org.junit.Before;
import org.junit.Test;
import utility.ArgLexer;
import utility.ArgParser;
im... | /**
* Copyright (c) 2012 Evolutionary Design and Optimization Group
*
* Licensed under the MIT License.
*
* See the "LICENSE" file for a copy of the license.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABIL... | assertTrue(c.nodeList.contains("0.0.0.1:9000").equals(Status.GOOD)); | 2 |
KeithYokoma/LGTMCamera | app/src/main/java/jp/yokomark/lgtm/app/history/ui/ComposeHistoryActivity.java | [
"@Module(\n\t\tcomplete = false,\n\t\tlibrary = true\n)\npublic class ActivityModule {\n\tprivate final Activity mActivity;\n\n\tpublic ActivityModule(Activity activity) {\n\t\tmActivity = activity;\n\t}\n\n\t@Provides\n\t@Singleton\n\tObjectGraph provideActivityGraph() {\n\t\tif (mActivity instanceof DaggerFragmen... | import android.os.Bundle;
import android.view.MenuItem;
import com.anprosit.android.dagger.ActivityModule;
import com.anprosit.android.dagger.ui.DaggerActivity;
import com.squareup.otto.Bus;
import com.squareup.otto.Subscribe;
import java.util.Arrays;
import java.util.List;
import javax.inject.Inject;
import jp.yokomar... | package jp.yokomark.lgtm.app.history.ui;
/**
* @author yokomakukeishin
* @version 1.0.0
* @since 1.0.0
*/
public class ComposeHistoryActivity extends DaggerActivity {
public static final String TAG = ComposeHistoryActivity.class.getSimpleName();
@Inject ComposeHistoryCollection mCollection;
@Injec... | public void onLoadHistory(HistoryLoadedEvent event) { | 3 |
JoeSteven/BiBi | app/src/main/java/com/joe/bibi/activity/CommentActivity.java | [
"public class BBUser extends BmobChatUser implements Serializable{\n private String Desc;//简介\n private String Tag;//标签\n private String AvatarName;\n private String AvatarUrl;\n\n public String getAvatarUrl() {\n return AvatarUrl;\n }\n\n public void setAvatarUrl(String avatarUrl) {\n ... | import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.widge... | package com.joe.bibi.activity;
public class CommentActivity extends AppCompatActivity {
private EditText mComment;
private String mDebateID;
private int mPoint;
private String mTitle;
private String mUserName;
private Comment comment;
private boolean mReply;
@Override
protect... | ToastUtils.make(CommentActivity.this, "正在发布,发布成功会自动跳转"); | 5 |
kurbatov/firmata4j | src/main/java/org/firmata4j/firmata/parser/ParsingExtendedAnalogMessageState.java | [
"public class Event {\n\n private final long timestamp;\n private final String type;\n private final Map<String, Object> body;\n\n /**\n * Constructs the event of unspecified type.\n */\n public Event() {\n timestamp = System.currentTimeMillis();\n type = \"unspecified\";\n ... | import org.firmata4j.fsm.Event;
import org.firmata4j.fsm.AbstractState;
import org.firmata4j.fsm.FiniteStateMachine;
import static org.firmata4j.firmata.parser.FirmataEventType.*;
import static org.firmata4j.firmata.parser.FirmataToken.*; | /*
* The MIT License (MIT)
*
* Copyright (c) 2014 Oleg Kurbatov (o.v.kurbatov@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limit... | Event evt = new Event(ANALOG_MESSAGE_RESPONSE); | 0 |
processquerying/PQL | src/org/pql/query/PQLQueryMySQL.java | [
"@SuppressWarnings({\"all\", \"warnings\", \"unchecked\", \"unused\", \"cast\"})\npublic class PQLLexer extends Lexer {\n\tprotected static final DFA[] _decisionToDFA;\n\tprotected static final PredictionContextCache _sharedContextCache =\n\t\tnew PredictionContextCache();\n\tpublic static final int\n\t\tUNIVERSE=1... | import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashSet;
import java.util.Set;
import java.util.Vector;
import java.util.concurrent.atomic.AtomicInteger;
import org.antlr.v4.runtime.Token;
import org.json.JSONArray;
import org.pql.antlr.PQLLexer;
import org.pql.core.IPQLBasicPredicat... | package org.pql.query;
/**
* An implementation of the {@link AbstractPQLQuery}} class that relies on MySQL index.
*
* @author Artem Polyvyanyy
*/
public class PQLQueryMySQL extends AbstractPQLQuery {
private String identifier = "";
private Connection connection = null;
IPQLBasicPredicatesOnTas... | public boolean interpretBinaryPredicateMacro(Token op, Set<PQLTask> set1, Set<PQLTask> set2, PQLQuantifier Q) {
| 3 |
hello/android-buruberi | buruberi-example/src/main/java/is/hello/buruberi/example/activities/PeripheralActivity.java | [
"public interface GattPeripheral extends Comparable<GattPeripheral> {\n /**\n * The log tag used by implementations of the GattPeripheral interface.\n */\n String LOG_TAG = \"Bluetooth.\" + GattPeripheral.class.getSimpleName();\n\n\n //region Local Broadcasts\n\n /**\n * A local broadcast th... | import android.content.res.Resources;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import javax.inject.Inject;
import is.hello.buruberi.bluetooth.stacks... | package is.hello.buruberi.example.activities;
/**
* Displays information about a peripheral chosen by the user.
*/
public class PeripheralActivity extends BaseActivity {
@Inject PeripheralPresenter peripheralPresenter;
private Button connectionButton;
private Button bondButton;
@Override
pro... | final PeripheralDetailsAdapter adapter = new PeripheralDetailsAdapter(this); | 1 |
tmalaska/hadcom.utils | src/main/java/com/cloudera/sa/hcu/io/route/scheduler/ScheduledDrivenRoute.java | [
"public class HeartBeatConsoleOutputListener implements PutListener\n{\n\tint waitMS;\n\tlong timePostedMS;\n\tlong lastPosting;\n\tlong numberOfFiles;\n\tpublic HeartBeatConsoleOutputListener(int waitSeconds)\n\t{\n\t\tthis.waitMS = waitSeconds * 1000;\n\t\tthis.timePostedMS = 0;\n\t\t\n\t}\n\n\tpublic void onA100... | import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.Map.Entry;
import com.cloudera.sa.hcu.io.put.listener.HeartBeatConsoleOutputListener;
import com.cloudera.sa.hcu.io.put.local.reader.AbstractLocalFileColumnReader;
import com.cloudera.sa.hcu.io.route.scheduler.thread.InputDir... | package com.cloudera.sa.hcu.io.route.scheduler;
public class ScheduledDrivenRoute extends AbstractRoute
{
public static final String CONF_BATCH_SEND_EVERY_N_MINUTES = ".batch.send.every.n.min";
int internalTimeInMinutes;
public ScheduledDrivenRoute(String routeNamePrefix, Properties prop) throws IOException
... | internalTimeInMinutes = PropertyUtils.getIntProperty(prop, routeName + CONF_BATCH_SEND_EVERY_N_MINUTES); | 4 |
ajitsing/Sherlock | sherlock/src/androidTest/java/com/singhajit/sherlock/core/SherlockTest.java | [
"public class CrashRecord {\n private String place;\n private String reason;\n private String date;\n private String stackTrace;\n\n public CrashRecord(String place, String reason, String date, String stackTrace) {\n this.place = place;\n this.reason = reason;\n this.date = date;\n this.stackTrace ... | import android.content.Context;
import android.support.test.InstrumentationRegistry;
import com.singhajit.sherlock.core.database.CrashRecord;
import com.singhajit.sherlock.core.database.DatabaseResetRule;
import com.singhajit.sherlock.core.database.SherlockDatabaseHelper;
import com.singhajit.sherlock.core.investigatio... | package com.singhajit.sherlock.core;
public class SherlockTest {
@Rule
public DatabaseResetRule databaseResetRule = new DatabaseResetRule();
@Test
public void shouldReturnAllCapturedCrashes() throws Exception {
Context targetContext = InstrumentationRegistry.getTargetContext();
Sherlock.init(tar... | SherlockDatabaseHelper database = new SherlockDatabaseHelper(targetContext); | 2 |
kontalk/desktopclient-java | src/main/java/org/kontalk/view/MainFrame.java | [
"public final class Kontalk {\n private static final Logger LOGGER = Logger.getLogger(Kontalk.class.getName());\n\n public static final String VERSION = \"3.1.2\";\n\n private final Path mAppDir;\n private ServerSocket mRunLock = null;\n\n Kontalk() {\n // platform dependent configuration dire... | import javax.swing.Icon;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import java.awt.Adjustable;
import java.awt.BorderLayout;
import java.awt.Color;
import java.a... | }
});
helpMenu.add(aboutMenuItem);
menubar.add(helpMenu);
// Layout...
this.setLayout(new BorderLayout(View.GAP_SMALL, View.GAP_SMALL));
// ...left...
mTabbedPane = new WebTabbedPane(WebTabbedPane.LEFT);
String chatOverlayText =
... | aboutPanel.add(new WebLabel("Kontalk Java Client v" + Kontalk.VERSION)); | 0 |
gtri/typesafeconfig-extensions | factory/src/main/java/edu/gatech/gtri/typesafeconfigextensions/factory/ConfigSourceList.java | [
"public interface Function<A, B> {\n\n B apply(A a);\n}",
"public final class EqualsEquivalence<A>\nimplements Equivalence<A> {\n\n @Override\n public boolean equals(A x, A y) {\n return x.equals(y);\n }\n\n @Override\n public int hashCode(A x) {\n return x.hashCode();\n }\n\n ... | import edu.gatech.gtri.typesafeconfigextensions.internal.Function;
import edu.gatech.gtri.typesafeconfigextensions.internal.equivalence.EqualsEquivalence;
import edu.gatech.gtri.typesafeconfigextensions.internal.equivalence.Equivalence;
import java.util.ArrayList;
import java.util.List;
import static edu.gatech.gtri.ty... | /*
* Copyright 2013 Georgia Tech Applied Research Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | checkNotNullCollectionElements(sourcesToInsert); | 4 |
Hatzen/PrismatikRemote | app/src/main/java/de/prismatikremote/hartz/prismatikremote/activities/Settings.java | [
"public class Communicator {\n private static String TAG = \"Communicator\";\n\n /**\n * Interface to inform caller that commands have finished.\n */\n // TODO: Call these methods always on gui thread.\n public interface OnCompleteListener {\n void onError(String result);\n void on... | import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.SeekBar;
import de.prismatikremote.hartz.prismatikremote.R;
import de.prismatikremote.hartz.prismatikremote.backend.Communicator;
import de.prismati... | package de.prismatikremote.hartz.prismatikremote.activities;
public class Settings extends Drawer implements View.OnClickListener, Communicator.OnCompleteListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = (... | ((SeekBar) findViewById(R.id.gamma)).setProgress((int) (RemoteState.getInstance().getGamma() * 100)); | 1 |
ProxyPrint/proxyprint-kitchen | src/main/java/io/github/proxyprint/kitchen/utils/NotificationManager.java | [
"@Configuration\r\n@EnableAutoConfiguration\r\n@ComponentScan\r\n@EnableCaching\r\n@EnableSwagger2\r\n@EnableAsync\r\npublic class WebAppConfig extends SpringBootServletInitializer {\r\n\r\n private static final Class<WebAppConfig> APP_CLASS = WebAppConfig.class;\r\n \r\n @Override\r\n protected Spr... | import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import io.github.proxyprint.kitchen.WebAppConfig;
import io.github.proxyprint.kitchen.models.consumer.Consumer;
import io.github.proxyprint.kitchen.models.notifications.Notification;
import io.github.proxyprint.kitchen.models.repo... | /*
* Copyright 2016 Pivotal Software, Inc..
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law ... | Consumer consumer = this.consumers.findByUsername(username); | 1 |
WASdev/tool.accelerate.core | liberty-starter-application/src/main/java/com/ibm/liberty/starter/api/v1/GenerateProjectEndpoint.java | [
"public class ProjectConstructionInput {\n\n private static final Logger log = Logger.getLogger(ProjectConstructionInput.class.getName());\n private static final String SERVICE_IDS_KEY = \"serviceIds\";\n private static final String BUILD_KEY = \"build\";\n private static final String WORKSPACE_DIR_KEY ... | import com.ibm.liberty.starter.ServiceConnector;
import com.ibm.liberty.starter.client.BxCodegenClient;
import com.ibm.liberty.starter.exception.ProjectGenerationException;
import java.util.logging.Logger;
import javax.validation.ValidationException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.P... | /*******************************************************************************
* Copyright (c) 2017 IBM Corp.
*
* 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... | ProjectConstructionInput inputProcessor = new ProjectConstructionInput(new ServiceConnector(info.getBaseUri())); | 0 |
petitparser/java-petitparser | petitparser-core/src/test/java/org/petitparser/PrimitiveTest.java | [
"public static <T> void assertFailure(Parser parser, String input) {\n assertFailure(parser, input, 0);\n}",
"public static <T> void assertSuccess(Parser parser, String input, T result) {\n assertSuccess(parser, input, result, input.length());\n}",
"public abstract class Parser {\n\n /**\n * Primitive meth... | import static org.petitparser.Assertions.assertFailure;
import static org.petitparser.Assertions.assertSuccess;
import org.junit.Test;
import org.petitparser.parser.Parser;
import org.petitparser.parser.primitive.EpsilonParser;
import org.petitparser.parser.primitive.FailureParser;
import org.petitparser.parser.primiti... | package org.petitparser;
/**
* Tests {@link EpsilonParser}, {@link FailureParser} and {@link StringParser}.
*/
public class PrimitiveTest {
@Test
public void testEpsilon() {
Parser parser = new EpsilonParser();
assertSuccess(parser, "", null);
assertSuccess(parser, "a", null, 0);
}
@Test
pu... | Parser parser = StringParser.of("foo"); | 5 |
wrey75/WaveCleaner | src/main/java/com/oxande/wavecleaner/ui/JFilterMeter.java | [
"public class AudioFilter extends UGen {\n\tprivate static Logger LOG = LogFactory.getLog(AudioFilter.class);\n\n\t/**\n\t * The enabled switch. This switch is NOT listed in the parameters because\n\t * it is accessed by setEnabled(). But the change can be listened though the\n\t * classic listener.\n\t * \n\t */\n... | import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.Timer;
import java.util.TimerTask;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import j... | package com.oxande.wavecleaner.ui;
/**
* A replacement for the {@link JSlider} which is not perfect for what we want.
* Basically, we need a precise value using steps like a incrementing value but
* it is not perfect in terms of user interface. I opted for a "-"/"+" interface.
* Buttons are replaced by {@link ... | private AudioFilter filter; | 0 |
qoomon/banking-swift-messages-java | src/main/java/com/qoomon/banking/swift/submessage/field/StatementLine.java | [
"public class FieldNotationParseException extends Exception {\n\n private final int index;\n\n public FieldNotationParseException(String message, int index) {\n super(message + \" at index \" + index);\n this.index = index;\n }\n\n public int getIndex() {\n return index;\n }\n}",... | import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.qoomon.banking.swift.notation.FieldNotationParseException;
import com.qoomon.banking.swift.notation.SwiftDecimalFormatter;
import com.qoomon.banking.swift.notation.SwiftNotation;
import com.qoomon.banking.swift.submessage.fi... | package com.qoomon.banking.swift.submessage.field;
/**
* <b>Statement Line</b>
* <p>
* <b>Field Tag</b> :61:
* <p>
* <b>Format</b> 6!n[4!n]2a[1!a]15d1!a3!c16x[//16x][BR34x]
* <p>
* <b>SubFields</b>
* <pre>
* 1: 6!n - Value Date - Format 'YYMMDD'
* 2: [4!n] - Entry Date - Format 'MMDD'
* 3: 2a ... | BigDecimal amount = SwiftDecimalFormatter.parse(subFields.get(4)); | 1 |
priaid-eHealth/symptomchecker | Java/SampleDiagnosisClient/src/SampleDiagnosis.java | [
"public class DiagnosisClient {\r\n\t\r\n\tprivate AccessToken token;\r\n private String language;\r\n private String healthServiceUrl;\r\n \r\n private CloseableHttpClient httpclient;\r\n\t\r\n /// <summary>\r\n /// DiagnosisClient constructor\r\n /// </summary>\r\n /// <param name=\"userna... | import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.ThreadLocalRand... | writeHeaderMessage("Sublocations symptoms for selected location " + randomLocation.Name);
return randomLocation.ID;
}
static Integer loadBodyLocations() throws Exception{
List<HealthItem> bodyLocations = _diagnosisClient.loadBodyLocations();
if (bodyLocations == null || ... | HealthIssueInfo issueInfo = _diagnosisClient.loadIssueInfo(issueId);
| 4 |
InteractiveSystemsGroup/GamificationEngine-Kinben | src/main/java/info/interactivesystems/gamificationengine/entities/goal/Goal.java | [
"@Entity\npublic class Organisation implements Serializable {\n\n\tprivate static final long serialVersionUID = -6830220885028070098L;\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\tprivate int id;\n\n\t@NotNull\n\t@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)\n\tprivate Collec... | import info.interactivesystems.gamificationengine.entities.Organisation;
import info.interactivesystems.gamificationengine.entities.Player;
import info.interactivesystems.gamificationengine.entities.PlayerGroup;
import info.interactivesystems.gamificationengine.entities.Role;
import info.interactivesystems.gamification... | * This method checks if a goal belongs to a specific organisation. Therefore
* it is tested if the organisation's API key matchs the group's API key.
*
* @param organisation
* The organisation object a goal may belongs to.
* @return Boolean value if the API key of the goal is the same
* of the te... | StringUtils.printIdsForDeletion(ids, objectToDelete , type); | 6 |
huyongli/TigerVideo | TigerVideoPlayer/src/main/java/cn/ittiger/player/VideoPlayerView.java | [
"public class BackPressedMessage extends Message {\n private int mScreenState;\n\n public BackPressedMessage(int screenState, int hash, String videoUrl) {\n\n super(hash, videoUrl);\n mScreenState = screenState;\n }\n\n public int getScreenState() {\n\n return mScreenState;\n }\n... | import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.media.AudioManager;
import android.os.Build;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
imp... | package cn.ittiger.player;
/**
* 播放器,主要处理视频的播放暂停,全屏播放切换,小窗口播放切换等逻辑
*
* 视频播放的真正控制交由{@link PlayerManager}实现
* @author: ylhu
* @time: 17-9-8
*/
public class VideoPlayerView extends StandardVideoView implements
AudioManager.OnAudioFocusChangeListener,
Observer {
/**
* 当前Observer(即:VideoPlayerView... | if(!(arg instanceof UIStateMessage)) { | 3 |
brsanthu/proxy-vole | src/main/java/com/btr/proxy/search/desktop/gnome/GnomeProxySearchStrategy.java | [
"public interface ProxySearchStrategy {\n\n\t/*************************************************************************\n\t * Gets the a ProxySelector found by applying the search strategy.\n\t * @return a ProxySelector, null if none is found.\n\t ********************************************************************... | import java.io.File;
import java.io.IOException;
import java.net.ProxySelector;
import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import o... | package com.btr.proxy.search.desktop.gnome;
/*****************************************************************************
* Loads the Gnome proxy settings from the Gnome GConf settings.
* <p>
* The following settings are extracted from the configuration that is stored
* in <i>.gconf</i> folder found in the u... | ProtocolDispatchSelector ps = new ProtocolDispatchSelector(); | 3 |
cianfrocco-lab/COSMIC-CryoEM-Gateway | gateway_config/portal/src/main/java/edu/sdsc/globusauth/action/EndpointListAction.java | [
"public final class OauthConstants {\n\n public static final String SESSION_ERROR_MESSAGE = \"sessionErrorMsg\";\n public static final String ERROR = \"error\";\n public static final String OAUTH_PORPS = \"oauth_consumer.properties\";\n public static final String SCOPES = \"scopes\";\n public static ... | import com.google.api.client.auth.oauth2.Credential;
import edu.sdsc.globusauth.util.OauthConstants;
import edu.sdsc.globusauth.util.OauthUtils;
import org.apache.log4j.Logger;
import org.globusonline.transfer.Authenticator;
import org.globusonline.transfer.BaseTransferAPIClient;
import org.globusonline.transfer.Goauth... | package edu.sdsc.globusauth.action;
/**
* Created by cyoun on 11/30/16.
*/
public class EndpointListAction extends NgbwSupport {
private static final Logger logger = Logger.getLogger(EndpointListAction.class.getName());
private JSONTransferAPIClient client;
private List<Map<String,Object>> iplist;
... | Authenticator authenticator = new GoauthAuthenticator(accesstoken); | 4 |
samuelhehe/AppMarket | src/com/samuel/downloader/app/AtyDownloadMgr.java | [
"public class CompareableLocalAppInfo {\r\n\r\n\t/**\r\n\t * \r\n\t * \r\n\t AppId String 應用ID appIcon String 应用图标 AppName String 應用名稱 VersionName\r\n\t * String App版本名稱 AppVersion Int App版本編號 SysVersion String Android最低版本要求\r\n\t * VersionDesc String 版本描述 ModifyTime String 更新時間 FileEntity String AppUrl\r\n\t * \r\... | import java.io.File;
import java.util.List;
import net.tsz.afinal.FinalDBChen;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.text.format.Formatter;
i... | package com.samuel.downloader.app;
public class AtyDownloadMgr extends BaseActivity implements ContentValue {
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// 获得需要下载的对象
DownloadFileItem downLoadFile... | new DownloadTask(context, currentTaskView, downLoadFileItem, false)
| 2 |
jsmith613/Aruco-Marker-Tracking-Android | openCVTutorial1CameraPreview/src/main/java/min3d/parser/AParser.java | [
"public class AnimationObject3d extends Object3d {\n\tprivate int numFrames;\n\tprivate KeyFrame[] frames;\n\tprivate int currentFrameIndex;\n\tprivate long startTime;\n\tprivate long currentTime;\n\tprivate boolean isPlaying;\n\tprivate float interpolation;\n\tprivate float fps = 70;\n\tprivate boolean updateVerti... | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import min3d.animation.AnimationObject3d;
import min3d.core.Object3dContainer;
import min3d.vos.Color4;
import min3d.vos.Number3d;
import min3d.vos.Uv;... |
/**
* Creates a new texture atlas instance.
*/
public TextureAtlas() {
bitmaps = new ArrayList<BitmapAsset>();
}
private String atlasId;
/**
* Adds a bitmap to the atlas
*
* @param bitmap
*/
public void addBitmapAsset(BitmapAsset ba) {
BitmapAsset existingBA = getBitmapAssetByReso... | setId(Shared.textureManager().getNewAtlasId()); | 5 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/forum/detail/view/ForumDetailActivity.java | [
"public abstract class BaseActivity extends AppCompatActivity {\n\n @LayoutRes\n public abstract int findLayout();\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(findLayout());\n ButterKnife.bind(... | import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.Toolba... | package com.mgilangjanuar.dev.goscele.modules.forum.detail.view;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class ForumDetailActivity extends BaseActivity {
@BindView(R.id.toolbar_forum_detail)
Toolbar toolbar;
@BindView(R.id.view_pager_activity_forum_detail)... | ShareContentUtil.share(this, presenter.getContentModel()); | 3 |
JulienDev/BugDroid | app/src/main/java/fr/julienvermet/bugdroid/ui/BugFragment.java | [
"public class BugDroidApplication extends Application implements OnSharedPreferenceChangeListener {\n\n // Android\n public static Context mContext;\n private static SharedPreferences mPrefs;\n\n // Objects\n public static Instance mCurrentInstance;\n\n @Override\n public void onCreate() {\n ... | import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Handler.Callback;
import android.os.Message;
import android.os.Messenger;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentPagerAdapter;
impo... | /*
* Copyright (C) 2013 Julien Vermet
*
* 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 writ... | if (getActivity() instanceof BugActivity || getActivity() instanceof BugMultiPaneActivity) { | 5 |
Nilhcem/droidcontn-2016 | app/src/internal/java/com/nilhcem/droidcontn/debug/stetho/AppDumperPlugin.java | [
"@Value\npublic class Session implements Parcelable {\n\n public static final Parcelable.Creator<Session> CREATOR = new Parcelable.Creator<Session>() {\n public Session createFromParcel(Parcel source) {\n return new Session(source);\n }\n\n public Session[] newArray(int size) {\n ... | import android.annotation.TargetApi;
import android.app.Activity;
import android.app.Application;
import android.app.PendingIntent;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Sy... | package com.nilhcem.droidcontn.debug.stetho;
public class AppDumperPlugin implements DumperPlugin {
private final Context context;
private final ApiEndpoint endpoint;
private final SessionsDao sessionsDao;
private final ActivityProvider activityProvider;
@Inject
public AppDumperPlugin(A... | ComponentName componentName = new ComponentName(context, BootReceiver.class); | 4 |
Orange-OpenSource/BeaconTag-Android-SDK | beacontag_sdk/src/main/java/com/orange/beaconme_sdk/control/BeaconMonitor.java | [
"public class BLEDeviceManager {\n private final String TAG = this.getClass().getSimpleName();\n\n public static final String ACTION_CONNECT_TO_DEVICE = \"com.orange.beacon_sdk.CONNECT_TO_DEVICE\";\n public static final String ACTION_DEVICE_CONNECTED = \"com.orange.beacon_sdk.DEVICE_CONNECTED\";\n publi... | import java.util.concurrent.ConcurrentHashMap;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.support.v4.content.LocalBroadc... | /*
* Copyright (c) 2015 Orange.
*
* This library is free software; you can redistribute it and/or modify it under the terms of
* the GNU Lesser General Public License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* This library is distrib... | public void onDetect(IBeaconDetect detection) { | 3 |
Petschko/Java-RPG-Maker-MV-Decrypter | src/main/java/org/petschko/rpgmakermv/decrypt/gui/Menu.java | [
"public class File {\n\tprivate String name;\n\tprivate String extension;\n\tprivate byte[] content = null;\n\tprivate String filePath;\n\n\t/**\n\t * File Constructor\n\t *\n\t * @param filePath - Path of the File\n\t * @throws Exception - Invalid File-Path\n\t */\n\tpublic File(String filePath) throws Exception {... | import org.petschko.lib.File;
import org.petschko.lib.Functions;
import org.petschko.lib.gui.JDirectoryChooser;
import org.petschko.lib.gui.notification.InfoWindow;
import org.petschko.rpgmakermv.decrypt.App;
import org.petschko.rpgmakermv.decrypt.Config;
import org.petschko.rpgmakermv.decrypt.Preferences;
import javax... | this.restoreProjectMV.setEnabled(false);
this.restoreProjectMZ.setEnabled(false);
this.help.setEnabled(false);
}
/**
* Disables Menu points which are always disabled on startup
*/
private void defaultDisabled() {
this.resetHeaderToDefault.setEnabled(false);
this.resetHeaderToDefaultE.setEnabled(false)... | this.reportABug.addActionListener(ActionListener.openWebsite(Config.PROJECT_BUG_REPORT_URL)); | 5 |
jenkinsci/tikal-multijob-plugin | src/test/java/com/tikal/jenkins/plugins/multijob/test/ConditionalPhaseTest.java | [
"@ExportedBean(defaultVisibility = 999)\r\npublic class MultiJobBuild extends Build<MultiJobProject, MultiJobBuild> {\r\n\r\n private List<SubBuild> subBuilds;\r\n private MultiJobChangeLogSet changeSets = new MultiJobChangeLogSet(this);\r\n private Map<String, SubBuild> subBuildsMap = new HashMap<String, ... | import com.tikal.jenkins.plugins.multijob.MultiJobBuild;
import hudson.model.Result;
import hudson.model.TopLevelItem;
import hudson.model.Cause.UserCause;
import hudson.model.FreeStyleProject;
import hudson.tasks.BuildStep;
import hudson.tasks.Shell;
import java.util.ArrayList;
import java.util.List;
import org.jenkin... | package com.tikal.jenkins.plugins.multijob.test;
/**
* @author Bartholdi Dominik (imod)
*/
public class ConditionalPhaseTest {
@Rule
public RestartableJenkinsRule rr = new RestartableJenkinsRule();
@Test
public void testConditionalPhase() throws Exception {
rr.then(new RestartableJenkins... | MultiJobBuild b = j.assertBuildStatus(Result.SUCCESS, multi.scheduleBuild2(0, new UserCause()).get()); | 0 |
caseydavenport/biermacht | src/com/biermacht/brews/frontend/fragments/ViewStylesFragment.java | [
"public class DisplayStyleActivity extends AppCompatActivity {\n\n private BeerStyle style;\n private int currentItem; // For storing current page\n DisplayStyleCollectionPagerAdapter cpAdapter;\n ViewPager mViewPager;\n ViewPager.OnPageChangeListener pageListener;\n\n @Override\n p... | import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView... | package com.biermacht.brews.frontend.fragments;
public class ViewStylesFragment extends Fragment implements BiermachtFragment {
private static int resource = R.layout.fragment_view;
;
private OnItemClickListener mClickListener;
private ListView listView;
private ArrayList<BeerStyle> list;
private BeerSt... | Collections.sort(list, new ToStringComparator()); | 5 |
BlackCraze/GameResourceBot | src/main/java/de/blackcraze/grb/commands/concrete/Check.java | [
"public static Locale getResponseLocale(Message message) {\r\n Locale channelLocale = getDefaultLocale();\r\n Mate mate = getMateDao().getOrCreateMate(message, channelLocale);\r\n if (mate != null && !StringUtils.isEmpty(mate.getLanguage())) {\r\n return new Locale(mate.getLanguage());\r\n }\r\n ... | import static de.blackcraze.grb.util.CommandUtils.getResponseLocale;
import static de.blackcraze.grb.util.CommandUtils.parseStockName;
import static de.blackcraze.grb.util.InjectorUtils.getMateDao;
import static de.blackcraze.grb.util.InjectorUtils.getStockTypeDao;
import static de.blackcraze.grb.util.InjectorUtils... | package de.blackcraze.grb.commands.concrete;
public class Check implements BaseCommand {
public void run(Scanner scanner, Message message) {
Optional<String> nameOptional = parseStockName(scanner);
MessageChannel channel = message.getChannel();
Locale locale = getResponseLocal... | Speaker.sayCode(channel, prettyPrintMate(mates, locale));
| 2 |
TheCount/jhilbert | src/main/java/jhilbert/commands/impl/CommandFactory.java | [
"public interface Command {\n\n\t/**\n\t * Executes this command.\n\t *\n\t * @throws CommandException if this command cannot be executed.\n\t */\n\tpublic void execute() throws CommandException;\n\n}",
"public class CommandException extends JHilbertException {\n\n\t/**\n\t * Creates a new <code>CommandException<... | import jhilbert.scanners.ScannerException;
import jhilbert.scanners.Token;
import jhilbert.scanners.TokenFeed;
import java.util.HashMap;
import java.util.Map;
import jhilbert.commands.Command;
import jhilbert.commands.CommandException;
import jhilbert.data.Module; | /*
JHilbert, a verifier for collaborative theorem proving
Copyright © 2008, 2009, 2011 The JHilbert Authors
See the AUTHORS file for the list of JHilbert authors.
See the commit logs ("git log") for a list of individual contributions.
This program is free software: you can redistribute it and/... | final Map<String, Command> commandMap = new HashMap(); | 0 |
chedim/minedriod | src/main/java/com/onkiup/minedroid/gui/views/ContentView.java | [
"public interface Context {\n /**\n * @return Context id\n */\n int contextId();\n\n}",
"@SideOnly(Side.CLIENT)\npublic class GuiManager {\n /**\n * Current MineDroid theme\n */\n public static HashMap<Integer, Style> themes = new HashMap<Integer, Style>();\n\n /**\n * Minecraft... | import com.onkiup.minedroid.Context;
import com.onkiup.minedroid.gui.GuiManager;
import com.onkiup.minedroid.gui.XmlHelper;
import com.onkiup.minedroid.gui.drawables.DebugDrawable;
import com.onkiup.minedroid.gui.primitives.Color;
import com.onkiup.minedroid.gui.primitives.Point;
import com.onkiup.minedroid.gui.primiti... | package com.onkiup.minedroid.gui.views;
/**
* Parent class for all GUI elements that have any content inside of them
*/
public abstract class ContentView extends View {
/**
* Content gravity on X axis
*/
protected HGravity hGravity = HGravity.LEFT;
/**
* Content gravity on Y axis
*/
... | DebugDrawable d = new DebugDrawable(new Color(0x6600ff00)); | 4 |
inovex/zax | src/main/java/com/inovex/zabbixmobile/activities/ServersActivity.java | [
"public class ServersListFragment extends BaseServiceConnectedListFragment {\n\n\tprivate BaseServiceAdapter<ZabbixServer> mServersListAdapter;\n\tprivate OnServerSelectedListener mActivity;\n\n\t@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\n\t\ttry {\n\t\t\tmActivity = (O... | import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import andro... | /*
This file is part of ZAX.
ZAX 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.
ZAX is distributed in the hope that it will be useful... | PubnubPushService.startOrStopPushService(getApplicationContext()); | 4 |
brsanthu/proxy-vole | src/main/java/com/btr/proxy/search/desktop/gnome/GnomeProxySearchStrategy.java | [
"public interface ProxySearchStrategy {\n\n\t/*************************************************************************\n\t * Gets the a ProxySelector found by applying the search strategy.\n\t * @return a ProxySelector, null if none is found.\n\t ********************************************************************... | import java.io.File;
import java.io.IOException;
import java.net.ProxySelector;
import java.util.Properties;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import o... | package com.btr.proxy.search.desktop.gnome;
/*****************************************************************************
* Loads the Gnome proxy settings from the Gnome GConf settings.
* <p>
* The following settings are extracted from the configuration that is stored
* in <i>.gconf</i> folder found in the u... | File userDir = new File(PlatformUtil.getUserHomeDir()); | 6 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/request/app/AppList.java | [
"public class App implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n String id;\n String name;\n Domain domain_name;\n String created_at;\n App.Owner owner;\n String web_url;\n App.Stack stack;\n String requested_stack;\n String git_url;\n String buil... | import com.heroku.api.App;
import com.heroku.api.Heroku;
import com.heroku.api.exception.RequestFailedException;
import com.heroku.api.http.Http;
import com.heroku.api.http.HttpUtil;
import com.heroku.api.parser.Json;
import com.heroku.api.request.Request;
import com.heroku.api.util.Range;
import java.util.HashMap;
imp... | package com.heroku.api.request.app;
/**
* TODO: Javadoc
*
* @author Naaman Newbold
*/
public class AppList implements Request<Range<App>> {
private Map<String,String> headers = new HashMap<>();
public AppList() {
}
public AppList(String range) {
this();
this.headers.put("Rang... | throw new RequestFailedException("AppList Failed", code, in); | 2 |
openshopio/openshop.io-android | app/src/main/java/bf/io/openshop/UX/fragments/PageFragment.java | [
"public class CONST {\n\n // TODO update this variable\n /**\n * Specific organization ID, received by successful integration.\n */\n public static final int ORGANIZATION_ID = 4;\n /**\n * ID used for simulate empty/null value\n */\n public static final int DEFAULT_EMPTY_ID = -131;\n\... | import android.app.ProgressDialog;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.Tex... | package bf.io.openshop.UX.fragments;
/**
* Fragment allow displaying useful information content like web page.
* Requires input argument - id of selected page. Pages are created in OpenShop server administration.
*/
public class PageFragment extends Fragment {
/**
* Name for input argument.
*/
... | MainActivity.setActionBarTitle(getString(R.string.app_name)); | 8 |
ProtocolSupport/ProtocolSupportPocketStuff | src/protocolsupportpocketstuff/skin/PeToPcProvider.java | [
"public class ProtocolSupportPocketStuff extends JavaPlugin implements Listener {\n\n\tpublic static final String PREFIX = \"[\" + ChatColor.DARK_PURPLE + \"PSPS\" + ChatColor.RESET + \"] \";\n\n\tprivate static ProtocolSupportPocketStuff INSTANCE;\n\tpublic static ProtocolSupportPocketStuff getInstance() {\n\t\tre... | import java.util.Base64;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import protocolsupport.api.Connection;
import protocolsupport.api.events.PlayerProfileCompleteEvent;
import protocolsupportpocketstuff.ProtocolSupportPocketStuff;
import protocolsupportpocketstuff.api.skins.SkinUtils;
impor... | package protocolsupportpocketstuff.skin;
public class PeToPcProvider implements PocketPacketListener, Listener {
private static final ProtocolSupportPocketStuff plugin = ProtocolSupportPocketStuff.getInstance();
public static final String TRANSFER_SKIN = "PEApplySkinOnJoin";
@PocketPacketHandler
public void ... | boolean isSlim = SkinUtils.slimFromModel(packet.getJsonPayload().get("SkinGeometryName").getAsString()); | 1 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/fragment/MediaPlayerFragment.java | [
"public class Kickflip {\n public static final String TAG = \"Kickflip\";\n private static Context sContext;\n private static String sClientKey;\n private static String sClientSecret;\n\n private static KickflipApiClient sKickflip;\n\n // Per-Stream settings\n private static SessionConfig sSess... | import android.app.Fragment;
import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.Surface;
import android.view.TextureView;
import andr... | package io.kickflip.sdk.fragment;
/**
* MediaPlayerFragment demonstrates playing an HLS Stream, and fetching
* stream metadata via the .m3u8 manifest to decorate the display for Live streams.
*/
public class MediaPlayerFragment extends Fragment implements TextureView.SurfaceTextureListener, MediaController.Med... | Stream stream = (Stream) response; | 3 |
jaychang0917/SimpleRecyclerView | app/src/main/java/com/jaychang/demo/srv/SwipeToDismissActivity.java | [
"public class BookCell extends SimpleCell<Book, BookCell.ViewHolder>\n implements Updatable<Book> {\n\n private static final String KEY_TITLE = \"KEY_TITLE\";\n private boolean showHandle;\n\n public BookCell(Book item) {\n super(item);\n }\n\n @Override\n protected int getLayoutRes() {\n return R.layo... | import android.graphics.Canvas;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.jaychang.demo.srv.cell.BookCell;
import com.jaychang.demo.srv.cell.NumberCell;
import com.jaychang.demo.srv.model.Book;
import com.jaychang.demo.srv.util.DataUtils;
import com.jaychang.srv.Simp... | package com.jaychang.demo.srv;
public class SwipeToDismissActivity extends BaseActivity {
@BindView(R.id.linearVerRecyclerView)
SimpleRecyclerView linearVerRecyclerView;
@BindView(R.id.linearHorRecyclerView)
SimpleRecyclerView linearHorRecyclerView;
@BindView(R.id.resultView)
TextView resultView;
... | BookCell cell = new BookCell(book); | 0 |
material-motion/material-motion-android | library/src/main/java/com/google/android/material/motion/interactions/Tween.java | [
"public class ConstraintApplicator<T> {\n\n private final Operation<T, T>[] constraints;\n\n public ConstraintApplicator(Operation<T, T>[] constraints) {\n this.constraints = constraints;\n }\n\n public MotionObservable<T> apply(MotionObservable<T> stream) {\n for (Operation<T, T> constraint : constraints... | import android.animation.TimeInterpolator;
import android.animation.TypeEvaluator;
import android.util.Property;
import com.google.android.material.motion.ConstraintApplicator;
import com.google.android.material.motion.Interaction;
import com.google.android.material.motion.MotionObservable;
import com.google.android.ma... | /*
* Copyright 2017-present The Material Motion Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* ... | public void apply(MotionRuntime runtime, O target, ConstraintApplicator<T> constraints) { | 0 |
scauwe/Generic-File-Driver-for-IDM | shim/src/test/java/info/vancauwenberge/filedriver/filereader/xml/XPathXMLFileReaderTester.java | [
"@RunWith(MockitoJUnitRunner.class)\r\npublic abstract class AbstractStrategyTest {\r\n\r\n\t@BeforeClass\r\n\tpublic static void setUpBeforeClass() throws Exception {\r\n\t\tTrace.registerImpl(SysoutTrace.class, 0);\r\n\r\n\t}\r\n\r\n\tpublic Trace getTrace(){\r\n\t\treturn new Trace(\">\");\r\n\t}\r\n}\r",
"@Su... | import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.FileWriter;
import java.util.Map;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Exp... | /*******************************************************************************
* Copyright (c) 2007, 2018 Stefaan Van Cauwenberge
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0 (the "License"). If a copy of the MPL was not distributed with this
* file, You can obta... | params.putParameter(GenericFileDriverShim.DriverParam.SCHEMA.getParamName(),"AField,BField,CField");
| 4 |
ddarriba/jmodeltest2 | src/main/java/es/uvigo/darwin/jmodeltest/io/HtmlReporter.java | [
"public class ApplicationOptions implements Serializable {\n\n\tprivate static final long serialVersionUID = -3961572952922591321L;\n\tprivate static final int AMBIGUOUS_DATATYPE_STATE = 4;\n\tprivate static final int DEFAULT_SEED = 12345;\n\n\t/** Tree topology search algorithms */\n\tpublic static enum TreeSearch... | import java.awt.GraphicsEnvironment;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.UnsupportedEncodingExcepti... | /*
Copyright (C) 2011 Diego Darriba, David Posada
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... | public static void buildReport(ApplicationOptions options, Model models[], | 0 |
bafomdad/realfilingcabinet | com/bafomdad/realfilingcabinet/helpers/UpgradeHelper.java | [
"public interface IFilingCabinet extends ITileEntityProvider {\n\n\tpublic void leftClick(TileEntity tile, EntityPlayer player);\n\t\n\tpublic void rightClick(TileEntity tile, EntityPlayer player, EnumFacing side, float hitX, float hity, float hitZ);\n}",
"public interface IUpgrades {\n\n\tpublic boolean canApply... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import com.bafomdad.realfilingcabinet.api.IFilingCabinet;
import com.bafomdad.realfilingcabinet.api.IUpgrades;
import com.bafomdad.real... | package com.bafomdad.realfilingcabinet.helpers;
public class UpgradeHelper {
private static Map<ItemStack, String> upgrades = new HashMap<ItemStack, String>();
/**
* Put this in init phase or sometime after you've registered all your items. Stack must implement IUpgrades, and tag must not be empty.
* @para... | public static boolean hasUpgrade(TileEntityRFC tile) { | 2 |
xpush/lib-xpush-android | lib/src/main/java/io/xpush/chat/services/XPushService.java | [
"public class XPushCore {\n\n private static final int NETWORK_WIFI = 1;\n private static final int NETWORK_MOBILE = 2;\n private static final int NETWORK_NOT_AVAILABLE = 0;\n\n private static XPushSession mXpushSession;\n\n private static final String TAG = XPushCore.class.getSimpleName();\n\n pu... | import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import androi... | package io.xpush.chat.services;
public class XPushService extends Service {
private static final String TAG = XPushService.class.getSimpleName();
private static final String XPUSH_THREAD_NAME = "XPushService[" + TAG + "]"; // Handler Thread ID
private static final int XPUSH_KEEP_ALIVE = 1000 * 5 * 6... | private XPushMessageDataSource mDataSource; | 4 |
SecrecySupportTeam/Secrecy_fDroid_DEPRECIATED | app/src/main/java/com/doplgangr/secrecy/Views/FilePhotoFragment.java | [
"public class Config {\n public static final int bufferSize = 2097152;\n public static final String file_extra = \"FILE\";\n public static final String vault_extra = \"VAULT\";\n public static final String password_extra = \"PASS\";\n public static final String gallery_item_extra = \"GALLERYITEMIS\";... | import android.app.Activity;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import an... | package com.doplgangr.secrecy.Views;
@Fullscreen
@WindowFeature(Window.FEATURE_NO_TITLE)
@EActivity(R.layout.activity_view_pager)
public class FilePhotoFragment extends FragmentActivity {
static Activity context;
@Extra(Config.vault_extra)
String vault;
@Extra(Config.password_extra)
String pa... | HackyViewPager mViewPager; | 6 |
jVoid/jVoid | src/test/java/io/jvoid/test/instrumentation/provider/ProviderCatalogTest.java | [
"@Singleton\npublic class ProviderCatalog {\n\n private List<InstrumentationProvider> registeredProviders = new ArrayList<>();\n\n // This is still \"hardcoded\" providers. Make it discover the providers in\n // the classpath automatically\n @Inject\n public void initializeProviders(AppInstrumentatio... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import io.jvoid.instrumentation.provider.ProviderCatalog;
import io.jvoid.instr... | package io.jvoid.test.instrumentation.provider;
public class ProviderCatalogTest extends AbstractJVoidTest {
private CtClass ctTestClass1, ctTestClass2;
private ProviderCatalog providerCatalog;
@Override
@Before
public void setUp() throws NotFoundException {
ctTestClass1 = classPool.... | List<InstrumentationProvider> providers = new ArrayList<>(providerCatalog.getProvidersForClass(ctTestClass1)); | 2 |
komamj/FileManager | app/src/main/java/com/koma/filemanager/fileview/FileViewActivity.java | [
"public abstract class BaseMenuActivity extends BaseSwipeBackActivity implements ActionMode.Callback {\n private static final String TAG = \"BaseMenuActivity\";\n protected SearchView mSearchView;\n protected MenuItem mSortMenu, mSearchItem, mMoreMenu, mShareMenu, mCutMenu,\n mDeleteMenu;\n @... | import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import com.koma.filemanager.R;
import com.koma.filemanager.base.BaseMenuActivity;
import com.koma.filemanager.data.FileRepository;
import com.koma.filemanager.helper.FileSortHelper;
import com.koma.filemanager.helper.RxBus;
import com.koma.fil... | package com.koma.filemanager.fileview;
/**
* Created by koma on 11/30/16.
*/
public class FileViewActivity extends BaseMenuActivity {
private static final String TAG = "FileViewActivity";
FileViewPresenter mPresenter;
private String mPath;
public void onCreate(Bundle savedInstanceState) {
... | LogUtils.i(TAG, "onCreate"); | 6 |
amymcgovern/spacesettlers | src/spacesettlers/gui/ObjectInfoPanel.java | [
"abstract public class AbstractObject {\n\t/**\n\t * Position of the object in the simulator space \n\t */\n\tprotected Position position;\n\t\n\t/**\n\t * The radius of the object\n\t */\n\tprotected int radius;\n\t\n\t/**\n\t * The mass of the object\n\t */\n\tprotected int mass, originalMass;\n\t\n\t/**\n\t * Is... | import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import spacesettlers.objects.AbstractObject;
import spacesettlers.objects.Asteroid;
import... | package spacesettlers.gui;
public class ObjectInfoPanel extends JPanel {
GridBagConstraints constraints;
ResourcesPanel resourcesPanel;
AbstractObject selectedObject;
InnerObjectPanel innerPanel;
JLabel objectName;
class InnerObjectPanel extends JPanel {
JLabel isAlive, mass, radius, flag, core;
publ... | } else if (selectedObject.getClass() == Ship.class) { | 3 |
hyounesy/ChAsE | src/org/sfu/chase/core/ClustFramework.java | [
"public class BioReader\n{\n\tprivate static Logger log = Logger.getLogger(BioReader.class);\n\t\n\t// Stores the features for all chromosomes\n\tprotected ChromFeatures \tm_ChromFeatures;\n\t\n\t// toggles, message output (debug) \n\tprotected static boolean m_bVerbose \t= false;\n\tprotected boolean\t\t m_bPrintP... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Hashtable;
import java.util.Map;
import java.util.Random;
import javax.swing.JFileChooser;
import javax.swing.e... | package org.sfu.chase.core;
public class ClustFramework
{ | private Table m_Table; | 5 |
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); | 3 |
stefanhaustein/nativehtml | android/src/main/java/org/kobjects/nativehtml/android/AndroidSelectElement.java | [
"public enum ContentType {\n\tCOMPONENTS,\n\tDATA_ELEMENTS,\n\tFORMATTED_TEXT,\n\tTEXT_ONLY,\n\tEMPTY, \n}",
"public class Document {\n private static final LinkedHashMap<String, ElementType> ELEMENT_TYPES = new LinkedHashMap<>();\n private static final LinkedHashMap<String, ContentType> CONTENT_TYPES = new... | import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.CheckedTextView;
import android.widget.Spinner;
import android.widget.T... | package org.kobjects.nativehtml.android;
public class AndroidSelectElement extends AndroidWrapperElement implements HtmlSelectElement {
HtmlCollectionImpl children = new HtmlCollectionImpl();
Spinner spinner;
AndroidSelectElement(final Context context, Document document) {
super(context, document... | public void insertBefore(Element newChild, Element referenceChild) { | 2 |
SilenceDut/NBAPlus | app/src/main/java/com/me/silencedut/nbaplus/ui/fragment/TeamSortFragment.java | [
"public class AppService {\n private static final AppService NBAPLUS_SERVICE=new AppService();\n private static Gson sGson;\n private static EventBus sBus ;\n private static DBHelper sDBHelper;\n private static NbaplusAPI sNbaplusApi;\n private static NewsDetileAPI sNewsDetileApi;\n private sta... | import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.me.silencedut.nbaplus.R;
import com.me.silencedut.nbaplus.app.AppService;
import com.me.silencedut.nbaplus.data.Constant;
import com.me.silencedut.nbaplus.event.TeamSortEvent;
import com.me.silencedut.nbaplus... | package com.me.silencedut.nbaplus.ui.fragment;
/**
* Created by SilenceDut on 2015/12/12.
*/
public class TeamSortFragment extends SwipeRefreshBaseFragment {
@Bind(R.id.rv_news)
RecyclerView mTeamsListView;
private TeamSortAdapter mTeamSortAdapter;
protected List<Teams.TeamsortEntity> mTeamsSort... | if(Constant.Result.FAIL.equals(teamSortEvent.getEventResult())){ | 1 |
Plinz/Hive_Game | src/main/java/model/Player.java | [
"public class Ant extends Piece {\n\n\tpublic Ant(int id, int team) {\n\t\tsuper(Consts.ANT_NAME, id, team, \"La fourmi peut se déplacer d'autant d'espaces que le joueur le désire\");\n }\n\n\t@Override\n\tpublic List<CoordGene<Integer>> updatePossibleMovement(Tile tile, Board board) {\n\t\tList<CoordGene<In... | import java.util.ArrayList;
import java.util.Comparator;
import main.java.model.piece.Ant;
import main.java.model.piece.Beetle;
import main.java.model.piece.Grasshopper;
import main.java.model.piece.Queen;
import main.java.model.piece.Spider;
import main.java.utils.Consts; | package main.java.model;
public class Player implements Cloneable{
private String name;
private int team;
private ArrayList<Piece> inventory;
public Player(){
this.team = -1;
}
public Player(String name, int team) {
this.name = name;
this.team = team;
this.inventory = new ArrayList<Pi... | inventory.add(new Spider(Consts.SPIDER1, team)); | 4 |
jbush001/WaveView | src/test/java/ValueFormatterTest.java | [
"public final class AsciiValueFormatter implements ValueFormatter {\n @Override\n public String format(BitVector bits) {\n return Character.toString((char) bits.intValue());\n }\n}",
"public final class BinaryValueFormatter implements ValueFormatter {\n @Override\n public String format(BitVe... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
import org.junit.Test;
import waveview.AsciiValueFormatter;
import waveview.BinaryValueFormatter;
import waveview.OctalValueFormatter;
import waveview.DecimalValueFormatter;
import waveview... |
//
// Copyright 2016 Jeff Bush
//
// 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... | assertEquals("STATE_INIT", vf.format(new BitVector("1", 10))); | 7 |
Qihoo360/RePlugin | replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/replugin/packages/PluginManagerServer.java | [
"public class RePlugin {\n\n static final String TAG = \"RePlugin\";\n\n /**\n * 表示目标进程根据实际情况自动调配\n */\n public static final String PROCESS_AUTO = \"\" + IPluginManager.PROCESS_AUTO;\n\n /**\n * 表示目标为UI进程\n */\n public static final String PROCESS_UI = \"\" + IPluginManager.PROCESS_UI;... | import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.RemoteException;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import com.qihoo360.loader2.CertUtils;
import com.qihoo360.loader2.MP;
im... | /*
* Copyright (C) 2005-2017 Qihoo 360 Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | private List<PluginInfo> loadLocked() { | 2 |
Condroidapp/android | Condroid/src/main/java/cz/quinix/condroid/ui/listeners/DrawerItemClickListener.java | [
"@Singleton\r\npublic class DataProvider {\r\n\r\n\tpublic static int ITEMS_PER_PAGE = 40;\r\n\r\n\t@Inject\r\n\tprivate CondroidDatabase mDatabase;\r\n\r\n\tprivate Convention con;\r\n\r\n\tprivate List<Integer> favorited;\r\n\r\n\tprivate Map<Integer, ProgramLine> programLines = null;\r\n\r\n\tprivate List<Place>... | import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.view.View;
import java.util.List;
import java.util.Locale;
import cz.quinix.condroid.R;
import cz.quinix.condroid.database.DataProvider;
import cz.quinix.condro... | package cz.quinix.condroid.ui.listeners;
/**
* Created by Jan on 1. 6. 2014.
*/
public class DrawerItemClickListener implements View.OnClickListener {
private MainActivity parentActivity;
| private DataProvider provider;
| 0 |
gaffo/scumd | src/main/java/com/asolutions/scmsshd/MainNoAuth.java | [
"public class SshServer extends AbstractFactoryManager implements ServerFactoryManager {\n\n private IoAcceptor acceptor;\n private int port;\n private boolean reuseAddress = true;\n private List<NamedFactory<UserAuth>> userAuthFactories;\n private List<NamedFactory<ServerChannel>> channelFactories;\... | import java.util.Arrays;
import java.util.Properties;
import java.util.regex.Pattern;
import javax.naming.NamingException;
import org.apache.sshd.SshServer;
import org.apache.sshd.common.Compression;
import org.apache.sshd.common.NamedFactory;
import org.apache.sshd.common.compression.CompressionNone;
import org.apache... | package com.asolutions.scmsshd;
public class MainNoAuth {
public static void main(String[] args) throws Exception {
System.out.println("Starting Server");
final SshServer sshd = SshServer.setUpDefaultServer();
sshd.setPort(Integer.parseInt(args[0]));
String basedir = args[1];
setupAuthenticators(ssh... | CommandFactoryBase commandFactory = new GitCommandFactory(); | 3 |
mreutegg/laszip4j | src/main/java/com/github/mreutegg/laszip4j/laslib/LASwriterTXT.java | [
"public class LASpoint {\n\n private static final PrintStream stderr = System.err;\n\n // these fields contain the data that describe each point\n\n /**\n * I32 X; 0\n * I32 Y; 4\n * I32 Z; 8\n... | import com.github.mreutegg.laszip4j.laszip.LASpoint;
import com.github.mreutegg.laszip4j.laszip.MyDefs;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.UncheckedIOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.text.DecimalFormat;
import ... | fprintf(file, "%g %g %g %g\012", payload.getDouble(18*8), payload.getDouble(19*8), payload.getDouble(20*8), payload.getDouble(21*8)); // transformation_row_0
fprintf(file, "%g %g %g %g\012", payload.getDouble(22*8), payload.getDouble(23*8), payload.getDouble(24*8), payload.getDouble(25*8... | private boolean unparse_attribute(LASpoint point, int index) | 0 |
MikeFot/java-lib-annotated-validator | src/test/com/michaelfotiadis/validator/annotated/validators/numeric/doublenum/ProcessorDoubleMinValueValidatorTest.java | [
"public class ValidationResultsContainer {\n\n private final Map<String, List<ValidationStatus>> resultsMap;\n\n public ValidationResultsContainer() {\n resultsMap = new HashMap<>();\n }\n\n public Map<String, List<ValidationStatus>> getResults() {\n return resultsMap;\n }\n\n public... | import com.michaelfotiadis.validator.annotated.ValidationResultsContainer;
import com.michaelfotiadis.validator.annotated.annotations.numeric.doublenum.DoubleMinValue;
import com.michaelfotiadis.validator.annotated.model.ValidationStatus;
import com.michaelfotiadis.validator.annotated.processor.AnnotatedValidatorProces... | package com.michaelfotiadis.validator.annotated.validators.numeric.doublenum;
/**
*
*/
public class ProcessorDoubleMinValueValidatorTest {
private AnnotatedValidatorProcessor processor;
@Before
public void setUp() throws Exception {
processor = new AnnotatedValidatorProcessor();
}
... | assertEquals(result.getFailedStatuses().iterator().next(), ValidationStatus.DOUBLE_OUT_OF_RANGE); | 1 |
GlitchCog/ChatGameFontificator | src/main/java/com/glitchcog/fontificator/gui/controls/panel/ControlPanelMessage.java | [
"public class ChatViewerBot extends PircBot\n{\n private static final Logger logger = Logger.getLogger(ChatViewerBot.class);\n\n /**\n * Debugging method to feed captured strings that include Twitch tags into the program\n * \n * @param filename\n * Name of a text file containing on... | import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import ... | package com.glitchcog.fontificator.gui.controls.panel;
/**
* Contains all the options for how to format the messages that are displayed in the chat panel- things like whether and
* how the time stamp is displayed on the line
*
* @author Matt Yanos
*/
public class ControlPanelMessage extends ControlPanelBase
{... | private LabeledSlider queueSizeSlider; | 7 |
ralscha/wampspring | src/test/java/ch/rasc/wampspring/config/EnableWampWithUserConfigurerTest.java | [
"public class CallMessage extends WampMessage {\n\tprivate final String callID;\n\n\tprivate final String procURI;\n\n\tprivate final List<Object> arguments;\n\n\tpublic CallMessage(String callID, String procURI, Object... arguments) {\n\t\tsuper(WampMessageType.CALL);\n\t\tthis.callID = callID;\n\t\tthis.procURI =... | import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAu... | /**
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | assertThat(response).isInstanceOf(CallResultMessage.class); | 1 |
chirino/hawtdb | hawtdb/src/test/java/org/fusesource/hawtdb/internal/index/RecoveryTest.java | [
"public class BTreeIndexFactory<Key, Value> implements IndexFactory<Key, Value> {\n\n private Codec<Key> keyCodec = new ObjectCodec<Key>();\n private Codec<Value> valueCodec = new ObjectCodec<Value>();\n private boolean deferredEncoding = true;\n private Prefixer<Key> prefixer;\n private Comparator c... | import org.fusesource.hawtdb.api.TxPageFileFactory;
import static org.junit.Assert.assertEquals;
import org.fusesource.hawtbuf.codec.LongCodec;
import org.fusesource.hawtbuf.codec.StringCodec;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import... | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | SortedIndex<Long, String> root = ROOT_FACTORY.create(tx); | 1 |
michaelmarconi/oncue | oncue-tests/src/test/java/oncue/tests/DeleteJobTest.java | [
"public class DeleteJobException extends Exception {\n\n\tprivate static final long serialVersionUID = 5126321084027131583L;\n\n\tpublic DeleteJobException(String message) {\n\t\tsuper(message);\n\t}\n\n}",
"public class DeleteJob implements Serializable {\n\n\tprivate static final long serialVersionUID = 8618404... | import akka.actor.ActorRef;
import akka.actor.Status.Failure;
import akka.testkit.JavaTestKit;
import static org.junit.Assert.assertEquals;
import java.util.Arrays;
import java.util.HashSet;
import oncue.common.exceptions.DeleteJobException;
import oncue.common.messages.DeleteJob;
import oncue.common.messages.EnqueueJo... | /*******************************************************************************
* Copyright 2013 Michael Marconi
*
* 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.apa... | assertEquals(Job.State.DELETED, deletedJob.getState()); | 4 |
syvaidya/openstego | src/main/java/com/openstego/desktop/plugin/lsb/LSBEmbedOptionsUI.java | [
"public class OpenStegoConfig {\n /**\n * Key string for configuration item - useCompression\n * <p>\n * Flag to indicate whether compression should be used or not\n */\n public static final String USE_COMPRESSION = \"useCompression\";\n\n /**\n * Key string for configuration item - use... | import com.openstego.desktop.OpenStegoConfig;
import com.openstego.desktop.ui.OpenStegoFrame;
import com.openstego.desktop.ui.PluginEmbedOptionsUI;
import com.openstego.desktop.util.CommonUtil;
import com.openstego.desktop.util.LabelUtil;
import javax.swing.*;
import javax.swing.event.ChangeListener;
import java.awt.*; | /*
* Steganography utility to hide messages into cover files
* Author: Samir Vaidya (mailto:syvaidya@gmail.com)
* Copyright (c) Samir Vaidya
*/
package com.openstego.desktop.plugin.lsb;
/**
* GUI class for the LSB Plugin
*/
@SuppressWarnings("unused")
public class LSBEmbedOptionsUI extends PluginEmbedOptionsU... | CommonUtil.setEnabled(coverFileTextField, false); | 3 |
danielgimenes/NasaPic | app/src/main/java/br/com/dgimenes/nasapic/control/fragment/BestPicturesFragment.java | [
"public enum ErrorMessage {\n DOWNLOADING_IMAGE(\"Error downloading image\", R.string.error_downloading_apod), //\n LOADING_RECENT_PICS(\"Error loading recent pictures\", R.string.error_loading_feed),\n LOADING_BEST_PICS(\"Error loading best pictures\", R.string.error_loading_feed), //\n SETTING_WALLPAP... | import android.view.View;
import java.util.List;
import br.com.dgimenes.nasapic.control.ErrorMessage;
import br.com.dgimenes.nasapic.model.SpacePic;
import br.com.dgimenes.nasapic.service.EventsLogger;
import br.com.dgimenes.nasapic.service.interactor.OnFinishListener;
import br.com.dgimenes.nasapic.service.interactor.... | package br.com.dgimenes.nasapic.control.fragment;
public class BestPicturesFragment extends RecentPicturesFragment {
@Override
protected void loadFeed() {
synchronized (loadingFeed) {
if (!loadingFeed) {
loadingFeed = true;
}
} | SpacePicInteractor spacePicInteractor = new SpacePicInteractor(getActivity()); | 4 |
apache/activemq-activeio | activeio-core/src/test/java/org/apache/activeio/xnet/hba/ServiceAccessControllerTest.java | [
"public interface ServerService extends SocketService {\n\n public void init(Properties props) throws Exception;\n\n public void start() throws ServiceException;\n\n public void stop() throws ServiceException;\n\n\n /**\n * Gets the ip number that the\n * daemon is listening on.\n */\n pu... | import junit.framework.TestCase;
import org.apache.activeio.xnet.ServerService;
import org.apache.activeio.xnet.ServiceException;
import org.apache.activeio.xnet.hba.IPAddressPermission;
import org.apache.activeio.xnet.hba.IPAddressPermissionFactory;
import org.apache.activeio.xnet.hba.ServiceAccessController;
import j... | /**
*
* 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 ... | IPAddressPermissionFactory.getIPAddressMask("121.122.123.a"); | 3 |
zegerhoogeboom/flysystem-java | src/test/java/com/flysystem/cache/CachedAdapterTest.java | [
"public interface Adapter extends Read, Write\n{\n}",
"public class Config\n{\n\tprotected Map<String, Object> settings = new HashMap<String, Object>();\n\tprotected Config fallback;\n\n\tpublic Config(Map<String, Object> settings)\n\t{\n\t\tthis.settings = settings;\n\t}\n\n\tpublic Config()\n\t{\n\t\tthis.setti... | import com.flysystem.core.Adapter;
import com.flysystem.core.Config;
import com.flysystem.core.FileMetadata;
import com.flysystem.core.Visibility;
import com.flysystem.core.cache.Cache;
import com.flysystem.core.cache.CacheCommands;
import com.flysystem.core.cache.CachedAdapter;
import org.hamcrest.CoreMatchers;
import... | /*
* Copyright (c) 2013-2015 Frank de Jonge
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge,... | CacheCommands mockedCommands; | 5 |
ailab-uniud/distiller-CORE | src/main/java/it/uniud/ailab/dcore/annotation/annotators/SimpleNGramGeneratorAnnotator.java | [
"public abstract class DocumentComponent extends Annotable {\n\n private final String text;\n private Locale language;\n\n /**\n * Creates a document component.\n *\n * @param text the text of the component\n * @param language the language of the component\n * @param identifier the uniq... | import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.simple.JSONArr... | /*
* Copyright (C) 2015 Artificial Intelligence
* Laboratory @ University of Udine.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your... | public void annotate(Blackboard blackboard, DocumentComponent component) {
| 0 |
multi-os-engine/moe-plugin-gradle | src/main/java/org/moe/gradle/remote/ServerSettings.java | [
"public class MoePlugin extends AbstractMoePlugin {\n\n private static final Logger LOG = Logging.getLogger(MoePlugin.class);\n\n private static final String MOE_ARCHS_PROPERTY = \"moe.archs\";\n\n @NotNull\n private MoeExtension extension;\n\n @NotNull\n @Override\n public MoeExtension getExte... | import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UserInfo;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
impor... | }
}
private void load() {
// Load properties file if exists
final File propsFile = plugin.getProject().file(MOE_REMOTEBUILD_PROPERTIES);
properties = new Properties();
try {
if (propsFile.exists()) {
properties.load(new FileInputStream(propsF... | private final TermColor color; | 4 |
davidmoten/state-machine | state-machine-generator/src/main/java/com/github/davidmoten/fsm/model/StateMachineDefinition.java | [
"public static String camelCaseToSpaced(String s) {\n return s.chars().mapToObj(ch -> {\n if (ch >= 'A' && ch <= 'Z') {\n return \" \" + (char) ch;\n } else {\n return \"\" + (char) ch;\n }\n }).collect(Collectors.joining(\"\"));\n}",
"public final class Graph {\n\... | import static com.github.davidmoten.fsm.Util.camelCaseToSpaced;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;
import java.util.Map;... | package com.github.davidmoten.fsm.model;
public final class StateMachineDefinition<T> {
private final Class<T> cls;
private final List<Transition<T, ? extends Event<? super T>, ? extends Event<? super T>>> transitions = new ArrayList<>();
private final Set<State<T, ? extends Event<? super T>>> states =... | private final State<T, EventVoid> initialState; | 8 |
Semx11/Autotip | src/main/java/me/semx11/autotip/api/request/impl/KeepAliveRequest.java | [
"public class GetBuilder {\n\n private static final String BASE_URL = \"https://api.autotip.pro/\";\n\n private final RequestBuilder builder;\n\n private GetBuilder(Request request) {\n this.builder = RequestBuilder.get().setUri(BASE_URL + request.getType().getEndpoint());\n }\n\n public stati... | import java.util.Optional;
import me.semx11.autotip.api.GetBuilder;
import me.semx11.autotip.api.RequestHandler;
import me.semx11.autotip.api.RequestType;
import me.semx11.autotip.api.SessionKey;
import me.semx11.autotip.api.reply.Reply;
import me.semx11.autotip.api.reply.impl.KeepAliveReply;
import me.semx11.autotip.a... | package me.semx11.autotip.api.request.impl;
public class KeepAliveRequest implements Request<KeepAliveReply> {
private final SessionKey sessionKey;
private KeepAliveRequest(SessionKey sessionKey) {
this.sessionKey = sessionKey;
}
public static KeepAliveRequest of(SessionKey sessionKey) {
... | HttpUriRequest request = GetBuilder.of(this) | 0 |
jferrater/Tap-And-Eat-MicroServices | FoodTrayService/src/main/java/com/github/joffryferrater/foodtrayservice/FoodTrayController.java | [
"@lombok.Getter\r\npublic class Item {\r\n\r\n\t@JsonProperty(\"Item Code\")\r\n\tprivate String itemCode;\r\n\t@JsonProperty(\"Name\")\r\n\tprivate String name;\r\n\t\r\n\tpublic Item() {\r\n\t\tsuper();\r\n\t}\r\n\t\r\n\tpublic Item(String itemCode, String name) {\r\n\t\tthis.itemCode = itemCode;\r\n\t\tthis.name... | import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.spr... | package com.github.joffryferrater.foodtrayservice;
/**
*
* @author Joffry Ferrater
*
*/
@RestController
@RequestMapping("/foodtrays")
public class FoodTrayController {
@Autowired
ItemServiceRepository itemServiceRepository;
@Autowired
PriceServiceRepository priceServiceRepo;
| private List<TrayItem> trayItems = new ArrayList<TrayItem>();
| 2 |
hazelcast/spring-data-hazelcast | src/test/java/org/springframework/data/hazelcast/repository/query/QueryIT.java | [
"public class TestConstants {\n\n public static final String CLIENT_INSTANCE_NAME = \"hazelcast-instance-client\";\n public static final String SERVER_INSTANCE_NAME = \"hazelcast-instance-server\";\n\n public static final String SPRING_TEST_PROFILE_CLIENT_SERVER = \"client-server\";\n public static fina... | import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import org.springframework.data.domain.S... | /*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... | private CityRepository cityRepository; | 4 |
komiya-atsushi/fast-rng-java | fast-rng-test/src/main/java/biz/k11i/rng/test/gof/ContinuousGofTest.java | [
"public class ComputationAndSorting<S extends ComputationAndSorting.Splittable<S>> {\n @FunctionalInterface\n public interface Computation<S extends Splittable<S>> {\n double compute(S splittable, int index);\n }\n\n @FunctionalInterface\n public interface Splittable<S extends Splittable<S>> {... | import biz.k11i.rng.test.util.ComputationAndSorting;
import biz.k11i.rng.test.util.SplittableRandomWrapper;
import biz.k11i.rng.test.util.distribution.ContinuousDistribution;
import biz.k11i.rng.test.util.distribution.ProbabilityDistributions;
import biz.k11i.rng.test.util.inference.AndersonDarlingTest;
import net.jafa... | package biz.k11i.rng.test.gof;
/**
* Provides Goodness-of-Fit test for discrete random number generator.
*/
class ContinuousGofTest extends GoodnessOfFitTest {
/**
* Builds {@link ContinuousGofTest} object.
*/
public static class Builder extends BuilderBase<Builder> {
private ContinuousDi... | this.distribution = ProbabilityDistributions.wrap(distribution); | 3 |
Doctoror/ParticlesDrawable | library/src/main/java/com/doctoror/particlesdrawable/ParticlesView.java | [
"@Keep\npublic interface SceneConfiguration {\n\n /**\n * Set number of particles to draw per scene.\n *\n * @param density the number of particles to draw per scene\n * @throws IllegalArgumentException if density is negative\n */\n void setDensity(@IntRange(from = 0) int density);\n\n ... | import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Animatable;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewParent;
import com.doctoror.particlesdrawable.contract.SceneConfi... | /*
* Copyright (C) 2017 Yaroslav Mytkalyk
*
* 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... | private final Engine engine = new Engine(scene, this, renderer); | 4 |
smart-fun/smartGL | smartgl/src/main/java/fr/arnaudguyon/smartgl/tools/ColladaModel.java | [
"public class Vector3D {\n\n private float[] mVector = new float[3];\n\n public Vector3D(float x, float y, float z) {\n mVector[0] = x;\n mVector[1] = y;\n mVector[2] = z;\n }\n\n public float[] getArray() {\n return mVector;\n }\n\n public Vector3D normalize() {\n ... | import android.content.Context;
import android.util.Log;
import androidx.annotation.FloatRange;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import jav... | /*
Copyright 2019 Mj Mendoza IV
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... | private HashMap<String, Texture> mTextures = new HashMap<>(); | 5 |
bobthekingofegypt/BobBall | app/src/main/java/org/bobstuff/bobball/GameLogic/GameManager.java | [
"public abstract class Actor implements Runnable {\n protected GameManager gameManager;\n protected int[] playerIds;\n /**\n * approx. freq of the calls to the run method per game cycle\n * 0 means call only once\n */\n public float getExecFreq(){return 0.0f;};\n\n public Actor(GameMana... | import android.graphics.RectF;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;
import org.bobstuff.bobball.Actors.Actor;
import org.bobstuff.bobball.Actors.NetworkActor;
import org.bobstuff.bobball.Actors.StupidAIActor;
import org.bobstuff.bobball.Network.NetworkIP;
import org.bobstuff.... | /*
Copyright (c) 2012 Richard Martin. All rights reserved.
Licensed under the terms of the BSD License, see LICENSE.txt
*/
package org.bobstuff.bobball.GameLogic;
public class GameManager implements Parcelable, Runnable {
private static final String TAG = "GameManager";
public static final int NUMBER_... | private List<Actor> actors = new ArrayList<>(); | 0 |
liuling07/QiQuYing | app/src/main/java/com/lling/qiqu/activitys/IndexActivity.java | [
"public class App extends Application {\n\tprivate static App mAppApplication;\n\tpublic static final String SP_FILE_NAME = \"qiquying_msg_sp\";\n\tprivate static SharePreferenceUtil mSpUtil;\n\tpublic static User currentUser = null;\n\tpublic static List<Activity> activities = new ArrayList<Activity>(); //用于记录已经开启... | import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
impo... | package com.lling.qiqu.activitys;
/**
* @ClassName: IndexActivity
* @Description: 主界面
* @author lling
* @date 2015-6-7
*/
@ContentView(R.layout.activity_index)
public class IndexActivity extends TabActivity implements
OnCheckedChangeListener {
@ViewInject(R.id.radiogroup)
private RadioGroup mRadioGroup;
pr... | ToastUtils.showMessage(getApplicationContext(), R.string.exit_hint); | 6 |
FernandoOrtegaMartinez/Planket | app/src/test/java/com/fomdeveloper/planket/ProfilePresenterTest.java | [
"public class FlickrUser implements UserProfileInfo {\n\n @SerializedName(\"nsid\")\n private String userId;\n\n @SerializedName(\"iconserver\")\n private String iconserver;\n\n @SerializedName(\"iconfarm\")\n private Integer iconfarm;\n\n @SerializedName(\"username\")\n private StringConten... | import com.fomdeveloper.planket.data.model.FlickrUser;
import com.fomdeveloper.planket.data.model.PhotoItem;
import com.fomdeveloper.planket.data.model.transportmodel.UserShowcase;
import com.fomdeveloper.planket.data.repository.FlickrRepository;
import com.fomdeveloper.planket.ui.presentation.profile.ProfilePresenter;... | package com.fomdeveloper.planket;
/**
* Created by Fernando on 22/10/2016.
*/
public class ProfilePresenterTest {
private static final String AN_USER_ID = "user_id";
@Mock
private FlickrRepository mockFlickrRepository;
@Mock
private ProfileView mockView;
private ProfilePresenter prof... | FlickrUser mockFlickrUser = mock(FlickrUser.class); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.