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
hanks-zyh/FlyWoo
app/src/main/java/com/zjk/wifiproject/socket/tcp/TcpService.java
[ "public class BaseApplication extends Application {\n\n public static boolean isDebugmode = true;\n private boolean isPrintLog = true;\n\n /** 静音、震动默认开关 **/\n private static boolean isSlient = false;\n private static boolean isVIBRATE = true;\n\n /** 新消息提醒 **/\n private static int notiSoundPool...
import android.content.Context; import android.content.Intent; import android.os.Handler; import com.orhanobut.logger.Logger; import com.zjk.wifiproject.BaseApplication; import com.zjk.wifiproject.config.ConfigBroadcast; import com.zjk.wifiproject.config.ConfigIntent; import com.zjk.wifiproject.entity.Constant; import ...
input = socket.getInputStream(); dataInput = new DataInputStream(input); L.d(TAG, "获取网络输入流成功"); } catch (IOException e) { // TODO Auto-generated catch block L.d(TAG, "获取网络输入流失败"); SCAN_RECIEVE = false...
Intent intent = new Intent(ConfigBroadcast.ACTION_NEW_MSG);
1
EasyPost/easypost-java
src/main/java/com/easypost/app/BatchExample.java
[ "public abstract class EasyPost {\n public static final String VERSION = \"${project.version}\";\n public static String API_BASE = \"https://api.easypost.com/v2\";\n public static String apiKey;\n public static String apiVersion;\n public static int readTimeout;\n}", "public class EasyPostException...
import com.easypost.EasyPost; import com.easypost.exception.EasyPostException; import com.easypost.model.Address; import com.easypost.model.Batch; import com.easypost.model.CustomsInfo; import com.easypost.model.CustomsItem; import com.easypost.model.Parcel; import com.easypost.model.Shipment; import java.util.ArrayLis...
package com.easypost.app; public class BatchExample { public static void main(final String[] args) throws InterruptedException { EasyPost.apiKey = "cueqNZUb3ldeWTNX7MU3Mel8UXtaAMUi"; try { Map<String, Object> fromAddressMap = new HashMap<String, Object>(); fromAddressMap...
CustomsItem customsItem1 = CustomsItem.create(customsItem1Map);
5
envyfan/AndroidReview
app/src/main/java/com/vv/androidreview/ui/activites/FavActivity.java
[ "public abstract class BaseActivity extends AppCompatActivity {\n\n protected Toolbar toolbar;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n onBeforeSetContentLayout();\n //禁止横屏\n setRequestedOrientation(ActivityInfo...
import android.widget.TextView; import com.vv.androidreview.R; import com.vv.androidreview.base.BaseActivity; import com.vv.androidreview.entity.Test; import com.vv.androidreview.ui.fragment.TestFragment; import com.vv.androidreview.ui.view.AnswerItem; import com.vv.androidreview.cache.CacheHelper; import android.conte...
/* * Copyright (c) 2016. Vv <envyfan@qq.com><http://www.v-sounds.com/> * * This file is part of AndroidReview (Android面试复习) * * AndroidReview is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either vers...
if (mTest.getTestType() == TestFragment.TYPE_SINGLE_ANSWER) {
2
el-groucho/jsRules
src/main/java/org/grouchotools/jsrules/util/RulesetTypeHandler.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.grouchotools.jsrules.Executor; import org.grouchotools.jsrules.RulesetExecutor; import org.grouchotools.jsrules.impl.AllTrueRulesetExecutorImpl; import org.grouchotools.jsrules.impl.AllTrueRulesetListExecutorImpl; import org.grouchotools.jsrules.impl.FirstTrueRulesetExecutorImpl; import org.grouchotools.jsru...
package org.grouchotools.jsrules.util; /** * Created by Paul Richardson 5/14/2015 */ public enum RulesetTypeHandler { ALLTRUE { @Override @SuppressWarnings("unchecked")
public RulesetExecutor getRulesetExecutor(String name, List<Executor> ruleSet, Object response) {
1
rapidftr/RapidFTR-Android
RapidFTR-Android/src/test/java/com/rapidftr/activity/ViewEnquiryActivityTest.java
[ "public class CustomTestRunner extends RobolectricTestRunner {\n\n public static List<FormSection> formSectionSeed = Arrays.asList(\n new FormSection(new HashMap<String, String>() {{\n put(\"en\", \"Section 1\");\n }}, 1, true, new HashMap<String, String>() {{\n ...
import android.os.Bundle; import com.google.inject.Injector; import com.rapidftr.CustomTestRunner; import com.rapidftr.RapidFtrApplication; import com.rapidftr.database.DatabaseSession; import com.rapidftr.database.ShadowSQLiteHelper; import com.rapidftr.model.Enquiry; import com.rapidftr.model.User; import com.rapidft...
package com.rapidftr.activity; @RunWith(CustomTestRunner.class) public class ViewEnquiryActivityTest { protected ViewEnquiryActivity activity; public DatabaseSession session; private EnquiryRepository enquiryRepository; @Mock private EnquiryRepository mockEnquiryRepository; @Mock privat...
session = new ShadowSQLiteHelper("test_database").getSession();
2
paspiz85/nanobot
src/test/java/it/paspiz85/nanobot/test/steps/AttackScreenSteps.java
[ "public class BotBadBaseException extends BotException {\n\n private static final long serialVersionUID = 1L;\n\n public BotBadBaseException(final String msg) {\n super(msg);\n }\n\n public BotBadBaseException(final String msg, final Throwable t) {\n super(msg, t);\n }\n}", "public cl...
import it.paspiz85.nanobot.exception.BotBadBaseException; import it.paspiz85.nanobot.exception.BotException; import it.paspiz85.nanobot.game.AttackScreen; import it.paspiz85.nanobot.game.EnemyInfo; import it.paspiz85.nanobot.game.Screen; import it.paspiz85.nanobot.util.Point; import org.junit.Assert; import cucumber.ap...
package it.paspiz85.nanobot.test.steps; public class AttackScreenSteps { @Then("^collectors is (.*)$") public void thenCollectorIs(final Boolean full) { final Boolean isCollectorsFull = ScenarioContext.get("isCollectorsFull", Boolean.class); Assert.assertEquals(full, isCollectorsFull); ...
final String trophyWin, final String thophyDefeat) throws BotBadBaseException {
0
apache/geronimo-gshell
gshell-commands/gshell-standard-commands/src/main/java/org/apache/geronimo/gshell/commands/standard/EchoCommand.java
[ "public interface Command\n{\n /** Standard command success status code. */\n int SUCCESS = 0;\n\n /** Standard command failure status code. */\n int FAILURE = -1;\n\n String getName();\n\n void init(CommandContext context); // throws Exception ?\n\n Object execute(Object... args) throws Except...
import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.geronimo.gshell.command.Command; import org.apache.geronimo.gshell.command.CommandSupport; import org.apache.geronimo.gshell.command.MessageSource; import org.apache.geronimo....
/* * 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 ...
IO io = getIO();
4
inovex/zax
src/main/java/com/inovex/zabbixmobile/data/HomescreenWidgetService.java
[ "public class ProblemsActivity extends BaseSeverityFilterActivity<Trigger> {\n\n\tpublic static final String ARG_TRIGGER_POSITION = \"ARG_TRIGGER_POSITION\";\n\tprivate static final String TAG = ProblemsActivity.class.getSimpleName();\n\tpublic static final String ARG_START_FROM_NOTIFICATION = \"arg_start_from_noti...
import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.PendingIntent; import android.app.Service; import android.appwidget.AppWidgetManager; import android.content.ComponentName; import android.content.Intent; import android.os.AsyncTask; import android.os.Build; import android....
/* This file is part of ZAX. ZAX is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ZAX is distributed in the hope that it will be useful...
private List<Trigger> problems;
3
richkmeli/Richkware-Manager-Server
src/main/java/it/richkmeli/rms/data/LoadDatabase.java
[ "@Component\npublic class ConfigurationDatabaseManager {\n private static ConfigurationRepository configurationRepository;\n\n @Autowired\n public ConfigurationDatabaseManager(ConfigurationRepository configurationRepository) {\n this.configurationRepository = configurationRepository;\n }\n\n p...
import it.richkmeli.jframework.util.RandomStringGenerator; import it.richkmeli.rms.data.entity.configuration.ConfigurationDatabaseManager; import it.richkmeli.rms.data.entity.configuration.ConfigurationEnum; import it.richkmeli.rms.data.entity.configuration.ConfigurationManager; import it.richkmeli.rms.data.entity.devi...
package it.richkmeli.rms.data; // Annotating a class with the @Configuration annotation indicates // that the class will be used by JavaConfig as a source of bean definitions. @Configuration class LoadDatabase { @Bean CommandLineRunner initDatabase(AuthDatabaseSpringManager authDatabaseSpringManager, Device...
ConfigurationManager.getValue(ConfigurationEnum.DEFAULT_CONFIGURATION_3);
2
emop/EmopAndroid
src/com/weibo/sdk/android/sso/SsoHandler.java
[ "public class Constants {\r\n\tpublic static final String APP_ID = \"\";\r\n\tpublic static final String TAG_EMOP = \"emop\";\r\n\t\r\n\tpublic static final String PREFS_NAME = \"taodianhuo_perfs\";\r\n\t\r\n\tpublic static final String PREFS_OAUTH_ID = \"fmei_user_id\";\r\n\tpublic static final String PREFS_TRACK_...
import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.co...
package com.weibo.sdk.android.sso; /** * 该类用于处理sso 认证功能,通过sso,无需输入用户名、密码即可以通过微博账号访问经过授权的第三方应用,\r\n * 使用SSO登录前,请检查手机上是否已经安装新浪微博客户端,目前仅3.0.0及以上微博客户端版本支持SSO; * 如果未安装,将自动转为Oauth2.0进行认证 * * @author xiaowei6@staff.sina.com.cn * */ public class SsoHandler { public static final int START_WEB_LOGIN = 2001; public s...
private Weibo mWeibo;
4
MagicMicky/HabitRPGJavaAPI
HabitRPGJavaAPI/src/com/magicmicky/habitrpglibrary/onlineapi/BuyItem.java
[ "public static class SpecialReward extends Reward {\n\tprivate static SpecialReward[] weapons= {\n\t\t new SpecialReward(0, \"Training Sword\",\"weapon_0\",\"Training weapon.\",0,0),\n\t\t new SpecialReward(1, \"Sword\",\"weapon_1\",\"Increases experience gain by 3%.\",3,20),\n\t\t new SpecialReward(2, \"A...
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.json.JSONObject; import com.magicmicky.habitrpglibrary.habits.Reward.SpecialReward; import com.magicmicky.habitrpglibrary.habits.User; import com.magicmicky.habitrpglibrary.habits.UserLook; import com.magic...
package com.magicmicky.habitrpglibrary.onlineapi; public class BuyItem extends WebServiceInteraction { private final static String CMD = "user/buy/"; private SpecialReward itemBought; public BuyItem(OnHabitsAPIResult callback, HostConfig config, SpecialReward itemBought) { super(CMD + itemBought.getType(), call...
protected Answer findAnswer(JSONObject answer) {
3
dflick-pivotal/sentimentr-release
src/sentimentr-service-broker/src/main/java/io/pivotal/fe/sentimentr/broker/service/SentimentrServiceInstanceService.java
[ "@Getter\n@ToString(callSuper = true)\n@EqualsAndHashCode(callSuper = true)\n@JsonAutoDetect(getterVisibility = JsonAutoDetect.Visibility.NONE)\npublic class CreateServiceInstanceRequest extends AsyncParameterizedServiceInstanceRequest {\n\n\t/**\n\t * The ID of the service to provision, from the broker catalog.\n\...
import org.springframework.cloud.servicebroker.model.CreateServiceInstanceRequest; import org.springframework.cloud.servicebroker.model.CreateServiceInstanceResponse; import org.springframework.cloud.servicebroker.model.DeleteServiceInstanceRequest; import org.springframework.cloud.servicebroker.model.DeleteServiceInst...
package io.pivotal.fe.sentimentr.broker.service; @Service public class SentimentrServiceInstanceService implements ServiceInstanceService { @Override public CreateServiceInstanceResponse createServiceInstance(CreateServiceInstanceRequest request) { return new CreateServiceInstanceResponse(); } @Override pub...
public UpdateServiceInstanceResponse updateServiceInstance(UpdateServiceInstanceRequest request) {
7
ervinsae/EZCode
app/src/main/java/com/ervin/litepal/ui/fragment/MeizhiFragment.java
[ "public class GetGankApi {\n\n public static Observable<MeizhiEntity> getMeizhiData(int page){\n return RestClient.RestRxClient(RequestConstants.GANK_URL,true).getMeizhiData(page);\n }\n\n public static Observable<VideoEntity> getVideoData(int page){\n return RestClient.RestRxClient(RequestCo...
import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.Fragment; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutManager; import andro...
package com.ervin.litepal.ui.fragment; /** * Created by Ervin on 2016/3/24. */ public class MeizhiFragment extends Fragment { @Bind(R.id.rv_meizhi) RecyclerView mRecycleview; @Bind(R.id.main_fab) FloatingActionButton mFab; private MeizhiListAdapter adpter; private static List<Meizhis> ...
public MeizhiEntity mergeDesc(MeizhiEntity mezhi, VideoEntity video){
2
eshioji/trident-tutorial
src/main/java/tutorial/storm/trident/example/RealTimeTextSearch.java
[ "public class ElasticSearchStateFactory implements StateFactory {\n\n @Override\n public State makeState(Map map, IMetricsContext iMetricsContext, int partitionIndex, int numPartitions) {\n /**\n * Here, we're using a singleton because we're connecting to a local in-memory ES-cluster.\n ...
import backtype.storm.Config; import backtype.storm.LocalCluster; import backtype.storm.LocalDRPC; import backtype.storm.StormSubmitter; import backtype.storm.generated.StormTopology; import backtype.storm.spout.SchemeAsMultiScheme; import backtype.storm.tuple.Fields; import com.google.common.base.Preconditions; import...
package tutorial.storm.trident.example; /** * This topology shows how to index on a search engine (ElasticSearch) a stream made of * tweets and how to query it, using DRPC calls. This example should be intended as * an example of {@link TridentState} custom implementation. * * @author Davide Palmisano (davide.palmis...
.each(new Fields("tweetId", "text"), new Print())
4
SilentChaos512/ScalingHealth
src/main/java/net/silentchaos512/scalinghealth/utils/SHDifficulty.java
[ "public class DifficultyAffectedCapability implements IDifficultyAffected, ICapabilitySerializable<CompoundNBT> {\n @CapabilityInject(IDifficultyAffected.class)\n public static Capability<IDifficultyAffected> INSTANCE = null;\n public static ResourceLocation NAME = ScalingHealth.getId(\"difficulty_affected...
import net.minecraft.entity.Entity; import net.minecraft.entity.MobEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.Tuple; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3i; import net.minecraft.world.IWorld; import...
package net.silentchaos512.scalinghealth.utils; public final class SHDifficulty { private SHDifficulty() {throw new IllegalAccessError("Utility class");} public static IDifficultyAffected affected(ICapabilityProvider entity) { return entity.getCapability(DifficultyAffectedCapability.INSTANCE) ...
public static IDifficultySource source(ICapabilityProvider source) {
3
beerbong/com_beerbong_zipinst
src/com/beerbong/zipinst/cloud/CloudStorage.java
[ "public interface Core extends Serializable {\n\n public static final String PLUGIN_UI = \"UIPlugin\";\n public static final String PLUGIN_SUPERUSER = \"SuperUserPlugin\";\n public static final String PLUGIN_RECOVERY = \"RecoveryPlugin\";\n public static final String PLUGIN_STORAGE = \"StoragePlugin\";\...
import com.beerbong.zipinst.R; import com.beerbong.zipinst.core.Core; import com.beerbong.zipinst.core.plugins.recovery.RecoveryPlugin; import com.beerbong.zipinst.core.plugins.superuser.SuperUserPlugin; import com.beerbong.zipinst.io.Zip; import com.beerbong.zipinst.io.Zip.ZipCallback; import com.beerbong.zipinst.ui.w...
final File file = new File(rPlugin.getBackupDir(true), entry.getName()); Resources res = mCore.getContext().getResources(); mDownloadDialog = new ProgressDialog(mCore.getContext()); mDownloadDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); mDownloadDialog.setMessage(re...
SuperUserPlugin sPlugin = (SuperUserPlugin) getCore().getPlugin(
2
ojacquemart/vlilleChecker
app/src/com/vlille/checker/ui/SettingsFragment.java
[ "@ReportsCrashes(\n formUri = Constants.TRACEPOT_REPORT_URl,\n mode = ReportingInteractionMode.TOAST,\n forceCloseDialogAfterToast = false,\n resToastText = R.string.crash_toast_text\n)\npublic class Application extends AbstractApplication {\n\n private static Context context;\n pr...
import android.app.AlertDialog; import android.content.DialogInterface; import android.content.SharedPreferences; import android.os.Bundle; import android.support.v7.preference.Preference; import android.support.v7.preference.PreferenceFragmentCompat; import android.util.Log; import android.view.LayoutInflater; import ...
package com.vlille.checker.ui; public class SettingsFragment extends PreferenceFragmentCompat implements OnSeekBarChangeListener { private static final String TAG = SettingsFragment.class.getSimpleName(); private LocationManagerWrapper locationManagerWrapper; private boolean hasClickedOnLoca...
protected StationEntityManager stationEntityManager;
2
alexandre-normand/blood-shepherd
dexcom-receiver/src/main/java/org/glukit/dexcom/sync/DexcomWatcher.java
[ "public class FetchNewDataRunner {\n private static Logger LOGGER = LoggerFactory.getLogger(FetchNewDataRunner.class);\n private final DataOutputFactory dataOutputFactory;\n private final DataInputFactory dataInputFactory;\n private final ResponseReader responseReader;\n\n @Inject\n public FetchNewDataRunner(...
import org.glukit.sync.api.ReceiverSyncData; import org.glukit.sync.api.SyncData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.threeten.bp.Instant; import javax.usb.UsbDevice; import javax.usb.UsbDeviceDescriptor; import javax.usb.event.UsbServicesEvent; import javax.usb.event.UsbServicesListener...
/* * The MIT License (MIT) * * Copyright (c) 2013 Alexandre Normand * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to *...
SyncData syncData = this.adapterService.convertData(receiverSyncData);
5
andresth/Kandroid
app/src/main/java/in/andres/kandroid/DashProjectsAdapter.java
[ "@SuppressWarnings(\"unused\")\npublic class KanboardColor implements Serializable {\n private String Id;\n private String Name;\n private Integer Background;\n private Integer Border;\n\n public KanboardColor(String id, JSONObject color) {\n Id = id;\n Name = color.optString(\"name\");...
import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.text.TextUtils; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseExpa...
/* * Copyright 2017 Thomas Andres * * This file is part of Kandroid. * * Kandroid is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
private Dictionary<String, KanboardColor> mColors;
0
ReplayMod/jGui
src/main/java/de/johni0702/minecraft/gui/popup/AbstractGuiPopup.java
[ "public interface GuiRenderer {\n\n ReadablePoint getOpenGlOffset();\n\n MatrixStack getMatrixStack();\n\n ReadableDimension getSize();\n\n void setDrawingArea(int x, int y, int width, int height);\n\n void bindTexture(Identifier location);\n\n void bindTexture(int glId);\n\n void drawTexturedR...
import de.johni0702.minecraft.gui.layout.CustomLayout; import de.johni0702.minecraft.gui.layout.Layout; import de.johni0702.minecraft.gui.utils.lwjgl.Dimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import java.util.function.Function; import de.johni0702.minecraft.gui.GuiRenderer; import de.j...
/* * This file is part of jGui API, licensed under the MIT License (MIT). * * Copyright (c) 2016 johni0702 <https://github.com/johni0702> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softw...
if (container instanceof AbstractGuiOverlay) {
3
alexvasilkov/Events
sample/src/main/java/com/alexvasilkov/events/sample/ui/activity/RepoListActivity.java
[ "public enum EventStatus {\n\n STARTED, FINISHED\n\n}", "public class Events {\n\n private static final Dispatcher dispatcher = new Dispatcher();\n\n private Events() {\n // No instances\n }\n\n /**\n * Initializes event bus.\n *\n * @deprecated This method does nothing, do not u...
import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.Snackbar; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.Rec...
package com.alexvasilkov.events.sample.ui.activity; public class RepoListActivity extends BaseActivity { private ViewHolder views; private RepoListAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.l...
views.list.addItemDecoration(new DividerItemDecoration(this, R.dimen.repo_divider_padding));
6
syvaidya/openstego
src/test/java/com/openstego/desktop/plugin/randlsb/RandomLSBOutputStreamTest.java
[ "public class OpenStegoException extends Exception {\n private static final long serialVersionUID = 668241029491685413L;\n\n /**\n * Error Code - Unhandled exception\n */\n static final int UNHANDLED_EXCEPTION = 0;\n\n /**\n * Map to store error code to message key mapping\n */\n priv...
import com.openstego.desktop.OpenStegoException; import com.openstego.desktop.plugin.lsb.LSBConfig; import com.openstego.desktop.plugin.lsb.LSBDataHeader; import com.openstego.desktop.plugin.lsb.LSBErrors; import com.openstego.desktop.plugin.lsb.LSBPlugin; import com.openstego.desktop.util.ImageHolder; import org.junit...
/* * Steganography utility to hide messages into cover files * Author: Samir Vaidya (mailto:syvaidya@gmail.com) * Copyright (c) Samir Vaidya */ package com.openstego.desktop.plugin.randlsb; /** * Unit test class for {@link com.openstego.desktop.plugin.randlsb.RandomLSBOutputStream} */ public class RandomLSBO...
} catch (OpenStegoException e) {
0
yammer/tenacity
tenacity-core/src/test/java/com/yammer/tenacity/tests/TenacityPropertiesTest.java
[ "public abstract class TenacityCommand<R> extends HystrixCommand<R> {\n protected TenacityCommand(TenacityPropertyKey tenacityPropertyKey) {\n this(tenacityPropertyKey, tenacityPropertyKey);\n }\n\n protected TenacityCommand(TenacityPropertyKey commandKey,\n TenacityProp...
import com.google.common.collect.ImmutableCollection; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.netflix.config.ConfigurationManager; import com.netflix.hystrix.HystrixCommandMetrics; import com.netflix.hystrix.HystrixCommandProperties; import com.netflix.h...
package com.yammer.tenacity.tests; public class TenacityPropertiesTest { @Rule public final TenacityTestRule tenacityTestRule = new TenacityTestRule(); @Test public void executeCorrectly() throws Exception { assertThat(new TenacitySuccessCommand().execute()).isEqualTo("value"); asse...
assertEquals(TenacityPropertyStore.getTenacityConfiguration(DependencyKey.OVERRIDE), overrideConfiguration);
4
rprobinson/MediPi
Android/app/src/main/java/uk/gov/nhs/digital/telehealth/fragments/BloodPressureFragment.java
[ "public class HomeScreenActivity extends AppCompatActivity implements NavigationDrawerFragment.NavigationDrawerCallbacks, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {\n\n private NavigationDrawerFragment navigationDrawerFragment;\n private CharSequence fr...
import android.app.PendingIntent; import android.bluetooth.BluetoothAdapter; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.hardware.usb.UsbDevice; import android.hardware.usb.UsbDeviceConnection; import androi...
package uk.gov.nhs.digital.telehealth.fragments; public class BloodPressureFragment extends Fragment { private HomeScreenActivity activity; private TextView deviceInfo; private TextView valueSYS; private TextView valueDIA; private TextView valueHeartRate; private TextView valueCurrentLocati...
usbService = new BM55USBService();
4
tticoin/JointER
src/jp/tti_coin/main/java/data/nlp/relation/SimpleRelationFeatureCache.java
[ "public class NICTNounSynonymsDB extends SynonymsDB {\n\tprotected NavigableSet<Tuple2<String, Tuple2<String,Double>>> nounSynonymsDB;\n\n\tpublic NICTNounSynonymsDB(String filename) {\n\t\tsuper(filename);\n\t\tnounSynonymsDB = db.getTreeSet(\"SW\");\n\t}\n\t\n\t@Override\n\tpublic Map<String, Float> getDirectSyno...
import java.util.List; import java.util.Map.Entry; import java.util.Set; import java.util.TreeMap; import java.util.Vector; import utils.NICTNounSynonymsDB; import utils.SynonymsDB; import config.Parameters; import data.nlp.Dijkstra; import data.nlp.Node; import model.FeatureCache; import model.SparseFeatureVector; imp...
package data.nlp.relation; public class SimpleRelationFeatureCache extends FeatureCache { private static SynonymsDB synonymsDB; private final int NGRAM_SIZE = 3; public SimpleRelationFeatureCache(Parameters params, Node node) { super(params, node); if(params.getNictSynonymFile() != null && synonymsDB == n...
synonymsDB = new NICTNounSynonymsDB(params.getNictSynonymFile());
0
BoD/irondad
src/main/java/org/jraf/irondad/handler/pixgame/PixGameHandler.java
[ "public class Config {\n\n public static final boolean LOGD = true;\n\n}", "public class Constants {\n public static final String TAG = \"irondad/\";\n\n public static final String PROJECT_FULL_NAME = \"BoD irondad\";\n public static final String PROJECT_URL = \"https://github.com/BoD/irondad\";\n ...
import java.io.IOException; import java.io.RandomAccessFile; import java.util.List; import java.util.Locale; import org.apache.commons.lang3.StringUtils; import org.jraf.irondad.Config; import org.jraf.irondad.Constants; import org.jraf.irondad.handler.CommandHandler; import org.jraf.irondad.handler.HandlerContext; imp...
/* * This source is part of the * _____ ___ ____ * __ / / _ \/ _ | / __/___ _______ _ * / // / , _/ __ |/ _/_/ _ \/ __/ _ `/ * \___/_/|_/_/ |_/_/ (_)___/_/ \_, / * /___/ * repository. * * Copyright (C) 2013 Benoit 'BoD' Lubek (BoD@JRAF.org) * * This library is free sof...
Log.w(TAG, "newGame Could not query Google", e);
7
davidbecker/taloonerrl
core/src/main/java/de/brainstormsoftworks/taloonerrl/system/MapOverlayPreparerSystem.java
[ "public class CollectibleComponent extends PooledComponent {\n\n\t@Override\n\tprotected void reset() {\n\t\t// TODO Auto-generated method stub\n\n\t}\n\n}", "@Getter\npublic class HealthComponent extends PooledComponent implements ISetAbleComponent<HealthComponent> {\n\t@Setter\n\t/** unprocessed \"queued up\" d...
import com.artemis.Aspect; import com.artemis.systems.IteratingSystem; import de.brainstormsoftworks.taloonerrl.components.CollectibleComponent; import de.brainstormsoftworks.taloonerrl.components.HealthComponent; import de.brainstormsoftworks.taloonerrl.components.PositionComponent; import de.brainstormsoftworks.taloo...
/******************************************************************************* * Copyright (c) 2015-2018 David Becker. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v2.0 * which accompanies this distribution, and is available at ...
if (!Renderer.getInstance().isFullMapVisible()) {
7
HotBitmapGG/LeisureRead
app/src/main/java/com/hotbitmapgg/leisureread/ui/fragment/ShortCommentFragment.java
[ "public class AppConstant {\n\n public static final float SCALE_END = 1.13F;\n\n public static final int ANIMATION_DURATION = 2000;\n\n public static final String EXTRA_ID = \"extra_id\";\n\n public static final String EXTRA_NAME = \"extra_name\";\n\n public static final String EXTRA_TYPE = \"extra_type\";\n\n...
import butterknife.Bind; import com.hotbitmapgg.leisureread.app.AppConstant; import com.hotbitmapgg.leisureread.mvp.model.entity.DailyCommentInfo; import com.hotbitmapgg.leisureread.network.RetrofitHelper; import com.hotbitmapgg.leisureread.rx.Rxutils; import com.hotbitmapgg.leisureread.ui.adapter.CommentAdapter; impor...
package com.hotbitmapgg.leisureread.ui.fragment; /** * Created by hcc on 2016/12/28 13:35 * 100332338@qq.com * LeisureRead * * @HotBitmapGG 短评论界面 */ public class ShortCommentFragment extends BaseFragment { @Bind(R.id.recycler_view) RecyclerView mRecyclerView; private int id; private CommentAdapter m...
mBundle.putInt(AppConstant.EXTRA_SHORT_COMMENT_ID, id);
0
Zhuinden/simple-stack
samples/basic-samples/simple-stack-example-basic-java-fragment/src/main/java/com/zhuinden/navigationexamplefrag/application/MainActivity.java
[ "@AutoValue\npublic abstract class DashboardKey extends DefaultFragmentKey {\n public static DashboardKey create() {\n return new AutoValue_DashboardKey();\n }\n\n @Override\n protected Fragment instantiateFragment() {\n return new DashboardFragment();\n }\n}", "@AutoValue\npublic abs...
import android.os.Bundle; import com.zhuinden.navigationexamplefrag.R; import com.zhuinden.navigationexamplefrag.databinding.ActivityMainBinding; import com.zhuinden.navigationexamplefrag.screens.DashboardKey; import com.zhuinden.navigationexamplefrag.screens.HomeKey; import com.zhuinden.navigationexamplefrag.screens.N...
package com.zhuinden.navigationexamplefrag.application; public class MainActivity extends AppCompatActivity implements SimpleStateChanger.NavigationHandler { private static final String TAG = "MainActivity"; DefaultFragmentStateChanger fragmentStateChanger; private ActivityMainBinding ...
Backstack backstack = Navigator.getBackstack(this);
7
BracketCove/Profiler
app/src/test/java/com/wiseass/profiler/PhotoGalleryPresenterTest.java
[ "public class Photo {\n private String photoUri;\n\n public Photo(String photoUri) {\n this.photoUri = photoUri;\n }\n\n public String getPhotoUri() {\n return photoUri;\n }\n\n public void setPhotoUri(String photoUri) {\n this.photoUri = photoUri;\n }\n}", "public class P...
import android.content.ContentResolver; import com.wiseass.profiler.data.photos.Photo; import com.wiseass.profiler.data.photos.PhotoInjection; import com.wiseass.profiler.data.photos.PhotoSource; import com.wiseass.profiler.data.scheduler.SchedulerInjection; import com.wiseass.profiler.photogallery.PhotoGalleryContract...
package com.wiseass.profiler; /** * Responsible for Displaying a gallery of the user's device's images. When an Image is selected, * it forwards that image's URL to PhotoDetailActivity * Created by Ryan on 13/01/2017. */ @RunWith(MockitoJUnitRunner.class) public class PhotoGalleryPresenterTest { @Mock ...
private PhotoSource photoSource;
2
mmonkey/Destinations
src/main/java/com/github/mmonkey/destinations/commands/ListHomesCommand.java
[ "@Entity\n@DynamicUpdate\n@Table(name = \"homes\", uniqueConstraints = {\n @UniqueConstraint(columnNames = \"home_id\")\n})\npublic class HomeEntity implements Serializable {\n\n private static final long serialVersionUID = -3949473855412057897L;\n\n @Id\n @Column(name = \"home_id\", unique = true, ...
import com.github.mmonkey.destinations.entities.HomeEntity; import com.github.mmonkey.destinations.entities.PlayerEntity; import com.github.mmonkey.destinations.persistence.cache.PlayerCache; import com.github.mmonkey.destinations.utilities.FormatUtil; import com.github.mmonkey.destinations.utilities.MessagesUtil; impo...
package com.github.mmonkey.destinations.commands; public class ListHomesCommand implements CommandExecutor { public static final String[] ALIASES = {"homes", "listhomes"}; /** * Get the Command Specifications for this command * * @return CommandSpec */ public static CommandSpec getC...
.color(FormatUtil.GENERIC_LINK)
3
ajonkisz/TraVis
src/travis/view/AttacherPanel.java
[ "public class UIHelper {\n\n private static final UIHelper INSTANCE = new UIHelper();\n\n public enum MessageType {\n INFORMATION, WARNING, ERROR\n }\n\n public enum Mode {\n ATTACH, PLAYBACK\n }\n\n private Mode mode;\n\n private final JFileChooser fc;\n private volatile File ...
import travis.controller.UIHelper; import travis.model.attach.Attacher; import travis.model.attach.AttacherFactory; import travis.model.attach.JavaProcess; import travis.model.project.structure.StructComponent; import travis.util.Messages; import travis.view.project.tree.NewProcessPane; import java.awt.event.ActionEven...
/* * AttacherPanel.java * * Copyright (C) 2011-2012, Artur Jonkisz, <travis.source@gmail.com> * * This file is part of TraVis. * See https://github.com/ajonkisz/TraVis for more info. * * TraVis is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as pub...
UIHelper.getInstance().askToKillAllIfConnected();
0
quaap/LaunchTime
app/src/main/java/com/quaap/launchtime/ShortcutReceiver.java
[ "public class AppLauncher implements Comparable<AppLauncher> {\n\n\n private static final Map<ComponentName,AppLauncher> mAppLaunchers = Collections.synchronizedMap(new HashMap<ComponentName,AppLauncher>());\n private static final String LINK_SEP = \":IS_APP_LINK:\";\n public static final String ACTION_PAC...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.os.Bundle; import android.util.Log; import com.quaap.launchtime.apps.AppLauncher; import com.quaap.launchtime.components.Categories; import com.quaap.launchtime.compone...
package com.quaap.launchtime; /** * Copyright (C) 2017 Tom Kliethermes * * This file is part of LaunchTime and is 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 (...
if (GlobState.enableCrashReporter && !BuildConfig.DEBUG) Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(context));
2
chedim/minedriod
src/main/java/com/onkiup/minedroid/holders/StringHolder.java
[ "public interface Context {\n /**\n * @return Context id\n */\n int contextId();\n\n}", "public final class R {\n\tfinal static String MODID = \"minedroid\";\n\tpublic final static class id {\n\t\tpublic final static int message = 268435456;\n\t\tpublic final static int hint = 268435457;\n\t\tpublic...
import com.onkiup.minedroid.Context; import com.onkiup.minedroid.R; import com.onkiup.minedroid.gui.views.ListView; import com.onkiup.minedroid.gui.views.TextView; import com.onkiup.minedroid.gui.views.View; import net.minecraft.util.ResourceLocation;
package com.onkiup.minedroid.holders; public class StringHolder extends ListView.Holder<String> { private TextView text;
public StringHolder(Context context) {
0
scauwe/Generic-File-Driver-for-IDM
shim/src/main/java/info/vancauwenberge/filedriver/filewriter/CSVFileWriter.java
[ "public abstract class AbstractStrategy implements IStrategy{\n\n\tpublic interface IStrategyParameters{\n\t\tpublic String getParameterName();\n\t\tpublic String getDefaultValue();\n\t\tpublic DataType getDataType();\n\t\tpublic Constraint[] getConstraints();\n\t}\n\t\n\tpublic static String getStringValueFor(ISt...
import com.novell.nds.dirxml.driver.xds.XDSParameterException; import info.vancauwenberge.filedriver.api.AbstractStrategy; import info.vancauwenberge.filedriver.api.IDriver; import info.vancauwenberge.filedriver.api.IFileWriteStrategy; import info.vancauwenberge.filedriver.exception.WriteException; import info.vancauwe...
/******************************************************************************* * Copyright (c) 2007, 2018 Stefaan Van Cauwenberge * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0 (the "License"). If a copy of the MPL was not distributed with this * file, You can obtain on...
trace.trace("Initialization.", TraceLevel.TRACE);
5
suzp1984/jbig-android
mvc-sample/src/main/java/io/github/suzp1984/jbigandroid/injector/component/ApplicationComponent.java
[ "public abstract class BaseDrawerActivity extends AppCompatActivity {\n\n DrawerLayout mDrawerLayout;\n\n NavigationView mNavigationView;\n\n @Inject\n MainController mMainController;\n private IDisplay mAndroidDisplay;\n\n @Override\n public void setContentView(int layoutId) {\n super.s...
import android.app.Application; import javax.inject.Singleton; import dagger.Component; import dagger.Provides; import io.github.suzp1984.jbigandroid.BaseDrawerActivity; import io.github.suzp1984.jbigandroid.controller.MainController; import io.github.suzp1984.jbigandroid.fragment.DecoderFragment; import io.github.suzp...
package io.github.suzp1984.jbigandroid.injector.component; /** * Created by jacobsu on 4/24/16. */ @Singleton @Component(modules = {ApplicationModule.class, UtilsModule.class, StateModule.class, PersistenceModule.class}) public interface Appl...
void inject(BaseDrawerActivity activity);
0
tassioauad/GameCheck
app/src/androidTest/java/com/tassioauad/gamecheck/model/api/asynctask/impl/PlatformSearchByNameAsyncTaskTest.java
[ "public class PlatformBuilder {\n\n public static final Long DEFAULT_ID = 94l;\n\n public static final Long WRONG_ID = 999999999999999L;\n\n public static final String DEFAULT_NAME = \"Commodore\";\n\n public static final String WRONG_NAME = \"hooyah\";\n\n private Long id;\n\n private String name...
import android.test.AndroidTestCase; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.tassioauad.gamecheck.R; import com.tassioauad.gamecheck.entity.PlatformBuilder; import com.tassioauad.gamecheck.model.api.ItemTypeAdapterFactory; import com.tassioauad.gamecheck.model.api.asynctask.ApiResult...
package com.tassioauad.gamecheck.model.api.asynctask.impl; public class PlatformSearchByNameAsyncTaskTest extends AndroidTestCase { PlatformResource platformResource; @Override protected void setUp() throws Exception { super.setUp(); Gson gson = new GsonBuilder()
.registerTypeAdapterFactory(new ItemTypeAdapterFactory())
1
a-schild/nextcloud-java-api
src/main/java/org/aarboard/nextcloud/api/filesharing/FilesharingConnector.java
[ "public class ServerConfig {\r\n \r\n private AuthenticationConfig authenticationConfig;\r\n private String serverName;\r\n private String subPathPrefix;\r\n private boolean useHTTPS;\r\n private int port;\r\n private boolean trustAllCertificates;\r\n\r\n /**\r\n * Use this constructor i...
import org.apache.http.message.BasicNameValuePair; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; import org.aarboard.nextcloud.api.ServerConfig; import org.aarboard.nextcl...
/* * Copyright (C) 2017 a.schild * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is d...
throw new MoreThanOneShareFoundException(shareId);
1
darrenfoong/candc
src/training/PrintForest.java
[ "public class FilledDependency implements Comparable<FilledDependency> {\n\tprotected final short relID;\n\tprotected final short headIndex; // position of the \"head\" word in the sentence\n\tprotected final short fillerIndex; // position of the filler word in the sentence\n\tprotected final short unaryRuleID; // ...
import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashSet; import cat_combination.FilledDependency; import cat_combination.SuperCategory; import chart_parser.Cell; import chart_parser.Chart; import io.Sentence; import lexicon.Categories; ...
package training; public class PrintForest { ArrayList<Integer> featureIDs; // used to collect features before printing Features features; // the complete feature set HashSet<FilledDependency> goldDeps; Category rootCat; public PrintForest(Features features) { featureIDs = new ArrayList<Integer>(); this.f...
public boolean print(PrintWriter out, Chart chart, Sentence sentence) {
3
Spedge/hangar
hangar-api/src/test/java/com/spedge/hangar/testutils/IndexUtils.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 com.spedge.hangar.index.IndexArtifact; import com.spedge.hangar.index.IndexKey; import com.spedge.hangar.repo.RepositoryType; import com.spedge.hangar.repo.java.JavaIndexArtifact; import com.spedge.hangar.repo.java.base.JavaGroup; import com.spedge.hangar.repo.java.index.JavaIndexKey;
package com.spedge.hangar.testutils; public enum IndexUtils { TEST1(new JavaIndexKey(RepositoryType.RELEASE_JAVA, JavaGroup.dotDelimited("com.spedge.test"), "test-artifact", "0.1.2.3"), generateArtifact("/this/is/a/location/")), TEST2(new JavaIndexKey(RepositoryType.RELEASE_JAVA, JavaGroup.dotDelimited("com.s...
IndexArtifact ia = new JavaIndexArtifact(location);
3
jimmc/HapiPodcastJ
src/info/xuluan/podcast/BackupChannelsActivity.java
[ "public class FeedParser {\r\n\r\n\tstatic final FeedParser instance = new FeedParser();\r\n\r\n\tpublic static FeedParser getDefault() {\r\n\t\treturn instance;\r\n\t}\r\n\r\n\tSAXParserFactory saxParserFactory = SAXParserFactory.newInstance();\r\n\r\n\tpublic FeedParser() {\r\n\r\n\t}\r\n\r\n\tpublic void parse(I...
import info.xuluan.podcast.parser.FeedParser; import info.xuluan.podcast.parser.OPMLParserHandler; import info.xuluan.podcast.provider.FeedItem; import info.xuluan.podcast.provider.Subscription; import info.xuluan.podcast.provider.SubscriptionColumns; import info.xuluan.podcast.utils.FileUtils; import info.xuluan.podca...
boolean exists = (file.exists()); if (exists==false) { file.mkdirs(); } return true; } abstract class ImportSelectedFile { abstract String fileType(); abstract String getDirectory(); abstract void readSelectedFile(File selectedFile); abstract FileFilter fileFilter(); } private void impo...
Cursor cursor = managedQuery(SubscriptionColumns.URI, SubscriptionColumns.ALL_COLUMNS,
4
TEAMModding/KalStuff
src/main/java/com/team/kalstuff/KalStuffGuiHandler.java
[ "public class ContainerChickenNest extends Container\n{\n\tprivate TileEntityChickenNest tileEntityChickenNest;\n\t\n\t// each time we add a Slot to the container, it automatically increases the slotIndex, which means\n\t// 0 - 8 = hotbar slots (which will map to the InventoryPlayer slot numbers 0 - 8)\n\t// 9 - 35...
import com.team.kalstuff.container.ContainerChickenNest; import com.team.kalstuff.container.ContainerTrashCan; import com.team.kalstuff.gui.GuiChickenNest; import com.team.kalstuff.gui.GuiTrashCan; import com.team.kalstuff.tileentity.TileEntityChickenNest; import net.minecraft.entity.player.EntityPlayer; import net.min...
package com.team.kalstuff; /** * This is the new gui registry everyone should use. To add a new Gui simply add * a new case statement with it's own number (your gui id). If your gui is on * both client and server you will need to add it in both methods. * * @author Joseph * */ public class KalStuffGuiHandler...
return new ContainerTrashCan(player.inventory);
1
openthread/ot-registrar
src/main/java/com/google/openthread/registrar/Registrar.java
[ "public class BouncyCastleInitializer {\n\n public static void init() {\n Security.addProvider(new BouncyCastleProvider());\n X500Name.setDefaultStyle(RFC4519Style.INSTANCE);\n }\n}", "public class Constants {\n\n // BRSKI - EST\n public static final String WELL_KNOWN = \".well-known\";\n\n public stat...
import COSE.CoseException; import COSE.Message; import COSE.MessageTag; import COSE.OneKey; import COSE.Sign1Message; import com.google.openthread.BouncyCastleInitializer; import com.google.openthread.Constants; import com.google.openthread.ExtendedMediaTypeRegistry; import com.google.openthread.RequestDumper; import c...
} logger.info("received voucher status report: " + voucherStatus.toString()); } catch (Exception e) { logger.warn("handle voucher status report failed: " + e.getMessage()); e.printStackTrace(); } finally { exchange.respond(ResponseCode.CHANGED); } } } ...
req.serialNumber = Pledge.getSerialNumber(idevid);
8
lheido/LheidoSMS
app/src/main/java/com/lheidosms/fragment/SMSFragment.java
[ "public class ConversationAdapter extends BaseAdapter {\n private final String mPhoneContact;\n /**\n * Récupérer un item de la liste en fonction de sa position\n * @param position - Position de l'item à récupérer\n * @return l'item récupéré\n */\n public LheidoUtils.UserPref userPref;\n ...
import android.app.Activity; import android.content.BroadcastReceiver; import android.content.ClipData; import android.content.Context; import android.content.IntentFilter; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import andr...
/** * Returns a new instance of this fragment for the given section * number. */ public static SMSFragment newInstance(int position, LheidoContact contact) { SMSFragment fragment = new SMSFragment(); Bundle args = new Bundle(); args.putInt(ARG_CONVERSATION_NUMBER, positio...
mBroadCast = new SmsReceiver(){
2
TheTemportalist/CountryGamer_PlantsVsZombies
java/com/countrygamer/pvz/items/ItemBasicPlants.java
[ "@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)\npublic class PvZ implements IFuelHandler, IGuiHandler {\n\t\n\tpublic static final Logger log = Logger.getLogger(Reference.MOD_ID);\n\t@Mod.Instance(Reference.MOD_ID)\n\tpublic static PvZ instance = new PvZ();\n\t@SidedProxy(cl...
import net.minecraft.block.Block; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import com.countrygamer.core.Base.common.item.ItemMetadataBase; import com.countrygamer.pv...
package com.countrygamer.pvz.items; public class ItemBasicPlants extends ItemMetadataBase { public static final String[] itemGameNames = { "Sunflower", "Pea Shooter", "Snow Pea", "Repeater", "Three-Peater" }; public boolean onGround = true; public ItemBasicPlants(String modid) { super(modid, itemGameNam...
Util.removeItem(player, thisItem);
6
idega/is.idega.idegaweb.egov.course
src/java/is/idega/idegaweb/egov/course/presentation/CourseEditor.java
[ "public class CourseConstants {\n\n\tpublic static final String CASE_CODE_KEY = \"COURSEA\";\n\n\tpublic static final String IW_BUNDLE_IDENTIFIER = \"is.idega.idegaweb.egov.course\";\n\n\tpublic static final String ADMINISTRATOR_ROLE_KEY = \"afterSchoolCareAdministrator\";\n\tpublic static final String SUPER_ADMINI...
import is.idega.idegaweb.egov.course.CourseConstants; import is.idega.idegaweb.egov.course.business.CourseBusiness; import is.idega.idegaweb.egov.course.business.CourseSession; import is.idega.idegaweb.egov.course.data.Course; import is.idega.idegaweb.egov.course.data.CourseCategory; import is.idega.idegaweb.egov.cours...
package is.idega.idegaweb.egov.course.presentation; public class CourseEditor extends CourseBlock { protected static final String PARAMETER_COURSE_PRICE_PK = "prm_course_price"; protected static final String PARAMETER_COURSE_NUMBER = "prm_course_number"; protected static final String PARAMETER_NAME = "prm_nam...
iwc.getIWMainApplication().getBundle(CourseConstants.IW_BUNDLE_IDENTIFIER).getVirtualPathWithFileNameString("javascript/egov_courses.js")
0
smartnsoft/droid4me
sample/src/main/java/com/smartnsoft/droid4sample/TitleBar.java
[ "public class ActivityController\n{\n\n /**\n * An interface which is requested when a new {@link Activity} is bound to be {@link Context#startActivity(Intent) started}.\n * <p>\n * <p>\n * The redirector acts as a controller over the activities starting phase: if an activity should be started before anoth...
import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import android.app.Activity; import android.content.Intent; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Handler; import android.util.AndroidRuntimeException; import android.view.View; import android.view.Wi...
} protected Map<ImageButton, TitleBarAttributes.ActionDetail> forgetActions() { final Map<ImageButton, TitleBarAttributes.ActionDetail> previousActions = new HashMap<ImageButton, TitleBarAttributes.ActionDetail>(actions); setShowAction1(-1, null); setShowAction2(-1, null); setShowAc...
protected static final Logger log = LoggerFactory.getInstance(TitleBar.class);
4
atam4j/atam4j
acceptance-tests/src/test/java/me/atam/atam4jsampleapp/PassingTestAcceptanceTest.java
[ "public class PollingPredicate<T> {\n\n private int maxAttempts;\n private int retryPollInterval;\n private Predicate<T> predicate;\n private Supplier<T> supplier;\n\n public PollingPredicate(int maxAttempts, int retryPollInterval, Predicate<T> predicate, Supplier<T> supplier) {\n this.maxAtte...
import me.atam.atam4j.PollingPredicate; import me.atam.atam4j.dummytests.PassingTestWithNoCategory; import me.atam.atam4j.dummytests.TestThatKnowsIfItsBeingRun; import me.atam.atam4jdomain.IndividualTestResult; import me.atam.atam4jdomain.TestsRunResult; import me.atam.atam4jsampleapp.testsupport.AcceptanceTest; import...
package me.atam.atam4jsampleapp; public class PassingTestAcceptanceTest extends AcceptanceTest { @Test public void givenPassingTest_whenTestsEndpointCalledBeforeTestRun_thenTooEarlyMessageReceived() { //given
dropwizardTestSupportAppConfig = Atam4jApplicationStarter
6
JosuaKrause/NBTEditor
src/nbt/world/Player.java
[ "public class GamePosition {\n\n /**\n * The dimension this position is in.\n */\n public final WorldDimension dim;\n\n /**\n * The x coordinate.\n */\n public final double x;\n\n /**\n * The y coordinate.\n */\n public final double y;\n\n /**\n * The z coordinate.\n */\n public final double...
import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import nbt.map.pos.GamePosition; import nbt.record.NBTCompound; import nbt.record.NBTHandler; import nbt.record.NBTList; import nbt.record.NBTNumeric; import nbt.world.World.GameType; import nbt.world.World.WorldDimension;
package nbt.world; /** * Represents a player nbt file or the player part in the level.dat file. * * @author Joschi <josua.krause@googlemail.com> */ public class Player extends NBTHandler { /** * The extension of player nbt files. */ public static final String PLAYER_EXT = ".dat"; /** * The fold...
private final NBTCompound playerRecord;
1
portablejim/VeinMiner
src/main/java/portablejim/veinminer/server/MinerServer.java
[ "public class ConfigurationSettings {\n\n private ConfigurationValues configValues;\n\n public ConfigurationSettings(ConfigurationValues configValues) {\n this.configValues = configValues;\n autoDetectBlocksToggle = new boolean[ToolType.values().length];\n //noinspection unchecked\n ...
import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import portablejim.veinminer.configuration.ConfigurationSettings; imp...
/* This file is part of VeinMiner. * * VeinMiner is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * Vein...
public MinerServer(ConfigurationValues configValues) {
1
mmonkey/Destinations
src/main/java/com/github/mmonkey/destinations/Destinations.java
[ "public class DestinationsConfig extends Config {\n\n public static final String DATABASE_SETTINGS = \"Database Settings\";\n public static final String COMMAND_SETTINGS = \"Command Settings\";\n\n private static DestinationsConfig instance;\n\n /**\n * DestinationsConfig constructor\n *\n *...
import com.github.mmonkey.destinations.commands.*; import com.github.mmonkey.destinations.configs.DestinationsConfig; import com.github.mmonkey.destinations.entities.*; import com.github.mmonkey.destinations.listeners.PlayerListeners; import com.github.mmonkey.destinations.listeners.TeleportListeners; import com.github...
package com.github.mmonkey.destinations; @Plugin(id = Destinations.ID, name = Destinations.NAME, version = Destinations.VERSION, description = Destinations.DESCRIPTION) public class Destinations { public static final String ID = "destinations"; public static final String NAME = "Destinations"; public st...
Sponge.getEventManager().registerListeners(this, new TeleportListeners());
2
ReplayMod/jGui
src/main/java/de/johni0702/minecraft/gui/element/AbstractGuiHorizontalScrollbar.java
[ "public interface GuiRenderer {\n\n ReadablePoint getOpenGlOffset();\n\n MatrixStack getMatrixStack();\n\n ReadableDimension getSize();\n\n void setDrawingArea(int x, int y, int width, int height);\n\n void bindTexture(Identifier location);\n\n void bindTexture(int glId);\n\n void drawTexturedR...
import de.johni0702.minecraft.gui.utils.Utils; import de.johni0702.minecraft.gui.utils.lwjgl.Dimension; import de.johni0702.minecraft.gui.utils.lwjgl.Point; import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint; import de.johni0702.minecraft.gui.Gui...
/* * This file is part of jGui API, licensed under the MIT License (MIT). * * Copyright (c) 2016 johni0702 <https://github.com/johni0702> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softw...
Utils.drawDynamicRect(new OffsetGuiRenderer(renderer, new Point(barOffset, BORDER_TOP), size),
1
maksim-m/Popular-Movies-App
app/src/main/java/me/maxdev/popularmoviesapp/ui/MainActivity.java
[ "public class PopularMoviesApp extends Application {\n\n private NetworkComponent networkComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n networkComponent = DaggerNetworkComponent.builder()\n .appModule(new AppModule(this))\n .networkModu...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.annotation.StringRes; import android.support.design.widget.CoordinatorLayout; import ...
ButterKnife.bind(this); ((PopularMoviesApp) getApplication()).getNetworkComponent().inject(this); if (savedInstanceState == null) { getSupportFragmentManager().beginTransaction() .replace(R.id.movies_grid_container, MoviesGridFragment.create()) ...
MovieDetailActivity.start(this, movie);
4
liuling07/QiQuYingServer
src/com/lling/qiqu/controllers/UploadController.java
[ "public class InitConfig {\n\tstatic Properties prop = new Properties();\n\tstatic {\n\t\ttry {\n\t\t\tInputStream in = InitConfig.class.getResourceAsStream(\"/init.properties\");\n\t\t\tprop.load(in);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n\n\tpublic static String get(String key) {...
import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.UUID; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.spr...
package com.lling.qiqu.controllers; /** * @ClassName: UploadController * @Description: 七牛上传控制器 * @author lling * @date 2015-5-31 */ @Controller @RequestMapping("/upload") public class UploadController { private Logger logger = Logger.getLogger(this.getClass()); /** * 获取七牛上传的token * @return */ @Res...
ajaxResponse.setResult(InitConfig.get("qiniu.bbkurl")+rskey);
0
tecsinapse/tecsinapse-data-io
src/main/java/br/com/tecsinapse/dataio/util/ExporterUtil.java
[ "public class Table {\n\n private ExporterFormatter exporterFormatter;\n\n private TableCellStyle tableCellStyleDefaultBody = Style.TABLE_CELL_STYLE_BODY_CENTER;\n\n private String title;\n private boolean autoSizeColumnSheet = true;\n @Getter @Setter\n private Integer minColumnWidth = 8 * 256;\n ...
import static br.com.tecsinapse.dataio.type.SeparatorType.SEMICOLON; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.file.Files; import java.nio.file.Path; import java.u...
/* * Tecsinapse Data Input and Output * * License: GNU Lesser General Public License (LGPL), version 3 or later * See the LICENSE file in the root directory or <http://www.gnu.org/licenses/lgpl-3.0.html>. */ package br.com.tecsinapse.dataio.util; @UtilityClass public final class ExporterUtil { public s...
throw new ExporterException("Invalid Table.");
1
exoplatform/task
services/src/main/java/org/exoplatform/task/rest/model/TaskEntity.java
[ "@Data\n@NoArgsConstructor\npublic class LabelDto implements Serializable {\n private long id;\n\n private String username;\n\n private String name;\n\n private String color;\n\n private boolean hidden;\n\n private boolean canEdit;\n\n private LabelDto parent;\n\n private ProjectD...
import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; import lombok.Data; import org.exoplatform.task.dto.LabelDto; import org.exoplatform.task.dto.StatusDto; import org.exoplatform.task.dto.TaskDto; import org.exoplatform.task.model.CommentModel; import org.exopl...
/** * Copyright (C) 2015 eXo Platform SAS. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation; either version 3 * of the License, or (at your option) any later version. * * This pro...
private User assignee;
4
thom-nic/openfire-jboss-clustering
src/main/java/com/enernoc/rnd/openfire/cluster/session/ClusteredSessionLocator.java
[ "public class ClientSessionTask extends RemoteSessionTask {\r\n private JID address;\r\n\r\n public ClientSessionTask() {\r\n super();\r\n }\r\n\r\n public ClientSessionTask(JID address, Operation operation) {\r\n super(operation);\r\n this.address = address;\r\n }\r\n\r\n pro...
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.session.ConnectionMultiplexerSession; import org.jivesoftware.openfire.session.IncomingServerSession; import org.jivesoftware.openfire.session.RemoteSessionLocator; import org.jivesoftware.util.cache.CacheFactory; import org.xmpp.packet.JID; ...
/** * 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 * dist...
new GetMultiplexerSessionTask( address ), nodeID);
4
dperezcabrera/jpoker
src/main/java/org/poker/engine/model/ModelContext.java
[ "@Immutable\npublic final class Card {\n\n private static final String STRING_RANK_CARDS = \"23456789TJQKA\";\n\n public enum Suit {\n\n SPADE('♠'), HEART('♥'), DIAMOND('♦'), CLUB('♣');\n \n private final char c;\n\n private Suit(char c) {\n this.c = c;\n }\n\n ...
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.poker.api.core.Card; import org.poker.api.core.Deck; import org.poker.api.game.BetCommand; import org.poker.api.game.GameInfo; import org.poker.api.game.Settings; import org.poker.api.game.TexasHoldEmUtil; impo...
/* * Copyright (C) 2016 David Pérez Cabrera <dperezcabrera@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later ve...
public ModelContext(Settings settings) {
4
achellies/AtlasForAndroid
src/android/taobao/atlas/runtime/DelegateResources.java
[ "public final class BundleImpl implements Bundle {\n static final Logger log;\n Archive archive;\n final File bundleDir;\n BundleClassLoader classloader;\n private final BundleContextImpl context;\n int currentStartlevel;\n ProtectionDomain domain;\n Hashtable<String, String> headers;\n f...
import android.app.Application; import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources.NotFoundException; import android.taobao.atlas.framework.BundleImpl; import android.taobao.atlas.framework.Framework; import andro...
package android.taobao.atlas.runtime; public class DelegateResources extends Resources { static final Logger log; private Map<String, Integer> resIdentifierMap; static { log = LoggerFactory.getInstance("DelegateResources"); } public DelegateResources(AssetManager assetManager, Resources ...
arrayList.add(((BundleImpl) bundle).getArchive().getArchiveFile().getAbsolutePath());
0
davidmoten/rtree
src/test/java/com/github/davidmoten/rtree/OnSubscribeSearchTest.java
[ "@VisibleForTesting\nstatic class SearchProducer<T, S extends Geometry> implements Producer {\n\n private final Subscriber<? super Entry<T, S>> subscriber;\n private final Node<T, S> node;\n private final Func1<? super Geometry, Boolean> condition;\n private volatile ImmutableStack<NodePosition<T, S>> s...
import java.util.Collections; import org.junit.Test; import org.mockito.Mockito; import com.github.davidmoten.rtree.OnSubscribeSearch.SearchProducer; import com.github.davidmoten.rtree.geometry.Geometries; import com.github.davidmoten.rtree.geometry.Geometry; import com.github.davidmoten.rtree.geometry.Point; import co...
package com.github.davidmoten.rtree; public class OnSubscribeSearchTest { @SuppressWarnings("unchecked") @Test public void testSearchProducerThrowsExceptionFromRequestAll() {
Node<Integer, Geometry> node = Mockito.mock(Node.class);
2
IHTSDO/snomed-utilities
src/main/java/org/ihtsdo/snomed/util/qa/PatternCollator.java
[ "public static void print(String msg) {\n\tSystem.out.println(msg);\n}", "public class SnomedUtilException extends Exception {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic SnomedUtilException(String msg, Throwable t) {\n\t\tsuper(msg, t);\n\t}\n\n\tpublic SnomedUtilException(String msg) {\n\t...
import java.io.File; import java.io.FileReader; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashSet; import java.util.Set; import static org.ihtsdo.util.GlobalUtils.print; import org.ihtsdo.snomed.util.SnomedUtilException; import org.ihtsdo.snomed.util.pojo.Con...
package org.ihtsdo.snomed.util.qa; public class PatternCollator { private File patternDir; private File outputDir; private static final String JSON = ".json"; private String outputFileName;
private String[] headers = new String[] {"PatternName","Concept","FSN (commas stripped)","hasChanged","isNew","Hierarchy1","Hierarchy2","Hierarchy3"};
2
cojen/Cojen
src/main/java/org/cojen/classfile/attribute/CodeAttr.java
[ "public abstract class Attribute {\n final static Attribute[] NO_ATTRIBUTES = new Attribute[0];\n\n public static final String CODE = \"Code\";\n public static final String CONSTANT_VALUE = \"ConstantValue\";\n public static final String DEPRECATED = \"Deprecated\";\n public static final String EXCEP...
import java.util.ArrayList; import java.util.List; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import org.cojen.classfile.Attribute; import org.cojen.classfile.AttributeFactory; import org.cojen.classfile.CodeBuffer; import org.cojen.classfile.ConstantPool; import org.cojen.classfil...
/* * Copyright 2004-2010 Brian S O'Neill * * 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 la...
public void setInitialStackMapFrame(MethodInfo method) {
7
ngageoint/geowave-osm
src/main/java/mil/nga/giat/osm/mapreduce/Convert/SimpleFeatureGenerator.java
[ "public class ColumnFamily {\n public static final byte[] NODE = \"n\".getBytes(Schema.CHARSET);\n public static final byte[] WAY = \"w\".getBytes(Schema.CHARSET);\n public static final byte[] RELATION = \"r\".getBytes(Schema.CHARSET);\n}", "public class ColumnQualifier {\n public static final byte[] ...
import java.io.IOException; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Value; import org.geotools.feature.s...
ColumnQualifier.TIMESTAMP)) { Timestamp = longReader.readField( item.getValue().get()); } else if (Schema.arraysEqual( CQ, ColumnQualifier.CHANGESET)) { Changeset = longReader.readField( item.getValue().get()); } else if (Schema.arraysEqual( CQ, Colu...
id).MemType = MemberType.NODE;
8
Tangyingqi/Jiemian
app/src/main/java/com/tyq/jiemian/ui/activity/SettingActivity.java
[ "public class ConfirmDialog extends DialogFragment {\n\n private String title;\n private String[] items = {\"确认\",\"取消\"};\n private DialogInterface.OnClickListener okOnClickListener;\n private DialogInterface.OnClickListener cancelOnClickListener;\n\n public void setParams(String title,DialogInterfa...
import android.databinding.DataBindingUtil; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.PersistableBundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.Toast; import com....
package com.tyq.jiemian.ui.activity; /** * Created by tyq on 2015/11/26. */ public class SettingActivity extends AppCompatActivity implements View.OnClickListener { private DialogHandler handler; private ActivitySettingBinding dataBinding; @Override protected void onCreate(@Nullable Bundle saved...
ConfirmDialog confirmDialog = new ConfirmDialog();
0
azinik/ADRMine
release/v1/java_src/ADRMine/src/main/java/edu/asu/diego/adrmine/evaluation/ADRMineEvaluation.java
[ "public enum TokenLabel {\n\tOUT(0),\n\tBADR(1),\n\tIADR(2),\n\tBIND(3),\n\tIIND(4),\n\tBBEN(5),\n\tIBEN(6);\n\tprivate static final Map<Integer,TokenLabel> lookup = \n\t\tnew HashMap<Integer,TokenLabel>();\n\t\t\n\tstatic {\n for(TokenLabel l : EnumSet.allOf(TokenLabel.class))\n lookup.put(l...
import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; import edu.asu.diego.adrmine.classification.TokenSequenceExampleBuilder.TokenLabel; import edu.asu.diego.adrmine.evaluation.CRFBasedExtractionUtils.TargetSemanticType; import preprocessutils.Stan...
package edu.asu.diego.adrmine.evaluation; public class ADRMineEvaluation { public static boolean tokenizeExpectedADRs = true; public static StanfordParser parser = new StanfordParser(); public static void main (String args[]) throws Exception { // "/home/azadeh/Documents/test_tweet_annotations.tsv" String...
List<MLExample> testExamples =
5
domoinc/domo-java-sdk
domo-java-sdk-all/src/main/java/com/domo/sdk/users/UserClient.java
[ "public class DomoClient {\n private final Config config;\n\n private final UserClient userClient;\n private final GroupClient groupClient;\n private final DataSetClient dataSetClient;\n private final PageClient pageClient;\n private final PDPClient pdpClient;\n private final StreamClient strea...
import com.domo.sdk.DomoClient; import com.domo.sdk.request.Transport; import com.domo.sdk.request.UrlBuilder; import com.domo.sdk.users.model.CreateUserRequest; import com.domo.sdk.users.model.User; import com.google.gson.reflect.TypeToken; import okhttp3.HttpUrl; import java.util.List;
package com.domo.sdk.users; /** * <p>Threadsafe client for performing User related requests. See <a href="https://developer.domo.com/docs/domo-apis/users"> * User API</a> docs for complete details. * </p> * <p><b>Use {@link DomoClient#userClient()} to get a reference to an instance of this client.</b></p> *...
private final Transport transport;
1
d-plaindoux/suitcase
src/main/java/org/smallibs/suitcase/cases/core/Case2.java
[ "public interface Case<T, R> {\n\n Optional<R> unapply(T t);\n\n interface WithoutCapture<T, R> extends Case<T, Result.WithoutCapture<R>> {\n static <T, R> WithoutCapture<T, R> adapt(Case<T, Result.WithoutCapture<R>> aCase) {\n return aCase::unapply;\n }\n }\n\n interface WithCa...
import org.smallibs.suitcase.cases.Case; import org.smallibs.suitcase.cases.Case.WithCapture; import org.smallibs.suitcase.cases.Case.WithoutCapture; import org.smallibs.suitcase.utils.Functions.Function2; import org.smallibs.suitcase.utils.Pair; import java.util.Optional; import java.util.function.Function; import sta...
/* * Copyright (C)2015 D. Plaindoux. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2, or (at your option) any * later version. * * This program is distributed i...
public <C1, C2> WithoutCapture<P, Pair<C1, C2>> $(WithoutCapture<E1, C1> aCase1, WithoutCapture<E2, C2> aCase2) {
2
jwoolston/Android-Webcam
library/src/main/java/com/jwoolston/android/uvc/WebcamConnection.java
[ "public class Descriptor {\n\n static final byte VIDEO_CLASS_CODE = ((byte) 0x0E);\n static final byte AUDIO_CLASS_CODE = ((byte) 0x01);\n\n private static final int INDEX_DESCRIPTOR_TYPE = 1;\n\n public static List<InterfaceAssociationDescriptor> parseDescriptors(UsbDeviceConnection connection,\n ...
import android.content.Context; import android.net.Uri; import android.support.annotation.NonNull; import com.jwoolston.android.libusb.DevicePermissionDenied; import com.jwoolston.android.libusb.UsbDeviceConnection; import com.jwoolston.android.libusb.UsbManager; import com.jwoolston.android.uvc.interfaces.Descriptor; ...
package com.jwoolston.android.uvc; /** * Helper class for abstracting communication to a camera. This implementation directly handles configuration, state, * and data transfer. The USB layer is constructed at instantiation and if possible, communication begins immediately. * * @author Jared Woolston (Jared.Woolst...
private List<InterfaceAssociationDescriptor> iads;
1
HubSpot/jackson-datatype-protobuf
src/test/java/com/hubspot/jackson/datatype/protobuf/AllFieldsTest.java
[ "public static ObjectMapper camelCase() {\n return DEFAULT;\n}", "public static ObjectMapper newUnderscore() {\n return NEW_UNDERSCORE;\n}", "public static ObjectMapper oldUnderscore() {\n return OLD_UNDERSCORE;\n}", "@SuppressWarnings(\"unchecked\")\npublic static <T extends MessageOrBuilder> T writeAndRe...
import static com.hubspot.jackson.datatype.protobuf.util.ObjectMapperHelper.camelCase; import static com.hubspot.jackson.datatype.protobuf.util.ObjectMapperHelper.newUnderscore; import static com.hubspot.jackson.datatype.protobuf.util.ObjectMapperHelper.oldUnderscore; import static com.hubspot.jackson.datatype.protobuf...
package com.hubspot.jackson.datatype.protobuf; public class AllFieldsTest { @Test public void testSingleMessageCamelCase() { AllFields message = ProtobufCreator.create(AllFields.class); AllFields parsed = writeAndReadBack(camelCase(), message); assertThat(parsed).isEqualTo(message); } @...
AllFields parsed = writeAndReadBack(ObjectMapperHelper.oldUnderscore(), message);
4
dvorka/shifts-solver
src/com/mindforger/shiftsolver/client/ui/dialogs/ChangeAssignmentDialog.java
[ "public class RiaContext implements ShiftSolverConstants {\n\n\t// RIA\n\tprivate Ria ria;\n\t\n\t// i18n and l10n\n\tprivate RiaMessages i18n;\n\t\n\t// server\n\tprivate ShiftSolverServiceAsync service;\n\t\n\t// solver\n\tprivate ShiftSolver solver;\n\t\n\t// validation\n\tprivate FieldVerifier fieldVerifier;\n\...
import java.util.ArrayList; import java.util.List; import java.util.Map; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.ui.Button; import com.google.gwt.user.client.ui.DialogBox; import com.google.gwt.user.client.ui.FlexTable; im...
package com.mindforger.shiftsolver.client.ui.dialogs; public class ChangeAssignmentDialog extends DialogBox { private RiaMessages i18n; private static final String EMPLOYEES_RADIO_GROUP="employees"; private List<RadioButton> radios;
private List<Employee> employees;
5
mapsforge/mapsforge
mapsforge-samples-awt/src/main/java/org/mapsforge/samples/awt/Samples.java
[ "public class BoundingBox implements Serializable {\n private static final long serialVersionUID = 1L;\n\n /**\n * Creates a new BoundingBox from a comma-separated string of coordinates in the order minLat, minLon, maxLat,\n * maxLon. All coordinate values must be in degrees.\n *\n * @param bo...
import org.mapsforge.core.graphics.GraphicFactory; import org.mapsforge.core.model.BoundingBox; import org.mapsforge.core.model.LatLong; import org.mapsforge.core.model.MapPosition; import org.mapsforge.core.model.Point; import org.mapsforge.core.util.LatLongUtils; import org.mapsforge.core.util.Parameters; import org....
/* * Copyright 2010, 2011, 2012, 2013 mapsforge.org * Copyright 2014 Christian Pesch * Copyright 2014 Ludwig M Brinckmann * Copyright 2014-2022 devemux86 * Copyright 2017 usrusr * * This program is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License...
MemoryCachingHgtReaderTileSource tileSource = new MemoryCachingHgtReaderTileSource(demFolder, new DiffuseLightShadingAlgorithm(), AwtGraphicFactory.INSTANCE);
5
blinkfox/zealot
src/main/java/com/blinkfox/zealot/helpers/XmlNodeHelper.java
[ "public class ZealotConfigManager {\n \n private static final Log log = Log.get(ZealotConfigManager.class);\n\n /** 初始化的单实例. */\n private static final ZealotConfigManager confManager = new ZealotConfigManager();\n\n /** zealot的XML文件所在的位置,多个用逗号隔开,可以是目录也可以是具体的xml文件. */\n private String xmlLocations;...
import com.blinkfox.zealot.config.ZealotConfigManager; import com.blinkfox.zealot.config.entity.XmlContext; import com.blinkfox.zealot.consts.ZealotConst; import com.blinkfox.zealot.exception.FieldEmptyException; import com.blinkfox.zealot.exception.XmlParseException; import com.blinkfox.zealot.log.Log; import java.io....
package com.blinkfox.zealot.helpers; /** * xml和xml节点相关的工具类. * @author blinkfox on 2016/10/30. */ public final class XmlNodeHelper { private static final Log log = Log.get(ZealotConfigManager.class); /** zealot xml文件中的根节点名称. */ private static final String ROOT_NAME = "zealots"; /** * 私...
String nameSpace = getNodeText(root.selectSingleNode(ZealotConst.ATTR_NAMESPACE));
2
maruohon/justenoughdimensions
src/main/java/fi/dy/masa/justenoughdimensions/network/MessageSyncWorldProperties.java
[ "@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION, certificateFingerprint = Reference.FINGERPRINT,\n guiFactory = \"fi.dy.masa.justenoughdimensions.config.JustEnoughDimensionsGuiFactory\",\n updateJSON = \"https://raw.githubusercontent.com/maruohon/justenoughdimensions...
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream; import javax.annotation.Nullable; import com.google.gson.JsonElement;...
package fi.dy.masa.justenoughdimensions.network; public class MessageSyncWorldProperties implements IMessage { @Nullable private JsonObject jedProperties; private boolean hasJEDTag; private boolean isHardcore; public MessageSyncWorldProperties() { } public MessageSyncWorldProperties(...
if (ClientUtils.setRenderersFrom(world.provider, message.jedProperties))
3
senseobservationsystems/sense-android-library
sense-android-library/src/nl/sense_os/service/feedback/FeedbackManager.java
[ "public class SenseApi {\n\n private static final long CACHE_REFRESH = 1000l * 60 * 60; // 1 hour\n private static final String TAG = \"SenseApi\";\n /** Device UUID for sensors that are not physical sensors, i.e. not connected to any device */\n public static final String NO_DEVICE_UUID = \"no_device_u...
import java.io.IOException; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; import java.util.List; import java.util.Locale; import java.util.Map; import nl.sense_os.service.commonsense.SenseApi; import nl.sense_os.service.constants.SensePrefs; import nl.sense_os.ser...
package nl.sense_os.service.feedback; /** * Class for giving feedback on state sensors in CommonSense. Used to 'teach' state sensors the * correct label for certain inputs. * * @author Steven Mulder <steven@sense-os.nl> */ public class FeedbackManager { private static final String TAG = "FeedbackManage...
String stateSensorId = SenseApi.getSensorId(context, name, null, null, null);
0
Airpy/KeywordDrivenAutoTest
src/test/java/com/keyword/automation/bill/warehouse/Test004_Warehouse_TestLossBill.java
[ "public class BrowserKeyword {\n // 不允许被初始化\n private BrowserKeyword() {\n\n }\n\n /**\n * 使用默认浏览器打开指定url\n *\n * @param requestUrl 请求url地址\n */\n public static void browserOpen(String requestUrl) {\n BrowserType bType = BrowserType.valueOf(Constants.DEFAULT_BROWSER);\n ...
import com.keyword.automation.action.BrowserKeyword; import com.keyword.automation.base.utils.LogUtils; import com.keyword.automation.bean.BillCell; import com.keyword.automation.bean.BillHeader; import com.keyword.automation.customer.BillKeyword; import com.keyword.automation.customer.LoginKeyword; import com.keyword....
package com.keyword.automation.bill.warehouse; /** * 入口:仓库-制作单据-报损单<br/> * 主要测试功能: * 1、新增报损单 * * @author Amio_ */ public class Test004_Warehouse_TestLossBill { private static List<BillCell> billCellList = new ArrayList<BillCell>(); private static BillHeader billHeader = new BillHeader("测试仓库", "刘振峰", fa...
BrowserKeyword.browserQuit();
0
citerus/bookstore-cqrs-example
order-context-parent/order-command/src/test/java/se/citerus/cqrs/bookstore/ordercontext/order/domain/OrderTest.java
[ "public abstract class DomainEvent<T extends GenericId> implements Serializable {\n\n public final T aggregateId;\n public final int version;\n public final long timestamp;\n\n protected DomainEvent(T aggregateId, int version, long timestamp) {\n this.aggregateId = aggregateId;\n this.version = version;\n...
import org.junit.Test; import se.citerus.cqrs.bookstore.event.DomainEvent; import se.citerus.cqrs.bookstore.ordercontext.order.BookId; import se.citerus.cqrs.bookstore.ordercontext.order.OrderId; import se.citerus.cqrs.bookstore.ordercontext.order.ProductId; import se.citerus.cqrs.bookstore.ordercontext.order.event.Ord...
package se.citerus.cqrs.bookstore.ordercontext.order.domain; public class OrderTest { private static final CustomerInformation JOHN_DOE = new CustomerInformation("John Doe", "john@acme.com", "Highway street 1"); @Test public void placingAnOrder() { Order order = new Order();
OrderLine orderLine = new OrderLine(ProductId.<BookId>randomId(), "title", 10, 200L);
6
palantir/eclipse-typescript
com.palantir.typescript/src/com/palantir/typescript/preferences/CompilerPreferencePage.java
[ "public final class Builders {\n\n /**\n * Prompts user to rebuild either the project or the whole workspace.\n *\n * @param shell\n * parent shell\n * @param onlyProject\n * the project to be rebuilt or null if the whole workpsace has to be rebuilt\n * @return t...
import static com.google.common.base.Preconditions.checkNotNull; import java.util.LinkedList; import java.util.List; import java.util.Set; import org.eclipse.core.resources.IProject; import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.ComboFieldEditor; import org.eclipse.jface.pr...
/* * Copyright 2013 Palantir Technologies, 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 l...
IPreferenceConstants.COMPILER_TARGET,
1
apache/commons-cli
src/test/java/org/apache/commons/cli/bug/BugCLI13Test.java
[ "public class CommandLine implements Serializable {\n /**\n * A nested builder class to create {@code CommandLine} instance using descriptive methods.\n *\n * @since 1.4\n */\n public static final class Builder {\n /**\n * CommandLine that is being build by this Builder.\n ...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.Option; import org.apache.commons.cli.OptionBuilder; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.com...
/* * 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 ...
final Option debug = OptionBuilder
1
simo415/spc
src/com/sijobe/spc/command/MovePlayer.java
[ "public enum FontColour {\n \n BLACK(\"\\2470\"),\n DARK_BLUE(\"\\2471\"),\n DARK_GREEN(\"\\2472\"),\n DARK_AQUA(\"\\2473\"),\n DARK_RED(\"\\2474\"),\n PURPLE(\"\\2475\"),\n ORANGE(\"\\2476\"),\n GREY(\"\\2477\"),\n DARK_GREY(\"\\2478\"),\n BLUE(\"\\2479\"),\n GREEN(\"\\247a\"),\n AQUA(\"\...
import com.sijobe.spc.util.FontColour; import com.sijobe.spc.validation.Parameter; import com.sijobe.spc.validation.ParameterString; import com.sijobe.spc.validation.ParameterInteger; import com.sijobe.spc.validation.Parameters; import com.sijobe.spc.wrapper.CommandException; import com.sijobe.spc.wrapper.CommandSender...
package com.sijobe.spc.command; /** * Allows you to move the player to the specified set of distance and direction * * @author simo_415 * @version 1.0 */ @Command ( name = "moveplayer", description = "move the player to the distance and direction specified", example = "10 north", ...
new ParameterString("[DIRECTION(N/E/S/W/U/D)]", false)
2
sparcules/Spark_Pixels
AndroidApp/SparkPixels/src/kc/spark/pixels/android/cloud/ApiFacade.java
[ "public class DeviceState {\n\n\tstatic final TLog log = new TLog(DeviceState.class);\n\n\n\tprivate static final Map<String, Device> deviceMap = map();\n\tprivate static final Random random = new Random();\n\n\tprivate static Context appContext;\n\n\n\tpublic static synchronized void initialize(Context ctx) {\n\t\...
import java.lang.reflect.Type; import java.util.List; import kc.spark.pixels.android.app.DeviceState; import kc.spark.pixels.android.cloud.api.Device; import kc.spark.pixels.android.cloud.api.FunctionResponse; import kc.spark.pixels.android.cloud.api.SimpleResponse; import kc.spark.pixels.android.cloud.api.TinkerRespon...
package kc.spark.pixels.android.cloud; /** * A simple interface for making requests and handling responses from the Spark * API. * * If you want to work with the Spark API from Android, this is the place to * start. See examples below like {@link #nameCore(String, String)}, * {@link #digitalWrite(String...
public void digitalRead(String coreId, String pinId, DigitalValue oldValue) {
6
iiljkic/utp4j
src/test/java/net/utp4j/channels/impl/read/SkippedPacketBufferTest.java
[ "public static final long MAX_USHORT = 65535;\r", "public static byte longToUbyte(long longvalue) {\r\n\tif (longvalue > MAX_UBYTE) {\r\n\t\tthrow new ByteOverflowException(getExceptionText(MAX_UBYTE, longvalue));\r\n\t} else if (longvalue < 0) {\r\n\t\tthrow new SignedNumberException(getExceptionText(MAX_UBYTE, ...
import static net.utp4j.data.bytes.UnsignedTypesUtil.MAX_USHORT; import static net.utp4j.data.bytes.UnsignedTypesUtil.longToUbyte; import static net.utp4j.data.bytes.UnsignedTypesUtil.longToUshort; import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.Queue; import org.junit.Te...
assertEquals(11, p11.utpPacket().getSequenceNumber() & 0xFFFF); assertEquals(12, p12.utpPacket().getSequenceNumber() & 0xFFFF); assertEquals(13, p13.utpPacket().getSequenceNumber() & 0xFFFF); buffer.reindex(13); Queue<UtpTimestampedPacketDTO> lastPackets = buffer.getAllUntillNextMissing(); assertEq...
assertEquals(longToUbyte(239), headerExtension.getBitMask()[0]);
1
yangwencan2002/MediaLoader
library/src/main/java/com/vincan/medialoader/tinyhttpd/IOHandler.java
[ "public class HttpRequestDecoder implements RequestDecoder<HttpRequest> {\n\n @Override\n public HttpRequest decode(byte[] bytes) throws ResponseException {\n String rawRequest = new String(bytes);\n try {\n //Http协议第1行是Method URI VERSION\n StringTokenizer st = new StringTo...
import com.vincan.medialoader.tinyhttpd.codec.HttpRequestDecoder; import com.vincan.medialoader.tinyhttpd.codec.HttpResponseEncoder; import com.vincan.medialoader.tinyhttpd.codec.RequestDecoder; import com.vincan.medialoader.tinyhttpd.codec.ResponseEncoder; import com.vincan.medialoader.tinyhttpd.request.Request; ...
package com.vincan.medialoader.tinyhttpd; /** * IO处理器 * * @author vincanyang */ public class IOHandler implements Runnable { private RequestDecoder mRequestDecoder = new HttpRequestDecoder(); private ResponseEncoder mResponseEncoder = new HttpResponseEncoder(); private TinyHttpd mHt...
LogUtil.d("ResponseException happened and handling", re);
8
ebolwidt/cassowary-java
src/main/java/org/klomp/cassowary/awt/constraint/AdjacencyConstraint.java
[ "public class CLInternalError extends CLException {\n\n public CLInternalError(String s) {\n super(s);\n }\n\n}", "public class ClSimplexSolver extends ClTableau {\n\n // the arrays of positive and negative error vars for the stay constraints\n // (need both positive and negative since they hav...
import java.awt.Color; import java.awt.Graphics; import java.util.ArrayList; import java.util.List; import org.klomp.cassowary.CLInternalError; import org.klomp.cassowary.ClSimplexSolver; import org.klomp.cassowary.ConstraintNotFoundException; import org.klomp.cassowary.awt.CDA_G; import org.klomp.cassowary.awt.compone...
/* * Adjacency relational constraint. The target CC (the second) is to be * next to the first (source) CC at all times, with respect to their bounding * boxes. * Used as a base class for the Above, Below, LeftOf, and RightOf constraints. * Subclasses need to implement toString and addConstraints. * * $Id: Adja...
g.setColor(CDA_G.DARK_GREEN);
3
jbenech/gnikrap
gnikrap-core/src/main/java/org/gnikrap/script/EV3ScriptContext.java
[ "public interface GnikrapAppContext {\n\n /**\n * Returns the {@link GnikrapApp} object (the application entry point).\n */\n GnikrapApp getGnikrapApp();\n\n /**\n * Returns the {@link EV3ActionProcessor} object (process asynchronously all the actions/events from the GUI).\n */\n EV3ActionProcessor getE...
import java.util.concurrent.Future; import org.gnikrap.GnikrapAppContext; import org.gnikrap.script.ev3api.SimpleChrono; import org.gnikrap.script.ev3api.SimpleEV3Brick; import org.gnikrap.script.ev3api.SimpleEV3Keyboard.SimpleEV3Button; import org.gnikrap.script.ev3api.xsensors.XSensor; import org.gnikrap.script.ev3ap...
/* * Gnikrap is a simple scripting environment for the Lego Mindstrom EV3 * Copyright (C) 2014-2017 Jean BENECH * * Gnikrap 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 Licens...
private final SimpleChrono chrono;
1
NikitaKozlov/Pury
pury/src/test/java/com/nikitakozlov/pury/aspects/StopProfilingAspectTest.java
[ "public final class Pury {\n\n public static final String LOG_TAG = \"Pury\";\n public static final String LOGGER_PLUGIN = \"LoggerPlugin\";\n\n public static void setLogger(Logger logger) {\n }\n\n public synchronized static Logger getLogger() {\n return null;\n }\n\n public static bool...
import com.nikitakozlov.pury.Pury; import com.nikitakozlov.pury.PurySetter; import com.nikitakozlov.pury.annotations.StopProfiling; import com.nikitakozlov.pury.annotations.StopProfilings; import com.nikitakozlov.pury.profile.Profiler; import com.nikitakozlov.pury.profile.ProfilingManager; import com.nikitakozlov.pury....
package com.nikitakozlov.pury.aspects; public class StopProfilingAspectTest { private static final int RUNS_COUNTER_5 = 5; private static final String PROFILER_NAME_1 = "profilerName 1"; private static final String STAGE_NAME_1 = "stageName 1"; private static final int RUNS_COUNTER_4 = 4; pri...
PurySetter.setProfilingManager(profilingManager);
1
spoqa/battery
src/main/java/com/spoqa/battery/ObjectBuilder.java
[ "public class JsonCodec implements RequestSerializer, ResponseDeserializer {\r\n private static final String TAG = \"JsonCodec\";\r\n\r\n public static final String MIME_TYPE = \"application/json\";\r\n\r\n public JsonCodec() {\r\n\r\n }\r\n\r\n /* serializer */\r\n\r\n @Override\r\n public byt...
import com.spoqa.battery.annotations.Response; import com.spoqa.battery.codecs.JsonCodec; import com.spoqa.battery.exceptions.DeserializationException; import com.spoqa.battery.exceptions.IncompatibleTypeException; import com.spoqa.battery.exceptions.MissingFieldException; import com.spoqa.battery.exceptions.RpcEx...
/** * Copyright (c) 2014-2015 Spoqa, All Rights Reserved. */ package com.spoqa.battery; public final class ObjectBuilder { private static final String TAG = "ObjectBuilder"; private static Map<String, ResponseDeserializer> sDeserializerMap; static { sDeserializerMap = new HashM...
throw new DeserializationException(new MissingFieldException(f.getName()));
3
pablopdomingos/nfse
nfse-bh/src/main/java/com/pablodomingos/webservices/WSPrefeitura.java
[ "public class CertificadoConfig {\n\n private TipoCertificado tipoCertificado;\n private String senhaCertificado;\n private String aliasCertificado;\n private String caminhoParaCertificado;\n private String caminhoParaCadeiaCertificado;\n private KeyStore keyStoreCertificado;\n private NFSeAmbiente ambiente;...
import java.io.IOException; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; import javax.xml.rpc.ServiceException; import com.pablodomingos.assinatura.CertificadoConfig; import com.pablodomingos.util.XmlUtil; import com.pablod...
package com.pablodomingos.webservices; public class WSPrefeitura { public static String consultaSituacaoLoteRps(String xml, CertificadoConfig configCertificado) throws ServiceException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { return webService(...
private static Nfse webService(CertificadoConfig configCertificado) throws ServiceException{
3
salk31/RedQueryBuilder
redquerybuilder-core/src/main/java/com/redspr/redquerybuilder/core/client/engine/Session.java
[ "public class Configuration {\n private Database database = new Database();\n\n private final From from = new From();\n\n public void fireEnumerate(EnumerateRequest request, AsyncCallback<Response> callback) {\n }\n\n // XXX not called by CommandBuilder. GWT users meant to use RedQueryBuilder?\n p...
import com.google.gwt.event.shared.HandlerManager; import com.redspr.redquerybuilder.core.client.Configuration; import com.redspr.redquerybuilder.core.client.ValueRegistry; import com.redspr.redquerybuilder.core.client.command.CommandBuilder; import com.redspr.redquerybuilder.core.client.command.dml.Select; import com....
package com.redspr.redquerybuilder.core.client.engine; /** * Communication bus for entire system. * * All nodes in the tree hold a reference to its Session. */ public class Session { private static IdentifierEscaper identifierEscaper = new IdentifierEscaper() { @Override public String quote(...
private Select select;
2
knishiura-lab/AjaxMutator
src/test/java/jp/gr/java_conf/daisy/ajax_mutator/mutator/DOMNormalizationMutatorTest.java
[ "public class MutateVisitor implements NodeVisitor {\n private final ImmutableSet<EventAttacherDetector> eventAttacherDetectors;\n private final ImmutableSet<TimerEventDetector> timerEventDetectors;\n private final ImmutableSet<? extends AbstractDetector<DOMCreation>> domCreationDetectors;\n private fin...
import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import jp.gr.java_conf.daisy.ajax_mutator.MutateVisitor; import jp.gr.java_conf.daisy.ajax_mutator.MutateVisitorBuilder; import jp.gr.java_conf.daisy.ajax_mutator.detector.dom_manipulation_detector.DOMNormalizationDetector; impor...
package jp.gr.java_conf.daisy.ajax_mutator.mutator; public class DOMNormalizationMutatorTest extends MutatorTestBase { @Override protected void prepare() { inputs = new String[] { "document.findElementById('foo').normalize();", };
MutateVisitorBuilder builder = MutateVisitor.emptyBuilder();
0
7upcat/agile-wroking-backend
src/main/java/org/catframework/agileworking/service/impl/ScheduleServiceImpl.java
[ "@Entity\n@JsonIgnoreProperties({ \"handler\", \"hibernateLazyInitializer\" })\npublic class MeetingRoom implements Serializable {\n\n\tprivate static final long serialVersionUID = -1701470269000866582L;\n\n\t@Id\n\t@GeneratedValue\n\tprivate Long id;\n\n\t@Column(nullable = false)\n\tprivate Long teamId;\n\n\t/** ...
import java.util.Date; import java.util.List; import java.util.stream.Collectors; import org.catframework.agileworking.domain.MeetingRoom; import org.catframework.agileworking.domain.MeetingRoomRepository; import org.catframework.agileworking.domain.Schedule; import org.catframework.agileworking.domain.ScheduleReposito...
package org.catframework.agileworking.service.impl; @Component public class ScheduleServiceImpl implements ScheduleService { @Autowired private ScheduleRepository scheduleRepository; @Autowired private MeetingRoomRepository meetingRoomRepository; @Override public List<Schedule> find(Long meetingRoomId, Date...
if (DateUtils.isSameWeekOfday(s1.getDate(), date)) {
5
TonnyL/Espresso
app/src/main/java/io/github/marktony/espresso/mvp/search/SearchActivity.java
[ "public class CompaniesRepository implements CompaniesDataSource {\n\n @Nullable\n private static CompaniesRepository INSTANCE = null;\n\n @NonNull\n private final CompaniesDataSource localDataSource;\n\n // Prevent direct instantiation\n private CompaniesRepository(@NonNull CompaniesDataSource lo...
import android.preference.PreferenceManager; import android.support.annotation.Nullable; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import io.github.marktony.espresso.R; import io.github.marktony.espresso.data.source.CompaniesRepository; i...
/* * Copyright(c) 2017 lizhaotailang * * 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 agre...
PackagesRepository.getInstance(PackagesRemoteDataSource.getInstance(), PackagesLocalDataSource.getInstance()),
4
deepakpk009/JScreenRecorder
src/com/deepak/jscreenrecorder/gui/WatermarkSelector.java
[ "public class TextWatermarkCreator {\n\n // the text watermark image object\n private BufferedImage textWatermarkImage = null;\n // the watermark display panel refernce\n private WatermarkDisplayPanel watermarkDisplayPanel = null;\n\n // the constructor with watermark display panel as the parameter\n...
import com.deepak.jscreenrecorder.core.TextWatermarkCreator; import com.deepak.jscreenrecorder.core.config.RecordConfig; import com.deepak.jscreenrecorder.core.constants.Directory; import com.deepak.jscreenrecorder.core.constants.Extension; import com.deepak.jscreenrecorder.core.filters.ImageFileNameFilter; import com....
.addGroup(layout.createSequentialGroup() .addComponent(useWatermarkCheckBox) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addComponent(createTextWatermarkButton) ...
int watermarkCount = new AddImage().add(Directory.WATERMARK_DB, Extension.WATERMARK_EXTENSION);
5
MingweiSamuel/Zyra
src/test/java/com/mingweisamuel/zyra/test/ApiComboFeaturedGamesSummonerCurrentGameV4Test.java
[ "public enum Region {\n /** Brazil. */\n BR(\"BR1\", true),\n /** North-east Europe. */\n EUNE(\"EUN1\", true),\n /** West Europe. */\n EUW(\"EUW1\", true),\n /** North America. */\n NA(\"NA1\", true),\n /** Korea. */\n KR(\"KR\", true),\n /** North Latin America. */\n LAN(\"LA1\...
import com.mingweisamuel.zyra.enums.Region; import com.mingweisamuel.zyra.spectatorV4.CurrentGameInfo; import com.mingweisamuel.zyra.spectatorV4.CurrentGameParticipant; import com.mingweisamuel.zyra.spectatorV4.FeaturedGameInfo; import com.mingweisamuel.zyra.spectatorV4.FeaturedGames; import com.mingweisamuel.zyra.spec...
package com.mingweisamuel.zyra.test; /** * Integration tests testing * {@link com.mingweisamuel.zyra.SpectatorV4Endpoints} (current game & featured game) and * {@link com.mingweisamuel.zyra.SummonerV4Endpoints}. */ public class ApiComboFeaturedGamesSummonerCurrentGameV4Test extends ApiTest { @Test publ...
Participant participant = gameInfo.participants.get(0);
5
moovida/STAGE
eu.hydrologis.stage.modules/src/eu/hydrologis/stage/modules/widgets/ModuleGui.java
[ "public class SpatialToolboxSessionPluginSingleton {\n\n public static final String JARPATH_SPLITTER = \"@@@\"; //$NON-NLS-1$\n public static final String STAGE_LOADED_JARS_KEY = \"STAGE_LOADED_JARS_KEY\"; //$NON-NLS-1$\n public static final String STAGE_LOG_KEY = \"STAGE_LOG_KEY\"; //$NON-NLS-1$\n publ...
import java.io.File; import java.util.ArrayList; import java.util.List; import net.miginfocom.swt.MigLayout; import org.eclipse.swt.SWT; import org.eclipse.swt.SWTError; import org.eclipse.swt.browser.Browser; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.custo...
/* * Stage - Spatial Toolbox And Geoscript Environment * (C) HydroloGIS - www.hydrologis.com * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * (http://www.eclipse.org/legal/epl-v10.html). */ package eu.hydrologis.stage...
String html = FileUtilities.readFile(moduleDocumentationPath);
3
adamin1990/MaterialWpp
wpp/app/src/main/java/adamin90/com/wpp/Activity/DetailActivity.java
[ "public class Constant {\n public static final String BASEURL=\"http://client.pic.hiapk.com/\";\n}", "public class DetailPagerAdapter extends PagerAdapter {\n private List<adamin90.com.wpp.model.detail.List> lists;\n private PhotoViewAttacher photoViewAttacher;\n private TabLisenter lisenter;\n\n\n ...
import android.app.WallpaperManager; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.os.PersistableBundle; import android.support.design.widget.AppBarLayout; import andro...
package adamin90.com.wpp.Activity; public class DetailActivity extends AppCompatActivity { @Bind(R.id.toolbar) Toolbar toolbar; @Bind(R.id.appbar) AppBarLayout appBarLayout; @Bind(R.id.viewpager) ViewPager viewPager; @Bind(R.id.floatingmenu)
FloatingActionMenu floatingActionMenu;
4
yarolegovich/wellsql
well-sample/src/androidTest/java/com/yarolegovich/wellsample/WellSqlTest.java
[ "@SuppressWarnings(\"unchecked\")\npublic class SelectQuery<T extends Identifiable> implements ConditionClauseConsumer {\n\n private static Executor sExecutor = Executors.newSingleThreadExecutor();\n\n private Handler mMainHandler = new Handler(Looper.getMainLooper());\n\n private Class<T> mModel;\n\n p...
import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.os.Looper; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import com.wellsql.generated.SuperHeroTable; import com.yarolegovich.wellsql.SelectQuery;...
assertTrue(Thread.currentThread() == Looper.getMainLooper().getThread()); assertEquals(heroes.size(), data.size()); } }); } @Test public void conditionalDeleteWorks() { List<SuperHero> heroes = getHeroes(); WellSql.insert(heroes).execute()...
WellCursor<SuperHero> heroCursor = WellSql.select(SuperHero.class).getAsCursor();
1
zhihu/mirror
app/src/main/java/com/zhihu/android/app/mirror/util/MirrorUtils.java
[ "public class Artboard {\n @SerializedName(\"id\")\n private String mId;\n\n @SerializedName(\"slug\")\n private String mSlug;\n\n // @SerializedName(\"files\")\n // private File[] mFiles;\n\n @SerializedName(\"name\")\n private String mName;\n\n @SerializedName(\"width\")\n private in...
import com.zhihu.android.app.mirror.model.Handshake; import com.zhihu.android.app.mirror.model.MirrorInfo; import com.zhihu.android.app.mirror.model.Page; import com.zhihu.android.app.mirror.model.Screen; import android.content.Context; import android.os.Build; import android.text.TextUtils; import java.util.ArrayList;...
/* * Mirror - Yet another Sketch Mirror App for Android. * Copyright (C) 2016 Zhihu Inc. * * 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 o...
for (Page page : content.getContents().getPages()) {
4
okinawaopenlabs/of-patch-manager
src/main/java/org/okinawaopenlabs/ofpm/validate/device/PortInfoCreateJsonInValidate.java
[ "public class ErrorMessage {\n\tpublic static final String CONNECTION_FAIL = \"Connection failed: %s.\";\n\tpublic static final String WRONG_RESPONSE = \"Response of %s is wrong.\";\n\tpublic static final String INVALID_JSON = \"Invalid json syntax.\";\n\tpublic static final String INVALID_PARAMETER = \"%s is...
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.log4j.Logger; import static org.okinawaopenlabs.constants.ErrorMessage.*; import static org.okinawaopenlabs.constants.OfpmDefinition.*; import java.util.regex.Pattern; import org.okinawaopenlabs.ofpm.excepti...
/* * Copyright 2015 Okinawa Open Laboratory, General Incorporated Association * * 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...
public void checkValidation(String deviceName, PortInfoCreateJsonIn portInfoJson) throws ValidateException {
3
kbase/kb_sdk
src/java/us/kbase/mobu/ModuleBuilder.java
[ "public class RunCompileCommand {\n\n public static void generate(File specFile, String url, boolean jsClientSide, \n String jsClientName, boolean perlClientSide, String perlClientName, \n boolean perlServerSide, String perlServerName, String perlImplName, \n String perlPsgiName,...
import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.PrintWriter; import java.io.StringWriter; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Properti...
package us.kbase.mobu; public class ModuleBuilder { private static final String defaultParentPackage = "us.kbase"; private static final String MODULE_BUILDER_SH_NAME = "kb-sdk"; private static final String INIT_COMMAND = "init"; private static final String VALIDATE_COMMAND = "validate"; ...
String language = ModuleInitializer.DEFAULT_LANGUAGE;
1
nullEuro/5zigCubecraft
src/main/java/net/frozenbit/plugin5zig/cubecraft/commands/stalker/StalkerCommandHandler.java
[ "@Plugin(name = \"5zigCubecraft\", version = Build.versionStr)\npublic class Main {\n public static final Path PLUGIN_PATH = Paths.get(\"the5zigmod/plugins/5zigCubecraft/\");\n public static final Version MIN_5ZIG_VERSION = new Version(3, 9, 10);\n private static final String LOG_FILE = \"cubecraft_5ziglog...
import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import eu.the5zig.mod.The5zigAPI; import eu.the5zig.util.minecraft.ChatColor; import net.frozenbit.plugin5zig.cubecraft.Main; import net.frozenbit.plugin5zig.cubecraft.Util; import net.frozenbit.plugin5zig.cubecraft.commands.CommandHandler; import n...
package net.frozenbit.plugin5zig.cubecraft.commands.stalker; public class StalkerCommandHandler extends CommandHandler { private static final URI MOJANG_API = URI.create("https://api.mojang.com/profiles/minecraft"); private final Main main; private ExecutorService executorService; private CloseableH...
public void run(String cmd, List<String> args, CommandOutputPrinter printer) throws UsageException {
3