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
XiaoMi/galaxy-fds-sdk-android
src/test/java/com/xiaomi/infra/galaxy/fds/android/example/FDSOAuthClient.java
[ "public class FDSClientConfiguration {\n\n private static final String URI_HTTP_PREFIX = \"http://\";\n private static final String URI_HTTPS_PREFIX = \"https://\";\n private static final String URI_CDN = \"cdn\";\n private static final String URI_SUFFIX = \"fds.api.xiaomi.com\";\n private static final String ...
import java.io.ByteArrayInputStream; import java.io.InputStream; import com.xiaomi.infra.galaxy.fds.android.FDSClientConfiguration; import com.xiaomi.infra.galaxy.fds.android.GalaxyFDSClient; import com.xiaomi.infra.galaxy.fds.android.GalaxyFDSClientImpl; import com.xiaomi.infra.galaxy.fds.android.auth.GalaxyFDSCredent...
package com.xiaomi.infra.galaxy.fds.android.example; public class FDSOAuthClient { // This is a simple demo for FDS android SDK, note that before use android // sdk, you should do the following preparation: // 1. Create the bucket which you want to upload your object // 2. Grant proper bucket permissi...
FDSClientConfiguration config = new FDSClientConfiguration()
0
ykulbashian/LiquidSurface
liquidview/src/main/java/com/google/fpl/liquidfunpaint/tool/Tool.java
[ "public class CircleShape extends Shape {\n private transient long swigCPtr;\n\n protected CircleShape(long cPtr, boolean cMemoryOwn) {\n super(liquidfunJNI.CircleShape_SWIGUpcast(cPtr), cMemoryOwn);\n swigCPtr = cPtr;\n }\n\n protected static long getCPtr(CircleShape obj) {\n return (obj == null) ? 0 ...
import java.nio.ByteBuffer; import java.util.EnumMap; import java.util.EnumSet; import android.util.SparseArray; import android.view.MotionEvent; import android.view.View; import com.google.fpl.liquidfun.CircleShape; import com.google.fpl.liquidfun.ParticleColor; import com.google.fpl.liquidfun.ParticleGroup; import co...
/** * Copyright (c) 2014 Google, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable...
protected CircleShape mShape = new CircleShape();
0
iGoodie/TwitchSpawn
src/main/java/net/programmer/igoodie/twitchspawn/tslanguage/action/OsRunAction.java
[ "@Mod(TwitchSpawn.MOD_ID)\npublic class TwitchSpawn {\n\n public static final String MOD_ID = \"twitchspawn\";\n public static final Logger LOGGER = LogManager.getLogger(TwitchSpawn.class);\n\n public static MinecraftServer SERVER;\n public static TraceManager TRACE_MANAGER;\n\n public TwitchSpawn() ...
import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.fmllegacy.network.NetworkDirection; import net.programmer.igoodie.twitchspawn.TwitchSpawn; import net.programmer.igoodie.twitchspawn.network.NetworkManager; import net.programmer.igoodie.twitchspawn.network.packet.OsRunPacket; import net.programm...
package net.programmer.igoodie.twitchspawn.tslanguage.action; public class OsRunAction extends TSLAction { public static void handleLocalScript(Shell shell, String script) { ProcessResult result = runScript(shell, script); if (result.exception != null) TwitchSpawn.LOGGER.info("OS_RUN...
public OsRunAction(List<String> words) throws TSLSyntaxError {
5
TheCreeperOfRedstone/RPG-Items-2
src/think/rpgitems/Handler.java
[ "public interface CommandHandler {\n\n}", "public class Locale extends BukkitRunnable {\n \n private static HashMap<String, HashMap<String, String>> localeStrings = new HashMap<String, HashMap<String,String>>();\n private static FileConfiguration config = think.rpgitems.Plugin.config;\n private Plugin...
import java.util.ArrayList; import java.util.HashSet; import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Color; import org.bukkit.Material; import org.bukkit.command.CommandSender; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.invento...
} if (WorldGuard.useWorldGuard) { sender.sendMessage(ChatColor.AQUA + Locale.get("message.worldguard.disable", locale)); } else { sender.sendMessage(ChatColor.AQUA + Locale.get("message.worldguard.enable", locale)); } WorldGuard.useWorldGuard = !WorldGuard...
public void setItemQuality(CommandSender sender, RPGItem item, Quality quality) {
3
oantajames/mdb-android-application
app/src/main/java/mdb/com/view/moviesgrid/MoviesGridActivity.java
[ "public class MovieEntity implements Parcelable {\n\n @SerializedName(\"vote_count\")\n @Expose\n public Integer voteCount;\n @SerializedName(\"id\")\n @Expose\n public Integer id;\n @SerializedName(\"video\")\n @Expose\n public Boolean video;\n @SerializedName(\"vote_average\")\n @...
import android.app.Fragment; import android.app.FragmentManager; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.os.PersistableBundle; import android.support.design.widget.TabLayout; import android.support.v4.view.ViewPager; import a...
package mdb.com.view.moviesgrid; public class MoviesGridActivity extends BaseActivity implements HasComponent<MoviesGridComponent>, OnItemSelectedListener { public static Intent getCallingIntent(Context context) { return new Intent(context, MoviesGridActivity.class); } public static S...
Intent intent = new Intent(this, MovieDetailsActivity.class);
7
heroku/heroku.jar
heroku-api/src/main/java/com/heroku/api/request/team/TeamCreate.java
[ "public class App implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n String id;\n String name;\n Domain domain_name;\n String created_at;\n App.Owner owner;\n String web_url;\n App.Stack stack;\n String requested_stack;\n String git_url;\n String buil...
import com.heroku.api.App; import com.heroku.api.Heroku; import com.heroku.api.Team; import com.heroku.api.exception.RequestFailedException; import com.heroku.api.http.Http; import com.heroku.api.request.Request; import com.heroku.api.request.RequestConfig; import java.util.Collections; import java.util.Map; import sta...
package com.heroku.api.request.team; /** * TODO: Javadoc * * @author Joe Kutner */ public class TeamCreate implements Request<Team> { private final RequestConfig config; public TeamCreate(Team team) { RequestConfig builder = new RequestConfig(); builder = (team.getName() != null) ? bui...
public Http.Method getHttpMethod() {
4
wavesoftware/java-eid-exceptions
src/test/java/pl/wavesoftware/eid/utils/EidPreconditionsIT.java
[ "@State(Scope.Benchmark)\npublic class DisableValidatorState {\n private static final Logger LOGGER =\n LoggerFactory.getLogger(DisableValidatorState.class);\n private ConfigurationContext context;\n\n @Setup\n public void setup() {\n context =\n new ConfigurationContext(new Con...
import com.google.common.base.Preconditions; import org.junit.ClassRule; import org.junit.Test; import org.junit.rules.RuleChain; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.annotations.Scope; import org.openjdk.jmh.annotations.Setup; import org.openjdk....
/* * Copyright (c) 2015 Wave Software * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
.jvmArgs(JvmArgs.get())
4
AdeptJ/adeptj-runtime
src/main/java/com/adeptj/runtime/servlet/BridgeServlet.java
[ "public enum BridgeServletConfigHolder {\n\n INSTANCE;\n\n private ServletConfig bridgeServletConfig;\n\n public void setBridgeServletConfig(ServletConfig bridgeServletConfig) { // NOSONAR\n if (this.bridgeServletConfig == null) {\n this.bridgeServletConfig = bridgeServletConfig;\n ...
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import com.adeptj.runtime.common.BridgeServletConfigHolder; import com.adeptj.runtime.common.BundleContextHolder; import com.adeptj.runtime.common.ResponseUtil; import com.adeptj.runtime.common.Times...
/* ############################################################################### # # # Copyright 2016, AdeptJ (http://www.adeptj.com) # # ...
ResponseUtil.unavailable(resp);
2
moberwasserlechner/vaadin-chartjs
src/test/java/com/byteowls/vaadin/chartjs/ChartJsTest.java
[ "public class LineChartConfig implements ChartConfig {\n\n private static final long serialVersionUID = 4896118079157690609L;\n\n private Data<LineChartConfig> data;\n private LineChartOptions options;\n\n public Data<LineChartConfig> data() {\n if (this.data == null) {\n this.data = n...
import org.junit.Assert; import org.junit.Test; import com.byteowls.vaadin.chartjs.config.LineChartConfig; import com.byteowls.vaadin.chartjs.data.LineDataset; import com.byteowls.vaadin.chartjs.options.AnimationEasing; import com.byteowls.vaadin.chartjs.options.InteractionMode; import com.byteowls.vaadin.chartjs.optio...
package com.byteowls.vaadin.chartjs; /** * @author michael@byteowls.com */ public class ChartJsTest { @Test public void testConfigGeneral() { LineChartConfig config = new LineChartConfig(); config .data() .labels("A", "B", "C") .addDataset(new ...
.add(Axis.X, new LinearScale().position(Position.TOP))
6
ilmila/J2EEScan
src/main/java/burp/j2ee/issues/impl/AJP_Tomcat_GhostCat.java
[ "public static String getApplicationContext(URL url) {\n\n String path = url.getPath();\n int i = path.indexOf(\"/\", 1);\n String context = path.substring(0, i + 1);\n\n return context;\n}", "public static List<int[]> getMatches(byte[] response, byte[] match, IExtensionHelpers helpers) {\n List<in...
import burp.CustomHttpRequestResponse; import static burp.HTTPMatcher.getApplicationContext; import static burp.HTTPMatcher.getMatches; import burp.j2ee.Confidence; import burp.j2ee.CustomScanIssue; import burp.j2ee.Risk; import burp.j2ee.issues.IModule; import burp.j2ee.lib.SimpleAjpClient; import burp.j2ee.lib.Tester...
package burp.j2ee.issues.impl; /** * AJP Tomcat GhostCat - CVE-2020-1938 * * * * References: - AJP Bug Implementation credits: - * https://github.com/threedr3am/learnjavabug/tree/master/tomcat/ajp-bug/src/main/java/com/threedr3am/bug/tomcat/ajp * * * TODO: * - Hardcoded AJP port 8009 * */ public class...
List<int[]> matches = getMatches(ajp_forward_result.getBytes(), GREP_STRING, helpers);
1
4FunApp/4Fun
client/FourFun/app/src/main/java/com/joker/fourfun/presenter/ReadPresenter.java
[ "public abstract class BaseMvpPresenter<T extends BaseView> implements BasePresenter<T> {\n public T mView;\n public CompositeDisposable mDisposable;\n\n public void attach(T mView) {\n this.mView = mView;\n mDisposable = new CompositeDisposable();\n }\n\n public void detach() {\n ...
import com.joker.fourfun.base.BaseMvpPresenter; import com.joker.fourfun.model.ArticleOne; import com.joker.fourfun.net.HttpResultFunc; import com.joker.fourfun.net.UserService; import com.joker.fourfun.presenter.contract.ReadContract; import com.joker.fourfun.utils.RetrofitUtil; import com.joker.fourfun.utils.RxUtil; ...
package com.joker.fourfun.presenter; /** * Created by joker on 2016/12/8. */ public class ReadPresenter extends BaseMvpPresenter<ReadContract.View> implements ReadContract.Presenter { private UserService mService; @Inject ReadPresenter(RetrofitUtil retrofit) { mService = retrofit.create(Use...
.map(new HttpResultFunc<List<ArticleOne>>())
1
redhat-developer-demos/brewery
brewing/src/main/java/io/spring/cloud/samples/brewery/maturing/BottlingServiceUpdater.java
[ "@Data\n@Builder\npublic class TestConfigurationHolder {\n\tpublic static final String TEST_COMMUNICATION_TYPE_HEADER_NAME = \"TEST-COMMUNICATION-TYPE\";\n\tpublic static final ThreadLocal<TestConfigurationHolder> TEST_CONFIG = new ThreadLocal<>();\n\n\tprivate TestCommunicationType testCommunicationType;\n\n\tpubl...
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand; import org.springframework.cloud.sleuth.Span; import org.springframework.cloud.sleuth.Tracer; import org.springframework.http.HttpMethod; import org.springframework.scheduling.annotation.Async; import org.springframework.util.Assert; import org.spri...
package io.spring.cloud.samples.brewery.maturing; @Slf4j class BottlingServiceUpdater { private final BrewProperties brewProperties; private final Tracer tracer; private final PresentingServiceClient presentingServiceClient; private final BottlingService bottlingService; private final RestTemp...
restTemplate.exchange(requestEntity()
7
NikitaKozlov/Pury
pury/src/test/java/com/nikitakozlov/pury/LoggerPluginTest.java
[ "public class ProfilerId {\n /**\n * @param profilerName Profiler Name.\n * @param runsCounter Amount of runs to complete\n */\n public ProfilerId(String profilerName, int runsCounter) {\n }\n\n /**\n * @return Profiler Name\n */\n public String getProfilerName() {\n return...
import com.nikitakozlov.pury.profile.ProfilerId; import com.nikitakozlov.pury.result.model.AverageProfileResult; import com.nikitakozlov.pury.result.model.AverageTime; import com.nikitakozlov.pury.result.model.RootAverageProfileResult; import com.nikitakozlov.pury.result.model.RootSingleProfileResult; import com.nikita...
package com.nikitakozlov.pury; public class LoggerPluginTest { @Mock Logger mLogger; @Before public void setUp() { initMocks(this); Pury.setLogger(mLogger); } @Test public void handleResult_ShouldLogProperly_WhenRunCounterIsOne() { String expectedResult = "Pro...
AverageTime apiCallStartAvgTime = new AverageTime(1100000, 0, 2000000L, 5);
2
danburkert/kudu-ts
core/src/test/java/org/kududb/ts/core/TestInterpolation.java
[ "@InterfaceAudience.Public\n@InterfaceStability.Evolving\n@NotThreadSafe\npublic class Aggregators {\n\n private Aggregators() {}\n\n public static Aggregator min() {\n return new Min();\n }\n\n public static Aggregator max() {\n return new Max();\n }\n\n public static Aggregator sum() {\n return new...
import static org.junit.Assert.assertEquals; import com.google.common.collect.ImmutableList; import org.junit.Test; import org.kududb.ts.core.Aggregators; import org.kududb.ts.core.Datapoints; import org.kududb.ts.core.DoubleVec; import org.kududb.ts.core.IntVec; import org.kududb.ts.core.Interpolators; import org.kudu...
package org.kududb.ts.core; public class TestInterpolation { /** * Tests that two {@link Datapoints} are equal, except for the series IDs. * @param a the first datapoints to compare * @param b the second datapoints to compare */ private static void datapointsEqual(Datapoints a, Datapoints b) { a...
Aggregators.max(),
0
Effervex/CycDAG
src/graph/inference/module/OrWorker.java
[ "public class OntologyFunction extends DAGNode implements Edge {\r\n\tprivate static final long serialVersionUID = 473544398260462641L;\r\n\tprivate boolean notAnonymous_ = true;\r\n\tprotected Node[] nodes_;\r\n\r\n\tpublic OntologyFunction() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic OntologyFunction(Node... nodes)...
import graph.core.Node; import graph.core.OntologyFunction; import graph.inference.QueryObject; import graph.inference.QueryResult; import graph.inference.QueryWorker; import graph.inference.Substitution; import graph.module.QueryModule;
/******************************************************************************* * Copyright (C) 2013 University of Waikato, Hamilton, New Zealand. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this dist...
queryObj.addResult(false, new Substitution());
4
yunnet/kafkaEagle
src/main/java/org/smartloli/kafka/eagle/web/controller/AlarmController.java
[ "public class AlarmDomain {\n\n\tprivate String group = \"\";\n\tprivate String topics = \"\";\n\tprivate long lag = 0L;\n\tprivate String owners = \"\";\n\tprivate String modifyDate = \"\";\n\n\tpublic String getGroup() {\n\t\treturn group;\n\t}\n\n\tpublic void setGroup(String group) {\n\t\tthis.group = group;\n\...
import java.io.OutputStream; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.smartloli.kafka.eagle.common.domain.AlarmDomain; import org.smartloli...
/** * 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...
String clusterAlias = session.getAttribute(ConstantUtils.SessionAlias.CLUSTER_ALIAS).toString();
2
ArcadiaPlugins/Arcadia-Spigot
src/main/java/me/redraskal/arcadia/game/RainbowJumpGame.java
[ "public class Arcadia extends JavaPlugin {\n\n private ArcadiaAPI api;\n public Configuration mainConfiguration;\n\n public void onEnable() {\n this.api = new ArcadiaAPI(this);\n new File(this.getDataFolder().getPath() + \"/translations/\").mkdirs();\n if(new File(this.getDataFolder()....
import me.redraskal.arcadia.Arcadia; import me.redraskal.arcadia.Cuboid; import me.redraskal.arcadia.Utils; import me.redraskal.arcadia.api.game.BaseGame; import me.redraskal.arcadia.api.map.GameMap; import me.redraskal.arcadia.api.scoreboard.SidebarSettings; import me.redraskal.arcadia.api.scoreboard.WinMethod; import...
package me.redraskal.arcadia.game; public class RainbowJumpGame extends BaseGame { private Location startPosition; private Location targetPosition; private String towards; private Cuboid glass;
public RainbowJumpGame(GameMap gameMap) {
4
maruohon/justenoughdimensions
src/main/java/fi/dy/masa/justenoughdimensions/world/WorldProviderJED.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 javax.annotation.Nullable; import net.minecraft.client.audio.MusicTicker.MusicType; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import n...
if (generatorClassName.equals("ChunkGeneratorFlatJED")) { return new ChunkGeneratorFlatJED(world, seed, features, generatorOptions); } try { @SuppressWarnings("unchecked") Class<? extends IChunkGenerator> clazz...
ClientUtils.setRenderersFrom(this, this.properties.getFullJEDProperties());
3
brk3/finch
src/com/bourke/finch/activities/ProfileActivity.java
[ "public class Constants {\n\n /* Themes and colors */\n public static final int THEME_DARK = R.style.Theme_Finch;\n public static final int THEME_LIGHT = R.style.Theme_Finch_Light;\n public static final int COLOR_FINCH_YELLOW = 0xffffbb33;\n\n /* Fonts */\n public static final String ROBOTO_REGULA...
import android.content.Context; import android.graphics.drawable.BitmapDrawable; import android.graphics.Typeface; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android...
package com.bourke.finch; public class ProfileActivity extends BaseFinchActivity { private static final String TAG = "Finch/ProfileActivity"; //TODO: add to R.strings public static final String[] CONTENT = new String[] { "Tweets", "Following", "Followers" }; public static final ...
mTwitter = FinchTwitterFactory.getInstance(mContext).getTwitter();
1
mohnishbasha/terraform-ui
src/main/java/com/glitterlabs/terraformui/service/ProjectService.java
[ "public interface CloudRepository extends CrudRepository<Cloud, Long> {\n\t@Cacheable(\"clouds\")\n\tCloud findByName(String name);\n}", "public interface ProjectRepository extends CrudRepository<Project, Long> {\n\n\t/**\n\t * Find by name.\n\t *\n\t * @param name the name\n\t * @return the list of projects\n\t ...
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.validation.constraints.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowire...
package com.glitterlabs.terraformui.service; /** * The Class CloudProjectService. */ @Service public class ProjectService { private static final Logger LOG = LoggerFactory.getLogger(ProjectService.class); /** The project dao. */ @Autowired private ProjectRepository projectdao; @Autowired private CloudRep...
public void updateStatus(final Long projectId, final ProjectStatus status) {
4
paramsen/currency-android-reactive
app/src/main/java/com/amsen/par/cewlrency/view/view/currencypicker/CurrencyPickerRecycler.java
[ "public class EventStream extends AbstractEventStream<Event> {\n public EventStream() {\n super();\n\n stream().doOnCompleted(() -> {\n if (BuildConfig.DEBUG) {\n throw new RuntimeException(\"AbstractEventStream should not be completed\");\n }\n });\n ...
import android.content.Context; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.AttributeSet; import android.view.View; import com.amsen.par.cewlrency.base.rx.event.EventStream; import com.amsen.par.cewlrency.base.util.ViewUtils; import com.amsen....
package com.amsen.par.cewlrency.view.view.currencypicker; /** * @author Pär Amsen 2016 */ public class CurrencyPickerRecycler extends LoopRecyclerViewPager { @Inject EventStream eventStream; private CurrencyAdapter adapter; private BaseActivity activity;
private List<Currency> items;
2
mokszr/ultimate-geojson
ugeojson-parser/src/test/java/org/ugeojson/parser/UltimateGeoJSONParserShould.java
[ "public abstract class GeoJSONObjectDto implements Serializable {\n \n\tprivate static final long serialVersionUID = 1L;\n\t\n\tprivate BoundingBoxDto bbox;\n\n\tpublic abstract GeoJSONObjectTypeEnum getGeoJSONObjectType();\n\t\n\tpublic BoundingBoxDto getBbox() {\n\t\treturn bbox;\n\t}\n\t\n\tpublic void setBbox(B...
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.util.Scanner; import org.junit.Test; import org.ugeojson.model.GeoJSONObjectDto; import org.ugeojson.model.feature.FeatureCo...
package org.ugeojson.parser; public class UltimateGeoJSONParserShould { @Test public void parse_sample_geojson(){ String sampleGeojson = getFile("sample.json"); GeoJSONObjectDto dto = UltimateGeoJSONParser.getInstance().parse(sampleGeojson); assertThat(dto, instanceOf(FeatureCollectionDto.class)); Fe...
assertThat(geometry2, instanceOf(PolygonDto.class));
6
jGleitz/JUnit-KIT
src/final1/subtests/ExportCommandTest.java
[ "public class Input {\n\tprivate static HashMap<String, String[]> filesMap = new HashMap<>();\n\tprivate static HashMap<String[], String> reverseFileMap = new HashMap<>();\n\n\t/**\n\t * This class is not meant to be instantiated.\n\t */\n\tprivate Input() {\n\t}\n\n\t/**\n\t * Returns a path to a file containing t...
import static org.hamcrest.CoreMatchers.anyOf; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; ...
package final1.subtests; /** * Performs calls to the {@code export} command and checks the results. */ public class ExportCommandTest extends RecommendationSubtest { public ExportCommandTest() { setAllowedSystemExitStatus(SystemExitStatus.WITH_0); } /** * Asserts correct results for the example given on...
sessionTest(runs, Input.getFile(input));
0
ustramooner/gwt-geom
src/gwt/awt/ShapeCache.java
[ "public class Polygon implements Shape, java.io.Serializable {\n\n /**\n * The total number of points. The value of <code>npoints</code>\n * represents the number of valid points in this <code>Polygon</code>\n * and might be less than the number of elements in\n * {@link #xpoints xpoints} or {@l...
import gwt.awt.Polygon; import gwt.awt.Rectangle; import gwt.awt.geom.Arc2D; import gwt.awt.geom.Ellipse2D; import gwt.awt.geom.GeneralPath; import gwt.awt.geom.Line2D; import gwt.awt.geom.RoundRectangle2D;
package gwt.awt; /** * Caches certain Shape objects for reuse in AbstractGraphics2D. This avoids * massive creation of such objects. */ class ShapeCache { /** * A cached Line2D. */ public Line2D line; /** * A cached Rectangle. */ public Rectangle rect; /** * A cached RoundRectangle2D. ...
public Arc2D arc;
2
hexabeast/HexBox
core/src/com/hexabeast/sandbox/NetworkManager.java
[ "public class HServer {\n\t\n\tstatic HServer instance;\n\tpublic Server server;\n\t\n\tpublic boolean problem = false;\n\t\n\tpublic boolean running = false;\n\t\n\tpublic VirtualMap servermap;\n\t\n\tpublic LinkedBlockingQueue<NBlockModification> bqueue;\n\t\n\tpublic static int port= 25565;\n\t\n\t//public Array...
import java.io.IOException; import com.badlogic.gdx.graphics.Color; import com.esotericsoftware.kryonet.Client; import com.esotericsoftware.kryonet.Connection; import com.esotericsoftware.kryonet.Listener; import com.hexabeast.hexboxserver.HServer; import com.hexabeast.hexboxserver.NCompressedLayer; import com.hexabeas...
package com.hexabeast.sandbox; public class NetworkManager { public static NetworkManager instance; public Client client; public HServer server; public NetworkRequestList modifications; boolean online = false; String defaultIP = "127.0.0.1"; int defaultPort = 25565; boolean mapReady = false; pu...
NPlayerUpdate npu = new NPlayerUpdate(GameScreen.player.PNJ.x, GameScreen.player.PNJ.y, GameScreen.player.PNJ.vx, GameScreen.player.PNJ.vy,GameScreen.player.PNJ.currentItem, Tools.getAbsoluteMouse().x, Tools.getAbsoluteMouse().y);
5
spccold/sailfish
sailfish-kernel/src/main/java/sailfish/remoting/protocol/RequestProtocol.java
[ "public class RequestControl {\n\t/**\n\t * response timeout or write timeout if {@code sent} is true\n\t */\n private int timeout = 2000;\n private short opcode;\n private byte serializeType;\n private byte compressType;\n //wait write success or not\n private boolean sent;\n\n /**...
import java.util.Arrays; import io.netty.buffer.ByteBuf; import io.netty.util.Recycler; import sailfish.remoting.RequestControl; import sailfish.remoting.constants.CompressType; import sailfish.remoting.constants.LangType; import sailfish.remoting.constants.RemotingConstants; import sailfish.remoting.constants.Serializ...
/** * * Copyright 2016-2016 spccold * * 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...
public void serialize(ByteBuf output) throws SailfishException {
5
adiyoss/StructED
src/com/structed/dal/OcrReader.java
[ "public class Char2Idx {\n final static public HashMap<Character, Integer> char2id = new HashMap<Character, Integer>(){\n {put('$', 0);}{put('a', 1);}{put('b', 2);}{put('c', 3);}{put('d', 4);}{put('e', 5);}\n {put('f', 6);}{put('g', 7);}{put('h', 8);}{put('i', 9);}{put('j', 10);}{put('k', 11);}\n ...
import com.structed.data.entities.Example; import com.structed.data.entities.Vector; import java.util.ArrayList; import com.structed.constants.Char2Idx; import com.structed.constants.Consts; import com.structed.data.Factory; import com.structed.data.InstancesContainer;
/* * The MIT License (MIT) * * StructED - Machine Learning Package for Structured Prediction * * Copyright (c) 2015 Yossi Adi, E-Mail: yossiadidrum@gmail.com * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), t...
public InstancesContainer readData(String path, String dataSpliter, String valueSpliter) {
3
steeleforge/ironsites
core/src/main/java/com/steeleforge/aem/ironsites/wcm/page/PageUse.java
[ "public enum WCMConstants {\n INSTANCE;\n public static final String HTTP = \"http\";\n public static final String HTTPS = \"https\";\n public static final String PROTOCOL_RELATIVE = \"//\";\n public static final String DELIMITER_QUERY = \"?\";\n public static final String DELIMITER_FRAGMENT = \"#...
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.StringUtils; import com.adobe.cq.sightly.WCMUse; import com.day.cq.tagging.Tag; import com.steeleforge.aem.ironsites.wcm.WCMConstants; import com.steeleforge.aem.ironsites.wcm.WCMUtil; import com.steeleforge.aem.ironsites.wcm.api.ApiService; impo...
/** * This is free and unencumbered software released into the public domain. * * Anyone is free to copy, modify, publish, use, compile, sell, or * distribute this software, either in source code form or as a compiled * binary, for any purpose, commercial or non-commercial, and by any * means. * * In jurisdi...
private List<Meta> meta = null;
4
beerbong/com_beerbong_zipinst
src/com/beerbong/zipinst/cloud/DropboxStorage.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 java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; import android.content.Intent; import com.beerbong.zipinst.R; import com.beerbong.zipinst.core.Core; import com.beerbong.zipinst.core.plugins.reco...
/* * Copyright 2014 ZipInstaller Project * * This file is part of ZipInstaller. * * ZipInstaller 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) a...
SuperUserPlugin suPlugin = (SuperUserPlugin) getCore().getPlugin(Core.PLUGIN_SUPERUSER);
3
xyxyLiu/PluginM
PluginManager/src/main/java/com/reginald/pluginm/core/PluginClientService.java
[ "public final class PluginInfo implements Parcelable {\n // install info\n public String packageName;\n public String apkPath;\n public String versionName;\n public int versionCode;\n public long fileSize;\n public long lastModified;\n public String dataDir;\n public String dexDir;\n p...
import java.util.HashMap; import java.util.List; import java.util.Map; import com.reginald.pluginm.IPluginClient; import com.reginald.pluginm.PluginInfo; import com.reginald.pluginm.comm.invoker.InvokeCallback; import com.reginald.pluginm.comm.invoker.InvokeCallbackWrapper; import com.reginald.pluginm.comm.invoker.Invo...
package com.reginald.pluginm.core; /** * Created by lxy on 17-9-20. */ public class PluginClientService extends IPluginClient.Stub { private static final String TAG = "PluginClientService"; private static volatile PluginClientService sInstance; private Context mContext; private PluginManager mP...
private final Map<String, IInvoker> mInvokerCacheMap = new HashMap<>();
5
prcaen/external-resources
library/src/main/java/fr/prcaen/externalresources/Downloader.java
[ "public interface Converter {\n Resources fromReader(Reader reader) throws IOException;\n}", "public class ExternalResourceException extends RuntimeException {\n\n public ExternalResourceException(String detailMessage) {\n super(detailMessage);\n }\n\n public ExternalResourceException(String message, Throw...
import android.content.Context; import android.content.res.Configuration; import android.support.annotation.NonNull; import com.squareup.okhttp.CacheControl; import com.squareup.okhttp.OkHttpClient; import com.squareup.okhttp.Request; import com.squareup.okhttp.Response; import fr.prcaen.externalresources.converter.Con...
package fr.prcaen.externalresources; public final class Downloader { private static final int CONNECT_TIMEOUT_MILLIS = 15 * 1000; // 15s private static final int READ_TIMEOUT_MILLIS = 20 * 1000; // 20s private static final int WRITE_TIMEOUT_MILLIS = 20 * 1000; // 20s @NonNull private final Context cont...
@NonNull private final Url url;
4
hiBrianLee/AndroidMvvm
mvvmapp/src/main/java/com/hibrianlee/mvvmapp/fragment/ViewModelFragment.java
[ "public abstract class MvvmApplication extends Application {\n\n private AppComponent appComponent;\n\n protected abstract AppComponent createAppComponent();\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n if (appComponent == null) {\n appComponent = createAppCo...
import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.View; import com.hibrianlee.mvvmapp.MvvmApplication; import com.hibrianlee.mvvmapp.activity.ViewModelActivity; import com.hibrianlee.mvvmapp.inject...
/* * Copyright (C) 2015 Brian Lee (@hiBrianLee) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
private ViewModel viewModel;
4
nloko/SyncMyPix
src/com/nloko/android/syncmypix/facebook/FacebookSyncService.java
[ "public class Facebook {\n\n // Strings used in the authorization flow\n public static final String REDIRECT_URI = \"fbconnect://success\";\n public static final String CANCEL_URI = \"fbconnect://cancel\";\n public static final String TOKEN = \"access_token\";\n public static final String EXPIRES = \...
import com.nloko.android.Log; import com.nloko.android.syncmypix.MainActivity; import com.nloko.android.syncmypix.SyncService; import com.nloko.android.syncmypix.SettingsActivity; import com.nloko.android.syncmypix.SocialNetworkUser; import com.nloko.android.syncmypix.R; import com.nloko.android.syncmypix.SyncServiceLi...
// // FacebookSyncService.java is part of SyncMyPix // // Authors: // Neil Loknath <neil.loknath@gmail.com> // // Copyright (c) 2009 Neil Loknath // // SyncMyPix is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // th...
SyncServiceListener listener = service.mListener;
7
vector-im/riot-automated-tests
VectorMobileTests/src/test/java/mobilestests_android/RiotNoConnectionTests.java
[ "public class RiotLoginAndRegisterPageObjects extends TestUtilities{\n\tprivate AppiumDriver<MobileElement> driver;\n\n\tpublic RiotLoginAndRegisterPageObjects(AppiumDriver<MobileElement> myDriver) {\n\t\tdriver= myDriver;\n\t\tPageFactory.initElements(new AppiumFieldDecorator(driver), this);\n\t\ttry {\n\t\t\tAsse...
import org.testng.Assert; import org.testng.annotations.BeforeGroups; import org.testng.annotations.Listeners; import org.testng.annotations.Test; import io.appium.java_client.MobileElement; import io.appium.java_client.android.AndroidDriver; import io.appium.java_client.android.Connection; import pom_android.RiotLogin...
package mobilestests_android; @Listeners({ ScreenshotUtility.class }) public class RiotNoConnectionTests extends RiotParentTest{ /** * Cut the wifi, launches Riot and asserts that the login button is disabled. </br> * Bring back the wifi and verifies that the login button become enabled. * @throws Interrupt...
loginPage.emailOrUserNameEditText.setValue(Constant.DEFAULT_USERNAME);
3
lovejjfg/MyBlogDemo
app/src/main/java/com/lovejjfg/blogdemo/activity/FangshiActivity.java
[ "public class TouchHelperCallback extends ItemTouchHelper.Callback {\n// int swipeFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;\n// return makeMovementFlags(0, swipeFlags);\n @Override\n public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {\n r...
import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.helpe...
package com.lovejjfg.blogdemo.activity; public class FangshiActivity extends AppCompatActivity implements OnShowMoreClickListener { private RecyclerView recyclerView; private ArrayList<Item> items; private ArrayList<Item> moreItems = new ArrayList<>(); boolean hasMore = false; private Fangshi...
return new MoreFangshiHolder(view);
2
kwon37xi/hibernate4-memcached
hibernate4-memcached-core/src/main/java/kr/pe/kwonnam/hibernate4memcached/regions/NaturalIdMemcachedRegion.java
[ "public class CacheNamespace implements Serializable {\n /**\n * name of region\n */\n private String name;\n\n /**\n * if this value is true, the memcached adapter should implement namespace pattern\n * or ignore namespace pattern.\n * <p/>\n * see <a href=\"https://code.google.com...
import kr.pe.kwonnam.hibernate4memcached.memcached.CacheNamespace; import kr.pe.kwonnam.hibernate4memcached.memcached.MemcachedAdapter; import kr.pe.kwonnam.hibernate4memcached.strategies.NonstrictReadWriteNaturalIdRegionAccessStrategy; import kr.pe.kwonnam.hibernate4memcached.strategies.ReadOnlyNaturalIdRegionAccessSt...
package kr.pe.kwonnam.hibernate4memcached.regions; /** * @author KwonNam Son (kwon37xi@gmail.com) */ public class NaturalIdMemcachedRegion extends TransactionalDataMemcachedRegion implements NaturalIdRegion { public NaturalIdMemcachedRegion(String regionName, OverridableReadOnlyProperties properties, ...
return new ReadOnlyNaturalIdRegionAccessStrategy(this);
3
lisnstatic/live_master
app/src/main/java/com/googlecode/mp4parser/authoring/adaptivestreaming/FlatPackageWriterImpl.java
[ "public class MovieFragmentBox extends AbstractContainerBox {\n public static final String TYPE = \"moof\";\n\n public MovieFragmentBox() {\n super(TYPE);\n }\n\n\n public List<Long> getSyncSamples(SampleDependencyTypeBox sdtp) {\n List<Long> result = new ArrayList<Long>();\n\n fina...
import com.coremedia.iso.IsoFile; import com.coremedia.iso.boxes.Box; import com.coremedia.iso.boxes.SoundMediaHeaderBox; import com.coremedia.iso.boxes.VideoMediaHeaderBox; import com.coremedia.iso.boxes.fragment.MovieFragmentBox; import com.googlecode.mp4parser.authoring.Movie; import com.googlecode.mp4parser.authori...
/* * Copyright 2012 Sebastian Annies, Hamburg * * 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 o...
for (Track track : movieWithAdjustedTimescale.getTracks()) {
1
takezoe/xlsbeans
src/main/java/com/github/takezoe/xlsbeans/XLSBeans.java
[ "public interface FieldProcessor {\r\n\r\n public void doProcess(WSheet wSheet, Object obj, Method setter, Annotation ann, AnnotationReader reader,\r\n XLSBeansConfig config, List<NeedPostProcess> needPostProcess) throws Exception;\r\n\r\n public void doProcess(WSheet wSheet, Object obj, Fi...
import java.io.InputStream; import java.lang.annotation.Annotation; import java.lang.reflect.Array; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; import com....
package com.github.takezoe.xlsbeans; /** * This is the entry point of XLSBeans. * * @author Naoki Takezoe */ public class XLSBeans { private XLSBeansConfig config = new XLSBeansConfig(); /** * Constructor. */ public XLSBeans() { super(); } public void setConfig(XLSBeans...
private <P> P loadSheet(Class<P> clazz, WSheet wSheet, AnnotationReader reader) throws Exception {
6
cookpad/puree-android
puree/src/androidTest/java/com/cookpad/puree/outputs/PureeBufferedOutputTest.java
[ "@ParametersAreNonnullByDefault\npublic class PureeConfiguration {\n\n private final Context context;\n\n private final PureeSerializer pureeSerializer;\n\n private final Map<Class<?>, List<PureeOutput>> sourceOutputMap;\n\n private final PureeStorage storage;\n\n private final ScheduledExecutorServi...
import com.cookpad.puree.PureeConfiguration; import com.cookpad.puree.PureeFilter; import com.cookpad.puree.PureeLogger; import com.cookpad.puree.PureeSerializer; import com.cookpad.puree.async.AsyncResult; import com.cookpad.puree.storage.PureeSQLiteStorage; import com.cookpad.puree.storage.PureeStorage; import com.co...
Iterator<Entry> iterator = entries.iterator(); while (iterator.hasNext() && entries.size() > maxRecords) { iterator.remove(); } } @Override public void clear() { entries.clear(); } @Override public boolean ...
public static class DiscardFilter implements PureeFilter {
1
EvidentSolutions/dalesbred
dalesbred/src/main/java/org/dalesbred/internal/result/InstantiatorRowMapper.java
[ "@FunctionalInterface\npublic interface Instantiator<T> {\n @Nullable\n T instantiate(@NotNull InstantiatorArguments arguments);\n}", "public final class InstantiatorArguments {\n\n private final @NotNull NamedTypeList types;\n\n private final @NotNull List<?> values;\n\n public InstantiatorArgumen...
import java.sql.ResultSet; import java.sql.SQLException; import static java.util.Objects.requireNonNull; import org.dalesbred.internal.instantiation.Instantiator; import org.dalesbred.internal.instantiation.InstantiatorArguments; import org.dalesbred.internal.instantiation.InstantiatorProvider; import org.dalesbred.int...
/* * Copyright (c) 2017 Evident Solutions Oy * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge...
private NamedTypeList types;
3
ceefour/webdav-servlet
src/main/java/net/sf/webdav/methods/DoMove.java
[ "public interface ITransaction {\n\n Principal getPrincipal();\n\n}", "public class WebdavStatus {\n\n // ----------------------------------------------------- Instance Variables\n\n /**\n * This Hashtable contains the mapping of HTTP and WebDAV status codes to\n * descriptive text. This is a sta...
import java.io.IOException; import java.util.Hashtable; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.webdav.ITransaction; import net.sf.webdav.WebdavStatus; import net.sf.webdav.exceptions.AccessDeniedException; import net.sf.webdav.exceptions.LockFailedExce...
/* * Copyright 1999,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
public void execute(ITransaction transaction, HttpServletRequest req,
0
kantega/kson
src/test/java/org/kantega/kson/test/ReadWriteTest.java
[ "public class JsonResult<A> {\n\n final Validation<String, A> validation;\n\n private JsonResult(Validation<String, A> validation) {\n this.validation = validation;\n }\n\n public static <A> JsonResult<A> fail(String msg) {\n return new JsonResult<>(Validation.fail(msg));\n }\n\n pub...
import org.junit.Assert; import org.junit.Test; import org.kantega.kson.JsonResult; import org.kantega.kson.json.JsonObject; import org.kantega.kson.json.JsonValue; import org.kantega.kson.parser.JsonParser; import static org.kantega.kson.json.JsonValues.jBool;
package org.kantega.kson.test; public class ReadWriteTest { @Test public void parseFalse() { String json = "{\"flag\":false}"; JsonResult<JsonValue> value = JsonParser.parse(json); JsonObject jObject = value.orThrow().asObject().orThrow();
Assert.assertTrue(jObject.get("flag").some().equals(jBool(false)));
4
njustesen/hero-aicademy
src/ai/RandomHeuristicAI.java
[ "public class GameState {\n\t\n\tpublic static int TURN_LIMIT = 100;\n\tpublic static boolean RANDOMNESS = false;\n\tpublic static int STARTING_AP = 3;\n\tpublic static int ACTION_POINTS = 5;\n\t\n\tprivate static final int ASSAULT_BONUS = 300;\n\tprivate static final double INFERNO_DAMAGE = 350;\n\tprivate static ...
import game.GameState; import java.util.ArrayList; import java.util.Collections; import java.util.List; import model.Card; import model.Position; import action.Action; import action.SingletonAction; import ai.util.ActionComparator; import ai.util.ComplexActionComparator;
package ai; public class RandomHeuristicAI implements AI { private static final double PROP_HAND = 0.25; private final List<Integer> heightOrder; private final List<Integer> widthOrder; private final List<Integer> handOrder; private final List<Action> actions; private final List<Position> positions; private...
private final ActionComparator comparator;
5
vsite-hr/hive
src/main/java/hr/vsite/hive/services/AbstractService.java
[ "public class HiveConfiguration extends XMLConfiguration {\n\n\tpublic static HiveConfiguration get() {\n\t\tif (instance == null)\n\t\t\tinstance = new HiveConfiguration();\n\t\treturn instance;\n\t}\n\t\n\tprivate HiveConfiguration() {\n \t\n\t\tsuper();\n \n\t\ttry {\n\t\t\tsetThrowExceptionOnMissing(t...
import hr.vsite.hive.HiveConfiguration; import hr.vsite.hive.HiveDestroyEvent; import hr.vsite.hive.HiveInitEvent; import hr.vsite.hive.HiveStartEvent; import hr.vsite.hive.HiveStopEvent;
package hr.vsite.hive.services; /** * Default Service implementation. Extend and provide concrete implementations. * Listest on event bus and responda on application's stae events. * * @see {@link Service}, {@link HiveInitEvent}, {@link HiveStartEvent}, {@link HiveStopEvent}, {@link HiveDestroyEvent} */ public...
this.enabled = HiveConfiguration.get().getBoolean("hive.services." + key + ".Enabled");
0
treeleafj/xDoc
xDoc-core/src/main/java/org/treeleafj/xdoc/resolver/javaparser/converter/SeeTagConverter.java
[ "@Data\npublic class FieldInfo {\n\n private String name;\n\n private Class<?> type;\n\n private String simpleTypeName;\n\n private String comment;\n\n /**\n * 是否必填,默认false\n */\n private boolean require;\n\n private List<FieldInfo> fieldInfos;\n\n}", "@Data\npublic class ObjectInfo {...
import com.github.javaparser.JavaParser; import com.github.javaparser.ParseResult; import com.github.javaparser.ast.CompilationUnit; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.treeleafj.xdoc.model.FieldInfo; import org.treeleafj.xdoc.model.ObjectInfo...
package org.treeleafj.xdoc.resolver.javaparser.converter; /** * 针对@see的转换器 * * @author leaf * @date 2017/3/4 */ public class SeeTagConverter extends DefaultJavaParserTagConverterImpl { private Logger log = LoggerFactory.getLogger(this.getClass()); private JavaParser javaParser = new JavaParser(); ...
return new SeeTagImpl(docTag.getTagName(), objectInfo);
4
davidmoten/logan
src/main/java/com/github/davidmoten/logan/servlet/ServletUtil.java
[ "public interface Data {\n\n Buckets execute(BucketQuery query);\n\n Stream<String> getLogs(long startTime, long finishTime);\n\n Stream<LogEntry> find(long startTime, long finishTime);\n\n /**\n * Adds a {@link LogEntry} to the data.\n * \n * @param entry entry\n * @return this this\n ...
import java.io.File; import javax.servlet.http.HttpServletRequest; import com.github.davidmoten.logan.Data; import com.github.davidmoten.logan.DataMemory; import com.github.davidmoten.logan.DataPersistedBPlusTree; import com.github.davidmoten.logan.DataPersistedH2; import com.github.davidmoten.logan.Util; import com.gi...
package com.github.davidmoten.logan.servlet; public class ServletUtil { private static final int JDBC_BATCH_SIZE = 100; public static double getMandatoryDouble(HttpServletRequest req, String name) { if (req.getParameter(name) == null) throw new RuntimeException("parameter " + name + " ...
public static Data getData(Configuration configuration) {
0
songbin/frc
FRCCLIENT/src/main/java/com/frc/thrift/client/frc/FrcClient.java
[ "@SuppressWarnings({\"cast\", \"rawtypes\", \"serial\", \"unchecked\"})\n@Generated(value = \"Autogenerated by Thrift Compiler (0.9.3)\", date = \"2017-01-05\")\npublic class ResBool implements org.apache.thrift.TBase<ResBool, ResBool._Fields>, java.io.Serializable, Cloneable, Comparable<ResBool> {\n private stati...
import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; import com.frc.thrift.datatype.ResBool; import com.frc.thrift.datatype.ResDouble; import com.frc.thrift.datatype.ResListStr; import com.frc.thrift.datatype.ResLong; import com.frc.thrift.datatype...
package com.frc.thrift.client.frc; public class FrcClient { private static String caller = "FRC"; private FrcPool pool = null; private String getClassName() { return "FrcClient"; } public FrcClient(String host, int port, int timeout) { this.pool = new FrcPool(host, port...
FRCLogger.getInstance().warn(logIndex, flag, "key:{}", e, key);
7
mutualmobile/Barricade
barricade/src/main/java/com/mutualmobile/barricade/Barricade.java
[ "public class BarricadeActivity extends AppCompatActivity\n implements BarricadeEndpointsRVAdapter.EndpointClickedListener, BarricadeResponsesRVAdapter.EndpointResponseClickedListener {\n\n private HashMap<String, BarricadeResponseSet> barricadeConfig;\n\n private ActionBar actionBar;\n private RecyclerView e...
import android.app.Application; import android.content.Context; import android.content.Intent; import android.os.Build; import com.mutualmobile.barricade.activity.BarricadeActivity; import com.mutualmobile.barricade.response.BarricadeResponse; import com.mutualmobile.barricade.response.BarricadeResponseSet; import com....
package com.mutualmobile.barricade; /** * Local server for your application. * * You should typically initialize it once, preferably in your Application class using Builder * class. */ public class Barricade { static final String TAG = "Barricade"; private static final String ROOT_DIRECTORY = "barricade"; ...
public HashMap<String, BarricadeResponseSet> getConfig() {
2
lijizhi/studydemo
app/src/main/java/com/lijizhi/studydemo/fragment/PersonFragment.java
[ "public class MyUser extends BmobUser{\n\n private int age;\n private boolean sex;\n private String desc;\n\n public int getAge() {\n return age;\n }\n\n public void setAge(int age) {\n this.age = age;\n }\n\n public boolean isSex() {\n return sex;\n }\n\n public v...
import android.content.Intent; import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; import android.os.Environment; import android.provider.MediaStore; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.text.TextUtils; import android.view.Gravi...
break; case R.id.btn_update_ok: //1.拿到输入框的值 String username = et_username.getText().toString(); String age = et_age.getText().toString(); String sex = et_sex.getText().toString(); Stri...
L.e("uri == null");
4
recommenders/rival
rival-split/src/main/java/net/recommenders/rival/split/parser/LastfmCelma360KParser.java
[ "public class DataModelFactory {\n\n public static <U, I> DataModelIF<U, I> getDefaultModel() {\n return getSimpleModel();\n }\n\n public static <U, I> TemporalDataModelIF<U, I> getDefaultTemporalModel() {\n return getSimpleTemporalModel();\n }\n\n public static <U, I> DataModelIF<U, I>...
import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import net.recommenders.rival.core.DataModelFactory; import net.recommenders.rival.core.DataModelIF; import net.recommenders.rival.core....
/* * Copyright 2015 recommenders.net. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
public TemporalDataModelIF<Long, Long> parseTemporalData(File f) throws IOException {
5
lemire/JavaFastPFOR
src/main/java/me/lemire/integercompression/benchmarktools/BenchmarkOffsettedSeries.java
[ "public final class BinaryPacking implements IntegerCODEC, SkippableIntegerCODEC {\n final static int BLOCK_SIZE = 32;\n \n @Override\n public void compress(int[] in, IntWrapper inpos, int inlength,\n int[] out, IntWrapper outpos) {\n inlength = Util.greatestMultipl...
import java.io.File; import java.io.PrintWriter; import java.util.Arrays; import java.util.Random; import me.lemire.integercompression.BinaryPacking; import me.lemire.integercompression.DeltaZigzagBinaryPacking; import me.lemire.integercompression.DeltaZigzagVariableByte; import me.lemire.integercompression.FastPFOR; i...
/** * This code is released under the * Apache License Version 2.0 http://www.apache.org/licenses/. */ package me.lemire.integercompression.benchmarktools; /** * Simple synthetic benchmark * */ public class BenchmarkOffsettedSeries { private static final int DEFAULT_MEAN = 1 << 20; private stat...
new FastPFOR128(), new FastPFOR()};
3
nowucca/SimpleAffableBean
src/main/java/business/order/DefaultCustomerOrderService.java
[ "public final class JdbcUtils {\n\n private JdbcUtils() {\n }\n\n static final String JDBC_SIMPLEAFFABLEBEAN = \"jdbc/simpleaffablebean\";\n\n private static DataSource dataSource;\n\n public static Connection getConnection() {\n if (dataSource == null) {\n dataSource = getDataSour...
import business.JdbcUtils; import business.SimpleAffableDbException; import business.ValidationException; import business.cart.ShoppingCart; import business.customer.Customer; import business.customer.CustomerForm; import business.customer.CustomerService; import business.product.Product; import business.product.Produc...
/** * BSD 3-Clause License * * Copyright (C) 2018 Steven Atkinson <steven@nowucca.com> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the...
public long placeOrder(CustomerForm customerForm, ShoppingCart cart) throws ValidationException {
2
jdbc-json/jdbc-cb
src/main/java/com/couchbase/jdbc/CBPreparedStatement.java
[ "public interface Protocol\n{\n void connect() throws Exception;\n void close() throws Exception;\n\n CBResultSet query(CBStatement statement, String sql) throws SQLException;\n int executeUpdate(CBStatement statement, String sql) throws SQLException;\n boolean execute(CBStatement statement, String s...
import com.couchbase.jdbc.connect.Protocol; import com.couchbase.jdbc.core.CouchResponse; import com.couchbase.jdbc.util.SqlParser; import com.couchbase.jdbc.util.TimestampUtils; import com.couchbase.json.SQLJSON; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; import java.math.BigDecimal; im...
/* * // Copyright (c) 2015 Couchbase, 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 la...
TimestampUtils timestampUtils = new TimestampUtils();
3
lwfwind/smart-api-framework
src/com/qa/framework/plugin/Entry.java
[ "public class TestCase {\n private String name;\n private String desc;\n private List<Setup> setupList;\n private Map<String, Setup> setupMap;\n private List<Param> params; //包含的数据\n private ExtraCheck extraCheck; //自定义的检查方法\n private int sendTime = 1;\n private boolean storeCookie;\n p...
import com.library.common.IOHelper; import com.qa.framework.bean.TestCase; import com.qa.framework.bean.TestSuite; import com.qa.framework.core.ParamValueProcessor; import com.qa.framework.core.TestSuiteConvertor; import com.qa.framework.library.httpclient.HttpMethod; import com.qa.framework.mock.IMockServer; import co...
package com.qa.framework.plugin; public class Entry { private static Logger logger = Logger.getLogger(Entry.class); private static IMockServer mockServer = null; public static void before() throws IllegalAccessException, InstantiationException {
Class<?> clazz = findImplementClass(IMockServer.class);
7
danielflower/app-runner
src/test/java/e2e/Python3Test.java
[ "public class App {\n public static final Logger log = LoggerFactory.getLogger(App.class);\n\n private final Config config;\n private WebServer webServer;\n private AppEstate estate;\n private final AtomicBoolean startupComplete = new AtomicBoolean(false);\n private BackupService backupService;\n\...
import com.danielflower.apprunner.App; import com.danielflower.apprunner.Config; import com.danielflower.apprunner.mgmt.AppManager; import com.danielflower.apprunner.runners.PythonRunnerTest; import org.junit.After; import org.junit.Before; import org.junit.Test; import scaffolding.AppRepo; import scaffolding.RestClien...
package e2e; public class Python3Test { private final String port = String.valueOf(AppManager.getAFreePort()); private final String appRunnerUrl = "http://localhost:" + port; private final RestClient restClient = RestClient.create(appRunnerUrl); private final String appId = "python3";
private final AppRepo appRepo = AppRepo.create(appId);
4
Zerthick/PlayerShopsRPG
src/main/java/io/github/zerthick/playershopsrpg/cmd/cmdexecutors/shop/ShopCreateExecutor.java
[ "@Plugin(id = \"playershopsrpg\",\n name = \"PlayerShopsRPG\",\n description = \"A region-based player shop plugin.\",\n authors = {\n \"Zerthick\"\n }\n)\npublic class PlayerShopsRPG {\n\n private ShopManager shopManager;\n private EconManager econManager;\n priv...
import org.spongepowered.api.command.CommandSource; import org.spongepowered.api.command.args.CommandContext; import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.chat.ChatTypes; import org.spongepowered.api.text.format.TextColors; import ja...
/* * Copyright (C) 2016 Zerthick * * This file is part of PlayerShopsRPG. * * PlayerShopsRPG is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any ...
Optional<RegionBuffer> regionBufferOptional = plugin.getRegionSelectBuffer().getBuffer(player.getUniqueId());
4
marcelothebuilder/webpedidos
src/main/java/com/github/marcelothebuilder/webpedidos/controller/CidadeEstadoBean.java
[ "@Entity\n@Table(name=\"cidade\")\npublic class Cidade implements Serializable {\n\tprivate static final long serialVersionUID = 1L;\n\tprivate Integer codigo;\n\tprivate String nome;\n\tprivate Estado estado;\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\tpublic Integer getCodigo() {\n\t\tretur...
import java.io.Serializable; import java.util.ArrayList; import java.util.List; import java.util.Set; import javax.faces.view.ViewScoped; import javax.inject.Inject; import javax.inject.Named; import com.github.marcelothebuilder.webpedidos.model.endereco.Cidade; import com.github.marcelothebuilder.webpedidos.model.ende...
/** * */ package com.github.marcelothebuilder.webpedidos.controller; /** * @author Marcelo Paixao Resende * */ @Named @ViewScoped public class CidadeEstadoBean implements Serializable { private static final long serialVersionUID = 1L; private @Inject Estados estados;
private @Inject Cidades cidades;
2
EndlessCodeGroup/RPGInventory
src/main/java/ru/endlesscode/rpginventory/inventory/InventoryLocker.java
[ "public class RPGInventory extends PluginLifecycle {\n private static RPGInventory instance;\n\n private Permission perms;\n private Economy economy;\n\n private BukkitLevelSystem.Provider levelSystemProvider;\n private BukkitClassSystem.Provider classSystemProvider;\n\n private FileLanguage langu...
import net.milkbowl.vault.economy.EconomyResponse; import org.bukkit.GameMode; import org.bukkit.OfflinePlayer; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.jetbrains.annotations.Cont...
/* * This file is part of RPGInventory. * Copyright (C) 2015-2017 Osip Fatkullin * * RPGInventory 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) a...
if (ItemUtils.isEmpty(InventoryLocker.LOCKED_SLOT) || ItemUtils.isEmpty(InventoryLocker.BUYABLE_SLOT)) {
5
teco-kit/Android-Context-Framework
src/edu/teco/context/recognition/WekaManager.java
[ "public class FrameworkConfiguration implements IProbeKeys, IFeatureKeys, ILocationKeys {\r\n\t\r\n\t\r\n\tprivate final static FrameworkConfiguration INSTANCE = new FrameworkConfiguration();\r\n\r\n\t/** Tag string for debug logs */\r\n\tprivate static final String TAG = \"FrameworkConfiguration\";\r\n\t\r\n\tpriv...
import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map.Entry; import weka.classifiers.Evaluation; import weka.classifiers.bayes.NaiveBayes...
try { // classifier.setDebug(true); classifier.buildClassifier(trainingData); // if too large String Log will not show everything // if (FrameworkContext.INFO) Log.i(TAG, "Classifier description: " + classifier.toString()); if (FrameworkContext.INFO) Log.i(TAG, "Classifier Global Info: " + clas...
if (DataLogger.isExternalStorageAvailable()) {
3
mauriciogracia/DGuitarSoftware
DGuitar/src/dguitar/gui/unused/BarStandard.java
[ "public class GPBeat {\n /**\n * Whether this beat is empty.\n */\n private boolean _emptyBeat;\n\n /**\n * Whether this beat is a rest.\n */\n private boolean _restBeat;\n\n /**\n * This beat's duration.\n * @see GPDuration\n */\n private GPDuration _duration;\n\n /...
import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.util.Vector; import dguitar.codecs.guitarPro.GPBeat; import dguitar.codecs.guitarPro.GPEffectsOnNote; import dguitar.c...
newPRelative = new Point() ; newP = snap(p,newPRelative) ; if( (avoidNoteClipping) && (newP.y <= NoteComponent.H) && (pAnt != null) ) { //Use last position newP = pAnt ; } n = findNote(newP) ; if(n != null){ Notes.remove(n) ; ...
public void paintRhythmHL(Graphics g, int x, int lowest, int n, GPBeat prev) {
0
ehsane/rainbownlp
src/main/java/rainbownlp/core/RainbowEngine.java
[ "public interface ICrossfoldValidator {\n\tpublic IEvaluationResult crossValidation(List<MLExample> examples, int folds) throws Exception;\n\tpublic LearnerEngine getLearnerEngine();\n}", "public interface IEvaluationResult {\n\tpublic void printResult();\n\tpublic Double getIntegratedMetric();\n}", "public cla...
import java.util.List; import rainbownlp.analyzer.evaluation.ICrossfoldValidator; import rainbownlp.analyzer.evaluation.IEvaluationResult; import rainbownlp.analyzer.evaluation.classification.Evaluator; import rainbownlp.machinelearning.IMLExampleBuilder; import rainbownlp.machinelearning.LearnerEngine; import rainbown...
package rainbownlp.core; /** * This includes several sugar methods to make using RNLP easier * @author eemadzadeh * */ public class RainbowEngine { List<Artifact> documentsInPipe = null; List<MLExample> trainExamplesInPipe = null; List<MLExample> testExamplesInPipe = null; public static enum DatasetType{ ...
public RainbowEngine train(IMLExampleBuilder exampleBuilder, LearnerEngine learner) throws Exception{
4
esbtools/esb-message-admin
common/src/test/java/org/esbtools/message/admin/common/ErrorServiceTest.java
[ "@Entity\n@Table(name=\"ESB_MESSAGE_SENSITIVE_INFO\")\npublic class EsbMessageSensitiveInfoEntity implements Serializable {\n\n private static final long serialVersionUID = 357984147079041238L;\n\n @Id\n @GeneratedValue(strategy=GenerationType.IDENTITY)\n private Long id;\n\n @Column(name=\"value\")\...
import java.io.IOException; import java.util.Arrays; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.persistence.Query; import org.esbtools.message.admin.common.orm.EsbMessageSensitiveInfoEntity; import org.esbtools.m...
/* Copyright 2015 esbtools Contributors and/or its affiliates. This file is part of esbtools. 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 optio...
Criterion[] c1 = {new Criterion(SearchField.sourceSystem, "SRC")};
6
struberg/juel
modules/impl/src/main/java/de/odysseus/el/tree/impl/Parser.java
[ "public enum Symbol {\r\n\tEOF,\r\n\tPLUS(\"'+'\"), MINUS(\"'-'\"),\r\n\tMUL(\"'*'\"), DIV(\"'/'|'div'\"), MOD(\"'%'|'mod'\"),\r\n\tLPAREN(\"'('\"), RPAREN(\"')'\"),\r\n\tIDENTIFIER,\r\n\tNOT(\"'!'|'not'\"), AND(\"'&&'|'and'\"), OR(\"'||'|'or'\"),\r\n\tEMPTY(\"'empty'\"), INSTANCEOF(\"'instanceof'\"),\r\n\tINTEGER,...
import de.odysseus.el.tree.impl.Scanner.ScanException; import de.odysseus.el.tree.impl.Scanner.Symbol; import de.odysseus.el.tree.impl.Scanner.Token; import de.odysseus.el.tree.impl.ast.*; import static de.odysseus.el.tree.impl.Scanner.Symbol.*; import static de.odysseus.el.tree.impl.Builder.Feature.*; import jav...
/* * Copyright 2006-2009 Odysseus Software GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
super(LocalMessages.get("error.parse", position, encountered, expected));
2
serialx/kkma
src/org/snu/ids/ha/sp/Parser.java
[ "public class POSTag\n{\n\t/**\n\t * 총 가능한 태그의 수가 63개인데, BOW, EOS까지 정의되었으므로 더이상의 태그는 정의 불가능함.\n\t * 첫번째 필드는 복합어 여부를 확인하기 위한 flag를 위해서 남겨 두어야 함.\n\t * @since\t2009. 10. 15\n\t * @author\ttherocks\n\t */\n\tprivate static final String[] TAG_ARR = {\n\t\t\t// 체언\n\t\t\t\"NNG\", \t// 01 일반 명사\n\t\t\t\"NNP\", \t// 02 고유...
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.Iterator; import java.util.List; import org.snu.ids.ha.constants.POSTag; import org.snu.ids.ha.ma.Eojeol; import org.snu.ids.ha.ma.MExpression; import org.snu.ids.ha.ma.MorphemeAnalyzer; import org.snu.ids.ha.ma.Sent...
package org.snu.ids.ha.sp; public class Parser { private List<ParseGrammar> grammarList = null; private static Parser parser = null; public static Parser getInstance() { if( parser == null ) parser = new Parser(); return parser; } public Parser() { initGrammars(); } protected void initGramm...
public ParseTree parse(Sentence sentence)
4
matthewcmead/sleet
src/main/java/sleet/generators/reservedinstance/ZooKeeperReservedInstanceIdGenerator.java
[ "public class SleetException extends Exception {\n\n /**\n * generated by eclipse\n */\n private static final long serialVersionUID = -404982431470350032L;\n\n public SleetException(String message, Throwable cause) {\n super(message, cause);\n }\n\n public SleetException(String message) {\n super(mes...
import sleet.id.LongId; import sleet.id.LongIdType; import sleet.state.IdState; import sleet.utils.zookeeper.InstanceIdManagerForwardReservationZooKeeper; import sleet.utils.zookeeper.ZooKeeperClient; import java.io.IOException; import java.util.List; import java.util.Properties; import org.apache.zookeeper.WatchedEven...
/** * 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...
private LongId id = null;
4
SW-Team/java-TelegramBot
src/milk/telegram/method/setter/GameScoreSetter.java
[ "public abstract class SendInstance extends JSONObject{\n\n protected final TelegramBot bot;\n\n public SendInstance(TelegramBot bot){\n this.bot = bot;\n }\n\n public abstract Object send();\n\n public void asyncSend(){\n new Thread(this::send).start();\n }\n\n}", "public abstract...
import milk.telegram.method.SendInstance; import milk.telegram.method.update.Editor; import milk.telegram.type.user.User; import milk.telegram.type.Usernamed; import milk.telegram.bot.TelegramBot; import milk.telegram.type.Identifier; import milk.telegram.type.chat.Channel; import milk.telegram.type.message.Message; im...
package milk.telegram.method.setter; public class GameScoreSetter extends Editor{ public GameScoreSetter(TelegramBot bot){ super(bot); } public long getScore(){ return optLong("score"); } public int getUserId(){ return optInt("user_id"); } public String getChat...
chat_id = chat_id instanceof Channel ? "@" + ((Usernamed) chat_id).getUsername() : ((Identifier) chat_id).getId();
3
flyou/Girls
app/src/main/java/com/flyou/girls/ui/mainImageList/widget/fragment/SWMTFragment.java
[ "public class Constant {\n public static final String BASE_URL=\"http://m.xxxiao.com\";\n public static final String NEW=\"/page/\";\n public static final String XINGGAN=\"/cat/xinggan/page/\";\n public static final String SHAONV=\"/cat/shaonv/page/\";\n public static final String MRXT=\"/cat/...
import android.content.Intent; import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityOptionsCompat; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import and...
package com.flyou.girls.ui.mainImageList.widget.fragment; /** * ============================================================ * 项目名称:Girls * 包名称:com.flyou.girls.ui.ImageList.widget.fragment * 文件名:NewFragment * 类描述: * 创建人:flyou * 邮箱:fangjaylong@gmail.com * 创建时间:2016/4/20 9:11 * 修改备注: * 版本:@version V1.0 *...
private CommonAdapter mAdapter;
2
fracpete/collective-classification-weka-package
src/main/java/weka/classifiers/collective/meta/SimpleCollective.java
[ "public abstract class CollectiveRandomizableSingleClassifierEnhancer\n extends RandomizableSingleClassifierEnhancer\n implements CollectiveClassifier, AdditionalMeasureProducer {\n \n /** whether the classifier was already built\n * (<code>buildClassifier(Instances)</code> only stores the training set.\n *...
import java.util.Enumeration; import java.util.Vector; import weka.classifiers.collective.CollectiveRandomizableSingleClassifierEnhancer; import weka.classifiers.collective.RestartableCollectiveClassifier; import weka.classifiers.collective.util.CollectiveHelper; import weka.classifiers.collective.util.CollectiveInstan...
// class result.enable(Capability.BINARY_CLASS); result.enable(Capability.MISSING_CLASS_VALUES); return result; } /** * Returns the value of the named measure * @param measureName the name of the measure to query for its value * @return the value of the named measure * @throws Il...
+ CollectiveHelper.getTempPath() + ").";
2
MKLab-ITI/easIE
src/main/java/certh/iti/mklab/easie/executor/generators/StaticWrapperGenerator.java
[ "public final class Configuration {\r\n\r\n public URL url;\r\n\r\n public HashSet<String> group_of_urls;\r\n\r\n public String source_name;\r\n\r\n public String entity_name;\r\n\r\n public String table_selector;\r\n\r\n public ArrayList<ScrapableField> metrics;\r\n\r\n public ArrayList<Scrapa...
import certh.iti.mklab.easie.configuration.Configuration; import certh.iti.mklab.easie.exception.PaginationException; import certh.iti.mklab.easie.extractors.staticpages.GroupHTMLExtractor; import certh.iti.mklab.easie.extractors.staticpages.PaginationIterator; import certh.iti.mklab.easie.extractors.staticpages.St...
/* * Copyright 2016 vasgat. * * 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...
GroupHTMLExtractor wrapper = new GroupHTMLExtractor(
2
lingochamp/FileDownloader
library/src/main/java/com/liulishuo/filedownloader/download/FetchDataTask.java
[ "@SuppressWarnings(\"EmptyMethod\")\npublic interface FileDownloadConnection {\n int NO_RESPONSE_CODE = 0;\n int RESPONSE_CODE_FROM_OFFSET = 1;\n\n /**\n * Sets the header named {@code name} to {@code value}.\n * <p>\n * The capacity of this method is similar to the\n * {@link URLConnection...
import android.os.SystemClock; import com.liulishuo.filedownloader.connection.FileDownloadConnection; import com.liulishuo.filedownloader.exception.FileDownloadGiveUpRetryException; import com.liulishuo.filedownloader.exception.FileDownloadNetworkPolicyException; import com.liulishuo.filedownloader.database.FileDownloa...
/* * Copyright (c) 2015 LingoChamp Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
if (contentLength == TOTAL_VALUE_IN_CHUNKED_RESOURCE) {
7
MarWoes/viper
src/main/java/de/imi/marw/viper/api/routes/SnapshotRoutes.java
[ "public class ViperServerConfig {\n\n private String analysisFile = \"/tmp/analysis/file\";\n private int viperPort = 8090;\n private int igvPort = 9090;\n private char csvDelimiter = ';';\n private String collectionDelimiter = \",\";\n private boolean enableGrouping = true;\n private int break...
import static spark.Spark.get; import static spark.Spark.post; import com.google.gson.Gson; import de.imi.marw.viper.api.ViperServerConfig; import de.imi.marw.viper.util.Util; import de.imi.marw.viper.variants.VariantTableCluster; import de.imi.marw.viper.variants.table.VariantTable; import de.imi.marw.viper.visualizat...
/* Copyright (c) 2017 Marius Wöste * * This file is part of VIPER. * * VIPER 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. * ...
String sample = relatedCall.get(VariantTable.SAMPLE_COLUMN_NAME).toString();
3
ferstl/pedantic-pom-enforcers
src/main/java/com/github/ferstl/maven/pomenforcers/AbstractPedanticDependencyOrderEnforcer.java
[ "public enum DependencyElement implements PriorityOrderingFactory<String, DependencyModel>, Function<DependencyModel, String> {\r\n GROUP_ID(\"groupId\") {\r\n @Override\r\n public PriorityOrdering<String, DependencyModel> createPriorityOrdering(Collection<String> priorityCollection) {\r\n return new Pr...
import java.util.Collection; import java.util.EnumSet; import java.util.LinkedHashSet; import java.util.Set; import org.apache.maven.model.Dependency; import org.apache.maven.project.MavenProject; import com.github.ferstl.maven.pomenforcers.model.DependencyElement; import com.github.ferstl.maven.pomenforcers.model.Depe...
/* * Copyright (c) 2012 - 2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required ...
CommaSeparatorUtils.splitAndAddToCollection(dependencyElements, orderBy, DependencyElement::getByElementName);
5
thane98/3DSFE-Randomizer
randomizer/fates/model/structures/FatesCharacter.java
[ "public enum CharacterType {\n FirstGen, SecondGen, NPC, Player\n}", "public class Job \n{\n\tprivate JobState state;\n\tprivate String jid;\n\tprivate String name;\n\tprivate ItemType itemType;\n\tprivate short tiedJob;\n\tprivate short id;\n\tprivate byte weaponRank;\n\tprivate byte gender;\n\t\n\tprivate Sk...
import randomizer.common.enums.CharacterType; import randomizer.common.structures.Job; import randomizer.common.structures.Skill; import randomizer.common.utils.ByteUtils; import randomizer.fates.singletons.FatesCharacters; import randomizer.fates.singletons.FatesGui; import randomizer.fates.singletons.FatesSkills; imp...
package randomizer.fates.model.structures; public class FatesCharacter { // Character label data. private String name; private String pid; private String fid; private String aid; private String mPid; private String mPidH; private String sound; private String[] bevAliases; // ...
res.append("Stats: ").append(ByteUtils.toString(stats)).append("\n");
3
OpenChain-Project/Online-Self-Certification-Web-App
test/org/openchain/certification/TestUpdateSurvey.java
[ "public class SurveyDbDao {\n\t\n\tstatic final Logger logger = LoggerFactory.getLogger(SurveyDbDao.class);\n\t\n\tConnection connection = null;\n\tprivate PreparedStatement updateQuestionQuery;\n\tprivate PreparedStatement addQuestionQuery;\n\tprivate PreparedStatement getQuestionIdQuery;\n\tprivate PreparedStatem...
import org.openchain.certification.model.SurveyResponseException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import static org.junit.Assert.*; import java.io.File; import java.sql.Connection; import java.sql.SQLException; import java.util.List; import org.junit.After; import org.junit.Before; impo...
/** * Copyright (c) 2019 Source Auditor 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 appli...
SurveyDbDao surveyDao;
0
concentricsky/android-viewer-for-khan-academy
src/com/concentricsky/android/khanacademy/app/AbstractListFragment.java
[ "public class KADataService extends Service {\n \n\tpublic final String LOG_TAG = getClass().getSimpleName();\n\t\n\tpublic static final int RESULT_SUCCESS = 0;\n\tpublic static final int RESULT_ERROR = 1;\n\tpublic static final int RESULT_CANCELLED = 2;\n\t\n\tprivate KADataBinder mBinder = new KADataBinder(thi...
import static com.concentricsky.android.khanacademy.Constants.PARAM_TOPIC_ID; import java.sql.SQLException; import android.app.Activity; import android.content.Context; import android.database.Cursor; import android.os.Bundle; import android.widget.CursorAdapter; import android.widget.ListAdapter; import android.widget...
/* Viewer for Khan Academy Copyright (C) 2012 Concentric Sky, 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 option) any later...
DatabaseHelper dbh = service.getHelper();
2
plusonelabs/calendar-widget
app/src/main/java/org/andstatus/todoagenda/prefs/ColorsPreferencesFragment.java
[ "public class ColorPreference extends DialogPreference {\n\tfinal String selectNoneButtonText;\n\tInteger defaultColor;\n\tprivate final String noneSelectedSummaryText;\n\tprivate final CharSequence summaryText;\n\tfinal boolean showAlpha;\n\tfinal boolean showHex;\n\tfinal boolean showPreview;\n\tprivate View thum...
import android.content.SharedPreferences; import android.os.Bundle; import androidx.fragment.app.DialogFragment; import androidx.preference.ListPreference; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; import androidx.preference.PreferenceScreen; import com.rarepebble.color...
package org.andstatus.todoagenda.prefs; /** AndroidX version created by yvolk@yurivolkov.com * based on this answer: https://stackoverflow.com/a/53290775/297710 * and on the code of https://github.com/koji-1009/ChronoDialogPreference */ public class ColorsPreferencesFragment extends PreferenceFragmentCompa...
Preference preference = findPreference(TimeSection.PAST.preferenceCategoryKey);
3
e-gov/AJ
filter/src/main/java/ee/ria/dumonitor/filter/processor/MessageProcessor.java
[ "public final class IOUtil {\n\n public static final Charset UTF_8 = Charset.forName(\"UTF-8\");\n\n private static final Logger LOG = LoggerFactory.getLogger(IOUtil.class);\n\n private static final int BUFFER_SIZE = 4096;\n\n private IOUtil() {\n throw new UnsupportedOperationException();\n }\n\n /**\n ...
import org.slf4j.LoggerFactory; import org.w3c.dom.Node; import javax.xml.soap.SOAPMessage; import java.util.*; import static ee.ria.dumonitor.common.util.ObjectUtil.eq; import ee.ria.dumonitor.common.util.IOUtil; import ee.ria.dumonitor.common.util.ObjectMapper; import ee.ria.dumonitor.common.util.SoapUtil; import ee....
/* * MIT License * Copyright (c) 2016 Estonian Information System Authority (RIA) * * 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...
private ObjectMapper<LogEntry> logEntryMapper = new ObjectMapper<LogEntry>(LogEntry.class);
1
wdtinc/mapbox-vector-tile-java
src/main/java/com/wdtinc/mapbox_vector_tile/adapt/jts/MvtReader.java
[ "public class JtsLayer {\n\n private final String name;\n private final Collection<Geometry> geometries;\n private final int extent;\n \n /**\n * Create an empty JTS layer.\n *\n * @param name layer name\n * @throws IllegalArgumentException when {@code name} is null\n */\n publ...
import org.locationtech.jts.algorithm.Area; import org.locationtech.jts.geom.*; import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsLayer; import com.wdtinc.mapbox_vector_tile.adapt.jts.model.JtsMvt; import com.wdtinc.mapbox_vector_tile.encoding.GeomCmd; import com.wdtinc.mapbox_vector_tile.VectorTile; import com.w...
package com.wdtinc.mapbox_vector_tile.adapt.jts; /** * Load Mapbox Vector Tiles (MVT) to JTS {@link Geometry}. Feature tags may be converted * to user data via {@link ITagConverter}. * * @see JtsMvt * @see JtsLayer */ public final class MvtReader { private static final int MIN_LINE_STRING_LEN = 6; // MoveT...
final List<JtsLayer> jtsLayers = new ArrayList<>(mvt.getLayersList().size());
0
geoparser/geolocator
geo-locator/src/edu/cmu/geoparser/parser/spanish/SpanishRuleToponymParser.java
[ "public class StringUtil {\n\n static Pattern pattern = Pattern.compile(\"\\\\p{InCombiningDiacriticalMarks}+\");\n\n /**\n * check each word in the given string array is capitalized or not Input: array of strings Output:\n * U U L L U L U L L L U L....\n */\n public static String[] capitalizedArray(String...
import com.csvreader.CsvReader; import com.csvreader.CsvWriter; import edu.cmu.geoparser.common.StringUtil; import edu.cmu.geoparser.model.Tweet; import edu.cmu.geoparser.nlp.MisspellParser; import edu.cmu.geoparser.nlp.ner.FeatureExtractor.FeatureGenerator; import edu.cmu.geoparser.nlp.tokenizer.EuroLangTwokenizer; im...
/** * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use t...
FeatureGenerator fgen;
3
envyfan/AndroidReview
app/src/main/java/com/vv/androidreview/ui/fragment/SettingFragment.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 com.vv.androidreview.entity.Suggest; import com.vv.androidreview.ui.activites.AboutActivity; import com.vv.androidreview.ui.activites.CreateTableActivity; import com.vv.androidreview.ui.activites.ListActivity; import com.vv.androidreview.ui.activites.MainActivity; import com.vv.androidreview.ui.activites.Setting...
/* * 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...
intent.setClass(getContext(), ListActivity.class);
5
Cleveroad/LoopBar
LoopBar-widget/src/main/java/com/cleveroad/loopbar/widget/LoopBarView.java
[ "public interface ICategoryItem {\n\n /**\n * Returns image for displaying in Item\n *\n * @return Instance of {@link Drawable}\n */\n Drawable getCategoryIconDrawable();\n\n /**\n * Returns text for displaying in Item\n *\n * @return Instance of {@link String}\n */\n Str...
import android.animation.Animator; import android.animation.AnimatorInflater; import android.annotation.TargetApi; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.PorterDuff; import android.graphics.drawable.ColorDrawable; import ...
* * @param orientation int value of orientation. Must be one of {@link Orientation} */ public final void setOrientation(int orientation) { mOrientation = orientation; mOrientationState = getOrientationStateFromParam(mOrientation); invalidate(); if (mOuterAdapter != nul...
IOperationItem firstItem = mOuterAdapter.getItem(0);
2
chucknorris-io/chuck-api
src/main/java/io/chucknorris/api/feed/FeedController.java
[ "@Data\npublic class DailyChuck {\n\n private Long issueNumber;\n private DailyChuckIssue[] issues;\n\n /**\n * Adds a DailyChuckIssue {@link DailyChuckIssue} to the DailyChuck instance and increases the\n * issue number {@link DailyChuck#issueNumber} by one.\n */\n public void addIssue(DailyChuckIssue da...
import io.chucknorris.api.feed.dailychuck.DailyChuck; import io.chucknorris.api.feed.dailychuck.DailyChuckIssue; import io.chucknorris.api.feed.dailychuck.DailyChuckPublishedEvent; import io.chucknorris.api.feed.dailychuck.DailyChuckService; import io.chucknorris.lib.DateUtil; import io.chucknorris.lib.event.EventServi...
package io.chucknorris.api.feed; @RestController public class FeedController { private DailyChuckService dailyChuckService; private DateUtil dateUtil; private EventService eventService; private MailchimpService mailchimpService; private MeterRegistry meterRegistry; @Value("${mailchimp.dailychuck.list_id...
MailingListStatistic mailingListStatistic = mailchimpService.fetchListStats(dailyChuckListId);
7
ZSCNetSupportDept/WechatTicketSystem
src/main/java/love/sola/netsupport/api/root/DashBoard.java
[ "public abstract class API {\n\n public String url = null; //url\n public int access = Access.GOD_MODE; //operator's permission\n public Command authorize = null; //session check\n\n protected abstract Object process(HttpServletRequest req, WxSession session) throws Exception;\n\n @Override\n publ...
import java.util.Set; import javax.servlet.http.HttpServletRequest; import love.sola.netsupport.api.API; import love.sola.netsupport.enums.Access; import love.sola.netsupport.session.WechatSession; import love.sola.netsupport.session.WxSession; import love.sola.netsupport.wechat.Command;
/* * This file is part of WechatTicketSystem. * * WechatTicketSystem 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. * *...
for (love.sola.netsupport.session.WxSession ws : WechatSession.list()) {
2
lenis0012/LoginSecurity-2
src/main/java/com/lenis0012/bukkit/loginsecurity/session/AuthAction.java
[ "public class LoginSecurity extends PluginHolder {\n private static final ExecutorService executorService = Executors.newCachedThreadPool();\n\n /**\n * Get the executor LoginSecurity uses for async processing.\n *\n * @return Executor service.\n */\n public static ExecutorService getExecut...
import com.lenis0012.bukkit.loginsecurity.LoginSecurity; import com.lenis0012.bukkit.loginsecurity.session.action.ActionResponse; import com.lenis0012.bukkit.loginsecurity.storage.PlayerInventory; import com.lenis0012.bukkit.loginsecurity.storage.PlayerLocation; import com.lenis0012.bukkit.loginsecurity.storage.PlayerP...
package com.lenis0012.bukkit.loginsecurity.session; public abstract class AuthAction { private final AuthActionType type; private final AuthService service; private final Object serviceProvider; public <T> AuthAction(AuthActionType type, AuthService<T> service, T serviceProvider) { this.type...
Bukkit.getScheduler().runTask(LoginSecurity.getInstance(), () -> player.removePotionEffect(PotionEffectType.BLINDNESS));
0
jenkinsci/google-storage-plugin
src/main/java/com/google/jenkins/plugins/storage/DownloadStep.java
[ "public class BucketPath implements Serializable {\n private final String bucket;\n private final String object;\n\n /**\n * Prepares a new BucketPath.\n *\n * @param uri path to the bucket object, of the form \"gs://bucket_name/path/to/object\". May\n * contain other characters (i.e., *), no verific...
import static com.google.common.base.Preconditions.checkNotNull; import com.google.api.client.googleapis.media.MediaHttpDownloader; import com.google.api.services.storage.Storage; import com.google.api.services.storage.model.Objects; import com.google.api.services.storage.model.StorageObject; import com.google.jenkins....
/* * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to ...
RetryStorageOperation.performRequestWithRetry(executor, a, module.getInsertRetryCount());
1
kwatters/solrgraph
src/test/java/com/kmwllc/search/solr/client/GraphExpressionTest.java
[ "public class Expression {\r\n\r\n\tprivate ArrayList<Expression> expressions;\r\n\t\r\n\t// TODO: an expression should have at minimum 1 term or another expression?\r\n\tprivate ArrayList<Term> terms;\r\n\t\r\n\t// TODO: get rid of the op\r\n\t// create subclasses for and / or / not / range / join / graph expressi...
import org.apache.solr.request.SolrQueryRequest; import org.apache.solr.search.SyntaxError; import org.junit.Assert; import org.junit.Test; import com.kmwllc.search.solr.client.Expression; import com.kmwllc.search.solr.client.GraphExpression; import com.kmwllc.search.solr.client.Operator; import com.kmwllc.searc...
package com.kmwllc.search.solr.client; public class GraphExpressionTest extends Assert { @Test public void testGraphExpression() throws SyntaxError { Expression startNodes = new Expression(Operator.AND);
startNodes.add(new Term("text", "bar"));
4
CollapsedDom/Stud.IP-Client
core/client/src/main/java/de/danner_web/studip_client/view/subframe/LogView.java
[ "public class LogItem {\n\n\tprivate Date date;\n\n\tprivate String pluginName;\n\n\tprivate String content;\n\n\tpublic LogItem(Date time, String pluginName, String content) {\n\t\tthis.date = time;\n\t\tthis.pluginName = pluginName;\n\t\tthis.content = content;\n\t}\n\n\t/**\n\t * @return the date\n\t */\n\tpubli...
import java.awt.BorderLayout; import java.awt.Color; import java.util.Observable; import java.util.Observer; import javax.swing.DefaultListModel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; impor...
package de.danner_web.studip_client.view.subframe; public class LogView extends JPanel implements Observer, DetachableView { private static final long serialVersionUID = -1430326569970992865L; private static Logger logger = LogManager.getLogger(LogView.class); private JScrollPane scrollPane;
private Model model;
1
ddcap/halvade
halvade/src/be/ugent/intec/halvade/tools/BWAAlnInstance.java
[ "public class CommandGenerator {\n \n public static ArrayList<String> addToCommand(ArrayList<String> command, String args) {\n if(args == null || args.isEmpty()) return command;\n command.addAll(Arrays.asList(args.split(\"\\\\s+\")));\n return command;\n }\n \n private static Str...
import org.apache.hadoop.mapreduce.Mapper; import be.ugent.intec.halvade.hadoop.mapreduce.HalvadeCounters; import be.ugent.intec.halvade.utils.CommandGenerator; import be.ugent.intec.halvade.utils.HalvadeFileUtils; import be.ugent.intec.halvade.utils.Logger; import be.ugent.intec.halvade.utils.HalvadeConf; import be.ug...
/* * Copyright (C) 2014 ddecap * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed...
String[] command1 = CommandGenerator.bwaAln(bin, ref, "/dev/stdin", getFileName(tmpdir, taskId, true, 1), threadsToUse, alnCustomArgs);
0
allegro/elasticsearch-reindex-tool
src/test/java/pl/allegro/tech/search/elasticsearch/tools/reindex/embeded/EmbeddedElasticsearchCluster.java
[ "public class ReindexInvokerTest {\n\n private static final String SOURCE_INDEX = \"sourceindex\";\n private static final String TARGET_INDEX = \"targetindex\";\n public static final String DATA_TYPE = \"type\";\n\n private static EmbeddedElasticsearchCluster embeddedElasticsearchCluster;\n\n @BeforeClass\n p...
import static org.elasticsearch.node.NodeBuilder.nodeBuilder; import java.util.stream.Stream; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.client.Client; import org.elasticsearch.client.IndicesAdminClient; import org.elasticsearch.common.settings.Settings; import org.elasticsearch...
package pl.allegro.tech.search.elasticsearch.tools.reindex.embeded; public final class EmbeddedElasticsearchCluster { public static final String CLUSTER_NAME = "ReindexInvoker_cluster"; public static final int ELS_PORT = 9211; public static final int ELS_TCP_PORT = 9311; private final Node dataNode; pr...
public ElasticDataPointer createDataPointer(String indexName) {
1
republique-et-canton-de-geneve/chvote-1-0
commons-base/commons-crypto/src/main/java/ch/ge/ve/commons/crypto/SensitiveDataCryptoUtilsConfigurationDefaultImpl.java
[ "public class CryptoConfigurationRuntimeException extends RuntimeException {\n\n public CryptoConfigurationRuntimeException(String message) {\n super(message);\n }\n\n public CryptoConfigurationRuntimeException(String message, Throwable cause) {\n super(message, cause);\n }\n}", "public ...
import javax.crypto.Mac; import javax.crypto.SecretKey; import java.io.*; import java.security.SecureRandom; import ch.ge.ve.commons.crypto.exceptions.CryptoConfigurationRuntimeException; import ch.ge.ve.commons.crypto.utils.CipherFactory; import ch.ge.ve.commons.crypto.utils.MacFactory; import ch.ge.ve.commons.crypto....
package ch.ge.ve.commons.crypto; /*- * #%L * Common crypto utilities * %% * Copyright (C) 2015 - 2016 République et Canton de Genève * %% * 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 Foun...
macThreadLocal.set(new MacFactory(propertyConfigurationService).getInstance());
2
CROW-NDOV/displaydirect
distribution/src/main/java/nl/crowndov/displaydirect/distribution/stats/MetricPusher.java
[ "public class TopicFactory {\n\n /**\n * Generate a topic for subscribe messages\n * @param stopSytemId An id for the originating stopsystem. If null, will be filled with a wildcard for that level\n * @return A valid topic name for subscribe messages\n */\n public static String subscribe(Strin...
import nl.crowndov.displaydirect.common.transport.mqtt.TopicFactory; import nl.crowndov.displaydirect.distribution.messages.DisplayDirectMessageFactory; import nl.crowndov.displaydirect.distribution.util.CatchableRunnable; import nl.crowndov.displaydirect.common.stats.domain.Metric; import nl.crowndov.displaydirect.dis...
package nl.crowndov.displaydirect.distribution.stats; /** * Copyright 2017 CROW-NDOV * * This file is subject to the terms and conditions defined in file 'LICENSE.txt', which is part of this source code package. */ public class MetricPusher { private static final Logger LOGGER = LoggerFactory.getLogger(Met...
private static Transport transport = TransportFactory.get();
4
marcelothebuilder/webpedidos
src/main/java/com/github/marcelothebuilder/webpedidos/controller/EnvioEmailPedidoBean.java
[ "@Entity\n@Table(name = \"cliente\", uniqueConstraints = {\n\t\t@UniqueConstraint(name = \"uk_doc_receita_federal\", columnNames = { \"doc_receita_federal\" }),\n\t\t@UniqueConstraint(name = \"uk_email\", columnNames = { \"email\" }) })\npublic class Cliente implements Serializable {\n\tprivate static final long se...
import java.io.Serializable; import javax.enterprise.context.RequestScoped; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.inject.Inject; import javax.inject.Named; import com.github.marcelothebuilder.webpedidos.controller.qualifiers.PedidoEdicao; import com.github.ma...
/** * */ package com.github.marcelothebuilder.webpedidos.controller; /** * @author Marcelo Paixao Resende * */ @Named @RequestScoped public class EnvioEmailPedidoBean implements Serializable { private static final long serialVersionUID = 1L; @Inject
private Mailer mailer;
4
AlexanderMisel/gnubridge
src/main/java/org/gnubridge/core/Card.java
[ "public class Ace {\n\tpublic static Card of(Suit denomination) {\n\t\treturn new Card(\"A\", denomination);\n\t}\n\n\tpublic static boolean isValueOf(Card card) {\n\t\treturn card.getValue() == Card.strToIntValue(\"A\");\n\t}\n\n}", "public class Five {\n\tpublic static Card of(Suit denomination) {\n\t\treturn n...
import org.gnubridge.core.deck.Ace; import org.gnubridge.core.deck.Eight; import org.gnubridge.core.deck.Five; import org.gnubridge.core.deck.Four; import org.gnubridge.core.deck.Jack; import org.gnubridge.core.deck.King; import org.gnubridge.core.deck.Nine; import org.gnubridge.core.deck.Queen; import org.gnubridge.co...
return FIVE; } else if ("6".equals(value)) { return SIX; } else if ("7".equals(value)) { return SEVEN; } else if ("8".equals(value)) { return EIGHT; } else if ("9".equals(value)) { return NINE; } else if ("10".equals(value)) { return TEN; } else if ("J".equals(value.toUpperCase())) { re...
result = "Nine";
2
cimiano/tbx2rdf
src/java/tbx2rdf/types/LexicalEntry.java
[ "public class DC {\n private static Model defaultModel = ModelFactory.createDefaultModel(); \n \n public static Property rights = defaultModel.createProperty(\"http://purl.org/dc/terms/rights\");\n public static Property source = defaultModel.createProperty(\"http://purl.org/dc/terms/source\");\n ...
import tbx2rdf.vocab.DC; import tbx2rdf.vocab.LIME; import tbx2rdf.vocab.ONTOLEX; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Resource; import com.hp.hpl.jena.vocabulary.RDF; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.uti...
package tbx2rdf.types; /** * This class represents a Lexical Entry * * @author Philipp Cimiano - Universität Bielefeld * @author Victor Rodriguez - Universidad Politécnica de Madrid */ public class LexicalEntry extends Describable { static LexicalEntry createFromSPARQL(String uri, Model model) { thr...
term.addProperty(LIME.language, lang); //before it was the mere constant "language"
1
metno/metadata-editor
src/test/java/no/met/metadataeditor/widget/NowDateWidgetTest.java
[ "public class InvalidEditorConfigurationException extends EditorException {\n\n private static final long serialVersionUID = 4902574371399601804L;\n\n public static final int UNKNOWN_VARIABLE = 301; // the variable name used in config is not in template\n public static final int INVALID_WIDGET_CONFIG = 302...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.List; import no.met.metadataeditor.InvalidEditorConfigurationException; import no.met.metadataeditor.dataTypes.EditorVariable; import no.met.metadataeditor.dataTypes.EditorVariableContent...
package no.met.metadataeditor.widget; public class NowDateWidgetTest { @Test public void testMissingNowDateGeneration() { List<EditorVariableContent> evcl = new ArrayList<>(); EditorWidget widget = new NowDateWidget(); widget.setVariableName("test-now-date"); ...
@Test(expected=InvalidEditorConfigurationException.class)
0
gruter/utogen
src/main/java/generator/engine/db/Generator.java
[ "public class DBGeneratorDefinition\r\n{\r\n private String scenario;\r\n private String description;\r\n private String filename; \r\n private String dbDriver;\r\n private String dbURL;\r\n private String user;\r\n private String password;\r\n private List<DBTableGenerator> dbTab...
import generator.db.DBGeneratorDefinition; import generator.engine.ProgressUpdateObserver; import generator.extenders.IRandomiserFunctionality; import generator.extenders.RandomiserInstance; import generator.db.DBFieldGenerator; import generator.db.DBTableGenerator; import generator.misc.ApplicationContext; impo...
/* * Generator.java * * Created on 11 November 2007, 21:41 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package generator.engine.db; /** * * @author Administrator */ public class Generator { private Vector<RandomiserType> vRand...
private DBGeneratorDefinition dbGenConfig;
0
horizon-institute/artcodes-android
library/src/main/java/uk/ac/horizon/artcodes/detect/marker/MarkerDetector.java
[ "public interface CameraFocusControl\n{\n void focus(Runnable callback);\n}", "public interface DetectorSetting\n{\n\tvoid nextValue();\n\n\t@DrawableRes\n\tint getIcon();\n\n\t@StringRes\n\tint getText();\n}", "public class ImageBuffers\n{\n\tprivate byte[] buffer;\n\n\t/**\n\t * cameraImage stores the full...
import android.content.Context; import android.util.Log; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.MatOfPoint; import org.opencv.core.MatOfPoint2f; import org.opencv.core.Point; import org.opencv.core.Rect; import org.opencv.core.RotatedRect; import org.opencv.core.Scalar; import o...
/* * Artcodes recognises a different marker scheme that allows the * creation of aesthetically pleasing, even beautiful, codes. * Copyright (C) 2013-2016 The University of Nottingham * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Pu...
public ImageProcessor create(Context context, Experience experience, MarkerDetectionHandler handler, CameraFocusControl cameraFocusControl, Map<String, String> args)
0
apache/whirr
services/hadoop/src/test/java/org/apache/whirr/service/hadoop/integration/HadoopServiceTest.java
[ "public class ClusterSpec {\n \n public enum Property {\n SERVICE_NAME(String.class, false),\n INSTANCE_TEMPLATES(String.class, false),\n PROVIDER(String.class, false),\n CREDENTIAL(String.class, false),\n IDENTITY(String.class, false),\n CLUSTER_NAME(String.class, false),\n PUBLIC_KEY_FILE(S...
import static junit.framework.Assert.assertEquals; import static junit.framework.Assert.assertNull; import static org.hamcrest.Matchers.instanceOf; import static org.junit.Assert.assertThat; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import ...
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you...
Service s = new ServiceFactory().create(clusterSpec.getServiceName());
1
jramoyo/quickfix-messenger
src/main/java/com/jramoyo/qfixmessenger/ui/ProjectDialog.java
[ "public class ProjectTreeCellEditor extends DefaultTreeCellEditor\r\n{\r\n\tpublic ProjectTreeCellEditor(JTree tree)\r\n\t{\r\n\t\tsuper(tree, null);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean isCellEditable(EventObject event)\r\n\t{\r\n\t\tif (super.isCellEditable(event))\r\n\t\t{\r\n\t\t\tObject value = tree.g...
import java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.BoxLayout; import javax.swing.JDialog; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTree; import javax.swing.tree.TreeSelectionModel; import com.jramoyo.fix.xml.MessageType; ...
/* * Copyright (c) 2011, Jan Amoyo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list...
projectTree.setCellEditor(new ProjectTreeCellEditor(projectTree));
0
vestrel00/android-dagger-butterknife-mvp
app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/main/MainActivityModule.java
[ "@Module\npublic abstract class BaseActivityModule {\n\n static final String ACTIVITY_FRAGMENT_MANAGER = \"BaseActivityModule.activityFragmentManager\";\n\n @Binds\n @PerActivity\n /*\n * PerActivity annotation isn't necessary since Activity instance is unique but is here for\n * convention. In ...
import dagger.Module; import dagger.android.ContributesAndroidInjector; import android.app.Activity; import com.vestrel00.daggerbutterknifemvp.inject.PerActivity; import com.vestrel00.daggerbutterknifemvp.inject.PerFragment; import com.vestrel00.daggerbutterknifemvp.ui.common.BaseActivityModule; import com.vestrel00.da...
/* * Copyright 2018 Vandolf Estrellado * * 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 ...
@ContributesAndroidInjector(modules = Example1FragmentModule.class)
2