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 |
|---|---|---|---|---|---|---|
yammer/breakerbox | breakerbox-jdbi/src/test/java/com/yammer/breakerbox/jdbi/tests/H2Test.java | [
"public class JdbiStore extends BreakerboxStore {\n public static final String MIGRATIONS_FILENAME = \"migrations.xml\";\n private static final Logger LOGGER = LoggerFactory.getLogger(JdbiStore.class);\n protected final ServiceDB serviceDB;\n protected final DependencyDB dependencyDB;\n private final... | import com.codahale.metrics.MetricRegistry;
import com.yammer.breakerbox.jdbi.JdbiConfiguration;
import com.yammer.breakerbox.jdbi.JdbiStore;
import com.yammer.breakerbox.jdbi.args.DateTimeArgumentFactory;
import com.yammer.breakerbox.jdbi.args.DependencyIdArgumentFactory;
import com.yammer.breakerbox.jdbi.args.Service... | package com.yammer.breakerbox.jdbi.tests;
public class H2Test {
protected final JdbiConfiguration hsqlConfig = new JdbiConfiguration();
protected CloseableLiquibase liquibase;
protected DBI database;
{
hsqlConfig.getDataSourceFactory().setUrl("jdbc:h2:mem:DbTest-" + System.currentTimeMillis(... | ServiceId.from(UUID.randomUUID().toString()), | 6 |
headwirecom/aemdc | src/main/java/com/headwire/aemdc/runner/HelpRunner.java | [
"public class CommandMenu {\r\n\r\n private static final Logger LOG = LoggerFactory.getLogger(CommandMenu.class);\r\n\r\n SortedMap<Integer, Command> menuItems = new TreeMap<Integer, Command>();\r\n\r\n public void setCommand(final Integer operationNumber, final Command cmd) {\r\n menuItems.put(operationNumbe... | import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.headwire.aemdc.command.CommandMenu;
import com.headwire.aemdc.command.HelpCommand;
import com.headwire.aemdc.companion.Config;
import com.headwire.aemdc.companion.Constants;
import com.headwire.aemdc.companion.Resourc... | package com.headwire.aemdc.runner;
/**
* Help creator
*
*/
public class HelpRunner extends BasisRunner {
private static final Logger LOG = LoggerFactory.getLogger(HelpRunner.class);
private static final String HELP_FOLDER = "help";
/**
* Invoker
*/
private final CommandMenu men... | public Replacer getPlaceHolderReplacer() {
| 5 |
ustream/yolo | src/main/java/tv/ustream/yolo/Yolo.java | [
"public class ConfigException extends Exception\n{\n\n public ConfigException(final String message)\n {\n super(\"Configuration error: \" + message);\n }\n\n}",
"public class ConfigPattern\n{\n\n private static final Pattern PARAMS_PATTERN = Pattern.compile(\"#([a-zA-Z0-9_\\\\-\\\\.]+)#\");\n\n... | import com.google.gson.Gson;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
import org.apache.commons.io.IOUtils;... | package tv.ustream.yolo;
/**
* @author bandesz
*/
public class Yolo
{
private static final Logger LOG = LoggerFactory.getLogger(Yolo.class);
private static final PatternLayout CONSOLE_LOG_PATTERN = new PatternLayout("%-6r [%15.15t] %-5p %30.30c - %m%n");
private static final PatternLayout FILE_LOG_P... | private FileHandler fileHandler; | 2 |
Pkmmte/TechDissected | app/src/main/java/com/pkmmte/techdissected/fragment/SettingsFragment.java | [
"public class SettingsAdapter extends BaseAdapter {\n\t// View Types\n\tpublic static final int TYPE_HEADER = 0;\n\tpublic static final int TYPE_DIVIDER = 1;\n\tpublic static final int TYPE_TEXT = 2;\n\tpublic static final int TYPE_CHECKBOX = 3;\n\tpublic static final int TYPE_MAX_COUNT = 4;\n\n\t// Essential Resou... | import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
impor... | package com.pkmmte.techdissected.fragment;
public class SettingsFragment extends ListFragment
{
// ID Keys
private final int STORAGE_CACHE = 0;
private final int READ_GRAYSCALE = 1;
private final int CREDITS_LIBRARIES = 2;
private final int CREDITS_DEV = 3;
// App Preferences
private SharedPreferences mPrefs;... | private SettingsAdapter mAdapter; | 0 |
sdadas/fsbrowser | src/main/java/pl/sdadas/fsbrowser/view/locations/StatusBarHelper.java | [
"public final class BeanFactory {\n\n private static Map<Class<?>, Object> beans = new HashMap<>();\n\n private BeanFactory() {\n }\n\n public static FsConnection connection(AppConnection connection) {\n ConnectionConfig config = new ConnectionConfig(connection.getUser(), connection.getProperties... | import com.alee.extended.tab.DocumentData;
import com.alee.laf.menu.WebMenuItem;
import com.alee.laf.menu.WebPopupMenu;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.fs.Path;
import pl.sdadas.fsbrowser.app.BeanFactory;
import pl.sdadas.fsbrowser.app.config.AppConfigProvider;
import pl.sdadas.fsb... | package pl.sdadas.fsbrowser.view.locations;
/**
* @author Sławomir Dadas
*/
public class StatusBarHelper {
private final AppConfigProvider provider;
public StatusBarHelper(AppConfigProvider provider) {
this.provider = provider;
}
public void addLocation(AppLocation location) {
pr... | public WebPopupMenu createConnectionsPopup(MainPanel parent) { | 8 |
kbase/kb_sdk | src/java/us/kbase/mobu/initializer/test/DockerClientServerTester.java | [
"public class ModuleInitializer {\n\tpublic static final String DEFAULT_LANGUAGE = \"python\";\n\n\tprivate String moduleName;\n\tprivate String userName;\n\tprivate String language;\n\tprivate boolean verbose;\n\tprivate File dir;\n\t\n\tprivate static String[] subdirs = {\"data\",\n\t\t\t\t\t\t\t\t\t\t\"scripts\"... | import java.io.File;
import java.io.FileWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
imp... | package us.kbase.mobu.initializer.test;
public class DockerClientServerTester {
protected static final boolean cleanupAfterTests = true;
protected static List<String> createdModuleNames = new ArrayList<String>();
protected static AuthToken token;
private static final long startingTime = Syste... | TypeGeneratorTest.suppressJettyLogging(); | 5 |
apache/creadur-rat | apache-rat-plugin/src/test/java/org/apache/rat/mp/util/ExclusionHelperTest.java | [
"public enum SourceCodeManagementSystems {\n SUBVERSION(\".svn\", null), //\n GIT(\".git\", \".gitignore\"), //\n BAZAAR(\".bzr\", \".bzrignore\"), //\n MERCURIAL(\".hg\", \".hgignore\"), //\n CVS(\"CVS\", \".cvsignore\")\n //\n ;\n\n /**\n * Technical directory of that SCM which contain... | import static org.apache.rat.mp.util.ExclusionHelper.addEclipseDefaults;
import static org.apache.rat.mp.util.ExclusionHelper.addIdeaDefaults;
import static org.apache.rat.mp.util.ExclusionHelper.addMavenDefaults;
import static org.apache.rat.mp.util.ExclusionHelper.addPlexusAndScmDefaults;
import static org.junit.Asse... | package org.apache.rat.mp.util;
/*
* 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... | ECLIPSE_DEFAULT_EXCLUDES.size()); | 1 |
architjn/YAAB | app/src/main/java/com/architjn/audiobook/presenter/OnGoingAudioBookPresenter.java | [
"public class AudioBookAdapter extends RecyclerView.Adapter<AudioBookAdapter.ViewHolder> {\n\n private Context context;\n private List<AudioBook> items;\n private IAdapterItemClick<AudioBook> callback;\n\n public AudioBookAdapter(Context context, ArrayList<AudioBook> items,\n ... | import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import com.architjn.audiobook.adapter.AudioBookAdapter;
import com.architjn.audiobook.adapter.IAdapt... | package com.architjn.audiobook.presenter;
/**
* Created by HP on 23-07-2017.
*/
public class OnGoingAudioBookPresenter implements IAdapterItemClick<AudioBook>, IAllAudioBookPresenter {
private final PrefUtils pref; | private final OnGoingAudioBookInteractor interactor; | 3 |
tangqifa/Common-App-Architecture | app/src/main/java/com/kejiwen/architecture/adapter/CustomerProductAdapter.java | [
"public interface IDataAdapter<DATA> extends ListAdapter {\r\n\r\n public abstract void setData(DATA data, boolean isRefresh);\r\n\r\n public abstract DATA getData();\r\n\r\n public void notifyDataSetChanged();\r\n\r\n}\r",
"public class CommonWebViewActivity extends BaseActivity {\n private final sta... | import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.Pr... | /*
Copyright 2015 shizhefei(LuckyJayce)
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 wri... | int totalMoney = StringUtils.parseInt(StringUtils.getNumbers(item.getTotalMoney()), 0);
| 5 |
CBSkarmory/AWGW | src/main/java/cbskarmory/units/air/Bomber.java | [
"public class Player {\n\n public static int numberOfPlayers;\n public final CO CO;\n public final int id;\n private ArrayList<Unit> unitsControlled;\n private int money;\n private ArrayList<Property> propertiesOwned;\n private int commTowers;\n private Color teamColor;\n\n /**\n * Co... | import cbskarmory.Player;
import cbskarmory.PassiveFlag.MoveType;
import cbskarmory.terrain.Terrain;
import cbskarmory.units.Air;
import cbskarmory.units.Unit;
import cbskarmory.weapons.WeaponType; | /*
* Copyright(c) 2017 CBSkarmory (https://github.com/CBSkarmory)
*
* This code 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.
*
* This code is distributed in the hope that it will be useful,
* but WI... | return super.couldTarget(toCheck, hypothetical) && !MoveType.AIR.equals(toCheck.getMovementType()); | 1 |
olivierlemasle/java-certificate-authority | ca-api/src/main/java/io/github/olivierlemasle/caweb/cli/CreateCertificate.java | [
"public static CsrBuilder createCsr() {\n return new CsrBuilderImpl();\n}",
"public static DnBuilder dn() {\n return new DnBuilderImpl();\n}",
"public static RootCertificate loadRootCertificate(final String keystorePath,\n final char[] password, final String alias) {\n return RootCertificateLoader.loadRoo... | import static io.github.olivierlemasle.ca.CA.createCsr;
import static io.github.olivierlemasle.ca.CA.dn;
import static io.github.olivierlemasle.ca.CA.loadRootCertificate;
import io.dropwizard.cli.Command;
import io.dropwizard.setup.Bootstrap;
import io.github.olivierlemasle.ca.Certificate;
import io.github.olivierlemas... | package io.github.olivierlemasle.caweb.cli;
public class CreateCertificate extends Command {
public CreateCertificate() {
super("createcert", "Creates a signed certificate.");
}
@Override
public void configure(final Subparser parser) {
parser.addArgument("-s", "--subject")
.dest("subject")
... | final CsrWithPrivateKey csr = createCsr().generateRequest(dn); | 5 |
52North/SensorPlanningService | 52n-sps-webapp/src/test/java/org/n52/sps/control/xml/XmlValidationDelegateTest.java | [
"public interface SensorPlanningService {\r\n \r\n public static final String SPS_VERSION = \"2.0.0\";\r\n \r\n public static final String OWS_VERSION = \"1.1.0\";\r\n\r\n // mandatory\r\n public BasicSensorPlanner getBasicSensorPlanner();\r\n\r\n // mandatory\r\n public SensorProvider getSe... | import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.IOException;
import org.apache.xmlbeans.XmlException;
import org.apache.xmlbeans.XmlObject;
import org.junit.Before;
import org.junit.Test;
import org.n52.ows.exception.InvalidParameterValueException;
import org.n52.o... | /**
* Copyright (C) 2012-${latestYearOfContribution} 52°North Initiative for Geospatial Open Source
* Software GmbH
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License version 2 as publishedby the Free
* Software Foundation.
*
... | return new SpsComponentProvider(planner, provider);
| 1 |
HugoGresse/Anecdote | app/src/main/java/io/gresse/hugo/anecdote/ServiceProvider.java | [
"@Singleton\npublic final class FavoritesRepository {\n\n public static final int OFFSET_QUERY = 50;\n\n private static Website sWebsite;\n\n @Inject\n protected Application mApplication;\n @Inject\n protected BoxStore mBoxStore;\n private Box<Anecdote> mAnecdoteBox;\n private Query... | import android.content.Context;
import org.greenrobot.eventbus.EventBus;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import io.gresse.hugo.anecdote.anecdote.like.FavoritesRepository;
import io.gresse.hugo.anecdote.anecdote.service.Ane... | package io.gresse.hugo.anecdote;
/**
* Provide different services (that explain a lot)
* <p/>
* Created by Hugo Gresse on 14/02/16.
*/
@Singleton
public class ServiceProvider {
private Map<String, AnecdoteService> mAnecdoteServices;
private WebsiteApiService mWebsiteApiService;
@In... | public void createAnecdoteService(Context context, List<Website> websites) { | 6 |
RestExpress/RestExpress-Examples | blogging/src/main/java/org/restexpress/example/blogging/controller/CommentController.java | [
"public class Constants\n{\n\tpublic class Routes\n\t{\n\t\tpublic static final String BLOGS_READ_ROUTE = \"blog.read.collection.route\";\n\t\tpublic static final String BLOG_READ_ROUTE = \"blog.read.route\";\n\t\tpublic static final String BLOG_ENTRY_READ_ROUTE = \"blog-entry.read.route\";\n\t\tpublic static final... | import static com.strategicgains.repoexpress.adapter.Identifiers.UUID;
import java.util.List;
import org.restexpress.Request;
import org.restexpress.Response;
import org.restexpress.common.query.FilterOperator;
import org.restexpress.common.query.QueryFilter;
import org.restexpress.common.query.QueryOrder;
import org.r... | package org.restexpress.example.blogging.controller;
public class CommentController
{
private static final UrlBuilder LOCATION_BUILDER = new DefaultUrlBuilder();
private CommentRepository comments;
private BlogEntryRepository entries;
private BlogRepository blogs;
public CommentController(CommentRepository... | String blogId = request.getHeader(Constants.Url.BLOG_ID_PARAMETER, "Blog ID not provided"); | 0 |
egetman/ibm-bpm-rest-client | src/main/ru/bpmink/bpm/api/impl/simple/KerberosBpmClient.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.collect.Lists;
import com.google.common.io.Closeables;
import org.apache.http.HttpHost;
import org.apache.http.HttpRequest;
import org.apache.http.auth.AuthSchemeProvider;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials;
import org.apache.http.client.ResponseHandl... | package ru.bpmink.bpm.api.impl.simple;
/**
* Simple implementation of {@link ru.bpmink.bpm.api.client.BpmClient} which supports
* {@link org.apache.http.impl.auth.KerberosScheme} authentication.
*/
//TODO: Broken implementation. Rewrite and retest needed.
@Immutable
@SuppressWarnings("deprecation")
@SuppressFBW... | this.rootUri = new SafeUriBuilder(serverUri).addPath(ROOT_ENDPOINT).build(); | 7 |
stefanhaustein/nativehtml | shared/src/main/java/org/kobjects/nativehtml/util/ElementImpl.java | [
"public class CssStyleDeclaration {\n /**\n * CSS DPI constant.\n */\n public static final int DPI = 96;\n\n public static final float FONT_WEIGHT_NORMAL = 400;\n public static final float FONT_WEIGHT_BOLD = 700;\n\n private static final int[] TOP_LEVEL = new int[0];\n\n private static final CssStyleDecla... | import java.util.HashMap;
import org.kobjects.nativehtml.css.CssStyleDeclaration;
import org.kobjects.nativehtml.dom.ContentType;
import org.kobjects.nativehtml.dom.Document;
import org.kobjects.nativehtml.dom.Element;
import org.kobjects.nativehtml.dom.ElementType;
import org.kobjects.nativehtml.dom.HtmlCollection; | package org.kobjects.nativehtml.util;
public class ElementImpl implements Element {
public static String getTextContent(Element element) {
StringBuilder sb = new StringBuilder();
HtmlCollection children = element.getChildren();
for (int i = 0; i < children.getLength(); i++) {
sb.append(child... | protected ElementType elementType; | 4 |
dumptruckman/ChestRestock | src/main/java/com/dumptruckman/chestrestock/DefaultChestManager.java | [
"public interface CRChest extends Config, CRChestOptions {\n\n /**\n * Constants related to CRChest.\n */\n class Constants {\n\n /**\n * The minimum for max inventory size.\n */\n public static final int MIN_MAX_INVENTORY_SIZE = 54;\n\n private static int MAX_INVE... | import com.dumptruckman.chestrestock.api.CRChest;
import com.dumptruckman.chestrestock.api.CRChestOptions;
import com.dumptruckman.chestrestock.api.CRConfig;
import com.dumptruckman.chestrestock.api.CRDefaults;
import com.dumptruckman.chestrestock.api.ChestManager;
import com.dumptruckman.chestrestock.api.ChestRestock;... | return;
}
Logging.fine("Initializing chest polling.");
cacheAllChests();
}
@Override
public void cacheAllChests() {
File worldContainer = Bukkit.getWorldContainer();
for (File file : worldContainer.listFiles(new FileFilter() {
@Override
... | for (Field field : CRChestOptions.class.getFields()) { | 1 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/topology/CommonMessagePrintTopology.java | [
"public class StreamMessagePrintBolt extends AmBaseBolt\n{\n /** serialVersionUID */\n private static final long serialVersionUID = -6390790906598881431L;\n\n /** logger */\n private static final Logger logger = LoggerFactory.getLogger(StreamMessagePrintBolt.class);\n\n /**\n * パラメータを... | import java.util.List;
import acromusashi.stream.bolt.StreamMessagePrintBolt;
import acromusashi.stream.component.kestrel.spout.KestrelJsonSpout;
import acromusashi.stream.config.StormConfigGenerator;
import acromusashi.stream.config.StormConfigUtil;
import acromusashi.stream.constants.FieldName;
import acromusashi.str... | /**
* Copyright (c) Acroquest Technology Co, Ltd. All Rights Reserved.
* Please read the associated COPYRIGHTS file for more details.
*
* THE SOFTWARE IS PROVIDED BY Acroquest Technolog Co., Ltd.,
* WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FIT... | List<String> kestrelHosts = StormConfigUtil.getStringListValue(getConfig(), | 3 |
ryft/NetVis | workspace/netvis/src/netvis/visualisations/comets/FlipNode.java | [
"public class Packet {\r\n\tpublic final int no, sport, dport, length;\r\n\tpublic final double time;\r\n\tpublic final String smac, dmac, info, protocol, sip, dip;\r\n\r\n\t/**\r\n\t * \r\n\t * @param no\r\n\t * Packet number\r\n\t * @param time\r\n\t * Time elapsed since first packet (second... | import java.awt.event.MouseEvent;
import javax.media.opengl.GL2;
import netvis.data.model.Packet;
import netvis.visualisations.gameengine.Framebuffer;
import netvis.visualisations.gameengine.FramebufferPool;
import netvis.visualisations.gameengine.Node;
import netvis.visualisations.gameengine.NodePainter;
import... | package netvis.visualisations.comets;
public class FlipNode extends Node {
private int framebufferid;
| public Framebuffer GetFramebuffer() {
| 1 |
mageddo/bookmark-notes | src/main/java/com/mageddo/bookmarks/controller/HomeController.java | [
"public class RecentBookmarksRes {\n\n private Long id;\n private String name;\n private String tags;\n\n public static RowMapper<RecentBookmarksRes> mapper() {\n return (rs, rowNum) -> new RecentBookmarksRes().setId(rs.getLong(\"ID\"))\n .setName(rs.getString(\"NAME\"))\n .setTags(rs.getString... | import java.util.List;
import com.mageddo.bookmarks.apiserver.res.RecentBookmarksRes;
import com.mageddo.bookmarks.service.BookmarksService;
import com.mageddo.bookmarks.service.SettingsService;
import com.mageddo.common.jackson.JsonUtils;
import com.mageddo.commons.Maps;
import com.mageddo.commons.UrlUtils;
import com... | package com.mageddo.bookmarks.controller;
@Rsl
@Controller
public class HomeController {
private final Logger logger = LoggerFactory.getLogger(getClass()); | private final BookmarksService bookmarksService; | 1 |
hantsy/angularjs-springmvc-sample-boot | src/main/java/com/hantsylabs/restexample/springmvc/api/post/PostController.java | [
"public class Constants {\n\n /**\n * prefix of REST API\n */\n public static final String URI_API_PREFIX = \"/api\";\n\n public static final String URI_SELF = \"/me\";\n\n public static final String URI_USERS = \"/users\";\n\n public static final String URI_POSTS = \"/posts\";\n\n public ... | import com.hantsylabs.restexample.springmvc.Constants;
import com.hantsylabs.restexample.springmvc.domain.Post;
import com.hantsylabs.restexample.springmvc.model.CommentDetails;
import com.hantsylabs.restexample.springmvc.model.CommentForm;
import com.hantsylabs.restexample.springmvc.model.PostDetails;
import com.hants... | package com.hantsylabs.restexample.springmvc.api.post;
@RestController
@RequestMapping(value = Constants.URI_API_PREFIX + Constants.URI_POSTS)
public class PostController {
private static final Logger log = LoggerFactory.getLogger(PostController.class);
//@Inject
private final BlogService blogService;
... | @RequestParam(value = "status", required = false) Post.Status status, // | 1 |
okinawaopenlabs/of-patch-manager | src/main/java/org/okinawaopenlabs/ofpm/validate/device/PortInfoCreateJsonInValidate.java | [
"public class ErrorMessage {\n\tpublic static final String CONNECTION_FAIL = \"Connection failed: %s.\";\n\tpublic static final String WRONG_RESPONSE = \"Response of %s is wrong.\";\n\tpublic static final String INVALID_JSON = \"Invalid json syntax.\";\n\tpublic static final String INVALID_PARAMETER = \"%s is... | import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.log4j.Logger;
import static org.okinawaopenlabs.constants.ErrorMessage.*;
import static org.okinawaopenlabs.constants.OfpmDefinition.*;
import java.util.regex.Pattern;
import org.okinawaopenlabs.ofpm.excepti... | /*
* Copyright 2015 Okinawa Open Laboratory, General Incorporated Association
*
* 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... | public void checkValidation(String deviceName, PortInfoCreateJsonIn portInfoJson) throws ValidateException { | 2 |
1and1/reactive | reactive-http/src/test/java/net/oneandone/reactive/sse/client/ServerSentEventSinkTest.java | [
"public class ConnectException extends RuntimeException {\n \n private static final long serialVersionUID = 4790384678606033160L;\n\n public ConnectException(String reason) {\n super(reason);\n }\n \n public ConnectException(Throwable cause) {\n super(cause);\n }\n \n publi... | import org.junit.Test;
import com.google.common.collect.Maps;
import java.net.URI;
import java.time.Duration;
import java.util.Map;
import java.util.UUID;
import net.oneandone.reactive.ConnectException;
import net.oneandone.reactive.ReactiveSink;
import net.oneandone.reactive.ReactiveSource;
import net.oneandone.reacti... | /*
* Copyright 1&1 Internet AG, https://github.com/1and1/
*
* 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... | ReactiveSink<ServerSentEvent> reactiveSink = new ClientSseSink(uri).open(); | 1 |
andidev/spring-bootstrap-enterprise | src/main/java/org/andidev/applicationname/config/SpringMvcConfig.java | [
"public class LocaleInterceptor extends ParameterInterceptor<Locale> {\n\n public LocaleInterceptor(String parameterName) {\n super(parameterName);\n }\n\n @Override\n protected String printParameter(Locale locale) {\n return locale.toString();\n }\n\n @Override\n protected Locale... | import java.util.List;
import javax.inject.Inject;
import javax.persistence.EntityManagerFactory;
import lombok.extern.slf4j.Slf4j;
import org.andidev.applicationname.config.interceptor.LocaleInterceptor;
import org.andidev.applicationname.config.interceptor.TimeZoneInterceptor;
import org.andidev.applicationname.confi... | package org.andidev.applicationname.config;
@Configuration
@Slf4j
public class SpringMvcConfig extends WebMvcConfigurationSupport {
@Value("${application.environment}")
private String applicationEnvironment;
@Value("${application.version}")
private String version;
@Inject
EntityManagerFactory... | public LocaleInterceptor localeInterceptor() { | 0 |
winterDroid/android-drawable-importer-intellij-plugin | src/main/java/de/mprengemann/intellij/plugin/androidicons/controllers/DefaultControllerFactory.java | [
"public class DefaultsController implements IDefaultsController {\n\n public static final HashSet<Resolution> DEFAULT_RESOLUTIONS = new HashSet<Resolution>(Arrays.asList(Resolution.MDPI,\n Resolution.HDPI,\n ... | import com.intellij.openapi.project.Project;
import de.mprengemann.intellij.plugin.androidicons.controllers.defaults.DefaultsController;
import de.mprengemann.intellij.plugin.androidicons.controllers.defaults.IDefaultsController;
import de.mprengemann.intellij.plugin.androidicons.controllers.iconimporter.IIconsImporter... | package de.mprengemann.intellij.plugin.androidicons.controllers;
public class DefaultControllerFactory implements IControllerFactory {
private IAndroidIconsController androidIconsController;
private IMaterialIconsController materialIconsController; | private IDefaultsController defaultsController; | 1 |
Gotye-QPlus/GotyeSDK-Android | GotyeSDK/src/com/gotye/sdk/MainActivity.java | [
"public interface Configs {\n\n ClientMode clientMode = ClientMode.ROOM;\n \n \n String ROOT_FOLDER = \"/sdcard/gotye\";\n \n String SEND_PIC_FOLDER = ROOT_FOLDER + \"/sendpics\";\n \n String SEND_VOICE_FOLDER = ROOT_FOLDER + \"/sendvoices\";\n \n String RECV_PIC_FOLDER = ROOT_FOLDER +... | import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.... | package com.gotye.sdk;
public class MainActivity extends FragmentActivity implements GotyeLoginListener{
private ProgressDialog dialog;
private Fragment[] mFragments;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(W... | Intent intent = new Intent(MainActivity.this, GotyeMessageActivity.class); | 2 |
ddf/Minim | src/main/java/ddf/minim/javasound/JSAudioOutput.java | [
"public interface AudioListener\n{\n /**\n * Called by the audio object this AudioListener is attached to \n * when that object has new samples.\n * \n * @example Advanced/AddAndRemoveAudioListener\n * \n * @param samp \n * \ta float[] buffer of samples from a MONO sound stream\n * \n * @related ... | import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.Control;
import javax.sound.sampled.SourceDataLine;
import ddf.minim.AudioEffect;
import ddf.minim.AudioListener;
import ddf.minim.AudioSignal;
import ddf.minim.Minim;
import ddf.minim.MultiChannelBuffer;
import ddf.minim.spi.AudioOut;
import ddf.minim.... | /*
* Copyright (c) 2007 by Damien Di Fede <ddf@compartmental.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as published
* by the Free Software Foundation; either version 2 of the License, or
* (at your option) ... | private AudioListener listener; | 0 |
srcdeps/srcdeps-core | srcdeps-core/src/test/java/org/srcdeps/core/config/DefaultsAndInheritanceTest.java | [
"public enum Verbosity {\n debug, error, info, trace, warn;\n\n public static Verbosity fastValueOf(String level) {\n SrcdepsCoreUtils.assertArgNotNull(level, \"Verbosity name\");\n switch (level.toLowerCase(Locale.ROOT)) {\n case \"trace\":\n return trace;\n case \"debu... | import java.util.Collections;
import java.util.Stack;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import org.junit.Assert;
import org.junit.Test;
import org.srcdeps.core.BuildRequest.Verbosity;
import org.srcdeps.core.SrcVersion;
import org.srcdeps.core.config.ScmRepository.Builder;
import org... | /**
* Copyright 2015-2019 Maven Source Dependencies
* Plugin contributors as indicated by the @author tags.
*
* 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... | Stack<Node> stack = new Stack<>(); | 4 |
AlexanderMisel/gnubridge | src/main/java/org/gnubridge/core/bidding/rules/RebidForcing1NT.java | [
"public class Hand {\n\tList<Card> cards;\n\n\t/**\n\t * Caching optimization for pruning played cards\n\t * and perhaps others\n\t */\n\tList<Card> orderedCards;\n\tSuit color;\n\tList<Card> colorInOrder;\n\n\tpublic Hand() {\n\t\tthis.cards = new ArrayList<Card>();\n\t}\n\n\tpublic Hand(Card... cards) {\n\t\tthis... | import org.gnubridge.core.Hand;
import org.gnubridge.core.bidding.Auctioneer;
import org.gnubridge.core.bidding.Bid;
import org.gnubridge.core.bidding.PointCalculator;
import org.gnubridge.core.deck.Clubs;
import org.gnubridge.core.deck.Diamonds;
import org.gnubridge.core.deck.Hearts;
import org.gnubridge.core.deck.NoT... | package org.gnubridge.core.bidding.rules;
public class RebidForcing1NT extends PartnersRebid {
public RebidForcing1NT(Auctioneer a, Hand h) {
super(a, h);
}
@Override
protected boolean applies() {
return super.applies() && response.getTrump().isNoTrump() && response.getValue() == 1
&& opening.getTrump()... | Trump open = opening.getTrump(); | 7 |
mgledi/DRUMS | src/main/java/com/unister/semweb/drums/sync/synchronizer/UpdateOnlySynchronizer.java | [
"public class DRUMSParameterSet<Data extends AbstractKVStorable> {\r\n /** My private Logger. */\r\n private static Logger logger = LoggerFactory.getLogger(DRUMSParameterSet.class);\r\n\r\n private static final String PROTOTYPE_FILE = \"prototype.dat\";\r\n private static final String PROPERTY_FILE = \"... | import com.unister.semweb.drums.util.KeyUtils;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.unister.semweb.drums.DRUMSParameterSet;
import com.unister.semweb.drums.bucket.Bucket;
import com.unist... | /* Copyright (C) 2012-2013 Unister GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This progr... | } catch (FileLockException ex) {
| 2 |
monapu/monacoinj-multibit | core/src/test/java/com/google/bitcoin/core/ChainSplitTest.java | [
"public enum ConfidenceType {\n /** If BUILDING, then the transaction is included in the best chain and your confidence in it is increasing. */\n BUILDING(1),\n\n /**\n * If PENDING, then the transaction is unconfirmed and should be included shortly, as long as it is being\n * announced and is cons... | import com.google.bitcoin.core.TransactionConfidence.ConfidenceType;
import com.google.bitcoin.params.UnitTestParams;
import com.google.bitcoin.store.MemoryBlockStore;
import com.google.bitcoin.utils.BriefLogFormatter;
import com.google.bitcoin.utils.TestUtils;
import com.google.bitcoin.utils.Threading;
import org.juni... | /*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | private MemoryBlockStore blockStore; | 2 |
Gogolook-Inc/GogoMonkeyRun | UICompareRunner/com/james/uicomparerunner/ui/UiCompareFrame.java | [
"public class UICompareRunner {\n\tpublic static String android_sdk_path = null;\n\tpublic static String adb = \"/platform-tools/adb\";\n\tpublic static String monkey_runner = \"/tools/monkeyrunner\";\n\tpublic static String monkey_runner_ext_lib = \"/tools/lib/monkeyrunner_ext.jar\";\n\tpublic static String monkey... | import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Event;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.eve... | informationPanel.setBorder(
BorderFactory.createCompoundBorder(
BorderFactory.createTitledBorder("Information"),
BorderFactory.createEmptyBorder(5, 5, 5, 5)));
this.add(informationPanel, BorderLayout.WEST);
JLabel deviceTitle = new JLabel("Current Device");
deviceTitle.setBorder(
BorderFact... | final AndroidShell shell = new AndroidShell(UICompareRunner.adb); | 0 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/IdentifyInstrumentationPass.java | [
"public static FieldNode findField(ClassNode classNode, String name) {\n Validate.notNull(classNode);\n Validate.notNull(name);\n Validate.notEmpty(name);\n return classNode.fields.stream()\n .filter(x -> name.equals(x.name))\n .findAny().orElse(null);\n}",
"public static List<Me... | import org.apache.commons.lang3.Validate;
import static com.offbynull.coroutines.instrumenter.asm.SearchUtils.findField;
import static com.offbynull.coroutines.instrumenter.asm.SearchUtils.findMethodsWithParameter;
import static com.offbynull.coroutines.instrumenter.InstrumentationState.ControlFlag.NO_INSTRUMENT;
impor... | /*
* Copyright (c) 2017, Kasra Faghihi, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later ve... | if (!INSTRUMENTED_MARKER_FIELD_TYPE.getDescriptor().equals(instrumentedMarkerField.desc)) { | 4 |
CycloneAxe/phphub-android | app/src/main/java/org/estgroup/phphub/ui/presenter/UserTopicsPresenter.java | [
"public class TopicEntity {\n protected List<Topic> data;\n\n public List<Topic> getData() {\n return data;\n }\n\n public void setData(List<Topic> data) {\n this.data = data;\n }\n\n public class ATopic {\n protected Topic data;\n\n public Topic getData() {\n ... | import android.os.Bundle;
import org.estgroup.phphub.api.entity.TopicEntity;
import org.estgroup.phphub.api.entity.element.Topic;
import org.estgroup.phphub.common.base.BaseRxPresenter;
import org.estgroup.phphub.common.transformer.SchedulerTransformer;
import org.estgroup.phphub.model.UserModel;
import org.estgroup.ph... | package org.estgroup.phphub.ui.presenter;
public class UserTopicsPresenter extends BaseRxPresenter<UserTopicActivity> {
private static final int REQUEST_USER_TOPIC_ID = 1;
private static final int REQUEST_USER_FOLLOW_ID = 2;
private static final int REQUEST_USER_FAVORITE_ID = 3;
int userId;
... | .compose(new SchedulerTransformer<TopicEntity>()) | 0 |
GoogleCloudPlatform/cloud-spanner-r2dbc | cloud-spanner-r2dbc/src/test/java/com/google/cloud/spanner/r2dbc/it/ClientLibraryBasedIntegrationTest.java | [
"public static final String DRIVER_NAME = \"cloudspanner\";",
"public static final Option<String> INSTANCE = Option.valueOf(\"instance\");",
"public abstract class SpannerType implements io.r2dbc.spi.Type {\n\n private Type type;\n\n private static final Map<Code, Class<?>> SPANNER_TO_JAVA_TYPES = buildTypeMa... | import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.DRIVER_NAME;
import static com.google.cloud.spanner.r2dbc.SpannerConnectionFactoryProvider.INSTANCE;
import static io.r2dbc.spi.ConnectionFactoryOptions.DATABASE;
import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER;
import static org.a... | /*
* Copyright 2019-2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | .option(INSTANCE, DatabaseProperties.INSTANCE) | 1 |
godstale/retrowatch | RetroWatch_Android/RetroWatchLE/src/com/hardcopy/retrowatchle/service/RetroWatchService.java | [
"public class BluetoothManager {\n\t\n // Debugging\n private static final String TAG = \"BluetoothManager\";\n\n // Constants that indicate the current connection state\n public static final int STATE_NONE = 0; // we're doing nothing\n public static final int STATE_LISTEN = 1; // now liste... | import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
import com.hardcopy.retrowatchle.R;
import com.hardcopy.retrowatchle.connectivity.BluetoothManager;
import com.hardcopy.retrowatchle.connectivity.ConnectionInfo;
import com.hardcopy.retrowatchle.connectivity.TransactionBuilder;
import com.h... | /*
* Copyright (C) 2014 The Retro Watch - Open source smart watch project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unle... | private BluetoothManager mBtManager = null; | 0 |
schnatterer/nusic | nusic-ui-android/src/main/java/info/schnatterer/nusic/android/activities/MainActivity.java | [
"interface Loaders {\n int RELEASE_LOADER_ALL = 0;\n int RELEASE_LOADER_JUST_ADDED = 1;\n int RELEASE_LOADER_ANNOUNCED = 2;\n int RELEASE_LOADER_AVAILABLE = 3;\n}",
"public class LoadNewRelasesServiceBinding {\n private static final Logger LOG = LoggerFactory\n .getLogger(LoadNewRelasesS... | import info.schnatterer.nusic.Constants.Loaders;
import info.schnatterer.nusic.android.LoadNewRelasesServiceBinding;
import info.schnatterer.nusic.android.application.NusicApplication;
import info.schnatterer.nusic.android.fragments.ReleaseListFragment;
import info.schnatterer.nusic.android.service.LoadNewReleasesServi... | private void startLoadingReleasesFromInternet(boolean updateOnlyIfNecessary) {
boolean wasRunning = !loadNewRelasesServiceBinding.refreshReleases(
this, updateOnlyIfNecessary);
LOG.debug("Explicit refresh triggered. Service was "
+ (wasRunning ? "" : " not ") + "runni... | Loaders.RELEASE_LOADER_JUST_ADDED), | 0 |
Earthblood/Toe | app/src/main/java/com/earthblood/tictactoe/util/Skill.java | [
"public class Toe extends Application {\n\n public static final String TAG = \"EARTHBLOOD_TOE\";\n private static Context context;\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n RoboGuice.overrideApplicationInjector(this, new ToeRoboModule());\n\n context = this;\n... | import com.earthblood.tictactoe.R;
import com.earthblood.tictactoe.application.Toe;
import com.earthblood.tictactoe.strategy.ToeStrategy;
import com.earthblood.tictactoe.strategy.ToeStrategyEasy;
import com.earthblood.tictactoe.strategy.ToeStrategyHard;
import com.earthblood.tictactoe.strategy.ToeStrategyNormal;
import... | /**
* @author John Piser developer@earthblood.com
*
* Copyright (C) 2014 EARTHBLOOD, LLC
*
* 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 ... | public ToeStrategy strategy(int[] selectedXBoxIds, int [] selectedOBoxIds, GameSymbol androidSymbol){ | 1 |
horizon-institute/artcodes-android | library/src/main/java/uk/ac/horizon/artcodes/detect/marker/MarkerEmbeddedChecksumDetector.java | [
"public interface CameraFocusControl\n{\n void focus(Runnable callback);\n}",
"public interface MarkerDetectionHandler\n{\n\tvoid onMarkersDetected(Collection<Marker> markers, ArrayList<MatOfPoint> contours, Mat hierarchy, Size sourceImageSize);\n}",
"public class Action\n{\n\tpublic enum Match\n\t{\n\t\tany... | import uk.ac.horizon.artcodes.detect.handler.MarkerDetectionHandler;
import uk.ac.horizon.artcodes.model.Action;
import uk.ac.horizon.artcodes.model.Experience;
import uk.ac.horizon.artcodes.process.ImageProcessor;
import uk.ac.horizon.artcodes.process.ImageProcessorFactory;
import static uk.ac.horizon.artcodes.detect.... | /*
* Artcodes recognises a different marker scheme that allows the
* creation of aesthetically pleasing, even beautiful, codes.
* Copyright (C) 2013-2016 The University of Nottingham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Pu... | public ImageProcessor create(Context context, Experience experience, MarkerDetectionHandler handler, CameraFocusControl cameraFocusControl, Map<String, String> args) | 3 |
ransford/mspsim | se/sics/mspsim/plugin/ContikiChecker.java | [
"public interface Profiler {\n\n public static final String PARAM_FUNCTION_NAME_REGEXP = \"function.regexp\";\n public static final String PARAM_PROFILE_CALLERS = \"showcallers\";\n public static final String PARAM_SORT_MODE = \"sortmode\";\n \n public void setCPU(MSP430Core cpu);\n\n public void profileCall(... | import java.util.Hashtable;
import se.sics.mspsim.cli.BasicAsyncCommand;
import se.sics.mspsim.cli.CommandContext;
import se.sics.mspsim.cli.CommandHandler;
import se.sics.mspsim.core.MSP430;
import se.sics.mspsim.core.Memory.AccessMode;
import se.sics.mspsim.core.MemoryMonitor;
import se.sics.mspsim.core.Profiler;
imp... | /*
* Copyright (c) 2009, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* n... | private Profiler profiler; | 0 |
FIRST-Team-2557-The-SOTABots/FRC_Robot | Robot/src/main/java/org/usfirst/frc/team2557/robot/commands/autonomous/Auto_Lowbar.java | [
"public class MoveArmToAngleCommand extends Command {\n\n private PIDController _controller;\n\n private double _value;\n\n public MoveArmToAngleCommand(double potentiometerValue) {\n this._value = potentiometerValue;\n requires(Robot.arm);\n\n this._controller = new PIDController(0.3,... | import edu.wpi.first.wpilibj.command.CommandGroup;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import org.usfirst.frc.team2557.robot.commands.arm.MoveArmToAngleCommand;
import org.usfirst.frc.team2557.robot.commands.catapult.CatapultRetractCommand;
import org.usfirst.frc.team2557.robot.commands.chassis... | package org.usfirst.frc.team2557.robot.commands.autonomous;
public class Auto_Lowbar extends CommandGroup {
public Auto_Lowbar() {
// Parallels that run with a sequential
// are added before that sequential!
| this.addParallel(new CatapultRetractCommand()); | 1 |
CaMnter/Robotlegs4Android | app/src/main/java/com/camnter/robotlegs4android/test/view/fragment/TabLayoutThirdFragmentMediator.java | [
"public class Event {\n\n public static final String ADDED_TO_STAGE = \"added_to_stage\";\n public static final String REMOVED_FROM_STAGE = \"removed_from_stage\";\n public static final String ENTER_FRAME = \"enter_frame\";\n\n private String _type;\n private Object _target = null;\n public Object... | import com.camnter.robotlegs4android.test.event.LoginEvent;
import java.util.LinkedList;
import java.util.List;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageVi... | /*
* Copyright (C) 2015 CaMnter 421482590@qq.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | public void onHandle(Event event) { | 0 |
jasonbaldridge/maul | src/main/java/edu/berkeley/nlp/lm/phrasetable/MosesPhraseTableReader.java | [
"public interface WordIndexer<W> extends Serializable\n{\n\n\t/**\n\t * Gets the index for a word, adding if necessary.\n\t * \n\t * @param word\n\t * @return\n\t */\n\tpublic int getOrAddIndex(W word);\n\n\tpublic int getOrAddIndexFromString(String word);\n\n\t/**\n\t * Should never add to vocabulary, and should r... | import java.io.IOException;
import java.util.Arrays;
import edu.berkeley.nlp.lm.WordIndexer;
import edu.berkeley.nlp.lm.collections.Iterators;
import edu.berkeley.nlp.lm.io.IOUtils;
import edu.berkeley.nlp.lm.io.LmReader;
import edu.berkeley.nlp.lm.io.LmReaderCallback;
import edu.berkeley.nlp.lm.util.Logger; | package edu.berkeley.nlp.lm.phrasetable;
public class MosesPhraseTableReader<W> implements LmReader<PhraseTableCounts, MosesPhraseTableReaderCallback<W>>
{
static final String SEP_WORD = "<<sep>>";
private final WordIndexer<W> wordIndexer;
private final String file;
public MosesPhraseTableReader(final String... | private void readFromFiles(final LmReaderCallback<PhraseTableCounts> callback) { | 4 |
SalmanTKhan/MyAnimeViewer | app/src/main/java/com/taskdesignsinc/android/myanimeviewer/adapter/OfflineHistoryRecyclerAdapter.java | [
"public abstract class FlexibleAdapter<VH extends RecyclerView.ViewHolder, T>\n\t\textends SelectableAdapter<VH>\n\t\timplements Filterable {\n\n\tprivate static final String TAG = FlexibleAdapter.class.getSimpleName();\n\tpublic static final long UNDO_TIMEOUT = 5000L;\n\n\t/**\n\t * Lock used to modify the content... | import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.preference.PreferenceManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
import android.view.LayoutInf... | package com.taskdesignsinc.android.myanimeviewer.adapter;
public class OfflineHistoryRecyclerAdapter extends FlexibleAdapter<OfflineHistoryRecyclerAdapter.ViewHolder, OfflineHistoryRecord> implements Filterable {
private static final String TAG = OfflineHistoryRecyclerAdapter.class.getSimpleName();
publi... | mUnreadColor = mPrefs.getInt(Constants.KEY_EPISODE_UNVIEWED_COLOR, ThemeManager.getInstance(context).getTextColor()); | 6 |
aikuma/aikuma | Aikuma/src/org/lp20/aikuma/ui/AddSpeakerActivity4.java | [
"public class Language implements Parcelable, Comparable<Language> {\n\n\t/**\n\t * The name of the language\n\t */\n\tprivate String name;\n\n\t/**\n\t * The language's ISO 639-3 language code\n\t */\n\tprivate String code;\n\n\tprivate void setName(String name) {\n\t\tthis.name = name;\n\t}\n\n\tprivate void setC... | import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.io.IOException;
import java.util.A... | /*
Copyright (C) 2013-2015, The Aikuma Project
AUTHORS: Oliver Sangyeop Lee
*/
package org.lp20.aikuma.ui;
/**
* @author Oliver Adams <oliver.adams@gmail.com>
* @author Florian Hanke <florian.hanke@gmail.com>
* @author Sangyeop Lee <sangl1@student.unimelb.edu.au>
*/
public class AddSpeakerActivity4 extends Aiku... | AikumaSettings.getLatestVersion(), AikumaSettings.getCurrentUserId()); | 2 |
sastix/cms | server/src/main/java/com/sastix/cms/server/services/cache/dummy/DummyCacheService.java | [
"@Getter @Setter @NoArgsConstructor\npublic class CacheDTO implements Serializable {\n\n /**\n * Serial Version UID.\n */\n private static final long serialVersionUID = 4215735359530723728L;\n\n /**\n * The key of the object to be cached\n */\n private String cacheKey;\n\n /**\n *... | import com.sastix.cms.common.cache.CacheDTO;
import com.sastix.cms.common.cache.QueryCacheDTO;
import com.sastix.cms.common.cache.RemoveCacheDTO;
import com.sastix.cms.common.cache.exceptions.DataNotFound;
import com.sastix.cms.server.services.cache.CacheService;
import org.springframework.context.annotation.Profile;
i... | /*
* Copyright(c) 2017 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 appl... | public void cacheResource(CacheDTO cacheDTO) throws DataNotFound { | 0 |
hecoding/Pac-Man | src/parser/TreeParser.java | [
"public enum BooleanOperator {\n\t\n\tand, or;\n\t\n\tpublic boolean operate(boolean b1, boolean b2){\n\t\tboolean result = false;\n\t\t\n\t\tif(this == BooleanOperator.and)\n\t\t\tresult = b1 && b2;\n\t\telse if(this == BooleanOperator.or)\n\t\t\tresult = b1 || b2;\n\t\telse\n\t\t\tSystem.err.println(\"unknown boo... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import parser.operators.BooleanOperator;
import parser.function.BooleanFunc;
import parser.function.NumericFunc;
import parser.function.Action;
import parser.nodes.IfNode;
import parser.nodes.NicerTree;
import parser.nodes.Node;
import parser.n... | package parser;
public class TreeParser {
public static NicerTree parseTree(String str){
List<String> strList = new ArrayList<String>(Arrays.asList(str.split("_")));
Node root = parseTree(strList);
NicerTree tree = new NicerTree(root);
return tree;
}
private static Node parseTree(List<Strin... | NumericFunc nf1 = getNumericFunc(num1); | 2 |
m4rciosouza/ponto-inteligente-api | src/test/java/com/kazale/pontointeligente/api/repositories/LancamentoRepositoryTest.java | [
"@Entity\n@Table(name = \"funcionario\")\npublic class Funcionario implements Serializable {\n\n\tprivate static final long serialVersionUID = -5754246207015712518L;\n\t\n\tprivate Long id;\n\tprivate String nome;\n\tprivate String email;\n\tprivate String senha;\n\tprivate String cpf;\n\tprivate BigDecimal valorHo... | import static org.junit.Assert.assertEquals;
import java.security.NoSuchAlgorithmException;
import java.util.Date;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.spr... | package com.kazale.pontointeligente.api.repositories;
@RunWith(SpringRunner.class)
@SpringBootTest
@ActiveProfiles("test")
public class LancamentoRepositoryTest {
@Autowired
private LancamentoRepository lancamentoRepository;
@Autowired
private FuncionarioRepository funcionarioRepository;
@Autowired
pri... | Funcionario funcionario = this.funcionarioRepository.save(obterDadosFuncionario(empresa)); | 0 |
StumbleUponArchive/hbase | src/test/java/org/apache/hadoop/hbase/coprocessor/example/TestZooKeeperScanPolicyObserver.java | [
"public class HBaseTestingUtility {\n private static final Log LOG = LogFactory.getLog(HBaseTestingUtility.class);\n private Configuration conf;\n private MiniZooKeeperCluster zkCluster = null;\n\n /**\n * The default number of regions per regionserver when creating a pre-split\n * table.\n */\n private ... | import static org.junit.Assert.assertEquals;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescri... | /**
* 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... | HTable t = new HTable(new Configuration(TEST_UTIL.getConfiguration()), tableName); | 2 |
Tirasa/ADSDDL | src/main/java/net/tirasa/adsddl/ntsd/ACE.java | [
"public enum AceFlag {\n\n /**\n * 0x02 - Child objects that are containers, such as directories, inherit the ACE as an effective ACE. The inherited\n * ACE is inheritable unless the NO_PROPAGATE_INHERIT_ACE bit flag is also set.\n */\n CONTAINER_INHERIT_ACE((byte) 0x02, \"CI\"),\n /**\n * ... | import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import net.tirasa.adsddl.ntsd.data.AceFlag;
import net.tirasa.adsddl.ntsd.data.AceObjectFlags;
import net... | /*
* Copyright (C) 2015 Tirasa (info@tirasa.net)
*
* 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 ... | private AceObjectFlags objectFlags; | 1 |
SEMERU-WM/ChangeScribe | CommitSummarizer/CommitSummarizer.core/src/main/java/co/edu/unal/colswe/changescribe/core/textgenerator/phrase/MethodPhraseGenerator.java | [
"public class Constants {\n\n\tpublic static final String RENAME = \"RENAME\";\n\tpublic static final String TREE = \"^{tree}\";\n\tpublic static final String DELETE = \"DELETE\";\n\tpublic static final String REMOVE = \"REMOVE\";\n\tpublic static final String ADD = \"ADD\";\n\tpublic static final String MODIFY = \... | import java.util.LinkedList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import co.edu.unal.colswe.changescribe.core.Constants;
import co... | package co.edu.unal.colswe.changescribe.core.textgenerator.phrase;
public class MethodPhraseGenerator implements PhraseGenerator {
private MethodDeclaration method;
private final StereotypedElement element;
private String type;
private String phraseString;
private LinkedList<Parameter> parameters = new Linke... | final LinkedList<TaggedTerm> taggedMethod = POSTagger.tag(Tokenizer.split(getMethod().getName().getFullyQualifiedName())); | 4 |
offbynull/actors | core/src/main/java/com/offbynull/actors/gateways/actor/ActorGateway.java | [
"public static final String DEFAULT_ACTOR = \"actor\";",
"public interface Gateway extends Closeable {\n\n /**\n * Get the shuttle used to receive messages.\n * @return shuttle for incoming messages\n * @throws IllegalStateException if this gateway is closed\n */\n Shuttle getIncomingShuttle... | import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.commons.io.IOUtils;
import static com.offbynull.actors.gateway.CommonAddresses.DEFAULT_ACTOR;
import com.offbynull.actors.gateway.Gateway;
import com.offbynull.coroutines.user.Coroutine;
import com.offbynu... | /*
* Copyright (c) 2017, Kasra Faghihi, All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later ve... | return create(DEFAULT_ACTOR); | 0 |
bourgesl/marlin-fx | src/main/java/com/sun/prism/impl/shape/MarlinPrismUtils.java | [
" public class Path2D extends Shape implements PathConsumer2D {\n\n static final int curvecoords[] = {2, 2, 4, 6, 0};\n\n public enum CornerPrefix {\n CORNER_ONLY,\n MOVE_THEN_CORNER,\n LINE_THEN_CORNER\n }\n\n /**\n * An even-odd winding rule for determining the interior... | import com.sun.javafx.geom.Shape;
import com.sun.javafx.geom.transform.BaseTransform;
import com.sun.marlin.MarlinConst;
import com.sun.marlin.MarlinProperties;
import com.sun.marlin.MarlinRenderer;
import com.sun.marlin.MarlinUtils;
import com.sun.marlin.RendererContext;
import com.sun.marlin.Stroker;
import com.sun.m... | /*
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free ... | static final boolean DO_CLIP = MarlinProperties.isDoClip(); | 2 |
Gotye-QPlus/GotyeSDK-Android | GotyeSDK/src/com/gotye/sdk/MainActivity.java | [
"public interface Configs {\n\n ClientMode clientMode = ClientMode.ROOM;\n \n \n String ROOT_FOLDER = \"/sdcard/gotye\";\n \n String SEND_PIC_FOLDER = ROOT_FOLDER + \"/sendpics\";\n \n String SEND_VOICE_FOLDER = ROOT_FOLDER + \"/sendvoices\";\n \n String RECV_PIC_FOLDER = ROOT_FOLDER +... | import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
import android.media.AudioManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.... | package com.gotye.sdk;
public class MainActivity extends FragmentActivity implements GotyeLoginListener{
private ProgressDialog dialog;
private Fragment[] mFragments;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(W... | FragmentHolder[] fragments = FragmentsFactory.getInstance().makeMainFragments(this, Configs.clientMode, mTabContainer, theme); | 3 |
ferstl/depgraph-maven-plugin | src/main/java/com/github/ferstl/depgraph/dependency/dot/DotGraphStyleConfigurer.java | [
"public abstract class AbstractGraphStyleConfigurer implements GraphStyleConfigurer {\n\n protected boolean showGroupId;\n protected boolean showArtifactId;\n protected boolean showVersionsOnNodes;\n protected boolean showTypes;\n protected boolean showClassifiers;\n protected boolean showVersionOnEdges;\n p... | import com.github.ferstl.depgraph.dependency.AbstractGraphStyleConfigurer;
import com.github.ferstl.depgraph.dependency.DependencyNode;
import com.github.ferstl.depgraph.dependency.dot.style.StyleConfiguration;
import com.github.ferstl.depgraph.graph.GraphBuilder;
import com.github.ferstl.depgraph.graph.dot.DotGraphFor... | /*
* Copyright (c) 2014 - 2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... | public GraphBuilder<DependencyNode> configure(GraphBuilder<DependencyNode> graphBuilder) { | 3 |
sewerk/Bill-Calculator | app/src/main/java/pl/srw/billcalculator/history/HistoryPresenter.java | [
"@Singleton\npublic class SavedBillsRegistry {\n\n private final SimpleArrayMap<String, Long> registry;\n\n @Inject\n SavedBillsRegistry() {\n registry = new SimpleArrayMap<>();\n }\n\n public String register(Bill bill) {\n Timber.d(\"register() called with: bill = [%s]\", bill);\n ... | import android.view.View;
import java.util.Arrays;
import javax.inject.Inject;
import pl.srw.billcalculator.bill.SavedBillsRegistry;
import pl.srw.billcalculator.data.ApplicationRepo;
import pl.srw.billcalculator.data.bill.HistoryRepo;
import pl.srw.billcalculator.db.Bill;
import pl.srw.billcalculator.form.fragment.For... | package pl.srw.billcalculator.history;
@RetainActivityScope
public class HistoryPresenter extends MvpPresenter<HistoryPresenter.HistoryView>
implements HistoryItemDismissHandling, HistoryItemClickListener, FormPresenter.HistoryChangeListener {
private final ApplicationRepo applicationRepo;
private... | public void onListItemDismissed(final int position, Bill bill) { | 2 |
evolvingstuff/RecurrentJava | src/datasets/SequentialParity.java | [
"public class LossMultiDimensionalBinary implements Loss {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = 1L;\n\n\t@Override\n\tpublic void backward(Matrix actualOutput, Matrix targetOutput) throws Exception {\n\t\tthrow new Exception(\"not implemented\");\n\t}\n\t\n\t@Override\n\tpublic dou... | import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import loss.LossMultiDimensionalBinary;
import loss.LossSumOfSquares;
import matrix.Matrix;
import model.Model;
import model.Nonlinearity;
import model.SigmoidUnit;
import datastructs.DataSequence;
import datastructs.DataSet;
import datastructs... | package datasets;
public class SequentialParity extends DataSet {
public SequentialParity(Random r, int total_sequences, int max_sequence_length_train, int max_sequence_length_test) {
inputDimension = 1;
outputDimension = 1; | lossTraining = new LossSumOfSquares(); | 1 |
actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/typed/TypedAskExtensions.java | [
"public class ActorRef {\n private ActorSystem system;\n private AbsActorDispatcher dispatcher;\n private UUID uuid;\n private String path;\n private ActorEndpoint endpoint;\n\n public UUID getUuid() {\n return uuid;\n }\n\n public String getPath() {\n return path;\n }\n\n ... | import com.droidkit.actors.ActorRef;
import com.droidkit.actors.concurrency.Future;
import com.droidkit.actors.concurrency.FutureCallback;
import com.droidkit.actors.extensions.ActorExtension;
import com.droidkit.actors.typed.messages.TypedFutureError;
import com.droidkit.actors.typed.messages.TypedFutureResult;
import... | package com.droidkit.actors.typed;
/**
* Created by ex3ndr on 14.09.14.
*/
public class TypedAskExtensions implements ActorExtension {
private HashMap<Integer, AskContainer> containers = new HashMap<Integer, AskContainer>();
| private ActorRef self; | 0 |
DDoS/JICI | src/main/java/ca/sapon/jici/lexer/literal/BooleanLiteral.java | [
"public class Environment {\n // TODO make me thread safe\n private static final Map<String, Class<?>> DEFAULT_CLASSES = new HashMap<>();\n private final Map<String, Class<?>> classes = new LinkedHashMap<>(DEFAULT_CLASSES);\n private final Map<String, Variable> variables = new LinkedHashMap<>();\n\n ... | import ca.sapon.jici.evaluator.Environment;
import ca.sapon.jici.evaluator.EvaluatorException;
import ca.sapon.jici.evaluator.value.Value;
import ca.sapon.jici.evaluator.value.ValueKind;
import ca.sapon.jici.evaluator.type.PrimitiveType;
import ca.sapon.jici.evaluator.type.Type;
import ca.sapon.jici.lexer.TokenID; | /*
* This file is part of JICI, licensed under the MIT License (MIT).
*
* Copyright (c) 2015-2016 Aleksi Sapon <http://sapon.ca/jici/>
*
* 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... | public ValueKind getKind() { | 3 |
sumeetchhetri/gatf | alldep-jar/src/main/java/com/gatf/executor/ext/WrkTestCaseExecutor.java | [
"public class AcceptanceTestContext {\r\n\r\n\tprivate Logger logger = Logger.getLogger(AcceptanceTestContext.class.getSimpleName());\r\n\t\r\n\tpublic final static String\r\n\t PROP_SOAP_ACTION_11 = \"SOAPAction\",\r\n\t PROP_SOAP_ACTION_12 = \"action=\",\r\n\t PROP_CONTENT_TYPE = \"Content-Type\",\r\n\t ... | import java.io.File;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.ws.rs.core.MediaType;
import org.apache.... | public static void execute(AcceptanceTestContext context, TestCase tc, TestCaseReport tcr, boolean isSingleExecutionContext) throws Exception {
GatfExecutorConfig config = context.getGatfExecutorConfig();
if(tc.getPerfConfig()!=null && tc.getPerfConfig().getType()!=null && tc.getPerfConfig().getType().startsWith(... | tcr.setStatus(TestStatus.Success.status); | 5 |
spotify/spydra | spydra/src/main/java/com/spotify/spydra/submitter/api/Submitter.java | [
"public abstract class Metrics {\n private final String user;\n\n public Metrics(String user) {\n this.user = user;\n }\n\n public String getUser() {\n return user;\n }\n\n /**\n * Emit cluster creation metric.\n *\n * @param arguments The Spydra arguments.\n * @param zoneUri The zone URI wher... | import com.spotify.spydra.metrics.Metrics;
import com.spotify.spydra.metrics.MetricsFactory;
import com.spotify.spydra.model.SpydraArgument;
import com.spotify.spydra.submitter.executor.Executor;
import com.spotify.spydra.submitter.executor.ExecutorFactory;
import com.spotify.spydra.util.SpydraArgumentUtil;
import java... | /*-
* -\-\-
* Spydra
* --
* Copyright (C) 2016 - 2018 Spotify AB
* --
* 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
*
* Unles... | private final Metrics metrics = MetricsFactory.getInstance(); | 0 |
flanglet/kanzi | java/src/test/java/kanzi/test/TestDefaultBitStream.java | [
"public class BitStreamException extends RuntimeException\n{\n private static final long serialVersionUID = 7279737120722476336L;\n\n public static final int UNDEFINED = 0;\n public static final int INPUT_OUTPUT = 1;\n public static final int END_OF_STREAM = 2;\n public static final int INVALID_ST... | import kanzi.bitstream.DefaultOutputBitStream;
import org.junit.Assert;
import org.junit.Test;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutpu... | /*
Copyright 2011-2021 Frederic Langlet
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 ... | DebugOutputBitStream dbs = new DebugOutputBitStream(obs, System.out); | 3 |
srcdeps/srcdeps-core | srcdeps-core/src/test/java/org/srcdeps/core/AbstractBuildServiceTest.java | [
"public static class BuildRequestBuilder {\n\n private boolean addDefaultBuildArguments = true;\n private boolean addDefaultBuildEnvironment = true;\n private List<String> buildArguments = new ArrayList<>();\n private Map<String, String> buildEnvironment = new LinkedHashMap<>();\n private Set<Ga> bui... | import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.eclipse.sisu.launch.InjectedTest;
import org.junit.Assert;
import org.junit.B... | /**
* Copyright 2015-2019 Maven Source Dependencies
* Plugin contributors as indicated by the @author tags.
*
* 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... | .gradleModelTransformer(CharStreamSource.defaultModelTransformer()) // | 2 |
brutusin/wava | wava-core/src/main/java/org/brutusin/wava/utils/LinuxCommands.java | [
"public class Config {\r\n\r\n private final File tempFolder;\r\n private static volatile Config instance;\r\n private final ConfigImpl impl;\r\n\r\n private Config() {\r\n try {\r\n File cfgFile = new File(WavaHome.getInstance().getFile(), \"cfg/wava.json\");\r\n if (!cfgFi... | import org.brutusin.wava.core.stats.MemoryStats;
import org.brutusin.wava.env.WavaHome;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
... | }
public static void createJobCgroups(String groupName, int jobId, long maxJobRSSBytes) {
createJobMemoryCgroup(groupName, jobId, maxJobRSSBytes);
createJobCpuCgroup(groupName, jobId);
createJobIOCgroup(groupName, jobId);
}
public static void createGroupCgroups(String g... | public static CpuStats getCgroupCpuStats(String groupName, Integer jobId) {
| 1 |
softwarespartan/TWS | src/apidemo/ContractInfoPanel.java | [
"public class HtmlButton extends JLabel {\n\tstatic Color light = new Color( 220, 220, 220);\n\t\n\tprivate String m_text;\n\tprotected boolean m_selected;\n\tprivate ActionListener m_al;\n\tprivate Color m_bg = getBackground();\n\n\tpublic boolean isSelected() { return m_selected; }\n\t\n\tpublic void setSelected(... | import java.awt.BorderLayout;
import java.awt.Desktop;
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import apidemo.util... | /* Copyright (C) 2013 Interactive Brokers LLC. All rights reserved. This code is subject to the terms
* and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. */
package apidemo;
public class ContractInfoPanel extends JPanel {
private final NewContract m_contract =... | class FundaResultPanel extends JPanel implements INewTab, IFundamentalsHandler { | 6 |
Piasy/decaf-mind-compiler | decaf_PA3/src/decaf/frontend/SemValue.java | [
"public abstract class Tree {\n\n /**\n * Toplevel nodes, of type TopLevel, representing entire source files.\n */\n public static final int TOPLEVEL = 1;\n\n /**\n * Import clauses, of type Import.\n */\n public static final int IMPORT = TOPLEVEL + 1;\n\n /**\n * Class definition... | import java.util.List;
import decaf.Location;
import decaf.tree.Tree;
import decaf.tree.Tree.ClassDef;
import decaf.tree.Tree.Expr;
import decaf.tree.Tree.MethodDef;
import decaf.tree.Tree.LValue;
import decaf.tree.Tree.TopLevel;
import decaf.tree.Tree.VarDef;
import decaf.tree.Tree.TypeLiteral;
import decaf.utils.Misc... | package decaf.frontend;
public class SemValue {
public int code;
public Location loc;
public int typeTag;
public Object literal;
public String ident;
public List<ClassDef> clist;
/**
* field list
*/
public List<Tree> flist;
public List<VarDef> vlist;
/**
* statement list
*/
public List... | public List<Expr> elist; | 2 |
Ayvytr/EasyAndroid | EasyAndroidTest/src/main/java/com/ayvytr/easyandroidtest/stickyheader/TestStickyActivity2.java | [
"public class Convert\r\n{\r\n //浮点数是否相等的精度\r\n public static final double DOUBLE_ACCURACY = 0.00001;\r\n\r\n /**\r\n * value转boolean\r\n *\r\n * @param value int\r\n * @return value == 0: false; value != 0: true\r\n */\r\n public static boolean toBool(int value)\r\n {\r\n ... | import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.ayvytr.easyandroid.tools.Convert;
import com.ayvytr.easya... | package com.ayvytr.easyandroidtest.stickyheader;
public class TestStickyActivity2 extends BaseActivity
{
@BindView(R.id.recyclerView)
RecyclerView recyclerView;
private BasicAdapter basicAdapter;
@Override
protected void initView(Bundle savedInstanceState)
{
ButterKnife.bind(this)... | recyclerView.addItemDecoration(new StickyHeaderItemDecoration(basicAdapter)); | 4 |
eleks/rnd-android-wear-tesla | mobile/src/main/java/com/eleks/tesla/api/ApiAdapter.java | [
"public class ChargeState implements Serializable {\n public static final String STATE_CHARGING = \"Charging\";\n public static final String STATE_COMPLETE = \"Complete\";\n\n private String charging_state;\n private boolean charge_to_max_range;\n private int max_range_charge_counter;\n private bo... | import com.eleks.tesla.teslalib.models.ChargeState;
import com.eleks.tesla.teslalib.models.ClimateState;
import com.eleks.tesla.teslalib.models.DriveState;
import com.eleks.tesla.teslalib.models.GuiSettings;
import com.eleks.tesla.teslalib.models.Result;
import com.eleks.tesla.teslalib.models.Vehicle;
import com.eleks.... | package com.eleks.tesla.api;
/**
* Created by maryan.melnychuk on 09.02.2015.
*/
public interface ApiAdapter {
@GET("/vehicles") | void getVehicles(Callback<List<Vehicle>> callback); | 5 |
mbolt35/coffee-graph | src/test/java/bolt/web/coffee/GeneralCoffeeGraphTest.java | [
"public class CoffeeIdentifier implements NamedDependency {\n\n private final String name;\n private final File file;\n private final int depth;\n\n public CoffeeIdentifier(String name, File file, int depth) {\n this.name = name;\n this.file = file;\n this.depth = depth;\n }\n\n ... | import org.junit.Test;
import java.io.File;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import bolt.web.coffee.dependency.CoffeeIdentifier;
import bolt.web.coffee.dependency.graph.CyclicDependencyException;
import bolt.web.... | ////////////////////////////////////////////////////////////////////////////////
//
// Coffee-Graph
// Copyright(C) 2012 Matt Bolt
//
// 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 w... | .parsedWith(new CoffeeScriptMinParser()) | 3 |
meruvian/yama | webapi/src/main/java/org/meruvian/yama/webapi/service/RestSignUpService.java | [
"@Entity\n@Table(name = \"yama_workflow_role\")\npublic class Role extends DefaultPersistence {\n\tprivate String name;\n\tprivate String description;\n\tprivate List<UserRole> users = new ArrayList<UserRole>();\n\t\n\t@NotNull\n\t@Column(nullable = false, unique = true)\n\tpublic String getName() {\n\t\treturn nam... | import java.io.IOException;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Context;
import org.meruvian.yama.core.commons.FileInfo;
import org.meruvian.yama.core.role.Role;
import org.meruvian.yama.core.role.RoleRepository;
import org.meruvian.yama.core.user.User;
impo... | /**
* Copyright 2014 Meruvian
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | SocialService<?> socialService = socialServiceLocator.getSocialService(connection.getKey().getProviderId()); | 3 |
totemo/watson | src/watson/analysis/LbCoordsAnalysis.java | [
"public class Configuration\n{\n /**\n * Single instance of this class.\n */\n public static final Configuration instance = new Configuration();\n\n /**\n * Key bind to show in-game Watson GUI.\n */\n public final ModifiedKeyBinding KEYBIND_INGAME = new ModifiedKeyBinding(\"Show in-g... | import static watson.analysis.LogBlockPatterns.LB_COORD;
import static watson.analysis.LogBlockPatterns.LB_COORD_KILLS;
import static watson.analysis.LogBlockPatterns.LB_COORD_REPLACED;
import static watson.analysis.LogBlockPatterns.LB_HEADER_BLOCK;
import static watson.analysis.LogBlockPatterns.LB_HEADER_BLOCKS;
impor... | package watson.analysis;
// ----------------------------------------------------------------------------
/**
* An {@link Analysis} implementation that extracts {@link BlockEdit} instances
* from lb.coord lines.
*/
public class LbCoordsAnalysis extends Analysis
{
// ---------------------------------------------... | BlockType type = BlockTypeRegistry.instance.getBlockTypeByName(block); | 5 |
thehiflyer/Fettle | src/main/java/se/fearless/fettle/impl/MutableTransitionModelImpl.java | [
"public interface Action<S, E, C> {\n\t/**\n\t * Called when a transition occurs\n\t * @param from the state the machine was in before the transition\n\t * @param to the state the machine is in after the transition\n\t * @param causedBy the event that triggered the transition\n\t * @param context the context in whi... | import se.fearless.fettle.Action;
import se.fearless.fettle.Condition;
import se.fearless.fettle.MutableTransitionModel;
import se.fearless.fettle.StateMachine;
import se.fearless.fettle.StateMachineTemplate;
import se.fearless.fettle.Transition;
import se.fearless.fettle.util.GuavaReplacement;
import java.util.Collect... | package se.fearless.fettle.impl;
public class MutableTransitionModelImpl<S, E, C> extends AbstractTransitionModel<S, E, C> implements MutableTransitionModel<S, E, C> {
private MutableTransitionModelImpl(Class<S> stateClass, Class<E> eventClass, C defaultContext) {
super(stateClass, eventClass, defaultContext);
... | public void addTransition(S from, S to, E event, Condition<C> condition, List<Action<S, E, C>> actions) { | 1 |
SamirTalwar/Streams | src/test/java/com/noodlesandwich/streams/implementations/IteratorWrapperTest.java | [
"public final class EndOfStreamException extends RuntimeException {\n private static final long serialVersionUID = 6349624304997685948L;\n\n public EndOfStreamException() {\n super(\"End of stream\");\n }\n}",
"public interface Stream<T> extends Iterable<T> {\n /**\n * Returns <code>true</c... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import org.junit.jupiter.api.Test;
import com.noodlesandwich.streams.EndOfStreamException;
import com.noodlesandwich.streams.Stream;
import com.noodlesandwich.streams.Streams;
import com.noodlesandwich.streams.... | package com.noodlesandwich.streams.implementations;
public final class IteratorWrapperTest {
@Test public void
wraps_an_iterable() {
final Iterable<Integer> iterable = Arrays.asList(1, 2, 3); | assertThat(Streams.wrap(iterable), contains(1, 2, 3)); | 2 |
hypfvieh/bluez-dbus | bluez-dbus/src/main/java/com/github/hypfvieh/bluetooth/wrapper/ProfileManager.java | [
"public final class DbusHelper {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(DbusHelper.class);\n\n private DbusHelper() {\n\n }\n\n /**\n * Find all <node>-Elements in DBUS Introspection XML and extracts the value of the 'name' attribute.\n * @param _connection the db... | import com.github.hypfvieh.DbusHelper;
import org.bluez.ProfileManager1;
import org.bluez.exceptions.BluezAlreadyExistsException;
import org.bluez.exceptions.BluezDoesNotExistException;
import org.bluez.exceptions.BluezInvalidArgumentsException;
import org.freedesktop.dbus.DBusPath;
import org.freedesktop.dbus.connecti... | package com.github.hypfvieh.bluetooth.wrapper;
public class ProfileManager extends AbstractBluetoothObject {
private final Logger logger = LoggerFactory.getLogger(getClass());
private final ProfileManager1 rawProfileManager;
public ProfileManager(DBusConnection _dbusConnection) {
super(Bluetoot... | rawProfileManager = DbusHelper.getRemoteObject(_dbusConnection, getDbusPath(), ProfileManager1.class); | 0 |
Ekryd/sortpom | sorter/src/test/java/sortpom/util/XmlProcessorTestUtil.java | [
"public class XmlOutputGenerator {\n private String encoding;\n private String indentCharacters;\n private boolean expandEmptyElements;\n private boolean indentBlankLines;\n private boolean indentSchemaLocation;\n private final WriterFactory writerFactory = new WriterFactory();\n\n /**\n * ... | import org.apache.commons.io.IOUtils;
import org.jdom.Content;
import org.jdom.Element;
import refutils.ReflectionHelper;
import sortpom.XmlOutputGenerator;
import sortpom.XmlProcessor;
import sortpom.parameter.PluginParameters;
import sortpom.wrapper.WrapperFactoryImpl;
import sortpom.wrapper.content.AlphabeticalSorte... | package sortpom.util;
/**
* Test utility
*/
public class XmlProcessorTestUtil {
private boolean sortAlphabeticalOnly = false;
private boolean keepBlankLines = false;
private boolean indentBlankLines = false;
private String predefinedSortOrder = "recommended_2008_06";
private boolean expandEmpt... | return new UnsortedWrapper<>(content); | 5 |
juiser/juiser | spring/spring-boot-starter/src/main/java/org/juiser/spring/boot/config/JuiserAutoConfiguration.java | [
"public interface ResourceLoader {\n\n Resource getResource(String path) throws IOException;\n}",
"public class FallbackSigningKeyResolver extends SigningKeyResolverAdapter {\n\n private final SigningKeyResolver delegate;\n private final Key fallbackKey;\n\n public FallbackSigningKeyResolver(SigningKe... | import io.jsonwebtoken.Claims;
import io.jsonwebtoken.SigningKeyResolver;
import io.jsonwebtoken.lang.Strings;
import org.juiser.io.ResourceLoader;
import org.juiser.jwt.FallbackSigningKeyResolver;
import org.juiser.jwt.JwsClaimsExtractor;
import org.juiser.jwt.config.ConfigJwkResolver;
import org.juiser.jwt.config.Jwk... | /*
* Copyright 2017 Les Hazlewood and the respective Juiser contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* U... | return new DefaultMapUserFactory(); | 6 |
jixieshi999/juahya | JuahyaLibrary/src/com/xml/inflate/inflater/IFlateViewInFlaterAdapter.java | [
"public class Debug {\r\n \r\n static String TAG = \"DebugTools\";\r\n\r\n public static boolean DEBUG = true; \r\n public static void dLog(String tag,String str){\r\n if(!DEBUG){\r\n return;\r\n }\r\n\r\n Log.v(tag, str);\r\n \r\n }\r\n public static void l... | import org.xmlpull.v1.XmlPullParser;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import an... | bottomMargin=Integer.valueOf(attrValue);
}else if((NAMESPACE_ANDROID+":"+ATTRIBUTE_LAYOUT_MARGINRIGHT).equals(attrName)){
rightMargin=Integer.valueOf(attrValue);
}else if((NAMESPACE_ANDROID+":"+ATTRIBUTE_LAYOUT_MARGINLEFT).equals(attrName)){
leftMargin=Integer.valueOf(attrValue);
}else if((NA... | Debug.dLog("loadImage:"+filePath); | 0 |
wagoodman/StackAttack | StackAttackLibrary/src/com/wagoodman/stackattack/MenuManager.java | [
"public class AppPreferences extends PreferenceActivity {\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n // Load the preferences from an XML resource\n addPreferencesFromResource(R.xml.preferences);\n }\n\n}",
"public cl... | import java.util.Collections;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Callable;
import javax.microedition.khronos.opengles.GL10;
import com.wagoodman.stackattack.AppPreferences;
import com.wagoodman.stackattack.FontManager;
import com.wagood... | package com.wagoodman.stackattack;
public class MenuManager
{
private final Context mContext;
private final MainActivity game;
public static final String NONE = "none"; //call outro of current menu only
public static final String MAINMENU = "main";
public static final String INGAMEMENU = "ingame... | public void transitionToMenu(String menuTitle, Boolean doOutro, Integer duration, MotionEquation eq) | 2 |
jedwards1211/Jhrome | src/main/java/org/sexydock/tabs/demos/NonUniformTabWidthDemo.java | [
"@SuppressWarnings( \"serial\" )\r\npublic class DefaultTabbedPaneWindow extends JFrame implements ITabbedPaneWindow\r\n{\r\n\t\r\n\tpublic DefaultTabbedPaneWindow( ) throws HeadlessException\r\n\t{\r\n\t\tsuper( );\r\n\t\tinit( );\r\n\t}\r\n\t\r\n\tpublic DefaultTabbedPaneWindow( GraphicsConfiguration gc )\r\n\t{\... | import java.awt.Window;
import javax.swing.JPanel;
import org.sexydock.tabs.DefaultTabbedPaneWindow;
import org.sexydock.tabs.DefaultTabbedPaneWindowFactory;
import org.sexydock.tabs.ITabbedPaneWindow;
import org.sexydock.tabs.Tab;
import org.sexydock.tabs.TestTabFactory;
import org.sexydock.tabs.jhrome.JhromeTa... | /*
Copyright 2012 James Edwards
This file is part of Jhrome.
Jhrome is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Jhrom... | TestTabFactory tabFactory = new TestTabFactory( );
| 4 |
trivago/Mail-Pigeon | pigeon-web/src/main/java/com/trivago/mail/pigeon/web/components/mail/ModalAddNewsletter.java | [
"public class Mail extends AbstractBean\r\n{\r\n\tpublic static final String ID = \"newsletter_id\";\r\n\tpublic static final String DATE = \"send_date\";\r\n\tpublic static final String SUBJECT = \"subject\";\r\n\tpublic static final String TEXT = \"text_content\";\r\n\tpublic static final String HTML = \"html_con... | import com.trivago.mail.pigeon.bean.Mail;
import com.trivago.mail.pigeon.bean.MailTemplate;
import com.trivago.mail.pigeon.bean.RecipientGroup;
import com.trivago.mail.pigeon.bean.Sender;
import com.trivago.mail.pigeon.storage.Util;
import com.trivago.mail.pigeon.web.components.groups.GroupSelectBox;
import com.t... | final GroupSelectBox groupSelectBox = new GroupSelectBox();
final UploadTextFileComponent uploadTextfile = new UploadTextFileComponent();
final UploadHtmlFileComponent uploadHtmlfile = new UploadHtmlFileComponent();
final TemplateSelectBox templateSelectBox = new TemplateSelectBox();
final TextField... | Mail m = new Mail(mailId, text, html, (Date)tfSendDate.getValue(), subject, s);
| 0 |
suragch/aePronunciation | app/src/main/java/com/aepronunciation/ipa/StudyTimer.java | [
"public static final String PREFS_NAME = \"MyPrefsFile\";",
"public static final long TIME_DEFAULT = 0;",
"public static final String TIME_LEARN_DOUBLE_KEY = \"timeLearnDouble\";",
"public static final String TIME_LEARN_SINGLE_KEY = \"timeLearnSingle\";",
"public static final String TIME_PRACTICE_DOUBLE_KEY... | import android.content.Context;
import android.content.SharedPreferences;
import static android.content.Context.MODE_PRIVATE;
import static com.aepronunciation.ipa.MainActivity.PREFS_NAME;
import static com.aepronunciation.ipa.MainActivity.TIME_DEFAULT;
import static com.aepronunciation.ipa.MainActivity.TIME_LEARN_DOUB... | package com.aepronunciation.ipa;
// Timer for handling learning, practice, and test times
// WARNING: Singletons are not thread safe. Only instantiate on the UI thread.
final class StudyTimer {
private long startTime;
enum StudyType {
LearnSingle,
LearnDouble,
PracticeSingle,
... | key = TIME_PRACTICE_SINGLE_KEY; | 5 |
jbosgi/jbosgi-repository | core/src/main/java/org/jboss/osgi/repository/spi/AbstractRepository.java | [
"public final class URLResourceBuilderFactory extends XResourceBuilderFactory<XResource> {\n\n private final URLResource urlres;\n\n private URLResourceBuilderFactory(URLResource urlres) {\n this.urlres = urlres;\n }\n\n public static XResourceBuilder<XResource> create(URL contentURL, Map<String,... | import static org.jboss.osgi.repository.RepositoryLogger.LOGGER;
import static org.jboss.osgi.repository.RepositoryMessages.MESSAGES;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.u... | if (l == null) {
// first condition
l = new ArrayList<Resource>(findProvidersImpl(req));
} else {
l.retainAll(findProvidersImpl(req));
}
}
// Handle the not expressions
for (NotExpression req : notExpressions) {... | if (resource instanceof RepositoryContent) { | 4 |
springtestdbunit/spring-test-dbunit | spring-test-dbunit/src/test/java/com/github/springtestdbunit/DbUnitTestExecutionListenerPrepareTest.java | [
"public enum DatabaseOperation {\n\n\t/**\n\t * Updates the contents of existing database tables from the dataset.\n\t */\n\tUPDATE,\n\n\t/**\n\t * Inserts new database tables and contents from the dataset.\n\t */\n\tINSERT,\n\n\t/**\n\t * Refresh the contents of existing database tables. Rows from the dataset will... | import static org.junit.Assert.*;
import static org.mockito.BDDMockito.given;
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;
import javax.sql.DataSource;
import org.dbunit.database.DatabaseDataSourceConnection;
import org.dbunit.database.IDatabaseConnection;
import org.dbunit.dataset.IDataSe... | /*
* Copyright 2002-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 applic... | assertEquals(DefaultDatabaseOperationLookup.class, testContextManager | 4 |
OpenWatch/OpenWatch-Android | app/OpenWatch/src/org/ale/openwatch/http/OWServiceRequests.java | [
"public class Authentication {\n private static final String TAG = \"Authentication\";\n\n public interface AuthenticationCallback{\n public void onComplete();\n }\n\n /**\n * Save the OpenWatch service login response data to SharedPreferences this\n * includes the public and private uplo... | import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.location.Location;
import android.net.Uri;
import android.os.AsyncTask;
import android.support.v4... | package org.ale.openwatch.http;
/**
* OWService (Django) Requests
*
* @author davidbrodsky
*
*/
public class OWServiceRequests {
private static final String TAG = "OWServiceRequests";
public interface RequestCallback {
public void onFailure();
public void onSuccess();
}
public interface Pagina... | if (response.has(Constants.OW_STATUS) && response.getString(Constants.OW_STATUS).compareTo(Constants.OW_SUCCESS) ==0) { | 1 |
thlcly/Mini-JVM | src/main/java/com/aaront/exercise/jvm/ClassFile.java | [
"@AllArgsConstructor\n@Getter\npublic enum ClassAccessFlag {\n ACC_PUBLIC(0X0001, \"PUBLIC\"),\n ACC_FINAL(0x0010, \"FINAL\"),\n ACC_SUPER(0x0020, \"SUPER\"),\n ACC_ABSTRACT(0x0400, \"ABSTRACT\"),\n ACC_SYNTHETIC(0x1000, \"SYNTHETIC\"),\n ACC_ANNOTATION(0x2000, \"ANNOTATION\"),\n ACC_ENUM(0x400... | import com.aaront.exercise.jvm.accessflag.ClassAccessFlag;
import com.aaront.exercise.jvm.constant.ClassConstant;
import com.aaront.exercise.jvm.constant.ConstantPool;
import com.aaront.exercise.jvm.field.Field;
import com.aaront.exercise.jvm.index.ClassIndex;
import com.aaront.exercise.jvm.index.InterfaceIndex;
import... | package com.aaront.exercise.jvm;
/**
* @author tonyhui
* @since 17/6/5
*/
@Data
public class ClassFile {
private String magicNumber;
private int majorVersion;
private int minorVersion;
private ClassIndex classIndex;
private InterfaceIndex interfaceIndex;
private ConstantPool constantPool;
... | private Map<Pair<String, String>, Method> methods; | 6 |
struberg/juel | modules/impl/src/main/java/de/odysseus/el/tree/impl/Parser.java | [
"public enum Symbol {\r\n\tEOF,\r\n\tPLUS(\"'+'\"), MINUS(\"'-'\"),\r\n\tMUL(\"'*'\"), DIV(\"'/'|'div'\"), MOD(\"'%'|'mod'\"),\r\n\tLPAREN(\"'('\"), RPAREN(\"')'\"),\r\n\tIDENTIFIER,\r\n\tNOT(\"'!'|'not'\"), AND(\"'&&'|'and'\"), OR(\"'||'|'or'\"),\r\n\tEMPTY(\"'empty'\"), INSTANCEOF(\"'instanceof'\"),\r\n\tINTEGER,... | import de.odysseus.el.tree.impl.Scanner.ScanException;
import de.odysseus.el.tree.impl.Scanner.Symbol;
import de.odysseus.el.tree.impl.Scanner.Token;
import de.odysseus.el.tree.impl.ast.*;
import static de.odysseus.el.tree.impl.Scanner.Symbol.*;
import static de.odysseus.el.tree.impl.Builder.Feature.*;
import jav... | /*
* Copyright 2006-2009 Odysseus Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | return new AstFunction(name, index, params, context.isEnabled(Feature.VARARGS));
| 4 |
upnext/blekit-android | src/main/java/com/upnext/blekit/BLEKitService.java | [
"public class Beacon {\n\n public static final String UID_REGEXP = \"(.*)\\\\+(\\\\d+)\\\\+(\\\\d+)\";\n private static final Pattern UID_PATTERN = Pattern.compile( UID_REGEXP );\n\n /**\n * Beacon identifier, which must match the regular epression {@link #UID_REGEXP}\n */\n public String id;\n\... | import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.os.RemoteException;
import com.radiusnetworks.ibeacon.IBeacon;
imp... | }
private void processStartCommand( String packageName, boolean inBackground, List<String> beaconIDs ) {
L.d(".");
if( packageName==null || beaconIDs==null || beaconIDs.isEmpty() ) {
return;
}
if( clients.containsKey(packageName) ) {
updateClient( packag... | client.call( this, BLEKit.Extra.EXTRA_CURRENT_BEACON_PROXIMITY, new CurrentBeaconProximity(beaconId, mMonitoredBeaconIds.get(beaconId))); | 1 |
dgomezferro/pasc-paxos | src/main/java/com/yahoo/pasc/paxos/handlers/acceptor/AcceptorAccept.java | [
"public class Accept extends PaxosMessage implements Serializable, CloneableDeep<Accept>, EqualsDeep<Accept> {\n\n private static final long serialVersionUID = -3781061394615967506L;\n\n public static class Descriptor implements PaxosDescriptor, EqualsDeep<Descriptor> {\n\n private long iid;\n\n ... | import com.yahoo.pasc.paxos.state.IidRequest;
import com.yahoo.pasc.paxos.state.PaxosState;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.yahoo.pasc.Message;
import com.yahoo.pasc.paxos.handlers.PaxosHandler;
import com.yahoo.pasc.paxos.handlers.p... | /**
* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | public List<PaxosDescriptor> processMessage(Accept message, PaxosState state) { | 1 |
AlexisChevalier/CarRental-Android-Application | app/src/main/java/com/vehiclerental/activities/User/UserBookingsActivity.java | [
"public class SearchAvailableVehicleActivity extends AppCompatActivity {\n\n //public message passing keys\n public final static String PICKUP_DATE_KEY = \"pickup_date\";\n public final static String RETURN_DATE_KEY = \"return_date\";\n public final static String VEHICLE_TYPE_KEY = \"vehicle_type\";\n\n... | import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;
impo... | /**
* CarRental
*
* This activity proposes a list of the current user bookings (past, present and future bookings)
*/
package com.vehiclerental.activities.User;
public class UserBookingsActivity extends AppCompatActivity {
//Automatic binding with Butterknife (external library)
@Bind(R.id.booking_lis... | private BookingListAdapter bookingListAdapter; | 1 |
zozoh/zdoc | java/src/org/nutz/zdoc/impl/html/ZDocNode2Html.java | [
"public class Rendering {\n\n public int charCount;\n\n public int limit;\n\n public String currentBasePath;\n\n public Map<String, ZFile> medias;\n\n public boolean isOutOfLimit() {\n if (limit <= 0)\n return false;\n return charCount > limit;\n }\n\n public boolean ha... | import java.util.ArrayList;
import org.nutz.lang.Lang;
import org.nutz.lang.Strings;
import org.nutz.zdoc.Rendering;
import org.nutz.zdoc.ZDocEle;
import org.nutz.zdoc.ZDocEleType;
import org.nutz.zdoc.ZDocNode;
import org.nutz.zdoc.ZDocNodeType;
import org.nutz.zdoc.ZLinkInfo; | if (onlyOneImg) {
sb.append("<div class=\"pa-img\">");
joinEles(sb, nd, ing);
sb.append("</div>");
}
// 否则当做普通段落
else {
sb.append("<p>");
joinEles(sb, nd, ing);
}
}
private void nodeAsBlockquote(StringBuilder sb... | ZLinkInfo linfo = ele.linkInfo("src"); | 5 |
chickling/kmanager | src/main/java/com/chickling/kmanager/utils/elasticsearch/restapi/ElasticsearchRESTUtil.java | [
"public class WorkerThreadFactory implements ThreadFactory {\n\tprivate AtomicInteger counter = new AtomicInteger(0);\n\tprivate String prefix = \"\";\n\n\tpublic WorkerThreadFactory(String prefix) {\n\t\tthis.prefix = prefix;\n\t}\n\n\t@Override\n\tpublic Thread newThread(Runnable r) {\n\t\tThread t = new Thread(r... | import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.concurrent.Callable;
import java.u... | package com.chickling.kmanager.utils.elasticsearch.restapi;
/**
* @author Hulva Luva.H
*
*/
public class ElasticsearchRESTUtil implements Ielasticsearch {
private static final Logger LOG = LoggerFactory.getLogger(ElasticsearchRESTUtil.class);
private static String RERST_HOST;
private static RestTemplate RE... | ExecutorService pool = Executors.newFixedThreadPool(SystemManager.DEFAULT_THREAD_POOL_SIZE, | 1 |
Nanopublication/nanopub-java | src/main/java/org/nanopub/extra/server/FetchIndex.java | [
"public interface Nanopub {\n\n\t// URIs in the nanopub namespace:\n\tpublic static final IRI NANOPUB_TYPE_URI = SimpleValueFactory.getInstance().createIRI(\"http://www.nanopub.org/nschema#Nanopublication\");\n\tpublic static final IRI HAS_ASSERTION_URI = SimpleValueFactory.getInstance().createIRI(\"http://www.nano... | import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.CookieSpec... | package org.nanopub.extra.server;
public class FetchIndex {
public static final int maxParallelRequestsPerServer = 5;
private OutputStream out;
private RDFFormat format;
private boolean writeIndex, writeContent;
private boolean running = false;
private List<FetchNanopubTask> fetchTasks;
private List<Server... | if (!IndexUtils.isIndex(np)) { | 2 |
PPiMapBuilder/PPiMapBuilder | src/main/java/ch/picard/ppimapbuilder/ui/querywindow/QueryWindow.java | [
"public class PMBInteractionNetworkBuildTaskFactory extends AbstractTaskFactory {\n\n\t// Cytoscape services\n\tprivate final CyNetworkManager networkManager;\n\tprivate final CyNetworkFactory networkFactory;\n\tprivate final CyNetworkNaming networkNaming;\n\tprivate final CyNetworkViewFactory networkViewFactory;\n... | import net.miginfocom.swing.MigLayout;
import org.cytoscape.work.TaskManager;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.List;
import ch.picard.ppimapbuilder.data.interaction.client.web.PsicquicService;
import ch.picard.ppimapbuilder.data.organism.Organism;
import ch.picard.ppima... | /*
* This file is part of PPiMapBuilder.
*
* PPiMapBuilder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PPiMapBuilder... | private final TabPanel<NetworkQueryPanel> networkQueryPanels; | 2 |
killbill/killbill-client-java | src/main/java/org/killbill/billing/client/model/gen/ComboPaymentTransaction.java | [
"public class Account extends KillBillObject {\n\n private UUID accountId = null;\n\n private String name = null;\n\n private Integer firstNameLength = null;\n\n private String externalKey = null;\n\n private String email = null;\n\n private Integer billCycleDayLocal = null;\n\n private Currenc... | import org.killbill.billing.client.model.KillBillObject;
import java.util.Objects;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
import org.killbill.billing.client.model.gen.Account;
import org.killbill.billing.client.model.gen.AuditLog;
import org.killbill.billing.client.model.gen.Payment... | /*
* Copyright 2010-2014 Ning, Inc.
* Copyright 2014-2020 Groupon, Inc
* Copyright 2020-2021 Equinix, Inc
* Copyright 2014-2021 The Billing Project, LLC
*
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with t... | private PaymentTransaction transaction = null; | 3 |
KMax/cqels | src/main/java/org/deri/cqels/engine/IndexedOnWindowBuff.java | [
"public class EnQuad {\n\tlong gID,sID,pID,oID;\n\tlong time;\n\tpublic EnQuad(long gID,long sID, long pID, long oID){\n\t\tthis.gID=gID;\n\t\tthis.sID=sID;\n\t\tthis.pID=pID;\n\t\tthis.oID=oID;\n\t\ttime=System.nanoTime();\n\t}\n\t\n\tpublic long getGID(){\n\t\treturn gID;\n\t}\n\t\n\tpublic long getSID(){\n\t\tre... | import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import org.deri.cqels.data.EnQuad;
import org.deri.cqels.data.Mapping;
import org.deri.cqels.engine.iterator.MappingIterCursorAll;
import org.deri.cqels.engine.iterator.MappingIterCursorByKey;
import org.deri.cqels.engine.iterator.MappingIterCursorByRang... | package org.deri.cqels.engine;
/**
* @author Danh Le Phuoc
* @organization DERI Galway, NUIG, Ireland www.deri.ie
* @email danh.lephuoc@deri.org
*/
public class IndexedOnWindowBuff {
ExecContext context;
Quad quad;
Database buff;
Op op;
OpRouter router;
ArrayList<Var> vars;
ArrayList<ArrayList<Integer... | public void add(EnQuad enQuad) { | 0 |
yuqirong/Koku | app/src/main/java/com/yuqirong/koku/adapter/WeiboCommentAdapter.java | [
"public class PublishActivity extends BaseActivity implements RevealBackgroundView.OnStateChangeListener {\n\n private Toolbar mToolbar;\n private ActionBar actionBar;\n private ImageButton ib_location;\n private ImageButton ib_photo;\n private ImageButton ib_emotion;\n private ImageButton ib_noti... | import android.content.Context;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.SpannableString;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Im... | package com.yuqirong.koku.adapter;
/**
* 评论Adapter
* Created by Anyway on 2015/10/11.
*/
public class WeiboCommentAdapter extends LoadMoreAdapter<Comment> {
private Context context;
private static ImageLoader imageLoader;
private static DisplayImageOptions options;
private static WeiboRecycleView... | options = BitmapUtil.getDisplayImageOptions(R.drawable.img_empty_avatar, true, false); | 3 |
csulennon/TaskManagerMaster | taskmanagermaster/src/com/kongderui/taskmanager/AddActivity.java | [
"public class Task implements Serializable{\n\n\tpublic static final int TYPE_TODO = 0;\n\tpublic static final int TYPE_DOING = 1;\n\tpublic static final int TYPE_HAVEDONE = 2;\n\tpublic static final int TYPE_TIMEOUT = 3;\n\tpublic static final int TYPE_UNKNOWN = 4;\n\tpublic static final int TYPE_ALL = 5;\n\tpubl... | import java.util.Calendar;
import java.util.Date;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.T... | package com.kongderui.taskmanager;
public class AddActivity extends Activity implements OnClickListener {
private WheelView mWheelViewYear = null;
private WheelView mWheelViewMonth = null;
private WheelView mWheelViewDay = null;
private WheelView mWheelViewHour = null;
private WheelView mWheelViewMinit = null;... | mWheelViewYear.setAdapter(new StrericWheelAdapter(Constant.YEARS)); | 6 |
liuhangyang/StormMQ | src/main/java/com/ystruct.middleware/stormmq/broker/SendHelper.java | [
"public class InvokeFuture<T> {\n private Semaphore semaphore = new Semaphore(0);\n private T result;\n private List<InvokeListener<T>> listeners = new ArrayList<InvokeListener<T>>();\n private String requestId;\n private Throwable cause;\n public void setCause(Throwable cause){\n this.caus... | import io.netty.channel.Channel;
import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import model.InvokeFuture;
import model.RequestResponseFromType;
import model.ResponseType;
import model.StormResponse;
import smq.Message;
import tool.Que... | package broker;
/**
* Created by yang on 16-12-2.
*/
public class SendHelper {
private long timeout = 3000; //默认超时时间
public static volatile Map<String, InvokeFuture<Object>> futures = new ConcurrentHashMap<String, InvokeFuture<Object>>();
//用于发送队列的信息到对应的consumer
public static void sendMessageByKey(... | Message pullmsg = (Message) Tool.deserialize(queue.peek(),Message.class); | 4 |
karthicks/gremlin-ogm | gremlin-objects/src/test/java/org/apache/tinkerpop/gremlin/object/edges/Uses.java | [
"public final class Label {\n\n private Label() {}\n\n @SuppressWarnings(\"PMD.ShortMethodName\")\n public static String of(Element element) {\n return of(element.getClass());\n }\n\n @SuppressWarnings(\"PMD.ShortMethodName\")\n public static String of(Class<? extends Element> elementType) {\n String la... | import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.tinkerpop.gremlin.object.reflect.Label;
import org.apache.tinkerpop.gremlin.object.structure.Connection;
import org.apache.tinkerpop.gremlin.object.structure.Edge;
import org.apache.tinkerpop.gremli... | /*
* 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 class Uses extends Edge { | 2 |
gstreamer-java/gst1-java-core | test/org/freedesktop/gstreamer/video/VideoCropMetaTest.java | [
"public class BufferProbeTester {\n\n public static void test(Consumer<Buffer> callback) {\n test(callback, \"videotestsrc ! videoconvert ! fakesink name=sink\");\n }\n\n public static void test(Consumer<Buffer> callback, String pipelineDescription) {\n test(callback, pipelineDescription, 0);... | import org.freedesktop.gstreamer.BufferProbeTester;
import org.freedesktop.gstreamer.Gst;
import org.freedesktop.gstreamer.glib.Natives;
import org.freedesktop.gstreamer.lowlevel.GstMetaPtr;
import org.freedesktop.gstreamer.util.TestAssumptions;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.juni... | /*
* Copyright (c) 2020 Neil C Smith
*
* This file is part of gstreamer-java.
*
* This code is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 3 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the h... | Gst.init(Gst.getVersion()); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.