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 |
|---|---|---|---|---|---|---|
hsyyid/EssentialCmds | src/main/java/io/github/hsyyid/essentialcmds/listeners/TPAListener.java | [
"@Updatifier(repoName = \"EssentialCmds\", repoOwner = \"hsyyid\", version = \"v\" + PluginInfo.VERSION)\n@Plugin(id = PluginInfo.ID, name = PluginInfo.NAME, version = PluginInfo.INFORMATIVE_VERSION, description = PluginInfo.DESCRIPTION, dependencies = @Dependency(id = \"Updatifier\", version = \"1.0\", optional = ... | import io.github.hsyyid.essentialcmds.EssentialCmds;
import io.github.hsyyid.essentialcmds.events.TPAAcceptEvent;
import io.github.hsyyid.essentialcmds.events.TPAEvent;
import io.github.hsyyid.essentialcmds.events.TPAHereAcceptEvent;
import io.github.hsyyid.essentialcmds.events.TPAHereEvent;
import io.github.hsyyid.ess... | /*
* This file is part of EssentialCmds, licensed under the MIT License (MIT).
*
* Copyright (c) 2015 - 2015 HassanS6000
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
*... | public void tpaHereEventHandler(TPAHereEvent event) | 2 |
ihongs/HongsCORE | hongs-core/src/main/java/io/github/ihongs/db/util/AssocCase.java | [
"public final class Cnst {\n\n //** 默认取值 **/\n\n public static final String LANG_DEF = \"zh_CN\"; // 默认语言\n\n public static final String ZONE_DEF = \"GMT+8\"; // 默认时区\n\n public static final int RN_DEF = 20 ; // 默认每页行数\n\n //** 查询参数 **/\n\n public static final String ID_KEY = \"id\"; // 编号\n... | import io.github.ihongs.Cnst;
import io.github.ihongs.HongsException;
import io.github.ihongs.HongsExemption;
import io.github.ihongs.db.Model;
import io.github.ihongs.db.Table;
import io.github.ihongs.dh.IFigure;
import io.github.ihongs.dh.JFigure;
import io.github.ihongs.util.Dict;
import io.github.ihongs.util.Syno;
... | * 存储需使用列举原始设置
*/
if (on == null) {
on = "" ;
}
if (af == null) {
switch (on) {
case LISTABLE:
case SRCHABLE:
af = new HashMap(0);
break;
case SAVEABLE:
case UNSTORED:
... | public AssocCase allow(Model model) { | 1 |
kpavlov/fixio | core/src/main/java/fixio/netty/pipeline/client/ClientSessionHandler.java | [
"public interface FixMessage {\n\n String FIX_4_0 = \"FIX.4.0\";\n String FIX_4_1 = \"FIX.4.1\";\n String FIX_4_2 = \"FIX.4.2\";\n String FIX_4_3 = \"FIX.4.3\";\n String FIX_4_4 = \"FIX.4.4\";\n String FIX_5_0 = \"FIXT.1.1\";\n\n FixMessageHeader getHeader();\n\n List<FixMessageFragment> get... | import org.slf4j.LoggerFactory;
import java.net.PasswordAuthentication;
import java.util.List;
import fixio.events.LogonEvent;
import fixio.fixprotocol.FieldType;
import fixio.fixprotocol.FixMessage;
import fixio.fixprotocol.FixMessageBuilder;
import fixio.fixprotocol.FixMessageBuilderImpl;
import fixio.fixprotocol.Fix... | /*
* Copyright 2014 The FIX.io Project
*
* The FIX.io Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unles... | super(fixApplication, FixClock.systemUTC(), new InMemorySessionRepository()); | 7 |
bencvt/LibShapeDraw | projects/main/src/test/java/libshapedraw/SetupTestEnvironment.java | [
"public class LSDController {\n private static LSDController instance;\n private final Logger log;\n private final LinkedHashSet<LibShapeDraw> apiInstances;\n private int topApiInstanceId;\n private MinecraftAccess minecraftAccess;\n private LSDUpdateCheck updateCheck;\n private boolean initial... | import java.io.File;
import java.lang.reflect.Field;
import libshapedraw.internal.LSDController;
import libshapedraw.internal.LSDGlobalSettings;
import libshapedraw.internal.LSDInternalException;
import libshapedraw.internal.LSDInternalReflectionException;
import libshapedraw.internal.LSDModDirectory;
import libshapedr... | package libshapedraw;
/**
* To ensure that JUnit testing does not touch the production Minecraft
* installation, every test case should extend SetupTestEnvironment.TestCase.
* <p>
* Involves some ClassLoader and Reflection hackery.
* <p>
* If you're running one of these test case classes individually in Eclip... | throw new LSDInternalException("LWJGL link error, " + | 2 |
jmhertlein/MCTowns | src/main/java/cafe/josh/mctowns/listeners/QuickSelectToolListener.java | [
"public class TownManager {\n private final HashMap<String, Town> towns;\n private final HashMap<String, MCTownsRegion> regions;\n\n /**\n * Constructs a new, empty town manager.\n */\n public TownManager() {\n towns = new HashMap<>();\n regions = new HashMap<>();\n }\n\n /**... | import cafe.josh.mctowns.TownManager;
import cafe.josh.mctowns.command.ActiveSet;
import cafe.josh.mctowns.region.Plot;
import cafe.josh.mctowns.region.Territory;
import cafe.josh.mctowns.region.Town;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.ApplicableRegionSet;
import... | /*
* Copyright (C) 2013 Joshua Michael Hertlein <jmhertlein@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later ve... | Territory territ = null; | 3 |
manuelsc/Raven-Messenger | Raven App/src/main/java/at/flack/receiver/FacebookReceiver.java | [
"public class MainActivity extends AppCompatActivity {\n\tprivate DrawerLayout mDrawerLayout;\n\tprivate ListView mDrawerList;\n\tprivate ActionBarDrawerToggle mDrawerToggle;\n\n\tprivate CharSequence mTitle;\n\tprivate final String VERSION = \"16.01.30.1\";\n\n\tprivate static int current_fragment = -1;\n\tprivate... | import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;... | /*
Copyright 2015 Philipp Adam, Manuel Caspari, Nicolas Lukaschek
contact@ravenapp.org
This file is part of Raven.
Raven 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
... | Intent resultIntent = new Intent(context, MainActivity.class); | 0 |
taolei87/SRLParser | src/parser/decoding/HillClimbingDecoder.java | [
"public class DependencyArcList {\n\tpublic int n;\n\tpublic int[] st, edges;\n\tpublic int[] left, right;\t\t// span\n\tpublic int[] nonproj;\t\t\t// non-proj\n\t\n\tpublic DependencyArcList(int n, boolean useHO)\n\t{\n\t\tthis.n = n;\n\t\tst = new int[n];\n\t\tedges = new int[n];\n\t\tif (useHO) {\n\t\t\tleft = n... | import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.Executors;
import java.util.concurrent.ExecutorService;
import parser.DependencyArcList;
import parser.DependencyInstance;
import parser.GlobalFeatureData;
import parser.LocalFeatureData;
import parser.Options;
import parser.sampling.Ran... | package parser.decoding;
public class HillClimbingDecoder extends DependencyDecoder {
DependencyInstance pred, inst;
LocalFeatureData lfd;
GlobalFeatureData gfd;
boolean addLoss;
final int labelLossType;
//int[][] staticTypes;
double bestScore;
int unchangedRuns, totRuns;
volatile boolean stopped;
... | tasks[i].sampler = new RandomWalkSampler(i, options); | 5 |
deephacks/westty | westty-protobuf/src/test/java/org/deephacks/westty/protobuf/ProtobufEndpoint.java | [
"public static final class AsyncCreateRequest extends\n com.google.protobuf.GeneratedMessage\n implements AsyncCreateRequestOrBuilder {\n // Use AsyncCreateRequest.newBuilder() to construct.\n private AsyncCreateRequest(Builder builder) {\n super(builder);\n }\n private AsyncCreateRequest(boolean noIni... | import org.deephacks.westty.protobuf.CreateMessages.AsyncCreateRequest;
import org.deephacks.westty.protobuf.CreateMessages.CreateExceptionRequest;
import org.deephacks.westty.protobuf.CreateMessages.CreateRequest;
import org.deephacks.westty.protobuf.CreateMessages.CreateResponse;
import org.deephacks.westty.protobuf.... | /**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | public void asyncCreate(AsyncCreateRequest request) throws ProtobufException { | 0 |
HumBuch/HumBuch | src/main/java/de/dhbw/humbuch/view/DunningView.java | [
"public class MessageEvent {\r\n\r\n\tpublic final String caption;\r\n\tpublic final String message;\r\n\tpublic final Type type;\r\n\r\n\tpublic enum Type {\r\n\t\tINFO, TRAYINFO, WARNING, ERROR;\r\n\t}\r\n\r\n\t/**\r\n\t * Creates an event with the specified caption and {@link Type}.INFO as\r\n\t * standard type\... | import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Set;
import com.google.common.eventbus.EventBus;
import com.google.inject.Inject;
import com.va... | //Buttons
HorizontalLayout buttons = new HorizontalLayout();
buttons.setSpacing(true);
buttons.addComponent(btnDunningSent);
buttons.addComponent(btnShowDunning);
btnDunningSent.setEnabled(false);
btnShowDunning.setEnabled(false);
head.addComponent(buttons);
head.setComponentAlignment(buttons, A... | eventBus.post(new MessageEvent("Fehler", "PDF konnte nicht erstellt werden", Type.ERROR)); | 0 |
headwirecom/aemdc | src/main/java/com/headwire/aemdc/runner/ConfigPropsRunner.java | [
"public class CommandMenu {\r\n\r\n private static final Logger LOG = LoggerFactory.getLogger(CommandMenu.class);\r\n\r\n SortedMap<Integer, Command> menuItems = new TreeMap<Integer, Command>();\r\n\r\n public void setCommand(final Integer operationNumber, final Command cmd) {\r\n menuItems.put(operationNumbe... | import java.io.IOException;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.headwire.aemdc.command.CommandMenu;
import com.headwire.aemdc.command.CreateFileFromResourceCommand;
import com.headwire.aemdc.command.ReplacePlaceHoldersCommand;
import co... | package com.headwire.aemdc.runner;
/**
* AEMDC Configuration Properties creator
*
*/
public class ConfigPropsRunner extends BasisRunner {
private static final Logger LOG = LoggerFactory.getLogger(ConfigPropsRunner.class);
private static final String HELP_FOLDER = "help";
public static final... | menu.setCommand(1, new CreateFileFromResourceCommand(resource, config));
| 1 |
pgroth/hbase-rdf | src/main/java/nl/vu/datalayer/hbase/HBaseFactory.java | [
"public abstract class HBaseConnection {\n\n\tpublic static final byte NATIVE_JAVA = 0;\n\tpublic static final byte REST = 1;\n\t\n\tpublic static HBaseConnection create(byte connectionType) throws IOException{\n\t\tswitch (connectionType){\n\t\tcase NATIVE_JAVA: {\t\n\t\t\treturn new NativeJavaConnection();\n\t\t}... | import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Properties;
import nl.vu.datalayer.hbase.connection.HBaseConnection;
import nl.vu.datalayer.hbase.operations.HBHexastoreOperationManager;
import nl.vu.datalayer.hbase.operations.HBPrefixMatchOperationManager;
... | package nl.vu.datalayer.hbase;
public class HBaseFactory {
public static HBaseClientSolution getHBaseSolution(String schemaName, HBaseConnection con, ArrayList<Statement> statements) {
| if (schemaName.equals(HBasePredicateCFSchema.SCHEMA_NAME)){
| 6 |
tmorcinek/android-codegenerator-library | src/test/java/com/morcinek/android/codegenerator/codegeneration/providers/factories/ActivityResourceProvidersFactoryTest.java | [
"public interface ResourceProvider {\n\n public Map<String, String> provideValues();\n\n public Set<String> provideInterface();\n\n public Set<String> provideMethod();\n\n public Set<String> provideAssignment();\n\n public Set<String> provideField();\n}",
"public interface ResourceProvidersFactory ... | import com.morcinek.android.codegenerator.codegeneration.providers.ResourceProvider;
import com.morcinek.android.codegenerator.codegeneration.providers.ResourceProvidersFactory;
import com.morcinek.android.codegenerator.codegeneration.providers.resources.ButtonProvider;
import com.morcinek.android.codegenerator.extract... | package com.morcinek.android.codegenerator.codegeneration.providers.factories;
/**
* Copyright 2014 Tomasz Morcinek. All rights reserved.
*/
public class ActivityResourceProvidersFactoryTest {
private ResourceProvidersFactory resourceProvidersFactory;
@Before
public void setUp() throws Exception {
... | ResourceProvider resourceProvider = resourceProvidersFactory.createResourceProvider(resource); | 0 |
shaohui10086/ShareUtil | shareutil/src/main/java/me/shaohui/shareutil/login/instance/QQLoginInstance.java | [
"public class ShareLogger {\n\n private static final String TAG = \"share_util_log\";\n\n public static void i(String info) {\n if (ShareManager.CONFIG.isDebug()) {\n Log.i(TAG, info);\n }\n }\n\n public static void e(String error) {\n if (ShareManager.CONFIG.isDebug()) {... | import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.text.TextUtils;
import com.tencent.tauth.IUiListener;
import com.tencent.tauth.Tencent;
import com.tencent.tauth.UiError;
import jav... | package me.shaohui.shareutil.login.instance;
/**
* Created by shaohui on 2016/12/1.
*/
public class QQLoginInstance extends LoginInstance {
private static final String SCOPE = "get_simple_userinfo";
private static final String URL = "https://graph.qq.com/user/get_user_info";
private Tencent mTencen... | mTencent = Tencent.createInstance(ShareManager.CONFIG.getQqId(), | 1 |
fireshort/spring-boot-quickstart | src/main/java/org/springside/examples/quickstart/service/task/TaskService.java | [
"@Entity\n@Table(name = \"ss_task\")\npublic class Task extends IdEntity {\n\n\tprivate String title;\n\tprivate String description;\n\tprivate User user;\n\n\t// JSR303 BeanValidator的校验规则\n\t@NotBlank\n\tpublic String getTitle() {\n\t\treturn title;\n\t}\n\n\tpublic void setTitle(String title) {\n\t\tthis.title = ... | import org.springside.examples.quickstart.entity.Task;
import org.springside.examples.quickstart.repository.TaskDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort... | /*******************************************************************************
* Copyright (c) 2005, 2014 springside.github.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
*******************************************************************************/
package org.springside.examples.quicks... | Map<String, SearchFilter> filters = SearchFilter.parse(searchParams); | 3 |
Qihoo360/RePlugin | replugin-host-library/replugin-host-lib/src/main/java/com/qihoo360/loader2/Plugin.java | [
"public class RePlugin {\n\n static final String TAG = \"RePlugin\";\n\n /**\n * 表示目标进程根据实际情况自动调配\n */\n public static final String PROCESS_AUTO = \"\" + IPluginManager.PROCESS_AUTO;\n\n /**\n * 表示目标为UI进程\n */\n public static final String PROCESS_UI = \"\" + IPluginManager.PROCESS_UI;... | import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.res.Resources;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.RemoteException;
import android.text.TextUtils;
import com.qihoo360.i.IModule;
import co... | /*
* Copyright (C) 2005-2017 Qihoo 360 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 ag... | LogRelease.e(PLUGIN_TAG, "ph u p i: " + e.getMessage(), e); | 6 |
operando/Garum | garum/src/main/java/com/os/operando/garum/models/PrefModel.java | [
"public class PrefInfo {\n\n private String prefName;\n private Map<Field, String> keyNames = new LinkedHashMap<>();\n\n public PrefInfo(Class<? extends PrefModel> type) {\n setPrefName(type);\n List<Field> fields = new LinkedList<>(ReflectionUtil.getDeclaredPrefKeyFields(type));\n for... | import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
import android.text.TextUtils;
import com.os.operando.garum.PrefInfo;
import com.os.operando.garum.annotations.DefaultBoolean;
import com.os.operando.garum.annotat... | package com.os.operando.garum.models;
public abstract class PrefModel {
private final PrefInfo prefInfo;
private SharedPreferences.Editor editor;
public PrefModel() { | prefInfo = Cache.getPrefInfo(getClass()); | 2 |
otto-de/jlineup | web/src/main/java/de/otto/jlineup/web/JLineupRunnerFactory.java | [
"public class JLineupRunner {\n\n private final static Logger LOG = LoggerFactory.getLogger(lookup().lookupClass());\n\n public static final String REPORT_LOG_NAME_KEY = \"reportlogname\";\n public static final String LOGFILE_NAME = \"jlineup.log\";\n\n private final JobConfig jobConfig;\n private fi... | import de.otto.jlineup.JLineupRunner;
import de.otto.jlineup.RunStepConfig;
import de.otto.jlineup.config.JobConfig;
import de.otto.jlineup.config.Step;
import de.otto.jlineup.service.BrowserNotInstalledException;
import de.otto.jlineup.web.configuration.JLineupWebProperties;
import org.springframework.beans.factory.an... | package de.otto.jlineup.web;
@Component
public class JLineupRunnerFactory {
private final JLineupWebProperties properties;
@Autowired
public JLineupRunnerFactory(JLineupWebProperties properties) {
this.properties = properties;
}
| public JLineupRunner createBeforeRun(String id, JobConfig jobConfig) throws Exception { | 0 |
AwaisKing/Linked-Words | app/src/main/java/awais/backworddictionary/asyncs/SearchAsyncTask.java | [
"public final class WordItem {\n private int position = RecyclerView.NO_POSITION;\n private final String word;\n private final String[][] defs;\n private final String parsedTags;\n private boolean expanded;\n\n public WordItem(final String word, final int numSyllables, final String[] tags, final S... | import android.util.Log;
import androidx.annotation.NonNull;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import awais.backworddictionary.BuildConfig;
import awais.backworddictionary.adapters.holders.WordItem;
import awais.backworddictionary.executor.LocalAsyncTask;
import awais.ba... | package awais.backworddictionary.asyncs;
public final class SearchAsyncTask extends LocalAsyncTask<String, ArrayList<WordItem>> {
private MainCheck mainCheck;
public SearchAsyncTask(final MainCheck mainCheck) {
this.mainCheck = mainCheck;
}
@NonNull
@Override
protected ArrayList<... | .concat(URLEncoder.encode(param))); | 2 |
Wokdsem/Kinject | compiler/src/main/java/com/wokdsem/kinject/codegen/ModuleAdapterSpec.java | [
"public class Dependency {\n\n\tpublic final String canonicalClassName;\n\tpublic final String named;\n\n\tpublic Dependency(String canonicalClassName, String named) {\n\t\tthis.canonicalClassName = canonicalClassName;\n\t\tthis.named = named;\n\t}\n\n}",
"public class Module {\n\n\tpublic final String canonicalM... | import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.ParameterizedTypeName;
import com.squareup.javapoet.TypeSpec;
import com.wokdsem.kinject.annotations.Provides;
import com.wokdsem.kinject.codegen.domains.Dependency;
import com.wokdsem.kinject.codegen.domains.M... | package com.wokdsem.kinject.codegen;
class ModuleAdapterSpec {
static TypeSpec getModuleAdapterSpec(Module module, String adapterName) {
List<MethodSpec> methods = getMethods(module.canonicalModuleName, module.provides);
return TypeSpec
.classBuilder(adapterName)
.addModifiers(PUBLIC, FINAL)
.addMeth... | List<Dependency> dependencies = provide.dependencies; | 0 |
Hevelian/hevelian-olastic | olastic-core/src/test/java/com/hevelian/olastic/core/api/uri/queryoption/expression/ElasticSearchExpressionRelationsTest.java | [
"public static void checkFilterGrandChildEqualsQuery(String query, String field, String value,\n String child, String grandChild) {\n JSONObject childObj = new JSONObject(query).getJSONObject(\"has_child\");\n String childType = (String) childObj.get(\"type\");\n assertEquals(child, childType);\n ... | import static com.hevelian.olastic.core.TestUtils.checkFilterGrandChildEqualsQuery;
import static com.hevelian.olastic.core.TestUtils.checkFilterGrandParentEqualsQuery;
import static com.hevelian.olastic.core.TestUtils.checkFilterParentEqualsQuery;
import static org.junit.Assert.assertEquals;
import static org.junit.As... | String rawQueryPath = "$filter=book/all(b:b/title eq 'name')";
UriInfo uriInfo = buildUriInfo(defaultMetadata, defaultOData, rawODataPath, rawQueryPath);
uriInfo.getFilterOption().getExpression().accept(new ElasticSearchExpressionVisitor());
}
@Test
public void visitMember_lambdaAny... | checkFilterParentEqualsQuery(query, "author", "name", "'Dawkins'"); | 2 |
flipkart-incubator/BlueShift | src/main/java/com/flipkart/fdp/migration/db/models/BatchRun.java | [
"public static final String COL_BATCH_CONFIG = \"batch_config\";",
"public static final String COL_JOB_ID = \"job_id\";",
"public static final String COL_STATUS = \"status\";",
"public static final String TAB_BATCH_RUNS = \"batch_runs\";",
"public final class DBUtils {\n\tpublic static final String TAB_BATC... | import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import lombok.Getter;
import com.flipkart.fdp.migration.db.utils.DBUtils;
import static com.flipkart.fdp.migration.db.utils.DBUtils.COL_BATCH_CONFIG;
import static com.flipkart.fdp.migration.db.utils.DBUtils.COL_JOB_ID;
import static com.flipk... | /*
*
* Copyright 2015 Flipkart Internet Pvt. Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless ... | @Column(name = COL_STATUS) | 2 |
petitparser/java-petitparser | petitparser-core/src/test/java/org/petitparser/tools/GrammarDefinitionTest.java | [
"public static CharacterParser digit() {\n return digit(\"digit expected\");\n}",
"public static CharacterParser letter() {\n return letter(\"letter expected\");\n}",
"public static CharacterParser of(\n CharacterPredicate predicate, String message) {\n return new CharacterParser(predicate, message);\n}",... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.petitparser.parser.primitive.CharacterParser.digit;
import static org.petitparser.parser.primitive.CharacterParser.letter;
import static org.petitparser.parser.primitive.... | package org.petitparser.tools;
/**
* Tests {@link GrammarDefinition}.
*/
public class GrammarDefinitionTest {
class ListGrammarDefinition extends GrammarDefinition {
ListGrammarDefinition() {
def("start", ref("list").end());
def("list", ref("element").seq(of(',').flatten()).seq(ref("list")).or(... | def("addition", ref("factors").separatedBy(pattern("+-").flatten().trim())); | 3 |
gauthierj/dsm-webapi-client | dsm-webapi-client-filestation/src/main/java/com/github/gauthierj/dsm/webapi/client/filestation/upload/UploadServiceImpl.java | [
"public class DsmWebapiResponse<T> {\n\n private boolean success;\n private T data;\n private DsmWebApiResponseError error;\n\n @JsonCreator\n public DsmWebapiResponse(@JsonProperty(\"success\") boolean success,\n @JsonProperty(\"data\") T data,\n ... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.gauthierj.dsm.webapi.client.DsmWebapiResponse;
import com.github.gauthierj.dsm.webapi.client.authentication.AuthenticationHolder;
import com.github.gauthierj.dsm.webapi.client.filestation.exception.FileAlreadyExistsException;
import com.github.gauthi... | package com.github.gauthierj.dsm.webapi.client.filestation.upload;
/**
* Could not succeed to implement this with RestTemplate
* Implemented with Apache's HttpClient and Jackson's object mapper
*/
@Component
public class UploadServiceImpl extends AbstractDsmServiceImpl implements UploadService {
private stat... | private void appendOverwriteBehaviorIfNeeded(StringBuilder request, OverwriteBehavior overwriteBehavior) { | 6 |
Earthblood/Toe | app/src/main/java/com/earthblood/tictactoe/util/Skill.java | [
"public class Toe extends Application {\n\n public static final String TAG = \"EARTHBLOOD_TOE\";\n private static Context context;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n RoboGuice.overrideApplicationInjector(this, new ToeRoboModule());\n\n context = this;\n... | import com.earthblood.tictactoe.R;
import com.earthblood.tictactoe.application.Toe;
import com.earthblood.tictactoe.strategy.ToeStrategy;
import com.earthblood.tictactoe.strategy.ToeStrategyEasy;
import com.earthblood.tictactoe.strategy.ToeStrategyHard;
import com.earthblood.tictactoe.strategy.ToeStrategyNormal;
import... | /**
* @author John Piser developer@earthblood.com
*
* Copyright (C) 2014 EARTHBLOOD, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | return new ToeStrategyEasy(selectedXBoxIds, selectedOBoxIds, androidSymbol); | 2 |
proxytoys/proxytoys | proxytoys/src/main/java/com/thoughtworks/proxy/toys/pool/Pool.java | [
"public interface ProxyFactory extends Serializable {\n\n /**\n * Create a new proxy instance.\n * \n * @param <T> The proxy's type. \n * @param invoker the invocation handler.\n * @param types the types the proxy must emulate.\n * @return the new proxy instance.\n * @since 1.0\n ... | import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.NotSerializableException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.H... | /*
* (c) 2003-2005, 2009, 2010 ThoughtWorks Ltd. All rights reserved.
* (c) 2015 ProxyToys Committers. All rights reserved.
*
* The software in this package is published under the terms of the BSD
* style license a copy of which has been included with this distribution in
* the LICENSE.txt file.
*
* Created on... | final PoolingInvoker<T> invoker = PoolingInvoker.class.cast(InvokerReference.class.cast(poolable).getInvoker()); | 1 |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/base_presenter/PicPostPresenter.java | [
"public interface IPicPostView {\n void showPostProgressDialog();\n\n void dismissPostProgressDialog();\n\n void netError();\n\n void doAfterPostSuccessfully();\n}",
"public class SellInfo {\n int id;\n String name;\n String tel;\n String shortTel;\n String wechat;\n String datetime;... | import com.leelit.stuer.base_view.viewinterface.IPicPostView;
import com.leelit.stuer.bean.SellInfo;
import com.leelit.stuer.bean.TreeholeInfo;
import com.leelit.stuer.module_sell.model.SellModel;
import com.leelit.stuer.module_treehole.model.TreeholeModel;
import java.io.File;
import okhttp3.ResponseBody;
import rx.Su... | package com.leelit.stuer.base_presenter;
/**
* Created by Leelit on 2016/3/16.
*/
public class PicPostPresenter implements IPresenter {
private SellModel mSellModel = new SellModel(); | private TreeholeModel mTreeholeModel = new TreeholeModel(); | 4 |
neo4j/windows-wrapper | src/main/java/org/rzo/yajsw/Pdh.java | [
"public class Memory extends Pointer {\n\n private static Map buffers = new WeakHashMap();\n\n protected long size; // Size of the malloc'ed space\n\n /** Force cleanup of memory that has associated NIO Buffers which have\n been GC'd.\n */\n public static void purge() {\n buffers.size()... | import java.util.HashMap;
import java.util.Map;
import com.sun.jna.Memory;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.Union;
import com.sun.jna.WString;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.PointerByReference;
import com.sun... | package org.rzo.yajsw;
/* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* <p/>
* This library is dis... | Pdhdll INSTANCE = (Pdhdll) Native.loadLibrary("pdh", Pdhdll.class);
| 1 |
janrain/engage.android | Jump/src/com/janrain/android/capture/Capture.java | [
"public class Jump {\n private static final String JR_CAPTURE_FLOW = \"jr_capture_flow\";\n\n /*package*/ enum State {\n STATE;\n\n // Computed values:\n /*package*/ CaptureRecord signedInUser;\n /*package*/ JREngage jrEngage;\n /*package*/ Map<String, Object> captureFlow;\n... | import com.janrain.android.Jump;
import com.janrain.android.utils.ApiConnection;
import org.json.JSONObject;
import static com.janrain.android.Jump.TraditionalSignInType;
import static com.janrain.android.Jump.TraditionalSignInType.EMAIL;
import static com.janrain.android.Jump.getCaptureClientId;
import static com.janr... | /*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright (c) 2012, Janrain, Inc.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* * Re... | TraditionalSignInType type, | 2 |
jaychang0917/SimpleRecyclerView | app/src/main/java/com/jaychang/demo/srv/MultiTypesActivity.java | [
"public class BookAdCell extends SimpleCell<Ad, BookAdCell.ViewHolder> {\n\n public BookAdCell(Ad ad) {\n super(ad);\n }\n\n @Override\n protected int getLayoutRes() {\n return R.layout.cell_book_ad;\n }\n\n @NonNull\n @Override\n protected ViewHolder onCreateViewHolder(ViewGroup parent, View cellView... | import android.os.Bundle;
import android.view.View;
import com.jaychang.demo.srv.cell.BookAdCell;
import com.jaychang.demo.srv.cell.BookCell;
import com.jaychang.demo.srv.cell.NumberAdCell;
import com.jaychang.demo.srv.cell.NumberCell;
import com.jaychang.demo.srv.model.Ad;
import com.jaychang.demo.srv.model.Book;
impo... | package com.jaychang.demo.srv;
public class MultiTypesActivity extends BaseActivity {
@BindView(R.id.linearVerRecyclerView)
SimpleRecyclerView linearVerRecyclerView;
@BindView(R.id.linearHorRecyclerView)
SimpleRecyclerView linearHorRecyclerView;
@BindView(R.id.gridRecyclerView)
SimpleRecyclerView grid... | List<SimpleCell> cells = new ArrayList<>(); | 7 |
simplify20/PowerfulRecyclerViewAdapter | app/src/main/java/com/steve/creact/powerfuladapter/presentation/BaseListActivity.java | [
"public class CommonRecyclerAdapter extends BaseRecyclerAdapter<DisplayBean, BaseRecyclerViewHolder> {\n private boolean userAnimation = false;\n //those bean instance will use to create concrete ViewHolders\n private List<DisplayBean> createBeans = new ArrayList<>();\n //those bean class will use to ge... | import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolb... | package com.steve.creact.powerfuladapter.presentation;
public class BaseListActivity extends AppCompatActivity {
protected RecyclerView recyclerView;
protected CommonRecyclerAdapter adapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
... | ICategory category = i == 0 ? new MockCategory() : new Category(i, "category" + i); | 4 |
fjoncourt/jfwknop | src/main/java/com/cipherdyne/gui/wizard/views/HmacView.java | [
"public interface IFwknopVariable {\n void setText(final String val);\n\n String getText();\n\n void setDefaultValue();\n\n boolean isDefault();\n}",
"public class JFwknopTextField extends JTextField implements IFwknopVariable {\n\n private static final long serialVersionUID = 1L;\n private fina... | import com.cipherdyne.gui.components.IFwknopVariable;
import com.cipherdyne.gui.components.JFwknopTextField;
import com.cipherdyne.gui.wizard.EnumWizardButton;
import com.cipherdyne.gui.wizard.EnumWizardVariable;
import com.cipherdyne.gui.wizard.EnumWizardView;
import java.util.Map;
import javax.swing.JButton; | /*
* JFwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2016 JFwknop developers and contributors.
*
* 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; ... | public void initialize(Map<EnumWizardVariable, IFwknopVariable> varMap, Map<EnumWizardButton, JButton> btnMap) { | 2 |
bourgesl/marlin-fx | src/main/java/com/sun/prism/impl/shape/MarlinRasterizer.java | [
" public class Path2D extends Shape implements PathConsumer2D {\n\n static final int curvecoords[] = {2, 2, 4, 6, 0};\n\n public enum CornerPrefix {\n CORNER_ONLY,\n MOVE_THEN_CORNER,\n LINE_THEN_CORNER\n }\n\n /**\n * An even-odd winding rule for determining the interior... | import com.sun.javafx.sg.prism.NGCanvasPath;
import com.sun.marlin.MarlinRenderer;
import com.sun.marlin.MarlinRenderingEngine;
import com.sun.marlin.MaskMarlinAlphaConsumer;
import com.sun.marlin.RendererContext;
import com.sun.prism.BasicStroke;
import com.sun.prism.impl.PrismSettings;
import com.sun.javafx.geom.Path... | /*
* Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free ... | if (shape instanceof NGCanvasPath) { | 1 |
ptgoetz/storm-hdfs | src/main/java/org/apache/storm/hdfs/bolt/AbstractHdfsBolt.java | [
"public interface FileNameFormat extends Serializable {\n\n void prepare(Map conf, TopologyContext topologyContext);\n\n /**\n * Returns the filename the HdfsBolt will create.\n * @param rotation the current file rotation number (incremented on every rotation)\n * @param timeStamp current time in ... | import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichBolt;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org... | /**
* 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... | protected SyncPolicy syncPolicy; | 3 |
fjoncourt/jfwknop | src/main/java/com/cipherdyne/gui/wizard/EnumWizardView.java | [
"public class AccessView extends AbstractView {\n\n @Override\n public void initialize(Map<EnumWizardVariable, IFwknopVariable> varMap, Map<EnumWizardButton, JButton> btnMap) {\n varMap.put(EnumWizardVariable.ACCESS, new JFwknopTextField(\"tcp/22\"));\n\n // Add object to the newly created panel... | import com.cipherdyne.gui.wizard.views.AccessView;
import com.cipherdyne.gui.wizard.views.AesView;
import com.cipherdyne.gui.wizard.views.CryptoView;
import com.cipherdyne.gui.wizard.views.GpgHomeDirectoryView;
import com.cipherdyne.gui.wizard.views.GpgRecipientIdView;
import com.cipherdyne.gui.wizard.views.GpgSignerId... | /*
* JFwknop is developed primarily by the people listed in the file 'AUTHORS'.
* Copyright (C) 2016 JFwknop developers and contributors.
*
* 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; ... | return new GpgSignerIdView(); | 5 |
dbdkmezz/true-sight-dota | app/src/main/java/com/carver/paul/truesight/Ui/MainActivity.java | [
"public class AbilityDebuffPresenter implements IInfoPresenter_Data, IInfoPresenter_P {\n private AbilityInfoFragment mView;\n\n public AbilityDebuffPresenter() {}\n\n public void setView(AbilityInfoFragment view) {\n mView = view;\n }\n\n public void reset() {\n mView.reset();\n }\n... | import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Bundle;
import android.suppor... | startActivity(intent);
}
public void clearButton(View view) {
mPresenter.clearButton();
}
protected boolean isNetworkAvailable() {
ConnectivityManager connectivityManager
= (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo... | ExpandingViewPager pager = (ExpandingViewPager) findViewById(R.id.pager); | 6 |
ccrama/Slide-RSS | app/src/main/java/me/ccrama/rssslide/Adapters/FeedAdapter.java | [
"public class ReaderMode extends BaseActivityAnim {\n\n public static final String EXTRA_URL = \"url\";\n public static String html;\n SpoilerRobotoTextView v;\n String url;\n\n\n @Override\n public void onCreate(Bundle savedInstanceState) {\n overrideSwipeFromAnywhere();\n super.onC... | import android.app.Activity;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.w... | package me.ccrama.rssslide.Adapters;
/**
* Created by ccrama on 3/22/2015.
*/
public class FeedAdapter extends RealmRecyclerViewAdapter<Article, RecyclerView.ViewHolder> {
private final RecyclerView listView;
private final SwipeRefreshLayout refreshLayout;
public Activity context;
public DataSet... | View v = CreateCardView.CreateView(viewGroup); | 7 |
nikkiii/java-webserver | src/org/nikki/http/content/DirectoryListingContentHandler.java | [
"public class HttpServer {\n\n\t/**\n\t * The server software..\n\t */\n\tpublic static final String SERVER_SOFTWARE = \"JavaHttpd\";\n\n\t/**\n\t * The server version\n\t */\n\tpublic static final String SERVER_VERSION = \"1.0\";\n\n\t/**\n\t * The logger instance\n\t */\n\tprivate static final Logger logger = Log... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.... | /**
* JavaHttpd, the flexible Java webserver
* 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 License, or
* (at your ... | string = string.replace("{version}", HttpServer.SERVER_SOFTWARE | 0 |
pasqualesalza/elephant56 | elephant56/src/main/java/it/unisa/elephant56/core/SequentialDriver.java | [
"public class IndividualWrapper<IndividualType extends Individual, FitnessValueType extends FitnessValue>\r\n implements Comparable<IndividualWrapper<IndividualType, FitnessValueType>>, Cloneable {\r\n\r\n private IndividualType individual;\r\n private FitnessValueType fitnessValue;\r\n private Bool... | import it.unisa.elephant56.core.common.IndividualWrapper;
import it.unisa.elephant56.core.generator.GenerationsBlockExecutor;
import it.unisa.elephant56.core.reporter.individual.IndividualReporter;
import it.unisa.elephant56.core.reporter.time.GeneticOperatorsTimeReporter;
import it.unisa.elephant56.core.reporter.t... | package it.unisa.elephant56.core;
public class SequentialDriver extends Driver {
// Driver objects.
private List<IndividualWrapper<Individual, FitnessValue>> inputPopulation;
private List<IndividualWrapper<Individual, FitnessValue>> outputPopulation;
private List<IndividualWrapper<Individua... | IndividualReporter individualReporter = null;
| 2 |
CycloneAxe/phphub-android | app/src/main/java/org/estgroup/phphub/ui/view/MainActivity.java | [
"public abstract class BaseActivity<PresenterType extends Presenter> extends NucleusAppCompatActivity<PresenterType> {\n @Nullable\n @Bind(R.id.toolbar)\n Toolbar toolbarView;\n\n @Nullable\n @Bind(R.id.toolbar_title)\n public TextView toolbarTitleView;\n\n public Navigator navigator;\n\n @I... | import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.ogaclejapan.smarttablayout.SmartTabLayo... | package org.estgroup.phphub.ui.view;
public class MainActivity extends BaseActivity {
@Bind(R.id.viewpager)
ViewPager viewPager;
@Bind(R.id.viewpagertab)
SmartTabLayout viewpagerTab;
private BGABadgeFrameLayout meIconView;
@Override
protected void onCreate(Bundle savedInstanceState)... | BusProvider.getInstance().register(this); | 2 |
xuraylei/floodlight_with_topoguard | src/main/java/net/floodlightcontroller/core/internal/OFChannelHandler.java | [
"public static enum Role {\n EQUAL(OFRoleVendorData.NX_ROLE_OTHER),\n MASTER(OFRoleVendorData.NX_ROLE_MASTER),\n SLAVE(OFRoleVendorData.NX_ROLE_SLAVE);\n\n private final int nxRole;\n\n private Role(int nxRole) {\n this.nxRole = nxRole;\n }\n\n private static Map<Integer,Role> nxRoleToEn... | import java.io.IOException;
import java.nio.channels.ClosedChannelException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.RejectedExecutionException;
import net.floodlightcontroller.core.FloodlightCon... | OFBadActionCode.values()[0xffff & error.getErrorCode()];
return String.format("Error %s %s", et, bac);
case OFPET_FLOW_MOD_FAILED:
OFFlowModFailedCode fmfc =
OFFlowModFailedCode.values()[0xffff & error.getErrorCode()];
r... | OFGetConfigRequest configReq = (OFGetConfigRequest) | 2 |
metno/metadata-editor | src/main/java/no/met/metadataeditor/view/NewRecordBean.java | [
"public class EditorException extends RuntimeException {\n \n // available error codes\n public final static int GENERAL_ERROR_CODE = 100; // exception that cannot be futher classified \n public final static int TEMPLATE_PARSE_ERROR = 101; // an error when parsing the template\n public final stati... | import java.io.IOException;
import java.io.Serializable;
import java.io.StringReader;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
im... | package no.met.metadataeditor.view;
@ManagedBean
@ViewScoped
public class NewRecordBean implements Serializable {
private static final Logger logger = Logger.getLogger(NewRecordBean.class.getName());
// automatically set based on the query parameters
private String project;
// the id... | throw new EditorException("Failed to parse template", e, EditorException.TEMPLATE_PARSE_ERROR); | 0 |
ubiratansoares/reactive-architectures-playground | app/src/main/java/br/ufs/demos/rxmvp/playground/dagger/modules/PresentationModule.java | [
"public class BehavioursCoordinator<T> implements FlowableTransformer<T, T> {\n\n private AssignEmptyState<T> dealWithEmptyState;\n private AssignErrorState<T> assignErrorState;\n private LoadingCoordination<T> loadingCoordinator;\n private NetworkingErrorFeedback<T> networkingErrorFeedback;\n privat... | import android.content.Context;
import br.ufs.demos.rxmvp.playground.core.behaviours.BehavioursCoordinator;
import br.ufs.demos.rxmvp.playground.core.lifecycles.LifecycleStrategist;
import br.ufs.demos.rxmvp.playground.trivia.domain.GetRandomFacts;
import br.ufs.demos.rxmvp.playground.trivia.presentation.DisplayFactsVi... | package br.ufs.demos.rxmvp.playground.dagger.modules;
/**
* Created by bira on 6/26/17.
*/
@Module(includes = InfrastructureModule.class)
public class PresentationModule {
@Provides static FactsPresenter presenter(GetRandomFacts usecase,
DisplayFactsView view,
... | FactsViewModelMapper mapper) { | 5 |
iloveeclipse/anyedittools | AnyEditTools/src/de/loskutov/anyedit/actions/DefaultOpenEditorParticipant.java | [
"public class AnyEditToolsPlugin extends AbstractUIPlugin {\n\n private static AnyEditToolsPlugin plugin;\n\n private static boolean isSaveHookInitialized;\n\n /**\n * The constructor.\n */\n public AnyEditToolsPlugin() {\n super();\n if(plugin != null) {\n throw new Ill... | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse... | /*******************************************************************************
* Copyright (c) 2009 Andrey Loskutov.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at... | int caretPosition = EclipseUtils.getCaretPosition(selectionProvider); | 2 |
inovex/zax | src/main/java/com/inovex/zabbixmobile/data/HomescreenWidgetService.java | [
"public class ProblemsActivity extends BaseSeverityFilterActivity<Trigger> {\n\n\tpublic static final String ARG_TRIGGER_POSITION = \"ARG_TRIGGER_POSITION\";\n\tprivate static final String TAG = ProblemsActivity.class.getSimpleName();\n\tpublic static final String ARG_START_FROM_NOTIFICATION = \"arg_start_from_noti... | import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.PendingIntent;
import android.app.Service;
import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Build;
import android.... | /*
This file is part of ZAX.
ZAX 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.
ZAX is distributed in the hope that it will be useful... | TriggerSeverity.ALL, HostGroup.GROUP_ID_ALL); | 2 |
abicelis/Remindy | app/src/main/java/ve/com/abicelis/remindy/app/fragments/RepeatingReminderDetailFragment.java | [
"public enum DateFormat {\n PRETTY_DATE {\n @Override\n public String formatCalendar(Calendar calendar) {\n SimpleDateFormat formatter = new SimpleDateFormat(\"MMM d, yyyy\", Locale.getDefault());\n String str = formatter.format(calendar.getTime());\n\n ... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.BaseTransientBottomBar;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import an... | package ve.com.abicelis.remindy.app.fragments;
/**
* Created by abice on 13/3/2017.
*/
public class RepeatingReminderDetailFragment extends Fragment {
//CONST
public static final String REMINDER_TO_DISPLAY = "REMINDER_TO_DISPLAY";
//DATA
private RepeatingReminder mReminder;
//UI
private... | DateFormat df = SharedPreferenceUtil.getDateFormat(getActivity()); | 0 |
wangym/koubei-sharding | performance-test/src/sharding/InsertStore.java | [
"public class Store implements Serializable {\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tprivate static final long serialVersionUID = 4197361270230967493L;\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\t// 表的主键\r\n\tprivate String id;\r\n\t// 店铺名称\r\n\tprivate String name;\r\n\t// 分店名称\r\n\tprivate String subname;\r\n\t// 用户Pin\r\n\... | import java.io.Serializable;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.protocol.java.sampler.AbstractJavaSamplerClient;
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext;
import org.apache.jmeter.samplers.SampleResult;
imp... | /**
*
*/
package sharding;
/**
* @author xuanyin
*
*/
public class InsertStore extends AbstractJavaSamplerClient implements Serializable {
/**
*
*/
private static final long serialVersionUID = -6388073015232081279L;
/**
*
*/
private static long start = 0;
private static lo... | private static IStoreDAO storeDAO;
| 2 |
mikroskeem/Shuriken | instrumentation/src/test/java/eu/mikroskeem/test/shuriken/instrumentation/BytecodeManipulatorTest.java | [
"public final class ClassLoaderTools {\n /**\n * Private constructor, do not use\n */\n private ClassLoaderTools() {\n throw new RuntimeException(\"No ClassLoaderTools instance for you!\");\n }\n\n /**\n * Load class from bytearray to existing class loader. Useful when you need to\n ... | import eu.mikroskeem.shuriken.instrumentation.ClassLoaderTools;
import eu.mikroskeem.shuriken.instrumentation.ClassTools;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.object... | package eu.mikroskeem.test.shuriken.instrumentation;
/**
* @author Mark Vainomaa
*/
public class BytecodeManipulatorTest {
private static byte[] testClassData;
private static Type tc11;
@BeforeAll
private static void before() throws Exception {
Class<?> clazz = Class.forName("eu.mikroskee... | MethodNode foundMethod = findMethod(methods, 0, "<init>", "()V"); | 4 |
dragonite-network/dragonite-java | dragonite-mux/src/main/java/com/vecsight/dragonite/mux/frame/types/PauseConnectionFrame.java | [
"public class IncorrectFrameException extends MuxException {\n\n public IncorrectFrameException(final String msg) {\n super(msg);\n }\n\n}",
"public interface Frame {\n\n byte getVersion();\n\n FrameType getType();\n\n byte[] toBytes();\n\n int getFixedLength();\n\n int getExpectedLeng... | import com.vecsight.dragonite.mux.exception.IncorrectFrameException;
import com.vecsight.dragonite.mux.frame.Frame;
import com.vecsight.dragonite.mux.frame.FrameType;
import com.vecsight.dragonite.mux.misc.MuxGlobalConstants;
import com.vecsight.dragonite.utils.binary.BinaryReader;
import com.vecsight.dragonite.utils.b... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.mux.frame.types;
/*
* VERSION 1 SB
* TYPE 1 SB
* connID 2 SS
*/
public class PauseConnectionFrame implements Frame {
private static fin... | final BinaryReader reader = new BinaryReader(frame); | 4 |
redomar/JavaGame | src/com/redomar/game/level/LevelHandler.java | [
"public abstract class Entity {\n\n\tprotected double x, y;\n\tprotected String name;\n\tprotected LevelHandler level;\n\n\tpublic Entity(LevelHandler level) {\n\t\tinit(level);\n\t}\n\n\tpublic final void init(LevelHandler level) {\n\t\tthis.level = level;\n\t}\n\n\tpublic abstract void tick();\n\n\tpublic abstrac... | import com.redomar.game.entities.Entity;
import com.redomar.game.entities.Player;
import com.redomar.game.entities.PlayerMP;
import com.redomar.game.gfx.Screen;
import com.redomar.game.level.tiles.Tile;
import com.redomar.game.lib.utils.Vector2i;
import com.redomar.game.scenes.Scene;
import com.redomar.game.script.Prin... | package com.redomar.game.level;
public class LevelHandler {
private byte[] tiles;
private int width;
private int height;
private List<Entity> entities;
private List<Entity> entities_p;
private String imagePath;
private BufferedImage image; | private Printing print; | 8 |
fvalente/LogDruid | src/logdruid/ui/mainpanel/SourceInfoPanel.java | [
"public class Repository {\n\tprivate static Logger logger = Logger.getLogger(DataMiner.class.getName());\n\tprivate ArrayList<Recording> recordings;\n\tprivate ArrayList<Source> sources;\n\tprivate String baseSourcePath;\n\tprivate ArrayList<DateFormat> dates;\n\tprivate boolean recursiveMode;\n\tprivate boolean o... | import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;
import javax.swing.JLabel;
import javax.swing.BoxLayout;
import java.awt.FlowLayout;
import java.awt.Component;
import java.util.Collections;
import java.util.Map;
import... | gbc_panel_2.anchor = GridBagConstraints.WEST;
gbc_panel_2.insets = new Insets(0, 0, 0, 5);
gbc_panel_2.gridx = 0;
gbc_panel_2.gridy = 1;
panel_7.add(panel_2, gbc_panel_2);
GridBagLayout gbl_panel_2 = new GridBagLayout();
g... | ChartData cd = DataMiner.gatherSourceData(repo,true); | 6 |
encircled/Joiner | joiner-core/src/main/java/cz/encircled/joiner/core/DefaultAliasResolver.java | [
"public class JoinerException extends RuntimeException {\n\n public JoinerException(String message) {\n super(message);\n }\n\n public JoinerException(String message, Exception exception) {\n super(message, exception);\n }\n}",
"public class J {\n\n /**\n * Aliases of nested joins... | import com.querydsl.core.types.EntityPath;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.dsl.BooleanPath;
import com.querydsl.core.types.dsl.CollectionPathBase;
import com.querydsl.core.types.dsl.EntityPathBase;
import cz.encircled.joiner.exception.JoinerException;
import cz.encircled.joiner.query... | package cz.encircled.joiner.core;
/**
* @see AliasResolver
* @author Vlad on 16-Aug-16.
*/
public class DefaultAliasResolver implements AliasResolver {
private static final BooleanPath nullPath = ReflectionUtils.instantiate(BooleanPath.class, "");
private final EntityManager entityManager;
private... | testAliasCandidate(targetType, candidatePaths, getField(field, parent)); | 4 |
awslabs/amazon-sqs-java-messaging-lib | src/test/java/com/amazon/sqs/javamessaging/message/SQSMessageTest.java | [
"public static final String APPROXIMATE_RECEIVE_COUNT = \"ApproximateReceiveCount\";",
"public static final String JMSX_DELIVERY_COUNT = \"JMSXDeliveryCount\";",
"public class SQSMessagingClientConstants {\n\n public static final String UNSUPPORTED_METHOD = \"Unsupported Method\";\n\n public static final ... | import static com.amazon.sqs.javamessaging.SQSMessagingClientConstants.APPROXIMATE_RECEIVE_COUNT;
import static com.amazon.sqs.javamessaging.SQSMessagingClientConstants.JMSX_DELIVERY_COUNT;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org... |
try {
msg.checkBodyWritePermissions();
} catch (MessageNotWriteableException exception) {
assertEquals("Message body is not writable", exception.getMessage());
}
msg.checkPropertyWritePermissions();
msg.setWritePermissionsForProperties(false);
... | .withDataType(SQSMessagingClientConstants.BOOLEAN) | 2 |
cwan/im-log-stats | im-log-stats-project/src/main/java/net/mikaboshi/intra_mart/tools/log_stats/report/Report.java | [
"public class ConcurrentRequest {\n\n\tpublic enum EventType {\n\n\t\t/** 受信時刻 */\n\t\tACCEPT_TIME,\n\n\t\t/** 返信時刻 */\n\t\tRESPONSE_TIME;\n\t}\n\n\tprivate final EventType type;\n\n\tprivate final long time;\n\n\tprivate int count = 0;\n\n\tprivate String tenantId;\n\n\tpublic ConcurrentRequest(EventType type, lon... | import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TimeZone;
import net.mikaboshi.intra_mart.to... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | public void add(ExceptionLog log) { | 1 |
piyell/NeteaseCloudMusic | app/src/main/java/com/zsorg/neteasecloudmusic/adapters/PlaylistAdapter.java | [
"public class MusicPlayerService extends IntentService {\n // IntentService can perform, e.g. ACTION_FETCH_NEW_ITEMS\n private static final String ACTION_PLAY = \"com.zsorg.neteasecloudmusic.action.PLAY\";\n private static final String ACTION_PAUSE = \"com.zsorg.neteasecloudmusic.action.PAUSE\";\n priva... | import android.content.Context;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.zsorg.neteasecloudmusic.MusicPlayerService;
import com.zsorg.neteasecloudmusic.callbacks.OnDel... | package com.zsorg.neteasecloudmusic.adapters;
public class PlaylistAdapter extends BaseAdapter<PlaylistHolder> {
private ArrayList<MusicBean> mValues;
private boolean isHideRightIcon;
public PlaylistAdapter(@NonNull LayoutInflater inflater) {
super(inflater);
}
public PlaylistAdapter(... | MusicPlayerService.startActionSet(context, list, 0); | 0 |
idega/is.idega.idegaweb.egov.course | src/java/is/idega/idegaweb/egov/course/presentation/CourseEditor.java | [
"public class CourseConstants {\n\n\tpublic static final String CASE_CODE_KEY = \"COURSEA\";\n\n\tpublic static final String IW_BUNDLE_IDENTIFIER = \"is.idega.idegaweb.egov.course\";\n\n\tpublic static final String ADMINISTRATOR_ROLE_KEY = \"afterSchoolCareAdministrator\";\n\tpublic static final String SUPER_ADMINI... | import is.idega.idegaweb.egov.course.CourseConstants;
import is.idega.idegaweb.egov.course.business.CourseBusiness;
import is.idega.idegaweb.egov.course.business.CourseSession;
import is.idega.idegaweb.egov.course.data.Course;
import is.idega.idegaweb.egov.course.data.CourseCategory;
import is.idega.idegaweb.egov.cours... |
Layer clearLayer = new Layer(Layer.DIV);
clearLayer.setStyleClass("Clear");
layer.add(clearLayer);
return layer;
}
public void showList(IWContext iwc) throws RemoteException {
Form form = new Form();
form.setStyleClass("adminForm");
form.setEventListener(this.getClass());
form.add(getNavigation(iw... | CourseType cType = course.getCourseType(); | 6 |
7upcat/agile-wroking-backend | src/test/java/org/catframework/agileworking/domain/ScheduleRepositoryTest.java | [
"public final class DateUtils {\r\n\r\n\t/** 简单的日期格式: yyyy-MM-dd */\r\n\tpublic static final String PATTERN_SIMPLE_DATE = \"yyyy-MM-dd\";\r\n\r\n\tpublic static final Date parse(String source, String pattern) {\r\n\t\ttry {\r\n\t\t\treturn new SimpleDateFormat(pattern).parse(source);\r\n\t\t} catch (ParseException ... | import java.util.List;
import org.catframework.agileworking.utils.DateUtils;
import org.catframework.agileworking.vo.ScheduleVO;
import org.catframework.agileworking.web.MeetingRoomController;
import org.catframework.agileworking.web.ScheduleController;
import org.catframework.agileworking.web.support.Result;
import or... | package org.catframework.agileworking.domain;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ScheduleRepositoryTest {
@Autowired
private ScheduleRepository scheduleRepository;
@Autowired
private ScheduleController scheduleController;
@Autowired
private MeetingRoomController meetingRoomController... | p.setDate(DateUtils.parse("2017-08-02", DateUtils.PATTERN_SIMPLE_DATE)); | 0 |
xushaomin/apple-ums-server | apple-ums-server-storage/apple-ums-server-storage-hdfs/src/main/java/com/appleframework/ums/server/storage/hdfs/KafkaSource.java | [
"public class ClientData implements Serializable {\r\n\r\n\tprivate static final long serialVersionUID = 6401151737886170198L;\r\n\r\n\tprivate String session_id;\r\n\tprivate String cellid;\r\n\tprivate Boolean ismobiledevice;\r\n\tprivate String appkey;\r\n\tprivate String resolution;\r\n\tprivate String network;... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.apache.flume.Context;
import org.apache.flume.Event;
import org.apache.flume.EventDeliveryException;
import org.apache.flume.FlumeException;
import org.apache.flume.Pollabl... |
package com.appleframework.ums.server.storage.hdfs;
/**
* A Source for Kafka which reads messages from a kafka topic.
*
* <tt>zookeeperConnect: </tt> Kafka's zookeeper connection string.
* <b>Required</b>
* <p>
* <tt>groupId: </tt> the group ID of consumer group. <b>Required</b>
* <p>
* <tt... | UsingLogJson json = JSON.parseObject(content, UsingLogJson.class);
| 7 |
sainttx/Auctions | Auctions/src/main/java/com/sainttx/auctions/command/AuctionCommands.java | [
"public enum MessagePath implements Message {\n // Auction formattable messages\n AUCTION_ITEMFORMAT(\"messages.auctionFormattable.itemFormat\"),\n AUCTION_ANTISNIPE_ADD(\"messages.auctionFormattable.antiSnipeAdd\"),\n AUCTION_AUTOWIN(\"messages.auctionFormattable.autowin\"),\n AUCTION_BID(\"messages... | import com.sainttx.auctions.MessagePath;
import com.sainttx.auctions.api.Auction;
import com.sainttx.auctions.api.AuctionManager;
import com.sainttx.auctions.api.AuctionPlugin;
import com.sainttx.auctions.api.MessageFactory;
import com.sainttx.auctions.api.event.AuctionPreBidEvent;
import com.sainttx.auctions.api.rewar... | /*
* Copyright (C) SainttX <http://sainttx.com>
* Copyright (C) contributors
*
* This file is part of Auctions.
*
* Auctions 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 Lice... | public void impound(CommandSender sender, @Optional Auction auction) { | 1 |
KalebKE/FSensor | fsensor/src/main/java/com/kircherelectronics/fsensor/sensor/acceleration/LowPassLinearAccelerationSensor.java | [
"public class LowPassFilter extends AveragingFilter\n{\n private static final String tag = LowPassFilter.class.getSimpleName();\n\n // Gravity and linear accelerations components for the\n // Wikipedia low-pass fusedOrientation\n private float[] output;\n\n public LowPassFilter() {\n this(DEFA... | import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import com.kircherelectronics.fsensor.filter.averaging.LowPassFilter;
import com.kircherelectronics.fsensor.linearacceleration.LinearAc... | package com.kircherelectronics.fsensor.sensor.acceleration;
/*
* Copyright 2018, Kircher Electronics, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org... | private final SensorSubject sensorSubject; | 3 |
plusonelabs/calendar-widget | app/src/androidTest/java/org/andstatus/todoagenda/PastDueHeaderWithTasksTest.java | [
"public class QueryResultsStorage {\n\n private static final String TAG = QueryResultsStorage.class.getSimpleName();\n private static final String KEY_RESULTS_VERSION = \"resultsVersion\";\n private static final int RESULTS_VERSION = 3;\n private static final String KEY_RESULTS = \"results\";\n publi... | import org.andstatus.todoagenda.provider.QueryResultsStorage;
import org.andstatus.todoagenda.util.MyClock;
import org.andstatus.todoagenda.widget.CalendarEntry;
import org.andstatus.todoagenda.widget.LastEntry;
import org.andstatus.todoagenda.widget.TaskEntry;
import org.andstatus.todoagenda.widget.WidgetEntryPosition... | package org.andstatus.todoagenda;
/**
* @author yvolk@yurivolkov.com
*/
public class PastDueHeaderWithTasksTest extends BaseWidgetTest {
/**
* https://github.com/plusonelabs/calendar-widget/issues/205
*/
@Test
public void testPastDueHeaderWithTasks() throws IOException, JSONException {
... | assertEquals("Past and Due header", MyClock.DATETIME_MIN, getFactory().getWidgetEntries().get(0).entryDate); | 1 |
ustramooner/gwt-geom | src/gwt/awt/ShapeCache.java | [
"public class Polygon implements Shape, java.io.Serializable {\n\n /**\n * The total number of points. The value of <code>npoints</code>\n * represents the number of valid points in this <code>Polygon</code>\n * and might be less than the number of elements in\n * {@link #xpoints xpoints} or {@l... | import gwt.awt.Polygon;
import gwt.awt.Rectangle;
import gwt.awt.geom.Arc2D;
import gwt.awt.geom.Ellipse2D;
import gwt.awt.geom.GeneralPath;
import gwt.awt.geom.Line2D;
import gwt.awt.geom.RoundRectangle2D; | package gwt.awt;
/**
* Caches certain Shape objects for reuse in AbstractGraphics2D. This avoids
* massive creation of such objects.
*/
class ShapeCache
{
/**
* A cached Line2D.
*/
public Line2D line;
/**
* A cached Rectangle.
*/
public Rectangle rect;
/**
* A cached RoundRectangle2D.
... | public RoundRectangle2D roundRect; | 6 |
mit-dig/punya | appinventor/components/src/com/google/appinventor/components/runtime/LinkedData.java | [
"public enum PropertyCategory {\n // TODO(user): i18n category names\n BEHAVIOR(\"Behavior\"),\n APPEARANCE(\"Appearance\"),\n LINKED_DATA(\"Linked Data\"),\n DEPRECATED(\"Deprecated\"),\n UNSET(\"Unspecified\");\n\n private String name;\n\n PropertyCategory(String categoryName) {\n name = categoryName;\... | import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import android.util.Log;
import com.google.appinventor.componen... | package com.google.appinventor.components.runtime;
@DesignerComponent(version = YaVersion.LINKED_DATA_COMPONENT_VERSION,
description = "Non-visible component that communicates with a SPARQL-powered triple store",
category = ComponentCategory.LINKEDDATA,
nonVisible = true,
iconName = "images/semantic... | @SimpleProperty(category = PropertyCategory.LINKED_DATA, | 0 |
cfg4j/cfg4j | cfg4j-core/src/test/java/org/cfg4j/source/classpath/ClasspathConfigurationSourceTest.java | [
"public class DefaultEnvironment extends ImmutableEnvironment {\n /**\n * Constructs environment named \"\" (empty string).\n */\n public DefaultEnvironment() {\n super(\"\");\n }\n\n @Override\n public String toString() {\n return \"DefaultEnvironment{}\";\n }\n}",
"public interface Environment {... | import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import org.assertj.core.data.MapEntry;
import org.cfg4j.source.context.environment.DefaultEnvironment;
import org... | /*
* Copyright 2015-2018 Norbert Potocki (norbert.potocki@nort.pl)
*
* 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 ... | Environment environment = new ImmutableEnvironment("otherApplicationConfigs"); | 1 |
rust-keylock/rust-keylock-ui | java/src/main/java/org/rustkeylock/controllers/ListEntriesController.java | [
"public class JavaEntry {\n public String name;\n public String url;\n public String user;\n public String pass;\n public String desc;\n public JavaEntryMeta meta;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n ... | import javafx.collections.FXCollections;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Pos;
import javafx.scene.control.*;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene... | // Copyright 2019 astonbitecode
// This file is part of rust-keylock password manager.
//
// rust-keylock 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 optio... | private ListView<JavaEntry> entriesListView; | 0 |
TeamCohen/SEAL | src/com/rcwang/seal/eval/BilingualExperiment.java | [
"public class Seal extends Pinniped {\r\n \r\n /********************** Parameters **************************/\r\n public static boolean readSerializedDocs = true;\r\n public static boolean writeSerializedDocs = false;\r\n /************************************************************/\r\n\r\n public static Log... | import java.io.File;
import java.util.List;
import org.apache.log4j.Logger;
import com.rcwang.seal.expand.Seal;
import com.rcwang.seal.expand.SeedSelector;
import com.rcwang.seal.translation.BilingualSeal;
import com.rcwang.seal.util.GlobalVar;
import com.rcwang.seal.util.Helper;
| package com.rcwang.seal.eval;
//import com.rcwang.seal.util.Mailer; //wwc
public class BilingualExperiment {
public static Logger log = Logger.getLogger(BilingualExperiment.class);
public static GlobalVar gv = GlobalVar.getGlobalVar();
public static final String FROM_EMAIL_ADDR = "Bilingual R... | BilingualSeal biSeal = new BilingualSeal();
| 2 |
tassioauad/GameCheck | app/src/main/java/com/tassioauad/gamecheck/dagger/PlatformViewModule.java | [
"public interface GameApi extends AsyncService {\n\n void searchLasts(Integer count);\n\n void searchByName(String name);\n\n void searchByPlatform(Platform platform);\n\n}",
"public interface PlatformRatingDao {\n boolean insert(Platform platform, float rating);\n\n boolean update(Platform platfor... | import com.tassioauad.gamecheck.model.api.GameApi;
import com.tassioauad.gamecheck.model.database.PlatformRatingDao;
import com.tassioauad.gamecheck.presenter.PlatformPresenter;
import com.tassioauad.gamecheck.view.PlatformView;
import com.tassioauad.gamecheck.view.activity.PlatformActivity;
import dagger.Module;
impor... | package com.tassioauad.gamecheck.dagger;
@Module(library = true, injects = PlatformActivity.class, includes = {AppModule.class, ApiModule.class, DaoModule.class})
public class PlatformViewModule {
private PlatformView view;
public PlatformViewModule(PlatformView view) {
this.view = view;
}
... | public PlatformPresenter providePlatformPresenter(GameApi gameApi, PlatformRatingDao platformRatingDao) { | 1 |
Nilhcem/droidconde-2016 | app/src/main/java/com/nilhcem/droidconde/data/database/dao/SessionsDao.java | [
"@Singleton\npublic class LocalDateTimeAdapter {\n\n private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\", Locale.US);\n\n @Inject\n public LocalDateTimeAdapter() {\n }\n\n @ToJson\n public String toText(LocalDateTime dateTime) {\n return dateTime.for... | import android.database.Cursor;
import com.nilhcem.droidconde.core.moshi.LocalDateTimeAdapter;
import com.nilhcem.droidconde.data.app.SelectedSessionsMemory;
import com.nilhcem.droidconde.data.database.DbMapper;
import com.nilhcem.droidconde.data.database.model.SelectedSession;
import com.nilhcem.droidconde.data.databa... | package com.nilhcem.droidconde.data.database.dao;
@Singleton
public class SessionsDao {
private final BriteDatabase database;
private final DbMapper dbMapper;
private final SpeakersDao speakersDao;
private final LocalDateTimeAdapter adapter;
private final SelectedSessionsMemory selectedSessi... | public Observable<List<com.nilhcem.droidconde.data.app.model.Session>> getSessions() { | 4 |
edouardhue/comeon | src/main/java/comeon/core/MediaUploadBatch.java | [
"public interface ExternalMetadataSource<T> {\n void loadMetadata() throws IOException, DuplicateKeyException;\n\n T getMediaMetadata(Media media, Map<String, Object> mediaMetadata);\n}",
"public final class AudioReader extends AbstractMediaReader {\n\n private static final Logger LOGGER = LoggerFactory.... | import comeon.core.extmetadata.ExternalMetadataSource;
import comeon.core.mediareaders.AudioReader;
import comeon.core.mediareaders.MediaReader;
import comeon.core.mediareaders.PictureReader;
import comeon.model.Media;
import comeon.model.Template;
import comeon.model.User;
import comeon.model.processors.PreProcessor;
... | package comeon.core;
public final class MediaUploadBatch {
private final File[] files;
private final Template template;
private final Set<Media> media;
private final Set<PreProcessor> preProcessors;
private final ExternalMetadataSource<?> externalMetadataSource;
public MediaUploadBatch(... | return new AudioReader(file, user); | 1 |
fiware-cybercaptor/cybercaptor-server | src/main/java/org/fiware/cybercaptor/server/rest/RestAPIAttackPaths.java | [
"public class AttackPathManagement {\n\n /**\n * Extract\n *\n * @param attackGraph the attack graph\n * @return the scores extracted from the attack graph in the information system\n */\n public static List<AttackPath> scoreAttackPaths(AttackGraph attackGraph, double previousMaxScore) {\n... | import org.fiware.cybercaptor.server.api.AttackPathManagement;
import org.fiware.cybercaptor.server.api.InformationSystemManagement;
import org.fiware.cybercaptor.server.attackgraph.AttackGraph;
import org.fiware.cybercaptor.server.attackgraph.AttackPath;
import org.fiware.cybercaptor.server.attackgraph.MulvalAttackGra... | /****************************************************************************************
* This file is part of FIWARE CyberCAPTOR, *
* instance of FIWARE Cyber Security Generic Enabler *
* Copyright (C) 2012-2015 Thales Services S.A.S.... | List<AttackPath> attackPaths = AttackPathManagement.scoreAttackPaths(attackGraph, attackGraph.getNumberOfVertices()); | 3 |
bzim/graphml-writer | src/main/java/de/graphml/writer/yed/graphics/AbstractBaseLabel.java | [
"public interface ElementWriter {\n\n\tvoid startData(Key key);\n\n\tvoid startElement(String localName);\n\n\tvoid startElement(String namespaceURI, String localName);\n\n\tvoid writeAttribute(String localName, String value);\n\n\tvoid writeAttribute(String localName, Boolean value);\n\n\tvoid writeAttribute(Strin... | import de.graphml.writer.model.ElementWriter;
import de.graphml.writer.yed.style.Alignment;
import de.graphml.writer.yed.style.AutoSizePolicy;
import de.graphml.writer.yed.style.FontStyle;
import de.graphml.writer.yed.style.ModelName;
import de.graphml.writer.yed.style.ModelPosition; | /*
* 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 n... | public AutoSizePolicy autoSizePolicy = AutoSizePolicy.CONTENT; | 2 |
kaklakariada/fritzbox-java-api | src/main/java/com/github/kaklakariada/fritzbox/TestDriver.java | [
"public enum EnergyStatsTimeRange {\n TEN_MINUTES(\"EnergyStats_10\"), //\n ONE_HOUR(\"EnergyStats_hour\"), //\n ONE_DAY(\"EnergyStats_24h\"), //\n ONE_WEEK(\"EnergyStats_week\"), //\n ONE_MONTH(\"EnergyStats_month\"), //\n ONE_YEAR(\"EnergyStats_year\");\n\n private final String command;\n\n ... | import com.github.kaklakariada.fritzbox.model.homeautomation.Device;
import com.github.kaklakariada.fritzbox.model.homeautomation.DeviceList;
import com.github.kaklakariada.fritzbox.model.homeautomation.MeasurementUnit;
import com.github.kaklakariada.fritzbox.model.homeautomation.PowerMeter;
import com.github.kaklakari... | /**
* A Java API for managing FritzBox HomeAutomation
* Copyright (C) 2017 Christoph Pirkl <christoph at users.sourceforge.net>
*
* 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 ver... | Optional<Statistics> dailyEnergy = energy.get().getStatisticsByGrid(86400); | 6 |
teivah/TIBreview | src/main/java/com/tibco/exchange/tibreview/processor/processrule/ElseifProcessor.java | [
"public class TIBProcess {\n\tprivate String filePath;\n\tprivate String fullProcessName;\n\tprivate String processName;\n\tprivate String packageName;\n\tprivate List<PartnerLinkModel> partners;\n\tprivate static final String PROCESSES_PACKAGE = \"Processes\";\n\tprivate static final String PROCESS_EXTENSION = \".... | import java.util.List;
import com.tibco.exchange.tibreview.common.TIBProcess;
import com.tibco.exchange.tibreview.engine.Context;
import com.tibco.exchange.tibreview.exception.ProcessorException;
import com.tibco.exchange.tibreview.model.pmd.Violation;
import com.tibco.exchange.tibreview.model.rules.Elseif;
import com.... | package com.tibco.exchange.tibreview.processor.processrule;
public final class ElseifProcessor implements PRProcessable, PRConditionProcessable {
@Override
public List<Violation> process(Context context, TIBProcess process, Rule rule, Object impl) throws ProcessorException { | Elseif el = (Elseif) impl; | 4 |
engagingspaces/vertx-graphql-service-discovery | graphql-service-publisher/src/test/java/io/engagingspaces/graphql/servicediscovery/service/GraphQLServiceTest.java | [
"@DataObject\npublic class QueryResult {\n\n private final JsonObject data;\n private final boolean succeeded;\n private final List<QueryError> errors;\n\n private volatile int hashCode;\n\n public QueryResult(JsonObject data, boolean succeeded, List<QueryError> errors) {\n this.data = data;\n... | import io.engagingspaces.graphql.query.QueryResult;
import io.engagingspaces.graphql.query.Queryable;
import io.engagingspaces.graphql.schema.SchemaMetadata;
import io.engagingspaces.graphql.servicediscovery.publisher.SchemaRegistration;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonArray;
import io.vertx.c... | /*
* Copyright (c) 2016 The original author or authors
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
*... | QueryResult queryResult = queryResultHandler.result(); | 0 |
Cue/hegemon | hegemon-testing/src/main/java/com/cueup/hegemon/testing/HegemonRunner.java | [
"public class LoadError extends Exception {\n /**\n * Basic constructor.\n */\n public LoadError() {\n super();\n }\n\n\n /**\n * Creates a LoadError which wraps a lower level Throwable.\n * @param cause the Throwable to wrap.\n */\n public LoadError(Throwable cause) {\n super(cause);\n }\n\n\... | import com.cueup.hegemon.LoadError;
import com.cueup.hegemon.LoadPath;
import com.cueup.hegemon.LoadPaths;
import com.cueup.hegemon.Script;
import com.cueup.hegemon.compilation.CachedScriptCompilation;
import com.cueup.hegemon.compilation.ClassFileScriptCompilation;
import com.cueup.hegemon.compilation.ScriptCompilatio... | /*
* Copyright 2012 the hegemon authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | public static final ScriptCompilation SCRIPT_COMPILATION = new CachedScriptCompilation( | 4 |
nkarasch/ChessGDX | core/src/nkarasch/chessgdx/gui/settings/GraphicsSettingsTable.java | [
"public class GameCore implements ApplicationListener {\n\n\tpublic static final String TITLE = \"ChessGDX\";\n\n\tprivate Camera mCameraController;\n\tprivate ChessLogicController mLogicController;\n\tprivate BoardController mBoardController;\n\tprivate PerspectiveRenderer mPerspectiveRenderer;\n\tprivate OverlayR... | import nkarasch.chessgdx.GameCore;
import nkarasch.chessgdx.gui.MenuSkin;
import nkarasch.chessgdx.util.GraphicsSettings;
import nkarasch.chessgdx.util.GraphicsSettings.CustomDisplayMode;
import nkarasch.chessgdx.util.PreferenceStrings;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Preferences;
import com.badlog... | package nkarasch.chessgdx.gui.settings;
class GraphicsSettingsTable extends Table {
/**
* Options dialog to let the user choose their display resolution, whether
* to run in fullscreen/windowed mode, and whether to enable vsync.
*
* @param skin
*/
GraphicsSettingsTable(Skin skin) {
GraphicsSettings ... | final SelectBox<CustomDisplayMode> sbResolution = new SelectBox<CustomDisplayMode>(skin); | 3 |
mreutegg/laszip4j | src/main/java/com/github/mreutegg/laszip4j/laszip/LASreadItemCompressed_POINT10_v2.java | [
"public static byte[] memcpy(byte[] dest, byte[] src, int num) {\n System.arraycopy(src, 0, dest, 0, num);\n return dest;\n}",
"static final byte[][] number_return_level =\n{\n { 0, 1, 2, 3, 4, 5, 6, 7 },\n { 1, 0, 1, 2, 3, 4, 5, 6 },\n { 2, 1, 0, 1, 2, 3, 4, 5 },\n { 3,... | import java.nio.ByteBuffer;
import static com.github.mreutegg.laszip4j.clib.Cstring.memcpy;
import static com.github.mreutegg.laszip4j.laszip.Common_v2.number_return_level;
import static com.github.mreutegg.laszip4j.laszip.Common_v2.number_return_map;
import static com.github.mreutegg.laszip4j.laszip.MyDefs.U32_ZERO_BI... | /*
* Copyright 2007-2012, martin isenburg, rapidlasso - fast tools to catch reality
*
* This is free software; you can redistribute and/or modify it under the
* terms of the GNU Lesser General Licence as published by the Free Software
* Foundation. See the LICENSE.txt file for more information.
*
* This software... | m = number_return_map[n][r]; | 2 |
aw20/MongoWorkBench | src/org/aw20/mongoworkbench/eclipse/view/MCommandConsole.java | [
"public enum Event {\n\n\tDOCUMENT_VIEW,\n\tELEMENT_VIEW,\n\t\n\tWRITERESULT,\n\t\n\tEXCEPTION, \n\t\n\tTOWIZARD\n\t\n}",
"public class EventWorkBenchManager extends Object {\n\tprivate static EventWorkBenchManager thisInst;\n\t\n\tpublic static synchronized EventWorkBenchManager getInst(){\n\t\tif ( thisInst == ... | import org.aw20.mongoworkbench.Event;
import org.aw20.mongoworkbench.EventWorkBenchManager;
import org.aw20.mongoworkbench.MongoFactory;
import org.aw20.mongoworkbench.command.MongoCommand;
import org.aw20.mongoworkbench.eclipse.Activator;
import org.aw20.mongoworkbench.eclipse.dialog.TextInputPopup;
import org.aw20.mo... | /*
* MongoWorkBench is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Free Software Foundation,version 3.
*
* MongoWorkBench is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implie... | MongoCommand cmd = MongoFactory.getInst().createCommand(cmdText); | 2 |
lacuna/bifurcan | src/io/lacuna/bifurcan/DurableInput.java | [
"public class BlockPrefix {\n\n public enum BlockType {\n // root (2 bits)\n PRIMITIVE,\n TABLE,\n DIFF, // continuation\n COLLECTION, // continuation\n\n // 3 bits preceded by COLLECTION\n HASH_MAP,\n SORTED_MAP,\n HASH_SET,\n SORTED_SET,\n LIST,\n COLLECTION_PLACEHOLDER_... | import io.lacuna.bifurcan.durable.BlockPrefix;
import io.lacuna.bifurcan.durable.Bytes;
import io.lacuna.bifurcan.durable.Util;
import io.lacuna.bifurcan.durable.io.ConcatInput;
import io.lacuna.bifurcan.utils.Iterators;
import java.io.Closeable;
import java.io.DataInput;
import java.io.EOFException;
import java.io.Inp... | package io.lacuna.bifurcan;
/**
* A cross between {@link DataInput} and {@link ByteBuffer}. Provides utility methods for writing Bifurcan-specific
* values such as {@link #readVLQ} and {@link #readUVLQ()}, as well as ways to slice out delimited blocks via
* {@link #sliceBlock(BlockPrefix.BlockType)} et al.
* <p... | ? new ConcatInput( | 3 |
ngageoint/disconnected-content-explorer-android | app/src/main/java/mil/nga/dice/map/OverlaysActivity.java | [
"public class DICEConstants {\n\n public static final String DICE_REPORT_DIRECTORY = \"DICE\";\n public static final String DICE_REPORT_NOTES_DIRECTORY = \"notes\";\n public static final String DICE_NO_MEDIA_FILE = \".nomedia\";\n public static final String DICE_REPORT_SHARED_DIRECTORY = \"shared\";\n ... | import android.Manifest;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.app... | package mil.nga.dice.map;
/**
* View, enabled, disable, and delete map tile and feature overlays
*/
public class OverlaysActivity extends AppCompatActivity {
/**
* Permission request read external storage id
*/
private static final int PERMISSIONS_REQUEST_READ_EXTERNAL_STORAGE = 100;
/**
... | Map<String, GeoPackageTableMapData> tileMapOverlays = new HashMap<>(); | 3 |
xpush/lib-xpush-android | lib/src/main/java/io/xpush/chat/services/XPushService.java | [
"public class XPushCore {\n\n private static final int NETWORK_WIFI = 1;\n private static final int NETWORK_MOBILE = 2;\n private static final int NETWORK_NOT_AVAILABLE = 0;\n\n private static XPushSession mXpushSession;\n\n private static final String TAG = XPushCore.class.getSimpleName();\n\n pu... | import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import androi... | package io.xpush.chat.services;
public class XPushService extends Service {
private static final String TAG = XPushService.class.getSimpleName();
private static final String XPUSH_THREAD_NAME = "XPushService[" + TAG + "]"; // Handler Thread ID
private static final int XPUSH_KEEP_ALIVE = 1000 * 5 * 6... | if( XPushCore.getXpushSession() == null) { | 0 |
aqfaridi/Code-Online-Judge | src/java/submitaction.java | [
"public class Ranking implements Serializable {\n \n String userid;\n String contestid;\n \n double Ascore;\n long Atime;\n int Apanalty;\n \n double Bscore;\n long Btime;\n int Bpanalty;\n \n double Cscore;\n long Ctime;\n int Cpanalty;\n \n double Dscore;\n lo... | import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import pojo.Ranking;
import pojo.Submissions;
import java.util.Date;
import pojo.Problems;
im... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author faridi
*/
public class submitaction extends HttpServlet {
HttpSession session=null;
/**
* Processes r... | Q queue = new Q(codefilename, username, language, ext, problempath , "unjudge",Double.parseDouble(now.getTimelimit()) ,"null", tmp, 0, 0,contestcode , 0 ,problemcode,now.getTestfiles()); | 3 |
abel533/DBMetadata | DBMetadata-swing/src/main/java/com/github/abel533/service/ToolsService.java | [
"public class DBData {\n private static DBServer dbServer;\n private static DBMetadataUtils dbMetadataUtils;\n private static SimpleDataSource dataSource;\n //登录系统的时候操作下面两项\n public static DBServerList dbServerList;\n public static List<String> dbServers;\n\n //选择配置后\n public static Database... | import com.github.abel533.component.DBData;
import com.github.abel533.database.IntrospectedColumn;
import com.github.abel533.database.IntrospectedTable;
import com.github.abel533.database.MatchType;
import com.github.abel533.utils.I18n;
import com.github.abel533.utils.StringUtils;
import javax.swing.*;
import javax.swi... | package com.github.abel533.service;
@SuppressWarnings("serial")
public class ToolsService {
private List<IntrospectedTable> EMPTY = new ArrayList<IntrospectedTable>(0);
private Object[][] EMPTY_DATA = new Object[][]{};
private String[] tableNames = I18n.key("dbTableModel.columns").split(",");
priv... | loadColumns(DBData.getTableColumns(tableName), true); | 0 |
Nescafemix/hintcase | app/src/main/java/com/joanfuentes/hintcaseexample/TargetHintActivity.java | [
"public class HintCase {\n public static final int DEFAULT_SHAPE_OFFSET_IN_DP = 10;\n public static final int NO_OFFSET_IN_PX = 0;\n public static final int BACKGROUND_COLOR_TRANSPARENT = 0x00000000;\n public static final int HINT_BLOCK_POSITION_LEFT = 0;\n public static final int HINT_BLOCK_POSITION... | import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.... | package com.joanfuentes.hintcaseexample;
public class TargetHintActivity extends AppCompatActivity {
public Activity getActivity() {
return this;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.acti... | new UnrevealCircleShapeAnimator()) | 5 |
domax/gwt-dynamic-plugins | gwt-dynamic-main/gwt-dynamic-module-bar/src/main/java/org/gwt/phys2d/client/gameplay/sprites/Polygon.java | [
"public class VectorTools {\n\t\n\t/**\n\t * A maximal difference between double values to consider them as equal.\n\t */\n\tpublic static final double EPSILON = 1.0E-7;\n\tpublic static final PrintableVector2 P_ONE = PrintableVector2.valueOf(Vector2.ONE);\n\tpublic static final PrintableVector2 P_UNIT_X = Printabl... | import org.gwt.phys2d.client.utils.Utils;
import static org.gwt.phys2d.client.utils.VectorTools.*;
import gwt.g2d.client.math.Circle;
import gwt.g2d.client.math.Vector2;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.gwt.... | if (edges == null)
edges = NO_EDGES;
}
private void buildBestFitCircle() {
// 0. The cases with 0, 1, 2 or 3 vertices are very simple, let's process them.
if (vertices.size() < 2)
bestFitCircle = NO_CIRCLE;
else if (vertices.size() == 2)
bestFitCircle = new PrintableCircle(vertices.get(0), vertices... | builder.append(Utils.getSimpleName(getClass())); | 6 |
DorsetProject/dorset-framework | core/src/main/java/edu/jhuapl/dorset/agents/RemoteAgent.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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import edu.jhuapl.dorset.Response;
import edu.jhuapl.dorset.ResponseStatus;
import edu.jhuapl.dorset.http.ContentType;
import edu.jhuapl.dorset.http.HttpC... | /*
* Copyright 2016-2017 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.o... | HttpRequest httpRequest = new HttpRequest(HttpMethod.POST, requestUrl).setBody(json, | 5 |
k0shk0sh/FastAccess | app/src/main/java/com/fastaccess/ui/modules/settings/dialogs/IconSizeTransparencyDialog.java | [
"public class Bundler {\n\n private Bundle bundle;\n\n private Bundler() {\n bundle = new Bundle();\n }\n\n public static Bundler start() {\n return new Bundler();\n }\n\n public Bundler put(@NonNull String key, boolean value) {\n bundle.putBoolean(key, value);\n return... | import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import com.fastaccess.R;
import com.fastaccess.helper.Bundler;
import com.fastaccess.helper.Pref... | package com.fastaccess.ui.modules.settings.dialogs;
/**
* Created by Kosh on 16 Oct 2016, 6:46 PM
*/
public class IconSizeTransparencyDialog extends BaseBottomSheetDialog implements DiscreteSeekBar.OnProgressChangeListener {
@BindView(R.id.done) ForegroundImageView done;
@BindView(R.id.valueText) FontT... | int height = ViewHelper.toPx(getContext(), value); | 1 |
ra4king/LWJGL-OpenGL-Tutorials | src/com/ra4king/opengl/arcsynthesis/gl33/chapter6/example4/Example6_4.java | [
"public abstract class GLProgram {\r\n\tprivate int fps;\r\n\t\r\n\t/**\r\n\t * Initializes the application in fullscreen mode.\r\n\t * \r\n\t * @param vsync Enables/disables the vertical-sync feature, where the rendering is in sync with the monitor's refresh rate.\r\n\t * With v-sync off, there is no framer... | import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL20.*;
import static org.lwjgl.opengl.GL30.*;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
import org.lwjgl.BufferUtils;
import org.lwjgl.input.Keyboard;
import com.ra4king.opengl.GLProgram... | 22, 23, 20
};
private ShaderProgram program;
private Hierarchy hierarchy;
private int modelToCameraMatrixUniform;
private Matrix4 cameraToClipMatrix;
private int cameraToClipMatrixUniform;
private int vao;
public Example6_4() {
super("Example 6.4 - Hierarchy", 500, 500, true);
}
... | private Vector3 posBase;
| 5 |
cornelcreanga/bitbucket-rest-client | src/main/java/com/ccreanga/bitbucket/rest/client/ProjectClient.java | [
"public class PullRequest implements Serializable {\n\n private long id;\n private long version;\n @Nonnull\n private String title;\n private String description;\n @Nonnull\n private PullRequestState state;\n private boolean open;\n private boolean closed;\n @Nonnull\n private Date... | import com.ccreanga.bitbucket.rest.client.model.*;
import com.ccreanga.bitbucket.rest.client.model.pull.PullRequest;
import com.ccreanga.bitbucket.rest.client.model.pull.PullRequestRole;
import com.ccreanga.bitbucket.rest.client.model.pull.activity.PullRequestActivity;
import com.ccreanga.bitbucket.rest.client.model.pu... | /*
*
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writ... | Page<PullRequestActivity> getPullRequestsActivities(@Nonnull String projectKey, @Nonnull String repositorySlug, @Nonnull Long pullRequestId, @Nonnull Range range); | 2 |
TooTallNate/Java-WebSocket | src/test/java/org/java_websocket/issues/Issue256Test.java | [
"public interface WebSocket {\n\n /**\n * sends the closing handshake. may be send in response to an other handshake.\n *\n * @param code the closing code\n * @param message the closing message\n */\n void close(int code, String message);\n\n /**\n * sends the closing handshake. may be send in res... | import static org.hamcrest.core.Is.is;
import static org.junit.Assume.assumeThat;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import org.java_websocket.WebS... | /*
* Copyright (c) 2010-2020 Nathan Rajlich
*
* 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... | public ThreadCheck zombies = new ThreadCheck(); | 5 |
all4you/redant | redant-core/src/main/java/com/redant/core/controller/ProxyInvocation.java | [
"public class InvocationException extends Exception{\n\tprivate static final long serialVersionUID = 1L;\n\n public InvocationException(String message, Throwable cause) {\n super(message, cause);\n }\n\n}",
"public class ValidationException extends RuntimeException{\n\tprivate static final long seria... | import com.redant.core.common.exception.InvocationException;
import com.redant.core.common.exception.ValidationException;
import com.redant.core.common.util.GenericsUtil;
import com.redant.core.common.util.HttpRequestUtil;
import com.redant.core.context.RedantContext;
import com.redant.core.converter.PrimitiveConverter... | package com.redant.core.controller;
/**
* 封装了ControllerProxy的调用过程
* @author houyi.wh
* @date 2017-10-20
*/
public class ProxyInvocation {
private static Invocation invocation = new Invocation();
public static Object invoke(ControllerProxy proxy) throws Exception{
Object controller = proxy.getController()... | GenericsUtil.checkNull(param.key(), parameter); | 2 |
deepakpk009/JScreenRecorder | src/com/deepak/jscreenrecorder/gui/WatermarkSelector.java | [
"public class TextWatermarkCreator {\n\n // the text watermark image object\n private BufferedImage textWatermarkImage = null;\n // the watermark display panel refernce\n private WatermarkDisplayPanel watermarkDisplayPanel = null;\n\n // the constructor with watermark display panel as the parameter\n... | import com.deepak.jscreenrecorder.core.TextWatermarkCreator;
import com.deepak.jscreenrecorder.core.config.RecordConfig;
import com.deepak.jscreenrecorder.core.constants.Directory;
import com.deepak.jscreenrecorder.core.constants.Extension;
import com.deepak.jscreenrecorder.core.filters.ImageFileNameFilter;
import com.... | // select a location for the watermark
if (useWatermarkCheckBox.isSelected() && recConfig.getWatermarkLocation() == null) {
JOptionPane.showMessageDialog(rootPane, "Watermark Location Not Set!\nPlease select the Watermark location.", "Insufficient Configuration", JOptionPane.WARNING_MESSAGE)... | new TextWatermarkCreator(watermarkDisplayPanel).createWatermark(); | 0 |
soluvas/sanad | cli/src/main/java/org/soluvas/sanad/cli/islamware/ImportHadithDatabase.java | [
"@Configuration\n@EnableTransactionManagement\n@Import({JpaConfig.class, CommonsWebConfig.class, MultiTenantConfig.class})\npublic class SanadConfig {\n\n\t@Configuration\n\tpublic static class SqlConfig {\n\t\t\n\t\tpublic static final String POSTGRESQL_DRIVER = \"org.postgresql.Driver\";\n\t\tprivate static final... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Optional;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.transaction.... | package org.soluvas.sanad.cli.islamware;
/**
* Imports <a href="https://www.islamware.com/app/downloads">IslamWare.com</a> hadith data using CP1256 character encoding.
*
* <p>Importing takes ~2 minutes on SATA i5.
*
* <p>To reset all hadith: (~23 minutes on SATA i5)
* (<a href="http://www.postgresql.org/d... | HadithCollection coll = new HadithCollection(); | 4 |
FlareBot/FlareBot | src/main/java/stream/flarebot/flarebot/util/MigrationHandler.java | [
"public class FlareBot {\n\n public static final Logger LOGGER;\n public static final Gson GSON = new GsonBuilder().create();\n private static final AtomicBoolean RUNNING = new AtomicBoolean(false);\n public static final AtomicBoolean EXITING = new AtomicBoolean(false);\n public static final AtomicBo... | import net.dv8tion.jda.core.entities.Guild;
import stream.flarebot.flarebot.FlareBot;
import stream.flarebot.flarebot.FlareBotManager;
import stream.flarebot.flarebot.Getters;
import stream.flarebot.flarebot.objects.GuildWrapper;
import stream.flarebot.flarebot.permissions.Group;
import java.util.Iterator;
import java.... | package stream.flarebot.flarebot.util;
/**
* For the 100 times we make breaking changes and need to do migration.
* //TODO: Make this async but without causing any possible issues to loaded guilds.
*/
public class MigrationHandler {
public int migratePermissionsForGuild(String[] oldPermissions, String[] newP... | GuildWrapper wrapper = null; | 3 |
instaclick/PDI-Plugin-Step-AMQP | src/main/java/com/instaclick/pentaho/plugin/amqp/processor/ProcessorFactory.java | [
"public class ProducerDeclareInitializer implements Initializer\n{\n public static final ProducerDeclareInitializer INSTANCE = new ProducerDeclareInitializer();\n\n @Override\n public void initialize(final Channel channel, final AMQPPlugin plugin, final AMQPPluginData data) throws IOException\n {\n ... | import com.instaclick.pentaho.plugin.amqp.initializer.ProducerDeclareInitializer;
import com.instaclick.pentaho.plugin.amqp.initializer.Initializer;
import com.instaclick.pentaho.plugin.amqp.initializer.ConsumerDeclareInitializer;
import com.instaclick.pentaho.plugin.amqp.initializer.ActiveConvirmationInitializer;
impo... | package com.instaclick.pentaho.plugin.amqp.processor;
public class ProcessorFactory
{
private final ConnectionFactory factory = new ConnectionFactory();
protected Connection connectionFor(final AMQPPluginData data) throws IOException, URISyntaxException, NoSuchAlgorithmException, KeyManagementException
{... | final List<Initializer> initializers = new ArrayList<Initializer>(); | 1 |
danfickle/cpp-to-java-source-converter | src/main/java/com/github/danfickle/cpptojavasourceconverter/SpecialGenerator.java | [
"static class CompositeInfo\n{\n\tCompositeInfo(CppClass tydArg)\n\t{\n\t\ttyd = tydArg;\n\t}\n\t\t\n\tCppClass tyd;\n\tIASTDeclSpecifier declSpecifier;\n\tString superClass;\n\tboolean hasCtor;\n\tboolean hasDtor;\n\tboolean hasCopy;\n\tboolean hasAssign;\n\tboolean hasSuper;\n}",
"static class FieldInfo\n{\n\tF... | import java.util.List;
import org.eclipse.cdt.core.dom.ast.*;
import com.github.danfickle.cpptojavasourceconverter.SourceConverter.CompositeInfo;
import com.github.danfickle.cpptojavasourceconverter.SourceConverter.FieldInfo;
import com.github.danfickle.cpptojavasourceconverter.TypeManager.TypeType;
import com.github.d... | package com.github.danfickle.cpptojavasourceconverter;
class SpecialGenerator
{
private final TranslationUnitContext ctx;
SpecialGenerator(TranslationUnitContext con)
{
ctx = con;
}
/**
* Given a list of fields for a class, adds initialization statements
* to the constructor for each field as require... | else if (TypeManager.isOneOf(fields.get(i).field.getType(), TypeEnum.OBJECT)) | 3 |
3pillarlabs/socialauth | socialauth/src/main/java/org/brickred/socialauth/provider/AmazonImpl.java | [
"public abstract class AbstractProvider implements AuthProvider, Serializable {\n\n\tprivate static final long serialVersionUID = -7827145708317886744L;\n\n\tprivate Map<Class<? extends Plugin>, Class<? extends Plugin>> pluginsMap;\n\n\tprivate final Log LOG = LogFactory.getLog(this.getClass());\n\n\tpublic Abstrac... | import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.brickred.socialauth.AbstractProvider;
import org.brickred.socialauth.Con... | /*
===========================================================================
Copyright (c) 2014 3PillarGlobal
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 ... | private Profile userProfile; | 2 |
encircled/Joiner | joiner-spring/src/test/java/cz/encircled/joiner/SpringRepositoryTest.java | [
"@Configuration\n@Import({EntityManagerConfig.class, JoinerConfiguration.class})\n@ComponentScan(basePackages = {\"cz.encircled.joiner\"})\npublic class SpringTestConfig {\n\n @Autowired\n private JoinGraphRegistry graphRegistry;\n\n @PostConstruct\n public void init() {\n graphRegistry.registerJ... | import cz.encircled.joiner.config.SpringTestConfig;
import cz.encircled.joiner.model.QGroup;
import cz.encircled.joiner.model.QStatus;
import cz.encircled.joiner.model.QUser;
import cz.encircled.joiner.model.User;
import cz.encircled.joiner.query.Q;
import cz.encircled.joiner.repository.UserRepository;
import cz.encirc... | package cz.encircled.joiner;
/**
* @author Vlad on 14-Aug-16.
*/
@ExtendWith(SpringExtension.class)
@SpringJUnitConfig(classes = {SpringTestConfig.class})
@Transactional
@EnableTransactionManagement
@TestExecutionListeners(listeners = {TestDataListener.class, DependencyInjectionTestExecutionListener.class, Transa... | PageableFeature feature = new PageableFeature(PageRequest.of(1, 2, Sort.by(Sort.Order.asc("name")))); | 4 |
ieg-vienna/EvalBench | src/evaluation/evalBench/panel/InsightTaskPanelStrategy.java | [
"public class EvaluationResources {\n\n\tprivate static final ResourceBundle resourceBundle = ResourceBundle\n\t\t\t.getBundle(EvaluationResources.class.getPackage().getName()\n\t\t\t\t\t+ \".evaluationGui\");\n\n\t/**\n\t * Prevent instantiation\n\t */\n\tprivate EvaluationResources() {\n\t}\n\n\t/**\n\t * Retriev... | import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Toolkit;
import javax.swing.ButtonGroup;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.sw... | insight.addCharacteristicsValue(characteristics[y], likertValue);
} else {
insight.addCharacteristicsValue(characteristics[y], null);
errors.append(", ");
errors.append(characteristics[y]);
}
}
if (task.isCh... | Task t = new Task("id", "desc", "com");
| 4 |
szegedi/dynalink | src/test/java/org/dynalang/dynalink/LinkerServicesFactory.java | [
"public interface GuardingDynamicLinker {\n /**\n * Creates a guarded invocation appropriate for a particular invocation with the specified arguments at a call site.\n *\n * @param linkRequest the object describing the request for linking a particular invocation\n * @param linkerServices linker s... | import java.util.LinkedList;
import org.dynalang.dynalink.linker.GuardingDynamicLinker;
import org.dynalang.dynalink.linker.GuardingTypeConverterFactory;
import org.dynalang.dynalink.linker.LinkerServices;
import org.dynalang.dynalink.support.LinkerServicesImpl;
import org.dynalang.dynalink.support.TypeConverterFactory... | /*
Copyright 2009-2013 Attila Szegedi
Licensed under both the Apache License, Version 2.0 (the "Apache License")
and the BSD License (the "BSD License"), with licensee being free to
choose either of the two at their discretion.
You may not use this file except in compliance with either the Apache
Li... | return new LinkerServicesImpl(new TypeConverterFactory(new LinkedList<GuardingTypeConverterFactory>(), null), linker, null); | 4 |
HubSpot/jackson-datatype-protobuf | src/main/java/com/hubspot/jackson/datatype/protobuf/builtin/deserializers/MessageDeserializer.java | [
"public class ExtensionRegistryWrapper {\n private final Function<Descriptor, Set<ExtensionInfo>> extensionFunction;\n\n private ExtensionRegistryWrapper() {\n this.extensionFunction = new Function<Descriptor, Set<ExtensionInfo>>() {\n\n @Override\n public Set<ExtensionInfo> apply(Descriptor descript... | import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
im... | package com.hubspot.jackson.datatype.protobuf.builtin.deserializers;
public class MessageDeserializer<T extends Message, V extends Builder> extends ProtobufDeserializer<T, V> {
@SuppressFBWarnings(value="SE_BAD_FIELD") | private final ProtobufJacksonConfig config; | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.