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 |
|---|---|---|---|---|---|---|
ReplayMod/jGui | src/main/java/de/johni0702/minecraft/gui/element/advanced/AbstractGuiProgressBar.java | [
"public interface GuiRenderer {\n\n ReadablePoint getOpenGlOffset();\n\n MatrixStack getMatrixStack();\n\n ReadableDimension getSize();\n\n void setDrawingArea(int x, int y, int width, int height);\n\n void bindTexture(Identifier location);\n\n void bindTexture(int glId);\n\n void drawTexturedR... | import de.johni0702.minecraft.gui.utils.lwjgl.ReadableDimension;
import de.johni0702.minecraft.gui.versions.MCVer;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.resource.language.I18n;
import de.johni0702.minecraft.gui.GuiRenderer;
import de.johni0702.minecraft.gui.RenderInfo;
import de.joh... | /*
* This file is part of jGui API, licensed under the MIT License (MIT).
*
* Copyright (c) 2016 johni0702 <https://github.com/johni0702>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Softw... | public void draw(GuiRenderer renderer, ReadableDimension size, RenderInfo renderInfo) { | 0 |
ferstl/pedantic-pom-enforcers | src/main/java/com/github/ferstl/maven/pomenforcers/AbstractPedanticDependencyOrderEnforcer.java | [
"public enum DependencyElement implements PriorityOrderingFactory<String, DependencyModel>, Function<DependencyModel, String> {\r\n GROUP_ID(\"groupId\") {\r\n @Override\r\n public PriorityOrdering<String, DependencyModel> createPriorityOrdering(Collection<String> priorityCollection) {\r\n return new Pr... | import java.util.Collection;
import java.util.EnumSet;
import java.util.LinkedHashSet;
import java.util.Set;
import org.apache.maven.model.Dependency;
import org.apache.maven.project.MavenProject;
import com.github.ferstl.maven.pomenforcers.model.DependencyElement;
import com.github.ferstl.maven.pomenforcers.model.Depe... | /*
* Copyright (c) 2012 - 2020 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 ... | Iterable<String> scopePriorities = EnumSet.allOf(DependencyScope.class) | 2 |
leifj/saml-md-aggregator | src/main/java/net/nordu/mdx/store/git/GitRepositoryMetadataStore.java | [
"public class MetadataChange implements Serializable {\n\t\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = -6750830823194935907L;\n\n\tprivate String id;\n\tprivate String reason;\n\tprivate Date timeStamp;\n\tprivate MetadataChangeType type;\n\t\n\tpublic String getId() {\n\t\treturn id;\n\t}\... | import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimerTask;
import net.nordu.mdx.scanner.Met... | package net.nordu.mdx.store.git;
public class GitRepositoryMetadataStore implements MetadataStore {
/**
* Git branch to use (refs/heads/branchname).
*/
private String refName;
/**
* Object ID of the last HEAD.
*/
private ObjectId lastRef;
/**
* Git repository.
*/
private Repository repository;
/... | MetadataChange metadataChange = new MetadataChange(identifier, | 0 |
offa/NBCndUnit | src/test/java/bv/offa/netbeans/cnd/unittest/googletest/GoogleTestSuiteStartedHandlerTest.java | [
"public class CndTestSuite extends TestSuite\n{\n private final TestFramework framework;\n \n public CndTestSuite(String name, TestFramework framework)\n {\n super(name);\n this.framework = framework;\n }\n\n \n /**\n * Returns the framework.\n * \n * @return Framewor... | import bv.offa.netbeans.cnd.unittest.api.CndTestSuite;
import bv.offa.netbeans.cnd.unittest.api.ManagerAdapter;
import bv.offa.netbeans.cnd.unittest.api.TestFramework;
import static bv.offa.netbeans.cnd.unittest.testhelper.Helper.checkedMatch;
import static bv.offa.netbeans.cnd.unittest.testhelper.Helper.createCurrentT... | /*
* NBCndUnit - C/C++ unit tests for NetBeans.
* Copyright (C) 2015-2021 offa
*
* This file is part of NBCndUnit.
*
* NBCndUnit 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... | private static final TestFramework FRAMEWORK = TestFramework.GOOGLETEST; | 2 |
alanhay/html-exporter | src/test/java/uk/co/certait/htmlexporter/writer/excel/ExcelCellRangeResolverTest.java | [
"public class CellRange {\r\n\tprivate List<CellRangeRow> rows;\r\n\tprivate List<CellRangeObserver> listeners;\r\n\r\n\tpublic CellRange() {\r\n\t\trows = new ArrayList<CellRangeRow>();\r\n\t\tlisteners = new ArrayList<CellRangeObserver>();\r\n\t}\r\n\r\n\t/**\r\n\t * \r\n\t * @param cell\r\n\t */\r\n\tpublic void... | import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import uk.co.certait.htmlexporter.ss.CellRange;
import uk.co.certait.htmlexporter.ss.CellRangeResolver;
import uk.co.certait.htmlexporter.ss.TableCellReference;
import uk.co.certait.htmlexporter.ss.TestUtils;
import uk.co.certait.html... | /**
* Copyright (C) 2012 alanhay <alanhay99@hotmail.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 re... | resolver = new ExcelCellRangeResolver();
| 4 |
AmadeusITGroup/sonar-stash | src/test/java/org/sonar/plugins/stash/issue/collector/StashCollectorTest.java | [
"public enum IssueType {\r\n CONTEXT,\r\n REMOVED,\r\n ADDED,\r\n}\r",
"public class StashComment {\r\n\r\n private final long id;\r\n private final String message;\r\n private final StashUser author;\r\n private final long version;\r\n private long line;\r\n private String path;\r\n private List<StashT... | import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.github.cliftonlabs.json_simple.JsonObject;
import com.github.cl... | package org.sonar.plugins.stash.issue.collector;
public class StashCollectorTest {
private static final long STASH_USER_ID = 1;
PullRequestRef pr = PullRequestRef.builder()
.setProject("project")
.setRepository("repository")
... | assertEquals(IssueType.CONTEXT, diff1.getType());
| 0 |
MarWoes/viper | src/test/java/de/imi/marw/viper/test/filtering/FilterTest.java | [
"public class TestUtil {\n\n public static String getResourceFile(String fileName) {\n // see https://stackoverflow.com/questions/24499692/access-resources-in-unit-tests\n try {\n URI uri = TestUtil.class.getClassLoader().getResource(fileName).toURI();\n return uri.getRawPath(... | import java.util.Set;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import de.imi.marw.viper.test.util.TestUtil;
import de.imi.marw.viper.variants.VariantCallFilter;
import de.imi.marw.viper.variants.filters.NumericCollectionFilter;
import de.imi.marw.viper.variants.filters.NumericFilter;
import d... | /* Copyright (c) 2017 Marius Wöste
*
* This file is part of VIPER.
*
* VIPER 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.
*
... | CsvTableReader reader = new CsvTableReader(';', ","); | 6 |
CraftedCart/SMBLevelWorkshop | src/main/java/craftedcart/smblevelworkshop/ui/component/transform/XYZTextFields.java | [
"public class DefaultUITheme extends UITheme {\n\n public DefaultUITheme() {\n labelFont = FontCache.getUnicodeFont(\"Roboto-Regular\", 16);\n headerFont = FontCache.getUnicodeFont(\"Roboto-Regular\", 24);\n labelTextColor = UIColor.matWhite();\n scrollbarThickness = 2;\n check... | import craftedcart.smblevelworkshop.ui.DefaultUITheme;
import craftedcart.smblevelworkshop.ui.MainScreen;
import craftedcart.smblevelworkshop.util.EnumAxis;
import craftedcart.smblevelworkshop.util.ITransformable;
import craftedcart.smblevelworkshop.util.PosXYZ;
import io.github.craftedcart.fluidui.component.ListBox;
i... | package craftedcart.smblevelworkshop.ui.component.transform;
/**
* @author CraftedCart
* Created on 30/10/2016 (DD/MM/YYYY)
*/
public abstract class XYZTextFields extends Panel {
@NotNull protected MainScreen mainScreen;
@Nullable private TextField nextTextField;
private ListBox listBox;
... | List<ITransformable> transformables = new ArrayList<>(); | 3 |
ISibboI/JBitmessage | src/main/java/sibbo/bitmessage/network/NetworkManager.java | [
"public class Options extends Properties {\n\tprivate static final Logger LOG = Logger.getLogger(Options.class.getName());\n\n\tprivate static final Options defaults = new Options(null);\n\n\tstatic {\n\t\tdefaults.setProperty(\"global.version\", \"0.0.0\");\n\t\tdefaults.setProperty(\"global.name\", \"JBitmessage\... | import java.util.Collection;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Vector;
import java.util.logging.Logger;
import sibbo.bitmessage.Options;
import sibbo.bitmessage.data.Datastore;
import sibbo.bitmessage.network.prot... | package sibbo.bitmessage.network;
/**
* Manages the operation of this bitmessage node. It is responsible for all
* communication with other nodes.
*
* @author Sebastian Schmidt
* @version 1.0
*/
public class NetworkManager implements ConnectionListener, Runnable {
private static final Logger LOG = Logger.get... | private final Map<InventoryVectorMessage, Connection> alreadyRequested = new Hashtable<>(); | 2 |
monster860/FastDMM | src/main/java/com/github/monster860/fastdmm/dmmmap/TileInstance.java | [
"public class FastDMM extends JFrame implements ActionListener, TreeSelectionListener, ListSelectionListener {\n\tprivate static final long serialVersionUID = 1L;\n\tpublic File dme;\n\tpublic DMM dmm;\n\tpublic List<DMM> loadedMaps = new ArrayList<DMM>();\n\tpublic Map<String, ModifiedType> modifiedTypes = new Has... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.regex.*;
import com.github.monster860.fastdmm.FastDMM;
import com.github.monster860.fastdmm.dmirender.DMI;
import com.github.monster860.fastdmm.dmirender.IconSubstate;
import com.github.monster... | StringBuilder sb = new StringBuilder();
boolean isFirst = true;
for(ObjInstance obj : objs) {
if(isFirst)
isFirst = false;
else
sb.append(",");
sb.append(obj);
}
return sb.toString();
}
public String toStringTGM() {
StringBuilder sb = new StringBuilder("\n");
boolean isFirst = true;
... | IconSubstate substate = dmi.getIconState(iconState).getSubstate(obj.getDir()); | 2 |
raydac/jprol | examples/java/jprol-example-life/src/main/java/com/igormaznitsa/jprol/example/life/LifeLibrary.java | [
"public class Term {\n\n private final String text;\n\n Term(final String text) {\n this.text = requireNonNull(text);\n }\n\n public int getPriority() {\n return 0;\n }\n\n public String getText() {\n return this.text;\n }\n\n public TermType getTermType() {\n return ATOM;\n }\n\n public boole... | import com.igormaznitsa.jprol.annotations.JProlConsultText;
import com.igormaznitsa.jprol.annotations.JProlPredicate;
import com.igormaznitsa.jprol.data.Term;
import com.igormaznitsa.jprol.data.TermLong;
import com.igormaznitsa.jprol.data.TermStruct;
import com.igormaznitsa.jprol.data.Terms;
import com.igormaznitsa.jpr... | package com.igormaznitsa.jprol.example.life;
@SuppressWarnings("unused")
@JProlConsultText({
"process_cell(X,Y,live) :- count_neighbors(X,Y,N), ((N < 2 ; N > 3), !, reset_cell(X,Y) ; set_cell(X,Y)),!.",
"process_cell(X,Y,dead) :- count_neighbors(X,Y,N), N = 3, set_cell(X,Y),!.",
"life() :- field_width(W),... | private static final TermLong WIDTH = Terms.newLong(LifeField.WIDTH); | 1 |
calibre2opds/calibre2opds | OpdsOutput/src/main/java/com/gmail/dpierron/calibre/opds/BooksSubCatalog.java | [
"public class CachedFile extends File {\r\n private final static Logger logger = LogManager.getLogger(CachedFile.class);\r\n\r\n private long privateLastModified;\r\n private long privateLength;\r\n private long privateCrc; // A -ve value indicates invalid CRC;\r\n private final static long... | import com.gmail.dpierron.calibre.cache.CachedFile;
import com.gmail.dpierron.calibre.cache.CachedFileManager;
import com.gmail.dpierron.calibre.configuration.DeviceMode;
import com.gmail.dpierron.calibre.datamodel.*;
import com.gmail.dpierron.tools.i18n.Localization;
import com.gmail.dpierron.tools.i18n.Localizat... | willSplitByDate = false;
break;
case DontSplit:
// Bug #716917 Do not split on letter (used in Author and Series book lists)
if (logger.isTraceEnabled()) logger.trace("getListOfBooks:splitOption=DontSplit");
assert from == 0 : "getListBooks: DontSplit, from=" + from;
... | TrookSpecificSearchDatabaseManager.addBook(book, entry);
| 3 |
ChenTianSaber/DailyZhiHu | MyZhiHuDaily/app/src/main/java/com/example/chentian/myzhihudaily/fragment/HomePagerFragment.java | [
"public class HomeContentRecyerAdapter extends RecyclerView.Adapter {\n\n Context context;\n ArrayList<String> titleData;\n ArrayList<String> bmpData;\n ArrayList<Integer> idData;\n\n ArrayList<String> date;\n\n public HomeContentRecyerAdapter(Context context, ArrayList<String> titleData, ArrayLis... | import android.content.res.Resources;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.util.TypedValue;
import android... | package com.example.chentian.myzhihudaily.fragment;
/**
* Created by chentian on 15/04/2017.
*/
public class HomePagerFragment extends Fragment {
View view;
RecyclerView contentRecycler;
ArrayList<String> titleData;
ArrayList<String> bmpData;
ArrayList<Integer> idData;
ArrayList<String... | contentRecycler.addOnScrollListener(new EndLessOnScrollListener(linearLayoutManager) { | 4 |
spccold/sailfish | sailfish-kernel/src/test/java/sailfish/remoting/ServerClientTest.java | [
"public interface ExchangeChannelGroup extends Endpoint, MessageExchangePattern{\n\t/**\n\t * like {@link Channel#id()}, Returns the globally unique identifier of this {@link ExchangeChannelGroup}.\n\t */\n\tUUID id();\n\n\t/**\n\t * Return {@code true} if this {@link ExchangeChannelGroup} is available, this means ... | import sailfish.remoting.processors.ClientRequestProcessor;
import sailfish.remoting.processors.RequestProcessor;
import sailfish.remoting.processors.ServerRequestProcessor;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.locks.LockSupport;
import org.junit.As... | /**
*
* Copyright 2016-2016 spccold
*
* 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... | processors.add(new ClientRequestProcessor()); | 4 |
stefanhaustein/nativehtml | swing/src/main/java/org/kobjects/nativehtml/swing/AbstractSwingComponentElement.java | [
"public enum CssEnum {\n ERROR,\n\n AUTO, AQUA,\n BLACK, BLOCK, BOTH, BOTTOM, BLUE,\n CENTER, CIRCLE,\n DECIMAL, DISC,\n FIXED, FUCHSIA,\n GRAY, GREEN,\n INHERIT, INLINE, INLINE_BLOCK, INSIDE, ITALIC,\n LEFT, LIME, LIST_ITEM, LOWER_LATIN, LOWER_GREEK, LOWER_ROMAN,\n MAROON, MEDIUM, MIDDLE,\n NAVY, NONE, ... | import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Shape;
import java.util.HashMap;
import javax.swing.JComponent;
import org.kobjects.nativehtml.css.CssEnum;
import org.kobjects.nativehtml.css.CssProperty;
import org.kobjects.nativehtml.css.CssStyleDecla... | package org.kobjects.nativehtml.swing;
public abstract class AbstractSwingComponentElement extends JComponent implements org.kobjects.nativehtml.layout.ComponentElement {
private final Document document;
protected final String elementName;
private HashMap<String, String> attributes; | private CssStyleDeclaration style; | 2 |
agilie/dribbble-android-sdk | dribbble-sdk-library/src/main/java/com/agilie/dribbblesdk/service/retrofit/DribbbleWebServiceHelper.java | [
"public interface DribbbleBucketsService {\n\n /**\n * Get a bucket\n *\n * @param bucketId Bucket ID\n *\n * @return Network operation result\n */\n @GET(\"buckets/{id}\")\n Call<Bucket> getBucket(@Path(\"id\") long bucketId);\n\n /**\n * Create a bucket.\n * C... | import com.agilie.dribbblesdk.service.retrofit.services.DribbbleBucketsService;
import com.agilie.dribbblesdk.service.retrofit.services.DribbbleProjectsService;
import com.agilie.dribbblesdk.service.retrofit.services.DribbbleShotsService;
import com.agilie.dribbblesdk.service.retrofit.services.DribbbleTeamsService;
imp... | package com.agilie.dribbblesdk.service.retrofit;
public class DribbbleWebServiceHelper {
public static String DRIBBBLE_URL = "https://api.dribbble.com/v1/";
public static DribbbleBucketsService getDribbbleBucketService(Retrofit retrofit) {
DribbbleBucketsService service = retrofit.create(Dribb... | public static DribbbleUserService getDribbbleUserService(Retrofit retrofit) { | 4 |
konifar/droidkaigi2016 | app/src/main/java/io/github/droidkaigi/confsched/activity/ContributorsActivity.java | [
"@Singleton\npublic class DroidKaigiClient {\n\n private static final String SESSIONS_API_ROUTES = \"/konifar/droidkaigi2016/master/app/src/main/res/raw/\";\n\n private final DroidKaigiService service;\n private final GoogleFormService googleFormService;\n private final GithubService githubService;\n\n ... | import android.content.Context;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.LinearLayoutManager;
im... | package io.github.droidkaigi.confsched.activity;
public class ContributorsActivity extends BaseActivity {
public static final String TAG = ContributorsActivity.class.getSimpleName();
@Inject
AnalyticsTracker analyticsTracker;
@Inject
DroidKaigiClient client;
@Inject
ContributorDao ... | private void renderContributors(List<Contributor> contributors) { | 2 |
idega/is.idega.idegaweb.egov.accounting | src/java/is/idega/idegaweb/egov/accounting/IWBundleStarter.java | [
"public class AccountingViewManager {\n\n\tprivate ViewNode accountingViewNode;\n\tprivate IWMainApplication iwma;\n\t/**\n\t * <p>\n\t * TODO tryggvil describe method getInstance\n\t * </p>\n\t * @param iwma\n\t * @return\n\t */\n\tpublic static AccountingViewManager getInstance(IWMainApplication iwma) {\n\t\tAcco... | import is.idega.idegaweb.egov.AccountingViewManager;
import is.idega.idegaweb.egov.accounting.business.AccountingConstants;
import is.idega.idegaweb.egov.accounting.business.AccountingEntry;
import is.idega.idegaweb.egov.accounting.business.AccountingSystemManager;
import is.idega.idegaweb.egov.accounting.business.Navi... | /*
* $Id$
* Created on Jul 25, 2006
*
* Copyright (C) 2006 Idega Software hf. All Rights Reserved.
*
* This software is the proprietary information of Idega hf.
* Use is subject to license terms.
*/
package is.idega.idegaweb.egov.accounting;
public class IWBundleStarter implements IWBundleStartable {
//Rv... | AccountingSystemManager.getInstance().addAccountingStringResult(AccountingConstants.ACCOUNTING_SYSTEM_NAVISION, NavisionStringResult.class); | 4 |
NanYoMy/mybatis-generator | src/main/java/org/mybatis/generator/api/IntrospectedTable.java | [
"public class Context extends PropertyHolder {\n private String id;\n\n private JDBCConnectionConfiguration jdbcConnectionConfiguration;\n\n private SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration;\n\n private JavaTypeResolverConfiguration javaTypeResolverConfiguration;\n\n private JavaMode... | import static org.mybatis.generator.internal.util.StringUtility.isTrue;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.my... | /*
* Copyright 2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | protected Rules rules; | 7 |
pdsoftplan/zap-maven-plugin | zap-client-api/src/main/java/br/com/softplan/security/zap/api/authentication/CasAuthenticationHandler.java | [
"public class ZapHelper {\n\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(ZapHelper.class);\n\t\n\tprivate static final String ZAP_SUCCESS_RESPONSE = \"OK\";\n\tprivate static final String ZAP_DEFAULT_CONTEXT_NAME = \"Default Context\";\n\t\n\tpublic static String extractResponse(ApiResponse respo... | import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import br.com.softplan.security.zap.api.ZapHelper;
import br.com.softplan.security.zap.api.exception.ZapClientException;
import br.com.softplan.security.zap.api.model.AuthenticationInfo;
imp... | package br.com.softplan.security.zap.api.authentication;
/**
* Class to handle CAS authentication via ZAP.
*
* @author pdsec
*/
public class CasAuthenticationHandler extends AbstractAuthenticationHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(CasAuthenticationHandler.class);
public ... | protected CasAuthenticationHandler(ClientApi api, ZapInfo zapInfo, AuthenticationInfo authenticationInfo) { | 2 |
OasisDigital/nges | src/test/java/com/oasisdigital/nges/event/jdbc/EventStreamListITest.java | [
"public class EventStoreConflict extends EventStoreException {\n private static final long serialVersionUID = 1L;\n\n public EventStoreConflict() {\n super();\n }\n\n public EventStoreConflict(String message, Throwable cause, boolean enableSuppression,\n boolean writableStackTrace) {\n... | import static java.time.OffsetDateTime.now;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import java.util.UUID;
import org.testng.annotations.BeforeMethod;
import org.testng.annotation... | package com.oasisdigital.nges.event.jdbc;
@Test(groups = TestGroups.INTEGRATION)
public class EventStreamListITest extends BaseITest { | private ConnectionSource connectionSource; | 3 |
priiduneemre/btcd-cli4j | examples/src/main/java/com/neemre/btcdcli4j/examples/daemon/AutonomousDaemon.java | [
"public interface BtcdDaemon {\n\t\n\tvoid addAlertListener(AlertListener listener);\n\t\n\tint countAlertListeners();\n\t\n\tvoid removeAlertListener(AlertListener listener);\n\t\n\tvoid removeAlertListeners();\n\t\n\tvoid addBlockListener(BlockListener listener);\n\t\n\tint countBlockListeners();\n\t\n\tvoid remo... | import com.neemre.btcdcli4j.daemon.BtcdDaemon;
import com.neemre.btcdcli4j.daemon.Notifications;
import com.neemre.btcdcli4j.daemon.event.AlertListener;
import com.neemre.btcdcli4j.daemon.event.BlockListener;
import com.neemre.btcdcli4j.daemon.event.WalletListener;
import com.neemre.btcdcli4j.core.domain.Block;
import ... | package com.neemre.btcdcli4j.examples.daemon;
/**An example demonstrating the use of <i>bitcoind</i>'s 'callback-via-shell-command' notification
* API via autonomous {@code BtcdDaemon} instances.*/
public class AutonomousDaemon {
public static void main(String[] args) throws Exception {
BtcdDaemon daemon = new ... | daemon.isMonitoring(Notifications.ALERT); | 1 |
CyclopsMC/IntegratedTunnels | src/main/java/org/cyclops/integratedtunnels/core/TunnelFluidHelpers.java | [
"public abstract class IngredientPredicate<T, M> implements Predicate<T>, ITunnelTransfer {\n\n private final IngredientComponent<T, M> ingredientComponent;\n private final T instance;\n private final M matchFlags;\n private final boolean blacklist;\n private final boolean empty;\n private final i... | import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.FlowingFluidBlock;
import net.minecraft.block.material.Material;
import net.minecraft.fluid.Fluids;
import net.minecraft.nbt.INBT;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft... | package org.cyclops.integratedtunnels.core;
/**
* @author rubensworks
*/
public class TunnelFluidHelpers {
public static final IngredientPredicate<FluidStack, Integer> MATCH_NONE = new IngredientPredicate<FluidStack, Integer>(IngredientComponent.FLUIDSTACK, null, FluidMatch.EXACT, false, true, 0, false) {
... | int channel, ITunnelConnection connection, | 4 |
hschott/Camdroid | app/src/main/java/org/hschott/camdroid/FrameProcessors.java | [
"public interface FrameDrawer {\n\tpublic void drawBitmap(Bitmap bitmap);\n\n\tpublic DisplayMetrics getDisplayMetrics();\n}",
"public class AdaptiveThresholdProcessor extends AbstractOpenCVFrameProcessor {\n\n private static int reduction = 0;\n private static int blocksize = 15;\n\n public static class... | import org.hschott.camdroid.OnCameraPreviewListener.FrameDrawer;
import org.hschott.camdroid.processor.AdaptiveThresholdProcessor;
import org.hschott.camdroid.processor.CannyEdgesProcessor;
import org.hschott.camdroid.processor.CascadeClassifierProcessor;
import org.hschott.camdroid.processor.NormalizeGrayProcessor;
im... | package org.hschott.camdroid;
public enum FrameProcessors {
ColorSpace, NormalizeGray, AdaptiveThreshold, CannyEdges, UnsharpenMask, MovementDetection, CascadeClassifier, OCR;
public FrameProcessor newFrameProcessor(FrameDrawer drawer) {
switch (this.ordinal()) {
case 0:
r... | return new NormalizeGrayProcessor(drawer); | 4 |
axxepta/project-argon | src/main/java/de/axxepta/oxygen/actions/SaveFileToArgonAction.java | [
"public enum BaseXSource {\r\n\r\n /**\r\n * Database.\r\n */\r\n DATABASE(\"argon\"),\r\n// /**\r\n// * RESTXQ.\r\n// */\r\n// RESTXQ(\"argonquery\"),\r\n /**\r\n * Repository.\r\n */\r\n REPO(\"argonrepo\");\r\n\r\n private final String protocol;\r\n\r\n BaseXSource... | import de.axxepta.oxygen.api.BaseXSource;
import de.axxepta.oxygen.customprotocol.ArgonChooserDialog;
import de.axxepta.oxygen.customprotocol.CustomProtocolURLUtils;
import de.axxepta.oxygen.utils.ConnectionWrapper;
import de.axxepta.oxygen.utils.Lang;
import de.axxepta.oxygen.utils.WorkspaceUtils;
import ro.sync.exml.... | package de.axxepta.oxygen.actions;
/**
* Store the current editor's content to BaseX. The URL can be chosen from a dialog. If no encoding can be obtained from
* the editor content, the default UTF-8 will be used.
*/
public class SaveFileToArgonAction extends AbstractAction {
private static final PluginWorksp... | ArgonChooserDialog urlChooser = new ArgonChooserDialog((Frame) workspace.getParentFrame(), | 1 |
mikelduke/LedTable | RPi-Java-LedTable/src/net/mdp3/java/rpi/ledtable/effects/ImageScanEffect.java | [
"public class LedTable_Selection implements DomXml {\n\tprivate final static Logger LOG = Logger.getLogger(LedTable_Selection.class.getName());\n\tprivate final static String name = \"LedTable_Selection\";\n\t\n\tpublic final static String NODE_NAME = \"selection\";\n\tpublic final static String DOC_ROOT = \"LedTab... | import java.io.IOException;
import java.util.Random;
import net.mdp3.java.rpi.ledtable.LedTable_Selection;
import net.mdp3.java.rpi.ledtable.LedTable_Settings;
import net.mdp3.java.rpi.ledtable.LedTable_Util;
import net.mdp3.java.rpi.ledtable.effects.EffectInfoParameter.EffectInfoParameterType;
import net.mdp3.java.rpi... | /**
*
*/
package net.mdp3.java.rpi.ledtable.effects;
/**
* @author Mikel
*
*/
public class ImageScanEffect extends Effect {
private final static String name = "ImageScanEffect";
private Random rnd = new Random();
private String imgPath = "";
private boolean imageLoaded = false;
private int inc = 1;
p... | new EffectInfoParameter("img", "Path to Image File", EffectInfoParameterType.FILE), | 3 |
mikroskeem/Shuriken | instrumentation/src/test/java/eu/mikroskeem/test/shuriken/instrumentation/testagent/TestAgent4.java | [
"public class Ensure {\n /**\n * Ensure that condition is true\n *\n * @param condition Condition\n * @param exception Exception what will be thrown, if condition isn't true\n * @param args Exception arguments\n */\n @Contract(\"false, _, _ -> fail\")\n public static void ensureCond... | import eu.mikroskeem.shuriken.common.Ensure;
import eu.mikroskeem.shuriken.instrumentation.Descriptor;
import org.objectweb.asm.Type;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldInsnNode;
import org.objectweb.asm.tre... | package eu.mikroskeem.test.shuriken.instrumentation.testagent;
/**
* @author Mark Vainomaa
*/
public class TestAgent4 implements ClassFileTransformer {
private final static String TARGET_CL = "eu/mikroskeem/test/shuriken/instrumentation/testclasses/TestTransformable4";
private final static int TARGET_A = ... | private final static String TARGET_S = Descriptor.DEFAULT; | 1 |
dsx-tech/blockchain-benchmarking | blockchain-api/src/main/java/uk/dsxt/bb/ethereum/EthereumManager.java | [
"public interface Manager {\n\n String sendTransaction(String to, String from, long amount);\n\n String sendMessage(byte[] body);\n String sendMessage(String from, String to, String message);\n\n List<Message> getNewMessages();\n\n BlockchainBlock getBlock(long id) throws IOException;\n\n Blockcha... | import uk.dsxt.bb.datamodel.ethereum.EthereumPeer;
import uk.dsxt.bb.datamodel.ethereum.EthereumTransaction;
import uk.dsxt.bb.utils.InternalLogicException;
import uk.dsxt.bb.utils.JSONRPCHelper;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Arrays;
impo... | /*
******************************************************************************
* Blockchain benchmarking framework *
* Copyright (C) 2016 DSX Technologies Limited. *
* ... | EthereumBlock block = JSONRPCHelper.post(url, EthereumMethods.GET_BLOCK_BY_NUMBER.getMethod(), EthereumBlock.class, | 2 |
eckig/graph-editor | demo/src/main/java/de/tesis/dynaware/grapheditor/demo/customskins/tree/TreeConnectionSkin.java | [
"public abstract class GConnectionSkin extends GSkin<GConnection> {\n\n /**\n * Cache the index of this connection skin inside the list of children of the\n * connection layer. As the graph editor grows the indexOf() lookup calls take\n * up a considerable amount of time.\n */\n private int mC... | import java.util.List;
import java.util.Map;
import de.tesis.dynaware.grapheditor.GConnectionSkin;
import de.tesis.dynaware.grapheditor.GJointSkin;
import de.tesis.dynaware.grapheditor.GraphEditor;
import de.tesis.dynaware.grapheditor.model.GConnection;
import de.tesis.dynaware.grapheditor.utils.Arrow;
import de.tesis.... | /*
* Copyright (C) 2005 - 2014 by TESIS DYNAware GmbH
*/
package de.tesis.dynaware.grapheditor.demo.customskins.tree;
/**
* Connection skin for the 'tree-like' graph. Pretty much just an arrow.
*/
public class TreeConnectionSkin extends GConnectionSkin {
private static final String STYLE_CLASS = "tree-conne... | public void setJointSkins(final List<GJointSkin> jointSkins) { | 1 |
hxnx-sam/DiscreteSpatialPhyloSimulator | src/trees/TreePrunerTest.java | [
"public class Deme {\n\n\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\t// class variables and methods\n\t//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////... | import individualBasedModel.Deme;
import individualBasedModel.DemeType;
import individualBasedModel.Event;
import individualBasedModel.EventType;
import individualBasedModel.ModelType;
import individualBasedModel.Population;
import individualBasedModel.Scheduler;
import io.NewickWriter;
import org.junit.After;
import o... | package trees;
//import static org.junit.Assert.*;
//import individualBasedModel.Host;
//import individualBasedModel.InfectionState;
/**
*
* @author Samantha Lycett
* @created 1 July 2013
* @version 2 July 2013
* @version 27 Sept 2013
*/
public class TreePrunerTest {
@BeforeClass
public static void setUpBe... | deme1.setModelType(ModelType.SIR); | 4 |
damingerdai/web-qq | src/main/java/org/aming/web/qq/contorller/ChatController.java | [
"public class Message implements Serializable {\n\n private static final long serialVersionUID = -7770415263565665094L;\n\n private String id;\n private User sendUser;\n private User receiveUser;\n private String content;\n private Timestamp sendDate;\n private int sendDeleteFlag;\n private ... | import io.swagger.annotations.ApiOperation;
import org.aming.web.qq.domain.Message;
import org.aming.web.qq.logger.Logger;
import org.aming.web.qq.logger.LoggerManager;
import org.aming.web.qq.response.CommonResponse;
import org.aming.web.qq.service.MessageService;
import org.springframework.web.bind.annotation.Request... | package org.aming.web.qq.contorller;
/**
* @author daming
* @version 2017/10/5.
*/
@RestController
@RequestMapping("/webqq")
public class ChatController {
private static final Logger logger = LoggerManager.getLogger(ChatController.class);
private MessageService messageService;
@ApiOperation(value = ... | public CommonResponse chat(@RequestBody Message message){ | 3 |
DarrenMowat/PicSync | src/com/darrenmowat/gdcu/tasks/RenameFolderTask.java | [
"public class RenameFolderActivity extends SherlockFragmentActivity {\n\n\tprivate EditText newNameET;\n\tprivate RenameFolderTask mTask;\n\t\n\tprivate ProgressDialogFragment progressFragment;\n\t\n\t\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tse... | import java.io.IOException;
import org.json.JSONException;
import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import com.darrenmowat.gdcu.activity.RenameFolderActivity;
import com.darrenmowat.gdcu.data.Database;
import com.darrenmowat.gdcu.data.Preferences;
import com.darrenmowat.g... | package com.darrenmowat.gdcu.tasks;
public class RenameFolderTask extends AsyncTask<Void, Void, Void> {
protected RenameFolderActivity mActivity;
protected String mToken;
protected String mCurrentName;
protected String mNewName;
public RenameFolderTask(RenameFolderActivity activity, String token, String cur... | DriveApi drive = new DriveApi(mToken, mCurrentName); | 3 |
vy/hrrs | replayer/src/main/java/com/vlkan/hrrs/replayer/cli/Replayer.java | [
"public interface HttpRequestRecord {\n\n String getId();\n\n Date getTimestamp();\n\n String getGroupName();\n\n String getUri();\n\n HttpRequestMethod getMethod();\n\n List<HttpRequestHeader> getHeaders();\n\n HttpRequestPayload getPayload();\n\n Builder toBuilder();\n\n interface Build... | import com.codahale.metrics.ConsoleReporter;
import com.codahale.metrics.MetricRegistry;
import com.google.common.base.Stopwatch;
import com.google.common.util.concurrent.RateLimiter;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.vlkan.hrrs.api.HttpRequestRecord;
import com.vlkan.hrrs.co... | package com.vlkan.hrrs.replayer.cli;
@Singleton
public class Replayer implements Runnable, Closeable, HttpRequestRecordStreamConsumer {
private static final Logger LOGGER = LoggerFactory.getLogger(Replayer.class);
private final Config config;
private final CloseableExecutor closeableExecutor;
pr... | private final MetricReporter metricReporter; | 5 |
uservoice/uservoice-android-sdk | UserVoiceSDK/src/com/uservoice/uservoicesdk/flow/InitManager.java | [
"public class Config extends BaseModel {\n private String site;\n private String key;\n private String secret;\n private String email;\n private String name;\n private String guid;\n private Map<String, String> customFields = new HashMap<String, String>();\n private int topicId = -1;\n pr... | import android.content.Context;
import android.content.SharedPreferences;
import com.uservoice.uservoicesdk.Config;
import com.uservoice.uservoicesdk.Session;
import com.uservoice.uservoicesdk.babayaga.Babayaga;
import com.uservoice.uservoicesdk.model.AccessToken;
import com.uservoice.uservoicesdk.model.AccessTokenResu... | package com.uservoice.uservoicesdk.flow;
public class InitManager {
private final Context context;
private final Runnable callback;
private boolean canceled;
public InitManager(Context context, Runnable callback) {
this.context = context;
this.callback = callback;
}
public ... | User.findOrCreate(context, config.getEmail(), config.getName(), config.getGuid(), new DefaultCallback<AccessTokenResult<User>>(context) { | 7 |
khasang/SmartForecast | Forecast/app/src/main/java/com/khasang/forecast/sqlite/SQLiteProcessData.java | [
"public class AppUtils {\n\n public static final String ApiCustomEvent = \"Error\";\n\n public static final double KELVIN_CELSIUS_DELTA = 273.15;\n public static final double HPA_TO_MM_HG = 1.33322;\n public static final double KM_TO_MILES = 0.62137;\n public static final double METER_TO_FOOT = 3.280... | import com.khasang.forecast.utils.AppUtils;
import com.khasang.forecast.position.Coordinate;
import com.khasang.forecast.position.Position;
import com.khasang.forecast.position.Precipitation;
import com.khasang.forecast.position.Weather;
import com.khasang.forecast.position.Wind;
import com.khasang.forecast.stations.We... | package com.khasang.forecast.sqlite;
/**
* Класс-обертка, предоставляет методы для записи/загрузки/удаления информации в БД.
*
* @author maxim.kulikov
*/
public class SQLiteProcessData {
public SimpleDateFormat dtFormat;
public SQLiteProcessData() {
dtFormat = new SimpleDateFormat("yyyy-MM-dd H... | public void saveSettings(AppUtils.TemperatureMetrics temperatureMetrics, | 0 |
Frank1234/FireBaseTest | app/src/main/java/com/ironflowers/firebasetest/ui/content/ContentPresenter.java | [
"@IgnoreExtraProperties\npublic class ContentItem {\n\n private int id;\n private String title;\n private String description;\n\n /**\n * Url of the image on the storage, relative to the storage content root.\n */\n private String imageUrl;\n\n @SuppressWarnings(\"unused\")\n public Con... | import android.support.annotation.Nullable;
import com.google.firebase.storage.StorageReference;
import com.ironflowers.firebasetest.data.model.ContentItem;
import com.ironflowers.firebasetest.data.repo.ContentRepository;
import com.ironflowers.firebasetest.ui.content.vm.ContentViewModel;
import com.ironflowers.firebas... | package com.ironflowers.firebasetest.ui.content;
/**
* Presents one {@link ContentItem} on the screen.
*/
public class ContentPresenter implements ContentContract.Presenter {
@Nullable
private ContentContract.View view;
| private ContentRepository contentRepository; | 1 |
pdtyreus/conversation-kit | conversation-kit/src/test/java/com/conversationkit/impl/DirectedConversationEngineTest.java | [
"public class ConversationEdge<I extends IConversationIntent, S extends IConversationState> implements IConversationEdge<I,S> {\n\n private final Integer endNodeId;\n private final String id;\n private final BiFunction<I, S, Boolean> validateFunction;\n private final List<BiFunction<I, S, Object>> sideE... | import com.eclipsesource.json.Json;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.BeforeClass;
import com.conversationkit.impl.edge.ConversationEdge... | /*
* The MIT License
*
* Copyright 2019 Synclab Consulting LLC.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use... | return new Action() { | 5 |
bourgesl/mapbench | src/main/java/test/ClipShapeTests.java | [
"public class BaseTest implements MapConst {\n\n /** base reference results directory */\n static final File refResultDirectory = getReferenceTestDirectory();\n\n /** base test results directory */\n static final File resultDirectory = new File(baseResultDirectory, getTestDirectory());\n\n static fin... | import it.geosolutions.java2d.BaseTest;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.Stroke;
import java.awt.geom.Ellipse2D;
import java.awt.geom.Path2D;
import java.awt.geom.PathIterator;
import java.awt.image.Buf... | package test;
/*
* Copyright (c) 2015, 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 ... | System.out.println("Diff ratio: " + testName + " = " + trimTo3Digits(ratio) + " %"); | 4 |
bmelnychuk/outlay | outlay/app/src/main/java/app/outlay/view/activity/base/ParentActivity.java | [
"public interface Analytics {\n void trackGuestSignIn();\n\n void trackEmailSignIn();\n\n void trackSignUp();\n\n void trackSingOut();\n\n void trackLinkAccount();\n\n void trackExpenseCreated(Expense e);\n\n void trackExpenseDeleted(Expense e);\n\n void trackExpenseUpdated(Expense e);\n\n ... | import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import app.outlay.App;
import app.outlay.R;
import app.outlay.analytics.Analytics;
import app.outlay.di.component.AppComponent;
... | package app.outlay.view.activity.base;
/**
* Created by Bogdan Melnychuk on 1/15/16.
*/
public class ParentActivity extends AppCompatActivity implements BaseActivity {
private ResourceHelper resourceHelper;
private OutlayTheme theme;
@Override
public void setContentView(int layoutResID) {
... | if (appPreferences().getTheme() == AppPreferences.THEME_LIGHT) { | 2 |
blackbbc/Tucao | takephoto_library/src/main/java/com/jph/takephoto/uitl/TUtils.java | [
"public class CropOptions implements Serializable{\n /**使用TakePhoto自带的裁切工具进行裁切*/\n private boolean withOwnCrop;\n private int aspectX;\n private int aspectY;\n private int outputX;\n private int outputY;\n private CropOptions(){}\n\n public int getAspectX() {\n return aspectX;\n }\... | import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import androidx.core.content.FileProvider;
import android.text.TextUtils;
import android.util.Log;
imp... | package com.jph.takephoto.uitl;
/**
* 工具类
* Author: JPH
* Date: 2016/7/26 10:04
*/
public class TUtils {
private static final String TAG = IntentUtils.class.getName();
/**
* 将Image集合转换成Uri集合
* @param images
* @return
*/
public static ArrayList<Uri> convertImageToUri(Context con... | if (defaultIndex+1>intentWapList.size())throw new TException(isCrop? TExceptionType.TYPE_NO_MATCH_PICK_INTENT:TExceptionType.TYPE_NO_MATCH_CROP_INTENT); | 3 |
eivindveg/HotSUploader | src/main/java/ninja/eivind/hotsreplayuploader/Client.java | [
"@Component\npublic class StatusBinder {\n\n private final StringProperty message = new SimpleStringProperty();\n\n public StringProperty message() {\n return message;\n }\n}",
"public class ProgressMonitor implements ApplicationContextInitializer<ConfigurableApplicationContext>, ApplicationListen... | import java.awt.AWTException;
import java.awt.SystemTray;
import java.awt.TrayIcon;
import java.net.URL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.... | // Copyright 2015-2016 Eivind Vegsundvåg
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... | final String windowTitle = Constants.APPLICATION_NAME + " v" + releaseManager.getCurrentVersion(); | 4 |
flyver/Flyver-Apps | HelloFlyver/FlyverServer/src/main/java/co/flyver/androidrc/Server/Server.java | [
"public class IPCKeys {\n public static final String COORDINATES = \"coordinates\";\n public static final String YAW = \"yaw\";\n public static final String THROTTLE = \"throttle\";\n public static final String INCREASE = \"increase\";\n public static final String DECREASE = \"decrease\";\n public... | import android.app.IntentService;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Base64;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Inpu... | package co.flyver.androidrc.Server;
/**
* Created by Petar Petrov on 10/2/14.
*/
public class Server extends IntentService {
private static final String SERVER = "SERVER";
private static final String EV_DEBUG = "DEBUG";
private static final String EV_RAWDATA = "RAWDATA";
public static Status ... | JSONTriple<String, String, Float> mJsonAction = new JSONTriple<>(); | 5 |
EsupPortail/esup-dematec | src/main/java/fr/univrouen/poste/services/CommissionEntryService.java | [
"@RooJavaBean\n@RooToString\n@RooJpaActiveRecord\npublic class AppliConfig {\n\t\n\tpublic static enum MailReturnReceiptModeTypes {NEVER, EACH_UPLOAD, EACH_SESSION};\n\n\tprivate static String cacheTitre;\n\t\n\tprivate static String cacheImageUrl;\n\t\n\tprivate static String cachePiedPage;\n\n\tprivate static Str... | import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import javax.persistence.TypedQuery;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.T... | package fr.univrouen.poste.services;
@Service
public class CommissionEntryService {
@Autowired
private CreateUserService createUserService;
@Autowired
private LogService logService;
@Autowired
EmailService emailService;
/**
* IMPORTANT : le commissionEntry ayant été récupéré dans un autre con... | UserRegistrationForm userRegistration = new UserRegistrationForm(); | 5 |
goshippo/shippo-java-client | src/test/java/com/shippo/model/PickupTest.java | [
"public class APIConnectionException extends ShippoException {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic APIConnectionException(String message) {\n\t\tsuper(message);\n\t}\n\n\tpublic APIConnectionException(String message, Throwable e) {\n\t\tsuper(message, e);\n\t}\n\n}",
"public class AP... | import static org.junit.Assert.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.time.LocalDateTime;
import org.junit.Test;
import com.shippo.... | package com.shippo.model;
public class PickupTest extends ShippoTest {
/**
* Intentionally commented out as this test could result in a purchase of a
* non test label depending on your carrier account settings
*
* To use this test, please make sure that test mode is enabled for the
* default rate object... | public void testInvalidCreate() throws AuthenticationException, InvalidRequestException, APIConnectionException, | 0 |
bingyulei007/bingexcel | excel/src/test/java/com/chinamobile/excel/ReadTest8.java | [
"public interface ExcleBuilder<T> {\n\n\tExcleBuilder<BingExcel> addFieldConversionMapper(Class<?> clazz,\n\t\t\tString filedName, int index);\n\n\tExcleBuilder<BingExcel> addFieldConversionMapper(Class<?> clazz,\n\t\t\tString filedName, int index, String alias);\n\n\tExcleBuilder<BingExcel> addFieldConversionMappe... | import com.bing.common.ExcleBuilder;
import com.bing.excel.annotation.CellConfig;
import com.bing.excel.annotation.OutAlias;
import com.bing.excel.converter.AbstractFieldConvertor;
import com.bing.excel.core.BingExcel;
import com.bing.excel.core.BingExcelBuilder;
import com.bing.excel.core.handler.ConverterHandler;
imp... | package com.chinamobile.excel;
/**
* @author shizhongtao
*
* date 2016-3-23 Description:
*/
public class ReadTest8 {
@Test
public void readExcelTest() throws URISyntaxException {
// InputStream in = Person.class.getResourceAsStream("/person.xlsx");
URL url = Salary.class.getResource("/salary7.xlsx");
Fi... | SheetVo vo = bing.readFile(f, Salary.class,1); | 5 |
DevotedMC/ExilePearl | src/main/java/com/devotedmc/ExilePearl/command/CmdAdminSetType.java | [
"public interface ExilePearl {\n\n\t/**\n\t * Gets the pearl item name\n\t * @return The item name\n\t */\n\tString getItemName();\n\n\t/**\n\t * Gets the exiled player ID\n\t * @return The player ID\n\t */\n\tUUID getPlayerId();\n\n\t/**\n\t * Gets the unique pearl ID\n\t * @return The pearl ID\n\t */\n\tint getPe... | import java.util.UUID;
import org.bukkit.entity.Player;
import com.devotedmc.ExilePearl.ExilePearl;
import com.devotedmc.ExilePearl.ExilePearlApi;
import com.devotedmc.ExilePearl.ExilePearlPlugin;
import com.devotedmc.ExilePearl.PearlType;
import com.devotedmc.ExilePearl.util.Permission;
import com.devotedmc.ExilePearl... | package com.devotedmc.ExilePearl.command;
public class CmdAdminSetType extends PearlCommand {
public CmdAdminSetType(ExilePearlApi pearlApi) {
super(pearlApi);
this.aliases.add("settype");
this.setHelpShort("Sets the type of a pearl.");
this.commandArgs.add(requiredPearlPlayer());
this.commandArgs.add... | PearlType type = PearlType.fromString(argAsString(1)); | 3 |
beiyoufx/teemo | teemo/src/main/java/com/teemo/web/controller/DefaultExceptionHandler.java | [
"public final class Constants {\r\n /**\r\n * 系统属性\r\n * DP_开头的属性全部从DynamicProperty表读取\r\n */\r\n public static final String DP_SYSTEM_VERSION = \"System.Version\"; //用户获取当前系统的版本\r\n public static final String DP_STATIC_PATH = \"Static.Path\"; //系统的静态资源地址\r\n\r\n /**\r\n * 业务属性\r\n *... | import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.teemo.core.Constants;
import com.teemo.core.util.UserLogUtil;
import com.teemo.dto.Result;
import com.teemo.entity.User;
import core.util.StringUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.sh... | /**
* Copyright (c) 2016- https://github.com/beiyoufx
*
* Licensed under the GPL-3.0
*/
package com.teemo.web.controller;
/**
* @author yongjie.teng
* @date 16-12-2 下午5:15
* @email yongjie.teng@foxmail.com
* @package com.teemo.web.controller
*/
@ControllerAdvice
public class DefaultException... | User currentUser = (User) session.getAttribute(Constants.CURRENT_USER);
| 3 |
jcgay/send-notification | send-notification-cli/src/main/java/fr/jcgay/notification/cli/SendNotificationCli.java | [
"@AutoValue\npublic abstract class Application {\n\n /**\n * Uniquely identify an application. <br>\n * In order to ensure your application's signature is unique, the recommendation is to follow the Internet Media\n * type (also known as MIME content type) format as defined in IETF <a href=\"http://t... | import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import fr.jcgay.notification.Application;
import fr.jcgay.notification.Icon;
import fr.jcgay.notification.Notification;
import fr.jcgay.notification.Notifier;
import fr.jcgay.notification.SendNotification;
import fr.jcgay.notification.SendNo... | package fr.jcgay.notification.cli;
public class SendNotificationCli {
@Parameter(description = "notifier(s)")
private List<String> notifiers;
@Parameter(names = {"-t", "--title"}, description = "notification title", required = true)
private String title;
@Parameter(names = {"-m", "--message"},... | private void sendNotificationUsing(Notifier notify) { | 3 |
respoke/respoke-sdk-android | respokeSDKTest/src/androidTest/java/com/digium/respokesdktest/unit/RespokeGroupTests.java | [
"public class Respoke {\n\n public final static int GUID_STRING_LENGTH = 36; // The length of GUID strings\n\n private static Respoke _instance;\n private static boolean factoryStaticInitialized;\n private String pushToken;\n private ArrayList<RespokeClient> instances;\n private Context context;\n... | import com.digium.respokesdk.Respoke;
import com.digium.respokesdk.RespokeClient;
import com.digium.respokesdk.RespokeConnection;
import com.digium.respokesdk.RespokeGroup;
import com.digium.respokesdktest.RespokeTestCase;
import java.util.ArrayList; | /**
* Copyright 2015, Digium, Inc.
* All rights reserved.
*
* This source code is licensed under The MIT License found in the
* LICENSE file in the root directory of this source tree.
*
* For all details and documentation: https://www.respoke.io
*/
package com.digium.respokesdktest.unit;
public class Resp... | RespokeClient client = Respoke.sharedInstance().createClient(getContext()); | 1 |
celiosilva/leitoor | leitoor/src/main/java/br/com/delogic/leitoor/service/mock/AutenticacaoServiceMock.java | [
"@Entity\n@DiscriminatorValue(\"ALUNO\")\npublic class Aluno extends Usuario {\n\n}",
"@Entity\n@DiscriminatorValue(\"PROFESSOR\")\npublic class Professor extends Aluno {\n\n}",
"@Entity\n@Inheritance(strategy = InheritanceType.SINGLE_TABLE)\n@DiscriminatorColumn(name = \"PERFIL\", length = 50)\npublic abstract... | import java.util.List;
import javax.inject.Inject;
import javax.inject.Named;
import org.springframework.security.authentication.AuthenticationManager;
import br.com.delogic.leitoor.entidade.Aluno;
import br.com.delogic.leitoor.entidade.Professor;
import br.com.delogic.leitoor.entidade.Usuario;
import br.com.delogic.le... | package br.com.delogic.leitoor.service.mock;
public class AutenticacaoServiceMock extends AutenticacaoServiceImpl implements AutenticacaoService {
private Professor professor;
@Inject | private ProfessorRepository professorRepository; | 3 |
sladeware/groningen | src/main/java/org/arbeitspferde/groningen/validator/Validator.java | [
"public interface GroningenConfig {\n\n /**\n * Returns the {@link ClusterConfig} with the specified name\n *\n * @param clusterName {@link String} representation of the cluster name for which to retrieve the\n * {@link ClusterConfig}\n * @return A {@link ClusterConfig} if the cluster is present in the e... | import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import org.arbeitspferde.groningen.config.GroningenConfig;
import org.arbeitspferde.groningen.config.PipelineIterationScoped;
import org.arbeitspferde.groningen.display.MonitorGroningen;
import org.arbeitspferde.groningen.experimentdb.Command... | /* 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 in... | final SubjectRestart subjectRestart = bridge.getSubjectRestart(); | 5 |
ongres/scram | client/src/main/java/com/ongres/scram/client/ScramClient.java | [
"public interface ScramMechanism {\n /**\n * The name of the mechanism, which must be a value registered under IANA:\n * <a href=\"https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml#scram\">\n * SASL SCRAM Family Mechanisms</a>\n * @return The mechanism name\n */\n ... | import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.List;
import static com.ongres.scram.common.util.Preconditions.*;
import com.ongres.scram.common.ScramMechanism;
import com.ongres.scram.common.Scr... | /*
* Copyright 2017, OnGres.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
... | private final StringPreparation stringPreparation; | 2 |
neo4j-contrib/neo4j-jdbc | neo4j-jdbc-bolt/src/main/java/org/neo4j/jdbc/bolt/BoltNeo4jResultSet.java | [
"public class ListArray extends Neo4jArray {\n\n\tprivate List list;\n\tprivate int type;\n\tprivate static final String TYPE_NOT_SUPPORTED = \"Type %s not supported\";\n\n\n\tpublic ListArray(List list, int type) {\n\t\tthis.list = list;\n\t\tthis.type = type;\n\t}\n\n\tpublic ListArray(String typeName, Object[] ... | import org.neo4j.driver.Record;
import org.neo4j.driver.Result;
import org.neo4j.driver.Value;
import org.neo4j.driver.Values;
import org.neo4j.driver.exceptions.value.Uncoercible;
import org.neo4j.driver.internal.types.InternalTypeSystem;
import org.neo4j.driver.internal.value.DateTimeValue;
import org.neo4j.driver.in... | return convertObject(obj);
}
@Override public Object getObject(String columnLabel) throws SQLException {
checkClosed();
Object obj = this.fetchValueFromLabel(columnLabel).asObject();
return convertObject(obj);
}
@Override public <T> T getObject(String columnLabel, Class<T> type) throws SQLException {
tr... | return valueToTimestamp(value); | 6 |
alexandre-normand/blood-shepherd | dexcom-receiver/src/main/java/org/glukit/dexcom/sync/tasks/FetchNewDataRunner.java | [
"public interface DataInputFactory {\n public DataInput create(InputStream inputStream);\n}",
"public interface DataOutputFactory {\n public DataOutput create(OutputStream outputStream);\n}",
"public class DatabasePagesPager implements Iterable<DatabaseReadRequestSpec> {\n private long firstPage;\n private ... | import com.google.common.base.Predicate;
import com.google.common.base.Throwables;
import com.google.common.collect.Collections2;
import com.google.inject.Inject;
import jssc.SerialPort;
import jssc.SerialPortException;
import org.glukit.dexcom.sync.DataInputFactory;
import org.glukit.dexcom.sync.DataOutputFactory;
imp... | /*
* The MIT License (MIT)
*
* Copyright (c) 2013 Alexandre Normand
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
*... | DatabasePagesPager manufacturingDataPager = getPagerForRecordType(serialPort, ManufacturingData); | 2 |
mediashelf/fedora-client | fedora-client-core/src/test/java/com/yourmediashelf/fedora/client/request/BaseFedoraRequestIT.java | [
"public static Ingest ingest() {\n return new Ingest();\n}",
"public static PurgeObject purgeObject(String pid) {\n return new PurgeObject(pid);\n}",
"public class FedoraClient {\n\n private final org.slf4j.Logger logger = org.slf4j.LoggerFactory\n .getLogger(this.getClass());\n\n private... | import static com.yourmediashelf.fedora.client.FedoraClient.ingest;
import static com.yourmediashelf.fedora.client.FedoraClient.purgeObject;
import static org.junit.Assert.assertEquals;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.apache.maven.ar... | /**
* Copyright (C) 2010 MediaShelf <http://www.yourmediashelf.com/>
*
* This file is part of fedora-client.
*
* fedora-client 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 ... | ingest(testPid).logMessage("ingestTestObject for " + getClass()) | 0 |
samtingleff/jchronic | src/main/java/com/mdimension/jchronic/repeaters/Repeater.java | [
"public class Options {\n private Pointer.PointerType _context;\n private Calendar _now;\n private boolean _guess;\n private boolean _debug;\n private int _ambiguousTimeRange;\n private boolean _compatibilityMode;\n\n public Options() {\n this(Pointer.PointerType.FUTURE, Calendar.getInstance(), true, 6);\... | import java.util.List;
import com.mdimension.jchronic.Options;
import com.mdimension.jchronic.tags.Pointer;
import com.mdimension.jchronic.tags.Tag;
import com.mdimension.jchronic.utils.Span;
import com.mdimension.jchronic.utils.Token; | package com.mdimension.jchronic.repeaters;
public abstract class Repeater<T> extends Tag<T> implements Comparable<Repeater<?>> {
public Repeater(T type) {
super(type);
}
| public static List<Token> scan(List<Token> tokens) { | 4 |
dbasedow/prospecter | src/test/java/de/danielbasedow/prospecter/core/query/build/AdvancedQueryBuilderTest.java | [
"public class MalformedQueryException extends Exception {\n public MalformedQueryException(String msg) {\n super(msg);\n }\n\n public MalformedQueryException(String msg, Throwable cause) {\n super(msg, cause);\n }\n}",
"public class Query {\n protected final int queryId;\n protecte... | import aima.core.logic.propositional.parsing.ast.Sentence;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.danielbasedow.prospecter.core.MalformedQueryException;
import de.danielbasedow.prospecter.core.query.Query;
import de.danielbasedow.prospecter.core.sch... | package de.danielbasedow.prospecter.core.query.build;
public class AdvancedQueryBuilderTest extends TestCase {
private AdvancedQueryBuilder builder;
private static final ObjectMapper mapper = new ObjectMapper();
public void setUp() {
try {
SchemaBuilder schemaBuilder = new SchemaBuil... | } catch (SchemaConfigurationError schemaConfigurationError) { | 4 |
dnault/therapi-json-rpc | src/main/java/com/github/therapi/jsonrpc/web/AbstractSpringJsonRpcController.java | [
"public class ApiDocProvider {\n private final CommentFormatter commentFormatter = new CommentFormatter();\n private final JsonSchemaProvider schemaProvider = new JsonSchemaProvider();\n\n public List<ApiNamespaceDoc> getDocumentation(MethodRegistry registry) throws IOException {\n final ObjectWrite... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.therapi.apidoc.ApiDocProvider;
import com.github.therapi.apidoc.ApiDocWriter;
import com.github.therapi.apidoc.ApiModelDoc;
import com.github.therapi.apidoc.ModelDocWriter;
import com.github.therapi.core.MethodRegistry;
import com.github.therapi.core... | package com.github.therapi.jsonrpc.web;
/**
* Base class for a Spring controller that acts as a JSON-RPC 2.0 endpoint and
* automatically scans the Spring application context for remotable services.
* Subclasses should be annotated with {@code @Controller} and must override the
* abstract {@link #getObjectMapper... | protected JsonRpcDispatcher newJsonRpcDispatcher(MethodRegistry registry) { | 3 |
remijouannet/get10 | app/src/main/java/com/remijouannet/get10/scenes/GameWorld.java | [
"public class GLRenderer implements Renderer {\n\n private static final String TAG = GLRenderer.class.getSimpleName();\n\n private final float[] mtrxProjection = new float[16];\n private final float[] mtrxView = new float[16];\n public final float[] mtrxProjectionAndView = new float[16];\n\n public i... | import android.view.MotionEvent;
import com.remijouannet.get10.graphic2D.GLRenderer;
import com.remijouannet.get10.graphic2D.GameScene;
import com.remijouannet.get10.scenes.gameScene.GameScene1;
import com.remijouannet.get10.scenes.gameScene.GameScene2;
import com.remijouannet.get10.Settings; | /*
Copyright (C) 2015 Rémi Jouannet <remijouannet@gmail.com>
This file is part of get10.
get10 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 o... | public GameScene gameScene; | 1 |
emina/kodkod | test/kodkod/test/unit/IntTest.java | [
"public abstract class Expression extends Node {\n\t\n\t/** The universal relation: contains all atoms in a {@link kodkod.instance.Universe universe of discourse}. */\n\tpublic static final Expression UNIV = new ConstantExpression(\"univ\", 1);\n\t\n\t/** The identity relation: maps all atoms in a {@link kodkod.in... | import static kodkod.ast.operator.IntCompOperator.EQ;
import static kodkod.ast.operator.IntCompOperator.GT;
import static kodkod.ast.operator.IntCompOperator.GTE;
import static kodkod.ast.operator.IntCompOperator.LT;
import static kodkod.ast.operator.IntCompOperator.LTE;
import static kodkod.ast.operator.IntOperator.AN... |
f = r1.sum().eq(IntConstant.constant(5));
s = solve(f);
assertNotNull(s.instance());
bounds.boundExactly(1, factory.setOf(factory.tuple("9")));
f = r1.sum().eq(IntConstant.constant(6));
s = solve(f);
assertNotNull(s.instance());
bounds.boundExactly(-8, factory.setOf(factory.tuple("1")));
f = ... | final Variable x = Variable.unary("x"); | 2 |
raduciobanu/mobemu | src/mobemu/algorithms/SAROS.java | [
"public class Context {\n\n private int id; // id of the node whose context this is\n private Set<Topic> topics; // topics belonging to this context\n private static int maxTopicsNo = 0;\n private static int maxTopicId = -1;\n private static Set<Integer> uniqueTopicsIds = new HashSet<>();\n public... | import java.util.*;
import mobemu.node.Context;
import mobemu.node.Message;
import mobemu.node.Node;
import mobemu.utils.Trust.TransactionData;
import mobemu.utils.Trust.TrustData;
import mobemu.utils.Trust.TrustMessage;
import mobemu.utils.Trust.TrustMessageInfo; | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mobemu.algorithms;
/**
* Class for a SAROS node.
*
* Radu-Ioan Ciobanu, Radu-Corneliu Marin, Ciprian Dobre, Valentin Cristea.
* Trust and Reputation Management for Opportunistic Dissemination. Pervasive
* ... | public Message generateMessage(Message message) { | 1 |
karthicks/gremlin-ogm | gremlin-objects/src/test/java/org/apache/tinkerpop/gremlin/object/graphs/Modern.java | [
"@Data\n@Builder\n@NoArgsConstructor\n@AllArgsConstructor\n@Accessors(fluent = true, chain = true)\n@EqualsAndHashCode(of = {}, callSuper = true)\npublic class Created extends Edge {\n\n private double weight;\n\n public static Created of(double weight) {\n return Created.builder().weight(weight).build();\n }... | import org.apache.tinkerpop.gremlin.object.edges.Created;
import org.apache.tinkerpop.gremlin.object.edges.Knows;
import org.apache.tinkerpop.gremlin.object.vertices.Person;
import org.apache.tinkerpop.gremlin.object.vertices.Software;
import org.apache.tinkerpop.gremlin.object.structure.Graph;
import lombok.Data; | /*
* 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... | private final Graph graph; | 4 |
CPPAlien/DaVinci | davinci/src/main/java/cn/hadcn/davinci/volley/toolbox/ImageLoader.java | [
"public interface ErrorListener {\n /**\n * Callback method that an error has been occurred with the\n * provided error code and optional user-readable message.\n */\n void onErrorResponse(VolleyError error);\n}",
"public interface Listener<T> {\n /** Called when a response is received. */\n ... | import cn.hadcn.davinci.volley.VolleyError;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.os.Handler;
import android.os.Looper;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import cn.hadcn.davinci.volley.Response.ErrorListener;
import cn.hadcn.davin... | /**
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | return new ImageRequest(requestUrl, new Listener<Bitmap>() { | 1 |
gauthierj/dsm-webapi-client | dsm-webapi-client-filestation/src/main/java/com/github/gauthierj/dsm/webapi/client/filestation/delete/DeleteServiceImpl.java | [
"public class DsmWebapiResponse<T> {\n\n private boolean success;\n private T data;\n private DsmWebApiResponseError error;\n\n @JsonCreator\n public DsmWebapiResponse(@JsonProperty(\"success\") boolean success,\n @JsonProperty(\"data\") T data,\n ... | import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.gauthierj.dsm.webapi.client.DsmWebapiResponse;
import com.github.gauthierj.dsm.webapi.client.AbstractDsmServiceImpl;
import com.github.gauthierj.dsm.webapi.client.DsmWebApiResponseError;
import com.github.gauthierj.dsm.webapi.client.DsmWebapiReques... | package com.github.gauthierj.dsm.webapi.client.filestation.delete;
@Component
public class DeleteServiceImpl extends AbstractDsmServiceImpl implements DeleteService {
public static final String API_ID = "SYNO.FileStation.Delete";
public static final String API_VERSION = "1";
public static final String P... | private static class DeleteErrorHandler implements ErrorHandler { | 4 |
brutusin/wava | wava-core/src/main/java/org/brutusin/wava/main/CoreMain.java | [
"public enum ANSICode {\r\n\r\n BLACK(\"\\u001B[30m\"),\r\n RED(\"\\u001B[31m\"),\r\n GREEN(\"\\u001B[32m\"),\r\n YELLOW(\"\\u001B[33m\"),\r\n BLUE(\"\\u001B[34m\"),\r\n PURPLE(\"\\u001B[35m\"),\r\n CYAN(\"\\u001B[36m\"),\r\n WHITE(\"\\u001B[37m\"),\r\n BG_GREEN(\"\\u001b[42m\"),\r\n B... | import org.brutusin.wava.io.RetCode;
import org.brutusin.wava.utils.CoreUtils;
import java.io.File;
import java.io.IOException;
import org.brutusin.wava.utils.ANSICode;
import java.nio.channels.FileLock;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
imp... | /*
* Copyright 2016 Ignacio del Valle Alles idelvall@brutusin.org.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Un... | FileLock lock = Utils.tryWavaLock();
| 1 |
android-notes/SwissArmyKnife | saklib/src/main/java/com/wanjian/sak/layer/impl/RelativeLayerView.java | [
"public abstract class ISizeConverter {\n public static ISizeConverter CONVERTER;\n\n public abstract String desc();\n\n public abstract Size convert(Context context, float length);\n\n public abstract int recovery(Context context, float length);\n\n}",
"public class Size {\n\n private static List<... | import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.v4.view.GestureDetectorCompat;
import android.view.GestureDetector;
import android.view.InputEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import com.wa... | package com.wanjian.sak.layer.impl;
public class RelativeLayerView extends Layer implements ISize {
private int mTxtSize;
private Paint mPaint;
private int[] mLocation1 = new int[2];
private int[] mLocation2 = new int[2];
private View mFirstView;
private View mSecondView;
private View mTargetView;
p... | Size size = sizeConverter.convert(getContext(), length); | 1 |
1Ridav/PengueeBot | src/main/java/bot/penguee/screen/ScreenEngine.java | [
"public class Data {\n\tString s = new File(\"\").getAbsolutePath();\n\t//Default fragments path value could be overriden in Main\n\tprivate static String fragmentsPath = new File(\"\").getAbsolutePath() + File.separator + \"frag\";\n\tprivate static HashMap<String, Frag> fragments = new HashMap<String, Frag>();\n\... | import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import bot.penguee.Data;
import bot.penguee.Position;
import bot.penguee.Region;
import bot.penguee.exception.FragmentNotLoadedException;
import bot.penguee.exception.ScreenNotGrabbedException;
import bot.penguee.screen.cpu.Screen;
import bot.penguee.scree... | package bot.penguee.screen;
public class ScreenEngine implements ScreenEngineInterface {
private ScreenEngineInterface se;
public ScreenEngine() {
se = Data.getForceUseGPU() ? new ScreenGPU() : new Screen();
}
@Override | public Position[] find_all(String fragName) throws FragmentNotLoadedException, ScreenNotGrabbedException { | 4 |
Keridos/FloodLights | src/main/java/de/keridos/floodlights/FloodLights.java | [
"@SuppressWarnings(\"WeakerAccess\")\npublic class ModCompatibility {\n private static ModCompatibility instance = null;\n\n public static boolean IC2Loaded = false;\n public static boolean BCLoaded = false;\n public static boolean CofhCoreLoaded = false;\n public static boolean NEILoaded = false;\n ... | import de.keridos.floodlights.compatability.ModCompatibility;
import de.keridos.floodlights.core.proxy.CommonProxy;
import de.keridos.floodlights.handler.ConfigHandler;
import de.keridos.floodlights.handler.GuiHandler;
import de.keridos.floodlights.handler.PacketHandler;
import de.keridos.floodlights.init.ModBlocks;
im... | package de.keridos.floodlights;
/**
* Created by Keridos on 28.02.14.
* This Class is the Main Class of the Mod.
*/
@SuppressWarnings("unused")
@Mod.EventBusSubscriber
@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION, dependencies = Reference.DEPENDENCIES)
public class FloodL... | FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(ModItems.rawFilament, 1), new ItemStack(ModItems.glowingFilament, 1), 0.1F); | 6 |
otto-de/edison-hal | src/test/java/de/otto/edison/hal/traverson/TraversonPagingTest.java | [
"@JsonIgnoreProperties(ignoreUnknown = true)\n@JsonPropertyOrder(alphabetic = false)\npublic class HalRepresentation {\n\n @JsonProperty(value = \"_links\")\n @JsonInclude(NON_NULL)\n private volatile Links links;\n @JsonProperty(value = \"_embedded\")\n @JsonInclude(NON_NULL)\n private volatile E... | import com.fasterxml.jackson.annotation.JsonProperty;
import de.otto.edison.hal.HalRepresentation;
import de.otto.edison.hal.Link;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestName;
import org.slf4j.Logger;
import java.io.IOException;
import java.net.URL;
import java... | // given
@SuppressWarnings("unchecked")
final LinkResolver mock = mock(LinkResolver.class);
when(mock.apply(link("self", "http://example.com/example/foo"))).thenReturn("{}");
// when we getResource the next page
final Optional<HalRepresentation> optionalPage = traverson(... | .map(Link::getHref) | 1 |
nikacotAndroid/Weather-Guru-MVP | app/src/main/java/mk/petrovski/weathergurumvp/injection/component/ActivityFragmentComponent.java | [
"@Module(includes = RxModule.class) public class ActivityFragmentModule {\n\n private Activity activity;\n\n public ActivityFragmentModule(Activity activity) {\n this.activity = activity;\n }\n\n @Provides Activity getActivity() {\n return activity;\n }\n\n @Provides @ActivityContext Context getActivity... | import dagger.Component;
import mk.petrovski.weathergurumvp.injection.module.ActivityFragmentModule;
import mk.petrovski.weathergurumvp.injection.scope.ActivityScope;
import mk.petrovski.weathergurumvp.ui.city.ManageCityActivity;
import mk.petrovski.weathergurumvp.ui.day.DayFragment;
import mk.petrovski.weathergurumvp.... | package mk.petrovski.weathergurumvp.injection.component;
/**
* Created by Nikola Petrovski on 2/15/2017.
*/
@ActivityScope
@Component(dependencies = ApplicationComponent.class, modules = ActivityFragmentModule.class)
public interface ActivityFragmentComponent {
void inject(MainActivity mainActivity);
void in... | void inject(ManageCityActivity manageCityActivity); | 1 |
thebrightspark/SparksHammers | src/main/java/brightspark/sparkshammers/init/SHItems.java | [
"public enum EnumMaterials\n{\n //Name, harvest level, durability, mining speed, damage vs entities, enchantability\n\n //Vanilla\n // Durability -> vanilla * 6\n // Efficiency -> vanilla * 0.6\n // Attack -> vanilla + 3\n WOOD(0x866526, \"plankWood\", EnumHelper.addToolMaterial(\"HammerWood\"... | import brightspark.sparkshammers.EnumMaterials;
import brightspark.sparkshammers.api.ModTool;
import brightspark.sparkshammers.api.RegisterToolEvent;
import brightspark.sparkshammers.customTools.CustomTools;
import brightspark.sparkshammers.customTools.RegisterToolException;
import brightspark.sparkshammers.customTools... | package brightspark.sparkshammers.init;
public class SHItems
{
//Contains all items
private static List<Item> ITEMS;
//Contains all of the AOE tools
public static List<ItemAOE> AOE_TOOLS = new LinkedList<>();
//Contains all of the items which use a basic coloured texture
public static List<It... | for(EnumMaterials material : EnumMaterials.values()) | 0 |
cuberact/cuberact-json | src/main/java/org/cuberact/json/parser/JsonScanner.java | [
"public class JsonException extends RuntimeException {\r\n\r\n private static final long serialVersionUID = 1L;\r\n\r\n public JsonException(String message) {\r\n super(message);\r\n }\r\n\r\n public JsonException(Throwable t) {\r\n super(t);\r\n }\r\n\r\n public JsonException(String... | import org.cuberact.json.JsonException;
import org.cuberact.json.JsonNumber;
import org.cuberact.json.input.JsonInput;
import static org.cuberact.json.input.JsonInput.END_OF_INPUT;
import static org.cuberact.json.optimize.CharTable.hexBitShift;
import static org.cuberact.json.optimize.CharTable.toInt;
| }
String consumeString() {
StringBuilder token = null;
int count = 0;
for (; ; ) {
nextChar();
if (lastReadChar == '"') {
nextImportantChar();
if (token == null) return new String(buffer, 0, count);
token.... | unicodeChar += (toInt(lastReadChar) << hexBitShift(h));
| 4 |
palantir/eclipse-typescript | com.palantir.typescript/src/com/palantir/typescript/text/FileLanguageService.java | [
"public final class DefinitionInfo {\n\n private final String fileName;\n private final TextSpan textSpan;\n private final ScriptElementKind kind;\n private final String name;\n private final ScriptElementKind containerKind;\n private final String containerName;\n\n public DefinitionInfo(\n ... | import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import java.util.UUID;
import org.eclipse.core.resources.IProject;
import com.google.common.collect.ImmutableList;
import com.palantir.typescript.services.language.CompletionInfoEx;
import com.palantir.typescript.services.language.D... | /*
* Copyright 2013 Palantir Technologies, 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 l... | public QuickInfo getQuickInfoAtPosition(int position) { | 4 |
Kesshou/Kesshou-Android | app/src/main/java/kesshou/android/daanx/views/menu/InfoFragment.java | [
"public abstract class MyCallBack<t> implements Callback<t> {\n\n\tprivate Context context;\n\n\tprotected MyCallBack(Context mContext){\n\t\tcontext=mContext.getApplicationContext();\n\t}\n\n\n\tprivate void onError(Call<t> call,Response<t> response){\n\t\tError error = ErrorUtils.parseError(response,context);\n\t... | import android.content.Context;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.AppCompatButton;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
imp... | package kesshou.android.daanx.views.menu;
/**
* A simple class.
*/
public class InfoFragment {
public InfoFragment() {
// Required empty public constructor
}
public View onCreateView(final Context context) {
// Inflate the layout for this fragment
context.setTheme(R.style.AppTheme);
context.getApp... | new NetworkingClient(context).checkNick(checkNick, new MyCallBack<StatusResponse>(context) { | 4 |
jimmc/HapiPodcastJ | src/info/xuluan/podcast/parser/FeedHandler.java | [
"public class FeedFetcher {\r\n\r\n\tprivate static final int maxSize = 1000 * 1024;\r\n\tprivate static final int TIMEOUT = 10 * 1000;\r\n\tprivate volatile boolean canceled = false;\r\n\tprivate volatile Thread downloadThread = null;\r\n\tprivate volatile HttpURLConnection m_httpConnection = null;\r\n\tprivate vo... | import info.xuluan.podcastj.R;
import info.xuluan.podcast.fetcher.FeedFetcher;
import info.xuluan.podcast.fetcher.Response;
import info.xuluan.podcast.provider.FeedItem;
import info.xuluan.podcast.provider.ItemColumns;
import info.xuluan.podcast.provider.Subscription;
import info.xuluan.podcast.utils.Log;
import... | package info.xuluan.podcast.parser;
public class FeedHandler {
private static final int REPEAT_UPDATE_FEED_COUNT = 3;
private final Log log = Log.getLog(getClass());
private ContentResolver cr;
private int max_valid_size;
public FeedHandler(ContentResolver context, int max_valid_sz){
cr =... | item.status = ItemColumns.ITEM_STATUS_DOWNLOAD_QUEUE;
| 3 |
achellies/AtlasForAndroid | src/android/taobao/atlas/runtime/ContextImplHook.java | [
"public final class BundleImpl implements Bundle {\n static final Logger log;\n Archive archive;\n final File bundleDir;\n BundleClassLoader classloader;\n private final BundleContextImpl context;\n int currentStartlevel;\n ProtectionDomain domain;\n Hashtable<String, String> headers;\n f... | import android.content.ComponentName;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.AssetManager;
import android.c... | package android.taobao.atlas.runtime;
public class ContextImplHook extends ContextWrapper {
static final Logger log;
private ClassLoader classLoader;
static {
log = LoggerFactory.getInstance("ContextImplHook");
}
public ContextImplHook(Context context, ClassLoader classLoader) {
... | if (Framework.getSystemClassLoader().loadClass(obj) != null) { | 1 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/Simplest_Test.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import org.apache.jena.rdf.model.ModelFactory;
import eu.optique.r2rml.api.model.LogicalTable;
import eu.optique.r2rml.api.model.ObjectMap;
import eu.optique.r2rml.api.model.PredicateMap;
import eu.optique.r2rml.api.model.PredicateObjectMap;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.ap... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* 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... | SQLBaseTableOrViewImpl ta= (SQLBaseTableOrViewImpl) table;
| 1 |
k0shk0sh/FastAccess | app/src/main/java/com/fastaccess/provider/service/FloatingService.java | [
"public class Bundler {\n\n private Bundle bundle;\n\n private Bundler() {\n bundle = new Bundle();\n }\n\n public static Bundler start() {\n return new Bundler();\n }\n\n public Bundler put(@NonNull String key, boolean value) {\n bundle.putBoolean(key, value);\n return... | import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.support.annotation.Nullable;
import com.fastaccess.R;
import com.fastaccess.helper.Bundler;
import com.fastaccess.helper... | package com.fastaccess.provider.service;
/**
* Created by Kosh on 13 Oct 2016, 7:32 PM
*/
public class FloatingService extends Service {
private FloatingVHView floatingVHView;
private FloatingFoldersView floatingFoldersView;
@Override public void onCreate() {
super.onCreate();
String... | PendingIntent.getActivity(this, 0, new Intent(this, MainView.class), PendingIntent.FLAG_UPDATE_CURRENT), | 4 |
sopeco/DynamicSpotter | org.spotter.core/src/org/spotter/core/Spotter.java | [
"public class PerformanceProblem {\n\tprivate List<PerformanceProblem> children;\n\n\tprivate Properties configuration;\n\n\tprivate IDetectionController detectionController;\n\n\tprivate String problemName = null;\n\n\tprivate Boolean detectable = null;\n\n\tprivate String uniqueId;\n\n\t/**\n\t * Create a new ins... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
import org.aim.api.exceptions.InstrumentationException;
import org.aim.api.exceptions.MeasurementException;
import org.lpe.common.config.GlobalConfiguration;
import org.lpe.common.util.LpeFi... | resultsContainer.reset();
}
}
/**
* Reads the performance problem hierarchy file and returns the root
* performance problem of that hierarchy.
*
* @param resultsContainer
* container in which to store the original root problem
* @return the root problem
*/
private PerformanceProblem ... | List<IWorkloadAdapter> wlAdapters = MeasurementEnvironmentFactory.getInstance().createWorkloadAdapters( | 6 |
curtbinder/AndroidStatus | app/src/main/java/info/curtbinder/reefangel/service/ControllerTask.java | [
"public class Controller {\n public static final byte MAX_CONTROLLER_VALUES = 20;\n public static final byte MAX_EXPANSION_RELAYS = 8;\n public static final byte MAX_RELAY_PORTS = 8;\n public static final byte MAX_TEMP_SENSORS = 3;\n public static final byte MAX_PWM_EXPANSION_PORTS = 6;\n public s... | import android.content.ContentValues;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import okhttp3.Credentials;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
i... | /*
* The MIT License (MIT)
*
* Copyright (c) 2012 Curt Binder
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, ... | private final RAPreferences raprefs; | 7 |
edsilfer/marvel-characters | user-intf/src/main/java/br/com/hole19/marvel/ui/controller/ActivityHomepage.java | [
"public class Postman {\n\n public static final String TAG = \"Postman\";\n\n @Inject\n RestTemplate mRequestService;\n @Inject\n RequestUtil mRequestUtil;\n\n public Postman() {\n DaggerWrapper.getComponent().inject(this);\n }\n\n public void listCharacters(Context context, String qu... | import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import com.gc.materialdesign.views.ButtonRectangle;
import com.mik... | package br.com.hole19.marvel.ui.controller;
/**
* Created by edgar on 28-Apr-16.
*/
public class ActivityHomepage extends ActivityTemplate {
private static final String TAG = "ActivityHomepage";
private static final int REQUEST_WRITE_EXTERNAL_PERMISSION = 1;
public static Boolean LOADING = Boolean.... | App.getComponent().inject(this); | 5 |
eedrummer/ccr-importer | src/java/org/ohd/pophealth/api/Evaluator.java | [
"public class InCompleteVocabularyException extends Exception {\n\n public InCompleteVocabularyException(String msg){\n super(msg);\n }\n public InCompleteVocabularyException(){\n super();\n }\n}",
"public class RecordCreator {\n\n private final static Logger LOG = Logger.getLogger(Re... | import java.io.Closeable;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.astm.ccr.ContinuityOfCareRecord;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import... | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.ohd.pophealth.api;
/**
* This is the main entry class for the popHealth CCR Validator/Importer. Additional
* service classes and implementation can be built using this class
*
* @author ohdohd
*/
publ... | addMeasure(MeasureReader.extractQualityMeasure(qMeasureJSON)); | 4 |
digitalpetri/ethernet-ip | cip-core/src/main/java/com/digitalpetri/enip/cip/services/ForwardOpenService.java | [
"public class CipResponseException extends Exception {\n\n private final int generalStatus;\n private final int[] additionalStatus;\n\n public CipResponseException(int generalStatus, int[] additionalStatus) {\n this.generalStatus = generalStatus;\n this.additionalStatus = additionalStatus;\n ... | import com.digitalpetri.enip.cip.CipResponseException;
import com.digitalpetri.enip.cip.epath.EPath.PaddedEPath;
import com.digitalpetri.enip.cip.epath.LogicalSegment.ClassId;
import com.digitalpetri.enip.cip.epath.LogicalSegment.InstanceId;
import com.digitalpetri.enip.cip.structs.ForwardOpenRequest;
import com.digita... | package com.digitalpetri.enip.cip.services;
public class ForwardOpenService implements CipService<ForwardOpenResponse> {
public static final int SERVICE_CODE = 0x54;
private static final PaddedEPath CONNECTION_MANAGER_PATH = new PaddedEPath(
new ClassId(0x06), | new InstanceId(0x01) | 3 |
CreateChance/DoorGod | app/src/main/java/com/createchance/doorgod/ui/AppListActivity.java | [
"public class AppAdapter extends RecyclerView.Adapter<AppAdapter.ViewHolder> {\n\n public static final int TYPE_PROTECTED = 100;\n public static final int TYPE_UNPROTECTED = 101;\n\n private static final String TAG = \"AppAdapter\";\n\n private Context context;\n\n private int type;\n\n private On... | import android.app.AppOpsManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.IBinder;
import a... | package com.createchance.doorgod.ui;
public class AppListActivity extends AppCompatActivity {
private static final String TAG = "AppListActivity";
public static final int CODE_REQUEST_PERMISSION = 100;
public static final int CODE_START_SETTINGS = 101;
private DrawerLayout drawerLayout;
priv... | private DoorGodService.ServiceBinder mService; | 2 |
cardinity/cardinity-sdk-java | src/main/java/com/cardinity/rest/RestResource.java | [
"public class CardSerializer implements JsonSerializer<Card> {\n\n @Override\n public JsonElement serialize(Card card, Type type, JsonSerializationContext jsonSerializationContext) {\n\n final JsonObject jsonObject = new JsonObject();\n jsonObject.addProperty(\"pan\", card.getPan());\n js... | import com.cardinity.json.CardSerializer;
import com.cardinity.json.PaymentDeserializer;
import com.cardinity.json.UtcDateTypeAdapter;
import com.cardinity.model.Card;
import com.cardinity.model.Payment;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import ja... | package com.cardinity.rest;
public abstract class RestResource {
// @formatter:off
public static final Gson GSON = new GsonBuilder()
.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
.registerTypeAdapter(Payment.class, new PaymentDeserializer()) | .registerTypeAdapter(Card.class, new CardSerializer()) | 3 |
CubeEngine/ReflecT | core/src/main/java/org/cubeengine/reflect/codec/CodecManager.java | [
"public class ConverterManager\n{\n private ConverterManager parent;\n\n private Map<Class<?>, Converter> converters = new ConcurrentHashMap<Class<?>, Converter>();\n private Map<Class, Converter> convertersByClass = new ConcurrentHashMap<Class, Converter>();\n\n protected ConverterManager(ConverterMana... | import java.util.HashMap;
import java.util.Map;
import org.cubeengine.converter.ConverterManager;
import org.cubeengine.reflect.Reflector;
import org.cubeengine.reflect.Section;
import org.cubeengine.reflect.SectionConverter;
import org.cubeengine.reflect.exception.ReflectedInstantiationException; | /*
* The MIT License
* Copyright © 2013 Cube Island
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modif... | defaultManager.registerConverter(new SectionConverter(), Section.class); | 2 |
stefanhaustein/nativehtml | android/src/main/java/org/kobjects/nativehtml/android/AndroidCss.java | [
"public class Css {\n /**\n * Specificity weight for element name and pseudoclass selectors.\n */\n static final int SPECIFICITY_D = 1;\n /**\n * Specificity weight for element name selectors.\n */\n static final int SPECIFICITY_C = 100 * SPECIFICITY_D;\n /**\n * Specificity weight for id selectors.\... | import android.graphics.Paint;
import android.graphics.Typeface;
import android.view.View;
import org.kobjects.nativehtml.css.Css;
import org.kobjects.nativehtml.css.CssEnum;
import org.kobjects.nativehtml.css.CssProperty;
import org.kobjects.nativehtml.css.CssStyleDeclaration;
import org.kobjects.nativehtml.css.CssUni... | package org.kobjects.nativehtml.android;
class AndroidCss {
static final int PAINT_MASK = ~(Paint.STRIKE_THRU_TEXT_FLAG | Paint.UNDERLINE_TEXT_FLAG);
static int getTextStyle(CssStyleDeclaration style) {
int flags = 0; | if (style.get(CssProperty.FONT_WEIGHT, CssUnit.NUMBER) > 600) { | 4 |
quartzweb/quartz-web | src/main/java/com/github/quartzweb/service/strategy/TriggerServiceStrategy.java | [
"public class QuartzWebManager {\n\n private final static QuartzWebManager instance = new QuartzWebManager();\n\n private QuartzWebManager() {\n }\n\n public static QuartzWebManager getInstance() {\n return instance;\n }\n\n private static QuartzManager quartzManager = QuartzManager.getInst... | import com.github.quartzweb.manager.web.QuartzWebManager;
import com.github.quartzweb.manager.web.TriggerInfo;
import com.github.quartzweb.service.JSONResult;
import com.github.quartzweb.service.QuartzWebURL;
import com.github.quartzweb.utils.Assert;
import com.github.quartzweb.utils.StringUtils;
import org.quartz.Cron... | /**
* Licensed under the Apache License, Version 2.0 (the "License");
*/
package com.github.quartzweb.service.strategy;
/**
* @author quxiucheng [quxiuchengdev@gmail.com]
*/
public class TriggerServiceStrategy implements ServiceStrategy<TriggerServiceStrategyParameter> {
@Override | public JSONResult service(ServiceStrategyURL serviceStrategyURL, TriggerServiceStrategyParameter parameter) { | 2 |
teivah/TIBreview | src/test/java/com/tibco/exchange/tibreview/processor/resourcerule/CProcessorRendezvousResourceCertifiedTest.java | [
"public class TIBResource {\n\tprivate String filePath;\n\tprivate String type;\n\t\n\tprivate static final String REQUEST_GET_TYPE = \"/jndi:namedResource/@type\";\n\t\n\tpublic TIBResource(String filePath) throws Exception {\n\t\tthis.filePath = filePath;\n\t\tthis.type = Util.xpathEval(filePath, Constants.RESOUR... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.log4j.Logger;
import org.junit.Test;
import com.tibco.exchange.tibreview.common.TIBResource;
import com.tibco.exchange.tibreview.engine.Context;
import com.tibco.exchange.tibreview.mod... | package com.tibco.exchange.tibreview.processor.resourcerule;
public class CProcessorRendezvousResourceCertifiedTest {
private static final Logger LOGGER = Logger.getLogger(CProcessorRendezvousResourceCertifiedTest.class);
@Test
public void testCProcessorRendezvousResourceCertifiedTest() {
TIBResou... | Tibrules tibrules= RulesParser.getInstance().parseFile("src/test/resources/FileResources/xml/RendezvousResourceCertified.xml");
| 6 |
hecoding/Pac-Man | src/pacman/game/Game.java | [
"public enum DM {PATH, EUCLID, MANHATTAN};",
"public enum GHOST\n{\n\tBLINKY(40),\n\tPINKY(60),\n\tINKY(80),\n\tSUE(100);\n\t\t\n\tpublic final int initialLairTime;\n\t\t\n\tGHOST(int lairTime)\n\t{\n\t\tthis.initialLairTime=lairTime;\n\t}\n};",
"public enum MOVE \n{\n\tUP {\n\t\tpublic MOVE opposite() {\n\t\t\... | import java.util.BitSet;
import java.util.EnumMap;
import java.util.Random;
import java.util.Map.Entry;
import pacman.game.Constants.DM;
import pacman.game.Constants.GHOST;
import pacman.game.Constants.MOVE;
import pacman.game.internal.Ghost;
import pacman.game.internal.Maze;
import pacman.game.internal.Node;
import pa... | package pacman.game;
/**
* The implementation of Ms Pac-Man. This class contains the game engine and all methods required to
* query the state of the game. First, the mazes are loaded once only as they are immutable. The game
* then proceeds to initialise all variables using default values. The game class also pr... | private GameInfo gi; | 6 |
tim-group/karg | src/test/java/com/timgroup/karg/examples/BuilderExample.java | [
"public interface KeywordFunction<T> extends Function<KeywordArguments, T> { }",
"public interface Keyword<T> extends KeywordArgumentsLens<T> {\n\n KeywordArguments metadata();\n KeywordArgument of(T value);\n T from(KeywordArguments keywordArguments);\n T from(KeywordArguments keywordArguments, T def... | import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import java.awt.Point;
import org.junit.Test;
import com.timgroup.karg.functions.KeywordFunction;
import com.timgroup.karg.keywords.Keyword;
import com.timgroup.karg.keywords.KeywordArgument;
import com.timgroup.karg.keywords.K... | package com.timgroup.karg.examples;
public class BuilderExample {
public static class Line {
public static interface LineMaker {
Line to(Point end);
}
public static LineMaker from(final Point start) {
return new LineMaker() {
@Overri... | public static Line a_line_with(KeywordArgument...args) { | 2 |
kaarelk/r4j | restful-r4j/tests/src/org/r4j/rest/cluster/conf/ClusterTest.java | [
"public class Raft {\r\n\r\n\t\r\n\tprivate Logger logger = LoggerFactory.getLogger(getClass());\r\n\r\n\tprivate List<ClusterMember> members = new ArrayList<ClusterMember>();\r\n\r\n\tprivate Role role = Role.FOLLOWER;\r\n\t\r\n\tprivate Term term = new Term();\r\n\r\n\tprivate Log log = new LogImpl(term);\r\n\t\r... | import java.util.ArrayList;
import java.util.List;
import org.r4j.Raft;
import org.r4j.Role;
import org.r4j.protocol.ClientRequest;
import org.r4j.protocol.MessageChannel;
import org.r4j.rest.cluster.Get;
import org.r4j.rest.cluster.Put;
import org.r4j.rest.cluster.Server;
import org.slf4j.Logger;
import org.... | package org.r4j.rest.cluster.conf;
public class ClusterTest {
private Logger logger;
@Test
public void test() throws InterruptedException {
logger = LoggerFactory.getLogger(getClass());
| List<Server> list = new ArrayList<>();
| 6 |
zeevy/grblcontroller | app/src/main/java/in/co/gorest/grblcontroller/ui/ConsoleTabFragment.java | [
"public class IconButton extends Button implements HasOnViewAttachListener {\n\n private HasOnViewAttachListenerDelegate delegate;\n\n public IconButton(Context context) {\n super(context);\n init();\n }\n\n public IconButton(Context context, AttributeSet attrs) {\n super(context, a... | import android.app.AlertDialog;
import android.content.DialogInterface;
import androidx.databinding.DataBindingUtil;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.appcompat.widget.S... | /*
* /**
* * Copyright (C) 2017 Grbl Controller Contributors
* *
* * 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... | GcodeCommand gcodeCommand = new GcodeCommand(commandText); | 7 |
dariober/ASCIIGenome | src/main/java/tracks/TrackWiggles.java | [
"public class Config {\n\t\n\t// C O N S T R U C T O R \n\t\n\tprivate static final Map<ConfigKey, String> config= new HashMap<ConfigKey, String>();\n\n\tpublic Config(String source) throws IOException, InvalidConfigException {\n\t\t\n\t\tnew Xterm256();\n\t\t\n\t\tString RawConfigFile= Config.getConfigFileAsString... | import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.broad.igv.bbfile.BBFileReader;
import org.broad.igv.bbfile.BigWigIterator;
imp... | package tracks;
/** Process wiggle file formats. Mostly using IGV classes.
* bigBed, bigWig, */
public class TrackWiggles extends Track {
// private double scorePerDot;
private List<ScreenWiggleLocusInfo> screenWiggleLocusInfoList;
protected int bdgDataColIdx= 4;
private BBFileReader bigWigReader;
/* C ... | this.setTrackFormat(Utils.getFileTypeFromName(this.getWorkFilename())); | 7 |
socoolby/CoolClock | app/src/main/java/clock/socoolby/com/clock/ClockApplication.java | [
"public class BusinessService {\n private final static String TAG = BusinessService.class.getSimpleName();\n\n public void getWeather(String city) {\n if (!(city != null && !city.isEmpty()))\n return;\n WeatherRequest request = new WeatherRequest();\n request.setmCity(city);\n ... | import android.app.Application;
import android.content.Context;
import android.os.Environment;
import java.io.File;
import clock.socoolby.com.clock.protocol.BusinessService;
import clock.socoolby.com.clock.utils.Constants;
import clock.socoolby.com.clock.utils.DateModel;
import clock.socoolby.com.clock.utils.FileUtils;... | package clock.socoolby.com.clock;
public class ClockApplication extends Application {
private static ClockApplication sEndzoneBoxApp;
private BusinessService mBusinessService = new BusinessService();
public static ClockApplication getInstance() {
return sEndzoneBoxApp;
}
@Override
... | DateModel startTimeModel = new DateModel(); | 2 |
USC-SQL/Violist | src/usc/sql/string/JavaAndroidWiden.java | [
"public class ConstantString extends Variable{\n\n\tString value;\n\tpublic ConstantString(String value)\n\t{\n\t\tthis.value = value;\n\t}\n\t@Override\n\tpublic String getValue() {\n\t\treturn replaceLast(value.replaceFirst(\"\\\"\", \"\"),\"\\\"\",\"\");\n\t}\n\t@Override\n\tpublic String toString()\n\t{\n\t\tre... | import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import j... | }
}
}
}
private Set<Variable> replaceExternal(Set<Variable> IRs,String signature,Map<String,Set<NodeInterface>> paraMap,Map<String,Translator> tMap,AndroidApp App)
{
Set<Variable> vSet = new HashSet<>();
for(Variable v: IRs)
{
if(paraMap.get(signature)==null)
vSet.add(v);
else
{
... | returnSet.add( new ConstantString(para)); | 0 |
IPEldorado/RemoteResources | src/com/eldorado/remoteresources/ui/DeviceConfigurationDialog.java | [
"public abstract class IConnectionConstants {\n\n\tpublic static final int CONTROL_SERVER_DEFAULT_PORT = 54321;\n\n\tpublic static final long DEFAULT_FRAME_DELAY = 500;\n\n\tpublic static final int DEFAULT_IMAGE_QUALITY = 50;\n\n\tpublic static final Map<String, String> pollingRates = new LinkedHashMap<String, Stri... | import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
i... | /*
* (C) Copyright 2014 Instituto de Pesquisas Eldorado (http://www.eldorado.org.br/).
*
* This file is part of the software Remote Resources
*
* All rights reserved. This file and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License
* (LGPL) version 3.0 which ... | private final PersistentDeviceModel model; | 4 |
zaproxy/zaproxy | zap/src/main/java/org/zaproxy/zap/extension/pscan/PassiveScanThread.java | [
"public class Control extends AbstractControl implements SessionListener {\n\n public enum Mode {\n safe,\n protect,\n standard,\n attack\n }\n\n private static Logger log = LogManager.getLogger(Control.class);\n\n private static Control control = null;\n private MenuFileC... | import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import net.htmlparser.jericho.MasonTagTypes;
import net.htmlparser.jericho.MicrosoftConditionalCommentTagTypes;
import net.htmlparser.jericho.PHPTagTypes;
import net.htmlparser.jericho.Source;
i... | msg.getRequestHeader().getURI(),
msg.getResponseBody().length(),
maxBodySize);
}
... | public void raiseAlert(int id, Alert alert) { | 2 |
codlab/amiibo | app/src/main/java/eu/codlab/amiiwrite/ui/my_list/fragments/MyAmiiboFromCategory.java | [
"public class AmiiboFactory {\n private static AmiiboCache _amiibo_cache = new AmiiboCache();\n private static AmiiboDescriptorCache _amiibo_descriptor_cache = new AmiiboDescriptorCache();\n\n @NonNull\n public static AmiiboCache getAmiiboCache() {\n return _amiibo_cache;\n }\n\n @NonNull\n... | import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
import de.greenrobot.event.EventBus;
import eu.codlab.amiiwrite.database.controllers.AmiiboFactory;
import eu.codlab.amiiwrite.database.models.Amiibo;
import eu.codlab.amiiwrite.ui.my_list.EventMyList;
import eu.codlab.amiiwrite.ui.my_list.ada... | package eu.codlab.amiiwrite.ui.my_list.fragments;
/**
* Show all amiibo in a specific category
* <p/>
* For instance, shows all your Classic Mario dumps
*/
public class MyAmiiboFromCategory extends AbstractMyAmiiboFragment<Amiibo> {
private final static String AMIIBO_IDENTIFIER = "AMIIBO_IDENTIFIER";
... | EventBus.getDefault().post(new EventMyList.EventLoadAmiibo(item.data)); | 2 |
jmcampanini/gexf4j-core | src/test/java/com/ojn/gexf4j/core/GraphWriterTest.java | [
"public class BasicGraphBuilder extends GexfBuilder {\n\t\n\t@Override\n\tpublic String getSuffix() {\n\t\treturn \"basic\";\n\t}\n\t\n\t@Override\n\tpublic Gexf buildGexf() {\n\t\tGexf gexf = new GexfImpl();\n\t\tGraph g = gexf.getGraph();\n\t\t\n\t\tNode hello = g.createNode(\"0\")\n\t\t\t.setLabel(\"Hello\");\n\... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import javax.xml.XMLConstants;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml... | package com.ojn.gexf4j.core;
@RunWith(Parameterized.class)
public abstract class GraphWriterTest {
protected abstract String getFileNamePrefix();
protected abstract GexfWriter newGraphWriter();
| protected GexfBuilder builder = null; | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.