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
gsh199449/spider
src/main/java/com/gs/spider/service/commons/webpage/CommonWebpageService.java
[ "@Component\npublic class CommonWebpageDAO extends IDAO<Webpage> {\n private final static String INDEX_NAME = \"commons\", TYPE_NAME = \"webpage\";\n private static final int SCROLL_TIMEOUT = 1;\n private static final Gson gson = new GsonBuilder()\n .registerTypeAdapter(Date.class, (JsonDeserial...
import com.google.gson.Gson; import com.gs.spider.dao.CommonWebpageDAO; import com.gs.spider.gather.commons.CommonSpider; import com.gs.spider.model.commons.SpiderInfo; import com.gs.spider.model.commons.Webpage; import com.gs.spider.model.utils.ResultBundle; import com.gs.spider.model.utils.ResultBundleBuilder; import...
package com.gs.spider.service.commons.webpage; /** * CommonWebpageService * * @author Gao Shen * @version 16/4/19 */ @Component public class CommonWebpageService { private static final Gson gson = new Gson(); private Logger LOG = LogManager.getLogger(CommonWebpageService.class); @Autowired priva...
public ResultListBundle<Webpage> getWebpageListBySpiderUUID(String spiderUUID, int size, int page) {
6
jprante/elasticsearch-knapsack
src/test/java/org/xbib/suites/KnapsackTestSuite.java
[ "public class KnapsackExportTests extends NodeTestUtils {\n\n private final static ESLogger logger = ESLoggerFactory.getLogger(KnapsackExportTests.class.getName());\n\n @Test\n public void testMinimalExport() throws Exception {\n File exportFile = File.createTempFile(\"minimal-export-\", \".bulk\");...
import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.xbib.elasticsearch.plugin.knapsack.KnapsackExportTests; import org.xbib.elasticsearch.plugin.knapsack.KnapsackImportTests; import org.xbib.elasticsearch.plugin.knapsack.KnapsackSimpleTests; import org.xbib.elasticsearch.plugin.knapsack.Knapsack...
package org.xbib.suites; @RunWith(ListenerSuite.class) @Suite.SuiteClasses({ KnapsackSimpleTests.class, KnapsackExportTests.class,
KnapsackImportTests.class,
1
OpenIchano/Viewer
src/com/zhongyun/viewer/video/VideoListViewHandler.java
[ "public class Constants {\n\n\tpublic static final String INTENT_CID = \"cid\";\n\tpublic static final String INTENT_CAMERA_NAME = \"camera_name\";\n\t\n\tpublic static final String BARCODE_SPLITER = \"&\";\n\tpublic static final String BARCODE_DEVICE_ID = \"deviceid=\";\n\tpublic static final String BARCODE_CID = ...
import java.util.ArrayList; import java.util.List; import com.ichano.rvs.viewer.Media; import com.ichano.rvs.viewer.Viewer; import com.ichano.rvs.viewer.bean.RecordFileInfo; import com.ichano.rvs.viewer.callback.RecordFileDeleteListener; import com.ichano.rvs.viewer.callback.RecordFileListCallback; import com.ichano.rv...
/* * Copyright (C) 2015 iChano incorporation's 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 requ...
List<File> files = new ArrayList<FileList.File>();
5
timeforcoffee/timeforcoffee-android
api/src/main/java/ch/liip/timeforcoffee/api/DepartureService.java
[ "public class DeparturesFetchedEvent {\n private final List<Departure> departures;\n\n public DeparturesFetchedEvent(List<Departure> departures) {\n this.departures = departures;\n }\n\n public List<Departure> getDepartures() {\n return departures;\n }\n}", "public class FetchDepartur...
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.inject.Inject; import ch.liip.timeforcoffee.api.events.departuresEvents.DeparturesFetchedEvent; import ch.liip.timeforcoffee....
package ch.liip.timeforcoffee.api; public class DepartureService { private final EventBus eventBus; private final BackendService backendService; @Inject public DepartureService(EventBus eventBus, BackendService backendService) { this.backendService = backendService; this.eventBus ...
ArrayList<Departure> departures = new ArrayList<>();
4
hdweiss/codemap
src/com/hdweiss/codemap/view/workspace/browser/WorkspaceBrowserAdapter.java
[ "public class CodeMapApp extends Application {\n\n\tprivate HashMap<String, HashMap<String,WorkspaceController>> controllers \n\t\t= new HashMap<String, HashMap<String, WorkspaceController>>();\n\t\n\tpublic WorkspaceController getController(String projectName, String workspaceName) {\n\t\tHashMap<String,WorkspaceC...
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseExpandableListAdapter; import android.widget.ExpandableListView; import android.widget....
package com.hdweiss.codemap.view.workspace.browser; public class WorkspaceBrowserAdapter extends BaseExpandableListAdapter { private Context context; private ProjectController projectController; private ArrayList<String> workspaceStateList; private HashMap<String, ArrayList<ICodeMapItem>> workspaceUrlsMap; ...
for (SerializableItem item: state.items)
3
reines/game
game-client/src/main/java/com/game/client/ui/LoginWindow.java
[ "public final class Client extends ClientFrame {\n\tprivate static final Logger log = LoggerFactory.getLogger(Client.class);\n\n\tpublic static final String DEFAULT_HOST = \"localhost\";\n\tpublic static final int DEFAULT_PORT = 36954;\n\tpublic static final int[] ICON_SIZES = {128, 64, 32, 16};\n\tpublic static fi...
import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.game.client.Client; import com.game.graphics.renderer.Graphics2D; import com.game.graphics.renderer.Sprite; import com.game.graphics.widget.Button; import c...
package com.game.client.ui; public class LoginWindow extends Window implements ActionListener { private static final Logger log = LoggerFactory.getLogger(LoginWindow.class); public static final String WELCOME_MESSAGE = "Please enter a username and password to login."; public static final Color WIDGET_BACKGROUND...
protected final Sprite background;
2
mitdbg/AdaptDB
src/main/java/core/adapt/iterator/PartitionIterator.java
[ "public class Query implements Serializable {\n\tprivate static final long serialVersionUID = 1L;\n\n\tprotected Predicate[] predicates;\n\n\tprivate String table;\n\n RawIndexKey key;\n\n\tpublic Query(String queryString) {\n\t\tString[] parts = queryString.split(\"\\\\|\");\n\t\tthis.table = parts[0];\n\t\tif ...
import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.util.Iterator; import core.adapt.Query; import core.common.globals.TableInfo; import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang.ArrayUtils; import com.google.common.io.ByteArrayDataOutput; import com.go...
package core.adapt.iterator; public class PartitionIterator implements Iterator<IteratorRecord> { public enum ITERATOR { SCAN, FILTER, REPART }; protected IteratorRecord record; protected byte[] recordBytes; protected static char newLine = '\n'; protected byte[] bytes; protected int bytesLength, offse...
protected Query query;
0
documaster/noark-extraction-validator
noark-extraction-validator/src/main/java/com/documaster/validator/validation/noark5/validators/XMLValidator.java
[ "public class BaseItem {\n\n\tprivate Map<String, Object> values;\n\n\tpublic Map<String, Object> getValues() {\n\n\t\tif (values == null) {\n\t\t\tvalues = new LinkedHashMap<>();\n\t\t}\n\t\treturn values;\n\t}\n\n\tpublic BaseItem add(String name, Object value) {\n\n\t\tgetValues().put(name.toLowerCase(), value);...
import java.io.File; import java.util.List; import com.documaster.validator.storage.model.BaseItem; import com.documaster.validator.validation.collector.ValidationCollector; import com.documaster.validator.validation.collector.ValidationResult; import com.documaster.validator.validation.noark5.model.Noark5PackageEntity...
/** * Noark Extraction Validator * Copyright (C) 2016, Documaster AS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any la...
ValidationGroup.PACKAGE.getNextGroupId(collector), entity.getXmlFileName() + " integrity",
4
encircled/Joiner
joiner-core/src/test/java/cz/encircled/joiner/core/MultipleMappingsForSameClassOnSingleEntityTest.java
[ "public class JoinerException extends RuntimeException {\n\n public JoinerException(String message) {\n super(message);\n }\n\n public JoinerException(String message, Exception exception) {\n super(message, exception);\n }\n}", "@Table(name = \"contact\")\n@Entity\n@Inheritance(strategy ...
import cz.encircled.joiner.exception.JoinerException; import cz.encircled.joiner.model.Contact; import cz.encircled.joiner.model.Group; import cz.encircled.joiner.model.QContact; import cz.encircled.joiner.model.QGroup; import cz.encircled.joiner.model.QUser; import cz.encircled.joiner.model.User; import cz.encircled.j...
package cz.encircled.joiner.core; /** * Tests for cases when an entity has multiple associations with the same class type (i.e. User and Contacts in test domain model) * * @author Vlad on 21-Aug-16. */ public class MultipleMappingsForSameClassOnSingleEntityTest extends AbstractTest { @Autowired public ...
List<User> users = joiner.find(Q.from(QUser.user1).joins(J.left(new QContact("employmentContacts"))));
3
contentful/contentful.java
src/test/java/com/contentful/java/cda/ClientTest.java
[ "public final class GeneratedBuildParameters {\n /**\n * Which version of '${project.name}' is getting used?\n */\n public static final String PROJECT_VERSION = \"${project.version}\";\n}", "public class AuthorizationHeaderInterceptor extends HeaderInterceptor {\n public static final String HEADER_NAME = \...
import com.contentful.java.cda.build.GeneratedBuildParameters; import com.contentful.java.cda.interceptor.AuthorizationHeaderInterceptor; import com.contentful.java.cda.interceptor.ContentfulUserAgentHeaderInterceptor; import com.contentful.java.cda.interceptor.UserAgentHeaderInterceptor; import com.contentful.java.cda...
package com.contentful.java.cda; public class ClientTest extends BaseTest { public static final String ERROR_MESSAGE = "This is an expected error!"; @Test @Enqueue public void notUsingCustomCallFactoryDoesCreateCallFactoryWithAuthAndUserAgentInterceptors() throws InterruptedException { createClient()...
assertThat(headers.get(AuthorizationHeaderInterceptor.HEADER_NAME)).endsWith(DEFAULT_TOKEN);
1
treasure-lau/CSipSimple
actionbarsherlock-library/src/main/java/com/actionbarsherlock/internal/ActionBarSherlockNative.java
[ "public abstract class ActionBarSherlock {\r\n protected static final String TAG = \"ActionBarSherlock\";\r\n public static final boolean DEBUG = false;\r\n\r\n private static final Class<?>[] CONSTRUCTOR_ARGS = new Class[] { Activity.class, int.class };\r\n private static final HashMap<Implementation, ...
import android.app.Activity; import android.content.Context; import android.util.Log; import android.util.TypedValue; import android.view.ContextThemeWrapper; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.view.Window; import com.actionbarsherlock.ActionBarSherlock; import com.acti...
package com.actionbarsherlock.internal; @ActionBarSherlock.Implementation(api = 14) public class ActionBarSherlockNative extends ActionBarSherlock {
private ActionBarWrapper mActionBar;
2
DorsetProject/dorset-framework
core/src/main/java/edu/jhuapl/dorset/http/apache/ApacheHttpClient.java
[ "public abstract class AbstractHttpClient implements HttpClient {\n protected String userAgent;\n protected Integer connectTimeout;\n protected Integer readTimeout;\n protected Map<String, String> requestHeaders = new HashMap<String, String>();\n\n @Override\n public void setUserAgent(String agent...
import org.apache.http.entity.ContentType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import edu.jhuapl.dorset.http.AbstractHttpClient; import edu.jhuapl.dorset.http.HttpClient; import edu.jhuapl.dorset.http.HttpParameter; import edu.jhuapl.dorset.http.HttpRequest; import edu.jhuapl.dorset.http.HttpRespon...
/* * Copyright 2016 The Johns Hopkins University Applied Physics Laboratory LLC * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/li...
public HttpResponse execute(HttpRequest request) {
3
tomasbjerre/git-changelog-lib
src/test/java/se/bjurr/gitchangelog/api/GitChangelogApiTest.java
[ "public static GitChangelogApi gitChangelogApiBuilder() {\n return new GitChangelogApi();\n}", "public static final String ZERO_COMMIT = \"0000000000000000000000000000000000000000\";", "public static void mock(final RestClient mock) {\n mockedRestClient = mock;\n}", "public class GitHubMockInterceptor imple...
import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder; import static se.bjurr.gitchangelog.api.GitChangelogApiConstants.ZERO_COMMIT; import static se.bjurr.gitchangelog.internal.inte...
package se.bjurr.gitchangelog.api; public class GitChangelogApiTest { private RestClientMock mockedRestClient; private GitHubMockInterceptor gitHubMockInterceptor; @Before public void before() throws Exception { JiraClientFactory.reset(); RedmineClientFactory.reset(); this.mockedRestClient = ne...
mock(this.mockedRestClient);
2
michaelmarconi/oncue
oncue-service/app/controllers/api/Status.java
[ "public class OnCueService extends GlobalSettings {\n\n\t// The OnCue actor system\n\tprivate static ActorSystem system;\n\n\t/**\n\t * Boot up the embedded OnCue actor system\n\t */\n\t@SuppressWarnings(\"serial\")\n\tprivate static void bootSystem() {\n\t\tfinal Settings settings = SettingsProvider.SettingsProvid...
import static akka.pattern.Patterns.ask; import oncue.OnCueService; import oncue.common.messages.Job; import oncue.common.messages.JobSummary; import oncue.common.messages.SimpleMessages.SimpleMessage; import oncue.common.settings.Settings; import oncue.common.settings.SettingsProvider; import org.codehaus.jackson.node...
package controllers.api; public class Status extends Controller { private final static Settings settings = SettingsProvider.SettingsProvider.get(OnCueService.system()); /** * Returns a JSON object with all relevant service status information */ public static Result index() { ActorRef scheduler = OnCueSer...
ask(scheduler, SimpleMessage.JOB_SUMMARY, new Timeout(settings.SCHEDULER_TIMEOUT)).recover(
3
SlimeVoid/LittleBlocks-FML
src/main/java/net/slimevoid/littleblocks/client/render/entities/LittleBlockDiggingFX.java
[ "public class BlockLittleChunk extends BlockContainer {\n\n public static int currentPass;\n\n public static int xSelected = -10;\n public static int ySelected = -10;\n public static int zSelected = -10;\n public static int side = -1;\n public stat...
import net.slimevoid.library.data.Logger.LogLevel; import net.slimevoid.littleblocks.blocks.BlockLittleChunk; import net.slimevoid.littleblocks.core.LittleBlocks; import net.slimevoid.littleblocks.core.LoggerLittleBlocks; import net.slimevoid.littleblocks.core.lib.ConfigurationLib; import net.slimevoid.littleblocks.cor...
package net.slimevoid.littleblocks.client.render.entities; public class LittleBlockDiggingFX extends EntityDiggingFX { public LittleBlockDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15) { super(par1World, par2, par4, p...
public static boolean doBlockDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer, BlockLittleChunk block) {
0
logful/logful-api
src/main/java/com/getui/logful/server/parse/GraylogClientService.java
[ "public class GlobalReference {\n\n private static final int MAX_CAPACITY = 1000;\n private HashMap<String, Layout> layoutMap = new HashMap<>();\n\n private static class ClassHolder {\n static GlobalReference instance = new GlobalReference();\n }\n\n public static GlobalReference reference() {...
import com.getui.logful.server.GlobalReference; import com.getui.logful.server.ServerProperties; import com.getui.logful.server.entity.Layout; import com.getui.logful.server.entity.LayoutItem; import com.getui.logful.server.entity.LogMessage; import com.getui.logful.server.mongod.LogMessageRepository; import com.mongod...
package com.getui.logful.server.parse; @Component public class GraylogClientService implements SenderInterface { private static final Logger LOG = LoggerFactory.getLogger(GraylogClientService.class); @Autowired ServerProperties serverProperties; @Autowired LogMessageRepository logMessageReposi...
private GelfTransport graylogTransport;
6
echocat/adam
src/main/java/org/echocat/adam/view/ViewProvider.java
[ "public class AccessProvider {\n\n @Nonnull\n private final PermissionManager _permissionManager;\n @Nonnull\n private final GroupManager _groupManager;\n\n @Nonnull\n private final ViewEditAccess _viewEditAccess = new DummyAccess();\n @Nonnull\n private final ViewAccess _viewAccess = new Du...
import org.apache.commons.collections15.map.LRUMap; import org.echocat.adam.access.AccessProvider; import org.echocat.adam.access.ViewAccess; import org.echocat.adam.configuration.Configuration; import org.echocat.adam.configuration.ConfigurationRepository; import org.echocat.adam.configuration.view.View.Element; impor...
/***************************************************************************************** * *** BEGIN LICENSE BLOCK ***** * * echocat Adam, Copyright (c) 2014 echocat * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as publi...
private final GroupProvider _groupProvider;
6
egetman/ibm-bpm-rest-client
src/main/ru/bpmink/bpm/api/impl/simple/SecuredBpmClient.java
[ "public interface BpmClient extends Closeable {\n\n /**\n * Client for actions on exposed bpm api.\n *\n * @return {@link ru.bpmink.bpm.api.client.ExposedClient}\n */\n ExposedClient getExposedClient();\n\n /**\n * Client for actions on process bpm api.\n *\n * @return {@link ru...
import com.google.common.io.Closeables; import org.apache.http.HttpVersion; import org.apache.http.auth.AuthScope; import org.apache.http.auth.UsernamePasswordCredentials; import org.apache.http.client.CredentialsProvider; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.PlainSock...
package ru.bpmink.bpm.api.impl.simple; /** * Default (Secure-all) implementation of {@link ru.bpmink.bpm.api.client.BpmClient} which * supports {@link org.apache.http.impl.auth.BasicScheme} authentication. * Need to be carefully rewrite. */ @Immutable @SuppressFBWarnings("JCIP_FIELD_ISNT_FINAL_IN_IMMUTABLE_CLA...
private ExposedClient exposedClient;
1
davidmoten/rtree-3d
src/test/java/com/github/davidmoten/rtree3d/LeafTest.java
[ "public final class Context {\n\n private final int maxChildren;\n private final int minChildren;\n private final Splitter splitter;\n private final Selector selector;\n private final Optional<Box> bounds;\n\n /**\n * Constructor.\n * \n * @param minChildren\n * minimum ...
import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.Arrays; import org.junit.Test; import com.github.davidmoten.rtree3d.Context; import com.github.davidmoten.rtree3d.Entry; import com.github.davidmoten.rtree3d.Leaf; import com.github.davidmoten.rtree3d.SelectorMinimalVolumeIncrease...
package com.github.davidmoten.rtree3d; public class LeafTest { private static Context context = new Context(2, 4, new SelectorMinimalVolumeIncrease(), new SplitterQuadratic()); @Test(expected = IllegalArgumentException.class) public void testCannotHaveZeroChildren() {
new Leaf<Object, Box>(new ArrayList<Entry<Object, Box>>(), context);
5
ls1intum/jReto
Source/src/de/tum/in/www1/jReto/module/wlan/WlanConnection.java
[ "public interface Connection {\n\t/** \n\t* The Connection.Handler interface allows the Connection to inform its delegate about various events.\n\t*/\n\tpublic static interface Handler {\n\t /** Called when the connection connected successfully.*/\n\t\tvoid onConnect(Connection connection);\n\t /** Called whe...
import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.SocketChannel; import de.tum.in.www1.jReto.module.api.Connection; import de.tum.in.www1.jReto.niotools.ChannelReader; import de.tum.in.www1.jReto.ni...
package de.tum.in.www1.jReto.module.wlan; public class WlanConnection implements Connection, ReadHandler, CloseHandler, WriteHandler { public final int PACKET_LENGTH_FIELD_LENGTH = 4; private Handler handler; private Dispatcher dispatcher; private InetAddress address; private int port; private boolean isConn...
private ChannelWriter channelWriter;
2
AwaisKing/Linked-Words
app/src/main/java/awais/backworddictionary/dialogs/WordDialog.java
[ "public final class DefinitionsAdapter<T> implements ListAdapter {\n private final boolean isExpanded;\n private final List<T> items;\n private final LayoutInflater layoutInflater;\n private final View.OnClickListener onClickListener;\n private final String currentWord;\n private int topMargin = 0...
import android.app.Dialog; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.view.Window; import androidx.annota...
package awais.backworddictionary.dialogs; public final class WordDialog extends Dialog implements android.view.View.OnClickListener { private static final int ALERT_DIALOG_THEME = R.style.DefinitionsDialogTheme; private static final Exception EMPTY_EXCEPTION = new Exception(); private final String wor...
this.anySearchAppFound = Utils.isAnySearchAppFound(context);
2
ailab-uniud/distiller-CORE
src/main/java/it/uniud/ailab/dcore/annotation/annotators/TagMeGramAnnotator.java
[ "public interface Annotator extends Stage {\r\n \r\n /**\r\n * The abstract annotation method. All classes that perform some kind of \r\n * annotation (splitting, PoS tagging, entity linking...) must inherit from\r\n * Annotator. They annotate the blackboard given as first parameter or a \r\n ...
import java.util.List; import it.uniud.ailab.dcore.annotation.Annotator; import it.uniud.ailab.dcore.Blackboard; import it.uniud.ailab.dcore.annotation.annotations.TextAnnotation; import it.uniud.ailab.dcore.annotation.annotations.UriAnnotation; import it.uniud.ailab.dcore.persistence.DocumentComponent; import it.uniud...
/* * Copyright (C) 2015 Artificial Intelligence * Laboratory @ University of Udine. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option...
public void annotate(Blackboard blackboard, DocumentComponent component) {
4
jedwards1211/Jhrome
src/main/java/org/sexydock/tabs/demos/GettingStarted.java
[ "public class DefaultTabDropFailureHandler implements ITabDropFailureHandler\r\n{\r\n\tpublic DefaultTabDropFailureHandler( ITabbedPaneWindowFactory windowFactory )\r\n\t{\r\n\t\tthis.windowFactory = windowFactory;\r\n\t}\r\n\t\r\n\tfinal ITabbedPaneWindowFactory\twindowFactory;\r\n\t\r\n\t@Override\r\n\tpublic voi...
import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.Font; import java.awt.Window; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; import javax.swing.UIManager; import org.sexydock.tabs.DefaultTabDropFailureHandler; import o...
package org.sexydock.tabs.demos; public class GettingStarted implements ISexyTabsDemo { // NOTE: This guide demonstrates how to enable all the special Google Chrome-like behavior // in a step-by-step manner. However, in practice, a tabbed application should be structured a bit // differently. See Notepa...
public Tab createTabWithContent( )
7
Darkhogg/LWJTorrent
src/es/darkhogg/torrent/tracker/TrackerResponse.java
[ "public class Bencode {\n\n /**\n * UTF-8 charset used for Bencode\n */\n public static final Charset UTF8 = Charset.forName(\"UTF-8\");\n\n /**\n * Gets a child element from the passed value using the strings as a path.\n * <p>\n * Each element of the <tt>strings</tt> parameter represe...
import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; impor...
package es.darkhogg.torrent.tracker; /** * Represents the response to a request to a {@link Tracker}. This class is immutable. * <p> * Note that the only public way to create a <tt>TrackerRequest</tt> is using a bencoded value. Objects of this class * should not be created by client code, but only returned by <t...
public static TrackerResponse fromValue (Value<?> value) {
4
simo415/spc
src/com/sijobe/spc/command/EnderCrystal.java
[ "public class CommandException extends Exception {\n \n /**\n * GUID\n */\n private static final long serialVersionUID = -2082390336460702125L;\n\n public CommandException() {\n super();\n }\n \n public CommandException(String message) {\n super(message);\n }\n \n public CommandE...
import java.util.List; import com.sijobe.spc.wrapper.CommandException; import com.sijobe.spc.wrapper.CommandSender; import com.sijobe.spc.wrapper.Coordinate; import com.sijobe.spc.wrapper.Entity; import com.sijobe.spc.wrapper.Player;
package com.sijobe.spc.command; /** * Creates an endercrystal where the player is pointing * * @author simo_415 * @version 1.0 */ @Command ( name = "endercrystal", description = "Creates an Ender Crystal where the player is pointing", example = "", videoURL = "", // TODO version = "1.4.6" ) publi...
Player player = super.getSenderAsPlayer(sender);
4
jclehner/AppOpsXposed
src/com/android/settings/applications/AppOpsSummary.java
[ "public class AppListFragment extends ListFragment implements LoaderCallbacks<List<AppListFragment.PackageInfoData>>\n{\n\tprivate static final String TAG = \"AOX:AppListFragment\";\n\n\tprivate AppListAdapter mAdapter;\n\tprivate LayoutInflater mInflater;\n\n\tclass AppListAdapter extends BaseAdapter\n\t{\n\t\tpri...
import android.app.Fragment; import android.app.FragmentManager; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceActivity; import android.support.v13.app.FragmentPagerAdapter; import android.support.v4.view.PagerTabStrip; import android.support.v4.vi...
/** * Copyright (C) 2013 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 applica...
getActivity().startActivity(new Intent(getActivity(), SettingsActivity.class));
1
Leaking/WeGit
app/src/main/java/com/quinn/githubknife/interactor/TokenInteractorImpl.java
[ "public interface GithubService{\n\n // Api about token\n\n @POST(\"authorizations\")\n Observable<Response<Token>> createToken(@Body Token token, @Header(\"Authorization\") String authorization) ;\n\n @GET(\"authorizations\")\n Observable<Response<List<Token>>> listToken(@Header(\"Authorization\") S...
import android.content.Context; import android.os.Handler; import android.os.Message; import com.quinn.githubknife.R; import com.quinn.githubknife.listener.OnTokenCreatedListener; import com.quinn.githubknife.model.GithubService; import com.quinn.githubknife.model.RetrofitUtil; import com.quinn.githubknife.utils.L; imp...
package com.quinn.githubknife.interactor; /** * Created by Quinn on 8/1/15. */ public class TokenInteractorImpl implements TokenInteractor { public static final String TAG = TokenInteractorImpl.class.getSimpleName(); private final static int TOKEN_CREATED = 1; private final static int ERROR = 2; ...
this.service = RetrofitUtil.getRetrofitWithoutTokenInstance(context).create(GithubService.class);
1
freenet/plugin-FlogHelper
src/main/java/plugins/floghelper/ui/AttachmentsToadlet.java
[ "public class DataFormatter {\n\n\t/**\n\t * RFC3339-compliant dates are used in Atom feeds.\n\t */\n\tpublic static final SimpleDateFormat RFC3339 = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\", java.util.Locale.US);\n\t/**\n\t * Our date format used in the flog (is UTC).\n\t */\n\tpublic static final ...
import plugins.floghelper.data.Activelink; import plugins.floghelper.data.Attachment; import plugins.floghelper.data.Flog; import plugins.floghelper.data.pluginstore.PluginStoreFlog; import plugins.floghelper.data.DataFormatter; import freenet.client.HighLevelSimpleClient; import freenet.clients.http.PageNode; import f...
/* FlogHelper, Freenet plugin to create flogs * Copyright (C) 2009 Romain "Artefact2" Dalmaso * * 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 yo...
final HTMLNode warning = this.getPM().getInfobox("infobox-warning", FlogHelper.getBaseL10n().getString("Warning"), pageNode.content);
1
cert-se/megatron-java
src/se/sitic/megatron/filter/OrganizationFilter.java
[ "public class AppProperties {\n // -- Keys in properties file --\n\n // Implicit\n public static final String JOB_TYPE_NAME_KEY = \"implicit.jobTypeName\";\n\n // General\n public static final String LOG4J_FILE_KEY = \"general.log4jConfigFile\";\n public static final String LOG_DIR_KEY = \"general...
import org.apache.log4j.Logger; import se.sitic.megatron.core.AppProperties; import se.sitic.megatron.core.JobContext; import se.sitic.megatron.core.MegatronException; import se.sitic.megatron.core.TypedProperties; import se.sitic.megatron.decorator.OrganizationMatcherDecorator; import se.sitic.megatron.entity.LogEntry...
package se.sitic.megatron.filter; /** * Filter out log entries that does not match an organization. */ public class OrganizationFilter implements ILogEntryFilter { private static final Logger log = Logger.getLogger(OrganizationFilter.class); private OrganizationMatcherDecorator organizationMatcher; ...
public boolean accept(LogEntry logEntry) throws MegatronException {
4
NickToony/scrAI
src/main/java/com/nicktoony/scrAI/World/Tasks/TaskPickupEnergy.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.scrAI.World.Creeps.CreepWrapper; import com.nicktoony.screeps.Energy; 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 TaskPickupEnergy extends Task { protected Energy energy; private int energyAvailable = 0; public TaskPickupEnergy(RoomController roomController, String associatedId, Energy energy) { super(roomController...
energy = (Energy) Game.getObjectById(associatedId);
5
mpusher/mpush-client-java
src/main/java/com/mpush/handler/PushMessageHandler.java
[ "public interface ClientListener {\n\n void onConnected(Client client);\n\n void onDisConnected(Client client);\n\n void onHandshakeOk(Client client, int heartbeat);\n\n void onReceivePush(Client client, byte[] content, int messageId);\n\n void onKickUser(String deviceId, String userId);\n\n void ...
import com.mpush.api.ClientListener; import com.mpush.api.connection.Connection; import com.mpush.api.protocol.Packet; import com.mpush.message.AckMessage; import com.mpush.message.PushMessage; import com.mpush.client.ClientConfig; import com.mpush.api.Logger;
/* * (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...
AckMessage.from(message).sendRaw();
3
reines/dropwizard-debpkg-maven-plugin
src/main/java/com/jamierf/dropwizard/debpkg/DropwizardMojo.java
[ "public class DependencyFilter implements Predicate<Dependency> {\n\n private final StringMatchingFilter groupFilter;\n private final StringMatchingFilter artifactFilter;\n\n public DependencyFilter(final String groupId, final String artifactId) {\n groupFilter = new StringMatchingFilter(groupId);\n...
import com.google.common.base.Optional; import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.jamierf.dropwizard.debpkg.config.*; import com.jamierf.dropwizard.debpkg.filter.Dep...
package com.jamierf.dropwizard.debpkg; @Mojo(name = "dwpackage", defaultPhase = LifecyclePhase.PACKAGE) public class DropwizardMojo extends AbstractMojo { private static final String INPUT_ARTIFACT_TYPE = "jar"; private static final String OUTPUT_ARTIFACT_TYPE = "deb"; private static final String DROP...
private Console log = new LogConsole(getLog());
7
AndyGu/ShanBay
src/com/shanbay/words/review/experience/ExpCategoryActivity.java
[ "public class ModelResponseException extends Exception\n{\n public static final int STATUS_CODE_CONNECT_EXCEPTION = 983040;\n public static final int STATUS_CODE_JSON_PARSE_EXCEPTION = 268369920;\n public static final int STATUS_CODE_NETWORK_404 = 268369921;\n public static final int STATUS_CODE_NETWORK_EXCEPTI...
import android.annotation.SuppressLint; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.LinearLayout.LayoutParams; import android.wid...
package com.shanbay.words.review.experience; public class ExpCategoryActivity extends WordsActivity { public static final int REQUEST_CODE_CATEGORY = 37; public static final int RESULT_CODE_CATEGORY = 38; private RadioButton[] mCategoryBtns; private LinearLayout mCategoryContainer;
private IndicatorWrapper mIndicatorWrapper;
3
onyxbits/TradeTrax
src/main/java/de/onyxbits/tradetrax/pages/tools/Importer.java
[ "public class IdentUtil {\n\n\t/**\n\t * For autocompletion using the name table\n\t * \n\t * @param session\n\t * database session to use\n\t * @param partial\n\t * what the user entered so far\n\t * @return list of matching labels\n\t */\n\t@SuppressWarnings(\"unchecked\")\n\tpublic static <T> L...
import java.io.StringReader; import java.sql.Timestamp; import java.text.DateFormat; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Vector; import org.apache.commons.csv.CSVFormat; import org.apache.commons.csv.CSVParser; import org.apache.commons.csv.CSVRecord; import org.apa...
package de.onyxbits.tradetrax.pages.tools; /** * Simple tool for batch importing CSV assets. * * @author patrick * */ public class Importer { @Inject private AlertManager alertManager; @Inject private SettingsStore settingsStore; @Inject private BeanModelSource ledgerSource; @Inject private Messa...
Variant v = stock.getVariant();
3
thx/RAP
src/main/java/com/taobao/rigel/rap/account/service/impl/AccountMgrImpl.java
[ "public class Notification {\n private int id;\n private int userId;\n private short typeId;\n private String param1;\n private String param2;\n private String param3;\n private Date createTime;\n private boolean isRead;\n private User user;\n private User targetUser;\n\n public Str...
import com.taobao.rigel.rap.account.bo.Notification; import com.taobao.rigel.rap.account.bo.User; import com.taobao.rigel.rap.account.dao.AccountDao; import com.taobao.rigel.rap.account.service.AccountMgr; import com.taobao.rigel.rap.common.config.PRIVATE_CONFIG; import com.taobao.rigel.rap.common.utils.CacheUtils; imp...
package com.taobao.rigel.rap.account.service.impl; public class AccountMgrImpl implements AccountMgr { private AccountDao accountDao; private OrganizationMgr organizationMgr;
private ProjectMgr projectMgr;
8
winzillion/FluxJava
demo-rx/src/main/java/com/example/fluxjava/rx/domain/stores/TodoStore.java
[ "public class TodoAction extends FluxAction<Integer, List<Todo>> {\n\n public TodoAction(final Integer inType, final List<Todo> inData) {\n super(inType, inData);\n }\n\n}", "public class Todo {\n\n public int id;\n public String title;\n public String dueDate;\n public String memo;\n ...
import com.example.fluxjava.rx.domain.actions.TodoAction; import com.example.fluxjava.rx.domain.models.Todo; import io.wzcodes.fluxjava.FluxContext; import io.wzcodes.fluxjava.IFluxAction; import io.wzcodes.fluxjava.IFluxBus; import io.wzcodes.fluxjava.rx.RxStore; import java.util.ArrayList; import static com.example.f...
/* * Copyright (C) 2016 Bugs will find a way (https://wznote.blogspot.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unl...
case TODO_ADD:
6
scriptkitty/SNC
unikl/disco/calculator/symbolic_math/ArrivalFactory.java
[ "public class SNC {\r\n\r\n private final UndoRedoStack undoRedoStack;\r\n private static SNC singletonInstance;\r\n private final List<Network> networks;\r\n private final int currentNetworkPosition;\r\n\r\n private SNC() {\r\n networks = new ArrayList<>();\r\n undoRedoStack = new Undo...
import unikl.disco.calculator.SNC; import unikl.disco.calculator.symbolic_math.functions.ConstantFunction; import unikl.disco.calculator.symbolic_math.functions.ExponentialSigma; import unikl.disco.calculator.symbolic_math.functions.PoissonRho; import unikl.disco.calculator.symbolic_math.functions.EBBSigma; import unik...
/* * (c) 2017 Michael A. Beck, Sebastian Henningsen * disco | Distributed Computer Systems Lab * University of Kaiserslautern, Germany * All Rights Reserved. * * This software is work in progress and is released in the hope that it will * be useful to the scientific community. It is provided "as is" with...
SymbolicFunction sigma = new ConstantFunction(0);
1
KMax/cqels
src/test/java/org/deri/cqels/SimpleQueriesTest.java
[ "public interface Mapping extends Map<Var, Long>{\n\t\n\n\tpublic long get(Var var); \n\t\n\tpublic void from(OpRouter router);\n\t\n\tpublic OpRouter from();\n\t\n\tpublic ExecContext getCtx();\n\t\n\tpublic Iterator<Var> vars();\n\t\n\tpublic void addParent(Mapping parent);\n\t\n\tpublic boolean hasParent();\n\t\...
import com.hp.hpl.jena.datatypes.xsd.XSDDatatype; import com.hp.hpl.jena.graph.Node; import com.hp.hpl.jena.graph.Triple; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import com.hp.hpl.jena.rdf.model.Statement; import static com.jayway.awaitility.Awaitility.await; import...
package org.deri.cqels; public class SimpleQueriesTest { private static final String STREAM_ID_PREFIX = "http://example.org/simpletest/test"; private static final String CQELS_HOME = "cqels_home";
private static ExecContext context;
3
NanYoMy/mybatis-generator
src/main/java/org/mybatis/generator/internal/PluginAggregator.java
[ "public class GeneratedXmlFile extends GeneratedFile {\n private Document document;\n\n private String fileName;\n\n private String targetPackage;\n\n private boolean isMergeable;\n \n private XmlFormatter xmlFormatter;\n\n /**\n * \n * @param document\n * @param fileName\n * @p...
import org.mybatis.generator.config.Context; import java.util.ArrayList; import java.util.List; import java.util.Properties; import org.mybatis.generator.api.GeneratedJavaFile; import org.mybatis.generator.api.GeneratedXmlFile; import org.mybatis.generator.api.Plugin; import org.mybatis.generator.api.IntrospectedColumn...
public boolean sqlMapSelectByPrimaryKeyElementGenerated(XmlElement element, IntrospectedTable introspectedTable) { boolean rc = true; for (Plugin plugin : plugins) { if (!plugin.sqlMapSelectByPrimaryKeyElementGenerated(element, introspectedTable)) { ...
Interface interfaze, IntrospectedTable introspectedTable) {
4
HubSpot/Rosetta
RosettaCore/src/test/java/com/hubspot/rosetta/RosettaMapperTest.java
[ "public class NestedBean {\n private InnerBean inner;\n\n public InnerBean getInner() {\n return inner;\n }\n\n public void setInner(InnerBean inner) {\n this.inner = inner;\n }\n}", "public class RosettaCreatorConstructorBean {\n private final String stringProperty;\n\n @RosettaCreator\n public Ros...
import com.hubspot.rosetta.beans.NestedBean; import com.hubspot.rosetta.beans.RosettaCreatorConstructorBean; import com.hubspot.rosetta.beans.RosettaCreatorMethodBean; import com.hubspot.rosetta.beans.RosettaNamingBean; import com.hubspot.rosetta.beans.RosettaValueBean; import com.hubspot.rosetta.beans.StoredAsJsonBean...
package com.hubspot.rosetta; public class RosettaMapperTest { private final ResultSet resultSet = Mockito.mock(ResultSet.class); private final ResultSetMetaData resultSetMetaData = Mockito.mock(ResultSetMetaData.class); private final List<String> tables = new ArrayList<String>(); private final List<String>...
StoredAsJsonBean bean = map(StoredAsJsonBean.class);
5
ZhaoKaiQiang/JianDan_AsyncHttpClient
app/src/main/java/com/socks/jiandan/adapter/FreshNewsAdapter.java
[ "public class Handler4FreshNews extends BaseJsonResponseHandler {\n\n public Handler4FreshNews(@NonNull OnHttpResponseCallBackImpl<ArrayList<FreshNews>> onHttpResponseCallBack) {\n super(onHttpResponseCallBack);\n }\n\n @Override\n protected void onSuccess(int statusCode, String rawJsonResponse) ...
import android.app.Activity; import android.content.Intent; import android.support.v7.widget.CardView; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.Animat...
} } @Override public void onViewDetachedFromWindow(ViewHolder holder) { if (isLargeMode) { holder.card.clearAnimation(); } else { holder.ll_content.clearAnimation(); } } @Override public ViewHolder onCreateViewHolder(ViewGroup parent, in...
ShowToast.Short(ConstantString.LOAD_NO_NETWORK);
2
kaklakariada/portmapper
src/main/java/org/chris/portmapper/gui/PortMapperView.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.Dimension; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.StringSelection; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import javax.swing.ActionMap; import javax.swing.BorderFactory; import javax.swing.JButton; imp...
routerPanel.add(new JLabel(app.getResourceMap().getString("mainFrame.router.external_address")), "align label"); //$NON-NLS-2$ externalIPLabel = new JLabel(app.getResourceMap().getString("mainFrame.router.not_connected")); routerPanel.add(externalIPLabel, "width 130!"); routerPanel.add(n...
} catch (final RouterException e) {
4
operator1/op1
op1/src/main/java/com/op1/aiff/ApplicationChunk.java
[ "public interface Chunk {\n\n /**\n * Returns the ID of this chunk.\n */\n ID getChunkID();\n\n /**\n * Returns the size in bytes of the data portion of the chunk. The count does not include the 8 bytes used by the\n * chunk ID and chunk size. Also, please note, when the data portion of a c...
import com.op1.iff.Chunk; import com.op1.iff.IffReader; import com.op1.iff.types.ID; import com.op1.iff.types.OSType; import com.op1.iff.types.SignedChar; import com.op1.iff.types.SignedLong; import com.op1.util.Check; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Lis...
package com.op1.aiff; public class ApplicationChunk implements Chunk { private final ID chunkId = ChunkType.APPLICATION.getChunkId(); // 4 bytes
private SignedLong chunkSize; // 4 bytes
5
socrata/datasync
src/main/java/com/socrata/datasync/validation/GISJobValidity.java
[ "public enum PublishMethod {\n replace, upsert, append, delete\n}", "public class SocrataConnectionInfo\n{\n public String url;\n public String user;\n public String password;\n private static String token;\n\n public SocrataConnectionInfo(String url, String user, String password)\n {\n ...
import com.socrata.datasync.PublishMethod; import com.socrata.datasync.SocrataConnectionInfo; import com.socrata.datasync.Utils; import com.socrata.datasync.config.CommandLineOptions; import com.socrata.datasync.job.GISJob; import com.socrata.datasync.job.JobStatus; import org.apache.commons.cli.CommandLine; import org...
package com.socrata.datasync.validation; public class GISJobValidity { public static final String GEOJSON_EXT = "geojson"; public static final String ZIP_EXT = "zip"; public static final String KML_EXT = "kml"; public static final String KMZ_EXT = "kmz"; public static final List<String> allowedGe...
if (!Utils.uidIsValid(job.getDatasetID())) {
2
crazyhitty/Munch
app/src/main/java/com/crazyhitty/chdev/ks/munch/ui/fragments/FeedsFragment.java
[ "public class FeedsPresenter implements IFeedsPresenter, OnFeedsLoadedListener {\n\n private IFeedsView mIFeedsView;\n private FeedsLoaderInteractor mFeedsLoaderInteractor;\n private Context mContext;\n\n public FeedsPresenter(IFeedsView mIFeedsView, Context context) {\n this.mIFeedsView = mIFeed...
import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView...
package com.crazyhitty.chdev.ks.munch.ui.fragments; /** * Created by Kartik_ch on 11/27/2015. */ public class FeedsFragment extends Fragment implements IFeedsView, SwipeRefreshLayout.OnRefreshListener { @Bind(R.id.linear_layout_empty_feeds) LinearLayout linearLayoutEmptyFeeds; @Bind(R.id.swipe_refre...
private FeedsPresenter mFeedsPresenter;
0
xylo/JErgometer
src/org/jergometer/model/UserData.java
[ "public class StreamUtils{\r\n /** Size of the temporary buffer. */\r\n private static int TEMPORARY_BUFFER_SIZE = 10000;\r\n\r\n /**\r\n * Reads from the input stream and returns the content as byte array.\r\n *\r\n * @param stream input stream\r\n * @return content of the stream\r\n * @exception IOEx...
import de.endrullis.utils.StreamUtils; import de.endrullis.xml.XMLDocument; import de.endrullis.xml.XMLElement; import de.endrullis.xml.XMLParser; import org.jergometer.JergometerSettings; import org.jergometer.control.BikeProgram; import javax.swing.*; import java.io.*; import java.util.ArrayList; import java.util.Arr...
package org.jergometer.model; /** * User data. */ public class UserData { private String userName; private ArrayList<BikeSession> sessions = new ArrayList<BikeSession>(); private ProgressMonitor progressMonitor; public UserData(String userName, BikeProgramTree programTree) { this.userName = userName; // ...
XMLElement root = doc.getRootElement();
2
onepf/OPFPush
samples/pushchat/src/main/java/org/onepf/pushchat/db/DatabaseHelper.java
[ "public static class ContactsContract {\n public static final String TABLE_NAME = \"contacts\";\n\n public static final Uri TABLE_URI = CONTENT_BASE_URI.buildUpon().appendPath(TABLE_NAME).build();\n public static final int ALL_URI_CODE = 2;\n public static final int URI_CODE = 3;\n\n public static cl...
import org.onepf.pushchat.model.db.Message; import java.util.HashSet; import java.util.Set; import android.content.AsyncQueryHandler; import android.content.ContentResolver; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabas...
/* * Copyright 2012-2015 One Platform Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
"CREATE TABLE " + ContactsContract.TABLE_NAME + " ( "
0
cwan/im-log-stats
im-log-stats-project/src/main/java/net/mikaboshi/intra_mart/tools/log_stats/ant/ParserParameterDataType.java
[ "public static class RequestLogLayout extends LogLayoutDataType {}", "public static class TransitionLogLayout extends LogLayoutDataType {}", "public class ExceptionLog extends Log {\n\n\t/**\n\t * 例外のグルーピングを何で行うか\n\t *\n\t * @since 1.0.8\n\t */\n\tpublic static enum GroupingType {\n\n\t\t/** スタックトレースの1行目 */\n\t...
import org.apache.tools.ant.types.DataType; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; import net.mikaboshi.intra_mart.tools.log_stats.ant.LogLayoutDataType.RequestLogLayout; import net.mikabo...
/* * 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 * distribut...
public ParserParameter toParserParameter(Version version) {
4
EsupPortail/esup-dematec
src/main/java/fr/univrouen/poste/web/admin/GalaxieEntryController.java
[ "@RooJavaBean\n@RooToString(excludeFields = {\"candidat\",\"poste\",\"candidature\"})\n@RooJpaActiveRecord(finders = { \"findGalaxieEntrysByNumEmploiAndNumCandidat\", \"findGalaxieEntrysByCandidat\", \"findGalaxieEntrysByCandidatIsNull\", \"findGalaxieEntrysByPosteIsNull\", \"findGalaxieEntrysByCandidatureIsNull\",...
import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.Vector; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.roo.addon.web.mvc.controller.scaffold.RooWebScaffold; ...
/** * Licensed to ESUP-Portail under one or more contributor license * agreements. See the NOTICE file distributed with this work for * additional information regarding copyright ownership. * * ESUP-Portail licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this fil...
GalaxieEntryService galaxieEntryService;
4
B2MSolutions/reyna
reyna-test/src/com/b2msolutions/reyna/DispatcherTest.java
[ "public enum Result {\n OK, PERMANENT_ERROR, TEMPORARY_ERROR, BLACKOUT, NOTCONNECTED\n}", "public class Time {\n\n private final int minuteOfDay;\n\n public Time(int hour, int minute) {\n if(hour >= 24 || minute >= 60 || hour < 0 || minute < 0) {\n throw new InvalidParameterException(\"...
import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.ConnectivityManager; import android.net.NetworkInfo; import com.b2msolutions.reyna.Dispatcher.Result; import com.b2msolutions.reyna.blackout.Time; import co...
package com.b2msolutions.reyna; @Config(shadows = {ShadowAndroidHttpClient.class}) @RunWith(RobolectricTestRunner.class) public class DispatcherTest { private Context context; private Intent batteryStatus; @Mock NetworkInfo networkInfo; @Mock Date now; @Before public void setup() { ...
TimeRange range = new TimeRange(new Time(hourOfDay - 1, 0), new Time(hourOfDay + 1, 0));
2
mathisdt/trackworktime
app/src/main/java/org/zephyrsoft/trackworktime/report/CsvGenerator.java
[ "public class DAO {\n\n\t// TODO use prepared statements as described here: http://stackoverflow.com/questions/7255574\n\n\tprivate volatile SQLiteDatabase db;\n\tprivate final MySQLiteHelper dbHelper;\n\tprivate final Context context;\n\tprivate final WorkTimeTrackerBackupManager backupManager;\n\tprivate final Ba...
import androidx.arch.core.util.Function; import org.pmw.tinylog.Logger; import org.supercsv.cellprocessor.CellProcessorAdaptor; import org.supercsv.cellprocessor.Optional; import org.supercsv.cellprocessor.constraint.NotNull; import org.supercsv.cellprocessor.ift.CellProcessor; import org.supercsv.io.CsvBeanWriter; imp...
/* * This file is part of TrackWorkTime (TWT). * * TWT is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License 3.0 as published by * the Free Software Foundation. * * TWT is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without...
public String createSumsCsv(Map<Task, TimeSum> sums) {
5
bhatti/RxJava8
src/main/java/com/plexobject/rx/impl/ObservableDelegate.java
[ "public interface Observable<T> {\n /**\n * This method allows user to create Observable by passing a consumer\n * function for notifying subscribers.\n * \n * @param consumer\n * function that implements Consumer function\n * @return instance of Observable\n */\n public...
import java.util.Comparator; import java.util.List; import java.util.Objects; import java.util.Set; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Stream; import com.plexobject.rx.Observable; import com.plexobject.rx.OnCompletion; imp...
package com.plexobject.rx.impl; /** * This is implementation of Observable that uses user-specified consumer * function to notify subscriber for data and errors * * @author Shahzad Bhatti * * @param <T> * type of subscription data */ public class ObservableDelegate<T> implements Observable<T> { ...
public Observable<T> subscribeOn(Scheduler scheduler) {
3
zutherb/build-light
app/buildlight/src/main/java/com/github/zutherb/buildlight/application/job/ColorSwitcher.java
[ "public interface BuildServerAdapter {\n java.util.List<BuildState> getCurrentBuildState();\n}", "public class BuildServerAdapterFactory {\n\n private final static Reflections reflections = new Reflections(\"com.github.zutherb.buildlight.application.adapter\");\n\n public static BuildServerAdapter create...
import com.github.zutherb.buildlight.application.adapter.BuildServerAdapter; import com.github.zutherb.buildlight.application.adapter.BuildServerAdapterFactory; import com.github.zutherb.buildlight.application.adapter.BuildState; import com.github.zutherb.buildlight.common.driver.core.TrafficLight; import com.github.zu...
package com.github.zutherb.buildlight.application.job; /** * @author zutherb */ @Component public class ColorSwitcher { private static final Logger LOGGER = LoggerFactory.getLogger(ColorSwitcher.class);
private TrafficLight light;
3
MrStahlfelge/gdx-gamesvcs
core/src/de/golfgl/gdxgamesvcs/MockGameServiceClient.java
[ "public interface IAchievement {\n\n /**\n * Returns the achievementId for this achievement\n * Note that this might be an internal id from the game service. For game services where you defined a\n * mapping, use {@link #isAchievementId} which respects mappings\n *\n * @return achievementId\n...
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Timer; import de.golfgl.gdxgamesvcs.achievement.IAchievement; import de.golfgl.gdxgamesvcs.achievement.IFetchAchievementsResponseListener; import de.golfgl.gdxgamesvcs.gamestate.IFetchGameStatesListResponseListener; import de.golfgl.gdxgamesvcs.gamestat...
package de.golfgl.gdxgamesvcs; /** * This is a mock implementation of {@link IGameServiceClient}. Useful during * development phase when you don't want to connect to an existing service but just * test your application behavior against service responses. * * It emulate network latencies with a fixed sleep time,...
abstract protected Array<IAchievement> getAchievements();
0
hitherejoe/Pickr
app/src/androidTest/java/com/hitherejoe/pickr/injection/TestComponentRule.java
[ "public class PickrApplication extends Application {\n\n ApplicationComponent mApplicationComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n if (BuildConfig.DEBUG) Timber.plant(new Timber.DebugTree());\n\n mApplicationComponent = DaggerApplicationComponent.builde...
import android.support.test.InstrumentationRegistry; import com.hitherejoe.pickr.PickrApplication; import com.hitherejoe.pickr.data.local.DatabaseHelper; import com.hitherejoe.pickr.injection.component.DaggerTestComponent; import com.hitherejoe.pickr.injection.component.TestComponent; import com.hitherejoe.pickr.inject...
package com.hitherejoe.pickr.injection; /** * Test rule that creates and sets a Dagger TestComponent into the application overriding the * existing application component. * Use this rule in your test case in order for the app to use mock dependencies. * It also exposes some of the dependencies so they can be ...
public TestDataManager getDataManager() {
4
lastfm/lastcommons-kyoto
src/main/java/fm/last/commons/kyoto/factory/CursorAdapter.java
[ "public enum AccessType {\n READ_WRITE(true),\n READ_ONLY(false);\n\n private boolean value;\n\n private AccessType(boolean value) {\n this.value = value;\n }\n\n public boolean value() {\n return value;\n }\n}", "public enum CursorStep {\n /** Advance to the next record */\n NEXT_RECORD(true),\n ...
import java.io.IOException; import kyotocabinet.Cursor; import kyotocabinet.Error; import fm.last.commons.kyoto.AccessType; import fm.last.commons.kyoto.CursorStep; import fm.last.commons.kyoto.KyotoCursor; import fm.last.commons.kyoto.ReadOnlyVisitor; import fm.last.commons.kyoto.WritableVisitor; import fm.last.common...
/* * Copyright 2012 Last.fm * * 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...
errorHandler.wrapVoidCall(delegate.accept(new ReadOnlyVisitorAdapter(visitor), AccessType.READ_ONLY.value(),
0
gdi-by/downloadclient
src/test/java/de/bayern/gdi/Issue85Test.java
[ "@XmlRootElement(name = \"DownloadSchritt\")\n@XmlAccessorType(XmlAccessType.FIELD)\npublic class DownloadStep {\n\n @XmlElement(name = \"ServiceTyp\")\n private String serviceType;\n\n @XmlElement(name = \"URL\")\n private String serviceURL;\n\n @XmlElement(name = \"DownloadPfad\")\n private Stri...
import de.bayern.gdi.processor.job.ExternalProcessJob; import de.bayern.gdi.processor.job.Job; import de.bayern.gdi.processor.ProcessingStepConverter; import de.bayern.gdi.config.Config; import de.bayern.gdi.utils.StringUtils; import junit.framework.TestCase; import org.junit.Before; import org.junit.Test; import java....
/* * DownloadClient Geodateninfrastruktur Bayern * * (c) 2016 GSt. GDI-BY (gdi.bayern.de) * * 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/LICE...
Config.initialize(null);
5
tupilabs/tap4j
src/test/java/org/tap4j/consumer/issue3504508/TestIssue3504508.java
[ "public class BaseTapTest {\n\n /**\n * Get a test set for a given file name.\n * @param name File name.\n * @return Test Set.\n */\n protected TestSet getTestSet(String name) {\n return this.getTestSet(new Tap13Parser(), name);\n }\n\n /**\n * Get a test set for given parser ...
import org.tap4j.BaseTapTest; import org.tap4j.consumer.TapConsumer; import org.tap4j.consumer.TapConsumerFactory; import org.tap4j.model.TestSet; import org.tap4j.parser.Tap13Parser; import org.tap4j.producer.Producer; import org.tap4j.producer.TapProducer; import static org.junit.Assert.assertEquals; import static or...
/* * The MIT License * * Copyright (c) 2010 tap4j team (see AUTHORS) * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * t...
final TestSet testSet = getTestSet(new Tap13Parser(/* enable subtests*/ true), "/org/tap4j/consumer/issue3504508/sample.tap");
3
OpsLabJPL/MarsImagesAndroid
MarsImages/MarsImages/src/main/java/gov/nasa/jpl/hi/marsimages/models/ImageQuad.java
[ "public abstract class Rover {\n\n public static final String CURIOSITY = \"Curiosity\";\n public static final String OPPORTUNITY = \"Opportunity\";\n public static final String SPIRIT = \"Spirit\";\n\n public static final String TAG = \"Rover\";\n\n static final String SOL = \"Sol\";\n static fin...
import android.graphics.Bitmap; import android.util.Log; import android.view.View; import com.evernote.edam.type.Note; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.assist.FailReason; import com.nostra13.universalimageloader.core.assist.ImageSize; import com.no...
} private void getImageVertices(Model model, double[] qLL, float[][] vertices, float distance) { Rover mission = MARS_IMAGES.getMission(); double eye[] = new double[3]; double pos[] = new double[2], pos3[] = new double[3], vec3[] = new double[3]; double pos3LL[]= new double[3],...
final String uri = EVERNOTE.getUri(photo.getResources().get(0));
7
davemckain/jacomax
jacomax-samples/src/main/java/uk/ac/ed/ph/jacomax/samples/InteractiveProcessExample.java
[ "public final class JacomaxSimpleConfigurator {\n\n private static final Logger logger = LoggerFactory.getLogger(JacomaxSimpleConfigurator.class);\n\n /** Enumerate the methods we'll use to obtain a MaximaConfiguration here */\n public enum ConfigMethod {\n /** Use {@link JacomaxAutoConfigurator} */...
import uk.ac.ed.ph.jacomax.MaximaInteractiveProcess; import uk.ac.ed.ph.jacomax.MaximaProcessLauncher; import uk.ac.ed.ph.jacomax.utilities.MaximaOutputUtilities; import uk.ac.ed.ph.jacomax.JacomaxSimpleConfigurator; import uk.ac.ed.ph.jacomax.MaximaConfiguration;
/* Copyright (c) 2010 - 2012, The University of Edinburgh. * 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 above copyright notice, this...
final MaximaInteractiveProcess process = launcher.launchInteractiveProcess();
2
ailab-uniud/distiller-CORE
src/main/java/it/uniud/ailab/dcore/wrappers/external/OpenNlpBootstrapperAnnotator.java
[ "public class AnnotationException extends RuntimeException {\n \n public AnnotationException(Annotator sender, String message) {\n super(\"Error while annotating\\n\\t\" + \n \"Annotator \" + sender.getClass().getName() + \n \" caused an exception with message:\\n\\t\" + m...
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.util.HashMap; import java.util.Map; import opennlp.tools.postag.POSModel; import opennlp.tools.postag.POSTaggerME; import opennlp.tools.sen...
/* * Copyright (C) 2015 Artificial Intelligence * Laboratory @ University of Udine. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option...
((DocumentComposite) component).addComponent(sentence);
4
kciray8/IronBrain
IBServer/src/test/java/com/springapp/mvc/AppTests.java
[ "@Component\npublic class IB {\n @Autowired\n private ServletContext context;\n\n //For testing purpose\n private static long msOffset = 0;\n\n public static Random rand() {\n return random;\n }\n\n public static void setRandom(Random random) {\n IB.random = random;\n }\n\n ...
import com.google.common.base.Joiner; import org.apache.commons.lang3.RandomStringUtils; import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.tuple.Pair; import org.ironbrain.IB; import org.ironbrain.MainController; import org.ironbrain.Result; import org.ironbrain.SessionData; import org.ironbr...
package com.springapp.mvc; @RunWith(SpringJUnit4ClassRunner.class) @WebAppConfiguration @ContextConfiguration("file:src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml")
public class AppTests extends AllDao {
4
idega/com.idega.xformsmanager
src/java/com/idega/xformsmanager/component/impl/FormComponentStaticImpl.java
[ "public interface ComponentStatic extends Component {\n\n\tpublic abstract PropertiesStatic getProperties();\n}", "public interface PropertiesStatic extends PropertiesComponent {\n\n\tpublic abstract LocalizedStringBean getText();\n\n\tpublic abstract void setText(LocalizedStringBean text);\n}", "public class C...
import com.idega.xformsmanager.business.component.ComponentStatic; import com.idega.xformsmanager.business.component.properties.PropertiesStatic; import com.idega.xformsmanager.component.properties.impl.ComponentPropertiesStatic; import com.idega.xformsmanager.component.properties.impl.ConstUpdateType; import com.idega...
package com.idega.xformsmanager.component.impl; /** * @author <a href="mailto:civilis@idega.com">Vytautas Čivilis</a> * @version $Revision: 1.2 $ Last modified: $Date: 2009/04/29 10:47:09 $ by $Author: civilis $ */ public class FormComponentStaticImpl extends FormComponentOutputImpl implements ComponentSta...
public XFormsManagerPlain getXFormsManager() {
4
cloud-software-foundation/c5-replicator
c5-replicator/src/main/java/c5db/replication/ReplicatorInstance.java
[ "public class ReplicatorConstants {\n public static final int REPLICATOR_PORT_MIN = 1024;\n\n public static final Path REPLICATOR_QUORUM_FILE_ROOT_DIRECTORY_RELATIVE_PATH = Paths.get(\"repl\");\n public static final String REPLICATOR_PERSISTER_FILE_NAME = \"replication-data\";\n public static final int REPLICAT...
import c5db.ReplicatorConstants; import c5db.interfaces.replication.IndexCommitNotice; import c5db.interfaces.replication.QuorumConfiguration; import c5db.interfaces.replication.Replicator; import c5db.interfaces.replication.ReplicatorInstanceEvent; import c5db.interfaces.replication.ReplicatorLog; import c5db.interfac...
/* * Copyright 2014 WANdisco * * WANdisco licenses this file to you under the Apache License, * version 2.0 (the "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by ap...
private final ReplicatorLog log;
3
contentful/contentful.java
src/test/java/com/contentful/java/cda/integration/IntegrationWithMasterEnvironment.java
[ "public class CDAAsset extends LocalizedResource {\n\n private static final long serialVersionUID = -4645571481643616657L;\n\n /**\n * @return title of this asset.\n */\n public String title() {\n return getField(\"title\");\n }\n\n /**\n * @return url to the file of this asset.\n */\n public Strin...
import com.contentful.java.cda.CDAAsset; import com.contentful.java.cda.CDAClient; import com.contentful.java.cda.CDAEntry; import com.contentful.java.cda.CDALocale; import com.contentful.java.cda.CDASpace; import com.contentful.java.cda.LocalizedResource; import com.contentful.java.cda.SynchronizedSpace; import java.u...
package com.contentful.java.cda.integration; public class IntegrationWithMasterEnvironment extends Integration { @Override public void setUp() { client = CDAClient.builder() .setSpace("5s4tdjmyjfpl") .setToken("84017d3a5da6d3ae9c733c6c210c55eebc3da033730b4e5093a6e6aa099b4995") .setEnvi...
final CDALocale found = client.fetch(CDALocale.class).one("4pPeIa89F7KD3G1q47eViY");
3
eriq-augustine/jocr
src/com/eriqaugustine/ocr/classifier/CharacterClassifier.java
[ "public abstract class FeatureVectorReducer {\n protected final int inputSize;\n protected int outputSize;\n\n public FeatureVectorReducer(int inputSize) {\n this(inputSize, -1);\n }\n\n public FeatureVectorReducer(int inputSize, int outputSize) {\n this.inputSize = inputSize;\n this.output...
import com.eriqaugustine.ocr.classifier.reduce.FeatureVectorReducer; import com.eriqaugustine.ocr.image.CharacterImage; import com.eriqaugustine.ocr.image.WrapImage; import com.eriqaugustine.ocr.utils.ListUtils; import com.eriqaugustine.ocr.utils.StringUtils; import com.eriqaugustine.ocr.utils.MapUtils; import org.apac...
package com.eriqaugustine.ocr.classifier; /** * A classifier specialized for ORCing characters. */ public abstract class CharacterClassifier extends VectorClassifier<WrapImage> implements OCRClassifier { private static Logger logger = LogManager.getLogger(CharacterClassifier.class.getName()); p...
StringUtils.charSplit(characters),
4
aldebaran/jnaoqi
examples/desktop/HelloDesktop/src/com/aldebaran/demo/ExSmileDetector.java
[ "public interface EventCallback<T> {\n\t/**\n\t * Call when an Event is raised\n\t *\n\t * @param value the value return by the event, you can get the type in aldebaran doc\n\t * */\n\tpublic void onEvent(T value) throws InterruptedException, CallError;\n}", "public class ALBasicAwareness extends ALProxy {\n\n ...
import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.aldebaran.qi.Application; import com.aldebaran.qi.CallError; import com.aldebaran.qi.helper.EventCallback; import com.aldebaran.qi.helper.proxies.ALBasicAwareness; import com.aldebaran.qi.helper.proxies.ALFaceCharacteristics; im...
/** * Copyright (c) 2015 Aldebaran Robotics. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the COPYING file. * Created by epinault on 25/09/2014. */ package com.aldebaran.demo; /** * Works only on a real robot. This example shows how the robot is capa...
private static ALFaceCharacteristics faceCharac;
2
TooTallNate/Java-WebSocket
src/main/java/org/java_websocket/extensions/permessage_deflate/PerMessageDeflateExtension.java
[ "public enum Opcode {\n CONTINUOUS, TEXT, BINARY, PING, PONG, CLOSING\n // more to come\n}", "public abstract class CompressionExtension extends DefaultExtension {\n\n @Override\n public void isFrameValid(Framedata inputFrame) throws InvalidDataException {\n if ((inputFrame instanceof DataFrame) && (inputF...
import java.io.ByteArrayOutputStream; import java.nio.ByteBuffer; import java.util.LinkedHashMap; import java.util.Map; import java.util.zip.DataFormatException; import java.util.zip.Deflater; import java.util.zip.Inflater; import org.java_websocket.enums.Opcode; import org.java_websocket.exceptions.InvalidDataExceptio...
package org.java_websocket.extensions.permessage_deflate; /** * PerMessage Deflate Extension (<a href="https://tools.ietf.org/html/rfc7692#section-7">7&#46; The * "permessage-deflate" Extension</a> in * <a href="https://tools.ietf.org/html/rfc7692">RFC 7692</a>). * * @see <a href="https://tools.ietf.org/html/rfc...
if (!(inputFrame instanceof ContinuousFrame)) {
5
rapidpro/surveyor
app/src/main/java/io/rapidpro/surveyor/activity/LoginActivity.java
[ "public class Logger {\n\n private static final String TAG = \"Surveyor\";\n\n public static void e(String message, Throwable t) {\n Log.e(TAG, message, t);\n }\n\n public static void w(String message) {\n Log.w(TAG, message);\n }\n\n public static void d(String message) {\n L...
import android.Manifest; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import android.view.KeyEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.inpu...
package io.rapidpro.surveyor.activity; /** * A login screen that offers login via email/password. */ public class LoginActivity extends BaseActivity { // UI references. private AutoCompleteTextView m_emailView; private EditText m_passwordView; private View m_progressView; private View m_log...
List<Token> tokens = response.body().getTokens();
4
hlavki/g-suite-identity-sync
services/facade/src/main/java/eu/hlavki/identity/services/rest/security/GSuiteGroupAuthorizationFilter.java
[ "public interface AppConfiguration {\n\n Optional<String> getExternalAccountsGroup();\n\n\n void setExternalAccountsGroup(String groupName);\n}", "public interface GSuiteDirectoryService {\n\n /**\n * Retrieve all groups for a member.\n *\n * @param userKey The userKey can be the user's prima...
import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import eu.hlavki.identity.services.config.AppConfiguration; import eu.hlavki.identity.services.google.GSuiteDirectoryService; import eu.hlavki.identity.services.google.NoPrivateKeyException; import eu.hlavki.identity.services.google.Resour...
package eu.hlavki.identity.services.rest.security; @Priority(Priorities.AUTHORIZATION) public class GSuiteGroupAuthorizationFilter implements ContainerRequestFilter { private static final Logger LOG = LoggerFactory.getLogger(GSuiteGroupAuthorizationFilter.class); private final Supplier<Set<String>> external...
private final GSuiteDirectoryService gsuiteDirService;
1
ibcn-cloudlet/firefly
be.iminds.iot.things.rule.engine.provider/src/be/iminds/iot/things/rule/factory/SimpleRuleFactory.java
[ "public interface Button extends Thing {\n\n public final static String STATE = \"state\";\n\n public static enum State {\n \tPRESSED, RELEASED, UP, DOWN\n }\n\n public State getState();\n\n}", "public interface Lamp extends Thing {\n\n public final static String STATE = \"state\";\n public f...
import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.stream.Collectors; import org.osgi.service.component.annotations.Activate; import org.osgi.service.component.annotations.Component; import be.iminds.iot.things.api.button.Button; import be.iminds.iot.things.api.lamp.Lamp; imp...
/******************************************************************************* * Copyright (c) 2015, Tim Verbelen * Internet Based Communication Networks and Services research group (IBCN), * Department of Information Technology (INTEC), Ghent University - iMinds. * All rights reserved. * * Redistribution ...
public Rule createRule(RuleDTO dto)
4
FlareBot/FlareBot
src/main/java/stream/flarebot/flarebot/commands/currency/CurrencyCommand.java
[ "public enum CommandType {\n\n GENERAL(true),\n MODERATION(true),\n MUSIC(true),\n USEFUL(false),\n CURRENCY(false),\n RANDOM(false),\n INFORMATIONAL(false),\n SECRET(false, Constants.DEVELOPER_ID),\n INTERNAL(false, Constants.ADMINS_ID, Constants.CONTRIBUTOR_ID, Constants.DEVELOPER_ID);\...
import net.dv8tion.jda.core.EmbedBuilder; import net.dv8tion.jda.core.entities.*; import stream.flarebot.flarebot.commands.Command; import stream.flarebot.flarebot.commands.CommandType; import stream.flarebot.flarebot.objects.GuildWrapper; import stream.flarebot.flarebot.permissions.Permission; import stream.flarebot.f...
package stream.flarebot.flarebot.commands.currency; public class CurrencyCommand implements Command { @Override public void onCommand(User sender, GuildWrapper guild, TextChannel channel, Message message, String[] args, Member member) { if (args.length >= 1) { if (args.length == 1) { ...
public Permission getPermission() {
2
AfterLifeLochie/fontbox
src/main/java/net/afterlifelochie/fontbox/layout/components/LineWriter.java
[ "public class TextFormat implements Cloneable {\r\n\r\n\tpublic final EnumSet<DecorationStyle> decorations;\r\n\tpublic final GLFont font;\r\n\tpublic final ColorFormat color;\r\n\r\n\tpublic TextFormat(GLFont font) {\r\n\t\tthis(font, EnumSet.noneOf(DecorationStyle.class), null);\r\n\t}\r\n\r\n\tpublic TextFormat(...
import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.Map.Entry; import net.afterlifelochie.fontbox.document.formatting.TextFormat; import net.afterlifelochie.fontbox.document.property.AlignmentMode; import net.afterlifelochie.fontbox.docume...
package net.afterlifelochie.fontbox.layout.components; public class LineWriter { /** The writer stream */ private final PageWriter writer; /** The alignment writing in */ private final AlignmentMode alignment; /** The list of words on the stack currently */ private final ArrayList<String> words; ...
bounds = new ObjectBounds(x, y, width, height, FloatMode.NONE);
2
cqyijifu/OpenFalcon-SuitAgent
src/main/java/com/yiji/falcon/agent/Agent.java
[ "@Getter\npublic enum AgentConfiguration {\n\n INSTANCE;\n\n //版本不能大于 x.9\n public static final float VERSION = (float) 11.8;\n\n /**\n * quartz配置文件路径\n */\n private String quartzConfPath = null;\n /**\n * push到falcon的地址\n */\n private String agentPushUrl = null;\n\n /**\n ...
import com.yiji.falcon.agent.config.AgentConfiguration; import com.yiji.falcon.agent.jmx.JMXConnection; import com.yiji.falcon.agent.plugins.util.PluginExecute; import com.yiji.falcon.agent.plugins.util.PluginLibraryHelper; import com.yiji.falcon.agent.util.*; import com.yiji.falcon.agent.vo.HttpResult; import com.yiji...
serverSocketChannel.socket().bind(new InetSocketAddress(port)); Thread.setDefaultUncaughtExceptionHandler((t, e) -> { log.error("线程 {} 未处理的异常",t.getName(),e); }); work(); //阻塞式方式进行客户端连接操作,连接成功后,单独启动线程进行客户端的读写操作 for(;;){ try { Soc...
PluginExecute.start();
2
daileyet/openlibs.easywebframework
src/main/java/com/openthinks/easyweb/monitor/WebProcessMonitor.java
[ "public final class WebStatic {\r\n\r\n\tpublic static final String WEB_ROOT = \"EasyWeb_Container\";\r\n\tpublic static final String WEB_CONFIGURE = \"EasyWeb_Configure\";\r\n\tpublic static final String WEB_CONTROLLER = \"EasyWeb_Controller\";\r\n\tpublic static final String WEB_FILTER = \"EasyWeb_Filter\";\r\n\t...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.Properties; import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpSer...
package com.openthinks.easyweb.monitor; /** * Servlet implementation class WebProcessMonitor<BR> * Simple monitor for all the configured {@link Controller} */ public class WebProcessMonitor extends HttpServlet { private static final long serialVersionUID = 1L; public static final String TEMPLATE_RES...
String remoteEnable_ = (String) WebContexts.getServletContext()
8
rtyley/mini-git-server
mini-git-server-sshd/src/main/java/com/google/gerrit/sshd/SshDaemon.java
[ "public class Version {\n private static final String version;\n\n public static String getVersion() {\n return version;\n }\n\n static {\n version = loadVersion();\n }\n\n private static String loadVersion() {\n InputStream in = Version.class.getResourceAsStream(\"Version\");\n if (in == null) {\...
import com.google.gerrit.common.Version; import com.google.gerrit.lifecycle.LifecycleListener; import com.google.gerrit.server.config.ConfigUtil; import com.google.gerrit.server.config.GerritServerConfig; import com.google.gerrit.server.ssh.SshInfo; import com.google.gerrit.server.util.IdGenerator; import com.google.ge...
// Copyright (C) 2008 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 applicable ...
final KeyPairProvider hostKeyProvider, final IdGenerator idGenerator,
4
nidi3/raml-tester-proxy
raml-tester-client/src/main/java/guru/nidi/ramlproxy/core/Command.java
[ "public class UsageDatas extends HashMap<String, UsageData> {\n\n}", "public class ValidationData {\n private final String ramlTitle;\n private final List<String> validationViolations;\n\n public ValidationData(@JsonProperty(\"ramlTitle\") String ramlTitle,\n @JsonProperty(\"vali...
import java.util.ArrayList; import java.util.List; import java.util.Map; import com.fasterxml.jackson.databind.ObjectMapper; import guru.nidi.ramlproxy.data.UsageDatas; import guru.nidi.ramlproxy.data.ValidationData; import guru.nidi.ramlproxy.data.ViolationData; import guru.nidi.ramlproxy.data.ViolationDatas; import g...
/* * Copyright © 2014 Stefan Niederhauser (nidin@gmx.ch) * * 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...
final ViolationDatas res = new ViolationDatas();
3
nickyangjun/EasyEmoji
app/src/main/java/org/nicky/easyemoji/lovedEmoji/LovedEmojiFragment.java
[ "public abstract class EmojiFragment<T extends Parcelable> extends Fragment {\n\n protected OnEmojiconClickedListener mOnEmojiconClickedListener;\n\n protected Bundle saveState = new Bundle();\n\n final public void setEmojiData(PageEmojiStyle<T> emojiData){\n saveState.putParcelable(\"emojiData\",em...
import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import org.nicky.libeasye...
package org.nicky.easyemoji.lovedEmoji; /** * Created by nickyang on 2017/4/1. */ public class LovedEmojiFragment<T extends Emoji> extends EmojiFragment { private LovedPageEmojiStyle<T> emojiconData; private RecyclerView mRecyclerView; private EmojiAdapter mEmojiAdapter; @Override
public void setData(PageEmojiStyle emojiData) {
1
andyiac/githot
app/src/main/java/com/knight/arch/module/HomeModule.java
[ "public class MainActivity extends InjectableActivity {\n\n private HotUsersMainFragment hotUsersFragment;\n private HotReposMainFragment hotReposFragment;\n private TrendingReposMainFragment trendingReposMainFragment;\n\n private DrawerLayout mDrawerLayout;\n private ActionBar ab;\n private Spinn...
import com.knight.arch.ui.MainActivity; import com.knight.arch.ui.base.InjectableActivity; import com.knight.arch.ui.fragment.LoginDialogFragment; import com.knight.arch.ui.fragment.RankingReposFragment; import com.knight.arch.ui.fragment.RankingUsersFragment; import com.knight.arch.ui.fragment.TrendingReposFragment; i...
package com.knight.arch.module; /** * @author andyiac * @date 15-8-4 * @web http://blog.andyiac.com/ */ @Module( complete = false, injects = { MainActivity.class, RankingReposFragment.class,
RankingUsersFragment.class,
4
copygirl/BetterStorage
src/main/java/net/mcft/copy/betterstorage/inventory/InventoryCraftingStation.java
[ "public final class BetterStorageCrafting {\n\t\n\tpublic static final List<IStationRecipe> recipes = new ArrayList<IStationRecipe>();\n\t\n\tprivate BetterStorageCrafting() { }\n\t\n\t/** Adds a station recipe to the recipe list. */\n\tpublic static void addStationRecipe(IStationRecipe recipe) { recipes.add(recip...
import java.util.Arrays; import net.mcft.copy.betterstorage.api.crafting.BetterStorageCrafting; import net.mcft.copy.betterstorage.api.crafting.ContainerInfo; import net.mcft.copy.betterstorage.api.crafting.CraftingSourceTileEntity; import net.mcft.copy.betterstorage.api.crafting.ICraftingSource; import net.mcft.copy.b...
package net.mcft.copy.betterstorage.inventory; public class InventoryCraftingStation extends InventoryBetterStorage { public TileEntityCraftingStation entity = null; public final ItemStack[] crafting; public final ItemStack[] output; public final ItemStack[] contents; public StationCrafting currentCraftin...
currentCrafting = BetterStorageCrafting.findMatchingStationCrafting(crafting);
0
Elopteryx/upload-parser
upload-parser-tests/src/test/java/com/github/elopteryx/upload/internal/BlockingUploadParserTest.java
[ "@FunctionalInterface\npublic interface OnError {\n\n /**\n * The consumer function to implement.\n * @param context The upload context\n * @param throwable The error that occurred\n * @throws IOException If an error occurs with the IO\n * @throws ServletException If and error occurred with t...
import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.when; import com.github.elopteryx.upload.OnError; import com.github.elopteryx.upload.OnPartBegin; import c...
package com.github.elopteryx.upload.internal; class BlockingUploadParserTest implements OnPartBegin, OnPartEnd, OnError { private final List<ByteArrayOutputStream> strings = new ArrayList<>(); @Test void this_should_end_with_multipart_exception() throws Exception { final var request = Serv...
public PartOutput onPartBegin(final UploadContext context, final ByteBuffer buffer) {
4
tagsys/tagbeat
src/main/java/org/tagsys/tagbeat/TagbeatServer.java
[ "public class ChangeFrameSize implements Command{\n\n\tint Q;\n\t\n\tpublic ChangeFrameSize(int Q){\n\t\tthis.Q = Q;\n\t}\n\t\n\t@Override\n\tpublic void execute() {\n\t\tCompressiveReading.instance().changeFrameSize(Q);\n\t}\n\t\n}", "public class ChangeSampleNumber implements Command{\n\n\tint N=5000;\n\t\n\tpu...
import java.awt.Desktop; import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; imp...
package org.tagsys.tagbeat; public class TagbeatServer { private static Gson gson = new Gson(); private static WebSocketClient socketClient; private static Processor processor; public static void main(String[] args) throws URISyntaxException { System.out.println("start tagbeat..."); Spark.port(9001...
processor.addCommmand(new ChangeSparsity(Integer.parseInt(KString)));
2
m4rciosouza/ponto-inteligente-api
src/test/java/com/kazale/pontointeligente/api/controllers/LancamentoControllerTest.java
[ "public class LancamentoDto {\n\t\n\tprivate Optional<Long> id = Optional.empty();\n\tprivate String data;\n\tprivate String tipo;\n\tprivate String descricao;\n\tprivate String localizacao;\n\tprivate Long funcionarioId;\n\n\tpublic LancamentoDto() {\n\t}\n\n\tpublic Optional<Long> getId() {\n\t\treturn id;\n\t}\n...
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Optional; import org.junit.Test; import org.junit.runner.RunWith; i...
package com.kazale.pontointeligente.api.controllers; @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc @ActiveProfiles("test") public class LancamentoControllerTest { @Autowired private MockMvc mvc; @MockBean private LancamentoService lancamentoService; @MockBean private FuncionarioServ...
Lancamento lancamento = obterDadosLancamento();
2
daquexian/chaoli-forum-for-android-2
app/src/main/java/com/daquexian/chaoli/forum/view/ReplyAction.java
[ "@SuppressWarnings({\"unused\", \"WeakerAccess\"})\r\npublic class Constants\r\n{\r\n\tpublic static final String APP_NAME = \"chaoli\";\t\t// for shared preference\r\n\tpublic static final String APP_DIR_NAME = \"ChaoLi\";\t// for directory where save attachments\r\n\tpublic static final int paddingLeft = 16;\r\n\...
import android.app.ProgressDialog; import android.content.Context; import android.content.DialogInterface; import android.databinding.DataBindingUtil; import android.databinding.Observable; import android.databinding.ObservableBoolean; import android.os.Bundle; import android.support.annotation.NonNull; import android....
package com.daquexian.chaoli.forum.view; public class ReplyAction extends BaseActivity { public static final String TAG = "ReplyAction"; public static final int FLAG_NORMAL = 0; public static final int FLAG_REPLY = 1; public static final int FLAG_EDIT = 2; private static final int MENU_REPLY = 2; private s...
if (!LoginUtils.isLoggedIn()){
2
excelsior-oss/excelsior-jet-api
src/main/java/com/excelsiorjet/api/tasks/config/excelsiorinstaller/InstallationDirectory.java
[ "public class ExcelsiorJet {\n\n private final JetHome jetHome;\n private final Log logger;\n\n private JetEdition edition;\n private OS targetOS;\n private CpuArch targetCpu;\n\n public ExcelsiorJet(JetHome jetHome, Log logger) throws JetHomeException {\n this.jetHome = jetHome;\n t...
import com.excelsiorjet.api.ExcelsiorJet; import com.excelsiorjet.api.tasks.JetProject; import com.excelsiorjet.api.tasks.JetTaskFailureException; import com.excelsiorjet.api.tasks.config.compiler.InlineExpansionType; import java.util.Objects; import java.util.stream.Stream; import static com.excelsiorjet.api.util.Txt....
/* * Copyright (c) 2017, Excelsior LLC. * * This file is part of Excelsior JET API. * * Excelsior JET API 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 * ...
void validate(ExcelsiorJet excelsiorJet) throws JetTaskFailureException {
0
Simdea/gmlrva
gmlrva-sample/src/main/java/pt/simdea/gmlrva/sample/layouts/holders/CarouselCategoryItemWithOptionLayout.java
[ "@SuppressWarnings({\"unused\", \"unchecked\", \"WeakerAccess\", \"SameParameterValue\"})\npublic class GenericMultipleLayoutAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\n\n /* Adapter Variables */\n @NonNull\n private final Context mContext;\n @NonNull\n private final List<IGeneri...
import android.animation.AnimatorSet; import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; ...
/* * Copyright (c) 2017. Simdea. */ package pt.simdea.gmlrva.sample.layouts.holders; /** * Class representing a Carousel Category Layout meant to be used on a {@link GenericMultipleLayoutAdapter}. * * Created by Paulo Ribeiro on 7/16/2017. * Simdea © All Rights Reserved. * paulo.ribeiro@simdea.pt */ @AllAr...
public void runAddAnimation(@NonNull final GenericItemAnimator listener) {
4
syvaidya/openstego
src/main/java/com/openstego/desktop/plugin/dwtdugad/DWTDugadPlugin.java
[ "public class OpenStegoException extends Exception {\n private static final long serialVersionUID = 668241029491685413L;\n\n /**\n * Error Code - Unhandled exception\n */\n static final int UNHANDLED_EXCEPTION = 0;\n\n /**\n * Map to store error code to message key mapping\n */\n priv...
import com.openstego.desktop.OpenStegoException; import com.openstego.desktop.plugin.template.image.WMImagePluginTemplate; import com.openstego.desktop.util.ImageHolder; import com.openstego.desktop.util.ImageUtil; import com.openstego.desktop.util.LabelUtil; import com.openstego.desktop.util.StringUtil; import com.ope...
oos.writeDouble((Double) vals[2]); vals = invWmSubBand(s.getDiagonal().getImage(), sig.watermark, sig.watermarkLength, sig.detectionThreshold); oos.writeInt((Integer) vals[0]); oos.writeDouble((Double) vals[1]); oos.writeDouble((Double) va...
private void wmSubBand(Image img, double[] wm, int n, double a, double threshold) {
7
sewerk/Bill-Calculator
persistence/src/main/java/pl/srw/billcalculator/persistence/Database.java
[ "public interface Bill {\n\n Long getId();\n Long getPricesId();\n\n Date getDateFrom();\n void setDateFrom(Date dateFrom);\n Date getDateTo();\n void setDateTo(Date dateTo);\n Double getAmountToPay();\n void setAmountToPay(Double value);\n}", "@Entity\npublic class History {\n\n @Id(au...
import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import org.greenrobot.greendao.query.Query; import org.greenrobot.greendao.query.QueryBuilder; import java.util.List; import pl.srw.billcalculator.db.Bill; import pl.srw.billcalculator.db.History; import pl.sr...
package pl.srw.billcalculator.persistence; public class Database { public static final String DB_NAME = "pl.srw.billcalculator.db"; private static final String QUERY_ROW_LIMIT = "100"; private static DaoSession daoSession; private static Query<History> historyQuery; public static void initial...
.orderDesc(HistoryDao.Properties.DateFrom, HistoryDao.Properties.BillType, HistoryDao.Properties.BillId)
4
NanYoMy/mybatis-generator
src/main/java/org/mybatis/generator/codegen/mybatis3/model/BaseRecordGenerator.java
[ "public class IntrospectedColumn {\n protected String actualColumnName;\n\n protected int jdbcType;\n\n protected String jdbcTypeName;\n\n protected boolean nullable;\n\n protected int length;\n\n protected int scale;\n\n protected boolean identity;\n \n protected boolean isSequenceColumn...
import org.mybatis.generator.api.dom.java.TopLevelClass; import org.mybatis.generator.codegen.AbstractJavaGenerator; import org.mybatis.generator.codegen.RootClassInfo; import static org.mybatis.generator.internal.util.messages.Messages.getString; import java.util.ArrayList; import java.util.List; import org.mybatis.ge...
/* * Copyright 2009 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
List<IntrospectedColumn> introspectedColumns = getColumnsInThisClass();
0
keeps/roda-in
src/main/java/org/roda/rodain/core/creation/SipCreator.java
[ "public class ConfigurationManager {\n private static final Logger LOGGER = LoggerFactory.getLogger(ConfigurationManager.class.getName());\n\n private static final Path rodainPath = computeRodainPath();\n private static Path schemasPath, templatesPath, logPath, metadataPath, helpPath, externalConfigPath,\n ex...
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.io.FileUtils; import org.roda.rodain.core.ConfigurationManager...
package org.roda.rodain.core.creation; /** * {@author João Gomes <jgomes@keep.pt>}. */ public abstract class SipCreator extends SimpleSipCreator implements SIPObserver, ISipCreator { /** * {@link LoggerFactory}. */ private static final Logger LOGGER = LoggerFactory.getLogger(SipCreator.class.getName()); ...
for (DescriptiveMetadata descObjMetadata : descriptionObject.getMetadata()) {
4
kontalk/desktopclient-java
src/main/java/org/kontalk/view/ContactListView.java
[ "public final class Contact extends Observable implements Searchable {\n private static final Logger LOGGER = Logger.getLogger(Contact.class.getName());\n\n /**\n * Online status of one contact.\n */\n public enum Online {UNKNOWN, YES, NO, ERROR}\n\n /**\n * XMPP subscription status in roste...
import javax.swing.Box; import javax.swing.ListSelectionModel; import java.awt.BorderLayout; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.List; import java.util.Optional; import com....
/* * Kontalk Java client * Copyright (C) 2016 Kontalk Devteam <devteam@kontalk.org> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your ...
boolean hideBlocked = Config.getInstance()
3
hamadmarri/Biscuit
main/java/com/biscuit/commands/planner/MoveSprintToRelease.java
[ "public class ColorCodes {\n\n\t// with normal background\n\tpublic static final String RESET = \"\\u001B[0m\";\n\tpublic static final String BLACK = \"\\u001B[30;1m\";\n\tpublic static final String RED = \"\\u001B[31;1m\";\n\tpublic static final String GREEN = \"\\u001B[32;1m\";\n\tpublic static final String YELLO...
import java.io.IOException; import com.biscuit.ColorCodes; import com.biscuit.commands.Command; import com.biscuit.models.Project; import com.biscuit.models.Release; import com.biscuit.models.Sprint; import com.biscuit.models.enums.Status; import com.biscuit.models.services.Finder.Releases; import com.biscuit.models.se...
package com.biscuit.commands.planner; public class MoveSprintToRelease implements Command { ConsoleReader reader = null;
Project project = null;
2
cckevincyh/SafeChatRoom
SafeChat_Room/src/chat_room/client/backstage/ClientConServer.java
[ "public class Message implements Serializable{\n\tprivate String MessageType;\n\tprivate String Content;\n\tprivate String Time;\n\tprivate String Sender;\n\tprivate String Getter;\n\tprivate byte[] Key;\t//秘钥\n\t\n\t\n\t\n\tpublic Message(String messageType, String sender, byte[] key) {\n\t\tsuper();\n\t\tMessageT...
import java.io.IOException; import java.io.ObjectOutputStream; import java.util.Set; import javax.swing.JOptionPane; import chat.common.Message; import chat.common.MessageType; import chat.utils.DecryptionUtils; import chat_room.client.tools.ManageClientCollction; import chat_room.client.tools.ManageClientPersonCollect...
package chat_room.client.backstage; /** * 客户端继续与服务器端通信的后台线程类 * @author Administrator * Client_Continue_Connect_Server_Thread */ public class ClientConServer implements Runnable{ private ClienManage cm; //后台处理对象 private ClientFrame client;//个人聊天界面对象 private Client_Frame cf;//群聊界面对象 public ClientConServer(...
if(mess.getMessageType().equals(MessageType.Common_Message_ToAll)){
1
yoichiro/oauth2-server
src/main/java/jp/eisbahn/oauth2/server/endpoint/ProtectedResource.java
[ "public abstract class DataHandler {\n\n\tprivate Request request;\n\n\t/**\n\t * Initialize this instance with the request information.\n\t * This constructor calls the init() method to initialize a connection\n\t * to your database, a preparation of your cache and so on.\n\t * @param request The request instance....
import jp.eisbahn.oauth2.server.data.DataHandler; import jp.eisbahn.oauth2.server.data.DataHandlerFactory; import jp.eisbahn.oauth2.server.exceptions.OAuthError; import jp.eisbahn.oauth2.server.fetcher.accesstoken.AccessTokenFetcher; import jp.eisbahn.oauth2.server.fetcher.accesstoken.AccessTokenFetcher.FetchResult; im...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ma...
public Response handleRequest(Request request) throws OAuthError {
2
Deltik/SignEdit
src/net/deltik/mc/signedit/commands/SignCommand.java
[ "public class ArgParser {\n private final Configuration config;\n private final Set<String> subcommandNames;\n\n public static final int[] NO_LINES_SELECTED = new int[0];\n public static final int[] ALL_LINES_SELECTED = new int[]{0, 1, 2, 3};\n\n String subcommand;\n int[] selectedLines = NO_LINES...
import net.deltik.mc.signedit.ArgParser; import net.deltik.mc.signedit.ChatComms; import net.deltik.mc.signedit.ChatCommsModule; import net.deltik.mc.signedit.Configuration; import net.deltik.mc.signedit.exceptions.LineSelectionException; import net.deltik.mc.signedit.interactions.SignEditInteraction; import net.deltik...
/* * Copyright (C) 2017-2021 Deltik <https://www.deltik.net/> * * This file is part of SignEdit for Bukkit. * * SignEdit for Bukkit 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 th...
SignEditInteraction interaction = signSubcommand.execute();
5
douo/ActivityBuilder
compiler/src/main/java/info/dourok/compiler/parameter/BundleWriter.java
[ "public static String capitalize(String s) {\n if (s.length() == 0) {\n return s;\n }\n return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();\n}", "public static void error(String msg) {\n S_INSTANCE.messager.printMessage(Diagnostic.Kind.ERROR, msg);\n}", "public static Types getTypes() ...
import com.squareup.javapoet.MethodSpec; import java.util.List; import java.util.Objects; import javax.lang.model.type.ArrayType; import javax.lang.model.type.DeclaredType; import javax.lang.model.type.PrimitiveType; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model...
package info.dourok.compiler.parameter; /** * 生成 Bundle 支持类型的写入读取代码 * * @author tiaolins * @date 2017/8/30 */ class BundleWriter extends ParameterWriter { private String prefix; BundleWriter(ParameterModel parameter, String prefix) { super(parameter); if (prefix == null) { prefix = generateP...
} else if (isBundle(declaredType)) {
4
mcalejo/interprolog
src/main/java/com/declarativa/interprolog/gui/EngineInspectionWindow.java
[ "public abstract class AbstractPrologEngine implements PrologEngine{\n\t/** cache variable */\n\tprivate String prologVersion=null;\n /** Auxiliary object knowing about specific implementation details */\n protected PrologImplementationPeer peer;\n /** File path to directory with Prolog machine, or command...
import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.J...
/* Author: Miguel Calejo Contact: info@interprolog.com, www.interprolog.com Copyright InterProlog Consulting / Renting Point Lda, Portugal 2014 Use and distribution, without any warranties, under the terms of the Apache License, as per http://www.apache.org/licenses/LICENSE-2.0.html */ package com.declarativa.interpro...
public static void init(AbstractPrologEngine engine){
0
xiangxik/castle-shop
src/main/java/com/whenling/shop/controller/ShortMsgController.java
[ "@Entity\n@Table(name = \"tbl_admin\")\npublic class Admin extends DataEntity<Admin, Long> implements Lockedable, Disabledable, LogicDeleteable {\n\n\tprivate static final long serialVersionUID = -5778996032468144613L;\n\t/** 用户名 */\n\t@NotNull\n\t@Size(min = 2, max = 20)\n\t@Pattern(regexp = Patterns.REGEX_USERNAM...
import java.util.Date; import java.util.HashSet; import java.util.Set; import org.apache.commons.lang.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort.Dire...
package com.whenling.shop.controller; @Controller @RequestMapping("/sms")
public class ShortMsgController extends CrudController<ShortMsg, Long> {
3
cccssw/enigma-vk
test/cuchaz/enigma/TestJarIndexInheritanceTree.java
[ "public class EntryReference<E extends Entry,C extends Entry> {\n\t\n\tprivate static final List<String> ConstructorNonNames = Arrays.asList(\"this\", \"super\", \"static\");\n\tpublic E entry;\n\tpublic C context;\n\t\n\tprivate boolean m_isNamed;\n\t\n\tpublic EntryReference(E entry, String sourceName) {\n\t\tthi...
import static cuchaz.enigma.TestEntryFactory.newBehaviorReferenceByConstructor; import static cuchaz.enigma.TestEntryFactory.newBehaviorReferenceByMethod; import static cuchaz.enigma.TestEntryFactory.newClass; import static cuchaz.enigma.TestEntryFactory.newConstructor; import static cuchaz.enigma.TestEntryFactory.newF...
/******************************************************************************* * Copyright (c) 2015 Jeff Martin. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public * License v3.0 which accompanies this distribution, and is avail...
private FieldEntry m_nameField = newField(m_baseClass, "a", "Ljava/lang/String;");
5
adelbs/ISO8583
src/main/java/org/adelbs/iso8583/constants/EncodingEnum.java
[ "public interface Encoding {\n\n\tString convert(byte[] bytesToConvert);\n\t\n\tbyte[] convert(String strToConvert);\n\t\n\t/**\n\t * Some encoding algorithms need more the one byte to represent an ASCII character.\n\t * So its original byte size, after the conversion, may change.\n\t * This method receives the asc...
import javax.swing.JComboBox; import org.adelbs.iso8583.util.Encoding; import org.adelbs.iso8583.util.EncodingBASE64; import org.adelbs.iso8583.util.EncodingBCD; import org.adelbs.iso8583.util.EncodingBYTE; import org.adelbs.iso8583.util.EncodingEBCDIC; import org.adelbs.iso8583.util.EncodingHEXA; import org.adelbs.iso...
package org.adelbs.iso8583.constants; /** * This class represents the available encoding options, * to convert ISO messages sent/received by this library */ public enum EncodingEnum implements Encoding { BCD("BCD", new EncodingBCD()), EBCDIC("EBCDIC", new EncodingEBCDIC()), ISO88591("ISO 8859-1", new Encodi...
BASE64("BASE64", new EncodingBASE64()),
1