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
funktionio/funktion-connectors
funktion-agent/src/main/java/io/fabric8/funktion/agent/SubscribeRequest.java
[ "@JsonInclude(JsonInclude.Include.NON_EMPTY)\npublic abstract class DtoSupport {\n\n\n}", "public class Flow extends DtoSupport {\n private String name;\n private Boolean trace;\n private Boolean logResult;\n private Boolean singleMessageMode;\n private List<Step> steps = new ArrayList<>();\n\n ...
import static io.fabric8.utils.Lists.notNullList; import io.fabric8.funktion.model.DtoSupport; import io.fabric8.funktion.model.Flow; import io.fabric8.funktion.model.Funktion; import io.fabric8.funktion.model.steps.Endpoint; import io.fabric8.funktion.model.steps.Step; import io.fabric8.utils.Strings; import org.slf4j...
/* * Copyright 2016 Red Hat, Inc. * <p> * Red Hat licenses this file to you under the Apache License, version * 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless requ...
List<Step> steps = notNullList(flow.getSteps());
4
52North/Supervisor
core/src/main/java/org/n52/supervisor/SupervisorInit.java
[ "@XmlRootElement\npublic abstract class Check {\n\n private String identifier;\n\n private String notificationEmail;\n\n protected String type = \"GenericCheck\";\n\n /*\n * injects only work on objects created by Guice.\n * this is most likely not the case for Checkers.\n */\n// @Inject\...
import org.slf4j.LoggerFactory; import com.google.inject.Inject; import com.google.inject.Singleton; import com.google.inject.name.Named; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.concurrent.Executo...
/** * Copyright (C) 2013 - 2014 52°North Initiative for Geospatial Open Source Software GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LIC...
CheckRunner runner = this.cr.getRunner(c);
1
1014277960/DailyReader
app/src/main/java/com/wulinpeng/daiylreader/rank/view/RankDetailActivity.java
[ "public class BookShortAdapter extends RecyclerView.Adapter {\n private Context context;\n\n private List<BookShort> data;\n\n private LayoutInflater inflater;\n\n public static final int TYPE_NORMAL = 0;\n\n public static final int TYPE_FOOTER = 1;\n\n public BookShortAdapter(Context context, Lis...
import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.MenuItem; ...
package com.wulinpeng.daiylreader.rank.view; /** * @author wulinpeng * @datetime: 17/2/20 下午4:16 * @description: */ public class RankDetailActivity extends BaseActivity implements IRankDetailView { @BindView(R.id.common_toolbar) public Toolbar toolbar; @BindView(R.id.refresh_layout) public Sw...
private IRankDetailPresenter presenter;
2
thlcly/Mini-JVM
src/main/java/com/aaront/exercise/jvm/commands/GoToCommand.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.ConstantPool; import com.aaront.exercise.jvm.engine.ExecutionResult; import com.aaront.exercise.jvm.engine.NextAction; import com.aaront.exercise.jvm.engine.StackFrame; import com.aaront.exercise.jvm.utils.string.ByteUtils; import java.ut...
package com.aaront.exercise.jvm.commands; /** * @author tonyhui * @since 2017/8/23 */ public class GoToCommand extends TwoOperandCommand { public GoToCommand(ClassFile clzFile, String opCode, int operand1, int operand2) { super(clzFile, opCode, operand1, operand2); } @Override public Stri...
public void execute(StackFrame frame, ExecutionResult result) {
2
webbit/webbit
src/test/java/org/webbitserver/handler/StaticFileHandlerTest.java
[ "public class StubHttpControl implements HttpControl {\n\n private HttpRequest request;\n private HttpResponse response;\n private WebSocketHandler webSocketHandler;\n private WebSocketConnection webSocketConnection;\n\n public StubHttpControl() {\n }\n\n public StubHttpControl(HttpRequest requ...
import org.junit.After; import org.junit.Before; import org.junit.Test; import org.webbitserver.WebServer; import org.webbitserver.stub.StubHttpControl; import org.webbitserver.stub.StubHttpRequest; import org.webbitserver.stub.StubHttpResponse; import java.io.File; import java.io.FileWriter; import java.io.IOException...
assertReturnedWithStatusAndContainsContent(200, "a.foo", handle(request("/"))); mkdir("a"); writeFile("a/a.foo", ""); assertReturnedWithStatus(301, handle(request("/a"))); assertReturnedWithStatusAndContainsContent(200, "a.foo", handle(request("/a/"))); } @Test ...
assertEquals("Hello world", contents(httpGet(webServer, "/index.html")));
5
cattaka/AdapterToolbox
example/src/main/java/net/cattaka/android/adaptertoolbox/example/NestedScrambleAdapterExampleActivity.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.view.View; import net.cattaka.android.a...
package net.cattaka.android.adaptertoolbox.example; /** * Created by cattaka on 16/05/02. */ public class NestedScrambleAdapterExampleActivity extends AppCompatActivity { ListenerRelay<ScrambleAdapter<?>, RecyclerView.ViewHolder> mListenerRelay = new ListenerRelay<ScrambleAdapter<?>, RecyclerView.ViewHolder>...
viewHolderViewHolderFactories.add(new CodeLableViewHolderFactory(getResources()));
2
lesstif/jira-rest-client
src/main/java/com/lesstif/jira/project/Project.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.time.LocalDateTime; import java.util.List; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;...
package com.lesstif.jira.project; /** * @see <a href="https://docs.atlassian.com/software/jira/docs/api/REST/latest/#d2e86">/rest/api/2/project</a> * * @author lesstif * */ @Data @EqualsAndHashCode(callSuper=false) @JsonIgnoreProperties({"assigneeType", "roles" }) public class Project extends JsonPrettyString...
private Lead lead;
3
rvep/dev_backend
src/main/java/io/abnd/rvep/security/service/impl/RvepJwtGenerator.java
[ "@Repository\npublic interface RvepUserRoleDAO extends JpaRepository<RvepUserRole, Integer> {\n\n\t/**\n\t * \n\t * @param id\n\t * @return\n\t */\n\tRvepUserRole findById(int id);\n\n\t/**\n\t *\n\t * @param id\n\t * @return\n\t */\n\tRvepUserRole findByRvepUserId(int id);\n\t\n}", "@Entity\n@Table(name=\"rvep_r...
import io.abnd.rvep.security.dao.intf.RvepUserRoleDAO; import io.abnd.rvep.security.model.RvepRole; import io.abnd.rvep.security.model.RvepUserRole; import io.abnd.rvep.security.service.intf.JwtGenerator; import io.abnd.rvep.user.dao.intf.RvepUserProfileDAO; import io.abnd.rvep.user.model.RvepUser; import io.jsonwebtok...
package io.abnd.rvep.security.service.impl; @Service public class RvepJwtGenerator implements JwtGenerator {
private RvepUserRoleDAO rvepUserRoleDAO;
0
Nilhcem/devoxxfr-2016
app/src/main/java/com/nilhcem/devoxxfr/data/database/dao/SessionsDao.java
[ "@Singleton\npublic class LocalDateTimeAdapter {\n\n private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\", Locale.US);\n\n @Inject\n public LocalDateTimeAdapter() {\n }\n\n @ToJson\n public String toText(LocalDateTime dateTime) {\n return dateTime.for...
import android.database.Cursor; import com.nilhcem.devoxxfr.core.moshi.LocalDateTimeAdapter; import com.nilhcem.devoxxfr.data.app.SelectedSessionsMemory; import com.nilhcem.devoxxfr.data.database.DbMapper; import com.nilhcem.devoxxfr.data.database.model.SelectedSession; import com.nilhcem.devoxxfr.data.database.model.S...
package com.nilhcem.devoxxfr.data.database.dao; @Singleton public class SessionsDao { private final BriteDatabase database; private final DbMapper dbMapper; private final SpeakersDao speakersDao; private final LocalDateTimeAdapter adapter; private final SelectedSessionsMemory selectedSession...
public Observable<List<com.nilhcem.devoxxfr.data.app.model.Session>> getSessions() {
4
paphus/Project-Libre
android/examples/Brain Bot/src/com/paphus/sdk/activity/ViewUserActivity.java
[ "public abstract class HttpAction extends AsyncTask<Void, Void, String> {\t\n\tprotected Activity activity;\n\tprotected Exception exception;\n\n\tpublic HttpAction(Activity activity) {\n\t\tthis.activity = activity;\n\t}\n\t\t\n\tpublic Exception getException() {\n\t\treturn exception;\n\t}\n\n\tpublic void setExc...
import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android....
} public void resetView() { UserConfig user = MainActivity.viewUser; if (user == null) { return; } setTitle(user.user); TextView text = (TextView) findViewById(R.id.userText); text.setText(user.user); text = (TextView) findViewById(R...
HttpAction action = new HttpFlagUserAction(ViewUserActivity.this, MainActivity.viewUser);
2
uber-java/tally
example/src/main/java/com/uber/m3/tally/example/PrintStatsReporterExample.java
[ "public interface Counter {\n /**\n * Increment this {@link Counter} by delta.\n * @param delta amount to increment this {@link Counter} by\n */\n void inc(long delta);\n}", "public class ScopeCloseException extends Exception {\n public ScopeCloseException() {\n super();\n }\n\n ...
import com.uber.m3.tally.Counter; import com.uber.m3.tally.ScopeCloseException; import com.uber.m3.util.Duration; import com.uber.m3.tally.Gauge; import com.uber.m3.tally.RootScopeBuilder; import com.uber.m3.tally.Scope; import com.uber.m3.tally.StatsReporter; import com.uber.m3.tally.Timer;
// Copyright (c) 2021 Uber Technologies, Inc. // // 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...
try (Scope rootScope = new RootScopeBuilder().reporter(reporter).reportEvery(Duration.ofSeconds(1))) {
5
jahlborn/jackcessencrypt
src/main/java/com/healthmarketscience/jackcess/crypt/impl/OfficeCryptCodecHandler.java
[ "public class InvalidCredentialsException extends IllegalStateException\n{\n private static final long serialVersionUID = 20170130L;\n\n public InvalidCredentialsException(String msg) {\n super(msg);\n }\n\n}", "public class InvalidCryptoConfigurationException extends IllegalStateException\n{\n private sta...
import java.io.IOException; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.util.function.Supplier; import com.healthmarketscience.jackcess.crypt.InvalidCredentialsException; import com.healthmarketscience.jackcess.crypt.InvalidCryptoConfigurationException; import com.healthmarketscience.jackce...
/* Copyright (c) 2013 James Ahlborn Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwa...
handler = new NonStandardEncryptionProvider(channel, encodingKey,
5
arquillian/arquillian-recorder
arquillian-recorder-video-base/arquillian-recorder-video-impl-base/src/main/java/org/arquillian/extension/recorder/video/VideoExtension.java
[ "public class DefaultVideoStrategy implements VideoStrategy {\n\n private VideoConfiguration configuration;\n\n @Override\n public void setConfiguration(VideoConfiguration configuration) {\n Validate.notNull(configuration, \"Video configuration can not be a null object!\");\n this.configurati...
import org.arquillian.extension.recorder.video.impl.DefaultVideoStrategy; import org.arquillian.extension.recorder.video.impl.InTestVideoResourceReportObserver; import org.arquillian.extension.recorder.video.impl.RecorderProvider; import org.arquillian.extension.recorder.video.impl.SkippingVideoStrategy; import org.arq...
/* * JBoss, Home of Professional Open Source * Copyright 2013, Red Hat, Inc. and/or its affiliates, and individual * contributors by the @authors tag. See the copyright.txt in the * distribution for a full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * y...
builder.observer(VideoLifecycleObserver.class);
4
gesellix/Nimbus-JOSE-JWT
src/test/java/com/nimbusds/jose/crypto/MACTest.java
[ "@Immutable\npublic final class JOSEObjectType implements JSONAware {\n\n\n\t/**\n\t * JWS object type.\n\t */\n\tpublic static final JOSEObjectType JWS = new JOSEObjectType(\"JWS\");\n\t\n\t\n\t/**\n\t * JWE object type.\n\t */\n\tpublic static final JOSEObjectType JWE = new JOSEObjectType(\"JWE\");\n\t\n\t\n\t/**...
import junit.framework.TestCase; import com.nimbusds.jose.JOSEObjectType; import com.nimbusds.jose.JWSAlgorithm; import com.nimbusds.jose.JWSHeader; import com.nimbusds.jose.JWSObject; import com.nimbusds.jose.JWSSigner; import com.nimbusds.jose.JWSVerifier; import com.nimbusds.jose.Payload; import com.nimbusds.jose.ut...
package com.nimbusds.jose.crypto; /** * Tests HS256 JWS signing and verfication. Uses test vectors from JWS spec. * * @author Vladimir Dzhuvinov * @version $version$ (2012-10-23) */ public class MACTest extends TestCase { private static final byte[] sharedSecret = { (byte) 3, (byte) 35, (byte) 53...
JWSSigner signer = new MACSigner(sharedSecret);
4
flexiblepower/fpai-core
flexiblepower.ral.efi.utils/src/org/flexiblepower/api/efi/bufferhelper/BufferActuator.java
[ "public class Actuator {\n private final int actuatorId;\n private final String actuatorLabel;\n private final CommoditySet supportedCommodities;\n\n /**\n * @param actuatorId\n * A unique identifier for this actuator. The identifier only has to be unique within the context of the\n ...
import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import javax.measure.Measurable; import javax.measure.quantity.Power; import javax.measure.quantity.Quantity; import org...
package org.flexiblepower.api.efi.bufferhelper; /** * The BufferActuator that integrates updated EFI messages and provides additional methods. * * @param <Q> * The quantity type of the buffer */ public class BufferActuator<Q extends Quantity> { private final int actuatorId; private final Str...
private Map<Integer, RunningMode<FillLevelFunction<RunningModeBehaviour>>> allRunningModes = new HashMap<Integer, RunningMode<FillLevelFunction<RunningModeBehaviour>>>();
1
lukeweber/webrtc-jingle-client
android/voice-client-example/src/main/java/com/tuenti/voice/example/ui/buddy/BuddyActivity.java
[ "public abstract class BuddyCallback\n extends IBuddyServiceCallback.Stub\n{\n// ------------------------------ FIELDS ------------------------------\n\n private static final String TAG = \"BuddyCallback\";\n\n private Activity mActivity;\n\n private IBuddyService mService;\n\n private boolean mServi...
import android.content.Intent; import android.os.Bundle; import android.support.v4.content.Loader; import android.view.View; import android.widget.ListView; import com.actionbarsherlock.app.ActionBar; import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuItem; import com.github.kevinsawicki.wish...
package com.tuenti.voice.example.ui.buddy; public class BuddyActivity extends ItemListActivity<Buddy> { // ------------------------------ FIELDS ------------------------------ private BuddyCallback mBuddyCallback; private CallCallback mCallCallback; private ConnectionCallback mConnectionCallback;...
private Call mCurrentCall;
4
signalfx/signalfx-java
signalfx-java/src/main/java/com/signalfx/metrics/SendMetrics.java
[ "public interface MetricError {\n /**\n * A code value that represents the type of error\n * @return MetricErrorType code for the error\n */\n MetricErrorType getMetricErrorType();\n\n /**\n * Human readable message describing the error.\n * @return Easy to read message describing the e...
import com.google.common.base.Preconditions; import com.signalfx.metrics.errorhandler.MetricError; import java.io.FileInputStream; import java.net.URL; import java.util.Collections; import java.util.Date; import java.util.Properties; import com.signalfx.endpoint.SignalFxEndpoint; import com.signalfx.endpoint.SignalFxRe...
package com.signalfx.metrics; /** * An example application to test sending metrics with this library. * * @author jack * @author max */ public final class SendMetrics { private SendMetrics() {} public static void main(String[] args) throws Exception { Properties prop = new Properties(); ...
new HttpDataPointProtobufReceiverFactory(endpoint).setVersion(2),
4
OpenJunction/JavaJunction
src/main/java/edu/stanford/junction/provider/xmpp/Junction.java
[ "@Deprecated\npublic class ActivityScript {\n\t\n\t/**\n\t * Note that there is probably a lot of confusing code in here\n\t * due to our redefinition of the Activity Description.\n\t * \n\t * The new setup:: there is an ActivityDescription that details\n\t * roles / platforms / codebases, and a SessionDescriptio...
import java.net.URI; import java.net.URLEncoder; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.jivesoftware.smack.Chat; import org.jivesoftware.smack.PacketListener; import org.jivesoftware.smack.XMPPConnect...
/* * Copyright (C) 2010 Stanford University * * 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 sendMessageToTarget(MessageTarget target, JSONObject message) {
5
janoliver/pOT-Droid
src/main/java/com/mde/potdroid/fragments/EditorFragment.java
[ "public abstract class AsyncHttpLoader<E> extends Loader<E> {\n\n // the calling activity\n protected Context mActivity;\n final Handler mUiThreadHandler = new Handler();\n\n // request type codes\n public static final Integer GET = 0;\n public static final Integer POST = 1;\n public static fin...
import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.os.Bundle; import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; ...
} return result; } @Override protected void onNetworkFailure(int statusCode, Header[] headers, String responseBody, Throwable error) { Utils.printException(error); deliverResult(null); } } ...
public static class BBCodeHandler implements ActionMenuView.OnMenuItemClickListener, PromptDialog.SuccessCallback, IconSelectionDialog.IconSelectedCallback {
6
gizwits/Gizwits-SmartSocket_Android
src/com/gizwits/framework/activity/onboarding/SearchDeviceActivity.java
[ "public final class CaptureActivity extends BaseActivity implements\n\t\tSurfaceHolder.Callback {\n\n\tprivate static final String TAG = CaptureActivity.class.getSimpleName();\n\n\tprivate CameraManager cameraManager;\n\tprivate CaptureActivityHandler handler;\n\tprivate InactivityTimer inactivityTimer;\n\n\tprivat...
import java.util.ArrayList; import java.util.List; import zxing.CaptureActivity; import android.app.Dialog; import android.app.ProgressDialog; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import...
/** * Project Name:XPGSdkV4AppBase * File Name:SearchDeviceActivity.java * Package Name:com.gizwits.framework.activity.onboarding * Date:2015-1-27 14:46:15 * Copyright (c) 2014~2015 Xtreme Programming Group, Inc. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and a...
noNetworkDialog = DialogManager.getNoNetworkDialog(this);
3
bunjlabs/Fuga-Framework
framework/src/main/java/com/bunjlabs/fuga/handlers/DefaultRequestHandler.java
[ "public abstract class FugaApp {\n\n private final Logger log = LogManager.getLogger(this);\n\n private final DependencyManager dependencyManager;\n private final ResourceManager resourceManager;\n private final Configuration configuration;\n private final Router router;\n\n private final SessionM...
import com.bunjlabs.fuga.FugaApp; import com.bunjlabs.fuga.dependency.Inject; import com.bunjlabs.fuga.foundation.Context; import com.bunjlabs.fuga.foundation.Request; import com.bunjlabs.fuga.foundation.Response; import com.bunjlabs.fuga.router.Router; import org.apache.logging.log4j.LogManager; import org.apache.logg...
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distribu...
private final FugaApp app;
0
davidmoten/rtree
src/test/java/com/github/davidmoten/rtree/fbs/SerializerFlatBuffersTest.java
[ "public interface Entry<T, S extends Geometry> extends HasGeometry {\n\n T value();\n\n @Override\n S geometry();\n\n}", "public class GreekEarthquakes {\n\n public static Observable<Entry<Object, Point>> entries(final Precision precision) {\n Observable<String> source = Observable.using(new Fu...
import static org.junit.Assert.assertEquals; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import org.junit.Test; import com.github.davidmoten.rtree.Entry; import com.github.davidmoten.rt...
package com.github.davidmoten.rtree.fbs; public class SerializerFlatBuffersTest { private static final byte[] EMPTY = new byte[] {}; @Test public void testSerializeRoundTripToFlatBuffersSingleArray() throws Exception { roundTrip(InternalStructure.SINGLE_ARRAY, false); } @Test pu...
Observable<Entry<Object, Point>> o = tr.search(Geometries.rectangle(40, 27.0, 40.5, 27.5));
6
hschott/Camdroid
app/src/main/java/org/hschott/camdroid/FrameProcessors.java
[ "public interface FrameDrawer {\n\tpublic void drawBitmap(Bitmap bitmap);\n\n\tpublic DisplayMetrics getDisplayMetrics();\n}", "public class AdaptiveThresholdProcessor extends AbstractOpenCVFrameProcessor {\n\n private static int reduction = 0;\n private static int blocksize = 15;\n\n public static class...
import org.hschott.camdroid.OnCameraPreviewListener.FrameDrawer; import org.hschott.camdroid.processor.AdaptiveThresholdProcessor; import org.hschott.camdroid.processor.CannyEdgesProcessor; import org.hschott.camdroid.processor.CascadeClassifierProcessor; import org.hschott.camdroid.processor.NormalizeGrayProcessor; im...
package org.hschott.camdroid; public enum FrameProcessors { ColorSpace, NormalizeGray, AdaptiveThreshold, CannyEdges, UnsharpenMask, MovementDetection, CascadeClassifier, OCR; public FrameProcessor newFrameProcessor(FrameDrawer drawer) { switch (this.ordinal()) { case 0:
return new ColorSpaceProcessor(drawer);
6
coverity/pie
pie-sm/src/main/java/com/coverity/security/pie/policy/securitymanager/fact/JmxMBeanMemberFactMetaData.java
[ "public class EqualityStringMatcher implements StringMatcher {\n \n private static final EqualityStringMatcher instance = new EqualityStringMatcher();\n \n private EqualityStringMatcher() {\n }\n \n public static EqualityStringMatcher getInstance() {\n return instance;\n }\n\n @Ove...
import com.coverity.security.pie.core.EqualityStringMatcher; import com.coverity.security.pie.core.FactMetaData; import com.coverity.security.pie.core.NullStringCollapser; import com.coverity.security.pie.core.PolicyConfig; import com.coverity.security.pie.core.StringCollapser;
package com.coverity.security.pie.policy.securitymanager.fact; public class JmxMBeanMemberFactMetaData implements FactMetaData { private static final JmxMBeanMemberFactMetaData instance = new JmxMBeanMemberFactMetaData(); private JmxMBeanMemberFactMetaData() { } public static JmxMBeanMember...
return NullStringCollapser.getInstance();
2
cert-se/megatron-java
src/se/sitic/megatron/decorator/AsnGeoIpDecorator.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.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.log4j.Logger; import se.sitic.megatron.core.AppProperties; import se.sitic.megatron.core.JobContext; import se.sitic.megatron.core.MegatronException; import se.sitic.megatron...
package se.sitic.megatron.decorator; /** * Adds AS number and name if missing and ip-address exists. * <p> * Using MaxMind's free ASN database. * <p> * One alternative is the AsnDecorator, which uses imported data from a BPG table. * AsnDecorator is more precise but needs BPG data. AsnGeoIpDecorator will ret...
useAsnInLogEntry = props.getBoolean(AppProperties.DECORATOR_USE_ASN_IN_LOG_ENTRY_KEY, true);
0
850759383/ZhihuDailyNews
app/src/main/java/com/yininghuang/zhihudailynews/detail/ZhihuNewsDetailPresenter.java
[ "public class ZhihuNewsContent {\n\n /**\n * body : html\n * image_source : Yestone.com 版权图片库\n * title : 食物中的色彩秘密,悄悄地影响着我们的食欲与健康\n * image : http://pic2.zhimg.com/bc5e570d8917680f1bfa11280e4a93e9.jpg\n * share_url : http://daily.zhihu.com/story/8890064\n * js : []\n * ga_prefix : 101...
import android.content.Intent; import com.google.gson.Gson; import com.yininghuang.zhihudailynews.model.ZhihuNewsContent; import com.yininghuang.zhihudailynews.model.db.Favorite; import com.yininghuang.zhihudailynews.net.Api; import com.yininghuang.zhihudailynews.net.RetrofitHelper; import com.yininghuang.zhihudailynew...
package com.yininghuang.zhihudailynews.detail; /** * Created by Yining Huang on 2016/10/19. */ public class ZhihuNewsDetailPresenter implements ZhihuNewsDetailContract.Presenter { private ZhihuNewsDetailContract.View mView; private ZhihuDailyService mService; private DBManager mDBManager;
private CacheManager mCacheManager;
6
yangshuai0711/dingding-app-server
dingding-app-server-web/src/main/java/com/mocoder/dingding/web/interceptor/EncryptParameterValidateInterceptor.java
[ "public class EncryptionConstant {\n public static final String HEADER_PARAM_SIGN_PRIVATE_KEY = \"66666\";\n public static final String DES_ENCRYPT_PRIVATE_KEY = \"40010011\";\n}", "public class RequestAttributeKeyConstant {\n public static final String REQUEST_ATTRIBUTE_KEY_COMMON_REQUEST = \"REQUEST_AT...
import com.mocoder.dingding.constants.EncryptionConstant; import com.mocoder.dingding.constants.RequestAttributeKeyConstant; import com.mocoder.dingding.enums.ErrorTypeEnum; import com.mocoder.dingding.utils.encryp.EncryptUtils; import com.mocoder.dingding.utils.web.WebUtil; import com.mocoder.dingding.vo.CommonRequest...
package com.mocoder.dingding.web.interceptor; /** * 加密参数请求拦截器(重要或者限制性操作如获取短信验证码等,不需要登录) * Created by yangshuai3 on 2016/1/28. */ public class EncryptParameterValidateInterceptor extends BaseParamValidateInterceptor { @Override protected boolean validate(HttpServletRequest request, HttpServletResponse res...
CommonRequest req = (CommonRequest) request.getAttribute(RequestAttributeKeyConstant.REQUEST_ATTRIBUTE_KEY_COMMON_REQUEST);
5
indvd00m/java-ascii-render
ascii-render/src/test/java/com/indvd00m/ascii/render/tests/plot/TestPlot.java
[ "public class Region implements IRegion {\n\n\tprotected int x;\n\tprotected int y;\n\tprotected int width;\n\tprotected int height;\n\n\tpublic Region(int x, int y, int width, int height) {\n\t\tsuper();\n\t\tif (width < 0) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tif (height < 0) {\n\t\t\tthrow n...
import com.indvd00m.ascii.render.Region; import com.indvd00m.ascii.render.Render; import com.indvd00m.ascii.render.api.ICanvas; import com.indvd00m.ascii.render.api.IContextBuilder; import com.indvd00m.ascii.render.api.IRender; import com.indvd00m.ascii.render.elements.plot.Plot; import com.indvd00m.ascii.render.elemen...
package com.indvd00m.ascii.render.tests.plot; /** * @author indvd00m (gotoindvdum[at]gmail[dot]com) * @since 1.0.0 */ public class TestPlot { @Before public void setUpLocale() throws Exception { Locale.setDefault(Locale.ENGLISH); } @Test public void test01() {
List<IPlotPoint> points = new ArrayList<IPlotPoint>();
6
tommai78101/PokemonWalking
game/src/main/java/level/OverWorld.java
[ "public class Debug {\n\tstatic class NotYetImplemented {\n\t\tprivate int occurrences = 0;\n\t\tprivate final String location;\n\n\t\tpublic NotYetImplemented(String loc) {\n\t\t\tthis.location = loc;\n\t\t}\n\n\t\tpublic boolean grab(String loc) {\n\t\t\tif (this.location.equals(loc) && !this.hasReachedLimit()) {...
import java.awt.Graphics; import java.util.ArrayList; import java.util.List; import common.Debug; import common.Tileable; import entity.Player; import error.GameException; import interfaces.UpdateRenderable; import main.Game; import screen.Scene;
/** * Open-source Game Boy inspired game. * * Created by tom_mai78101. Hobby game programming only. * * All rights copyrighted to The Pokémon Company and Nintendo. */ package level; public class OverWorld implements Tileable, UpdateRenderable { // Overworld properties. protected Player player; protected...
Debug.warn("Area: " + this.currentArea.getAreaID() + " Sector: " + this.currentArea.getSectorID());
0
robneild/pocket-query-creator
app/src/main/java/org/pquery/service/PQService.java
[ "public class Main extends AppCompatActivity implements PQClickedListener, PQServiceListener, ProgressBoxFragmentListener {\n\n private static final int CREATE_REQUEST_CODE = 1;\n private static final int DOWNLOAD_REQUEST_CODE = 2;\n\n private boolean doDialog;\n private boolean onSaveInstanceStateCalle...
import android.app.PendingIntent; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.LocationManager; import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.os.PowerManager; import com.google.android.gms.comm...
Assert.assertNull(createPQAsync); wakeLock = ((PowerManager) getSystemService(Context.POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "PocketQuery"); wakeLock.acquire(); notificationUtil.startInProgressNotification(getString(R.string.creating_pq), "", getPendingIntent())...
Intent intent = new Intent(this, Main.class);
0
LTTPP/Eemory
org.lttpp.eemory/src/org/lttpp/eemory/oauth/OAuth.java
[ "public final class Constants {\n\n private Constants() {\n\n }\n\n public static final String EVERNOTE_INTERNATIONAL = \"Evernote International\";\n public static final String EVERNOTE_YINXIANG = \"印象笔记\";\n public static final String EVERNOTE_SANDBOX = \"Evernote Sandbox\";\n\n // Command IDs\n ...
import java.net.MalformedURLException; import java.net.URL; import java.util.LinkedHashMap; import org.apache.commons.lang3.StringUtils; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PartInitException; import org.eclipse.ui.Pla...
package org.lttpp.eemory.oauth; public class OAuth { private static final String CONSUMER_KEY = "eevernote"; private static final String CONSUMER_SECRET = "kmLkG5Z1dFnBAam5oqie9NgHqN2zfojd+lg/00GRroU="; private final CallbackHandler callback; public OAuth() throws Exception { callback = ne...
btns.put(Constants.Plugin_OAuth_Copy, Messages.Plugin_OAuth_Copy);
1
janoliver/pOT-Droid
src/main/java/com/mde/potdroid/fragments/BookmarkFragment.java
[ "public class TopicActivity extends BaseActivity {\n\n private TopicFragment mTopicFragment;\n private Integer mTopicId = 0;\n private Integer mPage = 1;\n private Integer mPostId = 0;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);...
import android.content.Context; import android.content.Intent; import android.graphics.Paint; import android.os.Bundle; import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import andro...
super.onRefresh(direction); restartLoader(this); } @Override public Loader<BookmarkParser.BookmarksContainer> onCreateLoader(int id, Bundle args) { AsyncContentLoader l = new AsyncContentLoader(getBaseActivity()); showLoadingAnimation(); return l; } @Overrid...
Intent intent = new Intent(getBaseActivity(), TopicActivity.class);
0
xSAVIKx/openweathermap-java-api
api-examples/src/main/java/org/openweathermap/api/example/CurrentWeatherMultipleLocationsExample.java
[ "public interface DataWeatherClient extends WeatherClient {\n\n CurrentWeather getCurrentWeather(CurrentWeatherOneLocationQuery query);\n\n List<CurrentWeather> getCurrentWeather(CurrentWeatherMultipleLocationsQuery query);\n\n ForecastInformation<HourlyForecast> getForecastInformation(HourlyForecastQuery ...
import org.openweathermap.api.DataWeatherClient; import org.openweathermap.api.UrlConnectionDataWeatherClient; import org.openweathermap.api.common.Coordinate; import org.openweathermap.api.model.currentweather.CurrentWeather; import org.openweathermap.api.query.Language; import org.openweathermap.api.query.QueryBuilde...
/* * Copyright 2021, Yurii Serhiichuk * * 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 agree...
List<CurrentWeather> currentWeatherList = client.getCurrentWeather(inCycle);
3
Petschko/Java-RPG-Maker-MV-Decrypter
src/main/java/org/petschko/rpgmakermv/decrypt/gui/About.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.JImageLabel; import org.petschko.lib.gui.JLabelExtra; import org.petschko.lib.gui.JPanelLine; import org.petschko.rpgmakermv.decrypt.Config; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JComponent; i...
package org.petschko.rpgmakermv.decrypt.gui; /** * @author Peter Dragicevic */ class About extends org.petschko.lib.gui.GUI_About { /** * Creates a new, initially invisible <code>Frame</code> with the * specified title. * <p> * This constructor sets the component's locale property to the value * returne...
JPanelLine versionLine = new JPanelLine();
3
BubbleOctopus/Album
app/src/main/java/app/com/cn/album/presenter/MainPresenterImpl.java
[ "public class CommentUtils {\n public static final boolean isDebug = true;\n\n public static void d(String tag, String log) {\n if (isDebug)\n Log.d(tag, log);\n }\n\n\n public static void e(String tag, String log) {\n if (isDebug)\n Log.e(tag, log);\n }\n\n pu...
import android.content.Context; import android.util.Log; import android.view.View; import app.com.cn.album.CommentUtils; import app.com.cn.album.MainActivity; import app.com.cn.album.MainInteractor; import app.com.cn.album.factory.AbstractFragmentFactory; import app.com.cn.album.factory.FragmentObjFactory; import app.c...
package app.com.cn.album.presenter; /** * 作者:ArMn on 2016/3/3 * 邮箱:859686819@qq.com */ public class MainPresenterImpl implements MainPresenter { private static final String TAG = MainActivity.class.getSimpleName(); private FragmentObjFactory mFragmentFactory; private Context mContext = null; pri...
public MainPresenterImpl(View content, MainInteractor interactor, AbstractFragmentFactory fragment) {
3
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...
if (viewHolder instanceof FizzViewHolderFactory.ViewHolder) {
4
WojciechZankowski/iextrading4j-hist
iextrading4j-hist-api/src/test/java/pl/zankowski/iextrading4j/hist/api/message/administrative/IEXShortSalePriceTestStatusMessageTest.java
[ "public enum IEXMessageType implements IEXByteEnum {\n\n QUOTE_UPDATE((byte) 0x51),\n TRADE_REPORT((byte) 0x54),\n TRADE_BREAK((byte) 0x42),\n SYSTEM_EVENT((byte) 0x53),\n SECURITY_DIRECTORY((byte) 0x44),\n TRADING_STATUS((byte) 0x48),\n OPERATIONAL_HALT_STATUS((byte) 0x4f),\n SHORT_SALE_PRI...
import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.jupiter.api.Test; import pl.zankowski.iextrading4j.api.util.ToStringVerifier; import pl.zankowski.iextrading4j.hist.api.IEXMessageType; import pl.zankowski.iextrading4j.hist.api.message.administrative.field.IEXDetail; import pl.zankowski.iextrading4j.hist.a...
package pl.zankowski.iextrading4j.hist.api.message.administrative; class IEXShortSalePriceTestStatusMessageTest { @Test void constructor() { final IEXShortSalePriceTestStatus shortSalePriceTestStatus = IEXShortSalePriceTestStatus.PRICE_TEST_IN_EFFECT; final long timestamp = 14948550592874361...
final IEXDetail detail = IEXDetail.PRICE_TEST_RESTRICTION_DEACTIVATED;
1
univieCUBE/gepard
src/org/gepard/client/userinterface/InfoPanel.java
[ "public class Config extends DefaultHandler {\n\t\n\tprivate static Config instance=null;\n\tprivate static String configFile=null;\n\t\n\tprivate HashMap<String,String> settings;\n\t\n\tpublic static void setConfigFile(String file) throws Exception {\n\t\tif (instance == null) {\n\t\t\tconfigFile = file; \n\t\t\t/...
import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.image.BufferedImage; import java.util.ArrayList; import java.util.Arra...
1000, fm.getHeight()); // draw selection bufferGraphics.setColor(Color.BLACK); bufferGraphics.drawString(toDraw, COORDINATES_X,COORDINATES_Y+fm.getAscent()); // cause repaint this.repaint(); } public void showAlignment(byte[] seq1, byte[] seq2, int offset1, int offset2, int arrlength1, in...
}else if (Config.getInstance().getIntVal("NeedlemanWunsch", 0) == 1) {
2
lukas-krecan/JsonUnit
json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java
[ "public class Configuration {\n private static final DifferenceListener DUMMY_LISTENER = (difference, context) -> {};\n\n private static final String DEFAULT_IGNORE_PLACEHOLDER = \"${json-unit.ignore}\";\n private static final String ALTERNATIVE_IGNORE_PLACEHOLDER = \"#{json-unit.ignore}\";\n private st...
import net.javacrumbs.jsonunit.core.Configuration; import net.javacrumbs.jsonunit.core.ConfigurationWhen.ApplicableForPath; import net.javacrumbs.jsonunit.core.ConfigurationWhen.PathsParam; import net.javacrumbs.jsonunit.core.Option; import net.javacrumbs.jsonunit.core.internal.Diff; import net.javacrumbs.jsonunit.core...
/** * Copyright 2009-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
public static Configuration when(PathsParam subject, ApplicableForPath... actions) {
2
redfin/validity
src/test/java/com/redfin/validity/ValidityUtilsTest.java
[ "public abstract class AbstractDescriptivePredicate {\n\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n // Constants\n // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n /**\n * The String token that must be part of the...
import com.redfin.validity.predicates.AbstractDescriptivePredicate; import com.redfin.validity.predicates.DescriptiveDoublePredicate; import com.redfin.validity.predicates.DescriptiveIntPredicate; import com.redfin.validity.predicates.DescriptiveLongPredicate; import com.redfin.validity.predicates.DescriptivePredicate;...
/* * Copyright: (c) 2016 Redfin * * 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 w...
DescriptiveLongPredicate predicate = new DescriptiveLongPredicate(AbstractDescriptivePredicate.TOKEN, t -> t > 0);
3
OpenMods/OpenPeripheral-Addons
src/main/java/openperipheral/addons/glasses/server/TerminalManagerServer.java
[ "public class Config {\n\t@OnLineModifiable\n\t@ConfigProperty(category = \"sensor\", name = \"rangeInStorm\")\n\tpublic static int sensorRangeInStorm = 5;\n\n\t@OnLineModifiable\n\t@ConfigProperty(category = \"sensor\", name = \"normalRange\")\n\tpublic static int sensorRange = 5;\n\n\t@OnLineModifiable\n\t@Config...
import com.google.common.base.Optional; import com.google.common.collect.MapMaker; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent.Phase; import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent; import j...
package openperipheral.addons.glasses.server; public class TerminalManagerServer { private TerminalManagerServer() {} public static final TerminalManagerServer instance = new TerminalManagerServer(); private final Map<Long, TileEntityGlassesBridge> listeners = new MapMaker().weakValues().makeMap(); private sta...
public void onGlassesEvent(GlassesClientEvent evt) {
2
CMPUT301F14T14/android-question-answer-app
QuestionAppTests/src/ca/ualberta/cs/cmput301f14t14/questionapp/test/QuestionListTest.java
[ "public class MainActivity extends Activity {\n\n\tprivate DataManager dataManager;\n\tprivate QuestionListAdapter qla = null;\n\tprivate List<Question> qList = null;\n\t\n\tprivate ClientData cd = null;\n\tprivate Callback<List<Question>> listCallback = null;\n\tprivate Callback<Question> favouriteQuestionCallback...
import java.io.IOException; import android.app.Activity; import android.test.ActivityInstrumentationTestCase2; import ca.ualberta.cs.cmput301f14t14.questionapp.MainActivity; import ca.ualberta.cs.cmput301f14t14.questionapp.data.DataManager; import ca.ualberta.cs.cmput301f14t14.questionapp.data.LocalDataStore; import ca...
package ca.ualberta.cs.cmput301f14t14.questionapp.test; public class QuestionListTest extends ActivityInstrumentationTestCase2<MainActivity> { private LocalDataStore mLocalStore; private RemoteDataStore mRemoteStore;
private Question mQuestion;
6
mjeanroy/node-maven-plugin
src/main/java/com/github/mjeanroy/maven/plugins/node/mojos/CheckNodeMojo.java
[ "public class Command {\n\n\t/**\n\t * Command executable file, this executable will be run on operating system.\n\t */\n\tprivate final String executable;\n\n\t/**\n\t * Optional arguments (each arguments will be unique).\n\t */\n\tprivate final List<CommandArg> arguments;\n\n\t/**\n\t * Create new command providi...
import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import java.io.File; import java.util.Objects; import static com.github.mjeanroy.maven.plugins.node.commands.CommandExecutors.newExecutor; import com.githu...
/** * The MIT License (MIT) * * Copyright (c) 2015-2021 Mickael Jeanroy * * 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 t...
Command node = node();
0
Ecwid/consul-api
src/main/java/com/ecwid/consul/v1/health/HealthConsulClient.java
[ "public class GsonFactory {\n\n\tprivate static final Gson GSON = new Gson();\n\n\tpublic static Gson getGson() {\n\t\treturn GSON;\n\t}\n\n}", "public final class HttpResponse {\n\n\tprivate final int statusCode;\n\tprivate final String statusMessage;\n\n\tprivate final String content;\n\n\tprivate final Long co...
import java.util.List; import com.ecwid.consul.json.GsonFactory; import com.ecwid.consul.transport.HttpResponse; import com.ecwid.consul.transport.TLSConfig; import com.ecwid.consul.v1.ConsulRawClient; import com.ecwid.consul.v1.OperationException; import com.ecwid.consul.v1.QueryParams; import com.ecwid.consul.v1.Resp...
package com.ecwid.consul.v1.health; /** * @author Vasily Vasilkov (vgv@ecwid.com) */ public final class HealthConsulClient implements HealthClient { private final ConsulRawClient rawClient; public HealthConsulClient(ConsulRawClient rawClient) { this.rawClient = rawClient; } public HealthConsulClient() { ...
public Response<List<Check>> getHealthChecksForNode(String nodeName, QueryParams queryParams) {
5
godrin/TowerDefense
defend/src/com/cdm/view/elements/Level.java
[ "public interface Game {\n\tvoid setScreen(Screen newScreen);\n\n\tvoid setScreen(String string);\n\n\tvoid play(Type soundType);\n}", "public enum Type {\n\tKLICK, SHOT, SHOT2, HIT, HIT2, HURT, STUNRAY, LOOSE, WIN, WIN2, LEVEL1, LEVEL2\n};", "public class Position {\n\n\tprivate CoordSystem system;\n\n\tpublic...
import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import com.badlogic.gdx.utils.Json; import com.badlogic.gdx.utils.Json.Serializable; import com.badlogic.gdx.utils.OrderedMap; import com.cdm.Game; import com.cdm.gui.e...
package com.cdm.view.elements; public class Level implements Serializable { private Grid grid; private Selector selector = null; private EnemyPlayer player; private float speedFactor = 2.0f; private List<Unit> units = new ArrayList<Unit>(); private Set<Unit> unitsToRemove = new TreeSet<Unit>(); private Player...
Position.LEVEL_REF.setWidth(grid.getW());
2
isel-leic-mpd/mpd-2017-i41d
aula08-template-vs-strategy/src/test/java/LazyQueriesTest.java
[ "public class FileRequest implements IRequest{\n @Override\n public Iterable<String> getContent(String path) {\n String[] parts = path.split(\"/\");\n path = parts[parts.length-1]\n .replace('?', '-')\n .replace('&', '-')\n .replace('=', '-')\n ...
import org.junit.Test; import util.FileRequest; import util.queries.LazyQueries; import weather.WeatherWebApi; import weather.dto.WeatherInfo; import java.time.LocalDate; import static org.junit.Assert.assertEquals; import static util.queries.LazyQueries.*; import static util.queries.LazyQueries.filter;
/* * Copyright (c) 2017, Miguel Gamboa * * 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...
infos = filter(infos, info -> info.getDescription().toLowerCase().contains("sun"));
5
SoyaLeaf/CalendarII
app/src/main/java/top/soyask/calendarii/ui/adapter/month/MonthDayAdapter.java
[ "public class Day implements CalendarView.IDay, Serializable {\n\n private static final String BIRTHDAY = \"生日\";\n private int dayOfMonth;\n private LunarDay lunar;\n private boolean isToday;\n private int dayOfWeek;\n private int year;\n private int month;\n private boolean isHoliday;\n ...
import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.List; import top.soyask.calendarii.R; import top.soyask.calendarii.entity.Day; import top.soyask.calendarii.global.Setting; import static top.s...
package top.soyask.calendarii.ui.adapter.month; public class MonthDayAdapter extends BaseAdapter { private List<Day> mDays; private int mDateStartPos; private int mEndPosition; private static final String[] WEEK_ARRAY = {"日", "一", "二", "三", "四", "五", "六",}; public MonthDayAdapter(List<Day> d...
case VIEW_WEEK:
4
irq0/jext2
src/fusejext2/tasks/Link.java
[ "public class Constants {\n\t// Special inode numbers\n\tpublic static final int\tEXT2_BAD_INO = 1; /* Bad blocks inode */\n\tpublic static final int EXT2_ROOT_INO = 2; /* Root inode */\n\tpublic static final int EXT2_BOOT_LOADER_INO = 5; /* Boot loader inode */\n\tpublic static final int EXT2_UNDEL_...
import jext2.Constants; import jext2.DirectoryInode; import jext2.Inode; import jext2.exceptions.IsADirectory; import jext2.exceptions.JExt2Exception; import jext2.exceptions.NotADirectory; import fusejext2.Jext2Context; import fusejext2.Util; import jlowfuse.FuseReq; import jlowfuse.Reply;
/* * Copyright (c) 2011 Marcel Lauhoff. * * This file is part of jext2. * * jext2 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 vers...
Inode parent = context.inodes.getOpened(newparent);
2
redomar/JavaGame
src/com/redomar/game/net/GameClient.java
[ "public class Game extends Canvas implements Runnable {\n\n\t// Setting the size and name of the frame/canvas\n\tprivate static final long serialVersionUID = 1L;\n\tprivate static final String game_Version = \"v1.8.5 Alpha\";\n\tprivate static final int WIDTH = 160;\n\tprivate static final int HEIGHT = (WIDTH / 3 *...
import com.redomar.game.Game; import com.redomar.game.entities.PlayerMP; import com.redomar.game.net.packets.Packet; import com.redomar.game.net.packets.Packet.PacketTypes; import com.redomar.game.net.packets.Packet00Login; import com.redomar.game.net.packets.Packet01Disconnect; import com.redomar.game.net.packets.Pack...
package com.redomar.game.net; public class GameClient extends Thread { private InetAddress ipAddress; private DatagramSocket socket; private Game game; private Printing print = new Printing(); public GameClient(Game game, String ipAddress) { this.setGame(game); try { this.socket = new DatagramSocket();...
PlayerMP player = new PlayerMP(Game.getLevel(), packet.getX(),
1
Wootric/WootricSDK-Android
androidsdk/src/test/java/com/wootric/androidsdk/network/tasks/CheckEligibilityTaskTest.java
[ "public class SurveyValidator implements CheckEligibilityTask.Callback, GetRegisteredEventsTask.Callback {\n\n private OnSurveyValidatedListener onSurveyValidatedListener;\n private User user;\n private EndUser endUser;\n private Settings settings;\n private WootricRemoteClient wootricRemoteClient;\n...
import com.wootric.androidsdk.SurveyValidator; import com.wootric.androidsdk.network.WootricRemoteClient; import com.wootric.androidsdk.objects.EndUser; import com.wootric.androidsdk.objects.Settings; import com.wootric.androidsdk.objects.User; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito....
package com.wootric.androidsdk.network.tasks; @RunWith(RobolectricTestRunner.class) public class CheckEligibilityTaskTest { @Mock WootricRemoteClient wootricRemoteClient; @Test public void testGet_RequestWithProperties() throws Exception { EndUser endUser = new EndUser();
Settings settings = new Settings();
3
SQLPower/power-architect
src/main/java/ca/sqlpower/architect/ddl/critic/CriticAndSettings.java
[ "public class ArchitectProject extends AbstractSPObject {\n \n /**\n * Defines an absolute ordering of the child types of this class.\n * \n * IMPORTANT!: When changing this, ensure you maintain the order specified by {@link #getChildren()}\n */\n public static final List<Class<? extends SP...
import java.util.Collections; import java.util.List; import ca.sqlpower.architect.ArchitectProject; import ca.sqlpower.architect.ddl.DB2DDLGenerator; import ca.sqlpower.architect.ddl.DDLGenerator; import ca.sqlpower.architect.ddl.H2DDLGenerator; import ca.sqlpower.architect.ddl.HSQLDBDDLGenerator; import ca.sqlpower.ar...
/* * Copyright (c) 2010, SQL Power Group Inc. * * This file is part of SQL Power Architect. * * SQL Power Architect 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 *...
protected ArchitectSwingSession getSession() {
6
kbase/kb_sdk
src/java/us/kbase/mobu/tester/ModuleTester.java
[ "public abstract class CallbackServer extends JsonServerServlet {\n //TODO NJS_SDK move to common repo\n \n // should probably go in java_common or make a common repo for shared\n // NJSW & KB_SDK code, since they're tightly coupled\n private static final long serialVersionUID = 1L;\n \n privat...
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StringReader; import java.io.StringWriter; import java.net.URL; import java....
package us.kbase.mobu.tester; public class ModuleTester { private File moduleDir; protected Map<String,Object> kbaseYmlConfig; private Map<String, Object> moduleContext; public ModuleTester() throws Exception { this(null); } public ModuleTester(File dir) throws Exception { ...
ModuleInitializer.qualifyLanguage((String) kbaseYmlConfig.get("service-language"));
2
CaMnter/Robotlegs4Android
robotlegs4android/src/main/java/com/camnter/robotlegs4android/mvcs/Mediator.java
[ "public class Event {\n\n public static final String ADDED_TO_STAGE = \"added_to_stage\";\n public static final String REMOVED_FROM_STAGE = \"removed_from_stage\";\n public static final String ENTER_FRAME = \"enter_frame\";\n\n private String _type;\n private Object _target = null;\n public Object...
import com.camnter.robotlegs4android.base.Event; import com.camnter.robotlegs4android.base.EventMap; import com.camnter.robotlegs4android.base.Inject; import com.camnter.robotlegs4android.base.MediatorBase; import com.camnter.robotlegs4android.core.IEventDispatcher; import com.camnter.robotlegs4android.core.IEventMap; ...
/* * Copyright (C) 2015 CaMnter yuanyu.camnter@gmail.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
protected IEventMap _eventMap;
4
semanticvectors/semanticvectors
src/main/java/pitt/search/semanticvectors/ESPperm.java
[ "public class SigmoidTable {\n\n\t private int maxExponent = 6; //maximum permitted exponent\n\t private int tableSize\t\t = 1000;\n\t private double[] sigmoidTable;\n\t \n\t /**\n\t * \n\t */\n\t \n\t public SigmoidTable(int maxExponent, int tableSize)\n\t\t {\n\t\t \tthis.maxExponent \t= maxExponent;\n\...
import org.apache.lucene.document.Document; import org.apache.lucene.index.PostingsEnum; import org.apache.lucene.index.Term; import org.apache.lucene.index.Terms; import org.apache.lucene.index.TermsEnum; import org.apache.lucene.store.FSDirectory; import org.apache.lucene.store.IOContext; import org.apache.lucene.sto...
if (!luceneUtils.termFilter(term, dummyArray, 0, Integer.MAX_VALUE, Integer.MAX_VALUE, 1)) continue; if (flagConfig.elementalmethod().equals(ElementalGenerationMethod.CONTENTHASH)) random.setSeed(Bobcat.asLong(term.text().trim())); PermutationVector thePerm = new Pe...
loss = -sigmoid(VectorUtils.scalarProduct(v1, v2, flagConfig, blas, permutation));
6
UweTrottmann/Shopr
Android/Shopr/src/main/java/com/uwetrottmann/shopr/ui/CritiqueActivity.java
[ "public class AdaptiveSelection {\n\n private static final int NUM_RECOMMENDATIONS_DEFAULT = 8;\n private static final int BOUND_DEFAULT = 10;\n private static final boolean DUMP_INVENTORY = false;\n private static final boolean IS_USING_DIVERSITY_DEFAULT = true;\n\n private static AdaptiveSelection ...
import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.NavUtils; import android.util.SparseBooleanArray; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; impo...
package com.uwetrottmann.shopr.ui; public class CritiqueActivity extends Activity { private ListView mListView; private Button mButtonUpdate; private ItemFeatureAdapter mAdapter; private Item mItem; private boolean mIsPositiveCritique; public interface InitBundle { String ITEM_I...
Statistics.get().incrementCycleCount(mIsPositiveCritique);
8
neowu/core-ng-demo-project
demo-service/src/main/java/app/ProductModule.java
[ "public interface ProductWebService {\n @GET\n @Path(\"/product\")\n SearchProductResponse search(SearchProductRequest request);\n\n @GET\n @Path(\"/product/:id\")\n Optional<ProductView> get(@PathParam(\"id\") String id);\n\n @POST\n @Path(\"/product\")\n @ResponseStatus(HTTPStatus.CREAT...
import app.demo.api.ProductWebService; import app.demo.api.product.ProductView; import app.demo.api.product.kafka.ProductUpdatedMessage; import app.demo.product.kafka.ProductUpdatedMessageHandler; import app.demo.product.service.ProductService; import app.demo.product.web.ProductUpdatedMessageTestController; import app...
package app; /** * @author neo */ public class ProductModule extends Module { @Override protected void initialize() { bind(HTTPClient.class, HTTPClient.builder().build()); cache().add(ProductView.class, Duration.ofHours(2)).local(); bind(ProductService.class); // configur...
kafka().subscribe("product-updated", ProductUpdatedMessage.class, bind(ProductUpdatedMessageHandler.class));
3
Zappos/zappos-json
src/test/java/com/zappos/json/BeanBindingTest.java
[ "public class ContainingArray {\r\n\r\n private String strings[] = new String[]{\"A\", \"B\", \"C\"};\r\n\r\n private Integer integers[] = new Integer[]{1, 2, 3};\r\n\r\n private double doubles[] = new double[]{1.0, 2.0, 3.0};\r\n\r\n private SimpleBean simples[];\r\n\r\n public String[] getStrings() {\r\n ...
import com.zappos.json.data.SimpleBean; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Vector; import org.junit.Assert; import org.junit.Test; import com.zappos.json.data.ContainingArray; import com.zappos.json.d...
/* * Copyright 2015 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0/ * * or in t...
ContainingArray bean = new ContainingArray();
0
nfl/glitr
src/main/java/com/nfl/glitr/GlitrBuilder.java
[ "public class QueryComplexityCalculator {\n\n private static final Logger logger = LoggerFactory.getLogger(QueryComplexityCalculator.class);\n\n private static final String[] ALPHABET = new String[]{\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s...
import com.nfl.glitr.annotation.GlitrForwardPagingArguments; import com.nfl.glitr.calculator.QueryComplexityCalculator; import com.nfl.glitr.registry.TypeRegistry; import com.nfl.glitr.registry.TypeRegistryBuilder; import com.nfl.glitr.registry.datafetcher.AnnotationBasedDataFetcherFactory; import com.nfl.glitr.relay.R...
package com.nfl.glitr; public class GlitrBuilder { private static final Logger logger = LoggerFactory.getLogger(GlitrBuilder.class); private Map<Class, List<Object>> overrides = new HashMap<>();
private Map<Class<? extends Annotation>, AnnotationBasedDataFetcherFactory> annotationToDataFetcherFactoryMap = new HashMap<>();
3
SunakazeKun/PMDe
src/com/aurum/mystery2/swing/DungeonEditor.java
[ "public class Lists {\n private static List<String> populate(String filepath, int padlength) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(Lists.class.getResourceAsStream(filepath)));\n List<String> list = new ArrayList();\n \n String line;\n int index = ...
import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JScrollPane; import javax.swing.JSpinner; import javax.swing.SpinnerNumberModel; import com.aurum.mystery2.Lists; import com.aurum.mystery2.Main; import com.aurum.mystery2.game.Dungeon; import com.aurum.mystery2.game.Floor; import com.aurum.my...
/* * Copyright (C) 2016 - 2017 Aurum * * Mystery 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. * * Mystery is distributed in ...
Lists.dungeons.forEach((dungeon) -> { model.addElement(dungeon); });
0
open-erp-systems/erp-backend
erp-core/src/main/java/com/jukusoft/erp/core/module/base/service/group/GroupController.java
[ "public class GroupMember {\n\n protected Group group = null;\n protected long userID = 0;\n protected JsonObject row = null;\n\n public GroupMember (JsonObject row, Group group) {\n if (row == null) {\n throw new NullPointerException(\"row cannot be null.\");\n }\n\n if ...
import com.jukusoft.data.entity.GroupMember; import com.jukusoft.data.repository.GroupRepository; import com.jukusoft.erp.lib.database.InjectRepository; import com.jukusoft.erp.lib.message.StatusCode; import com.jukusoft.erp.lib.message.request.ApiRequest; import com.jukusoft.erp.lib.message.response.ApiResponse; impor...
package com.jukusoft.erp.core.module.base.service.group; public class GroupController extends AbstractController { @InjectRepository protected GroupRepository groupRepository; @Route(routes = "/list-my-groups")
public void listMyGroups (Message<ApiRequest> event, ApiRequest req, ApiResponse response, Handler<AsyncResult<ApiResponse>> handler) {
3
Kindrat/cassandra-client
src/main/java/com/github/kindrat/cassandra/client/service/tasks/CsvWriteBackgroundTask.java
[ "@Value\npublic class CsvTargetMetadata {\n private String table;\n private CSVFormat format;\n private File target;\n}", "@Slf4j\n@Service\n@RequiredArgsConstructor\npublic class CassandraClientAdapter {\n private final AtomicReference<CassandraAdminTemplate> template = new AtomicReference<>();\n ...
import com.datastax.driver.core.ColumnMetadata; import com.datastax.driver.core.TableMetadata; import com.github.kindrat.cassandra.client.model.CsvTargetMetadata; import com.github.kindrat.cassandra.client.service.CassandraClientAdapter; import com.github.kindrat.cassandra.client.service.TableContext; import com.github...
package com.github.kindrat.cassandra.client.service.tasks; @Slf4j @RequiredArgsConstructor public class CsvWriteBackgroundTask extends AbstractTask { private final CsvTargetMetadata metadata; private final TableMetadata tableMetadata;
private final CassandraClientAdapter clientAdapter;
1
davidmoten/rxjava2-jdbc
rxjava2-jdbc/src/main/java/org/davidmoten/rx/jdbc/Getter.java
[ "public class Tuple2<T1, T2> {\n\n private final T1 value1;\n private final T2 value2;\n\n /**\n * Constructor.\n * \n * @param value1\n * first element\n * @param value2\n * second element\n */\n public Tuple2(T1 value1, T2 value2) {\n this.value...
import java.sql.ResultSet; import java.util.Optional; import javax.annotation.Nonnull; import org.davidmoten.rx.jdbc.tuple.Tuple2; import org.davidmoten.rx.jdbc.tuple.Tuple3; import org.davidmoten.rx.jdbc.tuple.Tuple4; import org.davidmoten.rx.jdbc.tuple.Tuple5; import org.davidmoten.rx.jdbc.tuple.Tuple6; import org.da...
package org.davidmoten.rx.jdbc; public interface Getter { /** * Transforms the results using the given function. * * @param mapper * transforms ResultSet rows to an object of type T * @param <T> * the type being mapped to * @return the results of the q...
default <T> Flowable<TupleN<T>> getTupleN(@Nonnull Class<T> cls) {
6
codingricky/marvel-rest-client
src/main/java/com/github/codingricky/marvel/URLFactory.java
[ "public abstract class AbstractParameters {\n\n protected Integer limit;\n protected Integer offset;\n protected Date modifiedSince;\n\n protected List<Integer> creators = new ArrayList<Integer>();\n protected List<Integer> series = new ArrayList<Integer>();\n protected List<Integer> comics = new ...
import com.github.codingricky.marvel.parameter.AbstractParameters; import com.github.codingricky.marvel.parameter.CharacterParameters; import com.github.codingricky.marvel.parameter.ComicParameters; import com.github.codingricky.marvel.parameter.CreatorParameters; import com.github.codingricky.marvel.parameter.EventPar...
package com.github.codingricky.marvel; public class URLFactory { private static final String BASE_URL = "http://gateway.marvel.com/v1/public/"; private static final String COMICS_CHARACTERS_URL = BASE_URL + "comics/%d/characters"; private static final String COMICS_CREATORS_URL = BASE_URL + "comics/%d/c...
public String getCharactersSeriesURL(SeriesParameters seriesParameters) {
5
isisaddons/isis-app-todoapp
dom/src/main/java/todoapp/dom/todoitem/ToDoItem.java
[ "public final class ToDoAppDomainModule {\n\n private ToDoAppDomainModule(){}\n\n public abstract static class ActionDomainEvent<S> extends org.apache.isis.applib.services.eventbus.ActionDomainEvent<S> {\n }\n\n public abstract static class CollectionDomainEvent<S,T> extends org.apache.isis.applib.servi...
import java.math.BigDecimal; import java.net.MalformedURLException; import java.net.URL; import java.util.Comparator; import java.util.List; import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.VersionStrategy; import javax.v...
/* * 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")...
private Category category;
2
gr8pefish/IronBackpacks
src/main/java/gr8pefish/ironbackpacks/container/ContainerBackpack.java
[ "@Mod(modid = IronBackpacks.MODID, name = IronBackpacks.NAME, version = IronBackpacks.VERSION, dependencies = IronBackpacks.DEPEND, acceptedMinecraftVersions = \"[1.12,1.13)\")\npublic class IronBackpacks {\n\n public static final String MODID = \"ironbackpacks\";\n public static final String NAME = \"Iron Ba...
import com.google.common.base.Preconditions; import gr8pefish.ironbackpacks.IronBackpacks; import gr8pefish.ironbackpacks.api.backpack.BackpackInfo; import gr8pefish.ironbackpacks.api.backpack.IBackpack; import gr8pefish.ironbackpacks.api.backpack.variant.BackpackSize; import gr8pefish.ironbackpacks.util.InventoryBlack...
package gr8pefish.ironbackpacks.container; /** * The backpack's container class, holding all the slots of the backpack. */ @ChestContainer public class ContainerBackpack extends Container { // Fields @Nonnull private final BackpackInfo backpackInfo; @Nonnull
private final BackpackSize backpackSize;
3
00-Evan/PD-classes
com/watabou/noosa/Game.java
[ "public class Script extends Program {\n\n\tprivate static final HashMap<Class<? extends Script>,Script> all =\n\t\tnew HashMap<Class<? extends Script>, Script>();\n\t\n\tprivate static Script curScript = null;\n\tprivate static Class<? extends Script> curScriptClass = null;\n\t\n\t@SuppressWarnings(\"unchecked\")\...
import java.util.ArrayList; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import com.watabou.glscripts.Script; import com.watabou.gltextures.TextureCache; import com.watabou.input.Keys; import com.watabou.input.Touchscreen; import com.watabou.noosa.audio.Music; import...
/* * Pixel Dungeon * Copyright (C) 2012-2015 Oleg Dolya * * Shattered Pixel Dungeon * Copyright (C) 2014-2016 Evan Debenham * * 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 ver...
SystemTime.tick();
7
Kesshou/Kesshou-Android
app/src/main/java/kesshou/android/daanx/service/MyFirebaseMessagingService.java
[ "public class NotiSetting extends RealmObject {\n\tpublic String fcm_token;\n\tpublic boolean is_noti;\n}", "public class Setting extends RealmObject {\n\tpublic boolean logined;\n\tpublic String token;\n\tpublic String nick;\n\tpublic String name;\n\tpublic String email;\n\tpublic String password;\n\tpublic Stri...
import android.util.Log; import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.RemoteMessage; import io.realm.Realm; import io.realm.RealmResults; import kesshou.android.daanx.models.NotiSetting; import kesshou.android.daanx.models.Setting; import kesshou.android.daanx.util...
package kesshou.android.daanx.service; /** * Created by yoyoIU on 2016/12/19. */ public class MyFirebaseMessagingService extends FirebaseMessagingService { private static final String TAG = "MyFirebaseMsgService"; // Token updates // This used to be in MyFirebaseInstanceIDService /** * Called if ...
new NetworkingClient(getApplicationContext()).setNoti(token, notiSetting.is_noti, new MyCallBack<StatusResponse>(getApplicationContext()) {
2
jprante/elasticsearch-knapsack
src/test/java/org/xbib/elasticsearch/plugin/knapsack/cpio/KnapsackCpioTests.java
[ "public class KnapsackExportRequestBuilder extends ActionRequestBuilder<KnapsackExportRequest, KnapsackExportResponse, KnapsackExportRequestBuilder> {\n\n public KnapsackExportRequestBuilder(ElasticsearchClient client) {\n super(client, KnapsackExportAction.INSTANCE, new KnapsackExportRequest());\n }\n...
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.logging.ESLoggerFactory; import org.elasticsearch.index.query.QueryBuilders; import org.junit.Test; import org.xb...
package org.xbib.elasticsearch.plugin.knapsack.cpio; public class KnapsackCpioTests extends NodeTestUtils { private final static ESLogger logger = ESLoggerFactory.getLogger(KnapsackCpioTests.class.getName()); @Test public void testCpio() throws Exception { File exportFile = File.createTempFile...
KnapsackImportRequestBuilder knapsackImportRequestBuilder = new KnapsackImportRequestBuilder(client("1"))
2
apache/creadur-rat
apache-rat-core/src/main/java/org/apache/rat/Report.java
[ "public class XmlReportFactory {\n public static final RatReport createStandardReport(IXmlWriter writer,\n final ClaimStatistic pStatistic, ReportConfiguration pConfiguration) {\n final List<RatReport> reporters = new ArrayList<>();\n if (pStatistic != null) {\n reporters.add(...
import org.apache.commons.cli.*; import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.*; import org.apache.commons.lang3.StringUtils; import org.apache.rat.api.RatException; import org.apache.rat.report.IReportable; import org.apache.rat.report.RatReport; import org.apache.rat.report.claim.Cl...
if (base != null) { return report(base, new OutputStreamWriter(out), configuration); } return null; } private IReportable getDirectory(PrintStream out) { File base = new File(baseDirectory); if (!base.exists()) { out.print("ERROR: "); ...
IXmlWriter writer = new XmlWriter(out);
1
jnoessner/rockIt
src/main/java/com/googlecode/rockit/app/solver/thread/CardinalityFormulaRestrictionBuilder.java
[ "public class Parameters\n{\n\n public static String PROPERTYFILE = \"rockit.properties\";\n\n // ================= PARAMETERS CONFIGURABLE IN PROPERTYFILE\n\n /**\n * Path to store temporary files, which are deleted again after program execution.\n */\n public sta...
import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.Map.Entry; import java.util.TreeSet; import com.googlecode.rockit.app.Parameters; import com.googlecode.rockit.app.solver.aggregate.AggregationManager; import com.googlecode.rockit.app.solver....
package com.googlecode.rockit.app.solver.thread; public class CardinalityFormulaRestrictionBuilder extends RestrictionBuilder { private HashMap<TreeSet<String>, Integer> alreadyAddedCardinalities = new HashMap<TreeSet<String>, Integer>(); private HashMap<TreeSet<String>, Integer> newCardinalitiesToAdd ...
public void addConstraints(ILPConnector con) throws ILPException, SolveException
6
Esri/spatial-framework-for-hadoop
json/src/main/java/com/esri/json/EsriJsonFactory.java
[ "public class GeometryJsonDeserializer extends JsonDeserializer<Geometry> {\r\n\r\n\tpublic GeometryJsonDeserializer(){}\r\n\t\r\n\t@Override\r\n\tpublic Geometry deserialize(JsonParser arg0, DeserializationContext arg1)\r\n\t\t\tthrows IOException, JsonProcessingException {\r\n\t\treturn GeometryEngine.jsonToGeome...
import java.io.IOException; import java.io.InputStream; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerationException; import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException;...
package com.esri.json; public class EsriJsonFactory { private static final ObjectMapper jsonObjectMapper; private static final JsonFactory jsonFactory = new JsonFactory(); static { jsonObjectMapper = new ObjectMapper(); SimpleModule module = new SimpleModule("EsriJsonModule", new Version(1, 0, 0, null));...
module.addDeserializer(SpatialReference.class, new SpatialReferenceJsonDeserializer());
2
4FunApp/4Fun
client/FourFun/app/src/main/java/com/joker/fourfun/presenter/LoginPresenter.java
[ "public class Constants {\n public static final String MAIN_ACTIVITY_BUNDLE = \"main_bundle\";\n public static final String MEDIA_BUNDLE = \"media_bundle\";\n public static final String MOVIE_BUNDLE = \"movie_bundle\";\n public static final String PICTURE_BUNDLE = \"picture_bundle\";\n public static ...
import com.joker.fourfun.Constants; import com.joker.fourfun.base.BaseMvpPresenter; import com.joker.fourfun.model.LoginInfo; import com.joker.fourfun.net.HttpResultFunc; import com.joker.fourfun.net.UserService; import com.joker.fourfun.presenter.contract.LoginContract; import com.joker.fourfun.utils.RetrofitUtil; imp...
package com.joker.fourfun.presenter; /** * Created by joker on 2016/12/30. */ public class LoginPresenter extends BaseMvpPresenter<LoginContract.View> implements LoginContract .Presenter { private UserService mService; @Inject LoginPresenter(RetrofitUtil retrofitUtil) { mService = ...
.map(new HttpResultFunc<List<LoginInfo>>())
2
ajitsing/ExpenseManager
app/src/main/java/ajitsingh/com/expensemanager/database/ExpenseDatabaseHelper.java
[ "public class Expense {\n private String type;\n private String date;\n private Long amount;\n private Integer id;\n\n public Expense(Long amount, String type, String date) {\n this.type = type;\n this.date = date;\n this.amount = amount;\n }\n\n public Expense(Integer id, Long amount, String type, ...
import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import java.util.ArrayList; import java.util.List; import ajitsingh.com.expensemanager.model.Expense; import ajitsingh.com...
package ajitsingh.com.expensemanager.database; public class ExpenseDatabaseHelper extends SQLiteOpenHelper { public static final String EXPENSE_DB = "expense"; public ExpenseDatabaseHelper(Context context) { super(context, EXPENSE_DB, null, 1); } @Override public void onCreate(SQLiteDatabase sqLite...
Cursor cursor = database.rawQuery(ExpenseTable.getConsolidatedExpensesForDates(getCurrentWeeksDates()), null);
6
gomathi/merkle-tree
src/org/hashtrees/store/HashTreesStore.java
[ "public interface HashTrees {\n\n\t/**\n\t * Adds the (key,value) pair to the store. Intended to be used while synch\n\t * operation.\n\t * \n\t * @param keyValuePairs\n\t */\n\tvoid sPut(List<KeyValue> keyValuePairs) throws IOException;\n\n\t/**\n\t * Deletes the keys from the store. Intended to be used while sync...
import java.io.IOException; import java.nio.ByteBuffer; import java.util.Collection; import java.util.Iterator; import java.util.List; import org.hashtrees.HashTrees; import org.hashtrees.HashTreesCustomRuntimeException; import org.hashtrees.thrift.generated.SegmentData; import org.hashtrees.thrift.generated.SegmentHas...
/* * 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 ma...
SegmentHash getSegmentHash(long treeId, int nodeId) throws IOException;
3
xedin/sasi
src/java/org/apache/cassandra/db/index/SSTableAttachedSecondaryIndex.java
[ "public class ColumnIndex\n{\n private static final String FILE_NAME_FORMAT = \"SI_%s.db\";\n\n private final ColumnDefinition column;\n private final AbstractType<?> comparator;\n private final IndexMode mode;\n\n private final Component component;\n private final DataTracker tracker;\n\n publ...
import java.io.File; import java.io.IOException; import java.nio.ByteBuffer; import java.util.*; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import org.apache.cassandra.config.ColumnDefinition; i...
FBUtilities.waitOnFuture(CompactionManager.instance.submitIndexBuild(new IndexBuilder(sstables))); } catch (Exception e) { logger.error("Failed index build task", e); } } public void delete(DecoratedKey key) { // called during 'nodetool cleanu...
if (e instanceof TimeQuotaExceededException)
2
fauu/HelixEngine
editor/src/com/github/fauu/helix/editor/ui/HEAreaPassageSettingsPanel.java
[ "public enum TilePermission {\n\n OBSTACLE(\"Obstacle\", -1),\n PASSAGE(\"Area Passage\", -1),\n RAMP(\"Ramp\", -1),\n LEVEL0(\"Level 0\", 0),\n LEVEL1(\"Level 1\", 1),\n LEVEL2(\"Level 2\", 2),\n LEVEL3(\"Level 3\", 3),\n LEVEL4(\"Level 4\", 4),\n LEVEL5(\"Level 5\", 5),\n LEVEL6(\"Level 6\", 6),\n LEVE...
import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; import com.github.fauu.helix.TilePermission; import com.github.fauu.helix.editor.HelixEditor; import com.github.fauu.helix.editor.event.TilePassageAreaListState...
/* * Copyright (C) 2014-2016 Helix Engine Developers * (http://github.com/fauu/HelixEngine) * * This software is licensed under the GNU General Public License * (version 3 or later). See the COPYING file in this distribution. * * You should have received a copy of the GNU Library General Public License * along ...
setVisible(e.getMessage() == TilePermission.PASSAGE);
0
FedUni/caliko
caliko/src/main/java/au/edu/federation/caliko/FabrikBone3D.java
[ "public enum JointType\r\n{\r\n\tBALL,\r\n\tGLOBAL_HINGE,\r\n\tLOCAL_HINGE\r\n}\r", "public class Colour4f implements Serializable\n{\n\tprivate static final long serialVersionUID = 1L;\n\n\t// ---------- Properties ----------\n\n\t/** The minimum valid value of any colour component. */\n\tprivate static final fl...
import java.io.Serializable; import au.edu.federation.caliko.FabrikJoint3D.JointType; import au.edu.federation.utils.Colour4f; import au.edu.federation.utils.Mat4f; import au.edu.federation.utils.Utils; import au.edu.federation.utils.Vec3f;
package au.edu.federation.caliko; /** * A class to represent a FabrikBone3D object. * <p> * A FabrikBone3D consists of a start location, an end location and a FabrikJoint3D which can constrain * the rotation of the bone with regard to a previous bone in an IK chain either as a ball joint or as * a hing...
public JointType getJointType() { return mJoint.getJointType(); }
0
webdriverextensions/webdriverextensions
src/test/java/com/github/webdriverextensions/model/pages/ExamplesPage.java
[ "public class Bot {\n\n private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(Bot.class);\n\n /* Driver */\n public static WebDriver driver() {\n return WebDriverExtensionsContext.getDriver();\n }\n\n\n\n /* Click */\n public static void click(WebElement webElement) ...
import java.util.List; import static com.github.webdriverextensions.Bot.*; import static com.github.webdriverextensions.WebDriverExtensionsContext.*; import com.github.webdriverextensions.WebPage; import com.github.webdriverextensions.model.components.Body; import com.github.webdriverextensions.model.components.Menu; i...
package com.github.webdriverextensions.model.pages; public class ExamplesPage extends WebPage { WebDriverExtensionSite site; // Section: WebElements @FindBy(css = "#search-query") public WebElement searchQuery; @FindBy(css = "#search") public WebElement search; // Section: Extended WebEl...
public MenuButtonGroup menuButtonGroup;
5
njustesen/hero-aicademy
src/ai/StatisticAi.java
[ "public class GameState {\n\t\n\tpublic static int TURN_LIMIT = 100;\n\tpublic static boolean RANDOMNESS = false;\n\tpublic static int STARTING_AP = 3;\n\tpublic static int ACTION_POINTS = 5;\n\t\n\tprivate static final int ASSAULT_BONUS = 300;\n\tprivate static final double INFERNO_DAMAGE = 350;\n\tprivate static ...
import java.util.ArrayList; import java.util.List; import game.GameState; import action.Action; import ai.evolution.OnlineIslandEvolution; import ai.evolution.OnlineEvolution; import ai.mcts.Mcts; import ai.mcts.RootParallelizedMcts; import ai.util.AiStatistics;
package ai; public class StatisticAi implements AI { public AI ai;
public AiStatistics aiStatistics;
6
TeamCohen/SEAL
src/com/rcwang/seal/rank/TermFreqRanker.java
[ "public class Entity implements Comparable<Entity> {\r\n\r\n public static Logger log = Logger.getLogger(Entity.class);\r\n \r\n /** final score of this entity */\r\n public static final String SCORE = \"Score\";\r\n /** a name for the weight of string length */\r\n public static final String NAME_LENGTH = \"...
import com.rcwang.seal.expand.Entity; import com.rcwang.seal.expand.EntityList; import com.rcwang.seal.expand.Wrapper; import com.rcwang.seal.expand.Wrapper.EntityLiteral; import com.rcwang.seal.fetch.Document; import com.rcwang.seal.fetch.DocumentSet;
/************************************************************************** * Developed by Language Technologies Institute, Carnegie Mellon University * Written by Richard Wang (rcwang#cs,cmu,edu) **************************************************************************/ package com.rcwang.seal.rank; publi...
public void load(EntityList entities, DocumentSet documentSet) {
5
algolia/algoliasearch-client-android
algoliasearch/src/main/java/com/algolia/search/saas/helpers/BrowseIterator.java
[ "public interface CompletionHandler {\n\n /**\n * Called when the request has completed, either successfully or failing.\n * <p>\n * NOTE: One and only one of either <code>content</code> or <code>error</code> is guaranteed to be not null.\n * </p>\n *\n * @param content Content that was r...
import com.algolia.search.saas.Request; import com.algolia.search.saas.RequestOptions; import org.json.JSONObject; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.algolia.search.saas.AlgoliaException; import com.algolia.search.saas.CompletionHandler; import com.algolia....
/* * Copyright (c) 2012-2016 Algolia * http://www.algolia.com/ * * 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, ...
private @Nullable RequestOptions requestOptions;
4
jsmith613/Aruco-Marker-Tracking-Android
openCVTutorial1CameraPreview/src/main/java/min3d/parser/ParseObjectData.java
[ "public class AnimationObject3d extends Object3d {\n\tprivate int numFrames;\n\tprivate KeyFrame[] frames;\n\tprivate int currentFrameIndex;\n\tprivate long startTime;\n\tprivate long currentTime;\n\tprivate boolean isPlaying;\n\tprivate float interpolation;\n\tprivate float fps = 70;\n\tprivate boolean updateVerti...
import java.util.ArrayList; import java.util.HashMap; import min3d.animation.AnimationObject3d; import min3d.animation.KeyFrame; import min3d.core.Object3d; import min3d.parser.AParser.BitmapAsset; import min3d.parser.AParser.Material; import min3d.parser.AParser.TextureAtlas; import min3d.vos.Color4; import min3d.vos....
package min3d.parser; public class ParseObjectData { protected ArrayList<ParseObjectFace> faces; protected int numFaces = 0; protected ArrayList<Number3d> vertices; protected ArrayList<Uv> texCoords; protected ArrayList<Number3d> normals; public String name; public ParseObjectData() { this.vertices = n...
public AnimationObject3d getParsedObject(TextureAtlas textureAtlas, HashMap<String, Material> materialMap, KeyFrame[] frames)
4
mit-dig/punya
appinventor/appengine/src/com/google/appinventor/client/explorer/commands/CopyFormCommand.java
[ "public static final OdeMessages MESSAGES = GWT.create(OdeMessages.class);", "public class DesignToolbar extends Toolbar {\n\n /*\n * A Screen groups together the form editor and blocks editor for an\n * application screen. Name is the name of the screen (form) displayed\n * in the screens pull-down.\n *...
import static com.google.appinventor.client.Ode.MESSAGES; import java.util.HashSet; import java.util.List; import java.util.Set; import com.google.appinventor.client.DesignToolbar; import com.google.appinventor.client.Ode; import com.google.appinventor.client.OdeAsyncCallback; import com.google.appinventor.client.edito...
// -*- mode: java; c-basic-offset: 2; -*- // Copyright 2009-2011 Google, All Rights reserved // Copyright 2011-2012 MIT, All rights reserved // Released under the Apache License, Version 2.0 // http://www.apache.org/licenses/LICENSE-2.0 package com.google.appinventor.client.explorer.commands; /** * A command that...
setText(MESSAGES.newFormTitle());
0
tliron/jygments
components/jygments/source/com/threecrickets/jygments/grammar/def/IncludeDef.java
[ "public abstract class Def<C>\n{\n\t//\n\t// Attributes\n\t//\n\n\tpublic boolean isResolved()\n\t{\n\t\treturn resolved;\n\t}\n\n\tpublic Def<C> getCause( C container )\n\t{\n\t\treturn null;\n\t}\n\n\t//\n\t// Operations\n\t//\n\n\tpublic boolean resolve( C container ) throws ResolutionException\n\t{\n\t\treturn ...
import com.threecrickets.jygments.Def; import com.threecrickets.jygments.ResolutionException; import com.threecrickets.jygments.grammar.Grammar; import com.threecrickets.jygments.grammar.Rule; import com.threecrickets.jygments.grammar.State;
/** * Copyright 2010-2016 Three Crickets LLC. * <p> * The contents of this file are subject to the terms of a BSD license. See * attached license.txt. * <p> * Alternatively, you can obtain a royalty free commercial license with less * limitations, transferable or non-transferable, directly from Three Crickets *...
placeHolder = new Rule();
3
JanWiemer/jacis
src/test/java/org/jacis/objectadapter/microstream/JacisStoreWithMicrostreamCloningAndTrackedViewMultithreadedTest.java
[ "@JacisApi\npublic class JacisContainer {\n\n /** {@link JacisTransactionAdapter} to bind the Jacis Store to externally managed transactions. */\n private final JacisTransactionAdapter txAdapter;\n /** Map assigning the stores (values of type {@link JacisStoreImpl}) to the store identifiers (keys of type {@link ...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import org.jacis.container.JacisContainer; import org.jacis.container.JacisTransactionHandle; import org.jacis.plugin.JacisTran...
/* * Copyright (c) 2016. Jan Wiemer */ package org.jacis.objectadapter.microstream; public class JacisStoreWithMicrostreamCloningAndTrackedViewMultithreadedTest { static final Logger log = LoggerFactory.getLogger(JacisStoreWithMicrostreamCloningAndTrackedViewMultithreadedTest.class); protected...
TrackedViewRegistry<String, TestObject> tvr = store.getTrackedViewRegistry();
4
flyou/Girls
app/src/main/java/com/flyou/girls/ui/mainImageList/widget/fragment/MRXTFragment.java
[ "public class Constant {\n public static final String BASE_URL=\"http://m.xxxiao.com\";\n public static final String NEW=\"/page/\";\n public static final String XINGGAN=\"/cat/xinggan/page/\";\n public static final String SHAONV=\"/cat/shaonv/page/\";\n public static final String MRXT=\"/cat/...
import android.content.Intent; import android.support.v4.app.ActivityCompat; import android.support.v4.app.ActivityOptionsCompat; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import and...
package com.flyou.girls.ui.mainImageList.widget.fragment; /** * ============================================================ * 项目名称:Girls * 包名称:com.flyou.girls.ui.ImageList.widget.fragment * 文件名:NewFragment * 类描述: * 创建人:flyou * 邮箱:fangjaylong@gmail.com * 创建时间:2016/4/20 9:11 * 修改备注: * 版本:@version V1.0 *...
Intent intent=new Intent(context,TypeImageActivity.class);
7
monkeyk/oauth2-shiro
authz/src/main/java/com/monkeyk/os/oauth/token/AuthorizationCodeTokenHandler.java
[ "public class AccessToken extends AbstractDomain {\n private static final long serialVersionUID = 7336709167855003668L;\n\n\n public static final String BEARER_TYPE = \"Bearer\";\n\n\n /**\n * 默认的 refresh_token 的有效时长: 30天\n */\n public final static int REFRESH_TOKEN_VALIDITY_SECONDS = 60 * 60 * ...
import com.monkeyk.os.domain.oauth.AccessToken; import com.monkeyk.os.web.WebUtils; import com.monkeyk.os.oauth.OAuthTokenxRequest; import com.monkeyk.os.oauth.validator.AbstractClientDetailsValidator; import com.monkeyk.os.oauth.validator.AuthorizationCodeClientDetailsValidator; import org.apache.oltu.oauth2.common.ex...
/* * Copyright (c) 2013 Andaily Information Technology Co. Ltd * www.andaily.com * All rights reserved. * * This software is the confidential and proprietary information of * Andaily Information Technology Co. Ltd ("Confidential Information"). * You shall not disclose such Confidential Information and shall use ...
return new AuthorizationCodeClientDetailsValidator(tokenRequest);
4
dhemery/runtime-suite
examples/example/suites/SuiteWithClassFilterDeclaredAsSubtype.java
[ "public interface ClassFinder {\n\t/**\n\t * Finds test classes for possible inclusion in a runtime suite.\n\t * @return a {@link Collection} of test classes for possible inclusion in a runtime suite.\n\t * @see RuntimeSuite\n\t */\n\tCollection<Class<?>> find();\n}", "public class RuntimeSuite extends ParentRunn...
import org.junit.runner.RunWith; import com.dhemery.runtimesuite.ClassFinder; import com.dhemery.runtimesuite.Filter; import com.dhemery.runtimesuite.Finder; import com.dhemery.runtimesuite.RuntimeSuite; import com.dhemery.runtimesuite.filters.ExcludeClasses; import com.dhemery.runtimesuite.finders.ListedClasses; impor...
package example.suites; @RunWith(RuntimeSuite.class) public class SuiteWithClassFilterDeclaredAsSubtype {
@Finder public ClassFinder finder = new ListedClasses(Runnable1.class, Runnable2.class, Runnable3.class);
5
andieguo/nearbydemo
NearbyServerDemo/src/com/andieguo/nearby/service/Service.java
[ "public class GPS {\n\n\tprivate int id;\n\tprivate UserInfo user;//一对一的关系\n\tprivate String longitude;\n\tprivate String latitude;\n\tprivate Date time;\n\tprivate String geohash;\n\t\n\tpublic GPS() {\n\t\tsuper();\n\t}\n\tpublic GPS(UserInfo user, String longitude, String latitude, Date time) {\n\t\tsuper();\n\t...
import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.andieguo.nearby.bean.GPS; import com.andieguo.nearby.bean.UserInfo; import com.andieguo.nearby.dao.GpsDao; import com.andieguo.nearby.dao.UserDao; import com.andieguo.nearby.message.NearbyInfo; import com.andieguo.nearby.util.GP...
package com.andieguo.nearby.service; public class Service { public void saveOrUpdateGPS(GPS gps) throws SQLException { GpsDao dao = new GpsDao(); GPS gpsinfo = dao.findGPS(gps.getUser().getId()); if (gpsinfo == null) { dao.saveGPS(gps); } else { dao.updateGPS(gps); } } public List<NearbyInfo> f...
Double d = GPSUtil.computeDistance(Double.valueOf(latitude),
5
IPEldorado/RemoteResources
src/com/eldorado/remoteresources/RemoteResourcesServer.java
[ "public abstract class IConnectionConstants {\n\n\tpublic static final int CONTROL_SERVER_DEFAULT_PORT = 54321;\n\n\tpublic static final long DEFAULT_FRAME_DELAY = 500;\n\n\tpublic static final int DEFAULT_IMAGE_QUALITY = 50;\n\n\tpublic static final Map<String, String> pollingRates = new LinkedHashMap<String, Stri...
import java.io.File; import java.io.IOException; import java.net.ServerSocket; import java.util.ArrayList; import com.eldorado.remoteresources.android.common.connection.IConnectionConstants; import com.eldorado.remoteresources.android.server.ServerLogger; import com.eldorado.remoteresources.android.server.connection.Se...
/* * (C) Copyright 2014 Instituto de Pesquisas Eldorado (http://www.eldorado.org.br/). * * This file is part of the software Remote Resources * * All rights reserved. This file and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 3.0 which ...
ServerConnectionManager.getInstance().initializeDebugBridge(adbPath);
3
shixinzhang/GardenOfFeeling
app/src/main/java/sxkeji/net/dailydiary/common/activities/TodoListFragment.java
[ "public class Todo implements Serializable{\n\n private Long id;\n private java.util.Date date;\n /** Not-null value. */\n private String content;\n private int color;\n private boolean hasReminder;\n private Boolean showOnLockScreen;\n private boolean isFinished;\n private String objectI...
import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.su...
package sxkeji.net.dailydiary.common.activities; /** * Todo列表 * Created by zhangshixin on 4/27/2016. */ public class TodoListFragment extends Fragment { @Bind(R.id.recyclerView) RecyclerView recyclerView; @Bind(R.id.rl_empty_view) RelativeLayout rlEmptyView; private AllTodoRecyclerAdapter a...
private ArrayList<Todo> todoList;
0
nicolasbrailo/VlcFreemote
app/src/main/java/com/nicolasbrailo/vlcfreemote/PlaylistView.java
[ "public class VlcStatus {\n public interface ObserverRegister {\n Observer getVlcStatusObserver();\n }\n\n public interface Observer {\n void onVlcStatusUpdate(VlcStatus results);\n void onVlcStatusFetchError();\n void onVlcStatusFetchError(String msg);\n }\n\n public int ...
import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageButton; import android.widget.ListView; import ...
package com.nicolasbrailo.vlcfreemote; public class PlaylistView extends VlcFragment implements View.OnClickListener, PopupMenu.OnMenuItemClickListener { private PlaylistEntry_ViewAdapter playlistViewAdapter; private boolean attached = false; /* Mostly Android boilerplate ...
getVlc().exec(new Cmd_ClearPlaylist(getVlc()));
1
blazegraph/tinkerpop3
src/test/java/com/blazegraph/gremlin/structure/SampleCode.java
[ "public class BasicRepositoryProvider {\n\n /**\n * Open and initialize a BigdataSailRepository using the supplied journal\n * file location. If the file does not exist or is empty, the repository\n * will be created using the default property configuration below. \n * \n * @param journalFil...
import static java.util.stream.Collectors.toSet; import static org.junit.Assert.assertEquals; import java.io.File; import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; import org.apache.tinkerpop.gremlin.structure.Edge; import org.apache.tinkerpop.gremlin.structure.T; import org.apach...
/** Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016. All rights reserved. Contact: SYSTAP, LLC DBA Blazegraph 2501 Calvert ST NW #106 Washington, DC 20008 licenses@blazegraph.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public L...
final BlazeGraphListener listener = new BlazeGraphListener() {
5
mauimauer/cheapcast
src/main/java/at/maui/cheapcast/service/CheapCastService.java
[ "public class Const {\r\n\r\n public static final String DEVICE_DESC = \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?>\\n\" +\r\n \" <root xmlns=\\\"urn:schemas-upnp-org:device-1-0\\\">\\n\" +\r\n \" <specVersion>\\n\" +\r\n \" <major>1</major>\\n\" +\r\n ...
import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import an...
/* * Copyright 2013 Sebastian Mauer * * 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 ...
String appDesc = Const.APP_INFO;
0
antest1/kcanotify
app/src/main/java/com/antest1/kcanotify/KcaQuestListAdpater.java
[ "public static JsonObject getExpeditionInfo(int mission_no, String locale) {\n JsonObject data = null;\n int mission_key = mission_no;\n String key = String.valueOf(mission_key);\n if (!kcExpeditionData.has(key)) {\n if (mission_no % 2 == 1) key = \"203\";\n else key = \"204\";\n }\n ...
import android.content.Context; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import androidx.core.content.Conte...
package com.antest1.kcanotify; public class KcaQuestListAdpater extends BaseAdapter { private List<JsonObject> listViewItemList = new ArrayList<>(); private KcaQuestViewService service; private Context application_context; private KcaQuestTracker questTracker; public static final float PROGRES...
if (isQuestTrackable(api_no)) {
3
researchgate/restler
restler-service/src/main/java/net/researchgate/restler/service/resources/HealthResource.java
[ "public final class ServiceQuery<K> {\n private static final int MAX_LIMIT = 10000;\n\n private Integer limit;\n private Integer originalLimit;\n private int offset = 0;\n private boolean countTotalItems = true;\n private String order;\n private Set<String> fields;\n private Collection<K> id...
import com.codahale.metrics.health.HealthCheck; import com.google.inject.Inject; import com.google.inject.Singleton; import net.researchgate.restdsl.queries.ServiceQuery; import net.researchgate.restdsl.results.EntityResult; import net.researchgate.restler.domain.Account; import net.researchgate.restler.service.excepti...
package net.researchgate.restler.service.resources; /** * Health resource and health check at the same time */ @Path("health") @Singleton @Produces("application/json;charset=UTF-8") public class HealthResource extends HealthCheck { private final AccountModel accountModel; @Inject public HealthResource...
throw new ServiceException("No accounts found", Response.Status.INTERNAL_SERVER_ERROR);
3
sirensolutions/siren-join
src/main/java/solutions/siren/join/action/coordinate/tasks/CardinalityEstimationTask.java
[ "@SuppressWarnings(\"unchecked\")\npublic class FilterJoinNode extends AbstractNode {\n\n private final Map<String, Object> parent;\n private final Map<String, Object> self;\n\n /**\n * A hash of the query\n */\n private final int queryHash;\n\n /**\n * The version of the lookup indices\n */\n private...
import solutions.siren.join.action.coordinate.pipeline.NodeTaskContext; import solutions.siren.join.action.coordinate.pipeline.NodeTaskReporter; import solutions.siren.join.action.terms.TermsByQueryRequest; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionRequest; import org.elastic...
/** * Copyright (c) 2016, SIREn Solutions. All Rights Reserved. * * This file is part of the SIREn project. * * SIREn is a 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 ...
if (context.getNode().getTermsEncoding().equals(TermsByQueryRequest.TermsEncoding.BLOOM)) {
4
Q42/Jue
jue/src/nl/q42/jue/HueBridge.java
[ "public static class Result {\n\tprivate String body;\n\tprivate int responseCode;\n\t\t\n\tpublic Result(String body, int responseCode) {\n\t\tthis.body = body;\n\t\tthis.responseCode = responseCode;\n\t}\n\t\t\n\tpublic String getBody() {\n\t\treturn body;\n\t}\n\t\t\n\tpublic int getResponseCode() {\n\t\treturn ...
import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Type; import java.net.URLEncoder; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import nl.q42.jue.HttpCl...
} /** * Changes a schedule. * @param schedule schedule * @param update changes * @throws UnauthorizedException thrown if the user no longer exists * @throws EntityNotAvailableException thrown if the specified schedule no longer exists */ public void setSchedule(Schedule schedule, ScheduleUpdate update)...
throw new UnauthorizedException(e.toString());
7
daquexian/chaoli-forum-for-android-2
app/src/main/java/com/daquexian/chaoli/forum/viewmodel/HistoryFragmentVM.java
[ "public class ChaoliApplication extends Application {\n private static Context appContext;\n @Override\n public void onCreate() {\n super.onCreate();\n // train classifier on app start\n CodeProcessor.init(this);\n ChaoliApplication.appContext = getApplicationContext();\n ...
import android.databinding.ObservableArrayList; import android.databinding.ObservableBoolean; import android.databinding.ObservableField; import android.databinding.ObservableInt; import android.databinding.ObservableList; import android.util.Log; import com.daquexian.chaoli.forum.ChaoliApplication; import com.daquexia...
package com.daquexian.chaoli.forum.viewmodel; /** * ViewModel for HistoryFragment * Created by jianhao on 16-10-2. */ public class HistoryFragmentVM extends BaseViewModel { private static String TAG = "HistoryFVM"; public static final int TYPE_ACTIVITY = 0; public static final int TYPE_NOTIFICATIO...
new MyOkHttp.MyOkHttpClient()
7
mvk13ogb/qwait
src/main/java/se/kth/csc/controller/ApiProviderImpl.java
[ "@Entity\n@Table(name = \"account\")\npublic class Account {\n @Id\n @GeneratedValue(strategy = GenerationType.SEQUENCE)\n @Column(name = \"id\", updatable = false)\n private int id;\n\n @Column(name = \"principal_name\", unique = true)\n private String principalName;\n\n @Column(name = \"name\...
import se.kth.csc.model.QueuePosition; import se.kth.csc.payload.api.Snapshotters; import se.kth.csc.payload.message.*; import se.kth.csc.persist.AccountStore; import se.kth.csc.persist.QueuePositionStore; import se.kth.csc.persist.QueueStore; import java.util.Iterator; import com.google.common.collect.ImmutableSet; im...
package se.kth.csc.controller; /* * #%L * QWait * %% * Copyright (C) 2013 - 2014 KTH School of Computer Science and Communication * %% * 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 Foundat...
public QueuePosition fetchQueuePosition(String queueName, String userName) {
2