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
SecrecySupportTeam/Secrecy_fDroid_DEPRECIATED
app/src/main/java/com/doplgangr/secrecy/Premium/PremiumFragment.java
[ "public class Util {\n public static final DialogInterface.OnClickListener emptyClickListener = new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n }\n };\n\n public static void alert(final Context context,\n ...
import android.app.Activity; import android.app.AlertDialog; import android.content.Intent; import android.support.v4.app.Fragment; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.ProgressBar; import com.doplgangr.secrecy.R; import com.doplgangr.secrecy.Util; impor...
/* Copyright (c) 2012 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
private IabHelper mHelper;
1
TheCount/jhilbert
src/main/java/jhilbert/data/impl/StatementImpl.java
[ "public class ConstraintException extends DataException {\n\n\t/**\n\t * Constructs a new <code>ConstraintException</code> with the\n\t * specified detail message.\n\t *\n\t * @param message detail message.\n\t */\n\tpublic ConstraintException(final String message) {\n\t\tthis(message, null);\n\t}\n\n\t/**\n\t * Co...
import java.util.Set; import jhilbert.data.ConstraintException; import jhilbert.data.DVConstraints; import jhilbert.data.Statement; import jhilbert.data.Variable; import jhilbert.expressions.Anonymiser; import jhilbert.expressions.Expression; import jhilbert.expressions.ExpressionFactory; import org.apache.log4j.Logger...
/* JHilbert, a verifier for collaborative theorem proving Copyright © 2008, 2009, 2011 The JHilbert Authors See the AUTHORS file for the list of JHilbert authors. See the commit logs ("git log") for a list of individual contributions. This program is free software: you can redistribute it and/...
final Anonymiser anonymiser = ExpressionFactory.getInstance().createAnonymiser(allVars);
4
mikkeliamk/osa
src/fi/mamk/osa/ui/Gui.java
[ "public class FedoraBean {\n \n private static final Logger logger = Logger.getLogger(FedoraBean.class);\n public static final String DATASTREAM_DC = \"DC\";\n public static final String DATASTREAM_CAPTURE = \"CAPTURE\";\n public static final String DATASTREAM_CONTENT = \"CONTENT\";\n public stati...
import java.io.File; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Vector; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; ...
package fi.mamk.osa.ui; /** * Class that the wraps look & feel for a organization * */ public class Gui implements Serializable { private static final long serialVersionUID = -6157579742585725399L; private static final Logger logger = Logger.getLogger(Gui.class); // Form variables public...
if (el.getDatastream().equalsIgnoreCase(FedoraBean.DATASTREAM_CAPTURE)) {
0
lenis0012/LoginSecurity-2
src/test/java/com/lenis0012/bukkit/loginsecurity/test/ExampleListener.java
[ "public class LoginSecurity extends PluginHolder {\n private static final ExecutorService executorService = Executors.newCachedThreadPool();\n\n /**\n * Get the executor LoginSecurity uses for async processing.\n *\n * @return Executor service.\n */\n public static ExecutorService getExecut...
import com.lenis0012.bukkit.loginsecurity.LoginSecurity; import com.lenis0012.bukkit.loginsecurity.events.AuthActionEvent; import com.lenis0012.bukkit.loginsecurity.session.AuthAction; import com.lenis0012.bukkit.loginsecurity.session.AuthActionType; import com.lenis0012.bukkit.loginsecurity.session.AuthService; import...
package com.lenis0012.bukkit.loginsecurity.test; /** * An example listener using the LoginSecurity 2.1 API. * * This listeners makes it so whenever a player logs out using /logout. * It doesn't log out but instead deletes their password. * * Pretty useless, but it's just an example. */ public class ExampleList...
AuthAction deletePassword = new RemovePassAction(AuthService.PLUGIN, LoginSecurity.getInstance()); // Use your plugin instead
6
Project-Nyx/Nyx
src/main/java/org/projectnyx/network/ext/udp/UdpSessionHandler.java
[ "public class Nyx {\n /**\n * The singleton instance of Nyx\n */\n @Getter private static Nyx instance = null;\n\n /**\n * <p>The server's main thread</p>\n */\n @Getter private final Thread mainThread;\n /**\n * <p>The directory where JAR module files are loaded</p>\n * <p>Ca...
import java.net.InetSocketAddress; import java.nio.ByteBuffer; import lombok.Getter; import org.projectnyx.Nyx; import org.projectnyx.network.Client; import org.projectnyx.network.NetworkManager; import org.projectnyx.network.Protocol; import org.projectnyx.network.ext.PacketWithAddress; import org.projectnyx.network.e...
/* * Nyx - Server software for Minecraft: PE and more * Copyright © boredphoton 2016 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0...
public void onReceive(PacketWithAddress pk) {
4
ganeshkamathp/killingspree
core/src/com/sillygames/killingSpree/serverEntities/ServerPlayer.java
[ "public interface LivingCategory {\r\n\r\n public boolean kill();\r\n}\r", "public enum ActorType { ERROR, PLAYER, BLOB, ARROW, BULLET, FLY, FROG, BOMB };\r", "public class Utils {\r\n \r\n public static boolean wrapBody(Vector2 position) {\r\n boolean wrap = false;\r\n if (position.x > W...
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.math.Vector2; import com.sillygames.killingSpree.categories.LivingCategory; import com.sillygames.killingSpree.helpers.EntityUtils.ActorType; import com.sillygames.killingSpree.helpers.Utils; import com.sillygames.killingSpree.managers.WorldBodyUtils; import co...
package com.sillygames.killingSpree.serverEntities; public class ServerPlayer extends ServerEntity implements LivingCategory { public static final float WIDTH = 12; public static final float HEIGHT = 20; public static final float YOFFSET = 1f; private ControlsMessage currentControls; pri...
BodyType.DynamicBody);
4
PedroGomes/TPCw-benchmark
TPCW_DOCM_Implementation/src/org/uminho/gsd/benchmarks/TPCW_CassandraOM/database_executor/TPCWCassandraDatanucleusExecutorFactory.java
[ "public class BenchmarkExecutor {\n\n //Node id\n private BenchmarkNodeID nodeId;\n\n //Benchmark interfaces\n private AbstractWorkloadGeneratorFactory workloadInterface;\n private AbstractDatabaseExecutorFactory databaseInterface;\n\n /**\n * number of clients on each benchmarking node *\n ...
import org.uminho.gsd.benchmarks.benchmark.BenchmarkExecutor; import org.uminho.gsd.benchmarks.generic.helpers.NodeKeyGenerator; import org.uminho.gsd.benchmarks.helpers.TPM_counter; import org.uminho.gsd.benchmarks.interfaces.KeyGenerator; import org.uminho.gsd.benchmarks.interfaces.executor.AbstractDatabaseExecutorFa...
/* * ********************************************************************* * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. * 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...
keyGenerator = new NodeKeyGenerator(this.nodeID.getId());
1
HarryPotterSpells/HarryPotterSpells
src/com/hpspells/core/Listeners.java
[ "public class SpellPreCastEvent extends SpellEvent implements Cancellable {\n private static final HandlerList handlers = new HandlerList();\n\n private boolean cancelled = false;\n\n public SpellPreCastEvent(Spell spell, Player caster) {\n super(spell, caster);\n }\n\n /**\n * Gets the Ha...
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event...
package com.hpspells.core; public class Listeners implements Listener { private HPS HPS; private List<Material> buttonTypeList = new ArrayList<>(Arrays.asList( Material.ACACIA_BUTTON, Material.BIRCH_BUTTON, Material.DARK_OAK_BUTTON, Material.JUNGLE_BUTTON, Material.OAK_BUT...
PlayerSpellConfig psc = (PlayerSpellConfig) HPS.ConfigurationManager.getConfig(ConfigurationType.PLAYER_SPELL);
1
roybailey/research-graphql
research-graphql-server/src/main/java/me/roybailey/springboot/graphql/domain/manual/ManualGraphQLQuerySchema.java
[ "@JsonInclude(JsonInclude.Include.NON_NULL)\n@JsonPropertyOrder({\n \"id\",\n \"userId\",\n \"items\",\n \"status\"\n})\n@lombok.Builder\n@lombok.NoArgsConstructor\n@lombok.AllArgsConstructor\npublic class OrderDto {\n\n @JsonProperty(\"id\")\n private String id;\n /**\n * \n * (Require...
import graphql.schema.GraphQLArgument; import graphql.schema.GraphQLInputType; import graphql.schema.GraphQLObjectType; import me.roybailey.data.schema.OrderDto; import me.roybailey.data.schema.ProductDto; import me.roybailey.data.schema.UserDto; import me.roybailey.springboot.graphql.fetchers.*; import me.roybailey.sp...
package me.roybailey.springboot.graphql.domain.manual; @Configuration public class ManualGraphQLQuerySchema { @Autowired ProductAdaptor productAdaptor; @Autowired
OrderAdaptor orderAdaptor;
3
appcelerator/acs-android-sdk
examples/Demo/src/com/appcelerator/cloud/demo/PlaceView.java
[ "public class CCMeta {\n\tprivate JSONObject json;\n\tprivate String status;\n\tprivate int code;\n\tprivate String message;\n\tprivate String method;\n\n\t// Pagination info (optional)\n\tprivate CCPagination pagination;\n\n\tpublic String getStatus() {\n\t\treturn status;\n\t}\n\n\tpublic int getCode() {\n\t\tret...
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.app.Activity; import android.app.AlertDialog; import android.app.ProgressDialog; import andr...
package com.appcelerator.cloud.demo; public class PlaceView extends Activity { static final int LAUNCH_SIGNUP = 0; List<JSONObject> listOfCheckin = new ArrayList<JSONObject>(); JSONObject place; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstan...
} catch (ACSClientError e) {
4
lucas-dolsan/tcc-rpg
TCC/src/Telas/TelaConfigurarSom.java
[ "public class Client extends Thread {\n\n private Socket s;\n private ArrayList<AudioChannel> chs = new ArrayList<AudioChannel>();\n private MicThread st;\n\n public Client(String serverIp, int serverPort) throws UnknownHostException, IOException {\n s = new Socket(serverIp, serverPort);\n }\n...
import ClienteVoIP.Client; import ClienteVoIP.MicThread; import ConexaoBanco.DAO; import Dependencias.SoundPacket; import Dependencias.Utils; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioSystem; import javax.sound.sampled.DataLine; import javax.sound.sampled.TargetDataLine; import javax.swing...
package Telas; public class TelaConfigurarSom extends javax.swing.JFrame { DAO dao = new DAO(); private MicTester micTester; private class MicTester extends Thread { private TargetDataLine mic = null; public MicTester() { } @Override public void run() { ...
new Client(dao.pegarIPDono(DAO.salaAtual.getNome_sala()), TelaJogo.painel.port).start();
0
DevLeoko/AdvancedBan
core/src/main/java/me/leoko/advancedban/utils/commands/RevokeProcessor.java
[ "public class Universal {\n\n private static Universal instance = null;\n\n public static void setRedis(boolean redis) {\n Universal.redis = redis;\n }\n\n private final Map<String, String> ips = new HashMap<>();\n private MethodInterface mi;\n private LogManager logManager;\n\n private ...
import me.leoko.advancedban.Universal; import me.leoko.advancedban.manager.MessageManager; import me.leoko.advancedban.utils.Command; import me.leoko.advancedban.utils.Punishment; import me.leoko.advancedban.utils.PunishmentType; import java.util.function.Consumer; import static me.leoko.advancedban.utils.CommandUtils....
package me.leoko.advancedban.utils.commands; public class RevokeProcessor implements Consumer<Command.CommandInput> { private PunishmentType type; public RevokeProcessor(PunishmentType type) { this.type = type; } @Override public void accept(Command.CommandInput input) { String...
Punishment punishment = getPunishment(target, type);
3
jVoid/jVoid
src/test/java/io/jvoid/test/instrumentation/provider/ProviderCatalogTest.java
[ "@Singleton\npublic class ProviderCatalog {\n\n private List<InstrumentationProvider> registeredProviders = new ArrayList<>();\n\n // This is still \"hardcoded\" providers. Make it discover the providers in\n // the classpath automatically\n @Inject\n public void initializeProviders(AppInstrumentatio...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.junit.After; import org.junit.Before; import org.junit.Test; import io.jvoid.instrumentation.provider.ProviderCatalog; import io.jvoid.instr...
package io.jvoid.test.instrumentation.provider; public class ProviderCatalogTest extends AbstractJVoidTest { private CtClass ctTestClass1, ctTestClass2; private ProviderCatalog providerCatalog; @Override @Before public void setUp() throws NotFoundException { ctTestClass1 = classPool....
public List<MethodInstrumenter> getMethodInstrumenters(CtMethod ctMethod) {
3
ground-context/ground
modules/postgres/app/edu/berkeley/ground/postgres/dao/version/PostgresTagDao.java
[ "public interface TagDao {\n\n List<Long> getVersionIdsByTag(String tag) throws GroundException;\n\n List<Long> getItemIdsByTag(String tag) throws GroundException;\n\n Map<String, Tag> retrieveFromDatabaseByVersionId(long id) throws GroundException;\n\n Map<String, Tag> retrieveFromDatabaseByItemId(long id) thr...
import edu.berkeley.ground.common.dao.version.TagDao; import edu.berkeley.ground.common.exception.GroundException; import edu.berkeley.ground.common.exception.GroundException.ExceptionType; import edu.berkeley.ground.common.model.version.GroundType; import edu.berkeley.ground.common.model.version.Tag; import edu.berkel...
/** * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * <p> * <p>http://www.apache.org/licenses/LICENSE-2.0 * <p> * <p>Unless required by applicable law or agreed to in writing, software dist...
public PostgresStatements insertItemTag(final Tag tag) {
4
6thsolution/ApexNLP
persian-nlp/src/main/java/com/sixthsolution/apex/nlp/persian/PersianParser.java
[ "public class Dictionary extends HashMap<String, Tags> {\n private static final Tags NONE_TAG;\n\n static {\n NONE_TAG = new Tags();\n NONE_TAG.add(new TagValue(Tag.NONE, \"\", Entity.NONE));\n }\n\n public void addAll(String[] words, Tag tag, Object value, Entity entity) {\n TagVal...
import com.sixthsolution.apex.nlp.dict.Dictionary; import com.sixthsolution.apex.nlp.dict.DictionaryBuilder; import com.sixthsolution.apex.nlp.event.EventDetector; import com.sixthsolution.apex.nlp.event.StandardEventDetector; import com.sixthsolution.apex.nlp.ner.Chunker; import com.sixthsolution.apex.nlp.ner.regex.Re...
package com.sixthsolution.apex.nlp.persian; /** * @author Rozhin Bayati */ public class PersianParser extends StandardParserBase { protected Dictionary provideDictionary() {
DictionaryBuilder vb = new DictionaryBuilder();
1
popo1379/popomusic
app/src/main/java/com/popomusic/videofragment/MengchongFragment.java
[ "public class VideoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\n private List<ItemList> datas;\n static final int TYPE_ITEM = 0;\n static final int TYPE_FOOTER = 1;\n private boolean showFoot = false;\n\n public VideoAdapter(List<ItemList> lists){\n this.datas=lists;\n }...
import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutMana...
package com.popomusic.videofragment; /** * Created by popo on 2017/6/20 0020. */ public class MengchongFragment extends Fragment implements VideoData.View,SwipeRefreshLayout.OnRefreshListener { RecyclerView listView; VideoAdapter videoadapter; VideoPresenter mPresent; SwipeRefreshLayout srfLayout;...
LogUtils.d("VideoPagerFragment", "数据测试" + list.get(0).data.playUrl);
3
kefik/MsPacMan-vs-Ghosts-AI
PacMan-vs-Ghosts/src/game/core/Replay.java
[ "public static class GameConfig {\n\t\t\n\tpublic int seed = -1;\n\t\t\n\t/**\n\t * Whether POWER PILLS should be present within the environment.\n\t */\n\tpublic boolean powerPillsEnabled = true;\n\t\t\n\t/**\n\t * Total percentage of PILLS present within the level. If < 1, some (random) pills will be taken away.\...
import game.PacManSimulator.GameConfig; import game.controllers.Direction; import game.controllers.ghosts.GhostsActions; import game.controllers.ghosts.IGhostsController; import game.controllers.pacman.IPacManController; import game.controllers.pacman.PacManAction; import java.io.BufferedReader; import java.io.File; im...
package game.core; @SuppressWarnings({"rawtypes","unchecked"}) public class Replay {
public GameConfig gameConfig = new GameConfig();
0
ModelSolv/Kaboom
src/main/java/com/modelsolv/kaboom/model/resource/nativeImpl/ReferenceLinkImpl.java
[ "public interface CDMProperty extends ReadableCDMProperty {\n\n\tpublic void setName(String name);\n\t\n\tpublic void setCardinality(Cardinality cardinality);\n\n}", "public interface CDMReferenceProperty extends CDMProperty, ReadableCDMReferenceProperty {\n\t\n\tpublic void setTargetDataType(CanonicalDataType ty...
import com.modelsolv.kaboom.model.canonical.CDMProperty; import com.modelsolv.kaboom.model.canonical.CDMReferenceProperty; import com.modelsolv.kaboom.model.resource.ObjectResourceDefinition; import com.modelsolv.kaboom.model.resource.RDMProperty; import com.modelsolv.kaboom.model.resource.ReferenceLink;
/******************************************************************************* * Copyright (c) 2014 ModelSolv, Inc. and others. * 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 a...
private ObjectResourceDefinition targetResource;
2
peshkira/c3po
c3po-core/src/main/java/com/petpet/c3po/adaptor/fits/DigesterContext.java
[ "public interface PreProcessingRule extends ProcessingRule {\n\n /**\n * Returns true if the property and value should be skipped for some reason.\n * \n * The adaptors should invoke this method for each raw record and skip the\n * meta data record if the method returns true.\n * \n * @param property\n...
import java.util.ArrayList; import java.util.List; import org.apache.commons.digester3.Digester; import com.petpet.c3po.api.adaptor.PreProcessingRule; import com.petpet.c3po.api.dao.ReadOnlyCache; import com.petpet.c3po.api.model.Element; import com.petpet.c3po.api.model.Property; import com.petpet.c3po.api.model.Sourc...
/******************************************************************************* * Copyright 2013 Petar Petrov <me@petarpetrov.org> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * ...
final Property property = this.getProperty( propKey );
3
patrickfav/planb-android
planb/src/main/java/at/favre/lib/planb/full/CrashExplorerOverviewActivity.java
[ "public final class PlanB {\n private final static RecoverBehaviorFactory BEHAVIOR_FACTORY = new DefaultRecoverBehaviorFactor();\n private final static CrashDataHandlerFactory CRASH_DATA_HANDLER_FACTORY = new DefaultCrashDataHandlerFactory();\n private static PlanB instance;\n static final Thread.Uncaug...
import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.graphics.Typeface; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompat...
package at.favre.lib.planb.full; public class CrashExplorerOverviewActivity extends AppCompatActivity { private static final String TAG = CrashExplorerOverviewActivity.class.getName(); private static final String KEY_SORT = "SORT"; private final static int SORT_DATE = 0; private final static int S...
crashDataList = PlanB.get().getCrashDataHandler().getAll();
0
Lzw2016/fastdfs-java-client
src/main/java/org/cleverframe/fastdfs/protocol/storage/request/SetMetadataRequest.java
[ "public final class CmdConstants {\n /**\n * 客户端关闭连接命令\n */\n public static final byte FDFS_PROTO_CMD_QUIT = 82;\n /**\n * 连接状态检查命令\n */\n public static final byte FDFS_PROTO_CMD_ACTIVE_TEST = 111;\n /**\n * 服务端正确返回报文状态\n */\n public static final byte FDFS_PROTO_CMD_RESP = ...
import org.cleverframe.fastdfs.constant.CmdConstants; import org.cleverframe.fastdfs.constant.OtherConstants; import org.cleverframe.fastdfs.model.MateData; import org.cleverframe.fastdfs.protocol.BaseRequest; import org.cleverframe.fastdfs.protocol.ProtocolHead; import org.cleverframe.fastdfs.mapper.DynamicFieldType; ...
package org.cleverframe.fastdfs.protocol.storage.request; /** * 作者:LiZW <br/> * 创建时间:2016/11/20 18:46 <br/> */ public class SetMetadataRequest extends BaseRequest { /** * 文件名byte长度 */ @FastDFSColumn(index = 0) private int fileNameByteLength; /** * 元数据byte长度 */ @FastDFSColu...
private Set<MateData> metaDataSet;
2
MovingBlocks/TerasologyLauncher
src/main/java/org/terasology/launcher/TerasologyLauncher.java
[ "public final class LauncherVersion {\n\n private static final Logger logger = LoggerFactory.getLogger(LauncherVersion.class);\n private static final String VERSION_INFO_FILE = \"/org/terasology/launcher/version.txt\";\n private static LauncherVersion instance;\n\n private final Semver semver;\n\n pr...
import javafx.animation.FadeTransition; import javafx.application.Application; import javafx.application.Platform; import javafx.concurrent.Task; import javafx.concurrent.Worker; import javafx.fxml.FXMLLoader; import javafx.geometry.Pos; import javafx.geometry.Rectangle2D; import javafx.scene.Parent; import javafx.scen...
// Copyright 2020 The Terasology Foundation // SPDX-License-Identifier: Apache-2.0 package org.terasology.launcher; public final class TerasologyLauncher extends Application { private static final Logger logger = LoggerFactory.getLogger(TerasologyLauncher.class); private static final int SPLASH_WIDTH = 80...
throw new LauncherStartFailedException("Launcher configuration was `null`.");
5
desht/ScrollingMenuSign
src/main/java/me/desht/scrollingmenusign/commandlets/ScriptCommandlet.java
[ "public class DirectoryStructure {\n private static File pluginDir;\n private static File dataDir, menusDir, viewsDir, varsDir, macrosDir, imgCacheDir, fontsDir, scriptsDir;\n private static File commandFile;\n\n private static final String dataDirName = \"data\";\n private static final String menusD...
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import javax.script.Bindings; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; import javax.script.SimpleBindings; import me.desht.dhutils.D...
package me.desht.scrollingmenusign.commandlets; public class ScriptCommandlet extends BaseCommandlet { public ScriptCommandlet() { super("SCRIPT"); } @Override public boolean execute(ScrollingMenuSign plugin, CommandSender sender, CommandTrigger trigger, String cmd, String[] args) {
SMSValidate.isTrue(args.length >= 2, "Usage: " + cmd + " <script-name> [<script-args>]");
2
binkley/binkley
yaml-compile/src/main/java/hm/binkley/annotation/processing/YamlGenerateProcessor.java
[ "public abstract class YDocumented {\n private static final Pattern DQUOTE = compile(\"\\\"\");\n /** The simple name, never missing. */\n @Nonnull\n public final String name;\n /** The literal doc string, optional. */\n @Nullable\n public final String doc;\n /**\n * The escaped doc stri...
import com.google.common.reflect.ClassPath; import com.google.common.reflect.ClassPath.ResourceInfo; import freemarker.cache.URLTemplateLoader; import freemarker.template.Configuration; import freemarker.template.TemplateException; import hm.binkley.annotation.YamlGenerate; import hm.binkley.annotation.processing.y.YDo...
package hm.binkley.annotation.processing; /** * {@code YamlGenerateProcessor} generates Java source enums and classes from * YAML descriptions. * <p> * Type names are those <a href="http://yaml.org/type/">defined by YAML * 1.1</a>. * * @author <a href="mailto:binkley@alumni.rice.edu">B. K. Oxley (binkley)</a...
yaml = configure(YamlHelper.builder()).build();
5
sfPlayer1/Matcher
src/matcher/gui/tab/MemberScoresTab.java
[ "public class ClassifierResult<T> {\n\tpublic ClassifierResult(IClassifier<T> classifier, double score) {\n\t\tthis.classifier = classifier;\n\t\tthis.score = score;\n\t}\n\n\tpublic IClassifier<T> getClassifier() {\n\t\treturn classifier;\n\t}\n\n\tpublic double getScore() {\n\t\treturn score;\n\t}\n\n\t@Override\...
import javafx.scene.control.Tab; import javafx.scene.control.TableView; import matcher.classifier.ClassifierResult; import matcher.classifier.RankResult; import matcher.gui.IGuiComponent; import matcher.gui.ISelectionProvider; import matcher.type.FieldInstance; import matcher.type.MatchType; import matcher.type.MemberI...
package matcher.gui.tab; public class MemberScoresTab extends Tab implements IGuiComponent { public MemberScoresTab(ISelectionProvider selectionProvider) { super("member classifiers"); this.selectionProvider = selectionProvider; init(); } private void init() { setContent(table); } @Override public v...
RankResult<MemberInstance<?>> result = (RankResult<MemberInstance<?>>) selectionProvider.getSelectedRankResult(MatchType.Method);
5
jaychang0917/SimpleRecyclerView
app/src/main/java/com/jaychang/demo/srv/SectionHeaderActivity.java
[ "public class BookCell extends SimpleCell<Book, BookCell.ViewHolder>\n implements Updatable<Book> {\n\n private static final String KEY_TITLE = \"KEY_TITLE\";\n private boolean showHandle;\n\n public BookCell(Book item) {\n super(item);\n }\n\n @Override\n protected int getLayoutRes() {\n return R.layo...
import android.os.Bundle; import android.support.annotation.NonNull; import android.view.LayoutInflater; import android.view.View; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.TextView; import com.jaychang.demo.srv.cell.BookCell; import com.jaychang.demo.srv.model.Book; im...
package com.jaychang.demo.srv; public class SectionHeaderActivity extends BaseActivity { @BindView(R.id.recyclerView) SimpleRecyclerView recyclerView; @BindView(R.id.stickyCheckbox) CheckBox stickyCheckbox; @BindView(R.id.marginTopCheckbox) CheckBox marginTopCheckbox; @Override protected void onC...
return position == 0 ? 0 : Utils.dp2px(SectionHeaderActivity.this, 16);
3
alexandre-normand/blood-shepherd
dexcom-receiver/src/main/java/org/glukit/dexcom/sync/tasks/FetchNewDataRunner.java
[ "public interface DataInputFactory {\n public DataInput create(InputStream inputStream);\n}", "public interface DataOutputFactory {\n public DataOutput create(OutputStream outputStream);\n}", "public class DatabasePagesPager implements Iterable<DatabaseReadRequestSpec> {\n private long firstPage;\n private ...
import com.google.common.base.Predicate; import com.google.common.base.Throwables; import com.google.common.collect.Collections2; import com.google.inject.Inject; import jssc.SerialPort; import jssc.SerialPortException; import org.glukit.dexcom.sync.DataInputFactory; import org.glukit.dexcom.sync.DataOutputFactory; imp...
/* * The MIT License (MIT) * * Copyright (c) 2013 Alexandre Normand * * 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 *...
private final ResponseReader responseReader;
3
wseemann/RoMote
app/src/main/java/wseemann/media/romote/fragment/ManualConnectionFragment.java
[ "public abstract class RequestCallback {\n public abstract void requestResult(RokuRequestTypes rokuRequestType, RequestTask.Result result);\n public abstract void onErrorResponse(RequestTask.Result result);\n}", "public class RequestTask extends AsyncTask<RokuRequestTypes, Void, RequestTask.Result> {\n\n ...
import android.app.Activity; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.in...
package wseemann.media.romote.fragment; /** * Created by wseemann on 6/26/16. */ public class ManualConnectionFragment extends Fragment { private EditText mIpAddressText; private Button mConnectButton; private LinearLayout mProgressLayout; private TextView mErrorText; private String mHost; ...
DBUtils.insertDevice(getActivity(), device);
2
spotify/missinglink
core/src/test/java/com/spotify/missinglink/ConflictCheckerTest.java
[ "@AutoMatter\npublic interface Artifact {\n\n /** \"Name\" of artifact, for example a directory path or jar file or something else symbolic. */\n ArtifactName name();\n\n /** Map of classname to class object. Names are com/foo/bar/Baz. Returned map is immutable. */\n Map<ClassTypeDescriptor, DeclaredClass> clas...
import static org.assertj.core.api.Assertions.assertThat; import com.spotify.missinglink.datamodel.Artifact; import com.spotify.missinglink.datamodel.ArtifactBuilder; import com.spotify.missinglink.datamodel.ArtifactName; import com.spotify.missinglink.datamodel.CalledMethodBuilder; import com.spotify.missinglink.datam...
/*- * -\-\- * missinglink-core * -- * Copyright (C) 2016 - 2021 Spotify AB * -- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * ...
ClassTypeDescriptor libClass1 = TypeDescriptors.fromClassName("org/library/ClassName");
2
ProxyPrint/proxyprint-kitchen
src/main/java/io/github/proxyprint/kitchen/controllers/printshops/PriceTableController.java
[ "public class CoverTableItem {\n public static String DEFAULT = \"-\";\n public String coverType;\n public String priceA4, priceA3;\n\n public CoverTableItem() {\n this.coverType = DEFAULT;\n this.priceA4 = DEFAULT;\n this.priceA3 = DEFAULT;\n }\n\n public CoverTableItem(Strin...
import com.google.gson.Gson; import com.google.gson.JsonObject; import io.github.proxyprint.kitchen.controllers.printshops.pricetable.CoverTableItem; import io.github.proxyprint.kitchen.controllers.printshops.pricetable.PaperTableItem; import io.github.proxyprint.kitchen.controllers.printshops.pricetable.RingTableI...
package io.github.proxyprint.kitchen.controllers.printshops; /** * Created by daniel on 10-05-2016. */ @RestController @Transactional public class PriceTableController { @Autowired
private PrintShopDAO printshops;
6
StumbleUponArchive/hbase
src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
[ "public class HBaseTestingUtility {\n private static final Log LOG = LogFactory.getLog(HBaseTestingUtility.class);\n private Configuration conf;\n private MiniZooKeeperCluster zkCluster = null;\n\n /**\n * The default number of regions per regionserver when creating a pre-split\n * table.\n */\n private ...
import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import...
Put put2 = new Put(ROW); put2.add(FAMILY, QUALIFIER, value2); // row now exists, use the matching value to check ok = table.checkAndPut(ROW, FAMILY, QUALIFIER, VALUE, put2); assertEquals(ok, true); Put put3 = new Put(anotherrow); put3.add(FAMILY, QUALIFIER, VALUE); // try to do CheckA...
HRegion region = TEST_UTIL.getRSForFirstRegionInTable(
5
qibin0506/Glin
glin/src/main/java/org/loader/glin/Glin.java
[ "public interface ICacheProvider {\n /**\n * get cache by key of {@link #getKey(String, String)}\n * @param key key\n * @param klass type of data struct, see also {@link org.loader.glin.helper.Helper}\n * @param isList is result a List\n * @return cache data\n */\n <T> Result<T> get(S...
import org.loader.glin.annotation.Arg; import org.loader.glin.annotation.JSON; import org.loader.glin.annotation.Path; import org.loader.glin.annotation.ShouldCache; import org.loader.glin.cache.ICacheProvider; import org.loader.glin.call.Call; import org.loader.glin.chan.GlobalChanNode; import org.loader.glin.chan.Log...
Class<? extends Call> callKlass = mCallFactory.get(key); if (callKlass == null) { throw new UnsupportedOperationException("cannot find calls"); } boolean shouldCache = method.isAnnotationPresent(ShouldCache.class); Pair<String, Params> pair =...
public Builder resultInterceptor(IResultInterceptor interceptor) {
7
pgroth/hbase-rdf
src/main/java/nl/vu/jena/graph/HBaseGraph.java
[ "public class HBaseClientSolution {\r\n\tpublic IHBaseSchema schema;\r\n\tpublic IHBaseOperationManager opsManager;\r\n\t\r\n\tpublic HBaseClientSolution(IHBaseSchema schema, IHBaseOperationManager opsManager) {\r\n\t\tsuper();\r\n\t\tthis.schema = schema;\r\n\t\tthis.opsManager = opsManager;\r\n\t}\r\n}\r", "pub...
import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import nl.vu.datalayer.hbase.HBaseClientSolution; import nl.vu.datalayer.hbase.id.Id; import nl.vu.datalayer.hbase.retrieve.IHBasePrefixMatchRetrieveOpsManager; im...
package nl.vu.jena.graph; public class HBaseGraph extends GraphBase { public static final byte CACHING_ON = 1; public static final byte CACHING_OFF = 0; private static final int CACHE_SIZE = 1000000; private HBaseClientSolution hbase; ExtendedIterator<Triple> it; ValueIdMapper valIdMapper; private byte ca...
private Map<TripleMatch, List<Triple>> cache = Collections.synchronizedMap(new JenaCache<TripleMatch, List<Triple>>(CACHE_SIZE));
4
FRC2832/Robot_2017
src/org/usfirst/frc2832/Robot2017/commands/shooter/ShooterSequenceOn.java
[ "public class OI {\r\n\t\r\n\t//// CREATING BUTTONS\r\n // One type of button is a joystick button which is any button on a joystick.\r\n // You create one by telling it which joystick it's on and which button\r\n // number it is.\r\n // Joystick stick = new Joystick(port);\r\n // Button button = new...
import org.usfirst.frc2832.Robot2017.OI; import org.usfirst.frc2832.Robot2017.Robot; import org.usfirst.frc2832.Robot2017.RobotMap; import org.usfirst.frc2832.Robot2017.commands.WaitUntilSpeed; import org.usfirst.frc2832.Robot2017.subsystems.Shooter; import edu.wpi.first.wpilibj.command.CommandGroup;
package org.usfirst.frc2832.Robot2017.commands.shooter; /** * */ public class ShooterSequenceOn extends CommandGroup { public ShooterSequenceOn() { addSequential(new AgitatorOn()); addSequential(new ShooterOn());
addSequential(new WaitUntilSpeed(Shooter.shooterShootMotor, 50, Robot.shooter));
4
tonikolaba/MrTower
src/al/artofsoul/ndihma/StateManger.java
[ "public static PllakaFusha LoadMap(String mapName) {\n\tPllakaFusha grid = new PllakaFusha();\n\ttry {\n\t\tBufferedReader br = new BufferedReader(new FileReader(mapName));\n\t\tString data = br.readLine();\n\t\tfor (int i = 0; i < grid.getPllakaWide(); i++) {\n\t\t\tfor (int j = 0; j < grid.getPllakaHigh(); j++) {...
import static al.artofsoul.ndihma.Leveler.LoadMap; import al.artofsoul.data.Editor; import al.artofsoul.data.Game; import al.artofsoul.data.MainMenu; import al.artofsoul.data.PllakaFusha;
package al.artofsoul.ndihma; public class StateManger { public static enum GameState { MAINMENU, GAME, EDITOR } public static GameState gameState = GameState.MAINMENU;
public static MainMenu mainMenu;
3
JoshuaD84/HypnosMusicPlayer
src/net/joshuad/hypnos/lyrics/LyricsFetcher.java
[ "public class Track implements Serializable, AlbumInfoSource {\r\n\tprivate static transient final Logger LOGGER = Logger.getLogger( Track.class.getName() );\r\n\t\r\n\tprivate static final long serialVersionUID = 1L;\r\n\tpublic static final int NO_TRACK_NUMBER = -885533;\r\n\r\n\tpublic enum Format {\r\n\t\tFLAC ...
import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; import net.joshuad.hypnos.library.Track; import net.joshuad.hypnos.lyrics.scrapers.AZScraper; import net.joshuad.hypnos.lyrics.scrapers.AbstractScraper; import net.joshuad.hypnos.lyrics.scrapers.GeniusScraper; import net.joshuad.hypnos....
package net.joshuad.hypnos.lyrics; public class LyricsFetcher { @SuppressWarnings("unused") private static transient final Logger LOGGER = Logger.getLogger( LyricsFetcher.class.getName() ); public enum LyricSite { NONE ( "No Source" ), METRO ( "Metro Lyrics" ), GENIUS ( "Genius Lyrics" ), AZ ( "AZLyrics...
public Lyrics get ( Track track ) {
0
Yelp/yelp-android
src/integration-test/java/com/yelp/clientlib/BusinessIntegrationTest.java
[ "public interface YelpAPI {\n\n /**\n * Make a request to the business endpoint.\n *\n * @param businessId The business id.\n * @return Object to execute the request.\n * @see <a href = https://www.yelp.com/developers/documentation/v2/business>https://www.yelp.com/developers/documentation/v2/...
import com.yelp.clientlib.connection.YelpAPI; import com.yelp.clientlib.connection.YelpAPIFactory; import com.yelp.clientlib.entities.Business; import com.yelp.clientlib.exception.exceptions.BusinessUnavailable; import com.yelp.clientlib.exception.exceptions.YelpAPIError; import com.yelp.clientlib.utils.AsyncTestUtils;...
package com.yelp.clientlib; /** * TODO: Move this class to other directory so src/java/test only contains unit-tests related files. */ public class BusinessIntegrationTest { private String businessId = "yelp-san-francisco"; private YelpAPI yelpAPI; @Before public void setUp() { YelpAPIFa...
} catch (YelpAPIError apiError) {
4
googleapis/java-bigqueryconnection
google-cloud-bigqueryconnection/src/test/java/com/google/cloud/bigqueryconnection/v1/MockConnectionServiceImpl.java
[ "public final class Connection extends com.google.protobuf.GeneratedMessageV3\n implements\n // @@protoc_insertion_point(message_implements:google.cloud.bigquery.connection.v1.Connection)\n ConnectionOrBuilder {\n private static final long serialVersionUID = 0L;\n // Use Connection.newBuilder() to constr...
import com.google.api.core.BetaApi; import com.google.cloud.bigquery.connection.v1.Connection; import com.google.cloud.bigquery.connection.v1.ConnectionServiceGrpc.ConnectionServiceImplBase; import com.google.cloud.bigquery.connection.v1.CreateConnectionRequest; import com.google.cloud.bigquery.connection.v1.DeleteConn...
/* * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
CreateConnectionRequest request, StreamObserver<Connection> responseObserver) {
2
hanuor/pearl
sapphire/src/main/java/com/hanuor/sapphire/hub/Internals.java
[ "public class KapacRecentDB extends SQLiteOpenHelper {\n private static final KapacRecent TBNM = KapacRecent.RECENT_KAPAC_TABLE;\n private static final KapacRecent DBNM = KapacRecent.KAPAC_RECENT_DATABASE;\n private static final KapacRecent CLNM = KapacRecent.COLUMN_VALUE;\n private static final String ...
import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.os.AsyncTask; import android.util.Log; import android.widget.ImageView; import com.backendless.Backendless; import com.hanuor.client.Client; import com.hanuor.container.Initializer; import com...
package com.hanuor.sapphire.hub; /* * Copyright (C) 2016 Hanuor Inc. by Shantanu Johri(https://hanuor.github.io/shanjohri/) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://w...
private BitmapUtility bitmapUtility = new BitmapUtility();
4
rockihack/Stud.IP-FileSync
src/de/uni/hannover/studip/sync/views/RootLayoutController.java
[ "public class Main extends Application {\n\n\t/**\n\t * App name (titlebar).\n\t */\n\tpublic static final String APP_NAME = \"Stud.IP FileSync\";\n\n\t/**\n\t * Views.\n\t */\n\tpublic static final String OVERVIEW = \"Overview\";\n\tpublic static final String NEW_DOCUMENTS = \"NewDocuments\";\n\tpublic static fina...
import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.Paths; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import de.uni.hannover.studip.sy...
package de.uni.hannover.studip.sync.views; /** * * @author Lennart Glauer * */ public class RootLayoutController extends AbstractController { @FXML private MenuBar menu; /** * Get menu instance. * * @return */ public MenuBar getMenu() { return menu; } /** * File -> New documents. */ @F...
SimpleAlert.error("Kein Ziel Ordner gewählt.");
4
zhoufenglokki/mappingrpc
mappingrpc-connector/src/test/java/mappingrpc/test/centerserver/service/mock/UserServiceImpl.java
[ "public class Cookie implements JSONAware {\n\tprivate String name;\n\tprivate String value;\n\tprivate int maxAge = -1;\n\n\tpublic Cookie() {\n\t}\n\n\tpublic Cookie(String cookieName, String cookieValue, int maxAge) {\n\t\tsuper();\n\t\tthis.name = cookieName;\n\t\tthis.value = cookieValue;\n\t\tthis.maxAge = ma...
import github.mappingrpc.api.annotation.RequestMapping; import github.mappingrpc.api.clientside.domain.Cookie; import github.mappingrpc.api.threadmodel.ServerCookieManager; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; import java.util....
package mappingrpc.test.centerserver.service.mock; public class UserServiceImpl implements UserService { Logger log = LoggerFactory.getLogger(getClass()); @Deprecated @RequestMapping("/userservice/register/20140305/") public User registerUser(User user, String password) { System.err.println("service:" + "/...
Cookie cookie = new Cookie();
0
comtel2000/jfxvnc
jfxvnc-app/src/main/java/org/jfxvnc/app/presentation/MainViewPresenter.java
[ "public class SessionContext {\n\n private final static org.slf4j.Logger logger = LoggerFactory.getLogger(SessionContext.class);\n\n private String name;\n private Path propPath;\n\n private ObservableList<HistoryEntry> history;\n private ObservableMap<String, Property<?>> bindings;\n\n private final Properti...
import java.awt.Toolkit; import java.net.URL; import java.text.MessageFormat; import java.util.ResourceBundle; import javax.inject.Inject; import org.jfxvnc.app.persist.SessionContext; import org.jfxvnc.app.presentation.detail.DetailView; import org.jfxvnc.app.presentation.vnc.VncView; import org.jfxvnc.net.rfb.render....
/******************************************************************************* * Copyright (c) 2016 comtel 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.or...
VncRenderService service;
4
JustBru00/RenamePlugin
src/com/gmail/justbru00/epic/rename/commands/v3/RemoveGlow.java
[ "public enum EpicRenameCommands {\r\n\r\n\tRENAME, LORE, EPICRENAME, SETLORELINE, \r\n\tREMOVELORELINE, INSERTLORELINE, GLOW, REMOVEGLOW, ALIGN, EXPORT, IMPORT;\r\n\t\r\n\t\r\n\tpublic static String getStringName(EpicRenameCommands e) {\r\n\t\tswitch (e) {\r\n\t\tcase RENAME: {return \"rename\";}\r\n\t\tcase LORE: ...
import java.util.Map; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory....
package com.gmail.justbru00.epic.rename.commands.v3; public class RemoveGlow implements CommandExecutor { @SuppressWarnings("deprecation") @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { if (command.getName().equalsIgnoreCase("removeglow")) ...
if (!MaterialPermManager.checkPerms(EpicRenameCommands.REMOVEGLOW, inHand, player)) {
0
contentful/discovery-app-android
app/src/main/java/discovery/contentful/preview/EntryListFragment.java
[ "public class AssetPreviewActivity extends CFListActivity {\n private AssetInfoAdapter adapter;\n private CDAAsset asset;\n\n @Override protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n // Extract arguments from Intent\n asset = (CDAAsset) getIntent().getSeri...
import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import android.widget.AdapterView; import discovery.contentful.activities.AssetPreviewActivity; import discovery.contentful.activities.EntryActivity; import discovery.contentful.activities.MapA...
package discovery.contentful.preview; public class EntryListFragment extends CFListFragment { private CDAEntry entry; private CDAContentType contentType; private EntryListAdapter adapter; private Map<String, CDAField> contentTypesFields; private Map<String, CDAContentType> contentTypesMap; public static ...
new Intent(getActivity(), StringListActivity.class)
4
mucaho/jnetrobust
jnetrobust-core/src/main/java/com/github/mucaho/jnetrobust/controller/ProcessingController.java
[ "public final class ProtocolConfig {\n public enum AutoRetransmitMode {\n ALWAYS,\n NEVER,\n NEWEST\n }\n\n /**\n * The constant MAX_PACKET_QUEUE_LIMIT.\n */\n public static final int MAX_PACKET_QUEUE_LIMIT = Packet.MAX_DATAS_PER_PACKET;\n /**\n * The constant MAX_PAC...
import com.github.mucaho.jnetrobust.ProtocolConfig; import com.github.mucaho.jnetrobust.ProtocolListener; import com.github.mucaho.jnetrobust.control.*; import com.github.mucaho.jnetrobust.util.IdComparator; import com.github.mucaho.jnetrobust.util.RTTHandler; import com.github.mucaho.jnetrobust.util.SystemClock; impor...
/* * Copyright (c) 2014 mucaho (https://github.com/mucaho). * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package com.github.mucaho.jnetrobust.controller; ...
public ProcessingController(ProtocolListener listener, ProtocolConfig config) {
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...
File evalDir = Helper.createDir(gv.getEvalDir());
4
janoliver/pOT-Droid
src/main/java/com/mde/potdroid/parsers/TopicParser.java
[ "public class Network {\n private static OkHttpClient mHttpClient;\n\n // this is the AsyncHttpClient we use for the network interaction\n private Headers mHeaders;\n\n // a reference to the Context\n private Context mContext;\n\n // A reference to the Settings\n private SettingsWrapper mSettin...
import android.net.Uri; import android.sax.*; import android.util.Xml; import com.mde.potdroid.helpers.Network; import com.mde.potdroid.helpers.Utils; import com.mde.potdroid.models.Board; import com.mde.potdroid.models.Post; import com.mde.potdroid.models.Topic; import com.mde.potdroid.models.User; import org.xml.sax....
package com.mde.potdroid.parsers; /** * An XML Handler class to parse the API XML code of a Topic. A little bit messy, * but a long stare at the code should make it clear. */ public class TopicParser extends DefaultHandler { public static String TAG = "thread"; public static String SUBTITLE_TAG = "subtitl...
Network.logout(Utils.getApplicationContext());
1
zhangxx0/WOTPlus
app/src/main/java/com/xinxin/wotplus/util/mapper/XvmThirtyInfoToDayMap.java
[ "public class DaylistEntityForRecent implements Serializable {\n\n private int mark4;\n private int defense;\n private int mark3;\n private int teambattles;\n private int spotted;\n private int mark2;\n private int mark1;\n private int teamwins;\n private int frags;\n private int damag...
import com.xinxin.wotplus.model.DaylistEntityForRecent; import com.xinxin.wotplus.model.TankInfo; import com.xinxin.wotplus.model.XvmAllInfo; import com.xinxin.wotplus.model.XvmMainInfo; import com.xinxin.wotplus.util.CommonUtil; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Array...
package com.xinxin.wotplus.util.mapper; /** * Created by xinxin on 2016/5/29. */ public class XvmThirtyInfoToDayMap implements Func1<XvmAllInfo, XvmAllInfo> { private static XvmThirtyInfoToDayMap INSTANCE = new XvmThirtyInfoToDayMap(); public XvmThirtyInfoToDayMap() { } public static XvmThirtyI...
List<XvmMainInfo.DaylistEntity> daylist = xvmAllInfo.getXvmMainInfo().getDaylist();
3
ibm-datapower/ertool
framework/src/com/ibm/datapower/er/ERFramework.java
[ "public class Base64\n{\n // Globals\n public static final int DECODE = 0;\n public static final int ENCODE = 1;\n\n public static final byte ASCII_SPACE = 32;\n public static final byte ASCII_EQUALS = 61;\n public static final byte ASCII_TAB = 9;\n public static final byte ASCII_LF =...
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Hashtable; import java.util.List; import java.util.Map.Entry; import java.util.Vector; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; im...
} // instantiate the table if it does not exist for use further below if (mSectionsExist == null) { // if the mSectionList does not have previous built up entries we need to add // empty hashtables in place if (f > mSectionList.size()) for (int t = mSectionList.size(); t < f; t++) mSect...
Collections.sort(cidList, new DocSort());
2
davidmoten/rtree-3d
src/test/java/com/github/davidmoten/rtree3d/OnSubscribeSearchTest.java
[ "public final class Entry<T, S extends Geometry> implements HasGeometry {\n private final T value;\n private final S geometry;\n\n /**\n * Constructor.\n * \n * @param value\n * the value of the entry\n * @param geometry\n * the geometry of the value\n */\n...
import java.util.Collections; import org.junit.Test; import org.mockito.Mockito; import com.github.davidmoten.rtree3d.Entry; import com.github.davidmoten.rtree3d.Leaf; import com.github.davidmoten.rtree3d.Node; import com.github.davidmoten.rtree3d.OnSubscribeSearch; import com.github.davidmoten.rtree3d.OnSubscribeSearc...
package com.github.davidmoten.rtree3d; public class OnSubscribeSearchTest { @SuppressWarnings("unchecked") @Test public void testSearchProducerThrowsExceptionFromRequestAll() { Node<Integer, Geometry> node = Mockito.mock(Node.class); Func1<Geometry, Boolean> condition = Mockito.mock(Fu...
SearchProducer<Integer, Geometry> p = new OnSubscribeSearch.SearchProducer<Integer, Geometry>(
3
sandflow/regxmllib
src/main/java/com/sandflow/smpte/regxml/MXFFragmentBuilder.java
[ "public interface Group {\n\n /**\n * Retrieves the items of the Group\n * \n * @return Ordered collection of all items within the Group\n */\n Collection<Triplet> getItems();\n\n /**\n * Returns the Key of the Group\n * \n * @return Key of the Group\n */\n UL getKey();\n ...
import com.sandflow.smpte.klv.Group; import com.sandflow.smpte.klv.KLVInputStream; import com.sandflow.smpte.klv.LocalSet; import com.sandflow.smpte.klv.LocalTagRegister; import com.sandflow.smpte.klv.Triplet; import com.sandflow.smpte.klv.exceptions.KLVException; import com.sandflow.smpte.mxf.FillItem; import com.sand...
/* * Copyright (c) 2015, Pierre-Anthony Lemieux (pal@sandflow.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notic...
if (!FillItem.getKey().equalsIgnoreVersion(t.getKey())) {
3
ceylon/ceylon-module-resolver
maven/src/test/java/com/redhat/ceylon/test/maven/test/AetherTestCase.java
[ "@SuppressWarnings(\"serial\")\npublic class ArtifactContext implements Serializable, ContentOptions {\n public static final String CAR = \".car\";\n public static final String JAR = \".jar\";\n public static final String JS_MODEL = \"-model.js\";\n public static final String JS = \".js\";\n public s...
import com.redhat.ceylon.model.cmr.ArtifactResult; import org.junit.Assert; import org.junit.Test; import java.io.File; import java.net.URISyntaxException; import java.net.URL; import java.util.List; import com.redhat.ceylon.cmr.api.ArtifactContext; import com.redhat.ceylon.cmr.api.CmrRepository; import com.redhat.ceyl...
} } @Test public void testAether() throws Throwable { CmrRepository repository = AetherRepository.createRepository(log, false, 60000); RepositoryManager manager = new SimpleRepositoryManager(repository, log); ArtifactResult result = manager.getArtifactResult("org.slf4j.slf4j...
RepositoryManager manager = new SimpleRepositoryManager(repository, log, RepositoryManagerBuilder.parseOverrides(getOverridesFileName()));
2
vianneyfaivre/Persephone
src/main/java/re/vianneyfaiv/persephone/service/EnvironmentService.java
[ "@Configuration\npublic class RestTemplateFactory {\n\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(RestTemplateFactory.class);\n\n\t// Spring\n\n\t@Autowired\n\tprivate ApplicationContext applicationContext;\n\n\t@Autowired\n\tprivate ConfigurableListableBeanFactory registry;\n\n\t// Persephone R...
import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import or...
package re.vianneyfaiv.persephone.service; /** * Calls /env */ @Service public class EnvironmentService { private static final Logger LOGGER = LoggerFactory.getLogger(EnvironmentService.class); @Autowired private RestTemplateFactory restTemplates; public ActuatorVersion getActuatorVersion(Application app)...
throw RestTemplateErrorHandler.handle(app, url, clientEx);
6
duniter-gchange/gchange-pod
gchange-pod-es-plugin/src/main/java/org/duniter/elasticsearch/gchange/rest/market/search/CustomSearchAction.java
[ "public interface MarketIndexDao extends IndexDao<MarketIndexDao> {\n String INDEX = \"market\";\n String CATEGORY_TYPE = \"category\";\n\n void startDataMigration();\n}", "public class LightCategory implements LocalEntity<String> {\n\n public static final String PROPERTY_NAME = CategoryRecord.PROPERT...
import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.lang3.StringUtils; import org.duniter.core.client.model.bma.jackson.JacksonUtils; import org.duniter.core.exception.BusinessException; import org.duniter.core.exception.TechnicalException; import org.duniter.elasticsearch.exception.DuniterEla...
package org.duniter.elasticsearch.gchange.rest.market.search; public class CustomSearchAction extends BaseRestHandler { private final ESLogger log;
private MarketService service;
5
gaffo/scumd
src/test/java/com/asolutions/scmsshd/commands/factories/GitSCMCommandFactoryTest.java
[ "public class MockTestCase {\n\n\tprotected Mockery context = new JUnit4Mockery();\n\n\t@Before\n\tpublic void setupMockery() {\n\t\tcontext.setImposteriser(ClassImposteriser.INSTANCE);\n\t}\n\t\n\t@After\n\tpublic void mockeryAssertIsSatisfied(){\n\t\tcontext.assertIsSatisfied();\n\t}\n\n\tprotected void checking(...
import static org.junit.Assert.assertEquals; import java.util.Properties; import org.junit.Test; import com.asolutions.MockTestCase; import com.asolutions.scmsshd.commands.FilteredCommand; import com.asolutions.scmsshd.commands.git.SCMCommand; import com.asolutions.scmsshd.converters.path.IPathToProjectNameConver...
package com.asolutions.scmsshd.commands.factories; public class GitSCMCommandFactoryTest extends MockTestCase{ @Test public void testCreatesAGitCommand() throws Exception { FilteredCommand filteredCommand = new FilteredCommand(); IProjectAuthorizer mockProjectAuthorizer = context.mock(IProjectAu...
SCMCommand command = (SCMCommand) factory.create(filteredCommand, mockProjectAuthorizer, mockPathConverter, mockConfig);
2
ushahidi/SMSSync
smssync/src/main/java/org/addhen/smssync/presentation/view/ui/activity/MainActivity.java
[ "public class App extends BaseApplication {\n\n private static AppComponent mAppComponent;\n\n private static TwitterClient mTwitter;\n\n private static App mApp;\n\n\n public static synchronized TwitterClient getTwitterInstance() {\n if (mTwitter == null) {\n mTwitter = new TwitterBui...
import com.addhen.android.raiburari.presentation.di.HasComponent; import com.addhen.android.raiburari.presentation.ui.activity.BaseActivity; import org.addhen.smssync.R; import org.addhen.smssync.data.PrefsFactory; import org.addhen.smssync.presentation.App; import org.addhen.smssync.presentation.di.component.AppActivi...
mSearchView = (SearchView) MenuItemCompat.getActionView(mSearchItem); initSearchView(); } return true; } public boolean onPrepareOptionsMenu(Menu menu) { // Only show search icon for incoming messages fragment if (mNavigationView.getMenu().findItem(R.id.n...
Utility.capitalizeFirstLetter(prefs.uniqueName().get()) + " - " + prefs
3
scan/Nicol
jbox2d/src/main/java/org/jbox2d/pooling/normal/DefaultWorldPool.java
[ "public class AABB {\n /** Bottom left vertex of bounding box. */\n public final Vec2 lowerBound;\n /** Top right vertex of bounding box. */\n public final Vec2 upperBound;\n\n /**\n * Creates the default object, with vertices at 0,0 and 0,0.\n */\n public AABB() {\n lowerBound = new Vec2();\n upper...
import java.util.HashMap; import org.jbox2d.collision.AABB; import org.jbox2d.collision.Collision; import org.jbox2d.collision.Distance; import org.jbox2d.collision.TimeOfImpact; import org.jbox2d.common.Mat22; import org.jbox2d.common.Mat33; import org.jbox2d.common.Rot; import org.jbox2d.common.Settings; import org.j...
/******************************************************************************* * Copyright (c) 2013, Daniel Murphy * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of ...
private final OrderedStack<Rot> rots;
3
Kesshou/Kesshou-Android
app/src/main/java/kesshou/android/daanx/views/news/CalcActivity.java
[ "public class NetWorkCache extends RealmObject {\n\tpublic String sectionalexamscore1;\n\tpublic String sectionalexamscore2;\n\tpublic String timeTable;\n\tpublic String record;\n\tpublic String prize;\n\tpublic String histroyScore11;\n\tpublic String histroyScore12;\n\tpublic String histroyScore21;\n\tpublic Strin...
import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.MenuItem; import android.view.View; import com.github.tibolte.agendacalendarview.AgendaCalendarView; import com.github.tibolte.agendacalendarview.CalendarPickerController; import com.github.tibolte.agendacal...
package kesshou.android.daanx.views.news; public class CalcActivity extends BaseActivity implements CalendarPickerController { private FirebaseAnalytics mFirebaseAnalytics; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity...
networkingClient.getCalender(new MyCallBack<List<CalenderResponse>>(getApplicationContext()) {
5
DavidGoldman/MinecraftScripting
scripting/network/ScriptPacketHandler.java
[ "public class CloseGUIPacket extends ScriptPacket {\n\n\t@Override\n\tpublic ScriptPacket readData(Object... data) {\n\t\treturn this;\n\t}\n\t\n\t@Override\n\tpublic void encodeInto(ChannelHandlerContext ctx, ByteBuf to) throws IOException { }\n\n\t@Override\n\tpublic void decodeFrom(ChannelHandlerContext ctx, Byt...
import net.minecraft.entity.player.EntityPlayer; import scripting.packet.CloseGUIPacket; import scripting.packet.EntityNBTPacket; import scripting.packet.HasScriptsPacket; import scripting.packet.ScriptPacket; import scripting.packet.ScriptPacket.PacketType; import scripting.packet.SelectionPacket; import scripting.pac...
package scripting.network; public abstract class ScriptPacketHandler { public abstract void handleSelection(SelectionPacket pkt, EntityPlayer player); public abstract void handleHasScripts(HasScriptsPacket pkt, EntityPlayer player); public abstract void handleState(StatePacket pkt, EntityPlayer player); public ...
public abstract void handleRequest(PacketType type, String info, EntityPlayer player);
4
vineey/archelix-rsql
rsql-querydsl-parent/rsql-querydsl-integrationtest/src/test/java/com/github/vineey/rql/querydsl/test/jpa/dao/UserDaoTest.java
[ "public class RqlInput {\n private String select;\n private String sort;\n private String limit;\n private String filter;\n\n public String getSelect() {\n return select;\n }\n\n public RqlInput setSelect(String select) {\n this.select = select;\n return this;\n }\n\n ...
import com.github.springtestdbunit.DbUnitTestExecutionListener; import com.github.springtestdbunit.annotation.DatabaseSetup; import com.github.vineey.rql.RqlInput; import com.github.vineey.rql.core.util.StringUtils; import com.github.vineey.rql.querydsl.DefaultQuerydslRqlParser; import com.github.vineey.rql.querydsl.Qu...
/* * MIT License * * Copyright (c) 2016 John Michael Vincent S. Rustia * * 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 us...
QuerydslRqlParser querydslRqlParser = new DefaultQuerydslRqlParser();
2
autentia/wadl-tools
spring-wadl-generator/src/main/java/com/autentia/web/rest/wadl/builder/namespace/QNameBuilderFactory.java
[ "public class QNameBuilder {\n\n private static final Logger logger = LoggerFactory.getLogger(QNameBuilder.class);\n\n private static final Pattern BY_DOTS = Pattern.compile(\"\\\\.\");\n private static final Pattern VOWELS = Pattern.compile(\"[aeiou]\");\n private static final QName EMPTY_Q_NAME = new ...
import com.autentia.xml.namespace.QNameBuilder; import com.autentia.xml.namespace.QNameMemory; import com.autentia.xml.namespace.QNamePrefixesCache; import com.autentia.xml.namespace.QNamesCache; import com.autentia.xml.namespace.cache.InMemoryQNamePrefixesCache; import com.autentia.xml.namespace.cache.InMemoryQNamesCa...
/** * Copyright 2013 Autentia Real Business Solution S.L. * * 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 * * Unl...
return new InMemoryQNamesCache(BASIC_SINGLE_TYPES);
5
freenet/plugin-FlogHelper
src/main/java/plugins/floghelper/ui/AttachmentsToadlet.java
[ "public class DataFormatter {\n\n\t/**\n\t * RFC3339-compliant dates are used in Atom feeds.\n\t */\n\tpublic static final SimpleDateFormat RFC3339 = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\", java.util.Locale.US);\n\t/**\n\t * Our date format used in the flog (is UTC).\n\t */\n\tpublic static final ...
import plugins.floghelper.data.Activelink; import plugins.floghelper.data.Attachment; import plugins.floghelper.data.Flog; import plugins.floghelper.data.pluginstore.PluginStoreFlog; import plugins.floghelper.data.DataFormatter; import freenet.client.HighLevelSimpleClient; import freenet.clients.http.PageNode; import f...
/* FlogHelper, Freenet plugin to create flogs * Copyright (C) 2009 Romain "Artefact2" Dalmaso * * 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 yo...
DataFormatter.htmlSpecialChars(flog.getTitle())), pageNode.content).addChild("table");
0
fwix/java-gearman
src/org/gearman/GearmanJob.java
[ "public static enum StatusCallbackResult implements GearmanCallbackResult {\n\tSUCCESS,\n\tSERVER_NOT_AVAILABLE,\n\tSERVER_DROPPED,\n\tCONNECTION_FAILED,\n\tSERVER_DISCONNECTED,\n\tWORK_COMPLETE,\n\tSEND_FAILED;\n\n\t@Override\n\tpublic boolean isSuccessful() {\n\t\treturn this.equals(SUCCESS);\n\t}\n}", "public ...
import java.lang.ref.WeakReference; import java.util.Arrays; import java.util.UUID; import org.gearman.GearmanJobStatus.StatusCallbackResult; import org.gearman.GearmanJobStatus.StatusResult; import org.gearman.JobServerPoolAbstract.ConnectionController; import org.gearman.core.GearmanCallbackHandler; import org.gearma...
package org.gearman; public abstract class GearmanJob { /** * Defines the priority of a GearmanJob. The priority defines where in the * server's job queue this job will reside. Jobs with a high priority will * be grabbed before all others, and jobs with a normal priority will be * grabbed before those wi...
private ByteArray jobHandle;
5
Protino/Fad-Flicks
app/src/main/java/com/calgen/prodek/fadflicks/Activity/DetailActivity.java
[ "public class VideosAdapter extends RecyclerView.Adapter<VideosAdapter.VideoViewHolder> {\n\n public static Map<YouTubeThumbnailView, YouTubeThumbnailLoader> viewLoaderMap = new HashMap<>();\n private Context context;\n private List<String> keys;\n private Callback callback;\n\n\n public VideosAdapte...
import android.content.Intent; import android.content.res.Configuration; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CoordinatorLayout; import android.support....
/* * Copyright 2016 Gurupad Mamadapur * * 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 appl...
int overlayTopDimen = UI.dpToPx((int) getResources().getDimension(R.dimen.overlayTopDimen));
5
Nauktis/SolarFlux
src/main/java/com/nauktis/solarflux/blocks/SolarPanelTileEntity.java
[ "public final class Utils {\n public static final Random RANDOM = new Random();\n\n /**\n * Utility class, no public constructor.\n */\n private Utils() {\n\n }\n\n /**\n * Returns true for server side world.\n */\n public static boolean isServer(World pWorld) {\n return !pW...
import cofh.api.energy.IEnergyProvider; import com.google.common.base.Objects; import com.google.common.collect.Maps; import com.google.common.collect.Range; import com.nauktis.core.inventory.BaseInventory; import com.nauktis.core.tileentity.BaseModTileEntitySynced; import com.nauktis.core.utility.Utils; import com.nau...
package com.nauktis.solarflux.blocks; public class SolarPanelTileEntity extends BaseModTileEntitySynced implements IInventory, IEnergyProvider { public static final int INVENTORY_SIZE = 5; public static final Range<Integer> UPGRADE_SLOTS = Range.closedOpen(0, INVENTORY_SIZE); /** * Random number to...
if (itemStack != null && itemStack.getItem() instanceof UpgradeItem) {
4
dialogflow/dialogflow-android-client
ailib/src/main/java/ai/api/services/SpeaktoitRecognitionServiceImpl.java
[ "public class AIConfiguration extends ai.api.AIConfiguration {\n public enum RecognitionEngine {\n\n /**\n * Google Speech Recognition integrated into Android OS\n *\n * @deprecated Use System instead\n */\n @Deprecated\n Google,\n\n /**\n * Def...
import android.content.Context; import android.content.res.AssetFileDescriptor; import android.media.AudioFormat; import android.media.AudioRecord; import android.media.MediaPlayer; import android.media.MediaRecorder; import android.os.AsyncTask; import android.support.annotation.NonNull; import android.util.Log; impor...
synchronized (recognizerLock) { if (isRecording) { audioRecord.stop(); isRecording = false; final AssetFileDescriptor cancelSound = config.getRecognizerCancelSound(); if (cancelSound != null) { playSound(cancelSound...
while (bytes.length >= FRAME_SIZE_IN_BYTES) {
3
masl123/YM2151-Midi-Controller
src/ym2151/MainJFrame.java
[ "public enum Channels{\n\tCH1(\"Channel 1\", 0), CH2(\"Channel 2\", 1), CH3(\"Channel 3\",2), CH4(\"Channel 4\",3), CH5(\"Channel 5\",4), CH6(\"Channel 6\",5), CH7(\"Channel 7\",6), CH8(\"Channel 8\", 7);\n\t\n\tprivate String display;\n\tpublic final int num;\n\t\n\tprivate Channels(String display, int num){\n\t\t...
import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; impo...
public void actionPerformed(ActionEvent arg0) { instrumentMapperPanel.saveToOPM(); } }); mnFile.add(mntmExportToOpm); JSeparator separator_1 = new JSeparator(); mnFile.add(separator_1); JSeparator separator_2 = new JSeparator(); mnFile.add(separator_2); mnFile.add(mntmExit); //a...
PatchFileManager mgr = new PatchFileManager();
6
ppicas/android-clean-architecture-mvp
app/src/main/java/cat/ppicas/cleanarch/ui/presenter/CityDailyForecastPresenter.java
[ "public class DailyForecast {\n\n private String mCityId;\n private Date mDate;\n private String mDescription;\n private double mDayTemp;\n private double mMinTemp;\n private double mMaxTemp;\n private double mHumidity;\n private double mWindSpeed;\n\n public DailyForecast(String cityId, ...
import java.util.List; import cat.ppicas.cleanarch.R; import cat.ppicas.cleanarch.model.DailyForecast; import cat.ppicas.cleanarch.repository.DailyForecastRepository; import cat.ppicas.cleanarch.task.GetDailyForecastsTask; import cat.ppicas.cleanarch.text.NumberFormat; import cat.ppicas.cleanarch.ui.vista.CityDailyFore...
/* * Copyright (C) 2015 Pau Picas Sans <pau.picas@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
vista.setDayTemp(NumberFormat.formatTemperature(df.getDayTemp()));
3
mentlerd/HybridVM
engine/hu/mentlerd/hybrid/lib/CoroutineLib.java
[ "public class CallFrame{\r\n\t\r\n\tpublic final Coroutine coroutine;\r\n\t\r\n\tpublic LuaClosure closure;\r\n\tpublic Callable function;\r\n\t\r\n\tpublic int pc;\r\n\r\n\tpublic int localBase;\r\n\tpublic int argCount;\r\n\r\n\tprotected int returnBase;\r\n\t\r\n\tprotected boolean fromLua;\r\n\tprotected boolea...
import hu.mentlerd.hybrid.CallFrame; import hu.mentlerd.hybrid.Callable; import hu.mentlerd.hybrid.Coroutine; import hu.mentlerd.hybrid.LuaClosure; import hu.mentlerd.hybrid.LuaException; import hu.mentlerd.hybrid.LuaTable; import hu.mentlerd.hybrid.LuaUtil;
package hu.mentlerd.hybrid.lib; public enum CoroutineLib implements Callable{ CREATE { public int call(CallFrame frame, int argCount) { LuaClosure closure = getFunction(frame);
Coroutine coroutine = new Coroutine(frame.getPlatform(), frame.getEnv(), closure);
2
sheimi/SGit
src/main/java/me/sheimi/sgit/RepoListActivity.java
[ "public class SheimiFragmentActivity extends Activity {\n\n public static interface OnBackClickListener {\n public boolean onClick();\n }\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n BasicFunctions.setActiveActivity(thi...
import android.app.Activity; import android.app.AlertDialog; import android.content.ActivityNotFoundException; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import ...
package me.sheimi.sgit; public class RepoListActivity extends SheimiFragmentActivity { private static final String LOGTAG = RepoListActivity.class.getSimpleName(); private static final int MAX_UPGRADE_SHOW_TIMES = 4; private ListView mRepoList; private RepoListAdapter mRepoListAdapter; privat...
if (Profile.incUpgradeMesssageShownCount(getApplicationContext()) > MAX_UPGRADE_SHOW_TIMES) {
2
xda/XDA-One
android/src/main/java/com/xda/one/ui/CreateMessageFragment.java
[ "public class RetrofitPrivateMessageClient implements PrivateMessageClient {\n\n private static PrivateMessageClient sMessageClient;\n\n private final PrivateMessageAPI mMessageAPI;\n\n private final EventBus mBus;\n\n private RetrofitPrivateMessageClient(final Context context) {\n mMessageAPI = ...
import com.squareup.otto.Subscribe; import com.squareup.picasso.Picasso; import com.xda.one.R; import com.xda.one.api.inteface.PrivateMessageClient; import com.xda.one.api.retrofit.RetrofitPrivateMessageClient; import com.xda.one.auth.XDAAccount; import com.xda.one.event.message.MessageSendingFailedEvent; import com.xd...
package com.xda.one.ui; public class CreateMessageFragment extends DialogFragment implements TextWatcher { private static final int SELECT_EMOTICON_REQUEST_CODE = 101; private static final String USERNAME_ARGUMENT = "username"; private final EventListener mEventListener = new EventListener(); pr...
mPrivateMessageClient = RetrofitPrivateMessageClient.getClient(getActivity());
0
xuxueli/xxl-api
xxl-api-admin/src/main/java/com/xxl/api/admin/controller/XxlApiGroupController.java
[ "public class ArrayTool {\n\n public static final int INDEX_NOT_FOUND = -1;\n\n public static int getLength(final Object array) {\n if (array == null) {\n return 0;\n }\n return Array.getLength(array);\n }\n\n public static boolean isEmpty(final Object[] array) {\n ...
import com.xxl.api.admin.core.model.*; import com.xxl.api.admin.core.util.tool.ArrayTool; import com.xxl.api.admin.core.util.tool.StringTool; import com.xxl.api.admin.dao.IXxlApiDocumentDao; import com.xxl.api.admin.dao.IXxlApiGroupDao; import com.xxl.api.admin.dao.IXxlApiProjectDao; import com.xxl.api.admin.service.im...
package com.xxl.api.admin.controller; /** * @author xuxueli 2017-03-31 18:10:37 */ @Controller @RequestMapping("/group") public class XxlApiGroupController { @Resource private IXxlApiProjectDao xxlApiProjectDao; @Resource private IXxlApiGroupDao xxlApiGroupDao; @Resource private IXxlApiDocumentDao xxlApiDoc...
ArrayTool.contains(StringTool.split(loginUser.getPermissionBiz(), ","), String.valueOf(bizId))
0
h2r/burlapcraft
src/main/java/edu/brown/cs/h2r/burlapcraft/domaingenerator/MinecraftDomainGenerator.java
[ "public class PFAgentOnBlock extends PropositionalFunction {\n\n\tpublic PFAgentOnBlock(String name, String[] parameterClasses) {\n\t\tsuper(name, parameterClasses);\n\n\t}\n\n\t@Override\n\tpublic boolean isTrue(OOState s, String... params) {\n\t\tBCAgent a = (BCAgent)s.object(params[0]);\n\t\tBCBlock b = (BCBlock...
import burlap.mdp.auxiliary.DomainGenerator; import burlap.mdp.core.TerminalFunction; import burlap.mdp.core.oo.OODomain; import burlap.mdp.core.oo.propositional.PropositionalFunction; import burlap.mdp.singleagent.common.UniformCostRF; import burlap.mdp.singleagent.model.FactoredModel; import burlap.mdp.singleagent.mo...
package edu.brown.cs.h2r.burlapcraft.domaingenerator; /** * Class to generate burlap domain for minecraft. You can set a white list for actions if you only want to use * a subset of the actions provided. The model for the domain is a {@link FactoredModel} that allows you * to specify independent reward functions...
.addStateClass(CLASS_MAP, BCMap.class);
6
kermitt2/grobid-ner
src/main/java/org/grobid/trainer/SenseTrainer.java
[ "public class FeaturesVectorNERSense {\n\n public String string = null; // lexical feature\n public String label = null; // label if known\n\n public String capitalisation = null;// one of INITCAP, ALLCAPS, NOCAPS\n public String digit; // one of ALLDIGIT, CONTAINDIGIT, NODIGIT\n ...
import org.grobid.core.GrobidModels; import org.grobid.core.exceptions.GrobidException; import org.grobid.core.exceptions.GrobidResourceException; import org.grobid.core.features.FeaturesVectorNERSense; import org.grobid.core.lexicon.Lexicon; import org.grobid.core.lexicon.NERLexicon; import org.grobid.core.main.Grobid...
package org.grobid.trainer; /** * Train a model for estimating the most likely synset for a recognized named entity. This sense * enriches the NER results and can be exploited for improving the entity disambiguation resolution * in a further stage. * * @author Patrice Lopez */ public class SenseTrainer extend...
GrobidNerConfiguration grobidNerConfiguration = null;
2
svarzee/gpsoauth-java
src/main/java/xxx/sun/security/ssl/Handshaker.java
[ "final static class BulkCipher {\n\n // descriptive name including key size, e.g. AES/128\n final String description;\n\n // JCE cipher transformation string, e.g. AES/CBC/NoPadding\n final String transformation;\n\n // algorithm name, e.g. AES\n final String algorithm;\n\n // supported and com...
import sun.misc.HexDumpEncoder; import sun.security.internal.spec.TlsKeyMaterialParameterSpec; import sun.security.internal.spec.TlsKeyMaterialSpec; import sun.security.internal.spec.TlsMasterSecretParameterSpec; import xxx.sun.security.ssl.CipherSuite.BulkCipher; import xxx.sun.security.ssl.CipherSuite.KeyExchange; im...
return activeCipherSuites; } /* * Get the active protocol versions. * * In TLS 1.1, many weak or vulnerable cipher suites were obsoleted, * such as TLS_RSA_EXPORT_WITH_RC4_40_MD5. The implementation MUST NOT * negotiate these cipher suites in TLS 1.1 or later mode. * ...
BulkCipher cipher = cipherSuite.cipher;
0
cloudera/director-aws-plugin
provider/src/main/java/com/cloudera/director/aws/ec2/allocation/AbstractInstanceAllocator.java
[ "public static <T> T retryUntil(Callable<T> func)\n throws InterruptedException, RetryException, ExecutionException {\n return retryUntil(func, DEFAULT_TIMEOUT);\n}", "public class AWSExceptions {\n\n private static final Logger LOG = LoggerFactory.getLogger(AWSExceptions.class);\n\n /**\n * Error code su...
import static com.cloudera.director.aws.ec2.EC2Retryer.retryUntil; import static com.google.common.collect.Iterables.getOnlyElement; import com.amazonaws.AmazonServiceException; import com.amazonaws.services.ec2.AmazonEC2AsyncClient; import com.amazonaws.services.ec2.model.CreateTagsRequest; import com.amazonaws.servic...
// (c) Copyright 2018 Cloudera, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
protected final EC2TagHelper ec2TagHelper;
5
olmozavala/OWGIS_V2
src/java/com/mapviewer/business/OpenLayersManager.java
[ "public class OpenLayerMapConfig {\n\t\n private int imageResolution;\n\tprivate String center = null;\n\tprivate String zoom = null;\n\tprivate int zoomLevels;\n\tprivate double zoomFactor;\n\tprivate double maxResolution;//Controls the maximum resolution of the map\n\tprivate String restrictedExtent = \"-180.0...
import com.mapviewer.conf.OpenLayerMapConfig; import com.mapviewer.exceptions.XMLFilesException; import com.mapviewer.model.Layer; import com.mapviewer.model.menu.MenuEntry; import com.mapviewer.tools.ConvertionTools; import com.mapviewer.tools.StringAndNumbers; import java.util.ArrayList;
/* * Copyright (c) 2013 Olmo Zavala * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in the * Software without restriction, including without limitation the rights to use, copy, * modify, merge, publish, dis...
public OpenLayersManager() throws XMLFilesException {
1
Sleeksnap/sleeksnap
src/org/sleeksnap/uploaders/images/imgur/ImgurAuthentication.java
[ "public class ScreenSnapper {\n\n\t/**\n\t * A basic class which lets us execute a custom action based on the\n\t * ScreenshotAction class\n\t * \n\t * @author Nikki\n\t * \n\t */\n\t@SuppressWarnings(\"serial\")\n\tprivate class ActionMenuItem extends MenuItem implements ActionListener {\n\t\t/**\n\t\t * The actio...
import java.net.HttpURLConnection; import java.net.URL; import java.net.URLConnection; import java.util.logging.Logger; import org.json.JSONException; import org.json.JSONObject; import org.sleeksnap.ScreenSnapper; import org.sleeksnap.http.HttpUtil; import org.sleeksnap.http.RequestData; import org.sleeksnap.uploaders...
package org.sleeksnap.uploaders.images.imgur; /** * Provides helpful methods for Authentication on Imgur * * @author Nikki * */ public class ImgurAuthentication { private static final Logger logger = Logger.getLogger(ImgurUploader.class.getName()); /** * The Imgur Refresh Auth URL */ private static ...
if(Util.currentTimeSeconds() > account.getExpirationTime()) {
5
vbauer/herald
src/main/java/com/github/vbauer/herald/injector/LoggerInjector.java
[ "@SuppressWarnings(\"serial\")\npublic class LoggerInstantiationException extends HeraldException {\n\n private final LogFactory loggerFactory;\n\n\n public LoggerInstantiationException(final LogFactory loggerFactory) {\n this.loggerFactory = loggerFactory;\n }\n\n\n /**\n * Get logger factor...
import com.github.vbauer.herald.annotation.Log; import com.github.vbauer.herald.exception.LoggerInstantiationException; import com.github.vbauer.herald.exception.MissedLogFactoryException; import com.github.vbauer.herald.logger.LogFactory; import com.github.vbauer.herald.util.ReflectionUtils; import com.github.vbauer.h...
package com.github.vbauer.herald.injector; /** * @author Vladislav Bauer */ public final class LoggerInjector { private static final Collection<LogFactory> LOG_FACTORIES = loadLogFactories(); private LoggerInjector() { throw new UnsupportedOperationException(); } public static void in...
ReflectionUtils.setAccessible(field, true);
3
mslosarz/nextrtc-signaling-server
src/main/java/org/nextrtc/signalingserver/factory/SpringConversationFactory.java
[ "@Getter\n@Component\n@Scope(\"prototype\")\npublic abstract class Conversation implements NextRTCConversation {\n protected static final ExecutorService parallel = Executors.newCachedThreadPool();\n protected final String id;\n\n private LeftConversation leftConversation;\n protected MessageSender mess...
import org.nextrtc.signalingserver.domain.Conversation; import org.nextrtc.signalingserver.domain.conversation.BroadcastConversation; import org.nextrtc.signalingserver.domain.conversation.MeshConversation; import org.nextrtc.signalingserver.domain.conversation.MeshWithMasterConversation; import org.nextrtc.signalingse...
package org.nextrtc.signalingserver.factory; @Component public class SpringConversationFactory extends AbstractConversationFactory { private ApplicationContext context; @Autowired public SpringConversationFactory(ApplicationContext context, NextRTCProperties properties) { super(properties); ...
return context.getBean(MeshConversation.class, conversationName);
2
sunhong/jcurses
src/jcurses/util/Message.java
[ "public class Button extends Widget {\r\n\t\r\n \r\n\t\r\n\tprivate ActionListenerManager _listenerManager = new ActionListenerManager();\r\n\t\r\n\t\r\n\tprivate static CharColor __buttonDefaultColors = new CharColor(CharColor.WHITE, CharColor.BLACK);\r\n\t\r\n\tpublic CharColor getDefaultColors() {\r\n\t\treturn ...
import jcurses.event.ActionEvent; import jcurses.event.ActionListener; import jcurses.widgets.Button; import jcurses.widgets.Label; import jcurses.widgets.DefaultLayoutManager; import jcurses.widgets.Dialog; import jcurses.widgets.WidgetsConstants; import java.util.StringTokenizer;
package jcurses.util; /** * This is a class to create and show user defined messages. * Such message is a dialog with an user defined title, containing * an user defined text and a button to close the window with an user * defined label. */ public class Message extends Dialog implements ActionLi...
manager.addWidget(_label,0,0,getWidth(text, _title)+2, getHeight(text)+2, WidgetsConstants.ALIGNMENT_CENTER,
4
biointec/halvade
halvade/src/be/ugent/intec/halvade/MapReduceRunner.java
[ "public class GenomeSJ implements WritableComparable<GenomeSJ> {\n protected int type; // -2 = overhang length, -1 = sj string, 2 = count per key region\n protected int secondary_key;\n\n public void setOverhang(int overhang) {\n this.type = -2;\n this.secondary_key = overhang;\n }\n \...
import org.seqdoop.hadoop_bam.SAMRecordWritable; import org.seqdoop.hadoop_bam.VariantContextWritable; import be.ugent.intec.halvade.hadoop.datatypes.ChromosomeRegion; import be.ugent.intec.halvade.hadoop.datatypes.GenomeSJ; import be.ugent.intec.halvade.hadoop.mapreduce.HTSeqCombineMapper; import be.ugent.intec.halvad...
/* * Copyright (C) 2014 ddecap * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed...
pass1Job.setMapOutputKeyClass(GenomeSJ.class);
0
vasl-developers/vasl
src/VASL/build/module/map/CounterDetailViewer.java
[ "public class Hex {\n\n\t// Property variables\n\tprivate\tString\tname;\n\tprivate\tint\t\tcolumnNumber;\n\tprivate\tint\t\trowNumber;\n\tprivate\tint\t\tbaseHeight;\n\tprivate\tboolean northOnMap\t\t= true;\n\tprivate\tboolean northEastOnMap = true;\n\tprivate\tboolean southEastOnMap = true;\n\tprivate\tboolean...
import VASL.LOS.Map.Hex; import VASL.LOS.Map.Map; import VASL.build.module.ASLMap; import static VASL.build.module.map.boardPicker.ASLBoard.DEFAULT_HEX_HEIGHT; import java.awt.Rectangle; import VASL.counters.TextInfo; import VASSAL.build.module.map.boardPicker.Board; import VASSAL.build.module.map.boardPicker.board.map...
/* * Copyright (c) 2000-2007 by Rodney Kinney * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License (LGPL) as published by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, * but W...
final BufferedImage imgMapIcon = ((ASLMap)map).getImgMapIcon(ptPosition, isize, os_scale);
2
hpdcj/PCJ
src/main/java/org/pcj/internal/InternalPCJ.java
[ "public class AliveState {\n\n private static final Logger LOGGER = Logger.getLogger(AliveState.class.getName());\n private final ConcurrentMap<SocketChannel, LocalDateTime> nodeLastNotificationMap;\n private final ScheduledExecutorService scheduledExecutorService;\n private final AliveMessage aliveMess...
import java.io.UncheckedIOException; import java.nio.channels.SocketChannel; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; ...
/* * Copyright (c) 2011-2021, PCJ Library, Marek Nowicki * All rights reserved. * * Licensed under New BSD License (3-clause license). * * See the file "LICENSE" for the full license governing this code. */ package org.pcj.internal; /** * Internal class for external PCJ class. * * @author Marek Nowicki (far...
nodeData.setHelloState(new HelloState(allNodesThreadCount));
3
kstateome/lti-attendance
src/main/java/edu/ksu/canvas/attendance/controller/StudentSummaryController.java
[ "@Entity\n@Table(name = \"attendance\")\n@Check(constraints = \"minutes_missed >= 0 and status IN ('PRESENT', 'TARDY', 'ABSENT', 'EXCUSED', 'NA')\")\npublic class Attendance implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n @Id\n @GeneratedValue(generator = \"ATTENDANCE_SEQ...
import edu.ksu.canvas.attendance.entity.Attendance; import edu.ksu.canvas.attendance.entity.AttendanceAssignment; import edu.ksu.canvas.attendance.entity.AttendanceSection; import edu.ksu.canvas.attendance.entity.AttendanceStudent; import edu.ksu.canvas.attendance.exception.MissingSisIdException; import edu.ksu.canvas....
package edu.ksu.canvas.attendance.controller; @Controller @Scope("session") @RequestMapping("/studentSummary") public class StudentSummaryController extends AttendanceBaseController { private static final Logger LOG = LogManager.getLogger(StudentSummaryController.class); @Autowired private MakeupServi...
s.getAttendances().sort(Comparator.comparing(Attendance::getDateOfClass).reversed());
0
IAmContent/public
public-java/robots/iamcontent-robonova-1/src/main/java/com/iamcontent/robot/robonova1/RobonovaCommandLineDriver.java
[ "public static <T> T newInstance(String className, Class<T> castTo) {\r\n\treturn castTo.cast(newInstance(forName(className)));\r\n}\r", "public static String packageNameOf(Class<?> clazz) {\r\n\treturn clazz.getPackage().getName();\r\n}\r", "public interface ServoSource<C> extends PerChannelSource<C, Servo> {\...
import static com.iamcontent.core.LangUtils.newInstance; import static com.iamcontent.core.LangUtils.packageNameOf; import static org.apache.commons.lang3.StringUtils.capitalize; import com.iamcontent.device.servo.ServoSource; import com.iamcontent.device.servo.command.CompoundServoCommand; import com.iamcontent.d...
/** IAmContent Public Libraries. Copyright (C) 2015-2021 Greg Elderfield @author Greg Elderfield, support@jarchitect.co.uk This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either vers...
protected CompoundServoCommand<ServoId> compoundCommand(String commandName) {
3
oosthuizenr/Livingstone
app/src/main/java/com/livingstoneapp/fragments/ContentProvidersFragment.java
[ "public class DividerItemDecoration extends RecyclerView.ItemDecoration {\n\n private static final int[] ATTRS = new int[]{\n android.R.attr.listDivider\n };\n\n public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL;\n\n public static final int VERTICAL_LIST = LinearLayoutM...
import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v4.app.Fragment; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; ...
package com.livingstoneapp.fragments; public class ContentProvidersFragment extends Fragment implements IContentProvidersFragmentView { private static final String ARG_PACKAGE_NAME = "package_name_param"; @Inject IContentProvidersFragmentPresenter mPresenter; @Bind(R.id.item_list) RecyclerV...
private RecyclerViewOnClickListener<ContentProviderInfo> onItemClickListener = new RecyclerViewOnClickListener<ContentProviderInfo>() {
4
yangwencan2002/MediaLoader
library/src/main/java/com/vincan/medialoader/tinyhttpd/codec/HttpRequestDecoder.java
[ "public final class HttpConstants {\r\n\r\n public final static String CRLF = \"\\r\\n\";\r\n\r\n public final static String SP = \" \";\r\n\r\n public final static String COLON = \":\";\r\n\r\n public static final String CHARSET_DEFAULT = \"UTF-8\";\r\n\r\n public static final String PARAM_SIGN = \"...
import android.text.TextUtils; import com.vincan.medialoader.tinyhttpd.HttpConstants; import com.vincan.medialoader.tinyhttpd.HttpHeaders; import com.vincan.medialoader.tinyhttpd.HttpVersion; import com.vincan.medialoader.tinyhttpd.request.HttpMethod; import com.vincan.medialoader.tinyhttpd.request.HttpRequest; import ...
package com.vincan.medialoader.tinyhttpd.codec; /** * {@link HttpRequest}的解码器 * * @author vincanyang */ public class HttpRequestDecoder implements RequestDecoder<HttpRequest> { @Override public HttpRequest decode(byte[] bytes) throws ResponseException { String rawRequest = new String(bytes); ...
HttpHeaders headers = new HttpHeaders();
1
caprica/picam
src/test/java/uk/co/caprica/picam/tutorial/configuration/MyCameraApplication3.java
[ "public final class CameraConfiguration {\n\n private static final Integer DEFAULT_WIDTH = 2592;\n\n private static final Integer DEFAULT_HEIGHT = 1944;\n\n private Integer cameraNumber = 0;\n\n private Integer customSensorConfig = 0;\n\n private Integer width = DEFAULT_WIDTH;\n\n private Integer ...
import uk.co.caprica.picam.CameraConfiguration; import uk.co.caprica.picam.NativeLibraryException; import uk.co.caprica.picam.enums.AutomaticWhiteBalanceMode; import uk.co.caprica.picam.enums.Encoding; import static uk.co.caprica.picam.CameraConfiguration.cameraConfiguration; import static uk.co.caprica.picam.PicamNati...
/* * This file is part of picam. * * picam is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * picam is distributed in the hope...
CameraConfiguration config = cameraConfiguration()
4
trivago/Mail-Pigeon
pigeon-web/src/main/java/com/trivago/mail/pigeon/web/components/mail/ModalAddNewsletter.java
[ "public class Mail extends AbstractBean\r\n{\r\n\tpublic static final String ID = \"newsletter_id\";\r\n\tpublic static final String DATE = \"send_date\";\r\n\tpublic static final String SUBJECT = \"subject\";\r\n\tpublic static final String TEXT = \"text_content\";\r\n\tpublic static final String HTML = \"html_con...
import com.trivago.mail.pigeon.bean.Mail; import com.trivago.mail.pigeon.bean.MailTemplate; import com.trivago.mail.pigeon.bean.RecipientGroup; import com.trivago.mail.pigeon.bean.Sender; import com.trivago.mail.pigeon.storage.Util; import com.trivago.mail.pigeon.web.components.groups.GroupSelectBox; import com.t...
final TemplateSelectBox templateSelectBox = new TemplateSelectBox(); final TextField tfSubject = new TextField("Subject"); final DateField tfSendDate = new DateField("Send Date"); final Button cancelButton = new Button("Cancel"); final Button saveButton = new Button("Send"); tfSendDate.setInval...
queueNewsletter.queueNewsletter(m, s, new RecipientGroup(groupSelectBox.getSelectedGroup()));
2
Deltik/SignEdit
src/net/deltik/mc/signedit/subcommands/RedoSignSubcommand.java
[ "public class ChatComms {\n private Player player;\n private Configuration config;\n private ResourceBundle phrases;\n private MessageFormat messageFormatter;\n\n @Inject\n public ChatComms(Player player, Configuration config, UserComms userComms) {\n this(player, config, userComms.getClass...
import net.deltik.mc.signedit.ChatComms; import net.deltik.mc.signedit.SignText; import net.deltik.mc.signedit.SignTextHistory; import net.deltik.mc.signedit.SignTextHistoryManager; import net.deltik.mc.signedit.interactions.SignEditInteraction; import org.bukkit.entity.Player; import javax.inject.Inject;
/* * Copyright (C) 2017-2021 Deltik <https://www.deltik.net/> * * This file is part of SignEdit for Bukkit. * * SignEdit for Bukkit 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 th...
SignText redoneSignText = history.redo();
1
chengzichen/KrGallery
gallery/src/main/java/com/dhc/gallery/proxy/ImageReceiver.java
[ "public class AnimatedFileDrawable extends BitmapDrawable implements Animatable {\n\n private long lastFrameTime;\n private int lastTimeStamp;\n private int invalidateAfter = 50;\n private final int[] metaData = new int[3];\n private Runnable loadFrameTask;\n private Bitmap renderingBitmap;\n p...
import android.graphics.Bitmap; import android.graphics.BitmapShader; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.Rect; impor...
package com.dhc.gallery.proxy; public class ImageReceiver implements NotificationCenter.NotificationCenterDelegate { public interface ImageReceiverDelegate { void didSetImage(ImageReceiver imageReceiver, boolean set, boolean thumb); } private class SetImageBackup { public TLObject fileL...
ImageLoader.getInstance().cancelLoadingForImageReceiver(this, 0);
3
TreyRuffy/CommandBlocker
Command Blocker Bungee/src/main/java/me/treyruffy/commandblocker/bungeecord/BungeeMain.java
[ "public class Universal {\n\n\tprivate static Universal instance = null;\n\tprivate MethodInterface mi;\n\t\n\tpublic static Universal get() {\n\t\treturn instance == null ? instance = new Universal() : instance;\n\t}\n\t\n\tpublic void setup(MethodInterface mi) {\n\t\tthis.mi = mi;\n\t\t\n\t\tmi.setupMetrics();\n\...
import me.treyruffy.commandblocker.Universal; import me.treyruffy.commandblocker.bungeecord.commands.CommandBlockerCommand; import me.treyruffy.commandblocker.bungeecord.config.BungeeConfigManager; import me.treyruffy.commandblocker.bungeecord.config.BungeeUpdateConfig; import me.treyruffy.commandblocker.bungeecord.lis...
package me.treyruffy.commandblocker.bungeecord; public class BungeeMain extends Plugin { private static BungeeMain instance; private static BungeeAudiences adventure; public static @NotNull BungeeAudiences adventure() { if (adventure == null) { throw new IllegalStateException("Tried to access Adventure wh...
getProxy().getPluginManager().registerCommand(this, new CommandBlockerCommand());
1
blanu/sneakermesh
shared/src/net/blanu/sneakermesh/Sneakermesh.java
[ "public abstract class Message implements Comparable<Message>\n{\n\tpublic static final int MSG_TEXT=0;\n\tpublic static final int MSG_PHOTO=1;\n\t\n\tprotected static Random random=new Random();\n\tprotected static File tmp;\n\t\n\tpublic static Logger logger=null;\n\t\n\tpublic int type;\n\tpublic long timestamp;...
import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.Inet...
public boolean isPasswordSet() { return password!=null; } public void addPeer(InetAddress peer) { String peerIp=peer.toString(); db.addPeer(peerIp); } public List<String> getPeers() { return db.getPeers(); } public void sync() { try { while(true) { List<String> peers=db.getPeer...
if(msg instanceof PresenceCommand)
5
Assassinss/Interessant
app/src/androidTest/java/me/zsj/interessant/ExampleInstrumentedTest.java
[ "public interface DailyApi {\r\n\r\n @GET(\"v2/feed?num=2\")\r\n Flowable<Daily> getDaily(@Query(\"date\") long date);\r\n\r\n @GET(\"v2/feed?num=2\")\r\n Flowable<Daily> getDaily();\r\n\r\n}\r", "public interface ReplyApi {\r\n\r\n @GET(\"v1/replies/video\")\r\n Flowable<Replies> fetchReplies(@...
import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import android.util.Log; import org.junit.Test; import org.junit.runner.RunWith; import java.util.List; import me.zsj.interessant.api.DailyApi; import me.zsj.interessant.api.Rep...
package me.zsj.interessant; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() th...
final ReplyApi replyApi = RetrofitFactory.getRetrofit().createApi(ReplyApi.class);
1
abs-platform/abs-software
src/Android/payloadSDK/src/main/java/com/google/abs/payloadsdk/PayloadApp.java
[ "public class Arduino {\n\n private SDB sdb;\n\n /**\n * Arduino constructor\n * @param sdb\n */\n\n public Arduino(SDB sdb)\n {\n this.sdb = sdb;\n }\n\n /**\n * Write a 1 or a 0 value to a digital pin.\n *\n * @param pin the number of the digital pin you want to ...
import android.app.Service; import android.content.Intent; import android.os.IBinder; import com.google.abs.payloadsdk.Arduino.Arduino; import com.google.abs.payloadsdk.Measures.Attitude; import com.google.abs.payloadsdk.Measures.Energy; import com.google.abs.payloadsdk.Measures.OrbitalState; import com.google.abs.payl...
package com.google.abs.payloadsdk; public class PayloadApp extends Service { private SDB sdb; private Arduino arduino; public PayloadApp(String appName) { sdb = new SDB(); sdb.execute(); arduino = new Arduino(sdb); //sdb.send(new SDBPacket(SDBPacket.CMD.HANDSHAKE, a...
public Energy getEnergy()
2
adelbs/ISO8583
src/test/java/org/adelbs/iso8583/clientserver/MockISOClient.java
[ "public class ConnectionException extends Exception {\n\n\tprivate static final long serialVersionUID = 2L;\n\n\tpublic ConnectionException(String message) {\n\t\tsuper(message);\n\t}\n\n}", "public class ParseException extends Exception {\n\n\tprivate static final long serialVersionUID = 2L;\n\n\tpublic ParseExc...
import java.io.IOException; import java.util.ArrayList; import java.util.concurrent.Callable; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPathExpressionException; import org.adelbs.iso8583.exception.ConnectionException; import org.adelbs.iso8583.exception.ParseException; import org.ad...
package org.adelbs.iso8583.clientserver; class MockISOClient extends MockISOConnection implements Callable<MockResult> { private MockClientCallback callback = new MockClientCallback(ISOCONFIG); public MockISOClient(final String host, final int port) throws IOException, ConnectionException { this.conn = new ...
final ArrayList<FieldVO> fieldList = messageToBeSent.getFieldList();
3
benjaminpick/java-thumbnailer
test/src/de/uni_siegen/wineme/come_in/thumbnailer/test/ThumbnailersFailingTest.java
[ "public class JODWordConverterThumbnailer extends JODConverterThumbnailer {\n\n\tpublic JODWordConverterThumbnailer() throws IOException { super(); }\n\n\tprotected String getStandardOpenOfficeExtension() {\n\t\treturn \".odt\";\n\t}\n\n\tprotected String getStandardZipExtension() {\n\t\treturn \"docx\";\n\t}\n\tpr...
import java.io.File; import java.io.IOException; import de.uni_siegen.wineme.come_in.thumbnailer.ThumbnailerException; import de.uni_siegen.wineme.come_in.thumbnailer.thumbnailers.JODWordConverterThumbnailer; import de.uni_siegen.wineme.come_in.thumbnailer.thumbnailers.NativeImageThumbnailer; import de.uni_siegen.winem...
package de.uni_siegen.wineme.come_in.thumbnailer.test; /** * Failures due to a file type mismatch * must emit a ThumbnailerException * * @author Benjamin * */ public class ThumbnailersFailingTest extends MyTestCase { Thumbnailer currentThumbnailer; public void assert_fail_generation(File input) throws ...
currentThumbnailer = new JODWordConverterThumbnailer();
0
krokers/exchange-rates-mvvm
data/src/main/java/eu/rampsoftware/er/data/datasource/local/DatabaseCurrencyDataSource.java
[ "public class CurrencyData {\n private final String mBaseCurrency;\n private Date mDate;\n private Map<String, Double> mCurrencies;\n\n public CurrencyData(final Date date, final Map<String, Double> currencies, final String baseCurrency) {\n mDate = date;\n mCurrencies = currencies;\n ...
import android.text.TextUtils; import java.util.Date; import java.util.HashMap; import java.util.Map; import eu.rampsoftware.er.data.CurrencyData; import eu.rampsoftware.er.data.SingleValue; import eu.rampsoftware.er.data.datasource.CurrencyDataSource; import eu.rampsoftware.er.data.datasource.local.model.ValueEntity; ...
package eu.rampsoftware.er.data.datasource.local; public class DatabaseCurrencyDataSource extends RealmManagerBase implements CurrencyDataSource { public DatabaseCurrencyDataSource() { super(); } @Override public Observable<CurrencyData> getCurrencies(final Date date) { final l...
final RealmResults<ValueEntity> items = realm.where(ValueEntity.class)
3
YoannBuch/DependencyInjectionAgent
test-applications/spring-petclinic/src/test/java/org/springframework/samples/petclinic/service/AbstractClinicServiceTests.java
[ "@Entity\n@Table(name = \"owners\")\npublic class Owner extends Person {\n @Column(name = \"address\")\n @NotEmpty\n private String address;\n\n @Column(name = \"city\")\n @NotEmpty\n private String city;\n\n @Column(name = \"telephone\")\n @NotEmpty\n @Digits(fraction = 0, integer = 10)\...
import static org.assertj.core.api.Assertions.assertThat; import java.util.Collection; import org.joda.time.DateTime; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.samples.petclinic.model.Owner; import org.springframework.samples.petclinic.model.Pet; im...
/* * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
PetType petType1 = EntityUtils.getById(petTypes, PetType.class, 1);
5