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 |
|---|---|---|---|---|---|---|
wavesoftware/java-eid-exceptions | src/main/java/pl/wavesoftware/eid/impl/EidFactoriesImpl.java | [
"public interface Binding {\n\n /**\n * Gets a configuration system\n *\n * @return a configuration system\n */\n ConfigurationSystem getConfigurationSystem();\n\n /**\n * Get bound Eid factories to be used to perform various Eid\n * related operations.\n *\n * @return a fac... | import pl.wavesoftware.eid.api.Binding;
import pl.wavesoftware.eid.api.EidFactories;
import pl.wavesoftware.eid.api.EidFactory;
import pl.wavesoftware.eid.api.EidMessageFactory;
import pl.wavesoftware.eid.api.LazyFactory; | /*
* Copyright (c) 2018 Wave Software
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | private final EidFactory eidFactory; | 2 |
dss886/nForumSDK | src/com/dss886/nForumSDK/service/FavouriteService.java | [
"public class ParamOption {\n\n Map<String, String> params;\n List<NameValuePair> nameValuePairs;\n\n public ParamOption() {\n params = new HashMap<String, String>();\n }\n\n public ParamOption(List<NameValuePair> nameValuePairs) {\n this.nameValuePairs = nameValuePairs;\n }\n\n /... | import java.io.IOException;
import com.dss886.nForumSDK.util.ParamOption;
import org.apache.http.impl.client.DefaultHttpClient;
import org.json.JSONException;
import com.dss886.nForumSDK.http.GetMethod;
import com.dss886.nForumSDK.http.NForumException;
import com.dss886.nForumSDK.http.PostMethod;
import com.dss8... | /*
* Copyright (C) 2010-2014 dss886
*
* 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... | NForumException, IOException {
| 2 |
dariober/ASCIIGenome | src/test/java/tracks/TrackIntervalFeatureTest.java | [
"public class Config {\n\t\n\t// C O N S T R U C T O R \n\t\n\tprivate static final Map<ConfigKey, String> config= new HashMap<ConfigKey, String>();\n\n\tpublic Config(String source) throws IOException, InvalidConfigException {\n\t\t\n\t\tnew Xterm256();\n\t\t\n\t\tString RawConfigFile= Config.getConfigFileAsString... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
import org.junit.Before;
import org.junit.Test;
import com.google.common.base.Splitter;
imp... | package tracks;
public class TrackIntervalFeatureTest {
@Before
public void prepareConfig() throws IOException, InvalidConfigException{
new Config(null);
new Xterm256();
}
@Test
public void canReadOddFilename() throws InvalidGenomicCoordsException, IOException, ClassNotFoundException, InvalidRecordEx... | GenomicCoords gc= new GenomicCoords("1:1-100000", 80, null, null); | 7 |
bkueng/clash_of_balls | src/com/sapos_aplastados/game/clash_of_balls/menu/MenuItemStringMultiline.java | [
"public class Font2D implements IDrawable {\n\n\tprivate static final String LOG_TAG = \"Font2D\";\n\t\n\tprivate Texture m_texture;\n\tprivate Vector m_text_field_size;\n\t\n\tprivate Typeface m_typeface;\n\tprivate String m_string;\n\tprivate int m_font_size;\n\tprivate TextAlign m_align;\n\tprivate float m_color... | import com.sapos_aplastados.game.clash_of_balls.R;
import com.sapos_aplastados.game.clash_of_balls.Font2D;
import com.sapos_aplastados.game.clash_of_balls.Texture;
import com.sapos_aplastados.game.clash_of_balls.TextureManager;
import com.sapos_aplastados.game.clash_of_balls.VertexBufferFloat;
import com.sapos_aplastad... | /*
* Copyright (C) 2012-2013 Hans Hardmeier <hanshardmeier@gmail.com>
* Copyright (C) 2012-2013 Andrin Jenal
* Copyright (C) 2012-2013 Beat Küng <beat-kueng@gmx.net>
*
* 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
* ... | m_position_data = new VertexBufferFloat | 2 |
emop/EmopAndroid | src/com/emop/client/RegisterActivity.java | [
"public static final String TAG_EMOP = \"emop\";\r",
"public class ImageCache {\r\n\tpublic static DiskLruCache diskCache = null;\r\n\tprivate File cacheRoot = null;\r\n\tprivate LruCache<String, Bitmap> memCache;\r\n\tprivate LruCache<String, Lock> lockCache;\r\n\t\r\n\tpublic ImageCache(File root, final int cac... | import static com.emop.client.Constants.TAG_EMOP;
import java.util.HashMap;
import java.util.Map;
import android.app.ProgressDialog;
import android.content.SharedPreferences;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View... | package com.emop.client;
public class RegisterActivity extends BaseActivity {
//private WeiBoClient weibo = null;
private EditText nick = null;
private EditText email = null;
private EditText password = null;
private WeiBoClient weibo = null;
private ImageView icon = null;
private Progres... | private class RegisterRequest extends AsyncTask<String, Void, ApiResult> {
| 2 |
gems-uff/prov-viewer | src/main/java/br/uff/ic/utility/IO/PROVReader.java | [
"public class ActivityVertex extends Vertex {\n\n\n /**\n * Constructor\n *\n * @param id This param is used by JUNG for collapsed vertices and tooltips.\n */\n public ActivityVertex(String id) {\n super(id, \"\", \"\");\n }\n \n public ActivityVertex(String id, String label, S... | import java.io.IOException;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Map;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import br.uff.ic.utility.graph.ActivityVertex;
import br.uff.ic.utility.graph.AgentVertex;
im... | /*
* The MIT License
*
* Copyright 2017 Kohwalter.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modif... | vertex = new EntityVertex(id, label, time); | 3 |
mpusher/mpush-client-java | src/main/java/com/mpush/handler/HttpProxyHandler.java | [
"public interface Connection {\n\n void connect();\n\n void close();\n\n void reconnect();\n\n void send(Packet packet);//TODO add send Listener\n\n boolean isConnected();\n\n boolean isAutoConnect();\n\n boolean isReadTimeout();\n\n boolean isWriteTimeout();\n\n void setLastReadTime();\n... | import com.mpush.api.connection.Connection;
import com.mpush.api.http.HttpResponse;
import com.mpush.api.protocol.Packet;
import com.mpush.client.HttpRequestMgr;
import com.mpush.api.Logger;
import com.mpush.client.ClientConfig;
import com.mpush.message.HttpResponseMessage; | /*
* (C) Copyright 2015-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | HttpResponse response = new HttpResponse(message.statusCode, message.reasonPhrase, message.headers, message.body); | 1 |
ltettoni/logic2j | src/main/java/org/logic2j/contrib/rdb/RDBClauseProvider.java | [
"public static TermApi termApi() {\n return termApi;\n}",
"public class SqlBuilder3 {\n private static final String DEFAULT_TABLE_ALIAS = \"t\";\n\n // public static final String INSERT = \"insert\"; Not yet supported\n public static final String SELECT = \"select\";\n public static final String UPDATE = \"u... | import org.logic2j.engine.exception.InvalidTermException;
import org.logic2j.engine.model.PrologLists;
import org.logic2j.engine.model.Struct;
import org.logic2j.engine.unify.UnifyContext;
import static org.logic2j.engine.model.TermApiLocator.termApi;
import java.sql.SQLException;
import java.util.ArrayList;
import jav... | /*
* logic2j - "Bring Logic to your Java" - Copyright (c) 2017 Laurent.Tettoni@gmail.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your opt... | final SqlBuilder3 builder = new SqlBuilder3(); | 1 |
Medo42/Gmk-Splitter | src/com/ganggarrison/gmdec/xml/EventXmlFormat.java | [
"public class XmlReader {\r\n\tprivate final Document domDocument;\r\n\tprivate Element currentParent = null;\r\n\tprivate Element currentChild = null;\r\n\r\n\tpublic XmlReader(File xmlFile) throws IOException {\r\n\t\ttry {\r\n\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\r\n\t\t\tf... | import org.lateralgm.file.GmFile;
import org.lateralgm.resources.GmObject;
import org.lateralgm.resources.sub.Action;
import org.lateralgm.resources.sub.Event;
import org.lateralgm.resources.sub.MainEvent;
import com.ganggarrison.easyxml.XmlReader;
import com.ganggarrison.easyxml.XmlWriter;
import com.ganggarrison.gmde... | /*
* Copyright (C) 2010 Medo <smaxein@googlemail.com>
* Copyright (C) 2006 Clam <clamisgood@gmail.com>
*
* This file is part of GmkSplitter.
* GmkSplitter is free software and comes with ABSOLUTELY NO WARRANTY.
* See LICENSE for details.
*/
package com.ganggarrison.gmdec.xml;
public class EventXmlFormat exte... | private static class ReferenceCreator implements DeferredReferenceCreator { | 2 |
mstojcevich/Radix | core/src/sx/lambda/voxel/block/Block.java | [
"public class Item {\n\n private final String humanName;\n private int id;\n\n public Item(int id, String humanName) {\n this.id = id;\n this.humanName = humanName;\n }\n\n public int getID() {\n return this.id;\n }\n\n public void setID(int id) {\n this.id = id;\n ... | import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.collision.BoundingBox;
import sx.lambda.voxel.item.Item;
import sx.lambda.voxel.item.Tool;
import sx.lambda.voxel.item.Tool.ToolMaterial;
import sx.lambda.voxel.item.Tool.ToolType;
import sx.lambda.voxel.world.chunk.IChunk; | package sx.lambda.voxel.block;
public class Block extends Item {
private final transient BlockRenderer renderer;
private boolean translucent, solid, lightPassthrough, selectable, occludeCovered, decreaseLight, greedyMerge;
private final String[] textureLocations;
private int textureIndex;
private... | private final ToolType requiredType; | 3 |
groupon/Message-Bus | mbus-java/src/test/java/com/groupon/messagebus/client/test/StompServerFetcherTest.java | [
"public enum ConsumerAckType{\n AUTO_CLIENT_ACK,\n CLIENT_ACK;\n}",
"public class ConsumerConfig {\n\n // Set of servers to consume from.\n private Set<HostParams> hostParamsSet = null;\n\n // Consumer destination information.\n private String destinationName;\n private DestinationType destin... | import static org.mockito.Matchers.anyString;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.IOException;
impor... | package com.groupon.messagebus.client.test;
/*
* Copyright (c) 2013, Groupon, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the abov... | StompConnection connection; | 7 |
mlaccetti/JavaPNS | src/test/java/javapns/test/NotificationTest.java | [
"public class Push {\n\n private static final Logger logger = LoggerFactory.getLogger(Push.class);\n\n private Push() {\n // empty\n }\n\n /**\n * Push a simple alert to one or more devices.\n *\n * @param message the alert message to push.\n * @param keystore a keystore containing your private ... | import javapns.Push;
import javapns.communication.exceptions.CommunicationException;
import javapns.communication.exceptions.KeystoreException;
import javapns.devices.Device;
import javapns.devices.implementations.basic.BasicDevice;
import javapns.notification.*;
import javapns.notification.transmission.NotificationPro... | package javapns.test;
/**
* A command-line test facility for the Push Notification Service.
* <p>Example: <code>java -cp "[required libraries]" NotificationTest keystore.p12 mypass 2ed202ac08ea9033665e853a3dc8bc4c5e78f7a6cf8d55910df230567037dcc4</code></p>
* <p>
* <p>By default, this test uses the sandbox servi... | } catch (final CommunicationException | KeystoreException e) { | 2 |
DaveRead/SequenceHunt | src/com/monead/games/android/sequence/Sequence.java | [
"public class SequenceHuntGameModel implements Serializable {\n /**\n * Serial Id required since this model is serializable.\n */\n private static final long serialVersionUID = 5685518061216785733L;\n\n /**\n * Maximum number of attempts to discover the sequence.\n */\n private static fi... | import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Locale;
import com.monead.games.android.sequence.model.SequenceHuntGameModel;
import com.monead.games.android.sequence.reporting.GameStatistics;
import com.monead.games.android.sequence.reporting.GameStatisticsEngine;
import com.monea... | getResources().getString(R.string.button_close),
new DialogInterface.OnClickListener() {
public void onClick(
final DialogInterface dialog,
... | GameStatistics statistics; | 1 |
dan-silver/cast-dashboard-android-app | app/src/main/java/com/silver/dan/castdemo/settingsFragments/GoogleCalendarListAdapter.java | [
"public class CastCommunicator {\n CastSession mCastSession;\n\n public CastCommunicator(CastSession session) {\n this.mCastSession = session;\n }\n\n public void sendWidgetProperty(Widget widget, String property, Object value) {\n try {\n JSONObject propertyValue = new JSONObje... | import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.silver.dan.castdemo.CastCommunicator... | package com.silver.dan.castdemo.settingsFragments;
public class GoogleCalendarListAdapter extends RecyclerView.Adapter<GoogleCalendarListAdapter.CalendarViewHolder> {
private final Widget widget;
private List<GoogleCalendarWidget.Calendar> calendars = new ArrayList<>();
public static class CalendarView... | new CastCommunicator(MainActivity.mCastSession).sendWidget(widget, holder.calendarName.getContext()); | 0 |
CROW-NDOV/displaydirect | distribution/src/test/java/nl/crowndov/displaydirect/distribution/kv78/Kv78ParserTest.java | [
"public class InputHandler {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(InputHandler.class);\n\n private static ProcessFactory factory = new ProcessFactory();\n private static MetricStore metrics = MetricStore.getInstance();\n private static Transport transport = TransportFactory.g... | import com.netflix.config.ConfigurationManager;
import nl.crowndov.displaydirect.distribution.input.InputHandler;
import nl.crowndov.displaydirect.distribution.kv78.Kv78Parser;
import nl.crowndov.displaydirect.distribution.kv78.domain.Kv78Packet;
import nl.crowndov.displaydirect.distribution.transport.TestTransport;
im... | Assert.assertEquals("31001017", record.get("TimingPointCode"));
Assert.assertEquals("INTERMEDIATE", record.get("JourneyStopType"));
Assert.assertEquals( "20:55:13", record.get("TargetArrivalTime"));
Assert.assertEquals( "20:55:13", record.get("TargetDepartureTime"));
Assert.asser... | ((TestTransport) TransportFactory.get()).registerListener((topic, data1) -> { | 3 |
hnakagawa/proton | Proton/src/main/java/proton/inject/internal/Element.java | [
"public class ProvisionException extends ProtonRuntimeException {\n private static final long serialVersionUID = 8834973331199731825L;\n\n public ProvisionException() {\n super();\n }\n\n public ProvisionException(String detailMessage, Throwable throwable) {\n super(detailMessage, throwabl... | import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import proton.inject.ProvisionException;
import proton.inject.binding.Binding;
import proton.inject.internal.Element.ElementField.E... | package proton.inject.internal;
/**
* @hide
*/
public class Element {
public final Class<?> clazz;
public final Binding<?> binding;
private int mIsAbstract = -1;
private Class<? extends Annotation> mScope;
private ElementConstructor mConstructor;
private ElementField[] mFields;
p... | mIsAbstract = InjectorUtils.isAbstract(clazz) ? 1 : 0; | 5 |
Darkhogg/LWJTorrent | examples/ReadTorrentFile.java | [
"public final class BencodeInputStream implements Closeable {\n\n private static final int INTEGER_VALUE = 'i';\n private static final int LIST_VALUE = 'l';\n private static final int DICTIONARY_VALUE = 'd';\n private static final int STRING_VALUE_FROM = '0';\n private static final int STRING_VALUE_T... | import java.io.IOException;
import java.util.List;
import es.darkhogg.torrent.bencode.BencodeInputStream;
import es.darkhogg.torrent.data.Sha1Hash;
import es.darkhogg.torrent.data.TorrentFileInfo;
import es.darkhogg.torrent.data.TorrentInfoSection;
import es.darkhogg.torrent.data.TorrentMetaInfo; |
/**
* Example main class that shows the loading of a torrent file.
* <p>
* This class will load and print a torrent file (<tt>example.torrent</tt>) using a <tt>BencodeInputStream</tt> to read
* a bencode value and pass it to {@link TorrentMetaInfo#fromValue}. Note that {@link TorrentMetaInfo#fromFile} allows
* y... | List<Sha1Hash> hashes = tis.getPieceHashes(); | 1 |
JanWiemer/jacis | src/main/java/org/jacis/store/JacisStore.java | [
"@JacisApi\npublic class JacisContainer {\n\n /** {@link JacisTransactionAdapter} to bind the Jacis Store to externally managed transactions. */\n private final JacisTransactionAdapter txAdapter;\n /** Map assigning the stores (values of type {@link JacisStoreImpl}) to the store identifiers (keys of type {@link ... | import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
import org.jacis.JacisApi;
import org.jacis.contain... | /*
* Copyright (c) 2017. Jan Wiemer
*/
package org.jacis.store;
/**
* Storing a single type of objects.
*
* All operations checking or returning entries of the store operate on the committed values merged with the
* current transactional view (obtained with the currently active transaction handle... | void checkStale(K key) throws JacisStaleObjectException;
| 2 |
enguerrand/xdat | src/main/java/org/xdat/gui/panels/DataSheetTablePanel.java | [
"public class Main extends JFrame {\n\tpublic static final long serialVersionUID = 10L;\n\tprivate MainMenuBar mainMenuBar;\n\tprivate Session currentSession;\n\tprivate List<ChartFrame> chartFrames = new LinkedList<>();\n\tprivate final BuildProperties buildProperties;\n\tprivate final ClusterFactory clusterFactor... | import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableColumn;
import java.awt.GridLayout;
import java.util.List;
import org.xdat.Main;
import org.xdat.data.DataSheet;
import org.xdat.gui.tables.DataSh... | /*
* Copyright 2014, Enguerrand de Rochefort
*
* This file is part of xdat.
*
* xdat 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 v... | DataTableCellEditor cellEditor = new DataTableCellEditor(); | 4 |
yunnet/kafkaEagle | src/main/java/org/smartloli/kafka/eagle/web/service/impl/OffsetServiceImpl.java | [
"public class OffsetDomain {\n\n\tprivate int partition;\n\tprivate long logSize;\n\tprivate long offset;\n\tprivate long lag;\n\tprivate String owner;\n\tprivate String create;\n\tprivate String modify;\n\n\tpublic int getPartition() {\n\t\treturn partition;\n\t}\n\n\tpublic void setPartition(int partition) {\n\t\... | import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.smartloli.kafka.eagle.common.domain.OffsetDomain;
import org.smartloli.kafka... | /**
* 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... | JSONArray kafkaOffsets = JSON.parseArray(RpcClient.getOffset(clusterAlias)); | 7 |
evanchsa/instrumentj | src/main/java/instrumentj/probes/impl/StatefulMethodProbe.java | [
"public interface CallStack {\n\n /**\n * Represents an entry in a call stack\n *\n * @author Stephen Evanchik (evanchsa@gmail.com)\n *\n */\n interface Entry {\n\n /**\n * Determines if this call stack entry is about to exit\n *\n * @return {@code true} if t... | import instrumentj.CallStack;
import instrumentj.StaticProfilerInterface;
import instrumentj.probes.MethodEntryProbe;
import instrumentj.probes.MethodExitProbe;
import instrumentj.probes.Probe; | /*
* 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 distribute... | final CallStack.Entry stack = StaticProfilerInterface.INSTANCE.getProfiler().peek(); | 1 |
dmfs/xmlobjects | src/org/dmfs/xmlobjects/builder/UriObjectBuilder.java | [
"public final class ElementDescriptor<T>\n{\n\tpublic final static XmlContext DEFAULT_CONTEXT = new XmlContext()\n\t{\n\t};\n\n\t/**\n\t * The {@link QualifiedName} of this element.\n\t */\n\tpublic final QualifiedName qualifiedName;\n\n\t/**\n\t * An {@link IObjectBuilder} for elements of this type.\n\t */\n\tpubl... | import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.dmfs.xmlobjects.ElementDescriptor;
import org.dmfs.xmlobjects.pull.ParserContext;
import org.dmfs.xmlobjects.pull.XmlObjectPullParserException;
import org.dmfs.xmlobjects.serializer.SerializerContext;
import org.dmfs.xmlobje... | /*
* Copyright (C) 2014 Marten Gajda <marten@dmfs.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... | public URI update(ElementDescriptor<URI> descriptor, URI object, String text, ParserContext context) throws XmlObjectPullParserException | 1 |
mslosarz/nextrtc-signaling-server | src/main/java/org/nextrtc/signalingserver/domain/EventContext.java | [
"public enum NextRTCEvents {\n SESSION_OPENED,\n SESSION_CLOSED,\n CONVERSATION_CREATED,\n CONVERSATION_DESTROYED,\n UNEXPECTED_SITUATION,\n MEMBER_JOINED,\n MEMBER_LEFT,\n MEDIA_LOCAL_STREAM_REQUESTED,\n MEDIA_LOCAL_STREAM_CREATED,\n MEDIA_STREAMING,\n TEXT,\n MESSAGE;\n\n pu... | import com.google.common.collect.Maps;
import org.nextrtc.signalingserver.api.NextRTCEvents;
import org.nextrtc.signalingserver.api.dto.NextRTCConversation;
import org.nextrtc.signalingserver.api.dto.NextRTCEvent;
import org.nextrtc.signalingserver.api.dto.NextRTCMember;
import org.nextrtc.signalingserver.exception.Sig... | package org.nextrtc.signalingserver.domain;
public class EventContext implements NextRTCEvent {
private final NextRTCEvents type;
private final ZonedDateTime published = ZonedDateTime.now();
private final Map<String, String> custom = Maps.newHashMap(); | private final NextRTCMember from; | 3 |
fabioz/eclipse.spellchecker | src/eclipse/spellchecker/SpellCheckEngine.java | [
"public class DefaultSpellChecker implements ISpellChecker {\n\n\t/** Array of URL prefixes */\n\tpublic static final String[] URL_PREFIXES= new String[] { \"http://\", \"https://\", \"www.\", \"ftp://\", \"ftps://\", \"news://\", \"mailto://\" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5... | import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import java.util.Ma... | /*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, an... | private ISpellChecker fChecker= null; | 2 |
tliron/scripturian | components/scripturian/source/com/threecrickets/scripturian/adapter/PegdownAdapter.java | [
"public class Executable\n{\n\t//\n\t// Constants\n\t//\n\n\t/**\n\t * Prefix prepended to on-the-fly scriptlets stored in the document source.\n\t */\n\tpublic static final String ON_THE_FLY_PREFIX = \"_ON_THE_FLY_\";\n\n\t//\n\t// Static operations\n\t//\n\n\t/**\n\t * If the executable does not yet exist in the ... | import java.util.Arrays;
import org.pegdown.PegDownProcessor;
import com.threecrickets.scripturian.Executable;
import com.threecrickets.scripturian.LanguageAdapter;
import com.threecrickets.scripturian.Program;
import com.threecrickets.scripturian.exception.LanguageAdapterException;
import com.threecrickets.scripturian... | /**
* 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 Program createProgram( String sourceCode, boolean isScriptlet, int position, int startLineNumber, int startColumnNumber, Executable executable ) throws ParsingException | 4 |
softwarespartan/TWS | src/apidemo/TicketDlg.java | [
"public class HtmlButton extends JLabel {\n\tstatic Color light = new Color( 220, 220, 220);\n\t\n\tprivate String m_text;\n\tprotected boolean m_selected;\n\tprivate ActionListener m_al;\n\tprivate Color m_bg = getBackground();\n\n\tpublic boolean isSelected() { return m_selected; }\n\t\n\tpublic void setSelected(... | import static com.ib.controller.Formats.fmt;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.Box;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
imp... | }
});
}
@Override public void orderStatus(OrderStatus status, int filled, int remaining, double avgFillPrice, long permId, int parentId, double lastFillPrice, int clientId, String whyHeld) {
}
});
m_order.whatIf( false);
m_order.orderId( 0);
}
protected void displayMargin(NewOrderState ord... | class MiscTicketPanel extends StackPanel { | 7 |
vineey/archelix-rsql | rsql-querydsl-parent/rsql-querydsl-filter/src/test/java/com/github/vineey/rql/querydsl/filter/QuerydslFilterBuilder_EnumPath_Test.java | [
"public class DefaultFilterParser implements FilterParser {\n private RSQLParser rsqlParser;\n\n public DefaultFilterParser() {\n rsqlParser = new RSQLParser(QRSQLOperators.getOperators());\n }\n\n @Override\n public <T, E extends FilterParam> T parse(String rqlFilter, FilterContext<T, E> filt... | import com.github.vineey.rql.filter.parser.DefaultFilterParser;
import com.github.vineey.rql.filter.parser.FilterParser;
import com.github.vineey.rql.querydsl.filter.util.RSQLUtil;
import com.github.vineey.rql.querydsl.util.PathTestUtil;
import com.google.common.collect.Maps;
import com.querydsl.core.types.Ops;
import ... | /*
* MIT License
*
* Copyright (c) 2016 John Michael Vincent S. Rustia
*
* 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,... | assertEquals(PathTestUtil.pathArg(argument, argument2), booleanOperation.getArg(1).toString()); | 3 |
holmari/gerritstats | GerritStats/src/main/java/com/holmsted/gerrit/processors/perperson/PerPersonDataProcessor.java | [
"public class Commit {\n private static final long SEC_TO_MSEC = 1000;\n\n public final String project;\n public final String branch;\n public final String id;\n public final int commitNumber;\n public final String subject;\n public final Identity owner;\n public final String url;\n publi... | import com.holmsted.gerrit.Commit;
import com.holmsted.gerrit.Commit.Identity;
import com.holmsted.gerrit.CommitFilter;
import com.holmsted.gerrit.OutputRules;
import com.holmsted.gerrit.QueryData;
import com.holmsted.gerrit.processors.CommitDataProcessor;
import com.holmsted.gerrit.processors.CommitVisitor;
import jav... | package com.holmsted.gerrit.processors.perperson;
public class PerPersonDataProcessor extends CommitDataProcessor<PerPersonData> {
private final PerPersonData records = new PerPersonData();
public PerPersonDataProcessor(@Nonnull CommitFilter filter, @Nonnull OutputRules outputRules) {
super(filter... | for (Commit.Identity identity : commit.reviewers) { | 1 |
Polidea/state-machine-android | statemachine-sample/src/main/java/com/polidea/statemachine/sample/di/ApplicationComponent.java | [
"public class LoginStateableHandler extends BaseStateableHandler<LoginProvider, LoginActionInterface> implements LoginProvider, LoginActionInterface {\n\n @Inject\n Bus bus;\n\n private final LoginActivity mainActivity;\n\n protected LoginStateableHandler(LoginActivity mainActivity) {\n super(mai... | import android.app.Application;
import com.polidea.statemachine.sample.LoginStateableHandler;
import com.polidea.statemachine.sample.fragment.LoginFragment;
import com.polidea.statemachine.sample.fragment.NotLoggedInFragment;
import com.polidea.statemachine.sample.state.LoginInitialState;
import com.polidea.statemachin... | package com.polidea.statemachine.sample.di;
@Singleton
@Component(modules = {MainModule.class})
public interface ApplicationComponent {
void inject(NotLoggedInFragment notLoggedInFragment);
void inject(LoginInitialState loginInitialState);
| void inject(LoginFragment loginFragment); | 1 |
vector-im/riot-automated-tests | VectorMobileTests/src/test/java/mobilestests_ios/RiotVoipTests.java | [
"public class RiotCallingPageObjects extends TestUtilities{\n\tprivate IOSDriver<MobileElement> driver;\n\tpublic RiotCallingPageObjects(AppiumDriver<MobileElement> myDriver){\n\t\tdriver= (IOSDriver<MobileElement>) myDriver;\n\t\tPageFactory.initElements(new AppiumFieldDecorator(driver), this);\n\t\ttry {\n\t\t\tw... | import java.io.FileNotFoundException;
import org.testng.Assert;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import com.esotericsoftware.yamlbeans.YamlException;
import io.appium.java_client.MobileElement;
import pom_ios.RiotCallingPageObjects;... | package mobilestests_ios;
@Listeners({ ScreenshotUtility.class })
public class RiotVoipTests extends RiotParentTest{
private String roomNameTest="1:1_voip_automated_tests";
private String conferenceRoomTest="voip_conference_automated_tests";
private String unwantedRoomTest="VoIP Conference";
private String rio... | RiotHomePageTabObjects homePage = new RiotHomePageTabObjects(appiumFactory.getiOsDriver1()); | 3 |
vector-im/riot-automated-tests | VectorMobileTests/src/test/java/mobilestests_android/RiotRoomInvitationTests.java | [
"public class RiotRoomPageObjects extends TestUtilities{\n\tprivate AndroidDriver<MobileElement> driver;\n\tpublic RiotRoomPageObjects(AppiumDriver<MobileElement> myDriver) {\n\t\tPageFactory.initElements(new AppiumFieldDecorator(myDriver), this);\n\t\tdriver=(AndroidDriver<MobileElement>) myDriver;\n\t\t//Explicit... | import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.Method;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeGroups;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
import com.esotericsoftware.yam... | package mobilestests_android;
@Listeners({ ScreenshotUtility.class })
public class RiotRoomInvitationTests extends RiotParentTest{
private String roomId="!WnWDyMPdDkzMLHuGXK%3Amatrix.org";
private String roomIdCustomHs="!AoVlZJKRJGotpMJqYg%3Ajeangb.org";
String riotUserDisplayName="riotuser16";
String riotIn... | RiotRoomPageObjects newRoom = new RiotRoomPageObjects(appiumFactory.getAndroidDriver1()); | 0 |
d-plaindoux/suitcase | src/main/java/org/smallibs/suitcase/cases/core/Case2.java | [
"public interface Case<T, R> {\n\n Optional<R> unapply(T t);\n\n interface WithoutCapture<T, R> extends Case<T, Result.WithoutCapture<R>> {\n static <T, R> WithoutCapture<T, R> adapt(Case<T, Result.WithoutCapture<R>> aCase) {\n return aCase::unapply;\n }\n }\n\n interface WithCa... | import org.smallibs.suitcase.cases.Case;
import org.smallibs.suitcase.cases.Case.WithCapture;
import org.smallibs.suitcase.cases.Case.WithoutCapture;
import org.smallibs.suitcase.utils.Functions.Function2;
import org.smallibs.suitcase.utils.Pair;
import java.util.Optional;
import java.util.function.Function;
import sta... | /*
* Copyright (C)2015 D. Plaindoux.
*
* This program 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, or (at your option) any
* later version.
*
* This program is distributed i... | private final Function2<C1, C2, C> combination; | 3 |
googlearchive/androidtv-Leanback | app/src/main/java/com/example/android/tvleanback/ui/VideoDetailsFragment.java | [
"public final class VideoContract {\n\n // The name for the entire content provider.\n public static final String CONTENT_AUTHORITY = \"com.example.android.tvleanback\";\n\n // Base of all URIs that will be used to contact the content provider.\n public static final Uri BASE_CONTENT_URI = Uri.parse(\"co... | import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Bundle;
import androidx.leanba... | /*
* Copyright (c) 2014 The Android Open Source 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
*
* Unless required by app... | new FullWidthDetailsOverviewRowPresenter(new DetailsDescriptionPresenter(), | 4 |
mikolajmitura/java-properties-to-json | src/test/java/pl/jalokim/propertiestojson/util/PropertiesToJsonParsePropertiesExceptionTest.java | [
"public static final String PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE = \"Unsupported property key type: %s for key: %s, Property key needs to be a string type\";",
"public static final String STRING_RESOLVER_AS_NOT_LAST = \"Added some type resolver after \" + StringJsonTypeResolver.class.getCanonicalName()\n + \".... | import static junit.framework.TestCase.fail;
import static org.assertj.core.api.Assertions.assertThat;
import static pl.jalokim.propertiestojson.util.exception.ParsePropertiesException.PROPERTY_KEY_NEEDS_TO_BE_STRING_TYPE;
import static pl.jalokim.propertiestojson.util.exception.ParsePropertiesException.STRING_RESOLVER... | package pl.jalokim.propertiestojson.util;
public class PropertiesToJsonParsePropertiesExceptionTest {
@Rule
public ExpectedException expectedEx = ExpectedException.none();
public static void setUpMockPickupKeysOrder(PropertiesToJsonConverter converter, String... keys) {
PropertyKeysOrderResolve... | expectedEx.expectMessage(STRING_RESOLVER_AS_NOT_LAST); | 1 |
asher-stern/CRF | src/main/java/com/asher_stern/crf/postagging/postaggers/crf/CrfPosTaggerTrainer.java | [
"public class CrfModel<K,G> implements Serializable // K = token, G = tag\n{\n\tprivate static final long serialVersionUID = -5703467522848303660L;\n\t\n\tpublic CrfModel(CrfTags<G> crfTags, CrfFeaturesAndFilters<K, G> features, ArrayList<BigDecimal> parameters)\n\t{\n\t\tsuper();\n\t\tthis.crfTags = crfTags;\n\t\t... | import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
impor... | package com.asher_stern.crf.postagging.postaggers.crf;
/**
* A {@link PosTaggerTrainer} which creates a {@link CrfPosTagger}. Training and inference are performed by the CRF algorithm.
*
* @author Asher Stern
* Date: Nov 10, 2014
*
*/
public class CrfPosTaggerTrainer implements PosTaggerTrainer<List<? exte... | CrfModel<String, String> crfModel = crfTrainer.getLearnedModel(); | 0 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/controller/RandomContentController.java | [
"public abstract class BenihController<P extends BenihController.Presenter>\n{\n protected P presenter;\n\n public BenihController(P presenter)\n {\n this.presenter = presenter;\n Timber.tag(getClass().getSimpleName());\n }\n\n public abstract void saveState(Bundle bundle);\n\n publi... | import rx.Observable;
import timber.log.Timber;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
import id.zelory.benih.controller.BenihController;
import id.zelory.benih.util.BenihScheduler;
import id.zelory.benih.util.BenihUtils;
import id.zelory.codepolitan.controller.event.ErrorEvent;
im... | /*
* Copyright (c) 2015 Zelory.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | private Tag tag; | 6 |
ZonCon/Ecommerce-Retronight-Android | app/src/main/java/com/megotechnologies/ecommerce_retronight/account/FragmentShippingInfo.java | [
"public class FragmentMeta extends Fragment{\n\n\tprotected View v;\n\tprotected MainActivity activity;\n\tprotected DbConnection dbC;\n\tprotected Boolean LOCATION_SELECTED = false;\n\tprotected Boolean IS_SIGNEDIN = false;\n\tprotected Boolean IS_CLICKED = false;\n\n\t@Override\n\tpublic void onCreate(Bundle save... | import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.T... | package com.megotechnologies.ecommerce_retronight.account;
public class FragmentShippingInfo extends FragmentMeta implements ZCFragmentLifecycle, ZCRunnable {
Boolean RUN_FLAG = false;
Thread countryTh, stateTh, cityTh;
TextView tvName, tvPhone, tvTitle, tvAddress, tvPincode;
EditText editName, editPhone, edi... | if(!Validator.isValidPhone(editPhone.getText().toString())) { | 6 |
a-schild/nextcloud-java-api | src/test/java/org/aarboard/nextcloud/api/filesharing/FilesharingConnectorTest.java | [
"public class AuthenticationConfig {\n\n private String loginName;\n private String password;\n\n private String bearerToken;\n\n public AuthenticationConfig(String loginName, String password) {\n this.loginName = loginName;\n this.password = password;\n }\n\n public AuthenticationCo... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.time.LocalDate;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
... | /*
* Copyright (C) 2017 a.schild
*
* 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 distribut... | boolean result = instance.editShare(findShare(instance).get().getId(), ShareData.EXPIREDATE, "9999-01-01"); | 6 |
sdenier/GecoSI | src/test/net/gecosi/dataframe/Si11DataFrameTest.java | [
"public final static SiMessage sicard11_b0_data = new SiMessage(new byte[] {\n\t\t0x02, (byte) 0xEF, (byte) 0x83, 0x00, 0x01, 0x00, (byte) 0xB2, 0x23, (byte) 0xE1, (byte) 0x98, (byte) 0xEA, (byte) 0xEA, (byte) 0xEA,\n\t\t(byte) 0xEA, (byte) 0xEE, (byte) 0xEE, (byte) 0xEE, (byte) 0xEE, (byte) 0xEE, (byte) 0xEE, (byt... | import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static test.net.gecosi.SiMessageFixtures.sicard11_b0_data;
import static test.net.gecosi.SiMessageFixtures.sicard11_b4_data;
import static test.net.gecosi.SiMessageFixtures.sicard11_b5_data;
import static test.net.gecosi.... | /**
* Copyright (c) 2013 Simon Denier
*/
package test.net.gecosi.dataframe;
/**
* @author Simon Denier
* @since Apr 21, 2013
*
*/
public class Si11DataFrameTest {
@Test
public void getSiCardNumber() {
assertThat(subject9993810().getSiNumber(), equalTo("9993810"));
}
@Test
public void getSiCardSeries(... | assertThat(subject9993810().getStartTime(), equalTo(SiDataFrame.NO_TIME)); | 6 |
endercrest/VoidSpawn | src/main/java/com/endercrest/voidspawn/VoidListener.java | [
"public interface Detector extends OptionContainer {\n\n /**\n * Checks if the current player is within the 'detected' region. This is used to signal to the mode whether it\n * should activate\n * @param mode The current mode\n * @param player The player\n * @param world The world\n */\n ... | import com.endercrest.voidspawn.detectors.Detector;
import com.endercrest.voidspawn.modes.BaseMode;
import com.endercrest.voidspawn.modes.Mode;
import com.endercrest.voidspawn.options.Option;
import com.endercrest.voidspawn.utils.MessageUtil;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBui... | package com.endercrest.voidspawn;
/**
* Handles detecting if a player has entered the void & calls
* all the necessary executors.
*/
public class VoidListener implements Listener {
private final VoidSpawn plugin;
private final Cache<UUID, Instant> activationTracker = CacheBuilder.newBuilder()
... | Detector detector = DetectorManager.getInstance().getWorldDetector(worldName); | 0 |
lightcouch/LightCouch | src/main/java/org/lightcouch/Replication.java | [
"public static void assertNotEmpty(Object object, String prefix) throws IllegalArgumentException {\n\tif(object == null) {\n\t\tthrow new IllegalArgumentException(format(\"%s may not be null.\", prefix));\n\t} else if(object instanceof String && ((String)object).length() == 0) {\n\t\tthrow new IllegalArgumentExcept... | import com.google.gson.JsonObject;
import static org.lightcouch.CouchDbUtil.assertNotEmpty;
import static org.lightcouch.CouchDbUtil.close;
import static org.lightcouch.CouchDbUtil.getStream;
import static org.lightcouch.URIBuilder.buildUri;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.Map;
i... | /*
* Copyright (C) 2011 lightcouch.org
*
* 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 ... | final URI uri = buildUri(dbc.getBaseUri()).path("_replicate").build(); | 3 |
lumag/JBookReader | src/org/jbookreader/renderingengine/RenderingEngine.java | [
"public interface IBook {\n\n\t/**\n\t * Creates new body node with give tag and node names.\n\t * @param tagName the tag name\n\t * @param name the name of new body or null if it's main node.\n\t * @return new body node.\n\t */\n\tIContainerNode newBody(String tagName, String name);\n\n\t/**\n\t * Returns the main... | import org.jbookreader.formatengine.IFormatEngine;
import org.jbookreader.formatengine.IRenderingObject;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.WeakHashMap;
import org.jbookreader.book.bom.IBook;
import org.jbookreader.book.bom.IContainer... | /*
* JBookReader - Java FictionBook Reader
* Copyright (C) 2006 Dmitry Baryshkov
*
* 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 o... | IContainerNode pnode = node.getParentNode(); | 1 |
Apptitive/BanglaHadith | app/src/main/java/com/hadithbd/banglahadith/ui/HadithSectionListActivity.java | [
"public class HadithSectionListAdapter extends RecyclerView.Adapter<HadithSectionListAdapter.ViewHolder>\n implements View.OnClickListener {\n\n private String mHadithListPrefixText, mCountSuffix;\n private List<HadithBookSectionInfo> mHadithBookSectionInfoList;\n\n private HadithSectionItemClickLis... | import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import com.hadithbd.banglahadith.R;
import com.hadithbd.banglahadith.adapters.HadithSectionListAda... | package com.hadithbd.banglahadith.ui;
public class HadithSectionListActivity extends BaseActivity
implements HadithSectionListAdapter.HadithSectionItemClickListener {
public static final String TAG = HadithSectionListActivity.class.getSimpleName();
private static final int NUMBER_OF_COLUMNS = 2;
... | mBookId = data.getInt(Constants.BOOK_ID); | 3 |
PreibischLab/BigStitcher | src/main/java/net/preibisch/stitcher/headless/registration/TestGlobalOptTwoRound.java | [
"public class PairwiseStitchingParameters\n{\n\tpublic double minOverlap;\n\tpublic int peaksToCheck;\n\tpublic boolean doSubpixel;\n\tpublic boolean interpolateCrossCorrelation;\n\tpublic boolean showExpertGrouping;\n\tpublic boolean useWholeImage;\n\tpublic boolean manualNumTasks;\n\tpublic int numTasks;\n\n\tpub... | import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import ij.ImageJ;
import mpicbg.models.AbstractModel;
import mpicbg.models.TranslationModel3D;
import mpicbg.spim.data.generic.sequence.BasicViewDescription;
import mpicbg.spim.data.generic.sequence.BasicViewSetup;... | /*-
* #%L
* Multiview stitching of large datasets.
* %%
* Copyright (C) 2016 - 2021 Big Stitcher developers.
* %%
* 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
... | final SpimData2 spimData = FractalSpimDataGenerator.createVirtualSpimData(); | 4 |
loganj/foursquared | main/src/com/joelapenna/foursquared/TipActivity.java | [
"public class Foursquare {\n private static final Logger LOG = Logger.getLogger(\"com.joelapenna.foursquare\");\n public static final boolean DEBUG = true;\n public static final boolean PARSER_DEBUG = false;\n\n public static final String FOURSQUARE_API_DOMAIN = \"api.foursquare.com\";\n\n public sta... | import com.joelapenna.foursquare.Foursquare;
import com.joelapenna.foursquare.types.Tip;
import com.joelapenna.foursquare.types.User;
import com.joelapenna.foursquare.types.Venue;
import com.joelapenna.foursquared.util.RemoteResourceManager;
import com.joelapenna.foursquared.util.StringFormatters;
import com.joelapenna... | /**
* Copyright 2010 Mark Wyszomierski
*/
package com.joelapenna.foursquared;
/**
* Shows actions available for a tip:
*
* <ul>
* <li>Add to my to-do list</li>
* <li>I've done this!</li>
* </ul>
*
* The foursquare API doesn't tell us whether we've already marked a tip as
* to-do or already done, s... | StringFormatters.getUserFullName(mStateHolder.getTip().getUser())); | 4 |
MMAUG/FloodInfo | app/src/main/java/org/mmaug/InfoCenter/activities/ContactsActivity.java | [
"public class ContactAdapter extends BaseAdapter<BaseAdapter.BaseViewHolder> {\n\n public static final int CONTENT_VIEW_TYPE = 100;\n public static final int FOOTER_VIEW_TYPE = 101;\n\n private List<Contact> mContacts = new ArrayList<>();\n private boolean hideFooter;\n private Context mContext;\n\n public Co... | import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView.Adapter;
import android.support.v7.widget.RecyclerView.ItemDecoration;
import android.util.Log;
import a... | package org.mmaug.InfoCenter.activities;
/**
* @author SH (swanhtet@nexlabs.co)
*/
public class ContactsActivity extends BaseListActivity {
private static final String LIST_STATE_FRAGEMENT = "org.mmaug.InfoCenter.activitites.infocenter";
private static final String CONTACT_FILE = "contacts.dat";
ArrayList<Co... | private ContactAdapter mAdapter = null; | 0 |
VisualDataWeb/OWL2VOWL | src/main/java/de/uni_stuttgart/vis/vowl/owl2vowl/parser/vowl/classes/HasKeyAxiomParser.java | [
"public enum VowlAttribute {\n\tINTERSECTION(\"intersection\"),\n\tOBJECT(\"object\"),\n\tDEPRECATED(\"deprecated\"),\n\tEXTERNAL(\"external\"),\n\tRDF(\"rdf\"),\n\tUNION(\"union\"),\n\tCOMPLEMENT(\"complement\"),\n\tDATATYPE(\"datatype\"),\n\tTRANSITIVE(\"transitive\"),\n\tFUNCTIONAL(\"functional\"),\n\tINVERSE_FU... | import de.uni_stuttgart.vis.vowl.owl2vowl.constants.VowlAttribute;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.data.VowlData;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.entities.nodes.classes.AbstractClass;
import de.uni_stuttgart.vis.vowl.owl2vowl.model.entities.properties.VowlDatatypeProperty;
import de.uni_... | package de.uni_stuttgart.vis.vowl.owl2vowl.parser.vowl.classes;
public class HasKeyAxiomParser {
private static final Logger logger = LogManager.getLogger(HasKeyAxiomParser.class);
public static void parse(OWLOntology ontology, OWLClass owlClass, VowlData vowlData) {
for (OWLHasKeyAxiom owlHasKeyAxiom : ontol... | property.addAttribute(VowlAttribute.KEY); | 0 |
Justice-love/tiger | tiger/src/main/java/org/eddy/tiger/TigerBeanImpl.java | [
"public class AnnotatedTypeImpl<X> implements AnnotatedType<X> {\n\n\tprivate Class<X> beanClass;\n\tprivate Set<AnnotatedField<? super X>> annotatedFields = new HashSet<>();\n\tprivate Set<AnnotatedConstructor<X>> annotatedConstructors = new HashSet<>();\n\tprivate Set<AnnotatedMethod<? super X>> annotatedMethods ... | import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.HashSet;
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.AnnotatedConstructor;
import ... | /**
*
* @creatTime 上午8:53:16
* @author Eddy
*/
package org.eddy.tiger;
/**
* @author Eddy
*
*/
@SuppressWarnings("all")
public class TigerBeanImpl<T> implements TigerBean<T> {
private Class<?> beanClass;
private String name;
private Class<? extends Annotation> scop;
private Set<Annotation> qualifiers;... | private Set<ConstructorInjectionPoint> constructorInjectionPoints; | 3 |
andrewoma/dexx | collection/src/test/java/com/github/andrewoma/dexx/collection/mutable/MutableHashSet.java | [
"public interface Builder<E, R> {\n @NotNull\n Builder<E, R> add(E element);\n\n @NotNull\n Builder<E, R> addAll(@NotNull Traversable<E> elements);\n\n @NotNull\n Builder<E, R> addAll(@NotNull java.lang.Iterable<E> elements);\n\n @NotNull\n Builder<E, R> addAll(@NotNull Iterator<E> iterator)... | import java.util.Iterator;
import com.github.andrewoma.dexx.collection.Builder;
import com.github.andrewoma.dexx.collection.BuilderFactory;
import com.github.andrewoma.dexx.collection.Set;
import com.github.andrewoma.dexx.collection.internal.base.AbstractSet;
import com.github.andrewoma.dexx.collection.internal.builder... | /*
* Copyright (c) 2014 Andrew O'Malley
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, pub... | public Builder<A, Set<A>> newBuilder() { | 0 |
teivah/TIBreview | src/test/java/com/tibco/exchange/tibreview/processor/resourcerule/CProcessorJMSJNDIFullTest.java | [
"public class TIBResource {\n\tprivate String filePath;\n\tprivate String type;\n\t\n\tprivate static final String REQUEST_GET_TYPE = \"/jndi:namedResource/@type\";\n\t\n\tpublic TIBResource(String filePath) throws Exception {\n\t\tthis.filePath = filePath;\n\t\tthis.type = Util.xpathEval(filePath, Constants.RESOUR... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.junit.Test;
import com.tibco.exchange.tibreview.common.TIBResource;
import com.tibco.exchange.tibreview.engine.Context;
import com.tibco.exchange.tibreview.mod... | package com.tibco.exchange.tibreview.processor.resourcerule;
public class CProcessorJMSJNDIFullTest {
private static final Logger LOGGER = Logger.getLogger(CProcessorJMSJNDIFullTest.class);
@Test
public void testCProcessorJMSJNDIFullTest() {
TIBResource fileresource;
try {
fileresource = ... | Resource resource = tibrules.getResource();
| 4 |
DevotedMC/ExilePearl | src/main/java/com/devotedmc/ExilePearl/command/CmdDowngrade.java | [
"public interface ExilePearl {\n\n\t/**\n\t * Gets the pearl item name\n\t * @return The item name\n\t */\n\tString getItemName();\n\n\t/**\n\t * Gets the exiled player ID\n\t * @return The player ID\n\t */\n\tUUID getPlayerId();\n\n\t/**\n\t * Gets the unique pearl ID\n\t * @return The pearl ID\n\t */\n\tint getPe... | import com.devotedmc.ExilePearl.ExilePearl;
import com.devotedmc.ExilePearl.ExilePearlApi;
import com.devotedmc.ExilePearl.Lang;
import com.devotedmc.ExilePearl.PearlType;
import com.devotedmc.ExilePearl.util.SpawnUtil; | package com.devotedmc.ExilePearl.command;
/**
* Downgrades the Prison Pearl in senders main hand
*/
public class CmdDowngrade extends PearlCommand {
public CmdDowngrade(ExilePearlApi pearlApi) {
super(pearlApi);
this.aliases.add("downgrade");
this.helpShort = "Downgrades a Prison Pearl";
this.senderMustBe... | msg(Lang.pearlMustBeHoldingPearl); | 2 |
Xiaofei-it/Shelly | shelly/src/test/java/xiaofei/library/shelly/domino/Test06.java | [
"public class Shelly {\n\n private static final TargetCenter TARGET_CENTER = TargetCenter.getInstance();\n\n private static final DominoCenter DOMINO_CENTER = DominoCenter.getInstance();\n\n public static void register(Object object) {\n TARGET_CENTER.register(object);\n }\n\n public static bo... | import org.junit.Test;
import java.util.concurrent.TimeUnit;
import xiaofei.library.shelly.Shelly;
import xiaofei.library.shelly.function.Action0;
import xiaofei.library.shelly.function.Action1;
import xiaofei.library.shelly.function.TargetAction0;
import xiaofei.library.shelly.function.TargetAction1;
import xiaofei.li... | /**
*
* Copyright 2016 Xiaofei
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in w... | Shelly.register(new A()); | 0 |
kaklakariada/portmapper | src/main/java/org/chris/portmapper/gui/EditPresetDialog.java | [
"public class PortMapperApp extends SingleFrameApplication {\n\n /**\n * The name of the system property which will be used as the directory where all configuration files will be stored.\n */\n private static final String CONFIG_DIR_PROPERTY_NAME = \"portmapper.config.dir\";\n\n /**\n * The fil... | import java.awt.Component;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.beans.PropertyChangeSupport;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import javax.swing.ActionMap;
import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor;
imp... | /**
* UPnP PortMapper - A tool for managing port forwardings via UPnP
* Copyright (C) 2015 Christoph Pirkl <christoph at users.sourceforge.net>
*
* 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 Founda... | private final transient PortMappingPreset editedPreset; | 3 |
nantaphop/AomYim-Pantip | app/src/main/java/com/nantaphop/pantipfanapp/fragment/ForumHolderFragment.java | [
"public class ShowcaseView extends RelativeLayout\n implements View.OnTouchListener, ShowcaseViewApi {\n\n private static final int HOLO_BLUE = Color.parseColor(\"#33B5E5\");\n\n private final Button mEndButton;\n private final TextDrawer textDrawer;\n private final ShowcaseDrawer showcaseDrawer;... | import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
im... | package com.nantaphop.pantipfanapp.fragment;
/**
* Created by nantaphop on 27-Jul-14.
*/
@EFragment(R.layout.fragment_forumholder)
public class ForumHolderFragment extends BaseFragment {
public static final String TAG = "fragmentHolder";
@ViewById
ViewPager viewPager;
@ViewById
PagerSlidin... | BaseApplication.getEventBus().post(new OpenForumRearrangeEvent()); | 1 |
KurodaAkira/RPG-Hud | src/main/java/net/spellcraftgaming/rpghud/gui/hud/HudFullTexture.java | [
"@Environment(EnvType.CLIENT)\npublic abstract class HudElement {\n\n /** The values of the color red */\n public static final int COLOR_RED = 0xC10000;\n\n /** The values of the color red */\n public static final int COLOR_PINK = 0xFF69B4;\n\n /** The values of the color red */\n public static fi... | import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.spellcraftgaming.rpghud.gui.hud.element.HudElement;
import net.spellcraftgaming.rpghud.gui.hud.element.texture.HudElementAirTexture;
import net.spellcraftgaming.rpghud.gui.hud.element.texture.Hu... | package net.spellcraftgaming.rpghud.gui.hud;
@Environment(EnvType.CLIENT)
public class HudFullTexture extends HudExtendedWidget {
public HudFullTexture(MinecraftClient mc, String hudKey, String hudName) {
super(mc, hudKey, hudName);
}
@Override
public HudElement setElementAir() {
return new HudElementAirTex... | return new HudElementExperienceTexture(); | 2 |
mechero/code-quality-game | sonar-connector/src/main/java/com/thepracticaldeveloper/devgame/modules/stats/service/SonarStatsServiceImpl.java | [
"public enum BadgeDetails {\n\n EARLY_BIRD(\"Early Bird\", \"You're an early adopter of the game\"),\n UNIT_TESTER_PAPER(\"Paper Unit Tester\", \"You covered legacy code with at least 1 Unit Test\"),\n UNIT_TESTER_BRONZE(\"Bronze Unit Tester\", \"You covered legacy code with at least 10 Unit Tests\"),\n ... | import com.thepracticaldeveloper.devgame.modules.badges.domain.BadgeDetails;
import com.thepracticaldeveloper.devgame.modules.badges.domain.SonarBadge;
import com.thepracticaldeveloper.devgame.modules.stats.domain.SeverityType;
import com.thepracticaldeveloper.devgame.modules.stats.domain.SonarStatsRow;
import com.thep... | package com.thepracticaldeveloper.devgame.modules.stats.service;
@Service
final class SonarStatsServiceImpl implements SonarStatsService {
private static final Log log = LogFactory.getLog(SonarStatsServiceImpl.class);
private final UserMongoRepository userRepository;
private final ScoreCardMongoReposit... | final Stream<User> users = userRepository.findAllUsersWithTeam(); | 7 |
Sigimera/sigimera-android-app | src/org/sigimera/app/android/ProfileFragment.java | [
"public class ApplicationController {\n\tpublic static ApplicationController instance = null;\n\t\n\tprivate SessionHandler sessionHandler;\n\t\n\tprivate Context context;\n\tprivate SharedPreferences settings;\n\tprivate PersistentStorage pershandler;\n\tprivate ActionBar actionBar;\n\t\n\tprivate boolean updating... | import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import org.sigimera.app.android.controller.ApplicationController;
import org.sigimera.app.android.controller.LocationController;
import org.sigimera.app.android.controller.PersistanceController;
import or... |
TextView name = (TextView) view.findViewById(R.id.name);
name.setText(Html.fromHtml(content.toString()));
TextView images = (TextView) view.findViewById(R.id.images);
images.setText(Html.fromHtml("<p><b>" + stats.getUploadedImages()
+ "</b><br/><small>Images</small></p>"));
TextView locations = (... | LocationController.getInstance().getLastKnownLocation()); | 1 |
NickToony/scrAI | src/main/java/com/nicktoony/scrAI/World/Tasks/TaskBuild.java | [
"@GlobalScope\npublic class Constants {\n public static int TIER_LOW = 1;\n public static int TIER_MEDIUM = 2;\n public static int TIER_HIGH = 3;\n\n public static int ALERT_STATUS_CRITICAL = 1; // 100% military, 0% economy\n public static int ALERT_STATUS_HIGH = 2; //\n public static int ALERT_ST... | import com.nicktoony.scrAI.Constants;
import com.nicktoony.scrAI.Controllers.RoomController;
import com.nicktoony.scrAI.World.Creeps.CreepWorker;
import com.nicktoony.screeps.ConstructionSite;
import com.nicktoony.screeps.Game;
import org.stjs.javascript.Global; | package com.nicktoony.scrAI.World.Tasks;
/**
* Created by nick on 02/08/15.
*/
public class TaskBuild extends Task {
protected ConstructionSite buildable;
private float progress = 0;
public TaskBuild(RoomController roomController, String associatedId, ConstructionSite buildable) {
super(roomCon... | return Math.round(Constants.PRIORITY_BUILD * progress); | 0 |
ReadyTalk/swt-bling | src/examples/java/com/readytalk/examples/swt/text/painter/TextPainterExample.java | [
"public interface SwtBlingExample {\n public void run(Display display, Shell shell);\n}",
"public class NavigationEvent {\n\t\n Hyperlink hyperlink;\n\t\n /**\n * Creates a NavigationEvent containing the given Hyperlink.\n */\n public NavigationEvent(Hyperlink hyperlink) {\n this.hyperlink = hyperlink;... | import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import com.readytalk.examples.swt.RunnableExample;
import com.readytalk.examples.swt.SwtBlingExample;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
... | package com.readytalk.examples.swt.text.painter;
public class TextPainterExample implements SwtBlingExample {
class TextCanvas extends Canvas {
Timer timer;
public TextCanvas(Composite parent, int style){
super(parent, style);
final TextCanvas textCanvasInstance = this;
timer = new Ti... | .addNavigationListener(new NavigationListener() { | 2 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/ListArticleActivity.java | [
"public abstract class BenihActivity extends RxAppCompatActivity\n{\n @Override\n protected void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(getActivityView());\n ButterKnife.bind(this);\n Timber.tag(getClass().getSimpleName());... | import id.zelory.codepolitan.ui.fragment.SearchArticlesFragment;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import butterknife.Bind;
import id.zelory.benih.BenihActivity;
import id.zelory.codepolitan.R;... | /*
* Copyright (c) 2015 Zelory.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | .replace(R.id.list_container, new OthersArticlesFragment()) | 5 |
RestNEXT/restnext | restnext-route/src/main/java/org/restnext/route/Route.java | [
"public static boolean isPathParamUri(final String uri) {\n return uri != null && PATH_PARAM_URI.matcher(uri).matches();\n}",
"public static String normalize(String uri) {\n return Optional.ofNullable(uri)\n .map(UriUtils::addFirstSlash)\n .map(UriUtils::removeLastSlash)\n .orElse(uri);\n}",
"p... | import org.restnext.core.url.UrlMatcher;
import org.restnext.core.url.UrlPattern;
import org.restnext.core.url.UrlRegex;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.restnext.util.UriUtils.isPathParamUri;
import static org.restnext.util.UriUtils.normalize;
import java.util.Arrays;
import j... | /*
* Copyright (C) 2016 Thiago Gutenberg Carvalho da Costa
*
* 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 final UrlMatcher urlMatcher; | 5 |
yammer/tenacity | tenacity-core/src/test/java/com/yammer/tenacity/tests/TenacityCircuitBreakerHealthCheckTest.java | [
"@JsonDeserialize(using = CircuitBreaker.Deserializer.class)\npublic class CircuitBreaker {\n public enum State {\n OPEN, CLOSED, FORCED_OPEN, FORCED_CLOSED,\n FORCED_RESET //Used to \"unset\" any FORCED state\n }\n\n public static class Deserializer extends StdDeserializer<CircuitBreaker> {\... | import com.codahale.metrics.health.HealthCheck;
import com.google.common.collect.ImmutableList;
import com.yammer.tenacity.core.core.CircuitBreaker;
import com.yammer.tenacity.core.core.CircuitBreakers;
import com.yammer.tenacity.core.healthcheck.TenacityCircuitBreakerHealthCheck;
import com.yammer.tenacity.core.proper... | package com.yammer.tenacity.tests;
public class TenacityCircuitBreakerHealthCheckTest {
@Rule
public final TenacityTestRule tenacityTestRule = new TenacityTestRule();
@Before
public void setup() {
TenacityPropertyRegister.setDefaultMetricsHealthSnapshotInterval(Duration.milliseconds(10));
... | assertThat(CircuitBreakers.all(DependencyKey.EXISTENT_HEALTHCHECK)).isEmpty(); | 1 |
WorldSEnder/MCAnm | src/main/java/com/github/worldsender/mcanm/common/animation/parts/AnimatedTransform.java | [
"public class Utils {\n\tprivate static CharsetDecoder utf8Decoder = Charset.forName(\"UTF-8\").newDecoder()\n\t\t\t.onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(CodingErrorAction.REPORT);\n\n\t/**\n\t * Helper method for extending classes to read a null-terminated String in the BMP-unicode plan... | import java.io.DataInputStream;
import java.io.IOException;
import javax.vecmath.Quat4f;
import javax.vecmath.Vector3f;
import com.github.worldsender.mcanm.common.Utils;
import com.github.worldsender.mcanm.common.animation.IAnimation.BoneTransformation;
import com.github.worldsender.mcanm.common.animation.StoredAnimati... | package com.github.worldsender.mcanm.common.animation.parts;
/**
* Represents the animation of one bone from the {@link StoredAnimation}.
*
* @author WorldSEnder
*/
public class AnimatedTransform {
public static class AnimatedTransformBuilder {
private final AnimatedValueBuilder builder = new AnimatedValueB... | Utils.fromRTS(r, t, s, transform.matrix); | 0 |
vtsukur/spring-rest-black-market | src/test/java/org/vtsukur/spring/rest/market/AdsHttpApiTests.java | [
"@Entity\n@Data\npublic class Ad implements Identifiable<Long> {\n\n @Id\n @GeneratedValue\n private Long id;\n\n @Column(nullable = false)\n @Enumerated(EnumType.STRING)\n private Type type;\n\n public enum Type {\n\n BUY,\n\n SELL\n\n }\n\n @Column(nullable = false)\n p... | import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.dat... | package org.vtsukur.spring.rest.market;
/**
* @author volodymyr.tsukur
*/
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class AdsHttpApiTests {
@Autowired
private MockMvc mockMvc;
@Autowired | private AdRepository adRepository; | 1 |
commonsguy/cwac-netsecurity | netsecurity/src/androidTest/java/com/commonsware/cwac/netsecurity/test/OkHttp3MemorizationTests.java | [
"public class CertificateNotMemorizedException extends MemorizationException {\n CertificateNotMemorizedException(X509Certificate[] chain, String host) {\n super(chain, host);\n }\n}",
"public class MemorizingTrustManager implements X509Extensions {\n private final File workingDir;\n private final char[] s... | import androidx.test.InstrumentationRegistry;
import androidx.test.runner.AndroidJUnit4;
import com.commonsware.cwac.netsecurity.CertificateNotMemorizedException;
import com.commonsware.cwac.netsecurity.MemorizingTrustManager;
import com.commonsware.cwac.netsecurity.OkHttp3Integrator;
import com.commonsware.cwac.netsec... | /***
Copyright (c) 2016 CommonsWare, 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 writing, so... | CertificateNotMemorizedException memoEx; | 0 |
mini2Dx/miniscript | core/src/main/java/org/mini2Dx/miniscript/core/GameScriptingEngine.java | [
"public class InsufficientCompilersException extends Exception {\n\tprivate static final long serialVersionUID = 2947579725300422095L;\n\n\tpublic InsufficientCompilersException() {\n\t\tsuper(\"There were insufficient compilers available to compile the provided script\");\n\t}\n}",
"public class NoSuchScriptExce... | import org.mini2Dx.miniscript.core.threadpool.DefaultThreadPoolProvider;
import org.mini2Dx.miniscript.core.util.*;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import ja... | public void cancelQueuedScript(int scriptId, boolean notifyListeners) {
final List<ScriptInvocation> scriptInvocations = new ArrayList<>();
scriptInvocationQueue.cancelByScriptId(scriptId, scriptInvocations);
if(!notifyListeners) {
scriptInvocations.clear();
return;
}
notifyScriptCancelled(scriptInvoc... | public int compileScript(String filepath, String scriptContent) throws InsufficientCompilersException { | 0 |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/integration/AMQPIntegrationTest.java | [
"public interface AMQPConsumerCallback {\n ActionResponse handle(AMQPMessageBundle messageBundle);\n void notifyOfActionFailure(Exception e);\n void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);\n}",
"public class AMQPMessageBundle implements TransportMessageBundle {\n private Str... | import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.consumer.Consumer;
import io.rtr.conduit.amqp.impl.AMQPConnection;
import io.rtr.conduit.amqp.publisher.Publisher;
import io.rtr.conduit.util.LoggingAmqpCallbackHandler;
import org.junit.jupiter.api... | package io.rtr.conduit.integration;
@Testcontainers
public class AMQPIntegrationTest {
@Container
private static final RabbitMQContainer RABBITMQ_CONTAINER = RabbitMQContainerFactory.createBrokerWithSingleExchangeAndQueue();
@Test
public void testSslAmqpTransport() { | AMQPMessageBundle message = new AMQPMessageBundle("a message"); | 1 |
ehanoc/xwallet | app/src/main/java/com/bytetobyte/xwallet/service/coin/bitcoin/BitcoinManager.java | [
"public class Constants {\n // public static final org.bitcoinj.core.NetworkParameters NETWORK_PARAMETERS = TestNet3Params.get();\n public static final org.bitcoinj.core.NetworkParameters NETWORK_PARAMETERS = MainNetParams.get();\n\n public static final char CHAR_HAIR_SPACE = '\\u200a';\n public static f... | import com.bytetobyte.xwallet.service.Constants;
import com.bytetobyte.xwallet.service.coin.CoinAction;
import com.bytetobyte.xwallet.service.coin.CoinManager;
import com.bytetobyte.xwallet.service.coin.CurrencyCoin;
import com.bytetobyte.xwallet.service.coin.bitcoin.actions.BitcoinRecoverAction;
import com.bytetobyte.... | */
@Override
public Date getMnemonicSeedCreationDate() {
DeterministicSeed seed = _coin.getWalletManager().wallet().getKeyChainSeed();
Date date = new Date();
date.setTime(seed.getCreationTimeSeconds() * 1000);
return date;
}
/**
*
* @param callback
... | public List<CoinTransaction> getTransactionList() { | 7 |
hashmapinc/witsml-client | src/main/java/com/hashmapinc/tempus/witsml/example/MyWitsmlClient.java | [
"public class LogRequestTracker extends AbstractRequestTracker{\n\n private WitsmlClient witsmlClient;\n private ZonedDateTime lastQueryTime = null;\n private ZonedDateTime lastLogTime = null;\n private String indexType = null;\n private double lastLogDepth = -1;\n private WitsmlVersionTransformer... | import com.hashmapinc.tempus.WitsmlObjects.v1311.*;
import com.hashmapinc.tempus.WitsmlObjects.v1411.CsGeologyInterval;
import com.hashmapinc.tempus.WitsmlObjects.v1411.CsLogData;
import com.hashmapinc.tempus.WitsmlObjects.v1411.CsTrajectoryStation;
import com.hashmapinc.tempus.WitsmlObjects.v1411.*;
import com.hashmap... | package com.hashmapinc.tempus.witsml.example;
public class MyWitsmlClient {
public static void main(String args[]){
Client c = new Client(args[0]);
c.setUserName(args[1]);
c.setPassword(args[2]);
c.setVersion(WitsmlVersion.VERSION_1411);
c.connect();
try {
... | LogRequestTracker tracker = new LogRequestTracker(); | 0 |
apack1001/Android-Monkey-Adapter | src/AndroidMonkeyRunningAdapter/src/com/github/monkey/runner/Main.java | [
"public final class DeviceConnectHelper implements IDebugBridgeChangeListener, IDeviceChangeListener{\n\tprivate List<IDevice> devices = Collections\n\t\t\t.synchronizedList(new ArrayList<IDevice>());\n\tprivate String id = null;\n\t\n\tpublic static void init(final String adbLocation) {\n\t\tAndroidDebugBridge.ini... | import com.android.ddmlib.AndroidDebugBridge;
import com.android.ddmlib.IDevice;
import com.github.monkey.runner.helper.DeviceConnectHelper;
import com.github.monkey.runner.scheduler.Console;
import com.github.monkey.runner.scheduler.MonkeyTestDevice;
import com.github.monkey.runner.scheduler.MonkeyTestDeviceFacto... | package com.github.monkey.runner;
public class Main {
public static void main(String[] args) {
String initFileName = "";
String rawCommand = "monkey --throttle 300 -c android.intent.category.MONKEY -c android.intent.category.LAUNCHER -c android.intent.category.DEFAULT --monitor-native-crashes --kill-proc... | MonkeyTestDevice monkeyTestDevice = MonkeyTestDeviceFactory
| 3 |
FacePlusPlus/MegviiFacepp-Android-SDK | faceppdemo/src/main/java/com/facepp/demo/facecompare/FaceCompareManager.java | [
"public class FeatureInfoSettingActivity extends Activity implements View.OnClickListener, AdapterView.OnItemClickListener {\n\n private ListView mListView;\n private TextView mCancleText, mSureText;\n private FeatureInfoAdapter mAdapter;\n private FaceActionInfo mFaceActionInfo;\n private DialogUtil... | import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.util.Log;
import android.widget.Toast;
import com.facepp.demo.FeatureInfoSettingActivity;
import com.facepp.demo.OpenglActivity;
import com.facepp.demo.bean.FaceActionInfo;
import ... |
public synchronized FeatureInfo compare(Facepp facepp, final byte[] target) {
double likeMax =0;
FeatureInfo infoBest=null;
for (FeatureInfo featureInfo : mFeatureData) {
if (featureInfo.isSelected) {
double like = facepp.faceCompare(featureIn... | public void startActivity(OpenglActivity activity, Facepp.Face[] faces, ICamera mICamera, byte[] carmeraImgData, boolean isBackCamera, FaceActionInfo faceActionInfo) { | 2 |
turn/camino | src/main/java/com/turn/camino/Camino.java | [
"public interface Function {\n\n\t/**\n\t * Invokes function with given parameters and context\n\t *\n\t * @param params actual parameters to function call\n\t * @param context context in which the function operates\n\t * @return return value of function\n\t * @throws FunctionCallException\n\t */\n\tObject invoke(L... | import com.google.common.collect.Lists;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import com.turn.camino.config.*;
import com.turn.camino.render.Function;
import com.turn.camino.render.RenderException;
import com.turn.camino.render.Renderer;
import com.turn.camino.render.TimeValue;... | /*
* Copyright (C) 2014-2018, Amobee Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... | Renderer renderer = env.getRenderer(); | 2 |
yassirh/digitalocean-swimmer | DigitalOceanSwimmer/src/main/java/com/yassirh/digitalocean/utils/MyBroadcastReceiver.java | [
"public class Account {\n\n\tprivate Long id;\n\tprivate String name;\n\tprivate String token;\n\tprivate String refreshToken;\n\tprivate Date expiresIn;\n\tprivate boolean selected;\n\t\n\tpublic Account() {\n\t}\n\t\n\tpublic Account(Long id, String name, String token, String refreshToken,\n\t\t\tDate expiresIn, ... | import java.util.Date;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.yassirh.digitalocean.model.Account;
import com.yassirh.digitalocean.service.AccountService;
import com.yassirh.digitalocean.service.DomainService;
import com.yassirh.digitalocean.se... | package com.yassirh.digitalocean.utils;
public class MyBroadcastReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Account currentAccount = ApiHelper.getCurrentAccount(context);
if(currentAccount == null){
return;
}
if(!ApiHelper.isValidToken(current... | ImageService imageService = new ImageService(context); | 5 |
MHAVLOVICK/Sketchy | src/main/java/com/sketchy/server/action/RenderImage.java | [
"public enum SketchyContext {\n\tINSTANCE;\n\t\n\tprivate static NumberFormat nf = NumberFormat.getInstance();\n\n\tpublic static final Map<String, String> PEN_SIZES = new LinkedHashMap<String, String>();\n\tstatic{\n\t\tnf.setMinimumIntegerDigits(1);\n\t\tnf.setMinimumFractionDigits(1);\n\t\t\n\t\tfor (double penS... | import java.io.File;
import javax.servlet.http.HttpServletRequest;
import com.sketchy.SketchyContext;
import com.sketchy.image.ImageAttributes;
import com.sketchy.image.ImageProcessingThread;
import com.sketchy.image.RenderedImageAttributes;
import com.sketchy.server.HttpServer;
import com.sketchy.server.JSONServletRes... | /*
Sketchy
Copyright (C) 2015 Matthew Havlovick
http://www.quickdrawbot.com
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 op... | JSONServletResult jsonServletResult = new JSONServletResult(Status.SUCCESS); | 7 |
Velli20/Tachograph | app/src/main/java/com/velli20/tachograph/database/DataBaseHandler.java | [
"public class App extends MultiDexApplication {\n private static App instance;\n\n public static App get() {\n return instance;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n instance = this;\n }\n\n @Override\n protected void attachBaseContext(Contex... | import com.velli20.tachograph.App;
import com.velli20.tachograph.Event;
import com.velli20.tachograph.collections.ListItemLogGroup;
import com.velli20.tachograph.database.GetLoggedRouteTask.OnGetLoggedRouteListener;
import com.velli20.tachograph.location.CustomLocation;
import java.util.ArrayList;
import static com.vel... | /*
*
* * MIT License
* *
* * Copyright (c) [2017] [velli20]
* *
* * 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 righ... | public void addNewEvent(Event event) { | 1 |
BennSandoval/Woodmin | app/src/main/java/app/bennsandoval/com/woodmin/fragments/ProductsFragment.java | [
"public class Woodmin extends Application {\n\n public final String LOG_TAG = Woodmin.class.getSimpleName();\n\n @Override\n public void onCreate() {\n super.onCreate();\n Fabric.with(this, new Crashlytics());\n\n Picasso.Builder picassoBuilder = new Picasso.Builder(getApplicationConte... | import android.app.SearchManager;
import android.app.SearchableInfo;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import an... | @Override
public boolean onOptionsItemSelected(MenuItem item) {
return super.onOptionsItemSelected(item);
}
@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
Log.d(LOG_TAG, "onCreateLoader");
String sortOrder = WoodminContract.ProductEntry.COLUMN_TITLE +... | Call<Products> call = ((Woodmin)getActivity().getApplication()).getWoocommerceApiHandler().getProducts(options); | 7 |
graywolf336/Jail | src/main/java/com/graywolf336/jail/listeners/MoveProtectionListener.java | [
"public class JailMain extends JavaPlugin {\n private CommandHandler cmdHand;\n private HandCuffManager hcm;\n private JailHandler jh;\n private JailIO io;\n private JailManager jm;\n private IJailPayManager jpm;\n private IJailStickManager jsm;\n private JailTimer jt;\n private JailVoteM... | import java.util.concurrent.TimeUnit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import com.graywolf336.jail.JailMain;
import com.graywolf336.jail.Util;
import com.graywolf336.jail.beans.Cach... | package com.graywolf336.jail.listeners;
public class MoveProtectionListener implements Listener {
private JailMain pl;
public MoveProtectionListener(JailMain plugin) {
this.pl = plugin;
}
@EventHandler(ignoreCancelled=true)
public void moveProtection(PlayerMoveEvent event) {
//... | if(pl.getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) { | 6 |
Appolica/Flubber | Flubber/flubber/src/main/java/com/appolica/flubber/animation/providers/Wobble.java | [
"public class AnimationBody implements Serializable {\n\n private boolean autoStart;\n\n private float force = 1f;\n private float damping = 0.7f;\n private float velocity = 0.7f;\n\n private float startX = 0f;\n private float endX = 0f;\n\n private float startY = 0f;\n private float endY = ... | import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.view.View;
import android.view.animation.LinearInterpolator;
import com.appolica.flubber.AnimationBody;
import com.appolica.flubber.Flubber;
imp... | package com.appolica.flubber.animation.providers;
public class Wobble extends BaseProvider {
@Override
public Animator createAnimationFor(AnimationBody animationBody, View view) {
initInterpolatorFor(animationBody);
return getAnimationFor(animationBody, view);
}
@Override
publi... | final float dX = DimensionUtils.dp2px(30); | 2 |
Baseform/Baseform-Epanet-Java-Library | src/org/addition/epanet/ui/ReportOptions.java | [
"public class ENToolkit2 {\n\n\n public static final int EN_INITVOLUME = 14;\n public static final int EN_MIXMODEL = 15;\n public static final int EN_MIXZONEVOL = 16;\n\n\n public static final int EN_DIAMETER = 0;\n public static final int EN_LENGTH = 1;\n public static final int EN_ROUGHNESS = 2;... | import java.io.*;
import java.util.logging.*;
import org.addition.epanet.msx.ENToolkit2;
import org.addition.epanet.util.ENException;
import org.addition.epanet.hydraulic.HydraulicSim;
import org.addition.epanet.msx.EpanetMSX;
import org.addition.epanet.network.Network;
import org.addition.epanet.network.PropertiesMap;... | /*
* Copyright (C) 2012 Addition, Lda. (addition at addition dot pt)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later ver... | JOptionPane.showMessageDialog(root, Utilities.getError(Integer.toString(en_ex.getCodeID())) + "\nCheck epanet.log for detailed error description", "Error", JOptionPane.OK_OPTION); | 8 |
BottleRocketStudios/Android-GroundControl | GroundControl/groundcontrol/src/androidTest/java/com/bottlerocketstudios/groundcontrol/test/integration/AgentCancellationTest.java | [
"public class AgentExecutor implements InactivityCleanupListener {\n\n private static final String TAG = AgentExecutor.class.getSimpleName();\n\n public static final String DEFAULT_AGENT_EXECUTOR_ID = \"<def>\";\n\n private static final ConcurrentHashMap<String, AgentExecutor> sAgentExecutorMap = new Concu... | import android.test.AndroidTestCase;
import com.bottlerocketstudios.groundcontrol.AgentExecutor;
import com.bottlerocketstudios.groundcontrol.test.TestUtils;
import com.bottlerocketstudios.groundcontrol.listener.AgentListener;
import com.bottlerocketstudios.groundcontrol.policy.AgentPolicy;
import com.bottlerocketstudi... | /*
* Copyright (c) 2016. Bottle Rocket 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 ... | TestUtils.safeSleep(5500); | 1 |
spotify/trickle | src/examples/java/com/spotify/trickle/example/Examples.java | [
"public class CallInfo {\n private final NodeInfo nodeInfo;\n private final List<ParameterValue<?>> parameterValues;\n\n public CallInfo(NodeInfo nodeInfo, List<ParameterValue<?>> parameterValues) {\n this.nodeInfo = checkNotNull(nodeInfo, \"nodeInfo\");\n this.parameterValues = ImmutableList.copyOf(parame... | import com.google.common.util.concurrent.ListenableFuture;
import com.spotify.trickle.CallInfo;
import com.spotify.trickle.Func0;
import com.spotify.trickle.Func1;
import com.spotify.trickle.Graph;
import com.spotify.trickle.GraphExecutionException;
import com.spotify.trickle.Input;
import com.spotify.trickle.Func2;
im... | package com.spotify.trickle.example;
/**
* This class contains examples of how to use Trickle for combining asynchronous calls.
*/
public class Examples {
public static final Input<String> NAME = Input.named("person name");
public static final Input<String> GREETING = Input.named("greeting");
public sta... | Func1<String, String> transformName = new Func1<String, String>() { | 2 |
vianneyfaivre/Persephone | src/main/java/re/vianneyfaiv/persephone/service/MetricsService.java | [
"@Configuration\npublic class RestTemplateFactory {\n\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(RestTemplateFactory.class);\n\n\t// Spring\n\n\t@Autowired\n\tprivate ApplicationContext applicationContext;\n\n\t@Autowired\n\tprivate ConfigurableListableBeanFactory registry;\n\n\t// Persephone R... | import java.time.Duration;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org... | mc = new MetricsCache(cacheName);
metricsCache.put(cacheName, mc);
}
if("miss".equals(ratioType)) {
mc.setMissRatio(cacheMetric.getValue().doubleValue());
} else if("hit".equals(ratioType)) {
mc.setHitRatio(cacheMetric.getValue().doubleVa... | Map<String, MetricsGc> metricsGc = new HashMap<>(); | 6 |
princeofgiri/f-droid | F-Droid/src/org/fdroid/fdroid/views/swap/SwapActivity.java | [
"public class FDroidApp extends Application {\n\n // for the local repo on this device, all static since there is only one\n public static int port = 8888;\n public static String ipAddressString = null;\n public static String ssid = \"\";\n public static String bssid = \"\";\n public static Repo r... | import android.app.ProgressDialog;
import android.content.Context;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;
import a... | package org.fdroid.fdroid.views.swap;
public class SwapActivity extends ActionBarActivity implements SwapProcessManager {
private static final String STATE_START_SWAP = "startSwap";
private static final String STATE_SELECT_APPS = "selectApps";
private static final String STATE_JOIN_WIFI = "joinWifi";
... | boolean nfcMessageReady = NfcHelper.setPushMessage(this, Utils.getSharingUri(this, FDroidApp.repo)); | 3 |
huazhouwang/Synapse | app/src/main/java/io/whz/synapse/neural/NeuralNetwork.java | [
"public class App extends Application {\n public static final String TAG = \"Synapse\";\n private static final String DB_NAME = \"global-db\";\n private static final String PREFERENCE_NAME = \"global-preferences\";\n\n private final Global mGlobal = Global.getInstance();\n\n @Override\n public voi... | import android.support.annotation.NonNull;
import android.support.v4.util.Pair;
import org.greenrobot.greendao.annotation.NotNull;
import java.util.Arrays;
import io.whz.synapse.component.App;
import io.whz.synapse.matrix.Matrix;
import io.whz.synapse.pojo.neural.Batch;
import io.whz.synapse.util.MatrixUtil;
import io.... | package io.whz.synapse.neural;
public class NeuralNetwork {
private static final String TAG = App.TAG + "-NeuralNetwork";
public static final int INPUT_LAYER_NUMBER = 784;
public static final int OUTPUT_LAYER_NUMBER = 10;
private final Matrix[] mWeights;
private final Matrix[] mBiases;
... | Precondition.checkNotNull(hiddenLayerSizes, "Hidden layers must not be null!"); | 4 |
msteindorfer/criterion | src/main/java/io/usethesource/criterion/JmhSetBenchmarks.java | [
"public class MemoryFootprintProfiler implements InternalProfiler {\n\n private final static String UNIT_BYTES = \"bytes\";\n private final static String UNIT_COUNT = \"count\";\n private final static AggregationPolicy POLICY = AggregationPolicy.MAX;\n\n @Override\n public String getDescription() {\n return... | import io.usethesource.criterion.profiler.MemoryFootprintProfiler;
import java.util.Iterator;
import java.util.Random;
import java.util.concurrent.TimeUnit;
import io.usethesource.criterion.BenchmarkUtils.DataType;
import io.usethesource.criterion.BenchmarkUtils.SampleDataSelection;
import io.usethesource.criterion.Ben... | // full match
for (int i = 0; i < CACHED_NUMBERS_SIZE; i++) {
bh.consume(testSet.delete(cachedNumbers[i]));
}
// no match
for (int i = 0; i < CACHED_NUMBERS_SIZE; i++) {
bh.consume(testSet.delete(cachedNumbersNotContained[i]));
}
}
@Benchmark
@OperationsPerInvocation(CACHED_NU... | .addProfiler(MemoryFootprintProfiler.class) | 0 |
cestella/streaming_outliers | core/src/main/java/com/caseystella/analytics/outlier/batch/rpca/RPCAOutlierAlgorithm.java | [
"public class DataPoint {\n private long timestamp;\n private double value;\n private Map<String, String> metadata;\n private String source;\n\n public DataPoint() {\n\n }\n\n public DataPoint(long timestamp, double value, Map<String, String> metadata, String source) {\n this.timestamp =... | import com.caseystella.analytics.DataPoint;
import com.caseystella.analytics.distribution.GlobalStatistics;
import com.caseystella.analytics.distribution.scaling.ScalingFunctions;
import com.caseystella.analytics.outlier.Outlier;
import com.caseystella.analytics.outlier.OutlierMetadataConstants;
import com.caseystella.... | package com.caseystella.analytics.outlier.batch.rpca;
public class RPCAOutlierAlgorithm implements OutlierAlgorithm{
private static final double EPSILON = 1e-12;
private static final String THRESHOLD_CONF = "rpca.threshold";
private final double LPENALTY_DEFAULT = 1;
private final double SPENALTY_DE... | GlobalStatistics globalStats = new GlobalStatistics() {{ | 1 |
VernonLee/Theogony | app/src/main/java/com/nodlee/theogony/ui/fragment/SkinListFragment.java | [
"public class Champion extends RealmObject implements Serializable {\n @PrimaryKey\n private int id;\n private String key;\n private String name;\n private String title;\n private String image;\n private String lore;\n private String blurb;\n private String enemytipsc;\n private String... | import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.V... | package com.nodlee.theogony.ui.fragment;
/**
* 作者:nodlee
* 时间:16/8/11
* 说明:
*/
public class SkinListFragment extends BaseFragment implements ItemClickedListener {
@BindView(R.id.recy_view_skins)
RecyclerView mSkinsRecyclerView;
private Unbinder mUnbinder;
private SkinAdapter mSkinAdapter;
... | intent.putExtra(EXTRA_SKIN_ID, skin.getId()); | 6 |
wmaop/wm-aop | src/test/java/org/wmaop/aop/advice/AdviceTest.java | [
"public final class GlobalRemit implements Remit {\r\n\r\n\t@Override\r\n\tpublic final boolean isApplicable() {\r\n\t\treturn true;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic boolean isApplicable(Scope scope) {\r\n\t\treturn scope == ALL || scope == GLOBAL;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import org.junit.Before;
import org.junit.Test;
import org.wmaop.aop.advice.remit.GlobalRemit;
import org.wm... | package org.wmaop.aop.advice;
public class AdviceTest {
private static final String ADVICE_ID = "adviceid";
private PointCut pointCut;
private Interceptor interceptor;
private FlowPosition pipelinePosition;
private IData idata;
private Advice advice;
private Remit remit;
@Before
public void setUp() {
... | remit = new GlobalRemit(); | 0 |
julianctni/mensaDD | app/src/main/java/com/pasta/mensadd/MainActivity.java | [
"public class AutostartRegister {\n\tprivate static final String TAG = AutostartRegister.class.getName();\n public static void register(PackageManager pm, boolean autostart) {\n Log.i(TAG, \"Autostart is \" + autostart);\n int enabled = autostart ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :\n... | import android.app.PendingIntent;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.nfc.NfcAdapter;
import android.nfc.Tag;
import android.nfc.tech.IsoDep;
import android.... | public void onClick(View v) {
Animation animation = new ViewHeightAnimation(mCardCheckContainer, (int) mCardCheckHeight, 0, 150);
if (v.getId() == R.id.saveBalanceButton) {
storeCardData();
}
if (v.getId() == R.id.saveBalanceButton || v.getId() == R.id.hideBalanceButton)... | } catch (DesfireException ex) { | 1 |
joachimhs/Embriak | backend/src/main/java/no/haagensoftware/netty/server/Main.java | [
"public class NettyWebserverPipelineFactory implements ChannelPipelineFactory {\n\tprivate static Logger logger = Logger.getLogger(NettyWebserverPipelineFactory.class.getName());\n\tprivate List<NettyWebserverRouterPlugin> routerPlugins;\n\tprivate RouterHandler routerhandler = null;\n\t\n\tpublic NettyWebserverPip... | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.Executors;
import no.haagensoftware.netty.webserver.pipeline.Netty... | package no.haagensoftware.netty.server;
public class Main {
private static Logger logger = Logger.getLogger(Main.class.getName());
public static void main(String[] args) throws Exception{
//new Main().run();
configureLog4J();
configure();
Main main = new Main();
main.run();
}
private static voi... | routerPlugins.add(new PostSenseRouterPlugin(new ApplicationServerInfo(), dbEnv)); | 2 |
CMPUT301F14T14/android-question-answer-app | QuestionApp/src/ca/ualberta/cs/cmput301f14t14/questionapp/data/RemoteDataStore.java | [
"public class Answer extends Model implements Serializable, ICommentable {\n\n\tprivate static final long serialVersionUID = -237004584128041997L;\n\n\tprivate UUID id;\n\tprivate Image image;\n\tprivate String body;\n\t@SerializedName(\"comments\") private List<UUID> commentList;\n\tprivate String author;\n\tpriva... | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpG... | package ca.ualberta.cs.cmput301f14t14.questionapp.data;
/**
* A data store that uses an ElasticSearch server as a data storage mechanism.
*/
public class RemoteDataStore implements IDataStore {
protected static String ES_BASE_URL = "http://cmput301.softwareprocess.es:8080/cmput301f14t14/";
private static fi... | gb.registerTypeAdapter(new TypeToken<Comment<Question>>() {}.getType(), | 1 |
chedim/minedriod | src/main/java/com/onkiup/minedroid/holders/StringHolder.java | [
"public interface Context {\n /**\n * @return Context id\n */\n int contextId();\n\n}",
"public final class R {\n\tfinal static String MODID = \"minedroid\";\n\tpublic final static class id {\n\t\tpublic final static int message = 268435456;\n\t\tpublic final static int hint = 268435457;\n\t\tpublic... | import com.onkiup.minedroid.Context;
import com.onkiup.minedroid.R;
import com.onkiup.minedroid.gui.views.ListView;
import com.onkiup.minedroid.gui.views.TextView;
import com.onkiup.minedroid.gui.views.View;
import net.minecraft.util.ResourceLocation; | package com.onkiup.minedroid.holders;
public class StringHolder extends ListView.Holder<String> {
private TextView text;
public StringHolder(Context context) {
super(context);
}
@Override
protected ResourceLocation getViewLocation() {
return R.layout.holder_string;
}
@Ov... | protected void link(View view) { | 4 |
dmfs/oauth2-essentials | src/main/java/org/dmfs/oauth2/client/grants/ResourceOwnerPasswordGrant.java | [
"public interface OAuth2AccessToken\n{\n /**\n * Returns the actual access token String.\n *\n * @return\n *\n * @throws ProtocolException\n */\n public CharSequence accessToken() throws ProtocolException;\n\n /**\n * Returns the access token type.\n *\n * @return\n ... | import org.dmfs.httpessentials.client.HttpRequestExecutor;
import org.dmfs.httpessentials.exceptions.ProtocolError;
import org.dmfs.httpessentials.exceptions.ProtocolException;
import org.dmfs.oauth2.client.OAuth2AccessToken;
import org.dmfs.oauth2.client.OAuth2Client;
import org.dmfs.oauth2.client.OAuth2Grant;
import ... | /*
* Copyright (C) 2016 dmfs 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 applicable law or agr... | public OAuth2AccessToken accessToken(HttpRequestExecutor executor) throws IOException, ProtocolError, ProtocolException | 0 |
danfickle/cpp-to-java-source-converter | src/main/java/com/github/danfickle/cpptojavasourceconverter/ExpressionEvaluator.java | [
"enum InitType\n{\n\tRAW,\n\tWRAPPED;\n}",
"enum TypeEnum\n{\n\tNUMBER, \n\tBOOLEAN,\n\tCHAR,\n\tVOID,\n\tOBJECT_POINTER,\n\tBASIC_POINTER,\n\tOBJECT,\n\tOBJECT_ARRAY,\n\tBASIC_ARRAY,\n\tANY,\n\tBASIC_REFERENCE,\n\tOBJECT_REFERENCE,\n\tOTHER,\n\tENUMERATION,\n\tUNKNOWN,\n\tFUNCTION,\n\tFUNCTION_POINTER,\n\tFUNCTI... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.cdt.core.dom.ast.*;
import org.eclipse.cdt.core.dom.ast.c.*;
import org.eclipse.cdt.core.dom.ast.cpp.*;
import org.eclipse.cdt.core.dom.ast.gnu.*;
import com.github.danfickle.cpptojavasourceconverter.InitializationManager.Ini... | package com.github.danfickle.cpptojavasourceconverter;
class ExpressionEvaluator
{
private final TranslationUnitContext ctx;
ExpressionEvaluator(TranslationUnitContext con)
{
ctx = con;
}
/**
* Given a C++ expression, attempts to convert it to one Java expression.
*/
MExpression eval1Expr(IASTExpress... | if (expr.isArrayAllocation() && !TypeManager.isOneOf(expr.getExpressionType(), TypeEnum.OBJECT_POINTER)) | 1 |
citerus/dddsample-core | src/main/java/se/citerus/dddsample/config/DDDSampleApplicationContext.java | [
"public interface GraphTraversalService extends Remote {\n\n /**\n * @param origin origin point\n * @param destination destination point\n * @param limitations restrictions on the path selection, as key-value according to some API specification\n * @return A list of transit paths\n * @throws java.rmi.Rem... | import com.pathfinder.api.GraphTraversalService;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResour... | package se.citerus.dddsample.config;
@Configuration
@ImportResource({
"classpath:context-interfaces.xml",
"classpath:context-infrastructure-messaging.xml",
"classpath:context-infrastructure-persistence.xml"})
public class DDDSampleApplicationContext {
@Autowired
CargoRepository cargoR... | public SampleDataGenerator sampleDataGenerator() { | 3 |
tgobbens/fluffybalance | core/src/com/balanceball/system/SpriteRenderSystem.java | [
"public class PositionComponent implements Component {\n public Vector2 position = new Vector2();\n}",
"public class RotationComponent implements Component {\n public float degree;\n}",
"public class SizeComponent implements Component {\n public float width = 1.f;\n public float height = 1.f;\n}",
... | import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.Array;
import com.balanceball.component.PositionComponent;
import com.balanceball.component.RotationComponent;
import com.balanceball.component.SizeComponent;
import com.balanceball.component.TextureComponent;
import com.balanceball.compone... | package com.balanceball.system;
/**
* Created by tijs on 11/07/2017.
*/
public class SpriteRenderSystem extends System {
private SpriteBatch mSpriteBatch;
private Array<Entity> mZOrderedEntities;
public SpriteRenderSystem() {
addComponentType(TextureComponent.class);
addComponentType(... | ZIndexComponent zIndexComponent1 = entity1.getComponentByType(ZIndexComponent.class); | 5 |
jillesvangurp/jsonj | src/test/java/com/github/jsonj/tools/JsonBuilderTest.java | [
"public static @Nonnull JsonArray array() {\n return new JsonArray();\n}",
"@SuppressWarnings(\"rawtypes\")\npublic static @Nonnull JsonElement fromObject(Object o) {\n if(o instanceof JsonBuilder) {\n return ((JsonBuilder) o).get();\n } else if(o instanceof Map) {\n return new JsonObject((... | import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.github.jsonj.JsonElement;
import com.github.jsonj.JsonPrimitive;
import com.github.jsonj.JsonSet;
import static com.github.jsonj.tools.JsonBuilder.... | /**
* Copyright (c) 2011, Jilles van Gurp
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, p... | JsonPrimitive p1 = primitive(1234); | 3 |
Aevi-UK/android-pos-print-api | PrintingExample/src/main/java/com/aevi/example/print/PrintingActivity.java | [
"public class PrinterApi {\n\n public static PrinterManager getPrinterManager(Context context) {\n return new PrinterManagerImpl(context);\n }\n}",
"public interface PrinterManager {\n\n /**\n * @return True if the printing service is installed and available\n */\n boolean isPrinterServ... | import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import android.widg... | }
Log.d(TAG, "Got printer settings list: " + printerSettingsList.length);
driversSpinner.setAdapter(new ArrayAdapter<>(PrintingActivity.this,
android.R.layout.simple_spinner_item,
prin... | startIntent.putExtra(KEY_PAYLOAD, payload.toJson()); | 7 |
ZinoKader/SpotiQ | app/src/main/java/se/zinokader/spotiq/feature/party/PartyPresenter.java | [
"public class ApplicationConstants {\n\n private ApplicationConstants() {}\n\n /* Request codes */\n public static final int LOGIN_INTENT_REQUEST_CODE = 5473;\n public static final int SEARCH_INTENT_REQUEST_CODE = 3125;\n\n /* Time and timing-related */\n public static final int DEFER_SNACKBAR_DEL... | import android.os.Bundle;
import android.support.annotation.NonNull;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
import se.zinokader.spotiq.constant.ApplicationConstants;
import se.zinokader.spotiq... | package se.zinokader.spotiq.feature.party;
public class PartyPresenter extends BasePresenter<PartyView> {
@Inject
SpotifyAuthenticationService spotifyCommunicatorService;
@Inject
PartiesRepository partiesRepository;
@Inject
SpotifyRepository spotifyRepository;
private String partyTi... | partyTitle = savedState.getString(ApplicationConstants.PARTY_NAME_EXTRA); | 0 |
kwanghoon/MySmallBasic | MySmallBasic/src/com/coducation/smallbasic/lib/Program.java | [
"public class DoubleV extends Value {\r\n\t\r\n\tpublic DoubleV(double value) {\r\n\t\tthis.value = value;\r\n\t}\r\n\t\r\n\tpublic void setValue(double value) {\r\n\t\tthis.value = value;\r\n\t}\r\n\t\r\n\tpublic double getValue() {\r\n\t\treturn value;\r\n\t}\r\n\t\r\n\t@Override\r\n\tpublic double getNumber() {\... | import java.util.ArrayList;
import java.util.Calendar;
import com.coducation.smallbasic.DoubleV;
import com.coducation.smallbasic.Eval;
import com.coducation.smallbasic.InterpretException;
import com.coducation.smallbasic.StrV;
import com.coducation.smallbasic.Value;
| package com.coducation.smallbasic.lib;
public class Program {
public static Value ArgumentCount;
public static Value Directory;
//Program.Delay(milliSeconds)
//Delays program execution by the specified amount of MilliSeconds.
public static Value Delay(ArrayList<Value> args) {
double dbl_... | throw new InterpretException("Delay : Unexpected StrV arg : " + arg);
| 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.