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 |
|---|---|---|---|---|---|---|
Xiaofei-it/Shelly | shelly/src/test/java/xiaofei/library/shelly/domino/Test07.java | [
"public class Shelly {\n\n private static final TargetCenter TARGET_CENTER = TargetCenter.getInstance();\n\n private static final DominoCenter DOMINO_CENTER = DominoCenter.getInstance();\n\n public static void register(Object object) {\n TARGET_CENTER.register(object);\n }\n\n public static bo... | import org.junit.Test;
import xiaofei.library.shelly.Shelly;
import xiaofei.library.shelly.function.Action1;
import xiaofei.library.shelly.function.Function1;
import xiaofei.library.shelly.function.Function2;
import xiaofei.library.shelly.function.TargetAction1; | }
@Test
public void testRegister() {
A a1 = new A(1), a2 = new B(2);
Shelly.register(a1);
Shelly.register(a1);
Shelly.register(a2);
System.out.println(Shelly.isRegistered(a1));
System.out.println(Shelly.isRegistered(a2));
Shelly.<String>createDomino(1)... | .map(new Function1<String, Integer>() { | 2 |
KKorvin/uPods-android | app/src/main/java/com/chickenkiller/upods2/dialogs/DialogFragmentAddMediaItem.java | [
"public class ProfileManager {\n\n public static final String JS_SUBSCRIBED_PODCASTS = \"subscribedPodcasts\";\n public static final String JS_SUBSCRIBED_STATIONS = \"subscribedStations\";\n public static final String JS_RECENT_STATIONS = \"recentStations\";\n\n public static ProfileManager profileManag... | import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.URLUtil;
import android.widget.EditText;
imp... | package com.chickenkiller.upods2.dialogs;
/**
* Created by Alon Zilberman on 8/8/15.
*/
public class DialogFragmentAddMediaItem extends DialogFragment {
public static final String TAG = "add_media_item";
private static final int MIN_TITLE_LENGTH = 3;
| private MediaItemType mediaItemType; | 4 |
epfl-labos/eagle | src/main/java/ch/epfl/eagle/daemon/scheduler/ConstrainedTaskPlacer.java | [
"public class Logging {\n public final static String AUDIT_LOGGER_NAME = \"audit\";\n public final static String AUDIT_LOG_FILENAME_FORMAT = \"eagle_audit.%d.%d.log\";\n public final static String AUDIT_LOG_FORMAT = \"%c\\t%m%n\";\n\n private static Joiner paramJoiner = Joiner.on(\",\").useForNull(\"null\");\n ... | import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
impor... | /*
* EAGLE
*
* Copyright 2016 Operating Systems Laboratory EPFL
*
* Modified from Sparrow - University of California, Berkeley
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | List<TTaskSpec> taskList = Lists.newArrayList(schedulingRequest.getTasks()); | 5 |
ChiralBehaviors/Kramer | kramer/src/main/java/com/chiralbehaviors/layout/table/NestedTable.java | [
"public class RelationLayout extends SchemaNodeLayout {\n\n public static ArrayNode flatten(Relation fold, JsonNode datum) {\n ArrayNode flattened = JsonNodeFactory.instance.arrayNode();\n if (datum != null) {\n if (datum.isArray()) {\n datum.forEach(item -> {\n ... | import java.util.ArrayList;
import java.util.List;
import com.chiralbehaviors.layout.RelationLayout;
import com.chiralbehaviors.layout.cell.VerticalCell;
import com.chiralbehaviors.layout.cell.control.FocusTraversal;
import com.chiralbehaviors.layout.flowless.VirtualFlow;
import com.chiralbehaviors.layout.schema.Schema... | /**
* Copyright (c) 2017 Chiral Behaviors, LLC, all rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | SchemaNode.asArray(items) | 4 |
UKGovLD/ukl-registry-poc | src/main/java/com/epimorphics/registry/commands/CommandRegister.java | [
"public abstract class Command {\n static final Logger log = LoggerFactory.getLogger( Command.class );\n\n public enum Operation {\n Read(CommandRead.class),\n Register(CommandRegister.class, RegAction.Register),\n GraphRegister(CommandGraphRegister.class, RegAction.Register),\n De... | import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.ws.rs.... | /******************************************************************
* File: CommandRead.java
* Created by: Dave Reynolds
* Created on: 22 Jan 2013
*
* (c) Copyright 2013, Epimorphics Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in comp... | String expquery = PrefixUtils.expandQuery(query, Prefixes.get()); | 4 |
haodynasty/AndroidBleManager | app/src/main/java/com/blakequ/androidblemanager/ui/scan/DeviceDetailsActivity.java | [
"public class MergeAdapter extends BaseAdapter implements SectionIndexer{\n\n protected PieceStateRoster pieces=new PieceStateRoster();\n\n /**\n * Stock constructor, simply chaining to the superclass.\n */\n public MergeAdapter() {\n super();\n }\n\n /**\n * Adds a new adapter to ... | import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.blakequ.androidblemanager.... | package com.blakequ.androidblemanager.ui.scan;
/**
* Copyright (C) BlakeQu All Rights Reserved <blakequ@gmail.com>
* <p/>
* Licensed under the blakequ.com License, Version 1.0 (the "License");
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed ... | private void appendAdRecordView(final MergeAdapter adapter, final String title, final AdRecord record) { | 5 |
GlitchCog/ChatGameFontificator | src/main/java/com/glitchcog/fontificator/gui/controls/panel/MessageCensorPanel.java | [
"public class Message\n{\n private static final Logger logger = Logger.getLogger(Message.class);\n\n private static final long UNCOMPLETED_TIME = 0L;\n\n /**\n * A regex for checking for emoji keys in the text. Used in a String.split to divide the message into an array of\n * words and the spaces b... | import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.regex.Pattern;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import javax.swing.event... | package com.glitchcog.fontificator.gui.controls.panel;
/**
* Panel for configuring posted message censorship rules
*
* @author Matt Yanos
*/
public class MessageCensorPanel extends ControlPanelBase
{
private static final Logger logger = Logger.getLogger(MessageCensorPanel.class);
private static final... | private MessageCheckList messageList; | 8 |
gubatron/SellerTrade | src/com/seller/trade/servlets/SearchServlet.java | [
"public class ConfigurationKeys {\n public static final String ST_VERSION = \"st.version\";\n public static final String ST_SERVER_PORT = \"st.server_port\";\n public static final String ST_SITE_NAME = \"st.site_name\";\n public static final String ST_TEMPLATES_FOLDER = \"st.templates.folder\";\n pub... | import com.seller.trade.services.StoreService;
import com.seller.trade.utils.JsonUtils;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import com.seller.trade.core.ConfigurationKeys;
i... | /**
* The MIT License
===============
Copyright (C) 2015 SellerTrade Developers
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... | response.getWriter().println(JsonUtils.toJson(list)); | 5 |
Kesshou/Kesshou-Android | app/src/main/java/kesshou/android/daanx/views/infor/PrizeFragment.java | [
"public class NetWorkCache extends RealmObject {\n\tpublic String sectionalexamscore1;\n\tpublic String sectionalexamscore2;\n\tpublic String timeTable;\n\tpublic String record;\n\tpublic String prize;\n\tpublic String histroyScore11;\n\tpublic String histroyScore12;\n\tpublic String histroyScore21;\n\tpublic Strin... | import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.gson.Gson;
import java.util.List;
import io.realm.Realm;
import kesshou.android.daanx.R;
import kesshou.android.daanx.models.NetWorkCache;
i... | package kesshou.android.daanx.views.infor;
/**
* A simple class.
*/
public class PrizeFragment {
public PrizeFragment() {
// Required empty public constructor
}
public View onCreateView(final Context context) {
// Inflate the layout for this fragment
context.setTheme(R.style.AppTheme);
context.ge... | public void onErr(Error error, Call<AttitudeStatusResponse> call) { | 4 |
iChun/Hats | src/main/java/me/ichun/mods/hats/client/gui/window/WindowAllHats.java | [
"public class WorkspaceHats extends Workspace\n implements IHatSetter\n{\n public static final DecimalFormat FORMATTER = new DecimalFormat(\"#,###,###\");\n\n public final boolean fallback;\n public final @Nonnull LivingEntity hatEntity;\n public final HatsSavedData.HatPart hatDetails;\n publi... | import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import me.ichun.mods.hats.client.gui.WorkspaceHats;
import me.ichun.mods.hats.client.gui.window.element.ElementHatRender;
import me.ichun.mods.hats.client.gui.window.element.ElementHatsScrollView;
import me.ichun.mods.hats.com... | package me.ichun.mods.hats.client.gui.window;
public class WindowAllHats extends Window<WorkspaceHats>
{
public int age;
public WindowAllHats(WorkspaceHats parent)
{
super(parent);
disableDockingEntirely();
disableDrag();
disableTitle();
setView(new ViewAllHats(... | SortHandler.sort(Hats.configClient.filterSorters, hatPartSource, false); | 6 |
WillemJiang/acmeair | acmeair-booking-service/src/test/java/com/acmeair/AcmeAirApplicationTestBase.java | [
"@Document(collection = \"booking\")\n@Entity(name = \"booking\")\npublic class BookingImpl implements Booking, Serializable{\n\t\n\tprivate static final long serialVersionUID = 1L;\n\t\n\t@Id\n\t@Column(name = \"id\")\n\tprivate String _id;\t\n\tprivate String flightId;\n\tprivate String customerId;\n\tprivate Dat... | import br.com.six2six.fixturefactory.Fixture;
import br.com.six2six.fixturefactory.loader.FixtureFactoryLoader;
import com.acmeair.morphia.entities.BookingImpl;
import com.acmeair.morphia.entities.FlightImpl;
import com.acmeair.morphia.repositories.BookingRepository;
import com.acmeair.morphia.repositories.FlightReposi... | package com.acmeair;
@RunWith(SpringRunner.class)
public class AcmeAirApplicationTestBase {
@ClassRule
public static final WireMockRule wireMockRule = new WireMockRule(8082);
private static ConfigurableApplicationContext applicationContext;
private final ObjectMapper objectMapper = new ObjectMappe... | private final BookingImpl booking = new BookingImpl("1", new Date(), customerId, "SIN-2131"); | 0 |
immopoly/android | src/org/immopoly/android/tasks/AbstractExposeTask.java | [
"public class UserDataManager {\n\tpublic static final int USER_UNKNOWN = 0;\n\tpublic static final int LOGIN_PENDING = 1; // TODO unused (yet)\n\tpublic static final int LOGGED_IN = 2;\n\n//\tprivate boolean actionPending;\n\n\tprivate int state = USER_UNKNOWN;\n\tprivate Activity activity;\n\tprivate GoogleAnalyt... | import org.immopoly.android.R;
import org.immopoly.android.app.UserDataManager;
import org.immopoly.android.helper.Settings;
import org.immopoly.android.helper.TrackingManager;
import org.immopoly.android.model.Flat;
import org.immopoly.android.model.ImmopolyException;
import org.immopoly.android.model.ImmopolyHistory;... | package org.immopoly.android.tasks;
public abstract class AbstractExposeTask extends AsyncTask<Flat, Void, Result> {
protected Context context;
private GoogleAnalyticsTracker tracker;
private String trackerLabel;
public AbstractExposeTask(Context context, GoogleAnalyticsTracker tracker, String trackerLabel) {... | ImmopolyUser.getInstance().readToken(this.context); | 6 |
YugengWang/OneWeather | app/src/main/java/com/yoga/oneweather/util/JSONHandleUtil.java | [
"public class MyApplication extends Application {\n\n private static Context context;\n private static Gson mGson = new Gson();\n\n\n\n @Override\n public void onCreate() {\n super.onCreate();\n context = getApplicationContext();\n LitePal.initialize(context);\n DBManager.get... | import com.google.gson.reflect.TypeToken;
import com.yoga.oneweather.MyApplication;
import com.yoga.oneweather.model.entity.city.City;
import com.yoga.oneweather.model.entity.city.County;
import com.yoga.oneweather.model.entity.city.Province;
import com.yoga.oneweather.model.entity.weather.Weather;
import org.json.JSON... | package com.yoga.oneweather.util;
/**
* Created by wyg on 2017/7/29.
*/
public class JSONHandleUtil {
public static Weather handleWeatherResponse(String response){
try {
JSONObject jsonObject = new JSONObject(response);
JSONArray jsonArray = jsonObject.getJSONArray("HeWeather... | for(City city : province.cities){ | 1 |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/followee/FolloweeListRepository.java | [
"public final class ApiConstants {\n\n private ApiConstants() {\n throw new AssertionError(\"No construction for constant class\");\n }\n\n // general constants of Dribbble API\n public static final String DRIBBBLE_V1_BASE_URL = \"https://api.dribbble.com\";\n public static final String DRIBBB... | import com.ge.protein.data.api.ApiConstants;
import com.ge.protein.data.api.ServiceGenerator;
import com.ge.protein.data.api.service.UserService;
import com.ge.protein.data.model.Followee;
import com.ge.protein.util.AccountManager;
import java.util.List;
import io.reactivex.Observable;
import retrofit2.Response; | /*
* Copyright 2017 Jiaheng Ge
*
* 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 ... | return userService.listUserFollowing(userId, ApiConstants.PER_PAGE); | 0 |
hoko/hoko-android | hoko/src/main/java/com/hokolinks/model/Deeplink.java | [
"public interface MetadataRequestListener {\n\n void completion();\n\n}",
"public class Utils {\n\n // Hoko folder name\n private static final String FOLDER_NAME = \"hoko\";\n // Hoko SharedPreferences key\n private static final String SHARED_PREFERENCES_STRING_KEY = \"com.hoko.string\";\n\n /**... | import android.content.Context;
import com.hokolinks.deeplinking.listeners.MetadataRequestListener;
import com.hokolinks.utils.Utils;
import com.hokolinks.utils.log.HokoLog;
import com.hokolinks.utils.networking.Networking;
import com.hokolinks.utils.networking.async.HttpRequest;
import com.hokolinks.utils.networking.a... | package com.hokolinks.model;
/**
* Deeplink is the model which represents an inbound or outbound deeplink object.
* It contains a route format string, the route parameters, the query parameters and an optional
* url scheme.
*/
public class Deeplink {
// Key values from incoming deeplinks
private stati... | Networking.getNetworking().addRequest( | 3 |
jwoolston/Android-Webcam | library/src/main/java/com/jwoolston/android/uvc/StreamManager.java | [
"public class VideoControlInterface extends VideoClassInterface {\n\n private static final int VIDEO_CLASS_HEADER_LENGTH = 12;\n private static final int INTERRUPT_ENDPOINT = 0x3;\n\n private static final int bDescriptorSubType = 2;\n private static final int bcdUVC = 3;\n private static ... | import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.jwoolston.android.libusb.LibusbError;
import com.jwoolston.android.libusb.UsbDeviceConnection;
import com.jwoolston.android.libusb.async.IsochronousAsyncTransfer;
import com.jwoolston.android.libusb.async.IsochronousTransf... | package com.jwoolston.android.uvc;
/**
* Probe and Commit Operational Model
* <p>
* Unsupported fields shall be set to zero by the device. Fields left for streaming parameters negotiation shall be set
* to zero by the host. For example, after a SET_CUR request initializing the FormatIndex and FrameIndex, the devi... | private final VideoControlInterface controlInterface; | 0 |
aemreunal/iBeaconServer | src/main/java/com/aemreunal/controller/scenario/ScenarioController.java | [
"public class GlobalSettings {\n /**\n * Used to set the global logging levels, like whether to log SQL queries or prints\n * inside methods.\n */\n public static final boolean DEBUGGING = true;\n\n /**\n * The BCrypt-hashed password field length (in User.class) is assumed to be 60 with a\n... | import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.mvc.ControllerLinkBuilder;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.sp... | package com.aemreunal.controller.scenario;
/*
* *********************** *
* Copyright (c) 2015 *
* *
* This code belongs to: *
* *
* @author Ahmet Emre Ünal *
* S001974 *
* *
* aemreunal@gmail.com *
* emre.unal... | scenario.add(ControllerLinkBuilder.linkTo(methodOn(ProjectController.class).getProjectById(username, projectId)).withRel("project")); | 1 |
fredg02/se.bitcraze.crazyflie.lib | se.bitcraze.crazyflie.lib/src/test/java/se/bitcraze/crazyflie/lib/log/LogDataLiveTest.java | [
"@SuppressWarnings(\"java:S106\")\npublic abstract class TestConnectionAdapter implements ConnectionListener {\n\n @Override\n public void connectionRequested() {\n System.out.println(\"CONNECTION REQUESTED\");\n }\n\n @Override\n public void connected() {\n System.out.println(\"CONNECT... | import java.io.File;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Timer;
import java.util.TimerTask;
import org.junit.Test;
import se.bitcraze.crazyflie.lib.TestConnectionAdapter;
import se.bitcraze.crazyflie.lib.TestLogAdapter;
import se.bitcraze.crazyflie.lib.crazyflie.Crazyflie;
import se.bitcr... | /**
* || ____ _ __
* +------+ / __ )(_) /_______________ _____ ___
* | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
* +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
* || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
*
* Copyright (C) 2016 Bitcraze AB
*
* Crazyflie Nano Quadcop... | testConfig.addVariable("pm.vbat", VariableType.FLOAT); | 4 |
PedroGomes/TPCw-benchmark | src/org/uminho/gsd/benchmarks/interfaces/executor/AbstractDatabaseExecutorFactory.java | [
"public class BenchmarkExecutor {\n\n //Node id\n private BenchmarkNodeID nodeId;\n\n //Benchmark interfaces\n private AbstractWorkloadGeneratorFactory workloadInterface;\n private AbstractDatabaseExecutorFactory databaseInterface;\n\n /**\n * number of clients on each benchmarking node *\n ... | import org.uminho.gsd.benchmarks.benchmark.BenchmarkExecutor;
import org.uminho.gsd.benchmarks.benchmark.BenchmarkNodeID;
import org.uminho.gsd.benchmarks.dataStatistics.ResultHandler;
import org.uminho.gsd.benchmarks.helpers.JsonUtil;
import org.uminho.gsd.benchmarks.helpers.TPM_counter;
import java.io.*;
import java.... | /*
* *********************************************************************
* Copyright (c) 2010 Pedro Gomes and Universidade do Minho.
* All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy... | protected BenchmarkExecutor executor; | 0 |
ground-context/ground | modules/postgres/app/edu/berkeley/ground/postgres/dao/usage/PostgresLineageGraphVersionDao.java | [
"public class GroundException extends Exception {\n\n private static final long serialVersionUID = 1L;\n\n private final String message;\n private final ExceptionType exceptionType;\n\n public enum ExceptionType {\n DB(\"Database Exception:\", \"%s\"),\n ITEM_NOT_FOUND(\"GroundItemNotFoundException\", \"N... | import com.fasterxml.jackson.databind.JsonNode;
import edu.berkeley.ground.common.dao.usage.LineageGraphVersionDao;
import edu.berkeley.ground.common.exception.GroundException;
import edu.berkeley.ground.common.exception.GroundException.ExceptionType;
import edu.berkeley.ground.common.model.core.RichVersion;
import edu... | /**
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
* <p>
* <p>http://www.apache.org/licenses/LICENSE-2.0
* <p>
* <p>Unless required by applicable law or agreed to in writing, software dist... | throws GroundException { | 0 |
apache/commons-proxy | core/src/test/java/org/apache/commons/proxy2/interceptor/matcher/ReturnTypeMatcherTest.java | [
"public interface Invocation\n{\n //******************************************************************************************************************\n // Other Methods\n //******************************************************************************************************************\n\n /**\n *... | import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.Serializable;
import java.lang.reflect.Method;
import org.apache.commons.proxy2.Invocation;
import org.apache.commons.proxy2.interceptor.matcher.invocation.ReturnTypeMatcher;
import org.apache.commons.proxy2.util.Abstr... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | InvocationMatcher matcher = new ReturnTypeMatcher(Serializable.class, true); | 1 |
Simdea/gmlrva | gmlrva-lib/src/main/java/pt/simdea/gmlrva/lib/animation/GenericItemAnimator.java | [
"@SuppressWarnings(\"WeakerAccess\")\npublic interface IGenericRecyclerViewLayout<T extends RecyclerView.ViewHolder & IViewHolder> extends Serializable {\n\n /**\n * Procedure meant to handle the ViewHolder instance creation.\n * @param parent the root ViewGroup {@link ViewGroup} for the ViewHolder insta... | import android.animation.AnimatorSet;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.RecyclerView;
import android.util.ArrayMap;
import java.util.Lis... | /*
* Copyright (c) 2017. Simdea.
*/
package pt.simdea.gmlrva.lib.animation;
/**
* This class is meant to serve as a base {@link RecyclerView.ItemAnimator},
* responsible for coordinating default animations performed by {@link RecyclerView}.
*
* Created by Paulo Ribeiro on 10/7/2017.
* Simdea © All Rights R... | return new GenericAnimatedViewHolderInfo((Integer) payload); | 1 |
el-groucho/jsRules | src/test/java/org/grouchotools/jsrules/loader/RuleLoaderTest.java | [
"public enum Operator {\n GT {\n @Override\n public Boolean compare(Object left, Object right) throws InvalidParameterException {\n Number leftNumber = getNumber(left);\n Number rightNumber = getNumber(right);\n return leftNumber.doubleValue() > rightNumber.doubleVa... | import org.grouchotools.jsrules.Operator;
import org.grouchotools.jsrules.Parameter;
import org.grouchotools.jsrules.Rule;
import org.grouchotools.jsrules.config.ParamConfig;
import org.grouchotools.jsrules.config.ResponseConfig;
import org.grouchotools.jsrules.config.RuleConfig;
import org.grouchotools.jsrules.excepti... | /*
* The MIT License
*
* Copyright 2015 Paul.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, me... | ResponseConfig responseConfig = getResponseConfig(); | 4 |
jpush/jbox | android/JBox/app/src/main/java/com/jiguang/jbox/ui/channel/ChannelActivity.java | [
"public class AppApplication extends Application {\n private static Context mContext;\n\n public static boolean shouldUpdateData = false;\n\n public static String currentDevKey = \"\";\n public static String currentChannelName = \"\";\n\n @Override public void onCreate() {\n super.onCreate();\n mContext ... | import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import com.activeandroid.query.Delete;
import com.activeandro... | package com.jiguang.jbox.ui.channel;
/**
* 订阅 channel 界面。
*/
public class ChannelActivity extends Activity {
private static final String TAG = ChannelActivity.class.getSimpleName();
public static final String EXTRA_DEV_KEY = "dev_key";
private static final int MSG_DEV_UPDATE = 0;
private SubC... | HttpUtil.getInstance().requestDeveloper(mDevKey, new DeveloperDataSource.LoadDevCallback() { | 4 |
cimiano/tbx2rdf | test/tbx2rdf/Simple_with_decomposition_Test.java | [
"public class TBX_Terminology {\n\n /// Set of terms\n public final Set<Term> terms = new HashSet<Term>();\n \n /// Type. As for now, we have only type \"TBX\"\n public final String type;\n \n /// Header\n public final MartifHeader header;\n\n public TBX_Terminology(String type, MartifHea... | import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.RDFNode;
import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.Statement;
import com.hp.hpl.jena.vocabulary.RDF;
import com.hp.hpl.jena.vocabulary.RDFS;
import java.io.FileReader;
import java.util.List;
import org.apache.jena... | package tbx2rdf;
/**
*
* @author jmccrae
*/
public class Simple_with_decomposition_Test {
private Model model;
public Simple_with_decomposition_Test() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() throws Exception... | final List<Statement> stats2 = model.listStatements(stat.getSubject(), TBX.subjectField, (RDFNode) null).toList(); | 5 |
SilentChaos512/ScalingHealth | src/main/java/net/silentchaos512/scalinghealth/utils/MobDifficultyHandler.java | [
"@Mod(ScalingHealth.MOD_ID)\npublic class ScalingHealth {\n public static final String MOD_ID = \"scalinghealth\";\n public static final String MOD_NAME = \"Scaling Health\";\n public static final String VERSION = \"2.5.3\";\n\n public static final Random random = new Random();\n\n public static fina... | import net.minecraft.entity.MobEntity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
import net.minecraft.entity.monster.IMob;
import net.minecraft.util.math.MathHelper;
import net.minecraft... | package net.silentchaos512.scalinghealth.utils;
public final class MobDifficultyHandler {
private MobDifficultyHandler() {}
public static void process(MobEntity entity, IDifficultyAffected data) {
// Already dead?
if (!entity.isAlive()) return;
// Make blight?
// getDiff is u... | return MathUtils.tryPercentage(ScalingHealth.random, chance); | 0 |
ProtocolSupport/ProtocolSupportPocketStuff | src/protocolsupportpocketstuff/api/util/PocketPlayer.java | [
"public interface Modal {\n\n\t/***\n\t * @return the ModalType of this modal.\n\t */\n\tModalType getType();\n\n\t/***\n\t * @return the internal type of this modal.\n\t */\n\tString getPeType();\n\n\t/***\n\t * Converts this modal to JSON.\n\t * @return the JSON representation of this modal.\n\t */\n\tString toJS... | import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import protocolsupport.api.ProtocolSupportAPI;
import protocolsupport.api.ProtocolType;
import protocolsupportpocketstuff.api.modals.Modal;
import protocolsupportpocketstuff.api.modals.ModalCallback;
import protocolsupportpocketstuff.api.skins.PocketSkinModel;
... | package protocolsupportpocketstuff.api.util;
/***
* Utility to send and retrieve pocket-specific things to a {@link Player}.
*/
public class PocketPlayer {
//=====================================================\\
// Getting \\
//=====================================================\\
... | public static void sendSkin(Player player, UUID uuid, byte[] skin, PocketSkinModel skinModel) { | 2 |
rainu/alexa-skill | cloud/src/main/java/de/rainu/alexa/cloud/speechlet/QuerySpeechlet.java | [
"public class CalendarReadException extends AlexaExcpetion {\n private static final String ERROR_MESSAGE_KEY = \"event.error.read\";\n\n public CalendarReadException(String message) {\n super(ERROR_MESSAGE_KEY, message);\n }\n\n public CalendarReadException(String message, Throwable cause) {\n super(ERROR... | import com.amazon.speech.slu.Slot;
import com.amazon.speech.speechlet.IntentRequest;
import com.amazon.speech.speechlet.SpeechletResponse;
import de.rainu.alexa.annotation.OnIntent;
import de.rainu.alexa.annotation.SpeechletController;
import de.rainu.alexa.cloud.calendar.exception.CalendarReadException;
import de.rain... | package de.rainu.alexa.cloud.speechlet;
/**
* This class is responsible for handling incoming event query requests.
*/
@SpeechletController(endpoint = BasicSpeechlet.ENDPOINT)
public class QuerySpeechlet {
private static final Logger log = LoggerFactory.getLogger(QuerySpeechlet.class);
@Autowired | CalendarService calendarService; | 4 |
frohoff/ysoserial | src/main/java/ysoserial/payloads/util/PayloadRunner.java | [
"public class Deserializer implements Callable<Object> {\n\tprivate final byte[] bytes;\n\n\tpublic Deserializer(byte[] bytes) { this.bytes = bytes; }\n\n\tpublic Object call() throws Exception {\n\t\treturn deserialize(bytes);\n\t}\n\n\tpublic static Object deserialize(final byte[] serialized) throws IOException, ... | import java.util.concurrent.Callable;
import ysoserial.Deserializer;
import ysoserial.Serializer;
import static ysoserial.Deserializer.deserialize;
import static ysoserial.Serializer.serialize;
import ysoserial.payloads.ObjectPayload;
import ysoserial.payloads.ObjectPayload.Utils;
import ysoserial.secmgr.ExecCheckingSe... | package ysoserial.payloads.util;
/*
* utility class for running exploits locally from command line
*/
@SuppressWarnings("unused")
public class PayloadRunner {
| public static void run(final Class<? extends ObjectPayload<?>> clazz, final String[] args) throws Exception { | 2 |
endercrest/VoidSpawn | src/main/java/com/endercrest/voidspawn/commands/OptionCommand.java | [
"public class DetectorManager {\n\n private static DetectorManager instance = new DetectorManager();\n\n public static DetectorManager getInstance() {\n return instance;\n }\n\n private Detector defaultDetector;\n private HashMap<String, Detector> detectors;\n\n /**\n * Setup the Detect... | import com.endercrest.voidspawn.DetectorManager;
import com.endercrest.voidspawn.ModeManager;
import com.endercrest.voidspawn.VoidSpawn;
import com.endercrest.voidspawn.detectors.Detector;
import com.endercrest.voidspawn.modes.Mode;
import com.endercrest.voidspawn.options.Option;
import com.endercrest.voidspawn.utils.M... | package com.endercrest.voidspawn.commands;
public class OptionCommand implements SubCommand {
private static final List<String> actionOptions = new ArrayList<>() {{
add("clear");
add("set");
}};
@Override
public boolean onCommand(Player p, String[] args) {
if (args.length == 1)... | Option<?> option = mode.getOption(optionName); | 5 |
dkunzler/masterpassword | app/src/main/java/de/devland/masterpassword/export/Exporter.java | [
"public enum RequestCodeManager {\n INSTANCE;\n\n protected Map<Integer, RequestCodeCallback> callbacks;\n protected Map<Integer, Bundle> callbackData;\n protected InternalPrefs internalPrefs;\n\n RequestCodeManager() {\n callbackData = new HashMap<>();\n callbacks = new HashMap<>();\n ... | import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.ParcelFileDescriptor;
import com.google.gson.Gson;
import c... | package de.devland.masterpassword.export;
/**
* Created by David Kunzler on 23.10.2014.
*/
public class Exporter implements RequestCodeManager.RequestCodeCallback {
public static final int REQUEST_CODE_EXPORT = 2345;
public static final String EXTRA_EXPORT_TYPE = "de.devland.export.Exporter.EXPORT_TYPE";... | SnackbarUtil.showShort(activity, R.string.error_generic); | 1 |
DestinyVaultHelper/dvh | app/src/main/java/org/swistowski/vaulthelper/util/DataLoader.java | [
"public class Characters {\n public static Characters mInstance = new Characters();\n private Characters(){}\n\n public static Characters getInstance(){\n return mInstance;\n }\n\n private List<Character> mCharacters;\n\n public void loadFromJson(JSONArray jsonArray) throws JSONException {\... | import android.app.Activity;
import android.util.Log;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.swistowski.vaulthelper.R;
import org.swistowski.vaulthelper.storage.Characters;
import org.swistowski.vaulthelper.storage.Data;
import org.swistowski.vaulthelper.storage... | package org.swistowski.vaulthelper.util;
public class DataLoader {
private final String LOG_TAG = "DatabaseLoader";
private final Activity act;
private final ClientWebView webView;
private final Data data;
private Runnable mOnFinish;
private Callback mOnError;
private Callback mOnMessag... | void doGetAccount(final Membership membership) { | 6 |
elminsterjimmy/PSN-API | RESTfulShell/src/main/java/com/elminster/psn/restful/controller/PSNApiController.java | [
"public interface IUserGameService {\n\n public List<PSNUserGame> getUserGameList(String username) throws ServiceException;\n}",
"public interface IUserGameTrophyService {\n\n List<PSNUserTrophy> getUserGameTrophyList(String username, String gameId) throws ServiceException;\n}",
"public class PSNUserGame exte... | import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod... | package com.elminster.psn.restful.controller;
/**
* The PSN api RESTful controller.
*
* @author jgu
* @version 1.0
*/
@Controller
public class PSNApiController {
/** the PSN API. */
private static final IPSNApi API = new PSNApiImpl();
| private final IUserGameTrophyService userGameTrophyService; | 1 |
xyxyLiu/PluginM | PluginManager/src/main/java/com/reginald/pluginm/comm/PluginCommService.java | [
"public final class PluginInfo implements Parcelable {\n // install info\n public String packageName;\n public String apkPath;\n public String versionName;\n public int versionCode;\n public long fileSize;\n public long lastModified;\n public String dataDir;\n public String dexDir;\n p... | import android.content.Context;
import android.os.IBinder;
import android.os.RemoteException;
import android.text.TextUtils;
import com.reginald.pluginm.IPluginClient;
import com.reginald.pluginm.PluginInfo;
import com.reginald.pluginm.comm.invoker.HostInvokerManager;
import com.reginald.pluginm.comm.invoker.InvokeCall... | package com.reginald.pluginm.comm;
/**
* Created by lxy on 17-8-22.
*/
public class PluginCommService extends IPluginComm.Stub {
private static final String TAG = "PluginCommService";
private static volatile PluginCommService sInstance;
private Context mContext;
private PluginManager mPluginMana... | StubManager.ProcessInfo processInfo = StubManager.getInstance(mContext).selectStubProcess(targetProcessName, packageName); | 6 |
jskcse4/FreeTamilEBooks | src/com/jskaleel/fte/home/BooksHomeAdapter.java | [
"public class FTEApplication extends Application {\n\t\n\t public static final String TAG = FTEApplication.class.getSimpleName();\n\t\n\tprivate static FTEApplication mInstance;\n\tprivate static Context mAppContext;\n\n\tprivate RequestQueue mRequestQueue;\n\tprivate static ImageLoader mImageLoader;\n\n\t@Override... | import java.util.ArrayList;
import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android... | package com.jskaleel.fte.home;
public class BooksHomeAdapter extends BaseAdapter implements OnScrollListener {
private Context context;
private ArrayList<BooksHomeListItems> bookListArray;
private ArrayList<BooksHomeListItems> searchListArray;
private FragmentHome fragmentHome;
private Typeface tf;... | holder.baseLayout.setOnTouchListener(new OnListItemTouchListener(){
| 4 |
psidnell/ofexport2 | src/main/java/org/psidnell/omnifocus/visitor/Traverser.java | [
"@JsonPropertyOrder(alphabetic=true)\npublic class Context extends NodeImpl implements ContextHierarchyNode{\n\n public static final String TYPE = \"Context\";\n\n private List<Task> tasks = new LinkedList<>();\n\n private List<Context> contexts = new LinkedList<>();\n\n private String parentContextId;\... | import org.psidnell.omnifocus.model.Context;
import org.psidnell.omnifocus.model.Folder;
import org.psidnell.omnifocus.model.Node;
import org.psidnell.omnifocus.model.Project;
import org.psidnell.omnifocus.model.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | /*
* Copyright 2015 Paul Sidnell
*
* 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... | case Project.TYPE: | 3 |
AnujaK/restfiddle | src/main/java/com/restfiddle/controller/rest/NodeController.java | [
"public class NodeUtil {\n\n private NodeUtil() {}\n\n public static long findLastChildPosition(List<BaseNode> children) {\n\tif (children == null || children.isEmpty()) {\n\t return 0;\n\t}\n\tlong temp = 0;\n\tfor (BaseNode childNode : children) {\n\t if (childNode.getPosition() > temp) {\n\t\ttemp = ... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfig... | /*
* Copyright 2014 Ranjan Kumar
*
* 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 t... | private ProjectRepository projectRepository; | 2 |
mokszr/ultimate-geojson | ugeojson-model/src/main/java/org/ugeojson/model/GeoJSONObjectTypeEnum.java | [
"public class FeatureCollectionDto extends GeoJSONObjectDto {\n \n\tprivate static final long serialVersionUID = 1L;\n\t\n\tprivate List<FeatureDto> features;\n\n\t@Override\n\tpublic GeoJSONObjectTypeEnum getGeoJSONObjectType() {\n\t\treturn GeoJSONObjectTypeEnum.FeatureCollection;\n\t}\n\n\tpublic List<FeatureDto... | import org.ugeojson.model.feature.FeatureCollectionDto;
import org.ugeojson.model.feature.FeatureDto;
import org.ugeojson.model.geometry.GeometryCollectionDto;
import org.ugeojson.model.geometry.LineStringDto;
import org.ugeojson.model.geometry.MultiLineStringDto;
import org.ugeojson.model.geometry.MultiPointDto;
impor... | package org.ugeojson.model;
/**
* GeoJSON object types
*
* @author moksuzer
*
*/
public enum GeoJSONObjectTypeEnum {
Point(PointDto.class), MultiPoint(MultiPointDto.class), LineString(LineStringDto.class), MultiLineString(
MultiLineStringDto.class), Polygon(PolygonDto.class), MultiPolygon( | MultiPolygonDto.class), GeometryCollection(GeometryCollectionDto.class), Feature( | 2 |
xwz/iview-android-tv | sbs/src/main/java/io/github/xwz/sbs/fragments/MainFragment.java | [
"public abstract class ContentManagerBase {\n\n public static final String CONTENT_ID = \"io.github.xwz.base.CONTENT_ID\";\n public static final String CONTENT_TAG = \"io.github.xwz.base.CONTENT_TAG\";\n\n public static final String CONTENT_SHOW_LIST_FETCHING = \"io.github.xwz.base.CONTENT_SHOW_LIST_FETCHI... | import android.support.v17.leanback.widget.BrowseFrameLayout;
import android.view.View;
import io.github.xwz.base.content.ContentManagerBase;
import io.github.xwz.sbs.R;
import io.github.xwz.sbs.activities.CategoryActivity;
import io.github.xwz.sbs.activities.DetailsActivity;
import io.github.xwz.sbs.activities.SearchA... | package io.github.xwz.sbs.fragments;
public class MainFragment extends io.github.xwz.base.fragments.MainFragment {
@Override | protected ContentManagerBase getContentManger() { | 0 |
SEMERU-WM/ChangeScribe | CommitSummarizer/CommitSummarizer.core/src/main/java/co/edu/unal/colswe/changescribe/core/listener/SummarizeChangeListener.java | [
"public class PreferenceConstants {\n\n\tpublic static final String P_FILTER_COMMIT_MESSAGE = \"filterCommitMessagePreference\";\n\n\tpublic static final String P_AUTHOR = \"authorPreference\";\n\t\n\tpublic static final String P_COMMITER = \"commiterPreference\";\n\t\n\tpublic static final String P_FILTER_FACTOR =... | import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import changescribe.core.preferences.PreferenceConstants;
import co.edu.unal.colswe.changescribe.core.Activator;
import co.... | package co.edu.unal.colswe.changescribe.core.listener;
public class SummarizeChangeListener implements SelectionListener {
private FilesChangedListDialog changedListDialog;
public SummarizeChangeListener(FilesChangedListDialog changedListDialog) {
super();
this.changedListDialog = changedListDialog;
}
pu... | SummarizeChanges summarizer = new SummarizeChanges(changedListDialog.getGit(), filtering, factor, null, null); | 3 |
mit-dig/punya | appinventor/appengine/src/com/google/appinventor/server/project/youngandroid/YoungAndroidProjectService.java | [
"public class YaVersion {\n private YaVersion() {\n }\n\n // ............................ Young Android System Version Number .............................\n\n // YOUNG_ANDROID_VERSION must be incremented when either the blocks language or a component\n // changes.\n // TODO(lizlooney) - should this version n... | import com.google.appengine.api.utils.SystemProperty;
import com.google.apphosting.api.ApiProxy;
import com.google.appinventor.common.utils.StringUtils;
import com.google.appinventor.common.version.GitBuildId;
import com.google.appinventor.components.common.YaVersion;
import com.google.appinventor.server.CrashReport;
i... | // -*- 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.server.project.youngandroid;
/**
* Provides su... | public YoungAndroidProjectService(StorageIo storageIo) { | 4 |
OpherV/gitflow4idea | src/main/java/gitflow/ui/GitflowOpenTaskPanel.java | [
"public class GitflowBranchUtil {\n\n Project myProject;\n GitRepository myRepo;\n\n private String currentBranchName;\n private String branchnameMaster;\n private String branchnameDevelop;\n private String prefixFeature;\n private String prefixRelease;\n private String prefixHotfix;\n pr... | import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.VcsTaskHandler;
import com.intellij.tasks.LocalTask;
import com.intellij.tasks.Task;
import com.intellij.tasks.TaskManager;
import com.intellij.tasks.impl.TaskManagerImpl;
import com.intel... | package gitflow.ui;
public class GitflowOpenTaskPanel extends TaskDialogPanel implements ItemListener {
private JRadioButton noActionRadioButton;
private JRadioButton startFeatureRadioButton;
private JRadioButton startHotfixRadioButton;
private JTextField featureName;
private JComboBox featureBa... | attachTaskAndRunAction(new StartFeatureAction(myRepo), selectedFeatureBaseBranch.getBranchName(), branchName); | 6 |
Zalth-One-Three/Zombie-Infection | src/main/java/com/zalthonethree/zombieinfection/init/EntityInit.java | [
"public class Reference {\n\tpublic static final String MOD_ID = \"zombieinfection\";\n\tpublic static final String MOD_NAME = \"Zombie Infection\";\n\tpublic static final String MINECRAFT_VERSION = \"1.12\";\n\tpublic static final String VERSION = \"3.0.0\";\n\tpublic static final String CLIENT_PROXY = \"com.zalth... | import com.zalthonethree.zombieinfection.Reference;
import com.zalthonethree.zombieinfection.ZombieInfection;
import com.zalthonethree.zombieinfection.entity.EntityZombieChicken;
import com.zalthonethree.zombieinfection.entity.EntityZombieCow;
import com.zalthonethree.zombieinfection.entity.EntityZombiePig;
import com.... | package com.zalthonethree.zombieinfection.init;
public class EntityInit {
@SuppressWarnings("unused") private static void addSpawn(Class<? extends EntityLiving> entityClass, int spawnProb, int min, int max, Biome[] biomes) {
EntityRegistry.addSpawn(entityClass, spawnProb, min, max, EnumCreatureType.CREATURE, biom... | EntityRegistry.registerModEntity(new ResourceLocation(Reference.RESOURCE_PREFIX + "zombie_chicken"), EntityZombieChicken.class, "ZIZombieChicken", 0, ZombieInfection.instance, 80, 4, true, 0xa3a3a3, 0x566c58); | 0 |
yassirh/digitalocean-swimmer | DigitalOceanSwimmer/src/main/java/com/yassirh/digitalocean/ui/NewDropletActivity.java | [
"public class SizeTable extends TableHelper {\n\t\n\tpublic static final String SIZE_SLUG = \"size_slug\";\n\tpublic static final String MEMORY = \"memory\";\n\tpublic static final String CPU = \"cpu\";\n\tpublic static final String DISK = \"disk\";\n\tpublic static final String TRANSFER = \"transfer\";\n\tpublic s... | import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedList... | package com.yassirh.digitalocean.ui;
public class NewDropletActivity extends AppCompatActivity implements OnItemSelectedListener, OnCheckedChangeListener {
private DropletService dropletService;
private SizeService sizeService;
private CheckBox privateNetworkingCheckBox;
private CheckBox enableBackupsCh... | SSHKeyService sshKeyService = new SSHKeyService(this); | 7 |
Akshansh986/Webkiosk | Webkiosk/src/main/java/com/blackMonster/webkiosk/ui/DetailedAtndActivity.java | [
"public class RefreshBroadcasts {\n public static final String BROADCAST_LOGIN_RESULT = \"BROADCAST_LOGIN_RESULT\";\n public static final String BROADCAST_UPDATE_AVG_ATND_RESULT = \"UPDATE_AVG_ATND_RESULT\";\n public static final String BROADCAST_UPDATE_DETAILED_ATTENDENCE_RESULT = \"UPDATE_DETAILED_ATTEND... | import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import android.os.Bundle;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.ActionBar;
import android.widget.... | package com.blackMonster.webkiosk.ui;
public class DetailedAtndActivity extends BaseActivity {
public static final String TAG = "DetailedAtndActivity";
public static final String SUB_CODE = "subcode";
public static final String SUB_NAME = "subname";
private String subName;
private String code;
... | if (result == UpdateDetailedAttendance.ERROR) { | 3 |
krokers/exchange-rates-mvvm | presentation/src/main/java/eu/rampsoftware/er/di/ICurrenciesActivityModule.java | [
"public interface CurrencyRepository {\n\n Observable<CurrencyData> getCurrencies(final Date date);\n\n Observable<SingleValue> getSeries(Date from, Date to, String currencyCode);\n}",
"public interface PreferencesData {\n void setCurrenciesExchangeDate(Date date);\n Optional<Date> getCurrenciesExchan... | import android.app.Activity;
import eu.rampsoftware.er.data.CurrencyRepository;
import eu.rampsoftware.er.data.PreferencesData;
import eu.rampsoftware.er.domain.usecases.GetCurrenciesRatesDate;
import eu.rampsoftware.er.domain.usecases.GetCurrenciesUseCase;
import eu.rampsoftware.er.navigation.Navigator;
import eu.ramp... | package eu.rampsoftware.er.di;
interface ICurrenciesActivityModule {
Activity provideActivity();
GetCurrenciesUseCase provideGetCurrenciesUseCase(CurrencyRepository mCurrencyRepository,
PreferencesData mPreferencesData);
GetCurrenciesRatesDate provid... | CurrencyListViewModel provideCurrencyListViewModel(final Navigator navigator, GetCurrenciesUseCase currenciesUseCase, | 5 |
bekce/oauthly | app/controllers/OAuthClientController.java | [
"@Singleton\npublic class AuthorizationServerManager {\n\n private Map<String, OAuthProvider> providerMap;\n private List<Tuple2<String, String>> providerList;\n\n @Inject\n public AuthorizationServerManager(Config config){\n this.providerMap = new LinkedHashMap<>();\n try {\n L... | import config.AuthorizationServerManager;
import config.JwtUtils;
import config.Utils;
import dtos.OAuthContext;
import dtos.OAuthProvider;
import models.ProviderLink;
import models.User;
import org.apache.commons.codec.binary.Base64;
import play.libs.concurrent.HttpExecutionContext;
import play.libs.ws.WSClient;
impor... | package controllers;
public class OAuthClientController extends Controller {
@Inject
private AuthorizationServerManager manager;
@Inject
private WSClient ws;
@Inject
private HttpExecutionContext httpExecutionContext;
@Inject | private JwtUtils jwtUtils; | 1 |
SecUSo/privacy-friendly-memo-game | app/src/main/java/org/secuso/privacyfriendlymemory/ui/navigation/StatisticsActivity.java | [
"public final class Constants {\n\n private Constants(){} // this class should not be initialized\n\n // Preferences Constants\n public final static String FIRST_APP_START = \"FIRST_APP_START\";\n public final static String SELECTED_CARD_DESIGN = \"SELECTED_CARD_DESIGN\";\n public final ... | import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.TabLayout;
import android.supp... | package org.secuso.privacyfriendlymemory.ui.navigation;
public class StatisticsActivity extends AppCompatActivity {
private static StatisticsActivity statisticsActivity;
private SectionsPagerAdapter mSectionsPagerAdapter;
private ViewPager mViewPager;
private SharedPreferences preferences = null;
... | List<Integer> resIdsDeckOne = MemoGameDefaultImages.getResIDs(CardDesign.FIRST, MemoGameDifficulty.Hard, false); | 5 |
chukanov/mnp | src/com/eyeline/mnp/Builder.java | [
"public final class Mask {\n public static final int MAX_LENGTH = 15;\n private static final String EMPTY_MASK = \"\";\n public static final char WILDCARD = '?';\n private static final char ZERO = '0';\n\n private final byte[] data;\n\n public Mask(String mask) {\n this.data = mask.getBytes... | import com.eyeline.mnp.mask.Mask;
import com.eyeline.mnp.parser.MasksParser;
import com.eyeline.mnp.parser.MnpParser;
import com.eyeline.utils.Translit;
import com.eyeline.utils.filter.Filter;
import com.eyeline.utils.filter.PatternFilter;
import org.apache.log4j.Logger;
import java.io.*;
import java.nio.charset.Standa... | package com.eyeline.mnp;
/**
* Bulder to help create and configurate storage
* @author Chukanov
*/
public class Builder {
private static final Logger log = Logger.getLogger(Builder.class);
private List<MasksParser> masksParsers = new ArrayList<>();
private List<MnpParser> mnpParsers = new ArrayList<... | this.titleFilter.add(PatternFilter.loadFromProperties(config)); | 5 |
sherlok/sherlok | src/test/java/org/sherlok/config/ConfigVariableManagerTest.java | [
"public static final String FILE_CONTENT_MASTER = \"MASTER\\n\";",
"public static final String TEST_URL = \"https://github.com/sherlok/sherlok_dependency_test.git\";",
"public static <E> ArrayList<E> list() {\n return new ArrayList<E>();\n}",
"public static <K, V> HashMap<K, V> map() {\n return new Hash... | import org.sherlok.utils.ops.FileOps;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.sherlok.config.GitConfigVariableTest.FILE_CONTENT_MASTER;
import static org.sherlok.config.GitConfigVariableTest.TEST_URL;
import static org.sherlok.utils.Create.list;
import s... | /**
* Copyright (C) 2014-2015 Renaud Richardet
*
* 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 applicabl... | List<String> input = list("$var/$x/$y", "$$", "$$x/$x", "$$$$z$z$$$z"); | 2 |
WorldSEnder/MCAnm | src/main/java/com/github/worldsender/mcanm/common/skeleton/stored/RawData.java | [
"@Mod(\r\n\t\tmodid = Reference.core_modid,\r\n\t\tname = Reference.core_modname,\r\n\t\tversion = Reference.core_modversion,\r\n\t\tguiFactory = \"com.github.worldsender.mcanm.client.config.MCAnmGuiFactory\")\r\npublic class MCAnm {\r\n\t/**\r\n\t * Enables various visual outputs, e.g. the bones of models are rend... | import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.util.UUID;
import com.github.worldsender.mcanm.MCAnm;
import com.github.worldsender.mcanm.common.Utils;
import com.github.worldsender.mcanm.common.exceptions.ModelFormatException;
import com.github.worldsender.mcanm.com... | package com.github.worldsender.mcanm.common.skeleton.stored;
public class RawData implements ISkeletonVisitable {
public static final long MAGIC_NUMBER = Utils.asciiToMagicNumber("MHFC SKL");
public static final RawData MISSING_DATA;
static {
MISSING_DATA = new RawData();
MISSING_DATA.modelUUID = new UUID(0... | public void visitBy(ISkeletonVisitor visitor) {} | 5 |
tliron/scripturian | components/scripturian/source/com/threecrickets/scripturian/adapter/SuccinctAdapter.java | [
"public class Executable\n{\n\t//\n\t// Constants\n\t//\n\n\t/**\n\t * Prefix prepended to on-the-fly scriptlets stored in the document source.\n\t */\n\tpublic static final String ON_THE_FLY_PREFIX = \"_ON_THE_FLY_\";\n\n\t//\n\t// Static operations\n\t//\n\n\t/**\n\t * If the executable does not yet exist in the ... | import java.util.Arrays;
import com.threecrickets.scripturian.Executable;
import com.threecrickets.scripturian.ExecutionContext;
import com.threecrickets.scripturian.LanguageAdapter;
import com.threecrickets.scripturian.Program;
import com.threecrickets.scripturian.exception.LanguageAdapterException;
import com.threecr... | /**
* Copyright 2009-2017 Three Crickets LLC.
* <p>
* The contents of this file are subject to the terms of the LGPL version 3.0:
* http://www.gnu.org/copyleft/lesser.html
* <p>
* Alternatively, you can obtain a royalty free commercial license with less
* limitations, transferable or non-transferable, directly f... | public TemplateSource getTemplateSource( ExecutionContext executionContext ) | 1 |
lkoskela/beaninject | src/test/java/org/laughingpanda/beaninject/TestTypeInjection.java | [
"public class Inject {\r\n\r\n\t/**\r\n\t * Returns a target identifier that uses an injector that injects directly\r\n\t * to a member field regardless of the field's visibility.\r\n\t * \r\n\t * @param fieldName\r\n\t * The name of the field to inject.\r\n\t */\r\n\tpublic static ITargetIdentifier fiel... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import junit.framework.JUnit4TestAdapter;
import org.junit.Test;
import org.laughingpanda.beaninject.Inject;
import org.laughingpanda.beaninject.impl.Accessor;
import org.laughingpanda.bea... | /*
* Copyright 2006 Lasse Koskela
*
* 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 a... | public TypeClassA anotherField;
| 3 |
mibo/janos | janos-core/src/main/java/org/apache/olingo/odata2/janos/processor/core/data/source/AnnotationDataSource.java | [
"public final class ReadOptions {\n private FilterExpression filter;\n private OrderByExpression orderBy;\n private String skipToken;\n private Integer skip;\n private Integer top;\n\n /**\n * None read options.\n *\n * @return the read options\n */\n public static ReadOptions none() {\n return ne... | import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceContent;
import org.apache.olingo.odata2.api.annotation.edm.EdmMediaResourceMimeType;
import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.ap... | /**
* *****************************************************************************
* 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 fil... | public ReadResult<?> readData(final EdmEntitySet entitySet, ReadOptions readOptions) throws ODataNotImplementedException, | 0 |
ldbc-dev/ldbc_snb_datagen_deprecated2015 | src/main/java/ldbc/socialnet/dbgen/serializer/CSVSerializer/CommentResolver.java | [
"public class BrowserDictionary {\n\t\n private static final String SEPARATOR = \" \";\n \n Vector<String> vBrowser;\n\tVector<Double> \tvBrowserCummulative; \n\n\tString fileName;\n\t\n\tdouble probAnotherBrowser;\n\t/**\n\t * Creator.\n\t * \n\t * @param fileName: The file which contains the brows... | import ldbc.socialnet.dbgen.dictionary.BrowserDictionary;
import ldbc.socialnet.dbgen.dictionary.IPAddressDictionary;
import ldbc.socialnet.dbgen.dictionary.LanguageDictionary;
import ldbc.socialnet.dbgen.generator.DateGenerator;
import ldbc.socialnet.dbgen.objects.Comment;
import ldbc.socialnet.dbgen.vocabulary.SN;
im... | package ldbc.socialnet.dbgen.serializer.CSVSerializer;
/**
* Created by aprat on 4/14/14.
*/
public class CommentResolver implements EntityFieldResolver<Comment> {
private IPAddressDictionary ipDic; | private LanguageDictionary languageDic; | 2 |
porscheinformatik/selenium-components | src/main/java/at/porscheinformatik/seleniumcomponents/component/SelectComponent.java | [
"public interface WebElementSelector\n{\n\n /**\n * Creates a selector that always uses the specified element. This selector ignores the {@link SearchContext}.\n *\n * @param description a description for toString, to make it easier to find the specified element. Most-often the\n * des... | import static at.porscheinformatik.seleniumcomponents.WebElementSelector.*;
import java.util.function.Predicate;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Quotes;
import org.openqa.selenium.support.ui.Select;
import at.porscheinformatik.seleniumcomponents.AbstractSeleniumComponent;
im... | package at.porscheinformatik.seleniumcomponents.component;
/**
* A <select>
*
* @author HAM
* @author Daniel Furtlehner
*/
public class SelectComponent extends AbstractSeleniumComponent implements ActiveSeleniumComponent
{
protected final SeleniumComponentListFactory<OptionComponent> optionsFactory ... | SeleniumAsserts.assertThatSoon("Select item at index: " + index, () -> { | 3 |
campaignmonitor/createsend-java | src/com/createsend/Segments.java | [
"public class PagedResult<T> {\r\n public T[] Results;\r\n public String ResultsOrderedBy;\r\n public String OrderDirection;\r\n public int PageNumber;\r\n public int PageSize;\r\n public int RecordsOnThisPage;\r\n public int TotalNumberOfRecords;\r\n public int NumberOfPages;\r\n \r\n ... | import com.createsend.util.exceptions.CreateSendException;
import com.createsend.util.jersey.JsonProvider;
import com.sun.jersey.core.util.MultivaluedMapImpl;
import javax.ws.rs.core.MultivaluedMap;
import java.util.Date;
import com.createsend.models.PagedResult;
import com.createsend.models.segments.ClauseResult... | /**
* Copyright (c) 2011 Toby Brain
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, mer... | public void addRuleGroup(RuleGroup ruleGroup) throws CreateSendException {
| 2 |
JOML-CI/JOML | src/org/joml/Vector3i.java | [
"public interface Externalizable extends java.io.Serializable {\n void writeExternal(ObjectOutput out) throws IOException;\n void readExternal(ObjectInput in) throws IOException, ClassNotFoundException;\n}",
"public interface ObjectInput extends DataOutput {\n\n double readDouble() throws IOException;\n ... | import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.nio.ByteBuffer;
import java.nio.IntBuffer; | */
public static double length(int x, int y, int z) {
return Math.sqrt(x * x + y * y + z * z);
}
public double distance(Vector3ic v) {
int dx = this.x - v.x();
int dy = this.y - v.y();
int dz = this.z - v.z();
return Math.sqrt(dx * dx + dy * dy + dz * dz);
}... | public void writeExternal(ObjectOutput out) throws IOException { | 2 |
sylvainhalle/Bullwinkle | Source/Parsing/src/ca/uqac/lif/bullwinkle/BullwinkleCli.java | [
"public static class InvalidGrammarException extends EmptyException\n{\n\t/**\n\t * Dummy UID\n\t */\n\tprivate static final transient long serialVersionUID = 1L;\n\n\tpublic InvalidGrammarException(final String message)\n\t{\n\t\tsuper(message);\n\t}\n\t\t\n\tpublic InvalidGrammarException(Throwable t)\n\t{\n\t\ts... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.List;
import java.util.Scanner;
import ca.uqac.lif.bullwinkle.BnfParser.InvalidGrammarException;
import ca.uqac.lif.bullwinkle.P... | verbosity = Integer.parseInt(c_line.getOptionValue(P_VERBOSITY));
}
if (verbosity > 0)
{
showHeader(stderr);
}
if (c_line.hasOption(P_VERSION))
{
stderr.println("(C) 2014-2021 Sylvain Hallé et al., Université du Québec à Chicoutimi");
stderr.println("This program comes with ABSOLUTELY NO WARRANT... | out_vis = new IndentedTextVisitor(); | 3 |
magnusmickelsson/pokeraidbot | src/main/java/pokeraidbot/jda/UnsignWithMinusCommandListener.java | [
"public class BotService {\n private static final Logger LOGGER = LoggerFactory.getLogger(BotService.class);\n private final Set<EventListener> extraListeners = new CopyOnWriteArraySet<>();\n private TrackingService trackingService;\n private String ownerId;\n private String token;\n private JDA b... | import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.GenericEvent;
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import net.dv8tion.jda.api.hooks.EventListener;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.comm... | package pokeraidbot.jda;
public class UnsignWithMinusCommandListener implements EventListener {
private static final Logger LOGGER = LoggerFactory.getLogger(UnsignWithMinusCommandListener.class);
private final RaidRepository raidRepository;
private final PokemonRepository pokemonRepository;
private ... | private final LocaleService localeService; | 2 |
utluiz/spring-examples | agenda-web-completa-springboot/src/main/java/br/com/starcode/agenda/controller/EntradaController.java | [
"public class Entrada {\r\n\r\n\tprivate Integer id;\r\n\tprivate Date horario;\r\n\tprivate String descricao;\r\n\tprivate Prioridade prioridade;\r\n\tprivate Integer idUsuario;\r\n\t\r\n\tpublic Integer getId() {\r\n\t\treturn id;\r\n\t}\r\n\t\r\n\tpublic void setId(Integer id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\t... | import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVa... | package br.com.starcode.agenda.controller;
@Controller
public class EntradaController {
/**
* Injeta o serviço de entradas (camada Service)
*/
| @Autowired EntradaService entradaService;
| 5 |
oSoc14/Artoria | app/src/main/java/be/artoria/belfortapp/mixare/lib/marker/PluginMarker.java | [
"public class Label implements ScreenObj, Parcelable {\n\tprivate float x, y;\n\tprivate float width, height;\n\tprivate ScreenObj obj;\n\n\tpublic void prepare(ScreenObj drawObj) {\n\t\tobj = drawObj;\n\t\tfloat w = obj.getWidth();\n\t\tfloat h = obj.getHeight();\n\n\t\tx = w / 2;\n\t\ty = 0;\n\n\t\twidth = w * 2;... | import android.location.Location;
import java.net.URLDecoder;
import be.artoria.belfortapp.mixare.lib.gui.Label;
import be.artoria.belfortapp.mixare.lib.gui.TextObj;
import be.artoria.belfortapp.mixare.lib.marker.draw.ClickHandler;
import be.artoria.belfortapp.mixare.lib.marker.draw.DrawCommand;
import be.artoria.belfo... | /*
* Copyright (C) 2012- Peer internet solutions & Finalist IT Group
*
* This file is part of be.artoria.belfortapp.mixare.
*
* 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 ve... | public abstract DrawCommand[] remoteDraw(); | 3 |
sfPlayer1/Matcher | src/matcher/gui/tab/VarInfoTab.java | [
"static String getName(Matchable<?> m, NameType nameType) {\n\tString ret = m.getDisplayName(nameType.withMapped(false), true);\n\tString mapped = m.getDisplayName(nameType.withMapped(true), true);\n\n\tif (Objects.equals(ret, mapped)) {\n\t\treturn ret;\n\t} else {\n\t\treturn ret+\" - \"+mapped;\n\t}\n}",
"publ... | import static matcher.gui.tab.ClassInfoTab.getName;
import javafx.geometry.Insets;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Tab;
import javafx.scene.layout.GridPane;
import matcher.NameType;
import match... | package matcher.gui.tab;
public class VarInfoTab extends Tab implements IGuiComponent {
public VarInfoTab(Gui gui, ISelectionProvider selectionProvider, boolean unmatchedTmp) {
super("var info");
this.gui = gui;
this.selectionProvider = selectionProvider;
this.unmatchedTmp = unmatchedTmp;
for (int i = 0;... | public void onMethodVarSelect(MethodVarInstance var) { | 6 |
RepreZen/KaiZen-OpenAPI-Editor | com.reprezen.swagedit.core/src/com/reprezen/swagedit/core/validation/Validator.java | [
"public abstract class JsonDocument extends Document {\n\n private final ObjectMapper mapper;\n private CompositeSchema schema;\n\n public enum Version {\n SWAGGER, OPENAPI;\n }\n\n private final Yaml yaml = new Yaml();\n\n private AtomicReference<Result<JsonNode>> jsonContent = new AtomicR... | import java.io.IOException;
import java.net.URI;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import org.apache.commons.lang3.tuple.Pair;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.preference.IPreferenceStore;
import o... | /*******************************************************************************
* Copyright (c) 2016 ModelSolv, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is a... | this.providers = ExtensionUtils.getValidationProviders(); | 8 |
kecskemeti/dissect-cf | src/main/java/hu/mta/sztaki/lpds/cloud/simulator/iaas/VirtualMachine.java | [
"public abstract class Timed implements Comparable<Timed> {\n\n\t/**\n\t * The main container for all recurring events in the system\n\t */\n\tprivate static final PriorityQueue<Timed> timedlist = new PriorityQueue<Timed>();\n\t/**\n\t * If set to true, the event loop is processing this object at the moment.\n\t */... | import org.apache.commons.lang3.tuple.Triple;
import hu.mta.sztaki.lpds.cloud.simulator.DeferredEvent;
import hu.mta.sztaki.lpds.cloud.simulator.Timed;
import hu.mta.sztaki.lpds.cloud.simulator.iaas.VMManager.VMManagementException;
import hu.mta.sztaki.lpds.cloud.simulator.iaas.resourcemodel.ConsumptionEventAdapter;
im... | /*
* ========================================================================
* DIScrete event baSed Energy Consumption simulaTor
* for Clouds and Federations (DISSECT-CF)
* ========================================================================
*
* This file is part of DISSECT-CF.
*... | throws VMManagementException, NetworkNode.NetworkException { | 4 |
nikacotAndroid/Weather-Guru-MVP | app/src/main/java/mk/petrovski/weathergurumvp/injection/module/ApplicationModule.java | [
"public class AppDataManager implements DataManager {\n\n private final Context context;\n private final DbHelper dbHelper;\n private final PreferencesHelper applicationPreferences;\n private final ApiHelper apiHelper;\n\n @Inject\n public AppDataManager(Context context, DbHelper dbHelper,\n PreferencesH... | import android.app.Application;
import android.content.Context;
import dagger.Module;
import dagger.Provides;
import mk.petrovski.weathergurumvp.R;
import mk.petrovski.weathergurumvp.data.AppDataManager;
import mk.petrovski.weathergurumvp.data.DataManager;
import mk.petrovski.weathergurumvp.data.local.db.DbHelper;
impo... | package mk.petrovski.weathergurumvp.injection.module;
/**
* Created by Nikola Petrovski on 2/13/2017.
*/
@Module(includes = {
ContextModule.class, PreferencesModule.class, NetworkModule.class, DatabaseModule.class
}) public class ApplicationModule {
private final Application application;
public Applicati... | @ApplicationContext Context context, PreferencesHelper preferencesHelper, DbHelper dbHelper, | 2 |
integeruser/jgltut | src/integeruser/jgltut/tut10/FragmentAttenuation.java | [
"public class MousePoles {\n public enum MouseButtons {\n MB_LEFT_BTN,\n MB_RIGHT_BTN,\n MB_MIDDLE_BTN\n }\n\n public enum MouseModifiers {\n MM_KEY_SHIFT,\n MM_KEY_CTRL,\n MM_KEY_ALT\n }\n\n ////////////////////////////////\n public static class ObjectDat... | import integeruser.jglsdk.glutil.MousePoles.*;
import integeruser.jgltut.Tutorial;
import integeruser.jgltut.commons.ProjectionBlock;
import integeruser.jgltut.commons.UnprojectionBlock;
import integeruser.jgltut.framework.Framework;
import integeruser.jgltut.framework.Mesh;
import integeruser.jgltut.framework.MousePol... | package integeruser.jgltut.tut10;
/**
* Visit https://github.com/integeruser/jgltut for info and updates.
* Original: https://bitbucket.org/alfonse/gltut/src/default/Tut%2010%20Plane%20Lights/Fragment%20Attenuation.cpp
* <p>
* Part III. Illumination
* Chapter 10. Plane Lights
* <p>
* I,J,K,L - control the ... | cylinderMesh = new Mesh("UnitCylinder.xml"); | 5 |
Kaysoro/KaellyBot | src/main/java/commands/classic/GuildCommand.java | [
"public abstract class AbstractCommand implements Command {\n\n private final static Logger LOG = LoggerFactory.getLogger(AbstractCommand.class);\n\n protected String name;\n protected String pattern;\n protected DiscordException badUse;\n private boolean isPublic;\n private boolean isUsableInMP;\... | import commands.model.AbstractCommand;
import data.DofusGuild;
import discord4j.core.event.domain.message.MessageCreateEvent;
import discord4j.core.object.entity.Message;
import enums.Language;
import exceptions.*;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import... | package commands.classic;
/**
* Created by steve on 30/03/2018.
*/
public class GuildCommand extends AbstractCommand {
private final static String forPseudo = "text=";
private final static String forServer = "guild_server_id[]=";
private DiscordException tooMuchGuilds;
private DiscordException no... | public void request(MessageCreateEvent event, Message message, Matcher m, Language lg) { | 2 |
dazraf/vertx-futures | src/test/java/io/dazraf/vertx/futures/processors/CallProcessorTest.java | [
"static <T> Futures<T> when(Future<T> future) {\n return FuturesImpl.when(future);\n}",
"public class TestUtils {\n public static final String RESULT_MSG = \"result\";\n public static final int RESULT_INT = 42;\n public static boolean RESULT_BOOL = true;\n}",
"public class VertxMatcherAssert {\n\n public s... | import io.vertx.ext.unit.Async;
import io.vertx.ext.unit.TestContext;
import io.vertx.ext.unit.junit.RunTestOnContext;
import io.vertx.ext.unit.junit.VertxUnitRunner;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.Arrays;
import static io.dazraf.vertx.futures.Future... | package io.dazraf.vertx.futures.processors;
@RunWith(VertxUnitRunner.class)
public class CallProcessorTest {
private static final String MSG = "message";
private static final String FAILED = "failed";
@ClassRule
public static RunTestOnContext rule = new RunTestOnContext();
@Test
public void callShouldN... | when(failedFuture(MSG)) | 0 |
legobmw99/Allomancy | src/main/java/com/legobmw99/allomancy/datagen/ItemModels.java | [
"@Mod(Allomancy.MODID)\npublic class Allomancy {\n\n public static final String MODID = \"allomancy\";\n public static final CreativeModeTab allomancy_group = new CreativeModeTab(MODID) {\n @Override\n public ItemStack makeIcon() {\n return new ItemStack(CombatSetup.MISTCLOAK.get());\... | import com.legobmw99.allomancy.Allomancy;
import com.legobmw99.allomancy.api.enums.Metal;
import com.legobmw99.allomancy.modules.combat.CombatSetup;
import com.legobmw99.allomancy.modules.consumables.ConsumeSetup;
import com.legobmw99.allomancy.modules.extras.ExtrasSetup;
import com.legobmw99.allomancy.modules.material... | package com.legobmw99.allomancy.datagen;
public class ItemModels extends ItemModelProvider {
public ItemModels(DataGenerator generator, String modid, ExistingFileHelper existingFileHelper) {
super(generator, modid, existingFileHelper);
}
@Override
protected void registerModels() {
par... | Allomancy.LOGGER.debug("Creating Item Model for allomancy:vial (filled)"); | 0 |
jlinn/asana-api-java | src/test/java/net/joelinn/asana/test/tasks/TasksClientTest.java | [
"public class ApiException extends RuntimeException{\n protected ClientResponse.Status status;\n protected String message;\n\n public ApiException(ClientResponse.Status status, String message){\n super(message);\n this.status = status;\n this.message = message;\n }\n\n public Cli... | import com.sun.jersey.api.client.ClientResponse;
import junit.framework.TestCase;
import net.joelinn.asana.ApiException;
import net.joelinn.asana.tags.Tags;
import net.joelinn.asana.tasks.Task;
import net.joelinn.asana.tasks.TaskRequestBuilder;
import net.joelinn.asana.tasks.TasksClient;
import net.joelinn.asana.test.B... | package net.joelinn.asana.test.tasks;
/**
* Joe Linn
* 11/17/13
*/
public class TasksClientTest extends BaseTest{
protected TasksClient client;
@Before
public void setUp(){
client = new TasksClient(getApiKey());
}
@Test
public void testTasks(){
if(getApiKey().equals("")){
... | Tags tags = client.getTags(retrievedTask.id); | 1 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XCARespondingGatewayAuditor.java | [
"public abstract class IHETransactionEventTypeCodes extends CodedValueType\n{\n\t/**\n\t * Create a new IHE Event Code using a specific code and value\n\t * \n\t * @param value Coded value for IHE event code\n\t * @param meaning Display name for IHE event code\n\t */\n\tprotected IHETransactionEventTypeCodes(String... | import org.openhealthtools.ihe.atna.auditor.codes.ihe.IHETransactionEventTypeCodes;
import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes.RFC3881EventOutcomeCodes;
import org.openhealthtools.ihe.atna.auditor.context.AuditorModuleContext;
import org.openhealthtools.ihe.atna.auditor.events.ihe.Expor... | /*******************************************************************************
* Copyright (c) 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is a... | exportEvent.addSourceActiveParticipant(respondingGatewayEndpointUri, getSystemAltUserId(), null, EventUtils.getAddressForUrl(respondingGatewayEndpointUri, false), false); | 5 |
cm-heclouds/JAVA-HTTP-SDK | javaSDK/src/main/java/cmcc/iot/onenet/javasdk/api/mqtt/DeleteUserTopic.java | [
"public abstract class AbstractAPI<T> {\n public String key;\n public String url;\n public Method method;\n public ObjectMapper mapper = initObjectMapper();\n\n private ObjectMapper initObjectMapper() {\n ObjectMapper objectMapper = new ObjectMapper();\n //关闭字段不识别报错\n objectMappe... | import java.util.HashMap;
import java.util.Map;
import org.apache.http.HttpResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import cmcc.iot.onenet.javasdk.api.AbstractAPI;
import cmcc.iot.onenet.javasdk.exception.OnenetApiException;
import cmcc.iot.o... | package cmcc.iot.onenet.javasdk.api.mqtt;
public class DeleteUserTopic extends AbstractAPI{
private final Logger logger = LoggerFactory.getLogger(this.getClass());
private String name;
private HttpDeleteMethod HttpMethod;
/**
* 删除产品的Topic
* @param name:topic名(必选)
* @param key:masterkey
*/
public Delet... | public BasicResponse<Void> executeApi() { | 4 |
tripsta/spring-boot-starter-kit | application/sbsk-service/src/main/java/com/sbsk/service/services/user/UserServiceImpl.java | [
"public class UserRequestDto {\n\n private String firstName;\n private String lastName;\n private Integer age;\n\n public UserRequestDto() {\n }\n\n public UserRequestDto(String firstName, String lastName, Integer age) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.age = age;\... | import com.sbsk.dtos.user.UserRequestDto;
import com.sbsk.dtos.user.UserResponseDto;
import com.sbsk.persistence.entities.user.UserEntity;
import com.sbsk.persistence.repositories.UserRepository;
import com.sbsk.service.converters.user.UserConverter;
import com.sbsk.service.validators.UserValidator;
import org.springfr... | package com.sbsk.service.services.user;
@Service
public class UserServiceImpl implements UserService {
@Autowired
private UserValidator userValidator;
@Autowired
private UserConverter userConverter;
@Autowired
private UserRepository userRepository;
@Override | public List<UserResponseDto> getAllUsers() { | 1 |
szegedi/dynalink | src/test/java/org/dynalang/dynalink/beans/TestSimpleDynamicMethod.java | [
"enum Comparison {\n INDETERMINATE,\n TYPE_1_BETTER,\n TYPE_2_BETTER,\n}",
"public class GuardedInvocation {\n private static final SwitchPoint[] NO_SWITCH_POINTS = new SwitchPoint[0];\n\n private final MethodHandle invocation;\n private final MethodHandle guard;\n private final Class<? exten... | import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
import junit.framework.TestCase;
import org.dynalang.dynalink.linker.ConversionComparator.Comparison;
import org.dynalang.dynalink.linker.GuardedInvocation;
import org.dynalang.dynalink.linker.LinkRequest;
import org.dynalang.dynalink.linker.Link... | /*
Copyright 2009-2013 Attila Szegedi
Licensed under both the Apache License, Version 2.0 (the "Apache License")
and the BSD License (the "BSD License"), with licensee being free to
choose either of the two at their discretion.
You may not use this file except in compliance with either the Apache
Li... | return Lookup.PUBLIC.findVirtual(Test1.class, "x", MethodType.methodType(int.class, int.class, int.class)); | 4 |
eBay/mTracker | build-service/src/main/java/com/ccoe/build/alerts/pfdash/PfDashJob.java | [
"public class AlertResult {\n\n\tprivate List<SingleResult> resultlist = new ArrayList<SingleResult>();\n\n\n\tpublic List<SingleResult> getResultlist() {\n\t\treturn resultlist;\n\t}\n\n\tpublic void setResultlist(List <SingleResult> resultlist) {\n\t\tthis.resultlist = resultlist;\n\t}\n}",
"public class Compar... | import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import o... | /*
Copyright [2013-2014] eBay Software Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | for (SingleResult singleResult : ar.getResultlist()) { | 3 |
gruter/cloumon-oozie | src/main/java/org/cloumon/gruter/oozie/web/WorkflowController.java | [
"@Controller\npublic class BaseController{\n\tprotected static final Logger logger = LoggerFactory.getLogger(BaseController.class);\n\n\t@Autowired\n\tprivate WebApplicationContext ctx;\n\tprotected MappingJacksonHttpMessageConverter jsonConverter = new MappingJacksonHttpMessageConverter();\n\n\tprotected WebAppli... | import java.io.IOException;
import java.util.HashMap;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.cloumon.gruter.common.BaseController;
import org.cloumon.gruter.oozie.model.OozieApp;
import org.cloumon.gruter.oozie.model.OozieJob;
import org.cloumon.gruter.oozie.service.... | package org.cloumon.gruter.oozie.web;
@Controller
public class WorkflowController extends BaseController{ | @Resource(type=WorkflowService.class) | 4 |
desht/ScrollingMenuSign | src/main/java/me/desht/scrollingmenusign/views/icon/IconMenu.java | [
"public class SMSException extends DHUtilsException {\n\n private static final long serialVersionUID = 1L;\n\n public SMSException(String message) {\n super(message);\n }\n\n}",
"public class SMSMenuItem implements Comparable<SMSMenuItem>, SMSUseLimitable {\n private final String label;\n pr... | import me.desht.dhutils.Debugger;
import me.desht.dhutils.MiscUtil;
import me.desht.scrollingmenusign.SMSException;
import me.desht.scrollingmenusign.SMSMenuItem;
import me.desht.scrollingmenusign.ScrollingMenuSign;
import me.desht.scrollingmenusign.enums.ViewJustification;
import me.desht.scrollingmenusign.util.SMSUti... | package me.desht.scrollingmenusign.views.icon;
public class IconMenu implements Listener, SMSPopup {
private static final int INVENTORY_WIDTH = 9;
private static final int MAX_INVENTORY_ROWS = 6;
private static final String SMS_CLOSING_ON_COMMAND = "SMS_Closing_On_Command";
private static final int M... | Bukkit.getPluginManager().registerEvents(this, ScrollingMenuSign.getInstance()); | 2 |
duniter-gchange/gchange-pod | gchange-pod-es-plugin/src/main/java/org/duniter/elasticsearch/gchange/service/MarketService.java | [
"public class PluginSettings extends AbstractLifecycleComponent<PluginSettings> {\n\n private org.duniter.elasticsearch.user.PluginSettings delegate;\n\n @Inject\n public PluginSettings(org.elasticsearch.common.settings.Settings settings,\n org.duniter.elasticsearch.PluginSettings ... | import com.fasterxml.jackson.databind.JsonNode;
import org.duniter.core.client.model.elasticsearch.Record;
import org.duniter.core.client.model.elasticsearch.RecordComment;
import org.duniter.core.service.CryptoService;
import org.duniter.core.util.ArrayUtils;
import org.duniter.core.util.Preconditions;
import org.duni... | package org.duniter.elasticsearch.gchange.service;
/*
* #%L
* UCoin Java Client :: Core API
* %%
* Copyright (C) 2014 - 2015 EIS
* %%
* 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, eit... | public <C> List<C> findByFilter(MarketRecordFilter filter, Class<? extends C> clazz) { | 7 |
Alex1304/ultimategdbot | app/src/main/java/ultimategdbot/command/AccountCommand.java | [
"public final class Strings {\n\n public static final String GENERAL = \"GeneralStrings\";\n public static final String GD = \"GDStrings\";\n\n private Strings() {\n throw new AssertionError();\n }\n}",
"@ConfigEntry(\"ultimategdbot\")\n@Value.Immutable\n@JsonDeserialize(as = ImmutableUltimateG... | import botrino.api.config.ConfigContainer;
import botrino.interaction.InteractionFailedException;
import botrino.interaction.RetryableInteractionException;
import botrino.interaction.annotation.ChatInputCommand;
import botrino.interaction.annotation.Subcommand;
import botrino.interaction.context.ChatInputInteractionCon... | package ultimategdbot.command;
@ChatInputCommand(
name = "account",
description = "Manage your connection with your Geometry Dash account.",
subcommands = {
@Subcommand(
name = "status",
description = "Shows your account linking... | private final GDCommandCooldown commandCooldown; | 5 |
maxant/genericconnector | demo/genericconnector-demo-javaee-client/src/main/java/ch/maxant/jca_demo/client/SomeServiceThatBindsResourcesIntoTransaction.java | [
" public static Acquirer getAcquirer() {\n\t//String baseUrl = \"http://localhost:9081/genericconnector-demo-webservice-acquirer-2.1.1-SNAPSHOT/AcquirerWebService\";\n\tString baseUrl = \"http://a.maxant.ch/AcquirerWebService\";\n\ttry{\n\t\tURL url = new URL(baseUrl + \"?wsdl\");\n\t\tAcquirer svc = new Acquirer... | import static ch.maxant.jca_demo.client.IntegrationLayer.getAcquirer;
import static ch.maxant.jca_demo.client.IntegrationLayer.getBookingsystem;
import static ch.maxant.jca_demo.client.IntegrationLayer.getLetterwriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
impor... | /*
Copyright 2015 Ant Kutschera
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... | LetterWriter letterWriter = getLetterwriter();
| 2 |
hamadmarri/Biscuit | main/java/com/biscuit/commands/task/EditTask.java | [
"public class ColorCodes {\n\n\t// with normal background\n\tpublic static final String RESET = \"\\u001B[0m\";\n\tpublic static final String BLACK = \"\\u001B[30;1m\";\n\tpublic static final String RED = \"\\u001B[31;1m\";\n\tpublic static final String GREEN = \"\\u001B[32;1m\";\n\tpublic static final String YELLO... | import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import com.biscuit.ColorCodes;
import com.biscuit.commands.Command;
import com.biscuit.factories.DateCompleter;
import com.biscuit.models.Task;
import com.biscuit.models.enums.Status;
import com.biscuit.mod... | package com.biscuit.commands.task;
public class EditTask implements Command {
ConsoleReader reader = null;
Task t = new Task();
public EditTask(ConsoleReader reader, Task t) {
super();
this.reader = reader;
this.t = t;
}
public boolean execute() throws IOException {
String prompt = reader.getPromp... | + ColorCodes.RESET + "current value: " + DateService.getDateAsString(t.dueDate) + "\n"); | 5 |
krHasan/Money-Manager | src/controller/TransactionHistoryController.java | [
"public class TransactionHistoryModel extends DateAndClock {\n\t\n\tpublic ObservableList<String> loadAllMonths() {\n\t\tObservableList<String> list = FXCollections.observableArrayList((new ComboboxList()).getAllMonth());\n\t\treturn list;\n\t}\n\t\n\t\n\tpublic ObservableList<String> loadAllFilter() {\n\t\tObserva... | import java.net.URL;
import java.time.LocalDate;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.concurrent.Worker;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml... | package controller;
public class TransactionHistoryController extends TransactionHistoryModel {
@FXML
private MenuItem mnuDashboard;
@FXML
private MenuItem mnuGetMoney;
@FXML
private MenuItem mnuExpense;
@FXML
private MenuItem mnuLend;
@FXML
private MenuItem mnuBank;
@FXML
private MenuItem mnuSettings;... | (new TabAccess()).setTabName("tabGetMoney"); | 4 |
apache/commons-fileupload | src/main/java/org/apache/commons/fileupload2/disk/DiskFileItem.java | [
"public interface FileItem extends FileItemHeadersSupport {\n\n // ------------------------------- Methods from javax.activation.DataSource\n\n /**\n * Returns an {@link java.io.InputStream InputStream} that can be\n * used to retrieve the contents of the file.\n *\n * @return An {@link java.i... | import static java.lang.String.format;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UncheckedIOException;
import java.io.UnsupportedEncodingException;
import java.nio.file.Files;
import java.util.Ma... | /*
* 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... | final ParameterParser parser = new ParameterParser();
| 3 |
OpenWatch/OpenWatch-Android | app/OpenWatch/src/org/ale/openwatch/model/OWPhoto.java | [
"public class Constants {\n\n public static final String SUPPORT_EMAIL = \"team@openwatch.net\";\n public static final String GOOGLE_STORE_URL = \"https://play.google.com/store/apps/details?id=org.ale.openwatch\";\n public static final String APPLE_STORE_URL = \"https://itunes.apple.com/us/app/openwatch-so... | import android.content.Context;
import android.database.Cursor;
import android.util.Log;
import com.orm.androrm.DatabaseAdapter;
import com.orm.androrm.Model;
import com.orm.androrm.QuerySet;
import com.orm.androrm.field.BooleanField;
import com.orm.androrm.field.CharField;
import com.orm.androrm.field.DoubleField;
imp... | public void setLat(Context c, double lat) {
this.lat.set(lat);
}
@Override
public double getLat(Context c) {
return this.lat.get();
}
@Override
public void setLon(Context c, double lon) {
this.lon.set(lon);
}
@Override
public double getLon(Context c) {
return this.lon.get();
}
@Override
public ... | String query_string = String.format("SELECT %s FROM %s WHERE %s = \"%s\"", DBConstants.ID, DBConstants.PHOTO_TABLENAME, DBConstants.RECORDINGS_TABLE_UUID, json_obj.getString(Constants.OW_UUID)); | 2 |
aw20/MongoWorkBench | src/org/aw20/mongoworkbench/eclipse/view/wizard/AggregateWizard.java | [
"public enum Event {\n\n\tDOCUMENT_VIEW,\n\tELEMENT_VIEW,\n\t\n\tWRITERESULT,\n\t\n\tEXCEPTION, \n\t\n\tTOWIZARD\n\t\n}",
"public class EventWorkBenchManager extends Object {\n\tprivate static EventWorkBenchManager thisInst;\n\t\n\tpublic static synchronized EventWorkBenchManager getInst(){\n\t\tif ( thisInst == ... | import java.io.IOException;
import org.aw20.mongoworkbench.Event;
import org.aw20.mongoworkbench.EventWorkBenchManager;
import org.aw20.mongoworkbench.MongoFactory;
import org.aw20.mongoworkbench.command.AggregateMongoCommand;
import org.aw20.mongoworkbench.command.MongoCommand;
import org.aw20.mongoworkbench.eclipse.v... | /*
* MongoWorkBench is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Free Software Foundation,version 3.
*
* MongoWorkBench is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implie... | MongoCommand mcmd = MongoFactory.getInst().createCommand(sb.toString()); | 4 |
dbuschman7/mongoFS | src/test/java/me/lightspeed7/mongofs/spring/SpringStandUpTest.java | [
"public final class LoremIpsum {\n\n private static final String TEXT_FILE = \"./src/test/resources/loremIpsum.txt\";\n\n private LoremIpsum() {\n // hidden\n }\n\n public static File getFile() throws IOException {\n File file = new File(TEXT_FILE);\n if (!file.exists()) {\n ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.UnknownHostException;
import me.lights... | package me.lightspeed7.mongofs.spring;
public class SpringStandUpTest {
@BeforeClass
public static void setup() throws UnknownHostException {
SpringContext.setCtx(new FileSystemXmlApplicationContext("src/test/resources/spring.xml"));
SpringContext.dumpDefinedBeanNames();
}
@Test... | ByteArrayInputStream in = new ByteArrayInputStream(LoremIpsum.LOREM_IPSUM.getBytes()); | 0 |
tedgueniche/IPredict | src/ca/ipredict/predictor/Evaluator.java | [
"public class DatabaseHelper {\n\n\t/**\n\t * Path to the datasets directory\n\t */\n\tprivate String basePath;\n\t\n\t//Data sets\n\tpublic static enum Format{BMS, KOSARAK, FIFA, MSNBC, SIGN, CANADARM1, CANADARM2, SNAKE, BIBLE_CHAR, BIBLE_WORD, KORAN_WORD, LEVIATHAN_WORD, CUSTOM}; \n\t\n\t//Database\n\tprivate Seq... | import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.io.IOException;
import ca.ipredict.database.DatabaseHelper;
import ca.ipredict.database.DatabaseHelper.Format;
import ca.ipredict.database.Item;
import ca.ipredict.database.Sequence;
import ca.ipredict.database.SequenceStatsGene... | package ca.ipredict.predictor;
/**
* Evaluation framework
*/
public class Evaluator {
private List<Predictor> predictors; //list of predictors
//Sampling type
public final static int HOLDOUT = 0;
public final static int KFOLD = 1;
public final static int RANDOMSAMPLING = 2;
//statistics
private long s... | List<Sequence> trainingSequences = getDatabaseCopy(); | 3 |
stuart-warren/logit | src/main/java/com/stuartwarren/logit/tomcatvalve/ZmqAppender.java | [
"public interface IFrameworkLayout {\n \n /**\n * @return the layoutType\n */\n public String getLayoutType();\n\n /**\n * @param layoutType the layoutType to set\n */\n public void setLayoutType(String layoutType);\n\n /**\n * @return the detailThreshold\n */\n public S... | import org.apache.catalina.LifecycleException;
import org.apache.catalina.LifecycleState;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
import org.apache.catalina.valves.AccessLogValve;
import com.stuartwarren.logit.layout.IFrameworkLayout;
import com.stuartwarren.logit.ut... | /**
*
*/
package com.stuartwarren.logit.tomcatvalve;
/**
* @author Stuart Warren
* @date 6 Oct 2013
*
* Log4j1 ZMQ Appender
*/
public class ZmqAppender extends AccessLogValve implements IZmqTransport, IFrameworkLayout {
private transient final ZmqTransport appender = new ZmqTransport();
privat... | final Layout l = (Layout) LayoutLoader.instantiateByClassName(layout, DEFAULT_LAYOUT); | 1 |
mirabeau-nl/ceddl4j | src/main/java/nl/mirabeau/ceddl4j/transaction/Transaction.java | [
"public class DigitalData {\n\n\t/**\n\t * Constant for the version of CEDDL (1.0) implemented by this library.\n\t */\n\tpublic static final String VERSION_1_0 = \"1.0\";\n\n\t/**\n\t * Constant for the Default security category.\n\t */\n\tpublic static final String DEFAULT_SECURITY = \"Default\";\n\n\t/**\n\t * N... | import java.util.LinkedList;
import java.util.List;
import nl.mirabeau.ceddl4j.DigitalData;
import nl.mirabeau.ceddl4j.internal.BaseItem;
import nl.mirabeau.ceddl4j.shared.Attributes;
import nl.mirabeau.ceddl4j.shared.Item;
import nl.mirabeau.ceddl4j.shared.Price;
import com.fasterxml.jackson.annotation.JsonProperty; | package nl.mirabeau.ceddl4j.transaction;
/**
* The Transaction object is similar to the Cart object, but represents a
* completed order. The Transaction object contains analogous sub-objects to the
* Cart object as well as additional sub-objects specific to completed orders.
*/
public class Transaction extends ... | private Attributes<Transaction> attributes; | 2 |
52Jolynn/MyTv | src/main/java/com/laudandjolynn/mytv/crawler/CrawlerGroup.java | [
"public class AllTvStationCrawlEndEvent extends CrawlEndEvent<List<TvStation>> {\r\n\tprivate static final long serialVersionUID = -3789839197425037620L;\r\n\r\n\tpublic AllTvStationCrawlEndEvent(Object source, List<TvStation> returnValue) {\r\n\t\tsuper(source, returnValue);\r\n\t}\r\n\r\n}\r",
"public class Cra... | import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.E... | /*******************************************************************************
* Copyright 2015 htd0324@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:... | throw new MyTvException("url isn't avaliable of crawler group.");
| 5 |
antest1/kcanotify | app/src/main/java/com/antest1/kcanotify/ExpeditionTableActivity.java | [
"public static int loadSimpleExpeditionInfoFromStorage(Context context) {\n JsonArray data = getJsonArrayFromStorage(context, \"expedition.json\");\n if (data != null) {\n for (JsonElement item : data) {\n JsonObject expdata = item.getAsJsonObject();\n kcExpeditionData.add(expdata... | import android.content.Intent;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import android.util.... | package com.antest1.kcanotify;
public class ExpeditionTableActivity extends AppCompatActivity {
static final int SHIPINFO_GET_SORT_KEY = 1;
static final int SHIPINFO_GET_FILTER_RESULT = 2;
Toolbar toolbar;
static Gson gson = new Gson();
ListView listview;
TextView greatscbtn;
boolean... | loadTranslationData(getApplicationContext()); | 1 |
SOM-Research/EMFtoCSP | plugins/fr.inria.atlanmod.emftocsp.ui/src/fr/inria/atlanmod/emftocsp/ui/commands/AbstractWizardHandler.java | [
"public interface ICspSolver <ST> { \n\n public boolean solveCSP(File srcFile, List<File> libs) throws ProcessingException; \n\n public boolean solveCSP(File srcFile) throws ProcessingException; \n \n public Object getResult();\n\n public ST getSolution();\n}",
"public interface IModelToCspSolver<R,ST> {\... | import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resour... | /*******************************************************************************
* Copyright (c) 2013 INRIA Rennes Bretagne-Atlantique.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, an... | IModelToCspSolverFactory<Resource,CompoundTerm> modelSolverFactory = new EmfModelToCspSolverFactory(); | 4 |
gems-uff/prov-viewer | src/main/java/br/uff/ic/provviewer/Layout/Temporal_Layout.java | [
"public class Variables extends Object {\n\n public String mergingWithGraphPath;\n public String originalGraphPath = \"demo\";\n public Markov markov = new Markov();\n\n// public static String demo = File.separator + \"Graph\" + File.separator + \"Merge_Test.xml\";\n// public static String demo = Fil... | import edu.uci.ics.jung.graph.Graph;
import java.awt.geom.Point2D;
import java.util.ConcurrentModificationException;
import br.uff.ic.provviewer.Variables;
import br.uff.ic.utility.Utils;
import br.uff.ic.utility.graph.ActivityVertex;
import br.uff.ic.utility.graph.AgentVertex;
import br.uff.ic.utility.graph.EntityVert... | /*
* The MIT License
*
* Copyright 2017 Kohwalter.
*
* 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, modif... | if (v instanceof AgentVertex) { | 3 |
mstojcevich/Radix | core/src/sx/lambda/voxel/tasks/MovementHandler.java | [
"public class RadixClient extends ApplicationAdapter {\n\n // TODO CLEANUP the render loop is VERY undocumented and things happen all over the place, clean that up\n\n public static final String GAME_TITLE = \"VoxelTest\";\n private static RadixClient theGame;\n\n private SettingsManager settingsManager... | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.collision.BoundingBox;
import sx.lambda.voxel.RadixClient;
import sx.lambda.voxel.api.BuiltInBlockIds;
import sx.lambda.voxel.block.Block;
import sx.lamb... | package sx.lambda.voxel.tasks;
/**
* Handles input-based movement, forces, and gravity application.
*/
public class MovementHandler implements RepeatedTask {
// In meters per milliseconds
private static final float WALK_SPEED = 0.0032f;
public MovementHandler(RadixClient game) {
this.game = ga... | Player player = game.getPlayer(); | 4 |
ToroCraft/NemesisSystem | src/main/java/net/torocraft/nemesissystem/network/MessageOpenNemesisDetailsGuiRequest.java | [
"@Mod(modid = NemesisSystem.MODID, version = NemesisSystem.VERSION, name = NemesisSystem.MODNAME)\npublic class NemesisSystem {\n\n\tpublic static final String MODID = \"nemesissystem\";\n\tpublic static final String VERSION = \"1.12.1-2\";\n\tpublic static final String MODNAME = \"NemesisSystem\";\n\n\tpublic stat... | import io.netty.buffer.ByteBuf;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.fml.common.network.ByteBufUtils;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minec... | package net.torocraft.nemesissystem.network;
public class MessageOpenNemesisDetailsGuiRequest implements IMessage {
private UUID nemesisId;
public static void init(int packetId) {
NemesisSystem.NETWORK
.registerMessage(MessageOpenNemesisDetailsGuiRequest.Handler.class, MessageOpenNemesisDetailsGuiRequest.cl... | NemesisKnowledge knowledge = DiscoveryUtil.getGetPlayerKnowledgeOfNemesis(player, nemesis.getId()); | 1 |
shibing624/crf-seg | src/main/java/org/xm/xmnlp/seg/Segment.java | [
"public class Xmnlp {\n /**\n * 日志组件\n */\n private static Logger logger = LogManager.getLogger();\n\n public static final class Config {\n /**\n * 默认关闭调试\n */\n public static boolean DEBUG = false;\n /**\n * 字符类型对应表\n */\n public static S... | import org.xm.xmnlp.Xmnlp;
import org.xm.xmnlp.dictionary.other.CharTable;
import org.xm.xmnlp.seg.domain.Term;
import org.xm.xmnlp.util.SentencesUtil;
import org.xm.xmnlp.util.TextUtil;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import static org.xm.xmnlp.util.Static.logger; | package org.xm.xmnlp.seg;
/**
* 分词器(分词服务)<br>
* 是所有分词器的基类(Abstract)<br>
* 分词器的分词方法是线程安全的,但配置方法则不保证
* <p/>
* Created by xuming on 2016/7/22.
*/
public abstract class Segment {
/**
* 分词器配置
*/
protected TokenizerConfig tokenizerConfig;
/**
* 构造一个分词器
*/
public Segment() {
... | protected abstract List<Term> segSentence(char[] sentence); | 2 |
google/gulava | javatests/gulava/processor/MakeGoalFactoryNonLogicArgsTest.java | [
"@MakeLogicValue\npublic abstract class Cons<CAR, CDR> {\n /**\n * Package-protected constructor because only {@link Cons} should subclass.\n */\n Cons() {}\n\n public abstract CAR car();\n public abstract CDR cdr();\n\n public static <CAR, CDR> Cons<CAR, CDR> of(CAR car, CDR cdr) {\n return new MakeLog... | import org.junit.runners.JUnit4;
import gulava.Cons;
import gulava.Goal;
import gulava.Goals;
import gulava.Var;
import gulava.annotation.MakeGoalFactory;
import gulava.testing.LogicAsserter;
import org.junit.Test;
import org.junit.runner.RunWith; | /*
* Copyright (c) 2016 The Gulava Authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, me... | static Goal found(int x, Cons<?, ?> a) { | 0 |
tticoin/JointER | src/jp/tti_coin/main/java/data/nlp/relation/RelationEvaluator.java | [
"public abstract class Model {\n\tprotected Parameters params;\n\tprotected FeatureGenerator fg;\n\tprotected WeightVector weight;\n\tprotected WeightVector weightDiff;\n\tprotected WeightVector aveWeight;\n\tprotected int trainStep;\n\t\n\tpublic Model(Parameters params, FeatureGenerator fg){\n\t\tthis.params = pa... | import java.io.BufferedWriter;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import com.google.common.io.Files;
import model.Model;
import inference.Inference;
import inference.State;
i... | package data.nlp.relation;
public class RelationEvaluator extends Evaluator {
public RelationEvaluator(Parameters params, Inference infer) {
super(params, infer);
}
private class Counter{
int correct;
int pred;
int gold;
public Counter(){
correct = 0;
pred = 0;
gold = 0;
}
double getPre... | public void evaluate(Model model, Data valid){ | 0 |
ibm-security-intelligence/visualizations | incident_overview/src/main/java/com/ibm/si/qradar/offenseviz/api/OffenseResource.java | [
"public class QRadarConfig {\r\n\r\n\tprivate static final Logger logger = LoggerFactory.getLogger(QRadarConfig.class);\r\n\tprivate static QRadarConfig instance = new QRadarConfig();\r\n\tprivate static final String QRADAR_CONFIG_FILENAME = \"qradar.properties\";\r\n\tprivate static final int DEFAULT_CLEANUP_INTER... | import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Random;
import javax.annotation.Resource;
import javax.persistence.EntityManager;
import javax.servlet.ServletContext;
import java... | /******************************************************
Copyright (c) 2015, IBM
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 ... | Long startupTime = QRadarConfig.getInstance().getStartupTime();
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.