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 |
|---|---|---|---|---|---|---|
GoogleCloudPlatform/endpoints-codelab-android | todoTxtTouch/src/main/java/com/todotxt/todotxttouch/AddTask.java | [
"public interface RemoteClient {\n\tClient getClient();\n\n\t/**\n\t * Attempts to authenticate with remote api\n\t * \n\t * @return true if successful\n\t */\n\tboolean authenticate();\n\n\t/**\n\t * Starts the login with remote api\n\t * \n\t * @return true if successful\n\t */\n\tboolean startLogin();\n\n\t/**\n... | import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Random;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import andr... | /**
* This file is part of Todo.txt for Android, an app for managing your todo.txt file (http://todotxt.com).
*
* Copyright (c) 2009-2013 Todo.txt for Android contributors (http://todotxt.com)
*
* LICENSE:
*
* Todo.txt for Android is free software: you can redistribute it and/or modify it under the terms of the ... | private Task m_backup; | 2 |
cianfrocco-lab/COSMIC-CryoEM-Gateway | gateway_config/portal/src/main/java/org/ngbw/web/actions/DataManager.java | [
"public class WorkbenchSession {\n\tprivate static final Log log = LogFactory.getLog(WorkbenchSession.class);\n\n\tprivate final Workbench workbench;\n\tprivate final long userId;\n\tprivate User user;\n\n\n\tWorkbenchSession(User user, Workbench workbench)\n\t{\n\t\tthis.userId = user.getUserId();\n\t\tthis.workbe... | import java.io.File;
import java.io.InputStream;
import java.io.ByteArrayInputStream;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.Vector;
import java.u... |
public boolean hasSourceDocument() {
return (getSourceDocument() != null);
}
/*
* This method is where dynamically dispatched source data rendering mechanisms should be employed.
* The source data should be properly formatted HTML to be placed directly into the data display page.
* The contents of ... | User sizeuser = session.getUser(); | 4 |
apatry/neo4j-lucene4-index | src/test/java/org/neo4j/index/impl/lucene/TestLuceneIndex.java | [
"public class QueryContext\n{\n private final Object queryOrQueryObject;\n private Sort sorting;\n private QueryParser.Operator defaultOperator;\n private boolean tradeCorrectnessForSpeed;\n private int topHits;\n \n public QueryContext( Object queryOrQueryObject )\n {\n this.queryOrQ... | import org.apache.lucene.index.Term;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.NumericRangeQuery;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.TermQ... | /**
* Copyright (c) 2002-2014 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j 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 Foundati... | assertThat( index.get( key, value ), contains( entity1 ) ); | 4 |
GoogleCloudPlatform/bigquery-data-lineage | src/test/java/com/google/cloud/solutions/datalineage/converter/CompositeLineageToTagConverterTest.java | [
"public static <T> String asJsonString(T object) {\n try {\n\n if (object == null) {\n return \"\";\n }\n\n if (object instanceof MessageOrBuilder) {\n return convertProtobufMessage((MessageOrBuilder) object);\n }\n\n if (object instanceof Collection) {\n return \"[\" +\n ((C... | import static com.google.cloud.solutions.datalineage.converter.ProtoJsonConverter.asJsonString;
import static com.google.cloud.solutions.datalineage.converter.ProtoJsonConverter.parseJson;
import static com.google.cloud.solutions.datalineage.testing.JsonAssert.assertJsonEquals;
import static com.google.common.truth.Tru... | public void buildTags_noParent_tagDoesNotContainParent() {
CompositeLineage sampleLineage = CompositeLineage.newBuilder()
.setReconcileTime(Instant.parse("2020-04-12T12:00:00Z").toEpochMilli())
.setJobInformation(JobInformation.newBuilder()
.setActuator("test-account@gserviceaccount.co... | TestResourceLoader | 4 |
googleapis/java-trace | google-cloud-trace/src/test/java/com/google/cloud/trace/v2/TraceServiceClientTest.java | [
"public final class BatchWriteSpansRequest extends com.google.protobuf.GeneratedMessageV3\n implements\n // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.BatchWriteSpansRequest)\n BatchWriteSpansRequestOrBuilder {\n private static final long serialVersionUID = 0L;\n // Use Bat... | import com.google.api.gax.core.NoCredentialsProvider;
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.testing.LocalChannelProvider;
import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.api.gax.rpc.ApiClientHe... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | BatchWriteSpansRequest actualRequest = ((BatchWriteSpansRequest) actualRequests.get(0)); | 0 |
jenshadlich/s3srv | src/main/java/de/jeha/s3srv/storage/backends/InMemoryStorageBackend.java | [
"public class BadDigestException extends Exception {\n\n public BadDigestException(String message) {\n super(message);\n }\n\n}",
"public class Credentials {\n\n private final static String ACCESS_KEY_CHARS = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n private final static int ACCESS_KEY_LENGTH... | import de.jeha.s3srv.common.errors.BadDigestException;
import de.jeha.s3srv.common.security.Credentials;
import de.jeha.s3srv.model.S3Bucket;
import de.jeha.s3srv.model.S3Object;
import de.jeha.s3srv.model.S3User;
import de.jeha.s3srv.storage.StorageBackend;
import org.apache.commons.codec.binary.Base64;
import org.apa... | package de.jeha.s3srv.storage.backends;
/**
* @author jenshadlich@googlemail.com
*/
public class InMemoryStorageBackend implements StorageBackend {
private static final Logger LOG = LoggerFactory.getLogger(InMemoryStorageBackend.class);
private final Map<String, S3Bucket> buckets = new HashMap<>();
p... | public void createBucket(S3User owner, String bucket) { | 4 |
USCDataScience/AgePredictor | age-predictor-cli/src/main/java/edu/usc/irds/agepredictor/cmdline/spark/authorage/AgePredictTool.java | [
"public class CLI {\n public static final String CMD = \"bin/authorage\";\n public static final String DEFAULT_FORMAT = AuthorAgeSample.FORMAT_NAME;\n \n private static Map<String, CmdLineTool> toolLookupMap;\n \n static {\n\ttoolLookupMap = new LinkedHashMap<String, CmdLineTool>();\n \n\tLi... | import java.io.File;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.function.VoidFunction;
import org.apache.spark.ml.feature.CountVectorizerModel;
import ... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | FeatureGenerator[] featureGenerators = model.getContext().getFeatureGenerators(); | 4 |
cloud-software-foundation/c5-replicator | c5-general-replication/src/main/java/c5db/replication/C5GeneralizedReplicationService.java | [
"public interface GeneralizedReplicationService {\n\n ListenableFuture<GeneralizedReplicator> createReplicator(String quorumId, Collection<Long> peerIds);\n\n public Reader<ReplicatorEntry> getLogReader(String quorumId);\n}",
"@ModuleTypeBinding(ModuleType.Log)\npublic interface LogModule extends C5Module {\n ... | import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;
import c5db.interfaces.GeneralizedReplicationService;
import c5db.interfaces.LogModule;
import c5db.interfaces.ReplicationModule;
import c5db.interfaces.log.Reader;
import c5db.interfaces.replication.Gene... | /*
* Copyright 2014 WANdisco
*
* WANdisco licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | private final LogModule logModule; | 1 |
Earthblood/Toe | app/src/test/java/com/earthblood/tictactoe/guice/TestToeRoboModule.java | [
"public class ToeGame {\n\n private PreferenceHelper preferenceHelper;\n\n @Inject\n public ToeGame(PreferenceHelper preferenceHelper){\n this.preferenceHelper = preferenceHelper;\n }\n\n public String titleHack(String appName, String statusMessage){\n return \"<font color=#CD5C5C><b>\"... | import android.app.Application;
import com.earthblood.tictactoe.engine.ToeGame;
import com.earthblood.tictactoe.helper.CoinTossHelper;
import com.earthblood.tictactoe.helper.HapticFeedbackHelper;
import com.earthblood.tictactoe.helper.HtmlHelper;
import com.earthblood.tictactoe.helper.PreferenceHelper;
import com.googl... | /**
* @author John Piser developer@earthblood.com
*
* Copyright (C) 2014 EARTHBLOOD, LLC
*
* 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 ... | bind(ToeGame.class).toInstance(Mockito.mock(ToeGame.class)); | 0 |
gustav9797/PowerfulPerms | PowerfulPerms/src/main/java/com/github/gustav9797/PowerfulPerms/Vault/PowerfulPerms_Vault_Chat.java | [
"public class PowerfulPerms extends JavaPlugin implements Listener, PowerfulPermsPlugin {\n\n private PowerfulPermissionManager permissionManager;\n\n private File customConfigFile = null;\n private FileConfiguration customConfig = null;\n\n public static String pluginPrefix = ChatColor.WHITE + \"[\" + ... | import com.github.gustav9797.PowerfulPerms.PowerfulPerms;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import com.github.gustav9797.PowerfulPerms.common.PermissionContainer;
import com.github.gustav9797.PowerfulPerms.common.PermissionManagerBase;
import com.github.g... | package com.github.gustav9797.PowerfulPerms.Vault;
public class PowerfulPerms_Vault_Chat extends Chat {
private PowerfulPerms plugin;
private PermissionManagerBase permissionManager;
public PowerfulPerms_Vault_Chat(Permission perms, PowerfulPerms plugin) {
super(perms);
this.plugin = pl... | PermissionPlayer p = permissionManager.getPermissionPlayer(player); | 4 |
sergioag/cobol2java | src/main/java/com/res/java/util/NameUtil.java | [
"public class Main {\r\n\r\n private RESConfig config = RESConfig.getInstance();\r\n private static RESContext context = new RESContext();\r\n private boolean doListDir = false;\r\n private Preprocessor preprocessor = new Preprocessor();\r\n public long startClock;\r\n\r\n public static void main(... | import com.res.java.translation.symbol.SymbolTable;
import com.res.java.translation.symbol.SymbolUtil;
import java.util.Arrays;
import java.util.Collection;
import com.res.cobol.Main;
import java.util.Iterator;
import java.util.Stack;
import java.util.TreeSet;
import com.res.common.RESConfig;
import com.res.ja... | package com.res.java.util;
/*****************************************************************************
Copyright 2009 Venkat Krishnamurthy
This file is part of RES.
RES 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 Softwa... | if(props2.getType()==SymbolConstants.DUMMY)
| 5 |
edeoliveira/MailsterSMTP | src/org/mailster/smtp/core/SMTPContext.java | [
"public class SMTPServerConfig \n{\n\t/**\n\t * Server name.\n\t */\n\tpublic static final String NAME = \"MailsterSMTP\";\n\t\n\t/**\n\t * Server version\n\t */\n\tpublic static final String VERSION = \"1.0.0-M3\";\n\n\t/**\n\t * 4 megs by default. The server will buffer incoming messages to disk\n\t * when they h... | import java.io.InputStream;
import java.net.SocketAddress;
import org.apache.mina.core.session.IoSession;
import org.mailster.smtp.SMTPServerConfig;
import org.mailster.smtp.api.handler.AbstractDeliveryHandler;
import org.mailster.smtp.api.handler.DeliveryContext;
import org.mailster.smtp.api.handler.DeliveryHandlerFac... | package org.mailster.smtp.core;
/**
* The context of a SMTP session.
*
* @author De Oliveira Edouard <doe_wanted@yahoo.fr>
*/
public class SMTPContext implements DeliveryContext
{
private SMTPServerConfig cfg;
private SMTPState smtpState;
private SocketAddress remoteAddress;
private Credential cred... | private AbstractDeliveryHandler deliveryHandler; | 1 |
RoboTricker/Transport-Pipes | src/main/java/de/robotricker/transportpipes/ResourcepackService.java | [
"public class GeneralConf extends Conf {\n\n @Inject\n public GeneralConf(Plugin configPlugin) {\n super(configPlugin, \"config.yml\", \"config.yml\", true);\n }\n\n public int getMaxItemsPerPipe() {\n return (int) read(\"max_items_per_pipe\");\n }\n\n public boolean isCraftingEnable... | import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURL... | package de.robotricker.transportpipes;
public class ResourcepackService implements Listener {
private static String URL = "https://raw.githubusercontent.com/RoboTricker/Transport-Pipes/master/src/main/resources/wiki/resourcepack.zip";
private SentryService sentry;
private TransportPipes transportPipe... | LangConf.Key.RESOURCEPACK_FAIL.sendMessage(e.getPlayer()); | 1 |
flipkart-incubator/BlueShift | src/main/java/com/flipkart/fdp/migration/db/core/CBatchRunsDao.java | [
"@Slf4j\n@SuppressWarnings(\"unchecked\")\npublic class CServiceDao<E> implements IServiceDao<E> {\n\t/**\n\t * Creates a new DAO with a given session provider.\n\t * \n\t * @param sessionFactory\n\t * a session provider\n\t */\n\tprivate SessionFactory sessionFactory;\n\tprivate final Class<?> entityCla... | import com.flipkart.fdp.migration.db.utils.EBase;
import com.flipkart.fdp.migration.db.utils.EFailure;
import com.flipkart.fdp.migration.db.utils.EInvalid;
import com.flipkart.fdp.migration.db.utils.ENotFound;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.Query;
import org.hibernate.Sess... | /*
*
* Copyright 2015 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | public BatchRun getBatchRun(long batchId, String jobId) throws EBase { | 2 |
MFlisar/StorageManager | lib/src/main/java/com/michaelflisar/storagemanager/MediaStoreUpdateManager.java | [
"public class MediaStoreFileData\n{\n private StorageDefinitions.MediaType mType;\n\n // MediaStore\n private Uri mUri;\n private long mId;\n private String mName;\n private String mData;\n private long mDateTaken;\n private long mDateModified;\n private String mMimeType;\n private int... | import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.location.Location;
import com.michaelflisar.storagemanager.data.MediaStoreFileData;
import com.michaelflisar.storagemanager.exceptions.StorageException;
import com.michaelflisar.storagemanager.files.StorageFile... | package com.michaelflisar.storagemanager;
/**
* Created by flisar on 07.03.2016.
*/
public class MediaStoreUpdateManager
{
private static MediaStoreUpdateManager INSTANCE = null;
public static MediaStoreUpdateManager get()
{
if (INSTANCE == null)
INSTANCE = new MediaStoreUpdateMan... | private ArrayList<MediaStoreFileData> mFileCreationsMediaStoreFileData = new ArrayList<>(); | 0 |
JetBrains/teamcity-vmware-plugin | cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/vmware/VmwareCloudImage.java | [
"public abstract class AbstractCloudImage<T extends AbstractCloudInstance, G extends CloudImageDetails> implements CloudImage, UpdatableCloudErrorProvider {\n protected final UpdatableCloudErrorProvider myErrorProvider = new CloudErrorMap(SimpleErrorMessages.getInstance());\n private final Map<String, T> myInstan... | import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.Function;
import com.vmware.vim25.mo.Task;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.con... | myAsyncTaskExecutor.executeAsync(new VmwareTaskWrapper(new Callable<Task>() {
public Task call() throws Exception {
return myApiConnector.reconfigureInstance(instance, instance.getName(), cloudInstanceUserData);
... | protected VmwareCloudInstance createInstanceFromReal(final AbstractInstance realInstance) { | 1 |
redferret/planet | src/worlds/planet/geosphere/GeoCell.java | [
"public class Vec2 {\n\n private float x, y;\n\n public Vec2() {\n this(0, 0);\n }\n\n public Vec2(Vec2 toCopy) {\n this(toCopy.x, toCopy.y);\n }\n\n public Vec2(float x, float y) {\n this.x = x;\n this.y = y;\n }\n\n public float getX() {\n return x;\n }\n\n public float getY() {\n retu... | import java.awt.Color;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
import engine.util.Vec2;
import java.util.Set;
import worlds.planet.Util;
import worlds.planet.Planet;
import worlds.planet.PlanetCell;
import worlds.planet.PlanetSurface;
import java.util.concurrent.ConcurrentLinkedDeque... | */
public Layer removeTopRockLayer() {
if (strata.peek() == null) {
return null;
}
Layer removed = strata.removeFirst();
removed.removeBottom();
if (strata.peek() != null) {
strata.peek().removeTop();
}
return updateRemoved(removed);
}
/**
* Removes the bottom laye... | if (instance().getTimeScale() == Planet.TimeScale.Geological) { | 5 |
paramsen/currency-android-reactive | app/src/main/java/com/amsen/par/cewlrency/view/view/FavoriteFAB.java | [
"public class Analytics {\n private FirebaseAnalytics analytics;\n\n @Inject\n public Analytics(Context context, FirebaseAnalytics analytics) {\n this.analytics = analytics;\n analytics.setUserId(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID));\n }\n\n ... | import android.content.Context;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.content.ContextCompat;
import android.util.AttributeSet;
import com.amsen.par.cewlrency.R;
import com.amsen.par.cewlrency.analytics.Analytics;
import com.am... | package com.amsen.par.cewlrency.view.view;
/**
* @author Pär Amsen 2016
*/
public class FavoriteFAB extends FloatingActionButton {
@Inject
EventStream eventStream;
@Inject
PreferencesSource preferencesSource;
@Inject | Analytics analytics; | 0 |
NightKosh/Gravestone-mod-Graves | src/main/java/nightkosh/gravestone/core/event/EventsHandler.java | [
"public class Config {\n\n private static Configuration config;\n private static Config instance;\n private static String path;\n // CATEGORIES\n public static final String CATEGORY_COMPATIBILITY = \"compatibility\";\n public static final String CATEGORY_GRAVES = \"graves\";\n\n private Config(... | import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
import ... | package nightkosh.gravestone.core.event;
/**
* GraveStone mod
*
* @author NightKosh
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*/
public class EventsHandler {
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerClone(PlayerEvent.Clone event) {
... | if (!Config.generateGravesInLava && event.getSource().damageType.equals("lava")) { | 0 |
palominolabs/benchpress | examples/multi-db/hbase-async/src/main/java/com/palominolabs/benchpress/example/multidb/hbaseasync/HbaseAsyncJobTypePlugin.java | [
"public final class KeyGeneratorFactoryFactoryRegistry extends IdRegistry<KeyGeneratorFactoryFactory> {\n\n @Inject\n KeyGeneratorFactoryFactoryRegistry(Set<KeyGeneratorFactoryFactory> instances) {\n super(instances);\n }\n}",
"public final class ValueGeneratorFactoryFactoryRegistry extends IdRegi... | import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectReader;
import com.google.inject.Inject;
import com.palominolabs.benchpress.example.multidb.key.KeyGeneratorFactoryFactoryRegistry;
import com.palominolabs.benchpress.example.multidb.value.ValueGeneratorFactoryFactoryRegistry;
i... | package com.palominolabs.benchpress.example.multidb.hbaseasync;
final class HbaseAsyncJobTypePlugin implements JobTypePlugin {
static final String TASK_TYPE = "HBASE_ASYNC";
private final KeyGeneratorFactoryFactoryRegistry keyGeneratorFactoryFactoryRegistry;
private final ValueGeneratorFactoryFactoryRegi... | public ControllerComponentFactory getControllerComponentFactory(ObjectReader objectReader, | 3 |
scalyr/Scalyr-Java-Client | src/test/com/scalyr/api/tests/ConfigurationFileTest.java | [
"public class ScalyrDeadlineException extends ScalyrException {\n /**\n * @param deadlineInMs Time allowed for the operation (in milliseconds).\n */\n public ScalyrDeadlineException(long deadlineInMs) {\n this(\"Operation\", deadlineInMs);\n }\n\n /**\n * @param operationName Name of the operation that... | import java.util.List;
import java.util.concurrent.Semaphore;
import java.util.function.Consumer;
import static org.junit.Assert.*;
import com.scalyr.api.ScalyrDeadlineException;
import com.scalyr.api.internal.Sleeper;
import com.scalyr.api.json.JSONObject;
import com.scalyr.api.knobs.BadConfigurationFileException;
imp... | /*
* Scalyr client library
* Copyright 2012 Scalyr, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | private List<ConfigurationFile> files = new ArrayList<ConfigurationFile>(); | 4 |
Kaysoro/KaellyBot | src/main/java/commands/classic/WhoisCommand.java | [
"public abstract class AbstractCommand implements Command {\n\n private final static Logger LOG = LoggerFactory.getLogger(AbstractCommand.class);\n\n protected String name;\n protected String pattern;\n protected DiscordException badUse;\n private boolean isPublic;\n private boolean isUsableInMP;\... | import commands.model.AbstractCommand;
import data.Character;
import data.ServerDofus;
import discord4j.core.event.domain.message.MessageCreateEvent;
import discord4j.core.object.entity.Message;
import discord4j.core.spec.EmbedCreateSpec;
import enums.Language;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
i... | package commands.classic;
/**
* Created by steve on 14/07/2016.
*/
public class WhoisCommand extends AbstractCommand {
private final static Logger LOG = LoggerFactory.getLogger(WhoisCommand.class);
private final static String forPseudo = "text=";
private final static String forServer = "character_home... | public void request(MessageCreateEvent event, Message message, Matcher m, Language lg) { | 3 |
upenn-libraries/xmlaminar | integrator/src/main/java/edu/upenn/library/xmlaminar/integrator/IntegratorOutputNode.java | [
"public class InputSourceXMLReader extends VolatileXMLFilterImpl {\n\n private final InputSource source;\n private Reader ownReader;\n private final Resettable resetter;\n private boolean parsed = false;\n \n public InputSourceXMLReader(InputSource source) {\n this(null, source, null);\n ... | import edu.upenn.library.xmlaminar.parallel.InputSourceXMLReader;
import edu.upenn.library.xmlaminar.parallel.JoiningXMLFilter;
import edu.upenn.library.xmlaminar.parallel.QueueSourceXMLFilter;
import edu.upenn.library.xmlaminar.DumpingLexicalXMLFilter;
import edu.upenn.library.xmlaminar.SAXParserResetter;
import edu.u... | } catch (ExecutionException ex) {
activeJobs.remove(job);
throw ex;
} catch (Throwable t) {
activeJobs.remove(job);
throw new RuntimeException(t);
}
}
}
private vo... | return new InputSourceXMLReader(sp.getXMLReader(), source, new SAXParserResetter(sp)); | 4 |
redfin/fuzzy | fuzzy-core/src/main/java/com/redfin/fuzzy/Any.java | [
"public abstract class CollectionCase<COLLECTION extends Collection<ELEMENT>, ELEMENT> implements Case<COLLECTION> {\n\n\tprivate Case<Integer> sizeCase = Any.integer().inRange(0, 100);\n\tprivate Case<ELEMENT> elementsCase = Literal.nil();\n\n\tprivate boolean homogeneousMode;\n\n\tprotected abstract COLLECTION cr... | import com.redfin.fuzzy.cases.CollectionCase;
import com.redfin.fuzzy.cases.DoubleNumericCase;
import com.redfin.fuzzy.cases.EnumCase;
import com.redfin.fuzzy.cases.FloatNumericCase;
import com.redfin.fuzzy.cases.NullableCase;
import com.redfin.fuzzy.cases.NumericCase;
import com.redfin.fuzzy.cases.StringCase;
import c... | package com.redfin.fuzzy;
public class Any {
@SafeVarargs
public static <T> Case<T> of(Case<T>... cases) {
return new UnionCase<>(cases);
}
@SafeVarargs
public static <T> Case<T> of(Subcase<T>... subcases) { return Cases.of(subcases); }
@SafeVarargs
public static <T> Case<T> of(Supplier<T>... cases) { ret... | public static <T> CollectionCase<List<T>, T> listOf(Case<T>... cases) { | 0 |
ihongs/HongsCORE | hongs-serv-master/src/main/java/io/github/ihongs/serv/auth/RoleSet.java | [
"public final class Cnst {\n\n //** 默认取值 **/\n\n public static final String LANG_DEF = \"zh_CN\"; // 默认语言\n\n public static final String ZONE_DEF = \"GMT+8\"; // 默认时区\n\n public static final int RN_DEF = 20 ; // 默认每页行数\n\n //** 查询参数 **/\n\n public static final String ID_KEY = \"id\"; // 编号\n... | import io.github.ihongs.Cnst;
import io.github.ihongs.Core;
import io.github.ihongs.CoreSerial;
import io.github.ihongs.HongsException;
import io.github.ihongs.action.ActionHelper;
import io.github.ihongs.db.DB;
import io.github.ihongs.db.Table;
import io.github.ihongs.db.util.FetchCase;
import io.github.ihongs.util.Sy... | package io.github.ihongs.serv.auth;
/**
* 用户组记录
* @author Hongs
*/
public class RoleSet extends CoreSerial implements CoreSerial.Mtimes, Set<String> {
transient public final String userId;
transient public final File file ;
transient public final long time ;
public Set <String> roles = null... | String path = "master/role/" + Syno.splitPath(userId); | 3 |
xfumihiro/DataInspector | data-inspector-runtime/src/main/java/data_inspector/DataInspector.java | [
"@PerActivity @Component(dependencies = ApplicationComponent.class, modules = ActivityModule.class)\npublic interface ActivityComponent {\n void inject(DataInspector dataInspector);\n\n void inject(DataInspectorToolbar dataInspectorToolbar);\n\n void inject(BaseMenu baseMenu);\n\n void inject(PreferenceMenu pre... | import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.view.View;
import android.view.WindowManager;
import data_inspector.dagger.ActivityComponent;
import data_inspector.dagger.ActivityModule;
import data_inspector.dagger.ApplicationComponent;
import data_inspector.... | package data_inspector;
public final class DataInspector {
public static final String TAG = "DataInspector";
public static ApplicationComponent applicationComponent;
public static Set<Context> contextSet = new HashSet<>();
public static Map<Context, ActivityComponent> runtimeComponentMap = new HashMap<>();
... | private StorageLogger storageLogger; | 5 |
caarmen/scrumchatter | app/src/main/java/ca/rmen/android/scrumchatter/meeting/detail/MeetingFragment.java | [
"public class MeetingChartActivity extends AppCompatActivity {\n\n public static void start(Context context, long meetingId) {\n Intent intent = new Intent(context, MeetingChartActivity.class);\n intent.putExtra(Meetings.EXTRA_MEETING_ID, meetingId);\n context.startActivity(intent);\n }\n... | import android.app.Activity;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.databinding.DataBindingUtil;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.SystemClock;
import android.support.annotation.... | /*
* Copyright 2013-2017 Carmen Alvarez
*
* This file is part of Scrum Chatter.
*
* Scrum Chatter 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) ... | Log.v(TAG, "Constructor"); | 1 |
redfin/fuzzy | fuzzy-core/src/test/java/com/redfin/fuzzy/cases/NumericCaseTest.java | [
"public class Any {\n\n\t@SafeVarargs\n\tpublic static <T> Case<T> of(Case<T>... cases) {\n\t\treturn new UnionCase<>(cases);\n\t}\n\n\t@SafeVarargs\n\tpublic static <T> Case<T> of(Subcase<T>... subcases) { return Cases.of(subcases); }\n\n\t@SafeVarargs\n\tpublic static <T> Case<T> of(Supplier<T>... cases) { return... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
impor... | NumericCase<Byte> subject = Any.byteInteger();
assertTrue(subject.rngLessThan(random, (byte)5) <= (byte)5);
}
@Test
public void testShortNewCase() {
NumericCase<Short> subject = Any.shortInteger();
NumericCase<Short> newCase = subject.newCase();
assertNotSame(subject, newCase);
assertNotNull(newCase);
... | Context.init(CaseCompositionMode.PAIRWISE_PERMUTATIONS_OF_SUBCASES, 0); | 2 |
Anchormen/sql4es | src/main/java/nl/anchormen/sql4es/jdbc/ESStatement.java | [
"public class ESQueryState{\n\n\t// relevant resources\n\tprivate final QueryParser parser = new QueryParser();\n\tprivate final Client client;\n\tprivate final Properties props;\n\tprivate final Statement statement;\n\tprivate final SearchHitParser hitParser = new SearchHitParser();\n\tprivate final SearchAggregat... | import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLWarning;
import java.sql.Statement;
import java.util.List;
import java.util.Optional;
import com.facebook.presto.sql.parser.SqlParser;
import com.facebook.presto.sql.t... | package nl.anchormen.sql4es.jdbc;
public class ESStatement implements Statement {
private static final SqlParser parser = new SqlParser();
protected ESConnection connection;
protected int queryTimeoutSec = 10;
protected boolean poolable = true;
protected boolean closeOnCompletion = false;
protected ResultS... | protected ESUpdateState updateState; | 2 |
shapesecurity/shift-semantics-java | src/test/java/com/shapesecurity/shift/es2017/semantics/ExplicatorTest.java | [
"public class GlobalReference implements NodeWithValue {\n\n\n\t@Nonnull\n\tpublic final String name;\n\n\tpublic GlobalReference(@Nonnull String name) {\n\t\tthis.name = name;\n\t}\n\n\t@Override\n\tpublic boolean equalsIgnoringChildren(@Nonnull Node node) {\n\t\treturn node instanceof GlobalReference && this.name... | import com.shapesecurity.functional.data.NonEmptyImmutableList;
import com.shapesecurity.shift.es2017.parser.Parser;
import com.shapesecurity.shift.es2017.semantics.asg.GlobalReference;
import com.shapesecurity.shift.es2017.semantics.asg.LiteralFunction;
import com.shapesecurity.shift.es2017.semantics.asg.LiteralNumber... | package com.shapesecurity.shift.es2017.semantics;
public class ExplicatorTest {
@Test
public void testAssignment() throws Exception {
Semantics s = Explicator.deriveSemantics(Parser.parseScript("a=0"));
assertTrue(s.node instanceof Block);
assertEquals(1, ((Block) s.node).children.length); | assertTrue(((NonEmptyImmutableList<Node>) ((Block) s.node).children).head instanceof VariableAssignment); | 3 |
szegedi/dynalink | src/main/java/org/dynalang/dynalink/DynamicLinker.java | [
"public class GuardedInvocation {\n private static final SwitchPoint[] NO_SWITCH_POINTS = new SwitchPoint[0];\n\n private final MethodHandle invocation;\n private final MethodHandle guard;\n private final Class<? extends Throwable> exception;\n private final SwitchPoint[] switchPoints;\n\n /**\n ... | import org.dynalang.dynalink.support.Lookup;
import org.dynalang.dynalink.support.RuntimeContextLinkRequestImpl;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.invoke.MutableCallSite;
import java.util.List;
import org.dynalang.dynalink.l... | /*
Copyright 2009-2013 Attila Szegedi
Licensed under both the Apache License, Version 2.0 (the "Apache License")
and the BSD License (the "BSD License"), with licensee being free to
choose either of the two at their discretion.
You may not use this file except in compliance with either the Apache
Li... | new LinkRequestImpl(callSiteDescriptor, callSite, relinkCount, callSiteUnstable, arguments) : | 5 |
godstale/retrowatch | RetroWatch_Android/RetroWatchLE/src/com/hardcopy/retrowatchle/service/RetroWatchService.java | [
"public class BluetoothManager {\n\t\n // Debugging\n private static final String TAG = \"BluetoothManager\";\n\n // Constants that indicate the current connection state\n public static final int STATE_NONE = 0; // we're doing nothing\n public static final int STATE_LISTEN = 1; // now liste... | import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import com.hardcopy.retrowatchle.R;
import com.hardcopy.retrowatchle.connectivity.BluetoothManager;
import com.hardcopy.retrowatchle.connectivity.ConnectionInfo;
import com.hardcopy.retrowatchle.connectivity.TransactionBuilder;
import com.h... | /**
* Get connected device name
*/
public String getDeviceName() {
return mConnectionInfo.getDeviceName();
}
public boolean sendEveryContentsToDevice() {
ArrayList<ContentObject> contents = mContentManager.getContentObjectList();
sendContentsToDevice(contents);
return true;
}
public void sendClock... | if(Settings.getInstance(mContext).getRunInBackground()) { | 8 |
Joy-Whale/EasyShare | platform/src/main/java/cn/joy/libs/platform/sina/SinaWeiboEntryActivity.java | [
"public class AuthCallbackReceiver extends BroadcastReceiver {\n\n\tprivate static final String TAG = \"AUTHCallbackReceiver\";\n\tprivate static final String ACTION_AUTH_CALLBACK = \"cn.joy.libs.platforms.ACTION_AUTH_CALLBACK\";\n\tprivate static final String EXTRA_CALLBACK_CODE = \"EXTRA_CALLBACK_CODE\";\n\tpriva... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import cn.joy.libs.platform.AuthCallbackReceiver;
import cn.joy.libs.platform.ErrorCode;
import cn.joy.libs.platform.Logs;
import cn.joy.libs.platform.Operate;
import cn.j... | package cn.joy.libs.platform.sina;
public class SinaWeiboEntryActivity extends Activity implements IWeiboHandler.Response {
private static final String TAG = "SinaWeiboEntryActivity";
private static final String EXTRA_PARAMS = "EXTRA_PARAMS";
private static final String EXTRA_OPERATE = "EXTRA_OPERATE";
/**
... | Logs.d(TAG, "logout!!!"); | 2 |
jwtk/jjwt | impl/src/main/java/io/jsonwebtoken/impl/compression/DefaultCompressionCodecResolver.java | [
"public interface CompressionCodec {\n\n /**\n * The compression algorithm name to use as the JWT's {@code zip} header value.\n *\n * @return the compression algorithm name to use as the JWT's {@code zip} header value.\n */\n String getAlgorithmName();\n\n /**\n * Compresses the specifi... | import io.jsonwebtoken.CompressionCodec;
import io.jsonwebtoken.CompressionCodecResolver;
import io.jsonwebtoken.CompressionCodecs;
import io.jsonwebtoken.CompressionException;
import io.jsonwebtoken.Header;
import io.jsonwebtoken.lang.Assert;
import io.jsonwebtoken.impl.lang.Services;
import io.jsonwebtoken.lang.Strin... | /*
* Copyright (C) 2015 jsonwebtoken.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | Assert.notNull(header, "header cannot be null."); | 4 |
BaoBaoJianqiang/CustomListView | TestListViewNew/app/src/main/java/com/example/jianqiang/testlistview/MyAdapter.java | [
"public interface ItemViewAware<T>\n{\n void setData(T item, ItemViewLayoutConfig layoutConfig);\n\n boolean triggerNetworkJob(ListAdapterAware adapter, int position);\n\n void setOnItemViewClickedListener(OnItemViewClickedListener<T> listener);\n}",
"public interface ItemViewFactoryAware<T>\n{\n View... | import android.app.Activity;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import com.example.jianqiang.testlistview.awares.ItemViewAware;
import com.example.jianqiang.testlistview.awares.ItemViewFac... | package com.example.jianqiang.testlistview;
public class MyAdapter extends BaseAdapter implements ListAdapterAware {
private List<News> newsList;
private Activity context;
private ItemViewFactoryAware<News> itemViewFactory;
private boolean isScrolling;
private ListView mMyListView;
private O... | this.itemViewFactory = itemViewFactory == null ? new DefaultItemViewFactory() : itemViewFactory; | 5 |
csm/java-sandbox | src/main/java/net/datenwerke/sandbox/jvm/JvmImpl.java | [
"public class SandboxContext implements Serializable {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = -5253800931844658443L;\n\n\tprivate transient Logger logger = Logger.getLogger(getClass().getName());\n\t\n\t/**\n\t * \n\t * @author Arno Mittelbach\n\t */\n\tpublic enum FileAccess{ READ, ... | import net.datenwerke.sandbox.jvm.exceptions.JvmKilledUnsafeThreadException;
import net.datenwerke.sandbox.jvm.exceptions.JvmServerDeadException;
import net.datenwerke.sandbox.jvm.exceptions.RemoteTaskExecutionFailed;
import net.datenwerke.sandbox.jvm.server.SandboxRemoteServer;
import java.rmi.Naming;
import java.rmi.... | /*
* java-sandbox
* Copyright (c) 2012 datenwerke Jan Albrecht
* http://www.datenwerke.net
*
* This file is part of the java-sandbox: https://sourceforge.net/p/dw-sandbox/
*
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publish... | public synchronized SandboxedCallResult execute(JvmTask task) throws JvmServerDeadException, RemoteTaskExecutionFailed, JvmKilledUnsafeThreadException { | 5 |
winterDroid/android-drawable-importer-intellij-plugin | src/main/java/de/mprengemann/intellij/plugin/androidicons/controllers/multi/MultiImporterController.java | [
"public interface IDefaultsController {\n Set<Resolution> getResolutions();\n void setResolutions(Set<Resolution> resolutions);\n\n ImageAsset getImageAsset();\n void setImageAsset(ImageAsset imageAsset);\n\n Resolution getSourceResolution();\n void setSourceResolution(Resolution sourceResolution)... | import com.google.common.base.Objects;
import com.intellij.openapi.project.Project;
import de.mprengemann.intellij.plugin.androidicons.controllers.defaults.IDefaultsController;
import de.mprengemann.intellij.plugin.androidicons.images.RefactoringTask;
import de.mprengemann.intellij.plugin.androidicons.model.Format;
imp... | package de.mprengemann.intellij.plugin.androidicons.controllers.multi;
public class MultiImporterController implements IMultiImporterController {
private Set<MultiImporterObserver> observers;
private Map<Resolution, List<ImageInformation>> zipImageInformationMap;
private Map<Resolution, ImageInformation... | private Format format; | 2 |
geoparser/geolocator | geo-locator/src/edu/cmu/geoparser/parser/spanish/SpanishParser.java | [
"public class Tweet {\n String id;\n\n Status status;\n\n Sentence sentence;\n\n List<LocEntity> geoLocations;\n\n public Tweet(){\n }\n public Tweet(String tweetStr){\n this.sentence = new Sentence(tweetStr);\n }\n public String getId() {\n return id;\n }\n\n public Tweet setId(String id) {\n t... | import edu.cmu.geoparser.parser.STBDParser;
import edu.cmu.geoparser.parser.TPParser;
import edu.cmu.geoparser.parser.utils.ParserUtils;
import edu.cmu.geoparser.resource.gazindexing.Index;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import edu.cmu.geoparser.model.Tweet;
import edu.cmu.... | /**
*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use t... | FeatureGenerator fgen = new FeatureGenerator("es", index, "res/"); | 1 |
GoogleCloudPlatform/gcs-uploader | app-desktop/src/main/java/com/google/ce/media/contentuploader/exec/StitchTask.java | [
"@Component\npublic class AuthConfig {\n public static final long REFRESH_THRESHOLD_SECS = 60*10L; //10 minutes\n public static final Object REFRESH_LOCK = new Object();\n private final EnvConfig envConfig;\n\n private AuthInfo authInfo;\n private GoogleCredentials credentials;\n private Storage storage;\n\n ... | import java.util.stream.Collectors;
import com.google.ce.media.contentuploader.config.AuthConfig;
import com.google.ce.media.contentuploader.message.AnalyticsMessage;
import com.google.ce.media.contentuploader.message.TaskInfo;
import com.google.ce.media.contentuploader.message.Tasklet;
import com.google.ce.media.conte... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | m1.setStartTime(DateUtils.time(startTime)); | 4 |
adityayadav76/internet_of_things_simulator | AutoSIM-Automatski/src/com/automatski/autosim/automatski/SampleStreamerConnection.java | [
"public class AutoSIMConnectionConfig {\n\n\tpublic String name;\n\tpublic String host;\n\tpublic int port;\n\tpublic String username;\n\tpublic String password;\n\t\n\tpublic String connectorClassName;\n}",
"public interface IConnection {\n\n\tpublic void setConfig(Object object);\n\t\n\t\n\tpublic void connect(... | import org.apache.thrift.protocol.TBinaryProtocol;
import org.apache.thrift.protocol.TProtocol;
import org.apache.thrift.transport.TSocket;
import org.apache.thrift.transport.TTransport;
import com.automatski.autosim.automatski.config.AutoSIMConnectionConfig;
import com.automatski.autosim.environments.IConnection;
impo... | /*
* AutoSIM - Internet of Things Simulator
* Copyright (C) 2014, Aditya Yadav <aditya@automatski.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 Licens... | private IConnectionListener listener = null; | 2 |
dschadow/ApplicationIntrusionDetection | duke-encounters/src/test/java/de/dominikschadow/dukeencounters/encounter/EncounterServiceTest.java | [
"@ConfigurationProperties(prefix = \"duke.encounters\")\n@Data\npublic class DukeEncountersProperties {\n /**\n * The number of encounters to be shown in the latest encounters list.\n */\n private int latestAmount;\n private int passwordStrength;\n}",
"@Service\n@Slf4j\n@AllArgsConstructor\npubli... | import static de.dominikschadow.dukeencounters.TestData.twoTestEncounters;
import static org.assertj.core.api.Java6Assertions.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.anyLong;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Matchers.anyString;
im... | /*
* Copyright (C) 2017 Dominik Schadow, dominikschadow@gmail.com
*
* This file is part of the Application Intrusion Detection project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
... | private DukeEncountersProperties properties; | 0 |
google/ftc-object-detection | TFObjectDetector/tfod/src/main/java/com/google/ftcresearch/tfod/detection/TfodFrameManager.java | [
"public interface FrameGenerator {\n\n /**\n * Get the next frame in the sequence, blocking if none are available.\n *\n * @return The next frame. Never null.\n */\n @NonNull YuvRgbFrame getFrame() throws InterruptedException;\n\n /** Method to serve as a destructor to release any important resources (e.... | import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.Log;
import com.google.ftcresearch.tfod.generators.FrameGenerator;
import com.google.ftcresearch.tfod.util.AnnotatedYuvRgbFrame;
import com.goo... | /*
* Copyright (C) 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | Timer timer = new Timer(TAG); | 5 |
twak/campskeleton | src/org/twak/camp/debug/WeightedPointEditor.java | [
"public class Face\n{\n // first is outside, others are holes\n public LoopL<Point3d> points = null;\n\n public Set<Tag> plan = new HashSet<>(), profile = new HashSet<>();\n\n // bottom edges\n public Set<SharedEdge> definingSE = new LinkedHashSet<>();\n // defining edges of child (top) edges\n ... | import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.geom.Line2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.imageio.ImageIO;
import javax.vecmath.Po... | Output output;
static int count = 0;
public void paintPointEditor(Graphics2D g2)
{
// giggidyStar( count++ );
// changed = true;
g2.setColor( new Color (0,50,0 ) );
g2.setStroke( new BasicStroke( 4f ));
for (Loop<Bar> loop : edges)
{
for (B... | for ( Face face : output.faces.values() ) | 0 |
polysantiago/spring-boot-rest-client | src/main/java/io/github/polysantiago/spring/rest/AsyncRequestHelper.java | [
"@Getter\n@EqualsAndHashCode(callSuper = false)\n@RequiredArgsConstructor(access = AccessLevel.PRIVATE)\npublic class SyntheticParametrizedTypeReference<T> extends ParameterizedTypeReference<T> {\n\n private final Type type;\n\n public static <T> SyntheticParametrizedTypeReference<T> fromResolvableType(Resolv... | import io.github.polysantiago.spring.rest.support.SyntheticParametrizedTypeReference;
import io.github.polysantiago.spring.rest.util.LocationFutureAdapter;
import io.github.polysantiago.spring.rest.util.OptionalTypeFutureAdapter;
import io.github.polysantiago.spring.rest.util.ResolvableTypeUtils;
import io.github.polys... | package io.github.polysantiago.spring.rest;
@RequiredArgsConstructor
class AsyncRequestHelper {
private final AsyncRestTemplate asyncRestTemplate;
private final Class<?> implementingClass;
<T> ListenableFuture<?> executeAsyncRequest(Method method, RequestEntity<T> requestEntity) {
ResolvableT... | SyntheticParametrizedTypeReference<T> wrappedReturnType = fromResolvableType(resolvedType); | 5 |
Archistar/archistar-core | src/test/java/at/ac/ait/archistar/integration/BftTest.java | [
"public class MemoryStorage implements StorageServer {\n\n private HashMap<String, byte[]> data;\n\n private boolean connected = false;\n\n private final String id;\n\n private final int internalBFTId;\n\n public MemoryStorage(int bftId) {\n this.id = UUID.randomUUID().toString();\n thi... | import io.netty.channel.nio.NioEventLoopGroup;
import java.util.HashSet;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import at.ac.ait.archistar.backendserver.storageinterface.MemoryStorage;
import at.ac.ait.archistar.backendserver.storageinterface.StorageServer;
import at.ac.ait.archistar.engine.TestEngi... | package at.ac.ait.archistar.integration;
public class BftTest extends AbstractIntegrationTest {
@BeforeClass
public static void prepareBftNetwork() throws NoSuchAlgorithmException, WeakSecurityException {
/* test configuration */
HashSet<StorageServer> servers = new HashSet<>();
fo... | engine = new TestEngine(serverConfig, metadata, distributor, crypto); | 2 |
lukasz-kusek/xml-comparator | src/main/java/com/github/lukaszkusek/xml/comparator/comparators/children/cost/CostCalculator.java | [
"public class XMLComparator {\n\n private XMLDocument xmlDocument1;\n private XMLDocument xmlDocument2;\n\n private Predicate<DifferenceInformation> xPathsToOmitPredicate;\n\n private List<XMLComparatorStep> xmlComparatorSteps;\n\n XMLComparator() {\n }\n\n public static XMLComparatorBuilder bu... | import com.google.common.collect.Lists;
import java.util.Collection;
import com.github.lukaszkusek.xml.comparator.XMLComparator;
import com.github.lukaszkusek.xml.comparator.diff.DifferenceCode;
import com.github.lukaszkusek.xml.comparator.diff.DifferenceDetails;
import com.github.lukaszkusek.xml.comparator.node.INode;... | /*
* The MIT License (MIT)
*
* Copyright (c) 2013 Lukasz Kusek
*
* 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,... | private DifferenceDetails compare(INode node1, INode node2) { | 2 |
pushbit/sprockets | src/main/java/net/sf/sprockets/sql/SQLite.java | [
"public static final double LATITUDE_DEGREE_KM = 111.132;",
"public static final double LATITUDE_DEGREE_MI = 69.054;",
"public static final MeasureUnit MILE = new MeasureUnit(\"length\", \"mile\");",
"public class Geos {\n\t/**\n\t * Number of kilometres in one degree of latitude at 45 degrees.\n\t *\n\t * @s... | import org.apache.commons.lang3.time.FastDateFormat;
import net.sf.sprockets.util.Geos;
import net.sf.sprockets.util.MeasureUnit;
import static java.text.Normalizer.Form.NFD;
import static java.util.Locale.US;
import static net.sf.sprockets.util.Geos.LATITUDE_DEGREE_KM;
import static net.sf.sprockets.util.Geos.LATITUDE... | /*
* Copyright 2013-2016 pushbit <pushbit@gmail.com>
*
* This file is part of Sprockets.
*
* Sprockets is free software: you can redistribute it and/or modify it under the terms of the GNU
* Lesser General Public License as published by the Free Software Foundation, either version 3 of
* the License, or (at your... | double degree = unit == MILE ? LATITUDE_DEGREE_MI : LATITUDE_DEGREE_KM; | 1 |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/internal_metric_collectors/linux/Cpu/CpuCollector.java | [
"public abstract class InternalCollectorFramework {\n \n private static final Logger logger = LoggerFactory.getLogger(InternalCollectorFramework.class.getName());\n \n protected final int NUM_FILE_WRITE_RETRIES = 3;\n protected final int DELAY_BETWEEN_WRITE_RETRIES_IN_MS = 100;\n \n private fin... | import com.pearson.statspoller.internal_metric_collectors.InternalCollectorFramework;
import com.pearson.statspoller.metric_formats.graphite.GraphiteMetric;
import com.pearson.statspoller.utilities.core_utils.StackTrace;
import com.pearson.statspoller.utilities.core_utils.Threads;
import com.pearson.statspoller.utiliti... | package com.pearson.statspoller.internal_metric_collectors.linux.Cpu;
/**
* @author Jeffrey Schmidt
*
* Collects CPU % metrics -- similar to the metrics collected by mpstat
* Based on raw data from /proc/stat
*/
public class CpuCollector extends InternalCollectorFramework implements Runnable {
private stat... | String currentRawProcStats = FileIo.readFileToString(super.getLinuxProcFileSystemLocation() + "/stat"); | 4 |
narrowtux/Showcase | src/main/java/com/narrowtux/showcase/types/FiniteShowcase.java | [
"public class Showcase extends JavaPlugin {\n\tprivate Logger log;\n\tprivate ShowcasePlayerListener playerListener = new ShowcasePlayerListener();\n\tprivate ShowcaseBlockListener blockListener = new ShowcaseBlockListener();\n\tprivate ShowcaseWorldListener worldListener = new ShowcaseWorldListener();\n\tpublic st... | import java.util.HashMap;
import java.util.Map;
import com.narrowtux.showcase.Showcase;
import com.narrowtux.showcase.ShowcaseCreationAssistant;
import com.narrowtux.showcase.ShowcaseExtra;
import com.narrowtux.showcase.ShowcasePlayer;
import com.narrowtux.showcase.ShowcaseProvider; | /*
* Copyright (C) 2011 Moritz Schmale <narrow.m@gmail.com>
*
* Showcase 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.
*
* Th... | public ShowcaseExtra loadShowcase(String values) { | 2 |
jotorren/microservices-transactions-tcc | rahub-source-code-service/src/main/java/net/jotorren/microservices/content/service/ContentService.java | [
"public interface ContentDao extends CrudRepository<SourceCodeItem, String> {\n\n}",
"@Repository\n@Scope(\"prototype\")\npublic class ContentTransactionAwareDao extends CompositeTransactionParticipantDao{\n\n public SourceCodeItem findOne(String pk){ \t \t \n \treturn getEntityManager().find(SourceC... | import java.util.List;
import java.util.UUID;
import net.jotorren.microservices.content.dao.ContentDao;
import net.jotorren.microservices.content.dao.ContentTransactionAwareDao;
import net.jotorren.microservices.content.domain.SourceCodeItem;
import net.jotorren.microservices.context.ThreadLocalContext;
import net.joto... | package net.jotorren.microservices.content.service;
@Service
public class ContentService extends CompositeTransactionParticipantService {
private static final Logger LOG = LoggerFactory.getLogger(ContentService.class);
@Autowired
private ApplicationContext context;
@Autowired
private ContentDao dao;
... | public CompositeTransactionParticipantDao getCompositeTransactionDao() { | 4 |
janishar/JPost | src/main/java/tes/mindorks/jpost/TestPrivateChannel.java | [
"public class JPost {\n\n private static ReentrantLock JPostBootLock = new ReentrantLock();\n\n private static ConcurrentHashMap<Integer, Channel<PriorityBlockingQueue<WeakReference<ChannelPost>>,\n ConcurrentHashMap<Integer,WeakReference<Object>>>> channelMap;\n\n private static BroadcastCe... | import com.mindorks.javajpost.JPost;
import com.mindorks.jpost.exceptions.AlreadyExistsException;
import com.mindorks.jpost.exceptions.JPostNotRunningException;
import tes.mindorks.jpost.message.Message1;
import tes.mindorks.jpost.message.Message2;
import tes.mindorks.jpost.subscriber.Subscriber;
import tes.mindorks.jp... | package tes.mindorks.jpost;
/**
* Created by janisharali on 30/09/16.
*/
public class TestPrivateChannel {
static Subscriber subscriberA;
static Subscriber subscriberB;
static SubscriberAsync subscriberAsyncA;
static SubscriberAsync subscriberAsyncB;
static TestPrivateChannel privateChannelO... | Message2 message2 = new Message2("Private message subscriber async 2"); | 4 |
AChep/HeadsUp | project/app/src/main/java/com/achep/base/ui/fragments/dialogs/DonateDialog.java | [
"public class App extends Application {\n\n private static final String TAG = \"App\";\n\n public static final int ID_NOTIFY_INIT = 30;\n public static final int ID_NOTIFY_TEST = 40;\n\n public static final String ACTION_ENABLE = \"com.achep.headsup.ENABLE\";\n public static final String ACTION_DISAB... | import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annota... | /*
* Copyright (C) 2014 AChep@xda <artemchep@gmail.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* Th... | if (activity instanceof ActivityBase) { | 2 |
kontalk/desktopclient-java | src/main/java/org/kontalk/Kontalk.java | [
"public final class PGPUtils {\n private static final Logger LOGGER = Logger.getLogger(PGPUtils.class.getName());\n\n /** Security provider: Bouncy Castle. */\n public static final String PROVIDER = \"BC\";\n\n /** The fingerprint calculator to use whenever it is needed. */\n static final KeyFingerPr... | import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
impor... | /*
* Kontalk Java client
* Copyright (C) 2016 Kontalk Devteam <devteam@kontalk.org>
*
* 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 ... | View.showWrongJavaVersionDialog(); | 6 |
paperpointer/editor | src/yk/myengine/optiseq/states/VertexStructureState.java | [
"public class StructureBundleTight {\r\n public List<StructureUnit> units;\r\n public int stride;\r\n public String shaderProgram;\r\n ByteBuffer buffer;\r\n\r\n public StructureBundleTight(final List<StructureUnit> units) {\r\n this.units = units;\r\n recalcStride();\r\n }\r\n\r\n ... | import yk.jcommon.fastgeom.Vec2f;
import yk.jcommon.fastgeom.Vec3f;
import yk.myengine.data.geometry.bufferstructure.StructureBundleTight;
import yk.myengine.data.geometry.bufferstructure.StructureUnit;
import yk.myengine.optiseq.AbstractState;
import yk.myengine.optiseq.states.arraystructure.*;
import yk.myengin... | package yk.myengine.optiseq.states;
/**
* Created by: Yuri Kravchik Date: 26/10/2007 Time: 11:11:46
*/
public class VertexStructureState extends AbstractState {
public int stride;
public int bufferId;
private final LinkedList<AbstractArrayStructure> structures = new LinkedList<AbstractA... | public VertexStructureState(final StructureBundleTight types, final ShaderHandler shaderHandler) {
| 0 |
lenis0012/LoginSecurity-2 | src/main/java/com/lenis0012/bukkit/loginsecurity/modules/storage/LoginSecurityImport.java | [
"public class LoginSecurity extends PluginHolder {\n private static final ExecutorService executorService = Executors.newCachedThreadPool();\n\n /**\n * Get the executor LoginSecurity uses for async processing.\n *\n * @return Executor service.\n */\n public static ExecutorService getExecut... | import com.lenis0012.bukkit.loginsecurity.LoginSecurity;
import com.lenis0012.bukkit.loginsecurity.database.InventoryRepository;
import com.lenis0012.bukkit.loginsecurity.database.LocationRepository;
import com.lenis0012.bukkit.loginsecurity.database.LoginSecurityDatabase;
import com.lenis0012.bukkit.loginsecurity.data... | package com.lenis0012.bukkit.loginsecurity.modules.storage;
public class LoginSecurityImport implements StorageImport {
private final LoginSecurity loginSecurity;
private final CommandSender sender;
public LoginSecurityImport(LoginSecurity loginSecurity, CommandSender sender) {
this.loginSecurit... | SingleConnectionDataSource secondaryDataSource = createDataSource(storageModule); | 5 |
graywolf336/CasinoSlots | src/main/java/com/craftyn/casinoslots/actions/impl/CommandAction.java | [
"public class CasinoSlots extends JavaPlugin {\r\n private Economy economy = null;\r\n private PluginManager pm = null;\r\n private Towny towny = null;\r\n private WorldGuardPlugin worldGuard = null;\r\n private Update update;\r\n private int updateCheckTask;\r\n\r\n public boolean useTowny = f... | import org.bukkit.entity.Player;
import com.craftyn.casinoslots.CasinoSlots;
import com.craftyn.casinoslots.actions.Action;
import com.craftyn.casinoslots.classes.Reward;
import com.craftyn.casinoslots.classes.SlotType;
import com.craftyn.casinoslots.exceptions.ActionLoadingException;
import com.craftyn.casinoslots.uti... | package com.craftyn.casinoslots.actions.impl;
/**
* The command action. Usage: - command The command goes here
*
* @author graywolf336
* @since 3.0.0
* @version 1.0.0
*/
public class CommandAction extends Action {
private String name = "Command";
private CasinoSlots plugin;
private String command =... | public CommandAction(CasinoSlots plugin, String... args) throws ActionLoadingException { | 4 |
pdsoftplan/zap-maven-plugin | zap-client-api/src/main/java/br/com/softplan/security/zap/api/authentication/CasAuthenticationHandler.java | [
"public class ZapHelper {\n\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(ZapHelper.class);\n\t\n\tprivate static final String ZAP_SUCCESS_RESPONSE = \"OK\";\n\tprivate static final String ZAP_DEFAULT_CONTEXT_NAME = \"Default Context\";\n\t\n\tpublic static String extractResponse(ApiResponse respo... | import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import br.com.softplan.security.zap.api.ZapHelper;
import br.com.softplan.security.zap.api.exception.ZapClientException;
import br.com.softplan.security.zap.api.model.AuthenticationInfo;
imp... | package br.com.softplan.security.zap.api.authentication;
/**
* Class to handle CAS authentication via ZAP.
*
* @author pdsec
*/
public class CasAuthenticationHandler extends AbstractAuthenticationHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(CasAuthenticationHandler.class);
public ... | protected CasAuthenticationHandler(ClientApi api, ZapInfo zapInfo, AuthenticationInfo authenticationInfo) { | 3 |
Jannyboy11/CustomRecipes | src/main/java/com/gmail/jannyboy11/customrecipes/impl/crafting/custom/addremove/PermissionRemover.java | [
"public class CustomRecipesPlugin extends JavaPlugin implements CustomRecipesApi {\n\n\tprivate final NavigableMap<String, BiConsumer<? super Player, ? super List<String>>> adders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);\n\tprivate final NavigableMap<String, BiConsumer<? super Player, ? super List<String>>> ... | import java.util.List;
import java.util.function.BiConsumer;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import com.gmail.jannyboy11.customrecipes.CustomRecipesPlugin;
import com.gmail.jannyboy11.customrecipes.api.InventoryUtils;
... | package com.gmail.jannyboy11.customrecipes.impl.crafting.custom.addremove;
public class PermissionRemover implements BiConsumer<Player, List<String>> {
private final CustomRecipesPlugin plugin;
public PermissionRemover(CustomRecipesPlugin plugin) {
this.plugin = plugin;
}
@Override
public void accept(Play... | CraftingRecipe recipe = craftingManager.getRecipe(key); | 2 |
ubiratansoares/reactive-architectures-playground | app/src/test/java/br/ufs/demos/rxmvp/playground/trivia/FactsAboutNumbersActivityTest.java | [
"public class MainApplication extends Application implements HasActivityInjector {\n\n @Inject DispatchingAndroidInjector<Activity> injector;\n @Inject public NumbersWebService webservice;\n\n @Override public void onCreate() {\n super.onCreate();\n buildTopLevelDependenciesGraph();\n ... | import android.view.View;
import android.widget.ProgressBar;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.util.Arrays;
import java.util.List;
import br.ufs.demos.rxmvp.playground.Build... | package br.ufs.demos.rxmvp.playground.trivia;
/**
* Created by bira on 7/4/17.
*/
@RunWith(RobolectricTestRunner.class)
@Config(
constants = BuildConfig.class,
application = MainApplication.class,
sdk = 27,
packageName = "br.ufs.demos.rxmvp.playground"
)
public class FactsAboutN... | List<FactViewModel> facts = Arrays.asList( | 1 |
uzresk/aws-auto-operations-using-lambda | ebs-copy-snapshot/src/main/java/jp/gr/java_conf/uzresk/aws/ope/ebs/EBSCopySnapshotFunction.java | [
"public final class LambdaLock {\r\n\r\n\tprivate static final String TABLE_NAME = \"lambda_locks\";\r\n\r\n\tprivate static final String COL_FUNCTION_NAME = \"function_name\";\r\n\r\n\tprivate static final String COL_KEY = \"key\";\r\n\r\n\tprivate static final String COL_CREATED_TIME = \"created_time\";\r\n\r\n\t... | import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import com.amazonaws.ClientConfigurat... | package jp.gr.java_conf.uzresk.aws.ope.ebs;
public class EBSCopySnapshotFunction {
private static ClientConfiguration cc = new ClientConfiguration();
public void copySnapshotFromSnapshotId(SnapshotIdRequest snapshotIdRequest, Context context) {
LambdaLogger logger = context.getLogger();
logger.... | public void copySnapshotFromVolumeId(VolumeIdRequest volumeIdRequest, Context context) {
| 3 |
zaclimon/xipl | library/src/main/java/com/zaclimon/xipl/service/ProviderTvInputService.java | [
"public abstract class BaseTvInputService extends TvInputService {\n private static final String TAG = BaseTvInputService.class.getSimpleName();\n private static final boolean DEBUG = false;\n\n // For database calls\n private static HandlerThread mDbHandlerThread;\n\n // Map of channel {@link TvCont... | import android.content.Context;
import android.media.tv.TvInputManager;
import android.media.tv.TvTrackInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Handler;
import android.util.Log;
import android.widget.Toast;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.andr... | /*
* Copyright 2017 Isaac Pateau
*
* 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... | private ProviderTvPlayer mProviderTvPlayer; | 4 |
GoogleCloudPlatform/healthcare-api-dicom-fuse | src/main/java/com/google/dicomwebfuse/dao/spec/SingleDicomStorePathBuilder.java | [
"public static final String DATASETS = \"/datasets/\";",
"public static final String DICOM_STORES = \"/dicomStores/\";",
"public static final String LOCATIONS = \"/locations/\";",
"public static final String PROJECTS = \"/projects/\";",
"public class DicomFuseException extends Exception {\n\n private int s... | import static com.google.dicomwebfuse.dao.Constants.DATASETS;
import static com.google.dicomwebfuse.dao.Constants.DICOM_STORES;
import static com.google.dicomwebfuse.dao.Constants.LOCATIONS;
import static com.google.dicomwebfuse.dao.Constants.PROJECTS;
import com.google.dicomwebfuse.exception.DicomFuseException; | // Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | return stage + PROJECTS + project + LOCATIONS + location + DATASETS + dataset + DICOM_STORES | 3 |
jchampemont/WTFDYUM | src/main/java/com/jeanchampemont/wtfdyum/service/impl/FeatureServiceImpl.java | [
"public class Event {\n\n public Event() {\n // left deliberately empty\n }\n\n public Event(final EventType type, final String additionalData) {\n this.type = type;\n this.additionalData = additionalData;\n }\n\n private EventType type;\n\n private String additionalData;\n\n ... | import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.service.FeatureService;
import com.jeanchampemont.wtfdyum.service.feature.FeatureStrategy;
import com.jeanchampemont.wtfdyum.utils.WTFDYUMException;
import org.springframework.stereotype.Service... | /*
* Copyright (C) 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Un... | public Set<Event> cron(final Long userId, final Feature feature) throws WTFDYUMException { | 0 |
simo415/spc | src/com/sijobe/spc/command/Time.java | [
"public enum FontColour {\n \n BLACK(\"\\2470\"),\n DARK_BLUE(\"\\2471\"),\n DARK_GREEN(\"\\2472\"),\n DARK_AQUA(\"\\2473\"),\n DARK_RED(\"\\2474\"),\n PURPLE(\"\\2475\"),\n ORANGE(\"\\2476\"),\n GREY(\"\\2477\"),\n DARK_GREY(\"\\2478\"),\n BLUE(\"\\2479\"),\n GREEN(\"\\247a\"),\n AQUA(\"\... | import com.sijobe.spc.util.FontColour;
import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterString;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.World;
import java.... | package com.sijobe.spc.command;
/**
* Provides methods of changing the current Minecraft time
*
* @author simo_415
*/
@Command (
name = "time",
description = "Set and get the time within minecraft",
example = "set 06:00",
videoURL = "http://www.youtube.com/watch?v=W7T1XcSgJZA",
version = "1.0"
)
p... | World world = super.getSenderAsPlayer(sender).getWorld(); | 6 |
semanticvectors/semanticvectors | src/main/java/pitt/search/semanticvectors/ESPperm.java | [
"public class SigmoidTable {\n\n\t private int maxExponent = 6; //maximum permitted exponent\n\t private int tableSize\t\t = 1000;\n\t private double[] sigmoidTable;\n\t \n\t /**\n\t * \n\t */\n\t \n\t public SigmoidTable(int maxExponent, int tableSize)\n\t\t {\n\t\t \tthis.maxExponent \t= maxExponent;\n\... | import org.apache.lucene.document.Document;
import org.apache.lucene.index.PostingsEnum;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.store.FSDirectory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.sto... | /**
Copyright (c) 2008, Arizona State University.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions... | VectorType originalVectorType = flagConfig.vectortype(); | 5 |
shyampurk/bluemix-todo-app | Android-Client/app/src/main/java/controller/PubNubHelper.java | [
"public class AddCommentResponseTemplate {\n\n private int response_code=1;\n private String type=\"\";\n private LoginDetailsObject details= new LoginDetailsObject();\n private String response_message=\"\";\n private CommentResultTemplate result = new CommentResultTemplate();\n\n\n public int get... | import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.provider.SyncStateContract;
import android.support.v4.content.LocalBroadcastManager;
import com.google.gson.Gson;
import com... | }
if (responseTemplate.getResponse_code() == 1) {
if(responseTemplate.getResponse_message().equalsIgnoreCase(ChannelConstants.SESSION_EXPIRED)){
Activity a = (Activity)parentReference;
a.runOnUiThrea... | final LoginResponseTemplate responseTemplate = (LoginResponseTemplate) g.fromJson(message.toString(), | 4 |
guardianproject/ObscuraCam | app/src/main/java/org/witness/obscuracam/photo/jpegredaction/JpegRedaction.java | [
"public class ImageRegion\n{\n\tpublic static final String LOGTAG = \"SSC.ImageRegion\";\n\t\n\t// Rect for this when unscaled\n\tpublic RectF mBounds;\n\t\n\t// Start point for touch events\n\tPointF mStartPoint = null;\n\t\n\tpublic static final int REDACT = 0; // PaintSquareObscure\n\tpublic static final int PIX... | import java.io.File;
import java.util.ArrayList;
import java.util.Properties;
import org.witness.obscuracam.ui.ImageRegion;
import org.witness.obscuracam.photo.filters.CrowdPixelizeObscure;
import org.witness.obscuracam.photo.filters.PixelizeObscure;
import org.witness.obscuracam.photo.filters.RegionProcesser;
import o... | package org.witness.obscuracam.photo.jpegredaction;
public class JpegRedaction implements RegionProcesser {
private native void redactRegion(String src, String target, int left, int right, int top, int bottom, String method);
private native void redactRegions(String src, String target, String regions);
... | else if (rProc instanceof SolidObscure) | 4 |
ivannov/predcomposer | src/test/java/com/nosoftskills/predcomposer/alternatives/PredictionsServiceAlternative.java | [
"@Entity\n@XmlRootElement\n@NamedQueries({\n @NamedQuery(name = \"getRecentGames\", query = \"SELECT g from Game g WHERE g.gameTime <= :kickoffTime AND g.locked = FALSE\")\n})\npublic class Game implements Serializable, Comparable<Game> {\n\n private static final long serialVersionUID = -71677643609688633... | import com.nosoftskills.predcomposer.model.Game;
import com.nosoftskills.predcomposer.model.Prediction;
import com.nosoftskills.predcomposer.model.User;
import com.nosoftskills.predcomposer.prediction.PredictionsService;
import javax.enterprise.inject.Alternative;
import java.util.Arrays;
import java.util.HashSet;
impo... | package com.nosoftskills.predcomposer.alternatives;
/**
* @author Ivan St. Ivanov
*/
@Alternative
public class PredictionsServiceAlternative extends PredictionsService {
private static Set<Prediction> ivansPredictions = new HashSet<>();
private static Set<Prediction> kokosPredictions = new HashSet<>();
... | if (game.equals(game1)) { | 4 |
I8C/sonar-flow-plugin | sonar-flow-plugin/src/main/java/be/i8c/codequality/sonar/plugins/sag/webmethods/flow/squid/FlowAstScanner.java | [
"public enum FlowMetric implements MetricDef {\r\n\r\n FLOWS, \r\n INVOKES, \r\n SEQUENCES, \r\n LOOPS, \r\n BRANCHES, \r\n MAPS, \r\n LINES, \r\n FILES, \r\n LINES_OF_CODE, \r\n COMPLEXITY, \r\n COMMENT_LINES, \r\n STATEMENTS, \r\n DEPENDENCIES, \r\n IS_TOP_LEVEL;\r\n\r\n public boolean aggregateIfT... | import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.metric.FlowMetric;
import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.metric.MetricList;
import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.sslr.FlowConfiguration;
import be.i8c.codequality.sonar.plugins.sag.webmethods.flow.sslr.FlowParser... | /*
* i8c
* Copyright (C) 2016 i8c NV
* mailto:contact AT i8c DOT be
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option... | final Parser<Grammar> parser = FlowParser.create(conf);
| 3 |
PPiMapBuilder/PPiMapBuilder | src/main/java/ch/picard/ppimapbuilder/ui/querywindow/QueryWindow.java | [
"public class PMBInteractionNetworkBuildTaskFactory extends AbstractTaskFactory {\n\n\t// Cytoscape services\n\tprivate final CyNetworkManager networkManager;\n\tprivate final CyNetworkFactory networkFactory;\n\tprivate final CyNetworkNaming networkNaming;\n\tprivate final CyNetworkViewFactory networkViewFactory;\n... | import net.miginfocom.swing.MigLayout;
import org.cytoscape.work.TaskManager;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.List;
import ch.picard.ppimapbuilder.data.interaction.client.web.PsicquicService;
import ch.picard.ppimapbuilder.data.organism.Organism;
import ch.picard.ppima... | /*
* This file is part of PPiMapBuilder.
*
* PPiMapBuilder 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.
*
* PPiMapBuilder... | bottomPanel.setBackground(PMBUIStyle.focusActiveTabColor); | 4 |
welovecoding/editorconfig-netbeans | src/main/java/com/welovecoding/nbeditorconfig/mapper/EditorConfigPropertyMapper.java | [
"public class LoggerSettings {\n\n public static final Level OPERATION_LOG_LEVEL = Level.INFO;\n public static final Level PROCESSOR_LOG_LEVEL = Level.INFO;\n public static final Level LISTENER_LOG_LEVEL = Level.INFO;\n public static final Level MAPPER_LOG_LEVEL = Level.INFO;\n\n private LoggerSettings() {\n ... | import com.welovecoding.nbeditorconfig.config.LoggerSettings;
import com.welovecoding.nbeditorconfig.io.model.MappedCharset;
import com.welovecoding.nbeditorconfig.io.model.SupportedCharsets;
import com.welovecoding.nbeditorconfig.model.EditorConfigConstant;
import com.welovecoding.nbeditorconfig.model.MappedEditorConf... | package com.welovecoding.nbeditorconfig.mapper;
public class EditorConfigPropertyMapper {
private static final Logger LOG = Logger.getLogger(EditorConfigPropertyMapper.class.getName());
static { | LOG.setLevel(LoggerSettings.MAPPER_LOG_LEVEL); | 0 |
noctarius/castmapr | src/test/java/com/noctarius/castmapr/DistributedMapperClientMapReduceTest.java | [
"public interface MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n extends ExecutableMapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n{\n\n /**\n * Defines the mapper for this task. This method is not idempotent and is callable only one time. If called further\n * times an {@link IllegalStateExceptio... | import static org.junit.Assert.assertEquals;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Semaphore;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit... | }
Set<String> hazelcastNames = context.getHazelcastNames();
assertEquals( 4, hazelcastNames.size() );
}
@Test( timeout = 30000 )
public void testAsyncMapperReducerCollator()
throws Exception
{
Config config = buildConfig();
CountingManagedContext context... | public void map( Integer key, Integer value, Collector<String, Integer> collector ) | 3 |
digitalfondue/jfiveparse | src/main/java/ch/digitalfondue/jfiveparse/TreeConstructorAftersBeforeInitialInHead.java | [
"static final byte CHARACTER = 0;",
"static final byte COMMENT = 1;",
"static final byte DOCTYPE = 2;",
"static final byte END_TAG = 4;",
"static final byte EOF = 3;",
"static final byte START_TAG = 5;",
"static void genericRCDataParsing(TreeConstructor treeConstructor) {\n treeConstructor.insertHtml... | import static ch.digitalfondue.jfiveparse.TreeConstructor.CHARACTER;
import static ch.digitalfondue.jfiveparse.TreeConstructor.COMMENT;
import static ch.digitalfondue.jfiveparse.TreeConstructor.DOCTYPE;
import static ch.digitalfondue.jfiveparse.TreeConstructor.END_TAG;
import static ch.digitalfondue.jfiveparse.TreeCons... | /**
* Copyright © 2015 digitalfondue (info@digitalfondue.ch)
*
* 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... | if (tokenType == CHARACTER && Common.isTabLfFfCrOrSpace(treeConstructor.getChr())) { | 0 |
synapticloop/routemaster | src/main/java/synapticloop/nanohttpd/example/servant/RouteMasterRestServant.java | [
"public abstract class RestRoutable extends Routable {\n\tprotected List<String> restParamNames = new ArrayList<String>();\n\n\tpublic RestRoutable(String routeContext, List<String> params) {\n\t\tsuper(routeContext);\n\t\tthis.restParamNames = params;\n\t}\n\n\t/**\n\t * Serve the correct http method (GET, POST, P... | import fi.iki.elonen.NanoHTTPD.Response;
import java.io.File;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import synapticloop.nanohttpd.router.RestRoutable;
import synapticloop.nanohttpd.router.Routable;
import synapticloop.nanohttpd.router.RouteMaster;
import sy... | package synapticloop.nanohttpd.example.servant;
/*
* Copyright (c) 2013-2020 synapticloop.
*
* All rights reserved.
*
* This source code and any derived binaries are covered by the terms and
* conditions of the Licence agreement ("the Licence"). You may not use this
* source code or any derived binaries excep... | Router router = RouteMaster.getRouter(); | 3 |
DavidGoldman/MobSpawnControls2 | src/com/mcf/davidee/msc/gui/edit/EditCreatureTypeScreen.java | [
"@Mod(modid = \"MSC2\", name=\"Mob Spawn Controls 2\", dependencies = \"after:*\", version=MobSpawnControls.VERSION)\npublic class MobSpawnControls{\n\n\tpublic static final String VERSION = \"1.2.1\";\n\tpublic static final PacketPipeline DISPATCHER = new PacketPipeline();\n\t\n\t@SidedProxy(clientSide = \"com.mcf... | import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import com.mcf.davidee.guilib.basic.FocusedContainer;
import com.mcf.davidee.guilib.basic.Label;
import com.mcf.davidee.guilib.core.Button;
import com.mcf.davidee.guilib.core.Button.ButtonHandler;
import com.mcf.davidee.guilib... | package com.mcf.davidee.msc.gui.edit;
public class EditCreatureTypeScreen extends MSCScreen{
private CreatureTypePacket packet;
private Label title, arrow;
private Button close, save, move;
private Scrollbar scrollbar;
private Container labelContainer, masterContainer, creatureContainer;
private List<S... | MobSpawnControls.DISPATCHER.sendToServer(MSCPacket.getPacket(PacketType.CREATURE_TYPE, | 0 |
maker56/UltimateSurvivalGames | UltimateSurvivalGames/src/me/maker56/survivalgames/commands/arguments/ConfigArgument.java | [
"public class Helper {\r\n\r\n\tpublic static void showLobbyHelpsite(Player p) {\r\n\t\tp.sendMessage(MessageHandler.getMessage(\"prefix\") + \"Lobby Management §7§m---§r §6Helpsite\");\r\n\t\tfor(BaseComponent[] bc : lobby) {\r\n\t\t\tp.spigot().sendMessage(bc);\r\n\t\t}\r\n\t}\r\n\t\r\n\tpublic static void showCo... | import me.maker56.survivalgames.chat.Helper;
import me.maker56.survivalgames.commands.messages.MessageHandler;
import me.maker56.survivalgames.commands.permission.Permission;
import me.maker56.survivalgames.commands.permission.PermissionHandler;
import me.maker56.survivalgames.database.ConfigReloader;
import org.b... | package me.maker56.survivalgames.commands.arguments;
public class ConfigArgument {
private CommandSender sender;
private String[] args;
public ConfigArgument(CommandSender sender, String[] args) {
this.sender = sender;
this.args = args;
}
public boolean execute() {
if(!(sender instanc... | if(!PermissionHandler.hasPermission(p, Permission.CONFIG)) {
| 3 |
ZhuoKeTeam/MasterHelper | app/src/main/java/com/team/zhuoke/masterhelper/presenter/test/imp/TestPresenter.java | [
"public abstract class BasePresenter<V extends BaseView, M extends BaseModel> implements Presenter<V,M> {\n\n\n protected Context mContext;\n\n protected V mView;\n\n protected M mModel;\n\n protected CompositeSubscription mCompositeSubscription;\n\n protected void unSubscribe() {\n if (mCo... | import com.team.zhuoke.masterhelper.base.BasePresenter;
import com.team.zhuoke.masterhelper.model.test.TestList;
import com.team.zhuoke.masterhelper.model.test.TestModel;
import com.team.zhuoke.masterhelper.model.test.TestView;
import com.team.zhuoke.masterhelper.net.callback.RxSubscriber;
import com.team.zhuoke.master... | package com.team.zhuoke.masterhelper.presenter.test.imp;
/**
* 测试 presenter
*
* Created by WangQing on 2016/12/7.
*/
public class TestPresenter extends TestContract.Presenter {
@Override
public void getTestList() { | addSubscribe(mModel.testList(mContext).subscribe(new RxSubscriber<List<TestList>>() { | 1 |
CodeCrafter47/BungeeTabListPlus | bungee/src/main/java/codecrafter47/bungeetablistplus/managers/DataManager.java | [
"public class BungeeTabListPlus {\n\n /**\n * Holds an INSTANCE of itself if the plugin is enabled\n */\n private static BungeeTabListPlus INSTANCE;\n @Getter\n private final Plugin plugin;\n\n public PlayerProvider playerProvider;\n @Getter\n private EventExecutor mainThreadExecutor;\n... | import codecrafter47.bungeetablistplus.BungeeTabListPlus;
import codecrafter47.bungeetablistplus.bridge.BukkitBridge;
import codecrafter47.bungeetablistplus.data.BTLPBungeeDataKeys;
import codecrafter47.bungeetablistplus.data.ServerDataHolder;
import codecrafter47.bungeetablistplus.data.TrackingDataCache;
import codecr... | /*
* 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.
*
*... | public LocalDataCache createDataCacheForPlayer(BungeePlayer player) { | 5 |
mariok/pinemup | src/main/java/net/sourceforge/pinemup/ui/swing/menus/logic/NoteMenuLogic.java | [
"public final class CategoryManager {\n /** The pinboard, which contains all notes. **/\n private PinBoard pinBoard = new PinBoard();\n\n /** Listeners, which will be added per default to new notes. **/\n private final Collection<NoteChangedEventListener> defaultNoteChangedEventListeners = new LinkedList<>(... | import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JOptionPane;
import net.sourceforge.pinemup.core.CategoryManager;
import net.sourceforge.pinemup.core.i18n.I18N;
import net.sourceforge.pinemup.core.model.Note;
import net.sourceforge.pinemup.core.model.NoteColor;
import net.sou... | package net.sourceforge.pinemup.ui.swing.menus.logic;
public class NoteMenuLogic implements ActionListener {
public static final String ACTION_DELETE_NOTE = "DELETE_NOTE";
public static final String ACTION_TOGGLE_ALWAYS_ON_TOP = "TOGGLE_ALWAYS_ON_TOP";
public static final String ACTION_MOVE_NOTE_TO_CATEGOR... | note.setColor(NoteColor.getNoteColorByCode(colorCode)); | 3 |
suninformation/ymate-payment-v2 | ymate-payment-wxpay/src/main/java/net/ymate/payment/wxpay/controller/WxPayMWebController.java | [
"public interface IWxPay {\n\n String MODULE_NAME = \"payment.wxpay\";\n\n /**\n * @return 返回所属YMP框架管理器实例\n */\n YMP getOwner();\n\n /**\n * @return 返回模块配置对象\n */\n IWxPayModuleCfg getModuleCfg();\n\n /**\n * @return 返回模块是否已初始化\n */\n boolean isInited();\n\n /**\n ... | import org.apache.commons.lang.StringUtils;
import javax.servlet.http.HttpServletResponse;
import net.ymate.payment.wxpay.IWxPay;
import net.ymate.payment.wxpay.IWxPayEventHandler;
import net.ymate.payment.wxpay.WxPay;
import net.ymate.payment.wxpay.base.WxPayAccountMeta;
import net.ymate.payment.wxpay.request.WxPayUni... | /*
* Copyright 2007-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | IWxPayEventHandler _eventHandler = WxPay.get().getModuleCfg().getEventHandler(); | 1 |
bootique/bootique-job | bootique-job/src/test/java/io/bootique/job/scheduler/SchedulerIT.java | [
"public interface Job {\n\n\tJobMetadata getMetadata();\n\n\tJobResult run(Map<String, Object> params);\n}",
"public interface JobRegistry {\n\n /**\n * @deprecated since 3.0 in favor of {@link #getJobNames()}\n */\n default Set<String> getAvailableJobs() {\n return getJobNames();\n }\n\n ... | import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import java.util.Collection;
import java.util.Collections;
import static org.junit.jupiter.api.Assertions.*;
import io.bootique.BQRuntime;
import io.bootique.Bootique;
import io.bootique.BootiqueException;
import io.bootique.job.Job;
import io.... | /*
* Licensed to ObjectStyle LLC under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ObjectStyle LLC licenses
* this file to you under the Apache License, Version 2.0 (the
* "License"); you may not u... | .module(b -> JobModule.extend(b).addJob(ScheduledJob1.class).addListener(listener)) | 3 |
onepf/OPFPush | samples/pushchat/src/main/java/org/onepf/pushchat/ui/fragment/content/ContactsFragment.java | [
"public final class ContentDescriptor {\n\n private static final String AUTHORITY = \"org.onepf.pushchat.db.databaseContentProvider\";\n private static final Uri CONTENT_BASE_URI = new Uri.Builder()\n .scheme(ContentResolver.SCHEME_CONTENT)\n .authority(AUTHORITY)\n .build();\... | import android.content.DialogInterface;
import android.database.Cursor;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
... | /*
* Copyright 2012-2015 One Platform Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | private ContactsCursorAdapter adapter; | 2 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/GenericsResolutionUtils.java | [
"public class WildcardTypeImpl implements WildcardType {\n\n // ? extends T\n private final Type[] upperBounds;\n // ? super T\n private final Type[] lowerBounds;\n\n @SuppressWarnings(\"PMD.UseVarargs\")\n public WildcardTypeImpl(final Type[] upperBounds, final Type[] lowerBounds) {\n this... | import ru.vyarus.java.generics.resolver.context.container.WildcardTypeImpl;
import ru.vyarus.java.generics.resolver.error.GenericsResolutionException;
import ru.vyarus.java.generics.resolver.error.IncompatibleTypesException;
import ru.vyarus.java.generics.resolver.error.UnknownGenericException;
import ru.vyarus.java.ge... | package ru.vyarus.java.generics.resolver.util;
/**
* Generics analysis utilities.
*
* @author Vyacheslav Rusakov
* @since 11.05.2018
*/
// LinkedHashMap used instead of usual map to avoid accidental simple map usage (order is important!)
@SuppressWarnings({"PMD.LooseCoupling", "PMD.GodClass", "PMD.AvoidLiterals... | res = WildcardTypeImpl.upper(types.toArray(new Type[0])); | 0 |
cloudera/director-aws-plugin | tests/src/test/java/com/cloudera/director/aws/ec2/allocation/asg/AutoScalingGroupAllocatorTest.java | [
"@VisibleForTesting\nstatic final String AUTO_SCALING_GROUP_REQUEST_DURATION_MS = \"ec2.asg.requestDurationMilliseconds\";",
"@SuppressWarnings(\"Guava\")\npublic class AWSTimeouts {\n\n private final ImmutableMap<String, Long> timeouts;\n\n /**\n * Creates a new timeouts object from the given configuration. ... | import static com.cloudera.director.aws.ec2.EC2InstanceTemplate.EC2InstanceTemplateConfigurationPropertyToken.IMAGE;
import static com.cloudera.director.aws.ec2.EC2InstanceTemplate.EC2InstanceTemplateConfigurationPropertyToken.SECURITY_GROUP_IDS;
import static com.cloudera.director.aws.ec2.EC2InstanceTemplate.EC2Instan... | // (c) Copyright 2018 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... | Collection<EC2Instance> instances = autoScalingGroupAllocator.allocate(); | 3 |
CraftedCart/SMBLevelWorkshop | src/main/java/craftedcart/smblevelworkshop/ui/ExportOverlayUIScreen.java | [
"public class Window {\n\n public static SharedDrawable drawable;\n public static IUIScreen uiScreen;\n\n public static boolean running = true;\n\n public static String openGLVersion = \"OpenGL hasn't been initialized\";\n\n public static void init() throws LWJGLException, IOException, FontFormatExce... | import craftedcart.smblevelworkshop.Window;
import craftedcart.smblevelworkshop.project.ProjectManager;
import craftedcart.smblevelworkshop.resource.LangManager;
import craftedcart.smblevelworkshop.util.ExportManager;
import craftedcart.smblevelworkshop.util.ExportXMLManager;
import craftedcart.smblevelworkshop.util.Lo... | });
exportConfigButton.setOnLMBAction(() -> exportConfig(false));
listBox.addChildComponent("exportConfigButton", exportConfigButton);
final TextButton exportXMLConfigButton = new TextButton();
exportXMLConfigButton.setOnInitAction(() -> {
exportXMLConfigButton.setTo... | ExportXMLManager.writeXMLConfig(ProjectManager.getCurrentLevelData(), file); | 4 |
jajja/jorm | src/main/java/com/jajja/jorm/Dialect.java | [
"public static class Value {\n private Composite composite;\n private Object[] values;\n\n private Value(Composite composite, Object ... values) {\n this.composite = composite;\n this.values = values;\n }\n\n public Composite getComposite() {\n return composite;\n }\n\n pub... | import com.jajja.jorm.exceptions.DeadlockDetectedException;
import com.jajja.jorm.exceptions.ForeignKeyViolationException;
import com.jajja.jorm.exceptions.JormSqlException;
import com.jajja.jorm.exceptions.LockTimeoutException;
import com.jajja.jorm.exceptions.UniqueViolationException;
import java.sql.Connection;
impo... | //org.postgresql.core.Utils.appendEscapedLiteral()
//com.mysql.jdbc.StringUtils.escapeQuote
/*String brokenQuoteLiteral(String value) {
value = value.replace("'", "''");
if (DatabaseProduct.MYSQL.equals(databaseProduct)) {
value = value.replace("\\", "\\\\");
}
re... | throw new UniqueViolationException(database, sql, sqlException); | 6 |
douo/ActivityBuilder | compiler/src/main/java/info/dourok/compiler/generator/ConsumerGenerator.java | [
"public class EasyUtils {\n private Filer filer;\n private Messager messager;\n private Types types;\n private Elements elements;\n private TypeMirror string;\n private TypeMirror charSequence;\n private TypeMirror bundle;\n private TypeMirror arrayList;\n private TypeMirror parcelable;\n private TypeMirr... | import android.content.Intent;
import com.google.common.base.CaseFormat;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeNa... | package info.dourok.compiler.generator;
/**
* @author tiaolins
* @date 2017/9/5.
*/
public class ConsumerGenerator extends BaseActivityGenerator {
private TypeElement baseResultConsumer;
| private List<ResultModel> resultList; | 3 |
SunakazeKun/PMDe | src/com/aurum/mystery2/swing/ItemEditor.java | [
"public class BitConverter {\n public static int stringToInt(String value) {\n return value != null ? Integer.decode(value) : 0;\n }\n \n public static String toHexByteString(byte value) {\n return String.format(\"%02X\", value);\n }\n \n public static String toBinByteString(byte ... | import javax.swing.JSlider;
import javax.swing.JSpinner;
import javax.swing.JTextField;
import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants;
import com.aurum.mystery2.BitConverter;
import com.aurum.mystery2.Lists;
import com.aurum.mystery2.Main;
import com.aurum.mystery2.game.Item;
import com.aurum... | /*
* Copyright (C) 2016 - 2017 Aurum
*
* Mystery 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.
*
* Mystery is distributed in ... | selected = (Item) RomFile.current.items.get(list.getSelectedIndex()).clone(); | 4 |
tielei/AsyncProgrammingDemos | AndroidDemos/app/src/main/java/com/zhangtielei/demos/async/programming/multitask/http/mock/MockHttpService.java | [
"public interface HttpListener <T, R> {\n /**\n * 产生请求结果(成功或失败)时的回调接口.\n * @param apiUrl 请求URL\n * @param request 请求Model\n * @param result 请求结果(包括响应或者错误原因)\n * @param contextData 透传参数\n */\n void onResult(String apiUrl, T request, HttpResult<R> result, Object contextData);\n}",
"pub... | import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import android.os.Handler;
import android.os.Looper;
import com.zhangtielei.demos.async.programming.multitask.http.HttpListener;
import com.zhangtielei.demos.async.programming.multitask.http.HttpRes... | /*
* Copyright (C) 2016 Tielei Zhang (zhangtielei.com).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | public <T, R> void doRequest(final String apiUrl, final T request, final HttpListener<? super T, R> listener, final Object contextData) { | 0 |
mokies/ratelimitj | ratelimitj-redis/src/main/java/es/moki/ratelimitj/redis/request/RedisSlidingWindowRequestRateLimiter.java | [
"public interface ReactiveRequestRateLimiter {\n\n Mono<Boolean> overLimitWhenIncrementedReactive(String key);\n\n Mono<Boolean> overLimitWhenIncrementedReactive(String key, int weight);\n\n Mono<Boolean> geLimitWhenIncrementedReactive(String key);\n\n Mono<Boolean> geLimitWhenIncrementedReactive(String... | import es.moki.ratelimitj.core.limiter.request.ReactiveRequestRateLimiter;
import es.moki.ratelimitj.core.limiter.request.RequestLimitRule;
import es.moki.ratelimitj.core.limiter.request.RequestLimitRulesSupplier;
import es.moki.ratelimitj.core.limiter.request.RequestRateLimiter;
import es.moki.ratelimitj.core.time.Sys... | package es.moki.ratelimitj.redis.request;
@ParametersAreNonnullByDefault
@ThreadSafe
public class RedisSlidingWindowRequestRateLimiter implements RequestRateLimiter, ReactiveRequestRateLimiter {
private static final Logger LOG = LoggerFactory.getLogger(RedisSlidingWindowRequestRateLimiter.class);
private... | this(redisScriptingReactiveCommands, redisKeyCommands, rules, new SystemTimeSupplier()); | 4 |
vtsukur/take-a-REST | src/main/java/org/letustakearest/presentation/resources/BookingResource.java | [
"public interface BookingService {\n\n Booking create(Long roomId, BookingTransition data) throws EntityNotFoundException;\n\n Booking create(CreateBookingAsPlaceTransition data) throws EntityNotFoundException;\n\n Booking update(Booking booking, BookingTransition data) throws EntityNotFoundException;\n\n ... | import com.google.code.siren4j.Siren4J;
import com.theoryinpractise.halbuilder.api.RepresentationFactory;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.letustakearest.application.service.BookingService;
import org.letustakearest.dom... | package org.letustakearest.presentation.resources;
/**
* @author volodymyr.tsukur
*/
@Path("/{id}")
public class BookingResource {
private static final Log LOG = LogFactory.getLog(BookingResource.class);
@PathParam("id")
private Long id;
@Inject | private BookingService bookingService; | 0 |
orekyuu/Riho | src/net/orekyuu/riho/emotion/renderer/SurprisedRenderer.java | [
"public class LinearAnimation extends Animation {\n public LinearAnimation(Instant startTime, Duration duration) {\n super(startTime, duration);\n }\n\n public LinearAnimation(Instant startTime, Duration duration, Duration delay) {\n super(startTime, duration, delay);\n }\n\n @Override\... | import net.orekyuu.riho.animation.LinearAnimation;
import net.orekyuu.riho.character.ImageResources;
import net.orekyuu.riho.character.ImageUtil;
import net.orekyuu.riho.character.Loop;
import net.orekyuu.riho.character.Riho;
import net.orekyuu.riho.character.renderer.CharacterPosition;
import java.awt.*;
import java.a... | package net.orekyuu.riho.emotion.renderer;
public class SurprisedRenderer extends EmotionRendererBase {
private static final Duration ANIM_DURATION = Duration.ofMillis(1600);
private final BufferedImage image;
private final LinearAnimation fadeAnim = new LinearAnimation(Instant.now(), Duration.ofMillis(... | image = ImageResources.emotionSurprised(); | 1 |
winterstein/elasticsearch-java-client | test/com/winterwell/es/client/admin/PutMappingRequestBuilderTest.java | [
"public class ESTest {\n\n\t@BeforeClass\n\tpublic static void setupES() {\n\t\tESConfig config = ConfigFactory.get().getConfig(ESConfig.class);\n\t\tPrinter.out(config);\n\t}\n\t\n\tprotected static ESHttpClient getESJC() {\n//\t\tDep.setIfAbsent(ESConfig.class, new ESConfig()); done in setupES\n//\t\tESConfig esc... | import static org.junit.Assert.*;
import java.util.Map;
import org.junit.Test;
import com.winterwell.es.ESTest;
import com.winterwell.es.ESType;
import com.winterwell.es.client.ESHttpClient;
import com.winterwell.es.client.GetRequestBuilder;
import com.winterwell.es.client.GetResponse;
import com.winterwell.es.client.I... | package com.winterwell.es.client.admin;
public class PutMappingRequestBuilderTest extends ESTest {
@Test
public void testPutMappingRequestBuilder() { | ESHttpClient esjc = getESJC(); | 2 |
ebolwidt/cassowary-java | src/main/java/org/klomp/cassowary/awt/constraint/RightOfConstraint.java | [
"public class CL {\n protected final static boolean fDebugOn = false;\n public static boolean fTraceOn = false; // true;\n protected final static boolean fTraceAdded = false;\n protected final static boolean fGC = false;\n\n protected static void debugprint(String s) {\n System.err.println(s);... | import org.klomp.cassowary.CL;
import org.klomp.cassowary.CLInternalError;
import org.klomp.cassowary.ClSimplexSolver;
import org.klomp.cassowary.RequiredConstraintFailureException;
import org.klomp.cassowary.awt.component.ConstrComponent;
import org.klomp.cassowary.awt.component.SelPoint;
import org.klomp.cassowary.cl... | /*
* RightOf relational constraint. The target CC (the second) is to be
* right of the first (source) CC at all times, with respect to their bounding
* boxes.
*
* $Id: RightOfConstraint.java,v 1.4 1999/12/16 02:10:00 gjb Exp $
*
*/
package org.klomp.cassowary.awt.constraint;
public class RightOfConstraint e... | ClLinearInequality cli = new ClLinearInequality(sp.X(), CL.GEQ, srcCC.rightSP.X()); | 0 |
leerduo/travelinfo | DandelionPro/src/com/ustc/dystu/dandelion/EditNoteTitleActivity.java | [
"public class NoteInfo implements Serializable {\n\n\tpublic String note_id;\n\tpublic String note_uid;\n\tpublic String note_title;\n\tpublic String note_time_from;\n\tpublic String note_time_to;\n\tpublic String note_location;\n\tpublic String note_folder_url;\n\tpublic int note_is_suggest;\n\tpublic String[] wei... | import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.Vie... | package com.ustc.dystu.dandelion;
public class EditNoteTitleActivity extends Activity {private static final int REQUEST_UPDATE_NOTE_INFO = 0x1;
ImageView ivBack;
ImageView ivOK;
EditText etTitle;
TextView tvTitle;
NoteInfo mNoteInfo;
ProgressDialog pbProgress;
Handler mHandler = new Handler() {
@Override
pub... | new DandRequestListener(mHandler) { | 3 |
michael-rapp/AndroidMaterialValidation | example/src/main/java/de/mrapp/android/validation/example/MainActivity.java | [
"public final class Constraints {\n\n /**\n * Creates a new utility class, which provides factory methods, which allows to create various\n * validators.\n */\n private Constraints() {\n\n }\n\n /**\n * Creates and returns a constraint, which allows to negate the result of an other const... | import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import androidx.appcompat.app.AppCompatActivity;
import de.mrapp.android.validation.Constraints;
import de.mrapp.android.validation.EditText;
import de.mrapp.android.validation.PasswordEditText;
i... | /*
* Copyright 2015 - 2019 Michael Rapp
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | private Spinner genderSpinner; | 3 |
Doctoror/ParticlesDrawable | opengl/src/main/java/com/doctoror/particlesdrawable/opengl/renderer/GlSceneRendererLines.java | [
"@KeepAsApi\npublic final class Scene implements SceneConfiguration {\n\n private static final int COORDINATES_PER_VERTEX = 2;\n\n // The alpha value of the scene\n private int alpha = 255;\n\n private int density = Defaults.DENSITY;\n\n private int frameDelay = Defaults.FRAME_DELAY;\n\n @ColorInt... | import android.graphics.Color;
import android.opengl.GLES20;
import com.doctoror.particlesdrawable.model.Scene;
import com.doctoror.particlesdrawable.opengl.util.GLErrorChecker;
import com.doctoror.particlesdrawable.opengl.util.ShaderLoader;
import com.doctoror.particlesdrawable.util.DistanceResolver;
import com.doctor... | /*
* Copyright (C) 2018 Yaroslav Mytkalyk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or... | @NonNull final Scene scene, | 0 |
patka/cassandra-migration | cassandra-migration-spring-boot-starter/src/main/java/org/cognitor/cassandra/migration/spring/CassandraMigrationAutoConfiguration.java | [
"public class Database implements Closeable {\n private static final Logger LOGGER = LoggerFactory.getLogger(Database.class);\n\n /**\n * The name of the table that manages the migration scripts\n */\n private static final String SCHEMA_CF = \"schema_migration\";\n\n /**\n * The name of the ... | import com.datastax.oss.driver.api.core.CqlSession;
import org.cognitor.cassandra.migration.Database;
import org.cognitor.cassandra.migration.MigrationConfiguration;
import org.cognitor.cassandra.migration.MigrationRepository;
import org.cognitor.cassandra.migration.MigrationTask;
import org.cognitor.cassandra.migratio... | package org.cognitor.cassandra.migration.spring;
/**
* @author Patrick Kranz
*/
@Configuration
@EnableConfigurationProperties(CassandraMigrationConfigurationProperties.class)
@AutoConfigureAfter(CassandraAutoConfiguration.class)
@ConditionalOnClass(CqlSession.class)
public class CassandraMigrationAutoConfiguration ... | ScannerRegistry registry = new ScannerRegistry(); | 6 |
garfieldon757/video_management_system | src/com/adp/controller/AlgorithmController.java | [
"@Entity//声明当前类为hibernate映射到数据库中的实体�?\r\n@Table(name = \"Algorithm\")//声明在数据库中自动生成的表名为User\r\npublic class Algorithm {\r\n\r\n\t@Id//声明此列为主�?\r\n\t@GeneratedValue(strategy = GenerationType.AUTO)//根据不同数据库自动�?�择合�?�的id生成方案,这里使用mysql,为�?�增�?\r\n\tprivate Integer algorithmID;\r\n\t\r\n\tprivate String algorithmName;\r\... | import java.io.File;
import java.io.IOException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.io.FileUtils;
import org.springframework.bea... | package com.adp.controller;
@Controller
public class AlgorithmController {
@Autowired(required=true)
UserManager um;
@Autowired(required=true)
VideoManager vm;
@Autowired(required=true)
| AlgorithmManager am;
| 4 |
glenrobson/SimpleAnnotationServer | src/main/java/uk/org/llgc/annotation/store/contollers/StoreService.java | [
"public class PageAnnoCount {\n\tprotected int _count = 0;\n // These three properties should really be a canvas object...\n protected Canvas _canvas = null;\n\tprotected String _pageId = \"\";\n protected String _label = \"\";\n protected String _shortId = \"\";\n protected Manifest _manifest = null... | import javax.faces.bean.ManagedBean;
import javax.faces.bean.ApplicationScoped;
import javax.annotation.PostConstruct;
import uk.org.llgc.annotation.store.data.PageAnnoCount;
import uk.org.llgc.annotation.store.data.Manifest;
import uk.org.llgc.annotation.store.data.Canvas;
import uk.org.llgc.annotation.store.adapters.... | package uk.org.llgc.annotation.store.contollers;
@ApplicationScoped
@ManagedBean
public class StoreService {
protected StoreAdapter _store = null;
@PostConstruct
public void init() {
_store = StoreConfig.getConfig().getStore();
}
| public List<PageAnnoCount> getListAnnoPages() { | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.