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 |
|---|---|---|---|---|---|---|
mmonkey/Destinations | src/main/java/com/github/mmonkey/destinations/commands/ListWarpsCommand.java | [
"@Entity\n@DynamicUpdate\n@Table(name = \"access\", uniqueConstraints = {\n @UniqueConstraint(columnNames = \"access_id\")\n})\npublic class AccessEntity implements Serializable {\n\n private static final long serialVersionUID = -6492016883124144444L;\n\n @Id\n @Column(name = \"access_id\", unique =... | import com.github.mmonkey.destinations.entities.AccessEntity;
import com.github.mmonkey.destinations.entities.PlayerEntity;
import com.github.mmonkey.destinations.entities.WarpEntity;
import com.github.mmonkey.destinations.persistence.cache.PlayerCache;
import com.github.mmonkey.destinations.utilities.FormatUtil;
impor... | package com.github.mmonkey.destinations.commands;
public class ListWarpsCommand implements CommandExecutor {
public static final String[] ALIASES = {"warps", "listwarps"};
/**
* Get the Command Specifications for this command
*
* @return CommandSpec
*/
public static CommandSpec getC... | PlayerEntity playerEntity = PlayerCache.instance.get(player); | 3 |
edmocosta/queryfy | queryfy-core/src/test/java/org/evcode/queryfy/core/QueryStructureTest.java | [
"public enum OrderOperatorType implements Operator {\n ASC,\n DESC\n}",
"public class QueryParser extends BaseParser<Object> {\n\n final ParserConfig config;\n\n public QueryParser() {\n this.config = ParserConfig.DEFAULT;\n }\n\n public QueryParser(ParserConfig config) {\n this.co... | import java.util.Collections;
import java.util.List;
import org.evcode.queryfy.core.operator.OrderOperatorType;
import org.evcode.queryfy.core.parser.QueryParser;
import org.evcode.queryfy.core.parser.ast.FilterNode;
import org.evcode.queryfy.core.parser.ast.LimitNode;
import org.evcode.queryfy.core.parser.ast.OrderNod... | /*
* Copyright 2017 EVCode
*
* 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 wr... | Arrays.asList(new OrderNode.OrderSpecifier("one", OrderOperatorType.ASC)), | 4 |
isel-leic-mpd/mpd-2017-i41d | aula34-weather-webapp/src/main/java/weather/app/WeatherWebApp.java | [
"public class HttpRequest implements IRequest {\n @Override\n public Iterable<String> getContent(String path) {\n List<String> res = new ArrayList<>();\n try (InputStream in = new URL(path).openStream()) {\n /*\n * Consumir o Inputstream e adicionar dados ao res\n ... | import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.ServletHolder;
import util.HttpRequest;
import util.HttpServer;
import weather.WeatherService;
import weather.WeatherServiceCache;
import weather.controllers.WeatherController;
import weather.data.WeatherWebApi;
import static java.lang.Cl... | /*
* Copyright (c) 2017, Miguel Gamboa
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is dis... | WeatherService service = new WeatherServiceCache(new WeatherWebApi(http)); | 2 |
Nanopublication/nanopub-java | src/main/java/org/nanopub/extra/server/FetchIndexFromDb.java | [
"public class MalformedNanopubException extends Exception {\n\n\tprivate static final long serialVersionUID = -1022546557206977739L;\n\n\tpublic MalformedNanopubException(String message) {\n\t\tsuper(message);\n\t}\n\n}",
"public interface Nanopub {\n\n\t// URIs in the nanopub namespace:\n\tpublic static final IR... | import java.io.OutputStream;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.RDFHandlerException;
import org.nanopub.MalformedNanopubException;
import org.nanopub.Nanopub;
import org.nanopub.NanopubUtils;
import org.nanopub.extra.index.IndexUtils;
import org.nano... | package org.nanopub.extra.server;
public class FetchIndexFromDb extends FetchIndex {
public static final int maxParallelRequestsPerServer = 5;
private String indexUri;
private NanopubDb db;
private OutputStream out;
private RDFFormat format;
private boolean writeIndex, writeContent;
private int nanopubCount... | NanopubUtils.writeToStream(np, out, format); | 2 |
52North/geoar-app | src/main/java/org/n52/geoar/ar/view/ARFragment.java | [
"public class CheckList<T> extends ArrayList<T> {\r\n\r\n\tpublic interface OnCheckedChangedListener<T> {\r\n\t\tvoid onCheckedChanged(T item, boolean newState);\r\n\t}\r\n\r\n\tpublic interface OnItemChangedListener<T> {\r\n\t\tvoid onItemAdded(T item);\r\n\r\n\t\tvoid onItemRemoved(T item);\r\n\t}\r\n\r\n\tpublic... | import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.actionbarsherlock.app.SherlockFragment;
import java.util.HashMap;
import java.util.Map;
import org.n52.geoar.utils.GeoLocation;
import org.n52.geoar.R;
import org.n52.geoar.newdata... | /**
* Copyright 2012 52°North Initiative for Geospatial Open Source Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2... | private Map<DataSourceInstanceHolder, DataSourceVisualizationHandler> mVisualizationHandlerMap = new HashMap<DataSourceInstanceHolder, DataSourceVisualizationHandler>();
| 2 |
bingyulei007/bingexcel | excel/src/test/java/com/chinamobile/excel/ReadTest3.java | [
"public class AbstractFieldConvertor implements FieldValueConverter {\n\n\t@Override\n\tpublic boolean canConvert(Class<?> clz) {\n\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic OutValue toObject(Object source, ConverterHandler converterHandler) {\n\t\tif(source==null){\n\t\t\treturn null;\n\t\t}\n\t\treturn new... | import java.io.File;
import java.lang.reflect.Type;
import java.net.URISyntaxException;
import java.net.URL;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.junit.Test;
import com.bing.excel.annotat... | package com.chinamobile.excel;
public class ReadTest3 {
@Test
public void readExcelTest() throws URISyntaxException {
// InputStream in = Person.class.getResourceAsStream("/person.xlsx");
URL url = Salary.class.getResource("/salary.xlsx");
File f = new File(url.toURI());
BingExcel bing = BingExcelBuild... | public Object fromString(String cell, ConverterHandler converterHandler,Type type) { | 4 |
rodolfodpk/myeslib | myeslib-jdbi/src/test/java/org/myeslib/jdbi/storage/JdbiUnitOfWorkJournalTest.java | [
"public interface Command extends Serializable {\n\t\n UUID getCommandId();\n\tLong getTargetVersion();\n\t\n}",
"public interface Event extends Serializable {\n\t\n}",
"@SuppressWarnings(\"serial\")\n@Value\npublic class UnitOfWork implements Comparable<UnitOfWork>, Serializable {\n\n final UUID id;\n\tf... | import static org.mockito.Mockito.verify;
import java.util.Arrays;
import java.util.UUID;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.myeslib.core.Command;
import org.myeslib.core.Event;
import org.myeslib.core.data.UnitOfWor... | package org.myeslib.jdbi.storage;
@RunWith(MockitoJUnitRunner.class)
public class JdbiUnitOfWorkJournalTest {
@Mock
UnitOfWorkJournalDao<UUID> dao;
@Test
public void insert() {
JdbiUnitOfWorkJournal<UUID> writer = new JdbiUnitOfWorkJournal<>(dao);
UUID id = UUID.randomUUID();
| Command command1 = new IncreaseInventory(UUID.randomUUID(), id, 2, 0l); | 0 |
skuzzle/restrict-imports-enforcer-rule | src/main/java/org/apache/maven/plugins/enforcer/RestrictImports.java | [
"public static void checkArgument(boolean condition) {\n checkArgument(condition, \"Unexpected argument\");\n}",
"public final class AnalyzeResult {\n\n private final List<MatchedFile> srcMatches;\n private final List<MatchedFile> testMatches;\n private final Duration duration;\n private final int ... | import static de.skuzzle.enforcer.restrictimports.util.Preconditions.checkArgument;
import java.io.File;
import java.nio.charset.Charset;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.... | package org.apache.maven.plugins.enforcer;
/**
* Enforcer rule which restricts the usage of certain packages or classes within a Java
* code base.
*/
public class RestrictImports extends BannedImportGroupDefinition implements EnforcerRule, EnforcerRule2 {
private static final Logger LOGGER = LoggerFactory.... | final AnalyzerSettings analyzerSettings = createAnalyzerSettingsFromPluginConfiguration(helper, project); | 2 |
danijel3/KaldiJava | src/main/java/pl/edu/pjwstk/kaldi/service/tasks/KeywordSpottingTask.java | [
"public class TextGrid extends Segmentation {\n\n\tpublic TextGrid() {\n\n\t}\n\n\tpublic TextGrid(Segmentation segmentation) {\n\t\tthis.tiers = segmentation.tiers;\n\t}\n\n\tprivate String readUntil(BufferedReader reader, String prefix) throws IOException, RuntimeException {\n\t\tString line;\n\t\twhile ((line = ... | import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.security.MessageDigest;
import java.util.Vector;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import org.w3c.dom.Element;
import pl.edu.pjwstk.kaldi.files.Tex... | package pl.edu.pjwstk.kaldi.service.tasks;
public class KeywordSpottingTask extends Task {
private File input_keywords;
private File words_table;
@Override
public void run() {
state = State.RUNNING;
try {
File lattice = new File(Settings.curr_task_dir, "aligned_lattice");
File lattice_int = new F... | KaldiUtils.lattice_copy("ark", lattice, "ark,t", lattice_int, true); | 2 |
GeneFeng/CircView | src/cn/edu/whu/ui/ComparisonFrame.java | [
"public class CircRna implements Serializable {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t/**\n\t * circRNA ID\n\t */\n\tprivate String circRnaID;\n\n\t/**\n\t * Chromosome name\n\t */\n\tprivate String chrom;\n\n\t/**\n\t * circRNA start point;\n\t */\n\tprivate long startPoint;\n\n\t/**\n\t * cir... | import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;... | }
}
unSelected.addElement(slct);
jlUnSelected.removeAll();
jlSelected.removeAll();
jlUnSelected.setListData(unSelected);
jlSelected.setListData(selected);
}
}
public void mousePressed(MouseEvent e) {
}
public void mouseReleased(MouseEvent e) {
}
public void m... | TreeMap<String, CircRna> circRnas = gt.getCircRnas(); | 0 |
TheCookieLab/poloniex-api-java | src/test/java/com/cf/data/map/poloniex/PoloniexDataMapperTest.java | [
"public class PoloniexChartData {\n\n public final ZonedDateTime date;\n public final BigDecimal high;\n public final BigDecimal low;\n public final BigDecimal open;\n public final BigDecimal close;\n public final BigDecimal volume;\n public final BigDecimal quoteVolume;\n public final BigDe... | import com.cf.data.model.poloniex.PoloniexChartData;
import com.cf.data.model.poloniex.PoloniexFeeInfo;
import com.cf.data.model.poloniex.PoloniexOpenOrder;
import com.cf.data.model.poloniex.PoloniexOrderResult;
import com.cf.data.model.poloniex.PoloniexTradeHistory;
import com.cf.data.model.poloniex.PoloniexOrderTrade... | package com.cf.data.map.poloniex;
/**
*
* @author David
*/
public class PoloniexDataMapperTest {
private final PoloniexDataMapper mapper = new PoloniexDataMapper();
@Test
public void mapValidPoloniexChartData() {
String results = "[{\"date\":1512777600,\"high\":487.0422141,\"low\":436.6987279... | List<PoloniexChartData> chartDataList = mapper.mapChartData(results); | 0 |
dmillett/prank | src/test/java/net/prank/example/ExampleScoreCard.java | [
"public class Indices\n implements Serializable {\n\n private static final long serialVersionUID = 42L;\n /** A collection of indices for any object that is subject to multiple sorts */\n private final List<Integer> _indices;\n\n public Indices(int originalIndex) {\n _indices = new ArrayList<>... | import net.prank.core.Indices;
import net.prank.core.RequestOptions;
import net.prank.core.Result;
import net.prank.core.ScoreCard;
import net.prank.core.ScoreData;
import net.prank.core.ScoreSummary;
import net.prank.core.Statistics;
import java.math.BigDecimal; | package net.prank.example;
/**
* A very simple example of a setupScoring card. More complex examples should still be stateless for
* thread safety. Typically, the higher the setupScoring, the better the result.
* <p/>
* The adjustments are just examples of how scoring might be adjusted to make some
* setupScori... | ScoreData.Builder scoreBuilder = new ScoreData.Builder(); | 4 |
leobm/teavm-jquery | core/src/main/java/de/iterable/teavm/jquery/ajax/JQueryAjaxSettingsObject.java | [
"@JSFunctor\npublic interface AjaxBeforeSendHandler extends JSObject {\n void onBeforeSend(JQueryXHR jqXHR, JQueryAjaxSettingsObject settings);\n}",
"@JSFunctor\npublic interface AjaxCompleteHandler extends JSObject {\n\t\n\tvoid onComplete(JQueryXHR jqXHR, String textStatus);\n\n}",
"@JSFunctor\npublic inte... | import org.teavm.jso.JSBody;
import org.teavm.jso.JSObject;
import org.teavm.jso.JSProperty;
import org.teavm.jso.core.JSArray;
import org.teavm.jso.core.JSString;
import de.iterable.teavm.jquery.ajax.handler.AjaxBeforeSendHandler;
import de.iterable.teavm.jquery.ajax.handler.AjaxCompleteHandler;
import de.iterable.tea... | /*
* Copyright 2015 Jan-Felix Wittmann.
*
* 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 la... | public abstract void setBeforeSendHandler(AjaxBeforeSendHandler handler); | 0 |
curtisullerich/attendance | src/main/java/edu/iastate/music/marching/attendance/servlets/AuthServlet.java | [
"public class Lang {\n\n\tpublic static final String ERROR_MESSAGE_NO_DIRECTOR = \"There is no director registered. You cannot register for an account yet.\";\n\tpublic static final String ERROR_INVALID_PRIMARY_REGISTER_EMAIL= \"Not a valid email, try logging in with your student account\";\n\tpublic static final ... | import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.serv... | package edu.iastate.music.marching.attendance.servlets;
public class AuthServlet extends AbstractBaseServlet {
private enum Page {
index, login, login_callback, logout, welcome, register, register_post, login_fail;
}
private static final long serialVersionUID = -4587683490944456397L;
private static final ... | if (null != request.getParameter(PageBuilder.PARAM_REDIRECT_URL)) | 5 |
xcsp3team/XCSP3-Java-Tools | src/main/java/org/xcsp/parser/entries/XVariables.java | [
"public static enum TypeVar {\n\tinteger, symbolic, real, stochastic, symbolic_stochastic, set, symbolic_set, undirected_graph, directed_graph, point, interval, region;\n\n\t/** Returns true if the constant corresponds to integer, symbolic, real or (symbolic) stochastic. */\n\tpublic boolean isBasic() {\n\t\treturn... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.LongStream;
import java.util.stream.Stream;
import org.xcsp.common.IVar;
import org.xcsp.common.IVar.Var;
import org.xcsp.common.IVar.VarSymbolic;
import org.xcsp.common.Types.TypeVar;
import org.xcsp.common.Utilities;
i... | /*
* Copyright (c) 2016 XCSP3 Team (contact@xcsp.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use, copy, modify, m... | t[i] = tok.length() == 0 ? new IntegerInterval(0, size[i] - 1) : IntegerEntity.parse(tok); | 5 |
NICTA/nicta-ner | nicta-ner/src/main/java/org/t3as/ner/classifier/feature/ExistingCleanPhraseFeature.java | [
"public class Phrase {\n // TODO: getters and setters for these\n /** phrase text array */\n public final List<Token> phrase;\n /** corresponding name type */\n public EntityClass phraseType;\n /** the start position of the phase in a sentence */\n public final int phrasePosition;\n /** the ... | import java.util.List;
import java.util.Set;
import static org.t3as.ner.util.Strings.clean;
import static org.t3as.ner.util.Strings.toEngLowerCase;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableSet;
import org.t3as.ner.Phrase;
import org.t3as.ner.util.IO;
import org.t3a... | /*
* #%L
* NICTA t3as Named-Entity Recognition library
* %%
* Copyright (C) 2010 - 2014 NICTA
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or ... | final String phrase = Strings.simplify(p.phraseString()); | 2 |
wutongke/AndroidSkinAnimator | skin-app/src/main/java/com/ximsfei/dynamicskindemo/widget/CustomCircleImageView.java | [
"public class SkinCompatResources {\n private static volatile SkinCompatResources sInstance;\n private final Context mAppContext;\n private Resources mResources;\n private String mSkinPkgName;\n private boolean isDefaultSkin;\n\n private SkinCompatResources(Context context) {\n mAppContext ... | import android.content.Context;
import android.content.res.TypedArray;
import android.support.annotation.ColorRes;
import android.support.annotation.DrawableRes;
import android.util.AttributeSet;
import com.ximsfei.dynamicskindemo.R;
import skin.support.content.res.SkinCompatResources;
import skin.support.widget.SkinCo... | package com.ximsfei.dynamicskindemo.widget;
/**
* Created by ximsfei on 2017/1/17.
*/
public class CustomCircleImageView extends CircleImageView implements SkinCompatSupportable {
private final SkinCompatImageHelper mImageHelper;
private int mFillColorResId = INVALID_ID;
private int mBorderColorResI... | int color = SkinCompatResources.getInstance().getColor(mBorderColorResId); | 0 |
sumeetchhetri/gatf | alldep-jar/src/main/java/com/gatf/selenium/SeleniumTest.java | [
"public class AcceptanceTestContext {\r\n\r\n\tprivate Logger logger = Logger.getLogger(AcceptanceTestContext.class.getSimpleName());\r\n\t\r\n\tpublic final static String\r\n\t PROP_SOAP_ACTION_11 = \"SOAPAction\",\r\n\t PROP_SOAP_ACTION_12 = \"action=\",\r\n\t PROP_CONTENT_TYPE = \"Content-Type\",\r\n\t ... | import java.awt.AWTException;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.net.URL;
import java.nio.charset.Charset;
import ... | return null;
} else {
Map<String, String> _mt = ___cxt___.getWorkflowContextHandler().getGlobalSuiteAndTestLevelParameters(null, null, index);
return _mt.get(key);
}
}
protected Object getProviderDataValueO(String key, boolean isVar) {
if(isVar) {
return ___get_var__(key);
}
if(getSe... | System.out.println(WorkflowContextHandler.OM.writerWithDefaultPrettyPrinter().writeValueAsString(getAllProviderData(getPn(name))));
| 2 |
nichbar/Aequorea | app/src/main/java/nich/work/aequorea/ui/activitiy/TagActivity.java | [
"public class Constants {\n public static final String AUTHOR = \"author\";\n public static final String TAG = \"tag\";\n public static final String ARTICLE_ID = \"article_id\";\n public static final String AUTHOR_ID = \"author_id\";\n public static final String TAG_ID = \"tag_id\";\n public stati... | import android.graphics.drawable.Drawable;
import androidx.recyclerview.widget.LinearLayoutManager;
import android.view.View;
import butterknife.ButterKnife;
import nich.work.aequorea.R;
import nich.work.aequorea.common.Constants;
import nich.work.aequorea.common.utils.DisplayUtils;
import nich.work.aequorea.common.uti... | package nich.work.aequorea.ui.activitiy;
public class TagActivity extends SimpleArticleListActivity {
@Override
protected int getContentViewId() {
return R.layout.activity_tag;
}
@Override
protected void initModel() {
mModel = new SimpleArticleListModel();
mModel.setI... | int primaryColor = ThemeHelper.getResourceColor(this, R.attr.colorPrimary); | 2 |
beckchr/juel | modules/impl/src/main/java/de/odysseus/el/util/SimpleResolver.java | [
"public class ArrayELResolver extends ELResolver {\r\n\tprivate final boolean readOnly;\r\n\r\n\t/**\r\n\t * Creates a new read/write ArrayELResolver.\r\n\t */\r\n\tpublic ArrayELResolver() {\r\n\t\tthis(false);\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new ArrayELResolver whose read-only status is determined by the gi... | import java.beans.FeatureDescriptor;
import java.util.Iterator;
import javax.el.ArrayELResolver;
import javax.el.BeanELResolver;
import javax.el.CompositeELResolver;
import javax.el.ELContext;
import javax.el.ELResolver;
import javax.el.ListELResolver;
import javax.el.MapELResolver;
import javax.el.ResourceBun... | /*
* Copyright 2006-2009 Odysseus Software GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | add(new ResourceBundleELResolver());
| 6 |
ardeleanasm/quantum_computing | quantumapp/src/main/java/com/ars/algorithms/grover/GroversAlgorithm.java | [
"public class MeasurementPerformer {\r\n\tprivate Qubit resultQubit = null;\r\n\tprivate int length;\r\n\tprivate static final double Q_TOLERANCE = 0.1e-5;\r\n\r\n\tpublic MeasurementPerformer() {\r\n\r\n\t}\r\n\r\n\tpublic MeasurementPerformer configure(Qubit resultQubit) {\r\n\t\tthis.resultQubit = resultQubit;\r... | import com.ars.algorithms.MeasurementPerformer;
import com.ars.algorithms.QuantumAlgorithms;
import com.ars.gates.EGateTypes;
import com.ars.gates.IGate;
import com.ars.quantum.exception.RegisterOverflowException;
import com.ars.quantum.utils.QRegisterOperations;
import com.ars.quantum.utils.QuantumOperations;
i... | package com.ars.algorithms.grover;
public class GroversAlgorithm extends QuantumAlgorithms {
private static final int NO_OF_INPUT = 3;
private IGate gateH;
private IGate gateX;
private IGate gateCNot;
private IGate gateCPhaseShift;
public GroversAlgorithm() {
}
@Override
public voi... | QRegisterOperations qRegOps=QRegisterOperations.getInstance();
| 5 |
nchambers/probschemas | src/main/java/nate/probschemas/KeywordDetector.java | [
"public class IDFMap {\n// private HashMap<String,Integer> _wordToDocAppearances;\n// private HashMap<String,Integer> _wordToFrequencies;\n// private HashMap<String,Float> _wordToIDF;\n private Map<String,WordCounts> _wordToCounts;\n private int _numDocs = 0;\n private int _totalCorpusCount = 0;\n\n private ... | import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import edu.stanford.nlp.stats.ClassicCounter;
import edu.stanford.nlp.stats.Counter;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.trees.TypedDependency;
import nate.IDFMap;
import nate.ProcessedData;
import nate... | package nate.probschemas;
/**
* Code that reads a document(s) and gives you the top most important event words.
* This should be used for IR to find similar documents based on these keywords.
*
* This code is used by --KeywordTokenizer-- to process all of Gigaword and provide a short list
* of keywords to be ... | Map<Integer,String> particles = Ling.particlesInSentence(deps.get(sid++)); | 4 |
TranquilMarmot/spaceout | src/com/bitwaffle/spaceguts/util/console/ConsoleCommands.java | [
"public class Audio {\n\t/** Used for deleting all sound sources on shutdown (see {@link SoundSource}'s constructor, each SoundSource gets added to this when it's created */\n\tprotected static ArrayList<SoundSource> soundSources = new ArrayList<SoundSource>();\n\t\n\t/** Factor to use for doppler effect */\n\tpriv... | import java.util.StringTokenizer;
import javax.vecmath.Quat4f;
import org.lwjgl.util.vector.Quaternion;
import org.lwjgl.util.vector.Vector3f;
import com.bitwaffle.spaceguts.audio.Audio;
import com.bitwaffle.spaceguts.entities.DynamicEntity;
import com.bitwaffle.spaceguts.entities.Entities;
import com.bitwaffle.spacegu... | package com.bitwaffle.spaceguts.util.console;
/**
* All the possible console commands. These are called by the console by their name,
* so name a command however you want it to be referenced to in-game.
* Each command constructor takes in a command class that implements the inner Command interface.
* Many com... | System.out.printf("Changing player top speed from %f to %f\n", Entities.player.ship.getTopSpeed(), speedChange); | 2 |
dbuschman7/mongoFS | src/main/java/me/lightspeed7/mongofs/MongoFile.java | [
"public class MongoFileUrl {\n\n public static final String PROTOCOL = \"mongofile\";\n\n private URL url;\n\n // factories and helpers\n public static final MongoFileUrl construct(final ObjectId id, final String fileName, final String mediaType, final StorageFormat format)\n throws Malformed... | import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Date;
import java.util.List;
import java.util.zip.GZIPInputStream;
import me.lightspeed7.mongofs.url.MongoFileUrl;
impor... | package me.lightspeed7.mongofs;
/**
* Object to hold the state of the file's metatdata. To persist this outside of MongoFS, use the getURL() and persist that.
*
* @author David Buschman
*
*/
public class MongoFile implements InputFile {
private final Document surrogate;
private final MongoFileStor... | URL url = Parser.construct(getId(), getFilename(), getContentType(), this.format); | 1 |
konachan700/JNekoImageDB | src/main/java/ui/dialogs/windows/MainWindow.java | [
"public interface UseServices {\n\tInitService initService = new InitService();\n\n\tdefault <T> T getService(Class<T> clazz) {\n\t\tif (initService.getServices() == null || !initService.getServices().containsKey(clazz)) {\n\t\t\tthrow new IllegalStateException(\"Class \\\"\" + clazz + \"\\\" not found in list of s... | import javafx.event.ActionEvent;
import javafx.scene.layout.VBox;
import proto.UseServices;
import ui.StyleParser;
import ui.annotation.style.CssStyle;
import ui.annotation.style.HasStyledElements;
import ui.dialogs.activities.engine.ActivityHolder;
import ui.dialogs.activities.MainActivity;
import ui.dialogs.activitie... | package ui.dialogs.windows;
@HasStyledElements
public class MainWindow extends DefaultWindow implements UseServices {
private final ActivityHolder activityHolder = this.getActivityHolder();
private final MainActivity mainActivity = new MainActivity(activityHolder);
private final GlobalConfigUiEntity uiEntity = ne... | private final EditorActivity editorActivity = new EditorActivity(activityHolder, uiEntity, (a,b) -> { | 5 |
thom-nic/openfire-jboss-clustering | src/main/java/com/enernoc/rnd/openfire/cluster/session/ClusteredClientSession.java | [
"public class ClientSessionTask extends RemoteSessionTask {\r\n private JID address;\r\n\r\n public ClientSessionTask() {\r\n super();\r\n }\r\n\r\n public ClientSessionTask(JID address, Operation operation) {\r\n super(operation);\r\n this.address = address;\r\n }\r\n\r\n pro... | import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import org.dom4j.Element;
import org.dom4j.tree.DefaultElement;
import org.jivesoftware.openfire.SessionManager;
import org.jivesoftware.openfire.privacy.PrivacyList;
import org.jivesoftware.openfire.privacy.PrivacyListManager;
import ... | /**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* dist... | ClusterTask task = getRemoteSessionTask(RemoteSessionTask.Operation.isInitialized); | 3 |
SpongeBobSun/Prodigal | app/src/main/java/bob/sun/bender/view/WheelView.java | [
"public interface OnTickListener {\n public void onNextTick();\n public void onPreviousTick();\n public SelectionDetail getCurrentSelection();\n}",
"public class Theme {\n\n static private Theme defaultTheme;\n\n class Icons {\n @SerializedName(\"next\")\n public String icNext;\n ... | import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphi... | package bob.sun.bender.view;
/**
* Created by bob.sun on 2015/4/23.
*/
public class WheelView extends View {
private Point center;
private Path viewBound;
private int radiusOut,radiusIn;
private Paint paintOut, paintIn, ripplePaint;
private OnTickListener onTickListener;
private float sta... | private Theme theme; | 1 |
dkhmelenko/Varis-Android | app/src/main/java/com/khmelenko/lab/varis/repositories/RepositoriesPresenter.java | [
"public final class Constants {\n\n // denied constructor\n private Constants() {\n }\n\n /**\n * URL for open source projects\n */\n public static final String OPEN_SOURCE_TRAVIS_URL = \"https://api.travis-ci.org\";\n\n /**\n * URL for private projects\n */\n public static fina... | import com.khmelenko.lab.varis.common.Constants;
import com.khmelenko.lab.varis.mvp.MvpPresenter;
import com.khmelenko.lab.varis.network.response.Repo;
import com.khmelenko.lab.varis.network.response.User;
import com.khmelenko.lab.varis.network.retrofit.travis.TravisRestClient;
import com.khmelenko.lab.varis.storage.Ap... | package com.khmelenko.lab.varis.repositories;
/**
* Repositories presenter
*
* @author Dmytro Khmelenko (d.khmelenko@gmail.com)
*/
public class RepositoriesPresenter extends MvpPresenter<RepositoriesView> {
private final TravisRestClient mTravisRestClient; | private final CacheStorage mCache; | 5 |
mziccard/secureit | src/main/java/me/ziccard/secureit/async/upload/BluetoothPeriodicPositionUploaderTask.java | [
"public class SecureItPreferences {\n\t\n\tprivate SharedPreferences appSharedPrefs;\n private Editor prefsEditor;\n \n public static final String LOW = \"Low\";\n public static final String MEDIUM = \"Medium\";\n public static final String HIGH = \"High\";\n \n public static final String FRONT... | import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Date;
import me.ziccard.secureit.SecureItPreferences;
import me.ziccard.secureit.bluetooth.ObjectBluetoothSocket;
import me.ziccard.secureit.config.Remote;
import me.ziccard.secureit.messages.BluetoothMessa... | /*
* Copyright (c) 2013-2015 Marco Ziccardi, Luca Bonato
* Licensed under the MIT license.
*/
package me.ziccard.secureit.async.upload;
public class BluetoothPeriodicPositionUploaderTask extends AsyncTask<Void, Void, Void> {
private Context context;
/**
* Boolean true iff last thread iterations position... | BluetoothMessage message = builder.buildMessage(MessageType.HELLO); | 6 |
Fedict/dcattools | scrapers/src/main/java/be/fedict/dcat/scrapers/wiv/HtmlWIV.java | [
"public class Cache {\n private static final Logger logger = LoggerFactory.getLogger(Cache.class);\n \n private DB db = null;\n private static final String CACHE = \"cache\";\n private static final String URLS = \"urls\";\n private static final String PAGES = \"pages\";\n\n /**\n * Stor... | import be.fedict.dcat.scrapers.Cache;
import be.fedict.dcat.scrapers.Page;
import be.fedict.dcat.helpers.Storage;
import be.fedict.dcat.scrapers.Html;
import be.fedict.dcat.vocab.MDR_LANG;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.uti... | /*
* Copyright (c) 2020, FPS BOSA DG DT
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condit... | public void generateDcat(Cache cache, Storage store) | 0 |
D-3/BS808 | app/src/main/java/com/deew/bs808/MainActivity.java | [
"public class ClientConstants {\n\n public static final String PREF_FILE_NAME = \"client_preferences\";\n\n // Preference keys\n public static final String PREF_KEY_HOST = \"host\";\n public static final String PREF_KEY_PORT = \"port\";\n public static final String PREF_KEY_AUTH_CODE = \"auth_code\";... | import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.deew.jt808.ClientConstants;
import com.deew.jt808.ClientStateCallback;
import com.... | package com.deew.bs808;
public class MainActivity extends AppCompatActivity implements ClientStateCallback, View.OnClickListener{
private static final String TAG = LogUtils.makeTag(MainActivity.class);
private SharedPreferences mPrefs;
private String mHost;
private int mPo... | public void registerComplete(RegisterReply reply) { | 5 |
Catalysts/cat-boot | cat-boot-report-pdf/src/main/java/cc/catalysts/boot/report/pdf/PdfReportBuilder.java | [
"public class PdfPageLayout {\n\n private float width;\n private float height;\n private float marginLeft;\n private float marginRight;\n private float marginTop;\n private float marginBottom;\n private float lineDistance;\n private float header;\n private float footer;\n private Posit... | import cc.catalysts.boot.report.pdf.config.PdfPageLayout;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.elements.ReportElement;
import cc.catalysts.boot.report.pdf.utils.PdfFontContext;
import cc.catalysts.boot.report.pdf.utils.PositionOfStaticElements;
import org.apache.p... | package cc.catalysts.boot.report.pdf;
/**
* @author Klaus Lehner
*/
public interface PdfReportBuilder {
PdfReportBuilder addElement(ReportElement element);
PdfReportBuilder addHeading(String heading);
PdfReportBuilder addImage(Resource resource, float width, float height) throws IOException;
Pd... | PdfReport buildReport(String fileName, PdfPageLayout pageConfig, Resource templateResource) throws IOException; | 0 |
MinecraftForge/Srg2Source | src/test/java/net/minecraftforge/srg2source/test/SimpleTestBase.java | [
"public class RangeApplierBuilder {\n private PrintStream logStd = System.out;\n private PrintStream logErr = System.err;\n private List<InputSupplier> inputs = new ArrayList<>();\n private OutputSupplier output = null;\n private Consumer<RangeApplier> range = null;\n private List<Consumer<RangeAp... | import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URISyntaxException;
import java... | /*
* Srg2Source
* Copyright (c) 2020.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be u... | protected RangeApplierBuilder customize(RangeApplierBuilder builder) { return builder; }; | 0 |
kawasima/solr-jdbc | src/main/java/net/unit8/solr/jdbc/command/DeleteCommand.java | [
"public class Parameter implements Item {\n private static final String SQL_WILDCARD_CHARS = \"%_%_\";\n\n\tprivate SolrValue value;\n\tprivate int index;\n\tprivate boolean needsLikeEscape;\n\tprivate String likeEscapeChar = \"%\";\n\tprivate Expression targetColumn;\n\n\tpublic Parameter(int index) {\n\t\tthis... | import net.sf.jsqlparser.statement.delete.Delete;
import net.unit8.solr.jdbc.expression.Parameter;
import net.unit8.solr.jdbc.impl.AbstractResultSet;
import net.unit8.solr.jdbc.impl.DatabaseMetaDataImpl;
import net.unit8.solr.jdbc.message.DbException;
import net.unit8.solr.jdbc.message.ErrorCode;
import net.unit8.solr.... | package net.unit8.solr.jdbc.command;
public class DeleteCommand extends Command {
private transient final Delete delStmt;
private ConditionParser conditionParser;
public DeleteCommand(Delete stmt) {
this.parameters = new ArrayList<Parameter>();
this.delStmt = stmt;
}
@Override
public AbstractResultSet... | throw DbException.get(ErrorCode.METHOD_ONLY_ALLOWED_FOR_QUERY); | 4 |
johndavidbustard/RoughWorld | src/utils/shapes/skinned/Animate.java | [
"public class GeneralMatrixDouble implements Serializable\r\n{\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\tpublic static final double EPSILON=5.9e-8f;\r\n\tpublic int width; //columns\r\n\tpublic int height; //rows\r\n\tpublic double[] value; //array of values\r\n\r\n\tpublic static void main(St... | import utils.GeneralMatrixDouble;
import utils.GeneralMatrixFloat;
import utils.GeneralMatrixInt;
import utils.GeneralMatrixObject;
import utils.GeneralMatrixString;
import utils.Quaternion;
import utils.shapes.human.HumanBones; | float f0 = 1.0f-f1;
apos = pPose+f1;
if(f1==0.0f)
{
for(int li=0;li<lposes.width;li++)
{
lpos.value[li] = lposes.value[pPose*lposes.width+li];
}
}
else
{
for(int li=0;li<lposes.width;li++)
{
lpos.value[li] = lposes.value[pPose*lposes.width+li]*f0+lposes.value[nPose*lposes.width+li]... | public static void updateVposFromBmats(GeneralMatrixInt bones, | 2 |
OpenIchano/Viewer | src/com/zhongyun/viewer/MyViewerHelper.java | [
"public class CameraInfo {\n\n\tprivate long cid;\n\tprivate String cameraName;\n\tprivate String cameraUser;\n\tprivate String cameraPwd;\n\tprivate Bitmap cameraThumb;\n\tprivate boolean isOnline;\n\tprivate boolean pwdIsRight;\n\tprivate String os;\n\t\n\tpublic void setCid(long cid){\n\t\tthis.cid = cid;\n\t}\n... | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.util.Log;
import android.vi... | /*
* Copyright (C) 2015 iChano incorporation's Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless requ... | private static CameraInfoManager mCameraInfoManager; | 1 |
w-shackleton/droidpad-android | src/uk/digitalsquid/droidpad/layout/XmlDecoder.java | [
"public interface LogTag {\n\tstatic final String TAG = \"droidpad\";\n}",
"public class Button extends Item {\n\tprivate static final long serialVersionUID = -7921469580817352801L;\n\t\n\tpublic final String text;\n\tpublic final int textSize;\r\n\t\r\n\tprivate boolean resetButton;\r\n\t\n\tprotected boolean tm... | import java.io.IOException;
import java.io.Reader;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXExcepti... | /* This file is part of DroidPad.
*
* DroidPad 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.
*
* DroidPad is dist... | public static final ModeSpec decodeLayout(Reader stream) throws IOException {
| 3 |
berlinguyinca/spectra-hash | core/src/main/java/edu/ucdavis/fiehnlab/spectra/hash/core/impl/SplashVersion1.java | [
"public interface Spectrum {\n\n /**\n * ion of a spectra\n * @return\n */\n public List<Ion> getIons();\n\n /**\n * convmerts the spectrum to a relative spectra\n * @return\n * @param scale\n */\n Spectrum toRelative(int scale);\n\n /**\n *\n * @return\n */\n ... | import edu.ucdavis.fiehnlab.spectra.hash.core.Spectrum;
import edu.ucdavis.fiehnlab.spectra.hash.core.Splash;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashBlock;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashListener;
import edu.ucdavis.fiehnlab.spectra.hash.core.listener.SplashingEvent;
... | package edu.ucdavis.fiehnlab.spectra.hash.core.impl;
/**
* the reference implementation of the Spectral Hash Key
*/
public class SplashVersion1 implements Splash {
private static final int PREFILTER_BASE = 3;
private static final int PREFILTER_LENGTH = 10;
private static final int PREFILTER_BIN_SIZE = ... | protected void notifyListener(SplashingEvent e) { | 4 |
piyell/NeteaseCloudMusic | app/src/main/java/com/zsorg/neteasecloudmusic/activities/ConfigActivity.java | [
"public class ConfigAdapter extends RecyclerView.Adapter<ConfigHolder> implements OnItemCLickListener {\n\n private final LayoutInflater mInflater;\n private List<ConfigBean> mList;\n private OnItemCLickListener onItemCLickListener;\n\n public ConfigAdapter(LayoutInflater layoutInflater) {\n supe... | import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.View;
imp... | package com.zsorg.neteasecloudmusic.activities;
public class ConfigActivity extends AppCompatActivity implements View.OnClickListener, IConfigView {
@BindView(R.id.rv_config)
RecyclerView rvConfig;
private ConfigAdapter mAdapter;
private ConfigPresenter mPresenter;
@Override
protected voi... | rvConfig.addItemDecoration(LineItemDecorator.getInstance()); | 1 |
ykaragol/checkersmaster | CheckersMaster/test/checkers/algorithm/TestGreedyAlgorithm.java | [
"public class CalculationContext{\r\n\r\n\tprivate int depth;\r\n\tprivate Player player;\r\n\tprivate IEvaluation evaluationFunction;\r\n\tprivate ISuccessor successorFunction;\r\n\tprivate IAlgorithm algorithm;\r\n\r\n\r\n\tpublic void setDepth(int depth) {\r\n\t\tthis.depth = depth;\r\n\t}\r\n\r\n\tpublic int ge... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import checkers.domain.CalculationContext;
import checkers.domain.Model;
import checkers.domain.Move;
import checkers.domain.Playe... | package checkers.algorithm;
public class TestGreedyAlgorithm {
private GreedyAlgorithm algorithm;
| private CalculationContext context;
| 0 |
sfPlayer1/Matcher | src/matcher/type/ClassInstance.java | [
"public enum NameType {\n\tPLAIN(true, false, false, 0),\n\tMAPPED(false, true, false, 0),\n\tAUX(false, false, false, 1),\n\tAUX2(false, false, false, 2),\n\n\tMAPPED_PLAIN(true, true, false, 0),\n\tMAPPED_AUX_PLAIN(true, true, false, 1),\n\tMAPPED_AUX2_PLAIN(true, true, false, 2),\n\tMAPPED_TMP_PLAIN(true, true, ... | import java.net.URI;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util... | }
ret = sb.toString();
}
return full ? ret : ret.substring(ret.lastIndexOf('.') + 1);
}
public boolean isReal() {
return origin != null;
}
public URI getOrigin() {
return origin;
}
@Override
public Matchable<?> getOwner() {
return null;
}
@Override
public ClassEnv getEnv() {
return env... | return SimilarityChecker.compare(this, matchedClass); | 1 |
otto-de/edison-jobtrigger | src/main/java/de/otto/edison/jobtrigger/trigger/TriggerService.java | [
"@Component\n@ConfigurationProperties(prefix = \"edison.jobtrigger\")\npublic class JobTriggerProperties {\n\n @Valid\n private Jobresults jobresults = new Jobresults();\n\n @Valid\n private Scheduler scheduler = new Scheduler();\n\n @Valid\n private Security security = new Security();\n\n\n pu... | import de.otto.edison.jobtrigger.configuration.JobTriggerProperties;
import de.otto.edison.jobtrigger.definition.JobDefinition;
import de.otto.edison.jobtrigger.discovery.DiscoveryListener;
import de.otto.edison.jobtrigger.discovery.DiscoveryService;
import de.otto.edison.jobtrigger.security.BasicAuthCredentials;
impor... | package de.otto.edison.jobtrigger.trigger;
/**
* @author Guido Steinacker
* @since 05.09.15
*/
@Service
@EnableConfigurationProperties(JobTriggerProperties.class)
public class TriggerService implements DiscoveryListener {
private static final Logger LOG = getLogger(TriggerService.class);
private Discov... | return new JobTrigger(jobDefinition, periodicTrigger(of(10, MINUTES)), failingJobRunnable); | 7 |
domenique/tripled-framework | eventstore-core/src/test/java/eu/tripledframework/eventstore/infrastructure/ReflectionObjectConstructorTest.java | [
"public class DomainEvent {\n\n private String id;\n private String aggregateRootIdentifier;\n private int revision;\n private ZonedDateTime timestamp;\n\n public DomainEvent(String aggregateRootIdentifier) {\n this.id = UUID.randomUUID().toString();\n this.aggregateRootIdentifier = agg... | import eu.tripledframework.eventstore.domain.DomainEvent;
import eu.tripledframework.eventstore.domain.MyAggregateRoot;
import eu.tripledframework.eventstore.domain.NotInstantiatableAggregateRoot;
import eu.tripledframework.eventstore.domain.ObjectConstructor;
import eu.tripledframework.eventstore.event.AddressUpdatedE... | /*
* Copyright 2015 TripleD framework.
*
* 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 a... | DomainEvent event = new MyAggregateRootCreatedEvent(identifier, "Wallstreet"); | 0 |
emina/kodkod | src/kodkod/util/nodes/PrettyPrinter.java | [
"public final class Decl extends Decls {\n\t\n private final Variable variable;\n private final Multiplicity mult;\n private final Expression expression;\n \n /** \n * Constructs a new declaration from the specified variable and\n * expression, with the specified order.\n * \n * @ens... | import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import kodkod.ast.BinaryExpression;
import kodkod.ast.BinaryFormula;
import kodkod.ast.BinaryIntExpression;
import kodkod.ast.ComparisonFormula;
import kodkod.ast.Comprehension;
import kodkod.ast.ConstantExpr... | /** @ensures appends the tokenization of the given node to this.tokens */
public void visit(ProjectExpression node) {
append("project");
append("[");
node.expression().accept(this);
comma();
append("<");
final Iterator<IntExpression> cols = node.columns();
cols.next().accept(this);
... | if (n2 instanceof LeafExpression || n2 instanceof ConstantFormula || n2 instanceof IntConstant) {
| 3 |
ralscha/wampspring | src/test/java/ch/rasc/wampspring/call/CallTest.java | [
"public class CallErrorMessage extends WampMessage {\n\tprivate final String callID;\n\n\tprivate final String errorURI;\n\n\tprivate final String errorDesc;\n\n\tprivate final Object errorDetails;\n\n\tpublic CallErrorMessage(CallMessage callMessage, String errorURI, String errorDesc) {\n\t\tthis(callMessage, erro... | import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Test;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.cont... | /**
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appl... | assertThat(receivedMessage).isInstanceOf(CallErrorMessage.class); | 0 |
aNNiMON/HotaruFX | app/src/main/java/com/annimon/hotarufx/visual/PropertyType.java | [
"public class FontValue extends MapValue {\n\n public static Font toFont(MapValue mapValue) {\n final var map = mapValue.getMap();\n final var family = map.getOrDefault(\"family\", new StringValue(Font.getDefault().getFamily())).asString();\n final var weight = map.getOrDefault(\"weight\", N... | import com.annimon.hotarufx.lib.FontValue;
import com.annimon.hotarufx.lib.MapValue;
import com.annimon.hotarufx.lib.NodeValue;
import com.annimon.hotarufx.lib.NumberValue;
import com.annimon.hotarufx.lib.StringValue;
import com.annimon.hotarufx.lib.Types;
import com.annimon.hotarufx.lib.Value;
import com.annimon.hotar... | package com.annimon.hotarufx.visual;
public enum PropertyType {
BOOLEAN(Value::asBoolean, o -> NumberValue.fromBoolean(Boolean.TRUE.equals(o))),
NUMBER(toNumber(), o -> NumberValue.of((Number) o)),
STRING(Value::asString, o -> new StringValue(String.valueOf(o))),
NODE(toNode(), fromNode()),
CLIP_... | ObjectNode node = ((NodeValue) v).getNode(); | 7 |
utapyngo/owl2vcs | src/main/java/owl2vcs/changeset/CustomOntologyChangeDataVisitor.java | [
"public class AddPrefixData extends PrefixChangeData {\r\n\r\n private static final long serialVersionUID = 2801228470061214801L;\r\n\r\n public AddPrefixData(String prefixName, String prefix) {\r\n super(prefixName, prefix);\r\n }\r\n\r\n @Override\r\n public <R, E extends Exception> R accept... | import org.semanticweb.owlapi.change.OWLOntologyChangeDataVisitor;
import owl2vcs.changes.AddPrefixData;
import owl2vcs.changes.ModifyPrefixData;
import owl2vcs.changes.RemovePrefixData;
import owl2vcs.changes.RenamePrefixData;
import owl2vcs.changes.SetOntologyFormatData;
| package owl2vcs.changeset;
public interface CustomOntologyChangeDataVisitor<R, E extends Exception>
extends OWLOntologyChangeDataVisitor<R, E> {
| R visit(SetOntologyFormatData data) throws E;
| 4 |
GoogleCloudPlatform/opentelemetry-operations-java | exporters/metrics/src/test/java/com/google/cloud/opentelemetry/metric/MetricTranslatorTest.java | [
"static final DoublePointData aDoublePoint =\n DoublePointData.create(\n 1599030114 * NANO_PER_SECOND,\n 1599031814 * NANO_PER_SECOND,\n Attributes.of(stringKey(\"label1\"), \"value1\", booleanKey(\"label2\"), false),\n 32d);",
"static final DoubleSummaryPointData aDoubleSummaryPoin... | import static com.google.cloud.opentelemetry.metric.FakeData.aDoublePoint;
import static com.google.cloud.opentelemetry.metric.FakeData.aDoubleSummaryPoint;
import static com.google.cloud.opentelemetry.metric.FakeData.aGceResource;
import static com.google.cloud.opentelemetry.metric.FakeData.aHistogramPoint;
import sta... | /*
* Copyright 2022 Google
*
* 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 wr... | .setUnit(METRIC_DESCRIPTOR_TIME_UNIT) | 8 |
kennylbj/concurrent-java | src/main/java/producerconsumer/Main.java | [
"public class BlockingQueueConsumer implements Consumer<Item>, Runnable {\n private final BlockingQueue<Item> buffer;\n private final Random random = new Random(System.nanoTime());\n\n public BlockingQueueConsumer(BlockingQueue<Item> buffer) {\n this.buffer = buffer;\n }\n\n @Override\n pub... | import producerconsumer.blockingqueue.BlockingQueueConsumer;
import producerconsumer.blockingqueue.BlockingQueueProducer;
import producerconsumer.condition.ConditionConsumer;
import producerconsumer.condition.ConditionProducer;
import producerconsumer.semaphore.SemaphoreConsumer;
import producerconsumer.semaphore.Semap... | package producerconsumer;
/**
* Created by kennylbj on 16/9/10.
* Implement 3 versions of P/C
* 1) use Semaphore
* 2) use Condition
* 3) use BlockingQueue
* All versions support multiple producers and consumers
*/
public class Main {
private static final int BUFFER_SIZE = 100;
private static final int... | pool.execute(new SemaphoreProducer(semaphoreBuffer, fullCount, emptyCount)); | 5 |
mvescovo/item-reaper | app/src/testMock/java/com/michaelvescovo/android/itemreaper/item_details/ItemDetailsPresenterTest.java | [
"public interface DataSource {\n\n void getItems(@NonNull String userId, @NonNull String sortBy, @NonNull String caller,\n @NonNull GetItemsCallback callback);\n\n void getItem(@NonNull String itemId, @NonNull String userId, @NonNull String caller,\n @NonNull GetItemCallback c... | import com.google.firebase.auth.FirebaseAuth;
import com.michaelvescovo.android.itemreaper.data.DataSource;
import com.michaelvescovo.android.itemreaper.data.Item;
import com.michaelvescovo.android.itemreaper.data.Repository;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ju... | package com.michaelvescovo.android.itemreaper.item_details;
/**
* @author Michael Vescovo
*/
@RunWith(Parameterized.class)
public class ItemDetailsPresenterTest {
private ItemDetailsPresenter mPresenter;
@Mock
private ItemDetailsContract.View mView;
@Mock
private Repository mRepository;
... | mPresenter = new ItemDetailsPresenter(mView, mRepository, USER_ID); | 5 |
ceylon/ceylon-model | src/com/redhat/ceylon/model/loader/model/LazyModule.java | [
"public interface ArtifactResult {\n /**\n * Get name.\n *\n * @return the artifact name.\n */\n String name();\n\n /**\n * Get version.\n *\n * @return the version.\n */\n String version();\n\n /**\n * Get import type.\n *\n * @return the import type\n ... | import java.io.File;
import java.io.IOException;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import com.redhat.ceylon.model.cmr.ArtifactResult;
import com.redhat.ceylon.model.cmr.JDKUtils;
import com.re... | package com.redhat.ceylon.model.loader.model;
/**
* Represents a lazy Module declaration.
*
* @author Stéphane Épardaud <stef@epardaud.fr>
*/
public abstract class LazyModule extends Module {
private boolean isJava = false;
protected Set<String> jarPackages = new HashSet<String>();
public LazyModul... | public Package getDirectPackage(String name) { | 7 |
fflewddur/archivo | src/net/straylightlabs/archivo/controller/ArchiveQueueManager.java | [
"public class Archivo extends Application {\n private Stage primaryStage;\n private final MAKManager maks;\n private final StringProperty statusText;\n private final ExecutorService rpcExecutor;\n private final UserPrefs prefs;\n private RootLayoutController rootController;\n private RecordingL... | import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import net.straylightlabs.archivo.Archivo;
import net.straylightlabs.archivo.model.ArchiveH... | /*
* Copyright 2015-2016 Todd Kulesza <todd@dropline.net>.
*
* This file is part of Archivo.
*
* Archivo 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... | recording.setStatus(ArchiveStatus.FINISHED); | 2 |
jenkinsci/gitlab-plugin | src/test/java/com/dabsquared/gitlabjenkins/util/CommitStatusUpdaterTest.java | [
"@ExportedBean\npublic final class CauseData {\n private final ActionType actionType;\n private final Integer sourceProjectId;\n private final Integer targetProjectId;\n private final String branch;\n private final String sourceBranch;\n private final String userName;\n private final String use... | import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.dabsquared.gitlabjenkins.cause.CauseData;
import com.dabsquared.gitlabjenkins.cause.CauseDataBuilder... | package com.dabsquared.gitlabjenkins.util;
/**
* @author Daumantas Stulgis
*/
public class CommitStatusUpdaterTest {
private static final int PROJECT_ID = 1;
private static final String BUILD_URL = "job/Test-Job";
private static final String STAGE = "test";
private static final String REVISION = "111... | @Mock GitLabClient client; | 3 |
MCUpdater/MCUpdater | MCU-API/src/org/mcupdater/util/ServerPackParser.java | [
"public class Version {\n\tpublic static final int MAJOR_VERSION;\n\tpublic static final int MINOR_VERSION;\n\tpublic static final int BUILD_VERSION;\n\tpublic static final String BUILD_BRANCH;\n\tpublic static final String BUILD_LABEL;\n\tstatic {\n\t\tProperties prop = new Properties();\n\t\ttry {\n\t\t\tprop.loa... | import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.logging.Level;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.Docu... | NodeList nl;
switch (version) {
case 2:
// Handle ServerPacks designed for MCUpdater 3.0 and later
nl = docEle.getElementsByTagName("Import");
if(nl != null && nl.getLength() > 0) {
for(int i = 0; i < nl.getLength(); i++) {
Element el = (Element)nl.item(i);
modList.addAll(doImportV2(el, dom... | List<ConfigFile> configs = new ArrayList<ConfigFile>(); | 1 |
Roba1993/octo-chat | src/main/java/de/robertschuette/octochat/chats/ChatHandler.java | [
"public class ChatData {\n private Chat chat;\n private String userId;\n private String userName;\n private String lastMessage;\n private String lastMessageTime;\n private boolean lastMessageUnread;\n private boolean isOnline;\n\n /**\n * Constructor to create a new chat data object.\n ... | import de.robertschuette.octochat.model.ChatData;
import de.robertschuette.octochat.model.ChatDataStore;
import de.robertschuette.octochat.model.ChatHandlerSettings;
import de.robertschuette.octochat.model.ChatSettings;
import de.robertschuette.octochat.util.Util;
import javafx.scene.control.SplitPane;
import javafx.sc... | package de.robertschuette.octochat.chats;
/**
* This class holds the main logic of this application and
* routes the main actions.
*
* @author Robert Schütte
*/
public class ChatHandler extends SplitPane implements Runnable {
private ChatDataStore cds;
private List<Chat> chats;
private StackPane cha... | public void updateChatData(ChatData chatData) { | 0 |
tangqifa/Common-App-Architecture | app/src/main/java/com/kejiwen/architecture/activity/ProductCustomerListActivity.java | [
"public class ListViewHelper<DATA> {\r\n private IDataAdapter<DATA> dataAdapter;\r\n private PullToRefreshAdapterViewBase<? extends ListView> pullToRefreshPinnedHeaderListView;\r\n private IDataSource<DATA> dataSource;\r\n private ListView mListView;\r\n private Context context;\r\n private OnStat... | import android.os.Bundle;
import android.view.View;
import com.handmark.pulltorefresh.library.PullToRefreshListView;
import com.shizhefei.view.listviewhelper.ListViewHelper;
import com.kejiwen.architecture.R;
import com.kejiwen.architecture.adapter.ProductCustomerHistoryListAdapter;
import com.kejiwen.architecture.adap... | package com.kejiwen.architecture.activity;
public class ProductCustomerListActivity extends BaseActivity implements OnBackStackListener, View.OnClickListener {
private final static String TAG = "CustomerProductListActivity";
private ListViewHelper mListViewHelper;
private ProductCustomerHistoryListAdap... | mListViewHelper.setDataSource(new ProductCustomerOnsellDataSource()); | 4 |
curtisullerich/attendance | src/main/java/edu/iastate/music/marching/attendance/model/interact/AbsenceManager.java | [
"public class Lang {\n\n\tpublic static final String ERROR_MESSAGE_NO_DIRECTOR = \"There is no director registered. You cannot register for an account yet.\";\n\tpublic static final String ERROR_INVALID_PRIMARY_REGISTER_EMAIL= \"Not a valid email, try logging in with your student account\";\n\tpublic static final ... | import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.joda.time.DateMidnight;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Interval;
import com.google.appengine.api.datastore.Query.F... | LOG.warning("BLERG");
}
formDayOnAbsenceWeek = aStart.withDayOfWeek(formDayOfWeek)
.toDateMidnight();
break;
case Tardy:
DateTime checkin = absence.getCheckin(zone);
formDayOnAbsenceWeek = checkin.withDayOfWeek(formDayOfWeek)
.toDateMidnight();
break;
case EarlyCheckOut:
DateTime... | Absence absence = ModelFactory | 4 |
mangstadt/vinnie | src/main/java/com/github/mangstadt/vinnie/io/VObjectWriter.java | [
"public static String escapeNewlines(String string) {\n\tStringBuilder sb = null;\n\tchar prev = 0;\n\tfor (int i = 0; i < string.length(); i++) {\n\t\tchar c = string.charAt(i);\n\n\t\tif (c == '\\r' || c == '\\n') {\n\t\t\tif (sb == null) {\n\t\t\t\tsb = new StringBuilder(string.length() * 2);\n\t\t\t\tsb.append(... | import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
import com.github.mangstadt.vinnie.SyntaxStyle;
import com.github.mangstadt.vinnie.VObjectParameters;
import com.github.mangstadt.vinnie.VObjectProperty;
import com.github.mangstadt.vinnie.validate.AllowedCharacters;
import com.github.mangsta... | /*
* MIT License
*
* Copyright (c) 2016 Michael Angstadt
*
* 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, cop... | allowedGroupChars = VObjectValidator.allowedCharactersGroup(syntaxStyle, false); | 5 |
AussieGuy0/SDgen | src/main/java/au/com/anthonybruno/writer/WriterFactory.java | [
"public class CsvSettings extends FlatFileSettings {\n\n public static final char DEFAULT_DELIMITER = ',';\n\n private final char delimiter;\n\n public CsvSettings(boolean includeHeaders) {\n this(includeHeaders, DEFAULT_DELIMITER);\n }\n\n public CsvSettings(boolean includeHeaders, char delim... | import au.com.anthonybruno.settings.CsvSettings;
import au.com.anthonybruno.settings.FixedWidthSettings;
import au.com.anthonybruno.writer.csv.AbstractCsvWriter;
import au.com.anthonybruno.writer.csv.UnivocityCsvWriter;
import au.com.anthonybruno.writer.fixedwidth.AbstractFixedWidthWriter;
import au.com.anthonybruno.wr... | package au.com.anthonybruno.writer;
public class WriterFactory {
public static AbstractCsvWriter getDefaultCsvWriter(Writer writer, CsvSettings csvSettings) { | return new UnivocityCsvWriter(writer, csvSettings); | 3 |
jinahya/bit-io | src/main/java/com/github/jinahya/bit/io/AbstractBitOutput.java | [
"static int mask(final int size) {\n return MASKS[size - 1];\n}",
"static int requireValidSizeByte(final boolean unsigned, final int size) {\n if (size <= 0) {\n throw new IllegalArgumentException(\"size(\" + size + \") <= 0\");\n }\n if (size > Byte.SIZE) {\n throw new IllegalArgumentEx... | import java.io.IOException;
import static com.github.jinahya.bit.io.BitIoConstants.mask;
import static com.github.jinahya.bit.io.BitIoConstraints.requireValidSizeByte;
import static com.github.jinahya.bit.io.BitIoConstraints.requireValidSizeChar;
import static com.github.jinahya.bit.io.BitIoConstraints.requireValidSize... | package com.github.jinahya.bit.io;
/*-
* #%L
* bit-io
* %%
* Copyright (C) 2014 - 2019 Jinahya, 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.o... | writeInt(unsigned, requireValidSizeByte(unsigned, size), value); | 1 |
redferret/planet | src/worlds/planet/geosphere/GeoCell.java | [
"public class Vec2 {\n\n private float x, y;\n\n public Vec2() {\n this(0, 0);\n }\n\n public Vec2(Vec2 toCopy) {\n this(toCopy.x, toCopy.y);\n }\n\n public Vec2(float x, float y) {\n this.x = x;\n this.y = y;\n }\n\n public float getX() {\n return x;\n }\n\n public float getY() {\n retu... | import java.awt.Color;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
import engine.util.Vec2;
import java.util.Set;
import worlds.planet.Util;
import worlds.planet.Planet;
import worlds.planet.PlanetCell;
import worlds.planet.PlanetSurface;
import java.util.concurrent.ConcurrentLinkedDeque... | package worlds.planet.geosphere;
/**
* A GeoCell is a Cell representing land Geologically. The cell contains strata
* and specialized methods for adding and/or removing from the strata.
*
* @author Richard DeSilvey
*/
public class GeoCell extends Mantle {
/**
* The list of strata for this cell
*/
p... | heightMap = Util.constructSamples(heightColors, MAX_HEIGHT_INDEX); | 1 |
coil-lighting/udder | udder/src/main/java/com/coillighting/udder/effect/BloomEffect.java | [
"public class BoundingCube {\n\n protected double minX = 0.0;\n protected double minY = 0.0;\n protected double minZ = 0.0;\n\n protected double maxX = 0.0;\n protected double maxY = 0.0;\n protected double maxZ = 0.0;\n\n protected double width = 0.0;\n protected double height = 0.0;\n p... | import com.coillighting.udder.geometry.BoundingCube;
import com.coillighting.udder.geometry.TriangularSequence;
import com.coillighting.udder.mix.TimePoint;
import com.coillighting.udder.model.Device;
import com.coillighting.udder.model.Pixel;
import static com.coillighting.udder.util.LogUtil.log; | package com.coillighting.udder.effect;
/**
* A multicolor Blooming Leaf that can vary the discrete threadcount in its
* pattern. Easier to see than to explain this traditional weave.
*
* TODO Document this separately. It's a good example of what Udder was for.
*/
public class BloomEffect extends EffectBase {
... | px = TriangularSequence.oscillatingTriangularRootColor(xoffset, scale, repertoire); | 1 |
nikfoundas/etcd-viewer | src/main/java/org/github/etcd/service/impl/ClusterManagerImpl.java | [
"public enum ApiVersion {\n V2, V3\n}",
"public interface ClusterManager {\n\n boolean exists(String name);\n EtcdCluster getCluster(String name);\n\n EtcdCluster addCluster(String name, String etcdPeerAddress, ApiVersion apiVersion);\n void removeCluster(String name);\n\n List<EtcdCluster> getC... | import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import org.github.etcd.service.ApiVersion;
import org.github.etcd.service.Clust... | package org.github.etcd.service.impl;
public class ClusterManagerImpl implements ClusterManager {
private static final Logger log = LoggerFactory.getLogger(ClusterManager.class);
private static final Comparator<EtcdMember> MEMBER_SORTER = new Comparator<EtcdMember>() {
@Override
public int... | try (EtcdProxy proxy = proxyFactory.getEtcdProxy(name, leaderAddress, apiVersion)) { | 5 |
isel-leic-mpd/mpd-2017-i41d | aula31-weather-groupingBy/src/main/java/weather/WeatherService.java | [
"public class HttpRequest implements IRequest {\n @Override\n public Iterable<String> getContent(String path) {\n List<String> res = new ArrayList<>();\n try (InputStream in = new URL(path).openStream()) {\n /*\n * Consumir o Inputstream e adicionar dados ao res\n ... | import util.HttpRequest;
import weather.data.WeatherWebApi;
import weather.data.dto.LocationDto;
import weather.data.dto.WeatherInfoDto;
import weather.model.Location;
import weather.model.WeatherInfo;
import java.time.LocalDate;
import java.util.stream.Stream;
import static java.time.LocalDate.now; | /*
* Copyright (c) 2017, Miguel Gamboa
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is dis... | public Stream<WeatherInfo> last30daysWeather(double lat, double log) { | 5 |
caarmen/scrumchatter | app/src/main/java/ca/rmen/android/scrumchatter/chart/MeetingChartFragment.java | [
"public class Constants {\n public static final String TAG = \"ScrumChatter\";\n public static final String PREF_TEAM_ID = \"team_id\";\n public static final int DEFAULT_TEAM_ID = 1;\n public static final String DEFAULT_TEAM_NAME = \"Team A\";\n}",
"public class Meetings {\n private static final St... | import android.database.Cursor;
import android.databinding.DataBindingUtil;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.MainThread;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.supp... | /*
* Copyright 2016-2017 Carmen Alvarez
* <p/>
* This file is part of Scrum Chatter.
* <p/>
* Scrum Chatter 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 you... | MemberColumns.NAME, | 4 |
InMobi/api-monetization | java/src/test/java/com/inmobi/monetization/ads/NativeTest.java | [
"public class Native extends AdFormat {\n\n\tprivate JSONNativeResponseParser jsonParser = new JSONNativeResponseParser();\n\n\tpublic Native() {\n\t\trequestType = AdRequest.NATIVE;\n\t}\n\t\n\tprivate ArrayList<NativeResponse> loadRequestInternal(Request request) {\n\t\terrorCode = null;\n\t\tArrayList<NativeResp... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import java.util.ArrayList;
import main.java.com.inmobi.monetization.ads.Native;
import main.java.com.inmobi.monetization.api.request.ad.Slot;
import main.java.com.inmobi.monetization.api.request.ad.Device;
import main.java.com.inmo... | /**
* Copyright © 2015 InMobi Technologies Pte. Ltd. All rights reserved.
MIT License
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 wi... | Property property = null; | 4 |
LklCBPay/javasdk | src/test/java/QueryCustomAuthTest.java | [
"@Component\r\npublic class CustomAuthClient {\r\n private static final Logger logger=LoggerFactory.getLogger(CustomAuthClient.class);\r\n \r\n @Autowired\r\n private LklCrossPayRestfulClent payRestfulClent;\r\n \r\n /**\r\n * 海关认证请求\r\n * @param customAuthReq\r\n * @param dataHead\r\n... | import org.junit.Before;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
i... |
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:client-application.xml")
public class QueryCustomAuthTest {
private static final Logger logger=LoggerFactory.getLogger(QueryCustomAuthTest.class);
@Autowired
private LklCrossPayEnv lklCrossPayEnv;
@Autowired... | } catch (LklClientException e) {
| 5 |
Fedict/commons-eid | commons-eid-tests/src/test/java/be/bosa/commons/eid/client/tests/integration/LocaleTest.java | [
"public class BeIDCard implements AutoCloseable {\n\n\tprivate static final String UI_MISSING_LOG_MESSAGE = \"No BeIDCardUI set and can't load DefaultBeIDCardUI\";\n\tprivate static final String UI_DEFAULT_REQUIRES_HEAD = \"No BeIDCardUI set and DefaultBeIDCardUI requires a graphical environment\";\n\tprivate stati... | import be.bosa.commons.eid.client.BeIDCard;
import be.bosa.commons.eid.client.BeIDCards;
import be.bosa.commons.eid.client.FileType;
import be.bosa.commons.eid.client.impl.BeIDDigest;
import be.bosa.commons.eid.client.spi.BeIDCardsUI;
import be.bosa.commons.eid.dialogs.DefaultBeIDCardsUI;
import org.junit.Test;
import ... | /*
* Commons eID Project.
* Copyright (C) 2014 - 2018 BOSA.
*
* This is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License version 3.0 as published by
* the Free Software Foundation.
*
* This software is distributed in the hope that it will be usef... | card.sign(new byte[]{0x00, 0x00, 0x00, 0x00}, BeIDDigest.PLAIN_TEXT, FileType.NonRepudiationCertificate, false); | 3 |
RoboTricker/Transport-Pipes | src/main/java/de/robotricker/transportpipes/inventory/CraftingPipeSettingsInventory.java | [
"public class TransportPipes extends JavaPlugin {\n\n private Injector injector;\n\n private SentryService sentry;\n private ThreadService thread;\n private DiskService diskService;\n\n @Override\n public void onEnable() {\n\n if (Bukkit.getVersion().contains(\"1.13\")) {\n Legac... | import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.attribute.Attribute;
import org.bukkit.block.data.BlockData;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.DragType;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventor... | package de.robotricker.transportpipes.inventory;
public class CraftingPipeSettingsInventory extends DuctSettingsInventory {
@Override
public void create() {
inv = Bukkit.createInventory(null, 6 * 9, LangConf.Key.DUCT_INVENTORY_TITLE.get(duct.getDuctType().getFormattedTypeName()));
}
@Overr... | TPDirection outputDir = pipe.getOutputDir(); | 4 |
underhilllabs/dccsched | src/com/underhilllabs/dccsched/io/RemoteWorksheetsHandler.java | [
"public class ScheduleContract {\n\n /**\n * Special value for {@link SyncColumns#UPDATED} indicating that an entry\n * has never been updated, or doesn't exist yet.\n */\n public static final long UPDATED_NEVER = -2;\n\n /**\n * Special value for {@link SyncColumns#UPDATED} indicating that... | import static com.underhilllabs.dccsched.util.ParserUtils.AtomTags.ENTRY;
import static org.xmlpull.v1.XmlPullParser.END_DOCUMENT;
import static org.xmlpull.v1.XmlPullParser.START_TAG;
import com.underhilllabs.dccsched.provider.ScheduleContract;
import com.underhilllabs.dccsched.provider.ScheduleContract.Sessions;
impo... | /*
* Copyright 2010 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... | final HashMap<String, WorksheetEntry> sheets = Maps.newHashMap(); | 5 |
anyremote/anyremote-android-client | java/anyremote/client/android/SearchForm.java | [
"public class About extends Dialog {\n\n\tprivate static Context mContext = null;\n\n\tpublic About(Context context) {\n\t\tsuper(context);\n\t\tmContext = context;\n\t}\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\t\n\t\tsetContentView(anyremote.client.android.R.layout.about);\n\t\t\n\t\... | import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener;
import android.content.Intent;
import android.content.IntentFilter;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.os.Handler;
import androi... | //
// anyRemote android client
// a bluetooth/wi-fi remote control for Linux.
//
// Copyright (C) 2011-2016 Mikhail Fedotov <anyremote@mail.ru>
//
// 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 Foundat... | final Address auto = dataSource.getAutoconnectItem(); | 1 |
pmarques/SocketIO-Server | SocketIO-Netty/src/test/java/eu/k2c/socket/io/ci/usecases/UC17Handler.java | [
"public abstract class AbstractHandler extends AbstractSocketIOHandler {\n\t@Override\n\tpublic boolean validate(String URI) {\n\t\t// This isn't belongs to socketIO Spec AFAIK\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic void onConnect(final SocketIOOutbound outbound, final SocketIOSessionEventRegister eventReg... | import eu.k2c.socket.io.ci.AbstractHandler;
import eu.k2c.socket.io.server.api.SocketIOOutbound;
import eu.k2c.socket.io.server.api.SocketIOSessionEventRegister;
import eu.k2c.socket.io.server.api.SocketIOSessionNSRegister;
import eu.k2c.socket.io.server.exceptions.SocketIOException;
import java.util.List;
import java.... | /**
* Copyright (C) 2011 K2C @ Patrick Marques <patrickfmarques@gmail.com>
*
* 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 ... | public void onConnect(final SocketIOOutbound outbound, final SocketIOSessionEventRegister eventRegister, | 2 |
bencvt/LibShapeDraw | projects/main/src/main/java/libshapedraw/shape/WireframeLinesBlendIterable.java | [
"public interface MinecraftAccess {\n /** Tessellator.instance.startDrawing */\n public MinecraftAccess startDrawing(int mode);\n\n /** Tessellator.instance.addVertex */\n public MinecraftAccess addVertex(double x, double y, double z);\n\n /** Tessellator.instance.addVertex */\n public MinecraftAc... | import java.util.Iterator;
import libshapedraw.MinecraftAccess;
import libshapedraw.primitive.Color;
import libshapedraw.primitive.LineStyle;
import libshapedraw.primitive.ReadonlyColor;
import libshapedraw.primitive.ReadonlyLineStyle;
import libshapedraw.primitive.ReadonlyVector3;
import libshapedraw.primitive.Vector3... | package libshapedraw.shape;
/**
* A series of connected line segments that smoothly blends from one line style
* to another along the segments.
* <p>
* For most use cases you'll want to use WireframeLinesBlend instead, which
* takes a Collection of ReadonlyVector3s rather than an Iterable. Only use
* this cla... | final ReadonlyLineStyle fromStyle = getEffectiveLineStyle(); | 4 |
bmelnychuk/outlay | outlay/app/src/main/java/app/outlay/view/Navigator.java | [
"public class MainActivity extends DrawerActivity {\n\n private MainFragment mainFragment;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(app.outlay.R.layout.activity_single_fragment);\n\n Bundle b = getIntent... | import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import app.outlay.domain.model.Expense;
import app.outlay.view.activity.LoginActivity;
import app.outlay.view.activity.MainActivity;
import app.outlay.view.activity.SingleFrag... | package app.outlay.view;
/**
* Created by Bogdan Melnychuk on 1/24/16.
*/
public final class Navigator {
public static void goToCategoryDetails(FragmentActivity activityFrom, String categoryId) {
Bundle b = new Bundle();
if (categoryId != null) {
b.putString(CategoryDetailsFragment... | SingleFragmentActivity.start(from, CategoriesFragment.class); | 2 |
padster/Muse-EEG-Toolkit | sampleApp/src/main/java/eeg/useit/today/eegtoolkit/sampleapp/MoreDeviceDetailsActivity.java | [
"public class Constants {\n public static final String TAG = \"EEGToolkit\";\n public static final String RECORDING_PREFIX = \"data\";\n\n // HACK: Should configure these elsewhere, perhaps attributes to renderers.\n public static final double VOLTAGE_MAX = 1000.0;\n public static final double VOLTAGE_MIN = 70... | import android.databinding.DataBindingUtil;
import android.databinding.Observable;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import com.choosemuse.libmuse.Eeg;
import com.choosemuse.libmuse.Muse;
import com.choosemuse.libmuse.MuseManagerAndroid;
import eeg.useit... | package eeg.useit.today.eegtoolkit.sampleapp;
/**
* Activity containing more example views provided by the toolkit.
*/
public class MoreDeviceDetailsActivity extends AppCompatActivity {
public static int DURATION_SEC = 4;
/** The live device VM backing this view. */
private final StreamingDeviceViewModel d... | private final EpochCollector epochCollector = new EpochCollector(); | 3 |
jentrata/jentrata | ebms-msh-api/src/main/java/org/jentrata/ebms/cpa/PartnerAgreement.java | [
"public class EbmsConstants {\n\n public static final String JENTRATA_VERSION = \"JentrataVersion\";\n\n //Jentrata Message Header keys\n public static final String SOAP_VERSION = \"JentrataSOAPVersion\";\n public static final String EBMS_VERSION = \"JentrataEBMSVersion\";\n public static final Strin... | import com.google.common.base.Predicate;
import com.google.common.collect.Iterables;
import org.jentrata.ebms.EbmsConstants;
import org.jentrata.ebms.MessageType;
import org.jentrata.ebms.cpa.pmode.BusinessInfo;
import org.jentrata.ebms.cpa.pmode.Party;
import org.jentrata.ebms.cpa.pmode.PayloadService;
import org.jent... | package org.jentrata.ebms.cpa;
/**
* A Agreement between 2 trading partners
*
* @author aaronwalker
*/
public class PartnerAgreement {
private String cpaId;
private boolean active = true;
private String agreementRef;
private String mep = EbmsConstants.EBMS_V3_MEP_ONE_WAY;
private String mepB... | private Protocol protocol; | 5 |
ls1intum/jReto | Source/test/jReto/integration/TransferCancellationTest.java | [
"public class PeerConfiguration {\n\tpublic final RunLoop runloop;\n\tpublic final LocalPeer peer1;\n\tpublic final LocalPeer peer2;\n\tpublic final List<LocalPeer> participatingPeers;\n\tpublic final List<LocalPeer> reachablePeers;\n\tpublic final List<LocalPeer> destinations;\n\n\tpublic static List<LocalPeer> de... | import static org.junit.Assert.*;
import jReto.meta.PeerConfiguration;
import jReto.util.TestData;
import org.junit.Test;
import de.tum.in.www1.jReto.Connection;
import de.tum.in.www1.jReto.RemotePeer;
import de.tum.in.www1.jReto.connectivity.Transfer;
import de.tum.in.www1.jReto.util.CountDown; | package jReto.integration;
public class TransferCancellationTest {
@Test(timeout=1000)
public void testTransferDataIntegrityDirect() {
new TransferCancellationTest().testTransferCancellation(PeerConfiguration.directNeighborConfiguration());
}
@Test(timeout=1000)
public void testTransferDataIntegrity2Hop() {
... | Transfer outTransfer = connection.send(TestData.generate(dataLength)); | 1 |
jjoe64/GraphView-Demos | app/src/main/java/com/jjoe64/graphview_demos/categories/StylingExamplesFragment.java | [
"public enum FullscreenExample {\n HELLO_WORLD(R.layout.fullscreen_example_simple, HelloWorld.class),\n SCALING_XY(R.layout.fullscreen_example_simple, ScalingXY.class),\n SCALING_X(R.layout.fullscreen_example_simple, ScalingX.class),\n SCROLLING_X(R.layout.fullscreen_example_simple, ScrollingX.class),\n... | import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview_demos.FullscreenExample;
import com.jjoe64.graphview_demos.ItemDetailFragment;
import com.jjoe64.graphview_demos.R;
import com.jjoe64.... | package com.jjoe64.graphview_demos.categories;
/**
* Created by jonas on 07.09.16.
*/
public class StylingExamplesFragment extends ItemDetailFragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View roo... | new StylingColors().initGraph(graph); | 2 |
d-plaindoux/suitcase | src/main/java/org/smallibs/suitcase/match/Matcher.java | [
"public interface Case<T, R> {\n\n Optional<R> unapply(T t);\n\n interface WithoutCapture<T, R> extends Case<T, Result.WithoutCapture<R>> {\n static <T, R> WithoutCapture<T, R> adapt(Case<T, Result.WithoutCapture<R>> aCase) {\n return aCase::unapply;\n }\n }\n\n interface WithCa... | import org.smallibs.suitcase.cases.Case;
import org.smallibs.suitcase.cases.Result;
import org.smallibs.suitcase.utils.Functions;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.function.Function;
import java.util.function.Supplier;
import static org.smallibs.suitcase.cas... | /*
* Copyright (C)2015 D. Plaindoux.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed i... | return new WhenRuleWithoutCapture<>(typeOf(object)); | 4 |
crazyhitty/Munch | app/src/main/java/com/crazyhitty/chdev/ks/munch/ui/fragments/ManageSourcesFragment.java | [
"public class SourceItem {\n private String sourceName, sourceUrl, sourceCategoryName, sourceDateAdded;\n private int sourceCategoryImgId;\n\n public int getSourceCategoryImgId() {\n return sourceCategoryImgId;\n }\n\n public void setSourceCategoryImgId(int sourceCategoryImgId) {\n this... | import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import androi... | package com.crazyhitty.chdev.ks.munch.ui.fragments;
/**
* Created by Kartik_ch on 12/6/2015.
*/
public class ManageSourcesFragment extends Fragment implements ISourceView {
@Bind(R.id.recycler_view_sources)
RecyclerView recyclerViewSources;
private SourcesRecyclerViewAdapter mSourcesRecyclerViewAdap... | public void dataSourceItemsLoaded(List<SourceItem> sourceItems) { | 0 |
iChun/Hats | src/main/java/me/ichun/mods/hats/client/gui/window/WindowAllHats.java | [
"public class WorkspaceHats extends Workspace\n implements IHatSetter\n{\n public static final DecimalFormat FORMATTER = new DecimalFormat(\"#,###,###\");\n\n public final boolean fallback;\n public final @Nonnull LivingEntity hatEntity;\n public final HatsSavedData.HatPart hatDetails;\n publi... | import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import me.ichun.mods.hats.client.gui.WorkspaceHats;
import me.ichun.mods.hats.client.gui.window.element.ElementHatRender;
import me.ichun.mods.hats.client.gui.window.element.ElementHatsScrollView;
import me.ichun.mods.hats.com... | package me.ichun.mods.hats.client.gui.window;
public class WindowAllHats extends Window<WorkspaceHats>
{
public int age;
public WindowAllHats(WorkspaceHats parent)
{
super(parent);
disableDockingEntirely();
disableDrag();
disableTitle();
setView(new ViewAllHats(... | if(age <= Hats.configClient.guiAnimationTime) | 3 |
ChillingVan/AndroidInstantVideo | app/src/main/java/com/chillingvan/instantvideo/sample/test/publisher/TestMp4MuxerActivity.java | [
"public class CameraPreviewTextureView extends GLMultiTexProducerView {\n\n private H264Encoder.OnDrawListener onDrawListener;\n private IAndroidCanvasHelper drawTextHelper = IAndroidCanvasHelper.Factory.createAndroidCanvasHelper(IAndroidCanvasHelper.MODE.MODE_ASYNC);\n private Paint textPaint;\n\n publ... | import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.SurfaceTexture;
import android.hardware.Camera;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.os.Handle... | /*
*
* *
* * * Copyright (C) 2017 ChillingVan
* * *
* * * 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
*... | textPaint.setTextSize(ScreenUtil.dpToPx(getApplicationContext(), 15)); | 1 |
Chat-Wane/LSEQ | src/main/java/alma/fr/modules/GreedRandDoubleModule.java | [
"public class BaseDouble implements IBase {\n\n\tprivate final Integer baseBase;\n\n\t@Inject\n\tpublic BaseDouble(@Basebase Integer baseBase) {\n\t\tthis.baseBase = baseBase;\n\t}\n\n\tpublic Integer getBitBase(Integer depth) {\n\t\treturn baseBase + depth - 1;\n\t}\n\n\tpublic Integer getSumBit(Integer depth) {\n... | import java.math.BigInteger;
import alma.fr.basecomponents.BaseDouble;
import alma.fr.basecomponents.Basebase;
import alma.fr.basecomponents.IBase;
import alma.fr.strategiescomponents.BeginningBoundaryIdProvider;
import alma.fr.strategiescomponents.EndingBoundaryIdProvider;
import alma.fr.strategiescomponents.IIdProvid... | package alma.fr.modules;
/**
* Constant boundary but greed and double base
*/
public class GreedRandDoubleModule implements Module {
public void configure(Binder binder) {
Integer baseBase = new Integer(5);
BigInteger boundary = new BigInteger("10");
/* BASE */
binder.bind(Integer.class).annotatedWith(... | binder.bind(IBase.class).to(BaseDouble.class); | 0 |
fvalente/LogDruid | src/logdruid/ui/table/StatRecordingEditorTable.java | [
"public class Repository {\n\tprivate static Logger logger = Logger.getLogger(DataMiner.class.getName());\n\tprivate ArrayList<Recording> recordings;\n\tprivate ArrayList<Source> sources;\n\tprivate String baseSourcePath;\n\tprivate ArrayList<DateFormat> dates;\n\tprivate boolean recursiveMode;\n\tprivate boolean o... | import javax.swing.JPanel;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextPane;
import javax.swing.ListSelectionModel;
import javax.swing.table.AbstractTableModel... | /*******************************************************************************
* LogDruid : Generate charts and reports using data gathered in log files
* Copyright (C) 2016 Frederic Valente (frederic.valente@gmail.com)
*
* This program is free software: you can redistribute it and/or modify it under the terms of... | private Repository rep = null; | 0 |
jurihock/voicesmith | tests/src/de/jurihock/voicesmith/services/AudioServiceTestBase.java | [
"public class AudioDeviceManager\n{\n private final Context context;\n\n public AudioDeviceManager(Context context)\n {\n this.context = context;\n }\n\n public AudioDevice getInputDevice(HeadsetMode mode) throws IOException\n {\n // TEST: Read input signal from file instead of mic d... | import java.io.IOException;
import static org.mockito.Mockito.*;
import android.content.Intent;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.SmallTest;
import de.jurihock.voicesmith.audio.AudioDeviceManager;
import de.jurihock.voicesmith.audio.HeadsetManager;
import... | /*
* Voicesmith <http://voicesmith.jurihock.de/>
*
* Copyright (c) 2011-2014 Juergen Hock
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your... | AudioDevice dummyInDevice = new DummyInDevice(getContext()); | 3 |
ev3dev-lang-java/ev3dev-lang-java | src/main/java/ev3dev/utils/io/NativeTTY.java | [
"public static final int KDGKBMODE = 0x4B44; /* gets current keyboard mode */",
"public static final int KDSETMODE = 0x4B3A; /* set text/graphics mode */",
"public static final int KDSKBMODE = 0x4B45; /* sets current keyboard mode */",
"public static final int VT_GETMODE = 0x5601; /* get mode of acti... | import com.sun.jna.LastErrorException;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.IntByReference;
import lombok.NonNull;
import java.util.Arrays;
import java.util.List;
import static ev3dev.utils.io.NativeConstants.KDGKBMODE;
import static ev3dev.utils.io.NativeConstants.KDSETMODE;... | package ev3dev.utils.io;
/**
* Wrapper for basic actions on Linux VT/TTY
*
* @author Jakub Vaněk
* @since 2.4.7
*/
public class NativeTTY extends NativeDevice {
/**
* Initialize new TTY.
*
* @param dname Path to TTY device.
* @throws LastErrorException when the operation fails.
*/... | super.ioctl(KDSKBMODE, mode); | 2 |
izumin5210/Sunazuri | app/src/main/java/info/izumin/android/sunazuri/infrastructure/InfrastructureComponent.java | [
"public interface OauthRepository {\n Single<AuthorizedUser> getToken(String code);\n}",
"public interface TeamsRepository {\n Single<List<Team>> get(AuthorizedUser user);\n}",
"public interface UsersRepository {\n Observable<AuthorizedUser> getCurrentUser();\n Single<List<AuthorizedUser>> getAuthor... | import dagger.Component;
import info.izumin.android.sunazuri.domain.repository.OauthRepository;
import info.izumin.android.sunazuri.domain.repository.TeamsRepository;
import info.izumin.android.sunazuri.domain.repository.UsersRepository;
import info.izumin.android.sunazuri.infrastructure.api.ApiModule;
import info.izum... | package info.izumin.android.sunazuri.infrastructure;
/**
* Created by izumin on 5/13/2016 AD.
*/
@Singleton
@Component(
modules = {
InfrastructureModule.class,
RepositoryModule.class,
HttpClientModule.class,
ApiModule.class,
Ca... | OauthRepository oauthRepository(); | 0 |
maoruibin/AppPlus | app/src/main/java/com/gudong/appkit/receiver/BootReceiver.java | [
"public class App extends Application {\n private static final String DB_NAME = \"appplus.db\";\n public static LiteOrm sDb;\n public static Context sContext;\n @Override\n public void onCreate() {\n super.onCreate();\n sDb = LiteOrm.newSingleInstance(this, DB_NAME);\n sContext =... | import com.gudong.appkit.dao.AppInfoEngine;
import com.gudong.appkit.dao.DataHelper;
import com.gudong.appkit.event.EEvent;
import com.gudong.appkit.event.RxBus;
import com.gudong.appkit.event.RxEvent;
import com.gudong.appkit.utils.logger.Logger;
import android.content.BroadcastReceiver;
import android.content.Context... | /*
* Copyright (c) 2015 GuDong
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify,... | AppEntity uninstalledApp = DataHelper.getAppByPackageName(packageName); | 3 |
paulirotta/cascade | cascade/src/main/java/com/reactivecascade/util/NetUtil.java | [
"@NotCallOrigin\npublic class RunnableAltFuture<IN, OUT> extends AbstractAltFuture<IN, OUT> implements IRunnableAltFuture<IN, OUT> {\n private final IActionR<OUT> mAction;\n\n /**\n * Create a {@link java.lang.Runnable} which will be executed one time on the\n * {@link com.reactivecascade.i.IThreadTyp... | import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.net.NetworkInfo;
import android.net.wifi.SupplicantState;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
... | /*
This file is part of Reactive Cascade which is released under The MIT License.
See license.md , https://github.com/futurice/cascade and http://reactivecascade.com for details.
This is open source for the common good. Please contribute improvements by pull request or contact paulirotta@gmail.com
*/
package com.reacti... | this(context, NET_READ, NET_WRITE); | 5 |
Biacode/presentations | tdd/service/src/test/java/com/barcamp/tdd/service/user/impl/UserServiceImplTest.java | [
"@Entity\n@Table(name = \"USER\")\npublic class User implements Serializable {\n private static final long serialVersionUID = 415031695037724472L;\n\n //region Properties\n @Id\n @GeneratedValue(strategy = GenerationType.AUTO)\n private Long id;\n\n @Column(name = \"email\")\n private String em... | import com.barcamp.tdd.domain.user.User;
import com.barcamp.tdd.repository.user.UserRepository;
import com.barcamp.tdd.service.user.UserService;
import com.barcamp.tdd.service.user.dto.UserCreationDto;
import com.barcamp.tdd.service.user.exception.UserAlreadyExistsForEmailException;
import com.barcamp.tdd.service.user.... | package com.barcamp.tdd.service.user.impl;
/**
* Author: Arthur Asatryan
* Company: SFL LLC
* Date: 6/18/16
* Time: 11:26 PM
*/
public class UserServiceImplTest extends AbstractServiceImplTest {
//region Test subject and mocks
@TestSubject
private UserService userService = new UserServiceImpl();
... | } catch (final UserNotFoundForIdException ex) { | 5 |
datanerds-io/avropatch | src/test/java/io/datanerds/avropatch/serialization/ConcurrencyTest.java | [
"@ThreadSafe\npublic class Patch<T> {\n\n @AvroSchema(DefaultSchema.HEADERS)\n private final Map<String, Object> headers;\n @AvroSchema(DefaultSchema.VALUE)\n private final T resource;\n @AvroSchema(DefaultSchema.TIMESTAMP)\n private final Date timestamp;\n private final List<Operation> operati... | import com.google.common.collect.ImmutableList;
import io.datanerds.avropatch.Patch;
import io.datanerds.avropatch.operation.Operation;
import io.datanerds.avropatch.operation.OperationGenerator;
import io.datanerds.avropatch.value.Bimmel;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... | package io.datanerds.avropatch.serialization;
public class ConcurrencyTest {
private static Logger logger = LoggerFactory.getLogger(ConcurrencyTest.class);
private static final int NUMBER_OF_THREADS = 200;
private static final int NUMBER_OF_PATCHES = 100;
private static final int MAX_PATCH_SIZE = 5... | private static final List<Patch> PATCHES = Collections.unmodifiableList(generateData()); | 0 |
sfPlayer1/Matcher | src/matcher/type/ClassEnvironment.java | [
"public enum NameType {\n\tPLAIN(true, false, false, 0),\n\tMAPPED(false, true, false, 0),\n\tAUX(false, false, false, 1),\n\tAUX2(false, false, false, 2),\n\n\tMAPPED_PLAIN(true, true, false, 0),\n\tMAPPED_AUX_PLAIN(true, true, false, 1),\n\tMAPPED_AUX2_PLAIN(true, true, false, 2),\n\tMAPPED_TMP_PLAIN(true, true, ... | import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileSystem;
import java.nio.file.FileSystemNotFoundException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
impor... | }
}
if (!createUnknown) return null;
ClassInstance ret = new ClassInstance(id, this);
addSharedCls(ret);
return ret;
}
private Path getPath(URL url) {
URI uri = null;
try {
uri = url.toURI();
Path ret = Paths.get(uri);
if (uri.getScheme().equals("jrt") && !Files.exists(ret)) {
// w... | ClassifierUtil.extractStrings(mn.instructions, strings); | 2 |
caseydavenport/biermacht | src/com/biermacht/brews/xml/RecipeXmlWriter.java | [
"public class Fermentable extends Ingredient implements Parcelable {\n\n // Beer XML 1.0 Required Fields ===================================\n // ================================================================\n // Name - Inherited\n // Version - Inherited\n private String type; // G... | import android.content.Context;
import android.os.Environment;
import android.util.Log;
import com.biermacht.brews.ingredient.Fermentable;
import com.biermacht.brews.ingredient.Hop;
import com.biermacht.brews.ingredient.Misc;
import com.biermacht.brews.ingredient.Water;
import com.biermacht.brews.ingredient.Yeast;
impo... | Element versionElement = d.createElement("VERSION");
Element typeElement = d.createElement("TYPE");
Element amountElement = d.createElement("AMOUNT");
Element yieldElement = d.createElement("YIELD");
Element colorElement = d.createElement("COLOR");
Element addAfterBoilElement = d.cre... | public Element getWatersChild(Document d, ArrayList<Water> l) { | 3 |
junicorn/roo | src/main/java/social/roo/controller/auth/GithubController.java | [
"public enum UserRole {\n\n GUEST(0, \"游客\"),\n MEMBER(1, \"注册会员-所有注册用户自动属于该角色\"),\n VIP(2, \"VIP会员-没有特殊权限,只是一个身份象征\"),\n MODERATOR(3, \"版主-可以管理若干个话题下的帖子\"),\n SUPER_MODERATOR(4, \"超级版主-可以管理所有话题下的帖子和所有会员\"),\n ADMIN(5, \"管理员-享有论坛的最高权限,可以管理整个论坛,设置整个论坛的参数\");\n\n @Getter\n private Integer id;\... | import com.blade.ioc.annotation.Inject;
import com.blade.kit.JsonKit;
import com.blade.mvc.WebContext;
import com.blade.mvc.annotation.GetRoute;
import com.blade.mvc.annotation.Param;
import com.blade.mvc.annotation.Path;
import com.blade.mvc.http.Session;
import com.github.scribejava.core.model.OAuth2AccessToken;
impo... | package social.roo.controller.auth;
/**
* Github认证控制器
*
* @author biezhi
* @date 2017/10/9
*/
@Slf4j
@Path("auth/github")
public class GithubController {
@Inject
private OAuth20Service githubService;
@Inject
private PlatformService platformService;
@Inject
private AccountService acco... | user.setRole(UserRole.MEMBER.role()); | 0 |
1014277960/DailyReader | app/src/main/java/com/wulinpeng/daiylreader/bookdetail/presenter/BookDetailPresenterImpl.java | [
"public interface IBookDetailPresenter extends IBaseContract.IBasePresenter {\n\n public void getBookDetail();\n\n public boolean checkSelf();\n\n public void removeFromSelf();\n\n public void addToSelf();\n}",
"public interface IBookDetailView extends IBaseContract.IBaseView {\n\n public void onBo... | import android.content.Context;
import com.wulinpeng.daiylreader.net.ReaderApiManager;
import com.wulinpeng.daiylreader.bookdetail.contract.IBookDetailPresenter;
import com.wulinpeng.daiylreader.bookdetail.contract.IBookDetailView;
import com.wulinpeng.daiylreader.bookdetail.event.CollectionChangeEvent;
import com.wuli... | package com.wulinpeng.daiylreader.bookdetail.presenter;
/**
* @author wulinpeng
* @datetime: 17/2/20 下午7:59
* @description:
*/
public class BookDetailPresenterImpl extends BasePresenter<IBookDetailView> implements IBookDetailPresenter {
private Context context;
private String bookId;
private Bo... | .compose(RxUtil.rxScheduler()) | 6 |
aschaetzle/Sempala | sempala-loader/src/main/java/de/uni_freiburg/informatik/dbis/sempala/loader/run/Main.java | [
"public final class ExtVPLoader extends Loader {\n\n\t/** The constructor */\n\tpublic ExtVPLoader(Impala wrapper, String hdfsLocation) {\n\t\tsuper(wrapper, hdfsLocation);\n\t\ttablename_output = \"extvp\";\n\t}\n\n\tprivate ArrayList<String> ExtVPTypes = new ArrayList<String>();\n\tprivate ArrayList<String> ListO... | import java.sql.SQLException;
import org.apache.commons.cli.BasicParser;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.Par... | package de.uni_freiburg.informatik.dbis.sempala.loader.run;
/**
*
* @author Manuel Schneider <schneidm@informatik.uni-freiburg.de>
*
*/
public class Main {
/**
* The main routine.
*
* @param args
* The arguments passed to the program
*/
public static void main(String[] args) {
// Par... | impala.set(QueryOption.COMPRESSION_CODEC, "SNAPPY"); | 7 |
terzerm/hover-raft | src/main/java/org/tools4j/hoverraft/command/Command.java | [
"public interface DirectPayload {\n\n int byteLength();\n\n int offset();\n\n DirectBuffer readBufferOrNull();\n\n MutableDirectBuffer writeBufferOrNull();\n\n void wrap(DirectBuffer buffer, int offset);\n\n void wrap(MutableDirectBuffer buffer, int offset);\n\n void unwrap();\n\n default bo... | import org.tools4j.hoverraft.direct.DirectPayload;
import org.tools4j.hoverraft.event.Event;
import org.tools4j.hoverraft.event.EventHandler;
import org.tools4j.hoverraft.server.ServerContext;
import org.tools4j.hoverraft.state.Transition; | /**
* The MIT License (MIT)
*
* Copyright (c) 2016-2017 hover-raft (tools4j), Marco Terzer
*
* 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 limi... | default Transition accept(final ServerContext serverContext, final EventHandler eventHandler) { | 2 |
ilmila/J2EEScan | src/main/java/burp/J2EELFIRetriever.java | [
"public static boolean isApacheStrutsConfigFile(byte[] response, IExtensionHelpers helpers) {\n final byte[] STRUTS_PATTERN = \"<struts\".getBytes();\n List<int[]> matchesStruts = getMatches(response, STRUTS_PATTERN, helpers);\n\n return (matchesStruts.size() > 0);\n}",
"public static boolean isEtcPasswd... | import static burp.HTTPMatcher.isApacheStrutsConfigFile;
import static burp.HTTPMatcher.isEtcPasswdFile;
import static burp.HTTPMatcher.isEtcShadowFile;
import static burp.HTTPMatcher.isIBMWSBinding;
import static burp.HTTPMatcher.isSpringContextConfigFile;
import burp.j2ee.Confidence;
import burp.j2ee.CustomScanIssue;... | IHttpRequestResponse ibmwebRequestResponse = cb.makeHttpRequest(
baseRequestResponse.getHttpService(), helpers.stringToBytes(ibmwebLFIRequest));
byte[] ibmwebResponse = ibmwebRequestResponse.getResponse();
if (HTTPMatcher.isIBMWebExtFileWAS7(ibmwebResponse, help... | if (isApacheStrutsConfigFile(strutsResponse, helpers)) { | 0 |
apache/geronimo-gshell | gshell-core/src/main/java/org/apache/geronimo/gshell/builtins/SourceCommand.java | [
"public abstract class CommandSupport\n implements Command\n{\n protected Log log;\n\n private String name;\n\n private CommandContext context;\n\n protected CommandSupport(final String name) {\n setName(name);\n }\n\n /**\n * Sub-class <b>must</b> call {@link #setName(String)}.\n ... | import org.apache.geronimo.gshell.command.CommandException;
import org.apache.geronimo.gshell.command.MessageSource;
import org.apache.geronimo.gshell.command.Command;
import org.apache.geronimo.gshell.console.IO;
import org.apache.geronimo.gshell.Shell;
import java.io.File;
import java.io.BufferedReader;
import java.i... | /*
* 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 ... | IO io = getIO(); | 4 |
searchisko/elasticsearch-river-sysinfo | src/main/java/org/jboss/elasticsearch/river/sysinfo/SysinfoRiverPlugin.java | [
"public class JRLifecycleAction extends\n\t\tClusterAction<JRLifecycleRequest, JRLifecycleResponse, JRLifecycleRequestBuilder> {\n\n\tpublic static final JRLifecycleAction INSTANCE = new JRLifecycleAction();\n\tpublic static final String NAME = \"sysinfo_river/lifecycle\";\n\n\tprotected JRLifecycleAction() {\n\t\t... | import org.elasticsearch.action.ActionModule;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.rest.RestModule;
import org.elasticsearch.river.RiversModule;
import org.jboss.elasticsearch.river.sysinfo.mgm.lifecycle.JRLifecycleAction;
import org.jb... | /*
* JBoss, Home of Professional Open Source
* Copyright 2012 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
*/
package org.jboss.elasticsearch.river.sysinfo;
/**
* System Info River ElasticSearch Plugin class.
*
* @author Vlastimil Elias (ve... | module.registerAction(JRPeriodAction.INSTANCE, TransportJRPeriodAction.class); | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.