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 |
|---|---|---|---|---|---|---|
DaiDongLiang/DSC | src/main/java/net/floodlightcontroller/core/internal/IOFSwitchManager.java | [
"public class FloodlightContext {\n\t//一个线程安全的HashMap仓库\n protected ConcurrentHashMap<String, Object> storage =\n new ConcurrentHashMap<String, Object>();\n\n public ConcurrentHashMap<String, Object> getStorage() {\n return storage;\n }\n}",
"public interface IOFConnectionBackend extend... | import java.util.List;
import net.floodlightcontroller.core.FloodlightContext;
import net.floodlightcontroller.core.IOFConnectionBackend;
import net.floodlightcontroller.core.IOFSwitch.SwitchStatus;
import net.floodlightcontroller.core.IOFSwitchBackend;
import net.floodlightcontroller.core.IOFSwitchDriver;
import net.f... | package net.floodlightcontroller.core.internal;
public interface IOFSwitchManager {
/**
* Called when a switch is added.
* 在交换机添加是被调用
* @param sw the added switch
*/
void switchAdded(IOFSwitchBackend sw);
/**
* Called when a switch disconnects
* 交换机断开连接时被调用
* @param... | void switchStatusChanged(IOFSwitchBackend sw, SwitchStatus oldStatus, | 2 |
hugmanrique/PokeData | src/main/java/me/hugmanrique/pokedata/items/Item.java | [
"public class Data {\n protected Data() {}\n\n public Data(ROM rom) {}\n\n public Data(ROM rom, int offset) {\n this(rom.seekAndGet(offset));\n }\n}",
"public interface Imageable {\n ROMImage getImage(ROM rom, ROMData data);\n}",
"@Getter\npublic class Palette {\n private static final C... | import lombok.Getter;
import lombok.ToString;
import me.hugmanrique.pokedata.Data;
import me.hugmanrique.pokedata.graphics.Imageable;
import me.hugmanrique.pokedata.graphics.Palette;
import me.hugmanrique.pokedata.graphics.ROMImage;
import me.hugmanrique.pokedata.loaders.ROMData;
import me.hugmanrique.pokedata.roms.ROM... | package me.hugmanrique.pokedata.items;
/**
* http://bulbapedia.bulbagarden.net/wiki/Item_data_structure_in_Generation_III
* @author Hugmanrique
* @since 30/04/2017
*/
@Getter
@ToString | public class Item extends Data implements Imageable { | 0 |
lumag/JBookReader | src/org/jbookreader/renderingengine/RenderEngineTest.java | [
"public class FB2FilesTestFilter implements FilenameFilter {\n\tpublic boolean accept(File dir, String name) {\n\t\tif (name.endsWith(\".fb2\")) {\n\t\t\treturn true;\n\t\t}\n\t\tif (name.endsWith(\".xml\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t\n}",
"public class TestConfig implements ITestCon... | import org.jbookreader.formatengine.IBookPainter;
import org.jbookreader.formatengine.impl.FormatEngine;
import org.jbookreader.renderingengine.RenderingEngine;
import org.jbookreader.util.TextPainter;
import org.lumag.filetest.FileTestCase;
import org.lumag.filetest.FileTestUtil;
import java.io.BufferedOutputStream;
i... | /*
* JBookReader - Java FictionBook Reader
* Copyright (C) 2006 Dmitry Baryshkov
*
* 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 o... | return FileTestUtil.constructTestSuite(new TestConfig(), "fengine", FB2FilesTestFilter.class, RenderEngineTestCase.class); | 1 |
socrata/datasync | src/main/java/com/socrata/datasync/job/GISJob.java | [
"public class CommandLineOptions {\n\n public static final String JOB_TYPE_FLAG = \"jobType\";\n public static final String CONFIG_FLAG = \"config\";\n public static final String USER_AGENT_FLAG = \"userAgent\";\n\n public static final String DATASET_ID_FLAG = \"datasetID\";\n public static final Str... | import com.socrata.api.SodaImporter;
import com.socrata.datasync.*;
import com.socrata.datasync.config.CommandLineOptions;
import com.socrata.datasync.config.controlfile.ControlFile;
import com.socrata.datasync.config.userpreferences.UserPreferences;
import com.socrata.datasync.config.userpreferences.UserPreferencesJav... | package com.socrata.datasync.job;
@JsonIgnoreProperties(ignoreUnknown=true)
@JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL)
public class GISJob extends Job {
static AtomicInteger jobCounter = new AtomicInteger(0);
int jobNum = jobCounter.getAndIncrement();
private String defaultJobName = "Uns... | String method = cmd.getOptionValue(CommandLineOptions.PUBLISH_METHOD_FLAG); | 0 |
czy1121/sdk3rd | ezy.sdk3rd.social/src/main/java/ezy/sdk3rd/social/AuthorizeSDK.java | [
"public interface IAuthorize extends IResult {\n void authorize(OnCallback<String> callback);\n}",
"public class DefaultCallback<R> implements OnCallback<R> {\n OnCallback<R> onCallback;\n OnSucceed<R> onSuccess;\n\n public DefaultCallback(OnCallback<R> callback, OnSucceed<R> success) {\n onCal... | import android.app.Activity;
import android.content.Intent;
import ezy.sdk3rd.social.authorize.IAuthorize;
import ezy.sdk3rd.social.sdk.DefaultCallback;
import ezy.sdk3rd.social.sdk.IFactory;
import ezy.sdk3rd.social.sdk.OnCallback;
import ezy.sdk3rd.social.sdk.OnSucceed;
import ezy.sdk3rd.social.sdk.ResultCode;
import... | package ezy.sdk3rd.social;
public class AuthorizeSDK {
static Sdk<IAuthorize> sdk = new Sdk<>();
public static void setDefaultCallback(OnCallback callback) {
sdk.setDefaultCallback(callback);
}
public static <T extends IAuthorize> void register(String name, String appId, Class<T> clazz) {
... | public static void authorize(final Activity activity, String platform, OnSucceed<String> listener) { | 4 |
eckig/graph-editor | model/src/main/java/de/tesis/dynaware/grapheditor/model/impl/GraphPackageImpl.java | [
"public interface GConnection extends EObject {\n\t/**\n\t * Returns the value of the '<em><b>Id</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <p>\n\t * If the meaning of the '<em>Id</em>' attribute isn't clear,\n\t * there really should be more of a description here...\n\t * </p>\n\t * <!-- end-user-doc... | import de.tesis.dynaware.grapheditor.model.GConnection;
import de.tesis.dynaware.grapheditor.model.GConnector;
import de.tesis.dynaware.grapheditor.model.GJoint;
import de.tesis.dynaware.grapheditor.model.GModel;
import de.tesis.dynaware.grapheditor.model.GNode;
import de.tesis.dynaware.grapheditor.model.GraphFactory;
... | /**
*/
package de.tesis.dynaware.grapheditor.model.impl;
/**
* <!-- begin-user-doc -->
* An implementation of the model <b>Package</b>.
* <!-- end-user-doc -->
* @generated
*/
public class GraphPackageImpl extends EPackageImpl implements GraphPackage {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc --... | super(eNS_URI, GraphFactory.eINSTANCE); | 5 |
roncoo/roncoo-adminlte-springmvc | src/main/java/com/roncoo/adminlte/service/impl/dao/impl/EmailAccountInfoDaoImpl.java | [
"public class RcEmailAccountInfo implements Serializable {\r\n private Long id;\r\n\r\n private String statusId;\r\n\r\n @JsonFormat(pattern = \"yyyy-MM-dd HH:mm:ss\")\r\n private Date createTime;\r\n\r\n @JsonFormat(pattern = \"yyyy-MM-dd HH:mm:ss\")\r\n private Date updateTime;\r\n\r\n privat... | import com.roncoo.adminlte.util.base.SqlUtil;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import com.roncoo.adminlte.bean.entity.RcEmailAccountInfo;
impo... | /*
* Copyright 2015-2016 RonCoo(http://www.roncoo.com) Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | criteria.andCreateTimeBetween(DateUtil.parseDate(datePremise), DateUtil.addDate(DateUtil.parseDate(datePremise), 1));
| 6 |
celer/mouse | Mouse/source/GoGenerate.java | [
"public class PEG\r\n{\r\n //=====================================================================\r\n //\r\n // Data\r\n //\r\n //=====================================================================\r\n //-------------------------------------------------------------------\r\n // Rules, subexpressions, te... | import mouse.peg.Expr;
import mouse.peg.Action;
import mouse.runtime.SourceFile;
import mouse.utility.CommandArgs;
import mouse.utility.Convert;
import mouse.utility.LineWriter;
import java.io.File;
import java.util.Date;
import java.util.Hashtable;
import java.util.TimeZone;
import java.util.Vector;
import ... | //=========================================================================
//
// Part of PEG parser generator Mouse.
//
// Copyright (C) 2009, 2010, 2011, 2012
// by Roman R. Redziejowski (www.romanredz.se).
//
// Modifications by David S. Tyree (github.com/celer/)
//
// Licensed under the Apache License,... | PEG peg;
| 0 |
trello/RxLifecycle | rxlifecycle-components/src/main/java/com/trello/rxlifecycle4/components/support/RxAppCompatDialogFragment.java | [
"public interface LifecycleProvider<E> {\n /**\n * @return a sequence of lifecycle events\n */\n @Nonnull\n @CheckReturnValue\n Observable<E> lifecycle();\n\n /**\n * Binds a source until a specific event occurs.\n *\n * @param event the event that triggers unsubscription\n * ... | import android.os.Bundle;
import android.view.View;
import com.trello.rxlifecycle4.LifecycleProvider;
import com.trello.rxlifecycle4.LifecycleTransformer;
import com.trello.rxlifecycle4.RxLifecycle;
import com.trello.rxlifecycle4.android.FragmentEvent;
import com.trello.rxlifecycle4.android.RxLifecycleAndroid;
import a... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed u... | return RxLifecycleAndroid.bindFragment(lifecycleSubject); | 4 |
Kixeye/kixmpp | kixmpp-p2p/src/main/java/com/kixeye/kixmpp/p2p/node/RemoteNode.java | [
"public class ClusterClient {\n private final static Logger logger = LoggerFactory.getLogger(ClusterClient.class);\n\n private final Node localNode;\n private final NodeServer server;\n private final MessageRegistry messageRegistry = new MessageRegistry();\n private final ExecutorService executorServ... | import com.kixeye.kixmpp.p2p.ClusterClient;
import com.kixeye.kixmpp.p2p.message.JoinRequest;
import com.kixeye.kixmpp.p2p.message.JoinResponse;
import com.kixeye.kixmpp.p2p.message.MessageRegistry;
import com.kixeye.kixmpp.p2p.message.MessageWrapper;
import io.netty.buffer.ByteBuf;
import io.netty.channel.Channel;
imp... | package com.kixeye.kixmpp.p2p.node;
/*
* #%L
* Hermes
* %%
* Copyright (C) 2014 Charles Barry
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/lic... | if (msg instanceof JoinResponse) { | 2 |
quhfus/DoSeR-Disambiguation | doser-dis-core/src/main/java/doser/entitydisambiguation/algorithms/collective/dbpedia/CollectiveDisambiguationDBpediaEntities.java | [
"public abstract class AbstractDisambiguationAlgorithm {\n\n\tprotected AbstractDisambiguationTask task;\n\n\tpublic void disambiguate(AbstractDisambiguationTask task)\n\t\t\tthrows IllegalDisambiguationAlgorithmInputException {\n\t\tif (checkAndSetInputParameter(task)) {\n\t\t\tif (preDisambiguation()) {\n\t\t\t\t... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
impor... | package doser.entitydisambiguation.algorithms.collective.dbpedia;
/**
* Collective Disambiguation Approach by Stefan Zwicklbauer
*
* @author quh
*
*/
public class CollectiveDisambiguationDBpediaEntities extends AbstractDisambiguationAlgorithm {
private final static Logger logger = LoggerFactory.getLogger(C... | List<SurfaceForm> collectiveRep = new LinkedList<SurfaceForm>(); | 1 |
iacobcl/MARA | src/logic/analysis/DeviceDistrAnalysis.java | [
"public class CodeDistr \r\n{\r\n\r\n\tprivate String code;\r\n\tprivate int total;\r\n\tprivate double perc;\r\n\tprivate int totalrel;\r\n\tprivate double percrel;\r\n\t\r\n\tpublic CodeDistr()\r\n\t{\r\n\t\tcode = new String();\r\n\t\ttotal = 0;\r\n\t\tperc = 0;\r\n\t\ttotalrel = 0;\r\n\t\tpercrel = 0;\r\n\t}\r\... | import storage.FileQuerying;
import storage.FileStoring;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.util.ArrayList;
import objs.CodeDistr;
import objs.Device;
import objs.Review;
import objs.stats.DeviceStats;
import objs.stats.reports.ReportDeviceStats;
import storage.DBQuerying;
| /*
# 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 ... | DeviceStats devstats = new DeviceStats();
| 3 |
wanasit/chrono-java | src/main/java/com/wanasit/chrono/parser/en/ENMonthNameLittleEndianParser.java | [
"public class ChronoOption {\n\n public static final ChronoOption sharedOptions = standardOptions();\n\n public final List<Parser> parsers = new ArrayList<Parser>();\n public final List<Refiner> refiners = new ArrayList<Refiner>();\n\n public final Map<String, Integer> timezoneMap = new HashMap<String, ... | import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.wanasit.chrono.ChronoOption;
import com.wanasit.chrono.ParsedDateComponent;
import com.wanasit.chrono.ParsedDateComponent.Components;
import com.wanasit.chrono.parser.Par... | package com.wanasit.chrono.parser.en;
public class ENMonthNameLittleEndianParser extends ParserAbstract {
protected static String regPattern = "(\\W|^)((Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sun|Mon|Tue|Wed|Thu|Fri|Sat)\\s*,?\\s*)?([0-9]{1,2})(st|nd|rd|th)?(\\s*(to|\\-|\\s)\\s*([0-9]{1,2})(st... | result.end = new ParsedDateComponent(); | 1 |
raduciobanu/mobemu | src/mobemu/MobEmu.java | [
"public class Epidemic extends Node {\n\n private boolean dissemination;\n private boolean altruismAnalysis;\n\n /**\n * Instantiates an {@code Epidemic} object.\n *\n * @param id ID of the node\n * @param nodes total number of existing nodes\n * @param context the context of this node\... | import java.util.*;
import mobemu.algorithms.Epidemic;
import mobemu.node.Message;
import mobemu.node.Node;
import mobemu.node.Stats;
import mobemu.parsers.UPB;
import mobemu.trace.Parser; | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mobemu;
/**
* Main class for MobEmu.
*
* @author Radu
*/
public class MobEmu {
public static void main(String[] args) {
Parser parser = new UPB(UPB.UpbTrace.UPB2011);
// print some tra... | nodes[i] = new Epidemic(i, nodes.length, parser.getContextData().get(i), parser.getSocialNetwork()[i], | 0 |
Hevelian/hevelian-olastic | olastic-core/src/main/java/com/hevelian/olastic/core/processors/impl/EntityCollectionProcessorHandler.java | [
"public final class ElasticOData extends ODataImpl {\n\n private ElasticOData() {\n }\n\n /**\n * Creates new instance of {@link ElasticOData} instance.\n * \n * @return new OData instance\n */\n public static ElasticOData newInstance() {\n return new ElasticOData();\n }\n\n ... | import com.hevelian.olastic.core.ElasticOData;
import com.hevelian.olastic.core.ElasticServiceMetadata;
import com.hevelian.olastic.core.processors.ESProcessor;
import com.hevelian.olastic.core.processors.ESReadProcessor;
import org.apache.olingo.commons.api.format.ContentType;
import org.apache.olingo.server.api.OData... | package com.hevelian.olastic.core.processors.impl;
/**
* <p>
* Custom Elastic processor for handling all request to retrieve data from
* collection of entities.
* </p>
* Supported items for now: 1. one 'groupby' for multiple fields; 2. metrics
* aggregations; 3. one 'groupby' for multiple fields with metrics ... | throwNotImplemented("Combining Transformations per Group is not supported."); | 6 |
xiaomi-sa/alertsystem | src/com/xiaomi/alertsystem/ui/MainActivity.java | [
"public class PagerSlidingTabStrip extends HorizontalScrollView {\n\n\tpublic interface IconTabProvider {\n\t\tpublic int getPageIconResId(int position);\n\t}\n\n\t// @formatter:off\n\tprivate static final int[] ATTRS = new int[] {\n\t\tandroid.R.attr.textSize,\n\t\tandroid.R.attr.textColor\n };\n\t// @formatter... | import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import androi... | /**
* All rights Reserved, Designed By NoOps.me
* Company: XIAOMI.COM
* @author:
* Xiaodong Pan <panxiaodong@xiaomi.com>
* Wei Lai <laiwei@xiaomi.com>
* @version V1.0
*/
package com.xiaomi.alertsystem.ui;
public class MainActivity extends FragmentActivity implements
DatabaseChangedListe... | public static List<String> level = Constants.NOTIFICATION_LEVEL; | 2 |
tliron/scripturian | components/scripturian/source/com/threecrickets/scripturian/adapter/VelocityProgram.java | [
"public class Executable\n{\n\t//\n\t// Constants\n\t//\n\n\t/**\n\t * Prefix prepended to on-the-fly scriptlets stored in the document source.\n\t */\n\tpublic static final String ON_THE_FLY_PREFIX = \"_ON_THE_FLY_\";\n\n\t//\n\t// Static operations\n\t//\n\n\t/**\n\t * If the executable does not yet exist in the ... | import java.util.concurrent.atomic.AtomicReference;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.exception.ExtendedParseException;
import org.apache.velocity.runtime.RuntimeInstance;
import org.apache.velocity.runtime.parser.ParseException;
import org.apache.velocity.runtime.parser.node.Simple... | /**
* Copyright 2009-2017 Three Crickets LLC.
* <p>
* The contents of this file are subject to the terms of the LGPL version 3.0:
* http://www.gnu.org/copyleft/lesser.html
* <p>
* Alternatively, you can obtain a royalty free commercial license with less
* limitations, transferable or non-transferable, directly f... | public void execute( ExecutionContext executionContext ) throws ParsingException, ExecutionException | 2 |
hhua/product-hunt-android | app/src/main/java/com/hhua/android/producthunt/activities/UserActivity.java | [
"public class ProductHuntApplication extends com.activeandroid.app.Application {\n private static Context context;\n\n @Override\n public void onCreate() {\n super.onCreate();\n ProductHuntApplication.context = this;\n Parse.initialize(this, ApiConfig.PARSE_API_APPLICATION_ID, ApiConfi... | import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
... | package com.hhua.android.producthunt.activities;
public class UserActivity extends AppCompatActivity {
private final String LOG_D = "UserActivity";
private ProductHuntClient client;
private User user;
private List<TechHunt> votedPosts;
private List<TechHunt> submittedPosts;
private List<T... | PostsFragment votedPostsFragment = new PostsFragment(); | 4 |
uservoice/uservoice-android-sdk | UserVoiceSDK/src/com/uservoice/uservoicesdk/ui/MixedSearchAdapter.java | [
"@SuppressLint(\"NewApi\")\npublic abstract class SearchActivity extends FragmentListActivity {\n private int originalNavigationMode = -1;\n\n public SearchAdapter<?> getSearchAdapter() {\n return searchAdapter;\n }\n\n public void updateScopedSearch(int results, int articleResults, int ideaResul... | import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import com.uservoice.uservoicesdk.R;
import com.uservoice.use... | package com.uservoice.uservoicesdk.ui;
public class MixedSearchAdapter extends SearchAdapter<BaseModel> implements AdapterView.OnItemClickListener {
protected static int SEARCH_RESULT = 0;
protected static int LOADING = 1;
public static int SCOPE_ALL = 0;
public static int SCOPE_ARTICLES = 1;
... | public void onError(RestResult error) { | 5 |
canyapan/DietDiaryApp | app/src/main/java/com/canyapan/dietdiaryapp/helpers/DailyReminderServiceHelper.java | [
"public class DatabaseHelper extends SQLiteOpenHelper {\n public static final DateTimeFormatter DB_DATE_FORMATTER = DateTimeFormat.forPattern(\"yyyy-MM-dd\");\n public static final DateTimeFormatter DB_TIME_FORMATTER = DateTimeFormat.forPattern(\"HH:mm\");\n public static final String DBT_EVENT = \"[Event]... | import android.content.Context;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.v7.preference.PreferenceManager;
import com.canyapan.dietdiaryapp.db.DatabaseHelper;
import com.canyapan.dietdiaryapp.services.DailyReminderService;
import com.firebase.jobdispatch... | package com.canyapan.dietdiaryapp.helpers;
public class DailyReminderServiceHelper {
private static final String DEFAULT_TIME = "19:00";
public static void setup(@NonNull final Context context) {
setup(context, PreferenceManager.getDefaultSharedPreferences(context));
}
public static void ... | sharedPreferences.getString(KEY_NOTIFICATIONS_DAILY_REMAINDER_TIME_STRING, DEFAULT_TIME), | 4 |
CodeCrafter47/BungeeTabListPlus | bukkit/src/main/java/codecrafter47/bungeetablistplus/bukkitbridge/BukkitBridge.java | [
"public abstract class BungeeTabListPlusBukkitAPI {\n private static BungeeTabListPlusBukkitAPI instance;\n\n /**\n * Registers a custom variable\n * <p>\n * You cannot use this to replace existing variables. If registering a variable which already\n * exists there may be an exception thrown b... | import codecrafter47.bungeetablistplus.api.bukkit.BungeeTabListPlusBukkitAPI;
import codecrafter47.bungeetablistplus.api.bukkit.ServerVariable;
import codecrafter47.bungeetablistplus.api.bukkit.Variable;
import codecrafter47.bungeetablistplus.bukkitbridge.placeholderapi.PlaceholderAPIHook;
import codecrafter47.bungeeta... | /*
* Copyright (C) 2020 Florian Stober
*
* 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.
*
*... | private PlaceholderAPIHook placeholderAPIHook = null; | 3 |
JanWiemer/jacis | src/test/java/org/jacis/trackedview/TransactionLocalTrackedViewTest.java | [
"@JacisApi\npublic class JacisContainer {\n\n /** {@link JacisTransactionAdapter} to bind the Jacis Store to externally managed transactions. */\n private final JacisTransactionAdapter txAdapter;\n /** Map assigning the stores (values of type {@link JacisStoreImpl}) to the store identifiers (keys of type {@link ... | import static org.junit.Assert.assertEquals;
import org.jacis.container.JacisContainer;
import org.jacis.store.JacisStore;
import org.jacis.testhelper.JacisTestHelper;
import org.jacis.testhelper.TestObject;
import org.jacis.testhelper.TrackedTestView;
import org.jacis.trackedviews.TrackedView;
import org.junit.Test; | /*
* Copyright (c) 2020. Jan Wiemer
*/
package org.jacis.trackedview;
public class TransactionLocalTrackedViewTest {
@Test
public void testModificationTrackingInTransaction() {
JacisTestHelper testHelper = new JacisTestHelper(); | JacisStore<String, TestObject> store = testHelper.createTestStoreWithCloning(); | 1 |
reinra/dynaform | src/main/java/org/dynaform/dynadata/DynaDataAttributes.java | [
"public interface Form {\r\n \r\n String HL_CHILD = \"/\";\r\n String HL_DESCENDANT_OR_SELF = \"//\";\r\n String LL_CHILD = \"!\";\r\n String LL_DESCENDANT_OR_SELF = \"!!\";\r\n String INDEX_START = \"[\";\r\n String INDEX_END = \"]\";\r\n String OPERATOR_SEQUENCE = \"sequence\";\r\n String OPERATOR_CHOICE... | import org.dynaform.xml.form.Form;
import org.dynaform.xml.form.FormAll;
import org.dynaform.xml.form.FormChoice;
import org.dynaform.xml.form.FormElement;
import org.dynaform.xml.form.FormFunction;
import org.dynaform.xml.form.FormRepeat;
import org.dynaform.xml.form.FormSection;
import org.dynaform.xml.form.Fo... | for (Iterator<Object> it = attrs.values().iterator(); it.hasNext();) {
Object value = it.next();
if (value == null)
it.remove();
}
for (Entry<String, Object> entry: attrs.entrySet()) {
String name = entry.getKey();
Object value = entry.getValue();
boolean esca... | private final FormVisitor METADATA_APPLIER = new FormVisitor() {
| 5 |
bkimminich/kata-botwars | botwars-java/src/test/java/de/kimminich/kata/botwars/UtilsTest.java | [
"public class Bomb extends AbstractEffect {\n\n private Random random = new Random();\n\n public Bomb(Bot invoker, Integer duration) {\n super(invoker, duration);\n }\n\n @Override\n public Message applyEffect(Bot invoker, Bot target) {\n return new EmptyMessage();\n }\n\n @Overri... | import de.kimminich.kata.botwars.effects.negative.Bomb;
import de.kimminich.kata.botwars.effects.negative.ContinuousDamage;
import de.kimminich.kata.botwars.effects.negative.DefenseDown;
import de.kimminich.kata.botwars.effects.negative.OffenseDown;
import de.kimminich.kata.botwars.effects.negative.SpeedDown;
import de... | package de.kimminich.kata.botwars;
public class UtilsTest {
@Test
void unCamelCaseWorksForEffectNames() {
assertEquals("Bomb", Utils.unCamelCase(Bomb.class.getSimpleName()));
assertEquals("Continuous Damage", Utils.unCamelCase(ContinuousDamage.class.getSimpleName()));
assertEquals("D... | assertEquals("Speed Down", Utils.unCamelCase(SpeedDown.class.getSimpleName())); | 4 |
open-erp-systems/erp-backend | erp-core/src/main/java/com/jukusoft/erp/core/module/base/service/permission/PermissionController.java | [
"public class PermissionRepository extends AbstractMySQLRepository {\n\n @InjectCache(name = \"group-permissions-cache\", type = CacheTypes.HAZELCAST_CACHE)\n protected ICache groupPermCache;\n\n @InjectCache(name = \"user-permission-cache\", type = CacheTypes.HAZELCAST_CACHE)\n protected ICache userPer... | import com.jukusoft.data.repository.PermissionRepository;
import com.jukusoft.erp.lib.database.InjectRepository;
import com.jukusoft.erp.lib.message.StatusCode;
import com.jukusoft.erp.lib.message.request.ApiRequest;
import com.jukusoft.erp.lib.message.response.ApiResponse;
import com.jukusoft.erp.lib.route.Route;
impo... | package com.jukusoft.erp.core.module.base.service.permission;
public class PermissionController extends AbstractController {
@InjectRepository
protected PermissionRepository permissionRepository;
@Route(routes = "/list-my-permissions") | public void listPermissions (Message<ApiRequest> event, ApiRequest req, ApiResponse response, Handler<AsyncResult<ApiResponse>> handler) { | 3 |
yuqirong/Koku | app/src/main/java/com/yuqirong/koku/service/CheckUnreadService.java | [
"public class MyApplication extends Application {\n\n private static Context context;\n private static ThreadPoolExecutor executor;\n private static final int CPU_COUNT = Runtime.getRuntime().availableProcessors();\n private static final int CORE_POOL_SIZE = CPU_COUNT + 1;\n private static final int ... | import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.yuqirong.koku.applic... | package com.yuqirong.koku.service;
/**
* 检查各种消息未读数
* Created by Administrator on 2015/11/2.
*/
public class CheckUnreadService extends Service {
private Timer mTimer;
public static final String START_TIMER = "start_timer";
public static final String STOP_TIMER = "stop_timer";
@Nullable
@Ov... | intent.setAction(RefreshWeiboTimelineReceiver.INTENT_UNREAD_UPDATE); | 2 |
R2RML-api/R2RML-api | r2rml-api-rdf4j-binding/src/test/java/rdf4jTest/TermType1_Test.java | [
"public class RDF4JR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static RDF4JR2RMLMappingManager INSTANCE = new RDF4JR2RMLMappingManager(new RDF4J());\n\n private RDF4JR2RMLMappingManager(RDF4J rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import eu.optique.r2rml.api.binding.rdf4j.RDF4JR2RMLMappingManager;
import org.apache.commons.rdf.api.IRI;
import org.apache.commons.rdf.rdf4j.RDF4J;
import org.junit.Assert;
import org.junit.Test;
import org.eclipse.rdf4j.model... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | SubjectMap s=current.getSubjectMap();
| 3 |
microbean/microbean-helm | src/main/java/org/microbean/helm/chart/repository/ChartRepository.java | [
"public final class Metadatas {\n\n\n /*\n * Constructors.\n */\n\n \n /**\n * Creates a new {@link Metadatas}.\n *\n * @deprecated This constructor originally did not exist explicitly\n * in the source code. That means a default no-argument {@code\n * public} constructor was available to end user... | import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.IOException;
import java.net.Proxy;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.nio.file.CopyOptio... | * {@code null} in which case "latest" semantics are implied
*
* @param copyOptions any {@link CopyOption} instances that will be
* passed to any {@link Files#move(Path, Path, CopyOption...)}
* invocations that may be necessary; may be {@code null}
*
* @return the {@link Path} to the chart archive, ... | public Chart.Builder resolve(final String chartName, String chartVersion) throws ChartResolverException { | 4 |
sritchie/kryo | src/com/esotericsoftware/kryo/serializers/JavaSerializer.java | [
"public class Kryo {\r\n\tstatic public final byte NAME = -1;\r\n\tstatic public final byte NULL = 0;\r\n\tstatic public final byte NOT_NULL = 1;\r\n\r\n\tprivate Class<? extends Serializer> defaultSerializer = FieldSerializer.class;\r\n\tprivate final ArrayList<DefaultSerializerEntry> defaultSerializers = new Arra... | import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.KryoException;
import com.esotericsoftware.kryo.KryoSerializable;
import com.esotericsoftware.kryo.Serializer;
import com.esotericsoftware.kryo.io.Input;
import com.esoteri... |
package com.esotericsoftware.kryo.serializers;
/** Serializes objects using Java's built in serialization mechanism. Note that this is very inefficient and should be avoided if
* possible.
* @see Serializer
* @see FieldSerializer
* @see KryoSerializable
* @author Nathan Sweet <misc@n4te.com> */
publ... | private Output lastOutput;
| 4 |
HomeAdvisor/Kafdrop | src/main/java/com/homeadvisor/kafdrop/controller/ClusterController.java | [
"public class ZookeeperProperties\n{\n public static final Pattern CONNECT_SEPARATOR = Pattern.compile(\"\\\\s*,\\\\s*\");\n @NotBlank\n private String connect;\n\n private int sessionTimeoutMillis = (int) TimeUnit.SECONDS.toMillis(5);\n private int connectTimeoutMillis = (int) TimeUnit.SECONDS.toMillis(1... | import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import com.homeadvisor.kafdrop.config.ZookeeperProperties;
import com.homeadvisor.kafdrop.model.BrokerVO;
import com.homeadvisor.kafdrop.model.C... | /*
* Copyright 2017 HomeAdvisor, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | final List<TopicVO> topics = kafkaMonitor.getTopics(); | 3 |
ground-context/ground | modules/postgres/app/edu/berkeley/ground/postgres/controllers/GraphController.java | [
"public class GroundException extends Exception {\n\n private static final long serialVersionUID = 1L;\n\n private final String message;\n private final ExceptionType exceptionType;\n\n public enum ExceptionType {\n DB(\"Database Exception:\", \"%s\"),\n ITEM_NOT_FOUND(\"GroundItemNotFoundException\", \"N... | import akka.actor.ActorSystem;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import edu.berkeley.ground.common.exception.GroundException;
import edu.berkeley.ground.common.model.core.Graph;
import edu.berkeley.ground.common.model.core.GraphVersion;
import edu.ber... | /**
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* <p>http://www.apache.org/licenses/LICENSE-2.0
*
* <p>Unless required by applicable law or agreed to in writing, software distributed ... | final void injectUtils(final CacheApi cache, final Database dbSource, final ActorSystem actorSystem, final IdGenerator idGenerator) { | 3 |
melloc/roguelike | engine/src/main/java/edu/brown/cs/roguelike/engine/graphics/DefaultMainLayer.java | [
"public final class Vec2i implements Serializable {\r\n\tprivate static final long serialVersionUID = 5659632794862666943L;\r\n\t\r\n\t/**\r\n\t * Since {@link Vec2i} instances are immutable, their x and y fields may be accessed without getters.\r\n\t */\r\n\tpublic final int x, y;\r\n\t\r\n\t/**\r\n\t * Creates a ... | import java.util.List;
import com.googlecode.lanterna.input.Key;
import com.googlecode.lanterna.screen.ScreenCharacterStyle;
import com.googlecode.lanterna.screen.ScreenWriter;
import cs195n.Vec2i;
import edu.brown.cs.roguelike.engine.entities.Combatable;
import edu.brown.cs.roguelike.engine.entities.EntityActionManage... | package edu.brown.cs.roguelike.engine.graphics;
/**
* A default layer that displays levels. Games should extend this Layer
* to display their levels. Game customization can happen in getActionForKey
* and propogateAction
*
* @author lelberty
*
* @param <A> the main Application of the Roguelike
*/
public a... | protected final static Vec2i MAP_SIZE = new Vec2i(80, 24); | 0 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/forum/list/adapter/ForumListRecyclerViewAdapter.java | [
"public abstract class BaseRecyclerViewAdapter<T extends BaseViewHolder> extends RecyclerView.Adapter<T> {\n\n @Override\n public void onBindViewHolder(T holder, int position) {\n initialize(holder, position);\n }\n\n @Override\n public int getItemCount() {\n return findList().size();\n... | import android.content.Intent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.mgilangjanuar.dev.goscele.R;
import com.mgilangjanuar.dev.goscele.base.BaseRecyclerViewAdapter;
import com.mgilangjanuar.dev.goscele.base.BaseViewHolder;... | package com.mgilangjanuar.dev.goscele.modules.forum.list.adapter;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class ForumListRecyclerViewAdapter extends BaseRecyclerViewAdapter<ForumListRecyclerViewAdapter.ViewHolder> {
private List<ForumModel> list;
public For... | Intent intent = new Intent(v.getContext(), ForumDetailActivity.class).putExtra(Constant.URL, model.url); | 2 |
tricreo/schema-generator | src/test/java/jp/tricreo/schemagenerator/domain/model/impl/DataSourceConnectServiceImplTest.java | [
"public class DataSource implements Entity<DataSource, String> {\r\n\t\r\n\t// IDは必ずfinal\r\n\tprivate final String identity;\r\n\t\r\n\tprivate String driverClassName;\r\n\t\r\n\tprivate String url;\r\n\t\r\n\tprivate String userName;\r\n\t\r\n\tprivate String password;\r\n\t\r\n\r\n\t/**\r\n\t * インスタンスを生成する。\r\n\... | import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.junit.Assert.assertThat;
import java.sql.Connection;
import java.sql.SQLException;
import jp.tricreo.schemagenerator.domain.model.DataSource;
import jp.tricreo.schemagenerator.domain.model.DataSourc... | /*
* Copyright 2010 the Sisioh Project ant the Others.
* Created on 2010/08/03
*
* 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... | DataSource dataSource = new DataSource("test1");
| 0 |
adiyoss/StructED | src/com/structed/models/inference/InferenceMultiClassOld.java | [
"public class ClassifierData {\n\n public ITaskLoss taskLoss;\n public IUpdateRule updateRule;\n public IInference inference;\n public IKernel kernel;\n public IFeatureFunctions phi;\n public List<Double> arguments;\n public int iteration = 0;\n public String verbose = \"\";\n}",
"public c... | import com.structed.data.entities.PredictedLabels;
import com.structed.data.entities.Vector;
import com.structed.data.Logger;
import com.structed.utils.comperators.MapValueComparatorDescending;
import com.structed.utils.MathHelpers;
import com.structed.models.ClassifierData;
import com.structed.constants.Consts;
import... | /*
* The MIT License (MIT)
*
* StructED - Machine Learning Package for Structured Prediction
*
* Copyright (c) 2015 Yossi Adi, E-Mail: yossiadidrum@gmail.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), t... | double maxScore = MathHelpers.multipleVectors(W, phiData.getFeatures()); | 8 |
maximeAudrain/jenerate | org.jenerate/src/java/org/jenerate/internal/strategy/method/content/impl/guava/GuavaCompareToMethodContent.java | [
"public interface PreferencesManager {\r\n\r\n /**\r\n * Gets the current value for a specific preference\r\n * \r\n * @param preference the preference to get the value from\r\n * @return the value for this preference\r\n */\r\n <T> T getCurrentPreferenceValue(PluginPreference<T> preferenc... | import java.util.LinkedHashSet;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IType;
import org.jenerate.internal.domain.data.CompareToGenerationData;
import org.jenerate.internal.domain.identifier.impl.MethodContentStrategyIdentifier;
import org.jenerate.internal.manage.PreferencesManager;
impo... | package org.jenerate.internal.strategy.method.content.impl.guava;
/**
* Specific implementation of the {@link MethodContent} for {@link CompareToMethodSkeleton} using guava.
*
* @author maudrain
*/
public class GuavaCompareToMethodContent
extends AbstractMethodContent<CompareToMethodSkeleton, ... | private final JavaInterfaceCodeAppender javaInterfaceCodeAppender;
| 4 |
protolambda/blocktopograph | app/src/main/java/com/protolambda/blocktopograph/worldlist/WorldItemListActivity.java | [
"public class Log {\n\n //TODO This is kind of lazy, but repeating the Log.d(*msg*) everywhere is obnoxious\n //TODO log only if debug mode is on?\n\n public static final String LOG_TAG = \"Blocktopograph\";\n\n public static void i(String msg){\n android.util.Log.i(LOG_TAG, msg);\n }\n\n p... | import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Envir... |
}
public void initWorldList(){
View recyclerView = findViewById(R.id.worlditem_list);
assert recyclerView != null;
boolean hasWorlds = setupRecyclerView((RecyclerView) recyclerView);
if(!hasWorlds){
Snackbar.make(recyclerView, R.string.could_not_find_worlds, Snack... | Log.d("minecraftWorlds path: " + path); | 0 |
maruohon/minihud | src/main/java/fi/dy/masa/minihud/gui/ConfigScreen.java | [
"public class Reference\n{\n public static final String MOD_ID = \"minihud\";\n public static final String MOD_NAME = \"MiniHUD\";\n public static final String MOD_VERSION = \"@MOD_VERSION@\";\n\n public static final ModInfo MOD_INFO = new ModInfo(MOD_ID, MOD_NAME);\n}",
"public class Configs\n{\n ... | import java.util.ArrayList;
import javax.annotation.Nullable;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.gui.GuiScreen;
import fi.dy.masa.malilib.config.group.ExpandableConfigGroup;
import fi.dy.masa.malilib.config.option.ConfigInfo;
import fi.dy.masa.malilib.config.option.GenericButton... | package fi.dy.masa.minihud.gui;
public class ConfigScreen
{
public static final ModInfo MOD_INFO = Reference.MOD_INFO;
private static final BaseConfigTab GENERIC = new BaseConfigTab(MOD_INFO, "generic", 160, getGenericOptions(), ConfigScreen::create); | private static final BaseConfigTab COLORS = new BaseConfigTab(MOD_INFO, "colors", 100, Configs.Colors.OPTIONS, ConfigScreen::create); | 1 |
avram/zandy | src/main/java/com/gimranov/zandy/app/AttachmentActivity.java | [
"public class Attachment {\n\n public String key;\n public String parentKey;\n public String etag;\n public int status;\n public String dbId;\n public String title;\n public String filename;\n public String url;\n\n\t/*\n {\n\t \"itemType\": \"attachment\",\n\t \"linkMode\": \"import... | import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.app.ProgressDialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import... | /*******************************************************************************
* This file is part of Zandy.
*
* Zandy is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the Lice... | ArrayList<Attachment> rows = Attachment.forItem(item, db); | 0 |
nikolavp/approval | approval-core/src/test/java/com/github/approval/ApprovalTest.java | [
"public interface Converter<T> {\n /**\n * Gets the raw representation of the type object. This representation will be written in the files you are going to then use in the approval process.\n *\n * @param value the object that you want to convert\n * @return the raw representation of the object\... | import com.github.approval.converters.Converter;
import com.github.approval.converters.Converters;
import com.github.approval.converters.DefaultConverter;
import com.github.approval.example.Entity;
import com.github.approval.utils.FileSystemUtils;
import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.ju... | package com.github.approval;
/*
* #%L
* approval
* %%
* Copyright (C) 2014 Nikolavp
* %%
* 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/LICE... | new Approval<>(reporter, Converters.BOOLEAN, null, fileSystemUtils).verify(true, testFileInTemporaryDir.toPath()); | 1 |
jacobtabak/droidcon | app/src/main/java/com/timehop/droidcon2014retrofitsample/VenueSearchActivity.java | [
"public interface FoursquareService {\n\n @GET(\"/venues/search\")\n FoursquareResponse searchVenues(@Query(\"near\") String location) throws FoursquareException;\n\n @GET(\"/venues/search\")\n void searchVenues(\n @Query(\"near\") String location,\n Callback<FoursquareResponse> callback);\n\n class ... | import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import com.timehop.droidcon2014retrofitsample.data.foursquare.FoursquareService;
import com.timehop.d... | package com.timehop.droidcon2014retrofitsample;
public class VenueSearchActivity extends Activity {
public static final String TAG = VenueSearchActivity.class.getSimpleName();
public static final String EXTRA_LOCATION = "location";
private ListView mListView;
private VenueAdapter mAdapter;
private Progre... | new Callback<FoursquareResponse>() { | 2 |
Baseform/Baseform-Epanet-Java-Library | src/org/addition/epanet/hydraulic/structures/SimulationNode.java | [
"public class Constants {\n\n\n public static double PI = 3.141592654;\n\n /**\n * Max. # of disconnected nodes listed\n */\n public static int MAXCOUNT = 10;\n /**\n * Max. # title lines\n */\n public static int MAXTITLE = 3;\n /**\n * Max. input er... | import org.addition.epanet.Constants;
import org.addition.epanet.util.ENException;
import org.addition.epanet.util.Utilities;
import org.addition.epanet.hydraulic.SparseMatrix;
import org.addition.epanet.network.PropertiesMap;
import org.addition.epanet.network.structures.*;
import java.util.List; | /*
* Copyright (C) 2012 Addition, Lda. (addition at addition dot pt)
*
* 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 ver... | double y = Utilities.getSignal(q) * z * p; | 2 |
liyuanhust/LoadMoreHelper | testapp/src/main/java/com/lain/loadmoretest/Fragment3.java | [
"public interface ILoadViewCreator<DT> {\n\n View createView(ViewGroup parent, LoadMoreHelper<DT> loadHelper);\n}",
"public interface IDataSwapper<DT> {\n /**\n * Swap all datas\n */\n void swapData(List<? extends DT> list);\n /**\n * Append data to the end of current list\n */\n vo... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.wid... | package com.lain.loadmoretest;
/**
* Created by liyuan on 17/4/6.
* Layout with {@link in.srain.cube.views.ptr.PtrClassicFrameLayout}
* and {@link ListView}
*/
public class Fragment3 extends Fragment{
private List<Item> datas = new ArrayList<>();
@Override
public void onCreate(@Nullable Bundle sa... | BaseResult<Item> result = DataLoader.loadDataSync(page, null); | 4 |
eltrueno/TruenoNPC | src/es/eltrueno/npc/nms/TruenoNPC_v1_11_r1.java | [
"public interface TruenoNPC {\n\n /**\n *\n *\n * @author el_trueno\n *\n *\n **/\n\n void delete();\n Location getLocation();\n int getEntityID(Player p);\n boolean isDeleted();\n int getNpcID();\n TruenoNPCSkin getSkin();\n}",
"public class TruenoNPCApi {\n\n /**\... | import com.google.common.collect.Lists;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import es.eltrueno.npc.TruenoNPC;
import es.eltrueno.n... | }
}else{
GameProfile profile = getGameProfile(StringUtils.getRandomString(), cachedskin.getSkinData());
setGameProfile(profile);
spawnEnttity(p);
}
}
private void spawnEnttity(Player p){
MinecraftServer nmsServer = ((CraftServer)Bukkit.get... | TruenoNPCDespawnEvent event = new TruenoNPCDespawnEvent(p, (TruenoNPC) this); | 2 |
danielsomerfield/go-strong-auth-plugin | src/test/java/com/thoughtworks/go/strongauth/handlers/AuthenticationHandlerTest.java | [
"@Value\npublic class AuthenticationRequest {\n private final String username;\n private final String password;\n}",
"public class Authenticator {\n\n public final String pluginId = Constants.PLUGIN_ID;\n private static final Logger LOGGER = Logger.getLoggerFor(Authenticator.class);\n private final... | import com.google.common.base.Optional;
import com.thoughtworks.go.plugin.api.request.GoPluginApiRequest;
import com.thoughtworks.go.plugin.api.response.GoPluginApiResponse;
import com.thoughtworks.go.strongauth.authentication.AuthenticationRequest;
import com.thoughtworks.go.strongauth.authentication.Authenticator;
im... | package com.thoughtworks.go.strongauth.handlers;
public class AuthenticationHandlerTest {
private GoAuthenticationRequestDecoder requestDecoder = mock(GoAuthenticationRequestDecoder.class); | private Authenticator authenticator = mock(Authenticator.class); | 1 |
GaoGersy/LiveShow | app/src/main/java/com/gersion/pictureshow/presenter/WeChatFragmentPresenter.java | [
"public interface Constants {\n String APPKEY_JOKE = \"笑话大全APPKEY\";\n String APPKEY_WEIXIN = \"微信精选APPKEY\";\n String APPKEY_WEATHER = \"天气APPKEY\";\n\n //笑话\n String BASE_URL_JOKE = \"http://japi.juhe.cn/joke/content/text.from\";\n String BASE_URL_JOKE_PICTURE = \"http://japi.juhe.cn/joke/img/te... | import com.gersion.pictureshow.constants.Constants;
import com.gersion.pictureshow.model.IRequestGetModel;
import com.gersion.pictureshow.model.OnGetDataListener;
import com.gersion.pictureshow.model.RequestGetModel;
import com.gersion.pictureshow.ui.fragment.WeChatFragment;
import com.gersion.pictureshow.ui.fragment.j... | package com.gersion.pictureshow.presenter;
/**
* @作者 Gersy
* @版本
* @包名 com.gersion.pictureshow.presenter
* @待完成
* @创建时间 2016/11/23
* @功能描述 TODO
* @更新人 $
* @更新时间 $
* @更新版本 $
*/
public class WeChatFragmentPresenter {
private IRequestGetModel mRequestGetModel = new RequestGetModel();
private IHomeFragm... | mRequestGetModel.getDataFromNet(Constants.BASE_URL_WEIXIN, mWeChatFragment.getParamas(), new OnGetDataListener() { | 0 |
joelhockey/jacknji11 | src/main/java/org/pkcs11/jacknji11/jna/JNA_CK_C_INITIALIZE_ARGS.java | [
"public class CK_C_INITIALIZE_ARGS {\n\n /**\n * True if application threads which are executing calls to the library may not use native operating system calls to\n * spawn new threads; false if they may.\n */\n public static final long CKF_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001;\n /** Tru... | import java.util.List;
import com.sun.jna.Callback;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.PointerByReference;
import org.pkcs11.jacknji11.CK_C_INITIALIZE_ARGS;
import org.pkcs11.jacknji11.CK_C_INITIALIZE_ARGS.CK_CREATEMUTEX;
import org.pkcs11.jac... | /*
* Copyright 2010-2011 Joel Hockey (joel.hockey@gmail.com). All rights reserved.
* 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 ri... | public interface JNA_CK_DESTROYMUTEX extends CK_DESTROYMUTEX, Callback { | 2 |
davidmoten/rtree | src/main/java/com/github/davidmoten/rtree/internal/LeafHelper.java | [
"public final class Context<T, S extends Geometry> {\n\n private final int maxChildren;\n private final int minChildren;\n private final Splitter splitter;\n private final Selector selector;\n private final Factory<T, S> factory;\n\n /**\n * Constructor.\n * \n * @param minChildren\n ... | import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import com.github.davidmoten.rtree.Context;
import com.github.davidmoten.rtree.Entry;
import com.github.davidmoten.rtree.Leaf;
import com.github.davidmoten.rtree.Node;
import com.github.davidmoten.rtree.geometry.... | package com.github.davidmoten.rtree.internal;
public final class LeafHelper {
private LeafHelper() {
// prevent instantiation
}
public static <T, S extends Geometry> NodeAndEntries<T, S> delete(
Entry<? extends T, ? extends S> entry, boolean all, Leaf<T, S> leaf) {
List<E... | Context<T, S> context = leaf.context(); | 0 |
JavierMF/features-service | src/main/java/org/javiermf/features/services/ProductsService.java | [
"@Repository\npublic class ProductsConfigurationsDAO {\n\n @PersistenceContext\n private EntityManager entityManager;\n\n QProductConfiguration qProductConfiguration = QProductConfiguration.productConfiguration;\n QProduct qProduct = QProduct.product;\n\n public List<ProductConfiguration> findByProdu... | import org.javiermf.features.daos.ProductsConfigurationsDAO;
import org.javiermf.features.daos.ProductsDAO;
import org.javiermf.features.exceptions.DuplicatedObjectException;
import org.javiermf.features.models.Feature;
import org.javiermf.features.models.Product;
import org.javiermf.features.models.ProductConfiguratio... | package org.javiermf.features.services;
@Service
public class ProductsService {
@Autowired
ProductsDAO productsDAO;
@Autowired
ProductsConfigurationsDAO productsConfigurationsDAO;
public List<String> getAllProductNames() {
List<String> allProducts = new ArrayList<String>();
f... | public FeatureConstraint addRequiresConstraintToProduct(String productName, String sourceFeatureName, String requiredFeatureName) { | 8 |
jDramaix/SlidingPuzzle | test/be/dramaix/ai/slidingpuzzle/SlidingPuzzleTest.java | [
"public class IDAStar implements SearchAlgorithm, UseHeuristic {\n\n\tprivate long startTime;\n\tprivate long exploredNodes;\n\tprivate int nextCostBound;\n\tprivate HeuristicFunction heuristic;\n\n\t@Override\n\tpublic PuzzleSolution resolve(State start, State goal) {\n\n\t\tNode startNode = new Node(start);\n\t\t... | import junit.framework.TestCase;
import org.junit.Ignore;
import be.dramaix.ai.slidingpuzzle.server.search.IDAStar;
import be.dramaix.ai.slidingpuzzle.server.search.SearchAlgorithm;
import be.dramaix.ai.slidingpuzzle.server.search.heuristic.LinearConflict;
import be.dramaix.ai.slidingpuzzle.server.search.heuristic.Manh... | package be.dramaix.ai.slidingpuzzle;
public class SlidingPuzzleTest extends TestCase {
@Ignore
public void test3x3() {
runAStar(SLIDE_3X3, State.GOAL_3_3);
}
public void test4x4() {
runAStar(SLIDE_4X4, State.GOAL_4_4);
}
public void runAStar(byte[][] testData, State goal){
long averageTime = 0... | LinearConflict lc = new LinearConflict(); | 2 |
kwon37xi/hibernate4-memcached | hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/regions/GeneralDataMemcachedRegion.java | [
"public class CacheNamespace implements Serializable {\n /**\n * name of region\n */\n private String name;\n\n /**\n * if this value is true, the memcached adapter should implement namespace pattern\n * or ignore namespace pattern.\n * <p/>\n * see <a href=\"https://code.google.com... | import kr.pe.kwonnam.hibernate4memcached.memcached.CacheNamespace;
import kr.pe.kwonnam.hibernate4memcached.memcached.MemcachedAdapter;
import kr.pe.kwonnam.hibernate4memcached.timestamper.HibernateCacheTimestamper;
import kr.pe.kwonnam.hibernate4memcached.util.OverridableReadOnlyProperties;
import org.hibernate.cache.... | package kr.pe.kwonnam.hibernate4memcached.regions;
/**
* @author KwonNam Son (kwon37xi@gmail.com)
*/
public class GeneralDataMemcachedRegion extends MemcachedRegion implements GeneralDataRegion {
private Logger log = LoggerFactory.getLogger(GeneralDataMemcachedRegion.class);
private int expirySeconds;
| public GeneralDataMemcachedRegion(CacheNamespace cacheNamespace, OverridableReadOnlyProperties properties, CacheDataDescription metadata, | 3 |
xxonehjh/remote-files-sync | src/main/java/com/hjh/files/sync/client/FileCopyByCache.java | [
"public class HLogFactory {\n\n\tprivate static ILogFactory instance;\n\n\tpublic static boolean isInstanceNull() {\n\t\treturn null == instance;\n\t}\n\n\tprivate static ILog empty = new ILog() {\n\n\t\t@Override\n\t\tpublic void debug(String msg) {\n\t\t}\n\n\t\t@Override\n\t\tpublic void info(String msg) {\n\t\t... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.apache.http.util.Asserts;
import com.hjh.files.sync.common.HLogFactory;
import com.hjh.files.sync.common.ILog;
import com.hjh.files.sync.common.RemoteFile;... | package com.hjh.files.sync.client;
public class FileCopyByCache implements FileCopy {
private final static String CLIENT_CACHE_FOLDER_NAME = ".c.cache"; | private static ILog logger = HLogFactory.create(FileCopyByCache.class); | 0 |
zsawyer/MumbleLink | mod/src/main/java/zsawyer/mods/mumblelink/mumble/UpdateData.java | [
"@Mod(value = MumbleLink.MOD_ID)\r\n@Mod.EventBusSubscriber\r\n@OnlyIn(Dist.CLIENT)\r\npublic class MumbleLinkImpl extends MumbleLinkBase implements MumbleLink {\r\n public static Logger LOG = LogManager.getLogger();\r\n\r\n public static MumbleLinkImpl instance;\r\n //\r\n private UpdateTicker updateTi... | import zsawyer.mumble.jna.LinkAPILibrary;
import net.minecraft.client.Minecraft;
import net.minecraft.world.phys.Vec3;
import zsawyer.mods.mumblelink.MumbleLinkImpl;
import zsawyer.mods.mumblelink.api.IdentityManipulator;
import zsawyer.mods.mumblelink.error.NativeUpdateErrorHandler;
import zsawyer.mods.mumblelin... | /*
mod_MumbleLink - Positional Audio Communication for Minecraft with Mumble
Copyright 2012 zsawyer (http://sourceforge.net/users/zsawyer)
This file is part of mod_MumbleLink
(http://sourceforge.net/projects/modmumblelink/).
mod_MumbleLink is free software: you can redistribute it and/or modify
it under... | .handleError(NativeUpdateError.ERROR_NOT_YET_INITIALIZED);
| 3 |
WMCAlliance/BukkitIRCd | src/com/Jdbye/BukkitIRCd/Commands/UnbanCommand.java | [
"public class BukkitIRCdPlugin extends JavaPlugin {\n\n\tstatic class CriticalSection extends Object {\n\t}\n\n\tstatic public CriticalSection csLastReceived = new CriticalSection();\n\tprivate final PlayerListener playerListener = new PlayerListener(this);\n\tprivate final PlayerAchievementListener playerAchieveme... | import com.Jdbye.BukkitIRCd.BukkitIRCdPlugin;
import com.Jdbye.BukkitIRCd.IRCUserManagement;
import com.Jdbye.BukkitIRCd.IRCd;
import com.Jdbye.BukkitIRCd.Configuration.Config;
import com.Jdbye.BukkitIRCd.Utilities.ChatUtils;
import com.Jdbye.BukkitIRCd.Utilities.MessageFormatter;
import org.bukkit.ChatColor;
import or... | package com.Jdbye.BukkitIRCd.Commands;
public class UnbanCommand implements CommandExecutor {
private BukkitIRCdPlugin thePlugin;
public UnbanCommand(BukkitIRCdPlugin plugin) {
this.thePlugin = plugin;
}
public boolean onCommand(CommandSender sender, Command cmd, String label,
String[] args) {
if (send... | if (IRCUserManagement.unBanIRCUser(ban, player.getName() + Config.getIrcdIngameSuffix() + "!" + player.getName() + "@" + player.getAddress().getAddress().getHostName())) { | 3 |
e-Spirit/basicworkflows | src/main/java/com/espirit/moddev/basicworkflows/release/WfReleaseTestExecutable.java | [
"public abstract class AbstractWorkflowExecutable implements Executable {\n\n\n /**\n * Is started on a datasource record?.\n *\n * @param workflowScriptContext the workflow script context\n * @return the boolean\n */\n protected static boolean isStartedOnDatasource(final WorkflowScriptCon... | import de.espirit.firstspirit.access.store.templatestore.WorkflowScriptContext;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;
import com.espirit.moddev.basicworkflows.util.AbstractWorkflowExecutable;
import com.espirit.moddev.basicworkflo... | /*
* BasicWorkflows Module
* %%
* Copyright (C) 2012 - 2018 e-Spirit AG
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | final StoreUtil storeUtil = new StoreUtil(workflowScriptContext); | 2 |
karthicks/gremlin-ogm | gremlin-objects/src/main/java/org/apache/tinkerpop/gremlin/object/structure/EdgeGraph.java | [
"@SuppressWarnings({\"rawtypes\", \"unchecked\", \"PMD.TooManyStaticImports\"})\npublic final class Parser {\n\n private static final List<ElementParser<?>> ELEMENT_PARSERS = new ArrayList<>();\n\n static {\n registerElementParser(GremlinElementParser.getInstance());\n }\n\n private Parser() {}\n\n /**\n ... | import org.apache.tinkerpop.gremlin.structure.T;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.apache.tinkerpop.gremlin.object.reflect.Parser;
import org.apache.tinkerpop.gremlin.object.reflect.Properties;
import org.apache.tinkerpop.gremlin.object.t... | /*
* 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 ma... | AnyTraversal anyTraversal) { | 2 |
junjunguo/PocketMaps | PocketMaps/app/src/main/java/com/junjunguo/pocketmaps/map/Navigator.java | [
"public interface NavigatorListener {\n /**\n * the change on navigator: navigation is used or not\n *\n * @param on\n */\n void onStatusChanged(boolean on);\n \n void onNaviStart(boolean on);\n}",
"public class NaviEngine\n{\n /** The DEBUG_SIMULATOR will simulate first generated rou... | import com.graphhopper.PathWrapper;
import com.graphhopper.util.Helper;
import com.graphhopper.util.Instruction;
import com.junjunguo.pocketmaps.R;
import com.junjunguo.pocketmaps.model.listeners.NavigatorListener;
import com.junjunguo.pocketmaps.navigator.NaviEngine;
import com.junjunguo.pocketmaps.navigator.NaviText;... | return R.drawable.ic_directions_bike_white_24dp;
}
else if (Variable.getVariable().getTravelMode() == Variable.TravelMode.Car)
{
return R.drawable.ic_directions_car_white_24dp;
}
}
throw new NullPointerException("this method can only used w... | if (instruction.getSign() == 4) return NaviText.sNavEnd; | 2 |
cloudera/director-spi | src/main/java/com/cloudera/director/spi/v2/database/util/AbstractDatabaseServerProvider.java | [
"public interface DatabaseServerInstance<T extends DatabaseServerInstanceTemplate>\n extends Instance<T> {\n\n /**\n * Returns the port for administrative database connections.\n *\n * @return the port for administrative database connections\n */\n Integer getPort();\n}",
"public class DatabaseServer... | import com.cloudera.director.spi.v2.database.DatabaseServerInstance;
import com.cloudera.director.spi.v2.database.DatabaseServerInstanceTemplate;
import com.cloudera.director.spi.v2.database.DatabaseServerProvider;
import com.cloudera.director.spi.v2.model.Configured;
import com.cloudera.director.spi.v2.model.Localizat... | // (c) Copyright 2015 Cloudera, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... | extends AbstractInstanceProvider<R, T> implements DatabaseServerProvider<R, T> { | 2 |
Piasy/BigImageViewer | app/src/main/java/com/github/piasy/biv/example/GlideLoaderActivity.java | [
"public final class BigImageViewer {\n private static volatile BigImageViewer sInstance;\n\n private final ImageLoader mImageLoader;\n\n private BigImageViewer(ImageLoader imageLoader) {\n mImageLoader = imageLoader;\n }\n\n public static void initialize(ImageLoader imageLoader) {\n sIn... | import com.github.piasy.biv.indicator.progresspie.ProgressPieIndicator;
import com.github.piasy.biv.loader.glide.GlideImageLoader;
import com.github.piasy.biv.view.BigImageView;
import com.github.piasy.biv.view.GlideImageViewFactory;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import andr... | /*
* The MIT License (MIT)
*
* Copyright (c) 2018 Piasy
*
* 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, ... | bigImageView.setImageViewFactory(new GlideImageViewFactory()); | 4 |
AstartesGuardian/WebDAV-Server | WebDAV-Server/src/webdav/server/commands/WD_Head.java | [
"public abstract class HTTPCommand\r\n{\r\n public HTTPCommand(String command)\r\n {\r\n this.name = command.trim().toUpperCase();\r\n openedResources = new HashMap<>();\r\n }\r\n \r\n private final String name;\r\n \r\n /**\r\n * Get the name of the command.\r\n * \r\n ... | import http.server.HTTPCommand;
import http.server.message.HTTPResponse;
import webdav.server.resource.IResource;
import http.server.exceptions.NotFoundException;
import http.server.exceptions.UserRequiredException;
import http.server.message.HTTPEnvRequest;
| package webdav.server.commands;
public class WD_Head extends HTTPCommand
{
public WD_Head()
{
super("head");
}
@Override
| public HTTPResponse.Builder Compute(HTTPEnvRequest environment) throws UserRequiredException, NotFoundException
| 3 |
timeforcoffee/timeforcoffee-android | api/src/main/java/ch/liip/timeforcoffee/api/StationService.java | [
"public class FetchStationsLocationErrorEvent {\n\n private Throwable throwable;\n\n public FetchStationsLocationErrorEvent(Throwable throwable) {\n this.throwable = throwable;\n }\n\n public Throwable getThrowable() {\n return throwable;\n }\n}",
"public class FetchStationsLocationEv... | import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import ch.liip.timeforcoffee.api.events.stationsLocationEvents.FetchStationsLocationErrorEvent;
import ch.liip... | package ch.liip.timeforcoffee.api;
public class StationService {
private final EventBus eventBus;
private final OpenDataService openDataService;
@Inject
public StationService(EventBus eventBus, OpenDataService openDataService) {
this.openDataService = openDataService;
this.eventB... | stations.add(StationMapper.fromBackend(backendStation)); | 6 |
alexandre-normand/blood-shepherd | dexcom-receiver/src/main/java/org/glukit/dexcom/sync/DexcomWatcher.java | [
"public class FetchNewDataRunner {\n private static Logger LOGGER = LoggerFactory.getLogger(FetchNewDataRunner.class);\n private final DataOutputFactory dataOutputFactory;\n private final DataInputFactory dataInputFactory;\n private final ResponseReader responseReader;\n\n @Inject\n public FetchNewDataRunner(... | import org.glukit.sync.api.ReceiverSyncData;
import org.glukit.sync.api.SyncData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.threeten.bp.Instant;
import javax.usb.UsbDevice;
import javax.usb.UsbDeviceDescriptor;
import javax.usb.event.UsbServicesEvent;
import javax.usb.event.UsbServicesListener... | /*
* The MIT License (MIT)
*
* Copyright (c) 2013 Alexandre Normand
*
* 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
*... | private final BloodShepherdPreferences preferences; | 2 |
kaarelk/r4j | r4j/tests/src/org/r4j/RaftTest.java | [
"public class RespondingCommitHandler implements CommitHandler {\r\n\r\n\t@Override\r\n\tpublic void commit(AppendRequest entry) {\r\n\t\tObject o = commitImpl(entry);\r\n\t\tif (entry.getClientChannel() != null) {\r\n\t\t\tentry.getClientChannel().send(null, o);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected Object commitImpl... | import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.Atom... | @Override
public void send(Raft r, Object o) {
ClientResponse resp = (ClientResponse)o;
err = resp.getErrCode();
if (err == 0) {
successCounter.incrementAndGet();
} else {
errCounter.incrementAndGet();
}
}
}
private static class HashSetCommits extends RespondingCommitHan... | } else if (o instanceof VoteGranted) {
| 8 |
sfPlayer1/Matcher | src/matcher/classifier/MethodClassifier.java | [
"public class Util {\n\tpublic static <T> Set<T> newIdentityHashSet() {\n\t\treturn Collections.newSetFromMap(new IdentityHashMap<>());//new IdentityHashSet<>();\n\t}\n\n\tpublic static <T> Set<T> newIdentityHashSet(Collection<? extends T> c) {\n\t\tSet<T> ret = Collections.newSetFromMap(new IdentityHashMap<>(c.siz... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.objectweb.asm.Handle;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.AbstractInsnNode;
imp... | package matcher.classifier;
public class MethodClassifier {
public static void init() {
addClassifier(methodTypeCheck, 10);
addClassifier(accessFlags, 4);
addClassifier(argTypes, 10);
addClassifier(retType, 5);
addClassifier(signature, 5);
addClassifier(classRefs, 3);
addClassifier(stringConstants, 5... | MethodVarInstance[] args = method.getArgs(); | 5 |
ozimov/cirneco | hamcrest/guava-hamcrest-matchers/src/test/java/it/ozimov/cirneco/hamcrest/guava/GuavaMatchersTest.java | [
"public class IsEmptyGuavaOptional extends TypeSafeMatcher<Optional> {\n\n /**\n * Creates a matcher that matches when the examined {@linkplain Optional} contains no object.\n */\n public static Matcher<Optional> emptyGuavaOptional() {\n return new IsEmptyGuavaOptional();\n }\n\n @Overrid... | import com.google.common.base.Equivalence;
import com.google.common.collect.Multimap;
import it.ozimov.cirneco.hamcrest.guava.base.IsEmptyGuavaOptional;
import it.ozimov.cirneco.hamcrest.guava.base.IsEquivalent;
import it.ozimov.cirneco.hamcrest.guava.collect.IsMultimapKeyWithCollectionSize;
import it.ozimov.cirneco.ha... | package it.ozimov.cirneco.hamcrest.guava;
@RunWith(MockitoJUnitRunner.class)
public class GuavaMatchersTest {
@Mock
public Object object;
@Mock
public Set set;
@Mock
public Multimap multimap;
@Mock
public Equivalence<Object> equivalence;
@Test
public void testEmptyGuavaO... | assertThat(GuavaMatchers.emptyGuavaOptional(), instanceOf(IsEmptyGuavaOptional.class)); | 0 |
marcelothebuilder/webpedidos | src/main/java/com/github/marcelothebuilder/webpedidos/controller/RelatorioPedidosEmitidosBean.java | [
"public interface EmissorRelatorio {\n\n\tvoid setConnection(Connection connection);\n\n\tvoid emitir() throws IOException, JRException;\n\n\tboolean isRelatorioGerado();\n\n}",
"public interface ExecutorRelatorio {\n\n\tvoid emite();\n\n\tvoid setEmissor(EmissorRelatorio emissor);\n\n}",
"public interface Rela... | import java.io.IOException;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http... | /**
*
*/
package com.github.marcelothebuilder.webpedidos.controller;
/**
* Este bean é responsável pela emissão de relatórios dos pedidos emitidos.
* Fornece limitações de data e exporta o relatório para o navegador
* diretamente, validando erros de entrada do usuário.
*
* @author Marcelo Paixao Resende
... | Relatorio relatorioPedidos = new RelatorioPedidosEmitidos(getDataInicio(), getDataFim()); | 4 |
TrumanDu/AutoProgramming | src/main/java/com/aibibang/web/system/controller/LoginController.java | [
"public class BaseController {\r\n\r\n\t/**\r\n\t * 将前台传递过来的日期格式的字符串,自动转化为Date类型\r\n\t * \r\n\t * @param binder\r\n\t */\r\n\t@InitBinder\r\n\tpublic void initBinder(ServletRequestDataBinder binder) {\r\n\r\n\t\tbinder.registerCustomEditor(Date.class, new DateConvertEditor());\r\n\t}\r\n\t\r\n\t/**\r\n\t * 抽取由逗号分隔的... | import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework... | package com.aibibang.web.system.controller;
@Controller
@RequestMapping("/login")
public class LoginController extends BaseController {
private Logger logger = Logger.getLogger(LoginController.class);
@Resource
private SysUserService sysUserService;
@Resource
private SysMenuService sysMen... | session.setAttribute(SessionAttr.USER_LOGIN.getValue(), u);
| 1 |
Pierry/cartolapp | cartolapp/app/src/main/java/com/github/pierry/cartolapp/api/TeamApi.java | [
"public interface IApi {\n\n Future<Response<JsonObject>> getObject(String url);\n\n Future<Response<JsonArray>> getArray(String url);\n}",
"public interface IPlayerApi {\n\n void get(String team);\n\n void get();\n}",
"public interface ITeamApi {\n\n void get(Context context, String team, RecyclerView rec... | import android.content.Context;
import android.support.v7.widget.RecyclerView;
import com.github.pierry.cartolapp.api.contracts.IApi;
import com.github.pierry.cartolapp.api.contracts.IPlayerApi;
import com.github.pierry.cartolapp.api.contracts.ITeamApi;
import com.github.pierry.cartolapp.domain.Team;
import com.github.... | package com.github.pierry.cartolapp.api;
@EBean public class TeamApi implements ITeamApi {
@Bean(Api.class) IApi api; | @Bean(PlayerApi.class) IPlayerApi playerApi; | 1 |
cymcsg/UltimateRecyclerView | UltimateRecyclerView/app/src/main/java/com/marshalchen/ultimaterecyclerview/demo/admobdemo/TestAdvancedAdmobActivity.java | [
"public abstract class AdmobAdapter<Adv extends ViewGroup, T, BINDHOLDER extends AdItemHolder> extends easyRegularAdapter<T, BINDHOLDER> {\n public interface AdviewListener<Adv extends ViewGroup> {\n Adv onGenerateAdview();\n }\n\n protected final Adv advertise_view;\n /**\n * There is an AD ... | import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.appcompat.widget.Toolbar;
import android.util.DisplayMetrics;
import android.v... | package com.marshalchen.ultimaterecyclerview.demo.admobdemo;
/**
* Created by hesk on 4/8/15.
*/
public class TestAdvancedAdmobActivity extends AppCompatActivity {
private UltimateRecyclerView ultimateRecyclerView;
private boolean admob_test_mode = false;
private LinearLayoutManager linearLayoutManage... | public static class regular extends easyRegularAdapter<String, SingleItemHolder> { | 2 |
sagemath/android | src/org/sagemath/droid/activities/CellActivity.java | [
"public class IntConstants {\n\n //New Group, hide Name and Desc\n public static final int DIALOG_NEW_GROUP = 0x000501;\n //Show Edit Specific Hints\n public static final int DIALOG_EDIT_CELL = 0x000502;\n //New cell, show everything\n public static final int DIALOG_NEW_CELL = 0x000503;\n}",
"pu... | import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.PopupMenu;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import androi... | package org.sagemath.droid.activities;
/**
* CellActivity - Main Activity, First Screen
*
* @author Rasmi.Elasmar
* @author Ralf.Stephan
* @author Nikhil Peter Raj
*/
public class CellActivity
extends ActionBarActivity | implements OnGroupSelectedListener, | 5 |
gentoku/pinnacle-api-client | src/examples/PlaceBet.java | [
"public class Parameter extends ParameterCore {\n\n\t/**\n\t * Constructor.\n\t */\n\tprivate Parameter () {\n\t\tsuper();\n\t}\n\t\n\t/**\n\t * Factory\n\t * \n\t * @return\n\t */\n\tpublic static Parameter newInstance() {\n\t\treturn new Parameter();\n\t}\n\n\n\t/**\n\t * ID of the target sports.\n\t * \n\t * @pa... | import pinnacle.api.Parameter;
import pinnacle.api.PinnacleAPI;
import pinnacle.api.PinnacleException;
import pinnacle.api.dataobjects.PlacedBet;
import pinnacle.api.enums.BET_TYPE;
import pinnacle.api.enums.ODDS_FORMAT;
import pinnacle.api.enums.PERIOD;
import pinnacle.api.enums.TEAM_TYPE;
import pinnacle.api.enums.WI... | package examples;
public class PlaceBet {
public static void main(String[] args) throws PinnacleException {
// settings
String username = "yourUserName";
String password = "yourPassword";
PinnacleAPI api = PinnacleAPI.open(username, password);
// parameter
Parameter parameter = Parameter.newInstance(... | parameter.periodNumber(PERIOD.SOCCER_1ST_HALF); | 6 |
egetman/ibm-bpm-rest-client | src/main/ru/bpmink/bpm/api/impl/simple/SimpleBpmClient.java | [
"public interface BpmClient extends Closeable {\n\n /**\n * Client for actions on exposed bpm api.\n *\n * @return {@link ru.bpmink.bpm.api.client.ExposedClient}\n */\n ExposedClient getExposedClient();\n\n /**\n * Client for actions on process bpm api.\n *\n * @return {@link ru... | import com.google.common.io.Closeables;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.AuthCache;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.protocol.HttpClientContext;
i... | package ru.bpmink.bpm.api.impl.simple;
/**
* Simple implementation of {@link ru.bpmink.bpm.api.client.BpmClient} which supports
* {@link org.apache.http.impl.auth.BasicScheme} authentication.
*/
@Immutable
@SuppressFBWarnings("JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLASS")
public final class SimpleBpmClient impleme... | private ServiceClient serviceClient; | 5 |
wso2/jaggery | components/jaggery-core/org.jaggeryjs.jaggery.tools/src/main/java/org/jaggeryjs/jaggery/tools/CommandLineExecutor.java | [
"public class ScriptReader extends Reader {\n\n protected InputStream sourceIn = null;\n protected Reader sourceReader = null;\n private boolean isBuilt = false;\n\n public ScriptReader(InputStream sourceIn) {\n this.sourceIn = sourceIn;\n }\n\n @Override\n public int read(char[] cbuf, i... | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.jaggeryjs.jaggery.core.ScriptReader;
import org.jaggeryjs.jaggery.core.manager.CommandLineManager;
import org.jaggeryjs.jaggery.core.manager.CommonManager;
import org.jaggeryjs.scriptengine.engine.JaggeryContext;
import org.jaggeryjs.scriptengin... | /*
* Copyright 2012 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | final JaggeryContext jaggeryContext = new JaggeryContext();
| 3 |
vsite-hr/hive | src/main/java/hr/vsite/hive/services/jetty/rest/v1/ResourceModuleV1.java | [
"public class Sensor implements Comparable<Sensor> {\n\n\t/** Hive's ID of this Sensor */\n\tpublic UUID getId() { return id; }\n\tpublic void setId(UUID id) { this.id = id; }\n\t\n\t/** Sensor's own ID */\n\tpublic String getDeviceId() { return deviceId; }\n\tpublic void setDeviceId(String deviceId) { this.deviceI... | import java.time.Instant;
import javax.ws.rs.ext.ParamConverter;
import com.google.inject.AbstractModule;
import hr.vsite.hive.sensors.Sensor;
import hr.vsite.hive.services.jetty.rest.v1.param.InstantParamConverter;
import hr.vsite.hive.services.jetty.rest.v1.param.JaxRsParams;
import hr.vsite.hive.services.jetty.rest.... | package hr.vsite.hive.services.jetty.rest.v1;
/**
* Place to register all JAX-RS resources for API v1
*/
public class ResourceModuleV1 extends AbstractModule {
@Override
protected void configure() {
// providers
bind(ObjectMapperProvider.class); | bind(GuiceParamConverterProvider.class); | 4 |
SamuelGjk/GComic | app/src/main/java/moe/yukinoneko/gcomic/module/splash/SplashActivity.java | [
"public abstract class BaseActivity<T extends BasePresenter> extends AppCompatActivity {\n\n protected T presenter;\n\n protected Unbinder unbinder;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(provideContentVie... | import moe.yukinoneko.gcomic.base.BaseActivity;
import moe.yukinoneko.gcomic.base.IBaseView;
import moe.yukinoneko.gcomic.module.main.MainActivity;
import moe.yukinoneko.gcomic.utils.Settings;
import moe.yukinoneko.gcomic.utils.SnackbarUtils;
import moe.yukinoneko.gcomic.utils.Utils;
import android.Manifest;
import and... | /*
* Copyright (C) 2016 SamuelGjk <samuel.alva@outlook.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
... | SnackbarUtils.showLong(findViewById(android.R.id.content), R.string.using_cellular_data); | 4 |
ldbc-dev/ldbc_snb_datagen_deprecated2015 | src/main/java/ldbc/socialnet/dbgen/generator/PostGenerator.java | [
"public class TagTextDictionary {\r\n private static final String SEPARATOR = \" \";\r\n \r\n String dicFileName;\r\n DateGenerator dateGen;\r\n \r\n TagDictionary tagDic;\r\n\tHashMap<Integer, String> tagText;\r\n\t\r\n double reducedTextRatio;\r\n\t\r\n\tpublic TagTextDictionary(String dicFi... | import java.util.TreeSet;
import java.util.Random;
import java.util.Vector;
import cern.jet.random.engine.RandomGenerator;
import ldbc.socialnet.dbgen.dictionary.TagTextDictionary;
import ldbc.socialnet.dbgen.dictionary.UserAgentDictionary;
import ldbc.socialnet.dbgen.dictionary.IPAddressDictionary;
import ldbc.... | /*
* Copyright (c) 2013 LDBC
* Linked Data Benchmark Council (http://ldbc.eu)
*
* This file is part of ldbc_socialnet_dbgen.
*
* ldbc_socialnet_dbgen 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 Foundat... | private TagTextDictionary tagTextDic; /**< @brief The TagTextDictionary used to obtain the texts posts/comments.**/
| 0 |
horrorho/LiquidDonkey | src/main/java/com/github/horrorho/liquiddonkey/cloud/store/ChunkManager.java | [
"@ThreadSafe\npublic class BiMapSet<K, V> {\n\n public static <K, V> BiMapSet<K, V> from(Map<K, ? extends Collection<V>> map) {\n Objects.requireNonNull(map, \"Map cannot be null\");\n\n ConcurrentMap<K, Set<V>> kToVSet = new ConcurrentHashMap<>();\n ConcurrentMap<V, Set<K>> vToKSet = new Co... | import com.github.horrorho.liquiddonkey.util.BiMapSet;
import com.github.horrorho.liquiddonkey.cloud.protobuf.ChunkServer;
import com.github.horrorho.liquiddonkey.exception.BadDataException;
import com.github.horrorho.liquiddonkey.settings.Markers;
import com.github.horrorho.liquiddonkey.util.Bytes;
import com.google.p... | /*
* The MIT License
*
* Copyright 2015 Ahseya.
*
* 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, ... | throws BadDataException { | 2 |
Mokto/streaming-android-tv | app/src/main/java/android/support/v17/leanback/streamingapp/app/page/MoviesFragment.java | [
"public class IO {\n\n private static IO instance;\n\n public Socket socket;\n\n\n public static Emitter emit(final String event, final String data, final Ack callback) {\n return getInstance().socket.emit(event, data, callback);\n }\n public static Emitter emit(final String event, final JSONO... | import android.content.Intent;
import android.os.Bundle;
import android.support.v17.leanback.app.RowsFragment;
import android.support.v17.leanback.streamingapp.api.IO;
import android.support.v17.leanback.streamingapp.app.infinitegrid.InfiniteGridActivity;
import android.support.v17.leanback.streamingapp.model.Card;
imp... | package android.support.v17.leanback.streamingapp.app.page;
public class MoviesFragment extends RowsFragment {
private final ArrayObjectAdapter mRowsAdapter;
public MoviesFragment() {
mRowsAdapter = new ArrayObjectAdapter(new ShadowRowPresenterSelector());
setAdapter(mRowsAdapter);
... | return new CardListRow(headerItem, adapter, CardRow); | 6 |
SMXCore/SMXCore_NG | src/modules/MeterIEC8705102.java | [
"public class ConvertUtil {\r\n\r\n public static String Short2Hex(short shVal, int iPlaces) {\r\n try {\r\n\r\n return Int2Hex(shVal & 0xffff, iPlaces);\r\n } catch (Exception e) {\r\n return \"\";\r\n }\r\n }\r\n\r\n public static String Int2Hex(int iVal, int iP... | import java.text.DateFormat;
import jssc.SerialPort;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Properties;
import util.ConvertUtil;
import util.PropUtil;
import util.StringSocketServer;
import util.iec1107util;
import ... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package modules;
/**
*
* @author cristi
*/
public class MeterIEC8705102 extends Module {
public void Initiali... | bbAddr = iec8705102util.GetAddr(iAddr);
| 4 |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/app/solver/thread/CardinalityFormulaRestrictionBuilder.java | [
"public class Parameters\n{\n\n public static String PROPERTYFILE = \"rockit.properties\";\n\n // ================= PARAMETERS CONFIGURABLE IN PROPERTYFILE\n\n /**\n * Path to store temporary files, which are deleted again after program execution.\n */\n public sta... | import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.TreeSet;
import com.googlecode.rockit.app.Parameters;
import com.googlecode.rockit.app.solver.aggregate.AggregationManager;
import com.googlecode.rockit.app.solver.... | package com.googlecode.rockit.app.solver.thread;
public class CardinalityFormulaRestrictionBuilder extends RestrictionBuilder
{
private HashMap<TreeSet<String>, Integer> alreadyAddedCardinalities = new HashMap<TreeSet<String>, Integer>();
private HashMap<TreeSet<String>, Integer> newCardinalitiesToAdd ... | public void addConstraints(ILPConnector con) throws ILPException, SolveException | 5 |
fabzo/kraken | src/test/java/fabzo/kraken/docker/DockerFollowLogsTest.java | [
"public abstract class AbstractDockerTest {\n private static final String DOCKER_SOCKET_FILE = \"/var/run/docker.sock\";\n private static final String DOCKER_SOCKET_NOT_FOUND = \"Could not find '\" + DOCKER_SOCKET_FILE + \"' required for the docker integration tests.\";\n\n @BeforeClass\n public static ... | import fabzo.kraken.AbstractDockerTest;
import fabzo.kraken.Environment;
import fabzo.kraken.EnvironmentModule;
import fabzo.kraken.Kraken;
import fabzo.kraken.components.DockerComponent;
import fabzo.kraken.handler.docker.DockerConfiguration;
import fabzo.kraken.handler.docker.DockerLifecycleHandler;
import org.junit.... | package fabzo.kraken.docker;
public class DockerFollowLogsTest extends AbstractDockerTest {
@Test
public void testFollowLogs() { | final Environment environment = Kraken.createEnvironment(new EnvironmentModule() { | 1 |
winzillion/FluxJava | demo-rx/src/main/java/com/example/fluxjava/rx/domain/ActionHelper.java | [
"public class TodoAction extends FluxAction<Integer, List<Todo>> {\n\n public TodoAction(final Integer inType, final List<Todo> inData) {\n super(inType, inData);\n }\n\n}",
"public class UserAction extends FluxAction<Integer, List<User>> {\n\n public UserAction(final Integer inType, final List<Us... | import com.example.fluxjava.rx.domain.actions.TodoAction;
import com.example.fluxjava.rx.domain.actions.UserAction;
import com.example.fluxjava.rx.domain.models.Todo;
import com.example.fluxjava.rx.domain.models.User;
import io.wzcodes.fluxjava.IActionHelper;
import java.util.ArrayList;
import static com.example.fluxja... | /*
* Copyright (C) 2016 Bugs will find a way (https://wznote.blogspot.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unl... | case TODO_LOAD: | 7 |
longkerdandy/mithqtt | mithqtt-broker/src/main/java/com/github/longkerdandy/mithqtt/broker/MqttBroker.java | [
"@SuppressWarnings(\"unused\")\npublic interface Authenticator {\n\n /**\n * Init the authenticator\n *\n * @param config Authenticator Configuration\n */\n void init(AbstractConfiguration config);\n\n /**\n * Destroy the authenticator\n */\n void destroy();\n\n /**\n * Au... | import com.github.longkerdandy.mithqtt.api.auth.Authenticator;
import com.github.longkerdandy.mithqtt.api.cluster.Cluster;
import com.github.longkerdandy.mithqtt.api.storage.sync.SyncStorage;
import com.github.longkerdandy.mithqtt.broker.cluster.BrokerClusterListenerFactoryImpl;
import com.github.longkerdandy.mithqtt.b... | package com.github.longkerdandy.mithqtt.broker;
/**
* MQTT Bridge
*/
public class MqttBroker {
private static final Logger logger = LoggerFactory.getLogger(MqttBroker.class);
public static void main(String[] args) throws Exception {
logger.debug("Starting MQTT broker ...");
// load conf... | Validator validator = new Validator(brokerConfig); | 6 |
jefalbino/jsmart-web | src/main/java/com/jsmartframework/web/tag/LinkTagHandler.java | [
"public final class Param {\n\n private String name;\n\n private Object value;\n\n // It does not work with delegate for any iterable component\n private String bind;\n\n public Param() {\n }\n\n public Param(String name, Object value) {\n this.name = name;\n this.value = value;\n... | import static com.jsmartframework.web.tag.js.JsConstants.JSMART_AJAX;
import static com.jsmartframework.web.manager.BeanHandler.AnnotatedAction;
import com.jsmartframework.web.annotation.Arg;
import com.jsmartframework.web.exception.InvalidAttributeException;
import com.jsmartframework.web.json.Ajax;
import com.jsmartf... | /*
* JSmart Framework - Java Web Development Framework
* Copyright (c) 2015, Jeferson Albino da Silva, All rights reserved.
*
* 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... | if (look != null && !Look.validateButton(look) && !isEL(look)) { | 3 |
Spedge/hangar | hangar-api/src/main/java/com/spedge/hangar/repo/python/PythonStorageTranslator.java | [
"public abstract class IndexArtifact implements Serializable\n{\n private static final long serialVersionUID = -5720959937441417671L;\n private String location;\n\n public IndexArtifact(String location)\n {\n this.location = location;\n }\n\n public String getLocation()\n {\n retu... | import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import com.spedge.hangar.index.IndexArtifact;
im... | package com.spedge.hangar.repo.python;
public class PythonStorageTranslator implements IStorageTranslator
{
private final String[] delimiters = new String[]{}; | private RepositoryType type; | 3 |
cattaka/AdapterToolbox | example/src/main/java/net/cattaka/android/adaptertoolbox/example/adapter/factory/MyInfoViewHolderFactory.java | [
"public class CodeLabelAdapter extends ArrayAdapter<ICodeLabel> {\n @LayoutRes\n private int mResource;\n @LayoutRes\n private int mDropDownResource;\n\n public static CodeLabelAdapter newInstance(Context context, ICodeLabel[] objects, boolean withNullValue) {\n if (withNullValue) {\n ... | import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.Switch;
import net.cattaka.android.adaptertoolbox.ada... | package net.cattaka.android.adaptertoolbox.example.adapter.factory;
/**
* Created by cattaka on 16/05/15.
*/
public class MyInfoViewHolderFactory extends ScrambleAdapter.AbsViewHolderFactory<MyInfoViewHolderFactory.ViewHolder> {
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ScrambleA... | vh.ordinalLabelSpinner.setAdapter(CodeLabelAdapter.newInstance(view.getContext(), OrdinalLabel.values(), true)); | 0 |
apache/geronimo-gshell | gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/CatCommand.java | [
"public interface Command\n{\n /** Standard command success status code. */\n int SUCCESS = 0;\n\n /** Standard command failure status code. */\n int FAILURE = -1;\n\n String getName();\n\n void init(CommandContext context); // throws Exception ?\n\n Object execute(Object... args) throws Except... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.MalformedURLException;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.co... | /*
* 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 ... | IO io = getIO(); | 4 |
marcelothebuilder/webpedidos | src/main/java/com/github/marcelothebuilder/webpedidos/controller/RelatorioPedidosEmitidosBean.java | [
"public interface EmissorRelatorio {\n\n\tvoid setConnection(Connection connection);\n\n\tvoid emitir() throws IOException, JRException;\n\n\tboolean isRelatorioGerado();\n\n}",
"public interface ExecutorRelatorio {\n\n\tvoid emite();\n\n\tvoid setEmissor(EmissorRelatorio emissor);\n\n}",
"public interface Rela... | import java.io.IOException;
import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http... | /**
*
*/
package com.github.marcelothebuilder.webpedidos.controller;
/**
* Este bean é responsável pela emissão de relatórios dos pedidos emitidos.
* Fornece limitações de data e exporta o relatório para o navegador
* diretamente, validando erros de entrada do usuário.
*
* @author Marcelo Paixao Resende
... | EmissorRelatorio emissor = new EmissorRelatorioServlet(relatorioPedidos, response); | 3 |
wotateam/wota | src/wota/ai/bienemaja/MyHillAI.java | [
"public class Ant extends BaseAnt {\n\t\n\t/** health is decreased by attacking enemies. Ant dies if health reaches 0. */\n\tpublic final double health;\n\t\n\t/** amount of sugar which is carried */\n\tpublic final int sugarCarry;\n\t\n\t/** The name of this ant's AI class, not including the package name.*/\n\tpub... | import java.util.LinkedList;
import java.util.List;
import wota.gameobjects.Ant;
import wota.gameobjects.AntMessage;
import wota.gameobjects.Caste;
import wota.gameobjects.Hill;
import wota.gameobjects.Message;
import wota.gameobjects.Sugar;
import wota.utility.Modulo;
import wota.utility.SeededRandomizer;
import wota.... | /**
*
*/
package wota.ai.bienemaja;
/**
*
*/
public abstract class MyHillAI extends wota.gameobjects.HillAI {
/*
* your Queen is not able to move but can
* communicate and create new ants.
*
* You can create new ants with createAnt(caste, antAIClass)
* e.g. if you want a gatherer and the AI
... | public void insertheard(List<AntMessage> audibleAntMessages){ | 1 |
gems-uff/prov-viewer | src/main/java/br/uff/ic/provviewer/Layout/Temporal_Layout_entityAppart.java | [
"public class Variables extends Object {\n\n public String mergingWithGraphPath;\n public String originalGraphPath = \"demo\";\n public Markov markov = new Markov();\n\n// public static String demo = File.separator + \"Graph\" + File.separator + \"Merge_Test.xml\";\n// public static String demo = Fil... | import edu.uci.ics.jung.graph.Graph;
import java.awt.geom.Point2D;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import br.uff.ic.provviewer.Variables;
import br.uff.ic.utility.Utils;
import br.uff.ic.utility.graph.ActivityVertex;
import br.uff.ic.utility.graph.AgentVertex;
import br.uf... | /*
* 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... | else if (v instanceof ActivityVertex){ | 2 |
kinnla/eniac | src/eniac/data/type/EType.java | [
"public class EData extends Observable implements Comparable<EData> {\n\n\t// static key indicating that that a repaint is recommended.\n\tpublic static final String REPAINT = \"repaint\"; //$NON-NLS-1$\n\n\tpublic static final String PAINT_IMMEDIATELY = \"paint_immediately\"; //$NON-NLS-1$\n\n\tpublic enum Tag {\n... | import java.util.Arrays;
import eniac.data.model.EData;
import eniac.data.view.EPanel;
import eniac.skin.Descriptor;
import eniac.util.EProperties;
import eniac.util.StringConverter; | /*******************************************************************************
* Copyright (c) 2003-2005, 2013 Till Zoppke.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available... | public EData makeEData() throws InstantiationException, ClassNotFoundException, IllegalAccessException { | 0 |
Condroidapp/android | Condroid/src/main/java/cz/quinix/condroid/ui/activities/WelcomeActivity.java | [
"public abstract class AListenedAsyncTask<Progress, Result> extends RoboAsyncTask<Result> {\r\n\r\n\t@Inject\r\n\tprivate Provider<Context> contextProvider;\r\n\r\n\tprivate ITaskListener listener;\r\n\r\n\tprivate Result results;\r\n\r\n\tpublic AListenedAsyncTask(ITaskListener listener) {\r\n\t\tsuper(listener.ge... | import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;... | package cz.quinix.condroid.ui.activities;
public class WelcomeActivity extends RoboSherlockFragmentActivity implements ITaskListener {
@Inject
| private DataProvider database;
| 2 |
JAVACAFE-STUDY/logjdbc | src/main/java/net/chandol/logjdbc/config/DatabaseType.java | [
"public class LoggableDataSourceException extends RuntimeException{\n\n public LoggableDataSourceException(String message) {\n super(message);\n }\n\n public LoggableDataSourceException(String message, Throwable cause) {\n super(message, cause);\n }\n\n public LoggableDataSourceExceptio... | import net.chandol.logjdbc.except.LoggableDataSourceException;
import net.chandol.logjdbc.logging.printer.sql.paramconverter.BaseParameterConverter;
import net.chandol.logjdbc.logging.printer.sql.paramconverter.MysqlParameterConverter;
import net.chandol.logjdbc.logging.printer.sql.paramconverter.OracleParameterConvert... | package net.chandol.logjdbc.config;
/**
* 데이터베이스가 정의된다.
*/
public enum DatabaseType {
H2(BaseParameterConverter.class, "H2"),
MYSQL(MysqlParameterConverter.class, "MySql", "MariaDB"),
ORACLE(OracleParameterConverter.class, "Oracle"),
UNKNOWN(BaseParameterConverter.class);
/* enum필드 */
Str... | return findDatabaseType(databaseName); | 6 |
indvd00m/java-ascii-render | ascii-render/src/main/java/com/indvd00m/ascii/render/elements/PseudoText.java | [
"public class Point implements IPoint {\n\n\tprotected int x;\n\tprotected int y;\n\n\tpublic Point(int x, int y) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\t@Override\n\tpublic int getX() {\n\t\treturn x;\n\t}\n\n\t@Override\n\tpublic int getY() {\n\t\treturn y;\n\t}\n\n\t@Override\n\tpublic int ha... | import com.indvd00m.ascii.render.Point;
import com.indvd00m.ascii.render.api.ICanvas;
import com.indvd00m.ascii.render.api.IContext;
import com.indvd00m.ascii.render.api.IElement;
import com.indvd00m.ascii.render.api.IPoint;
import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.geom.Rectangle2D;
import java.... | package com.indvd00m.ascii.render.elements;
/**
* PseudoText element. Default font DejaVu Sans Mono.
*
* <pre>
* ██
* ██████▒ ██ ██████████ ██
* ██ ░░██▒ ... | public IPoint draw(ICanvas canvas, IContext context) { | 4 |
manuelsc/Lunary-Ethereum-Wallet | app/src/main/java/rehanced/com/simpleetherwallet/network/EtherscanAPI.java | [
"public class APIKey {\n public static final String API_KEY = \"9ZUSL64LS9POL3J2MVKR0ES1MBQHSFUOKK\";\n}",
"public interface LastIconLoaded {\n\n public void onLastIconDownloaded();\n}",
"public class Key {\n private String q;\n private String s;\n private final String g = \"9ZUSL64LS9POL3J2MVKR0... | import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import okh... | package rehanced.com.simpleetherwallet.network;
public class EtherscanAPI {
private String token;
private static EtherscanAPI instance;
public static EtherscanAPI getInstance() {
if (instance == null)
instance = new EtherscanAPI();
return instance;
}
public void g... | if (!force && RequestCache.getInstance().contains(RequestCache.TYPE_TXS_INTERNAL, address)) { | 3 |
kcthota/JSONQuery | src/test/java/com/kcthota/query/FilterTest.java | [
"public static IsNullExpression Null(String property) {\n\treturn new IsNullExpression(val(property));\n}",
"public static EqExpression eq(String property, String value) {\n\treturn eq(val(property), TextNode.valueOf(value));\n}",
"public static GtExpression gt(String property, Integer value) {\n\treturn new Gt... | import static com.kcthota.JSONQuery.expressions.Expr.Null;
import static com.kcthota.JSONQuery.expressions.Expr.eq;
import static com.kcthota.JSONQuery.expressions.Expr.gt;
import static com.kcthota.JSONQuery.expressions.Expr.le;
import static com.kcthota.JSONQuery.expressions.Expr.not;
import static com.kcthota.JSONQu... |
Query q=new Query(myNode);
ArrayNode result = q.filter("users", le("age", 18));
assertThat(result.size()).isEqualTo(1);
assertThat(Query.q(result).value("0/name/firstName").textValue()).isEqualTo("Jane");
result = q.filter("users", not(Null("address")));
assertThat(result.size()).isEqualTo(2)... | } catch(UnsupportedExprException e) { | 7 |
google/android-classyshark | ClassySharkWS/src/com/google/classyshark/silverghost/translator/java/StressTest.java | [
"public class ContentReader {\n\n /**\n * components that are part of jar & apk\n */\n public enum ARCHIVE_COMPONENT {\n ANDROID_MANIFEST, NATIVE_LIBRARY\n }\n\n public static class Component {\n\n public Component(String name, ARCHIVE_COMPONENT component) {\n this.name ... | import com.google.classyshark.silverghost.contentreader.ContentReader;
import com.google.classyshark.silverghost.contentreader.dex.DexlibLoader;
import com.google.classyshark.silverghost.contentreader.jar.JarReader;
import com.google.classyshark.silverghost.translator.Translator;
import com.google.classyshark.silvergho... | /*
* Copyright 2015 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | Translator sourceGenerator = TranslatorFactory.createTranslator(currentClass, | 3 |
yuanmomo/maven-archetype | generator-plugin/src/main/java/net/yuanmomo/generator/plugin/controller/jsp/ControllerPluginUtil.java | [
"public class PluginUtil {\n\t/**\n\t * 生成class中的logger属性\n\t * \n\t * @return\n\t */\n\tpublic static Field getLoggerField (String className){\n\t\tField field = new Field();\n field.setVisibility(JavaVisibility.PRIVATE);\n field.setType(new FullyQualifiedJavaType(\"Logger\"));\n field.setNam... | import com.alibaba.fastjson.JSON;
import net.yuanmomo.generator.PluginUtil;
import net.yuanmomo.generator.plugin.business.BusinessPluginUtil;
import net.yuanmomo.util.CollectionUtil;
import net.yuanmomo.util.generator.PaginationBean;
import net.yuanmomo.util.generator.PaginationUtil;
import org.mybatis.generator.api.Co... | package net.yuanmomo.generator.plugin.controller.jsp;
public class ControllerPluginUtil{
public static final String RETURN = "return \"out\";";
/**
* controller需要导入的包列表
*/
public static List<String> controllerImportStringList = new ArrayList<String>();
static{
controllerImportStringList.add("java.util.... | controllerImportStringList.add(PaginationUtil.class.getName()); | 4 |
jenkinsci/tikal-multijob-plugin | src/test/java/com/tikal/jenkins/plugins/multijob/test/PhaseJobsConfigTest.java | [
"@Restricted(NoExternalUse.class)\npublic class MultiJobParametersAction extends ParametersAction {\n\n private List<ParameterValue> parameters;\n\n public MultiJobParametersAction(@Nonnull List<ParameterValue> parameters) {\n super(parameters);\n this.parameters = parameters;\n }\n\n publ... | import com.tikal.jenkins.plugins.multijob.MultiJobParametersAction;
import hudson.model.Action;
import hudson.model.ParameterValue;
import hudson.model.TaskListener;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.Cause.UserIdCause;
import hudson.model.CauseAction;
import hud... | /*
* The MIT License
*
* Copyright (c) 2013, Chris Johnson
*
* 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, cop... | MultiJobParametersAction pa = getParametersAction(actions); | 0 |
legobmw99/Allomancy | src/main/java/com/legobmw99/allomancy/modules/consumables/ConsumeSetup.java | [
"@Mod(Allomancy.MODID)\npublic class Allomancy {\n\n public static final String MODID = \"allomancy\";\n public static final CreativeModeTab allomancy_group = new CreativeModeTab(MODID) {\n @Override\n public ItemStack makeIcon() {\n return new ItemStack(CombatSetup.MISTCLOAK.get());\... | import com.legobmw99.allomancy.Allomancy;
import com.legobmw99.allomancy.modules.consumables.item.GrinderItem;
import com.legobmw99.allomancy.modules.consumables.item.LerasiumItem;
import com.legobmw99.allomancy.modules.consumables.item.VialItem;
import com.legobmw99.allomancy.modules.consumables.item.recipe.VialItemRe... | package com.legobmw99.allomancy.modules.consumables;
public class ConsumeSetup {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Allomancy.MODID);
public static final DeferredRegister<RecipeSerializer<?>> RECIPES = DeferredRegister.create(ForgeRegistries.RECIP... | public static final RegistryObject<GrinderItem> ALLOMANTIC_GRINDER = ITEMS.register("allomantic_grinder", GrinderItem::new); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.