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 |
|---|---|---|---|---|---|---|
feldim2425/OC-Minecarts | src/main/java/mods/ocminecart/common/component/ComputerCartController.java | [
"public class Settings {\n\t\n\tpublic static final String OC_ResLoc = \"opencomputers\"; // Resource domain for OpenComputers\n\tpublic static final String OC_Namespace = \"oc:\"; // Namespace for OpenComputers NBT Data\n\t\n\tpublic static float OC_SoundVolume;\n\tpublic static double OC_IC2PWR;\n\tpublic static ... | import li.cil.oc.api.API;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.*;
import mods.ocminecart.Settings;
import mods.ocminecart.common.minecart.ComputerCart;
import mods.ocminecart.common.util.InventoryUtil;
import mo... | package mods.ocminecart.common.component;
public class ComputerCartController implements ManagedEnvironment{
private Node node; | private ComputerCart cart; | 1 |
setial/intellij-javadocs | src/main/java/com/github/setial/intellijjavadocs/configuration/impl/JavaDocConfigurationImpl.java | [
"public interface JavaDocConfiguration {\n\n\n /**\n * The constant COMPONENT_NAME.\n */\n String COMPONENT_NAME = \"JavaDocConfiguration\";\n\n /**\n * The constant COMPONENT_VERSION.\n */\n String COMPONENT_CONFIG_VERSION = \"4.0.1\";\n\n /**\n * The constant COMPONENT_CONFIG_PA... | import com.github.setial.intellijjavadocs.configuration.JavaDocConfiguration;
import com.github.setial.intellijjavadocs.exception.SetupTemplateException;
import com.github.setial.intellijjavadocs.model.settings.JavaDocSettings;
import com.github.setial.intellijjavadocs.model.settings.Level;
import com.github.setial.int... | package com.github.setial.intellijjavadocs.configuration.impl;
/**
* The type Java doc configuration impl.
*
* @author Sergey Timofiychuk
*/
@State(
name = JavaDocConfiguration.COMPONENT_NAME,
storages = {
@Storage(value = COMPONENT_CONFIG_PATH)
}
)
public class JavaDocCo... | Set<Visibility> visibilities = new HashSet<>(); | 5 |
gr8pefish/OpenGlider | src/main/java/gr8pefish/openglider/common/item/ItemHangGliderAdvanced.java | [
"public class ItemHangGliderBase extends Item implements IGlider {\n\n //ToDo: NBT saving tags of upgrade (need IRecipe for them)\n\n private double horizSpeed;\n private double vertSpeed;\n private double shiftHorizSpeed;\n private double shiftVertSpeed;\n private double windMultiplier;\n priv... | import gr8pefish.openglider.api.item.ItemHangGliderBase;
import gr8pefish.openglider.client.model.ModelGlider;
import gr8pefish.openglider.common.OpenGlider;
import gr8pefish.openglider.common.config.ConfigHandler;
import gr8pefish.openglider.common.lib.ModInfo;
import net.minecraft.nbt.NBTTagCompound;
import static gr... | package gr8pefish.openglider.common.item;
public class ItemHangGliderAdvanced extends ItemHangGliderBase {
public ItemHangGliderAdvanced() { | super(ConfigHandler.advancedGliderHorizSpeed, ConfigHandler.advancedGliderVertSpeed, ConfigHandler.advancedGliderShiftHorizSpeed, ConfigHandler.advancedGliderShiftVertSpeed, ConfigHandler.advancedGliderWindModifier, ConfigHandler.advancedGliderAirResistance, ConfigHandler.advancedGliderTotalDurability, ModelGli... | 3 |
multi-os-engine/moe-plugin-gradle | src/main/java/org/moe/gradle/tasks/GenerateUIObjCInterfaces.java | [
"public class MoePlugin extends AbstractMoePlugin {\n\n private static final Logger LOG = Logging.getLogger(MoePlugin.class);\n\n private static final String MOE_ARCHS_PROPERTY = \"moe.archs\";\n\n @NotNull\n private MoeExtension extension;\n\n @NotNull\n @Override\n public MoeExtension getExte... | import org.gradle.api.GradleException;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.tasks.Input;
import org.gradle.api.tasks.InputDirectory;
import org.gradle.api.tasks.InputFiles;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.OutputFile;
import org.gradle.api.tasks.S... | public List<String> getOptions_ExcludeLibraries() {
return getMoeExtension().actionsAndOutlets.getExcludeLibraries();
}
@Override
protected void run() {
final IBActionAndOutletComposer composer = new IBActionAndOutletComposer();
FileUtils.classAndJarInputIterator(getInputFiles()... | SourceSet sourceSet = TaskUtils.getSourceSet(getMoePlugin(), SourceSet.MAIN_SOURCE_SET_NAME); | 6 |
ajitsing/Sherlock | sherlock/src/androidTest/java/com/singhajit/sherlock/crashes/CrashActivityTest.java | [
"public class Sherlock {\n private static final String TAG = Sherlock.class.getSimpleName();\n private static Sherlock instance;\n private final SherlockDatabaseHelper database;\n private final CrashReporter crashReporter;\n private AppInfoProvider appInfoProvider;\n\n private Sherlock(Context context) {\n ... | import android.content.Context;
import android.content.Intent;
import android.support.test.InstrumentationRegistry;
import android.support.test.rule.ActivityTestRule;
import com.singhajit.sherlock.R;
import com.singhajit.sherlock.core.Sherlock;
import com.singhajit.sherlock.core.database.CrashRecord;
import com.singhaj... | package com.singhajit.sherlock.crashes;
public class CrashActivityTest {
@Rule
public DatabaseResetRule databaseResetRule = new DatabaseResetRule();
@Rule
public ActivityTestRule<CrashActivity> rule = new ActivityTestRule<>(CrashActivity.class, true, false);
@Test
public void shouldRenderCrashDetail... | Sherlock.init(targetContext); | 0 |
JessYanCoding/MVPArt | demo/src/main/java/me/jessyan/mvpart/demo/mvp/ui/holder/UserItemHolder.java | [
"public abstract class BaseHolder<T> extends RecyclerView.ViewHolder implements View.OnClickListener {\r\n protected OnViewClickListener mOnViewClickListener = null;\r\n protected final String TAG = this.getClass().getSimpleName();\r\n\r\n public BaseHolder(View itemView) {\r\n super(itemView);\r\n ... | import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import me.jessyan.art.base.BaseHolder;
import me.jessyan.art.base.DefaultAdapter;
import me.jessyan.art.di.com... | /*
* Copyright 2017 JessYan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | private AppComponent mAppComponent; | 2 |
yuqirong/RxNews | app/src/main/java/com/yuqirong/rxnews/ui/fragment/NewsFragment.java | [
"public class Constant {\n\n public static final String BASE_URL = \"http://c.m.163.com\";\n\n // 头条\n public static final String HEADLINE_TYPE = \"headline\";\n // 北京\n public static final String LOCAL_TYPE = \"local\";\n // 房产\n public static final String HOUSE_TYPE = \"house\";\n // 其他\n ... | import android.app.ActivityOptions;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityOptionsCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManage... | package com.yuqirong.rxnews.ui.fragment;
/**
* Created by yuqirong on 2016/2/24.
*/
public class NewsFragment extends BaseFragment implements INewsView, NewsAdapter.OnItemClickListener, SwipeRefreshLayout.OnRefreshListener, AutoLoadRecyclerView.OnLoadingMoreListener {
@Bind(R.id.mRecyclerView)
AutoLoadRe... | Constant.Result result = newsEvent.getResult(); | 0 |
hburgmeier/jerseyoauth2 | jersey-oauth2-authsrv-impl/src/main/java/com/github/hburgmeier/jerseyoauth2/authsrv/impl/services/TokenService.java | [
"public interface IAuthCodeAccessTokenRequest extends IAccessTokenRequest {\n\t\n\tString getCode();\n\t\n\tString getRedirectUri();\n\t\n\tString getClientId();\n\t\n\tString getClientSecret();\n\n}",
"public enum OAuth2ErrorCode {\n\n\tINVALID_REQUEST(\"invalid_request\"),\n\tINVALID_GRANT(\"invalid_grant\"),\n... | import java.net.URI;
import java.net.URISyntaxException;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.hburgmeier.jerseyoauth2.api.protocol.IAccessTokenRequest;
import com.github.hburgmeier.jerseyoauth2.api.pro... | package com.github.hburgmeier.jerseyoauth2.authsrv.impl.services;
public class TokenService implements ITokenService {
private static final String SERVER_ERROR_DESCRIPTION = "Server error";
private static final Logger LOGGER = LoggerFactory.getLogger(TokenService.class);
private final IAccessTok... | private final IClientService clientService;
| 4 |
TeamAmeriFrance/Guide-API | src/main/java/amerifrance/guideapi/page/PageTextImage.java | [
"public class Book {\n\n private static final String GUITEXLOC = \"guideapi:textures/gui/\";\n\n private List<CategoryAbstract> categories = Lists.newArrayList();\n private String title = \"item.GuideBook.name\";\n private String header = title;\n private String itemName = title;\n private String ... | import amerifrance.guideapi.api.impl.Book;
import amerifrance.guideapi.api.impl.Page;
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
import amerifrance.guideapi.api.util.GuiHelper;
import amerifrance.guideapi.gui.GuiBase;
import net.min... | package amerifrance.guideapi.page;
public class PageTextImage extends Page {
public PageText pageText;
public ResourceLocation image;
public boolean drawAtTop;
/**
* @param draw - Localized text to draw
* @param image - Image to draw
* @param drawAtTop - Draw Image at top and... | public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj) { | 0 |
izenecloud/laser | src/main/java/io/izenecloud/larser/framework/LaserOfflineTrainTask.java | [
"public class AdmmOptimizerDriver {\n\tprivate static final int DEFAULT_ADMM_ITERATIONS_MAX = 2;\n\tprivate static final float DEFAULT_REGULARIZATION_FACTOR = 0.000001f;\n\tprivate static final String ITERATION_FOLDER_NAME = \"iteration_\";\n\tpublic static final String FINAL_MODEL = \"FINAL_MODEL\";\n\n\tpublic st... | import io.izenecloud.admm.AdmmOptimizerDriver;
import io.izenecloud.conf.Configuration;
import io.izenecloud.couchbase.CouchbaseConfig;
import io.izenecloud.larser.feature.LaserMessageConsumer;
import io.izenecloud.larser.offline.precompute.Compute;
import io.izenecloud.larser.offline.topn.LaserOfflineResultWriter;
imp... | package io.izenecloud.larser.framework;
public class LaserOfflineTrainTask implements Job {
private static final Logger LOG = LoggerFactory
.getLogger(LaserOfflineTrainTask.class);
public void execute(JobExecutionContext context)
throws JobExecutionException {
String collection = context.getJobDetail()... | final LaserMessageConsumer consumeTask = (LaserMessageConsumer) context | 3 |
GoogleCloudPlatform/gcs-uploader | app-desktop/src/main/java/com/google/ce/media/contentuploader/exec/BlobUploadTask.java | [
"public class AnalyticsMessage {\n //required fields\n private String guid;\n private Type type;\n private String timestamp;\n private Integer index;\n private String username;\n private TaskStatus status;\n private Event event;\n private String blobId;\n private String bucket;\n private String objectNam... | import com.google.ce.media.contentuploader.message.AnalyticsMessage;
import com.google.ce.media.contentuploader.message.TaskInfo;
import com.google.ce.media.contentuploader.message.TaskStatus;
import com.google.ce.media.contentuploader.message.Tasklet;
import com.google.ce.media.contentuploader.utils.DateUtils;
import ... | /*
* 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 ... | AnalyticsMessage m1 = AnalyticsMessage.from(taskInfo.getAuthConfig().getAuthInfo(), | 0 |
msoute/vertx-deploy-tools | vertx-deploy-agent/src/main/java/nl/jpoint/vertx/deploy/agent/service/DeployApplicationService.java | [
"public class DeployConfig {\n\n private static final Logger LOG = LoggerFactory.getLogger(AwsDeployApplication.class);\n\n private static final String MAVEN_CENTRAL = \"https://repo1.maven.org/maven/\";\n private static final String DEFAULT_SERVICE_CONFIG_LOCATION = \"/etc/default/\";\n\n private stati... | import io.vertx.core.Vertx;
import io.vertx.rxjava.core.file.FileSystem;
import nl.jpoint.vertx.deploy.agent.DeployConfig;
import nl.jpoint.vertx.deploy.agent.command.RunApplication;
import nl.jpoint.vertx.deploy.agent.command.StopApplication;
import nl.jpoint.vertx.deploy.agent.request.DeployApplicationRequest;
import... | package nl.jpoint.vertx.deploy.agent.service;
public class DeployApplicationService implements DeployService<DeployApplicationRequest, DeployApplicationRequest> {
private static final Logger LOG = LoggerFactory.getLogger(DeployApplicationService.class);
private final DeployConfig config;
private final V... | LOG.info("[{} - {}]: Module '{}' running : {}, sameVersion : {}.", LogConstants.DEPLOY_REQUEST, deployApplicationRequest.getId(), deployApplicationRequest.getModuleId(), deployApplicationRequest.isInstalled(), deployApplicationRequest.isInstalled()); | 5 |
RestNEXT/restnext | restnext-server/src/main/java/org/restnext/server/ServerHandler.java | [
"public final class MediaType {\n\n private static final String TYPE_WILDCARD = \"*\";\n\n private static final String TOKEN = \"([a-zA-Z0-9-!#$%&'*+.^_`{|}~]+)\";\n private static final String QUOTED = \"\\\"([^\\\"]*)\\\"\";\n private static final Pattern TYPE_SUBTYPE = Pattern.compile(TOKEN + \"/\" + TOKEN);... | import static org.restnext.core.http.Response.Status.BAD_REQUEST;
import static org.restnext.core.http.Response.Status.INTERNAL_SERVER_ERROR;
import static org.restnext.core.http.Response.Status.METHOD_NOT_ALLOWED;
import static org.restnext.core.http.Response.Status.NOT_FOUND;
import static org.restnext.core.http.Resp... | /*
* Copyright (C) 2016 Thiago Gutenberg Carvalho da Costa
*
* 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 ... | .orElse(Response.noContent().build()), request.isKeepAlive()); | 4 |
corenting/EDCompanion | app/src/main/java/fr/corenting/edcompanion/singletons/RetrofitSingleton.java | [
"public class EDSMSystemInformationResponse {\n @SerializedName(\"allegiance\")\n public String Allegiance;\n\n @SerializedName(\"security\")\n public String Security;\n\n @SerializedName(\"government\")\n public String Government;\n\n @SerializedName(\"economy\")\n public String Economy;\n}... | import android.content.Context;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.io.Serializable;
import java.util.concurrent.TimeUnit;
import fr.corenting.edcompanion.R;
import fr.corenting.edcompanion.models.apis.EDSM.EDSMSystemInformationResponse;
import fr.corenting.edcompanion.models.ap... | package fr.corenting.edcompanion.singletons;
// Singleton safe from serialization/reflection...
// From https://medium.com/exploring-code/how-to-make-the-perfect-singleton-de6b951dfdb0
public class RetrofitSingleton implements Serializable {
private static volatile RetrofitSingleton instance;
private EDSM... | private EDApiRetrofit edApiRetrofit; | 2 |
SailFlorve/RunHDU | app/src/main/java/com/cxsj/runhdu/RunDetailsActivity.java | [
"public class BaseModel {\n\n protected static final String TAG = \"\";\n\n static final String CONNECT_FAILED = \"网络连接失败。\";\n static final String RETURN_DATA_ERROR = \"服务器数据出错。\";\n\n static Handler mHandler = new Handler(Looper.getMainLooper());\n\n public interface BaseCallback {\n void on... | import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Lin... | package com.cxsj.runhdu;
/**
* 跑步数据详情页面
*/
public class RunDetailsActivity extends BaseActivity {
private TextView disText; | private NumberView stepNumber; | 6 |
Nike-Inc/wingtips | wingtips-apache-http-client/src/main/java/com/nike/wingtips/apache/httpclient/WingtipsHttpClientBuilder.java | [
"@SuppressWarnings(\"WeakerAccess\")\npublic class Tracer {\n\n /**\n * The options for how {@link Span} objects are represented when they are completed. To change how {@link Tracer} serializes spans when logging them\n * call {@link #setSpanLoggingRepresentation(SpanLoggingRepresentation)}.\n */\n ... | import com.nike.internal.util.StringUtils;
import com.nike.wingtips.Span;
import com.nike.wingtips.Span.SpanPurpose;
import com.nike.wingtips.Tracer;
import com.nike.wingtips.apache.httpclient.tag.ApacheHttpClientTagAdapter;
import com.nike.wingtips.apache.httpclient.util.WingtipsApacheHttpClientUtil;
import com.nike.w... | package com.nike.wingtips.apache.httpclient;
/**
* (NOTE: This class is strongly recommended instead of {@link WingtipsApacheHttpClientInterceptor} if you have
* control over which {@link HttpClientBuilder} is used to create your {@link HttpClient}s. Reasons for this are
* described at the bottom of this class ... | protected HttpTagAndSpanNamingStrategy<HttpRequest, HttpResponse> tagAndNamingStrategy; | 3 |
kefik/MsPacMan-vs-Ghosts-AI | PacMan-vs-Ghosts-Agents/src/game/controllers/pacman/examples/NearestPillPacMan.java | [
"public class PacManSimulator {\n\t\n\tpublic static class GameConfig {\n\t\t\n\t\tpublic int seed = -1;\n\t\t\n\t\t/**\n\t\t * Whether POWER PILLS should be present within the environment.\n\t\t */\n\t\tpublic boolean powerPillsEnabled = true;\n\t\t\n\t\t/**\n\t\t * Total percentage of PILLS present within the lev... | import game.PacManSimulator;
import game.controllers.ghosts.game.GameGhosts;
import game.controllers.pacman.PacManHijackController;
import game.core.G;
import game.core.Game; | package game.controllers.pacman.examples;
public class NearestPillPacMan extends PacManHijackController
{
@Override | public void tick(Game game, long timeDue) { | 4 |
lvanyal/directly | app/src/main/java/com/iph/directly/presenter/NewToiletPresenter.java | [
"public interface AuthRepository {\n boolean isSignedIn();\n\n void signOut();\n\n String getUserId();\n}",
"public interface LocationRepository {\n Observable<Location> getCurrentLocation();\n\n Observable<Location> getLocationFromLatLng(double latitude, double longitude);\n\n Observable<Toilet... | import android.text.TextUtils;
import com.directly.iph.directly.R;
import com.google.android.gms.location.places.Place;
import com.google.android.gms.maps.model.LatLng;
import com.iph.directly.domain.AuthRepository;
import com.iph.directly.domain.LocationRepository;
import com.iph.directly.domain.ToiletRepository;
impo... | package com.iph.directly.presenter;
/**
* Created by vanya on 10/26/2016.
*/
public class NewToiletPresenter {
private String currentUserId;
private NewToiletView newToiletView;
private ToiletRepository toiletRepository; | private LocationRepository locationRepository; | 1 |
jacobhyphenated/PokerServer | src/main/java/com/hyphenated/card/util/PlayerUtil.java | [
"@Entity\n@Table(name=\"hand\")\npublic class HandEntity implements Serializable {\n\t\n\tprivate static final long serialVersionUID = 4557343585146763024L;\n\tprivate long id;\n\tprivate Game game;\n\tprivate BoardEntity board;\n\tprivate Set<PlayerHand> players;\n\tprivate Player currentToAct;\n\tprivate BlindLev... | import com.hyphenated.card.domain.HandEntity;
import com.hyphenated.card.domain.Player;
import com.hyphenated.card.domain.PlayerHand;
import com.hyphenated.card.eval.HandRank;
import com.hyphenated.card.eval.HandRankEvaluator;
import com.hyphenated.card.eval.TwoPlusTwoHandEvaluator;
import com.hyphenated.card.holder.Bo... | /*
The MIT License (MIT)
Copyright (c) 2013 Jacob Kanipe-Illig
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, m... | HandRank highestRank = null; | 3 |
twilmes/sql-gremlin | src/main/java/org/twilmes/sql/gremlin/adapter/converter/SqlMetadata.java | [
"@AllArgsConstructor\npublic class GremlinSchema extends AbstractSchema {\n private final List<GremlinVertexTable> vertices;\n private final List<GremlinEdgeTable> edges;\n\n @Override\n protected Map<String, Table> getTableMap() {\n final ImmutableMap.Builder<String, Table> builder = ImmutableMa... | import lombok.Getter;
import org.apache.calcite.sql.SqlAggFunction;
import org.apache.calcite.sql.SqlCall;
import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.sql.SqlNodeList;
import org.apache.calcite.sql.SqlOperator;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
im... | /*
* 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 ... | private final GremlinSchema gremlinSchema; | 0 |
GoogleCloudPlatform/bigquery-data-lineage | src/main/java/com/google/cloud/solutions/datalineage/transform/LineageExtractionTransform.java | [
"static ZetaSqlSchemaLoaderFactory emptyLoaderFactory() {\n return () -> null;\n}",
"public final class InsertJobTableLineageExtractor extends LineageExtractor {\n\n private static final String JOB_ID = \"$.protoPayload.resourceName\";\n private static final String JOB_TYPE = \"$.protoPayload.metadata.jobChang... | import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.transforms.SerializableFunction;
import org.apache.beam.sdk.values.PCollection;
import static com.google.cloud.solutions.datalineage.service.ZetaSqlSchemaLoaderFactory.emptyLoaderFactory;
import com.google.auto.value.AutoValue;
import com.google.cl... | /*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | public abstract ZetaSqlSchemaLoaderFactory getZetaSqlSchemaLoaderFactory(); | 4 |
raycoarana/awex | awex-core/src/main/java/com/raycoarana/awex/Promise.java | [
"public interface AlwaysCallback {\n\n void onAlways();\n\n}",
"public interface CancelCallback {\n\n void onCancel();\n\n}",
"public interface DoneCallback<T> {\n\n void onDone(T result);\n\n}",
"public interface FailCallback {\n\n void onFail(Exception exception);\n\n}",
"public interface Prog... | import com.raycoarana.awex.callbacks.AlwaysCallback;
import com.raycoarana.awex.callbacks.CancelCallback;
import com.raycoarana.awex.callbacks.DoneCallback;
import com.raycoarana.awex.callbacks.FailCallback;
import com.raycoarana.awex.callbacks.ProgressCallback;
import com.raycoarana.awex.callbacks.ThenCallback;
import... | package com.raycoarana.awex;
public interface Promise<Result, Progress> {
/**
* State: Task associated with this promise is executing and did not finish already
*/
int STATE_PENDING = 0;
/**
* State: Task associated with this promise has finish executing and have a result
*/
int... | Promise<Result, Progress> progress(ProgressCallback<Progress> callback); | 4 |
jinkg/UAFClient | fidoclient/src/main/java/com/yalin/fidoclient/api/UAFClientApi.java | [
"public class AsmInfo {\n public String appName;\n public String pack;\n public Drawable icon;\n\n public AsmInfo appName(String appName) {\n this.appName = appName;\n return this;\n }\n\n public AsmInfo pack(String pack) {\n this.pack = pack;\n return this;\n }\n\n ... | import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.text.TextUtils;
import com.yalin.fidoclient.msg.AsmInfo;
import com.yalin.fidoclient.msg.DeregisterAuthenticator;
import com.yalin.fidoclient.msg.Dere... | /*
* Copyright 2016 YaLin Jin
*
* 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 ... | public static DeregistrationRequest[] getDeRegistrationRequests(RegRecord regRecord) { | 2 |
fabmax/LightGL | LightGlLib/src/main/java/de/fabmax/lightgl/scene/DynamicMesh.java | [
"public class LightGlContext {\n\n protected final GfxEngine mEngine;\n protected final GfxState mState;\n protected final ShaderManager mShaderManager;\n protected final TextureManager mTextureManager;\n\n /**\n * Creates a new LightGlContext for the given {@link GfxEngine}.\n *\n * @par... | import android.util.Log;
import java.nio.ShortBuffer;
import de.fabmax.lightgl.LightGlContext;
import de.fabmax.lightgl.ShaderAttributeBinder;
import de.fabmax.lightgl.util.BufferHelper;
import de.fabmax.lightgl.util.IntList;
import de.fabmax.lightgl.util.MeshBuilder;
import de.fabmax.lightgl.util.MeshData;
import de.f... | package de.fabmax.lightgl.scene;
/**
* A dynamic (modifiable) mesh.
*
* @author fth
*/
public class DynamicMesh extends Mesh {
private static final String TAG = "DynamicMesh";
protected final int mGlPrimitiveType;
protected final ShortBuffer mIndexBuffer;
protected final PackedVertexBuffer ... | public void updateMeshData(MeshBuilder builder) { | 4 |
optimaize/command4j | src/main/java/com/optimaize/command4j/ext/extensions/loadlimit/maxconcurrent/MaxConcurrentRunningExtension.java | [
"public interface Command<A, R> {\n\n /**\n * Runs the remote command.\n *\n * <p>This method always blocks until either the command finishes successfully, aborts by throwing an\n * exception, or is cancelled early. (The {@link CommandExecutorService} allows you to execute\n * commands in a n... | import com.google.common.base.Function;
import com.google.common.base.Optional;
import com.google.common.base.Stopwatch;
import com.optimaize.command4j.Command;
import com.optimaize.command4j.ExecutionContext;
import com.optimaize.command4j.Mode;
import com.optimaize.command4j.ModeExtension;
import com.optimaize.comman... | package com.optimaize.command4j.ext.extensions.loadlimit.maxconcurrent;
/**
* Counts the number of pending requests and waits or throws until a slot becomes available.
*
* <p>Use Cases:
* This extension may come in handy to prevent overload when you're <b>not in direct control</b> over the executed
* commands o... | public R call(@NotNull Optional<A> arg, @NotNull ExecutionContext ec) throws Exception { | 1 |
utapyngo/owl2vcs | src/main/java/owl2vcs/analysis/ConflictFinder.java | [
"public abstract class PrefixChangeData extends CustomOntologyChangeData {\r\n\r\n private static final long serialVersionUID = -1862023752748180868L;\r\n\r\n private final String prefixName;\r\n private final String prefix;\r\n\r\n public PrefixChangeData(String prefixName, String prefix) {\r\n ... | import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.semanticweb.owlapi.change.AxiomChangeData;
import org.semanticweb.owlapi.model.OWLAnonymousIndividual;
import org.semanticweb.owlapi.model.OWLEntity;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.ow... | package owl2vcs.analysis;
/**
* This class is used to classify changes into 3 categories: - common changes
* (if it happens to both parties to make same changes); - conflicting changes
* (which have links to common ontology elements); - other changes
* (non-conflicting).
*
*/
public class Conflict... | common = ChangeSetUtils
| 4 |
Bernardo-MG/repository-pattern-java | src/test/java/com/wandrell/pattern/test/integration/repository/access/postgresql/eclipselink/ITModifyPostgreSqlEclipselinkJpaRepository.java | [
"public class PersistenceContextPaths {\n\n /**\n * Eclipselink JPA persistence.\n */\n public static final String ECLIPSELINK = \"classpath:context/persistence/jpa-eclipselink.xml\";\n\n /**\n * Hibernate JPA persistence.\n */\n public static final String HIBERNATE = \"classpath:context... | import com.wandrell.pattern.test.util.config.properties.DatabaseScriptsPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.JdbcPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.JpaPropertiesPaths;
import com.wandrell.pattern.test.util.config.properties.PersistenceProviderProp... | /**
* The MIT License (MIT)
* <p>
* Copyright (c) 2015 the original author or authors.
* <p>
* 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 limi... | extends AbstractITModify { | 7 |
qibin0506/Glin | glinsample/src/main/java/org/loader/glinsample/utils/Net.java | [
"public class Glin {\n private Builder mBuilder;\n private CallFactory mCallFactory;\n\n private Glin(Builder builder) {\n mBuilder = builder;\n mCallFactory = new CallFactory();\n }\n\n @SuppressWarnings(\"unchecked\")\n public <T> T create(Class<T> klass, Object tag) {\n ret... | import android.os.Environment;
import android.util.Log;
import org.loader.glin.Glin;
import org.loader.glin.cache.DefaultCacheProvider;
import org.loader.glin.chan.GlobalChanNode;
import org.loader.glin.chan.LogChanNode;
import org.loader.glin.helper.LogHelper;
import org.loader.okclient.OkClient; | package org.loader.glinsample.utils;
public class Net {
private static final LogHelper.LogPrinter printer = new LogHelper.LogPrinter() {
@Override
public void print(String tag, String content) {
Log.d(tag, content);
}
};
private static Glin glin;
public static G... | .client(new OkClient()) | 5 |
danisola/restify | url/src/test/java/com/danisola/restify/url/types/IntVarTest.java | [
"public class RestParser {\n\n private final Pattern pathPattern;\n private final VarType[] pathTypes;\n private final ParamVar[] paramVars;\n private final int numVars;\n\n RestParser(Pattern pathPattern, VarType[] pathTypes, ParamVar[] paramVars, int numVars) {\n this.pathPattern = pathPatte... | import com.danisola.restify.url.RestParser;
import com.danisola.restify.url.RestUrl;
import org.junit.Test;
import static com.danisola.restify.url.RestParserFactory.parser;
import static com.danisola.restify.url.matchers.IsInvalid.isInvalid;
import static com.danisola.restify.url.matchers.IsValid.isValid;
import static... | package com.danisola.restify.url.types;
public class IntVarTest {
@Test
public void whenNegIntIsCorrectThenIntegerIsReturned() {
RestParser parser = parser("/users/{}", intVar("userId"));
RestUrl url = parser.parse("http://www.mail.com/users/-2397");
assertThat(url, isValid());
... | assertThat(url, isInvalid()); | 3 |
LTTPP/Eemory | org.lttpp.eemory/src/org/lttpp/eemory/exception/EDAMUserExceptionHandler.java | [
"public final class Constants {\n\n private Constants() {\n\n }\n\n public static final String EVERNOTE_INTERNATIONAL = \"Evernote International\";\n public static final String EVERNOTE_YINXIANG = \"印象笔记\";\n public static final String EVERNOTE_SANDBOX = \"Evernote Sandbox\";\n\n // Command IDs\n ... | import java.util.LinkedHashMap;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnabl... | package org.lttpp.eemory.exception;
public class EDAMUserExceptionHandler {
private boolean reauthorized = false;
public IStatus handleRuntime(final Shell shell, final EDAMUserException e, final EeClipper clipper) {
if (e.getErrorCode() == EDAMErrorCode.AUTH_EXPIRED) {
Display.getDefau... | IDialogSettingsUtil.set(Constants.PLUGIN_SETTINGS_KEY_TOKEN, EncryptionUtil.encrypt(token)); | 5 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/processing/classic/TabularResultResponseProcessor.java | [
"public final class HeaderDefinition {\n private static Logger s_logger = LoggerFactory.getLogger(HeaderDefinition.class);\n private final Map<String, Integer> _columnNamesToIndices = new LinkedHashMap<String, Integer>();\n private final List<String> _columnNames;\n\n private HeaderDefinition(final List<String>... | import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.jimmoores.quandl.HeaderDefinition;
import com.jimmoores.quandl.Row;
import com.jimmoores.quandl.TabularResult;
import com.jimmoores.quandl.proc... | package com.jimmoores.quandl.processing.classic;
/**
* ReponseProcessor to process an input stream reply from a query into
* a TabularResult object.
*/
public class TabularResultResponseProcessor implements ResponseProcessor<TabularResult> {
/**
* {@inheritDoc}
*/
public TabularResult process(final Inp... | List<Row> rows = new ArrayList<Row>(); | 1 |
TeamAmeriFrance/Guide-API | src/main/java/amerifrance/guideapi/api/impl/Page.java | [
"public interface IPage {\n\n @SideOnly(Side.CLIENT)\n void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj);\n\n @SideOnly(Side.CLIENT)\n void drawExtras(Book book, CategoryAbstract category, ... | import amerifrance.guideapi.api.IPage;
import amerifrance.guideapi.api.impl.abstraction.CategoryAbstract;
import amerifrance.guideapi.api.impl.abstraction.EntryAbstract;
import amerifrance.guideapi.gui.GuiBase;
import amerifrance.guideapi.gui.GuiEntry;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.... | package amerifrance.guideapi.api.impl;
public class Page implements IPage {
protected boolean unicode;
@Override
@SideOnly(Side.CLIENT) | public void draw(Book book, CategoryAbstract category, EntryAbstract entry, int guiLeft, int guiTop, int mouseX, int mouseY, GuiBase guiBase, FontRenderer fontRendererObj) { | 2 |
digitalpetri/ethernet-ip | cip-core/src/main/java/com/digitalpetri/enip/cip/services/GetAttributeListService.java | [
"public class CipResponseException extends Exception {\n\n private final int generalStatus;\n private final int[] additionalStatus;\n\n public CipResponseException(int generalStatus, int[] additionalStatus) {\n this.generalStatus = generalStatus;\n this.additionalStatus = additionalStatus;\n ... | import com.digitalpetri.enip.cip.CipResponseException;
import com.digitalpetri.enip.cip.epath.EPath.PaddedEPath;
import com.digitalpetri.enip.cip.structs.AttributeResponse;
import com.digitalpetri.enip.cip.structs.MessageRouterRequest;
import com.digitalpetri.enip.cip.structs.MessageRouterResponse;
import io.netty.buff... | package com.digitalpetri.enip.cip.services;
public class GetAttributeListService implements CipService<AttributeResponse[]> {
public static final int SERVICE_CODE = 0x03;
private final PaddedEPath requestPath;
private final int[] attributeIds;
private final int[] attributeSizes;
public GetAttri... | MessageRouterResponse response = MessageRouterResponse.decode(buffer); | 4 |
kwanghoon/MySmallBasic | MySmallBasic/src/com/coducation/smallbasic/lib/Shapes.java | [
"public class ArrayV extends Value {\r\n\tpublic ArrayV(){\r\n\t\tarrmap = new LinkedHashMap<String, Pair<String,Value>>();\r\n\t}\r\n\t\r\n\t\r\n\tpublic Value get(String index) {\r\n\t\tPair<String,Value> psv = arrmap.get(index.toUpperCase());\r\n\t\treturn psv==null ? null : psv.b;\r\n\t}\r\n\r\n\tpublic void pu... | import java.util.ArrayList;
import com.coducation.smallbasic.ArrayV;
import com.coducation.smallbasic.DoubleV;
import com.coducation.smallbasic.InterpretException;
import com.coducation.smallbasic.StrV;
import com.coducation.smallbasic.Value;
| package com.coducation.smallbasic.lib;
public class Shapes {
public static Value AddRectangle(ArrayList<Value> args) {
// width, height
// GraphicsWiindow에 사각형을 추가한 창을 반환
if (args.size() == 2) {
int width, height;
if (args.get(0) instanceof DoubleV) {
width = (int) ((DoubleV) args.get... | } else if (args.get(0) instanceof StrV && ((StrV) args.get(0)).isNumber()) {
| 3 |
elminsterjimmy/XBoxApi | RESTfulShell/src/main/java/com/elminster/restful/service/UserGameServiceImpl.java | [
"public interface IGameDao extends JpaRepository<Game, String> {\n public Game findByGameId(String gameId);\n}",
"@Repository\npublic interface IPlatformDao extends JpaRepository<Platform, String> {\n\n public Platform findByPlatform(String platform);\n}",
"@Repository\npublic interface ITrophyDao extends Jpa... | import java.util.ArrayList;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elminster.common.util.CollectionUtil;
import com.elminster.restful.dao.IGameDao;
import com.elminster.restfu... | package com.elminster.restful.service;
@Service
@Transactional
public class UserGameServiceImpl implements IUserGameService {
/** the XBOX API. */
private static final IXboxApi API = new XboxApiImpl();
private final ITrophyDao trohpyDao;
private final IGameDao gameDao;
private final IPlatform... | public List<XblUserGame> getUserGameList(String username) throws ServiceException { | 6 |
sumeetchhetri/gatf | alldep-jar/src/main/java/com/gatf/ui/GatfTestCaseHandler.java | [
"public class AcceptanceTestContext {\r\n\r\n\tprivate Logger logger = Logger.getLogger(AcceptanceTestContext.class.getSimpleName());\r\n\t\r\n\tpublic final static String\r\n\t PROP_SOAP_ACTION_11 = \"SOAPAction\",\r\n\t PROP_SOAP_ACTION_12 = \"action=\",\r\n\t PROP_CONTENT_TYPE = \"Content-Type\",\r\n\t ... | import java.io.File;
import java.io.FileOutputStream;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
i... | /*
Copyright 2013-2019, Sumeet Chhetri
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... | TestCase testCase = WorkflowContextHandler.OM.readValue(request.getInputStream(),
| 3 |
hawkular/hawkular-android-client | mobile/src/main/java/org/hawkular/client/android/activity/TriggerSetupActivity.java | [
"public final class BackendClient {\n\n private final Activity activity;\n private final Fragment fragment;\n\n @NonNull\n @RequiresPermission(Manifest.permission.INTERNET)\n public static BackendClient of(@NonNull Activity activity) {\n return new BackendClient(activity, null);\n }\n\n ... | import android.content.DialogInterface;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import ... | /*
* Copyright 2015-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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://w... | FullTrigger trigger = null; | 3 |
occi4java/occi4java | http/src/main/java/occi/http/OcciRestNetworkInterface.java | [
"public class OcciConfig extends XMLConfiguration {\n\tprivate static final long serialVersionUID = 1L;\n\tprivate static final Logger LOGGER = LoggerFactory\n\t\t\t.getLogger(OcciConfig.class);\n\t/**\n\t * Instance of OcciConfig\n\t */\n\tprivate static OcciConfig instance = null;\n\tprivate static ConfigurationF... | import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.UUID;
import occi.config.OcciConfig;
import occi.core.Kind;
import occi.core.Mixin;
import occi.http.check.OcciCheck;
import occi.infrastructure.Network;
import occi.infrastructure.Network.State;... | /**
* Copyright (C) 2010-2011 Sebastian Heckmann, Sebastian Laag
*
* Contact Email: <sebastian.heckmann@udo.edu>, <sebastian.laag@udo.edu>
*
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a c... | OcciConfig.getInstance().config.getString("occi.version")); | 0 |
jchampemont/WTFDYUM | src/main/java/com/jeanchampemont/wtfdyum/service/feature/impl/NotifyUnfollowFeatureStrategy.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 java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import com.google.common.primitives.Longs;
import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.dto.Principal;
import com.jeanchampemont.wtfdyum.dto.... | /*
* Copyright (C) 2015, 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
*... | public NotifyUnfollowFeatureStrategy(final PrincipalService principalService, | 6 |
asciidoctor/asciidoctorj | asciidoctorj-documentation/src/test/java/org/asciidoctor/integrationguide/syntaxhighlighter/OrderDocumentingHighlighter.java | [
"public interface Document extends StructuralNode {\n\n /**\n * @return The Title structure for this document.\n * @see Title\n */\n Title getStructuredDoctitle();\n\n /**\n * @return The title as a String.\n * @see Title\n */\n String getDoctitle();\n\n /**\n * @deprecate... | import org.asciidoctor.ast.Block;
import org.asciidoctor.ast.Document;
import org.asciidoctor.extension.LocationType;
import org.asciidoctor.syntaxhighlighter.Formatter;
import org.asciidoctor.syntaxhighlighter.HighlightResult;
import org.asciidoctor.syntaxhighlighter.Highlighter;
import org.asciidoctor.syntaxhighlight... | package org.asciidoctor.integrationguide.syntaxhighlighter;
public class OrderDocumentingHighlighter implements SyntaxHighlighterAdapter, Formatter, StylesheetWriter, Highlighter {
public static List<String> messages = new ArrayList<>();
public OrderDocumentingHighlighter() {
messages.add("New Synt... | public boolean hasDocInfo(LocationType location) { | 1 |
hugmanrique/PokeData | src/test/java/MapLoadingTest.java | [
"@Getter\npublic class ROMData {\n public static final int BANKS = 42;\n\n private String romName;\n private int itemData;\n private int attackNames;\n private int tmData;\n private int totalTMsAndHMs;\n private int totalTMs;\n private int itemImgData;\n private int itemsNumber;\n priv... | import me.hugmanrique.pokedata.loaders.ROMData;
import me.hugmanrique.pokedata.maps.Map;
import me.hugmanrique.pokedata.maps.MapData;
import me.hugmanrique.pokedata.maps.MapHeader;
import me.hugmanrique.pokedata.roms.ReadableROM;
import org.junit.Test; |
public class MapLoadingTest extends ROMTest {
/**
* Load up the ROM, check Pallet Town data and exit
*/
@Test
public void testMapDataIntegrity() {
ReadableROM rom = load();
checkFireRed(rom);
ROMData data = loadData(rom);
// Pallet town is in bank 3, map 0
... | MapHeader header = map.getHeader(); | 3 |
TechzoneMC/NPCLib | nms-v1_7_R3/src/main/java/net/techcable/npclib/nms/versions/v1_7_R3/LivingNPCHook.java | [
"@RequiredArgsConstructor\npublic enum Animation {\n /**\n * Makes the npc act hurt\n * <p/>\n * Only applicable to living entities\n */\n HURT,\n /**\n * Makes the npc lie on the ground\n * <p/>\n * Only applicable to living entities\n */\n DEAD,\n\n // Human Animatio... | import java.util.ArrayList;
import java.util.List;
import net.minecraft.server.v1_7_R3.EntityHuman;
import net.minecraft.server.v1_7_R3.EntityLiving;
import net.minecraft.server.v1_7_R3.EntityPlayer;
import net.minecraft.server.v1_7_R3.ItemStack;
import net.minecraft.server.v1_7_R3.MinecraftServer;
import net.minecraft... | package net.techcable.npclib.nms.versions.v1_7_R3;
public class LivingNPCHook extends NPCHook implements ILivingNPCHook {
public LivingNPCHook(LivingNPC npc, Location toSpawn, EntityType type) {
super(npc);
this.nmsEntity = spawn(toSpawn, type);
getNmsEntity().spawnIn(NMS.getHandle(toSp... | public void navigateTo(Location l) throws PathNotFoundException { | 2 |
mikedouglas/MiniJava | src/java/minijava/ir/canon/TraceSchedule.java | [
"public class IR {\n\t\n\tpublic static final IRExp TRUE = CONST(1);\n\tpublic static final IRExp FALSE = CONST(0);\n\t\n\t/**\n\t * A statement that doesn't do anything:\n\t */\n\tpublic static final IRStm NOP = EXP(CONST(0));\n\n\tpublic static IRExp BINOP(Op op, IRExp l, IRExp r) {\n\t\tBINOP result = new BINOP(... | import static minijava.ir.tree.IR.*;
import java.util.HashMap;
import java.util.Map;
import junit.framework.Assert;
import minijava.ir.temp.Label;
import minijava.ir.tree.CJUMP;
import minijava.ir.tree.IRStm;
import minijava.ir.tree.JUMP;
import minijava.ir.tree.LABEL;
import minijava.util.List; | package minijava.ir.canon;
public class TraceSchedule {
/**
* We will be rebuilding the IR code in here, from the basic blocks.
*/
private List<IRStm> program = List.empty();
| private Map<Label, List<IRStm>> table = new HashMap<Label, List<IRStm>>(); | 1 |
exxeleron/qJava | src/sample/java/Utils.java | [
"public final class QDictionary implements Iterable<QDictionary.KeyValuePair> {\n\n private final Object keys;\n private final Object values;\n private final int length;\n private final boolean areValuesArray;\n\n /**\n * Creates new {@link QDictionary} instance with given keys and values arrays.... | import java.lang.reflect.Array;
import com.exxeleron.qjava.QDictionary;
import com.exxeleron.qjava.QKeyedTable;
import com.exxeleron.qjava.QTable;
import com.exxeleron.qjava.QDictionary.KeyValuePair;
import com.exxeleron.qjava.QTable.Row; | /**
* Copyright (c) 2011-2014 Exxeleron GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | } else if ( obj instanceof QDictionary ) { | 0 |
vert-x3/vertx-kafka-client | src/main/java/io/vertx/kafka/client/producer/impl/KafkaProducerImpl.java | [
"@DataObject(generateConverter = true)\npublic class KafkaClientOptions {\n /**\n * Default peer address to set in traces tags is null, and will automatically pick up bootstrap server from config\n */\n public static final String DEFAULT_TRACE_PEER_ADDRESS = null;\n\n /**\n * Default tracing policy is 'pro... | import io.vertx.core.AsyncResult;
import io.vertx.core.Context;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Promise;
import io.vertx.core.Vertx;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.impl.VertxInternal;
import io.vertx.kafka.client.common.KafkaClientOptions;... | /*
* Copyright 2016 Red Hat Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | public static <K, V> KafkaProducer<K, V> createShared(Vertx vertx, String name, KafkaClientOptions options) { | 0 |
aikuma/aikuma | Aikuma/src/org/lp20/aikuma/model/Speaker.java | [
"public class AikumaSettings {\n\t/**\n\t * Latest version name.\n\t * \n\t * v02: 1. Recording-metadata: delete languages/speakers, add comments\n\t * \t\t2. Speaker-metadata: delete languages, add comments/date\n\t * \t\t3. Delete speaker-images\n\t * \t\t4. Add recording-images\n\t * \t\t5. New files: Tags (spea... | import android.graphics.Bitmap;
import android.os.Parcelable;
import android.os.Parcel;
import android.util.Log;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
im... | /*
Copyright (C) 2013-2015, The Aikuma Project
AUTHORS: Oliver Adams and Florian Hanke
*/
package org.lp20.aikuma.model;
/**
* The class that stores the data pertaining to a speaker who has contributed
* to a recording.
*
* @author Oliver Adams <oliver.adams@gmail.com>
* @author Florian Hanke <florian.hanke@gm... | final String currentVersionName = AikumaSettings.getLatestVersion(); | 0 |
engagingspaces/vertx-graphql-service-discovery | graphql-service-publisher/src/main/java/io/engagingspaces/graphql/servicediscovery/publisher/SchemaRegistrar.java | [
"public abstract class AbstractRegistrar<T extends Registration> implements Registrar {\n\n protected final Vertx vertx;\n private final Map<String, ManagedServiceDiscovery> serviceDiscoveries;\n private final Map<T, String> registrationMap;\n\n protected AbstractRegistrar(Vertx vertx) {\n this.v... | import java.util.*;
import java.util.function.BiConsumer;
import io.engagingspaces.graphql.discovery.impl.AbstractRegistrar;
import io.engagingspaces.graphql.events.SchemaAnnounceHandler;
import io.engagingspaces.graphql.events.SchemaPublishedHandler;
import io.engagingspaces.graphql.events.SchemaUnpublishedHandler;
im... | /*
* Copyright (c) 2016 The original author or authors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
*... | SchemaUnpublishedHandler<SchemaRegistration> unpublishedHandler) { | 3 |
gstreamer-java/gst1-java-core | src/org/freedesktop/gstreamer/Buffer.java | [
"public interface GstBufferAPI extends com.sun.jna.Library {\n \n GstBufferAPI GSTBUFFER_API = GstNative.load(GstBufferAPI.class);\n\n public static final int GST_LOCK_FLAG_READ = (1 << 0);\n public static final int GST_LOCK_FLAG_WRITE = (1 << 1);\n public static final int GST_MAP_READ = GST_LOCK_FLA... | import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference;
import java.util.EnumSet;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.freedesktop.gstreamer.glib.NativeFlags;
import org.freedesktop.gstreamer.glib.Natives;
import org.freedesktop.gstreamer.lowlevel.GType;
import o... | /*
* Copyright (c) 2020 Neil C Smith
* Copyright (c) 2019 Christophe Lafolet
* Copyright (C) 2014 Tom Greenwood <tgreenwood@cafex.com>
* Copyright (C) 2007 Wayne Meissner
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000 Wim Taymans <wtay@chello.be>
*
* This file is part of... | writable ? GstBufferAPI.GST_MAP_WRITE : GstBufferAPI.GST_MAP_READ); | 0 |
mslosarz/nextrtc-signaling-server | src/test/java/org/nextrtc/signalingserver/cases/JoinConversationTest.java | [
"@ContextConfiguration(classes = {TestConfig.class})\n@RunWith(SpringJUnit4ClassRunner.class)\npublic abstract class BaseTest {\n\n @Autowired\n private CreateConversation create;\n\n @Autowired\n private JoinConversation join;\n\n @Autowired\n private Members members;\n\n @Autowired\n priva... | import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.nextrtc.signalingserver.BaseTest;
import org.nextrtc.signalingserver.MessageMatcher;
import org.nextrtc.signalingserver.domain.InternalMessage;
import org.nextrtc.signalingserver.domain.Member;
import org.nextrtc.signalin... | package org.nextrtc.signalingserver.cases;
public class JoinConversationTest extends BaseTest {
@Autowired
private JoinConversation joinConversation;
@Autowired
private Members members;
@Autowired
private ConversationRepository conversations;
@Rule
public ExpectedException excepti... | joinConversation.execute(InternalMessage.create()// | 2 |
adyliu/jafka | src/test/java/io/jafka/consumer/ZookeeperConsumerConnector4Test.java | [
"public abstract class BaseJafkaServer {\n\n static {\n //System.setProperty(\"jafka_mx4jenable\", \"true\");\n }\n\n protected Logger logger = LoggerFactory.getLogger(getClass());\n\n public Jafka createJafka() {\n Properties mainProperties = new Properties();\n return createJafka(... | import com.github.zkclient.ZkServer;
import io.jafka.BaseJafkaServer;
import io.jafka.DataLogCleaner;
import io.jafka.Jafka;
import io.jafka.PortUtils;
import io.jafka.ZkServerTestUtil;
import io.jafka.producer.Producer;
import io.jafka.producer.ProducerConfig;
import io.jafka.producer.StringProducerData;
import io.jaf... | /**
* 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... | Producer<String, String> producer = new Producer<String, String>(producerConfig); | 3 |
RCasatta/EternityWallAndroid | src/main/java/it/eternitywall/eternitywall/fragments/NotarizeListFragment.java | [
"public class Http {\n private final static Logger log = Logger.getLogger(Http.class.getName());\n\n\n public static Optional<String> get(String urlString) {\n return get(urlString, 10000);\n }\n public static Optional<String> get(String urlString, int timeout) {\n\n try {\n ... | import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app... | public void takeFile(){
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
intent.setType("*/*");
startActivityForResult(intent, PICK_FILE_REQUEST);
}
// Retrieve file from intent
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
... | byte[] mySeed = Bitcoin.getEntropyFromPassphrase(passphrase); | 4 |
TorchPowered/OpenByte | src/main/java/net/openbyte/gui/WorkFrame.java | [
"public class LibraryDataFormat {\n public ArrayList<LibraryEntry> libraries;\n}",
"public class LibraryEntry {\n public String path;\n}",
"public enum ModificationAPI {\n MINECRAFT_FORGE,\n MCP,\n BUKKIT,\n}",
"public class UpdateFileEvent implements Event {\n private File fileUpdated;\n ... | import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import net.openbyte.data.file.json.LibraryDataFormat;
import net.openbyte.data.file.json.LibraryEntry;
import net.openbyte.data.file.json.LibrarySerializer;
import net.openbyte.en... | }
byte[] textBytes = rSyntaxTextArea1.getText().getBytes();
UpdateFileEvent event = new UpdateFileEvent(selectedFile, rSyntaxTextArea1.getText());
try {
EventManager.getManager().callEvent(event);
} catch (Exception e1) {
e1.printStackTrace();
}
... | System.setOut(new PrintStream(new StreamCapturer("OpenByte", frame, previous))); | 5 |
pinterest/pinlater | src/main/java/com/pinterest/pinlater/backends/redis/PinLaterRedisBackend.java | [
"public abstract class PinLaterBackendBase implements PinLaterBackendIface {\n\n protected static final Random RANDOM = new Random();\n\n private final AtomicLong claimSuffix = new AtomicLong(0);\n private final PropertiesConfiguration configuration;\n private final String serverHostName;\n private final long ... | import com.pinterest.pinlater.PinLaterBackendBase;
import com.pinterest.pinlater.backends.common.PinLaterBackendUtils;
import com.pinterest.pinlater.backends.common.PinLaterJobDescriptor;
import com.pinterest.pinlater.commons.healthcheck.HealthChecker;
import com.pinterest.pinlater.commons.util.BytesUtil;
import com.pi... | /**
* 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... | private final HealthChecker healthChecker; | 3 |
EManual/EManual-Android | app/src/main/java/io/github/emanual/app/ui/fragment/NewFeedsFragment.java | [
"public class NewFeedsAPI {\n\n public NewFeedsAPI() {\n\n }\n\n public void getInfo(AsyncHttpResponseHandler responseHandler) {\n RestClient.get(\"/java-newfeeds/article/info.json\", null, responseHandler);\n }\n\n public void getNewFeeds(int page, AsyncHttpResponseHandler responseHandler) {\... | import android.content.Intent;
import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.View;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import ... | package io.github.emanual.app.ui.fragment;
public class NewFeedsFragment extends SwipeRefreshFragment {
@Bind(R.id.lv_newfeeds) ListView lv;
@Bind(R.id.swipeRefreshLayout) SwipeRefreshLayout swipeRefreshLayout;
boolean hasMore = true;
int page = 1, maxPage = 1;
long last_motify = 0;
NewFeed... | SwipeRefreshLayoutUtils.setRefreshing(swipeRefreshLayout, true); | 7 |
mkyral/josm-tracer | src/org/openstreetmap/josm/plugins/tracer/TracerRecord.java | [
"public class EdMultipolygon extends EdObject {\n private Relation m_relation;\n private List<EdWay> m_outerWays;\n private List<EdWay> m_innerWays;\n\n EdMultipolygon (WayEditor editor) {\n super(editor, null);\n m_relation = new Relation();\n m_relation.put(\"type\", \"multipolygo... | import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonString;
import javax.json.JsonValue;
import org.openstreetmap.josm.data.Bounds;
import o... | /**
* Tracer - plugin for JOSM
*
* 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.
*
* This program is distr... | public EdObject createObject (WayEditor editor) { | 1 |
mfit/PdfTableAnnotator | src/main/java/at/tugraz/kti/pdftable/document/export/HtmlExport.java | [
"public class TableCell {\n\n\tpublic static String HEADER_HEADER \t= \"header\";\n\tpublic static String HEADER_ROW \t= \"rowhead\";\n\tpublic static String HEADER_COL \t= \"colhead\";\n\tpublic static String HEADER_CAT \t= \"stubhead\";\n\t\n\t/**\n\t * Dimensions of cell, as [x1, y1, x2, y2]. \n\t */\n\tpublic A... | import java.util.ArrayList;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import at.tugraz.kti.pdftable.document.TableCell;
import at.tugraz.kti.pdftable.document.DocumentTable;
import at.tugraz.kti.pdftable.document.DocumentException;
import at.tugraz.kti.pdftable.document.RichDocument;
import at.tugraz.kti.pdftab... | package at.tugraz.kti.pdftable.document.export;
/**
* An export in HTML format.
* Exports annotated tables with content and bounding boxes from PDF document
* as html tables.
*/
public class HtmlExport extends DOMExport{
public HtmlExport() {
super();
format = "html";
}
| public void buildDom(RichDocument doc, DocumentTables tdef) throws ParserConfigurationException, DocumentException { | 2 |
cestella/streaming_outliers | storm/src/main/java/com/caseystella/analytics/outlier/OutlierBolt.java | [
"public class DataPoint {\n private long timestamp;\n private double value;\n private Map<String, String> metadata;\n private String source;\n\n public DataPoint() {\n\n }\n\n public DataPoint(long timestamp, double value, Map<String, String> metadata, String source) {\n this.timestamp =... | import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.IRichBolt;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Tuple;
import com.caseystella.analytics.DataPoint;
import com.caseystella... | package com.caseystella.analytics.outlier;
public class OutlierBolt implements IRichBolt {
public static String STREAM_ID = "outliers";
private static final Logger LOG = Logger.getLogger(OutlierBolt.class);
OutputCollector _collector;
OutlierConfig outlierConfig;
OutlierAlgorithm sketchyOutlierAl... | , TimeseriesDatabaseHandlers.getTags(dp | 5 |
wix/wix-embedded-mysql | wix-embedded-mysql/src/main/java/com/wix/mysql/store/SafeExtractedArtifactStoreBuilder.java | [
"public class DownloadConfig implements AdditionalConfig {\n private final String cacheDir;\n private final String baseUrl;\n private final IProxyFactory proxyFactory;\n\n private DownloadConfig(\n final String cacheDir,\n final String baseUrl,\n final IProxyFactory prox... | import com.wix.mysql.config.DownloadConfig;
import com.wix.mysql.config.DownloadConfigBuilder;
import com.wix.mysql.config.MysqldConfig;
import com.wix.mysql.config.directories.TargetGeneratedFixedPath;
import com.wix.mysql.config.extract.NoopNaming;
import com.wix.mysql.config.extract.PathPrefixingNaming;
import de.fl... | package com.wix.mysql.store;
public class SafeExtractedArtifactStoreBuilder extends de.flapdoodle.embed.process.store.ExtractedArtifactStoreBuilder {
public SafeExtractedArtifactStoreBuilder defaults( | final MysqldConfig mysqldConfig, | 2 |
Dynious/Biota | src/main/java/com/dynious/biota/command/CommandBiota.java | [
"public class BioSystem\n{\n private static final Random RANDOM = new Random();\n\n public final WeakReference<Chunk> chunkReference;\n private int tick = RANDOM.nextInt(Settings.TICKS_PER_BIOSYSTEM_UPDATE);\n\n /**\n * Stores the amount of plants in the chunk. Plant blocks can have different amount... | import com.dynious.biota.biosystem.BioSystem;
import com.dynious.biota.biosystem.BioSystemHandler;
import com.dynious.biota.biosystem.BioSystemInitThread;
import com.dynious.biota.lib.Commands;
import com.dynious.biota.network.NetworkHandler;
import com.dynious.biota.network.message.MessageBioSystemUpdate;
import net.m... | package com.dynious.biota.command;
public class CommandBiota extends CommandBase
{
@Override
public String getCommandName()
{
return Commands.BIOTA;
}
@Override
public int getRequiredPermissionLevel()
{
return 2;
}
@Override
public String getCommandUsage(ICom... | BioSystem bioSystem = BioSystemHandler.getBioSystem(world, chunk); | 0 |
OpenJunction/JavaJunction | src/main/java/edu/stanford/junction/simulator/ResponseTimeSimulator.java | [
"public class JunctionMaker {\n\tpublic static final String DIRECTOR_ACTIVITY = \"edu.stanford.junction.director\";\n\tpublic static final URI CASTING_DIRECTOR = URI.create(\"junction://jx-director-local/cast\");\n\tprotected JunctionProvider mProvider;\n\n\tpublic static final URI SWITCHBOARD_ACTIVITY = URI.creat... | import java.util.Date;
import org.json.JSONException;
import org.json.JSONObject;
import edu.stanford.junction.JunctionMaker;
import edu.stanford.junction.JunctionException;
import edu.stanford.junction.api.activity.ActivityScript;
import edu.stanford.junction.api.activity.JunctionActor;
import edu.stanford.junction.ap... | /*
* Copyright (C) 2010 Stanford University
*
* 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 ... | JunctionMaker maker = JunctionMaker.getInstance(config); | 0 |
astrapi69/jgeohash | jgeohash-core/src/test/java/de/alpharogroup/jgeohash/distance/DistanceCalculatorTest.java | [
"public abstract class Adjacent\n{\n\n\t/**\n\t * The static class Borders.\n\t */\n\tpublic static class Borders\n\t{\n\n\t\t/** The Constant borders. */\n\t\tpublic static final Map<String, Map<String, String>> borders = new LinkedHashMap<>();\n\n\t\t/** The Constant BOTTOM_LEFT. */\n\t\tprivate static final Stri... | import static org.testng.AssertJUnit.assertEquals;
import java.util.Map;
import org.meanbean.factories.ObjectCreationException;
import org.meanbean.test.BeanTestException;
import org.meanbean.test.BeanTester;
import org.testng.annotations.Test;
import de.alpharogroup.jgeohash.Adjacent;
import de.alpharogroup.jgeohash.G... | /**
* Copyright (C) 2010 Asterios Raptis
*
* 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 ... | final Position alterTeichweg = new Point(coordinates[0], coordinates[1]); | 3 |
caprica/picam | src/test/java/uk/co/caprica/picam/tutorial/creation/MyCameraApplication4.java | [
"public final class Camera implements AutoCloseable {\n\n /**\n * Camera configuration, may be <code>null</code>.\n */\n private CameraConfiguration cameraConfiguration;\n\n /**\n * Flag tracks whether this component is currently \"open\" or not.\n *\n * @see #open()\n * @see #close... | import uk.co.caprica.picam.Camera;
import uk.co.caprica.picam.CameraConfiguration;
import uk.co.caprica.picam.CameraException;
import uk.co.caprica.picam.NativeLibraryException;
import uk.co.caprica.picam.enums.AutomaticWhiteBalanceMode;
import uk.co.caprica.picam.enums.Encoding;
import static uk.co.caprica.picam.Camer... | /*
* This file is part of picam.
*
* picam 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.
*
* picam is distributed in the hope... | Camera camera = new Camera(config); | 0 |
spring-cloud/spring-cloud-zookeeper | spring-cloud-zookeeper-discovery/src/test/java/org/springframework/cloud/zookeeper/serviceregistry/ZookeeperAutoServiceRegistrationTests.java | [
"@ConfigurationProperties(ZookeeperDiscoveryProperties.PREFIX)\npublic class ZookeeperDiscoveryProperties {\n\n\t/**\n\t * Zookeeper Discovery Properties prefix.\n\t */\n\tpublic static final String PREFIX = \"spring.cloud.zookeeper.discovery\";\n\n\t/**\n\t * Default URI spec.\n\t */\n\tpublic static final String ... | import java.util.Collection;
import org.apache.curator.x.discovery.ServiceDiscovery;
import org.apache.curator.x.discovery.ServiceInstance;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringBootConfiguration;
impo... | /*
* Copyright 2015-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | private ServiceDiscovery<ZookeeperInstance> serviceDiscovery; | 1 |
SamuelGjk/DiyCode | app/src/main/java/moe/yukinoneko/diycode/module/news/details/NewsDetailsActivity.java | [
"public abstract class BaseActivity extends RxAppCompatActivity {\n\n protected Unbinder unbinder;\n\n @Nullable\n @BindView(R.id.toolbar)\n protected Toolbar toolbar;\n\n @BindColor(R.color.navigation)\n protected int navigationColor;\n\n @Override\n protected void onCreate(@Nullable Bundle... | import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.RequiresApi;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.AppCompatTextView;
import a... | /*
* Copyright (c) 2017 SamuelGjk <samuel.alva@outlook.com>
*
* This file is part of DiyCode
*
* DiyCode 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 o... | public static void launch(Context context, News news) { | 1 |
apradanas/prismoji-android | prismoji/src/main/java/com/apradanas/prismoji/PrismojiView.java | [
"public interface EmojiCategory {\n /**\n * returns all of the emojis it can display\n *\n * @since 0.4.0\n */\n @NonNull\n Emoji[] getEmojis();\n\n /**\n * returns the icon of the category that should be displayed\n *\n * @since 0.4.0\n */\n @DrawableRes\n int getI... | import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.PorterDuff;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.... | package com.apradanas.prismoji;
@SuppressLint("ViewConstructor")
final class PrismojiView extends LinearLayout implements ViewPager.OnPageChangeListener {
private static final long INITIAL_INTERVAL = TimeUnit.SECONDS.toMillis(1) / 2;
private static final int NORMAL_INTERVAL = 50;
@ColorInt
private ... | OnEmojiBackspaceClickListener onEmojiBackspaceClickListener; | 1 |
kurbatov/firmata4j | src/main/java/org/firmata4j/firmata/parser/ParsingAnalogMappingState.java | [
"public class Event {\n\n private final long timestamp;\n private final String type;\n private final Map<String, Object> body;\n\n /**\n * Constructs the event of unspecified type.\n */\n public Event() {\n timestamp = System.currentTimeMillis();\n type = \"unspecified\";\n ... | import static org.firmata4j.firmata.parser.FirmataEventType.*;
import static org.firmata4j.firmata.parser.FirmataToken.*;
import org.firmata4j.fsm.Event;
import org.firmata4j.fsm.AbstractState;
import org.firmata4j.fsm.FiniteStateMachine;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap; | /*
* The MIT License (MIT)
*
* Copyright (c) 2014 Oleg Kurbatov (o.v.kurbatov@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limit... | public ParsingAnalogMappingState(FiniteStateMachine fsm) { | 2 |
ailab-uniud/distiller-CORE | src/main/java/it/uniud/ailab/dcore/annotation/annotators/SimpleAnnotationFilterAnnotator.java | [
"public class Blackboard {\r\n\r\n /**\r\n * The default document identifier.\r\n */\r\n private static final String DEFAULT_DOCUMENT_ID = \"DocumentRoot\";\r\n\r\n /**\r\n * The full raw text of the document.\r\n */\r\n private String rawText;\r\n\r\n /**\r\n * The root block of ... | import it.uniud.ailab.dcore.Blackboard;
import it.uniud.ailab.dcore.annotation.Annotation;
import it.uniud.ailab.dcore.annotation.Annotator;
import it.uniud.ailab.dcore.annotation.annotations.ScoredAnnotation;
import it.uniud.ailab.dcore.persistence.DocumentComponent;
import java.util.Collection;
import java.util.Colle... | /*
* Copyright (C) 2015 Artificial Intelligence
* Laboratory @ University of Udine.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option... | public void annotate(Blackboard blackboard, DocumentComponent component) { | 0 |
RationaleEmotions/SimpleSe | src/main/java/com/rationaleemotions/page/PageObject.java | [
"public interface WaitCondition {\n\n /**\n *\n * @return - The name to be used to symbolically represent this implementation. This is the same\n * name that you will be providing in your Json file as wait strategy.\n */\n String getName();\n\n /**\n * @param by - The {@link By} that re... | import com.rationaleemotions.internal.locators.WaitCondition;
import com.rationaleemotions.internal.parser.pojos.Wait;
import com.rationaleemotions.pojos.JsonWebElement;
import com.rationaleemotions.pojos.WebPage;
import com.google.common.collect.Lists;
import com.rationaleemotions.utils.StringUtils;
import org.openqa.... | package com.rationaleemotions.page;
/**
* This class represents the entry point to all page object building.
* Houses all the logic required for loading a json file, parsing it, initialising location strategies
* based on the values provided in the json file and also in constructing different html elements.
*/
@... | if (StringUtils.isBlank(locale)) { | 4 |
Zoey76/L2J_LoginServer | src/main/java/com/l2jserver/login/network/clientpackets/RequestServerLogin.java | [
"public final class Config\r\n{\r\n\tprivate static final Logger LOGGER = Logger.getLogger(Config.class.getName());\r\n\t\r\n\tpublic static final String EOL = System.lineSeparator();\r\n\t\r\n\tprivate static final String HEXID_FILE = \"./config/hexid.txt\";\r\n\tprivate static final String LOGIN_CONFIGURATION_FIL... | import com.l2jserver.login.Config;
import com.l2jserver.login.LoginController;
import com.l2jserver.login.SessionKey;
import com.l2jserver.login.network.serverpackets.LoginFail.LoginFailReason;
import com.l2jserver.login.network.serverpackets.PlayFail.PlayFailReason;
import com.l2jserver.login.network.serverpacket... | /*
* Copyright (C) 2004-2015 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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 opti... | if (LoginController.getInstance().isLoginPossible(getClient(), _serverId))
| 1 |
paulrzcz/montecarlo | src/test/java/cz/paulrz/montecarlo/tests/LogOuTest.java | [
"public class SimpleAccumulator implements Accumulator<Double, SummaryStatistics> {\n public SimpleAccumulator() {\n stats = new SummaryStatistics();\n }\n\n public SimpleAccumulator(SimpleAccumulator s) {\n stats = s.stats.copy();\n }\n\n public SummaryStatistics stats;\n\n public v... | import cz.paulrz.montecarlo.accumulator.SimpleAccumulator;
import cz.paulrz.montecarlo.single.ArrivedPointValuation;
import cz.paulrz.montecarlo.single.IMonteCarloModel;
import cz.paulrz.montecarlo.single.LogOrnsteinUhlenbeckProcess;
import cz.paulrz.montecarlo.single.MonteCarloModel;
import junit.framework.TestCase;
i... | package cz.paulrz.montecarlo.tests;
/**
* User: paul
* Date: 26/5/11
* Time: 16:23 PM
*/
public class LogOuTest extends TestCase {
private LogOrnsteinUhlenbeckProcess process; | private IMonteCarloModel mcm; | 2 |
programingjd/okserver | src/samples/java/info/jdavid/ok/server/samples/Readme.java | [
"@SuppressWarnings({ \"WeakerAccess\" })\npublic class HttpServer {\n\n final AtomicBoolean started = new AtomicBoolean();\n final AtomicBoolean setup = new AtomicBoolean();\n int port = 8080; // 80\n int securePort = 8181; // 443\n String hostname = null;\n long maxRequestSize = 65536;\n Dispatcher dispatch... | import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import javax.annotation.Nullable;
import info.jdavid.ok.server.HttpServer;
import info.jdavid.ok.server.Https;
import info.jdavid... | package info.jdavid.ok.server.samples;
@SuppressWarnings({ "unused", "Convert2Lambda", "Anonymous2MethodRef" })
public class Readme {
public static void customRequestHandler() { | new HttpServer(). | 0 |
AlexIIL/CustomLoadingScreen | src/main/java/alexiil/mc/mod/load/render/MinecraftDisplayerRenderer.java | [
"public class ClsManager {\n public static final Resolution RESOLUTION = new Resolution();\n\n private static final FunctionContext FUNC_CTX\n = new FunctionContext(\"CLS\", DefaultContexts.createWithAll(), ClsRandom.CTX_RANDOM);\n\n private static final NodeVariableObject<String> NODE_STATUS = FUNC... | import java.util.Map;
import com.google.common.collect.Maps;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
import org.lwjgl.opengl.GLContext;
import org.lwjgl.opengl.KHRDebug;
import org.lwjgl.opengl.SharedDrawable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
impor... | package alexiil.mc.mod.load.render;
public class MinecraftDisplayerRenderer {
private static final ResourceLocation FONT_LOCATION = new ResourceLocation("textures/font/ascii.png");
public final TextureAnimator animator;
private final BakedVariable[] variables;
private final BakedRenderingPart[] r... | Resolution resolution = ClsManager.RESOLUTION; | 1 |
asm-products/nexus-camera | src/com/android/camera/VideoUI.java | [
"static public interface OnPreferenceChangedListener {\n public void onSharedPreferenceChanged();\n public void onRestorePreferencesClicked();\n public void onOverriddenPreferencesClicked();\n public void onCameraPickerClicked(int cameraId);\n}",
"abstract public class AbstractSettingPopup extends Rot... | import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.SurfaceTexture;
import android.graphics.drawable.ColorDrawable;
import android.hardware.Camera.Parameters;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.... | /*
* Copyright (C) 2012 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | private ModuleSwitcher mSwitcher; | 4 |
mattinsler/com.lowereast.guiceymongo | src/main/java/com/lowereast/guiceymongo/data/generator/ListPropertyGenerator.java | [
"public class ListProperty extends Property<ListType> {\n\tpublic ListProperty(UserDataType enclosingType, String name, ListType type, String comment, boolean useCamelCaseKeys) {\n\t\tsuper(enclosingType, name, type, comment, useCamelCaseKeys);\n\t}\n\n\t@Override\n\tpublic String getMemberVariableName() {\n\t\tret... | import java.io.IOException;
import org.antlr.stringtemplate.StringTemplate;
import com.lowereast.guiceymongo.data.generator.property.ListProperty;
import com.lowereast.guiceymongo.data.generator.type.ListType;
import com.lowereast.guiceymongo.data.generator.type.PrimitiveType;
import com.lowereast.guiceymongo.data.gene... | /**
* Copyright (C) 2010 Lowereast Software
*
* 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... | if (type.getItemType() instanceof UserEnumType) { | 4 |
irccloud/android | src/com/irccloud/android/activity/PastebinsActivity.java | [
"public abstract class AsyncTaskEx<Params, Progress, Result> {\n private static final String LOG_TAG = \"AsyncTaskEx\";\n\n private static final int CORE_POOL_SIZE = 10;\n private static final int MAXIMUM_POOL_SIZE = 50;\n private static final int KEEP_ALIVE = 10;\n\n private static final LinkedBlock... | import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View... | /*
* Copyright (c) 2015 IRCCloud, 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 required by applicable law or agreed ... | binding.delete.setColorFilter(ColorScheme.getInstance().colorControlNormal, PorterDuff.Mode.SRC_ATOP); | 1 |
CMPUT301F14T14/android-question-answer-app | QuestionAppTests/src/ca/ualberta/cs/cmput301f14t14/questionapp/test/AnswerTest.java | [
"public class MainActivity extends Activity {\n\n\tprivate DataManager dataManager;\n\tprivate QuestionListAdapter qla = null;\n\tprivate List<Question> qList = null;\n\t\n\tprivate ClientData cd = null;\n\tprivate Callback<List<Question>> listCallback = null;\n\tprivate Callback<Question> favouriteQuestionCallback... | import java.io.IOException;
import java.util.UUID;
import android.test.ActivityInstrumentationTestCase2;
import ca.ualberta.cs.cmput301f14t14.questionapp.MainActivity;
import ca.ualberta.cs.cmput301f14t14.questionapp.data.DataManager;
import ca.ualberta.cs.cmput301f14t14.questionapp.data.LocalDataStore;
import ca.ualbe... | package ca.ualberta.cs.cmput301f14t14.questionapp.test;
public class AnswerTest extends ActivityInstrumentationTestCase2<MainActivity> {
private Question mQuestion;
private Answer mAnswer;
private DataManager manager;
private LocalDataStore local;
private RemoteDataStore remote;
public AnswerTest() {
supe... | Image image = new Image(null); | 5 |
byoutline/CachedField | eventbuscachedfield/src/main/java/com/byoutline/eventbuscachedfield/EventBusCachedFieldWithArgBuilder.java | [
"public interface ProviderWithArg<RETURN_TYPE, ARG_TYPE> {\n\n RETURN_TYPE get(ARG_TYPE arg);\n}",
"@AutoValue\npublic abstract class DbCacheArg<ARG_TYPE> {\n\n public static <ARG_TYPE> DbCacheArg<ARG_TYPE> create(@Nullable ARG_TYPE arg, @Nonnull FetchType fetchType) {\n return new AutoValue_DbCacheA... | import com.byoutline.cachedfield.ProviderWithArg;
import com.byoutline.cachedfield.dbcache.DbCacheArg;
import com.byoutline.cachedfield.dbcache.DbCachedValueProviderWithArg;
import com.byoutline.cachedfield.dbcache.DbWriterWithArg;
import com.byoutline.eventbuscachedfield.internal.EventIBus;
import com.byoutline.ibusca... | package com.byoutline.eventbuscachedfield;
/**
* Fluent interface builder of {@link EventBusCachedField}. If you do not like
* fluent interface create {@link EventBusCachedField} by one of its constructors.
*
* @param <RETURN_TYPE> Type of object to be cached.
* @author Sebastian Kacprzak <sebastian.kacprzak at... | public <API_RETURN_TYPE> DbCacheBuilderReader<API_RETURN_TYPE, RETURN_TYPE, ARG_TYPE> withApiFetcher(ProviderWithArg<API_RETURN_TYPE, ARG_TYPE> apiValueProvider) { | 0 |
DmitryMalkovich/gito-github-client | github-api/src/main/java/com/dmitrymalkovich/android/githubapi/core/GithubService.java | [
"@SuppressWarnings(\"all\")\npublic class AccessToken {\n\n @SerializedName(\"access_token\")\n private String mAccessToken;\n @SerializedName(\"token_type\")\n private String mTokenType;\n\n public String getToken() {\n return mAccessToken;\n }\n\n public String getTokenType() {\n ... | import retrofit2.http.Query;
import com.dmitrymalkovich.android.githubapi.core.data.AccessToken;
import com.dmitrymalkovich.android.githubapi.core.data.Clones;
import com.dmitrymalkovich.android.githubapi.core.data.ReferringSite;
import com.dmitrymalkovich.android.githubapi.core.data.Star;
import com.dmitrymalkovich.an... | /*
* Copyright 2017. Dmitry Malkovich
*
* 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 agr... | Call<List<TrendingRepository>> getTrendingRepositories( | 4 |
upcyiban/IntegrateApplication | src/main/java/cn/edu/upc/yb/integrate/lostandfound/controller/LostAndFoundAdminController.java | [
"@Component\npublic class LostAndFoundConfig {\n @Value(\"${yibanoauth.lostandfound.APPID}\")\n public String client_id;\n\n @Value(\"${yibanoauth.lostandfound.APPkey}\")\n public String AppSecret;\n\n}",
"public interface LostAndFoundOfficialDao extends CrudRepository<LostAndFoundOfficial,Integer>,... | import cn.edu.upc.yb.integrate.common.dto.ErrorReporter;
import cn.edu.upc.yb.integrate.lostandfound.config.LostAndFoundConfig;
import cn.edu.upc.yb.integrate.lostandfound.dao.LostAndFoundOfficialDao;
import cn.edu.upc.yb.integrate.lostandfound.dao.LostAndFoundUserDao;
import cn.edu.upc.yb.integrate.lostandfound.dto.Js... | package cn.edu.upc.yb.integrate.lostandfound.controller;
/**
* Created by 17797 on 2017/5/30.
*/
@RestController
@RequestMapping("/lostandfound")
public class LostAndFoundAdminController {
@Autowired
private LostAndFoundOfficialDao officialDao;
@Autowired
private HttpSession session = null;
... | LostAndFoundUser user = userDao.findOne(id); | 5 |
wenerme/bbvm | jbbvm/bbvm-core/src/main/java/me/wener/bbvm/dev/swing/SwingPageManager.java | [
"public interface PageManager extends ResourceManager<PageManager, PageResource> {\n\n PageResource getScreen();\n\n int getWidth();\n\n int getHeight();\n\n PageManager setSize(int w, int h);\n\n @Override\n default String getType() {\n return \"page\";\n }\n}",
"public interface Page... | import com.google.common.collect.Maps;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import me.wener.bbvm.dev.PageManager;
import me.wener.bbvm.dev.PageResource;
import me.wener.bbvm.exception.ExecutionException;
import me.wener.bbvm.exception.ResourceMissingException;
import ... | package me.wener.bbvm.dev.swing;
/**
* @author wener
* @since 15/12/26
*/
@Singleton
class SwingPageManager implements PageManager {
private final static Logger log = LoggerFactory.getLogger(PageManager.class);
private final Map<Integer, SwingPage> resources = Maps.newConcurrentMap();
private int han... | public void onReset(ResetEvent e) { | 4 |
excella-core/excella-reports | src/sample/java/org/bbreak/excella/reports/samples/TransExpenseReporter.java | [
"public class ExcelExporter extends ReportBookExporter {\n\n /**\n * ログ\n */\n private static Log log = LogFactory.getLog( ExcelExporter.class);\n\n /**\n * 変換タイプ:エクセル\n */\n public static final String FORMAT_TYPE = \"EXCEL\";\n\n /**\n * 拡張子:〜2003\n */\n public static fina... | import org.bbreak.excella.reports.model.ReportSheet;
import org.bbreak.excella.reports.processor.ReportProcessor;
import org.bbreak.excella.reports.tag.BlockRowRepeatParamParser;
import org.bbreak.excella.reports.tag.SingleParamParser;
import java.math.BigDecimal;
import java.net.URL;
import java.net.URLDecoder;
... | /*-
* #%L
* excella-reports
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache... | ReportSheet outputSheet = new ReportSheet( "申請書", "申請書");
| 3 |
SOM-Research/EMFtoCSP | plugins/fr.inria.atlanmod.emftocsp.ui/src/fr/inria/atlanmod/emftocsp/ui/commands/AbstractWizardHandler.java | [
"public interface ICspSolver <ST> { \n\n public boolean solveCSP(File srcFile, List<File> libs) throws ProcessingException; \n\n public boolean solveCSP(File srcFile) throws ProcessingException; \n \n public Object getResult();\n\n public ST getSolution();\n}",
"public interface IModelToCspSolver<R,ST> {\... | import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resour... | /*******************************************************************************
* Copyright (c) 2013 INRIA Rennes Bretagne-Atlantique.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, an... | ValidationWizard wizard = new ModelSelectedWizard(modelSolver); | 7 |
stefanhaustein/expressionparser | demo/sets/src/main/java/org/kobjects/expressionparser/demo/sets/SetDemo.java | [
"public class ExpressionParser<T> {\n\n private final HashMap<String,Symbol> prefix = new HashMap<>();\n private final HashMap<String,Symbol> infix = new HashMap<>();\n private final HashSet<String> otherSymbols = new HashSet<>();\n private final HashSet<String> primary = new HashSet<>();\n private final HashM... | import org.kobjects.expressionparser.ExpressionParser;
import org.kobjects.expressionparser.OperatorType;
import org.kobjects.expressionparser.ParsingException;
import org.kobjects.expressionparser.Processor;
import org.kobjects.expressionparser.Tokenizer;
import java.io.BufferedReader;
import java.io.IOException;
impo... | package org.kobjects.expressionparser.demo.sets;
/**
* Demo for set expression operators.
*/
public class SetDemo {
static class SetProcessor extends Processor<Object> {
private Set<Object> assertSet(Object o) {
if (!(o instanceof Set)) {
throw new RuntimeException("Set expected for " + o);
... | parser.addOperators(OperatorType.INFIX, 1, "\u2229"); | 1 |
darrenfoong/candc | src/model/FeatureRuleHeadDist.java | [
"public class SuperCategory {\n\tpublic final Category cat;\n\n\tpublic ArrayList<Dependency> unfilledDeps = null;\n\tpublic ArrayList<FilledDependency> filledDeps = null;\n\n\t/*\n\t * used to record how the category was built (eg coordination) which then\n\t * gets used by rule restrictions in the combinators\n\t... | import java.util.ArrayList;
import java.util.HashMap;
import cat_combination.SuperCategory;
import cat_combination.Variable;
import io.Sentence;
import lexicon.Categories;
import lexicon.Category;
import utils.Hash; | package model;
public class FeatureRuleHeadDist implements Feature<FeatureRuleHeadDist> {
final short featureType;
final Category leftCat;
final Category rightCat;
final Category resultCat;
final int head;
short distance;
final int hashCode;
public FeatureRuleHeadDist(short featureType, Category leftCat, Ca... | Hash h = new Hash(featureType); | 5 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/Template_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import eu.optique.r2rml.api.model.LogicalTable;
import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.model.Template;
import eu.optique.r2rml.api.m... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | Iterator<PredicateMap> pmit=pom.getPredicateMaps().iterator();
| 4 |
liamspradlin/Phoebe | Selene/app/src/main/java/liam/franco/selene/activities/EditNoteActivity.java | [
"public class App extends Application {\n public static Context CONTEXT;\n public static Resources RESOURCES;\n public static Handler MAIN_THREAD;\n public static TinyBus BUS;\n public static AmbientLight SENSOR_AMBIENT_LIGHT;\n public static List<Gaia> GAIAS;\n public static Realm REALM;\n\n ... | import liam.franco.selene.utils.PaletteUtils;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import icepick.State;
import liam.franco.selene.R;
import... | /*
* Copyright 2016 Francisco Franco & Liam Spradlin
*
* 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 appli... | noteToEdit = App.REALM.where(Note.class).equalTo("uid", uid).findFirst(); | 0 |
ToroCraft/Minecoprocessors | src/main/java/net/torocraft/minecoprocessors/processor/Processor.java | [
"@Mod(modid = Minecoprocessors.MODID, version = Minecoprocessors.VERSION, name = Minecoprocessors.MODNAME)\npublic class Minecoprocessors {\n\n public static final String MODID = \"minecoprocessors\";\n public static final String VERSION = \"1.12.2-5\";\n public static final String MODNAME = \"Minecoprocessors\"... | import java.util.ArrayList;
import java.util.List;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagByteArray;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.torocraft.minecoprocessors.Minecoprocessors;
import net.torocraft.minecoprocessors.gui.GuiMinecoprocesso... | registers[i] = stack[--sp];
}
}
void processCall() {
if (sp >= stack.length - 1) {
faultCode = FaultCode.FAULT_STACK_OVERFLOW;
fault = true;
return;
}
stack[sp++] = ByteUtil.getByte(ip, 0);
stack[sp++] = ByteUtil.getByte(ip, 1);
ip = labels.get(instruction[1]).addres... | s.append(GuiMinecoprocessor.toHex(stack[(i * 8) + j])); | 1 |
maxdemarzi/grittier_ext | src/main/java/com/maxdemarzi/timeline/Timeline.java | [
"public enum RelationshipTypes implements RelationshipType {\n BLOCKS,\n FOLLOWS,\n MUTES,\n LIKES,\n REPLIED_TO\n}",
"@Path(\"/users\")\npublic class Users {\n\n private final GraphDatabaseService db;\n private static final ObjectMapper objectMapper = new ObjectMapper();\n\n public Users... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.maxdemarzi.RelationshipTypes;
import com.maxdemarzi.users.Users;
import org.neo4j.dbms.api.DatabaseManagementService;
import org.neo4j.graphdb.*;
import javax.ws.rs.Path;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Respons... | package com.maxdemarzi.timeline;
@Path("/users/{username}/timeline")
public class Timeline {
private final GraphDatabaseService db;
private static final ObjectMapper objectMapper = new ObjectMapper();
public Timeline(@Context DatabaseManagementService dbms ) {
this.db = dbms.database( "neo4j" ... | properties.put(REPOSTED, userRepostedPost(user, post)); | 7 |
xda/XDA-One | android/src/main/java/com/xda/one/ui/CreatePostFragment.java | [
"public interface UnifiedThread extends Parcelable {\n\n public String getThreadId();\n\n public boolean isAttach();\n\n public boolean hasAttachment();\n\n public int getViews();\n\n public long getLastPost();\n\n public String getTitle();\n\n public String getFirstPostContent();\n\n public... | import com.squareup.otto.Subscribe;
import com.squareup.picasso.Picasso;
import com.xda.one.R;
import com.xda.one.api.inteface.PostClient;
import com.xda.one.api.model.interfaces.UnifiedThread;
import com.xda.one.api.retrofit.RetrofitPostClient;
import com.xda.one.auth.XDAAccount;
import com.xda.one.event.post.PostCrea... | package com.xda.one.ui;
public class CreatePostFragment extends DialogFragment {
private static final String POST = "post";
private static final String THREAD = "thread";
private static final String DIALOG_SAVED_STATE = "dialog_saved_state";
private final EventListener mEventListener = new Event... | final XDAAccount selectedAccount = AccountUtils.getAccount(getActivity()); | 1 |
threerings/nexus | jvm-server/src/main/java/com/threerings/nexus/server/JVMServerConnection.java | [
"public class ByteBufferInputStream extends InputStream\n{\n /**\n * Configures the buffer from which data should be read.\n */\n public void setBuffer (ByteBuffer buffer) {\n _buffer = buffer;\n }\n\n @Override\n public int read () throws IOException {\n // note: we don't rely ... | import java.io.EOFException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.NotYetConnectedException;
import java.nio.channels.SocketChannel;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import com.threerings.nexus.io.ByteBufferInputStream;
import com.thre... | //
// Nexus JVMServer - server-side support for Nexus java.nio-based services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Handles a connection to a single client.
*/
public class JVMServerConnection
implements JVMConnectionManager.IOHandler, SessionMan... | public synchronized void send (Downstream msg) { | 5 |
GoogleCloudPlatform/healthcare-api-dicom-fuse | src/main/java/com/google/dicomwebfuse/dao/spec/SeriesPathBuilder.java | [
"public static final String DATASETS = \"/datasets/\";",
"public static final String DICOM_STORES = \"/dicomStores/\";",
"public static final String DICOM_WEB = \"/dicomWeb\";",
"public static final String LOCATIONS = \"/locations/\";",
"public static final String PROJECTS = \"/projects/\";",
"public stat... | import static com.google.dicomwebfuse.dao.Constants.DATASETS;
import static com.google.dicomwebfuse.dao.Constants.DICOM_STORES;
import static com.google.dicomwebfuse.dao.Constants.DICOM_WEB;
import static com.google.dicomwebfuse.dao.Constants.LOCATIONS;
import static com.google.dicomwebfuse.dao.Constants.PROJECTS;
impo... | // 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 ... | dicomStoreId + DICOM_WEB + STUDIES + studyId + SERIES; | 6 |
steeleforge/ironsites | core/src/main/java/com/steeleforge/aem/ironsites/wcm/page/PageUse.java | [
"public enum WCMConstants {\n INSTANCE;\n public static final String HTTP = \"http\";\n public static final String HTTPS = \"https\";\n public static final String PROTOCOL_RELATIVE = \"//\";\n public static final String DELIMITER_QUERY = \"?\";\n public static final String DELIMITER_FRAGMENT = \"#... | import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import com.adobe.cq.sightly.WCMUse;
import com.day.cq.tagging.Tag;
import com.steeleforge.aem.ironsites.wcm.WCMConstants;
import com.steeleforge.aem.ironsites.wcm.WCMUtil;
import com.steeleforge.aem.ironsites.wcm.api.ApiService;
impo... | public String getCanonical() {
if (null != canonical || null == getCurrentPage()) return canonical;
canonical = WCMUtil.getPageURL(getRequest(), getCurrentPage().getPath());
return canonical;
}
/**
* @return path based or base favicon path
*/
public String getFavic... | ApiService api = getSlingScriptHelper().getService(ApiService.class); | 2 |
Whiley/Jasm | src/test/java/jasm/testing/JKitValidTests.java | [
"public final class ClassFileReader {\t\n\tprivate final byte[] bytes; // byte array of class\n\tprivate final int[] items; // start indices of constant pool items\t\n\tprivate final HashMap<Integer,Constant.Info> constantPool;\t\t\n\tprivate final HashMap<String,BytecodeAttribute.Reader> attributeReader... | import java.io.StringReader;
import jasm.io.ClassFileReader;
import jasm.io.ClassFileWriter;
import jasm.lang.ClassFile;
import jasm.verifier.ClassFileVerifier;
import jasm.verifier.TypeAnalysis;
import org.junit.*;
import static org.junit.Assert.fail;
import java.io.BufferedReader;
import java.io.File;
impor... | // This file is part of the Java Compiler Kit (JKit)
//
// The Java Compiler Kit 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 ver... | new ClassFileVerifier().apply(cf);
| 3 |
lantunes/fixd | src/main/java/org/bigtesting/fixd/core/async/AsyncHandler.java | [
"public class SimpleCapturedRequest implements CapturedRequest {\n\n private final Request request;\n \n private boolean broadcast = false;\n \n public SimpleCapturedRequest(Request request) {\n this.request = request;\n }\n \n public String getPath() {\n \n return reque... | import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import org.bigtesting.fixd.capture.impl.SimpleCapturedRequest;
import org.bigtesting.fixd.core.RequestHandlerImpl;
import org.bigtesting.fixd.core.Upon;
import org.bigtesting.fixd.core.body.Resp... | /*
* Copyright (C) 2015 BigTesting.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | UnmarshallerProvider unmarshallerProvider) { | 5 |
wayfinder/Wayfinder-Android-Locate | src/com/vodafone/locate/view/SearchResultsView.java | [
"public class MapsApplication extends Application implements LocationListener {\n\n public static final int DISMISS_TIME_WARNING_DIALOG = 10;\n public static final int NO_LOCATION_TIMEOUT = 15000; //15 seconds\n \n private static final int NETW_ERROR_WAITING_TIME = 10000;\n private static final double... | import java.util.Vector;
import android.content.Context;
import android.graphics.Bitmap;
import android.os.Parcelable;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import androi... | /*******************************************************************************
* Copyright (c) 1999-2010, Vodafone Group Services
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
... | private CategoryLevelChangeListener listener; | 1 |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/network/server/ProxyServer.java | [
"public class ProxyServerConfig {\n\n private InetSocketAddress bindAddress;\n\n private String password;\n\n private int mbpsLimit = 0;\n\n private String welcomeMessage = \"Welcome to \" + SystemInfo.getHostname();\n\n private boolean allowLoopback = false;\n\n private final DragoniteSocketParam... | import com.vecsight.dragonite.proxy.config.ProxyServerConfig;
import com.vecsight.dragonite.proxy.misc.ProxyGlobalConstants;
import com.vecsight.dragonite.sdk.cryptor.PacketCryptor;
import com.vecsight.dragonite.sdk.socket.DragoniteServer;
import com.vecsight.dragonite.sdk.socket.DragoniteSocket;
import org.pmw.tinylog... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.network.server;
public class ProxyServer {
private final InetSocketAddress bindAddress;
private final int limitMbps;
private final ... | ProxyGlobalConstants.INIT_SEND_SPEED, config.getDragoniteSocketParameters()); | 1 |
ThexXTURBOXx/BlockHelper | de/thexxturboxx/blockhelper/integration/FSIntegration.java | [
"public class BlockHelperCommonProxy {\n\n protected static Configuration cfg;\n\n public static boolean showHealth;\n public static boolean advMachinesIntegration;\n public static boolean appEngIntegration;\n public static boolean bcIntegration;\n public static boolean ccIntegration;\n public ... | import de.thexxturboxx.blockhelper.BlockHelperCommonProxy;
import de.thexxturboxx.blockhelper.api.BlockHelperBlockState;
import de.thexxturboxx.blockhelper.api.BlockHelperInfoProvider;
import de.thexxturboxx.blockhelper.api.InfoHolder;
import de.thexxturboxx.blockhelper.i18n.I18n;
import net.minecraft.util.MathHelper; | package de.thexxturboxx.blockhelper.integration;
public class FSIntegration extends BlockHelperInfoProvider {
@Override
public void addInformation(BlockHelperBlockState state, InfoHolder info) {
if (iof(state.block, "florasoma.crops.blocks.BerryBush")) {
int newMeta = MathHelper.floor_dou... | return BlockHelperCommonProxy.floraSomaIntegration; | 0 |
XT-i/aws-lambda-jenkins-plugin | src/main/java/com/xti/jenkins/plugin/awslambda/callable/InvokeCallable.java | [
"public class InvokeConfig implements Serializable {\n private String functionName;\n private String payload;\n private boolean synchronous;\n private List<JsonParameter> jsonParameters;\n\n public InvokeConfig(String functionName, String payload, boolean synchronous, List<JsonParameter> jsonParamete... | import com.xti.jenkins.plugin.awslambda.invoke.InvokeConfig;
import com.xti.jenkins.plugin.awslambda.invoke.LambdaInvocationResult;
import com.xti.jenkins.plugin.awslambda.invoke.LambdaInvoker;
import com.xti.jenkins.plugin.awslambda.service.JenkinsLogger;
import com.xti.jenkins.plugin.awslambda.service.LambdaDeploySer... | package com.xti.jenkins.plugin.awslambda.callable;
/**
* Project: aws-lambda
* Created by Michael on 16/01/2016.
*/
public class InvokeCallable implements Callable<LambdaInvocationResult, RuntimeException> {
private TaskListener listener; | private InvokeConfig invokeConfig; | 0 |
handstudio/HzGrapher | sample/src/com/handstudio/android/hzgrapher/ScatterGraphActivity.java | [
"public class GraphAnimation {\n\tpublic static final int LINEAR_ANIMATION = 1;\n\t\n\tpublic static final int CURVE_REGION_ANIMATION_1 = 2;\n\tpublic static final int CURVE_REGION_ANIMATION_2 = 3;\n\t\n\tpublic static final int DEFAULT_DURATION = 2000;\n\t\n\tprivate int animation = LINEAR_ANIMATION;\n\tprivate in... | import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.util.Log;
import android.view.ViewGroup;
import com.handstudio.android.hzgrapherlib.animation.GraphAnimation;
import com.handstudio.android.hzg... | package com.handstudio.android.hzgrapher;
public class ScatterGraphActivity extends Activity
{
public static final String TAG = ScatterGraphActivity.class.getSimpleName();
private ViewGroup layoutGraphView;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState... | ScatterGraphVO vo = getScatterGraphInfo(); | 4 |
Yelp/yelp-android | src/test/java/com/yelp/clientlib/connection/YelpAPITest.java | [
"@AutoValue\n@JsonIgnoreProperties(ignoreUnknown = true)\n@JsonDeserialize(builder = AutoValue_Business.Builder.class)\npublic abstract class Business implements Serializable {\n\n public abstract String id();\n\n public abstract String name();\n\n @Nullable\n public abstract ArrayList<Category> categor... | import com.fasterxml.jackson.databind.JsonNode;
import okhttp3.mockwebserver.MockResponse;
import okhttp3.mockwebserver.MockWebServer;
import okhttp3.mockwebserver.RecordedRequest;
import com.yelp.clientlib.entities.Business;
import com.yelp.clientlib.utils.JsonTestUtils;
import com.yelp.clientlib.entities.SearchRespon... |
@Test
public void testGetBusinessParamsBeURLEncoded() throws IOException, InterruptedException {
setUpMockServerResponse(200, "OK", businessJsonNode.toString());
String testBusinessId = "test-business-id";
Map<String, String> params = new HashMap<>();
String key = "the key";
... | } catch (BusinessUnavailable e) { | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.