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 |
|---|---|---|---|---|---|---|
coil-lighting/udder | udder/src/main/java/com/coillighting/udder/effect/TextureEffect.java | [
"public class BoundingCube {\n\n protected double minX = 0.0;\n protected double minY = 0.0;\n protected double minZ = 0.0;\n\n protected double maxX = 0.0;\n protected double maxY = 0.0;\n protected double maxZ = 0.0;\n\n protected double width = 0.0;\n protected double height = 0.0;\n p... | import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;
import javax.imageio.ImageIO;
import com.coillighting.udder.geometry.BoundingCube;
import com.coillighting.udder.geometry.ControlQuad;
import com.coillighting.udder.geometry.Inter... | package com.coillighting.udder.effect;
/** Stretch and squeeze a raster image over the pointcloud representing the
* Devices in your show. See TextureEffectState for options.
*
* TODO rename to StretchEffect.
*/
public class TextureEffect extends EffectBase implements ImageEffect {
protected Interpolator... | public void patchDevices(Device[] devices) { | 4 |
LTTPP/Eemory | org.lttpp.eemory/src/org/lttpp/eemory/exception/ThrowableHandler.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 org.apache.commons.lang3.exception.ExceptionUtils;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.lttpp.eemory.Constants;
import org.lttpp.eemory.EemoryPlugin;
import org.lttpp.... | package org.lttpp.eemory.exception;
public class ThrowableHandler {
public static void openError(final Shell shell, final String message) {
EclipseUtil.openErrorSyncly(shell, Messages.Plugin_Error_Occurred, message);
}
public static boolean handleDesignTimeErr(final Shell shell, final Throwable... | return LogUtil.error(Messages.bind(Messages.Plugin_OutOfDate, EemoryPlugin.getVersion())); | 8 |
mpetazzoni/ttorrent | ttorrent-tracker/src/main/java/com/turn/ttorrent/tracker/TrackerRequestProcessor.java | [
"public class Constants {\n public static final int DEFAULT_ANNOUNCE_INTERVAL_SEC = 15;\n\n public final static int DEFAULT_SOCKET_CONNECTION_TIMEOUT_MILLIS = 100000;\n public static final int DEFAULT_CONNECTION_TIMEOUT_MILLIS = 10000;\n\n public static final int DEFAULT_MAX_CONNECTION_COUNT = 100;\n\n public ... | import com.turn.ttorrent.Constants;
import com.turn.ttorrent.bcodec.BEValue;
import com.turn.ttorrent.common.LoggerUtils;
import com.turn.ttorrent.common.Peer;
import com.turn.ttorrent.common.TorrentLoggerFactory;
import com.turn.ttorrent.common.protocol.AnnounceRequestMessage;
import com.turn.ttorrent.common.protocol.... | /**
* Copyright (C) 2011-2012 Turn, Inc.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable ... | LoggerUtils.warnAndDebugDetails(logger, "Unable to parse request message. Request url is {}", uri, mve); | 1 |
wpilibsuite/EclipsePlugins | edu.wpi.first.wpilib.plugins.java/src/main/java/edu/wpi/first/wpilib/plugins/java/wizards/newproject/NewJavaWizard.java | [
"public class WPILibCore extends AbstractUIPlugin {\n\n\t// The plug-in ID\n\tpublic static final String PLUGIN_ID = \"edu.wpi.first.wpilib.plugins.core\"; //$NON-NLS-1$\n\n\t// The shared instance\n\tprivate static WPILibCore plugin;\n\n\t/**\n\t * The constructor\n\t */\n\tpublic WPILibCore() {\n\t}\n\n\t/*\n\t *... | import java.lang.reflect.InvocationTargetException;
import java.util.Properties;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.ISe... | package edu.wpi.first.wpilib.plugins.java.wizards.newproject;
/**
*
* Example Docs:
* This is a sample new wizard. Its role is to create a new file
* resource in the provided container. If the container resource
* (a folder or a project) is selected in the workspace
* when the wizard is opened, it will acc... | page = new NewProjectMainPage(selection, teamNumberPage, INewProjectInfo.Null); | 1 |
xuxueli/xxl-api | xxl-api-admin/src/main/java/com/xxl/api/admin/controller/XxlApiGroupController.java | [
"public class ArrayTool {\n\n public static final int INDEX_NOT_FOUND = -1;\n\n public static int getLength(final Object array) {\n if (array == null) {\n return 0;\n }\n return Array.getLength(array);\n }\n\n public static boolean isEmpty(final Object[] array) {\n ... | import com.xxl.api.admin.core.model.*;
import com.xxl.api.admin.core.util.tool.ArrayTool;
import com.xxl.api.admin.core.util.tool.StringTool;
import com.xxl.api.admin.dao.IXxlApiDocumentDao;
import com.xxl.api.admin.dao.IXxlApiGroupDao;
import com.xxl.api.admin.dao.IXxlApiProjectDao;
import com.xxl.api.admin.service.im... | package com.xxl.api.admin.controller;
/**
* @author xuxueli 2017-03-31 18:10:37
*/
@Controller
@RequestMapping("/group")
public class XxlApiGroupController {
@Resource
private IXxlApiProjectDao xxlApiProjectDao;
@Resource
private IXxlApiGroupDao xxlApiGroupDao;
@Resource
private IXxlApiDocumentDao xxlApiDoc... | XxlApiUser loginUser = (XxlApiUser) request.getAttribute(LoginService.LOGIN_IDENTITY); | 5 |
occi4java/occi4java | infrastructure/src/main/java/occi/infrastructure/compute/actions/CreateAction.java | [
"public abstract class Action {\n\t/**\n\t * The identifying Category of the Action. \n\t */\n\tprivate static Category category;\n\n\tpublic abstract void execute(URI uri, Method method);\n\n\t/**\n\t * Returns the category of the action. \n\t * \n\t * @return the category\n\t */\n\tpublic Category getCategory() {... | import java.net.URI;
import java.util.UUID;
import occi.core.Action;
import occi.core.Method;
import occi.infrastructure.Compute;
import occi.infrastructure.injection.Injection;
import occi.infrastructure.interfaces.ComputeInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /**
* 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... | private static ComputeInterface computeInterface = Injection | 3 |
NudgeApm/nudge-elasticstack-connector | src/test/java/org/nudge/elasticstack/type/SQLLayerTest.java | [
"public class SQLEvent extends NudgeEvent {\n\n\tpublic SQLEvent() {\n\t\tsuper.setType(EventType.SQL);\n\t}\n\n\t// ===========================\n\t// Getters and Setters\n\t// ===========================\n\n\t@Override\n\t@JsonProperty(\"sql_code\")\n\tpublic String getName() {\n\t\treturn super.getName();\n\t}\n\... | import org.junit.Assert;
import org.junit.Test;
import org.nudge.elasticstack.context.elasticsearch.bean.SQLEvent;
import org.nudge.elasticstack.context.elasticsearch.builder.LayerTransformer;
import org.nudge.elasticstack.context.nudge.dto.LayerCallDTO;
import org.nudge.elasticstack.context.nudge.dto.LayerDTO;
import ... | package org.nudge.elasticstack.type;
/**
* Test class of {@link LayerTransformer}
*/
public class SQLLayerTest {
private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
private LayerTransformer layerTransformer = new LayerTransformer();
@Test
public void test_BuildSQL... | LayerCallDTO layerCall = layer.createAddLayerDetail(); | 2 |
sdnwiselab/sdn-wise-java | data/src/main/java/com/github/sdnwiselab/sdnwise/mote/core/SinkCore.java | [
"public class RegProxyPacket extends NetworkPacket {\n\n /**\n * Fields, indexes and lenghts.\n */\n private static final int DPID_INDEX = 0, DPID_LEN = 8,\n IP_LEN = 4,\n MAC_INDEX = DPID_INDEX + DPID_LEN, MAC_LEN = 6, MAC_STR_LEN = 18,\n PORT_INDEX = MAC_INDEX + MAC_... | import com.github.sdnwiselab.sdnwise.packet.RegProxyPacket;
import com.github.sdnwiselab.sdnwise.mote.battery.Dischargeable;
import com.github.sdnwiselab.sdnwise.packet.BeaconPacket;
import com.github.sdnwiselab.sdnwise.packet.ConfigPacket;
import com.github.sdnwiselab.sdnwise.packet.DataPacket;
import com.github.sdnwi... | /*
* Copyright (C) 2015 SDN-WISE
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distribut... | RegProxyPacket rpp = new RegProxyPacket(1, getMyAddress(), switchDPid, | 0 |
material-motion/material-motion-android | library/src/main/java/com/google/android/material/motion/interactions/AdjustsAnchorPoint.java | [
"public class ConstraintApplicator<T> {\n\n private final Operation<T, T>[] constraints;\n\n public ConstraintApplicator(Operation<T, T>[] constraints) {\n this.constraints = constraints;\n }\n\n public MotionObservable<T> apply(MotionObservable<T> stream) {\n for (Operation<T, T> constraint : constraints... | import android.view.View;
import com.google.android.material.motion.ConstraintApplicator;
import com.google.android.material.motion.Interaction;
import com.google.android.material.motion.MotionObservable;
import com.google.android.material.motion.MotionRuntime;
import com.google.android.material.motion.gestures.Gesture... | /*
* Copyright 2017-present The Material Motion Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* ... | runtime.write(gestureStream.compose(anchored(target)), target, ViewProperties.ANCHOR_POINT_ADJUSTMENT); | 6 |
rkkr/simple-keyboard | app/src/main/java/rkr/simplekeyboard/inputmethod/keyboard/KeyboardLayoutSet.java | [
"public class KeyboardBuilder<KP extends KeyboardParams> {\n private static final String BUILDER_TAG = \"Keyboard.Builder\";\n private static final boolean DEBUG = false;\n\n // Keyboard XML Tags\n private static final String TAG_KEYBOARD = \"Keyboard\";\n private static final String TAG_ROW = \"Row\... | import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.text.InputType;
import android.util.Log;
import android.util.SparseArray;
import android.util.Xml;
import android.view.inputmethod.EditorInfo;
import ... | /*
* Copyright (C) 2011 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... | final KeyboardBuilder<KeyboardParams> builder = | 0 |
claudius108/oxygen-addon-builder-plugin | src/main/java/ro/kuberam/oxygen/addonBuilder/javafx/bridges/framework/FrameworkGeneratingBridge.java | [
"public class AddonBuilderPluginExtension implements WorkspaceAccessPluginExtension {\n\n\tprivate static final Logger logger = Logger.getLogger(AddonBuilderPluginExtension.class.getName());\n\n\tprivate static StandalonePluginWorkspace pluginWorkspaceAccess;\n\tpublic static Path pluginInstallDir;\n\tpublic static... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLDecoder;
import jav... | package ro.kuberam.oxygen.addonBuilder.javafx.bridges.framework;
public class FrameworkGeneratingBridge extends BaseBridge {
/**
*
*/
private static final long serialVersionUID = 1583182879142664468L;
public String oxygenInstallDir;
private Pattern frameworkIdPattern = Pattern.compile("^[a-z]+(\\.[a-z][a-... | public FrameworkGeneratingBridge(JavaFXDialog dialogWindow) { | 2 |
ScreamingHawk/fate-sheets | app/src/main/java/link/standen/michael/fatesheets/fragment/CoreCharacterEditStressFragment.java | [
"public class ConsequenceArrayAdapter extends ArrayAdapter<Consequence> {\n\n\tprivate static final String TAG = ConsequenceArrayAdapter.class.getName();\n\n\tprivate final Context context;\n\tprivate final int resourceId;\n\tprivate final List<Consequence> items;\n\n\tpublic ConsequenceArrayAdapter(@NonNull Contex... | import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import link.standen.michael.fatesheets.R;
import link.standen.michael.fatesheets.adapter.ConsequenceArrayAdapt... | package link.standen.michael.fatesheets.fragment;
/**
* A fragment for managing a characters stress.
*/
public class CoreCharacterEditStressFragment extends CharacterEditAbstractFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ret... | getCoreCharacter().getPhysicalStress().add(new Stress(nextValue)); | 5 |
prelert/engine-java | prelert-engine-api-common/src/main/java/com/prelert/job/persistence/JobProvider.java | [
"@JsonInclude(Include.NON_NULL)\npublic class ModelSnapshot\n{\n /**\n * Field Names\n */\n public static final String TIMESTAMP = \"timestamp\";\n public static final String DESCRIPTION = \"description\";\n public static final String RESTORE_PRIORITY = \"restorePriority\";\n public static fi... | import com.prelert.job.ModelSnapshot;
import com.prelert.job.NoSuchModelSnapshotException;
import com.prelert.job.UnknownJobException;
import com.prelert.job.audit.Auditor;
import com.prelert.job.quantiles.Quantiles; | /****************************************************************************
* *
* Copyright 2015-2016 Prelert Ltd *
* *
* Licen... | public QueryPage<ModelSnapshot> modelSnapshots(String jobId, int skip, int take) | 0 |
TechzoneMC/NPCLib | nms-v1_8_R1/src/main/java/net/techcable/npclib/nms/versions/v1_8_R1/NMS.java | [
"public interface HumanNPC extends LivingNPC {\r\n\r\n /**\r\n * Return this npc's skin\r\n * <p/>\r\n * A value of null represents a steve skin\r\n *\r\n * @return this npc's skin\r\n */\r\n public UUID getSkin();\r\n\r\n /**\r\n * Set the npc's skin\r\n * <p/>\r\n * A ... | import java.util.Collection;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.mojang.authlib.GameProfile;
import net.minecraft.server.v1_8_R1.EntityLiving;
import ... | package net.techcable.npclib.nms.versions.v1_8_R1;
public class NMS implements net.techcable.npclib.nms.NMS {
private static NMS instance;
public NMS() {
if (instance == null) instance = this;
}
public static NMS getInstance() {
return instance;
}
@Override
public I... | public static LivingNPCHook getHook(LivingNPC npc) { | 1 |
Tonius/E-Mobile | src/main/java/tonius/emobile/network/message/MessageCellphonePlayer.java | [
"public class EMConfig {\n \n public static Configuration config;\n public static List<ConfigSection> configSections = new ArrayList<ConfigSection>();\n \n public static final ConfigSection sectionGeneral = new ConfigSection(\"General Settings\", \"general\");\n public static final ConfigSection s... | import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import tonius.emobile.config.EMConfig;
import tonius.emobile.item.ItemCellphone;
import tonius.emobile.session.CellphoneSessionPlayer;
import tonius.emobi... | package tonius.emobile.network.message;
public class MessageCellphonePlayer implements IMessage, IMessageHandler<MessageCellphonePlayer, IMessage> {
private String requesting;
private String receiving;
public MessageCellphonePlayer() {
}
public MessageCellphonePlayer(String requesti... | EntityPlayerMP requestingPlayer = ServerUtils.getPlayerOnServer(msg.requesting); | 4 |
guillaume-alvarez/ShapeOfThingsThatWere | core/src/com/galvarez/ttw/rendering/CounterRenderSystem.java | [
"public final class MapPosition extends Component {\r\n\r\n public final int x, y;\r\n\r\n public MapPosition(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }\r\n\r\n @Override\r\n public int hashCode() {\r\n return x + y * 31;\r\n }\r\n\r\n @Override\r\n public boolean equals(Object obj) {\r\... | import java.util.HashMap;
import java.util.Map;
import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.utils.ImmutableBag;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.ba... | package com.galvarez.ttw.rendering;
@Wire
public final class CounterRenderSystem extends AbstractRendererSystem {
private static final int SIZE = 32;
private ComponentMapper<MapPosition> positions;
| private ComponentMapper<Counter> counters; | 2 |
codingricky/marvel-rest-client | src/main/java/com/github/codingricky/marvel/URLFactory.java | [
"public abstract class AbstractParameters {\n\n protected Integer limit;\n protected Integer offset;\n protected Date modifiedSince;\n\n protected List<Integer> creators = new ArrayList<Integer>();\n protected List<Integer> series = new ArrayList<Integer>();\n protected List<Integer> comics = new ... | import com.github.codingricky.marvel.parameter.AbstractParameters;
import com.github.codingricky.marvel.parameter.CharacterParameters;
import com.github.codingricky.marvel.parameter.ComicParameters;
import com.github.codingricky.marvel.parameter.CreatorParameters;
import com.github.codingricky.marvel.parameter.EventPar... | package com.github.codingricky.marvel;
public class URLFactory {
private static final String BASE_URL = "http://gateway.marvel.com/v1/public/";
private static final String COMICS_CHARACTERS_URL = BASE_URL + "comics/%d/characters";
private static final String COMICS_CREATORS_URL = BASE_URL + "comics/%d/c... | public String getCharactersEventURL(EventParameters eventParameters) { | 4 |
anqit/spanqit | src/main/java/com/anqit/spanqit/graphpattern/TriplePattern.java | [
"public static StringLiteral[] toRdfLiteralArray(String... literals) {\n\treturn Arrays.stream(literals).map(Rdf::literalOf).toArray(StringLiteral[]::new);\n}",
"public class Rdf {\n\t// not sure if other protocols are generally used in RDF iri's?\n\tprivate static final Set<String> IRI_PROTOCOLS = Stream.of(\"h... | import static com.anqit.spanqit.rdf.Rdf.toRdfLiteralArray;
import com.anqit.spanqit.rdf.Rdf;
import com.anqit.spanqit.rdf.RdfObject;
import com.anqit.spanqit.rdf.RdfPredicate;
import com.anqit.spanqit.rdf.RdfPredicateObjectList; | package com.anqit.spanqit.graphpattern;
/**
* Denotes a SPARQL Triple Pattern
*
* @see <a
* href="http://www.w3.org/TR/2013/REC-sparql11-query-20130321/#QSynTriples">
* Triple pattern syntax</a>
* @see <a href="https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#QSynBlankNodes">
* blank node ... | public TriplePattern andHas(RdfPredicateObjectList... lists); | 4 |
JoaquimLey/avenging | core/src/test/java/com/joaquimley/core/ListPresenterTest.java | [
"public class DataManager {\n\n private static DataManager sInstance;\n\n private final MarvelService mMarvelService;\n\n public static DataManager getInstance() {\n if (sInstance == null) {\n sInstance = new DataManager();\n }\n return sInstance;\n }\n\n private DataM... | import android.text.TextUtils;
import com.joaquimley.core.data.DataManager;
import com.joaquimley.core.data.model.CharacterMarvel;
import com.joaquimley.core.data.model.DataContainer;
import com.joaquimley.core.data.model.DataWrapper;
import com.joaquimley.core.data.network.RemoteCallback;
import com.joaquimley.core.ui... | package com.joaquimley.core;
@RunWith(PowerMockRunner.class)
@PrepareForTest(TextUtils.class)
public class ListPresenterTest {
@Mock
private DataManager mDataManager;
@Mock
private ListContract.ListView mView;
@Captor | private ArgumentCaptor<RemoteCallback<DataWrapper<List<CharacterMarvel>>>> mGetCharactersListCallbackCaptor; | 1 |
vbauer/herald | src/test/java/com/github/vbauer/herald/injector/LoggerInjectorTest.java | [
"@RunWith(BlockJUnit4ClassRunner.class)\npublic abstract class BasicTest {\n\n protected final void checkUtilConstructorContract(final Class<?> utilClass) {\n PrivateConstructorChecker\n .forClass(utilClass)\n .expectedTypeOfException(UnsupportedOperationException.class)\n ... | import com.github.vbauer.herald.core.BasicTest;
import com.github.vbauer.herald.exception.MissedLogFactoryException;
import com.github.vbauer.herald.ext.spring.bean.CheckerBean;
import com.github.vbauer.herald.ext.spring.bean.ClassLogBean;
import com.github.vbauer.herald.ext.spring.bean.IncorrectLogBean;
import com.git... | package com.github.vbauer.herald.injector;
/**
* @author Vadislav Bauer
*/
public class LoggerInjectorTest extends BasicTest {
@Test
public void testConstructorContract() throws Exception {
checkUtilConstructorContract(LoggerInjector.class);
}
@Test
public void testNullBean() {
... | final NamedLogBean namedLogBean = new NamedLogBean(); | 6 |
jchampemont/notedown | src/main/java/com/jeanchampemont/notedown/web/SettingsController.java | [
"@Service\npublic class AuthenticationService {\n private UserRepository userRepository;\n\n private AuthenticationManager authenticationManager;\n\n @Autowired\n public AuthenticationService(UserRepository userRepository, AuthenticationManager authenticationManager) {\n this.userRepository = use... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import com.jeanchampemont.notedown.security.AuthenticationService;
import com.jeanchampemont.notedown.user.UserService;
import com.jeanchampemont.notedown.user.persistence.User;
import com.jeanchampemont.notedown.web.... | /*
* Copyright (C) 2014, 2015 NoteDown
*
* This file is part of the NoteDown 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
... | User user = authenticationService.getCurrentUser(); | 2 |
abego/treelayout | org.abego.treelayout.demo/src/main/java/org/abego/treelayout/demo/svg/SVGForTextInBoxTree.java | [
"public static String doc(String content) {\n\treturn String\n\t\t\t.format(\"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\" ?>\\n\"\n\t\t\t\t\t+ \"<!DOCTYPE svg PUBLIC \\\"-//W3C//DTD SVG 20010904//EN\\\" \\\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\\\">\\n\"\n\t\t\t\t\t+ \"%s\\n\", content);\n}",... | import static org.abego.treelayout.demo.svg.SVGUtil.line;
import static org.abego.treelayout.demo.svg.SVGUtil.rect;
import static org.abego.treelayout.demo.svg.SVGUtil.svg;
import static org.abego.treelayout.demo.svg.SVGUtil.text;
import java.awt.Dimension;
import java.awt.geom.Rectangle2D;
import org.abego.treelayout.... | /*
* [The "BSD license"]
* Copyright (c) 2011, abego Software GmbH, Germany (http://www.abego.org)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code ... | String[] lines = textInBox.text.split("\n"); | 4 |
rjeschke/weel | src/main/java/com/github/rjeschke/weel/jclass/WeelThread.java | [
"public class WeelException extends RuntimeException\n{\n /** serialVersionUID */\n private static final long serialVersionUID = 7187502537191362694L;\n private final Value value;\n \n /**\n * @param value The Weel value.\n */\n public WeelException(final Value value)\n {\n super... | import com.github.rjeschke.weel.WeelException;
import com.github.rjeschke.weel.WeelRuntime;
import com.github.rjeschke.weel.ValueMap;
import com.github.rjeschke.weel.Weel;
import com.github.rjeschke.weel.WeelFunction;
import com.github.rjeschke.weel.WeelOop;
import com.github.rjeschke.weel.annotations.WeelClass;
import... | /*
* Copyright (C) 2011 René Jeschke <rene_jeschke@yahoo.de>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | private final Weel weel; | 3 |
ls1110924/ImmerseMode | immerse/src/main/java/com/yunxian/immerse/impl/TpSbNNbwFCwARImmerseMode.java | [
"public final class ImmerseConfiguration {\n\n final ImmerseType mImmerseTypeInKK;\n final ImmerseType mImmerseTypeInL;\n\n public final boolean lightStatusBar;\n public final boolean coverCompatMask;\n public final int coverMaskColor;\n\n private ImmerseConfiguration(@NonNull ImmerseType immerseT... | import android.annotation.TargetApi;
import android.app.Activity;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import androidx.annotation.ColorInt;
imp... | package com.yunxian.immerse.impl;
/**
* 全透明状态栏+普通导航栏+内容全屏+EditText Adjust-Resize模式
*
* @author AShuai
* @email ls1110924@gmail.com
* @date 17/2/3 下午5:55
*/
@TargetApi(LOLLIPOP)
public class TpSbNNbwFCwARImmerseMode extends AbsImmerseMode {
private final ConsumeInsetsFrameLayout mNewUserViewGroup;
//... | ViewUtils.addSystemUiFlags(window.getDecorView(), View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); | 2 |
EsupPortail/esup-papercut | src/main/java/org/esupportail/papercut/web/AdminController.java | [
"@Component\n@ConfigurationProperties(prefix=\"esup\")\n@PropertySource(value = \"classpath:/esup-papercut.properties\", encoding = \"UTF-8\")\n@EnableGlobalMethodSecurity(prePostEnabled=true)\npublic class EsupPapercutConfig {\n\n\tString defaultContext = null;\n\t\n\tMap<String, EsupPapercutContext> contexts;\n\n... | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.esupportail.papercut.config.EsupPapercutConfig;
import org.esupportail.paper... | /**
* Licensed to EsupPortail under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* EsupPortail licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file ... | PayPapercutTransactionLog txLog = papercutDaoService.findById(id); | 3 |
FernandoOrtegaMartinez/Planket | app/src/main/java/com/fomdeveloper/planket/ui/presentation/login/FlickrLoginActivity.java | [
"public class PlanketApplication extends Application {\n\n private AppComponent appComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n Crashlytics crashlyticsKit = new Crashlytics.Builder()\n .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG... | import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import com.fomdeveloper.planket.Bui... | package com.fomdeveloper.planket.ui.presentation.login;
/**
* Created by Fernando on 23/09/16.
*/
public class FlickrLoginActivity extends OauthActivity implements OauthView{
@Inject | OauthPresenter presenter; | 5 |
indvd00m/java-ascii-render | ascii-render/src/test/java/com/indvd00m/ascii/render/tests/TestLine.java | [
"public class Canvas implements ICanvas {\n\n\tpublic static final char NULL_CHAR = '\\0';\n\n\tprotected final int width;\n\tprotected final int height;\n\tprotected final List<StringBuilder> lines;\n\n\t// cache\n\tprotected String cachedText;\n\tprotected String cachedLines;\n\tprotected boolean needUpdateCache ... | import com.indvd00m.ascii.render.Canvas;
import com.indvd00m.ascii.render.Point;
import com.indvd00m.ascii.render.api.ICanvas;
import com.indvd00m.ascii.render.api.IContext;
import com.indvd00m.ascii.render.api.IPoint;
import com.indvd00m.ascii.render.elements.Line;
import org.junit.Test;
import static org.junit.Assert... | package com.indvd00m.ascii.render.tests;
/**
* @author indvd00m (gotoindvdum[at]gmail[dot]com)
* @since 0.9.0
*/
public class TestLine {
@Test
public void test01() {
IContext context = mock(IContext.class); | ICanvas canvas = new Canvas(10, 5); | 0 |
all4you/redant | redant-core/src/main/java/com/redant/core/executor/HttpResponseExecutor.java | [
"public class InvocationException extends Exception{\n\tprivate static final long serialVersionUID = 1L;\n\n public InvocationException(String message, Throwable cause) {\n super(message, cause);\n }\n\n}",
"public class HttpRenderUtil {\n\n public static final String EMPTY_CONTENT = \"\";\n\n ... | import cn.hutool.core.collection.CollectionUtil;
import com.redant.core.common.exception.InvocationException;
import com.redant.core.common.util.HttpRenderUtil;
import com.redant.core.common.util.HttpRequestUtil;
import com.redant.core.context.RedantContext;
import com.redant.core.controller.ControllerProxy;
import com... | package com.redant.core.executor;
/**
* @author houyi
*/
public class HttpResponseExecutor extends AbstractExecutor<HttpResponse> {
private final static Logger LOGGER = LoggerFactory.getLogger(HttpResponseExecutor.class);
private static ControllerContext controllerContext = DefaultControllerContext.getIn... | Map<String, List<String>> paramMap = HttpRequestUtil.getParameterMap(httpRequest); | 2 |
pierre/hfind | src/main/java/com/ning/hfind/primary/Expression.java | [
"public interface FileAttributes extends Comparable<FileAttributes>\n{\n public ReadableDateTime getAccessDate();\n\n public ReadableDateTime getModificationDate();\n\n public boolean isDirectory();\n\n public long getLength();\n\n public long getBlockSize();\n\n public int getReplicationCount();\... | import com.ning.hfind.FileAttributes;
import com.ning.hfind.FsItem;
import com.ning.hfind.HdfsAccess;
import com.ning.hfind.HdfsItem;
import com.ning.hfind.Printer;
import com.ning.hfind.PrinterConfig;
import java.io.IOException; | /*
* Copyright 2010 Ning, Inc.
*
* Ning licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | FsItem listing = new HdfsItem(HdfsAccess.get(), path, depth); | 1 |
corehunter/corehunter3 | corehunter-services/corehunter-services-simple/src/main/java/org/corehunter/services/simple/SimpleCoreHunterRunServices.java | [
"public class CoreHunter {\n\n // defaults\n private static final int DEFAULT_MAX_TIME_WITHOUT_IMPROVEMENT = 10000;\n private static final int FAST_MAX_TIME_WITHOUT_IMPROVEMENT = 2000;\n \n // parallel tempering settings\n private static final int PT_NUM_REPLICAS = 10;\n private static fina... | import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import... | } catch (IOException e) {
logger.error("Can not load result from path {} due to {}", path, e.getMessage());
logger.error("Full error ", e);
e.printStackTrace();
}
}
private void saveResult(CoreHunterRunResultPojo coreHunterRunResult) {
Path ... | private CoreHunterRunStatus status; | 7 |
onepf/OPFPush | samples/pushchat/src/main/java/org/onepf/pushchat/ui/dialog/AddContactDialogFragment.java | [
"public class PushChatApplication extends Application {\n\n private static final String GCM_SENDER_ID = \"707033278505\";\n\n private static final String NOKIA_SENDER_ID = \"pushsample\";\n\n private String uuid;\n\n private RefWatcher refWatcher;\n\n @Override\n public void onCreate() {\n ... | import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import ... | /*
* Copyright 2012-2015 One Platform Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | DatabaseHelper.getInstance(getActivity()).addContact(new Contact(name, uuid)); | 2 |
guillaume-alvarez/ShapeOfThingsThatWere | core/src/com/galvarez/ttw/rendering/InfluenceRenderSystem.java | [
"public final class InfluenceSource extends Component {\n\n private float power = InfluenceSystem.INITIAL_POWER;\n\n /** In per mille. */\n public int growth;\n\n /** Usually compared to power. */\n public int health = InfluenceSystem.INITIAL_POWER;\n\n public final Set<MapPosition> influencedTiles = new Hash... | import static java.lang.Math.min;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.artemis.ComponentMapper;
import com.artemis.Entity;
import com.artemis.annotations.Wire;
import com.artemis.utils.Immutabl... | package com.galvarez.ttw.rendering;
@Wire
public final class InfluenceRenderSystem extends AbstractRendererSystem {
private ComponentMapper<Empire> empires;
private final GameMap map;
private final EnumMap<Border, AtlasRegion> borderTexture = new EnumMap<>(Border.class);
private final AtlasRegion blank;... | FloatPair position = MapTools.world2window(p); | 7 |
UweTrottmann/MovieTracker | SeriesGuideMovies/src/com/uwetrottmann/movies/ui/CancelCheckInDialogFragment.java | [
"public class ServiceManager {\n /** API key. */\n private String apiKeyValue;\n /** User email. */\n private String username;\n /** User password. */\n private String password_sha;\n /** Connection timeout (in milliseconds). */\n private Integer connectionTimeout;\n /** Read timeout (in ... | import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fr... | /*
* Copyright 2012 Uwe Trottmann
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed ... | ServiceManager manager; | 0 |
DigiArea/es5-model | com.digiarea.es5/src/com/digiarea/es5/LetExpression.java | [
"public abstract class Expression extends Node {\r\n\r\n Expression() {\r\n super();\r\n }\r\n\r\n Expression(JSDocComment jsDocComment, int posBegin, int posEnd) {\r\n super(jsDocComment, posBegin, posEnd);\r\n }\r\n\r\n}\r",
"public class VariableDeclaration extends Node {\r\n\r\n /... | import com.digiarea.es5.Expression;
import com.digiarea.es5.VariableDeclaration;
import com.digiarea.es5.NodeList;
import com.digiarea.es5.JSDocComment;
import com.digiarea.es5.visitor.VoidVisitor;
import com.digiarea.es5.visitor.GenericVisitor;
| package com.digiarea.es5;
/**
* The Class LetExpression.
*/
public class LetExpression extends Expression {
/**
* The variable declarations.
*/
private NodeList<VariableDeclaration> variableDeclarations = null;
/**
* The expression.
*/
private Expression expr... | public <R, C> R accept(GenericVisitor<R, C> v, C ctx) throws Exception {
| 5 |
RedMadRobot/Chronos | chronos/src/main/java/com/redmadrobot/chronos/gui/fragment/ChronosSupportFragment.java | [
"public final class ChronosConnector {\n\n private final static String KEY_CHRONOS_LISTENER_ID = \"chronos_listener_id\";\n\n private ChronosListener mChronosListener;\n\n private Object mGUIClient;\n\n /**\n * GUI client should call this method in its own onCreate() method.\n *\n * @param c... | import com.redmadrobot.chronos.ChronosConnector;
import com.redmadrobot.chronos.ChronosOperation;
import com.redmadrobot.chronos.gui.ChronosConnectorWrapper;
import com.redmadrobot.chronos.gui.fragment.dialog.ChronosDialogFragment;
import com.redmadrobot.chronos.gui.fragment.dialog.ChronosSupportDialogFragment;
import ... | package com.redmadrobot.chronos.gui.fragment;
/**
* A Fragment of support library that is connected to Chronos.
*
* @author maximefimov
* @see ChronosDialogFragment
* @see ChronosFragment
* @see ChronosSupportDialogFragment
*/
@SuppressWarnings("unused")
public abstract class ChronosSupportFragment extends F... | private final ChronosConnector mConnector = new ChronosConnector(); | 0 |
narrowtux/Showcase | src/main/java/com/narrowtux/showcase/types/BasicShowcase.java | [
"public class Showcase extends JavaPlugin {\n\tprivate Logger log;\n\tprivate ShowcasePlayerListener playerListener = new ShowcasePlayerListener();\n\tprivate ShowcaseBlockListener blockListener = new ShowcaseBlockListener();\n\tprivate ShowcaseWorldListener worldListener = new ShowcaseWorldListener();\n\tpublic st... | import com.narrowtux.showcase.Showcase;
import com.narrowtux.showcase.ShowcaseCreationAssistant;
import com.narrowtux.showcase.ShowcaseExtra;
import com.narrowtux.showcase.ShowcasePlayer;
import com.narrowtux.showcase.ShowcaseProvider; | /*
* Copyright (C) 2011 Moritz Schmale <narrow.m@gmail.com>
*
* Showcase is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Th... | ShowcasePlayer player = ShowcasePlayer.getPlayer(assistant.getPlayer()); | 3 |
horizon-institute/artcodes-android | app/src/main/java/uk/ac/horizon/artcodes/detect/handler/MarkerActionDetectionHandler.java | [
"public class Utils {\n\n public static String exportResource(Context context, int resourceId) {\n return exportResource(context, resourceId, \"OpenCV_data\");\n }\n\n public static String exportResource(Context context, int resourceId, String dirname) {\n String fullname = context.getResourc... | import java.util.Collection;
import uk.ac.horizon.artcodes.detect.marker.Marker;
import uk.ac.horizon.artcodes.drawer.MarkerDrawer;
import uk.ac.horizon.artcodes.model.Action;
import uk.ac.horizon.artcodes.model.Experience;
import uk.ac.horizon.artcodes.model.MarkerImage;
import android.graphics.Bitmap;
import android.... | /*
* Artcodes recognises a different marker scheme that allows the
* creation of aesthetically pleasing, even beautiful, codes.
* Copyright (C) 2013-2016 The University of Nottingham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Pu... | public void onMarkersDetected(Collection<Marker> markers, ArrayList<MatOfPoint> contours, Mat hierarchy, Size sourceImageSize) | 1 |
emop/EmopAndroid | src/com/emop/client/provider/DataUpdateService.java | [
"public class Constants {\r\n\tpublic static final String APP_ID = \"\";\r\n\tpublic static final String TAG_EMOP = \"emop\";\r\n\t\r\n\tpublic static final String PREFS_NAME = \"taodianhuo_perfs\";\r\n\t\r\n\tpublic static final String PREFS_OAUTH_ID = \"fmei_user_id\";\r\n\tpublic static final String PREFS_TRACK_... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.u... | return true;
}
return false;
}
private boolean isForceRefresh(Uri uri){
String q = uri.getQueryParameter("force_refresh");
return q != null && q.equals("y");
}
private boolean allowEmpty(Uri uri){
String q = uri.getQueryParameter("empty");
return q != null && q.equals("y");
}
... | Rebate.convertJson(jarray.getJSONObject(i)),
| 4 |
wesabe/grendel | src/test/java/com/wesabe/grendel/resources/tests/LinkedDocumentResourceTest.java | [
"public class Credentials {\n\t/**\n\t * An authentication challenge {@link Response}. Use this when a client's\n\t * provided credentials are invalid.\n\t */\n\tpublic static final Response CHALLENGE =\n\t\tResponse.status(Status.UNAUTHORIZED)\n\t\t\t.header(HttpHeaders.WWW_AUTHENTICATE, \"Basic realm=\\\"Grendel\... | import static org.fest.assertions.Assertions.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import j... | package com.wesabe.grendel.resources.tests;
@RunWith(Enclosed.class)
public class LinkedDocumentResourceTest {
private static abstract class Context {
protected UserDAO userDAO;
protected DocumentDAO documentDAO;
protected Credentials credentials;
protected User owner, user;
protected UnlockedKeySet ke... | protected Session session; | 1 |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/activities/RadiusSearchActivity.java | [
"@Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)\npublic abstract class AppDatabase extends RoomDatabase {\n public static final String DB_NAME = \"PF_WEATHER_DB.db\";\n static final int VERSION = 7;\n static... | import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.TextView;
import androidx.core.content.res.Resources... | package org.secuso.privacyfriendlyweather.activities;
/**
* This activity provides the functionality to search the best weather around a given location.
*/
public class RadiusSearchActivity extends BaseActivity {
/**
* Visual components
*/
private AppPreferencesManager prefManager;
private ... | IHttpRequestForRadiusSearch radiusSearchRequest = new OwmHttpRequestForRadiusSearch(getApplicationContext()); | 6 |
Medo42/Gmk-Splitter | src/com/ganggarrison/gmdec/files/ObjectFormat.java | [
"public class DeferredReferenceCreatorNotifier {\n\tprivate Set<DeferredReferenceCreator> drcSet = new HashSet<DeferredReferenceCreator>();\n\n\tpublic void addDeferredReferenceCreator(DeferredReferenceCreator drc) {\n\t\tdrcSet.add(drc);\n\t}\n\n\tpublic void createReferences(GmFile gmf) {\n\t\tfor (DeferredRefere... | import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import org.lateralgm.file.GmFile;
import org.lateralgm.resources.GmObject;
import org.lateralgm.resources.sub.Event;
import org.lateralgm.resources.sub.MainEvent;
import com.ganggarrison.gmdec.DeferredReferenceCreatorNotifier;
import com.gangga... | /*
* Copyright (C) 2010 Medo <smaxein@googlemail.com>
*
* This file is part of GmkSplitter.
* GmkSplitter is free software and comes with ABSOLUTELY NO WARRANTY.
* See LICENSE for details.
*/
package com.ganggarrison.gmdec.files;
public class ObjectFormat extends ResourceFormat<GmObject> {
@Override
public... | GmObject gmObject = new GmObjectXmlFormat().read(getXmlFile(path, entry), drcn); | 4 |
Catalysts/cat-boot | cat-boot-report-pdf/src/test/java/cc/catalysts/boot/report/pdf/impl/CorruptPdfTest.java | [
"public interface PdfReportService {\n\n PdfReportBuilder createBuilder();\n\n PdfReportBuilder createBuilder(PdfStyleSheet config);\n}",
"@ConfigurationProperties(prefix = \"cat-boot.report.pdf.stylesheet\", ignoreUnknownFields = false)\npublic class DefaultPdfStyleSheet extends PdfStyleSheet {\n\n}",
"p... | import cc.catalysts.boot.report.pdf.PdfReportService;
import cc.catalysts.boot.report.pdf.config.DefaultPdfStyleSheet;
import cc.catalysts.boot.report.pdf.config.PdfFont;
import cc.catalysts.boot.report.pdf.config.PdfPageLayout;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pd... | package cc.catalysts.boot.report.pdf.impl;
public class CorruptPdfTest {
private final PDColor BLACK = new PDColor(new float[]{0.0f, 0.0f, 0.0f}, PDDeviceRGB.INSTANCE);
@Test(expected = PdfReportGeneratorException.class)
public void generateCorruptPdf() throws IOException { | ReportTable.setLayoutingAssertionsEnabled(true); | 5 |
sangupta/dry-redis | src/main/java/com/sangupta/dryredis/DryRedisGeo.java | [
"public interface DryRedisCache {\n\t\n /**\n\t * Delete the keys matching the pattern and return the number of keys\n\t * removed.\n\t * \n\t * @param key\n\t * the key to remove\n\t * \n\t * @return the number of keys removed\n\t */\n\tpublic int del(String key);\n\t\n\t/**\n\t * Get the {@link DryR... | import com.sangupta.dryredis.support.Haversine;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.sangupta.dryredis.support.DryRedisCache;
import com.sangupta.dryredis.support.DryRedisCacheType;
import com.sangupta.dryredis.support.DryRedisGeoPoint;
import com... | /**
*
* dry-redis: In-memory pure java implementation to Redis
* Copyright (c) 2016, Sandeep Gupta
*
* http://sangupta.com/projects/dry-redis
*
* 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 L... | public Double geodist(String key, String member1, String member2, DryRedisGeoUnit unit) { | 3 |
tticoin/JointER | src/jp/tti_coin/main/java/data/nlp/relation/SimpleRelationFeatureCache.java | [
"public class NICTNounSynonymsDB extends SynonymsDB {\n\tprotected NavigableSet<Tuple2<String, Tuple2<String,Double>>> nounSynonymsDB;\n\n\tpublic NICTNounSynonymsDB(String filename) {\n\t\tsuper(filename);\n\t\tnounSynonymsDB = db.getTreeSet(\"SW\");\n\t}\n\t\n\t@Override\n\tpublic Map<String, Float> getDirectSyno... | import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.Vector;
import utils.NICTNounSynonymsDB;
import utils.SynonymsDB;
import config.Parameters;
import data.nlp.Dijkstra;
import data.nlp.Node;
import model.FeatureCache;
import model.SparseFeatureVector;
imp... | package data.nlp.relation;
public class SimpleRelationFeatureCache extends FeatureCache {
private static SynonymsDB synonymsDB;
private final int NGRAM_SIZE = 3;
| public SimpleRelationFeatureCache(Parameters params, Node node) { | 4 |
simo415/spc | src/com/sijobe/spc/command/UsePortal.java | [
"public abstract class Parameter {\n\n private String label;\n private boolean optional;\n private boolean variableLength;\n \n public Parameter(String label, boolean optional) {\n this.label = label;\n this.optional = optional;\n }\n \n public Parameter(String label, boolean optional, boo... | import java.util.List;
import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterString;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandSender;
import com.sijobe.spc.wrapper.Player; | package com.sijobe.spc.command;
/**
* Changes the dimension that the player is in
*
* @author simo_415
* @version 1.0
*/
@Command (
name = "useportal",
description = "Changes the dimension that the player is in",
videoURL = "http://www.youtube.com/watch?v=HbhgS5JyPHc",
version = "1.4.6"
)
public cla... | new ParameterString("<normal|nether|end>", false, | 1 |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/config/Configurator.java | [
"public enum Level {\n\tFATAL(Level.FATAL_INT),\n\tERROR(Level.ERROR_INT),\n\tWARN(Level.WARN_INT),\n\tINFO(Level.INFO_INT),\n\tDEBUG(Level.DEBUG_INT),\n\tTRACE(Level.TRACE_INT),\n\tOFF(Level.OFF_INT);\n\t\n\tpublic static final int FATAL_INT = 16;\n\tpublic static final int ERROR_INT = 8;\n\tpublic static final in... | import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.util.Log;
import com.github.lisicnu.log4android.Level;
import com.github.lisicnu.log4android.Logger;
import com.github.lisicnu.log4android... | /**
*
*/
package com.github.lisicnu.log4android.config;
/**
* The {@link Configurator} is used for configuration via a properties file. The
* properties file should be put in one of the following directories: <br/>
* <br/>
* <font color='red'>Note: <br/>
* call this method before your application's first log... | public static final String[] FORMATTER_ALIASES = {"SimpleFormatter", "PatternFormatter"}; | 5 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/QuandlSession.java | [
"public static final class Builder {\n private final String _quandlCode;\n private LocalDate _startDate;\n private LocalDate _endDate;\n private Integer _columnIndex;\n private Frequency _frequency;\n private Integer _maxRows;\n private Transform _transform;\n private SortOrder _sortOrder;\n\n private Buil... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import javax.ws.rs.cl... | package com.jimmoores.quandl;
/**
* @deprecated use e.g. ClassicQuandlSession, StringQuandlSession or TableSawQuandlSession
*
* Quandl session class. Create an instance with either
*
* <pre>
* QuandlSession.of(SessionOptions.withAuthToken(AUTH_TOKEN));
* </pre>
*
* to use your API authorization token s... | ArgumentChecker.notNull(authToken, "authToken"); | 4 |
BeYkeRYkt/LightAPI | bukkit-backward-support/src/main/java/ru/beykerykt/lightapi/LightAPI.java | [
"@Deprecated\npublic class ChunkInfo {\n\n private final World world;\n private final int x;\n private final int z;\n private int y;\n private Collection<? extends Player> receivers;\n\n public ChunkInfo(World world, int chunkX, int chunkZ, Collection<? extends Player> players) {\n this(wor... | import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Collection;
i... | /*
* The MIT License (MIT)
*
* Copyright 2021 Vladimir Mikhailov <beykerykt@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 limitati... | IChunkData newData = handler.createChunkData(event.getChunkInfo().getWorld().getName(), | 7 |
truecaller/android-actors-library | generator/src/test/java/com/truecaller/androidactors/ActorInterfaceDescriptionImplTest.java | [
"public class ActorClass {\n}",
"public interface ActorGenerifiedPromise {\n @NonNull\n Promise testMethod();\n}",
"public interface ActorNullablePromise {\n Promise<String> testMethod();\n}",
"public interface ActorWithConstant {\n int CONSTANT = 10;\n}",
"public interface ActorWithException {\... | import com.google.common.collect.Iterables;
import com.google.testing.compile.CompilationRule;
import com.truecaller.androidactors.cases.ActorClass;
import com.truecaller.androidactors.cases.ActorGenerifiedPromise;
import com.truecaller.androidactors.cases.ActorNullablePromise;
import com.truecaller.androidactors.cases... | /*
* Copyright (C) 2017 True Software Scandinavia AB
*
* 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 applica... | TypeElement element = getTypeElement(ActorWithNonPromise.class); | 6 |
TreyRuffy/CommandBlocker | Command Blocker Bungee/src/main/java/me/treyruffy/commandblocker/bungeecord/listeners/BungeeCommandValueListener.java | [
"public class Log {\n\n\tpublic static void addLog(MethodInterface mi, String s) {\n\t\ttry {\n\t\t\tList<String> log = getLog(mi);\n\t\t\tif (log == null) {\n\t\t\t\tmi.log(s);\n\t\t\t\tmi.log(\"&cTrey's Command Blocker: Could not access log.txt!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tPath file = Paths.get(mi.getDat... | import com.google.gson.Gson;
import com.google.gson.JsonObject;
import me.treyruffy.commandblocker.Log;
import me.treyruffy.commandblocker.MethodInterface;
import me.treyruffy.commandblocker.Universal;
import me.treyruffy.commandblocker.bungeecord.BungeeMain;
import me.treyruffy.commandblocker.bungeecord.Variables;
imp... | package me.treyruffy.commandblocker.bungeecord.listeners;
public class BungeeCommandValueListener implements Listener {
public static HashMap<String, String> lookingFor = new HashMap<>();
public static HashMap<String, JsonObject> partsHad = new HashMap<>();
public static HashMap<String, BossBar> bossBar = new Ha... | MethodInterface mi = Universal.get().getMethods(); | 1 |
kinow/tap-plugin | src/main/java/org/tap4j/plugin/TapResult.java | [
"public class ParseErrorTestSetMap extends TestSetMap {\n\n private static final long serialVersionUID = 6433486962160499201L;\n\n private final Throwable cause;\n\n /**\n * @param fileName TAP file name\n * @param cause {@link Throwable} that caused the TAP parse error\n */\n public ParseEr... | import hudson.FilePath;
import hudson.model.ModelObject;
import hudson.model.Run;
import hudson.tasks.test.TestObject;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import org.kohsuke.stapler.StaplerRequest;
import org.koh... | }
/**
* @param owner the owner to set
*/
public void setOwner(Run owner) {
this.build = owner;
}
public List<TestSetMap> getTestSets() {
return this.testSets;
}
public boolean isEmptyTestSet() {
return this.testSets.size() <= 0;
}
... | TapAttachment attachment = getAttachment(ts, key);
| 1 |
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;... | // access the request headers and get the X-OCCI-Attribute
Form requestHeaders = (Form) getRequest().getAttributes().get(
"org.restlet.http.headers");
LOGGER.debug("Current request: " + requestHeaders);
String attributeCase = OcciCheck.checkCaseSensitivity(
requestHeaders.toString()).get("x-occi-a... | Network network = Network.getNetworkList().get(UUID | 4 |
codecentric/conference-app | app/src/main/java/de/codecentric/controller/ProposeSessionController.java | [
"public interface LocationDao {\r\n\r\n List<Location> getLocations();\r\n\r\n Location getLocation(String shortName);\r\n\r\n}\r",
"public interface SessionDao {\n\n List<Session> getAllSessions();\n\n List<String> getListOfConferenceDays();\n\n List<Session> getAllStaticSessions();\n\n /* retu... | import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
... | package de.codecentric.controller;
@Controller
@RequestMapping("/proposeNewSession")
public class ProposeSessionController {
@Autowired
| private SessionDao sessionDao;
| 1 |
afpdev/alpheusafpparser | src/main/java/com/mgz/afp/foca/FNI_FontIndex.java | [
"@AFPType\npublic abstract class StructuredField implements IAFPDecodeableWriteable {\n\n @AFPField\n StructuredFieldIntroducer structuredFieldIntroducer;\n /**\n * The structured field's padding data. Contains null if this structured field has no padding\n * data.\n */\n @AFPField(isOptional = true, maxS... | import java.io.OutputStream;
import java.util.*;
import com.mgz.afp.base.StructuredField;
import com.mgz.afp.base.annotations.AFPField;
import com.mgz.afp.exceptions.AFPParserException;
import com.mgz.afp.exceptions.IAFPDecodeableWriteable;
import com.mgz.afp.foca.FNI_FontIndex.FNI_RepeatingGroup.ComparatorForFNIRepeat... | /*
Copyright 2015 Rudolf Fiala
This file is part of Alpheus AFP Parser.
Alpheus AFP Parser 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.
... | os.write(UtilCharacterEncoding.stringToByteArray(graphicCharacterGlobalID_GCGID, Constants.cpIBM500, 8, Constants.EBCDIC_ID_FILLER)); | 4 |
olivierlemasle/java-certificate-authority | java-ca-lib/src/test/java/io/github/olivierlemasle/tests/it/OpenSslIT.java | [
"public static RootCertificateBuilder createSelfSignedCertificate(\n final DistinguishedName subject) {\n return new RootCertificateBuilderImpl(subject);\n}",
"public static DnBuilder dn() {\n return new DnBuilderImpl();\n}",
"public static CsrLoader loadCsr(final File csrFile) {\n return new CsrLoaderImp... | import static io.github.olivierlemasle.ca.CA.createSelfSignedCertificate;
import static io.github.olivierlemasle.ca.CA.dn;
import static io.github.olivierlemasle.ca.CA.loadCsr;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;
import static org.junit.Assume.assumeTrue;
import java.i... | package io.github.olivierlemasle.tests.it;
public class OpenSslIT {
@BeforeClass
@AfterClass
public static void clean() {
final File caCertPath = new File("ca.cer");
caCertPath.delete();
final File reqPath = new File("CSR.csr");
reqPath.delete();
final File keyPath = new File("private.k... | final DistinguishedName rootDn = dn("CN=CA-Test"); | 5 |
iacobcl/MARA | src/logic/analysis/PriceRangeWorthAnalysis.java | [
"public class CodeDistr \r\n{\r\n\r\n\tprivate String code;\r\n\tprivate int total;\r\n\tprivate double perc;\r\n\tprivate int totalrel;\r\n\tprivate double percrel;\r\n\t\r\n\tpublic CodeDistr()\r\n\t{\r\n\t\tcode = new String();\r\n\t\ttotal = 0;\r\n\t\tperc = 0;\r\n\t\ttotalrel = 0;\r\n\t\tpercrel = 0;\r\n\t}\r\... | import java.sql.ResultSet;
import java.util.ArrayList;
import objs.CodeDistr;
import objs.stats.PosNegCatStats;
import objs.stats.PriceWorthStats;
import objs.stats.reports.ReportPosNegCatStats;
import objs.stats.reports.ReportPriceRangeWorthStats;
import storage.DBQuerying;
import storage.FileQuerying;
| /*
# 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 ... | CodeDistr worth = new CodeDistr("worth the money", totalworth, percpos, 0, 0);
| 0 |
calibre2opds/calibre2opds | OpdsOutput/src/main/java/com/gmail/dpierron/calibre/opds/SubCatalog.java | [
"public class CachedFile extends File {\r\n private final static Logger logger = LogManager.getLogger(CachedFile.class);\r\n\r\n private long privateLastModified;\r\n private long privateLength;\r\n private long privateCrc; // A -ve value indicates invalid CRC;\r\n private final static long... | import com.gmail.dpierron.calibre.cache.CachedFile;
import com.gmail.dpierron.calibre.cache.CachedFileManager;
import com.gmail.dpierron.calibre.configuration.ConfigurationHolder;
import com.gmail.dpierron.calibre.configuration.ConfigurationManager;
import com.gmail.dpierron.calibre.datamodel.*;
import com.gmail.d... | package com.gmail.dpierron.calibre.opds;
/**
* Abstract class containing functions and variables common to all catalog types
*/
public abstract class SubCatalog {
// cache some widely used objects.
private final static Logger logger = LogManager.getLogger(SubCatalog.class);
// Get some non-mutabl... | if (Helper.isNullOrEmpty(catalogFolder)) {
| 4 |
FabioZumbi12/UltimateChat | UltimateChat-Spigot/src/main/java/br/net/fabiozumbi12/UltimateChat/Bukkit/discord/UCDiscord.java | [
"public class UCChannel {\n private final List<String> ignoring = new ArrayList<>();\n private final List<String> mutes = new ArrayList<>();\n private final Properties properties = new Properties();\n private List<String> members = new ArrayList<>();\n\n @Deprecated()\n public UCChannel(String nam... | import br.net.fabiozumbi12.UltimateChat.Bukkit.UCChannel;
import br.net.fabiozumbi12.UltimateChat.Bukkit.UChat;
import br.net.fabiozumbi12.UltimateChat.Bukkit.util.UCPerms;
import br.net.fabiozumbi12.UltimateChat.Bukkit.util.UCUtil;
import br.net.fabiozumbi12.UltimateChat.Bukkit.util.UChatColor;
import br.net.fabiozumb... | } else
if (e.getMessage().getMentionedMembers().stream().findFirst().isPresent()){
String nick = e.getMessage().getMentionedMembers().stream().findFirst().get().getNickname();
if (nick == null || nick.isEmpty())
nick = e.get... | format = format.replace("{dd-rolecolor}", fromRGB( | 6 |
USCDataScience/AgePredictor | age-predictor-cli/src/main/java/edu/usc/irds/agepredictor/cmdline/authorage/AgeClassifyTrainerTool.java | [
"public class CLI {\n public static final String CMD = \"bin/authorage\";\n public static final String DEFAULT_FORMAT = AuthorAgeSample.FORMAT_NAME;\n \n private static Map<String, CmdLineTool> toolLookupMap;\n \n static {\n\ttoolLookupMap = new LinkedHashMap<String, CmdLineTool>();\n \n\tLi... | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import edu.usc.irds.agepredictor.cmdline.CLI;
import edu.usc.irds.agepredictor.cmdline.params.ClassifyTrainingToolParams;
import opennlp.tools.authorage.AgeClassifyFactory;
import opennlp.tools.authorage.AgeClas... | /*
* 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 ... | if (!AgeClassifyTrainerFactory.isValid(mlParams.getSettings())) { | 6 |
SilenceDut/NBAPlus | app/src/main/java/com/me/silencedut/nbaplus/ui/activity/MainActivity.java | [
"public class Constant {\n\n public static final String APP_FIR_IM_URL=\"http://fir.im/nbaplus\";\n public static final String API_TOKEN_FIR=\"ff55b0c5cb165ec0b04c473cf77c8995\";\n\n public static final String LOADIMAGE = \"LOADIMAGE\";\n public static final String ACTILEFONTSIZE = \"ACTILEFONTSIZE\";\n... | import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.widget.FrameLayout;
import com.me.silencedut.nbaplus.R;
import com.me.silencedut.nbaplus.data.Constant;
import com.me.silencedut.nbaplus.event.DrawerClickEvent;
import com.me.silencedut.nbaplus.ui.fragment.GamesFragmen... | package com.me.silencedut.nbaplus.ui.activity;
public class MainActivity extends BaseActivity {
private DrawerFragment mNavigationFragment; | private BaseFragment mCurrentFragment; | 4 |
hpdcj/PCJ | src/main/java/org/pcj/internal/InternalCommonGroup.java | [
"public class BarrierStates {\n\n private final ConcurrentMap<Integer, AtomicInteger> counterMap;\n private final ConcurrentMap<Integer, State> stateMap;\n\n public BarrierStates() {\n counterMap = new ConcurrentHashMap<>();\n stateMap = new ConcurrentHashMap<>();\n }\n\n public int get... | import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.... | /*
* Copyright (c) 2011-2021, PCJ Library, Marek Nowicki
* All rights reserved.
*
* Licensed under New BSD License (3-clause license).
*
* See the file "LICENSE" for the full license governing this code.
*/
package org.pcj.internal;
/**
* Internal (with common ClassLoader) representation of Group. It contains... | private final ScatterStates scatterStates; | 5 |
matthewhorridge/owlexplanation | src/main/java/org/semanticweb/owl/explanation/impl/setree/SETreeExplanationGenerator.java | [
"public class Explanation<E> {\n\n public static final IRI ENTAILMENT_MARKER_IRI = IRI.create(\"http://owl.cs.manchester.ac.uk/explanation/vocabulary#entailment\");\n\n private E entailment;\n\n private Set<OWLAxiom> justification;\n\n /**\n * Gets the entailment that the explanation is for\n * ... | import org.semanticweb.owl.explanation.api.Explanation;
import org.semanticweb.owl.explanation.api.ExplanationException;
import org.semanticweb.owl.explanation.api.ExplanationGenerator;
import org.semanticweb.owl.explanation.api.NullExplanationProgressMonitor;
import org.semanticweb.owl.explanation.impl.blackbox.*;
imp... | package org.semanticweb.owl.explanation.impl.setree;
/**
* Author: Matthew Horridge<br>
* The University of Manchester<br>
* Bio-Health Informatics Group<br>
* Date: 19-Jul-2010
*/
public class SETreeExplanationGenerator implements ExplanationGenerator<OWLAxiom> {
private OWLReasonerFactory reasonerFactory... | public Set<Explanation<OWLAxiom>> getExplanations(OWLAxiom entailment) throws ExplanationException { | 1 |
google/mug | mug/src/test/java/com/google/mu/util/concurrent/RetryerTest.java | [
"public static CancellationException assertCancelled(CompletionStage<?> stage) {\n CompletableFuture<?> future = stage.toCompletableFuture();\n assertThat(future.isDone()).isTrue();\n assertThat(future.isCompletedExceptionally()).isTrue();\n CancellationException cancelled = assertThrows(CancellationException.c... | import static com.google.common.truth.Truth.assertThat;
import static com.google.mu.util.concurrent.FutureAssertions.assertCancelled;
import static com.google.mu.util.concurrent.FutureAssertions.assertCauseOf;
import static com.google.mu.util.concurrent.FutureAssertions.assertCompleted;
import static com.google.mu.util... | assertThat(ofDays(1).randomized(random, 0.5).duration()).isEqualTo(Duration.ofHours(24));
assertThat(ofDays(1).randomized(random, 0.5).duration()).isEqualTo(Duration.ofHours(36));
}
@Ignore("Can't mock Random in JDK 17")
@Test public void testDelay_randomized_fullRandomness() {
Random random = Mockit... | private <T> CompletionStage<T> retry(CheckedSupplier<T, ?> supplier) { | 4 |
cmongis/psfj | src/knop/psfj/BeadFrame.java | [
"public class Counter3D extends Observable{\n int thr=0;\n boolean[] isSurf;\n int width=1, height=1, nbSlices=1, length=1, depth=8;\n Calibration cal;\n String title=\"img\";\n int minSize, maxSize, nbObj=0, nbSurfPix=0;\n int[] imgArray, objID, IDcount, surfList;\n boolean[] IDisAtEdge;\n Voxel[... | import ij.ImagePlus;
import ij.ImageStack;
import ij.gui.Line;
import ij.gui.Plot;
import ij.measure.Calibration;
import ij.measure.CurveFitter;
import ij.plugin.Slicer;
import ij.process.Blitter;
import ij.process.ColorProcessor;
import ij.process.ImageProcessor;
import ij.process.LUT;
import java.awt.Color;
import ja... |
center[0] = MathUtils.round(centroid[0]);
center[1] = MathUtils.round(centroid[1]);
int width = MathUtils.round(boundaries.getWidth());
int height = MathUtils.round(boundaries.getHeight());
boundaries = new Rectangle(newCenterX - (width / 2), newCenterY
- (height / 2), width, height);
}
/**
* Gets... | center = new FindMax().getAllCoordinates(getSubstack()); | 1 |
Lyneira/MachinaCraft | MachinaCore/src/me/lyneira/MachinaCore/machina/Universe.java | [
"public class THashMap<K, V> extends TObjectHash<K> implements TMap<K, V>, Externalizable {\r\n\r\n static final long serialVersionUID = 1L;\r\n\r\n /**\r\n * the values of the map\r\n */\r\n protected transient V[] _values;\r\n\r\n\r\n /**\r\n * Creates a new <code>THashMap</code> instance... | import gnu.trove.map.hash.THashMap;
import gnu.trove.procedure.TObjectProcedure;
import gnu.trove.set.hash.THashSet;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.invent... | package me.lyneira.MachinaCore.machina;
/**
* Represents all machinae in a world. This universal block store keeps track of
* all blocks in the world that belong to a machina, and all machinae
* themselves. It also prevents machinae from intersecting each other and
* provides fast testing whether any b... | private final THashSet<Machina> machinae = new THashSet<Machina>();
| 1 |
hidekatsu-izuno/wmf2svg | src/main/java/net/arnx/wmf2svg/gdi/wmf/WmfParser.java | [
"public interface Gdi {\r\n public static final int OPAQUE = 2;\r\n public static final int TRANSPARENT = 1;\r\n\r\n public static final int TA_BASELINE = 24;\r\n public static final int TA_BOTTOM = 8;\r\n public static final int TA_TOP = 0;\r\n public static final int TA_CENTER = 6;\r\n public... | import java.io.BufferedInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteOrder;
import java.util.logging.Logger;
import net.arnx.wmf2svg.gdi.Gdi;
import net.arnx.wmf2svg.gdi.GdiBrush;
import net.arnx.wmf2svg.gdi.GdiObject;
import net.arnx.wmf2svg.gdi.G... | /*
* Copyright 2007-2015 Hidekatsu Izuno
*
* 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 a... | gdi.setPaletteEntries((GdiPalette) objs[objID], startIndex, entries); | 3 |
supaldubey/storm | src/main/java/in/cubestack/android/lib/storm/service/asyc/AsyncSupportService.java | [
"public class DatabaseMetaData {\r\n\r\n private String name;\r\n private int version;\r\n private Class<?>[] tables;\r\n private Class<? extends DatabaseUpdatesHandler> handler;\r\n\r\n public String getName() {\r\n return name;\r\n }\r\n\r\n public void setName(String name) {\r\n ... | import in.cubestack.android.lib.storm.core.DatabaseMetaData;
import in.cubestack.android.lib.storm.core.StormException;
import in.cubestack.android.lib.storm.criteria.Order;
import in.cubestack.android.lib.storm.criteria.Projection;
import in.cubestack.android.lib.storm.criteria.Restriction;
import in.cubestack.android... | callBack.onError(throwable);
} else {
callBack.onSaveAll(entity);
}
};
}.execute();
}
public <T> void update(final T entity, final StormCallBack<T> callBack) {
new AsyncTask<Void, Void, Integer>() {
private Throwable throwable;
@Override
protected Integer doInBackground(Void... ... | public <E> void delete(final Class<E> type, final Restriction restriction, final StormCallBack<E> callBack) { | 4 |
TheTorbinWren/OresPlus | src/main/java/tw/oresplus/blocks/TileEntityMachine.java | [
"public class Ores {\n\tprivate static Ores instance = new Ores();\n\t\n\tpublic static IOreManager manager;\n\t\n\tpublic static IOreFluidManager fluidManager;\n\t\n\tpublic static IOreRecipeManager grinderRecipes;\n\tpublic static IOreFluidRecipeManager crackerRecipes;\n\n\tprivate Ores () {}\n\t\n\tprivate class... | import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import tw.oresplus.api.Ores;
import tw.oresplus.core.FuelHelper;
import tw.oresplus.energy.EnergyBuffer;
import tw.oresplus.network.NetHandler;
import tw.oresplus.network.PacketMachine;
import net.minecraft.entity.player.EntityPlayer;
import ... | package tw.oresplus.blocks;
public abstract class TileEntityMachine extends TileEntity
implements ISidedInventory {
class Tags {
public static final String ORIENTATION = "orientation";
public static final String BURN_TIME = "burnTime";
public static final String WORK_DONE = "workDone";
public static final S... | public EnergyBuffer energyBuffer; | 2 |
eltrueno/TruenoNPC | src/es/eltrueno/npc/nms/TruenoNPC_v1_12_r1.java | [
"public interface TruenoNPC {\n\n /**\n *\n *\n * @author el_trueno\n *\n *\n **/\n\n void delete();\n Location getLocation();\n int getEntityID(Player p);\n boolean isDeleted();\n int getNpcID();\n TruenoNPCSkin getSkin();\n}",
"public class TruenoNPCApi {\n\n /**\... | import com.google.common.collect.Lists;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.mojang.authlib.GameProfile;
import com.mojang.authlib.properties.Property;
import es.eltrueno.npc.TruenoNPC;
import es.eltrueno.n... | package es.eltrueno.npc.nms;
public class TruenoNPC_v1_12_r1 implements TruenoNPC {
/**
*
*
* @author el_trueno
*
*
**/
private static List<TruenoNPC_v1_12_r1> npcs = new ArrayList<TruenoNPC_v1_12_r1>();
private static int id = 0;
private static boolean taskstarted = f... | if(TruenoNPCApi.getCache() && this.skin.getSkinType()!= SkinType.PLAYER) { | 1 |
dkzwm/SmoothRefreshLayout | app/src/main/java/me/dkzwm/widget/srl/sample/ui/TestMultiDirectionViewsActivity.java | [
"public class HorizontalSmoothRefreshLayout extends SmoothRefreshLayout {\n\n public HorizontalSmoothRefreshLayout(Context context) {\n super(context);\n }\n\n public HorizontalSmoothRefreshLayout(Context context, AttributeSet attrs) {\n super(context, attrs);\n }\n\n public HorizontalS... | import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.view.MenuItem;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpag... | package me.dkzwm.widget.srl.sample.ui;
/**
* Created by dkzwm on 2017/11/3.
*
* @author dkzwm
*/
public class TestMultiDirectionViewsActivity extends AppCompatActivity {
private static final int[] sColors =
new int[] {Color.WHITE, Color.GREEN, Color.YELLOW, Color.BLUE, Color.RED, Color.BLACK};
... | CustomLoadDetailFooter footer = new CustomLoadDetailFooter(this); | 5 |
jbossas/jboss-vfs | src/main/java/org/jboss/vfs/spi/JavaZipFileSystem.java | [
"public final class TempDir implements Closeable {\n\n private final TempFileProvider provider;\n private final File root;\n private final AtomicBoolean open = new AtomicBoolean(true);\n\n TempDir(TempFileProvider provider, File root) {\n this.provider = provider;\n this.root = root;\n ... | import java.io.BufferedOutputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.security... | /*
* JBoss, Home of Professional Open Source
* Copyright 2009, JBoss Inc., and individual contributors as indicated
* by the @authors tag.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License ... | public File getFile(VirtualFile mountPoint, VirtualFile target) throws IOException { | 4 |
googlearchive/android-AutofillFramework | afservice/src/main/java/com/example/android/autofill/service/data/source/local/dao/AutofillDao.java | [
"@Entity(primaryKeys = {\"id\"})\npublic class AutofillDataset {\n @NonNull\n @ColumnInfo(name = \"id\")\n private final String mId;\n\n @NonNull\n @ColumnInfo(name = \"datasetName\")\n private final String mDatasetName;\n\n @NonNull\n @ColumnInfo(name = \"packageName\")\n private final S... | import java.util.List;
import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import com.example.android.autofill.service.model.AutofillDataset;
import com.example.android.autofill.servic... | /*
* Copyright (C) 2017 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... | void insertResourceIdHeuristic(ResourceIdHeuristic resourceIdHeuristic); | 6 |
htrc/HTRC-Portal | app/controllers/ExperimentalAnalysis.java | [
"public class HTRCExperimentalAnalysisServiceClient {\n private static Logger.ALogger log = play.Logger.of(\"application\");\n\n private HttpClient client = new HttpClient();\n\n /**\n * access token renew time\n */\n private int renew = 0;\n private final int MAX_RENEW = 1;\n\n public int... | import edu.indiana.d2i.htrc.portal.HTRCExperimentalAnalysisServiceClient;
import edu.indiana.d2i.htrc.portal.PlayConfWrapper;
import edu.indiana.d2i.htrc.portal.PortalConstants;
import edu.indiana.d2i.htrc.sloan.bean.VMImageDetails;
import edu.indiana.d2i.htrc.sloan.bean.VMStatus;
import org.pac4j.play.java.JavaControl... | /**
* Copyright 2013 The Trustees of Indiana 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 applic... | if(!PlayConfWrapper.isDataCapsuleEnable()){ | 1 |
vector-im/riot-automated-tests | VectorMobileTests/src/test/java/mobilestests_ios/RiotMessagesReceptionTests.java | [
"public class RiotRoomPageObjects extends TestUtilities{\n\tprivate IOSDriver<MobileElement> driver;\n\tpublic RiotRoomPageObjects(AppiumDriver<MobileElement> myDriver) {\n\t\tdriver= (IOSDriver<MobileElement>) myDriver;\n\t\tPageFactory.initElements(new AppiumFieldDecorator(driver), this);\n\t\ttry {\n\t\t\twaitUn... | import java.io.FileNotFoundException;
import java.io.IOException;
import org.testng.Assert;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import com.esotericsoftware.yamlbeans.YamlException;
import io.appium.java_client.MobileElement;
import pom... | package mobilestests_ios;
@Listeners({ ScreenshotUtility.class })
public class RiotMessagesReceptionTests extends RiotParentTest{
private String msgFromUpUser="UP";
private String roomId="!SBpfTGBlKgELgoLALQ%3Amatrix.org";
private String roomIdCustomHs="!LVRuDkmtSvMXfqSgLy%3Ajeangb.org";
private String pic... | if("false".equals(ReadConfigFile.getInstance().getConfMap().get("homeserverlocal"))){ | 5 |
cvtienhoven/graylog-plugin-aggregates | src/main/java/org/graylog/plugins/aggregates/maintenance/AggregatesMaintenance.java | [
"@JsonAutoDetect\n@JsonIgnoreProperties(ignoreUnknown = true)\n@AutoValue\npublic abstract class AggregatesConfig {\n\n @JsonProperty(\"purgeHistory\")\n public abstract boolean purgeHistory();\n\n @JsonProperty(\"historyRetention\")\n public abstract String historyRetention();\n\n @JsonProperty(\"re... | import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import javax.inject.Inject;
import javax.inject.Named;
import com.codah... | package org.graylog.plugins.aggregates.maintenance;
public class AggregatesMaintenance extends Periodical {
private static final Logger LOG = LoggerFactory.getLogger(AggregatesMaintenance.class);
private final AlertService alertService;
private final StreamService streamService;
private final RuleS... | List<Rule> rules = ruleService.all(); | 4 |
metova/privvy | sample/src/main/java/com/metova/privvy/sample/MainActivity.java | [
"public interface PrivvyHost {\n\n void initialize(RouteData... routes);\n\n void replace(RouteData oldComponent, RouteData newComponent);\n\n void goTo(RouteData newComponent);\n}",
"public class PrivvyHostDelegate implements PrivvyHost {\n\n private AppCompatActivity hostActivity;\n\n public Priv... | import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import com.metova.privvy.PrivvyHost;
import com.metova.privvy.PrivvyHostDelegate;
import com.metova.privvy.RouteData;
import com.metova.privvy.sample.di.HostComponent;
import com.metova.privvy.sample.di.HostModule;
import com.metova.privvy.sampl... | package com.metova.privvy.sample;
public class MainActivity extends AppCompatActivity implements PrivvyHost {
public HostComponent hostComponent;
private PrivvyHostDelegate hostDelegate;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
... | initialize(NumberComponent.ROUTE_DATA, ButtonComponent.ROUTE_DATA); | 5 |
mosmetro-android/mosmetro-android | app/src/main/java/pw/thedrhax/mosmetro/authenticator/ProviderMetrics.java | [
"public class SettingsActivity extends Activity {\n public static final String ACTION_DONATE = \"donate\";\n public static final String ACTION_MIDSESSION = \"midsession\";\n\n private SettingsFragment fragment;\n private PermissionUtils pu;\n private Listener<Map<String, UpdateChecker.Branch>> branch... | import pw.thedrhax.mosmetro.activities.SilentActionActivity;
import pw.thedrhax.mosmetro.httpclient.clients.OkHttp;
import pw.thedrhax.mosmetro.updater.BackendRequest;
import pw.thedrhax.util.Notify;
import pw.thedrhax.util.UUID;
import pw.thedrhax.util.Version;
import pw.thedrhax.util.WifiUtils;
import android.annotat... | /**
* Wi-Fi в метро (pw.thedrhax.mosmetro, Moscow Wi-Fi autologin)
* Copyright © 2015 Dmitry Karikh <the.dr.hax@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version ... | WifiUtils wifi = new WifiUtils(p.context); | 7 |
ketao1989/ourea | ourea-spring/src/main/java/com/taocoder/ourea/spring/consumer/ConsumerProxyFactoryBean.java | [
"public class Constants {\n\n public static final String ZK_PATH_PREFIX = \"/ourea\";\n\n public static final String PATH_SEPARATOR = \"/\";\n\n public static final String GROUP_KEY = \"group\";\n\n public static final String VERSION_KEY = \"version\";\n\n public static final String INTERFACE_KEY = \... | import com.taocoder.ourea.core.common.Constants;
import com.taocoder.ourea.core.common.PropertiesUtils;
import com.taocoder.ourea.core.config.ThriftClientConfig;
import com.taocoder.ourea.core.config.ZkConfig;
import com.taocoder.ourea.core.consumer.ConsumerProxyFactory;
import com.taocoder.ourea.core.loadbalance.ILoad... | /*
* Copyright (c) 2015 taocoder.com. All Rights Reserved.
*/
package com.taocoder.ourea.spring.consumer;
/**
* @author tao.ke Date: 16/5/1 Time: 下午2:18
*/
public class ConsumerProxyFactoryBean
implements FactoryBean<ConsumerProxyFactory>, InitializingBean, ApplicationListener<ApplicationEvent> {
pr... | private ThriftClientConfig clientConfig; | 2 |
bkimminich/kata-botwars | botwars-java/src/test/java/de/kimminich/kata/botwars/effects/negative/ContinuousDamageTest.java | [
"public class MockitoExtension implements TestInstancePostProcessor, ParameterResolver {\n\n @Override\n public void postProcessTestInstance(Object testInstance, ExtensionContext context) {\n MockitoAnnotations.initMocks(testInstance);\n }\n\n @Override\n public boolean supports(ParameterConte... | import de.kimminich.extensions.MockitoExtension;
import de.kimminich.kata.botwars.Bot;
import de.kimminich.kata.botwars.Game;
import de.kimminich.kata.botwars.effects.Effect;
import de.kimminich.kata.botwars.ui.UserInterface;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.... | package de.kimminich.kata.botwars.effects.negative;
@ExtendWith(MockitoExtension.class)
@DisplayName("A Continuous Damage effect")
public class ContinuousDamageTest {
@Test
@DisplayName("causes damage each turn while the effect is active")
void causesDamageEachTurn() {
Effect continuousDamage =... | Game game = new Game(ui, aPlayer().withTeam(bot, anyBot(), anyBot()).build(), | 7 |
GoogleCloudPlatform/qupath-chcapi-extension | src/main/java/com/quantumsoft/qupathcloud/imageserver/CloudImageServer.java | [
"public abstract class CloudDao {\n\n private OAuth20 oAuth20;\n\n /**\n * Instantiates a new Cloud dao.\n *\n * @param oAuth20 the oAuth20\n */\n CloudDao(OAuth20 oAuth20) {\n this.oAuth20 = oAuth20;\n }\n\n /**\n * Gets Projects list.\n *\n * @return the list of Projects\n * @throws QuPath... | import com.quantumsoft.qupathcloud.dao.CloudDao;
import com.quantumsoft.qupathcloud.dao.spec.QueryBuilder;
import com.quantumsoft.qupathcloud.entities.DicomStore;
import com.quantumsoft.qupathcloud.exception.QuPathCloudException;
import com.quantumsoft.qupathcloud.pyramid.LoadPyramidFileCallable;
import com.quantumsoft... | // Copyright (C) 2019 Google LLC
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distribute... | PyramidFrame frame = pyramid.getFrame(tileX + 1, tileY + 1, level); | 6 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeFormatter.java | [
"public abstract class ZoneId implements Serializable {\n\n /**\n * Simulate JDK 8 method reference ZoneId::from.\n */\n public static final TemporalQuery<ZoneId> FROM = new TemporalQuery<ZoneId>() {\n @Override\n public ZoneId queryFrom(TemporalAccessor temporal) {\n return Z... | import static org.threeten.bp.temporal.ChronoField.DAY_OF_MONTH;
import static org.threeten.bp.temporal.ChronoField.DAY_OF_WEEK;
import static org.threeten.bp.temporal.ChronoField.DAY_OF_YEAR;
import static org.threeten.bp.temporal.ChronoField.HOUR_OF_DAY;
import static org.threeten.bp.temporal.ChronoField.MINUTE_OF_HO... | .toFormatter().withChronology(IsoChronology.INSTANCE);
}
//-----------------------------------------------------------------------
/**
* A query that provides access to the excess days that were parsed.
* <p>
* This returns a singleton {@linkplain TemporalQuery query}... | private final Set<TemporalField> resolverFields; | 6 |
gemserk/jresourcesmanager | resourcesmanager-tests/src/main/java/com/gemserk/resources/tests/JFrameResourceReloadSample.java | [
"public class Resource<T> {\n\n\tT data = null;\n\n\tDataLoader<T> dataLoader;\n\n\tprotected Resource(DataLoader<T> dataLoader) {\n\t\tthis(dataLoader, true);\n\t}\n\n\tprotected Resource(DataLoader<T> dataLoader, boolean deferred) {\n\t\tthis.dataLoader = dataLoader;\n\t\tif (!deferred)\n\t\t\treload();\n\t}\n\n\... | import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame... | package com.gemserk.resources.tests;
public class JFrameResourceReloadSample {
@SuppressWarnings("serial")
public static void main(String[] args) {
| ImageLoader whiteLogoImageLoader = new ImageLoader(new ClassPathDataSource("logo-gemserk-512x116-white.png")); | 3 |
hanhailong/DevHeadLine | app/src/main/java/com/hhl/devheadline/ui/fragment/HomeChoiceFragment.java | [
"public class Article {\n\n /**\n * is_advertorial : false\n * id : 294078\n * title : 如果你用 GitHub,可以这样提高效率\n * contributor : 流星狂飙\n * original_site_name : segmentfault.com\n * is_recommend : false\n * original_url : http://toutiao.io/r/0ivkig\n * image : null\n * thumbnail :\... | import android.content.Context;
import android.net.Uri;
import android.os.Handler;
import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
import com.bigkoo.convenientbanner.ConvenientBanner;
import c... | package com.hhl.devheadline.ui.fragment;
/**
* Created by HanHailong on 16/3/15.
*/
public class HomeChoiceFragment extends BaseFragment<HomeChoicePresenter> implements IHomeChoiceView {
@Bind(R.id.swipe_refresh_layout) | DHLSwipeRefreshLayout mSwipeRefreshLayout; | 5 |
Ryan-ZA/async-elastic-orm | src/main/java/com/rc/gds/GDSQueryResultImpl.java | [
"public interface GDS {\r\n\t\r\n\t/**\r\n\t * Begin a transaction that will last until commitTransaction() or rollbackTransaction() is called. You must call one of these when you\r\n\t * have finished the transaction. The transaction will apply to all load() save() and query() calls from this GDS.\r\n\t * \r\n\t *... | import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.s... | package com.rc.gds;
public class GDSQueryResultImpl<T> implements GDSMultiResult<T> {
private static final int MAX_DEPTH = 100;
GDS gds;
Iterator<SearchHit> iterator;
Class<T> clazz;
GDSLoader loader;
SearchResponse searchResponse;
private boolean finished = false;
int depth = 0;
ExecutorService deepSta... | loader.entityToPOJO(entity, hit.getId(), links, new GDSCallback<Object>() { | 1 |
AlexanderMisel/gnubridge | src/main/java/org/gnubridge/core/bidding/rules/TakeoutDouble.java | [
"public class Hand {\n\tList<Card> cards;\n\n\t/**\n\t * Caching optimization for pruning played cards\n\t * and perhaps others\n\t */\n\tList<Card> orderedCards;\n\tSuit color;\n\tList<Card> colorInOrder;\n\n\tpublic Hand() {\n\t\tthis.cards = new ArrayList<Card>();\n\t}\n\n\tpublic Hand(Card... cards) {\n\t\tthis... | import java.util.Set;
import org.gnubridge.core.Hand;
import org.gnubridge.core.bidding.Auctioneer;
import org.gnubridge.core.bidding.Bid;
import org.gnubridge.core.bidding.Double;
import org.gnubridge.core.bidding.PointCalculator;
import org.gnubridge.core.deck.Suit;
import org.gnubridge.core.deck.Trump; | package org.gnubridge.core.bidding.rules;
public class TakeoutDouble extends BiddingRule {
private final PointCalculator pc;
| public TakeoutDouble(Auctioneer a, Hand h) { | 1 |
zhenglu1989/web-sso | ki4so-core/src/main/java/com/github/ebnew/ki4so/core/authentication/handlers/EncryCredentialAuthenticationHandler.java | [
"public interface KnightCredential {\n\n\n /**\n * 是否是原始凭据,即未认证过的原始信息\n *\n * @return true :原始凭据,false:加密后的凭据\n */\n public boolean isOriginal();\n}",
"public class KnightEncryCredential extends KnightAbstractParameter implements KnightCredential{\n /**\n * 加密后的用户凭证串\n */\n pri... | import com.github.ebnew.ki4so.core.authentication.KnightCredential;
import com.github.ebnew.ki4so.core.authentication.KnightEncryCredential;
import com.github.ebnew.ki4so.core.authentication.KnightEncryCredentialManager;
import com.github.ebnew.ki4so.core.model.KnightCredentialInfo;
import org.springframework.beans... | package com.github.ebnew.ki4so.core.authentication.handlers;
/**
* 认证后的凭据认证处理器实现类,需要验证认证后的凭据是否有效,凭据是否过期等等其它
* 合法性验证。
* @author burgess yang
*
*/
public class EncryCredentialAuthenticationHandler extends
AbstractPreAndPostProcessingAuthenticationHandler {
@Autowired
| private KnightEncryCredentialManager encryCredentialManager;
| 2 |
princeofgiri/f-droid | F-Droid/src/org/fdroid/fdroid/views/ManageReposActivity.java | [
"public class FDroid extends ActionBarActivity {\n\n public static final int REQUEST_APPDETAILS = 0;\n public static final int REQUEST_MANAGEREPOS = 1;\n public static final int REQUEST_PREFS = 2;\n public static final int REQUEST_ENABLE_BLUETOOTH = 3;\n public static final int REQUEST_SWAP = 4;\n\n ... | import android.app.Activity;
import android.app.AlertDialog;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.net.w... | /*
* Copyright (C) 2010-12 Ciaran Gultnieks, ciaran@ciarang.com
* Copyright (C) 2009 Roberto Jacinto, roberto.jacinto@caixamagica.pt
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; eit... | ? RepoProvider.Helper.findByAddress(this, newAddress) | 5 |
andremion/Villains-and-Heroes | app/src/main/java/com/andremion/heroes/ui/home/view/MainActivity.java | [
"public class MarvelApi {\n\n public static final int MAX_FETCH_LIMIT = 100;\n\n private static final String BASE_URL = \"http://gateway.marvel.com/v1/public/\";\n private static MarvelApi sMarvelApi;\n private final MarvelService mService;\n private Call<CharacterDataWrapper> mLastSearchCall;\n\n ... | import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.text.TextUt... | /*
* Copyright (c) 2017. André Mion
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed... | private MainPresenter mPresenter; | 5 |
mpsonic/Evolve-Workout-Logger | app/src/main/java/edu/umn/paull011/evolveworkoutlogger/fragments/ExerciseSessionSetsFragment.java | [
"public class ExerciseSession {\n\n private static final String TAG = ExerciseSession.class.getSimpleName();\n // Private\n private Exercise mExercise;\n private int mId;\n private Date mDate;\n private ArrayList<Set> mSetList;\n private int mCurrentSetIndex;\n private Boolean mCompleted;\n ... | import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import android.util.Log;
import android.view.LayoutInflater;... | package edu.umn.paull011.evolveworkoutlogger.fragments;
/**
* A fragment representing a list of Items.
* <p>
* Activities containing this fragment MUST implement the {@link OnFragmentInteractionListener}
* interface.
*/
public class ExerciseSessionSetsFragment extends BaseFragment{
private RecyclerView mR... | ItemTouchHelper.Callback callback = new ItemTouchHelperCallback(mAdapter); | 4 |
exoplatform/task | integration/src/main/java/org/exoplatform/task/integration/gamification/GamificationTaskUpdateListener.java | [
"@Entity(name = \"TaskTask\")\n@ExoEntity\n@Table(name = \"TASK_TASKS\")\n@NamedQueries({\n @NamedQuery(name = \"Task.findByMemberships\",\n query = \"SELECT ta FROM TaskTask ta LEFT JOIN ta.coworker coworkers \" +\n \"WHERE ta.assignee = :userName \" +\n \"OR ta.createdBy = :userNam... | import java.util.Iterator;
import java.util.Set;
import org.exoplatform.addons.gamification.entities.domain.effective.GamificationActionsHistory;
import org.exoplatform.addons.gamification.service.configuration.RuleService;
import org.exoplatform.addons.gamification.service.dto.configuration.RuleDTO;
import org.exoplat... | package org.exoplatform.task.integration.gamification;
public class GamificationTaskUpdateListener extends Listener<TaskService, TaskPayload> {
private static final Log LOG =
ExoLogger.getLogger(GamificationTaskUpdateListener.clas... | TaskDto oldTask = data.before(); | 1 |
Grover-c13/PokeGOAPI-Java | sample/src/main/java/com/pokegoapi/examples/TravelToPokestopExample.java | [
"public class PokemonGo {\n\tprivate static final java.lang.String TAG = PokemonGo.class.getSimpleName();\n\tprivate final Time time;\n\tprivate News news;\n\t@Getter\n\tpublic long startTime;\n\t@Getter\n\tpublic final byte[] sessionHash = new byte[32];\n\t@Getter\n\tpublic RequestHandler requestHandler;\n\t@Gette... | import com.pokegoapi.api.PokemonGo;
import com.pokegoapi.api.map.Point;
import com.pokegoapi.api.map.fort.Pokestop;
import com.pokegoapi.api.map.fort.PokestopLootResult;
import com.pokegoapi.auth.PtcCredentialProvider;
import com.pokegoapi.exceptions.request.RequestFailedException;
import com.pokegoapi.util.Log;
import... | /*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope... | Point destination = new Point(destinationPokestop.getLatitude(), destinationPokestop.getLongitude()); | 1 |
Blazemeter/blazemeter-jenkins-plugin | src/main/java/hudson/plugins/blazemeter/PerformanceBuilder.java | [
"public interface Constants {\n String BZM_LOG = \"bzm-log\";\n String VERSION = \"version\";\n String A_BLAZEMETER_COM = \"https://a.blazemeter.com\";\n}",
"public class Utils {\n\n private Utils() {\n }\n\n public static String getTestId(String testId) {\n try {\n return test... | import com.cloudbees.plugins.credentials.CredentialsScope;
import hudson.AbortException;
import hudson.EnvVars;
import hudson.FilePath;
import hudson.Launcher;
import hudson.ProxyConfiguration;
import hudson.model.Result;
import hudson.model.Run;
import hudson.model.TaskListener;
import hudson.plugins.blazemeter.utils.... | public boolean isGetJunit() {
return getJunit;
}
public String getNotes() {
return notes;
}
@DataBoundSetter
public void setNotes(String notes) {
this.notes = notes;
}
public String getSessionProperties() {
return sessionProperties;
}
public St... | listener.error(BzmJobNotifier.formatMessage("Please, reconfigure job and select valid credentials and test")); | 3 |
martin-lizner/trezor-ssh-agent | src/main/java/com/trezoragent/gui/AgentPopUpMenu.java | [
"public abstract class DeviceService {\n\n protected HardwareWalletService hardwareWalletService;\n protected HardwareWalletClient client;\n protected String deviceKey;\n byte[] signedData;\n byte[] challengeData;\n protected ReadDeviceData asyncKeyData;\n protected ReadDeviceData asyncSignData... | import com.trezoragent.sshagent.DeviceService;
import com.trezoragent.sshagent.SSHAgent;
import com.trezoragent.sshagent.DeviceWrapper;
import com.trezoragent.utils.AgentConstants;
import static com.trezoragent.utils.AgentConstants.*;
import com.trezoragent.utils.LocalizedLogger;
import java.awt.*;
import java.awt.even... | package com.trezoragent.gui;
/**
*
* @author Martin Lizner
*
* Class renders menu in System Tray
*
*/
public class AgentPopUpMenu extends JPopupMenu {
private final String ABOUT_BUTTON_LOCALIZED_KEY = "ABOUT";
private final String SHOW_LOG_FILE_KEY = "SHOW_LOG_FILE";
private final String EDIT_SETT... | File log = new File(System.getProperty("user.home") + File.separator + AgentConstants.LOG_FILE_NAME); | 4 |
badvision/jace | src/main/java/jace/hardware/DiskIIDrive.java | [
"public class EmulatorUILogic implements Reconfigurable {\r\n\r\n static Debugger debugger;\r\n\r\n static {\r\n debugger = new Debugger() {\r\n @Override\r\n public void updateStatus() {\r\n enableDebug(true);\r\n MOS65C02 cpu = (MOS65C02) Emulator.c... | import java.util.concurrent.locks.LockSupport;
import javafx.scene.control.Label;
import jace.EmulatorUILogic;
import jace.core.Computer;
import jace.library.MediaConsumer;
import jace.library.MediaEntry;
import jace.library.MediaEntry.MediaFile;
import jace.state.StateManager;
import jace.state.Stateful;
import java.i... | }
}
} else {
spinCount = (spinCount + 1) & 0x0F;
if (spinCount > 0) {
result = (byte) 0x080;
}
}
return result;
}
void write() {
if (writeMode) {
while (diskUpdatePending) {
... | private MediaFile currentMediaFile; | 4 |
centro/monitoring-center | src/test/java/net/centro/rtb/monitoringcenter/MetricCollectorImplTest.java | [
"public class Configurator {\n public static final String DEFAULT_CONFIG_FILE_NAME = \"monitoringCenter.yaml\";\n\n /**\n * Obtains a MonitoringCenterConfig builder, pre-filled with a given config file in the YAML format. The client\n * can override any config file property programmatically via a buil... | import com.codahale.metrics.*;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import net.centro.rtb.monitoringcenter.config.Configurator;
import net.centro.rtb.monitoringcenter.config.GraphiteReporterConfig;
import net.centro.rtb.moni... | package net.centro.rtb.monitoringcenter;
@RunWith(SeparateClassloaderTestRunner.class)
public class MetricCollectorImplTest {
@BeforeClass
public static void setUp() {
MonitoringCenterConfig monitoringCenterConfig = Configurator.noConfigFile()
.applicationName("applicationName")
... | .graphiteReporterConfig(GraphiteReporterConfig.builder() | 1 |
simo415/spc | src/com/sijobe/spc/command/Waypoint.java | [
"public enum FontColour {\n \n BLACK(\"\\2470\"),\n DARK_BLUE(\"\\2471\"),\n DARK_GREEN(\"\\2472\"),\n DARK_AQUA(\"\\2473\"),\n DARK_RED(\"\\2474\"),\n PURPLE(\"\\2475\"),\n ORANGE(\"\\2476\"),\n GREY(\"\\2477\"),\n DARK_GREY(\"\\2478\"),\n BLUE(\"\\2479\"),\n GREEN(\"\\247a\"),\n AQUA(\"\... | import com.sijobe.spc.util.FontColour;
import com.sijobe.spc.util.Settings;
import com.sijobe.spc.validation.Parameter;
import com.sijobe.spc.validation.ParameterString;
import com.sijobe.spc.validation.Parameters;
import com.sijobe.spc.wrapper.CommandException;
import com.sijobe.spc.wrapper.CommandSender;
import com.s... | package com.sijobe.spc.command;
/**
* Commands that control waypoints, settings, removing and using them.
* Waypoints are saved per player
*
* @author simo_415
* @version 1.0
*/
public class Waypoint extends MultipleCommands {
public static final String PREFIX = "waypoint-";
/**
* The parameter... | private static final Parameters PARAMETERS = new Parameters ( | 4 |
timboudreau/nb-nodejs | node-projects/src/main/java/org/netbeans/modules/nodejs/platform/NativePlatformType.java | [
"public abstract class NodeJSPlatformType implements Comparable<NodeJSPlatformType> {\n\n public abstract String name ();\n\n public static Collection<? extends NodeJSPlatformType> allTypes () {\n return Lookup.getDefault().lookupAll( NodeJSPlatformType.class );\n }\n\n public abstract String add... | import org.openide.filesystems.FileChooserBuilder;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.util.NbPreferences;
import org.openide.util.lookup.ServiceProvider;
import java.io.File;
import java.util.LinkedList;
import org.netbeans... | /* Copyright (C) 2014 Tim Boudreau
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute... | result.add( new DisplayNamePanel() ); | 3 |
mpusher/mpush-client-java | src/main/java/com/mpush/handler/OkMessageHandler.java | [
"public interface Connection {\n\n void connect();\n\n void close();\n\n void reconnect();\n\n void send(Packet packet);//TODO add send Listener\n\n boolean isConnected();\n\n boolean isAutoConnect();\n\n boolean isReadTimeout();\n\n boolean isWriteTimeout();\n\n void setLastReadTime();\n... | import com.mpush.api.connection.Connection;
import com.mpush.api.protocol.Command;
import com.mpush.api.protocol.Packet;
import com.mpush.message.OkMessage;
import com.mpush.api.Logger;
import com.mpush.client.ClientConfig; | /*
* (C) Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | public OkMessage decode(Packet packet, Connection connection) { | 2 |
nmby/jUtaime | project/src/main/java/xyz/hotchpotch/jutaime/throwable/RaiseMatchers.java | [
"public class InChain extends InChainBase {\r\n \r\n // [static members] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++\r\n \r\n /**\r\n * スローされた例外の例外チェインの中に、期待される型の例外が含まれるかを検査する {@code Matcher} オブジェクトを返します。<br>\r\n * このメソッドにより返される {@code Matcher} オブジェクトは、例外チェインの中の例外の型が期待された型のサブクラスの場合も... | import java.util.Objects;
import org.hamcrest.Matcher;
import xyz.hotchpotch.jutaime.throwable.matchers.InChain;
import xyz.hotchpotch.jutaime.throwable.matchers.InChainExact;
import xyz.hotchpotch.jutaime.throwable.matchers.NoCause;
import xyz.hotchpotch.jutaime.throwable.matchers.Raise;
import xyz.hotchpotch.ju... | package xyz.hotchpotch.jutaime.throwable;
/**
* オペレーションによりスローされる例外およびエラーを検査するための各種 {@code Matcher} を提供するユーティリティクラスです。<br>
* {@link Testee} と組み合わせた利用方法については、
* {@link xyz.hotchpotch.jutaime.throwable xyz.hotchpotch.jutaime.throwable パッケージの説明}を参照してください。<br>
* <br>
* 一般に、このクラスの static ファクトリメソッドにより提供される ... | return new RaiseMatcher(InChain.inChain(expectedType));
| 0 |
FreeSunny/Amazing | app/src/main/java/com/demo/amazing/net/WSService.java | [
"public class Action {\n\n public static final int UNKNOWN_ACTION = -1;\n\n public static final int LINK_ACTION = 1;\n\n public static final int FAIL_ACTION = 2;\n\n public static final int VOTE_ACTION = 3;\n\n public static final int DESC_ACTION = 4;\n\n public int action;// 动作类型\n\n public St... | import android.os.Handler;
import android.os.Looper;
import com.demo.amazing.net.action.Action;
import com.demo.amazing.net.action.ActionFactory;
import com.demo.amazing.net.bean.LinkPing;
import com.demo.amazing.net.client.WSClient;
import com.demo.amazing.net.config.LinkStatus;
import com.demo.amazing.net.config.WSLi... | package com.demo.amazing.net;
/**
* web socket service
* <p>
* Created by hzsunyj on 2017/8/28.
*/
public class WSService {
private static WSClient client;
private static WSService service;
private WSLink wsLink;
/**
* dispatch ui thread
*/
private Handler handler;
privat... | private LinkPing linkPing; | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.