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
goerlitz/rdffederator
src/de/uni_koblenz/west/splendid/optimizer/AbstractFederationOptimizer.java
[ "public abstract class AbstractCostEstimator extends QueryModelVisitorBase<RuntimeException> implements ModelEvaluator {\n\t\n\tprotected double cost;\n\t\n\tprotected AbstractCardinalityEstimator cardEst;\n\t\n\tpublic AbstractCardinalityEstimator getCardinalityEstimator() {\n\t\treturn cardEst;\n\t}\n\n\tpublic v...
import org.slf4j.LoggerFactory; import de.uni_koblenz.west.splendid.estimation.AbstractCostEstimator; import de.uni_koblenz.west.splendid.estimation.ModelEvaluator; import de.uni_koblenz.west.splendid.helpers.AnnotatingTreePrinter; import de.uni_koblenz.west.splendid.helpers.FilterConditionCollector; import de.uni_kobl...
/* * This file is part of RDF Federator. * Copyright 2011 Olaf Goerlitz * * RDF Federator 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) a...
protected ModelEvaluator modelEvaluator;
1
campaignmonitor/createsend-java
src/com/createsend/General.java
[ "public class ExternalSessionOptions {\n\tpublic String Email;\n\tpublic String Chrome;\n\tpublic String Url;\n\tpublic String IntegratorID;\n\tpublic String ClientID;\n}", "public class ExternalSessionResult {\n\tpublic String SessionUrl;\n}", "public class OAuthTokenDetails {\n\tpublic String access_token;\n\...
import com.createsend.models.OAuthTokenDetails; import com.createsend.models.SystemDate; import com.createsend.models.administrators.Administrator; import com.createsend.models.administrators.AdministratorResult; import com.createsend.models.clients.ClientBasics; import com.createsend.util.AuthenticationDetails; ...
/** * Copyright (c) 2011 Toby Brain * * 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, mer...
public static OAuthTokenDetails exchangeToken(
2
Drusy/Wisper
wisper-libgdx/core/src/java/fr/wisper/screens/gamescreen/WisperChooseMenu.java
[ "public class WisperGame extends Game {\n // Fps\n private FPSLogger fps;\n\n // Preferences\n public static Preferences preferences;\n\n // Loader\n private LoadingScreen loader;\n\n // Camera\n static public OrthographicCameraWithVirtualViewport Camera;\n static public MultipleVirtualVi...
import aurelienribon.tweenengine.BaseTween; import aurelienribon.tweenengine.Tween; import aurelienribon.tweenengine.TweenCallback; import aurelienribon.tweenengine.TweenManager; import com.badlogic.gdx.Game; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Screen; import com.badlogic.gdx.assets.AssetManager; impor...
package fr.wisper.screens.gamescreen; public class WisperChooseMenu implements FadingScreen { // Stage private ExtendedStage<WisperChooseMenu> stage; private Table table; private Skin skin; List<String> list; // Wisper private final String CHOSEN_WISPER = "chosen-wisper"; private Spri...
private AnimatedWisper wisper;
2
exoplatform/task
services/src/test/java/org/exoplatform/task/rest/TestProjectRestService.java
[ "public class TestUtils {\n\n private static Connection conn;\n private static Liquibase liquibase;\n\n public static long EXISTING_TASK_ID = 1;\n public static long UNEXISTING_TASK_ID = 2;\n\n public static long EXISTING_PROJECT_ID = 1;\n public static long UNEXISTING_PROJECT_ID = 2;\n\n public static long ...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.mockito.Mockito.*; import java.util.*; import javax.ws.rs.core.Response; import javax.ws.rs.ext.RuntimeDelegate; import org.exoplatform.commons.utils.ListAccess; import org.exoplatform.social.core.identity.provi...
package org.exoplatform.task.rest; @RunWith(MockitoJUnitRunner.class) public class TestProjectRestService { @Mock TaskService taskService; @Mock ProjectService projectService; @Mock ProjectStorage projectStorage; @Mock StatusService statusService; @Mock StatusStorage statusStorage; ...
ProjectDto project1 = new ProjectDto();
1
mast-group/codemining-core
src/main/java/codemining/java/codeutils/binding/AbstractJavaNameBindingsExtractor.java
[ "public class JavaASTExtractor {\n\n\tprivate static final class TopMethodRetriever extends ASTVisitor {\n\t\tpublic MethodDeclaration topDcl;\n\n\t\t@Override\n\t\tpublic boolean visit(final MethodDeclaration node) {\n\t\t\ttopDcl = node;\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Remembers if the given Extra...
import java.io.File; import java.io.IOException; import java.util.List; import java.util.Set; import java.util.SortedMap; import java.util.function.Predicate; import org.apache.commons.io.FileUtils; import org.eclipse.jdt.core.dom.ASTNode; import codemining.java.codeutils.JavaASTExtractor; import codemining.languagetoo...
/** * */ package codemining.java.codeutils.binding; /** * A name bindings extractor interface for Java. * * @author Miltos Allamanis <m.allamanis@ed.ac.uk> * */ public abstract class AbstractJavaNameBindingsExtractor extends AbstractNameBindingsExtractor { /** * Return the token index for the given po...
public final List<TokenNameBinding> getNameBindings(final ASTNode node,
5
CreativeMD/IGCM
src/main/java/com/creativemd/igcm/IGCMGuiManager.java
[ "public class ConfigTab extends ConfigGroupElement {\n\t\n\tpublic static final ConfigTab root = new ConfigTab(\"root\", ItemStack.EMPTY);\n\t\n\tpublic static ConfigSegment getSegmentByPath(String path) {\n\t\tif (path.equals(\"root\"))\n\t\t\treturn root;\n\t\tif (path.startsWith(\"root.\"))\n\t\t\treturn root.ge...
import com.creativemd.creativecore.common.gui.container.SubContainer; import com.creativemd.creativecore.common.gui.container.SubGui; import com.creativemd.creativecore.common.gui.opener.CustomGuiHandler; import com.creativemd.creativecore.common.gui.opener.GuiHandler; import com.creativemd.igcm.api.ConfigTab; import c...
package com.creativemd.igcm; public class IGCMGuiManager extends CustomGuiHandler { public static void openConfigGui(EntityPlayer player) { openConfigGui(player, "root"); } public static void openConfigGui(EntityPlayer player, String path) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("gui...
return new SubGuiConfigSegement(ConfigTab.getSegmentByPath(name));
3
susom/database
src/test/java/com/github/susom/database/example/VertxServer.java
[ "public interface Config extends Function<String, String>, Supplier<Config> {\n /**\n * Convenience method for fluent syntax.\n *\n * @return a builder for specifying from where configuration should be loaded\n */\n static @Nonnull ConfigFrom from() {\n return new ConfigFromImpl();\n }\n\n // TODO ad...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.github.susom.database.Config; import com.github.susom.database.ConfigFrom; import com.github.susom.database.DatabaseProviderVertx; import com.github.susom.database.DatabaseProviderVertx.Builder; import com.github.susom.database.Metric; import com.githu...
package com.github.susom.database.example; /** * Demo of using some com.github.susom.database classes with Vertx and HyperSQL. */ public class VertxServer { private static final Logger log = LoggerFactory.getLogger(VertxServer.class); private final Object lock = new Object(); public void run() throws Excep...
Config config = ConfigFrom.firstOf().custom(jsonConfig::getString).get();
0
WSDOT/social-analytics
src/main/java/gov/wa/wsdot/apps/analytics/client/activities/twitter/view/ranking/RankingView.java
[ "public interface ClientFactory {\n EventBus getEventBus();\n PlaceController getPlaceController();\n AnalyticsView getAnalyticsView();\n}", "public class DateSubmitEvent extends GenericEvent {\n\n\n private final String dateRange;\n private final String account;\n private final Date startDate;\...
import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.JsArray; import com.google.gwt.dom.client.Style; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.jsonp.client.JsonpRequ...
/* * Copyright (c) 2016 Washington State Department of Transportation * * 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 ver...
public RankingView(ClientFactory clientFactory) {
0
Petschko/Java-RPG-Maker-MV-Decrypter
src/main/java/org/petschko/rpgmakermv/decrypt/gui/Update.java
[ "public class Const {\n\tpublic static final String CREATOR = \"Petschko\";\n\tpublic static final String CREATOR_URL = \"https://petschko.org/\";\n\tpublic static final String CREATOR_DONATION_URL = \"https://www.paypal.me/petschko\";\n\n\t// System Constance's\n\tpublic static final String DS = System.getProperty...
import org.petschko.lib.Const; import org.petschko.lib.gui.JOptionPane; import org.petschko.lib.gui.notification.ErrorWindow; import org.petschko.lib.gui.notification.InfoWindow; import org.petschko.lib.update.UpdateException; import org.petschko.rpgmakermv.decrypt.App; import org.petschko.rpgmakermv.decrypt.Config; im...
package org.petschko.rpgmakermv.decrypt.gui; /** * @author Peter Dragicevic */ class Update { private GUI gui; private org.petschko.lib.update.Update update = null; private String[] options; private boolean autoOptionExists = false; private boolean ranAutomatically = false; /** * Update constructor * ...
ErrorWindow ew = new ErrorWindow("Can't check for Updates...", ErrorWindow.ERROR_LEVEL_WARNING, false);
2
meridor/stecker
stecker-plugin-loader/src/main/java/org/meridor/stecker/impl/DefaultDependencyChecker.java
[ "public class PluginException extends Exception {\n\n private Optional<DependencyProblem> dependencyProblem = Optional.empty();\n\n private Optional<PluginMetadata> pluginMetadata = Optional.empty();\n\n public PluginException(Exception e) {\n super(e);\n }\n\n public PluginException(String me...
import org.meridor.stecker.PluginException; import org.meridor.stecker.PluginMetadata; import org.meridor.stecker.VersionRelation; import org.meridor.stecker.interfaces.Dependency; import org.meridor.stecker.interfaces.DependencyChecker; import org.meridor.stecker.interfaces.PluginsAware; import org.meridor.stecker.int...
package org.meridor.stecker.impl; public class DefaultDependencyChecker implements DependencyChecker { @Override
public void check(PluginsAware pluginRegistry, PluginMetadata pluginMetadata) throws PluginException {
1
swookiee/com.swookiee.runtime
com.swookiee.runtime.ewok/src/main/java/com/swookiee/runtime/ewok/servlet/BundleServlet.java
[ "public class BundleRepresentation {\n\n private long id;\n private long lastModified;\n private String location;\n private int state;\n private String symbolicName;\n private String version;\n\n public BundleRepresentation() {\n }\n\n public BundleRepresentation(final long id, final long...
import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.Map; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.osgi.framework.Bundle; import org.osgi....
/******************************************************************************* * Copyright (c) 2014 Lars Pfannenschmidt and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and ...
final BundleStatusRepresentation bundleStatusRepresentation = new BundleStatusRepresentation(
2
dkzwm/SmoothRefreshLayout
app/src/main/java/me/dkzwm/widget/srl/sample/DemoApplication.java
[ "public interface IRefreshViewCreator {\n IRefreshView<IIndicator> createHeader(SmoothRefreshLayout layout);\n\n IRefreshView<IIndicator> createFooter(SmoothRefreshLayout layout);\n}", "public class SmoothRefreshLayout extends ViewGroup\n implements NestedScrollingParent3, NestedScrollingChild3 {\n ...
import android.app.Application; import me.dkzwm.widget.srl.IRefreshViewCreator; import me.dkzwm.widget.srl.SmoothRefreshLayout; import me.dkzwm.widget.srl.extra.IRefreshView; import me.dkzwm.widget.srl.extra.footer.ClassicFooter; import me.dkzwm.widget.srl.extra.header.ClassicHeader; import me.dkzwm.widget.srl.indicato...
package me.dkzwm.widget.srl.sample; /** * Created by dkzwm on 2017/6/28. * * @author dkzwm */ public class DemoApplication extends Application { @Override public void onCreate() { super.onCreate(); SmoothRefreshLayout.setDefaultCreator( new IRefreshViewCreator() { ...
public IRefreshView<IIndicator> createHeader(SmoothRefreshLayout layout) {
5
ajonkisz/TraVis
src/travis/view/project/graph/GraphTooltip.java
[ "public class UIHelper {\n\n private static final UIHelper INSTANCE = new UIHelper();\n\n public enum MessageType {\n INFORMATION, WARNING, ERROR\n }\n\n public enum Mode {\n ATTACH, PLAYBACK\n }\n\n private Mode mode;\n\n private final JFileChooser fc;\n private volatile File ...
import java.awt.Color; import java.awt.Cursor; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.geom.AffineTransform; import java.util.Collection; import j...
String text = null; switch (mode) { case METHOD: text = ep.getComponentData().getComp().getTooltipFriendlyName() + " THREAD: " + ep.getTrace().getThreadId(); break; case CLASS: text = ep.getComponentData().ge...
ConnectionPainter connPainter = graph.getConnectionPainter();
3
hufeiya/CoolSignIn
AndroidClient/app/src/main/java/com/hufeiya/SignIn/fragment/SignInFragment.java
[ "public class CategorySelectionActivity extends AppCompatActivity {\n\n private static final String EXTRA_PLAYER = \"player\";\n private User user;\n\n public static void start(Activity activity, User user, ActivityOptionsCompat options) {\n Intent starter = getStartIntent(activity, user);\n ...
import android.app.Activity; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.ActivityOptionsCompat; import android.support.v4.app.Fragment; import android.support.v4.util.Pair; import android.support.v4.view.V...
/* * Copyright 2015 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
AsyncHttpHelper.login(phone.getText().toString(),pass.getText().toString(),SignInFragment.this);
6
lauriholmas/batmapper
src/main/java/com/glaurung/batMap/controller/MapperEngine.java
[ "public class CorpsePanel extends JPanel implements ActionListener, ComponentListener, KeyListener, DocumentListener {\n\n private CorpseModel model = new CorpseModel();\n private String BASEDIR;\n private MapperPlugin plugin;\n private final Color TEXT_COLOR = Color.LIGHT_GRAY;\n private final Color...
import java.awt.Color; import java.awt.Dimension; import java.awt.Point; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.geom.Point2D; import java.io.IOException; import ...
package com.glaurung.batMap.controller; public class MapperEngine implements ItemListener, ComponentListener { SparseMultigraph<Room, Exit> graph; VisualizationViewer<Room, Exit> vv; MapperLayout mapperLayout; Room currentRoom = null; Area area = null; MapperPanel panel; PickedState<R...
CorpsePanel corpsePanel;
0
thlcly/Mini-JVM
src/main/java/com/aaront/exercise/jvm/commands/GetStaticFieldCommand.java
[ "@Data\npublic class ClassFile {\n private String magicNumber;\n private int majorVersion;\n private int minorVersion;\n private ClassIndex classIndex;\n private InterfaceIndex interfaceIndex;\n private ConstantPool constantPool;\n private List<ClassAccessFlag> accessFlags;\n private List<Fi...
import com.aaront.exercise.jvm.ClassFile; import com.aaront.exercise.jvm.constant.ClassConstant; import com.aaront.exercise.jvm.constant.ConstantPool; import com.aaront.exercise.jvm.constant.FieldRefConstant; import com.aaront.exercise.jvm.engine.ExecutionResult; import com.aaront.exercise.jvm.engine.Heap; import com.a...
package com.aaront.exercise.jvm.commands; /** * @author tonyhui * @since 17/6/17 */ public class GetStaticFieldCommand extends TwoOperandCommand { public GetStaticFieldCommand(ClassFile clzFile, String opCode, int operand1, int operand2) { super(clzFile, opCode, operand1, operand2); } @Overrid...
JavaObject jo = Heap.getInstance().newObject(className);
5
jGleitz/JUnit-KIT
src/final2/subtests/PraktomatPublicTest.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.is; import org.junit.Test; import test.Input; import test.SystemExitStatus; import test.runs.LineRun; import test.runs.NoOutputRun; import test.runs.Run;
package final2.subtests; /** * Simulates the Praktomat's public test. * * @author Martin Löper */ public class PraktomatPublicTest extends LangtonSubtest { public PraktomatPublicTest() { setAllowedSystemExitStatus(SystemExitStatus.WITH_0); } /** * "Fundamental tests with ordinary ant" A...
sessionTest(runs, Input.getFile(PUBLIC_PRAKTOMAT_TEST_FILE_1));
0
codebulb/LambdaOmega
src/test/java/ch/codebulb/lambdaomega/LBaseTest.java
[ "public static <T> L<T> L(Stream<T> stream) {\n return new L(stream.collect(Collectors.toList()));\n}", "public static <T> L<T> l() {\n return new L<>(new ArrayList<>());\n}", "public static <T> List<T> list(T... ts) {\n return l(ts).l;\n}", "public static final List<Integer> EXPECTED_LIST = new Arra...
import static ch.codebulb.lambdaomega.L.L; import static ch.codebulb.lambdaomega.L.l; import static ch.codebulb.lambdaomega.L.list; import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_LIST; import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_NESTED_LIST; import static ch.codebulb.lambdaomega.TestUtil.assertEqua...
package ch.codebulb.lambdaomega; /** * Basic test cases for {@link L}. */ public class LBaseTest { @BeforeClass public static void beforeClass() {
L.TEST_DISABLE_HELPER_MAP_CONVERSION = true;
0
TreyRuffy/CommandBlocker
Command Blocker Bungee/src/main/java/me/treyruffy/commandblocker/bungeecord/BungeeMain.java
[ "public class Universal {\n\n\tprivate static Universal instance = null;\n\tprivate MethodInterface mi;\n\t\n\tpublic static Universal get() {\n\t\treturn instance == null ? instance = new Universal() : instance;\n\t}\n\t\n\tpublic void setup(MethodInterface mi) {\n\t\tthis.mi = mi;\n\t\t\n\t\tmi.setupMetrics();\n\...
import me.treyruffy.commandblocker.Universal; import me.treyruffy.commandblocker.bungeecord.commands.CommandBlockerCommand; import me.treyruffy.commandblocker.bungeecord.config.BungeeConfigManager; import me.treyruffy.commandblocker.bungeecord.config.BungeeUpdateConfig; import me.treyruffy.commandblocker.bungeecord.lis...
package me.treyruffy.commandblocker.bungeecord; public class BungeeMain extends Plugin { private static BungeeMain instance; private static BungeeAudiences adventure; public static @NotNull BungeeAudiences adventure() { if (adventure == null) { throw new IllegalStateException("Tried to access Adventure wh...
getProxy().getPluginManager().registerListener(this, new TabCompletion());
6
artur-tamazian/avro-schema-generator
src/test/java/com/at/avro/integration/HsqlIntegrationTest.java
[ "public class AvroSchema {\n private final String name;\n private final String namespace;\n private final String doc;\n\n private List<AvroField> fields;\n\n private Map<String, String> customProperties = new LinkedHashMap<>();\n\n public AvroSchema(Table table, AvroConfig avroConfig) {\n t...
import com.at.avro.AvroSchema; import com.at.avro.DbSchemaExtractor; import com.at.avro.SchemaGenerator; import com.at.avro.config.AvroConfig; import com.at.avro.config.FormatterConfig; import com.at.avro.formatters.SchemaFormatter; import com.at.avro.mappers.RemovePlural; import com.at.avro.mappers.ToCamelCase; import...
package com.at.avro.integration; /** * @author artur@callfire.com */ public class HsqlIntegrationTest { private static final String CONNECTION_URL = "jdbc:hsqldb:mem:testcase;shutdown=true"; private static Connection CONNECTION; private AvroConfig avroConfig = new AvroConfig("test.namespace"); ...
Function<String, String> nameMapper = new ToCamelCase().andThen(new RemovePlural());
7
azinik/ADRMine
release/v1/java_src/ADRMine/src/main/java/edu/asu/diego/loader/DocumentAnalyzer.java
[ "@Entity\n@Table( name = \"Artifact\" )\npublic class Artifact {\n\tString content;\n\tString generalized_content;\n\tList<Artifact> childsArtifact;\n\tArtifact parentArtifact;\n\tArtifact nextArtifact;\n\tArtifact previousArtifact;\n\tType artifactType;\n\tprivate boolean forTrain;\n\tprivate boolean forDemo=false...
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.prefs.PreferenceChangeEvent; import rainbownlp.core.Artifact; import rainbownlp.core.Setting; import rainbownlp.util.FileUtil; import rainbownlp.util.Hi...
package edu.asu.diego.loader; public class DocumentAnalyzer implements IDocumentAnalyzer{ public boolean isForDemo =false;
List<Artifact> loadedSentences = new ArrayList<>();
0
cattaka/AdapterToolbox
example/src/main/java/net/cattaka/android/adaptertoolbox/example/FizzBuzzExampleActivity.java
[ "public class ScrambleAdapter<T> extends AbsScrambleAdapter<\n ScrambleAdapter<T>,\n ScrambleAdapter<?>,\n RecyclerView.ViewHolder,\n ForwardingListener<ScrambleAdapter<?>, RecyclerView.ViewHolder>,\n T\n > {\n private Context mContext;\n private List<T> mItems;\n\n ...
import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutMa...
package net.cattaka.android.adaptertoolbox.example; /** * Created by cattaka on 16/05/02. */ public class FizzBuzzExampleActivity extends AppCompatActivity implements CompoundButton.OnCheckedChangeListener { ListenerRelay<ScrambleAdapter<?>, RecyclerView.ViewHolder> mListenerRelay = new ListenerRelay<Scrambl...
} else if (viewHolder instanceof BuzzViewHolderFactory.ViewHolder) {
2
DorsetProject/dorset-framework
agents/web-api/src/test/java/edu/jhuapl/dorset/agents/StockAgentTest.java
[ "public interface Agent {\n\n /**\n * Get the name of the agent\n *\n * @return name\n */\n public String getName();\n\n /**\n * Override the default name of the agent\n *\n * @param name New name for the agent\n */\n public void setName(String name);\n\n /**\n * ...
import edu.jhuapl.dorset.agents.Agent; import edu.jhuapl.dorset.agents.AgentRequest; import edu.jhuapl.dorset.agents.AgentResponse; import edu.jhuapl.dorset.http.HttpClient; import edu.jhuapl.dorset.http.HttpRequest; import edu.jhuapl.dorset.http.HttpResponse; import static org.junit.Assert.assertEquals; import static ...
/** * Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/l...
HttpClient client = new FakeHttpClient(new FakeHttpResponse(jsonData));
3
bladecoder/blade-ink
src/test/java/com/bladecoder/ink/runtime/test/RuntimeSpecTest.java
[ "public class Profiler {\n\tprivate Stopwatch continueWatch = new Stopwatch();\n\tprivate Stopwatch stepWatch = new Stopwatch();\n\tprivate Stopwatch snapWatch = new Stopwatch();\n\n\tprivate double continueTotal;\n\tprivate double snapTotal;\n\tprivate double stepTotal;\n\n\tprivate String[] currStepStack;\n\tpriv...
import java.util.ArrayList; import java.util.List; import org.junit.Assert; import org.junit.Test; import com.bladecoder.ink.runtime.Profiler; import com.bladecoder.ink.runtime.Story; import com.bladecoder.ink.runtime.Story.ExternalFunction; import com.bladecoder.ink.runtime.Story.ExternalFunction0; import com.bladecod...
package com.bladecoder.ink.runtime.test; public class RuntimeSpecTest { /** * Test external function call. */ @Test public void externalFunction() throws Exception { List<String> text = new ArrayList<>(); String json = TestUtils.getJsonString("inkfiles/runtime/external-function-2-arg.ink.json"); fina...
story.bindExternalFunction("externalFunction", new ExternalFunction2<Integer, Float, Integer>() {
5
neoremind/navi-pbrpc
src/main/java/com/baidu/beidou/navi/pbrpc/client/BlockingIOPbrpcClient.java
[ "public class CallFuture<T> implements Future<T>, Callback<T> {\r\n\r\n /**\r\n * 内部回调用的栅栏\r\n */\r\n private final CountDownLatch latch = new CountDownLatch(1);\r\n\r\n /**\r\n * 调用返回结果\r\n */\r\n private T result = null;\r\n\r\n /**\r\n * 调用错误信息\r\n */\r\n private Throwab...
import io.netty.channel.ChannelFuture; import java.io.InputStream; import java.io.OutputStream; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketException; import java.net.SocketTimeoutException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.baidu.beidou.navi.pbrpc....
package com.baidu.beidou.navi.pbrpc.client; /** * ClassName: BlockingIOPbrpcClient <br/> * Function: 简单的远程访问客户端,使用短连接Blocking IO方式调用服务端,不使用nio * * @author Zhang Xu */ public class BlockingIOPbrpcClient implements PbrpcClient { private static final Logger LOG = LoggerFactory.getLogger(BlockingIOPbrpcClien...
throw new OperationNotSupportException();
3
buni-rock/Pixie
04_Software/03_Development/02_SourceCode/java/src/gui/editobject/BoxEdit.java
[ "public class Constants {\n\n /**\n * Number of objects which can be segmented in the application\n */\n public static final int NUMBER_OF_OBJECTS = 2;\n\n /**\n * The path to the user preferences containing the configuration specific to\n * the user.\n */\n public static final Strin...
import gui.support.CustomTreeNode; import gui.support.Objects; import java.awt.Color; import java.awt.Dimension; import java.awt.Frame; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.image.BufferedImage; import java.util.Arrays; import java.util.List; import java.util.Observable; import library....
// refresh the displayed image displayImage(); // change the title of the frame setFrameTitle(); // refresh also the image on the GUI observable.notifyObservers(ObservedActions.Action.SELECTED_OBJECT_MOVED); } @Override protected void changeObjColor() { ...
updatePreview(workImg, DrawConstants.DrawType.DO_NOT_DRAW, currentObject.getUserPreference().getZoomingIndex());
8
corehunter/corehunter3
corehunter-services/corehunter-services-simple/src/main/java/org/corehunter/services/simple/SimpleCoreHunterRunServices.java
[ "public class CoreHunter {\n\n // defaults\n private static final int DEFAULT_MAX_TIME_WITHOUT_IMPROVEMENT = 10000;\n private static final int FAST_MAX_TIME_WITHOUT_IMPROVEMENT = 2000;\n \n // parallel tempering settings\n private static final int PT_NUM_REPLICAS = 10;\n private static fina...
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; 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 ...
public CoreHunterRun executeCoreHunter(CoreHunterRunArguments arguments) {
4
eckig/graph-editor
api/src/main/java/de/tesis/dynaware/grapheditor/GraphEditor.java
[ "public interface GConnection extends EObject {\n\t/**\n\t * Returns the value of the '<em><b>Id</b></em>' attribute.\n\t * <!-- begin-user-doc -->\n\t * <p>\n\t * If the meaning of the '<em>Id</em>' attribute isn't clear,\n\t * there really should be more of a description here...\n\t * </p>\n\t * <!-- end-user-doc...
import java.util.Collection; import java.util.function.BiFunction; import java.util.function.Function; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.ecore.EObject; import de.tesis.dynaware.grapheditor.model.GConnection; import de.tesis.dynaware.grapheditor.model.GModel; import de.tesis.dynaware....
/* * Copyright (C) 2005 - 2014 by TESIS DYNAware GmbH */ package de.tesis.dynaware.grapheditor; /** * Provides functionality for displaying and editing graph-like diagrams in * JavaFX. * * <p> * Example: * * <pre> * <code>GModel model = GraphFactory.eINSTANCE.createGModel(); * * GraphEditor graphEditor...
void setOnConnectionCreated(Function<GConnection, Command> consumer);
0
cert-se/megatron-java
src/se/sitic/megatron/db/ImportSystemData.java
[ "public class AppProperties {\n // -- Keys in properties file --\n\n // Implicit\n public static final String JOB_TYPE_NAME_KEY = \"implicit.jobTypeName\";\n\n // General\n public static final String LOG4J_FILE_KEY = \"general.log4jConfigFile\";\n public static final String LOG_DIR_KEY = \"general...
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.Method; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import j...
package se.sitic.megatron.db; public class ImportSystemData { private static final Logger log = Logger.getLogger(ImportSystemData.class);
private TypedProperties props;
1
loehndorf/scengen
src/main/java/scengen/paper/QuantizationGridBench.java
[ "public class Generator {\n\t\n\tstatic long _seed = 191;\n\t\n\t/**\n\t * <p>Generate a reduced set of scenarios from a normal, log-normal, or uniform, probability distribution with given parameters.</br>\n\t * Use the following arguments to run the program:</p>\n\t * <ul><li>dist=(Normal, Lognormal, Student, Unif...
import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Map; import java.util.Random; import scengen.application.Generator; import scengen.distribution.MultivariateDistribution; import scengen.distribution.MultivariateNormal; import...
package scengen.paper; public class QuantizationGridBench { static int _sampleSize = 100000; static int _numRepititions = 10; static long _seed = 191; static Random _rand = new Xorshift(_seed); static String filename = "comparison_"+System.nanoTime()+".txt"; static int[][] dimScens = new int[][]{{2,4},{2,40}...
Statistics wasserStat = new Statistics();
6
FabioZumbi12/PixelVip
PixelVip-Spigot/src/main/java/br/net/fabiozumbi12/pixelvip/bukkit/PixelVip.java
[ "public class PackageManager {\n\n private YamlConfiguration packages;\n private PixelVip plugin;\n private File fPack;\n\n public PackageManager(PixelVip plugin) {\n this.plugin = plugin;\n\n packages = new YamlConfiguration();\n fPack = new File(plugin.getDataFolder(), \"packages....
import br.net.fabiozumbi12.pixelvip.bukkit.Packages.PackageManager; import br.net.fabiozumbi12.pixelvip.bukkit.PaymentsAPI.MercadoPagoHook; import br.net.fabiozumbi12.pixelvip.bukkit.PaymentsAPI.PagSeguroHook; import br.net.fabiozumbi12.pixelvip.bukkit.PaymentsAPI.PayPalHook; import br.net.fabiozumbi12.pixelvip.bukkit....
package br.net.fabiozumbi12.pixelvip.bukkit; public class PixelVip extends JavaPlugin implements Listener { public PixelVip plugin; public Server serv; public PluginDescriptionFile pdf; public Essentials ess; public HashMap<String, String> processTrans; private PVLogger logger; private i...
private PackageManager packageManager;
0
sviperll/static-mustache
static-mustache/src/main/java/com/github/sviperll/staticmustache/token/MustacheTokenizer.java
[ "public abstract class MustacheToken {\n public static MustacheToken beginSection(final String name) {\n return new MustacheToken() {\n @Override\n public <R, E extends Exception> R accept(Visitor<R, E> visitor) throws E {\n return visitor.beginSection(name);\n ...
import com.github.sviperll.staticmustache.Position; import com.github.sviperll.staticmustache.PositionedToken; import com.github.sviperll.staticmustache.ProcessingException; import com.github.sviperll.staticmustache.TokenProcessor; import com.github.sviperll.staticmustache.token.util.BracesTokenizer; import com.github....
/* * Copyright (c) 2014, Victor Nazarov <asviraspossible@gmail.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: * * 1. Redistributions of source code must retain the above copyright no...
public void processToken(@Nonnull PositionedToken<BracesToken> positionedToken) throws ProcessingException {
3
epfl-labos/eagle
src/main/java/ch/epfl/eagle/api/EagleFrontendClient.java
[ "public class Network {\n \n public static THostPort socketAddressToThrift(InetSocketAddress address) {\n return new THostPort(address.getAddress().getHostAddress(), address.getPort());\n }\n\n /** Return the hostname of this machine, based on configured value, or system\n * Interrogation. */\n public sta...
import ch.epfl.eagle.daemon.util.Network; import ch.epfl.eagle.daemon.util.TClients; import ch.epfl.eagle.daemon.util.TServers; import ch.epfl.eagle.thrift.FrontendService; import ch.epfl.eagle.thrift.IncompleteRequestException; import ch.epfl.eagle.thrift.SchedulerService; import ch.epfl.eagle.thrift.SchedulerService....
/* * EAGLE * * Copyright 2016 Operating Systems Laboratory EPFL * * Modified from Sparrow - University of California, Berkeley * * 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 * *...
clients.peek().registerFrontend(app, Network.getIPAddress(new PropertiesConfiguration())
0
cjstehno/ersatz
ersatz/src/test/java/io/github/cjstehno/ersatz/impl/RequestMatcherTest.java
[ "public enum HttpMethod {\r\n\r\n /**\r\n * Wildcard matching any HTTP method.\r\n */\r\n ANY(\"*\"),\r\n\r\n /**\r\n * HTTP GET method matcher.\r\n */\r\n GET(\"GET\"),\r\n\r\n /**\r\n * HTTP HEAD method matcher.\r\n */\r\n HEAD(\"HEAD\"),\r\n\r\n /**\r\n * HTTP POS...
import io.github.cjstehno.ersatz.cfg.HttpMethod; import io.github.cjstehno.ersatz.encdec.DecoderChain; import io.github.cjstehno.ersatz.encdec.Decoders; import io.github.cjstehno.ersatz.encdec.RequestDecoders; import io.github.cjstehno.ersatz.match.CookieMatcher; import io.github.cjstehno.ersatz.server.MockClientR...
/** * Copyright (C) 2022 Christopher J. Stehno * * 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 ...
stringIterableMatcher(List.of(equalTo("alpha"), equalTo("blah")))
7
socialize/loopy-sdk-android
test/src/com/sharethis/loopy/test/ApiClientIntegrationTest.java
[ "public abstract class ApiCallback {\n\n /**\n * Called when the API request succeeded.\n * This method executes on the main UI thread.\n * @param result The result from the API call.\n */\n\tpublic abstract void onSuccess(JSONObject result);\n\n /**\n * Called when an unrecoverable error ...
import android.content.Context; import com.sharethis.loopy.sdk.ApiCallback; import com.sharethis.loopy.sdk.ApiClient; import com.sharethis.loopy.sdk.Event; import com.sharethis.loopy.sdk.Item; import com.sharethis.loopy.sdk.Loopy; import com.sharethis.loopy.sdk.LoopyAccess; import com.sharethis.loopy.sdk.LoopyException...
package com.sharethis.loopy.test; /** * tests against the mock API * * @author Jason Polites */ public class ApiClientIntegrationTest extends LoopyAndroidTestCase { ApiClient apiClient; String apiKey = "foobar_api_key"; String apiSecret = "foobar_api_secret"; String stdid = "foobar_stdid"; ...
void doApiCall(ApiClient client, ApiCallback callback) {
0
KodeMunkie/imagetozxspec
src/main/java/uk/co/silentsoftware/core/colourstrategy/GigaScreenPaletteStrategy.java
[ "public class OptionsObject {\n\n\tprivate static final Logger log = LoggerFactory.getLogger(OptionsObject.class);\n\t\n\t/**\n\t * The version of preferences\n\t */\n\t@PreferencesField\n\tprivate int prefsVersion = 1;\n\t\n\t/**\n\t * The number of starts this app has had\n\t */\n\t@PreferencesField\n\tprivate in...
import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; import uk.co.silentsoftware.config.OptionsObject; import uk.co.silentsoftware.config.SpectrumDefaults; import uk.co.silentsoftware.core.attributestrategy.GigaScreenAttributeStrategy; import uk.co.silentsoftware.core.con...
/* Image to ZX Spec * Copyright (C) 2020 Silent Software (Benjamin Brown) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation, either version 3 * of the License, or (at your option) an...
if (x % ATTRIBUTE_BLOCK_SIZE == 0) {
6
CyclopsMC/ColossalChests
src/main/java/org/cyclops/colossalchests/item/ItemUpgradeTool.java
[ "public class Advancements {\n\n public static final ChestFormedTrigger CHEST_FORMED = AdvancementHelpers\n .registerCriteriaTrigger(new ChestFormedTrigger());\n\n public static void load() {}\n\n}", "public class ChestMaterial extends ForgeRegistryEntry<ChestMaterial> {\n\n public static fina...
import com.google.common.collect.Lists; import lombok.Data; import lombok.EqualsAndHashCode; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.mine...
package org.cyclops.colossalchests.item; /** * An item to upgrade chests to the next tier. * @author rubensworks */ @EqualsAndHashCode(callSuper = false) @Data public class ItemUpgradeTool extends Item { private final boolean upgrade; public ItemUpgradeTool(Properties properties, boolean upgrade) { ...
if (blockState.getBlock() instanceof IBlockChestMaterial
4
ArtificialPB/DevelopmentKit
src/com/artificial/cachereader/fs/RT4CacheSystem.java
[ "public enum GameType {\n RT6(\"runescape\"),\n RT4(\"oldschool\");\n\n private final String folderName;\n\n GameType(final String folderName) {\n this.folderName = folderName;\n }\n\n public String getFolderName() {\n return folderName;\n }\n}", "public class ItemDefinitionLoad...
import com.artificial.cachereader.GameType; import com.artificial.cachereader.wrappers.rt4.loaders.ItemDefinitionLoader; import com.artificial.cachereader.wrappers.rt4.loaders.NpcDefinitionLoader; import com.artificial.cachereader.wrappers.rt4.loaders.ObjectDefinitionLoader; import com.artificial.cachereader.wrappers.r...
package com.artificial.cachereader.fs; public class RT4CacheSystem extends CacheSystem<RT4CacheSystem> { public final ItemDefinitionLoader itemLoader; public final ObjectDefinitionLoader objectLoader; public final NpcDefinitionLoader npcLoader;
public final ScriptLoader scriptLoader;
4
olivierlemasle/java-certificate-authority
ca-api/src/main/java/io/github/olivierlemasle/caweb/cli/CreateCertificate.java
[ "public static CsrBuilder createCsr() {\n return new CsrBuilderImpl();\n}", "public static DnBuilder dn() {\n return new DnBuilderImpl();\n}", "public static RootCertificate loadRootCertificate(final String keystorePath,\n final char[] password, final String alias) {\n return RootCertificateLoader.loadRoo...
import static io.github.olivierlemasle.ca.CA.createCsr; import static io.github.olivierlemasle.ca.CA.dn; import static io.github.olivierlemasle.ca.CA.loadRootCertificate; import io.dropwizard.cli.Command; import io.dropwizard.setup.Bootstrap; import io.github.olivierlemasle.ca.Certificate; import io.github.olivierlemas...
package io.github.olivierlemasle.caweb.cli; public class CreateCertificate extends Command { public CreateCertificate() { super("createcert", "Creates a signed certificate."); } @Override public void configure(final Subparser parser) { parser.addArgument("-s", "--subject") .dest("subject") ...
final DistinguishedName dn = dn().setCn(subject).build();
1
ivannov/predcomposer
src/test/java/com/nosoftskills/predcomposer/browser/fixtures/TestDataInserter.java
[ "@Stateless\npublic class CompetitionsService implements Serializable {\n\n public static final String DEFAULT_COMPETITION_NAME = \"Champions League 2016-2017\";\n\n private static final long serialVersionUID = 7432416155835050214L;\n\n @PersistenceContext\n EntityManager entityManager;\n\n private s...
import static com.nosoftskills.predcomposer.user.PasswordHashUtil.hashPassword; import com.nosoftskills.predcomposer.competition.CompetitionsService; import com.nosoftskills.predcomposer.model.Competition; import com.nosoftskills.predcomposer.model.Game; import com.nosoftskills.predcomposer.model.User; import javax.ann...
/* * Copyright 2016 Microprofile.io * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
Competition competition = new Competition(CompetitionsService.DEFAULT_COMPETITION_NAME);
1
KlubJagiellonski/pola-android
app/src/test/java/pl/pola_app/ui/activity/MainPresenterTest.java
[ "public class TestApplication extends Application {\n}", "public class EventLogger {\n\n private Context c;\n\n public EventLogger(Context context) {\n c = context;\n }\n\n public void logSearch(String result, String deviceId, String source) {\n if (!BuildConfig.USE_FIREBASE) {\n ...
import android.os.Bundle; import android.util.Log; import com.squareup.otto.Bus; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; import org.robolectric.annotation.Config; import...
package pl.pola_app.ui.activity; @Config(application = TestApplication.class) @RunWith(RobolectricTestRunner.class) public class MainPresenterTest { @Mock private MainViewBinder viewBinder; @Mock private ProductList productList; @Mock private Api api; @Mock private Bus eventBus; ...
private SessionId sessionId;
2
johndavidbustard/RoughWorld
src/utils/shapes/skinned/Animate.java
[ "public class GeneralMatrixDouble implements Serializable\r\n{\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\tpublic static final double EPSILON=5.9e-8f;\r\n\tpublic int width; //columns\r\n\tpublic int height; //rows\r\n\tpublic double[] value; //array of values\r\n\r\n\tpublic static void main(St...
import utils.GeneralMatrixDouble; import utils.GeneralMatrixFloat; import utils.GeneralMatrixInt; import utils.GeneralMatrixObject; import utils.GeneralMatrixString; import utils.Quaternion; import utils.shapes.human.HumanBones;
pbmat.width = 9; pbmat.height = 1; pbmat.setFromSubset(bmats, pbi); pbmat.width = 3; pbmat.height = 3; } //Calc inverse GeneralMatrixDouble.transpose(pbmat, pbmati); //calc the local matrix //calc the local bmat bmatl.width = 3; bmatl.height = 3; GeneralMatrixDouble...
plog.value[0] += ""+HumanBones.snames[bi]+":"+li+":"+dl+":"+params.value[lind]/HumanBones.DEG2RAD+"\n";
6
zqingyang521/qingyang
QingYangDemo/src/com/example/qingyangdemo/SettingActivity.java
[ "public class AppManager {\n\n\t// activity的堆栈\n\tprivate static Stack<Activity> activityStack;\n\n\tprivate static AppManager instance;\n\n\t/**\n\t * 单例\n\t */\n\tpublic static AppManager getAppManager() {\n\n\t\tif (instance == null) {\n\t\t\tinstance = new AppManager();\n\t\t}\n\t\treturn instance;\n\n\t}\n\n\t...
import java.io.File; import com.example.qingyangdemo.base.AppManager; import com.example.qingyangdemo.base.BaseApplication; import com.example.qingyangdemo.common.FileUtil; import com.example.qingyangdemo.common.UIHelper; import com.example.qingyangdemo.common.UpdateManager; import com.example.qingyangdemo.net.Constant...
package com.example.qingyangdemo; /** * 系统设置类 * * @author 赵庆洋 * */ public class SettingActivity extends PreferenceActivity { private SharedPreferences mPreferences; private BaseApplication myApplication; // 设置Ip private Preference ipset; // 账户 private Preference account; // 清除缓存 private Preferenc...
UIHelper.loginOrLogout(SettingActivity.this);
3
jhy/jsoup
src/test/java/org/jsoup/parser/HtmlParserTest.java
[ "public class Jsoup {\n private Jsoup() {}\n\n /**\n Parse HTML into a Document. The parser will make a sensible, balanced document tree out of any HTML.\n\n @param html HTML to parse\n @param baseUri The URL where the HTML was retrieved from. Used to resolve relative URLs to absolute URLs, tha...
import org.jsoup.Jsoup; import org.jsoup.TextUtil; import org.jsoup.integration.ParseTest; import org.jsoup.internal.StringUtil; import org.jsoup.nodes.*; import org.jsoup.safety.Safelist; import org.jsoup.select.Elements; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.io.ByteArra...
@Test public void handlesJavadocFont() { String h = "<TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A>&nbsp;</TD>"; Document doc = Jsoup.parse(h); Element a = doc.select("a").first(); assertEqu...
StringUtil.normaliseWhitespace(w),
3
gamblore/AndroidPunk
sample/AndroidPunkTest/src/com/gamblore/androidpunk/entities/Ogmo.java
[ "public class Entity extends Tweener {\n\n\tprivate static final String TAG = \"Entity\";\n\t\n /**\n * If the Entity should render.\n */\n public boolean visible = true;\n\n /**\n * If the Entity should respond to collision checks.\n */\n public boolean collidable = true;\n\n /**\n ...
import java.util.Vector; import net.androidpunk.Entity; import net.androidpunk.FP; import net.androidpunk.graphics.atlas.SpriteMap; import net.androidpunk.graphics.atlas.TileMap; import net.androidpunk.graphics.opengl.SubTexture; import net.androidpunk.utils.Input; import android.graphics.Point; import android....
package com.gamblore.androidpunk.entities; public class Ogmo extends Entity { private static final String TAG = "Ogmo"; public static final String TYPE_PLAYER = "player"; private static final int X_SPEED = 200; private static final int MAX_FALL_SPEED = 200; private static final int JUMP_SPEED...
int width = ((TileMap)e.getGraphic()).getTileWidth();
3
crukci-bioinformatics/MGA
src/main/java/org/cruk/mga/report/SummaryPlotter.java
[ "public static final int DEFAULT_PLOT_WIDTH = 800;", "public class AlignmentSummary implements Serializable\n{\n private static final long serialVersionUID = 1121576146340427575L;\n\n private String referenceGenomeId;\n private int alignedCount = 0;\n private int totalAlignedSequenceLength = 0;\n p...
import static org.cruk.mga.MGAConfig.DEFAULT_PLOT_WIDTH; import java.awt.AlphaComposite; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Composite; import java.awt.Font; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.image.BufferedImage; import java.io.BufferedOutputStre...
package org.cruk.mga.report; public class SummaryPlotter { private static final int[] INTERVALS = new int[] {5, 10, 25}; private static final int OPTIMUM_NO_INTERVALS = 6; private static final float ROW_HEIGHT_SCALING_FACTOR = 1.5f; private static final float ROW_GAP_SCALING_FACTOR = 2.0f; priv...
public void createSummaryPlot(MGAConfig mgaConfig,
2
ericleong/forceengine
Force Engine/src/forceengine/demo/objects/Gel.java
[ "public interface Colored {\n\tpublic Color getColor();\n}", "public class CircleMath {\n\t/**\n\t * checks whether or not 2 circles have collided with each other\n\t * \n\t * @param circle1\n\t * the first circle\n\t * @param circle2\n\t * the second circle\n\t * @return whether or not they...
import java.awt.Color; import forceengine.graphics.Colored; import forceengine.math.CircleMath; import forceengine.objects.Circle; import forceengine.objects.ForceCircle; import forceengine.objects.Point; import forceengine.objects.PointVector; import forceengine.objects.RectVector; import forceengine.objects.Vector;
package forceengine.demo.objects; public class Gel extends ForceCircle implements Colored { public static final Color color = new Color(26, 141, 240, 100); public Gel(double x, double y, double vx, double vy, double radius, double mass, double restitution) { super(x, y, vx, vy, radius, mass, restitution); ...
public Vector responsiveAcceleration(PointVector pv, double t, Point b) {
5
TU-Berlin-SNET/JCPABE
src/main/java/cpabe/bsw07/policy/Bsw07PolicyParentNode.java
[ "public class AbeDecryptionException extends GeneralSecurityException {\n\n private static final long serialVersionUID = 2848983353356933397L;\n\n public AbeDecryptionException(String msg) {\n super(msg);\n }\n\n public AbeDecryptionException(String msg, Throwable t) {\n super(msg, t);\n ...
import cpabe.AbeDecryptionException; import cpabe.AbeOutputStream; import cpabe.AbePrivateKey; import cpabe.AbePublicKey; import cpabe.bsw07.Bsw07Polynomial; import it.unisa.dia.gas.jpbc.Element; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import ja...
package cpabe.bsw07.policy; public class Bsw07PolicyParentNode extends Bsw07PolicyAbstractNode { private int threshold; private ArrayList<Bsw07PolicyAbstractNode> children; private ArrayList<Integer> satl; private Bsw07Polynomial poly; private Integer satisfiableChildrenCount = null; public ...
public void fillPolicy(AbePublicKey pub, Element e) {
3
armouroflight/gstreamer1.x-java
src/org/gstreamer/lowlevel/SubtypeMapper.java
[ "public class DurationMessage extends Message {\n private static interface API extends GstMessageAPI {\n Pointer ptr_gst_message_new_duration(GstObject src, Format format, long duration);\n }\n private static final API gst = GstNative.load(API.class);\n \n /**\n * Creates a new Buffering m...
import java.util.HashMap; import java.util.Map; import org.gstreamer.Event; import org.gstreamer.EventType; import org.gstreamer.Message; import org.gstreamer.MessageType; import org.gstreamer.Query; import org.gstreamer.QueryType; import org.gstreamer.event.BufferSizeEvent; import org.gstreamer.event.EOSEvent; import ...
/* * Copyright (c) 2008 Wayne Meissner * * This file is part of gstreamer-java. * * This code is free software: you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License version 3 only, as * published by the Free Software Foundation. * * This code is distributed in t...
put(QueryType.POSITION, PositionQuery.class);
4
sTorro/triviazo
src/com/torrosoft/triviazo/screens/GameScreen.java
[ "public class TriviazoGame extends Game {\n public static final String VERSION = \" - v0.7 ALPHA - \";\n public static final boolean DEBUG_MODE = false;\n public static final boolean FULL_DEBUG_MODE = false;\n\n /* SERVICES */\n private MusicManager musicManager;\n private SoundManager soundManage...
import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Random; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Input...
/* * This file is part of Triviazo project. * * 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 dis...
final List<Discipline> selectedDis = new ArrayList<Discipline>();
3
urbanairship/datacube
src/main/java/com/urbanairship/datacube/idservices/HBaseIdService.java
[ "public interface IdService {\n byte[] getOrCreateId(int dimensionNum, byte[] input, int numIdBytes) throws IOException, InterruptedException;\n\n Optional<byte[]> getId(int dimensionNum, byte[] input, int numIdBytes) throws IOException, InterruptedException;\n\n /**\n * Utilities to make implementatio...
import com.codahale.metrics.Gauge; import com.codahale.metrics.Meter; import com.codahale.metrics.Timer; import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.google.common.collect.Sets; import com.google.common.math.LongMath; import com.urbanairship.datacube.IdService; im...
/* Copyright 2012 Urban Airship and Contributors */ package com.urbanairship.datacube.idservices; public class HBaseIdService implements IdService { private static final Logger log = LoggerFactory.getLogger(HBaseIdService.class); public static final byte[] QUALIFIER = ArrayUtils.EMPTY_BYTE_ARRAY; publi...
final long id = WithHTable.increment(pool, counterTable, counterKey, cf, QUALIFIER, 1L);
2
moxious/neoprofiler
src/main/java/org/mitre/neoprofiler/markdown/MarkdownMaker.java
[ "public class DBProfile extends NeoProfile {\n\tprotected List<NeoProfile> profiles = new ArrayList<NeoProfile>();\n\t\t\n\tpublic DBProfile(String storageLoc) {\t\t\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n\t\tDate date = new Date();\n\t\t\n\t\tname = \"Profile of \" + storageLo...
import java.io.IOException; import java.io.Writer; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import org.mitre.neoprofiler.profile.DBProfile; import org.mitre.neoprofiler.profile.NeoConstraint; import org.mitre.neoprofiler.profile....
package org.mitre.neoprofiler.markdown; /** * A class to write profiles as Markdown. * @author moxious */ public class MarkdownMaker { public MarkdownMaker() { } public String link(String text, String url) { return "[" + text + "](" + url + ")"; } public String h1(String content) { return "\n# " + conte...
if(profile instanceof SchemaProfile) {
4
StumbleUponArchive/hbase
src/test/java/org/apache/hadoop/hbase/MiniHBaseCluster.java
[ "@SuppressWarnings(\"serial\")\npublic class HConnectionManager {\n // An LRU Map of HConnectionKey -> HConnection (TableServer). All\n // access must be synchronized. This map is not private because tests\n // need to be able to tinker with it.\n static final Map<HConnectionKey, HConnectionImplementation> HB...
import org.apache.hadoop.hbase.regionserver.HRegion; import org.apache.hadoop.hbase.regionserver.HRegionServer; import org.apache.hadoop.hbase.security.User; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.JVMClusterUtil; import org.apache.hadoop.hbase.util.Threads; import org.apache.hado...
/** * Copyright 2008 The Apache Software Foundation * * 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...
public static class MiniHBaseClusterRegionServer extends HRegionServer {
3
lingochamp/FileDownloader
library/src/main/java/com/liulishuo/filedownloader/FileDownloadServiceSharedTransmit.java
[ "public class DownloadServiceConnectChangedEvent extends IDownloadEvent {\n public static final String ID = \"event.service.connect.changed\";\n\n public DownloadServiceConnectChangedEvent(final ConnectStatus status,\n final Class<?> serviceClass) {\n super(...
import java.util.ArrayList; import java.util.List; import android.app.Notification; import android.content.Context; import android.content.Intent; import android.os.Build; import com.liulishuo.filedownloader.event.DownloadServiceConnectChangedEvent; import com.liulishuo.filedownloader.model.FileDownloadHeader; import c...
/* * 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 agr...
if (FileDownloadLog.NEED_LOG) FileDownloadLog.d(this, "start foreground service");
7
guiying712/AndroidModulePattern
module_girls/src/main/java/com/guiying/module/girls/data/source/RemoteGirlsDataSource.java
[ "public class DataType {\n\n /*返回数据为String*/\n public static final int STRING = 1;\n /*返回数据为xml类型*/\n public static final int XML = 2;\n /*返回数据为json对象*/\n public static final int JSON_OBJECT = 3;\n /*返回数据为json数组*/\n public static final int JSON_ARRAY = 4;\n\n /**\n * 自定义一个播放器状态注解\n ...
import com.guiying.module.common.http.DataType; import com.guiying.module.common.http.HttpClient; import com.guiying.module.common.http.OnResultListener; import com.guiying.module.girls.Constants; import com.guiying.module.girls.data.GirlsDataSource; import com.guiying.module.girls.data.bean.GirlsParser;
package com.guiying.module.girls.data.source; public class RemoteGirlsDataSource implements GirlsDataSource { @Override public void getGirls(int size, int page, final LoadGirlsCallback callback) { HttpClient client = new HttpClient.Builder() .baseUrl(Constants.GAN_HUO_API) ...
.bodyType(DataType.JSON_OBJECT, GirlsParser.class)
5
iychoi/libra
src/libra/merge/Merge.java
[ "public class CommandArgumentsParser<T extends CommandArgumentsBase> {\n public boolean parse(String[] args, T cmdargs) {\n CmdLineParser parser = new CmdLineParser(cmdargs);\n CmdLineException parseException = null;\n try {\n parser.parseArgument(args);\n } catch (CmdLineE...
import libra.common.cmdargs.CommandArgumentsParser; import libra.merge.common.MergeConfig; import libra.merge.merge.MergeMap; import libra.preprocess.common.filetable.FileTable; import libra.preprocess.common.helpers.FileTableHelper; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; i...
/* * Copyright 2016 iychoi. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in ...
CommandArgumentsParser<MergeCmdArgs> parser = new CommandArgumentsParser<MergeCmdArgs>();
0
PuffOpenSource/Puff-Android
app/src/main/java/sun/bob/leela/App.java
[ "public class AccountHelper {\n private static AccountHelper ourInstance;\n private Context context;\n private DaoMaster daoMaster;\n private DaoSession daoSession;\n private AccountDao accountDao;\n\n public static AccountHelper getInstance(Context context) {\n if (ourInstance == null) {\n...
import android.app.Application; import sun.bob.leela.db.AccountHelper; import sun.bob.leela.db.CategoryHelper; import sun.bob.leela.db.TypeHelper; import sun.bob.leela.utils.CategoryUtil; import sun.bob.leela.utils.EnvUtil; import sun.bob.leela.utils.ResUtil; import sun.bob.leela.utils.UserDefault;
package sun.bob.leela; /** * Created by bob.sun on 16/3/19. */ public class App extends Application { @Override public void onCreate(){ super.onCreate(); AccountHelper.getInstance(getApplicationContext()); CategoryHelper categoryHelper = CategoryHelper.getInstance(getApplicationCont...
TypeHelper typeHelper = TypeHelper.getInstance(getApplicationContext());
2
IYCI/MyClass
app/src/main/java/com/YC2010/MyClass/ui/fragments/SearchScheduleFragment.java
[ "public class CourseInfo {\n private String courseName;\n private String courseNum;\n private String courseSec;\n private String courseTime;\n private String courseLoc;\n private String courseProf;\n private String tutName;\n private String tutNum;\n private String tutTime;\n private S...
import android.app.Activity; import android.app.AlertDialog; import android.app.Fragment; import android.content.DialogInterface; import android.content.res.ColorStateList; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.design.widget.Sn...
package com.YC2010.MyClass.ui.fragments; /** * Created by Danny on 2015/12/26. */ public class SearchScheduleFragment extends Fragment { private Activity mActivity; private View mView; private Bundle mFetchedResult; private boolean mCourseTaken; private String mTakenCourseNumber; @Overrid...
TstListAdapter TstAdapter = new TstListAdapter(mActivity, R.layout.section_item, mFetchedResult);
4
kakao/hbase-tools
hbase0.98/hbase-manager-0.98/src/main/java/com/kakao/hbase/manager/command/MC.java
[ "public abstract class Args {\n public static final String OPTION_REGION = \"region\";\n public static final String OPTION_OUTPUT = \"output\";\n public static final String OPTION_SKIP_EXPORT = \"skip-export\";\n public static final String OPTION_VERBOSE = \"verbose\";\n public static final String OP...
import java.io.IOException; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import com.google.common.annotations.VisibleForTesting; import com.kakao.hbase.common.Args; import com.kakao.hbase.common.Constant; import com.kakao.hbase.common.util.Util; import com.kakao.hbase.specific.CommandAdapter; i...
/* * Copyright 2015 Kakao Corporation * * 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 (!args.isForceProceed() && !Util.askProceed()) return;
2
Martin20150405/Pano360
vrlib/src/main/java/com/martin/ads/vrlib/filters/base/OrthoFilter.java
[ "public enum PanoMode\n{\n MOTION,TOUCH,SINGLE_SCREEN,DUAL_SCREEN\n}", "public class Plane {\n private FloatBuffer mVerticesBuffer;\n private FloatBuffer mTexCoordinateBuffer;\n private final float TRIANGLES_DATA_CW[] = {\n -1.0f, -1.0f, 0f, //LD\n -1.0f, 1.0f, 0f, //LU\n ...
import android.opengl.GLES20; import android.opengl.Matrix; import com.martin.ads.vrlib.constant.PanoMode; import com.martin.ads.vrlib.object.Plane; import com.martin.ads.vrlib.programs.GLPassThroughProgram; import com.martin.ads.vrlib.utils.MatrixUtils; import com.martin.ads.vrlib.utils.StatusHelper; import com.martin...
package com.martin.ads.vrlib.filters.base; /** * Created by Ads on 2016/11/19. * let the image pass through * and simply fit the image to the screen */ public class OrthoFilter extends AbsFilter { private int adjustingMode; private GLPassThroughProgram glPassThroughProgram; private Plane plane; ...
private StatusHelper statusHelper;
4
KMax/cqels
src/main/java/org/deri/cqels/engine/IndexedOnWindowBuff.java
[ "public class EnQuad {\n\tlong gID,sID,pID,oID;\n\tlong time;\n\tpublic EnQuad(long gID,long sID, long pID, long oID){\n\t\tthis.gID=gID;\n\t\tthis.sID=sID;\n\t\tthis.pID=pID;\n\t\tthis.oID=oID;\n\t\ttime=System.nanoTime();\n\t}\n\t\n\tpublic long getGID(){\n\t\treturn gID;\n\t}\n\t\n\tpublic long getSID(){\n\t\tre...
import java.util.ArrayList; import java.util.concurrent.TimeUnit; import org.deri.cqels.data.EnQuad; import org.deri.cqels.data.Mapping; import org.deri.cqels.engine.iterator.MappingIterCursorAll; import org.deri.cqels.engine.iterator.MappingIterCursorByKey; import org.deri.cqels.engine.iterator.MappingIterCursorByRang...
package org.deri.cqels.engine; /** * @author Danh Le Phuoc * @organization DERI Galway, NUIG, Ireland www.deri.ie * @email danh.lephuoc@deri.org */ public class IndexedOnWindowBuff { ExecContext context; Quad quad; Database buff; Op op; OpRouter router; ArrayList<Var> vars; ArrayList<ArrayList<Integer...
vars = Utils.quad2Vars(quad);
7
yunnet/kafkaEagle
src/main/java/org/smartloli/kafka/eagle/web/service/impl/AlarmServiceImpl.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 com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import org.smartloli.kafka.eagle.common.domain.AlarmDomain; import org.smartloli.kafka.eagle.core.factory.Ka...
/** * 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...
private KafkaService kafkaService = new KafkaFactory().create();
2
cjdaly/fold
net.locosoft.fold.channel.fold/src/net/locosoft/fold/channel/fold/internal/FoldChannel.java
[ "public abstract class AbstractChannel implements IChannel, IChannelInternal {\n\n\t//\n\t// IChannel\n\t//\n\n\tprivate String _id;\n\n\tpublic String getChannelId() {\n\t\treturn _id;\n\t}\n\n\tprivate String _description;\n\n\tpublic String getChannelData(String key, String... params) {\n\t\tswitch (key) {\n\t\t...
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.locosoft.fold.channel.AbstractChannel; import net.locosoft.fold.channel.ChannelUtil; import net.locosoft.fold.channel.IChannel; import net.locosoft.f...
/***************************************************************************** * Copyright (c) 2015 Chris J Daly (github user cjdaly) * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and ...
HierarchyNode foldChannelNode = new HierarchyNode(
6
khasang/SmartForecast
Forecast/app/src/main/java/com/khasang/forecast/stations/OpenWeatherMap.java
[ "public class MyApplication extends Application {\n\n private static Context context;\n\n public static Context getAppContext() {\n return MyApplication.context;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n /** Проверяет, если Debug mode, то не отправляет ...
import android.content.SharedPreferences; import android.support.annotation.Nullable; import android.support.v7.preference.PreferenceManager; import com.crashlytics.android.Crashlytics; import com.crashlytics.android.answers.Answers; import com.crashlytics.android.answers.CustomEvent; import com.facebook.stetho.okhttp....
package com.khasang.forecast.stations; /** * Этот класс скачивает и парсит данные с API в фоновом потоке, после чего отправляет их * на UI поток через методы onResponse или onFailure. */ public class OpenWeatherMap extends WeatherStation { private final static String API = "OpenWeaterMap API"; /** ...
public void updateWeather(final LinkedList<ResponseType> requestQueue, final int cityID, final Coordinate
3
andrewoma/dexx
collection/src/test/java/com/github/andrewoma/dexx/collection/mutable/MutableArrayList.java
[ "public interface Builder<E, R> {\n @NotNull\n Builder<E, R> add(E element);\n\n @NotNull\n Builder<E, R> addAll(@NotNull Traversable<E> elements);\n\n @NotNull\n Builder<E, R> addAll(@NotNull java.lang.Iterable<E> elements);\n\n @NotNull\n Builder<E, R> addAll(@NotNull Iterator<E> iterator)...
import java.util.ArrayList; import java.util.Iterator; import com.github.andrewoma.dexx.collection.Builder; import com.github.andrewoma.dexx.collection.BuilderFactory; import com.github.andrewoma.dexx.collection.IndexedList; import com.github.andrewoma.dexx.collection.List; import com.github.andrewoma.dexx.collection.i...
/* * Copyright (c) 2014 Andrew O'Malley * * 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, pub...
public Builder<A, IndexedList<A>> newBuilder() {
0
antest1/kcanotify
app/src/main/java/com/antest1/kcanotify/KcaAkashiListViewItem.java
[ "public static String getItemTranslation(String jp_name) {\n String name = jp_name;\n if (currentLocaleCode.equals(\"jp\")) {\n return jp_name;\n } else if (kcItemTranslationData.has(name)) {\n name = kcItemTranslationData.get(name).getAsString();\n }\n return name;\n}", "public stati...
import android.widget.Toast; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import java.util.ArrayList; import java.util.List; import static com.antest1.kcanotify.KcaApiData.getItemTranslation; import static com.antest1.kcanotify.KcaApiData.getKcItemStatusById; ...
package com.antest1.kcanotify; public class KcaAkashiListViewItem { private int equipId; private JsonObject equipImprovementData; private int equipIconMipmap; private String equipName = ""; private String equipSupport = ""; private String equipMaterials = ""; private String equipScrews ...
ship.add(joinStr(shiplist,"/"));
6
simo415/spc
src/com/sijobe/spc/worldedit/LocalPlayer.java
[ "public interface ICUIEventHandler extends IHook {\n\n /**\n * Handles a CUI Event\n * \n * @param type - the type of CUI Event\n * @param type - the parameters of the CUI Event\n */\n public void handleCUIEvent(String type, String[] params);\n}", "public enum FontColour {\n \n BLACK(\"\\24...
import com.sijobe.spc.core.ICUIEventHandler; import com.sijobe.spc.util.FontColour; import com.sijobe.spc.util.WorldEditCUIHelper; import com.sijobe.spc.wrapper.Coordinate; import com.sijobe.spc.wrapper.Player; import com.sk89q.worldedit.ServerInterface; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.Wor...
package com.sijobe.spc.worldedit; public class LocalPlayer extends com.sk89q.worldedit.LocalPlayer { private Player player; protected LocalPlayer(Player player, ServerInterface server) { super(server); this.player = player; } @Override public String[] getGroups() { // TODO A...
player.sendChatMessage(FontColour.RED + message);
1
dkzwm/SmoothRefreshLayout
app/src/main/java/me/dkzwm/widget/srl/sample/ui/TestQQActivityStyleActivity.java
[ "public abstract class RefreshingListenerAdapter implements SmoothRefreshLayout.OnRefreshListener {\n @Override\n public void onRefreshing() {}\n\n @Override\n public void onLoadingMore() {}\n}", "public class SmoothRefreshLayout extends ViewGroup\n implements NestedScrollingParent3, NestedScro...
import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.view.MenuItem; import android.view.ViewGroup; import android.widget.RadioButton; import android.widget.RadioGroup; import androidx.annotation.IdRes; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCo...
package me.dkzwm.widget.srl.sample.ui; /** * Created by dkzwm on 2017/6/20. * * @author dkzwm */ public class TestQQActivityStyleActivity extends AppCompatActivity implements RadioGroup.OnCheckedChangeListener { private SmoothRefreshLayout mRefreshLayout; private RecyclerView mRecyclerView; pr...
new RefreshingListenerAdapter() {
0
wrey75/WaveCleaner
src/main/java/com/oxande/xmlswing/components/JTextComponentUI.java
[ "public class AttributeDefinition {\r\n\t\r\n\tpublic final static Map<String, String> ALIGNS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CLOSE_OPERATIONS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CURSORS = new HashMap<String, String>();\r\n\tpub...
import javax.swing.text.JTextComponent; import org.w3c.dom.Element; import com.oxande.xmlswing.AttributeDefinition; import com.oxande.xmlswing.AttributesController; import com.oxande.xmlswing.Parser; import com.oxande.xmlswing.AttributeDefinition.ClassType; import com.oxande.xmlswing.UnexpectedTag; import com.ox...
package com.oxande.xmlswing.components; /** * The JTextComponent implementation. * * @author wrey75 * @version $Rev: 85 $ * */ public class JTextComponentUI extends JComponentUI { public static final AttributeDefinition[] PROPERTIES = { new AttributeDefinition( "caretColor", "setCaret...
public String parse(JavaClass jclass, JavaMethod initMethod, Element root ) throws UnexpectedTag{
5
Samourai-Wallet/sentinel-android
app/src/main/java/com/samourai/sentinel/Network.java
[ "public class WebSocketService extends Service {\n\n private Context context = null;\n\n private Timer timer = new Timer();\n private static final long checkIfNotConnectedDelay = 15000L;\n private WebSocketHandler webSocketHandler = null;\n private final Handler handler = new Handler();\n private ...
import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.support.v4.content.ContextCompat; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; impor...
package com.samourai.sentinel; public class Network extends Activity { TextView torRenewBtn; TextView torConnectionStatus; Button torButton; ImageView torConnectionIcon; int activeColor, disabledColor, waiting; CompositeDisposable disposables = new CompositeDisposable(); @Override ...
PrefsUtil.getInstance(getApplicationContext()).setValue(PrefsUtil.ENABLE_TOR, false);
5
ReplayMod/jGui
src/main/java/de/johni0702/minecraft/gui/popup/GuiInfoPopup.java
[ "public interface GuiContainer<T extends GuiContainer<T>> extends ComposedGuiElement<T> {\n\n T setLayout(Layout layout);\n Layout getLayout();\n\n void convertFor(GuiElement element, Point point);\n\n /**\n * Converts the global coordinates of the point to ones relative to the element.\n * @par...
import de.johni0702.minecraft.gui.layout.VerticalLayout; import de.johni0702.minecraft.gui.utils.Colors; import de.johni0702.minecraft.gui.utils.lwjgl.Dimension; import de.johni0702.minecraft.gui.utils.lwjgl.ReadablePoint; import de.johni0702.minecraft.gui.versions.MCVer.Keyboard; import de.johni0702.minecraft.gui.cont...
/* * This file is part of jGui API, licensed under the MIT License (MIT). * * Copyright (c) 2016 johni0702 <https://github.com/johni0702> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Softw...
if (keyCode == Keyboard.KEY_ESCAPE) {
8
reines/game
game-server/src/main/java/com/game/server/handlers/packet/WalkHandler.java
[ "public class Packet {\n\tprivate static final Logger log = LoggerFactory.getLogger(Packet.class);\n\n\tpublic static final int HEADER_SIZE = 4 + 4; // type + size\n\n\tprotected static final CharsetDecoder stringDecoder;\n\n\tstatic {\n\t\tstringDecoder = Charset.forName(\"UTF-8\").newDecoder();\n\t}\n\n\t// X_SEN...
import com.game.common.codec.Packet; import com.game.common.model.Path; import com.game.server.Server; import com.game.server.WorldManager; import com.game.server.handlers.PacketHandler; import com.game.server.model.Player;
package com.game.server.handlers.packet; public class WalkHandler implements PacketHandler { @Override
public void handlePacket(Server server, WorldManager world, Player player, Packet packet) throws Exception {
0
IPEldorado/RemoteResources
src/com/eldorado/remoteresources/ui/model/PersistentDeviceModel.java
[ "public class CaptureManager implements ClientChangedListener {\n\n\tprivate static CaptureManager instance;\n\n\tprivate final ScreenPanel canvas;\n\n\tprivate Client client;\n\n\tprivate String deviceSerialNumber;\n\n\tprivate Device userDevice;\n\n\tprivate boolean isRunning;\n\n\tprivate EventsListener mouseLis...
import com.eldorado.remoteresources.android.client.screencapture.CaptureManager; import com.eldorado.remoteresources.i18n.RemoteResourcesLocalization; import com.eldorado.remoteresources.i18n.RemoteResourcesMessages; import com.eldorado.remoteresources.ui.DevicesContainer; import com.eldorado.remoteresources.ui.HostsCo...
devices.put(device.getName(), device); devicesHistory.put(device.getSerialNumber(), device); } Host host = hosts.get(device.getHost()); if (!host.getDevices().contains(device)) { host.addDevice(device); } if (notifyListeners) { for (DeviceModelChangeListener listener : listeners) { listener....
CaptureManager.getInstance().stopCapture();
0
tkrajina/10000sentences
10000sentencesapp/src/main/java/info/puzz/a10000sentences/tasks/ImporterAsyncTask.java
[ "public class Application extends android.app.Application {\n\n public static DiComponent COMPONENT;\n\n @Override\n public void onCreate() {\n super.onCreate();\n initIconify();\n initActiveAndroid();\n initDagger();\n }\n\n private void initDagger() {\n COMPONENT ...
import android.app.ProgressDialog; import android.content.pm.ActivityInfo; import android.os.AsyncTask; import android.widget.Toast; import com.activeandroid.util.Log; import org.apache.commons.lang3.StringUtils; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.ut...
package info.puzz.a10000sentences.tasks; public class ImporterAsyncTask extends AsyncTask<String, Integer, Void> { private static final java.lang.String TAG = ImporterAsyncTask.class.getSimpleName(); public static final int PROGRESS_EVERY = 50; @Inject Dao dao; private final BaseActivity a...
List<Sentence> sentences = new ArrayList<>();
3
darko1002001/android-rest-client
rest-client-demo/src/main/java/com/dg/examples/restclientdemo/MainActivity.java
[ "public class BlogsGoogleRequest extends RestClientRequest<ResponseModel> {\n\n public static final String TAG = BlogsGoogleRequest.class.getSimpleName();\n\n public BlogsGoogleRequest(String query) {\n super();\n setRequestMethod(RequestMethod.GET);\n setUrl(RestConstants.GOOGLE_BLOGS);\n\n setParser...
import android.app.Activity; import android.os.Bundle; import android.widget.TextView; import android.widget.Toast; import com.dg.examples.restclientdemo.communication.requests.BlogsGoogleRequest; import com.dg.examples.restclientdemo.communication.requests.PatchRequest; import com.dg.examples.restclientdemo.domain.Res...
package com.dg.examples.restclientdemo; public class MainActivity extends Activity { private TextView textViewResponse; private RestClientRequest<ResponseModel> request; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activit...
new PatchRequest("Hello").setCallback(new HttpCallback<Void>() {
3
monkeyk/oauth2-shiro
authz/src/main/java/com/monkeyk/os/oauth/authorize/CodeAuthorizeHandler.java
[ "public class ClientDetails extends BasicClientInfo {\n\n\n /**\n * 客户端所拥有的资源ID(resource-id), 至少有一个,\n * 多个ID时使用逗号(,)分隔, 如: os,mobile\n */\n private String resourceIds;\n\n private String scope;\n\n /**\n * 客户端所支持的授权模式(grant_type),\n * 至少一个, 多个值时使用逗号(,)分隔, 如: password,refresh_token\...
import com.monkeyk.os.domain.oauth.ClientDetails; import com.monkeyk.os.web.WebUtils; import com.monkeyk.os.oauth.OAuthAuthxRequest; import com.monkeyk.os.oauth.validator.AbstractClientDetailsValidator; import com.monkeyk.os.oauth.validator.CodeClientDetailsValidator; import org.apache.oltu.oauth2.as.response.OAuthASRe...
package com.monkeyk.os.oauth.authorize; /** * 2015/6/25 * <p/> * Handle response_type = 'code' * * @author Shengzhao Li */ public class CodeAuthorizeHandler extends AbstractAuthorizeHandler { private static final Logger LOG = LoggerFactory.getLogger(CodeAuthorizeHandler.class); public CodeAuthorizeH...
return new CodeClientDetailsValidator(oauthRequest);
4
SolraBizna/jarm
src/name/bizna/jarmtest/TestDirectory.java
[ "public class AlignmentException extends Exception {\n\tstatic final long serialVersionUID = 1;\n}", "public final class BusErrorException extends Exception {\n\n\tprivate static final long serialVersionUID = 1;\n\n\tprivate final String reason;\n\tprivate final long address;\n\tprivate final AccessType accessTyp...
import java.io.EOFException; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.util.ArrayList; import java.util.List; import name.bizna.jarm.AlignmentException; import name.bizna.jarm...
package name.bizna.jarmtest; public class TestDirectory { public static final String CODE_FILENAME = "code.elf"; public static final int MAX_PROGRAM_SPACE = 1<<30; private File path; private String name; private byte[] programBytes = null, hiBytes = null; private boolean littleEndian = false, hasEntryPoint = f...
catch(BusErrorException e) { /* NOTREACHED */ }
1
janrain/engage.android
Jump/src/com/janrain/android/engage/JREngage.java
[ "public class JRProvider implements Serializable {\n public static final String KEY_FRIENDLY_NAME = \"friendly_name\";\n public static final String KEY_INPUT_PROMPT = \"input_prompt\";\n public static final String KEY_OPENID_IDENTIFIER = \"openid_identifier\";\n public static final String KEY_URL = \"ur...
import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.Fr...
// * @param hostActivity The android.support.v4.app.FragmentActivity which will host the publishing fragment // * @param containerId The resource ID of a FrameLayout to embed the publishing fragment in // */ //public void showSocialSignInFragment(FragmentActivity hostActivity, // ...
private JRSessionDelegate mJrsd = new JRSessionDelegate.SimpleJRSessionDelegate() {
2
jeffsvajlenko/BigCloneEval
src/tasks/EvaluateRecall.java
[ "public interface CloneMatcher {\n\tpublic boolean isDetected(Clone clone) throws SQLException;\n\tpublic void close() throws SQLException;\n\t\n\tpublic static String getTableName(long toolid) {\n\t\treturn \"tool_\" + toolid + \"_clones\";\n\t}\n\t\n\tpublic static CloneMatcher load(long toolid, String clazz, Str...
import cloneMatchingAlgorithms.CloneMatcher; import cloneMatchingAlgorithms.CoverageMatcher; import database.Clones; import database.Tool; import database.Tools; import evaluate.ToolEvaluator; import picocli.CommandLine; import util.FixPath; import java.io.FileWriter; import java.io.PrintWriter; import java.nio.file.Fi...
package tasks; @CommandLine.Command( name = "evaluateRecall", description = "Measures the recall of the clones given. Highly configureable." + "Summarizes recall per clone type, per inter vs intra-project clones, per functionality in " + "BigCloneBench and for differe...
ToolEvaluator te = new ToolEvaluator(toolID,
7
jboss-logging/jboss-logmanager
ext/src/test/java/org/jboss/logmanager/ext/PropertyConfigurationTests.java
[ "public abstract class ExtHandler extends Handler implements AutoCloseable, Flushable {\n\n private static final ErrorManager DEFAULT_ERROR_MANAGER = new OnlyOnceErrorManager();\n private static final Permission CONTROL_PERMISSION = new LoggingPermission(\"control\", null);\n\n private volatile boolean aut...
import java.io.PrintWriter; import java.io.Reader; import java.io.StringWriter; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Properties; im...
/* * JBoss, Home of Professional Open Source. * * Copyright 2018 Red Hat, Inc., and individual contributors * as indicated by the @author tags. * * 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 Li...
private LogContext logContext;
2
NanYoMy/mybatis-generator
src/main/java/org/mybatis/generator/codegen/ibatis2/dao/elements/DeleteByExampleMethodGenerator.java
[ "public class FullyQualifiedJavaType implements\n Comparable<FullyQualifiedJavaType> {\n private static final String JAVA_LANG = \"java.lang\"; //$NON-NLS-1$\n private static FullyQualifiedJavaType intInstance = null;\n private static FullyQualifiedJavaType stringInstance = null;\n private static...
import java.util.Set; import java.util.TreeSet; import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType; import org.mybatis.generator.api.dom.java.Interface; import org.mybatis.generator.api.dom.java.JavaVisibility; import org.mybatis.generator.api.dom.java.Method; import org.mybatis.generator.api.dom.java.Par...
/* * Copyright 2008 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 app...
Method method = getMethodShell(importedTypes);
2
rodhilton/jasome
src/main/java/org/jasome/metrics/calculators/TypeAggregatorCalculator.java
[ "public class Method extends Code {\n private final MethodDeclaration declaration;\n\n public final static Method UNKNOWN = new Method();\n\n private Method() {\n super(\"unknownMethod\");\n this.declaration = null;\n }\n\n public Method(MethodDeclaration declaration) {\n super(d...
import com.google.common.collect.ImmutableSet; import org.jasome.input.Method; import org.jasome.input.Type; import org.jasome.metrics.Calculator; import org.jasome.metrics.Metric; import org.jasome.metrics.value.NumericValue; import org.jasome.metrics.value.NumericValueSummaryStatistics; import java.util.Optional; imp...
package org.jasome.metrics.calculators; public class TypeAggregatorCalculator implements Calculator<Type> { @Override
public Set<Metric> calculate(Type type) {
3
AEminium/AeminiumRuntime
src/aeminium/runtime/implementations/implicitworkstealing/datagroup/FifoDataGroup.java
[ "public interface DataGroup {}", "public final class Configuration {\n\tprotected static final String GLOBAL_PREFIX = \"global.\";\n\tprotected static int processorCount;\n\tprotected static String implementation;\n\tprotected static final Properties properties; \n\t\n\tstatic {\n\t\tString filename = System.gete...
import aeminium.runtime.utils.graphviz.GraphViz.Color; import aeminium.runtime.utils.graphviz.GraphViz.LineStyle; import java.util.LinkedList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import aeminium.runtime.DataGroup; import aeminium.runtime.implementations.Configuration; import aeminiu...
/** * Copyright (c) 2010-11 The AEminium Project (see AUTHORS file) * * This file is part of Plaid Programming Language. * * Plaid Programming Language 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, e...
for ( DataGroup dg : atomicParent.getDataGroupDependencies() ) {
0
OpherV/gitflow4idea
src/main/java/gitflow/ui/GitflowOpenTaskPanel.java
[ "public class GitflowBranchUtil {\n\n Project myProject;\n GitRepository myRepo;\n\n private String currentBranchName;\n private String branchnameMaster;\n private String branchnameDevelop;\n private String prefixFeature;\n private String prefixRelease;\n private String prefixHotfix;\n pr...
import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.project.Project; import com.intellij.openapi.vcs.VcsTaskHandler; import com.intellij.tasks.LocalTask; import com.intellij.tasks.Task; import com.intellij.tasks.TaskManager; import com.intellij.tasks.impl.TaskManagerImpl; import com.intel...
package gitflow.ui; public class GitflowOpenTaskPanel extends TaskDialogPanel implements ItemListener { private JRadioButton noActionRadioButton; private JRadioButton startFeatureRadioButton; private JRadioButton startHotfixRadioButton; private JTextField featureName; private JComboBox featureBa...
private void attachTaskAndRunAction(GitflowAction action, String baseBranchName, final String fullBranchName) {
4
kontalk/desktopclient-java
src/main/java/org/kontalk/view/ContactDetails.java
[ "public final class JID {\n private static final Logger LOGGER = Logger.getLogger(JID.class.getName());\n\n static {\n // good to know. For working JID validation\n SimpleXmppStringprep.setup();\n }\n\n private final String mLocal; // escaped!\n private final String mDomain;\n privat...
import javax.swing.Box; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.GradientPaint; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.ActionEvent; import java.awt.e...
/* * Kontalk Java client * Copyright (C) 2016 Kontalk Devteam <devteam@kontalk.org> * * 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 ...
groupPanel.add(new WebLabel(Tr.tr("Contact details")).setBoldFont());
2
larusba/doc2graph
neo4j-json/src/main/java/org/neo4j/helpers/json/document/impl/DocumentGrapherRecursive.java
[ "public interface DocumentGrapher {\n\n\t/**\n\t * Create and re-use node and relations\n\t * @param key\n\t * @param document\n\t * @return id of root node\n\t */\n\t@SuppressWarnings(\"rawtypes\")\n\tNode upsertDocument(String key, Map document);\n\t\n\t/**\n\t * Remove non shared node and relationships regarding...
import org.neo4j.helpers.json.document.DocumentId; import org.neo4j.helpers.json.document.DocumentIdBuilder; import org.neo4j.helpers.json.document.DocumentLabelBuilder; import org.neo4j.helpers.json.document.DocumentRelationBuilder; import org.neo4j.helpers.json.document.context.DocumentGrapherExecutionContext; import...
/** * Copyright (c) 2017 LARUS Business Automation [http://www.larus-ba.it] * <p> * This file is part of the "LARUS Integration Framework for Neo4j". * <p> * The "LARUS Integration Framework for Neo4j" is licensed * under the Apache License, Version 2.0 (the "License"); * you may not use this file except in comp...
private DocumentLabelBuilder documentLabelBuilder;
3
lesstif/jira-rest-client
src/test/java/com/lesstif/jira/services/IssueTest.java
[ "public class JsonPrettyString {\n\t\n\tfinal public String toPrettyJsonString() {\n\t\tObjectMapper mapper = new ObjectMapper();\n\n\t\tmapper.configure(SerializationFeature.INDENT_OUTPUT, true);\n\t\t\n\t\tStringWriter sw = new StringWriter();\n\t\ttry {\n\t\t\tmapper.writeValue(sw, this);\n\t\t} catch (IOExcepti...
import java.io.File; import java.io.IOException; import java.util.List; import java.util.Map; import org.apache.commons.configuration.ConfigurationException; import org.junit.BeforeClass; import org.junit.FixMethodOrder; import org.junit.runners.MethodSorters; import org.junit.Test; import org.slf4j.Logger; import org....
package com.lesstif.jira.services; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class IssueTest { private Logger logger = LoggerFactory.getLogger(getClass()); static String PROJECT_KEY = null; static String ISSUE_KEY = null; static String REPORTER = null; static String ASSIGNEE = null; @Bef...
Issue issue = new Issue();
2
agilie/dribbble-android-sdk
dribbble-sdk-library/src/main/java/com/agilie/dribbblesdk/service/retrofit/DribbbleWebServiceHelper.java
[ "public interface DribbbleBucketsService {\n\n /**\n * Get a bucket\n *\n * @param bucketId Bucket ID\n *\n * @return Network operation result\n */\n @GET(\"buckets/{id}\")\n Call<Bucket> getBucket(@Path(\"id\") long bucketId);\n\n /**\n * Create a bucket.\n * C...
import com.agilie.dribbblesdk.service.retrofit.services.DribbbleBucketsService; import com.agilie.dribbblesdk.service.retrofit.services.DribbbleProjectsService; import com.agilie.dribbblesdk.service.retrofit.services.DribbbleShotsService; import com.agilie.dribbblesdk.service.retrofit.services.DribbbleTeamsService; imp...
package com.agilie.dribbblesdk.service.retrofit; public class DribbbleWebServiceHelper { public static String DRIBBBLE_URL = "https://api.dribbble.com/v1/"; public static DribbbleBucketsService getDribbbleBucketService(Retrofit retrofit) { DribbbleBucketsService service = retrofit.create(Dribb...
public static DribbbleTeamsService getDribbbleTeamService(Retrofit retrofit) {
3
MCUpdater/MCUpdater
MCU-API/src/org/mcupdater/util/MCLegacyAuth.java
[ "public class Version {\n\tpublic static final int MAJOR_VERSION;\n\tpublic static final int MINOR_VERSION;\n\tpublic static final int BUILD_VERSION;\n\tpublic static final String BUILD_BRANCH;\n\tpublic static final String BUILD_LABEL;\n\tstatic {\n\t\tProperties prop = new Properties();\n\t\ttry {\n\t\t\tprop.loa...
import java.util.HashMap; import java.util.logging.Level; import org.mcupdater.Version; import org.mcupdater.model.LoginData; import org.mcupdater.util.HTTPSUtils; import org.mcupdater.util.MCLoginException; import org.mcupdater.util.MCLoginException.ResponseType;
package org.mcupdater.util; public class MCLegacyAuth { public static LoginData login(String username, String password) throws Exception { try { HashMap<String, Object> localHashMap = new HashMap<String, Object>(); localHashMap.put("user", username); localHashMap.put("password", password); localHashMa...
if (!Version.isMasterBranch()) {
0
jeick/jamod
src/main/java/net/wimpi/modbus/io/ModbusBINTransport.java
[ "public interface Modbus {\n\n\t/**\n\t * JVM flag for debug mode. Can be set passing the system property\n\t * net.wimpi.modbus.debug=false|true (-D flag to the jvm).\n\t */\n\tpublic static final boolean debug = \"true\".equals(System\n\t\t\t.getProperty(\"net.wimpi.modbus.debug\"));\n\n\t/**\n\t * Defines the cl...
import net.wimpi.modbus.Modbus; import net.wimpi.modbus.ModbusCoupler; import net.wimpi.modbus.ModbusIOException; import net.wimpi.modbus.util.ModbusUtil; import net.wimpi.modbus.msg.ModbusMessage; import net.wimpi.modbus.msg.ModbusRequest; import net.wimpi.modbus.msg.ModbusResponse; import java.io.DataInputStream; imp...
/*** * Copyright 2002-2010 jamod development team * * 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...
public void writeMessage(ModbusMessage msg) throws ModbusIOException {
4
occi4java/occi4java
http/src/main/java/occi/http/OcciRestNetworkInterface.java
[ "public class OcciConfig extends XMLConfiguration {\n\tprivate static final long serialVersionUID = 1L;\n\tprivate static final Logger LOGGER = LoggerFactory\n\t\t\t.getLogger(OcciConfig.class);\n\t/**\n\t * Instance of OcciConfig\n\t */\n\tprivate static OcciConfig instance = null;\n\tprivate static ConfigurationF...
import java.util.HashMap; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; import java.util.UUID; import occi.config.OcciConfig; import occi.core.Kind; import occi.core.Mixin; import occi.http.check.OcciCheck; import occi.infrastructure.Network; import occi.infrastructure.Network.State;...
if (requestHeaders.getFirstValue(acceptCase).equals("text/occi")) { // generate header rendering occiCheck.setHeaderRendering(null, networkinterface, buffer .toString(), buffer2); // set right representation and status code getResponse().setEntity(representation); getResponse().setStatus(Status.S...
networkInterface.setKind(new Kind(null, "networkinterface",
1
protolambda/blocktopograph
app/src/main/java/com/protolambda/blocktopograph/WorldActivity.java
[ "public enum Dimension {\n\n OVERWORLD(0, \"overworld\", \"Overworld\", 16, 16, 128, 1, MapType.OVERWORLD_SATELLITE),\n NETHER(1, \"nether\", \"Nether\", 16, 16, 128, 8, MapType.NETHER),\n END(2, \"end\", \"End\", 16, 16, 128, 1, MapType.END_SATELLITE);//mcpe: SOON^TM /jk\n\n public final int id;\n p...
import android.app.AlertDialog; import android.app.FragmentManager; import android.app.FragmentTransaction; import android.content.Context; import android.content.DialogInterface; import android.os.Build; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v7.app.ActionBar; i...
public void openMultiplayerEditor(){ //takes some time to find all players... // TODO make more responsive // TODO maybe cache player keys for responsiveness? // Or messes this too much with the first perception of present players? final String[] players = getWorld().ge...
final CompoundTag workCopy = world.level.getDeepCopy();
7
otto-de/jlineup
core/src/test/java/de/otto/jlineup/report/HTMLReportWriterTest.java
[ "@JsonDeserialize(builder = ScreenshotContext.Builder.class)\npublic final class ScreenshotContext {\n public final String url;\n public final String urlSubPath;\n public final DeviceConfig deviceConfig;\n public final List<Cookie> cookies;\n @JsonIgnore\n public final Step step;\n @JsonIgnore...
import com.google.common.collect.ImmutableMap; import de.otto.jlineup.browser.ScreenshotContext; import de.otto.jlineup.config.DeviceConfig; import de.otto.jlineup.config.JobConfig; import de.otto.jlineup.config.Step; import de.otto.jlineup.config.UrlConfig; import de.otto.jlineup.file.FileService; import org.junit.Bef...
package de.otto.jlineup.report; public class HTMLReportWriterTest { private HTMLReportWriter testee; @Mock private FileService fileServiceMock; private final List<ScreenshotComparisonResult> screenshotComparisonResults = singletonList(new ScreenshotComparisonResult(1887, "someurl/somepath", Devic...
when(fileServiceMock.getRecordedContext(anyInt())).thenReturn(ScreenshotContext.of("someUrl", "somePath", DeviceConfig.deviceConfig(1337,200), Step.before, UrlConfig.urlConfigBuilder().build()));
3
palominolabs/benchpress
examples/multi-db/mongodb/src/main/java/com/palominolabs/benchpress/example/multidb/mongodb/MongoDbTaskFactory.java
[ "public abstract class TaskFactoryBase {\n protected final ValueGeneratorFactory valueGeneratorFactory;\n protected final KeyGeneratorFactory keyGeneratorFactory;\n protected final TaskOperation taskOperation;\n protected final int numThreads;\n protected final int numQuanta;\n protected final int...
import com.google.common.collect.Lists; import com.mongodb.DB; import com.mongodb.Mongo; import com.palominolabs.benchpress.example.multidb.task.TaskFactoryBase; import com.palominolabs.benchpress.example.multidb.key.KeyGeneratorFactory; import com.palominolabs.benchpress.job.task.TaskFactory; import com.palominolabs.b...
package com.palominolabs.benchpress.example.multidb.mongodb; final class MongoDbTaskFactory extends TaskFactoryBase implements TaskFactory { private final String hostname; private final int port; private final String dbName; private String collectionName; private Mongo mongo; MongoDbTaskFact...
@Nonnull ScopedProgressClient progressClient) throws IOException {
5
copygirl/copycore
src/net/mcft/copy/core/client/gui/GuiConfigBase.java
[ "public class Config extends AbstractConfig {\n\t\n\tprivate final File file;\n\tprivate final Configuration forgeConfig;\n\t\n\tprivate final Map<Setting, Object> settingValues = new HashMap<Setting, Object>();\n\tprivate final Map<String, String> categoryComments = new HashMap<String, String>();\n\t\n\tprivate fi...
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.mcft.copy.core.config.Config; import net.mcft.copy.core.config.SettingInfo; import net.mcft.copy.core.config.setting.BooleanSetting; import net.mcft.copy.core.config.setting.DoubleSetting; import net.mcft.copy....
package net.mcft.copy.core.client.gui; @SideOnly(Side.CLIENT) public abstract class GuiConfigBase extends GuiConfig { public final Config config; public GuiConfigBase(GuiScreen parentScreen, String id, String configId, String title, Config config) { super(parentScreen, getElementsFor(config, id), configId, f...
if (setting instanceof BooleanSetting) return ConfigGuiType.BOOLEAN;
2
kinabalu/mysticpaste
web/src/main/java/com/mysticcoders/mysticpaste/web/pages/admin/OverviewPage.java
[ "@Entity(\"pastes\")\n@Message\npublic class PasteItem implements Serializable {\n private static final long serialVersionUID = -6467870857777145137L;\n private static Logger logger = LoggerFactory.getLogger(PasteItem.class);\n private static SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy\");\n\n...
import com.mysticcoders.mysticpaste.model.PasteItem; import com.mysticcoders.mysticpaste.services.PasteService; import com.mysticcoders.mysticpaste.web.components.highlighter.HighlighterPanel; import com.mysticcoders.mysticpaste.web.pages.BasePage; import com.mysticcoders.mysticpaste.web.pages.history.HistoryDataProvid...
package com.mysticcoders.mysticpaste.web.pages.admin; /** * Paste Admin * * @author Andrew Lombardi <andrew@mysticcoders.com> */ public class OverviewPage extends BasePage { @SpringBean PasteService pasteService; DataView historyDataView; private final int ITEMS_PER_PAGE = 50; private int ...
final HistoryDataProvider historyDataProvider = new HistoryDataProvider(pasteService);
4
zhouruikevin/ImageLoadPK
imageloadpk/src/main/java/com/example/imageloadpk/model/MainActivity.java
[ "public class FrescoAdapter extends ImageListAdapter {\n\n\n public FrescoAdapter(Context context, WatchListener watchListener) {\n super(context, watchListener);\n Fresco.initialize(context, FrescoConfigFactory.getImagePipelineConfig(context));\n }\n\n @Override\n public RecyclerView.View...
import android.os.Bundle; import android.os.Handler; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.RadioButton; impor...
package com.example.imageloadpk.model; public class MainActivity extends AppCompatActivity { private static final String TAG = "MainActivity"; @Bind(R.id.recyclerView) RecyclerView mRecyclerView; @Bind(R.id.refreshLayout) SwipeRefreshLayout mRefreshLayout; @Bind(R.id.tvShowInfo) TextView...
loadData(new FrescoAdapter(this, mWatchListener));
0
RedditAndroidDev/Tamagotchi
Tamagotchi/src/com/redditandroiddevelopers/tamagotchi/TamagotchiConfiguration.java
[ "public class CreatureDao {\n private CommonDatabase<Creature> db;\n private Mapper<Creature> rowMapper;\n\n public CreatureDao(CommonDatabase<Creature> database,\n Mapper<Creature> mapper) {\n db = database;\n rowMapper = mapper;\n }\n\n public Creature create(Creature creat...
import com.badlogic.gdx.Application; import com.badlogic.gdx.graphics.Color; import com.redditandroiddevelopers.tamagotchi.dao.CreatureDao; import com.redditandroiddevelopers.tamagotchi.dao.CreatureEvolutionDao; import com.redditandroiddevelopers.tamagotchi.dao.CreatureRaiseTypeDao; import com.redditandroiddevelopers.t...
package com.redditandroiddevelopers.tamagotchi; /** * A place to store runtime configuration for use throughout the lifetime of a * {@link TamagotchiGame} object. Not to be confused with a store for game * settings. * * @author Santoso Wijaya */ public class TamagotchiConfiguration { public boolean debug...
public SicknessDao sicknessDao;
6
kennylbj/concurrent-java
src/main/java/producerconsumer/Main.java
[ "public class BlockingQueueConsumer implements Consumer<Item>, Runnable {\n private final BlockingQueue<Item> buffer;\n private final Random random = new Random(System.nanoTime());\n\n public BlockingQueueConsumer(BlockingQueue<Item> buffer) {\n this.buffer = buffer;\n }\n\n @Override\n pub...
import producerconsumer.blockingqueue.BlockingQueueConsumer; import producerconsumer.blockingqueue.BlockingQueueProducer; import producerconsumer.condition.ConditionConsumer; import producerconsumer.condition.ConditionProducer; import producerconsumer.semaphore.SemaphoreConsumer; import producerconsumer.semaphore.Semap...
package producerconsumer; /** * Created by kennylbj on 16/9/10. * Implement 3 versions of P/C * 1) use Semaphore * 2) use Condition * 3) use BlockingQueue * All versions support multiple producers and consumers */ public class Main { private static final int BUFFER_SIZE = 100; private static final int...
pool.execute(new SemaphoreConsumer(semaphoreBuffer, fullCount, emptyCount));
4
codelibs/fess-suggest
src/main/java/org/codelibs/fess/suggest/index/contents/DefaultContentsParser.java
[ "public interface SuggestAnalyzer {\n List<AnalyzeToken> analyze(String text, String field, String lang);\n\n List<AnalyzeToken> analyzeAndReading(String text, String field, String lang);\n}", "public interface ReadingConverter {\n default int getMaxReadingNum() {\n return 10;\n }\n\n void i...
import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import org.codelibs.core.lang.StringUtil; import org.codelibs.fess.suggest.analysis.SuggestAnalyzer; import org.codelibs.fess.suggest.converter.ReadingConverter; import org.codelibs.fess.suggest...
/* * Copyright 2012-2022 CodeLibs Project and the Others. * * 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 SuggestItem parseSearchWords(final String[] words, final String[][] readings, final String[] fields, final String[] tags,
2