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 |
|---|---|---|---|---|---|---|
smartcat-labs/berserker | berserker-core/src/test/java/io/smartcat/berserker/worker/InternalWorkerTest.java | [
"public class LoadGenerator<T> {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(LoadGenerator.class);\n private static final long NANOS_IN_SECOND = TimeUnit.SECONDS.toNanos(1);\n private static final long TICK_PERIOD_IN_NANOS = 1000;\n\n private final DataSource<T> dataSource;\n pri... | import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.Assert;
import org.junit.Test;
import io.smartcat.berserker.LoadGenerator;
import io.smartcat.berserker.api.DataSource;
import io.smartcat.berserker.api.RateGenerator;
import io.smartcat.berserker.api.Worker;
... | package io.smartcat.berserker.worker;
public class InternalWorkerTest {
/**
* InternalWorker has 4 threads and queue of 4 elements. Each thread is blocked until load generator depletes data
* source. Data source has 10 values. At that moment, 4 threads have taken first four values and there is four m... | LoadGenerator<Integer> lg = new LoadGenerator<>(ds, rg, w); | 0 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/bucket/Bucket.java | [
"public class DRUMSParameterSet<Data extends AbstractKVStorable> {\r\n /** My private Logger. */\r\n private static Logger logger = LoggerFactory.getLogger(DRUMSParameterSet.class);\r\n\r\n private static final String PROTOTYPE_FILE = \"prototype.dat\";\r\n private static final String PROPERTY_FILE = \"... | import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import com.unister.semweb.drums.DRUMSParameterSet;
import com.unister.semweb.drums.api.DRUMS;
import com.unister.semweb.drums.bucket.hashfunction.AbstractHashFunction;
import com.unister.semweb.drums.file.FileLockException;
import com.unis... | /* Copyright (C) 2012-2013 Unister GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is d... | public Bucket<Data> getEmptyBucketWithSameProperties() throws FileLockException, IOException { | 3 |
leelit/STUer-client | app/src/main/java/com/leelit/stuer/module_sell/MySellAdapter.java | [
"public abstract class BaseListAdapter<VH extends RecyclerView.ViewHolder> extends RecyclerView.Adapter<VH> {\n protected OnItemClickListener mOnItemClickListener;\n\n public void setOnItemClickListener(OnItemClickListener onItemClickListener) {\n mOnItemClickListener = onItemClickListener;\n }\n\n ... | import android.content.Context;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.leelit.stuer.R;
import com.le... | package com.leelit.stuer.module_sell;
/**
* Created by Leelit on 2016/3/18.
*/
public class MySellAdapter extends BaseListAdapter<MySellAdapter.ViewHolder> {
private Context mContext; | private List<SellInfo> mList; | 1 |
andraus/BluetoothHidEmu | src/andraus/bluetoothhidemu/settings/BluetoothDeviceStateReceiver.java | [
"public class BluetoothHidEmuActivity extends Activity {\n\t\n\tpublic static String TAG = \"BluetoothHidEmu\";\n\t\n private static final int HANDLER_MONITOR_SOCKET = 0;\n private static final int HANDLER_CONNECT = 1;\n private static final int HANDLER_BLUETOOTH_ENABLED = 2;\n\n\tprivate boolean mDisableB... | import andraus.bluetoothhidemu.BluetoothHidEmuActivity;
import andraus.bluetoothhidemu.R;
import andraus.bluetoothhidemu.spoof.Spoof;
import andraus.bluetoothhidemu.spoof.Spoof.SpoofMode;
import andraus.bluetoothhidemu.util.DoLog;
import andraus.bluetoothhidemu.view.BluetoothDeviceArrayAdapter;
import andraus.bluetooth... | package andraus.bluetoothhidemu.settings;
/**
*
*/
public class BluetoothDeviceStateReceiver extends BroadcastReceiver {
private static final String TAG = BluetoothHidEmuActivity.TAG;
private PreferenceCategory mBluetoothDevicePrefCategory = null;
private Spinner mDeviceSpinner = null;
... | DoLog.d(TAG, "context: " + context); | 3 |
iostackproject/SDGen | src/com/ibm/test/HelloWorldTest.java | [
"public class DatasetCharacterization implements Serializable, Cloneable{\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t/*List of chunk characterization and deduplication ratio of this dataset*/\n\tprivate List<AbstractChunkCharacterization> chunkCharacterization = new ArrayList<>();\n\tprivate double ... | import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import com.ibm.characterization.DatasetCharacterization;
import com.ibm.config.PropertiesStore;
import com.ibm.config.PropertyNames;
import com.ibm.generation.DataProducer;
import com.... | package com.ibm.test;
public class HelloWorldTest {
private static String datasetPath = "path_to_your_dataset";
private static String originalDataset = datasetPath + "LargeCalgaryCorpus.tar";
private static String syntheticDataset = datasetPath + "syntheticDataset"; | private static int chunkSize = PropertiesStore.getInt(PropertyNames.GENERATION_CHUNK_SIZE); | 2 |
Bedework/exchange-ws-client | src/main/java/com/microsoft/exchange/impl/BaseExchangeCalendarDataDao.java | [
"public class DateHelp {\n\tprotected static final Log log = LogFactory.getLog(DateHelp.class);\n\tpublic static final Period MAX_PERIOD = Period.days(3660);\n\n\tprotected static final String DATE_TIME_FORMAT = \"yyyyMMdd-HHmm\";\n\tprivate static final String DATE_FORMAT = \"yyyy-MM-dd\";\n\t/**\n\t * @return a n... | import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.xml.bind.JAXBContext;
import net.fortuna.ical4j.model.Calendar;
import org.apa... | /**
* See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Board of Regents of the University of Wisconsin System
* licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* except in compliance with the L... | private ExchangeResponseUtils responseUtils = new ExchangeResponseUtilsImpl(); | 2 |
integrationagent/hubspot-java | src/test/java/com/integrationagent/hubspotApi/integration/HSContactServiceIT.java | [
"public class HSContactService {\n\n private HttpService httpService;\n\n public HSContactService(HttpService httpService) {\n this.httpService = httpService;\n }\n\n public HSContact getByEmail(String email) throws HubSpotException {\n String url = \"/contacts/v1/contact/email/\" + email ... | import com.integrationagent.hubspotApi.service.HSContactService;
import com.integrationagent.hubspotApi.utils.Helper;
import com.integrationagent.hubspotApi.domain.HSContact;
import com.integrationagent.hubspotApi.service.HubSpot;
import com.integrationagent.hubspotApi.utils.HubSpotException;
import org.hamcrest.core.S... | package com.integrationagent.hubspotApi.integration;
public class HSContactServiceIT {
private String testEmail1;
private String testEmail2;
private String testEmail3;
private final String testBadEmail = "test@test.test";
private final String testFirstname = "Testfristname";
private final S... | HSContact contact = new HSContact(testEmail1, testFirstname, testLastname); | 2 |
Lemonszz/Anima-Mundi | src/main/java/party/lemons/anima/proxy/CommonProxy.java | [
"@Mod(modid = ModConstants.MODID, name = ModConstants.MODNAME, version = ModConstants.MODVERSION, updateJSON = ModConstants.UPDATEURL)\npublic class Anima\n{\n\t@Mod.Instance(ModConstants.MODID)\n\tpublic static Anima Instance;\n\n\t@SidedProxy(clientSide = \"party.lemons.anima.proxy.ClientProxy\", serverSide = \"p... | import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import... | package party.lemons.anima.proxy;
/**
* Created by Sam on 19/06/2017.
*/
public class CommonProxy implements IProxy
{
@Override
public void OnPreInit(FMLPreInitializationEvent e)
{
//TODO: move these
int id = 1;
EntityRegistry.registerModEntity(new ResourceLocation(ModConstants.MODID + ":nodeitem"),... | GameRegistry.registerWorldGenerator(new AnimaWorldGenerator(), 0); | 3 |
zhouchaoyi/springMVC_mybatis_angularjs_HUI | src/main/java/com/dawn/bgSys/controller/PermController.java | [
"public class JWTUtils {\n public static Map<String, Object> verifierToken(String token, String key) {\n Base64 decoder = new Base64();\n\n byte[] secret = Base64.encodeBase64(key.getBytes());\n Map decodedPayload = null;\n try {\n decodedPayload = new JWTVerifier(secret).v... | import com.alibaba.fastjson.JSONObject;
import com.dawn.bgSys.common.JWTUtils;
import com.dawn.bgSys.common.Utils;
import com.dawn.bgSys.common.WebJsonUtils;
import com.dawn.bgSys.domain.*;
import com.dawn.bgSys.service.IPermService;
import com.dawn.bgSys.service.IUserService;
import org.apache.commons.lang3.StringUtil... | package com.dawn.bgSys.controller;
/**
* User: zhouchaoyi
* Date: 15-9-23
*/
@Controller
@RequestMapping("/permMgmt")
public class PermController extends BaseController {
/**
* 日志工具
*/
final Logger logger = Logger.getLogger(PermController.class);
@Autowired | private IPermService permService; | 3 |
jeffprestes/brasilino | android/Brasilino/app/src/main/java/com/paypal/developer/brasilino/PermissionActivity.java | [
"public class CarrinhoApplication extends Application {\n private static final String UNBIND_FLAG = \"UNBIND_FLAG\";\n\n private CandieSQLiteDataSource dataSource;\n private static CarrinhoApplication app;\n\n private RequestQueue queue;\n\n @Override\n public void onCreate() {\n super.onCr... | import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v7.app.ActionBarAc... | package com.paypal.developer.brasilino;
public class PermissionActivity extends ActionBarActivity {
private WebView webContent;
private ProgressBar progress;
private Bundle receivedExtras;
private Token token;
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
... | final CandieSQLiteDataSource dataSource = CarrinhoApplication.getDatasource(); | 1 |
maxpower47/DeliciousDroid | src/com/deliciousdroid/action/IntentHelper.java | [
"public class AddBookmark extends FragmentBaseActivity implements OnBookmarkSaveListener {\n\n\tprivate AddBookmarkFragment frag;\n\tprivate Bookmark bookmark = null;\n\tprivate Bookmark oldBookmark = null;\n\tprivate Boolean update = false;\n\t\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState){\n\t\t... | import com.deliciousdroid.Constants.BookmarkViewType;
import com.deliciousdroid.providers.BookmarkContent.Bookmark;
import com.deliciousdroid.providers.BookmarkContentProvider;
import android.app.SearchManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import java.io.Unsuppo... | /*
* DeliciousDroid - http://code.google.com/p/DeliciousDroid/
*
* Copyright (C) 2010 Matt Schmidt
*
* DeliciousDroid is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 3 of the License,
* ... | public static Intent AddBookmark(String url, String account, Context context) { | 0 |
tliron/scripturian | components/scripturian/source/com/threecrickets/scripturian/adapter/LuajProgram.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.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringReader;
import java.util.concurrent.atomic.AtomicReference;
import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaClosure;
import o... | /**
* 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 void execute( ExecutionContext executionContext ) throws ParsingException, ExecutionException | 3 |
psidnell/ofexport2 | src/test/java/org/psidnell/omnifocus/integrationtest/IntegrationTest.java | [
"public class ApplicationContextFactory {\n\n public static final String CONFIG_XML = \"/config.xml\";\n private static final String CONFIG_PROPERTIES = \"/config.properties\";\n\n public static ApplicationContext getContext() {\n return new ClassPathXmlApplicationContext(CONFIG_XML);\n }\n\n ... | import org.psidnell.omnifocus.sqlite.SQLiteDAO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import static org.junit.Assert.*;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.functi... | /*
* 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... | DataCache dataCache = appContext.getBean("datacache", DataCache.class); | 2 |
andrew-nguyen/ucanaccess | src/main/java/net/ucanaccess/commands/DDLCommandEnlist.java | [
"public class LoadJet {\n\tprivate static int namingCounter = 0;\n\n\tprivate final class FunctionsLoader {\n\t\tprivate HashSet<String> functionsDefinition = new HashSet<String>();\n\n\t\tprivate void addAggregates() {\n\t\t\tfunctionsDefinition.add(getAggregate(\"LONGVARCHAR\", \"last\"));\n\t\t\tfunctionsDefinit... | import com.healthmarketscience.jackcess.Database;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import net.ucanaccess.converters.LoadJet;
import net.ucanaccess.converters.SQLConverter.DDLType;
import net.ucanaccess.jdbc.UcanaccessConnection;
import net.ucanaccess.jdbc.UcanaccessS... | /*
Copyright (c) 2012 Marco Amadei.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in th... | UcanaccessConnection ac = UcanaccessConnection.getCtxConnection(); | 2 |
Chat-Wane/LSEQ | src/main/java/alma/fr/modules/GreedRandDoubleModule.java | [
"public class BaseDouble implements IBase {\n\n\tprivate final Integer baseBase;\n\n\t@Inject\n\tpublic BaseDouble(@Basebase Integer baseBase) {\n\t\tthis.baseBase = baseBase;\n\t}\n\n\tpublic Integer getBitBase(Integer depth) {\n\t\treturn baseBase + depth - 1;\n\t}\n\n\tpublic Integer getSumBit(Integer depth) {\n... | import java.math.BigInteger;
import alma.fr.basecomponents.BaseDouble;
import alma.fr.basecomponents.Basebase;
import alma.fr.basecomponents.IBase;
import alma.fr.strategiescomponents.BeginningBoundaryIdProvider;
import alma.fr.strategiescomponents.EndingBoundaryIdProvider;
import alma.fr.strategiescomponents.IIdProvid... | package alma.fr.modules;
/**
* Constant boundary but greed and double base
*/
public class GreedRandDoubleModule implements Module {
public void configure(Binder binder) {
Integer baseBase = new Integer(5);
BigInteger boundary = new BigInteger("10");
/* BASE */
binder.bind(Integer.class).annotatedWith(... | BeginningBoundaryIdProvider.class); | 2 |
be-hase/relumin | src/test/java/com/behase/relumin/controller/RedisTribApiControllerTest.java | [
"public class InvalidParameterException extends ApiException {\n private static final long serialVersionUID = -6416726302671334601L;\n\n public InvalidParameterException(String message) {\n super(Constants.ERR_CODE_INVALID_PARAMETER, String.format(\"Invalid parameter. %s\", message), HttpStatus.BAD_REQ... | import com.behase.relumin.exception.InvalidParameterException;
import com.behase.relumin.model.Cluster;
import com.behase.relumin.model.ClusterNode;
import com.behase.relumin.model.param.CreateClusterParam;
import com.behase.relumin.service.ClusterService;
import com.behase.relumin.service.LoggingOperationService;
impo... | package com.behase.relumin.controller;
@Slf4j
@RunWith(MockitoJUnitRunner.class)
public class RedisTribApiControllerTest {
@InjectMocks
@Spy
private RedisTribApiController controller = new RedisTribApiController();
@Mock
private RedisTribService redisTibService;
@Mock | private ClusterService clusterService; | 4 |
AlexanderMisel/gnubridge | src/main/java/org/gnubridge/core/bidding/rules/TakeoutDouble.java | [
"public class Hand {\n\tList<Card> cards;\n\n\t/**\n\t * Caching optimization for pruning played cards\n\t * and perhaps others\n\t */\n\tList<Card> orderedCards;\n\tSuit color;\n\tList<Card> colorInOrder;\n\n\tpublic Hand() {\n\t\tthis.cards = new ArrayList<Card>();\n\t}\n\n\tpublic Hand(Card... cards) {\n\t\tthis... | import java.util.Set;
import org.gnubridge.core.Hand;
import org.gnubridge.core.bidding.Auctioneer;
import org.gnubridge.core.bidding.Bid;
import org.gnubridge.core.bidding.Double;
import org.gnubridge.core.bidding.PointCalculator;
import org.gnubridge.core.deck.Suit;
import org.gnubridge.core.deck.Trump; | package org.gnubridge.core.bidding.rules;
public class TakeoutDouble extends BiddingRule {
private final PointCalculator pc;
public TakeoutDouble(Auctioneer a, Hand h) {
super(a, h);
pc = new PointCalculator(hand);
}
@Override
protected boolean applies() {
int HCP = pc.getHighCardPoints();
if ((auct... | for (Suit color : Suit.list) { | 4 |
blacklocus/jres | jres-util/src/main/java/com/blacklocus/jres/JresBulkRequestor.java | [
"@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = \"@class\")\npublic interface JresBulkable {\n\n /**\n * @return bulk command\n */\n Object getAction();\n\n /**\n * @return (optional) payload of action, e.g. index operation is followed by the document ... | import com.blacklocus.jres.request.JresBulkable;
import com.blacklocus.jres.request.bulk.JresBulk;
import com.blacklocus.jres.response.bulk.JresBulkItemResult;
import com.blacklocus.jres.response.bulk.JresBulkReply;
import com.blacklocus.jres.util.DaemonThreadFactory;
import com.google.common.collect.Lists;
import com.... | /**
* Copyright 2015 BlackLocus
*
* 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 i... | numThreads, numThreads, 1, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new DaemonThreadFactory() | 4 |
cjstehno/ersatz | ersatz/src/main/java/io/github/cjstehno/ersatz/impl/ExpectationsImpl.java | [
"public interface Expectations extends AnyExpectations, GetExpectations, HeadExpectations, PostExpectations, PutExpectations, DeleteExpectations, PatchExpectations, OptionsExpectations {\r\n\r\n // just the place they all come together.\r\n}\r",
"public enum HttpMethod {\r\n\r\n /**\r\n * Wildcard match... | import static java.util.Collections.unmodifiableList;
import io.github.cjstehno.ersatz.cfg.Expectations;
import io.github.cjstehno.ersatz.cfg.HttpMethod;
import io.github.cjstehno.ersatz.cfg.Request;
import io.github.cjstehno.ersatz.cfg.RequestWithContent;
import io.github.cjstehno.ersatz.encdec.RequestDecoders;
... | /**
* Copyright (C) 2022 Christopher J. Stehno
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ... | private ResponseEncoders globalEncoders;
| 5 |
MarcProe/lp2go | app/src/main/java/org/librepilot/lp2go/uavtalk/device/FcUsbWaiterThread.java | [
"public class VisualLog {\r\n\r\n //private static Activity activity;\r\n private static String nullstring = \"null\";\r\n //private static TextView txtDebugLog;\r\n\r\n static private String checkNull(String msg) {\r\n return msg == null ? nullstring : msg;\r\n }\r\n\r\n static public void... | import java.util.ArrayDeque;
import java.util.Queue;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbEndpoint;
import org.librepilot.lp2go.VisualLog;
import org.librepilot.lp2go.helper.H;
import org.librepilot.lp2go.uavtalk.UAVTalkMessage;
import org.librepilot.lp2go.uavtalk.UAVTa... | /*
* @file FcUsbWaiterThread.java
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* @see The GNU Public License (GPL) Version 3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published ... | UAVTalkObject myObj =
| 3 |
dnault/therapi-json-rpc | src/main/java/com/github/therapi/apidoc/ApiDocProvider.java | [
"public class MethodDefinition {\n private final String shortName;\n private final Method method;\n private final Method invokeVia;\n private final Object owner;\n private final ImmutableList<ParameterDefinition> params;\n private final Optional<String> namespace;\n private final TypeReference ... | import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.github.therapi.core.MethodDefinition;
import com.github.therapi.core.MethodRegistry;
import com.github.therapi.core.ParameterDefinition;
import ... | package com.github.therapi.apidoc;
public class ApiDocProvider {
private final CommentFormatter commentFormatter = new CommentFormatter();
private final JsonSchemaProvider schemaProvider = new JsonSchemaProvider();
public List<ApiNamespaceDoc> getDocumentation(MethodRegistry registry) throws IOExceptio... | final SortedSetMultimap<String, MethodDefinition> methodDefinitionsByNamespace = TreeMultimap.create( | 0 |
dogriffiths/hipster | src/dg/hipster/Main.java | [
"public class IdeaDocument extends AbstractModel implements IdeaListener {\n /**\n * Internationalization strings.\n */\n protected static ResourceBundle resBundle = ResourceBundle.getBundle(\n \"dg/hipster/resource/strings\");\n /**\n * Undo controller.\n */\n private UndoMan... | import dg.hipster.model.IdeaDocument;
import dg.hipster.io.ReaderException;
import dg.hipster.io.ReaderFactory;
import dg.hipster.model.Settings;
import dg.hipster.view.AboutBox;
import dg.hipster.view.GuiUtilities;
import dg.hipster.view.Mainframe;
import java.awt.Rectangle;
import java.awt.event.WindowAdapter;
import... | /*
* Main.java
*
* Created on July 19, 2006, 6:44 AM
*
* Copyright (c) 2006, David Griffiths
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must re... | GuiUtilities.showDebug(re.getMessage()); | 5 |
palominolabs/benchpress | examples/multi-db/mongodb/src/main/java/com/palominolabs/benchpress/example/multidb/mongodb/MongoDbTaskFactory.java | [
"public abstract class TaskFactoryBase {\n protected final ValueGeneratorFactory valueGeneratorFactory;\n protected final KeyGeneratorFactory keyGeneratorFactory;\n protected final TaskOperation taskOperation;\n protected final int numThreads;\n protected final int numQuanta;\n protected final int... | import com.google.common.collect.Lists;
import com.mongodb.DB;
import com.mongodb.Mongo;
import com.palominolabs.benchpress.example.multidb.task.TaskFactoryBase;
import com.palominolabs.benchpress.example.multidb.key.KeyGeneratorFactory;
import com.palominolabs.benchpress.job.task.TaskFactory;
import com.palominolabs.b... | package com.palominolabs.benchpress.example.multidb.mongodb;
final class MongoDbTaskFactory extends TaskFactoryBase implements TaskFactory {
private final String hostname;
private final int port;
private final String dbName;
private String collectionName;
private Mongo mongo;
MongoDbTaskFact... | KeyGeneratorFactory keyGeneratorFactory, int numQuanta, int numThreads, String hostname, | 1 |
inovex/zax | src/main/java/com/inovex/zabbixmobile/activities/GraphFullscreenActivity.java | [
"public class ZabbixDataService extends Service {\n\n\tpublic interface OnLoginProgressListener {\n\n\t\tpublic void onLoginStarted();\n\n\t\tpublic void onLoginFinished(boolean success, boolean showToast);\n\n\t}\n\n\tprivate static final String TAG = ZabbixDataService.class.getSimpleName();\n\n\tpublic static fin... | import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import ... | /*
This file is part of ZAX.
ZAX is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ZAX is distributed in the hope that it will be useful... | new OnGraphDataLoadedListener() { | 2 |
bitsoex/bitso-java | src/test/java/com/bitso/BitsoWebSocketTest.java | [
"@SuppressWarnings(\"serial\")\npublic class BitsoExceptionNotExpectedValue extends RuntimeException {\n public BitsoExceptionNotExpectedValue(String message){\n super(message);\n }\n}",
"public class Helpers {\n private static final String PATH = \"src/test/java/JSONFiles/\";\n\n public static... | import static org.junit.Assert.assertEquals;
import java.net.URISyntaxException;
import java.util.ArrayList;
import javax.net.ssl.SSLException;
import org.json.JSONObject;
import org.junit.Before;
import org.junit.Test;
import com.bitso.exceptions.BitsoExceptionNotExpectedValue;
import com.bitso.helpers.Helpers;
import... | package com.bitso;
public class BitsoWebSocketTest {
private final BitsoChannels[] bitsoChannels = { BitsoChannels.TRADES, BitsoChannels.DIFF_ORDERS,
BitsoChannels.ORDERS };
private BitsoWebSocket bitsoWebSocket;
private BitsoWebSocketObserver bitsoWebSocketObserver;
@Before
publi... | BitsoStreamTrades trades = new BitsoStreamTrades(jsonObject); | 4 |
aw20/MongoWorkBench | src/org/aw20/mongoworkbench/eclipse/view/wizard/MapReduceWizard.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.MapReduceMongoCommand;
import org.aw20.mongoworkbench.command.MongoCommand;
import org.aw20.mongoworkbench.eclipse.v... | textMRMap.setText(JS_MAP);
Label lblSomeHelpText = new Label(composite_4, SWT.NONE);
lblSomeHelpText.setText("A JavaScript function that associates or 'maps' a value with a key and emits the key and value pair");
//--
TabItem tbtmReduceTab = new TabItem(tabFolder_2, SWT.NONE);
tbtmReduceTab.setText("Re... | if ( MongoFactory.getInst().getActiveCollection() == null ){ | 2 |
iChun/Hats | src/main/java/me/ichun/mods/hats/client/gui/WorkspaceHats.java | [
"public class ElementHatRender<T extends ElementHatRender> extends ElementClickable<T>\n{\n public static final String HAMBURGER = \"\\u2261\";//\"≡\";\n\n public HatsSavedData.HatPart hatOrigin;\n public HatsSavedData.HatPart hatLevel;\n public boolean toggleState;\n\n public boolean hasConflict;\n... | import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import me.ichun.mods.hats.client.gui.window.*;
import me.ichun.mods.hats.client.gui.window.element.ElementHatRender;
import me.ichun.mods.hats.common.Hats;
import me.ichun.mods.hats.common.hats.HatHandler;
import me.ichun.mods... | package me.ichun.mods.hats.client.gui;
public class WorkspaceHats extends Workspace
implements IHatSetter
{
public static final DecimalFormat FORMATTER = new DecimalFormat("#,###,###");
public final boolean fallback;
public final @Nonnull LivingEntity hatEntity; | public final HatsSavedData.HatPart hatDetails; | 6 |
almeidaRodrigo/conciliacao | test/conciliacao/TestGui.java | [
"public class AppScreen extends JFrame implements IScreen {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = 1L;\n\t\n\t/**\n\t * Default Constructor\n\t */\n\tpublic AppScreen(){\n\t\t\n\t}\n\n\t/**\n\t * @param title\n\t * @param subTitle\n\t * @param window\n\t * @param menu\n\t * @param fr... | import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JOptionPane;
import gui.AppScreen;
import gui.Frame;
import gui.IFrame;
import gui.IScreen;
import gui.IWindow;
import... | /**
*
*/
package conciliacao;
/**
* @author rodrigo
*
*/
public class TestGui {
/**
* @param args
*/
public static void main(String[] args) throws Exception {
IScreen screen; | IWindow window = new Window(new BorderLayout()); | 4 |
neoremind/navi-pbrpc | src/test/java/com/baidu/beidou/navi/pbrpc/it/NegativePbrpcClientTest.java | [
"public interface PbrpcClient {\n\n /**\n * 连接远程服务器\n * \n * @return ChannelFuture netty nio方式连接后的future回调\n */\n ChannelFuture connect();\n\n /**\n * 关闭客户端的远程连接\n */\n void shutdown();\n\n /**\n * 异步调用\n * \n * @param responseClazz\n * 调用待返回的对象类型,T为... | import org.junit.Test;
import com.baidu.beidou.navi.pbrpc.client.PbrpcClient;
import com.baidu.beidou.navi.pbrpc.client.PbrpcClientFactory;
import com.baidu.beidou.navi.pbrpc.exception.CodecException;
import com.baidu.beidou.navi.pbrpc.exception.ServerExecutionException;
import com.baidu.beidou.navi.pbrpc.exception.Ser... | package com.baidu.beidou.navi.pbrpc.it;
public class NegativePbrpcClientTest extends BaseTest {
@Test
public void testMethodNotFoundException() throws Exception { | PbrpcMsg msg = getPbrpcMsg(1).setServiceId(-1); | 5 |
wzgiceman/RxjavaRetrofitDemo-string-master | app/src/main/java/com/example/retrofit/activity/MainActivity.java | [
"public class SubjectPostApi extends BaseApi {\n // 接口需要传入的参数 可自定义不同类型\n private boolean all;\n /*任何你先要传递的参数*/\n// String xxxxx;\n// String xxxxx;\n// String xxxxx;\n// String xxxxx;\n\n\n /**\n * 默认初始化需要给定初始设置\n * 可以额外设置请求设置加载框显示,回调等(可扩展)\n * 设置可查看BaseApi\n */\n public... | import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.bumptech.glide.Glide;
import com.daimajia.numberprogressbar.NumberProgressBar;... | package com.example.retrofit.activity;
public class MainActivity extends RxAppCompatActivity implements View.OnClickListener, HttpOnNextListener {
private TextView tvMsg;
private NumberProgressBar progressBar;
private ImageView img;
// 公用一个HttpManager | private HttpManager manager; | 4 |
hburgmeier/jerseyoauth2 | jersey-oauth2-testsuite-rs2/src/main/java/com/github/hburgmeier/jerseyoauth2/testsuite/rs2/RestApplication.java | [
"public interface IClientIdGenerator {\n\n\tString generateClientId();\n\n\tString generateClientSecret();\n\n}",
"public interface IClientService {\n\n\tIRegisteredClientApp registerClient(String appName, String callbackUrl, ClientType clientType) throws ClientServiceException;\n\t\n\tIRegisteredClientApp getReg... | import java.util.HashSet;
import java.util.Set;
import javax.inject.Inject;
import javax.persistence.EntityManagerFactory;
import javax.ws.rs.core.Application;
import net.sf.ehcache.CacheManager;
import org.glassfish.hk2.api.DynamicConfiguration;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish... | package com.github.hburgmeier.jerseyoauth2.testsuite.rs2;
public class RestApplication extends Application {
@Inject
public RestApplication(ServiceLocator serviceLocator) {
DynamicConfiguration dc = Injections.getConfiguration(serviceLocator);
Injections.addBinding(Injections.newBind... | Injections.addBinding(Injections.newBinder(Configuration.class).to(IConfiguration.class),dc);
| 4 |
Semx11/Autotip | src/main/java/me/semx11/autotip/stats/Stats.java | [
"@Mod(modid = Autotip.MOD_ID, name = Autotip.NAME, version = Autotip.VERSION, acceptedMinecraftVersions = Autotip.ACCEPTED_VERSIONS, clientSideOnly = true)\npublic class Autotip {\n\n public static final Logger LOGGER = LogManager.getLogger(\"Autotip\");\n\n static final String MOD_ID = \"autotip\";\n stat... | import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.time.format.DateTimeFormatter;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import me.semx11.autotip.Autotip;
import me.semx11.autotip.chat.MessageUtil;
import me.semx11.autotip.config.GlobalSetti... | package me.semx11.autotip.stats;
public abstract class Stats {
static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern("dd/MM/yyyy");
private static final DecimalFormat FORMAT = (DecimalFormat) NumberFormat.getInstance(Locale.US);
@Exclude
protected final Autotip autotip;
@Ex... | MessageUtil messageUtil = autotip.getMessageUtil(); | 1 |
domoinc/domo-java-sdk | domo-java-sdk-all/src/main/java/com/domo/sdk/datasets/DataSetClient.java | [
"public class CreateDataSetRequest {\n private String name;\n private String description;\n private long rows;\n private Schema schema;\n\n public CreateDataSetRequest(){\n this.name=\"\";\n this.description=\"\";\n this.rows=0;\n this.schema = new Schema();\n }\n\n ... | import com.domo.sdk.datasets.model.CreateDataSetRequest;
import com.domo.sdk.datasets.model.DataSet;
import com.domo.sdk.datasets.model.DataSetAndPDP;
import com.domo.sdk.datasets.model.DataSetListResult;
import com.domo.sdk.request.RequestException;
import com.domo.sdk.request.Transport;
import com.domo.sdk.request.Ur... | package com.domo.sdk.datasets;
public class DataSetClient {
private final UrlBuilder urlBuilder;
private final Transport transport;
private static final String URL_BASE = "v1/datasets";
/**
DataSets
- Programmatically manage Domo DataSets
- Use DataSets for fairly static data sources ... | throw new RequestException("Error exporting data and writing to file:"+file, e); | 4 |
kinabalu/mysticpaste | web/src/main/java/com/mysticcoders/mysticpaste/web/pages/history/HistoryPage.java | [
"@Entity(\"pastes\")\n@Message\npublic class PasteItem implements Serializable {\n private static final long serialVersionUID = -6467870857777145137L;\n private static Logger logger = LoggerFactory.getLogger(PasteItem.class);\n private static SimpleDateFormat sdf = new SimpleDateFormat(\"MM/dd/yyyy\");\n\n... | import com.mysticcoders.mysticpaste.model.PasteItem;
import com.mysticcoders.mysticpaste.services.PasteService;
import com.mysticcoders.mysticpaste.web.pages.BasePage;
import com.mysticcoders.mysticpaste.web.pages.HelpPage;
import com.mysticcoders.mysticpaste.web.pages.paste.PasteItemPage;
import com.mysticcoders.mysti... | package com.mysticcoders.mysticpaste.web.pages.history;
/**
* List the paste history.
*
* @author Steve Forsyth
* Date: Mar 8, 2009
*/
public class HistoryPage extends BasePage {
@SpringBean
PasteService pasteService;
DataView historyDataView;
private static final Logger logger = Logge... | throw new RestartResponseException(HelpPage.class); | 3 |
vishesh/sealnote | Sealnote/src/main/java/com/twistedplane/sealnote/view/simplelist/SimpleListAdapter.java | [
"public class DatabaseHandler extends SQLiteOpenHelper {\n public static final String TAG = \"DatabaseHandler\";\n\n public static final String DBNAME = \"sealnote.sqlite\";\n public static final int VERSION = 4;\n\n // table and column names names\n public static final String TABLE_NAME = \"notes\";... | import android.content.Context;
import android.database.Cursor;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import com.twistedplane.sealnote.R;
import com.twistedplane.sealnote.data... | package com.twistedplane.sealnote.view.simplelist;
/**
* Adapter for SimpleListView.
*/
public class SimpleListAdapter extends SimpleCursorAdapter implements SealnoteAdapter {
public final static String TAG = "SimpleListAdapter";
public SimpleListAdapter(Context context, Cursor cursor) {
super(
... | text1.setTypeface(FontCache.getFont(context, PreferenceHandler.getFontDefault())); | 4 |
Idrinths-Stellaris-Mods/Mod-Tools | src/test/java/de/idrinth/stellaris/modtools/process3filepatch/OriginalFileFillerTest.java | [
"public abstract class TestATask extends FileBased {\n \n protected abstract ProcessTask get();\n\n @Test\n public void testInterface() {\n System.out.println(\"interface\");\n Assert.assertTrue(\"This task does not implement the required interface.\", ProcessTask.class.isAssignableFrom(ge... | import de.idrinth.stellaris.modtools.abstract_cases.TestATask;
import de.idrinth.stellaris.modtools.filesystem.FileSystemLocation;
import de.idrinth.stellaris.modtools.persistence.PersistenceProvider;
import de.idrinth.stellaris.modtools.persistence.entity.Original;
import de.idrinth.stellaris.modtools.process.ProcessT... | /*
* Copyright (C) 2017 Björn Büttner
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is dist... | Original original = new Original("test.txt"); | 3 |
jchampemont/WTFDYUM | src/main/java/com/jeanchampemont/wtfdyum/service/feature/impl/NotifyUnfollowFeatureStrategy.java | [
"public class Event {\n\n public Event() {\n // left deliberately empty\n }\n\n public Event(final EventType type, final String additionalData) {\n this.type = type;\n this.additionalData = additionalData;\n }\n\n private EventType type;\n\n private String additionalData;\n\n ... | import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import com.google.common.primitives.Longs;
import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.dto.Principal;
import com.jeanchampemont.wtfdyum.dto.... | /*
* Copyright (C) 2015, 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* 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
*... | final Principal principal = principalService.get(userId); | 2 |
karsany/obridge | obridge-main/src/main/java/org/obridge/generators/PackageObjectGenerator.java | [
"public class OBridgeConfiguration {\n\n public static final boolean GENERATE_SOURCE_FOR_PLSQL_TYPES = false;\n public static final boolean ADD_ASSERT = false;\n\n private String jdbcUrl;\n private String sourceRoot;\n private String rootPackageName;\n private Packages packages;\n private Loggi... | import org.obridge.util.DataSourceProvider;
import org.obridge.util.MustacheRunner;
import org.obridge.util.OBridgeException;
import java.beans.PropertyVetoException;
import java.io.File;
import java.io.IOException;
import java.util.List;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.io.FileUtils;
import... | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ferenc Karsany
*
* 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
* us... | List<OraclePackage> allPackages = new ProcedureDao(DataSourceProvider.getDataSource(c.getJdbcUrl())).getAllPackages(c.getPackagesLike(), c.getSourceOwner(), c.getProjectName(), c.getSourcesTable()); | 2 |
googleapis/java-trace | google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java | [
"public static class ListTracesPagedResponse\n extends AbstractPagedListResponse<\n ListTracesRequest,\n ListTracesResponse,\n Trace,\n ListTracesPage,\n ListTracesFixedSizeCollection> {\n\n public static ApiFuture<ListTracesPagedResponse> createAsync(\n PageContext<ListT... | import static com.google.cloud.trace.v1.TraceServiceClient.ListTracesPagedResponse;
import com.google.api.core.ApiFunction;
import com.google.api.core.ApiFuture;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.GaxProperties;
import com.google.api.gax.core.GoogleCredentialsProvider;
import com.google.... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | private final UnaryCallSettings<GetTraceRequest, Trace> getTraceSettings; | 5 |
DataAgg/DAFramework | core-service/src/main/java/com/dataagg/commons/controller/OrgController.java | [
"@Table(\"sys_area\")\npublic class EArea implements ITreeNode<EArea> {\n\tprivate static final long serialVersionUID = 1393610235911613287L;\n\n\t@Id\n\t@Comment(\"主键\")\n\tprivate Long id;\n\n\t@Column(\"parent_id\")\n\t@Comment(\"父类ID\")\n\t@Default(\"0\")\n\tprivate Long parentId;\n\n\t@Comment(\"所有父类ID,逗号拼接\")... | import java.util.List;
import org.nutz.dao.Cnd;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.Criteria;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframewo... | package com.dataagg.commons.controller;
/**
* Created by carlos on 2017/3/29. 机构管理 controller
*/
@RestController
@RequestMapping("/org")
public class OrgController {
private Logger LOG = LoggerFactory.getLogger(OrgController.class);
@Autowired
public OrgService orgService;
@Autowired
public OrgDao orgDao;
... | List<EOrg> orgList = orgDao.query(cnd, pager); | 1 |
ccrama/Slide-RSS | app/src/main/java/me/ccrama/rssslide/Activities/BaseActivity.java | [
"public class ColorPreferences {\n\n public final static String FONT_STYLE = \"THEME\";\n private final Context context;\n\n public ColorPreferences(Context context) {\n this.context = context;\n }\n\n public static int[] getColors(Context context, int c) {\n if (c == ContextCompat.getC... | import android.app.ActivityManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.nfc.NfcAdapter;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.Nullable;
impo... | @Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home) {
try {
onBackPressed();
} catch (IllegalStateException ignored) {
}
}
return super.onOptionsItemSelected... | getTheme().applyStyle(new ColorPreferences(this).getFontStyle().getBaseId(), true); | 0 |
cesquivias/mumbler | lang/src/main/java/mumbler/truffle/node/builtin/lang/ReadBuiltinNode.java | [
"public class MumblerException extends RuntimeException {\n private static final long serialVersionUID = 1L;\n\n public MumblerException(String message) {\n super(message);\n }\n\n @Override\n public Throwable fillInStackTrace() {\n CompilerAsserts.neverPartOfCompilation();\n ret... | import java.io.IOException;
import mumbler.truffle.MumblerException;
import mumbler.truffle.node.builtin.BuiltinNode;
import mumbler.truffle.parser.Reader;
import mumbler.truffle.parser.Syntax;
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.tru... | package mumbler.truffle.node.builtin.lang;
@NodeInfo(shortName="read")
@GenerateNodeFactory
public abstract class ReadBuiltinNode extends BuiltinNode {
@Specialization
public Syntax read(VirtualFrame virtualFrame, String str) {
try { | Source source = Source.newBuilder(ID, str, "<read>").build(); | 4 |
indywidualny/Centrum.fm | app/src/main/java/org/indywidualni/centrumfm/fragment/FavouriteSongsFragment.java | [
"public class SongsActivity extends AppCompatActivity\n implements SongArchiveFragment.IFragmentToActivity,\n FavouriteSongsFragment.IFragmentToActivity {\n\n private static final String TAG_FRAGMENT = \"songs_fragment\";\n public static int currentPosition;\n \n @BindView(R.id.toolbar) To... | import android.content.Context;
import android.os.Bundle;
import android.support.design.widget.CoordinatorLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.... | package org.indywidualni.centrumfm.fragment;
public class FavouriteSongsFragment extends Fragment implements SearchView.OnQueryTextListener,
SongsAdapter.ViewHolder.IViewHolderClicks, UpdatableFragment {
@BindView(R.id.recycler_view) RecyclerViewEmptySupport mRecyclerView;
@BindView(R.id.coordinat... | private List<Song> songs = new ArrayList<>(); | 2 |
google/gulava | javatests/gulava/processor/MakePredicatesFunctionalTest.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 gulava.annotation.MakePredicates;
import gulava.testing.LogicAsserter;
import gulava.util.Count;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.util.Arrays;
import java.util.List;
import static gulava.Goals.UNIT;
import static gulava.... | /*
* Copyright (c) 2015 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... | new LogicAsserter() | 5 |
zh32/TeleportSigns | src/main/java/de/zh32/teleportsigns/BukkitUpdateLoop.java | [
"public interface ConfigurationAdapter {\n\n\tList<SignLayout> loadLayouts();\n\n\tList<GameServer> loadServers();\n\n\tpublic long getUpdateInterval();\n\n\tpublic int getTeleportCooldown();\n\n\tpublic String getDatabasePath();\n\n\tpublic int getUpdatePerTicks();\n\n}",
"@Data\n@Builder\n@AllArgsConstructor\np... | import de.zh32.teleportsigns.configuration.ConfigurationAdapter;
import de.zh32.teleportsigns.sign.TeleportSign;
import de.zh32.teleportsigns.task.Callback;
import de.zh32.teleportsigns.task.ServerUpdateTask;
import de.zh32.teleportsigns.task.bukkit.BukkitServerUpdateTask;
import de.zh32.teleportsigns.task.bukkit.Bukki... | package de.zh32.teleportsigns;
public class BukkitUpdateLoop extends UpdateLoop {
private final Plugin plugin; | private final ConfigurationAdapter configuration; | 0 |
excella-core/excella-reports | src/main/java/org/bbreak/excella/reports/processor/ReportProcessor.java | [
"public abstract class ReportBookExporter implements BookExporter {\n\n /**\n * 変換設定情報\n */\n private ConvertConfiguration configuration = null;\n\n /**\n * 出力先ファイルパス\n */\n private String filePath = null;\n\n /**\n * 出力先ファイルパスの取得\n * \n * @return 出力先ファイルパス\n */\n p... | import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSe... | /*-
* #%L
* excella-reports
* %%
* Copyright (C) 2009 - 2019 bBreak Systems and contributors
* %%
* 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/licen... | private Map<String, ReportBookExporter> exporters = new HashMap<String, ReportBookExporter>(); | 0 |
hoffimar/timerdroid | app/src/main/java/com/tomatodev/timerdroid/widget/WidgetProviderSmall.java | [
"public class MyApplication extends Application {\n\tpublic static boolean mainVisible = false;\n\tprivate static int counter;\n\t\n\tpublic static boolean showRunningTimers = false;\n\t\n\tpublic static synchronized int getId() {\n\t\treturn counter++;\n\t}\n}",
"public class Utilities {\n\n\tpublic static Strin... | import android.app.PendingIntent;
import android.app.Service;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.database.Curs... | package com.tomatodev.timerdroid.widget;
public class WidgetProviderSmall extends AppWidgetProvider {
public static String ACTION_WIDGET_RECEIVER_MAIN = "ActionReceiverWidgetMain";
public static String ACTION_WIDGET_RECEIVER_CONFIGURE = "ActionReceiverWidgetConfigure";
public static String ACTION_WIDGET_RECEIVER... | private static LocalBinder localBinder; | 5 |
csuyzb/AndroidLinkup | LinkupCore/src/com/znv/linkup/core/map/GameMap.java | [
"public class GameSettings {\n\n /**\n * 地板卡片值\n */\n public static byte GroundCardValue = 0;\n\n /**\n * 游戏卡片值,用于地图模版\n */\n public static byte GameCardValue = 1;\n\n /**\n * 障碍卡片值\n */\n public static byte ObstacleCardValue = -1;\n\n /**\n * 空卡片值\n */\n publ... | import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.znv.linkup.core.GameSettings;
import com.znv.linkup.core.card.Piece;
import com.znv.linkup.core.config.LevelCfg;
import com.znv.linkup.core.map.template.MapTemplate;
import com.znv.linkup.core.map.template.RandomTemplate; | package com.znv.linkup.core.map;
/**
* 游戏地图类
*
* @author yzb
*
*/
public class GameMap extends BaseMap {
private static final long serialVersionUID = 8129010267609099217L;
protected GameMap() {
super();
}
public GameMap(int ySize, int xSize) {
super(ySize, xSize);
Tem... | public static Piece[][] createPieces(LevelCfg levelCfg) { | 1 |
yunnet/kafkaEagle | src/main/java/org/smartloli/kafka/eagle/web/controller/ConsumersController.java | [
"public class PageParamDomain {\n\n\tprivate String search;\n\tprivate int iDisplayStart;\n\tprivate int iDisplayLength;\n\n\tpublic String getSearch() {\n\t\treturn search;\n\t}\n\n\tpublic void setSearch(String search) {\n\t\tthis.search = search;\n\t}\n\n\tpublic int getiDisplayStart() {\n\t\treturn iDisplayStar... | import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import c... | /**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... | String clusterAlias = session.getAttribute(ConstantUtils.SessionAlias.CLUSTER_ALIAS).toString(); | 1 |
zzwwws/RxZhihuDaily | app/src/main/java/com/github/zzwwws/rxzhihudaily/model/service/ServiceApi.java | [
"@JsonInclude(JsonInclude.Include.NON_NULL)\n@JsonPropertyOrder({\n \"author\",\n \"content\",\n \"avatar\",\n \"time\",\n \"id\",\n \"likes\",\n \"reply_to\"\n})\npublic class Comment {\n\n @JsonProperty(\"author\")\n private String author;\n @JsonProperty(\"content\")\n private St... | import com.github.zzwwws.rxzhihudaily.model.entities.Comment;
import com.github.zzwwws.rxzhihudaily.model.entities.CommentEntities;
import com.github.zzwwws.rxzhihudaily.model.entities.Feed;
import com.github.zzwwws.rxzhihudaily.model.entities.StartImage;
import com.github.zzwwws.rxzhihudaily.model.entities.Story;
impo... | package com.github.zzwwws.rxzhihudaily.model.service;
/**
* Created by zzwwws on 2016/2/15.
*/
public interface ServiceApi {
@GET("4/start-image/{density}")
Observable<StartImage> getStartImage(@Path("density") String density);
@GET("4/themes")
Observable<Topics> getTopics();
@GET("4/theme/... | Observable<Feed> fetchLatestStory(); | 2 |
chedim/minedriod | src/main/java/com/onkiup/minedroid/exprop/ExProps.java | [
"@Mod(\n modid = MineDroid.MODID,\n version = MineDroid.VERSION,\n guiFactory = \"com.onkiup.minedroid.config.GuiFactory\"\n)\npublic class MineDroid extends Modification {\n public static final String MODID = \"minedroid\";\n public static final String VERSION = \"1.3.2\";\n\n protect... | import com.onkiup.minedroid.MineDroid;
import com.onkiup.minedroid.Modification;
import com.onkiup.minedroid.gui.events.Event;
import com.onkiup.minedroid.EventBase;
import com.onkiup.minedroid.net.ExPropDeltaPacket;
import com.onkiup.minedroid.net.ExPropDeltaRequestPacket;
import net.minecraft.client.Minecraft;
import... | }
return true;
}
@Override
public int hashCode() {
int result = 0;
for (Field f : getClass().getFields()) {
try {
result = 37 * result + getObjHash(f.get(this));
} catch (IllegalAccessException e) {
e.printStackTrace()... | if (Modification.isServerThread() && !callFieldListener(name, value)) continue; | 1 |
noctarius/castmapr | src/main/java/com/noctarius/castmapr/core/IListNodeMapReduceTaskImpl.java | [
"public interface MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n extends ExecutableMapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut>\n{\n\n /**\n * Defines the mapper for this task. This method is not idempotent and is callable only one time. If called further\n * times an {@link IllegalStateExceptio... | import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.map.MapService;
import com.hazelcast.partition.PartitionService;
import com.hazelcast.spi.NodeEngine;
import com.haz... | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed u... | public MapReduceTask<KeyIn, ValueIn, KeyOut, ValueOut> keyPredicate( KeyPredicate<KeyIn> predicate ) | 3 |
danimahardhika/wallpaperboard | library/src/main/java/com/dm/wallpaper/board/tasks/WallpapersLoaderTask.java | [
"public abstract class WallpaperBoardApplication extends Application implements ApplicationCallback {\r\n\r\n public static boolean sIsClickable = true;\r\n private static boolean mIsLatestWallpapersLoaded;\r\n private static WallpaperBoardConfiguration mConfiguration;\r\n\r\n private Thread.UncaughtExc... | import android.app.Activity;
import android.content.Context;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import com.bluelinelabs.logansquare.LoganSquare;
import com.danimahardhika.android.helpers.core.ListHelper;
im... | package com.dm.wallpaper.board.tasks;
/*
* Wallpaper Board
*
* Copyright (c) 2017 Dani Mahardhika
*
* 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://... | stream.writeBytes(JsonHelper.getQuery(values));
| 2 |
sandin/YoDao | yodao-compiler/src/main/java/com/yoda/yodao/internal/RepositoryParser.java | [
"public class YoGroupBy {\n\n\tprivate String field;\n\t\n\tpublic YoGroupBy() {\n\t\tthis(null);\n\t}\n\n\tpublic YoGroupBy(String field) {\n\t\tthis.field = field;\n\t}\n\n\tpublic String getField() {\n\t\treturn field;\n\t}\n\n\tpublic void setField(String field) {\n\t\tthis.field = field;\n\t}\n\n\t@Override\n\... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.Modifier;
import javax.lang.model.element.TypeElement... | package com.yoda.yodao.internal;
public class RepositoryParser {
public static DaoInfo parser(Element element) throws ProcessException {
DaoInfo daoInfo = new DaoInfo();
Repository repository = element.getAnnotation(Repository.class);
String elementName = element.asType().toString();
daoInfo.setDaoClass... | YoQuery query = parseDaoMethodToQuery(method); | 3 |
DV8FromTheWorld/JDA-Audio | src/main/java/net/dv8tion/jda/audio/AudioWebSocket.java | [
"public class Core\n{\n public static SimpleLog LOG = SimpleLog.getLog(\"Core\");\n\n private final HashMap<String, AudioManager> audioManagers = new HashMap<>();\n private final ConnectionManager connManager;\n private final ScheduledThreadPoolExecutor audioKeepAlivePool;\n private final VoiceServer... | import com.neovisionaries.ws.client.ThreadType;
import com.neovisionaries.ws.client.WebSocket;
import com.neovisionaries.ws.client.WebSocketAdapter;
import com.neovisionaries.ws.client.WebSocketException;
import com.neovisionaries.ws.client.WebSocketFactory;
import com.neovisionaries.ws.client.WebSocketFrame;
import ne... | LOG.debug("ClientReason: " + clientCloseFrame.getCloseReason());
LOG.debug("ClientCode: " + clientCloseFrame.getCloseCode());
if (clientCloseFrame.getCloseCode() != 1000)
{
// unexpected close -> error -> attempt resume
this.reconnect(Conne... | AudioManager manager = core.getAudioManager(guildId); | 3 |
lkorth/photo-paper | PhotoPaper/src/main/java/com/lukekorth/photo_paper/services/ClearCacheIntentService.java | [
"public class WallpaperApplication extends Application {\n\n private static final String VERSION = \"version\";\n\n private static FiveHundredPxClient sApiClient;\n private static FiveHundredPxClient sNonLoggedInApiClient;\n private static ThreadBus sBus;\n\n @Override\n public void onCreate() {\n... | import android.app.IntentService;
import android.content.Intent;
import com.lukekorth.photo_paper.WallpaperApplication;
import com.lukekorth.photo_paper.helpers.PicassoHelper;
import com.lukekorth.photo_paper.helpers.Settings;
import com.lukekorth.photo_paper.models.Photos;
import com.lukekorth.photo_paper.models.Wallp... | package com.lukekorth.photo_paper.services;
public class ClearCacheIntentService extends IntentService {
public ClearCacheIntentService() {
super("ClearCacheIntentService");
}
@Override
protected void onHandleIntent(Intent intent) {
LoggerFactory.getLogger("ClearCacheIntentService... | PicassoHelper.clearCache(this); | 1 |
beckchr/juel | modules/impl/src/main/java/de/odysseus/el/tree/impl/ast/AstMethod.java | [
"public abstract class ELContext {\r\n\tprivate Map<Class<?>, Object> context;\r\n\tprivate Locale locale;\r\n\tprivate boolean resolved;\r\n\r\n\t/**\r\n\t * Returns the context object associated with the given key. The ELContext maintains a\r\n\t * collection of context objects relevant to the evaluation of an ex... | import javax.el.ELContext;
import javax.el.ELException;
import javax.el.MethodInfo;
import javax.el.MethodNotFoundException;
import javax.el.PropertyNotFoundException;
import javax.el.ValueReference;
import de.odysseus.el.misc.LocalMessages;
import de.odysseus.el.tree.Bindings;
import de.odysseus.el.tree.Node;
| /*
* Copyright 2006-2009 Odysseus Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | throw new MethodNotFoundException(LocalMessages.get("error.property.method.notfound", name, base.getClass()));
| 2 |
xuraylei/floodlight_with_topoguard | src/test/java/net/floodlightcontroller/core/internal/OFChannelHandlerTest.java | [
"public static enum Role {\n EQUAL(OFRoleVendorData.NX_ROLE_OTHER),\n MASTER(OFRoleVendorData.NX_ROLE_MASTER),\n SLAVE(OFRoleVendorData.NX_ROLE_SLAVE);\n\n private final int nxRole;\n\n private Role(int nxRole) {\n this.nxRole = nxRole;\n }\n\n private static Map<Integer,Role> nxRoleToEn... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import net.floodlightcontroller.core.FloodlightContext;
import net.floodlightcontroller.core.IOFSwitch;
import net.floodlightcontroller.... | expect(controller.getAccessFlowPriority())
.andReturn(ACCESS_PRIORITY).once();
expect(controller.getStorageSourceService())
.andReturn(storageSource).atLeastOnce();
replay(controller);
// send the description stats reply
handler.messageReceived(ct... | Role expectedRole) { | 0 |
ilmila/J2EEScan | src/main/java/burp/j2ee/issues/impl/AJP_Tomcat_GhostCat.java | [
"public static String getApplicationContext(URL url) {\n\n String path = url.getPath();\n int i = path.indexOf(\"/\", 1);\n String context = path.substring(0, i + 1);\n\n return context;\n}",
"public static List<int[]> getMatches(byte[] response, byte[] match, IExtensionHelpers helpers) {\n List<in... | import burp.CustomHttpRequestResponse;
import static burp.HTTPMatcher.getApplicationContext;
import static burp.HTTPMatcher.getMatches;
import burp.j2ee.Confidence;
import burp.j2ee.CustomScanIssue;
import burp.j2ee.Risk;
import burp.j2ee.issues.IModule;
import burp.j2ee.lib.SimpleAjpClient;
import burp.j2ee.lib.Tester... | package burp.j2ee.issues.impl;
/**
* AJP Tomcat GhostCat - CVE-2020-1938
*
*
*
* References: - AJP Bug Implementation credits: -
* https://github.com/threedr3am/learnjavabug/tree/master/tomcat/ajp-bug/src/main/java/com/threedr3am/bug/tomcat/ajp
*
*
* TODO:
* - Hardcoded AJP port 8009
*
*/
public class... | TesterAjpMessage forwardMessage = ac.createForwardMessage(uri); | 4 |
chromium/eclipse-gn | org.chromium.gnsupport.ui/src/org/chromium/gnsupport/internal/ui/prefs/GnEditorColoringConfigurationBlock.java | [
"public class GnPreferenceConstants extends PreferenceConstants {\n\n public static final String EDITOR_STRING_COLOR = GnColorConstants.GN_STRING;\n public final static String EDITOR_STRING_BOLD = GnColorConstants.GN_STRING + EDITOR_BOLD_SUFFIX;\n public final static String EDITOR_STRING_ITALIC = GnColorConstant... | import org.chromium.gnsupport.internal.ui.GnPreferenceConstants;
import org.chromium.gnsupport.internal.ui.editor.GnDocumentSetupParticipant;
import org.chromium.gnsupport.internal.ui.editor.GnPartitions;
import org.chromium.gnsupport.internal.ui.editor.SimpleGnSourceViewerConfiguration;
import org.chromium.gnsupport.i... | /*
* Copyright (c) 2014, The Chromium Authors
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list o... | return GnUiPlugin.getDefault().getTextTools(); | 5 |
Techjar/VivecraftForgeExtensions | src/main/java/com/techjar/vivecraftforge/handler/HandlerClientTick.java | [
"@Mod(modid = \"VivecraftForge\", name = \"Vivecraft Forge Extensions\", version = \"@VERSION@\", dependencies = \"required-after:Forge@[10.13.4.1558,)\", acceptableRemoteVersions = \"@RAW_VERSION@.*\")\npublic class VivecraftForge {\n\t@Instance(\"VivecraftForge\")\n\tpublic static VivecraftForge instance;\n\t\n\t... | import net.minecraft.client.Minecraft;
import net.minecraft.util.Vec3;
import com.techjar.vivecraftforge.VivecraftForge;
import com.techjar.vivecraftforge.network.packet.PacketVRSettings;
import com.techjar.vivecraftforge.network.packet.PacketVRData;
import com.techjar.vivecraftforge.proxy.ProxyClient;
import com.techj... | package com.techjar.vivecraftforge.handler;
public class HandlerClientTick {
@SubscribeEvent
public void onClientTick(ClientTickEvent event) { // TODO | if (event.phase == Phase.END && ProxyClient.isVFEServer && VivecraftReflector.isInstalled()) { | 3 |
krishnaraj/oneclipboard | oneclipboardandroid/src/main/java/com/cb/oneclipboard/ClipboardApplication.java | [
"public class KeyStoreBuilder {\n private InputStream publicKeyStoreInputStream;\n private InputStream privateKeyStoreInputStream;\n private String publicKeyStorePass;\n private String privateKeyStorePass;\n\n public KeyStoreBuilder publicKeyStoreInputStream(InputStream publicKeyStoreInputStream) {\n... | import android.app.Application;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import android.support.v4.content.LocalBroadcastManager;
imp... | package com.cb.oneclipboard;
public class ClipboardApplication extends Application {
public static final int NOTIFICATION_ID = 1;
public static final String CLIPBOARD_UPDATED = "clipboard_updated";
private static final String TAG = ClipboardApplication.class.getName();
private static final String[] P... | private ClipboardConnector clipboardConnector = null; | 2 |
otaviojava/Easy-Cassandra | src/main/java/org/easycassandra/persistence/cassandra/spring/SimpleCassandraTemplateImpl.java | [
"public interface BatchBuilder extends AlterationBuilder {\n /**\n * Enables or not tracing for this query.\n * @param tracing the tracing\n * @return Adds if true or Disables if not\n */\n BatchBuilder withTracing(boolean tracing);\n /**\n * Sets the query fetch size.\n * @see {@li... | import java.util.List;
import org.easycassandra.persistence.cassandra.BatchBuilder;
import org.easycassandra.persistence.cassandra.PersistenceBuilder;
import org.easycassandra.persistence.cassandra.PersistenceBuilderImpl;
import org.easycassandra.persistence.cassandra.CassandraFactory;
import org.easycassandra.per... | }
@Override
public <K> void delete(K key, Class<?> entity, ConsistencyLevel consistency) {
command.deleteByKey(key, entity, session, consistency);
}
@Override
public <K, T> void delete(Iterable<K> keys, Class<T> entity, ConsistencyLevel consistency) {
command.deleteByKey(keys, entity, session, cons... | public BatchBuilder batchBuilder() {
| 0 |
WonderBeat/vasilich | alice-src/bitoflife/chatterbean/parser/TransformationsParser.java | [
"public class ConfigException extends Exception\n{\n /*\n Attribute Section\n */\n \n private static final long serialVersionUID = 7L;\n\n /*\n Constructor Section\n */\n \n /**\n Constructs a new exception with <code>null</code> as its detail message. The cause is not initialized, and may subsequently b... | import bitoflife.chatterbean.text.Tokenizer;
import bitoflife.chatterbean.text.Transformations;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import javax.xml.parsers.ParserConfigurationException;
im... | /*
Copyleft (C) 2005 Hio Perroni Filho
xperroni@yahoo.com
ICQ: 2490863
This file is part of ChatterBean.
ChatterBean is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your o... | throws ConfigException, IOException, SAXException | 0 |
mucaho/jnetrobust | jnetrobust-samples/src/main/java/com/github/mucaho/jnetrobust/example/ProtocolHost.java | [
"public abstract class Logger {\n /**\n * Enum representing all possible <code>logging event descriptions</code>.\n */\n public static enum LoggingEvent {\n SEND(\"Data sent\"),\n RECEIVE(\"Data received\"),\n NEWEST(\"Newest data received\"),\n SEND_RETRANSMISSION(\"Data r... | import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.ByteBufferInput;
import com.esotericsoftware.kryo.io.ByteBufferOutput;
import com.esotericsoftware.kryo.io.KryoObjectInput;
import com.esotericsoftware.kryo.io.KryoObjectOutput;
import com.github.mucaho.jnetrobust.Logger;
import com.github.mucah... | /*
* Copyright (c) 2014 mucaho (https://github.com/mucaho).
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package com.github.mucaho.jnetrobust.example;
/*... | handleExceptionalData(protocolId, new ProtocolException(Logger.LoggingEvent.UNORDERED, value)); | 6 |
irq0/jext2 | src/fusejext2/tasks/Unlink.java | [
"public class Constants {\n\t// Special inode numbers\n\tpublic static final int\tEXT2_BAD_INO = 1; /* Bad blocks inode */\n\tpublic static final int EXT2_ROOT_INO = 2; /* Root inode */\n\tpublic static final int EXT2_BOOT_LOADER_INO = 5; /* Boot loader inode */\n\tpublic static final int EXT2_UNDEL_... | import jext2.Constants;
import jext2.DirectoryInode;
import jext2.Inode;
import jext2.InodeAccess;
import jext2.exceptions.InvalidArgument;
import jext2.exceptions.JExt2Exception;
import fusejext2.Jext2Context;
import jlowfuse.FuseReq;
import jlowfuse.Reply; | /*
* Copyright (c) 2011 Marcel Lauhoff.
*
* This file is part of jext2.
*
* jext2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later vers... | DirectoryInode parentInode = (DirectoryInode)(context.inodes.getOpened(parent)); | 1 |
ajitsing/Sherlock | sherlock/src/test/java/com/singhajit/sherlock/crashes/CrashPresenterTest.java | [
"public class SherlockDatabaseHelper extends SQLiteOpenHelper {\n private static final int VERSION = 2;\n private static final String DB_NAME = \"Sherlock\";\n\n public SherlockDatabaseHelper(Context context) {\n super(context, DB_NAME, null, VERSION);\n }\n\n @Override\n public void onCreate(SQLiteDatabas... | import com.singhajit.sherlock.core.database.SherlockDatabaseHelper;
import com.singhajit.sherlock.core.investigation.AppInfo;
import com.singhajit.sherlock.core.investigation.Crash;
import com.singhajit.sherlock.core.investigation.CrashViewModel;
import com.singhajit.sherlock.crashes.action.CrashActions;
import com.sin... | package com.singhajit.sherlock.crashes;
public class CrashPresenterTest {
@Test
public void shouldInitializeCrashView() throws Exception { | SherlockDatabaseHelper database = mock(SherlockDatabaseHelper.class); | 0 |
apache/commons-proxy | javassist/src/main/java/org/apache/commons/proxy2/javassist/JavassistProxyFactory.java | [
"public interface Interceptor extends Serializable\n{\n //******************************************************************************************************************\n // Other Methods\n //***************************************************************************************************************... | import org.apache.commons.proxy2.impl.AbstractSubclassingProxyFactory;
import org.apache.commons.proxy2.impl.ProxyClassCache;
import java.lang.reflect.Method;
import javassist.CannotCompileException;
import javassist.CtClass;
import javassist.CtConstructor;
import javassist.CtMethod;
import org.apache.commons.proxy2.In... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | private static final ProxyClassCache DELEGATING_PROXY_CACHE = new ProxyClassCache( | 7 |
urandom/gearshift | gearshift/src/main/java/org/sugr/gearshift/ui/settings/SettingsActivity.java | [
"public final class G {\n public static final String PREF_DEBUG = \"debug\";\n\n public static final String PREF_SHOW_STATUS = \"show_status\";\n public static final String PREF_SHOW_ADD_DIALOG = \"show_add_dialog\";\n public static final String PREF_DELETE_DATA = \"delete_data\";\n public static fin... | import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.GradientDrawable;
import android.os.Bundle;
import android.preference.Preference... | package org.sugr.gearshift.ui.settings;
public class SettingsActivity extends AppCompatActivity {
enum Type {
PROFILE_HEADER, PREFERENCES, PROFILE, PROFILE_DIRECTORIES
}
private SlidingPaneLayout slidingPane;
private ProfileAdapter profileAdapter;
private static final int PREFERENCE_G... | return new TransmissionProfileSupportLoader(SettingsActivity.this, true); | 4 |
redhat-developer-demos/brewery | brewing/src/main/java/io/spring/cloud/samples/brewery/bottling/BottlingWorker.java | [
"@Data\n@Builder\npublic class TestConfigurationHolder {\n\tpublic static final String TEST_COMMUNICATION_TYPE_HEADER_NAME = \"TEST-COMMUNICATION-TYPE\";\n\tpublic static final ThreadLocal<TestConfigurationHolder> TEST_CONFIG = new ThreadLocal<>();\n\n\tprivate TestCommunicationType testCommunicationType;\n\n\tpubl... | import io.spring.cloud.samples.brewery.common.TestConfigurationHolder;
import io.spring.cloud.samples.brewery.common.events.Event;
import io.spring.cloud.samples.brewery.common.events.EventGateway;
import io.spring.cloud.samples.brewery.common.events.EventType;
import io.spring.cloud.samples.brewery.common.model.Versio... | package io.spring.cloud.samples.brewery.bottling;
@Component
@Slf4j
class BottlingWorker {
private Map<String, State> PROCESS_STATE = new ConcurrentHashMap<>();
private final Tracer tracer;
private final PresentingClient presentingClient;
private final RestTemplate restTemplate; | private final EventGateway eventGateway; | 2 |
Sleeksnap/sleeksnap | src/org/sleeksnap/uploaders/text/UpasteUploader.java | [
"public class HttpUtil {\n\n\t/**\n\t * Attempt to encode the string silenty\n\t * \n\t * @param string\n\t * The string\n\t * @return The encoded string\n\t */\n\tpublic static String encode(String string) {\n\t\ttry {\n\t\t\treturn URLEncoder.encode(string, \"UTF-8\");\n\t\t} catch (UnsupportedEncoding... | import java.util.Map;
import org.sleeksnap.http.HttpUtil;
import org.sleeksnap.http.RequestData;
import org.sleeksnap.impl.APICredentials;
import org.sleeksnap.upload.TextUpload;
import org.sleeksnap.uploaders.UploadException;
import org.sleeksnap.uploaders.Uploader;
import org.sleeksnap.uploaders.settings.Setting;
imp... | /**
* Sleeksnap, the open source cross-platform screenshot uploader
* Copyright (C) 2014 Nikki <nikki@nikkii.us>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the L... | throw new UploadException("Upload failed due to unknown reason."); | 4 |
BurstProject/burstcoin | src/java/nxt/http/ParameterParser.java | [
"public final class AT extends AT_Machine_State {\n\n\tstatic {\n\t\tNxt.getBlockchainProcessor().addListener(new Listener<Block>() {\n\t\t\t@Override\n\t\t\tpublic void notify(Block block) {\n\t\t\t\tfor(Long id : pendingFees.keySet()) {\n\t\t\t\t\tAccount atAccount = Account.getAccount(id);\n\t\t\t\t\tatAccount.a... | import nxt.AT;
import nxt.Account;
import nxt.Alias;
import nxt.Asset;
import nxt.Constants;
import nxt.DigitalGoodsStore;
import nxt.Nxt;
import nxt.NxtException;
import nxt.Transaction;
import nxt.crypto.Crypto;
import nxt.crypto.EncryptedData;
import nxt.util.Convert;
import nxt.util.Logger;
import org.json.simple.J... | package nxt.http;
final class ParameterParser {
static Alias getAlias(HttpServletRequest req) throws ParameterException {
long aliasId;
try {
aliasId = Convert.parseUnsignedLong(Convert.emptyToNull(req.getParameter("alias")));
} catch (RuntimeException e) {
thr... | if (amountNQT <= 0 || amountNQT >= Constants.MAX_BALANCE_NQT) { | 2 |
c-rack/cbor-java | src/test/java/co/nstant/in/cbor/examples/Example49Test.java | [
"public class CborBuilder extends AbstractBuilder<CborBuilder> {\n\n private final LinkedList<DataItem> dataItems = new LinkedList<>();\n\n public CborBuilder() {\n super(null);\n }\n\n public CborBuilder reset() {\n dataItems.clear();\n return this;\n }\n\n public List<DataIt... | import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import co.nstant.in.cbor.CborBuilder;
import co.nstant.in.cbor.CborDecoder;
import co.nstant.in.cbor.CborEncoder;
import co.nstant.in.cbor.CborExc... | package co.nstant.in.cbor.examples;
/**
* 1(1363896240) -> 0xc11a514b67b0
*/
public class Example49Test {
private final List<DataItem> VALUE;
private final byte[] ENCODED_VALUE = new byte[] { (byte) 0xc1, 0x1a, 0x51, 0x4b, 0x67, (byte) 0xb0 };
public Example49Test() {
DataItem di = new Unsi... | CborDecoder decoder = new CborDecoder(inputStream); | 1 |
levin81/daelic | src/main/java/com/github/levin81/daelic/druid/Select.java | [
"public interface DataSource {\n String getType();\n}",
"@JsonInclude(JsonInclude.Include.NON_NULL)\npublic class TableDataSource implements DataSource {\n\n private final String type = \"table\";\n\n private String name;\n\n TableDataSource(String name) {\n Properties.assertRequired(name, \"Na... | import com.fasterxml.jackson.annotation.JsonInclude;
import com.github.levin81.daelic.druid.datasource.DataSource;
import com.github.levin81.daelic.druid.datasource.TableDataSource;
import com.github.levin81.daelic.druid.dimension.DefaultDimension;
import com.github.levin81.daelic.druid.dimension.Dimension;
import com.... | package com.github.levin81.daelic.druid;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Select {
private final String type = "select";
private DataSource dataSource;
private Boolean descending;
private List<Dimension> dimensions;
private List<String> metrics; | private Granularity granularity; | 4 |
godstale/retrowatch | RetroWatch_Android/RetroWatchLE/src/com/hardcopy/retrowatchle/service/RetroWatchService.java | [
"public class BluetoothManager {\n\t\n // Debugging\n private static final String TAG = \"BluetoothManager\";\n\n // Constants that indicate the current connection state\n public static final int STATE_NONE = 0; // we're doing nothing\n public static final int STATE_LISTEN = 1; // now liste... | import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import com.hardcopy.retrowatchle.R;
import com.hardcopy.retrowatchle.connectivity.BluetoothManager;
import com.hardcopy.retrowatchle.connectivity.ConnectionInfo;
import com.hardcopy.retrowatchle.connectivity.TransactionBuilder;
import com.h... | /*
* Copyright (C) 2014 The Retro Watch - Open source smart watch project
*
* 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
*
* Unle... | mActivityHandler.obtainMessage(Constants.MESSAGE_GMAIL_UPDATED, arg4).sendToTarget(); | 6 |
i2p/i2p.itoopie | src/net/i2p/itoopie/i2pcontrol/methods/GetRouterInfo.java | [
"public class Transl {\n \n public static final String BUNDLE_NAME = \"net.i2p.itoopie.messages\";\n \n \n public static String _t(String s) {\n return Translate.getString(s, BUNDLE_NAME);\n }\n\n \n /**\n * translate a string with a parameter\n * This is a lot more expensi... | import java.util.Arrays;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.i2p.itoopie.i18n.Transl;
import net.i2p.itoopie.i2pc... | package net.i2p.itoopie.i2pcontrol.methods;
public class GetRouterInfo {
private static HashMap<Integer, NETWORK_STATUS> enumMap;
public static enum NETWORK_STATUS{
OK { public String toString(){ return Transl._t("Ok."); }},
TESTING { public String toString(){ return Transl._t("Testi... | JSONRPC2Request req = new JSONRPC2Request("RouterInfo", JSONRPC2Interface.incrNonce()); | 3 |
tteguayco/JITRAX | src/es/ull/etsii/jitrax/interpreters/RelationalAlgebraInterpreter.java | [
"public class Database {\n\n\tprivate String name;\n\tprivate ArrayList<Table> tables;\n\tprivate DbmsDriver dbmsDriver;\n\t\n\t/**\n\t * @param name name for the database.\n\t */\n\tpublic Database(String aName) {\n\t\tname = aName;\n\t\ttables = new ArrayList<Table>();\n\t}\n\t\n\tpublic Database(String aName, Ar... | import org.antlr.v4.runtime.ANTLRInputStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;
import es.ull.etsii.jitrax.adt.Database;
import es.ull.etsii.jitrax.analysis.CustomErrorListener;
import es.ull.etsii.jitrax.analysis.ra.PreprocessingEvalVisitor;
import es.ull.etsii.... | package es.ull.etsii.jitrax.interpreters;
public class RelationalAlgebraInterpreter {
private static final String SYNTAX_ERRORS_MSG =
"> The entered Relational Algebra expression contains syntax errors:";
private ANTLRInputStream input;
private ParseTree tree;
private RelationalAlgebraLexer lexer;
priva... | private RelationalAlgebraEvalVisitor eval; | 3 |
jasondevj/hotpotato | src/functionaltest/java/com/biasedbit/hotpotato/client/AbstractHttpClientFunctionalTest.java | [
"public class PipeliningHttpConnectionFactory implements HttpConnectionFactory {\n\n // configuration defaults -----------------------------------------------------------------------------------------\n\n private static final boolean DISCONNECT_IF_NON_KEEP_ALIVE_REQUEST = false;\n private static final bool... | import com.biasedbit.hotpotato.client.connection.factory.PipeliningHttpConnectionFactory;
import com.biasedbit.hotpotato.client.factory.DefaultHttpClientFactory;
import com.biasedbit.hotpotato.request.HttpRequestFuture;
import com.biasedbit.hotpotato.response.DiscardProcessor;
import com.biasedbit.hotpotato.util.DummyH... | package com.biasedbit.hotpotato.client;
/**
* @author <a href="http://bruno.biasedbit.com/">Bruno de Carvalho</a>
*/
public class AbstractHttpClientFunctionalTest {
private DummyHttpServer server;
@Before
public void setUp() {
this.server = new DummyHttpServer("localhost", 8081);
}
... | List<HttpRequestFuture<Object>> futures = new ArrayList<HttpRequestFuture<Object>>(); | 2 |
rsgoncalves/ecco | src/main/java/uk/ac/manchester/cs/diff/test/SubconceptDiffAlternative.java | [
"public class ConceptChange {\n\tprivate OWLClass c;\n\tprivate Set<OWLAxiom> dirSpecWit, indirSpecWit, dirGenWit, indirGenWit, allWit;\n\tprivate Map<OWLAxiom,Set<OWLAxiom>> dirSpecWitsOfAx, dirGenWitsOfAx, indirSpecWitsOfAx, indirGenWitsOfAx;\n\n\t/**\n\t * Constructor\n\t * @param c\tConcept\n\t * @param specWit... | import java.io.File;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import ja... | /*******************************************************************************
* This file is part of ecco.
*
* ecco is distributed under the terms of the GNU Lesser General Public License (LGPL), Version 3.0.
*
* Copyright 2011-2014, The University of Manchester
*
* ecco is free software: you can redistr... | Set<RHSConceptChange> rhsConceptChanges = new HashSet<RHSConceptChange>(); | 2 |
pasqualesalza/elephant56 | elephant56/src/main/java/it/unisa/elephant56/core/DistributedDriver.java | [
"public class IndividualWrapper<IndividualType extends Individual, FitnessValueType extends FitnessValue>\r\n implements Comparable<IndividualWrapper<IndividualType, FitnessValueType>>, Cloneable {\r\n\r\n private IndividualType individual;\r\n private FitnessValueType fitnessValue;\r\n private Bool... | import it.unisa.elephant56.core.common.IndividualWrapper;
import it.unisa.elephant56.core.input.NodesInputFormat;
import it.unisa.elephant56.core.output.NodesOutputFormat;
import it.unisa.elephant56.user.common.FitnessValue;
import it.unisa.elephant56.user.common.Individual;
import it.unisa.elephant56.util.hadoop.... | */
public Path getGenerationsBlocksFolderPath() {
return new Path(this.workingFolderPath, Constants.DEFAULT_GENERATIONS_BLOCKS_FOLDER_NAME);
}
public Path getGenerationsBlockFolderPath(long generationsBlockNumber, String generationsBlockNameFormat) {
return new Path(getGeneration... | job.setInputFormatClass(NodesInputFormat.class);
| 1 |
NICTA/nicta-ner | nicta-ner/src/main/java/org/t3as/ner/data/Date.java | [
"public class EntityClass {\n\n public static final EntityClass UNKNOWN = new EntityClass(\"UNKNOWN\");\n public static final EntityClass DATE = new EntityClass(\"DATE\");\n\n private final String entityClass;\n\n @JsonCreator\n public EntityClass(@JsonProperty(\"entityClass\") final String entityCla... | import static org.t3as.ner.data.Date.DateType.DATE_MM;
import static org.t3as.ner.data.Date.DateType.DATE_WEEKDAY;
import static org.t3as.ner.data.Date.DateType.DATE_YY;
import static org.t3as.ner.data.Date.DateType.NONE;
import static org.t3as.ner.data.Date.DateType.TIME;
import static org.t3as.ner.data.Date.DateType.... | /*
* #%L
* NICTA t3as Named-Entity Recognition library
* %%
* Copyright (C) 2010 - 2014 NICTA
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or ... | super(tokens, pos, len, stubPos, EntityClass.DATE); | 0 |
neva-dev/felix-search-webconsole-plugin | src/main/java/com/neva/felix/webconsole/plugins/search/rest/SourceGenerateServlet.java | [
"public class BundleClass {\n\n private Bundle bundle;\n\n private String className;\n\n public BundleClass(Bundle bundle, String className) {\n this.bundle = bundle;\n this.className = className;\n }\n\n public Bundle getBundle() {\n return bundle;\n }\n\n public String ge... | import com.neva.felix.webconsole.plugins.search.core.BundleClass;
import com.neva.felix.webconsole.plugins.search.core.OsgiExplorer;
import com.neva.felix.webconsole.plugins.search.core.SearchMonitor;
import com.neva.felix.webconsole.plugins.search.core.sourcegenerator.SourceGeneratorJob;
import org.osgi.framework.Bund... | package com.neva.felix.webconsole.plugins.search.rest;
public class SourceGenerateServlet extends RestServlet {
private static final Logger LOG = LoggerFactory.getLogger(SourceGenerateServlet.class);
public static final String ALIAS_NAME = "source-generate";
private final SearchMonitor<SourceGenerato... | writeMessage(response, MessageType.SUCCESS, "Job started properly.", job); | 5 |
MewX/light-novel-library_Wenku8_Android | studio-android/LightNovelLibrary/app/src/main/java/org/mewx/wenku8/activity/UserLoginActivity.java | [
"public class MyApp extends Application {\n @SuppressLint(\"StaticFieldLeak\")\n private static Context context;\n\n @Override\n public void onCreate() {\n super.onCreate();\n context = getApplicationContextLocal();\n }\n\n /**\n * wrap the getApplicationContext() function for ea... | import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.view.MenuItem;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.afoll... | package org.mewx.wenku8.activity;
/**
* Created by MewX on 2015/6/12.
* User Login Activity.
*/
public class UserLoginActivity extends BaseMaterialActivity {
// private vars
private EditText etUserName = null;
private EditText etPassword = null;
@Override
protected void onCreate(Bundle sav... | Toast.makeText(MyApp.getContext(), getResources().getString(R.string.system_logged), Toast.LENGTH_SHORT).show(); | 0 |
Simperium/simperium-android | Simperium/src/androidTestSupport/java/com/simperium/WebSocketManagerTest.java | [
"public class WebSocketManager implements ChannelProvider, Channel.OnMessageListener {\n\n public enum ConnectionStatus {\n DISCONNECTING, DISCONNECTED, CONNECTING, CONNECTED\n }\n\n public interface Connection {\n public void close();\n public void send(String message);\n }\n\n ... | import com.simperium.android.WebSocketManager;
import com.simperium.client.Bucket;
import com.simperium.client.ChannelProvider;
import com.simperium.models.Note;
import com.simperium.test.MockBucket;
import com.simperium.test.MockConnection;
import com.simperium.test.MockChannelSerializer;
import com.simperium.test.Moc... | package com.simperium;
public class WebSocketManagerTest extends TestCase {
static public final String APP_ID = "mock-app-id";
static public final String SESSION_ID = "mock-session-id";
WebSocketManager mSocketManager;
MockChannelSerializer mChannelSerializer;
MockConnection mConnection;
... | mBucket = MockBucket.buildBucket(new Note.Schema(), mSocketManager); | 4 |
koendeschacht/count-db | src/main/java/be/bagofwords/db/remote/RemoteDataInterfaceServer.java | [
"public interface DataInterface<T extends Object> extends DataIterable<KeyValue<T>> {\n\n T read(long key);\n\n default long readCount(long key) {\n Long result = (Long) read(key);\n if (result == null)\n return 0;\n else\n return result;\n }\n\n default T read... | import be.bagofwords.db.DataInterface;
import be.bagofwords.db.DataInterfaceFactory;
import be.bagofwords.db.combinator.Combinator;
import be.bagofwords.db.methods.DataStream;
import be.bagofwords.db.methods.DataStreamUtils;
import be.bagofwords.db.methods.KeyFilter;
import be.bagofwords.db.methods.ObjectSerializer;
im... | dataInterface.write(new Iterator<KeyValue>() {
private KeyValue nextValue;
{
//psuedo constructor
readNextValue();
}
private void readNextValue() {
try {
lon... | DataStreamUtils.writeValue(value, ds, objectSerializer); | 4 |
NessComputing/components-ness-httpclient | client/src/test/java/com/nesscomputing/httpclient/AbstractTestHttpClient.java | [
"public final class HttpClient implements Closeable\n{\n private final HttpClientFactory httpClientFactory;\n\n /**\n * Creates a new HTTP client with the default implementation (currently Apache HTTPClient 4) and default settings.\n */\n public HttpClient()\n {\n this(new HttpClientDefau... | import com.nesscomputing.httpclient.testsupport.StringResponseConverter;
import com.nesscomputing.testing.lessio.AllowNetworkAccess;
import static org.hamcrest.CoreMatchers.is;
import java.io.IOException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import com.nesscom... | /**
* Copyright (C) 2012 Ness Computing, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ... | protected final HttpClientResponseHandler<String> responseHandler = new ContentResponseHandler<String>(new StringResponseConverter()); | 6 |
lgvalle/Beautiful-Photos | app/src/main/java/com/lgvalle/beaufitulphotos/gallery/GalleryFragment.java | [
"public abstract class BaseFragment extends Fragment {\n\n\t/**\n\t * Bind layout\n\t */\n\tprotected abstract void initLayout();\n\n\t/**\n\t * @return Activity layout resource\n\t */\n\tprotected abstract int getContentView();\n\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container... | import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AbsListView;
import android.widget.ListView;
import android.widget.ProgressBar;
import butterknife.InjectView;
import butterknife.OnItemClick;
import com.lgvalle.beaufitulphotos.BaseFragment;
import com.lgvalle... | package com.lgvalle.beaufitulphotos.gallery;
/**
* Created by lgvalle on 21/07/14.
* <p/>
* A PhotoModel Gallery.
* <p/>
* This is the UI layer of the Gallery.
* It is initialized empty and listen for {@link PhotosAvailableEvent} on the bus
* When a new event is received, all photos are added to the adapter.
... | public void onNewPhotosEvent(PhotosAvailableEvent event) { | 4 |
mung3r/MobRider | src/main/java/com/edwardhand/mobrider/commands/MountCommand.java | [
"public class ConfigManager\r\n{\r\n public final Material controlItem;\r\n public final long updatePeriod;\r\n\r\n public final int maxTravelDistance;\r\n public final double maxSearchRange;\r\n public final double attackRange;\r\n public final double mountRange;\r\n public final double goalRa... | import com.edwardhand.mobrider.rider.RiderManager;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import com.edwardhand.mobrider.ConfigManager;
import com.edwardhand.mobrider.MobRider;
... | /*
* This file is part of MobRider.
*
* Copyright (c) 2011-2015, R. Ramos <http://github.com/mung3r/>
* MobRider is licensed under the GNU Lesser General Public License.
*
* MobRider is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as pu... | private RiderManager riderManager;
| 5 |
ceaseless-prayer/CeaselessAndroid | app/src/main/java/org/theotech/ceaselessandroid/cache/LocalDailyCacheManagerImpl.java | [
"public class LocalCacheData extends RealmObject {\n @PrimaryKey @Required\n private String creationDate;\n private String scriptureCitation;\n private String scriptureText;\n private String scriptureLink;\n private String scriptureJson;\n private String verseImageURL;\n private RealmList<Re... | import android.content.Context;
import org.theotech.ceaselessandroid.realm.LocalCacheData;
import org.theotech.ceaselessandroid.realm.RealmString;
import org.theotech.ceaselessandroid.realm.pojo.LocalCacheDataPOJO;
import org.theotech.ceaselessandroid.scripture.ScriptureData;
import org.theotech.ceaselessandroid.util.R... | package org.theotech.ceaselessandroid.cache;
/**
* Created by uberx on 10/4/15.
*/
public class LocalDailyCacheManagerImpl implements CacheManager {
private static final String TAG = LocalDailyCacheManagerImpl.class.getSimpleName();
private static LocalDailyCacheManagerImpl instance = null;
private ... | public ScriptureData getCachedScripture() { | 3 |
hoko/hoko-android | hoko/src/main/java/com/hokolinks/Hoko.java | [
"public class AnnotationParser {\n\n // Route link\n\n /**\n * Get the route annotated with DeeplinkRoute on a certain class.\n *\n * @param classObject A classObject (usually an activity).\n * @return The route string.\n */\n private static String routeFromClass(Class classObject) {\n ... | import android.content.Context;
import com.hokolinks.deeplinking.AnnotationParser;
import com.hokolinks.deeplinking.Deeplinking;
import com.hokolinks.model.App;
import com.hokolinks.model.exceptions.SetupCalledMoreThanOnceException;
import com.hokolinks.model.exceptions.SetupNotCalledYetException;
import com.hokolinks.... | package com.hokolinks;
/**
* Hoko is an easy-to-use Framework to handle Deeplinking and the Analytics around it.
*
* This is a simple drop-in class for handling incoming deeplinks.
* With the Hoko framework you can map routes to your activities, add handlers that trigger when
* deeplinks are the point of entry ... | Networking.setupNetworking(context); | 6 |
GoogleCloudPlatform/healthcare-api-dicom-fuse | src/test/java/com/google/dicomwebfuse/TestUtils.java | [
"public static final Integer MAX_SERIES_IN_STUDY = VALUE_PARAM_MAX_LIMIT_FOR_SERIES * 3;",
"public static final Integer MAX_STUDIES_IN_DICOM_STORE = VALUE_PARAM_MAX_LIMIT_FOR_STUDY * 3;",
"public static final Integer VALUE_PARAM_MAX_LIMIT_FOR_INSTANCES = 15000; // max - 50 000 results",
"public static final I... | import static com.google.dicomwebfuse.EntityType.DICOM_STORE;
import static com.google.dicomwebfuse.dao.Constants.MAX_INSTANCES_IN_SERIES;
import static com.google.dicomwebfuse.dao.Constants.MAX_SERIES_IN_STUDY;
import static com.google.dicomwebfuse.dao.Constants.MAX_STUDIES_IN_DICOM_STORE;
import static com.google.dic... | // Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | EntityType entityType, int statusCode) throws IOException, DicomFuseException { | 7 |
rob42/freeboard-server | src/main/java/nz/co/fortytwo/freeboard/server/GPXProcessor.java | [
"public class SGImplify {\n \n //adapted from http://geometryalgorithms.com/Archive/algorithm_0205/algorithm_0205.htm\n //original copyright message follows\n \n // Copyright 2002, softSurfer (www.softsurfer.com)\n // This code may be freely used and modified for any purpose\n // providing that... | import org.alternativevision.gpx.beans.Track;
import org.alternativevision.gpx.beans.TrackPoint;
import org.alternativevision.gpx.beans.Waypoint;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.commons.io.FileUtils;
import org.apache.log4j.Logger;
import java.io.File;
import java.... | /*
* Copyright 2012,2013 Robert Huitema robert@42.co.nz
*
* This file is part of FreeBoard. (http://www.42.co.nz/freeboard)
*
* FreeBoard is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version... | currentTrack.setTrackPoints(SGImplify.simplifyLine2D(TOLERANCE, currentTrack.getTrackPoints())); | 0 |
neo4j/windows-wrapper | src/main/java/com/sun/jna/platform/win32/DsGetDC.java | [
"public class NativeLong extends IntegerType {\n /** Size of a native long, in bytes. */\n public static final int SIZE = Native.LONG_SIZE;\n\n /** Create a zero-valued NativeLong. */\n public NativeLong() {\n this(0);\n }\n \n /** Create a NativeLong with the given value. */\n public... | import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.WString;
import com.sun.jna.platform.win32.Guid.GUID;
import com.sun.jna.platform.win32.WinNT.PSID;
import com.sun.jna.win32.StdCallLibrary;
| /* Copyright (c) 2010 Daniel Doubrovkine, All Rights Reserved
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any lat... | public PSID.ByReference DomainSid;
| 5 |
legobmw99/Allomancy | src/main/java/com/legobmw99/allomancy/modules/combat/CombatSetup.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.modules.combat.entity.ProjectileNuggetEntity;
import com.legobmw99.allomancy.modules.combat.item.CoinBagItem;
import com.legobmw99.allomancy.modules.combat.item.KolossBladeItem;
import com.legobmw99.allomancy.modules.combat.item.MistcloakItem;
imp... | package com.legobmw99.allomancy.modules.combat;
public class CombatSetup {
public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, Allomancy.MODID);
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Alloma... | public static final RegistryObject<ObsidianDaggerItem> OBSIDIAN_DAGGER = ITEMS.register("obsidian_dagger", ObsidianDaggerItem::new); | 5 |
jhamalt/maltparser | src/org/maltparser/core/lw/parser/LWClassifier.java | [
"public class FeatureVector extends ArrayList<FeatureFunction> implements Serializable {\r\n\tpublic final static long serialVersionUID = 3256444702936019250L;\r\n\tprivate final SpecificationSubModel specSubModel;\r\n\tprivate final FeatureModel featureModel;\r\n\t\r\n\t/**\r\n\t * Constructs a feature vector\r\n\... | import java.util.ArrayList;
import org.maltparser.core.exception.MaltChainedException;
import org.maltparser.core.feature.FeatureVector;
import org.maltparser.core.feature.value.FeatureValue;
import org.maltparser.core.feature.value.MultipleFeatureValue;
import org.maltparser.core.feature.value.SingleFeatureValue;
impo... | package org.maltparser.core.lw.parser;
/**
* A lightweight version of org.maltparser.ml.lib.{Lib,LibLinear,LibSvm} and can only predict the next transition.
*
* @author Johan Hall
*/
public class LWClassifier {
private final FeatureMap featureMap;
private final boolean excludeNullValues;
private final MaltLibMo... | SingleFeatureValue singleFeatureValue = (SingleFeatureValue)featureValue; | 3 |
jdbc-json/jdbc-cb | src/test/java/com/couchbase/jdbc/JDBCTestUtils.java | [
"public class BucketInfo {\n\tpublic String name;\n\tpublic int port;\n\tpublic int ramQuotaMB;\n\tpublic int replicaNumber;\n\tpublic Integer proxyPort;\n\tpublic String authType;\n\tpublic static int proxy_port = 21000;\n\t\n\t/***\n\t * Constructor\n\t */\n\tpublic BucketInfo(){\n\t\tthis.name = \"default\";\n\t... | import com.couchbase.jdbc.BucketInfo;
import com.couchbase.jdbc.ClusterInfo;
import com.couchbase.jdbc.ClusterSetupUtils;
import com.couchbase.jdbc.TestResultAnalysis;
import java.awt.List;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
impor... | package com.couchbase.jdbc;
public class JDBCTestUtils {
public static Connection con;
public static String ConnectionURL = "jdbc:couchbase://127.0.0.1:8093"; | public static ClusterInfo clusteInfo = null; | 1 |
marcelothebuilder/webpedidos | src/main/java/com/github/marcelothebuilder/webpedidos/controller/CidadeEstadoBean.java | [
"@Entity\n@Table(name=\"cidade\")\npublic class Cidade implements Serializable {\n\tprivate static final long serialVersionUID = 1L;\n\tprivate Integer codigo;\n\tprivate String nome;\n\tprivate Estado estado;\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\tpublic Integer getCodigo() {\n\t\tretur... | import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
import javax.inject.Named;
import com.github.marcelothebuilder.webpedidos.model.endereco.Cidade;
import com.github.marcelothebuilder.webpedidos.model.ende... | /**
*
*/
package com.github.marcelothebuilder.webpedidos.controller;
/**
* @author Marcelo Paixao Resende
*
*/
@Named
@ViewScoped
public class CidadeEstadoBean implements Serializable {
private static final long serialVersionUID = 1L;
private @Inject Estados estados;
private @Inject Cidades cidades;
priv... | CidadeFilter filter = new CidadeFilter(); | 4 |
murielK/AndroidWPTemplate | app/src/main/java/hr/mk/wpmagazine/android/component/ui/fragments/FeedsFragment.java | [
"public class ConnectivityUtils {\n\n private ConnectivityUtils() {\n }\n\n public static boolean isOnline(final Context context) {\n final ConnectivityManager connectivity = (ConnectivityManager) context.getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);\n if (connectivi... | import hr.mk.wpmagazine.android.component.activities.FeedViewerActivity;
import hr.mk.wpmagazine.android.component.services.UpdaterService;
import hr.mk.wpmagazine.model.ObjectParcel;
import hr.mk.wpmagazine.model.WP.WPPost;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Null... | /*
*
* *
* * * ****************************************************************************
* * * Copyright (c) 2015. Muriel Kamgang Mabou
* * * All rights reserved.
* * *
* * * This file is part of project AndroidWPTemplate.
* * * It can not be copied and/or distributed without the
* * * expres... | absBaseActivity.sendServiceCommand(UpdaterService.UPDATE_DATA_BASE); | 4 |
NiceSystems/hrider | src/main/java/hrider/hbase/Connection.java | [
"public class ConnectionDetails implements Serializable {\n\n //region Constants\n private static final long serialVersionUID = -5808921673890223877L;\n //endregion\n\n //region Variables\n private ServerDetails zookeeper;\n //endregion\n\n //region Public Properties\n public ServerDetails g... | import hrider.config.ConnectionDetails;
import hrider.config.GlobalConfig;
import hrider.data.ColumnFamily;
import hrider.data.DataCell;
import hrider.data.DataRow;
import hrider.data.TableDescriptor;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
... |
do {
Result result = scanner.next();
isValid = result != null;
if (isValid) {
Put put = new Put(result.getRow());
for (KeyValue kv : result.list()) {
put.add(kv);
}
... | Collection<ColumnFamily> families = new HashSet<ColumnFamily>(); | 2 |
XiaoMi/galaxy-fds-sdk-android | src/test/java/com/xiaomi/infra/galaxy/fds/android/example/FDSSSOClient.java | [
"public class FDSClientConfiguration {\n\n private static final String URI_HTTP_PREFIX = \"http://\";\n private static final String URI_HTTPS_PREFIX = \"https://\";\n private static final String URI_CDN = \"cdn\";\n private static final String URI_SUFFIX = \"fds.api.xiaomi.com\";\n private static final String ... | import java.io.ByteArrayInputStream;
import java.io.InputStream;
import com.xiaomi.infra.galaxy.fds.android.FDSClientConfiguration;
import com.xiaomi.infra.galaxy.fds.android.GalaxyFDSClient;
import com.xiaomi.infra.galaxy.fds.android.GalaxyFDSClientImpl;
import com.xiaomi.infra.galaxy.fds.android.auth.GalaxyFDSCredent... | package com.xiaomi.infra.galaxy.fds.android.example;
public class FDSSSOClient {
// This is a simple demo for FDS android SDK, note that before use android
// sdk, you should do the following preparation:
// 1. Create the bucket which you want to upload your object
// 2. Grant proper bucket permission... | GalaxyFDSCredential credential = new SSOCredential( | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.