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 |
|---|---|---|---|---|---|---|
mstojcevich/Radix | core/src/sx/lambda/voxel/tasks/MovementHandler.java | [
"public class RadixClient extends ApplicationAdapter {\n\n // TODO CLEANUP the render loop is VERY undocumented and things happen all over the place, clean that up\n\n public static final String GAME_TITLE = \"VoxelTest\";\n private static RadixClient theGame;\n\n private SettingsManager settingsManager... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.collision.BoundingBox;
import sx.lambda.voxel.RadixClient;
import sx.lambda.voxel.api.BuiltInBlockIds;
import sx.lambda.voxel.block.Block;
import sx.lamb... | } else {
Player player = game.getPlayer();
IWorld world = game.getWorld();
long moveDiffMS = System.currentTimeMillis() - lastMoveCheckMS;
lastMoveCheckMS = System.currentTimeMillis();
final boolean three... | public boolean checkDeltaCollision(LivingEntity e, float deltaX, float deltaY, float deltaZ) { | 3 |
Digipom/Calculator-for-Android | Calculator/src/com/digipom/calculator/logic/Calculator.java | [
"public class BigDecimalPostfixEvaluator extends PostfixEvaluator {\n\tprivate final BigDecimal[] operandStack = new BigDecimal[4096];\n\tprivate int stackPointer = -1;\n\n\tpublic BigDecimalPostfixEvaluator(String input) throws ParseException {\n\t\tsuper(input, NumberPrecision.BIG_DECIMAL);\n\t}\t\t\n\n\tpublic B... | import com.digipom.calculator.R;
import com.digipom.calculator.config.LoggerConfig;
import static com.digipom.calculator.logic.Calculator.ExpressionState.DISPLAY;
import static com.digipom.calculator.logic.Calculator.ExpressionState.EDIT;
import static com.digipom.calculator.logic.Calculator.ExpressionState.ERROR;
impo... | // Copyright 2012 Digipom Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... | private final ExpressionBuilder expressionBuilder = new ExpressionBuilder(); | 1 |
koterpillar/android-sasl | classpath-0.98/gnu/javax/crypto/sasl/crammd5/CramMD5Client.java | [
"public abstract class ClientMechanism\n implements SaslClient\n{\n /** Name of this mechanism. */\n protected String mechanism;\n /** The authorisation identity. */\n protected String authorizationID;\n /** Name of protocol using this mechanism. */\n protected String protocol;\n /** Name of server to aut... | import gnu.java.security.Registry;
import gnu.java.security.util.Util;
import gnu.javax.crypto.sasl.ClientMechanism;
import java.io.IOException;
import java.security.InvalidKeyException;
import javax.security.auth.callback.Callback;
import gnusasl.javax.security.auth.callback.NameCallback;
import javax.security.auth.ca... | /* CramMD5Client.java --
Copyright (C) 2003, 2006 Free Software Foundation, Inc.
Modified for Android (C) 2009, 2010 by Alexey Kotlyarov
This file is a part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published ... | protected void initMechanism() throws SaslException | 4 |
yoichiro/oauth2-server | src/test/java/jp/eisbahn/oauth2/server/granttype/impl/DefaultGrantHandlerProviderTest.java | [
"public interface GrantHandler {\n\n\t/**\n\t * Handle a request to issue a token and issue it.\n\t * This method should be implemented for each grant type of OAuth2\n\t * specification. For instance, the procedure uses a DataHandler instance\n\t * to access to your database. Each grant type has some validation rul... | import static org.junit.Assert.*;
import java.util.Map;
import jp.eisbahn.oauth2.server.granttype.GrantHandler;
import jp.eisbahn.oauth2.server.granttype.impl.AuthorizationCode;
import jp.eisbahn.oauth2.server.granttype.impl.ClientCredentials;
import jp.eisbahn.oauth2.server.granttype.impl.DefaultGrantHandlerProvider;
... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ma... | DefaultGrantHandlerProvider target = new DefaultGrantHandlerProvider(); | 3 |
groundupworks/flying-photo-booth | party-photo-booth/src/com/groundupworks/partyphotobooth/fragments/CaptureFragment.java | [
"public class CameraAudioHelper {\n\n /**\n * The application context.\n */\n private final Context mContext;\n\n /**\n * Resource id for the beep tone.\n */\n private final int mBeepId;\n\n /**\n * Handler for posting to the worker thread.\n */\n private final Handler mWor... | import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable.Callback;
import android.hardware.Camera;
import android.hardware.Camera.AutoFocusCallback;
import android.hardware.Camera.Ca... | /*
* This file is part of Flying PhotoBooth.
*
* Flying PhotoBooth 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.
*
* Flying... | private CenteredPreview mPreview; | 3 |
webbit/webbit | src/test/java/samples/authentication/AsyncPasswordsExample.java | [
"public static WebServer createWebServer(int port) {\n return new NettyWebServer(port);\n}",
"public interface HttpRequest extends DataHolder {\n\n public String COOKIE_HEADER = \"Cookie\";\n\n String uri();\n\n /**\n * Modify uri\n *\n * @param uri new uri\n */\n HttpRequest uri(St... | import static org.webbitserver.WebServers.createWebServer;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import org.webbitserver.HttpRequest;
import org.webbitserver.WebServer;
import org.webbitserver.handler.StaticFileHandler;
import org.we... | package samples.authentication;
/**
* This example how to verify username/passwords in the background without blocking the
* main Webbit thread.
*/
public class AsyncPasswordsExample {
static Executor backgroundAuthenticatorThread = Executors.newSingleThreadExecutor();
public static void main(String[] ... | WebServer webServer = createWebServer(45454) | 0 |
michaelmarconi/oncue | oncue-tests/src/test/java/oncue/tests/WorkRequestTest.java | [
"public abstract class AbstractWorkRequest implements Serializable {\n\n\tprivate static final long serialVersionUID = -3802453222882202468L;\n\n\tprivate final ActorRef agent;\n\tprivate final Set<String> workerTypes;\n\n\tpublic AbstractWorkRequest(ActorRef agent, Set<String> workerTypes) {\n\t\tthis.agent = agen... | import akka.testkit.JavaTestKit;
import static junit.framework.Assert.assertEquals;
import java.util.Arrays;
import java.util.HashSet;
import oncue.common.messages.AbstractWorkRequest;
import oncue.common.messages.EnqueueJob;
import oncue.common.messages.Job;
import oncue.common.messages.WorkResponse;
import oncue.test... | /*******************************************************************************
* Copyright 2013 Michael Marconi
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apa... | createAgent(system, new HashSet<String>(Arrays.asList(TestWorker.class.getName())), agentProbe.getRef()); | 5 |
wagoodman/StackAttack | StackAttackLibrary/src/com/wagoodman/stackattack/GLButton.java | [
"public enum Color {\n\t//Color \tMaterialAmbience\t\t\t \t\t\tMaterial Diffusion\t\t\t\t\t\t\tEnabled?\n\tNONE\t\t(new float[] { 0, 0, 0, 0 }\t, \t\t\tnew float[] { 0, 0, 0, 0 }, \t\t\t\tfalse\t), // NONE must be first!\n\n\t\n\t// Alli 5\n\t\n\tTAN (new float[] {0.82353f, 0.78824f, 0.6f, 1f}, new float[] {1, ... | import java.util.concurrent.Callable;
import javax.microedition.khronos.opengles.GL10;
import com.wagoodman.stackattack.Color;
import com.wagoodman.stackattack.ColorBroker;
import com.wagoodman.stackattack.ColorState;
import com.wagoodman.stackattack.MotionEquation;
import com.wagoodman.stackattack.MainActivity;
import... | package com.wagoodman.stackattack;
public class GLButton<Type> extends GLMenuItem
{
private final Context mContext;
private final MainActivity game;
/*
// EXAMPLE USAGE
mMenuButton = new GLButton<Void>(mContext, SCOREFONT, "This is a test!", 0, 0,
new Callable<Void>() {
public Void call() {
... | public GLButton(Boolean draw, Context context, String fontName, Color fontColor, String[] labels, int x, int y, Boolean leftJust, float fontScale) | 0 |
ThreeTen/threetenbp | src/test/java/org/threeten/bp/TestLocalDate.java | [
"public final class DateTimeFormatter {\n\n //-----------------------------------------------------------------------\n /**\n * Returns the ISO date formatter that prints/parses a date without an offset,\n * such as '2011-12-03'.\n * <p>\n * This returns an immutable formatter capable of print... | import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
import static org.threeten.bp.temporal.ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH;
import static... |
private LocalDate previous(LocalDate date) {
int newDayOfMonth = date.getDayOfMonth() - 1;
if (newDayOfMonth > 0) {
return date.withDayOfMonth(newDayOfMonth);
}
date = date.with(date.getMonth().minus(1));
if (date.getMonth() == Month.DECEMBER) {
date ... | DateTimeFormatter f = DateTimeFormatter.ofPattern("u M d"); | 0 |
NudgeApm/nudge-elasticstack-connector | src/main/java/org/nudge/elasticstack/context/elasticsearch/builder/MBean.java | [
"public class Configuration {\n\n\tprivate static final Logger LOG = Logger.getLogger(Configuration.class);\n\n\t// Configuration files\n\tprivate static final String CONF_FILE = \"nudge-elastic.properties\";\n\tprivate static final String NUDGE_URL = \"nudge.url\";\n\tprivate static final String NUDGE_API_TOKEN = ... | import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.nudge.apm.buffer.probe.RawDataProtocol.Dictionary;
import com.nudge.apm.buffer.probe.RawDataProtocol.Dictionary.DictionaryEntry;
import or... | package org.nudge.elasticstack.context.elasticsearch.builder;
public class MBean {
private static final Logger LOG = Logger.getLogger(MBean.class.getName());
private static final String lineBreak = "\n";
private Configuration config = Configuration.getInstance();
/**
* Retrieve MBean from rawdata
*
* @pa... | appId, nameMbean, objectName, EventType.MBEAN, valueMbean, collectingTime, countAttribute); | 4 |
tools4j/spockito | spockito-junit4/src/main/java/org/tools4j/spockito/TableRowConverters.java | [
"public interface InjectionContext {\n /**\n * THe phase during which the injection occurs.\n */\n enum Phase {\n /**\n * Initialisation phase if injection is triggered at initialisation time, for instance when using the Junit-5\n * {@code SpockitoExtension}, when using {@link S... | import org.tools4j.spockito.table.ValueConverter;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Executable;
import java.lang.reflect.Field;
import java.lang.reflect.Parameter;
import java.lang.reflect.Type;
import static org.tools4j.spockito.Spockito.fieldRefOrName;
import static org.tools4j.spock... | /*
* The MIT License (MIT)
*
* Copyright (c) 2017-2021 tools4j.org (Marco Terzer)
*
* 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 th... | static Object[] convert(final TableRow tableRow, final Executable executable, final ValueConverter valueConverter) { | 3 |
IAmContent/public | public-java/io/iamcontent-servos/src/main/java/com/iamcontent/device/servo/ServoSource.java | [
"public static <C> DefaultingServoSourceCalibration<C> servoSourceCalibration(ServoCalibration calibration) {\r\n\treturn new DefaultingServoSourceCalibration<C>(calibration);\r\n}\r",
"public interface PerChannelSource<C, T> {\r\n\tT forChannel(C channelId);\r\n}\r",
"public class CalibratedServoSource<C> exte... | import static com.iamcontent.device.servo.ServoSourceCalibration.servoSourceCalibration;
import java.util.function.Function;
import com.iamcontent.device.channel.PerChannelSource;
import com.iamcontent.device.servo.impl.CalibratedServoSource;
import com.iamcontent.device.servo.impl.RawServo;
import com.iamcontent.... | /**
IAmContent Public Libraries.
Copyright (C) 2015-2021 Greg Elderfield
@author Greg Elderfield, support@jarchitect.co.uk
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 vers... | return calibrated(servoSourceCalibration(calibration));
| 0 |
yetanotherx/WorldEditCUI | src/main/java/wecui/render/region/EllipsoidRegion.java | [
"public class WorldEditCUI {\n\n public static final String VERSION = \"1.4.5\";\n public static final String MCVERSION = \"1.4.5\";\n public static final int protocolVersion = 2;\n protected Minecraft minecraft;\n protected EventManager eventManager;\n protected Obfuscation obfuscation;\n prot... | import wecui.WorldEditCUI;
import wecui.render.LineColor;
import wecui.render.shapes.RenderEllipsoid;
import wecui.render.points.PointCube;
import wecui.util.Vector3; | package wecui.render.region;
/**
* Main controller for a ellipsoid-type region
*
* @author yetanotherx
* @author lahwran
*/
public class EllipsoidRegion extends BaseRegion {
protected PointCube center;
protected Vector3 radii;
public EllipsoidRegion(WorldEditCUI controller) {
super(con... | new RenderEllipsoid(LineColor.ELLIPSOIDGRID, center, radii).render(); | 1 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | app/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/core/app/MainActivity.java | [
"public class BMSClient extends AbstractClient {\n\t\n public final static String REGION_US_SOUTH = \".ng.bluemix.net\";\n public final static String REGION_UK = \".eu-gb.bluemix.net\";\n public final static String REGION_SYDNEY = \".au-syd.bluemix.net\";\n public final static String REGION_GERMANY = \"... | import android.Manifest;
import android.app.Activity;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import com.ibm.mobilefirstplatform.clientsdk.android.core.api.BMSClient;
impor... | /*
* Copyright 2017 IBM Corp.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or a... | public void networkChanged(NetworkConnectionType newConnection) { | 2 |
moltin/android-example | shutterbug/src/main/java/com/applidium/shutterbug/cache/ImageCache.java | [
"public final class Editor {\n private final Entry entry;\n private boolean hasErrors;\n\n private Editor(Entry entry) {\n this.entry = entry;\n }\n\n /**\n * Returns an unbuffered input stream to read the last committed value,\n * or null if no value has been committed.\n */\n ... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import com.applidium.... | package com.applidium.shutterbug.cache;
public class ImageCache {
public interface ImageCacheListener {
void onImageFound(ImageCache imageCache, Bitmap bitmap, String key, DownloadRequest downloadRequest);
void onImageNotFound(ImageCache imageCache, String key, DownloadRequest downloadRequest);... | public Snapshot storeToDisk(InputStream inputStream, String cacheKey) { | 1 |
vmi/indylisp | src/test/java/jp/vmi/indylisp/importer/ImporterTest.java | [
"public class Engine {\n\n public static final String NAMESPACE = \"Engine\";\n\n private static final Class<?>[] DEFAULT_IMPORTS = {\n Nil.class,\n Cell.class,\n StringWrapper.class,\n NumberWrapper.class,\n BufferedReaderWrapper.class,\n PrintStreamWrapper.class,\n ... | import java.math.BigDecimal;
import org.junit.Test;
import jp.vmi.indylisp.Engine;
import jp.vmi.indylisp.bindings.BoundEntry;
import jp.vmi.indylisp.objects.IndyObject;
import jp.vmi.indylisp.objects.JavaMethod;
import jp.vmi.indylisp.objects.NumberWrapper;
import jp.vmi.indylisp.objects.StringWrapper;
import static j... | package jp.vmi.indylisp.importer;
public class ImporterTest {
@Test
public void testImportMethods() { | Engine engine = Engine.newInstance(); | 0 |
googleapis/java-trace | google-cloud-trace/src/test/java/com/google/cloud/trace/v2/TraceServiceClientTest.java | [
"public final class BatchWriteSpansRequest extends com.google.protobuf.GeneratedMessageV3\n implements\n // @@protoc_insertion_point(message_implements:google.devtools.cloudtrace.v2.BatchWriteSpansRequest)\n BatchWriteSpansRequestOrBuilder {\n private static final long serialVersionUID = 0L;\n // Use Bat... | import com.google.api.gax.core.NoCredentialsProvider;
import com.google.api.gax.grpc.GaxGrpcProperties;
import com.google.api.gax.grpc.testing.LocalChannelProvider;
import com.google.api.gax.grpc.testing.MockGrpcService;
import com.google.api.gax.grpc.testing.MockServiceHelper;
import com.google.api.gax.rpc.ApiClientHe... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | .setStackTrace(StackTrace.newBuilder().build()) | 4 |
zer0Black/zer0MQTTServer | zer0MQTTServer/src/com/syxy/protocol/mqttImp/MQTTProcess.java | [
"public class ConnectMessage extends Message {\n\t\n\tpublic ConnectMessage(FixedHeader fixedHeader, ConnectVariableHeader variableHeader,\n\t\t\tConnectPayload payload) {\n\t\tsuper(fixedHeader, variableHeader, payload);\n\t}\n\t\n\t@Override\n\tpublic ConnectVariableHeader getVariableHeader() {\n\t\treturn (Conne... | import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
import io.netty.handler.timeout.IdleStateHandler;
import com.syxy.protocol.mqttImp.message.ConnectMessage;
import com.syxy.protocol.mqt... | package com.syxy.protocol.mqttImp;
/**
* MQTT协议业务处理
*
* @author zer0
* @version 1.0
* @date 2015-2-16
*/
public class MQTTProcess extends ChannelHandlerAdapter {
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg)
throws Exception {
ProtocolProcess process = ProtocolProcess.getIn... | process.processSubscribe(ctx.channel(), (SubscribeMessage)message); | 4 |
omise/omise-java | src/test/java/co/omise/live/LiveRefundRequestTest.java | [
"public class Client {\n\n private final OkHttpClient httpClient;\n private Requester requester;\n\n /**\n * Creates a Client that sends the specified API version string in the header to access an earlier version\n * of the Omise API.\n *\n * <p>\n * Note: Please ensure to have at least... | import co.omise.Client;
import co.omise.models.OmiseException;
import co.omise.models.Refund;
import co.omise.models.RefundStatus;
import co.omise.models.ScopedList;
import co.omise.requests.Request;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import java.io.IOException;
import static org.j... | package co.omise.live;
public class LiveRefundRequestTest extends BaseLiveTest {
private final String LIVETEST_CHARGE = "[YOUR_CHARGE]";
private final String LIVETEST_REFUND = "[YOUR_REFUND]";
private Client client;
@Before
public void setup() throws Exception {
client = getLiveClient... | public void testLiveCreateRefund() throws IOException, OmiseException { | 1 |
gossi/eclipse-transpiler-plugin | si.gos.transpiler.ui/src/si/gos/transpiler/ui/dialogs/InstalledTranspilerDialog.java | [
"public class TranspilerPlugin extends AbstractUIPlugin {\n\n\t// The plug-in ID\n\tpublic static final String PLUGIN_ID = \"si.gos.transpiler.core\"; //$NON-NLS-1$\n\n\t// The shared instance\n\tprivate static TranspilerPlugin plugin;\n\t\n\tprivate TranspilerManager transpilerManager;\n\t\n\t/**\n\t * The constru... | import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.ComboViewer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.window.IShellProvider;
import org.ecl... | package si.gos.transpiler.ui.dialogs;
public class InstalledTranspilerDialog extends Dialog {
private Text cmd;
private Text path;
private Text name;
private boolean editing = false;
private boolean fillingFromPreset = false;
private InstalledTranspiler transpiler;
private Text sourceExtension;
private ... | controller = new NonInstalledTranspilerController(); | 3 |
samuelhehe/AppMarket | src/com/samuel/downloader/app/AtyDownloadMgr.java | [
"public class CompareableLocalAppInfo {\r\n\r\n\t/**\r\n\t * \r\n\t * \r\n\t AppId String 應用ID appIcon String 应用图标 AppName String 應用名稱 VersionName\r\n\t * String App版本名稱 AppVersion Int App版本編號 SysVersion String Android最低版本要求\r\n\t * VersionDesc String 版本描述 ModifyTime String 更新時間 FileEntity String AppUrl\r\n\t * \r\... | import java.io.File;
import java.util.List;
import net.tsz.afinal.FinalDBChen;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Bundle;
import android.text.format.Formatter;
i... | package com.samuel.downloader.app;
public class AtyDownloadMgr extends BaseActivity implements ContentValue {
private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// 获得需要下载的对象
DownloadFileItem downLoadFile... | imageUri = ImageLoader.getImage(imageurl,
| 4 |
nVisium/MoneyX | src/main/java/com/nvisium/androidnv/api/controller/PaymentController.java | [
"@Entity\n@Table(name = \"eventMemberships\")\npublic class EventMembership {\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.AUTO)\n\tprivate Long id;\n\n\t@Version\n\tprivate Long version;\n\n\t@Column(name = \"eventId\")\n\tprivate Long eventId;\n\n\t@Column(name = \"user\")\n\tprivate Long user;\n\n\t@Col... | import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.transaction.Transactional;
import org.hibernat... | package com.nvisium.androidnv.api.controller;
@RequestMapping(value = "/payment")
@Controller
public class PaymentController {
@Autowired
PaymentService paymentService;
@Autowired
EventService eventService;
@Autowired
UserService userService;
@Autowired
SecurityUtils security;
@PersistenceContext... | List<EventMembership> memberships = eventService.getEventsByMembership(security.getCurrentUserId()); | 0 |
badvision/jace | src/test/java/jace/scripting/TestCommandlineArgs.java | [
"public class Emulator {\r\n\r\n public static Emulator instance;\r\n public static EmulatorUILogic logic = new EmulatorUILogic();\r\n public static Thread mainThread;\r\n\r\n// public static void main(String... args) {\r\n// mainThread = Thread.currentThread();\r\n// instance = new Emulat... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import jace.Emulator;
import jace.apple2e.Apple2e;
import jace.apple2e.MOS65C02;
import jace.apple2e.VideoNTSC;
import jace.apple2e.VideoNTSC.VideoMode;
import jace.core.Computer;
import jace.core.RAM;
import jace.core.SoundMixer;
i... | /*
* Copyright 2019 Brendan Robert
*
* 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... | SoundMixer.MUTE = true; | 7 |
jchampemont/WTFDYUM | src/test/java/com/jeanchampemont/wtfdyum/service/FeatureServiceTest.java | [
"@SpringBootApplication\n@EnableScheduling\npublic class WTFDYUMApplication {\n\n @Bean\n public Clock clock() {\n return Clock.systemDefaultZone();\n }\n\n public static void main(final String[] args) {\n SpringApplication.run(WTFDYUMApplication.class, args);\n }\n}",
"public class E... | import com.jeanchampemont.wtfdyum.WTFDYUMApplication;
import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.service.feature.FeatureStrategy;
import com.jeanchampemont.wtfdyum.service.feature.impl.NotifyUnfollowFeatureStrategy;
import com.jeanchampe... | /*
* Copyright (C) 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Un... | final Map<Feature, FeatureStrategy> featureServices = new HashMap<>(); | 2 |
meltzow/tonegodgui | src/tonegod/gui/controls/windows/Window.java | [
"public class ButtonAdapter extends Button {\r\n\t/**\r\n\t * Creates a new instance of the Button control\r\n\t * \r\n\t * @param screen The screen control the Element is to be added to\r\n\t */\r\n\tpublic ButtonAdapter(ElementManager screen) {\r\n\t\tthis(screen, UIDUtil.getUID(), Vector2f.ZERO,\r\n\t\t\tscreen.... | import com.jme3.font.BitmapFont;
import com.jme3.font.LineWrapMode;
import com.jme3.input.event.MouseButtonEvent;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector4f;
import tonegod.gui.controls.buttons.ButtonAdapter;
import tonegod.gui.core.Element;
import tonegod.gui.core.ElementManager;
import toneg... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package tonegod.gui.controls.windows;
/**
*
* @author t0neg0d
*/
public class Window extends Element {
protected Element dragBar;
protected Element contentArea;
protected ButtonAdapter close, collap... | contentArea = ControlUtil.getContainer(screen);
| 3 |
calibre2opds/calibre2opds | OpdsOutput/src/main/java/com/gmail/dpierron/calibre/opds/Summarizer.java | [
"public class ConfigurationManager {\r\n\r\n public static final String PROFILES_SUFFIX = \".profile.xml\";\r\n private final static String PROFILE_FILENAME = \"profile.xml\";\r\n private final static String DEFAULT_PROFILE = \"default\";\r\n public static final String LOGGING_PREFIX = \"log4j2.\";\r\n public ... | import com.gmail.dpierron.calibre.configuration.ConfigurationManager;
import com.gmail.dpierron.calibre.datamodel.Author;
import com.gmail.dpierron.calibre.datamodel.Book;
import com.gmail.dpierron.calibre.datamodel.Series;
import com.gmail.dpierron.calibre.datamodel.Tag;
import com.gmail.dpierron.tools.i18n.Local... | package com.gmail.dpierron.calibre.opds;
public class Summarizer {
public static int getPageNumber(int itemNumber) {
double pageSize = ConfigurationManager.getCurrentProfile().getMaxBeforePaginate();
double dItemNumber = itemNumber;
double result = dItemNumber / pageSize;
return (int) Ma... | return ((Tag) o).getTextToSort();
| 4 |
xcurator/xcurator | test/edu/toronto/cs/xcurator/discoverer/BasicEntityDiscoveryTest.java | [
"public interface Mapping {\n\n /**\n * Check if this mapping is initialized.\n *\n * @return\n */\n boolean isInitialized();\n\n /**\n * Set this mapping as initialized, return success flag.\n *\n * @return true if successfully initialized, false if not successful.\n */\n ... | import edu.toronto.cs.xcurator.common.DataDocument;
import edu.toronto.cs.xcurator.mapping.Mapping;
import edu.toronto.cs.xcurator.mapping.XmlBasedMapping;
import edu.toronto.cs.xcurator.mapping.Attribute;
import edu.toronto.cs.xcurator.mapping.Schema;
import edu.toronto.cs.xcurator.common.RdfUriBuilder;
import edu.tor... | /*
* Copyright (c) 2013, University of Toronto.
*
* 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 requi... | private RdfUriBuilder rdfUriBuilder; | 4 |
flozano/statsd-netty | metrics-statsd/src/test/java/com/flozano/metrics/client/statsd/IntegrationTest.java | [
"public final class CountValue extends MetricValue {\n\n\tprivate static final String SUFFIX = \"c\";\n\n\tpublic CountValue(String name, long value, Double sample, Tags tags) {\n\t\tsuper(name, value, sample, SUFFIX, tags);\n\t}\n\n\tpublic CountValue(String name, long value, Double sample) {\n\t\tthis(name, value... | import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.everyItem;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.... | package com.flozano.metrics.client.statsd;
@RunWith(Parameterized.class)
public class IntegrationTest {
static final Logger LOGGER = LoggerFactory.getLogger(IntegrationTest.class);
static final AtomicInteger PORTS = new AtomicInteger(8125);
int port;
@Parameters(name = "{index}: items={0}, rcvbuf={2}, flush... | css.add(c.send(new CountValue("example", 1))); | 0 |
Tanaguru/Tanaguru-Survey | tanaguru-survey-impl/src/main/java/org/opens/tanaguru/survey/view/data/factory/SynthesisDataFactoryImpl.java | [
"public interface ContractDataServiceDecorator extends ContractDataService{\n\n /**\n *\n * @param user\n * @return\n */\n int getNumberOfContractsFromPrefix(String prefix);\n\n /**\n * \n * @param listUser\n * @param nbOfContracts\n * @return\n */\n Collection<Contra... | import org.opens.tanaguru.entity.decorator.tgol.user.UserDataServiceDecorator;
import org.opens.tanaguru.survey.view.data.DetailedSurveyList;
import org.opens.tanaguru.survey.view.data.SynthesisData;
import org.opens.tanaguru.survey.view.data.SynthesisDataImpl;
import org.opens.tgol.entity.user.User;
import org.springf... | /*
* Tanaguru - Automated webpage assessment
* Copyright (C) 2008-2011 Open-S Company
*
* This file is part of Tanaguru.
*
* Tanaguru is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either vers... | private UserDataServiceDecorator userDataServiceDecorator; | 1 |
anjlab/sat3 | 3-sat-core/src/test/java/com/anjlab/sat3/TestSimpleTier.java | [
"public static final ITripletValue _000_instance = new _000();\r",
"public static final ITripletValue _001_instance = new _001();\r",
"public static final ITripletValue _010_instance = new _010();\r",
"public static final ITripletValue _011_instance = new _011();\r",
"public static final ITripletValue _100_... | import static com.anjlab.sat3.SimpleTripletValueFactory._111_instance;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.BeforeClass;
import org.junit.Test;
import static com.anjlab.sat3.SimpleTripletValueFactory.... | /*
* Copyright (c) 2010 AnjLab
*
* This file is part of
* Reference Implementation of Romanov's Polynomial Algorithm for 3-SAT Problem.
*
* Reference Implementation of Romanov's Polynomial Algorithm for 3-SAT Problem
* is free software: you can redistribute it and/or modify
* it under the terms of t... | tier.add(_000_instance);
| 0 |
thebrightspark/SparksHammers | src/main/java/brightspark/sparkshammers/item/ItemAOE.java | [
"public class Reference\n{\n public static final String MOD_ID = \"sparkshammers\";\n public static final String MOD_NAME = \"Spark's Hammers\";\n public static final String VERSION = \"@VERSION@\";\n public static final String DEPENDENCIES =\n \"after:enderio;\" +\n \"after:botani... | import brightspark.sparkshammers.Reference;
import brightspark.sparkshammers.SHConfig;
import brightspark.sparkshammers.SparksHammers;
import brightspark.sparkshammers.customTools.Tool;
import brightspark.sparkshammers.util.CommonUtils;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net... | package brightspark.sparkshammers.item;
public class ItemAOE extends ItemTool
{
private static final Set<Block> PickaxeBlocks = Sets.newHashSet(Blocks.ACTIVATOR_RAIL, Blocks.COAL_ORE, Blocks.COBBLESTONE, Blocks.DETECTOR_RAIL, Blocks.DIAMOND_BLOCK, Blocks.DIAMOND_ORE, Blocks.DOUBLE_STONE_SLAB, Blocks.GOLDEN_RAIL,... | setCreativeTab(SparksHammers.SH_TAB); | 2 |
qcloudsms/qcloudsms_java | src/main/java/com/github/qcloudsms/SmsVoicePromptSender.java | [
"public interface HTTPClient {\n\n /**\n * Fetch HTTP response by given HTTP request,\n *\n * @param request Specify which to be fetched.\n *\n * @return the response to the request.\n * @throws IOException connection problem.\n * @throws URISyntaxException url syntax problem.\n ... | import com.github.qcloudsms.httpclient.HTTPClient;
import com.github.qcloudsms.httpclient.HTTPException;
import com.github.qcloudsms.httpclient.HTTPMethod;
import com.github.qcloudsms.httpclient.HTTPRequest;
import com.github.qcloudsms.httpclient.HTTPResponse;
import com.github.qcloudsms.httpclient.DefaultHTTPClient;
i... | package com.github.qcloudsms;
public class SmsVoicePromptSender extends SmsBase {
private String url = "https://cloud.tim.qq.com/v5/tlsvoicesvr/sendvoiceprompt";
public SmsVoicePromptSender(int appid, String appkey) {
super(appid, appkey, new DefaultHTTPClient());
}
public SmsVoicePrompt... | HTTPRequest req = new HTTPRequest(HTTPMethod.POST, this.url) | 2 |
peshkira/c3po | c3po-webapi/app/controllers/Export.java | [
"public class CSVGenerator {\n\n /**\n * Default logger.\n */\n private static final Logger LOG = LoggerFactory.getLogger( CSVGenerator.class );\n\n /**\n * The persistence layer.\n */\n private PersistenceLayer persistence;\n\n /**\n * Creates the generator with the given persistence layer.\n * \n... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
import play.Logger;
import play.data.DynamicForm;
import play.mvc.Controller;
import play.mvc.Result;
import ... | /*******************************************************************************
* Copyright 2013 Petar Petrov <me@petarpetrov.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | long filtersCount = persistence.count(Constants.TBL_FILTERS, | 5 |
R2RML-api/R2RML-api | r2rml-api-rdf4j-binding/src/test/java/rdf4jTest/Simplest_Test.java | [
"public class RDF4JR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static RDF4JR2RMLMappingManager INSTANCE = new RDF4JR2RMLMappingManager(new RDF4J());\n\n private RDF4JR2RMLMappingManager(RDF4J rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import java.io.InputStream;
import java.util.Collection;
import java.util.Iterator;
import eu.optique.r2rml.api.binding.rdf4j.RDF4JR2RMLMappingManager;
import eu.optique.r2rml.api.model.impl.SQLBaseTableOrViewImpl;
import org.apache.commons.rdf.api.IRI;
import org.junit.Assert;
import org.junit.Test;
import org... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | LogicalTable table=current.getLogicalTable();
| 2 |
dtanzer/jobjectformatter | src/main/java/net/davidtanzer/jobjectformatter/valuesinfo/ObjectValuesCompiler.java | [
"public enum FormattedFieldType {\n\t/**\n\t * Include the field in the formatted output.\n\t */\n\tDEFAULT,\n\t/**\n\t * Include the field in the formatted output, but only when the output is set to \"verbose\".\n\t */\n\tVERBOSE,\n\t/**\n\t * Do not include the field in the formatted output.\n\t */\n\tNEVER\n}",
... | import net.davidtanzer.jobjectformatter.annotations.FormattedFieldType;
import net.davidtanzer.jobjectformatter.annotations.TransitiveInclude;
import net.davidtanzer.jobjectformatter.typeinfo.ClassInfo;
import net.davidtanzer.jobjectformatter.typeinfo.PropertyInfo;
import net.davidtanzer.jobjectformatter.typeinfo.TypeI... | /*
Copyright 2015 David Tanzer (business@davidtanzer.net / @dtanzer)
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 require... | for(PropertyInfo propertyInfo : classInfo.fieldInfos()) { | 3 |
koendeschacht/count-db | src/main/java/be/bagofwords/db/DataInterfaceFactory.java | [
"public interface Combinator<T extends Object> extends Serializable {\n\n T combine(T first, T second);\n\n default void addRemoteClasses(RemoteObjectConfig objectConfig) {\n //Don't add any classes by default\n }\n\n default RemoteObjectConfig createExecConfig() {\n RemoteObjectConfig res... | import be.bagofwords.db.combinator.Combinator;
import be.bagofwords.db.combinator.OverWriteCombinator;
import be.bagofwords.db.experimental.id.IdDataInterface;
import be.bagofwords.db.experimental.id.IdObject;
import be.bagofwords.db.experimental.index.MultiDataIndexer;
import be.bagofwords.db.experimental.index.MultiD... | package be.bagofwords.db;
public interface DataInterfaceFactory {
<T> DataInterfaceConfig<T> dataInterface(String name, Class<T> objectClass, Class... genericParams);
<T> MultiDataInterfaceIndex<T> multiIndex(DataInterface<T> dataInterface, String nameOfIndex, MultiDataIndexer<T> indexer);
| <T> UniqueDataInterfaceIndex<T> uniqueIndex(DataInterface<T> dataInterface, String nameOfIndex, UniqueDataIndexer<T> indexer); | 6 |
huyongli/TigerVideo | TigerVideoPlayer/src/main/java/cn/ittiger/player/ui/StandardVideoView.java | [
"public interface FullScreenGestureStateListener {\r\n\r\n /**\r\n * 手势开始\r\n */\r\n void onFullScreenGestureStart();\r\n\r\n /**\r\n * 手势结束\r\n */\r\n void onFullScreenGestureFinish();\r\n}\r",
"public interface FullScreenToggleListener {\r\n\r\n /**\r\n * 开始进入全屏\r\n */\r\n... | import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.os.Build;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.MotionEvent;
import android.view.Te... | package cn.ittiger.player.ui;
/**
* 视频播放时界面上各控件的显示控制
* @author: ylhu
* @time: 2017/12/15
*/
public abstract class StandardVideoView extends RelativeLayout implements
View.OnClickListener,
View.OnTouchListener,
FullScreenGestureStateListener,
| FullScreenToggleListener,
| 1 |
mattinsler/com.lowereast.guiceymongo | src/main/java/com/lowereast/guiceymongo/guice/spi/BuilderImpls.java | [
"public interface IsData {\n}",
"public interface BucketConfiguration {\n\tBucketOptionConfiguration to(String bucket);\n}",
"public interface BucketOptionConfiguration {\n\tFinishableConfiguration inDatabase(String databaseKey);\n}",
"public interface CollectionConfiguration extends CollectionConfigurationOn... | import com.google.inject.Binder;
import com.google.inject.Module;
import com.lowereast.guiceymongo.data.IsData;
import com.lowereast.guiceymongo.guice.spi.Builders.BucketConfiguration;
import com.lowereast.guiceymongo.guice.spi.Builders.BucketOptionConfiguration;
import com.lowereast.guiceymongo.guice.spi.Builders.Coll... | /**
* Copyright (C) 2010 Lowereast Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | public CollectionConfigurationOnlyTo ofType(Class<? extends IsData> dataType) { | 0 |
zznate/intravert-ug | src/main/java/io/teknek/intravert/action/impl/CreateColumnFamilyAction.java | [
"public interface Action {\n void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application);\n}",
"public class Operation {\n private String type;\n private String id;\n private Map<String,Object> arguments;\n \n public Operation(){\n arguments = new HashMap... | import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.KSMetaData;
import org.apache.cassandra.config.Schema;
import org.apache.cassandra.exceptions.ConfigurationException;
import org.apache.cassandra.exceptions.InvalidRequestException;
import org.apache.cassandra.service.MigrationManager;
im... | package io.teknek.intravert.action.impl;
public class CreateColumnFamilyAction implements Action {
@Override | public void doAction(Operation operation, Response response, RequestContext request, | 1 |
giancosta86/EasyPmd | src/main/java/info/gianlucacosta/easypmd/ide/IdeScanner.java | [
"public interface AnnotationService {\n\n void attachAnnotationsTo(Options options, DataObject dataObject, Set<ScanMessage> scanMessages);\n\n void detachAnnotationsFrom(FileObject fileObject);\n\n void detachAllAnnotations();\n}",
"public class GuardedSectionsAnalyzer {\n\n private final Set<Integer>... | import info.gianlucacosta.easypmd.ide.annotations.AnnotationService;
import info.gianlucacosta.easypmd.ide.annotations.GuardedSectionsAnalyzer;
import info.gianlucacosta.easypmd.ide.options.Options;
import info.gianlucacosta.easypmd.ide.options.OptionsChanges;
import info.gianlucacosta.easypmd.ide.options.OptionsServic... | /*
* ==========================================================================%%#
* EasyPmd
* ===========================================================================%%
* Copyright (C) 2009 - 2017 Gianluca Costa
* ===========================================================================%%
* This program is ... | private final AnnotationService annotationService; | 0 |
hxnx-sam/DiscreteSpatialPhyloSimulator | src/io/WriteNetworkConfigurationXML.java | [
"public enum DemeType {\n\tMIGRATION_OF_INFECTEDS, INFECTION_OVER_NETWORK\n}",
"public class JustBeforeRecoverySampler implements Sampler {\n\t\n\tprotected double justBefore = 1e-16;\n\n\tpublic JustBeforeRecoverySampler() {\n\t\t\n\t}\n\t\n\tpublic void setJustBefore(double d) {\n\t\tthis.justBefore = d;\n\t}\n... | import individualBasedModel.DemeType;
import individualBasedModel.JustBeforeRecoverySampler;
import individualBasedModel.ModelType;
import individualBasedModel.PopulationType;
import individualBasedModel.Sampler;
import java.util.ArrayList;
import java.util.List; | package io;
/**
* class to create the input xml for DiscreteSpatialPhyloSimulator,
* specifically for a network.
* It reads the edge list from edgeList.csv, assumes 1 host per deme, and infection parameters, and writes example_network_params.xml
* @author Samantha Lycett
* @version 29 Dec 2014
*
*/
public cla... | ModelType modelType = ModelType.SIR; | 2 |
arquillian/arquillian-extension-seam2 | src/main/java/org/jboss/arquillian/seam2/client/Seam2ArchiveProcessor.java | [
"public final class ReflectionHelper\n{\n\n //-------------------------------------------------------------------------------||\n // Constructor ------------------------------------------------------------------||\n //-------------------------------------------------------------------------------||\n\n /**\... | import java.io.File;
import java.util.Map;
import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor;
import org.jboss.arquillian.core.api.Instance;
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.seam2.ReflectionHelper;
import org.jboss.arquillian.... | /*
* JBoss, Home of Professional Open Source
* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Vers... | private Instance<Seam2Configuration> configurationInstance; | 1 |
Hevelian/hevelian-olastic | olastic-core/src/main/java/com/hevelian/olastic/core/elastic/parsers/EntityParser.java | [
"public class ElasticEdmEntitySet extends EdmEntitySetImpl {\n\n private ElasticCsdlEntitySet csdlEntitySet;\n private ElasticEdmProvider provider;\n\n /**\n * Initialize fields.\n * \n * @param provider\n * the EDM provider\n * @param container\n * the EDM ent... | import com.hevelian.olastic.core.edm.ElasticEdmEntitySet;
import com.hevelian.olastic.core.edm.ElasticEdmEntityType;
import com.hevelian.olastic.core.edm.ElasticEdmProperty;
import com.hevelian.olastic.core.elastic.ElasticConstants;
import com.hevelian.olastic.core.processors.data.InstanceData;
import com.hevelian.olas... | package com.hevelian.olastic.core.elastic.parsers;
/**
* Parser class for single entity.
*
* @author rdidyk
*/
public class EntityParser extends SingleResponseParser<EdmEntityType, Entity> {
@Override
public InstanceData<EdmEntityType, Entity> parse(SearchResponse response, | ElasticEdmEntitySet entitySet) throws ODataApplicationException { | 0 |
documaster/noark-extraction-validator | noark-extraction-validator/src/main/java/com/documaster/validator/validation/noark5/validators/XMLValidator.java | [
"public class BaseItem {\n\n\tprivate Map<String, Object> values;\n\n\tpublic Map<String, Object> getValues() {\n\n\t\tif (values == null) {\n\t\t\tvalues = new LinkedHashMap<>();\n\t\t}\n\t\treturn values;\n\t}\n\n\tpublic BaseItem add(String name, Object value) {\n\n\t\tgetValues().put(name.toLowerCase(), value);... | import java.io.File;
import java.util.List;
import com.documaster.validator.storage.model.BaseItem;
import com.documaster.validator.validation.collector.ValidationCollector;
import com.documaster.validator.validation.collector.ValidationResult;
import com.documaster.validator.validation.noark5.model.Noark5PackageEntity... | /**
* Noark Extraction Validator
* Copyright (C) 2016, Documaster AS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any la... | result.addError(new BaseItem().add("Error", "Missing file: " + xmlFile.getName())); | 0 |
komamitsu/fluency | fluency-aws-s3/src/main/java/org/komamitsu/fluency/aws/s3/recordformat/CsvRecordFormatter.java | [
"public abstract class AbstractRecordFormatter\n implements RecordFormatter\n{\n private static final Logger LOG = LoggerFactory.getLogger(AbstractRecordFormatter.class);\n protected final ObjectMapper objectMapperForMessagePack = new ObjectMapper(new MessagePackFactory());\n protected final Config ... | import org.komamitsu.fluency.recordformat.AbstractRecordFormatter;
import org.komamitsu.fluency.recordformat.recordaccessor.MapRecordAccessor;
import org.komamitsu.fluency.recordformat.recordaccessor.MessagePackRecordAccessor;
import org.komamitsu.fluency.recordformat.recordaccessor.RecordAccessor;
import org.komamitsu... | /*
* Copyright 2019 Mitsunori Komatsu (komamitsu)
*
* 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 applicabl... | private byte[] formatInternal(RecordAccessor recordAccessor) | 3 |
flyver/Flyver-SDK | IOIO/iOIOLibAndroid/src/main/java/ioio/lib/impl/IOIOProtocol.java | [
"public interface DigitalInput extends Closeable {\n /**\n * A digital input pin specification, used when opening digital inputs.\n */\n static public class Spec {\n /**\n * Input pin mode.\n */\n public enum Mode {\n /**\n * Pin is floating. When t... | import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import ioio.lib.api.DigitalInput;
import ioio.lib.api.DigitalOutput;
import ioio.lib.api.SpiMaster;
import ioio.lib.api.TwiMaster.Rate;
import ioio.lib.api.Uart;
imp... | }
private void writeThreeBytes(int i) throws IOException {
writeByte(i & 0xFF);
writeByte((i >> 8) & 0xFF);
writeByte((i >> 16) & 0xFF);
}
public synchronized void sync() throws IOException {
beginBatch();
writeByte(SYNC);
endBatch();
}
synchron... | synchronized public void setPinDigitalOut(int pin, boolean value, DigitalOutput.Spec.Mode mode) | 1 |
PowerBack/AnKey | AnKey/app/src/main/java/net/qiujuer/powerback/ankey/ui/activity/MainActivity.java | [
"public class AppPresenter {\n private static final Object SERVICE_LOCK = new Object();\n private static KeyTool KEY_TOOL;\n private static boolean ALLOW_D_KEY = true;\n\n\n public static void setApplication(Application application) {\n AppModel.setApplication(application);\n }\n\n public s... | import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import net.qiujuer.genius.ui.widget.FloatAc... | package net.qiujuer.powerback.ankey.ui.activity;
public class MainActivity extends SuperActivity implements View.OnClickListener, InfoListAdapterCallback {
private View mStatus;
private Loading mLoading;
private RecyclerView mRecycler;
private InfoListAdapter mInfoListAdapter;
@Override
pro... | DetailView view = (DetailView) View.inflate(this, R.layout.lay_detail, null); | 4 |
freedomofme/Netease | app/src/main/java/com/hhxplaying/neteasedemo/netease/adapter/HorizontalImageRecyclerViewAdapter.java | [
"public class MyApplication extends Application {\n public static int width = 0;\n public static int height = 0;\n public static float density = 0;\n public void onCreate() {\n super.onCreate();\n width = ScreenUtil.getWidth(this);\n height = ScreenUtil.getHeight(this);\n den... | import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import androi... | package com.hhxplaying.neteasedemo.netease.adapter;
/**
* Created by HHX on 15/9/9.
*/
public class HorizontalImageRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements View.OnTouchListener{
private final LayoutInflater mLayoutInflater;
private final Context mContext;
pri... | PhotoSet photoSet; | 2 |
DorsetProject/dorset-framework | agents/web-api/src/main/java/edu/jhuapl/dorset/agents/StockAgent.java | [
"public class Response {\n private final Type type;\n private final String text;\n private final String payload;\n private final ResponseStatus status;\n\n /**\n * Create a response\n *\n * @param text the text of the response\n */\n public Response(String text) {\n this.ty... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util... | /*
* Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC
* 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/li... | return new AgentResponse(Response.Type.JSON, | 0 |
l3nz/SlicedBread | tests/ch/loway/oss/slicedbread/tasks/DeferredPoolTest.java | [
"public class MessagingConsole {\n\n private static final Logger logger = LoggerFactory.getLogger(MessagingConsole.class);\n private static final MessagingConsole me = new MessagingConsole();\n private final Map<PID,MsgQueue> mQueues = new ConcurrentHashMap<PID,MsgQueue>();\n\n private final static int ... | import ch.loway.oss.slicedbread.MessagingConsole;
import ch.loway.oss.slicedbread.SbTools;
import ch.loway.oss.slicedbread.containers.*;
import ch.loway.oss.slicedbread.messages.Msg;
import ch.loway.oss.slicedbread.messages.wd.MsgPoolDeferred;
import ch.loway.oss.slicedbread.messages.wd.MsgPoolRunnable;
import ch.loway... |
package ch.loway.oss.slicedbread.tasks;
/**
* Test deferred message execution on a thread pool.
*
* @author lenz
*/
public class DeferredPoolTest {
public static final Logger logger = LoggerFactory.getLogger(DeferredPoolTest.class);
public static final MessagingConsole mc = MessagingConsole.getConsole(... | public static class RTaskGeneric implements RTask { | 5 |
mokszr/ultimate-geojson | ugeojson-builder/src/main/java/org/ugeojson/builder/geometry/CommonGeometryBuilder.java | [
"public interface BuilderConstants {\n\n\tpublic static final String OPEN_BRACKET = \"[\";\n\tpublic static final String CLOSE_BRACKET = \"]\";\n\tpublic static final String OPEN_CURLY_BRACE = \"{\";\n\tpublic static final String CLOSE_CURLY_BRACE = \"}\";\n\t\n\tpublic static final String COMMA_SPACE = \", \";\n\t... | import java.util.HashMap;
import java.util.Map;
import org.ugeojson.builder.common.BuilderConstants;
import org.ugeojson.model.geometry.GeometryCollectionDto;
import org.ugeojson.model.geometry.GeometryDto;
import org.ugeojson.model.geometry.LineStringDto;
import org.ugeojson.model.geometry.MultiLineStringDto;
import o... | package org.ugeojson.builder.geometry;
/**
* Find suitable geometry builder
*
* @author moksuzer
*
*/
public final class CommonGeometryBuilder {
private static Map<Class<? extends GeometryDto>, GeometryBuilder<?>> builders = new HashMap<>();
static {
builders.put(PointDto.class, PointBuilder.getInstance(... | builders.put(MultiPointDto.class, MultiPointBuilder.getInstance()); | 5 |
rogeriogentil/data-structures-and-algorithms | src/main/java/rogeriogentil/data/structures/chapter14/AdjacencyMapGraph.java | [
"public class LinkedPositionalList<E> implements PositionalList<E> {\n\n private Node<E> header;\n private Node<E> trailer;\n private int size = 0;\n\n public LinkedPositionalList() {\n header = new Node(null, null, null);\n trailer = new Node(null, header, null);\n header.setNext(trailer);\n... | import rogeriogentil.data.structures.chapter07.LinkedPositionalList;
import rogeriogentil.data.structures.chapter07.Position;
import rogeriogentil.data.structures.chapter07.PositionalList;
import rogeriogentil.data.structures.chapter10.Map;
import rogeriogentil.data.structures.chapter10.UnsortedTableMap; | package rogeriogentil.data.structures.chapter14;
/**
*
* @author Rogerio J. Gentil
* @param <V> Vertex
* @param <E> Edge
*/
public class AdjacencyMapGraph<V, E> implements Graph<V, E> {
/**
* A vertex of an adjacency map graph representation.
*
* @param <V>
*/
private class InnerVert... | private PositionalList<Vertex<V>> vertices = new LinkedPositionalList<>(); | 2 |
lanixzcj/LoveTalkClient | src/com/example/lovetalk/activity/NewFriendActivity.java | [
"public class NewFriendAdapter extends BaseListAdapter<AddRequest> {\n\n\tpublic NewFriendAdapter(Context context, List<AddRequest> list) {\n\t\tsuper(context, list);\n\t\t// TODO Auto-generated constructor stub\n\t}\n\n\t@Override\n\tpublic View getView(int position, View conView, ViewGroup parent) {\n\t\t// TODO ... | import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.ListView;
import com.avos.avoscloud.AVUser;
import com.example.lovetalk.R;
impor... | package com.example.lovetalk.activity;
public class NewFriendActivity extends BaseActivity implements OnItemLongClickListener {
ListView listview; | NewFriendAdapter adapter; | 0 |
millecker/storm-apps | commons/src/at/illecker/storm/commons/postagger/ArkPOSTagger.java | [
"public class Configuration {\n private static final Logger LOG = LoggerFactory\n .getLogger(Configuration.class);\n\n public static final boolean RUNNING_WITHIN_JAR = Configuration.class\n .getResource(\"Configuration.class\").toString().startsWith(\"jar:\");\n\n public static final String WORKING_DIR... | import cmu.arktweetnlp.Tagger.TaggedToken;
import cmu.arktweetnlp.impl.Model;
import cmu.arktweetnlp.impl.ModelSentence;
import cmu.arktweetnlp.impl.Sentence;
import cmu.arktweetnlp.impl.features.FeatureExtractor;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import... | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | Dataset dataset = Configuration.getDataSetSemEval2013(); | 1 |
UndefinedOffset/eclipse-silverstripedt | ca.edchipman.silverStripePDT/src/ca/edchipman/silverstripepdt/SilverStripePDTPlugin.java | [
"@SuppressWarnings(\"restriction\")\npublic class SSTemplateCompletionProcessor extends TemplateCompletionProcessor {\n public static final String TEMPLATE_CONTEXT_ID = \"ss_proposal\";\n private Image proposalIcon;\n private ITextViewer fTextViewer;\n \n private static final class ProposalComparator... | import java.io.IOException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.templates.ContextTypeRegistry;
import org.eclipse.jface.text.templates.persistence.TemplateStore;
import org.eclipse.php.internal.ui.Logger;
import org.eclipse.php.inter... | package ca.edchipman.silverstripepdt;
/**
* The activator class controls the plug-in life cycle
*/
@SuppressWarnings("restriction")
public class SilverStripePDTPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "ca.edchipman.silverstripepdt"; //$NON-NLS-1$
public... | templateStore = new SilverStripeTemplateStore(getTemplateContextRegistry(), getPreferenceStore(), "ca.edchipman.silverstripepdt.SilverStripe.templates"); | 1 |
davemorrissey/brightpearl-api-client-java | src/test/java/uk/co/visalia/brightpearl/apiclient/BrightpearlApiSessionTest.java | [
"public final class Account implements Serializable {\n\n private final Datacenter datacenter;\n\n private final String accountCode;\n\n /**\n * Construct an account instance.\n * @param datacenter the datacenter that hosts the account.\n * @param accountCode the customer account code.\n */... | import com.google.common.collect.ImmutableMap;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.invocation.InvocationOnMock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
import uk.c... | /*
* Copyright 2014 David Morrissey
*
* 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... | return ResponseBuilder.newResponse().withStatus(401).withHeaders(ImmutableMap.of("content-type", "application/json")).withBody("{\"response\":{}}").build(); | 7 |
bencvt/LibShapeDraw | projects/main/src/test/java/libshapedraw/shape/TestWireframeCuboid.java | [
"public class MockMinecraftAccess implements MinecraftAccess {\n private boolean drawingStarted = false;\n private int curCountVertices = 0;\n private int countDraw = 0;\n private int countVertices = 0;\n private int countEnableStandardLighting = 0;\n private int countSendChatMessage = 0;\n\n p... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import libshapedraw.MockMinecraftAccess;
import libshapedraw.SetupTestEnvironment;
import libshap... | package libshapedraw.shape;
public class TestWireframeCuboid extends SetupTestEnvironment.TestCase {
@Test
public void testConstructors() {
new WireframeCuboid(1.0,2.0,3.0, 4.0,5.0,6.0);
new WireframeCuboid(new Vector3(1.0,2.0,3.0), new Vector3(4.0,5.0,6.0));
// it is valid to have b... | shape.setLineStyle(Color.BISQUE.copy(), 5.0F, true); | 2 |
Sleeksnap/sleeksnap | src/org/sleeksnap/uploaders/images/SleeksnapUploader.java | [
"public class HttpUtil {\n\n\t/**\n\t * Attempt to encode the string silenty\n\t * \n\t * @param string\n\t * The string\n\t * @return The encoded string\n\t */\n\tpublic static String encode(String string) {\n\t\ttry {\n\t\t\treturn URLEncoder.encode(string, \"UTF-8\");\n\t\t} catch (UnsupportedEncoding... | import java.net.URLEncoder;
import org.sleeksnap.http.HttpUtil;
import org.sleeksnap.upload.ImageUpload;
import org.sleeksnap.uploaders.UploadException;
import org.sleeksnap.uploaders.Uploader;
import org.sleeksnap.util.Utils.ImageUtil; | /**
* Sleeksnap, the open source cross-platform screenshot uploader
* Copyright (C) 2012 Nikki <nikki@nikkii.us>
*
* 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 L... | String resp = HttpUtil.executePost("http://sleeksnap.com/upload", "image=" | 0 |
MFlisar/StorageManager | lib/src/main/java/com/michaelflisar/storagemanager/folders/BaseFolder.java | [
"public class StorageDefinitions\n{\n public static final String AUTHORITY_MAIN = \"content://com.android.externalstorage.documents\";\n public static final String AUTHORITY_TREE = \"content://com.android.externalstorage.documents/tree\";\n public static final String AUTHORITY_COLON = \"%3A\";\n public ... | import com.michaelflisar.storagemanager.StorageDefinitions;
import com.michaelflisar.storagemanager.data.MediaStoreFolderData;
import com.michaelflisar.storagemanager.interfaces.IFile;
import com.michaelflisar.storagemanager.interfaces.IFolder;
import com.michaelflisar.storagemanager.interfaces.IMediaStoreFolder;
impor... | package com.michaelflisar.storagemanager.folders;
/**
* Created by flisar on 03.02.2016.
*/
public abstract class BaseFolder<T> implements IFolder<T>, IMediaStoreFolder<T>
{
protected StorageDefinitions.FolderStatus status = StorageDefinitions.FolderStatus.NotLoaded; | protected IFile<T> folder; | 2 |
lwfwind/smart-api-framework | src/com/qa/framework/core/TestSuiteConvertor.java | [
"public class TestCase {\n private String name;\n private String desc;\n private List<Setup> setupList;\n private Map<String, Setup> setupMap;\n private List<Param> params; //包含的数据\n private ExtraCheck extraCheck; //自定义的检查方法\n private int sendTime = 1;\n private boolean storeCookie;\n p... | import com.library.common.IOHelper;
import com.library.common.ReflectHelper;
import com.library.common.XmlHelper;
import com.qa.framework.bean.TestCase;
import com.qa.framework.bean.TestSuite;
import com.qa.framework.exception.TestCaseDescDuplicatedException;
import com.qa.framework.exception.TestCaseNameDuplicatedExce... | package com.qa.framework.core;
/**
* 将xml中的数据转化成对应的bean类
*/
public class TestSuiteConvertor {
private static final Logger logger = Logger.getLogger(TestSuiteConvertor.class); | private TestSuite testSuite; | 1 |
threerings/nexus | jvm-server/src/test/java/com/threerings/nexus/server/ClientServerTest.java | [
"public class JVMClient extends NexusClient\n{\n /** Creates an executor that executes commands on the AWT thread. */\n public static Executor awtExecutor () {\n return new Executor() {\n public void execute (Runnable command) {\n EventQueue.invokeLater(command);\n ... | import java.io.IOException;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import react.Slot;
import com.threerings.nexus.client.JVMClient;
import com.threerings.nexus.client.NexusClient;
import com.th... | //
// Nexus JVMServer - server-side support for Nexus java.nio-based services
// http://github.com/threerings/nexus/blob/master/LICENSE
package com.threerings.nexus.server;
/**
* Tests simple client server communication.
*/
public class ClientServerTest
{
public abstract class TestAction {
/** This ... | NexusClient client = new JVMClient(Executors.newSingleThreadExecutor(), 1234); | 0 |
rockihack/Stud.IP-FileSync | src/de/uni/hannover/studip/sync/views/OAuthWebviewController.java | [
"@JsonIgnoreProperties(ignoreUnknown = true)\npublic class User {\n\tpublic String user_id;\n\tpublic String username;\n\tpublic Name name;\n\n\t/**\n\t * Default constructor\n\t */\n\tpublic User() {\n\t}\n\n\t@JsonIgnoreProperties(ignoreUnknown = true)\n\tpublic class Name {\n\t\tpublic String family;\n\t\tpublic... | import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.scribe.exceptions.OAuthConnectionException;
import org.scribe.exceptions.OAuthException;
import org.scribe.model.Token;
import de.elanev.studip.android.app.backend.datamodel.User;
import de.uni.hannover.studip.sync.Ma... | package de.uni.hannover.studip.sync.views;
/**
*
* @author Lennart Glauer
*
*/
public class OAuthWebviewController extends AbstractController {
private static final Config CONFIG = Config.getInstance();
private static final OAuth OAUTH = OAuth.getInstance();
@FXML
private WebView webView;
/**
* The i... | getMain().setView(Main.SETUP_ROOTDIR); | 1 |
tkrajina/10000sentences | tatoebaimporter/src/main/java/info/puzz/a10000sentences/importer/importers/Importer.java | [
"public enum CollectionType {\n\n TATOEBA(\"https://tatoeba.org\", new CollectionTypeInfo() {\n @Override\n public String getSentenceUrl(String sentenceId) {\n return null;\n }\n }),\n\n EU_CORPUS(\"http://www.statmt.org/europarl/\", new CollectionTypeInfo() {\n @Over... | import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.regex.Pattern;
import info.puzz.a10000sentences.apimodels.CollectionType;
import info.puzz.a10000sentences.apimodels.LanguageVO;
import info.puzz.a1000... | package info.puzz.a10000sentences.importer.importers;
public abstract class Importer {
protected static final String RAW_FILES_PATH = "../raw_files";
public static final int MAX_SENTENCES_NO = 12_000;
private static Pattern NUMBER_DELIMITER = Pattern.compile("^.*\\d+.*$");
final String knownLang... | protected void calculateComplexityAndReorder(WordCounter wordCounter, List<SentenceVO> sentences) { | 2 |
kawasima/solr-jdbc | src/main/java/net/unit8/solr/jdbc/impl/ResultSetMetaDataImpl.java | [
"public abstract class Expression {\n\tprotected SolrType type;\n\tprotected String columnName;\n\tprotected String tableName;\n\tprotected String alias;\n\tprotected SolrType originalType;\n\n\tpublic SolrType getType() {\n\t\tif(type == null)\n\t\t\treturn SolrType.UNKNOWN;\n\t\treturn type;\n\t}\n\n\t/**\n\t * J... | import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import net.unit8.solr.jdbc.expression.Expression;
import net.unit8.solr.jdbc.expression.FunctionExpression;
import net.unit8.solr.jdbc.message.DbException;
impo... | package net.unit8.solr.jdbc.impl;
public class ResultSetMetaDataImpl implements ResultSetMetaData {
private final String catalog;
private final AbstractResultSet resultSet;
private final List<Expression> expressions;
// private final List<ColumnExpression> solrColumns = new ArrayList<ColumnExpression>();
publ... | SolrType type = expressions.get(column).getType(); | 5 |
alex73/OSMemory | src/org/alex73/osmemory/geometry/OsmHelper.java | [
"public interface IOsmNode extends IOsmObject {\n public static final double DIVIDER = 0.0000001;\n\n /**\n * Get latitude as int, i.e. multiplied by 10000000.\n */\n int getLat();\n\n /**\n * Get longitude as int, i.e. multiplied by 10000000.\n */\n int getLon();\n\n /**\n * G... | import org.alex73.osmemory.IOsmNode;
import org.alex73.osmemory.IOsmObject;
import org.alex73.osmemory.IOsmRelation;
import org.alex73.osmemory.IOsmWay;
import org.alex73.osmemory.MemoryStorage;
import com.vividsolutions.jts.geom.Geometry; | /**************************************************************************
OSMemory library for OSM data processing.
Copyright (C) 2014 Aleś Bułojčyk <alex73mail@gmail.com>
This 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 ... | return new ExtendedNode((IOsmNode) obj, osm); | 0 |
googleapis/java-bigqueryconnection | google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java | [
"public final class Connection extends com.google.protobuf.GeneratedMessageV3\n implements\n // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.Connection)\n ConnectionOrBuilder {\n private static final long serialVersionUID = 0L;\n // Use Connection.newBuilder() to constr... | import com.google.api.core.BetaApi;
import com.google.cloud.bigquery.connection.v1.Connection;
import com.google.cloud.bigquery.connection.v1.ConnectionServiceGrpc.ConnectionServiceImplBase;
import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest;
import com.google.cloud.bigquery.connection.v1.DeleteConn... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | CreateConnectionRequest request, StreamObserver<Connection> responseObserver) { | 0 |
kravchik/senjin | src/main/java/yk/senjin/examples/simple/IKnowOpenGL_9_FrameBuffer2.java | [
"public class FrameBuffer {\n public int framebufferID;\n public int depthRenderBufferID;\n public YList<SomeTexture> textures;\n public Vec3f backgroundColor = Vec3f.ZERO();\n\n public int w, h;\n\n public static FrameBuffer multipleRenderTargetsF32(int count, int w, int h) {\n SomeTexture... | import yk.senjin.FrameBuffer;
import yk.senjin.SomeTexture;
import yk.senjin.examples.simple.stuff.Ikogl_8_Fs;
import yk.senjin.examples.simple.stuff.Ikogl_8_Vd;
import yk.senjin.examples.simple.stuff.Ikogl_8_Vs;
import yk.senjin.shaders.gshader.GProgram;
import yk.senjin.vbo.AVboShortIndices;
import yk.senjin.vbo.AVbo... | package yk.senjin.examples.simple;
/**
* Created by Yuri Kravchik on 25.11.17.
*/
public class IKnowOpenGL_9_FrameBuffer2 extends SimpleLwjglRoutine {
public static void main(String[] args) {
new IKnowOpenGL_9_FrameBuffer2().main();
}
public Ikogl_8_Vs vs;
public Ikogl_8_Fs fs;
public ... | SomeTexture texture; | 1 |
Kaysoro/KaellyBot | src/main/java/commands/classic/DonateCommand.java | [
"public abstract class AbstractCommand implements Command {\n\n private final static Logger LOG = LoggerFactory.getLogger(AbstractCommand.class);\n\n protected String name;\n protected String pattern;\n protected DiscordException badUse;\n private boolean isPublic;\n private boolean isUsableInMP;\... | import commands.model.AbstractCommand;
import data.Constants;
import discord4j.core.event.domain.message.MessageCreateEvent;
import discord4j.core.object.entity.ApplicationInfo;
import discord4j.core.object.entity.Message;
import discord4j.core.object.entity.User;
import discord4j.rest.util.Image;
import enums.Donator;... | package commands.classic;
/**
* Created by Kaysoro on 20/05/2019.
*/
public class DonateCommand extends AbstractCommand {
public DonateCommand() {
super("donate", "");
}
@Override
public void request(MessageCreateEvent event, Message message, Matcher m, Language lg) {
Optional<Ap... | .setAuthor(author.map(User::getUsername).orElse(authorName), null, | 6 |
ceylon/ceylon-model | src/com/redhat/ceylon/model/loader/NamingBase.java | [
"public enum OutputElement {\n TYPE,\n FIELD,\n METHOD,\n GETTER,\n SETTER,\n PARAMETER,\n CONSTRUCTOR,\n LOCAL_VARIABLE,\n ANNOTATION_TYPE,\n PACKAGE;\n}",
"public class Class extends ClassOrInterface implements Functional {\n \n private static final int CONSTRUCTORS = 1<<11;\... | import com.redhat.ceylon.model.loader.model.FieldValue;
import com.redhat.ceylon.model.loader.model.JavaBeanValue;
import com.redhat.ceylon.model.loader.model.OutputElement;
import com.redhat.ceylon.model.typechecker.model.Class;
import com.redhat.ceylon.model.typechecker.model.Declaration;
import com.redhat.ceylon.mod... | package com.redhat.ceylon.model.loader;
public class NamingBase {
public static final String OLD_MODULE_DESCRIPTOR_CLASS_NAME = "module_";
public static final String MODULE_DESCRIPTOR_CLASS_NAME = "$module_";
public static final String PACKAGE_DESCRIPTOR_CLASS_NAME = "$package_";
/**
* A synthe... | public static String getDisambigAnnoCtorName(Interface iface, OutputElement target) { | 0 |
EManual/EManual-Android | app/src/main/java/io/github/emanual/app/ui/fragment/ResourceCenterFragment.java | [
"public class EmanualAPI {\n /**\n * 下载对应的语言\n *\n * @param lang\n * @param responseHandler\n */\n @SuppressLint(\"DefaultLocale\") public static void downloadLang(String lang, AsyncHttpResponseHandler responseHandler) {\n RestClient.get(String.format(\"/md-%s/dist/%s.zip\", lang.to... | import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import andro... | package io.github.emanual.app.ui.fragment;
public class ResourceCenterFragment extends BaseFragment {
@Bind({R.id.btn_java, R.id.btn_android, R.id.btn_php, R.id.btn_python, R.id.btn_javascript, R.id.btn_c, R.id.btn_angular, R.id.btn_scala, R.id.btn_http2}) List<View> names;
public String ROOT_PATH;
pu... | FileTreeEntity remote = FileTreeEntity.create(new String(responseBody)); | 1 |
smartmarmot/DBforBIX | src/com/smartmarmot/dbforbix/scheduler/Scheduler.java | [
"public class DBforBix implements Daemon {\r\n\t\r\n\tprivate static final Logger\t\t\t\tLOG\t\t\t\t= Logger.getLogger(DBforBix.class);\r\n\t\r\n\tprivate static ZabbixSender\t\t\t\t_zabbixSender;\r\n\tprivate static PersistentDBSender\tpersSender; \r\n\t//private static boolean debug = false;\r\n\t\r\n\t... | import com.smartmarmot.dbforbix.db.adapter.DBAdapter.DBNotDefinedException;
import com.smartmarmot.dbforbix.zabbix.ZabbixItem;
import com.smartmarmot.dbforbix.zabbix.ZabbixSender;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.SQLTimeoutException;
import java.util.HashSet;
import java.... | /*
* This file is part of DBforBix.
*
* DBforBix 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.
*
* DBforBix is distr... | ZabbixSender zabbixSender = DBforBix.getZabbixSender();
| 7 |
mathisdt/trackworktime | app/src/main/java/org/zephyrsoft/trackworktime/timer/TimeCalculatorV2.java | [
"public class DAO {\n\n\t// TODO use prepared statements as described here: http://stackoverflow.com/questions/7255574\n\n\tprivate volatile SQLiteDatabase db;\n\tprivate final MySQLiteHelper dbHelper;\n\tprivate final Context context;\n\tprivate final WorkTimeTrackerBackupManager backupManager;\n\tprivate final Ba... | import org.apache.commons.lang3.NotImplementedException;
import org.pmw.tinylog.Logger;
import org.threeten.bp.DayOfWeek;
import org.threeten.bp.LocalDate;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.LocalTime;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp... | }
private void setStartDate(LocalDate startDate) {
this.startDate = startDate;
this.currentDate = startDate.minusDays(1);
// get last event before start
this.lastEventBeforeDay =
dao.getLastEventBefore(this.startDate.atStartOfDay(zoneId).toOffsetDateTime());
// get next flexi reset
if (flexiReset !... | private long calculateTargetTime(Target specialTarget, TargetEnum targetEnum) { | 5 |
xiaoshanlin000/SLTableView | app/src/main/java/com/shanlin/sltableview/fragment/base/DemoBaseFragment.java | [
"public class SLIndexPath {\n private int row;\n private int section;\n\n public SLIndexPath() {\n }\n\n public SLIndexPath(int section,int row) {\n if (row < 0) row = 0;\n if (section < 0) section = 0;\n this.row = row;\n this.section = section;\n }\n\n public int g... | import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.shanlin.library.sltableview.SLIndexPath;
import com.shanlin.library.sltableview.SLTableView;
import com.shanlin.library.sltableview.SLTableViewCell;
import com.shanlin.library.sltableview.SLT... | package com.shanlin.sltableview.fragment.base;
/**
* Created by Shanlin on 2016/12/30.
*/
public abstract class DemoBaseFragment extends BaseFragment implements SLTableViewDataSource,SLTableViewDelegate,SLTableViewCell.SLCellViewClickListener{
protected ArrayList<List<String>> dataLists = new ArrayList<>()... | public int typeOfIndexPath(SLTableView tableView, SLIndexPath indexPath) { | 0 |
gems-uff/prov-viewer | src/main/java/br/uff/ic/utility/GraphUtils.java | [
"public class VariableNames {\n public static String CollapsedVertexAgentAttribute = \"Agents\";\n public static String CollapsedVertexActivityAttribute = \"Activities\";\n public static String CollapsedVertexEntityAttribute = \"Entities\";\n public static String GraphFile = \"GraphFile\";\n public s... | import br.uff.ic.utility.graph.GraphVertex;
import br.uff.ic.utility.graph.Vertex;
import edu.uci.ics.jung.graph.DirectedGraph;
import edu.uci.ics.jung.graph.Graph;
import edu.uci.ics.jung.graph.util.Pair;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import br... | /*
* The MIT License
*
* Copyright 2017 Kohwalter.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modif... | public static double getSlope(Object node, ColorScheme colorScheme) { | 1 |
awslabs/amazon-sqs-java-messaging-lib | src/test/java/com/amazon/sqs/javamessaging/SQSMessageConsumerPrefetchTest.java | [
"public static class MessageManager {\n\n private final PrefetchManager prefetchManager;\n\n private final javax.jms.Message message;\n\n public MessageManager(PrefetchManager prefetchManager, javax.jms.Message message) {\n this.prefetchManager = prefetchManager;\n this.message = message;\n ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito... | e.printStackTrace();
}
}
});
// Yield execution to allow the consumer to wait
assertEquals(true, beforeWaitForPrefetchCall.await(10, TimeUnit.SECONDS));
Thread.sleep(10);
// Validate we do not wait when the consumer is closed
... | assertTrue(jsmMessage instanceof SQSBytesMessage); | 3 |
jillesvangurp/jsonj | src/main/java/com/github/jsonj/JsonSet.java | [
"public class JsonBuilder {\n private final @Nonnull JsonObject object;\n\n private JsonBuilder() {\n // use the static methods\n this(new JsonObject());\n }\n\n private JsonBuilder(@Nonnull JsonObject object) {\n this.object = object;\n }\n\n /**\n * @return constructed J... | import static com.github.jsonj.tools.JsonBuilder.nullValue;
import static com.github.jsonj.tools.JsonBuilder.primitive;
import com.github.jsonj.tools.JsonBuilder;
import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import static com.github.jsonj.tools.JsonBuild... | /**
* Copyright (c) 2011, Jilles van Gurp
*
* 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, p... | JsonPrimitive primitive = primitive(s); | 4 |
open-io/oio-api-java | src/main/java/io/openio/sds/ClientBuilder.java | [
"public static OioHttp http(OioHttpSettings settings, SocketProvider socketProvider) {\n Check.checkArgument(null != settings);\n Check.checkArgument(null != socketProvider);\n return new OioHttp(settings, socketProvider);\n}",
"public interface SocketProvider {\n\n public Socket getSocket(String host... | import static io.openio.sds.http.OioHttp.http;
import java.io.FileNotFoundException;
import java.net.InetSocketAddress;
import java.net.URI;
import io.openio.sds.common.SocketProvider;
import io.openio.sds.common.SocketProviders;
import io.openio.sds.http.OioHttp;
import io.openio.sds.http.OioHttpSettings;
import io.op... | package io.openio.sds;
/**
* Builder for @link {@link Client} implementations
*
* @author Christopher Dedeurwaerder
* @author Florent Vennetier
*/
public class ClientBuilder {
/**
* Create a new {@link AdvancedClient} using the specified settings.
*
* @param settings
* the settings to us... | private static SocketProvider proxySocketProvider(String url, | 1 |
LMAX-Exchange/disruptor-proxy | src/test/java/com/lmax/tool/disruptor/handlers/HandlersTest.java | [
"public final class BatchAwareListenerImpl implements Listener, BatchListener\n{\n private volatile int batchCount = 0;\n\n @Override\n public void onString(final String value)\n {\n }\n\n @Override\n public void onFloatAndInt(final Float floatValue, final int intValue)\n {\n }\n\n @Ov... | import com.lmax.disruptor.EventHandler;
import com.lmax.tool.disruptor.BatchAwareListenerImpl;
import com.lmax.tool.disruptor.Invoker;
import com.lmax.tool.disruptor.ListenerImpl;
import com.lmax.tool.disruptor.ProxyMethodInvocation;
import com.lmax.tool.disruptor.Resetable;
import org.junit.Test;
import static com.lma... | /*
* Copyright 2015-2016 LMAX Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | private static final class StubResetable implements Resetable | 4 |
dragonite-network/dragonite-java | dragonite-proxy/src/main/java/com/vecsight/dragonite/proxy/config/ProxyClientConfig.java | [
"public class ParsedACL {\n\n private final String title;\n\n private final String author;\n\n private final ACLItemMethod defaultMethod;\n\n private final List<ACLItem> items;\n\n private final ConcurrentHashMap<String, ACLItemMethod> domainCacheMap = new ConcurrentHashMap<>();\n\n private final ... | import com.vecsight.dragonite.proxy.acl.ParsedACL;
import com.vecsight.dragonite.proxy.misc.ProxyGlobalConstants;
import com.vecsight.dragonite.sdk.config.DragoniteSocketParameters;
import com.vecsight.dragonite.sdk.cryptor.AESCryptor;
import com.vecsight.dragonite.sdk.exception.EncryptionException;
import java.net.Ine... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.proxy.config;
public class ProxyClientConfig {
private InetSocketAddress remoteAddress;
private int socks5port;
private String password;... | private final DragoniteSocketParameters dragoniteSocketParameters = new DragoniteSocketParameters(); | 2 |
MazeSolver/MazeSolver | src/es/ull/mazesolver/agent/AStarAgent.java | [
"public class Path {\n private Stack <Point> m_path;\n private double m_cost;\n\n private Path () {\n }\n\n /**\n * Crea una nueva trayectoria.\n *\n * @param initial\n * Punto inicial de la trayectoria.\n */\n public Path (Point initial) {\n m_path = new Stack <Point>();\n m_path.pus... | import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.PriorityQueue;
import es.ull.mazesolver.agent.util.Path;
import es.ull.mazesolver.gui.configuration.AgentConfigurationPanel;
import es.ull.mazesolver.gui.configuration.HeuristicAgentConfigurationPanel;
import es.ull.ma... | /*
* This file is part of MazeSolver.
*
* 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 dist... | private transient ArrayList <Direction> m_directions; | 4 |
Raxa/RaxaMachineLearning | src/com/learningmodule/association/conceptdrug/predictionmodule/PredictionMethod.java | [
"public interface ConceptDrugDatabaseInterface {\n\n\t/*\n\t * get name of file that will contain the prediction matrix generated by\n\t * algorithm\n\t */\n\tpublic String getMatrixFileName();\n\n\t/*\n\t * Method to get all the medical records containing encounterId(integer that\n\t * represent an id for prescrip... | import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import org.apache.log4j.Logger;
import com.learningmodule.association.conceptdrug.ConceptDrugDatabaseInterface;
import com.learningmodule.association.conceptdrug.PredictionResult;
import com.learningmodule.association.conceptdrug.mo... | package com.learningmodule.association.conceptdrug.predictionmodule;
/*
* Class that predicts the drugs for given query
*/
public class PredictionMethod {
private PredictionMatrix matrix;
private ConceptDrugDatabaseInterface learningInterface;
private LevenshteinSearch dictonary;
private Logger log = Logger... | LinkedList<ConceptDrugPredictionResult> results = new LinkedList<ConceptDrugPredictionResult>(); | 4 |
lukasniemeier/mensaapp | MensaApp/src/main/java/de/lukasniemeier/mensa/parser/TodaysMenuParser.java | [
"public class Mensa implements Serializable {\n\n private static List<Mensa> database = null;\n\n public static Mensa getMensa(final String shortName) {\n return Iterables.find(getMensas(), new Predicate<Mensa>() {\n @Override\n public boolean apply(Mensa mensa) {\n ... | import android.content.Context;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Patt... | package de.lukasniemeier.mensa.parser;
/**
* Created on 17.09.13.
*/
public class TodaysMenuParser extends WeeklyMenuParser {
private static final String priceGroup = "Studierende";
private final Map<String, Collection<String>> alternativeNameMap;
| public TodaysMenuParser(Context context, Document page, Mensa mensa) { | 0 |
drbild/c2dm4j | src/main/java/org/whispercomm/c2dm4j/impl/DefaultC2dmManager.java | [
"public interface C2dmManager {\n\n\t/**\n\t * Sends a message to the C2DM service to be delivered to the client\n\t * specified in the message header.\n\t * \n\t * @param msg\n\t * the message to deliver\n\t * @return the response from the C2DM service\n\t * @throws UnexpectedResponseException\n\t * ... | import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.http.client.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.whispercomm.c2dm4j.C2dmManager;
import org.whispercomm.c2dm4j.Message;
import org.whispercomm.c2dm4j.Response;
import org.whi... | /*
* Copyright 2012 The Regents of the University of Michigan
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required b... | public Response pushMessage(Message msg) throws IOException, | 1 |
SumoLogic/sumologic-jenkins-plugin | src/main/java/com/sumologic/jenkins/jenkinssumologicplugin/PluginDescriptorImpl.java | [
"public enum EventSourceEnum {\n\n PERIODIC_UPDATE(\"Periodic_Update\"),\n COMPUTER_ONLINE(\"Computer_Online\"),\n COMPUTER_OFFLINE(\"Computer_Offline\"),\n COMPUTER_TEMP_ONLINE(\"Computer_Temp_Online\"),\n COMPUTER_TEMP_OFFLINE(\"Computer_Temp_Offline\"),\n COMPUTER_PRE_ONLINE(\"Computer_Pre_Onli... | import com.google.gson.Gson;
import com.sumologic.jenkins.jenkinssumologicplugin.constants.EventSourceEnum;
import com.sumologic.jenkins.jenkinssumologicplugin.constants.LogTypeEnum;
import com.sumologic.jenkins.jenkinssumologicplugin.metrics.SumoMetricDataPublisher;
import com.sumologic.jenkins.jenkinssumologicplugin.... | package com.sumologic.jenkins.jenkinssumologicplugin;
/**
* Sumo Logic plugin for Jenkins model.
* Provides options to parametrize plugin.
* <p>
* Created by deven on 7/8/15.
* Contributors: lukasz, Sourabh Jain
*/
@Extension
public final class PluginDescriptorImpl extends BuildStepDescriptor<Publisher> {
... | private transient SumoMetricDataPublisher sumoMetricDataPublisher; | 2 |
jonghough/ArtisteX | app/src/test/java/jgh/artistex/layers/PolygonTest.java | [
"public class DrawingEngine {\n\n /**\n * the instance of the Drawing Engine\n */\n private static DrawingEngine sEngine;\n\n /**\n * List of the <code>ILayer</code> layers in order to be\n * drawn to the canvas. It's not a stack, because insert and removal\n * of arbitrary elements is ... | import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.PointF;
import android.os.SystemClock;
import android.view.MotionEvent;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectr... | package jgh.artistex.layers;
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21, manifest = "src/main/AndroidManifest.xml")
public class PolygonTest {
@Test
public void polygonTest1() {
DrawingEngine.Instance().killEngine();
Bitmap r = BitmapFactory.dec... | BasePen p = new Polygon(PolygonFactory.createPolygon(10, 100,100,100)); | 2 |
TrumanDu/AutoProgramming | src/main/java/com/aibibang/web/system/service/impl/SysUserServiceImpl.java | [
"public class Page<T> extends RowBounds {\r\n\r\n\tprivate int pageNo = 1;\t\t\t\t// 当前页数\r\n\tprivate int pageSize = 10;\t\t\t// 每页显示行数\r\n\tprivate int totalCount;\t\t\t\t// 总行数\r\n\tprivate int totalPages;\t\t\t\t// 总页数\r\n\t\r\n\tprivate List<T> result = new ArrayList<T>();// 查询结果\r\n\t\r\n\tprivate int offset;... | import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import com.aibibang.common.persistence.Page;
import com.aibibang.web.system.dao.SysRoleMenuDao;
import com.aibibang.web.system.dao.SysUse... | package com.aibibang.web.system.service.impl;
@Service("SysUserService")
public class SysUserServiceImpl implements SysUserService {
@Resource
private SysUserDao sysUserDao;
@Resource
private SysUserRoleDao sysUserRoleDao;
@Resource
private SysRoleMenuDao sysRoleMenuDao;
@Override
publi... | List<SysUserRole> userRoleList = new ArrayList<SysUserRole>();
| 5 |
tassioauad/GameCheck | app/src/main/java/com/tassioauad/gamecheck/view/activity/SearchGameActivity.java | [
"public class GameCatalogApplication extends Application {\n\n private ObjectGraph objectGraph;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n objectGraph = ObjectGraph.create(\n new Object[]{\n new AppModule(GameCatalogApplication.this)... | import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.su... | package com.tassioauad.gamecheck.view.activity;
public class SearchGameActivity extends AppCompatActivity implements SearchGameView {
@Inject
SearchGamePresenter presenter;
private final int numberOfColumns = 2; | private List<Game> gameList; | 2 |
ongres/scram | common/src/test/java/com/ongres/scram/common/message/ServerFinalMessageTest.java | [
"public enum ScramAttributes implements CharAttribute {\n /**\n * This attribute specifies the name of the user whose password is used for authentication\n * (a.k.a. \"authentication identity\" [<a href=\"https://tools.ietf.org/html/rfc4422\">RFC4422</a>]).\n * If the \"a\" attribute is not specified... | import org.junit.Test;
import static com.ongres.scram.common.RfcExampleSha1.*;
import static junit.framework.TestCase.assertFalse;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import com.ongres.scram.common.ScramAttributes;
import com.ongres.scram.common.ScramFunctions;
import... | /*
* Copyright 2017, OnGres.
*
* 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 must retain the above copyright notice, this list of conditions and the following
* disclaimer.
... | public void validParseFrom() throws ScramParseException { | 4 |
jenkinsci/scm-sync-configuration-plugin | src/test/java/hudson/plugins/scm_sync_configuration/util/ScmSyncConfigurationBaseTest.java | [
"public class SCMManipulator {\n\n private static final Logger LOGGER = Logger.getLogger(SCMManipulator.class.getName());\n\n private final ScmManager scmManager;\n private ScmRepository scmRepository = null;\n private String scmSpecificFilename = null;\n\n public SCMManipulator(ScmManager _scmManage... | import hudson.Plugin;
import hudson.PluginWrapper;
import hudson.model.Hudson;
import hudson.model.User;
import hudson.plugins.scm_sync_configuration.SCMManagerFactory;
import hudson.plugins.scm_sync_configuration.SCMManipulator;
import hudson.plugins.scm_sync_configuration.ScmSyncConfigurationBusiness;
import hudson.p... | package hudson.plugins.scm_sync_configuration.util;
@RunWith(PowerMockRunner.class)
@PowerMockIgnore({ "org.tmatesoft.svn.*" })
@PrepareForTest({Hudson.class, Jenkins.class, SCM.class, ScmSyncSubversionSCM.class, PluginWrapper.class})
public abstract class ScmSyncConfigurationBaseTest {
@Rule protected TestN... | protected ScmSyncConfigurationBusiness sscBusiness = null; | 1 |
arnaudroger/mapping-benchmark | jooq/src/main/java/org/simpleflatmapper/jooq/JooqMapperBenchmark.java | [
"public class MappedObject4 {\r\n\tpublic static final String SELECT_WITH_LIMIT = \"SELECT * FROM TEST_SMALL_BENCHMARK_OBJECT LIMIT ?\";\r\n\r\n\tprivate long id;\r\n\r\n\tprivate int yearStarted;\r\n\tprivate String name;\r\n\tprivate String email;\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\tpublic vo... | import org.jooq.*;
import org.jooq.impl.DSL;
import org.jooq.impl.DefaultConfiguration;
import org.openjdk.jmh.annotations.*;
import org.openjdk.jmh.annotations.Param;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.infra.Blackhole;
import org.simpleflatmapper.jdbc.JdbcMapper;
import org.simpleflatmapp... | package org.simpleflatmapper.jooq;
@State(Scope.Benchmark)
public class JooqMapperBenchmark {
@Param(value = "H2")
private DbTarget db;
private DSLContext dsl;
private SelectWhereStep<TestSmallBenchmarkObjectRecord> select4; | private SelectWhereStep<TestBenchmarkObject_16Record> select16; | 3 |
ykaragol/checkersmaster | CheckersMaster/test/checkers/algorithm/TestAlphaBetaAlgorithm.java | [
"public class CalculationContext{\r\n\r\n\tprivate int depth;\r\n\tprivate Player player;\r\n\tprivate IEvaluation evaluationFunction;\r\n\tprivate ISuccessor successorFunction;\r\n\tprivate IAlgorithm algorithm;\r\n\r\n\r\n\tpublic void setDepth(int depth) {\r\n\t\tthis.depth = depth;\r\n\t}\r\n\r\n\tpublic int ge... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import org.junit.Before;
import org.junit.Test;
import checkers.domain.CalculationContext;
import checkers.domain.Model;
import checkers.doma... | package checkers.algorithm;
public class TestAlphaBetaAlgorithm {
private AlphaBetaAlgorithm algorithm;
| private CalculationContext context;
| 0 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/effects/Transitions.java | [
"public static Transform getInstance(Element e) {\n return getInstance(e, null);\n}",
"public static boolean isTransform(String propName) {\n return transformRegex.test(propName);\n}",
"public static final String transform = vendorProperty(\"transform\");",
"public class GQuery implements Lazy<GQuery, LazyG... | import static com.google.gwt.query.client.plugins.effects.Transform.transform;
import com.google.gwt.dom.client.Element;
import com.google.gwt.query.client.Function;
import com.google.gwt.query.client.GQuery;
import com.google.gwt.query.client.Properties;
import com.google.gwt.query.client.js.JsUtils;
import com.google... | /*
* Copyright 2014, The gwtquery team.
*
* 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... | String c = JsUtils.camelize(s); | 5 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/main/provider/DeadlineProvider.java | [
"public abstract class BaseProvider extends AsyncTask<String, Integer, List<Elements>> {\n\n protected Map<String, String> cookies = new HashMap<>();\n\n public BaseProvider() {\n super();\n }\n\n @Override\n @Deprecated\n protected List<Elements> doInBackground(String... params) {\n ... | import com.mgilangjanuar.dev.goscele.base.BaseProvider;
import com.mgilangjanuar.dev.goscele.modules.common.model.CookieModel;
import com.mgilangjanuar.dev.goscele.modules.main.adapter.ScheduleDeadlineRecyclerViewAdapter;
import com.mgilangjanuar.dev.goscele.modules.main.listener.ScheduleDeadlineDetailListener;
import ... | package com.mgilangjanuar.dev.goscele.modules.main.provider;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class DeadlineProvider {
public static class MonthView extends BaseProvider {
private long time;
private ScheduleDeadlineListener listener;
... | List<ScheduleDeadlineModel> result = new ArrayList<>(); | 7 |
ldbc-dev/ldbc_snb_datagen_deprecated2015 | src/main/java/ldbc/socialnet/dbgen/generator/UniformPostGenerator.java | [
"public class DateGenerator {\n\tpublic static long ONE_DAY = 24L * 60L * 60L * 1000L;\n\tpublic static long SEVEN_DAYS = 7L * ONE_DAY;\n\tpublic static long THIRTY_DAYS = 30L * ONE_DAY;\n\tpublic static long ONE_YEAR = 365L * ONE_DAY;\n\tpublic static long TWO_YEARS = 2L * ONE_YEAR;\n\tpublic static... | import java.util.TreeSet;
import java.util.Iterator;
import java.util.Random;
import ldbc.socialnet.dbgen.generator.DateGenerator;
import ldbc.socialnet.dbgen.dictionary.TagTextDictionary;
import ldbc.socialnet.dbgen.dictionary.UserAgentDictionary;
import ldbc.socialnet.dbgen.dictionary.IPAddressDictionary;
impo... | /*
* Copyright (c) 2013 LDBC
* Linked Data Benchmark Council (http://ldbc.eu)
*
* This file is part of ldbc_socialnet_dbgen.
*
* ldbc_socialnet_dbgen is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundat... | protected PostInfo generatePostInfo( Random randomTag, Random randomDate, Group group, GroupMemberShip membership ) {
| 6 |
Lzw2016/fastdfs-java-client | src/main/java/org/cleverframe/fastdfs/protocol/storage/request/DeleteFileRequest.java | [
"public final class CmdConstants {\n /**\n * 客户端关闭连接命令\n */\n public static final byte FDFS_PROTO_CMD_QUIT = 82;\n /**\n * 连接状态检查命令\n */\n public static final byte FDFS_PROTO_CMD_ACTIVE_TEST = 111;\n /**\n * 服务端正确返回报文状态\n */\n public static final byte FDFS_PROTO_CMD_RESP = ... | import org.cleverframe.fastdfs.constant.CmdConstants;
import org.cleverframe.fastdfs.constant.OtherConstants;
import org.cleverframe.fastdfs.protocol.BaseRequest;
import org.cleverframe.fastdfs.protocol.ProtocolHead;
import org.cleverframe.fastdfs.mapper.DynamicFieldType;
import org.cleverframe.fastdfs.mapper.FastDFSCo... | package org.cleverframe.fastdfs.protocol.storage.request;
/**
* 作者:LiZW <br/>
* 创建时间:2016/11/20 17:05 <br/>
*/
public class DeleteFileRequest extends BaseRequest {
/**
* 组名
*/
@FastDFSColumn(index = 0, max = OtherConstants.FDFS_GROUP_NAME_MAX_LEN)
private String groupName;
/**
* 路径名... | @FastDFSColumn(index = 1, dynamicField = DynamicFieldType.allRestByte) | 4 |
jbehave/jbehave-web | archetypes/web-selenium-java-spring-archetype/src/main/resources/archetype-resources/src/main/java/etsy/EtsyDotComStories.java | [
"public class LocalFrameContextView implements ContextView {\n\n private JFrame frame;\n private JLabel label;\n private int width;\n private int height;\n private int x;\n private int y;\n\n /**\n * Creates view frame of default size - (380 x 85)\n */\n public LocalFrameContextView(... | import java.util.List;
import org.jbehave.core.configuration.Configuration;
import org.jbehave.core.embedder.StoryControls;
import org.jbehave.core.failures.FailingUponPendingStep;
import org.jbehave.core.io.LoadFromClasspath;
import org.jbehave.core.io.StoryFinder;
import org.jbehave.core.junit.JUnitStories;
import or... | #set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.etsy;
public class EtsyDotComStories extends JUnitStories {
CrossReference crossReference = new CrossReference().withJsonOnly().withOutputAfterEachStory(true)
.excludingStoriesWithNoExecuted... | Format[] formats = new Format[] { new SeleniumContextOutput(seleniumContext), CONSOLE, WEB_DRIVER_HTML }; | 3 |
strooooke/quickfit | app/src/main/java/com/lambdasoup/quickfit/ui/SchedulesRecyclerViewAdapter.java | [
"public enum DayOfWeek implements Parcelable {\n MONDAY(Calendar.MONDAY, R.string.monday),\n TUESDAY(Calendar.TUESDAY, R.string.tuesday),\n WEDNESDAY(Calendar.WEDNESDAY, R.string.wednesday),\n THURSDAY(Calendar.THURSDAY, R.string.thursday),\n FRIDAY(Calendar.FRIDAY, R.string.friday),\n SATURDAY(Ca... | import java.util.List;
import android.database.Cursor;
import androidx.recyclerview.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.lambdasoup.quickfit.databinding.ScheduleListContentBinding;
import com.lambdasoup.quickfit.model.DayOfWeek;
imp... | /*
* Copyright 2016 Juliane Lehmann <jl@lambdasoup.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | public class ViewHolder extends LeaveBehind.LeaveBehindViewHolder { | 2 |
karlnicholas/votesmart | src/test/java/org/votesmart/testapi/TestVoteSmartBase.java | [
"public class ArgMap extends TreeMap<String, String> {\r\n\tprivate static final long serialVersionUID = -2664255408377082118L;\r\n\t\r\n\tpublic ArgMap(String... args ) {\r\n\t\tfor ( int i=0; i<args.length; i+=2) {\r\n\t\t\tthis.put(args[i], args[i+1]);\r\n\t\t}\r\n\t}\r\n}\r",
"public interface VoteSmartAPI {\... | import static org.junit.Assert.*;
import java.util.ResourceBundle;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.votesmart.api.ArgMap;
import org.votesmart.api.VoteSmartAPI;
import org.votesmart.api.VoteSmartErrorException;
import org.votesmart.api.VoteSmartException;
import org.votesmar... | package org.votesmart.testapi;
/**
* Base class for all Test classes.
*
*/
public class TestVoteSmartBase implements VoteSmartAPI {
protected static TestVoteSmart api;
| private static GeneralInfoBase generalInfoBase;
| 4 |
googlearchive/androidtv-Leanback | app/src/androidTest/java/com/example/android/tvleanback/VideoDbIntegrationTest.java | [
"public class FetchVideoService extends IntentService {\n private static final String TAG = \"FetchVideoService\";\n\n /**\n * Creates an IntentService with a default name for the worker thread.\n */\n public FetchVideoService() {\n super(TAG);\n }\n\n @Override\n protected void onH... | import static com.google.common.truth.Truth.assertThat;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import com.example.android.tvleanback.data.FetchVideoService;
import com.example.android.tvleanback.data.VideoContract;
import com.... | package com.example.android.tvleanback;
@RunWith(AndroidJUnit4.class)
public class VideoDbIntegrationTest {
private Context mContext;
@Before
public void setup() {
mContext = ApplicationProvider.getApplicationContext();
}
@Test
public void resetAndRedownloadDatabase() throws In... | video1.put(VideoDbBuilder.TAG_TITLE, "New Dad") | 3 |
mkopylec/errorest-spring-boot-starter | src/main/java/com/github/mkopylec/errorest/handling/errordata/security/ErrorestAuthenticationEntryPoint.java | [
"public class ErrorData {\n\n public static final int ERRORS_ID_LENGTH = 10;\n\n protected final String id;\n protected final LoggingLevel loggingLevel;\n protected final String requestMethod;\n protected final String requestUri;\n protected final HttpStatus responseStatus;\n protected final Li... | import com.github.mkopylec.errorest.handling.errordata.ErrorData;
import com.github.mkopylec.errorest.handling.errordata.ErrorDataProvider;
import com.github.mkopylec.errorest.handling.errordata.ErrorDataProviderContext;
import com.github.mkopylec.errorest.response.Errors;
import com.github.mkopylec.errorest.response.E... | package com.github.mkopylec.errorest.handling.errordata.security;
public class ErrorestAuthenticationEntryPoint implements AuthenticationEntryPoint {
protected final ErrorDataProviderContext providerContext;
protected final ErrorsFactory errorsFactory;
protected final ErrorsHttpResponseSetter responseBo... | Errors errors = errorsFactory.logAndCreateErrors(errorData); | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.