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 |
|---|---|---|---|---|---|---|
CableIM/Cable-Android | src/org/thoughtcrime/securesms/crypto/storage/TextSecureIdentityKeyStore.java | [
"public class SessionUtil {\n\n public static boolean hasSession(Context context, MasterSecret masterSecret, Recipient recipient) {\n return hasSession(context, masterSecret, recipient.getNumber());\n }\n\n public static boolean hasSession(Context context, MasterSecret masterSecret, @NonNull String number) {\... | import android.content.Context;
import android.util.Log;
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil;
import org.thoughtcrime.securesms.crypto.SessionUtil;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.IdentityDatabase;
import org.thoughtcrime.secure... | package org.thoughtcrime.securesms.crypto.storage;
public class TextSecureIdentityKeyStore implements IdentityKeyStore {
private static final int TIMESTAMP_THRESHOLD_SECONDS = 5;
private static final String TAG = TextSecureIdentityKeyStore.class.getSimpleName();
private static final Object LOCK = new Object... | Optional<IdentityRecord> identityRecord = identityDatabase.getIdentity(recipientId); | 3 |
jcgay/send-notification | send-notification/src/main/java/fr/jcgay/notification/notifier/notifu/NotifuNotifier.java | [
"@AutoValue\npublic abstract class Application {\n\n /**\n * Uniquely identify an application. <br>\n * In order to ensure your application's signature is unique, the recommendation is to follow the Internet Media\n * type (also known as MIME content type) format as defined in IETF <a href=\"http://t... | import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import fr.jcgay.notification.Application;
import fr.jcgay.notification.DiscoverableNotifier;
import fr.jcgay.notification.Notification;
import fr.jcgay.notification.Notifier;
import fr.jcgay.notification.notifier.executor.Executor;
import... | package fr.jcgay.notification.notifier.notifu;
public class NotifuNotifier implements DiscoverableNotifier {
private static final Logger LOGGER = getLogger(NotifuNotifier.class);
private final Application application;
private final NotifuConfiguration configuration;
private final Executor executor... | public Notifier init() { | 3 |
geoparser/geolocator | geo-locator/src/edu/cmu/geoparser/parser/spanish/SpanishRuleToponymParser.java | [
"public class StringUtil {\n\n static Pattern pattern = Pattern.compile(\"\\\\p{InCombiningDiacriticalMarks}+\");\n\n /**\n * check each word in the given string array is capitalized or not Input: array of strings Output:\n * U U L L U L U L L L U L....\n */\n public static String[] capitalizedArray(String... | import com.csvreader.CsvReader;
import com.csvreader.CsvWriter;
import edu.cmu.geoparser.common.StringUtil;
import edu.cmu.geoparser.model.Tweet;
import edu.cmu.geoparser.nlp.MisspellParser;
import edu.cmu.geoparser.nlp.ner.FeatureExtractor.FeatureGenerator;
import edu.cmu.geoparser.nlp.tokenizer.EuroLangTwokenizer;
im... | /**
*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use t... | String[] igrams = StringUtil.constructgrams(tokens.toArray(new String[] {}), i, true); | 0 |
wesabe/grendel | src/main/java/com/wesabe/grendel/resources/LinksResource.java | [
"public class Credentials {\n\t/**\n\t * An authentication challenge {@link Response}. Use this when a client's\n\t * provided credentials are invalid.\n\t */\n\tpublic static final Response CHALLENGE =\n\t\tResponse.status(Status.UNAUTHORIZED)\n\t\t\t.header(HttpHeaders.WWW_AUTHENTICATE, \"Basic realm=\\\"Grendel\... | import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.core.Response.Status;
import com.google.inject.I... | package com.wesabe.grendel.resources;
/**
* A class which exposes a list of {@link User}s linked to a particular
* {@link Document} as a resource.
*
* @author coda
*/
@Path("/users/{user_id}/documents/{name}/links/")
@Produces(MediaType.APPLICATION_JSON)
public class LinksResource { | private final UserDAO userDAO; | 5 |
ChiralBehaviors/Kramer | kramer/src/main/java/com/chiralbehaviors/layout/style/RelationStyle.java | [
"public class Outline extends VirtualFlow<OutlineCell> {\n private static final String DEFAULT_STYLE = \"outline\";\n private static final String SCHEMA_CLASS_TEMPLATE = \"%s-outline\";\n private static final String STYLE_SHEET = \"outline.css\";\n\n public Outline(double width, double... | import com.chiralbehaviors.layout.outline.Outline;
import com.chiralbehaviors.layout.outline.OutlineCell;
import com.chiralbehaviors.layout.outline.OutlineColumn;
import com.chiralbehaviors.layout.outline.OutlineElement;
import com.chiralbehaviors.layout.outline.Span;
import com.chiralbehaviors.layout.table.NestedCell;... | /**
* Copyright (c) 2017 Chiral Behaviors, LLC, all rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | OutlineCell outlineCell, OutlineColumn column, | 1 |
carrotsearch/smartsprites | src/main/java/org/carrot2/labs/smartsprites/resource/FileSystemResourceHandler.java | [
"public final class SmartSpritesParameters\n{\n /**\n * Path to the directory that contains the css files to be processed. Directories\n * containing CSS and image files must be writable, unless output.dir.path is\n * provided. The root.dir.path can be either absolute, e.g. c:/myproject/web or\n ... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.UnsupportedEncodingException;
import java.... | package org.carrot2.labs.smartsprites.resource;
/**
* This class defines the resource handler which manage resources from the file system.
*
* @author Ibrahim Chaehoi
* @author Stanislaw Osinski
*/
public class FileSystemResourceHandler implements ResourceHandler
{
/** The message log */
private final ... | messageLog.error(Message.MessageType.GENERIC, "Charset '" + charset | 3 |
EnderiumSmith/CharcoalPit | src/main/java/charcoalPit/blocks/BlockPotteryKiln.java | [
"public class Config {\n\t\n\tprivate static final String CATEGORY_GENERAL=\"General\";\n\tprivate static final String CATEGORY_CHARCOAL_PIT=\"Charcoal Pit\";\n\tprivate static final String CATEGORY_COKE_OVEN=\"Coke Oven\";\n\tprivate static final String CATEGORY_KILN=\"Kiln\";\n\tprivate static final String CATEGO... | import charcoalPit.core.Config;
import charcoalPit.core.MethodHelper;
import charcoalPit.crafting.PotteryKilnRecipe;
import charcoalPit.items.ItemsRegistry;
import charcoalPit.tile.TilePotteryKiln;
import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.SoundType;
im... | public boolean isFullCube(IBlockState state) {
return state.getValue(TYPE)==EnumKilnTypes.WOOD||state.getValue(TYPE)==EnumKilnTypes.ACTIVE||state.getValue(TYPE)==EnumKilnTypes.COMPLETE;
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
return state.getValue(TYPE)==En... | if(!playerIn.getHeldItem(hand).isEmpty()&&MethodHelper.PotteryKilnIsTatch(playerIn.getHeldItem(hand))&&playerIn.getHeldItem(hand).getCount()>=Config.ThatchAmount){ | 1 |
njustesen/hero-aicademy | test/Hash/PerfectHashing.java | [
"public class MapLoader {\n\t\n\tprivate static final char P1CRYSTAL = 'c';\n\tprivate static final char P2CRYSTAL = 'C';\n\tstatic Map<Character, SquareType> codes = new HashMap<Character, SquareType>();\n\tstatic {\n\t\tcodes.put('0', SquareType.NONE);\n\t\tcodes.put('d', SquareType.DEPLOY_1);\n\t\tcodes.put('D',... | import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
import util.MapLoader;
import game.GameState;
import model.Card;
import model.CardSet;
import model.DECK_SIZE;
import model.HaMap;
import model.Unit; | package Hash;
public class PerfectHashing {
public static Random random;
public static void main(String[] args) throws IOException{
random = new Random();
test();
}
private static void test() throws IOException {
Map<Long, GameState> states = new HashMap<Long, GameState>();
for(int i = 0... | static List<Card> units = new ArrayList<Card>(); | 2 |
Spedge/hangar | hangar-api/src/test/java/com/spedge/hangar/testutils/TestStorage.java | [
"public abstract class IndexArtifact implements Serializable\n{\n private static final long serialVersionUID = -5720959937441417671L;\n private String location;\n\n public IndexArtifact(String location)\n {\n this.location = location;\n }\n\n public String getLocation()\n {\n retu... | import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.StreamingOutput;
import com.codahale.metrics.health.HealthCheck;
import com.spedge.hangar.index.... | package com.spedge.hangar.testutils;
public class TestStorage implements IStorage
{
private Map<String, String> fakeStorage;
public TestStorage()
{
fakeStorage = new HashMap<String, String>();
}
public HealthCheck getHealthcheck() {
return null;
}
| public IndexArtifact generateArtifactPath(JavaIndexKey key) { | 0 |
m-szalik/dbpatch | dbpatch-core/src/main/java/org/jsoftware/dbpatch/impl/DbManager.java | [
"public abstract class AbstractPatch implements Serializable {\n private static final long serialVersionUID = 4178101927323891639L;\n private String name;\n private int statementCount = -1;\n private File file;\n\n public enum DbState {\n COMMITTED, IN_PROGRESS, NOT_AVAILABLE\n }\n\n pub... | import org.jsoftware.dbpatch.config.AbstractPatch;
import org.jsoftware.dbpatch.config.ConfigurationEntry;
import org.jsoftware.dbpatch.config.Patch;
import org.jsoftware.dbpatch.config.RollbackPatch;
import org.jsoftware.dbpatch.config.dialect.Dialect;
import org.jsoftware.dbpatch.config.dialect.PatchExecutionResult;
... | package org.jsoftware.dbpatch.impl;
public class DbManager {
private final ConfigurationEntry ce;
private final Dialect dialect; | private final Log log; | 5 |
douo/ActivityBuilder | compiler/src/main/java/info/dourok/compiler/parameter/BundleWriter.java | [
"public static String capitalize(String s) {\n if (s.length() == 0) {\n return s;\n }\n return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();\n}",
"public static void error(String msg) {\n S_INSTANCE.messager.printMessage(Diagnostic.Kind.ERROR, msg);\n}",
"public static Types getTypes() ... | import com.squareup.javapoet.MethodSpec;
import java.util.List;
import java.util.Objects;
import javax.lang.model.type.ArrayType;
import javax.lang.model.type.DeclaredType;
import javax.lang.model.type.PrimitiveType;
import javax.lang.model.type.TypeKind;
import javax.lang.model.type.TypeMirror;
import javax.lang.model... | package info.dourok.compiler.parameter;
/**
* 生成 Bundle 支持类型的写入读取代码
*
* @author tiaolins
* @date 2017/8/30
*/
class BundleWriter extends ParameterWriter {
private String prefix;
BundleWriter(ParameterModel parameter, String prefix) {
super(parameter);
if (prefix == null) {
prefix = generateP... | } else if (isParcelable(declaredType, false)) { | 6 |
7upcat/agile-wroking-backend | src/main/java/org/catframework/agileworking/scheduling/SendNotifyMessageJob.java | [
"@Entity\r\npublic class Schedule implements Serializable, Comparable<Schedule> {\r\n\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\tprivate static final Logger logger = LoggerFactory.getLogger(Schedule.class);\r\n\r\n\t/** 排期的重复模式:不重复. */\r\n\tpublic static final String REPEAT_MODE_NO = \"N\";\r\n\... | import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.catframework.agileworking.domain.Schedule;
import org.catframework.agileworking.domain.ScheduleRepository;
import org.catframework.agileworking.domain.Us... | package org.catframework.agileworking.scheduling;
/**
* 发送会议通知,每60秒轮训一次,在会前 15 分钟发送提醒,目前的实现比较简单仅在内存中增加了缓存来存放已发送的排期.
*
* 提示:目前版本只考虑了单 JVM 环境运行,作业调度未考虑并发的问题,如果运行在集群环境下,需要修改此类.
*
* @author devzzm
*/
@Component
public class SendNotifyMessageJob {
private static final Log logger = LogFactory.getLog(SendNotifyMe... | Schedule schedule = scheduleRepository.findOne(new Long(s.getScheduleId().intValue())); | 0 |
UrsZeidler/uml2solidity | de.urszeidler.eclipse.solidity.laucher.ui/src/de/urszeidler/eclipse/solidity/laucher/ui/GenerateOthersConfigurationTab.java | [
"public static final String GENERATE_ABI = \"GENERATE_ABI\";",
"public static final String GENERATE_ABI_TARGET = \"GENERATE_ABI_TARGET\";",
"public static final String GENERATE_MARKDOWN = \"GENERATE_MARKDOWN\";",
"public static final String GENERATION_TARGET_DOC = \"GENERATION_TARGET_DOC\";",
"public class ... | import static de.urszeidler.eclipse.solidity.ui.preferences.PreferenceConstants.GENERATE_ABI;
import static de.urszeidler.eclipse.solidity.ui.preferences.PreferenceConstants.GENERATE_ABI_TARGET;
import static de.urszeidler.eclipse.solidity.ui.preferences.PreferenceConstants.GENERATE_MARKDOWN;
import static de.urszeidle... | /**
*
*/
package de.urszeidler.eclipse.solidity.laucher.ui;
/**
* @author urs
*
*/
public class GenerateOthersConfigurationTab extends AbstractUml2SolidityLaunchConfigurationTab {
private Button btnGenerateMarkdownReport;
private Text docDirectoryText;
private Button btnGenerateSingleAbi;
private Text ab... | configuration.setAttribute(GENERATION_TARGET_DOC, store.getString(GENERATION_TARGET_DOC)); | 3 |
junkdog/dominatrix-odb | dominatrix-demo/src/net/onedaybeard/dominatrix/demo/system/debug/SpriteBoundsRenderSystem.java | [
"public static void free(Disposable... disposables)\n{\n\tfor (Disposable disposable : disposables)\n\t\tfree(disposable);\n}",
"public enum Director implements Disposable\n{\n\tinstance;\n\t\n\t@Getter\tprivate final SpriteBatch spriteBatch;\n\t@Getter private Screen screen;\n\t\n\tprivate AssetManager assetMana... | import static net.onedaybeard.dominatrix.util.Disposer.free;
import java.util.Properties;
import net.onedaybeard.dominatrix.demo.Director;
import net.onedaybeard.dominatrix.demo.component.Renderable;
import net.onedaybeard.dominatrix.demo.component.Tint;
import net.onedaybeard.dominatrix.demo.event.CommandEvent;
import... | package net.onedaybeard.dominatrix.demo.system.debug;
public final class SpriteBoundsRenderSystem extends EntitySystem implements Disposable, InjectableProperties
{
public static final String TAG = SpriteBoundsRenderSystem.class.getSimpleName();
private final OrthographicCamera camera;
private ShapeRenderer r... | free(renderer); | 0 |
Wackymax/CPOrm | CPOrm/src/main/java/za/co/cporm/provider/CPOrmContentProvider.java | [
"public class CPOrm {\n\n private static Context applicationContext;\n private static TableDetailsCache tableDetailsCache;\n\n public enum ChangeType {\n INSERT,\n UPDATE,\n DELETE\n }\n\n /**\n * This is an optional initialize method that can be used to set the application c... | import android.annotation.TargetApi;
import android.content.ContentProvider;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentValues;
import android.content.Context;
import android.content.OperationApplicationException;
import android.content.p... | package za.co.cporm.provider;
/**
* The base content provided that will expose all of the model objects.
* Objects are expose in the form of authority/table_name/*
*/
public class CPOrmContentProvider extends ContentProvider {
public static final String PARAMETER_OFFSET = "OFFSET";
public static final S... | cPOrmConfiguration = ManifestHelper.getConfiguration(getContext()); | 4 |
oxoooo/excited-android | app/src/main/java/ooo/oxo/excited/ExcitedRetrofit.java | [
"public class NewData {\n\n public List<Channel> channels;\n public List<Card> cards;\n public List<Card> timeline;\n public User user;\n public VoteCard voteCard;\n @SerializedName(\"setFollowState\")\n public Follow followState;\n public Card card;\n public PreviewCard previewCard;\n ... | import android.content.Context;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import java.lang.reflect.Type;
import java.u... | package ooo.oxo.excited;
/**
* Created by zsj on 2016/10/17.
*/
public class ExcitedRetrofit {
private Map<Class, Object> apis = new HashMap<>();
private Retrofit retrofit;
private Gson gson;
public ExcitedRetrofit(final Context context) {
OkHttpClient.Builder ... | String token = PreferenceManager.getValue(context, TOKEN);
| 4 |
apradanas/prismoji-android | prismoji/src/main/java/com/apradanas/prismoji/PrismojiPopup.java | [
"public final class Emoji implements Serializable {\n private static final long serialVersionUID = 3L;\n\n @NonNull\n private final String unicode;\n @DrawableRes\n private final int resource;\n @NonNull\n private List<Emoji> variants;\n @SuppressWarnings(\"PMD.ImmutableField\")\n @Nullab... | import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
import android.support.a... | package com.apradanas.prismoji;
public final class PrismojiPopup {
private static final int MIN_KEYBOARD_HEIGHT = 100;
final View rootView;
final Context context;
@NonNull
final RecentEmoji recentEmoji;
@NonNull
final PrismojiVariantPopup variantPopup;
final PopupWindow popupWindo... | OnEmojiPopupShownListener onEmojiPopupShownListener; | 5 |
dogriffiths/hipster | src/dg/hipster/view/IdeaMap.java | [
"public final class IdeaMapController implements KeyListener, FocusListener,\n MouseListener, MouseMotionListener, PropertyChangeListener {\n /**\n * Internationalization strings.\n */\n private static ResourceBundle resBundle = ResourceBundle.getBundle(\n \"dg/hipster/resource/strin... | import dg.hipster.controller.IdeaMapController;
import dg.hipster.model.Idea;
import dg.hipster.model.IdeaDocument;
import dg.hipster.view.BranchView;
import dg.hipster.view.IdeaView;
import dg.hipster.view.LinkView;
import dg.hipster.view.MapComponent;
import dg.inx.XMLPanel;
import java.awt.BasicStroke;
import java.a... | /*
* IdeaMap.java
*
* Created on August 31, 2006, 6:03 PM
*
* Copyright (c) 2006, David Griffiths
* 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 mu... | propertiesPanel.getContentPane().add(new XMLPanel( | 7 |
Doctoror/Pure-File-Manager | purefm/src/main/java/com/docd/purefm/operations/CreateFileOperation.java | [
"public final class Environment {\n \n private Environment() {}\n\n @NonNull\n private static final ActivityMonitorListener sActivityMonitorListener = new ActivityMonitorListener();\n\n @NonNull\n public static final File sRootDirectory = File.listRoots()[0];\n\n @NonNull\n public static fin... | import android.content.Context;
import android.support.annotation.NonNull;
import com.docd.purefm.Environment;
import com.docd.purefm.R;
import com.docd.purefm.file.FileObserverNotifier;
import com.docd.purefm.file.GenericFile;
import com.docd.purefm.settings.Settings;
import com.docd.purefm.utils.MediaStoreUtils;
impo... | /*
* Copyright 2014 Yaroslav Mytkalyk
* 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... | final Settings settings = Settings.getInstance(mContext); | 3 |
jlinn/riot-api-java | src/main/java/net/joelinn/riot/summoner/SummonerClient.java | [
"public abstract class AbstractClient {\n\n protected static final String BASE_URL = \"https://prod.api.pvp.net/api/\";\n\n protected String apiKey;\n\n protected Region region;\n\n protected WebResource service;\n\n /**\n * @param apiKey your Riot API key\n * @param region {@link Region}\n ... | import com.google.common.base.Joiner;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.GenericType;
import com.sun.jersey.core.util.MultivaluedMapImpl;
import net.joelinn.riot.AbstractClient;
import net.joelinn.riot.Region;
import net.joelinn.riot.summoner.dto.MasteryPages;
import net.j... | package net.joelinn.riot.summoner;
/**
* Joe Linn
* 12/14/13
* @see <a href="https://developer.riotgames.com/api/methods#!/293">https://developer.riotgames.com/api/methods#!/293</a>
*/
public class SummonerClient extends AbstractClient{
public SummonerClient(String apiKey, Region region) {
super(ap... | public Map<String, MasteryPages> getMasteries(long... summonerIds){ | 2 |
Mpmart08/MusicPlayer | src/app/musicplayer/view/MainController.java | [
"public class Search {\n\n private static BooleanProperty hasResults = new SimpleBooleanProperty(false);\n private static SearchResult result;\n private static Thread searchThread;\n\n public static BooleanProperty hasResultsProperty() { return hasResults; }\n\n public static SearchResult getResult()... | import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.concurrent.CountDownLatch;
import app.musicplayer.model.*;
import app.musicplayer.util.Search;
import com.melloware.jintellitype.IntellitypeListener;
import com.melloware.jintellitype.JIntellitype;
import app.musicplayer.M... | package app.musicplayer.view;
public class MainController implements Initializable, IntellitypeListener {
private boolean isSideBarExpanded = true;
private double expandedWidth = 250;
private double collapsedWidth = 50;
private double expandedHeight = 50;
private double collapsedHeight = 0;
priva... | Search.search(text); | 0 |
struktured/ocamljava-maven-plugin | ocamljava-maven-plugins/ocamljava-compiler-maven-plugin/src/main/java/mandelbrot/ocamljava_maven_plugin/OcamlJavaCompileAbstractMojo.java | [
"@JsonTypeName(\"dependencyGraph\")\npublic class DependencyGraph {\n\n\tprivate static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();\n\n\tpublic static final String DEPENDENCIES_PROPERTY = \"dependencies\";\n\t\n\t@JsonProperty(DEPENDENCIES_PROPERTY)\n\tprivate final Map<String, Collection<ModuleDescripto... | import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map.Entry;
import java.util.Set;
import mandelbrot.dependency.data.DependencyGraph;
import mandelbrot.dependency.data.ModuleDescriptor;
import mandelbrot.ocamljava_maven_plugin.util.ArtifactDescriptor;
... | package mandelbrot.ocamljava_maven_plugin;
public abstract class OcamlJavaCompileAbstractMojo extends OcamlJavaAbstractMojo {
private static final Boolean FORK_BY_DEFAULT = Boolean.FALSE;
/**
* Record debugging information.
*
*/
@Parameter(defaultValue="false")
protected boolean recordDebugInfo = ... | final DependencyGraph dependencyGraph = DependencyGraph.read(dependencyGraphTarget); | 0 |
Slikey/EffectLib | src/main/java/de/slikey/effectlib/effect/EquationEffect.java | [
"public abstract class Effect implements Runnable {\n\n /**\n * Handles the type, the effect is played.\n *\n * @see {@link de.slikey.effectlib.EffectType}\n */\n public EffectType type = EffectType.INSTANT;\n\n /**\n * Can be used to colorize certain particles. As of 1.8, those\n *... | import de.slikey.effectlib.Effect;
import de.slikey.effectlib.EffectManager;
import de.slikey.effectlib.EffectType;
import de.slikey.effectlib.math.EquationStore;
import de.slikey.effectlib.math.EquationTransform;
import org.bukkit.Particle;
import de.slikey.effectlib.util.VectorUtils;
import org.bukkit.Location;
impor... | package de.slikey.effectlib.effect;
public class EquationEffect extends Effect {
/**
* ParticleType of spawned particle
*/
public Particle particle = Particle.REDSTONE;
/**
* Equations defining the X,Y,Z coordinates over
* iteration t
*
* These equations can make use of mo... | private EquationTransform xTransform; | 4 |
izumin5210/Bletia | bletia-core/src/main/java/info/izumin/android/bletia/core/action/AbstractDiscoverServicesAction.java | [
"public enum BleErrorType implements BletiaErrorType {\n // BluetoothGatt.GATT_CONNECTION_CONGESTED is added in API level 21(Lolipop)\n // CONNECTION_CONGESTED(BluetoothGatt.GATT_CONNECTION_CONGESTED),\n CONNECTION_CONGESTED(143),\n FAILURE(BluetoothGatt.GATT_FAILURE),\n INSUFFICIENT_AUTHENTICATION(B... | import info.izumin.android.bletia.core.BleErrorType;
import info.izumin.android.bletia.core.BleState;
import info.izumin.android.bletia.core.BletiaException;
import info.izumin.android.bletia.core.ResolveStrategy;
import info.izumin.android.bletia.core.StateContainer;
import info.izumin.android.bletia.core.wrapper.Blue... | package info.izumin.android.bletia.core.action;
/**
* Created by izumin on 11/14/15.
*/
public abstract class AbstractDiscoverServicesAction<R> extends AbstractAction<Void, BletiaException, Void, R> {
public static final String TAG = AbstractDiscoverServicesAction.class.getSimpleName();
private final State... | reject(new BletiaException(this, BleErrorType.REQUEST_FAILURE)); | 0 |
njnareshjoshi/articles | multiple-microservices-example/reference-data-service/src/main/java/org/sapient/metalica/referencedataservice/BootApplication.java | [
"@EnableRabbit\n@Configuration\npublic class AmqpConfig {\n\n @Bean\n public DirectExchange commodityExchange() {\n return new DirectExchange(REF_DATA_EXCHANGE);\n }\n\n @Bean\n public Queue commodityDataQueue() {\n return new Queue(COMMODITY_DATA_QUEUE);\n }\n\n @Bean\n public... | import jdk.internal.org.objectweb.asm.TypeReference;
import org.sapient.metalica.referencedataservice.config.AmqpConfig;
import org.sapient.metalica.referencedataservice.model.Commodity;
import org.sapient.metalica.referencedataservice.model.CounterParty;
import org.sapient.metalica.referencedataservice.model.Location;... | package org.sapient.metalica.referencedataservice;
@SpringBootApplication
@Import(AmqpConfig.class)
@EnableMongoRepositories
public class BootApplication implements CommandLineRunner {
@Resource CommodityRepository commodityRepository;
@Resource CounterPartyRepository counterPartyRepository;
@Resource ... | counterPartyRepository.save(new CounterParty("Lorem", "Lorem")); | 2 |
moorkop/mccy-engine | src/test/java/me/itzg/mccy/services/LevelDatServiceTest.java | [
"public class FmlModRef extends ModRef {\n\n}",
"public class WorldDescriptor {\n private String name;\n\n private ComparableVersion minecraftVersion;\n\n private ServerType serverType;\n\n private List<ModRef> requiredMods;\n\n public void setName(String name) {\n this.name = name;\n }\n... | import me.itzg.mccy.model.FmlModRef;
import me.itzg.mccy.model.WorldDescriptor;
import me.itzg.mccy.model.ModRef;
import me.itzg.mccy.model.ServerType;
import me.itzg.mccy.services.assets.LevelDatService;
import me.itzg.mccy.services.assets.impl.LevelDatServiceImpl;
import me.itzg.mccy.types.MccyException;
import org.h... | package me.itzg.mccy.services;
/**
* @author Geoff Bourne
* @since 0.2
*/
public class LevelDatServiceTest {
@Test
public void test_1_7_10_vanilla() throws Exception, MccyException {
final WorldDescriptor worldDescriptor = loadLevelDescriptor("1.7.10-vanilla.nbt");
assertNotNull(worldDes... | assertThat(modRef, Matchers.instanceOf(FmlModRef.class)); | 0 |
XT-i/aws-lambda-jenkins-plugin | src/main/java/com/xti/jenkins/plugin/awslambda/callable/InvokeCallable.java | [
"public class InvokeConfig implements Serializable {\n private String functionName;\n private String payload;\n private boolean synchronous;\n private List<JsonParameter> jsonParameters;\n\n public InvokeConfig(String functionName, String payload, boolean synchronous, List<JsonParameter> jsonParamete... | import com.xti.jenkins.plugin.awslambda.invoke.InvokeConfig;
import com.xti.jenkins.plugin.awslambda.invoke.LambdaInvocationResult;
import com.xti.jenkins.plugin.awslambda.invoke.LambdaInvoker;
import com.xti.jenkins.plugin.awslambda.service.JenkinsLogger;
import com.xti.jenkins.plugin.awslambda.service.LambdaDeploySer... | package com.xti.jenkins.plugin.awslambda.callable;
/**
* Project: aws-lambda
* Created by Michael on 16/01/2016.
*/
public class InvokeCallable implements Callable<LambdaInvocationResult, RuntimeException> {
private TaskListener listener;
private InvokeConfig invokeConfig; | private LambdaClientConfig clientConfig; | 6 |
bertrandmartel/speed-test-lib | jspeedtest/src/test/java/fr/bmartel/speedtest/test/SpeedTestProxyTest.java | [
"public class SpeedTestReport {\n\n /**\n * current size of file to upload.\n */\n private final long mTempPacketSize;\n\n /**\n * total file size.\n */\n private final long mTotalPacketSize;\n\n /**\n * transfer rate in octet/s.\n */\n private final BigDecimal mTransferRat... | import fr.bmartel.speedtest.test.utils.TestCommon;
import net.jodah.concurrentunit.Waiter;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import java.math.BigDecimal;
import java.util.concurrent.TimeoutException;
import static java.util.concurrent.TimeUnit.SECONDS;
import fr.bmartel.speedtest.... | /*
* The MIT License (MIT)
* <p/>
* Copyright (c) 2016-2017 Bertrand Martel
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the... | public void onProgress(final float percent, final SpeedTestReport report) { | 0 |
Earthblood/Toe | app/src/test/java/com/earthblood/tictactoe/guice/TestToeRoboModule.java | [
"public class ToeGame {\n\n private PreferenceHelper preferenceHelper;\n\n @Inject\n public ToeGame(PreferenceHelper preferenceHelper){\n this.preferenceHelper = preferenceHelper;\n }\n\n public String titleHack(String appName, String statusMessage){\n return \"<font color=#CD5C5C><b>\"... | import android.app.Application;
import com.earthblood.tictactoe.engine.ToeGame;
import com.earthblood.tictactoe.helper.CoinTossHelper;
import com.earthblood.tictactoe.helper.HapticFeedbackHelper;
import com.earthblood.tictactoe.helper.HtmlHelper;
import com.earthblood.tictactoe.helper.PreferenceHelper;
import com.googl... | /**
* @author John Piser developer@earthblood.com
*
* Copyright (C) 2014 EARTHBLOOD, LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | bind(HapticFeedbackHelper.class).toInstance(Mockito.mock(HapticFeedbackHelper.class)); | 2 |
bafomdad/uniquecrops | com/bafomdad/uniquecrops/crops/DevilSnare.java | [
"public abstract class BlockCropsBase extends BlockCrops {\n\t\n\tprivate EnumCrops type;\n\tprotected boolean extra;\n\tprotected boolean canPlant;\n\tprotected boolean clickHarvest;\n\n\tpublic BlockCropsBase(EnumCrops type, boolean extra, boolean canPlant) {\n\t\t\n\t\tthis.type = type;\n\t\tthis.extra = extra;\... | import java.util.Random;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import ne... | package com.bafomdad.uniquecrops.crops;
public class DevilSnare extends BlockCropsBase {
public DevilSnare() {
super(EnumCrops.DEVILSNARE, false, UCConfig.cropDevilsnare);
this.clickHarvest = false;
}
@Override
public Item getSeed() {
return UCItems.seedsDevilsnare;
}
@Override
public Item g... | world.setBlockState(looppos, UCBlocks.cropDevilsnare.getDefaultState(), 3); | 3 |
SpartanJ/restafari | app-test/src/main/java/com/ensoft/restafari_app/example/App.java | [
"public class DatabaseService\n{\n\tprivate static DatabaseService instance;\n\tprotected Context context;\n\tprotected TableCollection tables;\n\n\tpublic static DatabaseService init( Context context, TableCollection tables )\n\t{\n\t\tinstance = new DatabaseService( context, tables );\n\t\treturn instance;\n\t}\n... | import android.app.Application;
import android.content.Context;
import com.ensoft.restafari.database.DatabaseService;
import com.ensoft.restafari.database.TableCollection;
import com.ensoft.restafari.database.converters.FieldTypeConverter;
import com.ensoft.restafari.database.converters.JsonFieldTypeConverter;
import c... | package com.ensoft.restafari_app.example;
public class App extends Application
{
@Override
public void onCreate()
{
super.onCreate();
RequestService.init( this );
}
@Override
protected void attachBaseContext(Context base)
{
super.attachBaseContext( base );
// Register the field type converter to... | TableCollection tableCollection = new TableCollection( "ipdb", 1, fieldTypeConverters ); | 1 |
jchampemont/WTFDYUM | src/main/java/com/jeanchampemont/wtfdyum/web/UserController.java | [
"public class Event {\n\n public Event() {\n // left deliberately empty\n }\n\n public Event(final EventType type, final String additionalData) {\n this.type = type;\n this.additionalData = additionalData;\n }\n\n private EventType type;\n\n private String additionalData;\n\n ... | import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.dto.type.EventType;
import com.jeanchampemont.wtfdyum.security.Secured;
import com.jeanchampemont.wtfdyum.service.AuthenticationService;
import com.jeanchampemont.wtfdyum.service.FeatureService;... | /*
* Copyright (C) 2015, 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*... | userService.addEvent(userId, new Event(EventType.FEATURE_DISABLED, feature.getShortName())); | 2 |
anotherMe17/CommonAdapterSample | app/src/main/java/io/github/anotherme17/commonadaptersample/ui/ItemTouchActivity.java | [
"public abstract class BaseActivity extends AppCompatActivity {\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n supportRequestWindowFeature(Window.FEATURE_NO_TITLE);//隐藏导航栏\n setContentView(getLayoutId());\n But... | import android.graphics.Canvas;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;
import android.widget.TextView;
import java.util.ArrayList;
imp... | package io.github.anotherme17.commonadaptersample.ui;
/**
* Created by Administrator on 2017/1/19.
*/
public class ItemTouchActivity extends BaseActivity {
@Bind(R.id.back)
ImageView mBack;
@Bind(R.id.title)
TextView mTitle;
@Bind(R.id.act_normal_toolbar)
Toolbar mActNormalToolbar;
... | mRv.addItemDecoration(new Divider(this)); | 3 |
CraftedCart/SMBLevelWorkshop | src/main/java/craftedcart/smblevelworkshop/ui/component/transform/PlaceableScaleTextFields.java | [
"public class Placeable implements Cloneable, ITransformable {\n\n @NotNull private IAsset asset;\n\n @NotNull private PosXYZ position = new PosXYZ();\n @NotNull private PosXYZ rotation = new PosXYZ();\n @NotNull private PosXYZ scale = new PosXYZ(1, 1, 1);\n\n public Placeable(@NotNull IAsset asset) ... | import craftedcart.smblevelworkshop.asset.Placeable;
import craftedcart.smblevelworkshop.project.ProjectManager;
import craftedcart.smblevelworkshop.resource.LangManager;
import craftedcart.smblevelworkshop.ui.MainScreen;
import craftedcart.smblevelworkshop.undo.UndoAssetTransform;
import craftedcart.smblevelworkshop.u... | package craftedcart.smblevelworkshop.ui.component.transform;
/**
* @author CraftedCart
* Created on 30/10/2016 (DD/MM/YYYY)
*/
public class PlaceableScaleTextFields extends ScaleTextFields {
public PlaceableScaleTextFields(@NotNull MainScreen mainScreen, @Nullable TextField nextTextField) {
s... | assert ProjectManager.getCurrentClientLevelData() != null; | 1 |
petosorus/dotalys-cli | src/de/lighti/packet/Entities.java | [
"public class DotaPlay {\r\n public interface ProgressListener {\r\n void bytesRemaining( int position );\r\n }\r\n\r\n /**\r\n * The current parsing state.\r\n */\r\n private static ParseState state;\r\n\r\n private static List<GameEventListener> listeners = new ArrayList<GameEventLis... | import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Logger;
import com.valve.dota2.Netmessages.CSVCMsg_PacketEntities;
import de.lighti.DotaPlay;
import de.lighti.GameEventListener;
import de.lighti.model.Entity;
import de.lighti.mode... | package de.lighti.packet;
/**
* This class handles the CSVCMsg_PacketEntities SVCMessage. The packet is originally
* a binary field and denotes created, changed, and deleted entities.
*
* The code is based on the c++ parser library https://github.com/dschleck/edith
*
* @author Tobias Mahlmann
*... | final FlatSendTable flatSendTable = state.getFlatSendTable( eClass.getDtName() );
| 5 |
PLNech/BactMan-Adventures | app/src/main/java/fr/plnech/igem/game/PictoGame.java | [
"public class ResMan {\r\n /* Global */\r\n public static final String SPLASH = \"splash.png\";\r\n public static final String SPLASH_LAND = \"splash_land.png\";\r\n public static final String FACE_BOX_TILED = \"face_box_tiled.png\";\r\n public static final String MENU_BG = \"menu_background.png\";\r... | import android.support.annotation.NonNull;
import android.util.Log;
import com.badlogic.gdx.math.Vector2;
import fr.plnech.igem.game.managers.ResMan;
import fr.plnech.igem.game.model.HUDElement;
import fr.plnech.igem.game.model.PortraitGame;
import fr.plnech.igem.game.model.res.FontAsset;
import fr.plnech.igem.g... | /*
=======================================================================
BactMan Adventures | Scientific popularisation through mini-games
Copyright (C) 2015 IONIS iGEM Team
Distributed under the GNU GPLv3 License.
(See file LICENSE.txt or copy at https://www.gnu.org/licenses/gpl.txt)
==========================... | public List<GFXAsset> getGraphicalAssets() {
| 4 |
FedericoPecora/coordination_oru | src/main/java/se/oru/coordination/coordination_oru/tests/TestTrajectoryEnvelopeCoordinatorWithMotionPlanner13.java | [
"public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m... | import java.io.File;
import java.util.Comparator;
import org.metacsp.multi.spatioTemporal.paths.Pose;
import com.vividsolutions.jts.geom.Coordinate;
import se.oru.coordination.coordination_oru.ConstantAccelerationForwardModel;
import se.oru.coordination.coordination_oru.CriticalSection;
import se.oru.coordination.coord... | package se.oru.coordination.coordination_oru.tests;
@DemoDescription(desc = "Example that throws an error due to coordination being impossible.")
public class TestTrajectoryEnvelopeCoordinatorWithMotionPlanner13 {
public static void main(String[] args) throws InterruptedException {
double MAX_ACCEL = 1.0;
d... | Missions.enqueueMission(new Mission(1,rsp1.getPath())); | 8 |
thx/RAP | src/main/java/com/taobao/rigel/rap/common/base/ActionBase.java | [
"public class User implements java.io.Serializable {\n private int id;\n private String name;\n private String account;\n private String password;\n private String email;\n private Date createDate;\n private boolean isLockedOut;\n private Date lastLoginDate;\n private int incorrectLoginAt... | import com.google.gson.reflect.TypeToken;
import com.opensymphony.xwork2.ActionSupport;
import com.taobao.rigel.rap.account.bo.Role;
import com.taobao.rigel.rap.account.bo.User;
import com.taobao.rigel.rap.account.service.AccountMgr;
import com.taobao.rigel.rap.common.service.impl.ContextManager;
import com.taobao.rige... | for (Corporation c : list) {
corpList.add(c.toMap());
}
CacheUtils.put(cacheKey, CommonUtils.gson.toJson(corpList));
}
return corpList;
}
public List<Map<String, Object>> getAllCorpList() {
String [] cacheKey = new String[]{CacheUtils.... | this.returnUrl = SystemSettings.projectContext + returnUrl; | 3 |
multi-os-engine/moe-plugin-gradle | src/main/java/org/moe/gradle/tasks/Launchers.java | [
"public abstract class AbstractMoePlugin implements Plugin<Project> {\n\n /**\n * MOE group.\n */\n public static final String MOE = \"moe\";\n\n /**\n * Required major version of Gradle.\n */\n private static final int GRADLE_MIN_VERSION_MAJOR = 4;\n /**\n * Required minor versio... | import org.apache.commons.io.output.NullOutputStream;
import org.apache.tools.ant.taskdefs.condition.Os;
import org.gradle.api.DefaultTask;
import org.gradle.api.GradleException;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.logging.Logger;
import org.gradle.api.logging.Logging;
impor... | tasks.create("moeListDevices", JavaExec.class, exec -> {
exec.setGroup(AbstractMoePlugin.MOE);
exec.setDescription("Lists all connected devices.");
new DeviceLauncherBuilder().setList(true).build(plugin, exec);
exec.setIgnoreExitValue(true);
... | private final JUnitTestCollector testCollector; | 4 |
edeoliveira/MailsterSMTP | test/examples/CustomDeliveryHandlerImpl.java | [
"abstract public class AbstractDeliveryHandler \t\r\n\timplements AuthenticationHandler\t\r\n{\r\n\tprivate class SessionContextImpl implements SessionContext\r\n\t{\r\n\t\tprivate HashMap<String, Object> attrs = new HashMap<String, Object>();\r\n\t\t\r\n\t\tpublic SessionContextImpl() {\r\n\t\t}\r\n\r\n\t\tpublic ... | import java.io.IOException;
import java.io.InputStream;
import org.mailster.smtp.api.handler.AbstractDeliveryHandler;
import org.mailster.smtp.api.handler.DeliveryContext;
import org.mailster.smtp.api.handler.RejectException;
import org.mailster.smtp.core.TooMuchDataException;
import org.mailster.smtp.core.auth.A... | package examples;
/**
* @author De Oliveira Edouard <doe_wanted@yahoo.fr>
*/
public class CustomDeliveryHandlerImpl
extends AbstractDeliveryHandler
{
/**
* An instance of this implementation will be created for each
* SMTP session.
*
* @param ctx the delivery context
* @param au... | protected CustomDeliveryHandlerImpl(DeliveryContext ctx,
| 1 |
jbarr21/gopro-remote | wear/src/main/java/com/github/jbarr21/goproremote/ui/notification/WearNotificationManager.java | [
"public class ControlActivity extends GoProActivity {\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_control);\n }\n}",
"public class ModeActivity extends GoProActivity {\n\n @Override\n prote... | import android.app.Notification;
import android.app.Notification.Action;
import android.app.Notification.WearableExtender;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.suppor... | package com.github.jbarr21.goproremote.ui.notification;
public class WearNotificationManager {
private static final int NOTIFICATION_ID_STATUS = 0;
private static final int NOTIFICATION_ID_STREAM = 1;
private static WearNotificationManager instance;
private final Context appContext;
private f... | .putExtra(WearNotificationReceiver.EXTRA_GO_PRO_COMMAND, GoProCommand.CONNECT_WIFI); | 3 |
BoD/bikey | handheld/src/main/java/org/jraf/android/bikey/app/display/fragment/speed/SpeedDisplayFragment.java | [
"public abstract class SimpleDisplayFragment extends BaseFragment<DisplayActivity> {\n private TextView mTxtValue;\n private GraphView mGraValues;\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View res = inflater.inflate(getL... | import org.jraf.android.bikey.backend.location.LocationManager.StatusListener;
import org.jraf.android.bikey.backend.location.Speedometer;
import org.jraf.android.bikey.common.UnitUtil;
import android.location.Location;
import android.os.Bundle;
import android.view.View;
import org.jraf.android.bikey.app.display.fragme... | /*
* This source is part of the
* _____ ___ ____
* __ / / _ \/ _ | / __/___ _______ _
* / // / , _/ __ |/ _/_/ _ \/ __/ _ `/
* \___/_/|_/_/ |_/_/ (_)___/_/ \_, /
* /___/
* repository.
*
* Copyright (C) 2013 Benoit 'BoD' Lubek (BoD@JRAF.org)
*
* This program is free s... | setText(UnitUtil.formatSpeed(getSpeed())); | 4 |
JOML-CI/JOML | src/org/joml/Vector3d.java | [
"public interface Externalizable extends java.io.Serializable {\n void writeExternal(ObjectOutput out) throws IOException;\n void readExternal(ObjectInput in) throws IOException, ClassNotFoundException;\n}",
"public interface ObjectInput extends DataOutput {\n\n double readDouble() throws IOException;\n ... | import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.nio.*; | double dx = x1 - x2;
double dy = y1 - y2;
double dz = z1 - z2;
return Math.fma(dx, dx, Math.fma(dy, dy, dz * dz));
}
public double dot(Vector3dc v) {
return Math.fma(this.x, v.x(), Math.fma(this.y, v.y(), this.z * v.z()));
}
public double dot(double x, double y,... | public void writeExternal(ObjectOutput out) throws IOException { | 2 |
movitto/nethack-encyclopedia | app/src/main/java/org/morsi/android/nethack/redux/CalculatorActivity.java | [
"public class AndroidMenu {\n\n // Override functionality of the search button to bring up encyclopedia\n public static boolean onSearchRequested(Activity activity) {\n // bring up the Encyclopedia\n activity.startActivity(new Intent(activity, EncyclopediaActivity.class));\n return false;... | import org.morsi.android.nethack.redux.util.AndroidMenu;
import org.morsi.android.nethack.redux.calculators.ArmorCalculator;
import org.morsi.android.nethack.redux.calculators.DamageCalculator;
import org.morsi.android.nethack.redux.calculators.SpellsCalculator;
import org.morsi.android.nethack.redux.util.UI;
import an... | /**********************************
* Nethack Encyclopedia - Calculator Activity
*
* Copyright (C) 2011: Mo Morsi <mo@morsi.org>
* Distributed under the MIT License
**********************************/
package org.morsi.android.nethack.redux;
// Tools to calculate Nethack stats based on user input
public class ... | return AndroidMenu.onSearchRequested(this); | 0 |
rubenlagus/Tsupport | TMessagesProj/src/main/java/org/telegram/ui/DocumentSelectActivity.java | [
"public class AndroidUtilities {\n\n private static final Hashtable<String, Typeface> typefaceCache = new Hashtable<>();\n private static int prevOrientation = -10;\n private static boolean waitingForSms = false;\n private static final Object smsLock = new Object();\n\n public static int statusBarHei... | import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Environment;
import android.os.StatFs;
import android.text.TextUtils;
import android.view.Gravity;
impo... | }
if (fragmentView == null) {
actionBar.setBackButtonImage(R.drawable.ic_ab_back);
actionBar.setAllowOverlayTitle(true);
actionBar.setTitle(LocaleController.getString("SelectFile", R.string.SelectFile));
actionBar.setActionBarMenuOnItemClick(new ActionBar... | if (view instanceof SharedDocumentCell) { | 6 |
zak0/AppTycoon | app/src/main/java/jaakko/jaaska/apptycoon/engine/core/GameEngine.java | [
"public class Company {\n\n private static final String TAG = \"Company\";\n\n private String mName;\n private int mReputation;\n private long mValue;\n\n private long mFunds;\n\n /** All the assets that the company has, including the premises asset. */\n private List<Asset> mAssets;\n\n /**... | import android.util.Log;
import java.util.concurrent.atomic.AtomicBoolean;
import jaakko.jaaska.apptycoon.engine.Company;
import jaakko.jaaska.apptycoon.engine.asset.PremisesAsset;
import jaakko.jaaska.apptycoon.engine.people.EmployeeType;
import jaakko.jaaska.apptycoon.engine.product.Product;
import jaakko.jaaska.appt... | package jaakko.jaaska.apptycoon.engine.core;
/**
* Singleton for controlling the game engine. Also acts as an accessor for the current game instance.
*/
public class GameEngine {
private static final String TAG = "GameEngine";
private AtomicBoolean mRunning; // flag for telling if the engine has been s... | company.addAsset(PremisesAsset.getPremisesAssetById(PremisesAsset.SMALL_OFFICE_SPACE)); | 1 |
jplu/stanfordNLPRESTAPI | src/test/java/fr/eurecom/stanfordnlprestapi/core/StanfordNlpTest.java | [
"public class Context {\n static final Logger LOGGER = LoggerFactory.getLogger(Context.class);\n private final String text;\n private final int start;\n private final int end;\n private final List<Sentence> sentences;\n\n /**\n * Context constructor.\n *\n * @param newText Text that represents the cont... | import java.nio.file.FileSystems;
import javax.ws.rs.WebApplicationException;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import edu.stanford.nlp.util.CoreMap;
impo... | /**
* StanfordNLPRESTAPI - Offering a REST API over Stanford CoreNLP to get results in NIF format.
* Copyright © 2017 Julien Plu (julien.plu@redaction-developpez.com)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* t... | final Sentence sentence = new SentenceImpl("I like Paris", context, 0, 12, 0, | 2 |
kefirfromperm/kefirbb | src/org/kefirsf/bb/TemplateElementFactory.java | [
"public class Constant extends AbstractGhostable implements TemplateElement {\n /**\n * Constant value. String for search.\n */\n private String value;\n\n /**\n * If true, then uses search ignore case\n */\n private boolean ignoreCase;\n\n /**\n * Default constructor.\n */\n ... | import org.kefirsf.bb.conf.Constant;
import org.kefirsf.bb.conf.If;
import org.kefirsf.bb.conf.NamedValue;
import org.kefirsf.bb.conf.TemplateElement;
import org.kefirsf.bb.proc.IfExpression;
import org.kefirsf.bb.proc.ProcNamedValue;
import org.kefirsf.bb.proc.ProcTemplateElement;
import org.kefirsf.bb.proc.TemplateCo... | package org.kefirsf.bb;
class TemplateElementFactory {
public TemplateElementFactory() {
}
| List<ProcTemplateElement> createTemplateList(List<? extends TemplateElement> templateElements) { | 6 |
chickling/kmanager | src/test/java/com/chickling/kmanager/test/SaveJMXMetricsToES.java | [
"public interface JMXExecutor {\n\n\tpublic void doWithConnection(MBeanServerConnection mBeanServerConnection);\n\n}",
"public class KafkaJMX {\n\tprivate static Logger LOG = LoggerFactory.getLogger(KafkaJMX.class);\n\n\tprivate Map<String, Object> defaultJmxConnectorProperties = new HashMap<String, Object>();\n\... | import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.management.Attribute;
import javax.management.... | package com.chickling.kmanager.test;
/**
* @author Hulva Luva.H from ECBD
* @date 2017年7月25日
* @description
*
*/
public class SaveJMXMetricsToES {
private static Logger LOG = LoggerFactory.getLogger(App.class);
private static boolean excludeInternalTopic = true; // like __consumer_offsets
private stati... | ZKUtils.init("10.16.238.101:8181,10.16.238.102:8181,10.16.238.103:8181", 30000, 30000); | 3 |
DV8FromTheWorld/JDA-Audio | src/main/java/net/dv8tion/jda/Core.java | [
"public class AudioWebSocket extends WebSocketAdapter\n{\n public static final SimpleLog LOG = SimpleLog.getLog(\"JDAAudioSocket\");\n public static final int DISCORD_SECRET_KEY_LENGTH = 32;\n\n protected final ConnectionListener listener;\n protected final ScheduledThreadPoolExecutor keepAlivePool;\n ... | import net.dv8tion.jda.audio.AudioWebSocket;
import net.dv8tion.jda.audio.factory.DefaultSendFactory;
import net.dv8tion.jda.audio.factory.IAudioSendFactory;
import net.dv8tion.jda.handle.VoiceServerUpdateHandler;
import net.dv8tion.jda.manager.AudioManager;
import net.dv8tion.jda.manager.ConnectionManager;
import net.... | /*
* Copyright 2015-2017 Austin Keener & Michael Ritter
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | public Core(String userId, CoreClient coreClient, ConnectionManagerBuilder connectionManagerBuilder) { | 6 |
hitanshu-dhawan/PopCorn | app/src/main/java/com/hitanshudhawan/popcorn/adapters/TVShowBriefsLargeAdapter.java | [
"public class TVShowDetailActivity extends AppCompatActivity {\n\n private int mTVShowId;\n\n private CollapsingToolbarLayout mCollapsingToolbarLayout;\n private AppBarLayout mAppBarLayout;\n private Toolbar mToolbar;\n\n private ConstraintLayout mTVShowTabLayout;\n private ImageView mPosterImageV... | import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageBu... | package com.hitanshudhawan.popcorn.adapters;
/**
* Created by hitanshu on 13/8/17.
*/
public class TVShowBriefsLargeAdapter extends RecyclerView.Adapter<TVShowBriefsLargeAdapter.TVShowViewHolder> {
private Context mContext;
private List<TVShowBrief> mTVShows;
public TVShowBriefsLargeAdapter(Context... | Glide.with(mContext.getApplicationContext()).load(Constants.IMAGE_LOADING_BASE_URL_780 + mTVShows.get(position).getBackdropPath()) | 2 |
karsany/obridge | obridge-main/src/main/java/org/obridge/generators/ConverterObjectGenerator.java | [
"public class OBridgeConfiguration {\n\n public static final boolean GENERATE_SOURCE_FOR_PLSQL_TYPES = false;\n public static final boolean ADD_ASSERT = false;\n\n private String jdbcUrl;\n private String sourceRoot;\n private String rootPackageName;\n private Packages packages;\n private Loggi... | import org.obridge.util.CodeFormatter;
import org.obridge.util.DataSourceProvider;
import org.obridge.util.MustacheRunner;
import org.obridge.util.OBridgeException;
import java.beans.PropertyVetoException;
import java.io.File;
import java.io.IOException;
import java.util.List;
import org.apache.commons.io.FileUtils;
im... | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ferenc Karsany
*
* 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... | public static void generate(OBridgeConfiguration c) { | 0 |
LearningByExample/reactive-ms-example | src/test/java/org/learning/by/example/reactive/microservices/routers/ApiRouterTest.java | [
"public class GeoLocationNotFoundException extends Exception{\n\n public GeoLocationNotFoundException(final String message) {\n super(message);\n }\n}",
"public class ApiHandler {\n\n private static final String ADDRESS = \"address\";\n private static final String EMPTY_STRING = \"\";\n\n private ... | import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.learning.by.example.reactive.microservices.exceptions.GeoLocationNotFoundException;
import org.learning.by.example.reactive.microservices.handlers.ApiH... | package org.learning.by.example.reactive.microservices.routers;
@IntegrationTest
@DisplayName("ApiRouter Integration Tests")
class ApiRouterTest extends BasicIntegrationTest {
private static final String LOCATION_PATH = "/api/location";
private static final String ADDRESS_ARG = "{address}";
private stat... | private ErrorHandler errorHandler; | 2 |
PeteGoo/tcSlackBuildNotifier | tcslackbuildnotifier-core/src/test/java/slacknotifications/testframework/SlackNotificationMockingFrameworkImpl.java | [
"public interface SlackNotification {\n\n\tpublic abstract void setProxy(SlackNotificationProxyConfig proxyConfig);\n\n\tpublic abstract void setProxy(String proxyHost, Integer proxyPort, Credentials credentials);\n\n\tpublic abstract void post() throws FileNotFoundException, IOException;\n\n\tpublic abstract Integ... | import jetbrains.buildServer.messages.Status;
import jetbrains.buildServer.serverSide.*;
import jetbrains.buildServer.serverSide.settings.ProjectSettingsManager;
import org.jdom.JDOMException;
import slacknotifications.SlackNotification;
import slacknotifications.SlackNotificationImpl;
import slacknotifications.teamcit... | package slacknotifications.testframework;
public class SlackNotificationMockingFrameworkImpl implements SlackNotificationMockingFramework {
SlackNotificationPayloadContent content;
SlackNotificationConfig slackNotificationConfig;
SBuildServer sBuildServer = mock(SBuildServer.class);
BuildHistory buildHistory ... | SlackNotificationPayloadManager manager = mock(SlackNotificationPayloadManager.class); | 2 |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_baseinfo/carpool/CarpoolFragment.java | [
"public class MyBusinessActivity extends AppCompatActivity {\n\n @InjectView(R.id.toolbar)\n Toolbar mToolbar;\n\n private int mOrderActivityConstant;\n private Fragment mFragment;\n\n public static boolean needPush = false;\n public static String uniquecode = \"\";\n public static String type ... | import android.content.Intent;
import com.leelit.stuer.MyBusinessActivity;
import com.leelit.stuer.base_adapters.BaseListAdapter;
import com.leelit.stuer.base_view.BaseInfoFragment;
import com.leelit.stuer.bean.CarpoolingInfo;
import com.leelit.stuer.constant.MyBusinessConstant;
import com.leelit.stuer.module_baseinfo.... | package com.leelit.stuer.module_baseinfo.carpool;
/**
* Created by Leelit on 2015/12/6.
*/
public class CarpoolFragment extends BaseInfoFragment {
private CarpoolPresenter mCarpoolPresenter = new CarpoolPresenter(this);
@Override
protected BaseListAdapter bindAdapter() {
return new CarpoolAda... | intent.putExtra(MyBusinessConstant.TAG, MyBusinessConstant.CARPOOL); | 4 |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/metric_formats/influxdb/InfluxdbStandardizedMetric.java | [
"public interface GenericMetricFormat {\n \n public long getMetricHashKey();\n \n public void setMetricHashKey(long hashKey);\n\n public String getMetricKey();\n \n public BigDecimal getMetricValueBigDecimal();\n\n public String getMetricValueString();\n \n public int getMetricTime... | import com.pearson.statspoller.metric_formats.GenericMetricFormat;
import com.pearson.statspoller.metric_formats.graphite.GraphiteMetric;
import com.pearson.statspoller.metric_formats.graphite.GraphiteMetricFormat;
import com.pearson.statspoller.metric_formats.opentsdb.OpenTsdbMetric;
import com.pearson.statspoller.met... | return getOpenTsdbJsonFormatString(sanitizeMetric, null, null);
}
@Override
public String getOpenTsdbJsonFormatString(boolean sanitizeMetric, String defaultOpenTsdbTagKey, String defaultOpenTsdbTagValue) {
StringBuilder metric = new StringBuilder();
... | return MathUtilities.getFastPlainStringWithNoTrailingZeros(metricValue_); | 5 |
CreativeCodingLab/PathwayMatrix | src/org/biopax/paxtools/pattern/constraint/ConBox.java | [
"public interface Constraint\n{\n\t/**\n\t * Checks if the variables in the Match satisfies this constraint.\n\t *\n\t * @param match current pattern match\n\t * @param ind mapped indices of the match\n\t * @return true if this constraint is satisfied\n\t */\n\tpublic boolean satisfies(Match match, int ... ind);\n\... | import org.biopax.paxtools.controller.PathAccessor;
import org.biopax.paxtools.model.BioPAXElement;
import org.biopax.paxtools.model.level3.PhysicalEntity;
import org.biopax.paxtools.pattern.Constraint;
import org.biopax.paxtools.pattern.MappedConst;
import org.biopax.paxtools.pattern.Match;
import org.biopax.paxtools.... | package org.biopax.paxtools.pattern.constraint;
/**
* Some predefined constraints.
*
* @author Ozgun Babur
*/
public class ConBox
{
/**
* From EntityReference to the member PhysicalEntity
* @return generative constraint to get to the member PhysicalEntity of the EntityReference
*/
public static Constrain... | public static Constraint simplePEToConv(RelType type) | 4 |
Kesshou/Kesshou-Android | app/src/main/java/kesshou/android/daanx/views/regist/SchoolFragment.java | [
"public class ToastUtils {\n\n\tprivate static Toast toast;\n\n\tpublic static void makeTextAndShow(Context context,String text, int duration) {\n\t\tif (toast == null) {\n\t\t\t//如果還沒有用過makeText方法,才使用\n\t\t\ttoast = new Toast(context);\n\t\t\tLayoutInflater inflater = LayoutInflater.from(context);\n\t\t\tView view... | import android.os.Bundle;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.AppCompatButton;
import android.text.Editable;
import androi... | package kesshou.android.daanx.views.regist;
/**
* A simple {@link Fragment} subclass.
*/
public class SchoolFragment extends Fragment {
@Override
public View onCreateView(final LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this f... | ToastUtils.makeTextAndShow(getActivity().getApplicationContext(),"學校帳號錯誤", Toast.LENGTH_SHORT); | 0 |
cwan/im-log-stats | im-log-stats-project/src/main/java/net/mikaboshi/intra_mart/tools/log_stats/report/Report.java | [
"public class ConcurrentRequest {\n\n\tpublic enum EventType {\n\n\t\t/** 受信時刻 */\n\t\tACCEPT_TIME,\n\n\t\t/** 返信時刻 */\n\t\tRESPONSE_TIME;\n\t}\n\n\tprivate final EventType type;\n\n\tprivate final long time;\n\n\tprivate int count = 0;\n\n\tprivate String tenantId;\n\n\tpublic ConcurrentRequest(EventType type, lon... | import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TimeZone;
import net.mikaboshi.intra_mart.to... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distribut... | stat.pageTimeMedian = MathUtil.getMedian(pageTimes, 0L); | 7 |
joffrey-bion/fx-log | src/main/java/org/hildan/fxlog/controllers/SearchController.java | [
"public class ColumnDefinition {\n\n private static final double DEFAULT_WIDTH = 80d;\n\n private final StringProperty headerLabel;\n\n private final StringProperty capturingGroupName;\n\n private final DoubleProperty width;\n\n private final BooleanProperty visible;\n\n private final StringProper... | import java.net.URL;
import java.util.List;
import java.util.ResourceBundle;
import java.util.concurrent.Callable;
import java.util.function.Predicate;
import javafx.beans.binding.Binding;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.ObjectProperty;
impo... | package org.hildan.fxlog.controllers;
public class SearchController implements Initializable, ListChangeListener<LogEntry> {
private static final int MIN_QUERY_LENGTH_TO_TRIGGER = 3;
@FXML
private Pane searchPanel;
@FXML
private CustomTextField searchTextField;
@FXML
private Button p... | private ProportionLabel<Integer> matchNavigationLabel; | 6 |
wanasit/chrono-java | src/main/java/com/wanasit/chrono/parser/en/ENDayOfWeekDateFormatParser.java | [
"public class ChronoOption {\n\n public static final ChronoOption sharedOptions = standardOptions();\n\n public final List<Parser> parsers = new ArrayList<Parser>();\n public final List<Refiner> refiners = new ArrayList<Refiner>();\n\n public final Map<String, Integer> timezoneMap = new HashMap<String, ... | import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.wanasit.chrono.ChronoOption;
import com.wanasit.chrono.ParsedDateComponent;
import com.wanasit.chrono.ParsedResult;
import com.wanasit.chrono.ParsedDateComponent.Componen... | package com.wanasit.chrono.parser.en;
public class ENDayOfWeekDateFormatParser extends ParserAbstract {
protected static String regPattern = "(?<=\\W|^)"
+ "(?:(this|last|next)\\s*)?"
+ "(Sunday|Sun|Monday|Mon|Tuesday|Tues|Tue|Wednesday|Wed|Thursday|Thu(?:rs|r)?|Friday|Fri|Saturday|Sat)"... | result.start.imply(Components.Year, calendar.get(Calendar.YEAR)); | 3 |
kreativekorp/vexillo | main/java/Vexillo/src/com/kreative/vexillo/main/VexMoji.java | [
"public class Flag {\n\tprivate String id;\n\tprivate String name;\n\tprivate PropertySet properties;\n\tprivate Dimension fly;\n\tprivate Map<String, Dimension> dimensions;\n\tprivate Map<String, Color> colors;\n\tprivate Map<String, Symbol> symbols;\n\tprivate Map<String, Image> images;\n\tprivate List<Instructio... | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import com.kreative.vexillo.core.Flag;
import com.kreative.vexillo.core.FlagParser;
import com.kre... |
private static void printHelp(String arg0) {
System.out.println();
System.out.println("VexMoji - Export Vexillo files to emoji fonts.");
System.out.println();
System.out.println("Usage:");
System.out.println(" " + arg0 + " [<options>] <output-file> <encoding-file> <flag-files>");
System.out.println();
... | Flag flag = FlagParser.parse(file.getName(), in); | 1 |
BlackCraze/GameResourceBot | src/main/java/de/blackcraze/grb/commands/concrete/UserConfig.java | [
"public static Locale getResponseLocale(Message message) {\r\n Locale channelLocale = getDefaultLocale();\r\n Mate mate = getMateDao().getOrCreateMate(message, channelLocale);\r\n if (mate != null && !StringUtils.isEmpty(mate.getLanguage())) {\r\n return new Locale(mate.getLanguage());\r\n }\r\n ... | import static de.blackcraze.grb.util.CommandUtils.getResponseLocale;
import static de.blackcraze.grb.util.InjectorUtils.getMateDao;
import de.blackcraze.grb.commands.BaseCommand;
import de.blackcraze.grb.core.Speaker;
import de.blackcraze.grb.i18n.Resource;
import de.blackcraze.grb.model.Device;
import de.blackcr... | package de.blackcraze.grb.commands.concrete;
public class UserConfig implements BaseCommand {
public void run(Scanner scanner, Message message) {
| Locale local = getResponseLocale(message);
| 0 |
emris/BCTFCcrossover | src/main/java/emris/bctfccrossover/BCTFCcrossover.java | [
"public class CraftingHandler\n{\n\t@SubscribeEvent\n\tpublic void onCrafting(ItemCraftedEvent e)\n\t{\n\t\tItem item = e.crafting.getItem();\n\t\t\n\t\tif(e.craftMatrix != null)\n\t\t{\n\t\t\tif(item == BCTFCItems.Rubber)\n\t\t\t{\n\t\t\t\tfor(int i = 0; i < e.craftMatrix.getSizeInventory(); i++)\n\t\t\t\t{\n\t\t\... | import java.util.logging.Logger;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.core.IIconProvider;
import buildcraft.core.BlockSpring;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw... | /**
* Copyright (C) 2013 emris
* https://github.com/emris/BCTFCcrossover
*
* 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) an... | FMLCommonHandler.instance().bus().register(new CraftingHandler()); | 0 |
luminis-ams/elastic-rest-spring-wrapper | src/main/java/eu/luminis/elastic/document/DocumentService.java | [
"@Component\npublic class ClusterManagementService {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(ClusterManagementService.class);\n private static final String HEADER_CONTENT_TYPE_KEY = \"Content-Type\";\n private static final String DEFAULT_HEADER_CONTENT_TYPE = \"application/json\";\... | import com.fasterxml.jackson.databind.ObjectMapper;
import eu.luminis.elastic.cluster.ClusterManagementService;
import eu.luminis.elastic.document.response.GetByIdResponse;
import eu.luminis.elastic.document.response.IndexResponse;
import org.apache.http.HttpEntity;
import org.apache.http.entity.StringEntity;
import or... | package eu.luminis.elastic.document;
/**
* Used to execute actions that interact with the documents in an elasticsearch index.
*/
@Component
public class DocumentService {
private static final Logger logger = LoggerFactory.getLogger(DocumentService.class);
private final ClusterManagementService clusterMa... | Response response = clusterManagementService.getRestClientForCluster(clusterName).performRequest(DELETE, endpoint); | 3 |
mmlevin/secu3droid | secu3droid/src/org/secu3/android/MainActivity.java | [
"public class ProtoFieldInteger extends BaseProtoField implements Parcelable {\n\tprivate int value;\n\tprivate int multiplier;\n\tprivate boolean signed;\n\n\t@Override\n\tpublic void writeToParcel(Parcel dest, int flags) {\n\t\tsuper.writeToParcel(dest, flags);\n\t\tdest.writeInt(value);\n\t\tdest.writeInt(multip... | import org.andengine.AndEngine;
import org.secu3.android.api.io.ProtoFieldInteger;
import org.secu3.android.api.io.ProtoFieldString;
import org.secu3.android.api.io.Secu3Manager.SECU3_TASK;
import org.secu3.android.api.io.Secu3Packet;
import org.secu3.android.api.io.Secu3Service;
import org.secu3.android.api.utils.Pack... | /* Secu3Droid - An open source, free manager for SECU-3 engine
* control unit
* Copyright (C) 2013 Maksim M. Levin. Russia, Voronezh
*
* SECU-3 - An open source, free engine control unit
* Copyright (C) 2007 Alexey A. Shabelnikov. Ukraine, Gorlovka
*
* This program is free software: you can redistribute it and... | private PacketUtils packetUtils = null; | 5 |
excella-core/excella-core | src/test/java/org/bbreak/excella/core/BookControllerTest.java | [
"@SuppressWarnings( \"serial\")\npublic class ExportException extends Exception {\n\n /**\n * コンストラクタ\n * \n * @param throwable スロー可能オブジェクト\n */\n public ExportException( Throwable throwable) {\n super( throwable);\n }\n}",
"@SuppressWarnings(\"serial\")\npublic class ParseExceptio... | import org.bbreak.excella.core.exporter.book.TextFileExporter;
import org.bbreak.excella.core.handler.DebugErrorHandler;
import org.bbreak.excella.core.listener.SheetParseListener;
import org.bbreak.excella.core.tag.excel2java.ListParser;
import org.bbreak.excella.core.tag.excel2java.MapParser;
import org.junit.Assert;... | /*-
* #%L
* excella-core
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses... | controller.setErrorHandler( new DebugErrorHandler()); | 5 |
dmfs/uri-toolkit | rfc3986-uri/src/main/java/org/dmfs/rfc3986/uris/Resolved.java | [
"public interface Authority\n{\n /**\n * Returns the {@link Optional} user info part of the authority in encoded form.\n *\n * @return The {@link UriEncoded} user info.\n */\n Optional<? extends UriEncoded> userInfo();\n\n /**\n * Returns the host of this authority.\n *\n * @ret... | import org.dmfs.optional.Optional;
import org.dmfs.rfc3986.Authority;
import org.dmfs.rfc3986.Fragment;
import org.dmfs.rfc3986.Path;
import org.dmfs.rfc3986.Query;
import org.dmfs.rfc3986.Scheme;
import org.dmfs.rfc3986.Uri; | /*
* Copyright 2017 dmfs GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in... | public Optional<? extends Scheme> scheme() | 4 |
tfreier/desktop-crm | src/main/java/net/combase/desktopcrm/swing/TaskTableModel.java | [
"public final class AsteriskManager\n{\n\n\tpublic interface AsteriskCallEventListener\n\t{\n\t\tpublic void incomingCall(String number);\n\n\t\tpublic void outgoingCall(String number);\n\t}\n\n\tprivate static AsteriskServer asteriskServer = null;\n\n\tprivate static String extension = \"\";\n\n\tprivate static Li... | import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.table.AbstractTableModel;
import org.joda.time.DateTime;
import org... | /**
*
*/
package net.combase.desktopcrm.swing;
/**
* @author "Till Freier"
*/
public class TaskTableModel extends AbstractTableModel
{
private enum RescheduleOption
{
LATER("Later"),
TOMORROW_AM("Tomorrow AM"),
TOMORROW_PM("Tomorrow PM"),
DAYS_2("In 2 days"),
NEXT_WEEK("Next Week");
private f... | CrmManager.completeTask(task); | 1 |
Nantes1900/Nantes-1900 | src/test/fr/nantes1900/models/MeshTest.java | [
"public class Edge {\r\n\r\n /**\r\n * Array of two points describing the edge.\r\n */\r\n private final Point[] points = new Point[2];\r\n\r\n /**\r\n * List of triangles containing this edge. The can be two triangles maximum.\r\n */\r\n private List<Triangle> triangles = new ArrayList<... | import java.util.List;
import javax.vecmath.Vector3d;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Test;
import fr.nantes1900.models.basis.Edge;
import fr.nantes1900.models.basis.Mesh;
import fr.nantes1900.models.basis.Point;
import fr.nantes1900.models.basis.Triangle;
impor... | package test.fr.nantes1900.models;
/**
* A set of tests for the class Mesh.
* @author Daniel Lefevre
*/
public class MeshTest extends TestCase {
/**
* Test attribute.
*/
private final Point p1 = new Point(1, 0, -1);
/**
* Test attribute.
*/
private final... | private final Mesh m = new Mesh();
| 1 |
kasirgalabs/ETUmulator | src/test/java/com/kasirgalabs/etumulator/visitor/CompareVisitorTest.java | [
"public class Assembler {\n private final Linker linker;\n private final Loader loader;\n\n /**\n * Constructs an Assembler object with the given {@link Memory}. Generated address space layout\n * and the data will be loaded in the memory.\n *\n * @param memory Memory for the allocated data... | import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import com.kasirgalabs.etumulator.lang.Assembler;
import com.kasirgalabs.etumulator.processor.APSR;
import com.kasirgalabs.etumulator.processor.BaseProcessor;
import com.kasirgalabs.etumulator.processor.BaseProcessorUnits;
import com... | package com.kasirgalabs.etumulator.visitor;
public class CompareVisitorTest {
private final Assembler assembler;
private final APSR apsr;
private final Processor processor;
public CompareVisitorTest() { | ProcessorUnits processorUnits = new BaseProcessorUnits(); | 5 |
Xilef11/runesofwizardry-classics | src/main/java/xilef11/mc/runesofwizardry_classics/runes/RuneSpiritTools.java | [
"public final class Refs {\n\tprivate Refs(){}\n\tpublic static final String MODID = \"runesofwizardry_classics\";\n\tpublic static final String VERSION = \"@VERSION@\";\n\tpublic static final String NAME=\"Runes of Wizardry - Classic Dusts Pack\";\n\tpublic static final String GUI_FACTORY=\"xilef11.mc.runesofwizar... | import java.io.IOException;
import java.util.Set;
import com.zpig333.runesofwizardry.api.RuneEntity;
import com.zpig333.runesofwizardry.tileentity.TileEntityDustActive;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.mine... | package xilef11.mc.runesofwizardry_classics.runes;
public class RuneSpiritTools extends ClassicRune {
public RuneSpiritTools() {
//register to the event bus to be able to create the spirit tools instances.
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void onItemRegister(RegistryEvent.Re... | return Refs.Lang.RUNE+".spirittools"; | 0 |
jGleitz/JUnit-KIT | src/sheet6/a_books/BookSearchTest.java | [
"public static Matcher<String> containsExactlyDividedBy(final String[] substrings, final String divider) {\n\treturn new BaseMatcher<String>() {\n\t\tprivate List<String> notContained = new LinkedList<>(Arrays.asList(substrings));\n\t\tprivate boolean hadTooMuch;\n\n\t\t@Override\n\t\tpublic boolean matches(final O... | import static test.KitMatchers.containsExactlyDividedBy;
import org.junit.Test;
import test.Input;
import test.InteractiveConsoleTest;
import test.SystemExitStatus;
import test.TestObject;
| package sheet6.a_books;
/**
* A test for the Interactive Console (Task A) <br>
* This test is based on the test for Sheet 5 Task C. The test is still under development.
*
* !!! The info command is not tested at all at the moment !!!
*
* @author Roman Langrehr
* @since 30.01.2015
* @version 0.1
... | TestObject.allowSystemExit(SystemExitStatus.ALL);
| 4 |
cosysoft/device | device-api/src/test/java/com/github/cosysoft/device/android/test/Readme.java | [
"public interface AndroidApp {\n\n\tString getBasePackage();\n\n\tString getMainActivity();\n\n\tvoid setMainActivity(String mainActivity);\n\n\tString getVersionName();\n\n\tvoid deleteFileFromWithinApk(String file);\n\n\tString getAppId();\n\n\t/**\n\t * For testing only\n\t */\n\tString getAbsolutePath();\n}",
... | import com.android.ddmlib.Log.LogLevel;
import com.android.ddmlib.logcat.LogCatFilter;
import com.android.ddmlib.logcat.LogCatListener;
import com.android.ddmlib.logcat.LogCatMessage;
import com.github.cosysoft.device.android.AndroidApp;
import com.github.cosysoft.device.android.AndroidDevice;
import com.github.cosysof... | package com.github.cosysoft.device.android.test;
public class Readme extends AndroidDeviceTest {
@Test
public void takeDevices() {
TreeSet<AndroidDevice> devices = AndroidDeviceStore.getInstance()
.getDevices();
for (AndroidDevice d : devices) {
System.out.println(d.getSerialNumber());
... | AndroidApp app = new DefaultAndroidApp(new File( | 3 |
lambdazen/pixy | src/main/java/com/lambdazen/pixy/pipemakers/BothLoop3.java | [
"public interface PipeMaker {\n\t/** Returns the signature as relationName + \"/\" + arity */\n\tpublic String getSignature();\n\n\t/** Given the bindings, this method returns a PixyPipe and adds any new replacements typically of the form x -> $x */\n\tpublic PixyPipe makePipe(List<PixyDatum> bindings, Map<String, ... | import java.util.List;
import java.util.Map;
import com.lambdazen.pixy.PipeMaker;
import com.lambdazen.pixy.PixyDatum;
import com.lambdazen.pixy.PixyPipe;
import com.lambdazen.pixy.VariableGenerator;
import com.lambdazen.pixy.pipes.AdjacentStep; | package com.lambdazen.pixy.pipemakers;
public class BothLoop3 implements PipeMaker {
@Override
public String getSignature() {
return "bothLoop/3";
}
@Override
public PixyPipe makePipe(List<PixyDatum> bindings, Map<String, PixyDatum> replacements, VariableGenerator varGen) { | return PipeMakerUtils.adjacentLoopPipe(AdjacentStep.both, AdjacentStep.both, bindings, replacements, varGen); | 4 |
ppeccin/javatari | javatari/src/org/javatari/pc/room/Room.java | [
"public final class RemoteReceiver {\r\n\r\n\tpublic RemoteReceiver() {\r\n\t\tupdates = new ConcurrentLinkedQueue<ServerUpdate>();\r\n\t}\r\n\r\n\tpublic void connect(String server) throws IOException {\r\n\t\ttryConnection(server);\r\n\t}\r\n\t\r\n\tpublic void disconnect() throws IOException {\r\n\t\tif (socket ... | import java.awt.Component;
import java.security.AccessControlException;
import java.util.ArrayList;
import org.javatari.atari.cartridge.Cartridge;
import org.javatari.atari.console.Console;
import org.javatari.atari.network.ClientConsole;
import org.javatari.atari.network.RemoteReceiver;
import org.javatari.atar... | public void morphToStandaloneMode() {
if (isStandaloneMode()) return;
powerOff();
Cartridge lastCartridge = isClientMode() ? cartridgeProvided : currentConsole.cartridgeSocket().inserted();
if (standaloneConsole == null) buildAndPlugStandaloneConsole();
else plugConsole(standaloneConsole);
adjustPeri... | RemoteReceiver remoteReceiver = new RemoteReceiver();
| 0 |
matt-allen/repay-android | repay/src/main/java/com/repay/android/MainActivity.java | [
"public class AddDebtActivity extends DebtActivity\n{\n\n\tprivate static final String TAG = AddDebtActivity.class.getName();\n\n\tprivate int mFrame;\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState)\n\t{\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tgetActionBar().setDisplayHomeAsUpEnabled(true)... | import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.repay.android.adddebt.AddDebtActivity;
import com.repay.android.database.DatabaseHandler;
import com.repay.android.model.Friend;
import com.repay.android.settings.Sett... | package com.repay.android;
/**
* Property of Matt Allen
* mattallen092@gmail.com
* http://mattallensoftware.co.uk/
*
* This software is distributed under the Apache v2.0 license and use
* of the Repay name may not be used without explicit permission from the project owner.
*/
public class MainActivity exten... | intent.setClass(this, AddDebtActivity.class); | 0 |
el-groucho/jsRules | src/test/java/org/grouchotools/jsrules/util/RulesetTypeHandlerTest.java | [
"public abstract class Executor {\n private static final Logger LOG = LoggerFactory.getLogger(Executor.class);\n\n /**\n * Validate that parameter is present (not null) and is an instance of the correct\n * class\n *\n * @param key the name of the parameter\n * @param parameter ... | import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.List;
import static org.junit.Assert.assertTrue;
import org.grouchotools.jsrules.Executor;
import org.grouchotools.jsrules.impl.AllTrueRulesetExecutorImpl;
import org.grouchotools.jsrules.impl.AllTrueRulesetListExecutorImpl;
import... | /*
* The MIT License
*
* Copyright 2015 Paul.
*
* 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, me... | List<Executor> ruleSet; | 0 |
andrey7mel/android-step-by-step | app/src/test/java/com/andrey7mel/stepbystep/model/ModelImplTest.java | [
"public interface ApiInterface {\n\n @GET(\"/users/{user}/repos\")\n Observable<List<RepositoryDTO>> getRepositories(@Path(\"user\") String user);\n\n @GET(\"/repos/{owner}/{repo}/contributors\")\n Observable<List<ContributorDTO>> getContributors(@Path(\"owner\") String owner, @Path(\"repo\") String rep... | import com.andrey7mel.stepbystep.model.api.ApiInterface;
import com.andrey7mel.stepbystep.model.dto.BranchDTO;
import com.andrey7mel.stepbystep.model.dto.ContributorDTO;
import com.andrey7mel.stepbystep.model.dto.RepositoryDTO;
import com.andrey7mel.stepbystep.other.BaseTest;
import com.andrey7mel.stepbystep.other.Test... | package com.andrey7mel.stepbystep.model;
public class ModelImplTest extends BaseTest {
@Inject | protected ApiInterface apiInterface; | 0 |
glenrobson/SimpleAnnotationServer | src/test/java/uk/org/llgc/annotation/store/test/TestBOR.java | [
"public class IDConflictException extends Exception {\n\tpublic IDConflictException() {\n\t\tsuper();\n\t}\n\n\tpublic IDConflictException(final String pMessage) {\n\t\tsuper(pMessage);\n\t}\n}",
"public interface StoreAdapter {\n\n\tpublic void init(final AnnotationUtils pAnnoUtils);\n\n // CRUD annotations\n... | import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Rule;
import org.junit.Before;
import org.junit.After;
import org.junit.rules.TemporaryFolder;
import com.github.jsonldjava.utils.JsonUtils;
import java.util.List... | package uk.org.llgc.annotation.store.test;
public class TestBOR extends TestUtils {
protected static Logger _logger = LogManager.getLogger(TestBOR.class.getName());
public TestBOR() throws IOException {
super(new BookOfPeaceEncoder());
}
@Before
public void setup() throws IOException {
super.setup... | Map<String, Object> tAnnotationJSON = _annotationUtils.readAnnotaion(new FileInputStream(getClass().getResource("/jsonld/borAnnotation.json").getFile()), StoreConfig.getConfig().getBaseURI(null)); | 5 |
priiduneemre/btcd-cli4j | daemon/src/main/java/com/neemre/btcdcli4j/daemon/notification/NotificationMonitor.java | [
"public interface BtcdClient {\n\t\n\tString addMultiSigAddress(Integer minSignatures, List<String> addresses) \n\t\t\tthrows BitcoindException, CommunicationException;\n\n\tString addMultiSigAddress(Integer minSignatures, List<String> addresses, String account) \n\t\t\tthrows BitcoindException, CommunicationExcept... | import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.util.Observable;
import java.util.Observer;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import ... | package com.neemre.btcdcli4j.daemon.notification;
public class NotificationMonitor extends Observable implements Observer, Runnable {
private static final Logger LOG = LoggerFactory.getLogger(NotificationMonitor.class);
private static final int WORKER_MIN_COUNT = 1;
private static final int WORKER_MAX_COUNT = 1... | private BtcdClient client; | 0 |
jackyhung/consumer-dispatcher | src/main/java/com/thenetcircle/comsumerdispatcher/distribution/watcher/BaseJobPoolLevelWatcher.java | [
"public class DistributionManager {\n\tprivate static Log _logger = LogFactory.getLog(DistributionManager.class);\n\t\n\tprivate static DistributionManager _self = null;\n\t\n\tprotected Thread distributionThread;\n\tprotected ServerConfig sc;\n\tprotected ZooKeeper zk;\n\t\n\t/**\n\t * the type of how the applicat... | import java.net.MalformedURLException;
import com.thenetcircle.comsumerdispatcher.distribution.DistributionManager;
import com.thenetcircle.comsumerdispatcher.distribution.DistributionTreeConstants;
import com.thenetcircle.comsumerdispatcher.job.JobExecutor;
import com.thenetcircle.comsumerdispatcher.thread.ConsumerJob... | package com.thenetcircle.comsumerdispatcher.distribution.watcher;
public abstract class BaseJobPoolLevelWatcher extends BaseWatcher {
protected static Integer mutex; | protected ConsumerJobExecutorPool pool; | 3 |
PhantomThief/simple-failover-java | src/test/java/com/github/phantomthief/failover/util/FailoverUtilsTest.java | [
"public static boolean checkRatio(int a, int b, int ratio) {\n return between((double) a / b, (double) ratio - OFFSET, (double) ratio + OFFSET);\n}",
"public static boolean isHostUnavailable(Throwable t) {\n Throwable rootCause = getRootCause(t);\n if (rootCause instanceof NoRouteToHostException) {\n ... | import static com.github.phantomthief.failover.WeighTestUtils.checkRatio;
import static com.github.phantomthief.failover.util.FailoverUtils.isHostUnavailable;
import static com.github.phantomthief.failover.util.FailoverUtils.runWithRetry;
import static com.github.phantomthief.failover.util.FailoverUtils.supplyWithRetry... | package com.github.phantomthief.failover.util;
/**
* @author w.vela
* Created on 2019-01-04.
*/
class FailoverUtilsTest {
@Test
void test() {
test("localhost", 1, 100);
test("111.222.222.112", 2, 100);
}
@Test
void testRetry() { | WeightFailover<String> failover = WeightFailover.<String> newGenericBuilder() | 4 |
AppHero2/Raffler-Android | app/src/main/java/com/raffler/app/AppSplashActivity.java | [
"public class AlertView {\r\n public enum Style{\r\n ActionSheet,\r\n Alert\r\n }\r\n private final FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(\r\n ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM\r\n );\r\n public s... | import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat... | package com.raffler.app;
/**
* Created by Ghost on 14/8/2017.
*/
public class AppSplashActivity extends AppCompatActivity {
private static final String TAG = "AppSplashActivity";
private static final long SPLASH_DURATION = 100L;//2000L;
private Handler handler;
private Runnable runnable;
... | AlertView alertView = new AlertView(getString(R.string.alert_title_notice), "Your current version is "+ currentVersion +"\nYou must update this app to the latest version", getResources().getString(R.string.alert_button_okay), null, null, AppSplashActivity.this, AlertView.Style.Alert, new OnI... | 0 |
i2p/i2p.itoopie | src/net/i2p/itoopie/gui/component/chart/OutboundBandwidthTracker.java | [
"public class JSONRPC2SessionException extends Exception {\n\n\t\n\t/**\n\t * The exception cause is network or I/O related.\n\t */\n\tpublic static final int NETWORK_EXCEPTION = 1;\n\t\n\t\n\t/**\n\t * Unexpected \"Content-Type\" header value of the HTTP response.\n\t */\n\tpublic static final int UNEXPECTED_CONTE... | import java.util.EnumMap;
import java.util.HashMap;
import com.thetransactioncompany.jsonrpc2.client.JSONRPC2SessionException;
import net.i2p.itoopie.i2pcontrol.InvalidParametersException;
import net.i2p.itoopie.i2pcontrol.InvalidPasswordException;
import net.i2p.itoopie.i2pcontrol.methods.GetRateStat;
import net.i2p.i... | package net.i2p.itoopie.gui.component.chart;
public class OutboundBandwidthTracker extends Thread implements Tracker {
/** Last read bw */
private double m_value = 0;
private final int updateInterval;
private volatile boolean running;
/**
* Start daemon that checks to current inbound bandwidth of the rout... | } catch (InvalidPasswordException e) { | 2 |
andrzejchm/RESTMock | androidsample/src/androidTest/java/io/appflate/restmock/androidsample/tests/MainActivityTest.java | [
"@SuppressWarnings(\"unused\")\npublic class RESTMockServer {\n\n public static final String RESPONSE_NOT_MOCKED = \"NOT MOCKED\";\n public static final String MORE_THAN_ONE_RESPONSE_ERROR = \"There are more than one response matching this request: \";\n static MockWebServer mockWebServer;\n static Matc... | import static io.appflate.restmock.utils.RequestMatchers.pathEndsWith;
import static io.appflate.restmock.utils.RequestMatchers.pathStartsWith;
import static org.hamcrest.CoreMatchers.not;
import androidx.test.rule.ActivityTestRule;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import io.appfla... | /*
* Copyright (C) 2016 Appflate.io
*
* 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 ... | RequestsVerifier.verifyRequest(pathEndsWith(USERNAME_ANDRZEJCHM)).invoked(); | 1 |
opencb/bionetdb | bionetdb-lib/src/main/java/org/opencb/bionetdb/lib/executors/NodeQueryExecutor.java | [
"public class BioNetDBException extends Exception {\n\n public BioNetDBException(String message) {\n super(message);\n }\n\n public BioNetDBException(String message, Throwable cause) {\n super(message, cause);\n }\n\n public BioNetDBException(Throwable cause) {\n super(cause);\n ... | import org.opencb.bionetdb.core.exceptions.BioNetDBException;
import org.opencb.bionetdb.core.models.network.Node;
import org.opencb.bionetdb.core.models.network.NodeStats;
import org.opencb.bionetdb.core.models.network.Relation;
import org.opencb.bionetdb.core.response.BioNetDBResult;
import org.opencb.bionetdb.lib.ap... | package org.opencb.bionetdb.lib.executors;
public class NodeQueryExecutor {
private static final int QUERY_MAX_RESULTS = 50000;
private NetworkDBAdaptor networkDBAdaptor;
public NodeQueryExecutor(NetworkDBAdaptor networkDBAdaptor) {
this.networkDBAdaptor = networkDBAdaptor;
}
| public BioNetDBResult<Node> getNode(long uid) throws BioNetDBException { | 1 |
TheCount/jhilbert | src/main/java/jhilbert/expressions/impl/TranslatorImpl.java | [
"public abstract class DataFactory {\n\n\t/**\n\t * Instance.\n\t */\n\tprivate static final DataFactory instance = new jhilbert.data.impl.DataFactory();\n\n\t/**\n\t * Obtains a <code>DataFactory</code> instance.\n\t *\n\t * @return a <code>DataFactory</code> instance.\n\t */\n\tpublic static DataFactory getInstan... | import jhilbert.data.Term;
import jhilbert.data.Variable;
import jhilbert.expressions.Expression;
import jhilbert.expressions.ExpressionException;
import jhilbert.expressions.Translator;
import org.apache.log4j.Logger;
import java.util.HashMap;
import java.util.Map;
import jhilbert.data.DataFactory;
import jhilbert.dat... | /*
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/... | private final Map<Functor, Functor> functorMap; | 1 |
thirdy/durian | durian/src/main/java/qic/ui/SearchResultTable.java | [
"@SuppressWarnings(\"rawtypes\")\npublic class BeanPropertyTableModel<T> extends AbstractTableModel {\n\t\n\tprivate static final long serialVersionUID = 1L;\n\t\n\t/** class of the data in rows */\n\tprivate final Class beanClass;\n /** collection of table rows */\n private List<T> data = new ArrayList<T>();... | import static java.lang.String.format;
import static java.util.Arrays.asList;
import java.awt.Color;
import java.awt.Point;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.List;
import java.util.function.Consumer;
import javax.swing.ImageIcon;
import javax.swing.JTable;
... | /*
* Copyright (C) 2015 thirdy
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is dis... | private BeanPropertyTableModel<SearchResultItem> model;
| 1 |
timwhit/lego | sales-service-impl/src/main/java/com/whitney/sales/service/SalesServiceImpl.java | [
"public class MessageQueue {\n public static final String SALE_CREATED = \"saleCreated\";\n}",
"@Service\n@Validated\npublic class MessageSender {\n @Autowired\n private JmsTemplate jmsTemplate;\n\n @Autowired\n private ObjectMapper mapper;\n\n public void sendMessage(Object message, String dest... | import com.whitney.common.messaging.MessageQueue;
import com.whitney.common.messaging.MessageSender;
import com.whitney.common.util.MapperUtils;
import com.whitney.product.web.vo.ProductVO;
import com.whitney.sales.data.dao.ProductDAO;
import com.whitney.sales.data.dao.SalesDAO;
import com.whitney.sales.data.dto.SaleDT... | package com.whitney.sales.service;
@Validated
@Transactional
@Service
public class SalesServiceImpl implements SalesService {
@Autowired
private SalesDAO salesDAO;
@Autowired
private ProductDAO productDAO;
@Autowired
private MapperUtils mapper;
@Autowired
private MessageSender mess... | SaleDTO saleDTO = this.mapper.map(sale, SaleDTO.class); | 6 |
apache/karaf-cave | deployer/service/src/main/java/org/apache/karaf/cave/deployer/service/management/DeployerMBeanService.java | [
"public class Bundle {\n\n private String id;\n private String name;\n private String version;\n private String state;\n private int startLevel;\n\n public String getId() {\n return id;\n }\n\n public void setId(String id) {\n this.id = id;\n }\n\n public int getStartLeve... | import org.apache.karaf.cave.deployer.Bundle;
import org.apache.karaf.cave.deployer.Connection;
import org.apache.karaf.cave.deployer.DeployerService;
import org.apache.karaf.cave.deployer.Feature;
import org.apache.karaf.cave.deployer.FeaturesRepository;
import org.osgi.service.component.annotations.Component;
import ... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distrib... | Connection connection = new Connection(); | 1 |
oxoooo/excited-android | app/src/main/java/ooo/oxo/excited/ImageActivity.java | [
"public class RxFiles {\n\n public static Observable<File> copy(final File from, final File to) {\n return Observable.defer(() -> {\n FileInputStream input = null;\n FileOutputStream output = null;\n\n try {\n input = new FileInputStream(from);\n ... | import android.Manifest;
import android.app.WallpaperManager;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
import android.support.v4.content.FileProvider;... | package ooo.oxo.excited;
public class ImageActivity extends RxAppCompatActivity implements
ImageViewTouch.OnImageViewTouchSingleTapListener, View.OnLongClickListener {
private static final String AUTHORITY_IMAGES = BuildConfig.APPLICATION_ID + ".images";
private ProgressBar progressBar;
priv... | return RxFiles.mkdirsIfNotExists(new File(Environment.getExternalStorageDirectory(), name)); | 0 |
sorinMD/MCTS | src/main/java/mcts/tree/ExpansionPolicy.java | [
"public interface Game {\n\n\t/**\n\t * @return a clone of the game state\n\t */\n\tpublic int[] getState();\n\n\tpublic int getWinner();\n\n\tpublic boolean isTerminal();\n\n\tpublic int getCurrentPlayer();\n\n\t/**\n\t * Updates the state description based on the chosen action\n\t * \n\t * @param a\n\t * ... | import java.util.ArrayList;
import java.util.Collections;
import java.util.concurrent.ThreadLocalRandom;
import mcts.game.Game;
import mcts.game.GameFactory;
import mcts.seeder.SeedTrigger;
import mcts.tree.node.StandardNode;
import mcts.tree.node.Key;
import mcts.tree.node.TreeNode;
import mcts.utils.Options;
import m... | package mcts.tree;
/**
* The default expansion policy.
*
* @author sorinMD
*
*/
public class ExpansionPolicy {
/**
* Expands a node and adds all the children to the tree data structure. It
* also selects the next one at random. If seeding is used it adds the newly
* expanded node to the seed trigger.
... | Options options = game.listPossiblities(false);//always list all options when expanding | 6 |
12315jack/j1st-mqtt | j1st-mqtt-http/src/main/java/com/github/j1stiot/mqtt/http/MqttHttp.java | [
"public class OAuthAuthenticator implements io.dropwizard.auth.Authenticator<String, UserPrincipal> {\n\n private final Authenticator authenticator;\n\n public OAuthAuthenticator(Authenticator authenticator) {\n this.authenticator = authenticator;\n }\n\n /**\n * Authenticate\n * <p>\n ... | import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.github.j1stiot.mqtt.http.oauth.OAuthAuthenticator;
import com.github.j1stiot.mqtt.http.resources.MqttSubscribeResource;
import com.git... | package com.github.j1stiot.mqtt.http;
/**
* MQTT Http Interface
*/
public class MqttHttp extends Application<MqttHttpConfiguration> {
private static final Logger logger = LoggerFactory.getLogger(MqttHttp.class);
private static PropertiesConfiguration redisConfig;
private static PropertiesConfiguration... | HttpCommunicator communicator = (HttpCommunicator) Class.forName(communicatorConfig.getString("communicator.class")).newInstance(); | 6 |
Netflix/Raigad | raigad/src/main/java/com/netflix/raigad/resources/ElasticsearchConfig.java | [
"@ImplementedBy(RaigadConfigSource.class)\npublic interface IConfigSource\n{\n\n /**\n * Must be called before any other method. This method will allow implementations to do any setup that they require\n * before being called.\n */\n void initialize(String asgName, String region);\n\n /*\n ... | import com.google.gson.JsonObject;
import com.google.inject.Inject;
import com.google.inject.name.Named;
import com.netflix.raigad.configuration.IConfigSource;
import com.netflix.raigad.configuration.IConfiguration;
import com.netflix.raigad.identity.RaigadInstance;
import com.netflix.raigad.startup.RaigadServer;
impor... | /**
* Copyright 2017 Netflix, Inc.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or... | JSONObject raigadJson = ElasticsearchUtils.transformRaigadInstanceToJson(instances); | 4 |
GoogleCloudPlatform/runtime-builder-java | java-runtime-builder-app/src/main/java/com/google/cloud/runtimes/builder/buildsteps/base/BuildStepFactory.java | [
"public class GradleBuildStep implements BuildStep {\n\n private final Logger logger = LoggerFactory.getLogger(GradleBuildStep.class);\n\n private final String gradleImage;\n\n @Inject\n GradleBuildStep(@GradleDockerImage String gradleImage) {\n this.gradleImage = gradleImage;\n }\n\n @Override\n public v... | import com.google.cloud.runtimes.builder.buildsteps.GradleBuildStep;
import com.google.cloud.runtimes.builder.buildsteps.JettyOptionsBuildStep;
import com.google.cloud.runtimes.builder.buildsteps.MavenBuildStep;
import com.google.cloud.runtimes.builder.buildsteps.PrebuiltRuntimeImageBuildStep;
import com.google.cloud.r... | /*
* Copyright 2017 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | PrebuiltRuntimeImageBuildStep createPrebuiltRuntimeImageBuildStep(); | 3 |
authlete/java-oauth-server | src/main/java/com/authlete/jaxrs/server/api/obb/ConsentsEndpoint.java | [
"public class ConsentDao\n{\n private static final ConsentDao sInstance = new ConsentDao(\"example\");\n\n\n private final String mNamespace;\n private final ConsentStore mStore;\n\n\n private ConsentDao(String namespace)\n {\n mNamespace = namespace;\n mStore = new ConsentStore();\... | import static com.authlete.common.util.FapiUtils.X_FAPI_INTERACTION_ID;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import jav... | /*
* Copyright (C) 2021 Authlete, 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 agr... | Consent consent = ConsentDao.getInstance() | 0 |
Epic-Breakfast-Productions/OWAT | implementations/java/OWAT-lib/src/test/java/com/ebp/owat/lib/ExceptionTests.java | [
"public class OwatStructureException extends OwatException {\n\tpublic OwatStructureException() {super();}\n\t\n\tpublic OwatStructureException(String s) {\n\t\tsuper(s);\n\t}\n\t\n\tpublic OwatStructureException(String s, Throwable throwable) {\n\t\tsuper(s, throwable);\n\t}\n\t\n\tpublic OwatStructureException(Th... | import com.ebp.owat.lib.datastructure.OwatStructureException;
import com.ebp.owat.lib.datastructure.matrix.OwatMatrixException;
import com.ebp.owat.lib.datastructure.matrix.utils.OwatMatrixUtilException;
import com.ebp.owat.lib.datastructure.value.OwatValueException;
import com.ebp.owat.lib.datastructure.set.OwatSetExc... | package com.ebp.owat.lib;
@RunWith(Parameterized.class)
public class ExceptionTests {
private static final Logger LOGGER = LoggerFactory.getLogger(ExceptionTests.class);
/** The different exceptions to test. */
@Parameterized.Parameters
public static Collection exceptionsToTest() {
return Arrays.asList(new ... | { OwatUtilException.class }, | 5 |
zond/android-diplicity | app/src/main/java/se/oort/diplicity/NotificationReceiveActivity.java | [
"public class Game implements java.io.Serializable {\n public String ID;\n public Boolean Started;\n public Boolean Closed;\n public Boolean Finished;\n public String Desc;\n public String Variant;\n public Long PhaseLengthMinutes;\n public Long NonMovementPhaseLengthMinutes;\n public Double MaxHated;\n p... | import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.media.RingtoneManager;
import android.net.Uri;
import android.os.Bundle;
import android.sup... | package se.oort.diplicity;
// NotificationReceiveActivity receives notifications directly from FCM when the app was
// turned off as the notification arrived (and triggers using the ClickAction), via
// the MessagingService if the app was turned on but no activity consumed that particular
// message and via the Ala... | Intent gameIntent = GameActivity.startGameIntent(NotificationReceiveActivity.this, gameSingleContainer.Properties, phaseMultiContainer); | 5 |
charliem/OCM | Output Languages/Java/TestHarness/src/com/kissintelligentsystems/ocm/java/sample/generated/Account.java | [
"public abstract class BaseTable \n{\n\tpublic abstract String getKey();\n\t\n\tpublic abstract void newKey(Random rand) throws Exception;\n\t\n\tpublic abstract void save() throws Exception;\n\n\tpublic abstract void delete() throws Exception;\n\n\tpublic abstract void loadAll() throws Exception;\n\n\t\n\tprotecte... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Random;
import me.prettyprint.cassandra.service.Keyspace;
import org.apache.cassandra.thrift.*;
import org.ap... |
//Update Many 2 Many Columns
dynamicIterator = users.getDeletedColumns().iterator();
while(dynamicIterator.hasNext())
{
String foreignKey = dynamicIterator.next();
ColumnPath localColumnPath = new ColumnPath("Accounts");
localColumnPath.setSuper_column(usersSuperNameBytes);
localCo... | public static class AccountScanner extends BaseTableScanner | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.