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 |
|---|---|---|---|---|---|---|
mjuhasz/BDSup2Sub | src/main/java/bdsup2sub/supstream/dvd/IfoParser.java | [
"public class Palette {\n /** Number of palette entries */\n private final int size;\n /** Byte buffer for RED info */\n private final byte[] r;\n /** Byte buffer for GREEN info */\n private final byte[] g;\n /** Byte buffer for BLUE info */\n private final byte[] b;\n /** Byte buffer for... | import bdsup2sub.bitmap.Palette;
import bdsup2sub.core.CoreException;
import bdsup2sub.core.Logger;
import bdsup2sub.tools.FileBuffer;
import bdsup2sub.tools.FileBufferException;
import bdsup2sub.utils.ToolBox;
import java.util.Arrays;
import static bdsup2sub.core.Constants.DEFAULT_DVD_PALETTE;
import static bdsup2sub.... | /*
* Copyright 2014 Volker Oth (0xdeadbeef) / Miklos Juhasz (mjuhasz)
*
* 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 req... | } catch (FileBufferException e) { | 4 |
Airpy/KeywordDrivenAutoTest | src/test/java/com/keyword/automation/bill/warehouse/Test003_Warehouse_TestPriceBill.java | [
"public class BrowserKeyword {\n // 不允许被初始化\n private BrowserKeyword() {\n\n }\n\n /**\n * 使用默认浏览器打开指定url\n *\n * @param requestUrl 请求url地址\n */\n public static void browserOpen(String requestUrl) {\n BrowserType bType = BrowserType.valueOf(Constants.DEFAULT_BROWSER);\n ... | import com.keyword.automation.action.BrowserKeyword;
import com.keyword.automation.base.utils.LogUtils;
import com.keyword.automation.bean.BillCell;
import com.keyword.automation.bean.BillHeader;
import com.keyword.automation.customer.BillKeyword;
import com.keyword.automation.customer.LoginKeyword;
import com.keyword.... | package com.keyword.automation.bill.warehouse;
/**
* 入口:仓库-制作单据-成本调价单<br/>
* 主要测试功能:
* 1、新增成本调价单
*
* @author Amio_
*/
public class Test003_Warehouse_TestPriceBill {
private static List<BillCell> billCellList = new ArrayList<BillCell>();
private static BillHeader billHeader = new BillHeader();
priva... | MenuKeyword.selectMenu("仓库", "成本调价单"); | 6 |
universal-automata/liblevenshtein-java | src/main/java/com/github/liblevenshtein/collection/dictionary/factory/DawgFactory.java | [
"@Slf4j\n@EqualsAndHashCode(of = {\"size\", \"root\"},\n callSuper = false)\npublic abstract class Dawg\n extends AbstractSet<String>\n implements IFinalFunction<DawgNode>,\n ITransitionFunction<DawgNode>,\n Serializable {\n\n private static final long serialVers... | import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import com.github.liblevenshtein.collection.dictionary.Dawg;
import com.github.liblevenshtein.collection.dictionary.DawgNode... | package com.github.liblevenshtein.collection.dictionary.factory;
/**
* Constructs DAWG instances.
* @author Dylon Edwards
* @since 2.1.0
*/
@Slf4j
public class DawgFactory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* Returns a new DAWG.
* @param terms Terms to ins... | public IFinalFunction<DawgNode> finalFunction(@NonNull final Dawg dictionary) { | 2 |
peshkira/c3po | c3po-webapi/app/controllers/FilterController.java | [
"public class Graph {\n\n private String property;\n private Map<String, String> options;\n private List<String> keys;\n private List<String> values;\n\n public Graph() {\n this.setOptions(new HashMap<String, String>());\n }\n\n public Graph(String p, List<String> keys, List<String> values) {\n this();... | import helpers.Graph;
import helpers.PropertyValuesFilter;
import helpers.Statistics;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import play.Logger;
import play.data.DynamicForm;
import play.mvc.Controller;
import play.mvc.Result;
i... | /*******************************************************************************
* Copyright 2013 Petar Petrov <me@petarpetrov.org>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
... | List<PropertyValuesFilter> filters = new ArrayList<PropertyValuesFilter>(); | 1 |
martinschaef/bixie | src/main/java/bixie/checker/inconsistency_checker/CdcChecker.java | [
"public class Report {\n\n\tprotected Map<Integer, Set<Set<BasicBlock>>> inconsistentBlocks = new LinkedHashMap<Integer, Set<Set<BasicBlock>>>(); \n\tprotected AbstractTransitionRelation tr;\t\n\t\n\tprotected Map<Integer, List<FaultExplanation>> faultExplanations = new LinkedHashMap<Integer, List<FaultExplanation>... | import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Set;
import java.util.LinkedHashSet;
import org.joogie.cfgPlugin.Util.Dag;
import ap.parser.IFormula;
import bixie.checker.report.Report;
import bixie.checker.transition_relati... | /**
*
*/
package bixie.checker.inconsistency_checker;
/**
* @author schaef Inconsistent code detection algorithm that uses an abstract
* graph to find paths with a sat solver, and then an smt solver to
* check if the transition relation of the path is feasible. If not, it
* ... | public Report runAnalysis(Prover prover) {
| 2 |
spoqa/battery | src/main/java/com/spoqa/battery/codecs/UrlEncodedFormEncoder.java | [
"public final class CodecUtils {\r\n public static final String TAG = \"CodecUtils\";\r\n\r\n private static final Class PRIMITIVE_TYPE_STRING = String.class;\r\n private static final Class PRIMITIVE_TYPE_INTEGER = int.class;\r\n private static final Class PRIMITIVE_TYPE_INTEGER_BOXED = Integer.class;\r... | import com.spoqa.battery.CodecUtils;
import com.spoqa.battery.FieldNameTranslator;
import com.spoqa.battery.Logger;
import com.spoqa.battery.RequestSerializer;
import com.spoqa.battery.TypeAdapterCollection;
import com.spoqa.battery.annotations.RequestBody;
import com.spoqa.battery.exceptions.SerializationExcepti... | /**
* Copyright (c) 2014-2015 Spoqa, All Rights Reserved.
*/
package com.spoqa.battery.codecs;
public class UrlEncodedFormEncoder implements RequestSerializer {
private static final String TAG = "UrlEncodedFormEncoder";
private static final String MIME_TYPE = "application/x-www-form-urlencoded... | List<Field> fields = CodecUtils.getAnnotatedFields(null, RequestBody.class, o.getClass());
| 0 |
OpenNTF/POI4Xpages | poi4xpages/bundles/biz.webgate.dominoext.poi/src/biz/webgate/dominoext/poi/component/kernel/workbook/EmbeddedDataSourceExportProcessor.java | [
"public class Data2ColumnExporter extends AbstractDataExporter implements\n\t\tIListDataExporter {\n\n\tList<RowDefinition> m_Rows;\n\tInteger m_StartColumn;\n\n\tpublic int getStartColumn() {\n\t\tif (m_StartColumn != null) {\n\t\t\treturn m_StartColumn;\n\t\t}\n\t\tValueBinding vb = getValueBinding(\"startColumn\... | import biz.webgate.dominoext.poi.util.RequestVarsHandler;
import biz.webgate.dominoext.poi.utils.exceptions.POIException;
import biz.webgate.dominoext.poi.utils.logging.LoggerFactory;
import java.util.List;
import java.util.logging.Logger;
import javax.faces.context.FacesContext;
import org.apache.poi.ss.usermodel.Shee... | /**
* Copyright (c) 2012-2021 WebGate Consulting AG and others
*
* 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 ... | WorkbookProcessor.INSTANCE.setCellValue(shProcess, nMyRow, nCol, objCurrent, clDef.isCellFormula(), clDef.getPoiCellStyle()); | 4 |
vsfexperts/LaTeX | latex-server/src/main/java/de/vsfexperts/latex/server/configuration/RendererConfiguration.java | [
"public interface LatexRenderer {\n\n\t/**\n\t * Trigger a latex render job\n\t *\n\t * @param template\n\t * to process\n\t * @return id of render job\n\t */\n\tUUID render(String template);\n\n\t/**\n\t * Retrieve render output.\n\t *\n\t * @param jobId\n\t * to identify job\n\t * @return fi... | import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configurat... | package de.vsfexperts.latex.server.configuration;
@Configuration
@ConfigurationProperties(prefix = "renderer")
public class RendererConfiguration {
@Value("${renderer.workDirectory:#{systemProperties['java.io.tmpdir']}}")
private String workDirectory;
@Value("${renderer.archiveDirectory:#{systemProperties['jav... | return new FileSystemArchive(new LocalFileSystemStorage(archiveDirectory)); | 4 |
CagataySonmez/EdgeCloudSim | src/edu/boun/edgecloudsim/edge_orchestrator/BasicEdgeOrchestrator.java | [
"public class CloudVM extends Vm {\r\n\tprivate SimSettings.VM_TYPES type;\r\n\r\n\tpublic CloudVM(int id, int userId, double mips, int numberOfPes, int ram,\r\n\t\t\tlong bw, long size, String vmm, CloudletScheduler cloudletScheduler) {\r\n\t\tsuper(id, userId, mips, numberOfPes, ram, bw, size, vmm, cloudletSchedu... | import java.util.List;
import org.cloudbus.cloudsim.Host;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.core.SimEvent;
import edu.boun.edgecloudsim.cloud_server.CloudVM;
import edu.boun.edgecloudsim.core.SimManager;
import edu.boun.edgecloudsim.core.SimSetting... | /*
* Title: EdgeCloudSim - Basic Edge Orchestrator implementation
*
* Description:
* BasicEdgeOrchestrator implements basic algorithms which are
* first/next/best/worst/random fit algorithms while assigning
* requests to the edge devices.
*
* Licence: GPL - http://www.gnu.org/copyle... | int CloudVmPicker = SimUtils.getRandomNumber(0, 100); | 7 |
adyliu/jafka | src/test/java/io/jafka/consumer/SimpleConsumerTest.java | [
"public abstract class BaseJafkaServer {\n\n static {\n //System.setProperty(\"jafka_mx4jenable\", \"true\");\n }\n\n protected Logger logger = LoggerFactory.getLogger(getClass());\n\n public Jafka createJafka() {\n Properties mainProperties = new Properties();\n return createJafka(... | import io.jafka.BaseJafkaServer;
import io.jafka.Jafka;
import io.jafka.PortUtils;
import io.jafka.api.FetchRequest;
import io.jafka.api.MultiFetchResponse;
import io.jafka.api.OffsetRequest;
import io.jafka.message.ByteBufferMessageSet;
import io.jafka.message.MessageAndOffset;
import io.jafka.producer.Producer;
impor... | // assertEquals(partitions, size);
// //
// final String largePartitionTopic = "largepartition";
// size = consumer.createPartitions(largePartitionTopic, partitions+5, true);
// assertEquals(partitions+5, size);
// sendSomeMessages(1000, largePartitionTopic);
// }
priva... | MultiFetchResponse responses = consumer.multifetch(Arrays.asList(request1, request2)); | 3 |
Nanopublication/nanopub-java | src/main/java/org/nanopub/extra/index/MakeIndex.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 class MultiNanopubRdfHandler extends AbstractRDFHandler {\n\n\tpublic static void pr... | import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPOutputStream;
import org.eclipse.rdf... | package org.nanopub.extra.index;
public class MakeIndex {
@com.beust.jcommander.Parameter(description = "input-nanopub-files")
private List<File> inputFiles = new ArrayList<File>();
@com.beust.jcommander.Parameter(names = "-fs", description = "Add index nanopubs from input files " +
"as sub-indexes (instead... | NanopubImpl.ensureLoaded(); | 4 |
fergus825/SmartOrnament | app/src/main/java/com/edu/chzu/fg/smartornament/fragment/GuardFragment.java | [
"public class MainActivity extends AppCompatActivity {\n private Fragment linkDevice,guardFragment, sosFragment, settingFragment;\n private static final long RIPPLE_DURATION = 250;\n private Toolbar toolbar;\n private FrameLayout root;\n private View contentHamburger;\n private GuillotineAnimation... | import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView... | package com.edu.chzu.fg.smartornament.fragment;
/**
* Created by FG on 2017/3/6.
*/
public class GuardFragment extends Fragment {
private LinearLayout ll_guard;
private RippleBackground rippleBackground;
private Button btn_start;
private MyApplication mMyApplication;
private HintPopupWindow ... | intentService.setClass(getActivity(), BtService.class); | 2 |
scarletsky/Bangumi-Android | app/src/main/java/io/github/scarletsky/bangumi/ui/fragments/CalendarFragment.java | [
"public class FragmentAdapter extends FragmentStatePagerAdapter {\n\n private static final String TAG = FragmentAdapter.class.getSimpleName();\n private String[] mTitles;\n private Context ctx;\n private SessionManager session = BangumiApplication.getInstance().getSession();\n\n\n public enum PagerTy... | import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.astuetz.PagerSlidingTabStrip;
import java.util.List;
import io.github.scarletsky.bangumi.R;
import io.github.scarletsky.bangumi.adapters.FragmentAda... | package io.github.scarletsky.bangumi.ui.fragments;
/**
* Created by scarlex on 15-7-2.
*/
public class CalendarFragment extends BaseToolbarFragment {
private static final String TAG = CalendarFragment.class.getSimpleName();
private List<Calendar> mCalendars;
private int currentPosition = 0;
@O... | BusProvider.getInstance().post(new GetCalendarEvent(mCalendars)); | 3 |
vert-x3/vertx-jdbc-client | src/main/java/io/vertx/ext/jdbc/impl/JDBCClientImpl.java | [
"@VertxGen\npublic interface JDBCClient extends SQLClient {\n\n /**\n * The default data source provider is C3P0\n */\n String DEFAULT_PROVIDER_CLASS = \"io.vertx.ext.jdbc.spi.impl.C3P0DataSourceProvider\";\n\n /**\n * The name of the default data source\n */\n String DEFAULT_DS_NAME = \"DEFAULT_DS\";\... | import io.vertx.core.*;
import io.vertx.core.impl.ContextInternal;
import io.vertx.core.impl.VertxInternal;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.core.spi.metrics.PoolMetrics;
import io.vertx.core.spi.metrics.VertxMetrics;
import io.vertx.ext.jdbc.JDBCClient;
import ... | /*
* Copyright (c) 2011-2014 The original author or authors
* ------------------------------------------------------
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distributi... | executeDirect(new JDBCQuery(helper, null, sql, null), resultHandler); | 2 |
wesabe/grendel | src/test/java/com/wesabe/grendel/openpgp/tests/MasterKeyTest.java | [
"public enum AsymmetricAlgorithm implements IntegerEquivalent {\n\t/**\n\t * Elgamal (Encrypt-Only)\n\t * \n\t * @see <a href=\"http://en.wikipedia.org/wiki/ElGamal_encryption\">Wikipedia</a>\n\t */\n\tELGAMAL(\t\"ElGamal\",\t\tPublicKeyAlgorithmTags.ELGAMAL_ENCRYPT) {\n\t\t@Override\n\t\tpublic AlgorithmParameterS... | import static org.fest.assertions.Assertions.*;
import java.io.FileInputStream;
import org.bouncycastle.openpgp.PGPSecretKeyRing;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunW... | package com.wesabe.grendel.openpgp.tests;
@RunWith(Enclosed.class)
public class MasterKeyTest {
public static class A_Master_Key {
private MasterKey key;
@Before
public void setup() throws Exception {
final FileInputStream keyRingFile = new FileInputStream("src/test/resources/secret-keyring.gpg");
... | } catch (CryptographicException e) { | 2 |
kaif-open/kaif-android | app/src/androidTest/java/io/kaif/mobile/view/daemon/ArticleDaemonTest.java | [
"public class Article implements Serializable {\n\n public enum ArticleType {\n EXTERNAL_LINK, SPEAK\n }\n\n private final String zone;\n\n private final String zoneTitle;\n\n private final String articleId;\n\n private final String title;\n\n private final Date createTime;\n\n private final String link;... | import static java.util.Arrays.asList;
import static org.mockito.Mockito.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import android.test.AndroidTestCase;
import io.kaif.mobile.model.Article;
import io.ka... | package io.kaif.mobile.view.daemon;
public class ArticleDaemonTest extends AndroidTestCase implements ModelFixture {
@Mock
private ArticleService mockArticleService;
@Mock
private VoteService mockVoteService;
@Mock
private DebateService mockDebateService;
private ArticleDaemon daemon;
@Overrid... | final List<Article> articles = asList(article("aId"), article("bId"), article("cId")); | 0 |
marbl/MHAP | src/main/java/edu/umd/marbl/mhap/main/KmerStatSimulator.java | [
"public class FastaData implements Cloneable\n{\n\tprivate final BufferedReader fileReader;\n\tprivate final long offset;\n\tprivate String lastLine;\n\tprivate AtomicLong numberProcessed;\n\tprivate boolean readFullFile;\n\t// length of sequences loaded\n\tprivate final ConcurrentLinkedQueue<Sequence> sequenceList... | import java.util.HashMap;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Random;
import java.util.GregorianCalendar;
import java.util.Calendar;
import java.util.HashSet;
import java.io.BufferedReader;
import java.io.PrintStream;
import edu.umd.marbl.mhap.impl.FastaData;
import edu.umd.marb... | } else if (args.length >= 7) {
usage1 = true;
} else {
printUsage();
System.exit(1);
}
KmerStatSimulator f = new KmerStatSimulator();
f.totalTrials = Integer.parseInt(args[0]);
if (usage1) {
f.requestedLength = Double.parseDouble(args[2]);
f.kmer = Integer.parseInt(args[1]);
f.overlap ... | MinHashSketch h1 = new MinHashSketch(first, this.kmer, 1256, null, true, 1.0); | 2 |
shapesecurity/bandolier | src/test/java/com/shapesecurity/bandolier/es2017/Test262.java | [
"public final class BundlerOptions {\n\n\tpublic enum ImportUnresolvedResolutionStrategy {\n\t\tCOMPILE_ERROR,\n\t\tDEFAULT_TO_UNDEFINED,\n\t\tTHROW_ON_REFERENCE,\n\t\tNOTHING\n\t}\n\n\tpublic enum ExportStrategy {\n\t\tEXPLICIT,\n\t\tALL_GLOBALS,\n\t\tNONE,\n\t}\n\n\tpublic enum DangerLevel {\n\t\tSAFE, // to spec... | import com.shapesecurity.bandolier.es2017.bundlers.BundlerOptions;
import com.shapesecurity.bandolier.es2017.bundlers.IModuleBundler;
import com.shapesecurity.bandolier.es2017.bundlers.PiercedModuleBundler;
import com.shapesecurity.bandolier.es2017.loader.FileLoader;
import com.shapesecurity.bandolier.es2017.loader.IRe... | case "onlyStrict":
onlyStrict = true;
break;
case "async":
async = true;
break;
case "module":
module = true;
break;
}
}
}
Object rawIncludes = parsedYaml.get("includes");
ImmutableList<String> includes = ImmutableList.empty();
if (rawIncludes != null) {... | buildTest262Test(source, path, info, new PiercedModuleBundler(), BundlerOptions.SPEC_OPTIONS.withDangerLevel(BundlerOptions.DangerLevel.SAFE), xfailParse) | 2 |
BlackCraze/GameResourceBot | src/main/java/de/blackcraze/grb/commands/concrete/Update.java | [
"public static Locale getResponseLocale(Message message) {\r\n Locale channelLocale = getDefaultLocale();\r\n Mate mate = getMateDao().getOrCreateMate(message, channelLocale);\r\n if (mate != null && !StringUtils.isEmpty(mate.getLanguage())) {\r\n return new Locale(mate.getLanguage());\r\n }\r\n ... | import static de.blackcraze.grb.util.CommandUtils.getResponseLocale;
import static de.blackcraze.grb.util.CommandUtils.parseStocks;
import static de.blackcraze.grb.util.InjectorUtils.getMateDao;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Scanner;
import de.blackcraze.g... | package de.blackcraze.grb.commands.concrete;
public class Update implements BaseCommand {
public void run(Scanner scanner, Message message) {
Locale responseLocale = getResponseLocale(message);
Map<String, Long> stocks = parseStocks(scanner, responseLocale);
internalUpdate(mes... | Mate mate = getMateDao().getOrCreateMate(message, getResponseLocale(message));
| 5 |
Drazuam/RunicArcana | src/main/java/com/latenighters/runicarcana/common/items/SoothLensItem.java | [
"@Mod(\"runicarcana\")\npublic class RunicArcana\n{\n // Directly reference a log4j logger.\n private static final Logger LOGGER = LogManager.getLogger();\n public static final String MODID = \"runicarcana\";\n\n //Capability Registration\n @CapabilityInject(ISymbolHandler.class)\n public static C... | import com.latenighters.runicarcana.RunicArcana;
import com.latenighters.runicarcana.common.setup.ModSetup;
import com.latenighters.runicarcana.common.symbols.Symbols;
import com.latenighters.runicarcana.common.symbols.backend.DrawnSymbol;
import com.latenighters.runicarcana.common.symbols.backend.HashableTuple;
import... | package com.latenighters.runicarcana.common.items;
public class SoothLensItem extends Item {
public SoothLensItem() {
super(new Properties().maxStackSize(1).group(ModSetup.ITEM_GROUP));
}
@Override
public ActionResultType onItemUse(ItemUseContext context) {
Chunk chunk = context.ge... | HashableTuple<List<HashableTuple<String, Object>>, List<HashableTuple<String, Object>>> prevResolution = symbols.getPrintableResolution((DrawnSymbol) symbol, chunk); | 3 |
mjeanroy/node-maven-plugin | src/main/java/com/github/mjeanroy/maven/plugins/node/mojos/CheckNodeMojo.java | [
"public class Command {\n\n\t/**\n\t * Command executable file, this executable will be run on operating system.\n\t */\n\tprivate final String executable;\n\n\t/**\n\t * Optional arguments (each arguments will be unique).\n\t */\n\tprivate final List<CommandArg> arguments;\n\n\t/**\n\t * Create new command providi... | import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.File;
import java.util.Objects;
import static com.github.mjeanroy.maven.plugins.node.commands.CommandExecutors.newExecutor;
import com.githu... | /**
* The MIT License (MIT)
*
* Copyright (c) 2015-2021 Mickael Jeanroy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights t... | private EngineConfig engines; | 3 |
NasaGeek/utexas-utilities | app/src/main/java/com/nasageek/utexasutilities/fragments/UTilitiesPreferenceFragment.java | [
"public class PasswordEditTextPreferenceDialogFragmentCompat extends EditTextPreferenceDialogFragmentCompat {\n\n public static PasswordEditTextPreferenceDialogFragmentCompat newInstance(String key) {\n final PasswordEditTextPreferenceDialogFragmentCompat\n fragment = new PasswordEditTextPr... | import android.app.Dialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.CheckBoxPreference;
import android.support.v7.preference.Preference... | package com.nasageek.utexasutilities.fragments;
/**
* Created by chris on 9/3/15.
*/
public class UTilitiesPreferenceFragment extends PreferenceFragmentCompat {
private Preference loginfield;
private Preference passwordfield;
private CheckBoxPreference autologin;
private RecyclerView.Adapter ba;... | return mApp.getAuthCookie(UTD_AUTH_COOKIE_KEY).hasCookieBeenSet(); | 4 |
RockinChaos/ItemJoin | src/me/RockinChaos/itemjoin/listeners/triggers/PlayerQuit.java | [
"public class ItemHandler {\n\t\n /**\n * Adds a list of lores to the specified ItemStack.\n * \n * @param item - The ItemStack to be modified.\n * @param lores - The list of lores to be added to the item.\n * @return The ItemStack with its newly added lores.\n */\n\tpublic static ItemStack addL... | import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
import me.RockinChaos.itemjoin.handlers.ItemHandler;
import me.RockinChaos.itemjoin.handlers.PlayerHandler;
import me.RockinChaos.itemjoin.item.ItemUtilities;
import m... | /*
* ItemJoin
* Copyright (C) CraftationGaming <https://www.craftationgaming.com/>
*
* 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 3 of the License, or
* (at your ... | ItemUtilities.getUtilities().setAuthenticating(player, player.getWorld(), TriggerType.QUIT, player.getGameMode(), "GLOBAL"); | 3 |
dedyk/JaponskiPomocnik | app/src/main/java/pl/idedyk/android/japaneselearnhelper/kanji/KanjiSearchRadical.java | [
"public class JapaneseAndroidLearnHelperApplication extends MultiDexApplication {\n\n\tpublic static final ThemeType defaultThemeType = ThemeType.BLACK;\n\t\n\tprivate static JapaneseAndroidLearnHelperApplication singleton;\n\n\tpublic static JapaneseAndroidLearnHelperApplication getInstance() {\n\t\treturn singlet... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import pl.idedyk.android.japaneselearnhelper.JapaneseAndroidLearnHelperApplication;
import pl.idedyk.android.japaneselearnhelper.MenuShorterHelper;
import pl.idedyk.andro... | package pl.idedyk.android.japaneselearnhelper.kanji;
public class KanjiSearchRadical extends Activity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuShorterHelper.onCreateOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSe... | DictionaryManagerCommon dictionaryManager = JapaneseAndroidLearnHelperApplication.getInstance().getDictionaryManager(KanjiSearchRadical.this); | 2 |
MarcGiffing/easyxml | easyxml-jdom2-example/src/test/java/easyxml/jdom2/example/NoteWriterTest.java | [
"public class GroupItemReader implements ItemReader<XMLStreamReader, Void> {\r\n\t\r\n\tprivate NoteContext context;\r\n\t\r\n\t@Override\r\n\tpublic boolean shouldHandle(ParseContext context) {\r\n\t\tthis.context = (NoteContext) context;\r\n\t\treturn context.getPath().equals(\"notes/group\");\r\n\t}\r\n\t\r\n\t@... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.xml.stream.XMLStreamException;
import org.jdom2.Element;
import org.jdom2.Namespace;
import org.junit.Test;
import com.giffing.easyxml.jdom2.example.GroupItemReader... | package easyxml.jdom2.example;
public class NoteWriterTest {
@Test
public void foo() throws XMLStreamException, Exception {
try (
InputStream inputStream = new FileInputStream(new File("src/main/resources/note.xml"));
OutputStream outputStream = new FileOutputStream(new File("target/note.xml"))) {
Wr... | .addStaxItemReader(new GroupItemReader()) | 0 |
FirebaseExtended/mlkit-material-android | app/src/main/java/com/google/firebase/ml/md/java/camera/WorkflowModel.java | [
"public class DetectedObject {\n\n private static final String TAG = \"DetectedObject\";\n private static final int MAX_IMAGE_WIDTH = 640;\n\n private final FirebaseVisionObject object;\n private final int objectIndex;\n private final FirebaseVisionImage image;\n\n @Nullable\n private Bitmap bitmap = null;\n... | import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static com.google.common.base.Preconditions.checkNotNull;
import android.app.Application;
import android.content.Context;
import androidx.annotation.MainThread;
import androidx.annotation.Nullable;
import androidx.lifecycle.AndroidViewModel;
... | /*
* Copyright 2019 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | if (PreferenceUtils.isAutoSearchEnabled(getContext())) { | 4 |
zak0/AppTycoon | app/src/main/java/jaakko/jaaska/apptycoon/ui/fragment/ProductStatsFragment.java | [
"public class Company {\n\n private static final String TAG = \"Company\";\n\n private String mName;\n private int mReputation;\n private long mValue;\n\n private long mFunds;\n\n /** All the assets that the company has, including the premises asset. */\n private List<Asset> mAssets;\n\n /**... | import android.content.res.Resources;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import jaakko.jaaska.apptycoon.R;
import jaakko.jaaska.apptycoon.engine.Company;
import jaakko.jaaska.apptycoon.engine.core.GameEngine;
import jaa... | package jaakko.jaaska.apptycoon.ui.fragment;
/**
* Fragment for displaying more detailed stats for a product and its history.
*/
public class ProductStatsFragment extends AppTycoonFragment {
private static final String TAG = "ProductStatsFragment";
Product mProduct;
public ProductStatsFragment() {
... | textViewComplexity.setText(Utils.largeNumberToNiceString(mProduct.getComplexity(), 2)); | 6 |
CollapsedDom/Stud.IP-Client | core/coreplugins/file_downloader/src/test/java/de/danner_webstudip_client/plugins/file_download/TreeMergeTest.java | [
"@JsonIgnoreProperties(ignoreUnknown = true)\npublic class CourseNode extends InnerNode {\n\n\tprivate static final long serialVersionUID = -4708003934139554204L;\n\n\tpublic String course_id;\n\tpublic String course_nr;\n\tpublic String course_type;\n\tpublic String title;\n\n\t@XmlElementWrapper(name = \"folders\... | import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import de.danner_web.studip_client.plugins.file_downloader.treeModel.CourseNode;
import de.danner_web.studip_client.plugins.file_downloader.treeModel.DocumentLeaf;... | package de.danner_webstudip_client.plugins.file_download;
public class TreeMergeTest {
private TreeRootNode tree;
@Before
public void createTree(){
tree = new TreeRootNode();
}
@After
public void cleanFileSystem(){
}
@Test
public void AddItems() {
List<SemesterNode> semList = new ArrayList<S... | DocumentLeaf doc = new DocumentLeaf(); | 1 |
desht/ScrollingMenuSign | src/main/java/me/desht/scrollingmenusign/commands/SMSAbstractCommand.java | [
"public class SMSException extends DHUtilsException {\n\n private static final long serialVersionUID = 1L;\n\n public SMSException(String message) {\n super(message);\n }\n\n}",
"public interface SMSHandler {\n /**\n * Creates a new menu\n *\n * @param name Unique name of the menu\... | import java.util.ArrayList;
import java.util.List;
import me.desht.dhutils.commands.AbstractCommand;
import me.desht.scrollingmenusign.SMSException;
import me.desht.scrollingmenusign.SMSHandler;
import me.desht.scrollingmenusign.SMSMacro;
import me.desht.scrollingmenusign.SMSMenu;
import me.desht.scrollingmenusign.SMSM... | package me.desht.scrollingmenusign.commands;
public abstract class SMSAbstractCommand extends AbstractCommand {
public SMSAbstractCommand(String label, int minArgs, int maxArgs) {
super(label, minArgs, maxArgs);
}
public SMSAbstractCommand(String label, int minArgs) {
super(label, minA... | protected int parseNumber(String s) throws SMSException { | 0 |
pktczwd/tcc-transaction | tcc-transaction-core/src/main/java/org/pankai/tcctransaction/serializer/KryoTransactionSerializer.java | [
"public class InvocationContext implements Serializable {\n\n private Class targetClass;\n\n private String methodName;\n\n private Class[] parameterTypes;\n\n private Object[] args;\n\n public InvocationContext() {\n }\n\n public InvocationContext(Class targetClass, String methodName, Class[] ... | import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import org.pankai.tcctransaction.InvocationContext;
import org.pankai.tcctransaction.Participant;
import org.pankai.tcctransaction.Terminator;
import org.pankai.tcctransaction.Transaction;
impor... | package org.pankai.tcctransaction.serializer;
/**
* Created by pankai on 2016/11/13.
*/
public class KryoTransactionSerializer implements ObjectSerializer<Transaction> {
private static Kryo kryo = null;
static {
kryo = new Kryo();
kryo.register(Transaction.class);
kryo.register(Tr... | kryo.register(InvocationContext.class); | 0 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/format/DateTimeBuilder.java | [
"public final class Instant\n extends DefaultInterfaceTemporalAccessor\n implements Temporal, TemporalAdjuster, Comparable<Instant>, Serializable {\n\n /**\n * Constant for the 1970-01-01T00:00:00Z epoch instant.\n */\n public static final Instant EPOCH = new Instant(0, 0);\n /**\n ... | import static org.threeten.bp.temporal.ChronoField.AMPM_OF_DAY;
import static org.threeten.bp.temporal.ChronoField.CLOCK_HOUR_OF_AMPM;
import static org.threeten.bp.temporal.ChronoField.CLOCK_HOUR_OF_DAY;
import static org.threeten.bp.temporal.ChronoField.EPOCH_DAY;
import static org.threeten.bp.temporal.ChronoField.HO... | }
if (fieldValues.containsKey(MICRO_OF_SECOND) && fieldValues.containsKey(NANO_OF_SECOND)) {
long nos = fieldValues.get(NANO_OF_SECOND);
addFieldValue(MICRO_OF_SECOND, nos / 1000);
fieldValues.remove(MICRO_OF_SECOND);
}
if (fieldValues.containsKey(MILL... | Instant instant = Instant.ofEpochSecond(fieldValues.remove(INSTANT_SECONDS)); | 0 |
mjedynak/builder-generator-idea-plugin | src/test/java/pl/mjedynak/idea/plugins/builder/action/handler/GenerateBuilderActionHandlerTest.java | [
"public class GoToBuilderAdditionalAction extends AbstractBuilderAdditionalAction {\r\n\r\n private static final String TEXT = \"Go to builder...\";\r\n private static final Icon ICON = IconLoader.getIcon(\"/actions/intentionBulb.png\");\r\n\r\n @NotNull\r\n @Override\r\n public String getText() {\r\... | import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.DataKeys;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
impo... | package pl.mjedynak.idea.plugins.builder.action.handler;
@RunWith(MockitoJUnitRunner.class)
public class GenerateBuilderActionHandlerTest {
@InjectMocks private GenerateBuilderActionHandler builderActionHandler;
| @Mock private BuilderVerifier builderVerifier;
| 6 |
chudooder/FEMultiplayer | src/net/fe/ConnectStage.java | [
"public class TeamBuilderStage extends Stage {\n\t\n\tprivate List<Unit> units;\n\tprivate Cursor cursor;\n\tprivate float[] repeatTimers;\n\tprivate int funds;\n\tprivate int exp;\n\tprivate TeamSelectionStage select;\n\tprivate Button end, save, load, back;\n\tprivate Button[] buttons;\n\tprivate int currButton;\... | import java.util.List;
import net.fe.builderStage.TeamBuilderStage;
import org.newdawn.slick.Color;
import chu.engine.Entity;
import chu.engine.Game;
import chu.engine.MouseEvent;
import chu.engine.Stage;
import chu.engine.anim.AudioPlayer;
import chu.engine.anim.BitmapFont;
import chu.engine.anim.Renderer;
import chu.... | package net.fe;
/**
* Player selects name and server ip
* @author Shawn
*
*/
public class ConnectStage extends Stage {
public static final Color BORDER_DARK = new Color(0x483828);
public static final Color BORDER_LIGHT = new Color(0xf8f0c8);
public static final Color NEUTRAL = new Color(0xb0a878);
public... | FEMultiplayer.setCurrentStage(new TeamBuilderStage(true, null, null)); | 0 |
dcodecasa/CTBNCToolkit | CTBNCToolkit/performances/ZJTESTMicroMacroClusteringPerformances.java | [
"public class CTTrajectory<TimeType extends Number> implements ITrajectory<TimeType> {\r\n\r\n\tprivate NodeIndexing nodeIndexing;\r\n\tprivate String name;\r\n\tprivate List<CTTransition<TimeType>> transitions;\r\n\t\r\n\t/**\r\n\t * Empty constructor. To use the trajectory\r\n\t * after called this constructor yo... | import static org.junit.Assert.*;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.Vector;
import org.junit.Test;
import CTBNCToolkit.CTTrajectory;
import CTBNCToolkit.ClassificationResults;
import CTBNCToolkit.IClassificatio... | @Test
public void testGetRandStatisticMacro() {
MicroMacroClusteringPerformances<Double,ClusteringExternalPerformances<Double>> aggPerformances = generatePerformances();
aggPerformances.setMicroFlag(false);
assertTrue( this.dEqual( aggPerformances.getRandStatistic(), 7/10.0));
}
/**
* Test method for {@... | ClassificationResults<Double> trj; | 1 |
anjlab/sat3 | 3-sat-core/src/test/java/com/anjlab/sat3/TestHelper.java | [
"public static final ITripletValue _000_instance = new _000();\r",
"public static final ITripletValue _001_instance = new _001();\r",
"public static final ITripletValue _010_instance = new _010();\r",
"public static final ITripletValue _011_instance = new _011();\r",
"public static final ITripletValue _100_... | import static com.anjlab.sat3.SimpleTripletValueFactory._000_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._001_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._010_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._011_instance;
import static com.anjlab.sat3.Si... | /*
* Copyright (c) 2010 AnjLab
*
* This file is part of
* Reference Implementation of Romanov's Polynomial Algorithm for 3-SAT Problem.
*
* Reference Implementation of Romanov's Polynomial Algorithm for 3-SAT Problem
* is free software: you can redistribute it and/or modify
* it under the terms of t... | assertTrue(s1.getTier(3).contains(_110_instance));
| 6 |
WorldSEnder/MCAnm | src/main/java/com/github/worldsender/mcanm/common/skeleton/LegacyModelAsSkeleton.java | [
"public class RawData implements IModelVisitable {\n\tpublic static final long MAGIC_NUMBER = Utils.asciiToMagicNumber(\"MHFC MDL\");\n\n\tpublic static final RawData MISSING_DATA;\n\n\tstatic {\n\t\tMISSING_DATA = new RawData();\n\t\tMISSING_DATA.artist = \"<unknown>\";\n\t\tMISSING_DATA.modelUUID = new UUID(0, 0)... | import com.github.worldsender.mcanm.client.mcanmmodel.stored.RawData;
import com.github.worldsender.mcanm.common.exceptions.ModelFormatException;
import com.github.worldsender.mcanm.common.resource.IResource;
import com.github.worldsender.mcanm.common.resource.IResourceLocation;
import com.github.worldsender.mcanm.comm... | package com.github.worldsender.mcanm.common.skeleton;
@Deprecated
public class LegacyModelAsSkeleton extends AbstractSkeleton {
| private static ISkeletonVisitable load(IResource resource) { | 4 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/google/android/apps/common/testing/accessibility/framework/suggestions/RedundantDescriptionFixSuggestionProducer.java | [
"public class AccessibilityHierarchyCheckResult extends AccessibilityCheckResult {\n\n private final int resultId;\n private final @Nullable ViewHierarchyElement element;\n private final @Nullable ResultMetadata metadata;\n private final ImmutableList<Answer> answers;\n\n /**\n * Constructor when there are {... | import static com.google.common.base.Preconditions.checkNotNull;
import com.google.android.apps.common.testing.accessibility.framework.AccessibilityHierarchyCheckResult;
import com.google.android.apps.common.testing.accessibility.framework.Parameters;
import com.google.android.apps.common.testing.accessibility.framewor... | package com.google.android.apps.common.testing.accessibility.framework.suggestions;
/**
* A {@link FixSuggestionsProvider} which recommends setting the {@code contentDescription} view
* attribute to a suggested value if the culprit view's speakable text contains redundant
* information about the view's type.
*/
... | AccessibilityHierarchyCheckResult checkResult, | 0 |
fablab-fribourg/EggBot | GCodeSender/src/main/java/net/collaud/fablab/gcodesender/controller/ControlController.java | [
"@Component\n@Slf4j\npublic class Config implements Constants {\n\t\n\tprivate final Properties prop;\n\t\n\tprivate Config() {\n\t\tInputStream is;\n\t\tprop = new Properties();\n\t\tFile f = new File(CONFIG_FILE);\n\t\ttry {\n\t\t\tis = new FileInputStream(f);\n\t\t\tprop.load(is);\n\t\t} catch (IOException ex) {... | import java.net.URL;
import java.util.Map;
import java.util.Optional;
import java.util.ResourceBundle;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Semaphore;
import javafx.beans.property.DoubleProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
i... | package net.collaud.fablab.gcodesender.controller;
/**
* FXML Controller class
*
* @author Gaetan Collaud
*/
@Controller
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
@Slf4j
public class ControlController implements Initializable {
@Autowired | private GcodeService gcodeService; | 4 |
idega/com.idega.company | src/java/com/idega/company/companyregister/business/CompanyRegisterBusinessBean.java | [
"public interface Company extends IDOEntity {\n\t/**\n\t * @see com.idega.company.data.CompanyBMPBean#getGroup\n\t */\n\tpublic Group getGroup();\n\n\t/**\n\t * @see com.idega.company.data.CompanyBMPBean#getType\n\t */\n\tpublic CompanyType getType();\n\n\t/**\n\t * @see com.idega.company.data.CompanyBMPBean#getNam... | import java.rmi.RemoteException;
import java.util.Collection;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.FinderException;
import com.idega.business.IBOLookupException;
import com.idega.business.IBORuntimeException;
import com.idega.business.IBOServiceBea... | company_registry.setRecipientName(recipientName);
}
Address addressBean = company_registry.getAddress();
if(addressBean == null) {
try {
addressBean = getAddressHome().create();
addressBean.setAddressType(getAddressHome().getAddressType1());
} catch(Exception re) {
logger.log(... | OperationForm operationFormBean = ((OperationFormHome) IDOLookup.getHome(OperationForm.class)).findOperationFormByUniqueCode(operationForm); | 4 |
liaozhoubei/NetEasyNews | app/src/main/java/cn/bproject/neteasynews/webview/WebViewActivity.java | [
"public class CommonUtils {\n\n /**\n * 随机颜色\n */\n public static int randomColor() {\n Random random = new Random();\n int red = random.nextInt(150) + 50;//50-199\n int green = random.nextInt(150) + 50;//50-199\n int blue = random.nextInt(150) + 50;//50-199\n return... | import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
impo... | package cn.bproject.neteasynews.webview;
public class WebViewActivity extends AppCompatActivity implements IWebPageView {
// 进度条
ProgressBar mProgressBar;
WebView webView;
// 全屏时视频加载view
FrameLayout videoFullView;
Toolbar mTitleToolBar;
// 进度条是否加载到90%
public boolean mProgress90;
... | StatusBarUtil.setColor(this, CommonUtils.getColor(R.color.colorTheme),0); | 0 |
OfficeDev/O365-Android-Snippets | app/src/main/java/com/microsoft/office365/snippetapp/UserGroupStories/GetADUsersStory.java | [
"public class UsersAndGroupsSnippets {\n\n DirectoryClient mDirectoryClient;\n\n public UsersAndGroupsSnippets(DirectoryClient directoryClient) {\n mDirectoryClient = directoryClient;\n }\n\n /**\n * Return a list of users from Active Directory, sorted by display name..\n *\n * @retur... | import com.microsoft.directoryservices.User;
import com.microsoft.directoryservices.odata.DirectoryClient;
import com.microsoft.office365.snippetapp.Snippets.UsersAndGroupsSnippets;
import com.microsoft.office365.snippetapp.helpers.AuthenticationController;
import com.microsoft.office365.snippetapp.helpers.BaseUserStor... | package com.microsoft.office365.snippetapp.UserGroupStories;
public class GetADUsersStory extends BaseUserStory {
private static final String STORY_DESCRIPTION = "Gets users from Active Directory";
@Override
public String execute() {
boolean isStoryComplete;
StringBuilder resultMessage ... | AuthenticationController | 1 |
Bpazy/finalspeed | src/main/java/net/fs/rudp/Route.java | [
"public class CapEnv {\n\n private final int COUNT = -1;\n private final int READ_TIMEOUT = 1;\n private final int SNAPLEN = 10 * 1024;\n public MacAddress gateway_mac;\n public MacAddress local_mac;\n public PcapHandle sendHandle;\n public boolean tcpEnable = false;\n public boolean fwSucce... | import net.fs.cap.CapEnv;
import net.fs.cap.VDatagramSocket;
import net.fs.rudp.message.MessageType;
import net.fs.utils.ByteIntConvert;
import net.fs.utils.MLog;
import net.fs.utils.MessageCheck;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAd... | package net.fs.rudp;
public class Route {
public static ThreadPoolExecutor es;
public static int mode_server = 2;
public static int mode_client = 1;
public static int localDownloadSpeed, localUploadSpeed;
private static List<Trafficlistener> listenerList = new Vector<>();
stat... | final int connectId = ByteIntConvert.toInt(dpData, 4);
| 3 |
segator/proxylive | src/main/java/com/github/segator/proxylive/tasks/DirectTranscodeTask.java | [
"@Configuration\n@ConfigurationProperties\npublic class ProxyLiveConfiguration {\n private final Logger logger = LoggerFactory.getLogger(DirectTranscodeTask.class);\n private final JwtHelper jwtHelper;\n private BufferingConfiguration buffers;\n private FFMpegConfiguration ffmpeg;\n private HttpLiveS... | import com.github.segator.proxylive.config.ProxyLiveConfiguration;
import com.github.segator.proxylive.entity.Channel;
import com.github.segator.proxylive.processor.IStreamProcessor;
import com.github.segator.proxylive.profiler.FFmpegProfilerService;
import com.github.segator.proxylive.service.TokenService;
import com.... | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.github.segator.proxylive.tasks;
/**
*
* @author isaac
*/
public class DirectTranscodeTask implements IMultiplexerStre... | private ProxyLiveConfiguration config; | 0 |
tomayac/rest-describe-and-compile | src/com/google/code/apis/rest/client/Tree/RepresentationItem.java | [
"public class GuiFactory implements WindowResizeListener {\r\n private static DockPanel blockScreen;\r\n public static Strings strings;\r\n public static Notifications notifications; \r\n private DockPanel dockPanel;\r\n public static final String restCompile = \"restCompile\";\r\n public static final String... | import java.util.Iterator;
import java.util.Vector;
import com.google.code.apis.rest.client.GUI.GuiFactory;
import com.google.code.apis.rest.client.GUI.SettingsDialog;
import com.google.code.apis.rest.client.Util.SyntaxHighlighter;
import com.google.code.apis.rest.client.Wadl.ApplicationNode;
import com.google.code.api... | package com.google.code.apis.rest.client.Tree;
public class RepresentationItem extends Composite {
private static final String application_xml = "application/xml";
public RepresentationItem(final RepresentationNode representation, final Object parentNode, final TreeItem parentTreeItem) {
VerticalPanel... | final Hyperlink showDetails = new Hyperlink(GuiFactory.strings.showDetails(), ""); | 0 |
huanghaibin-dev/CalendarView | app/src/main/java/com/haibin/calendarviewproject/full/FullActivity.java | [
"@SuppressWarnings(\"all\")\npublic final class Calendar implements Serializable, Comparable<Calendar> {\n private static final long serialVersionUID = 141315161718191143L;\n\n\n /**\n * 年\n */\n private int year;\n\n /**\n * 月1-12\n */\n private int month;\n\n /**\n * 如果是闰月,则返... | import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import com.haibin.calendarview.Calendar;
import com.haibin.calendarview.CalendarView;
import com.haibin.calendarviewproject.R;
import ... | package com.haibin.calendarviewproject.full;
/**
* 全屏日历,因为月份大小不同的关系,需要 app:month_view_show_mode="mode_all",
* 一般地,既然使用全屏日历,那也不必要
* Created by huanghaibin on 2019/3/7.
*/
public class FullActivity extends BaseActivity implements
CalendarView.OnCalendarSelectListener,
CalendarView.OnYearChangeLis... | CustomActivity.show(this); | 4 |
recommenders/rival | rival-recommend/src/main/java/net/recommenders/rival/recommend/frameworks/ranksys/RanksysRecommenderRunner.java | [
"public class TemporalDataModel<U, I> extends DataModel<U, I> implements TemporalDataModelIF<U, I> {\n\n /**\n * The map with the timestamps between users and items.\n */\n protected Map<U, Map<I, Set<Long>>> userItemTimestamps;\n\n /**\n * Default constructor.\n */\n public TemporalData... | import es.uam.eps.ir.ranksys.core.Recommendation;
import es.uam.eps.ir.ranksys.core.preference.ConcatPreferenceData;
import es.uam.eps.ir.ranksys.core.preference.PreferenceData;
import es.uam.eps.ir.ranksys.core.preference.SimplePreferenceData;
import es.uam.eps.ir.ranksys.fast.index.FastItemIndex;
import es.uam.eps.ir... | /*
* Copyright 2017 recommenders.net.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... | public TemporalDataModelIF<Long, Long> run(final RUN_OPTIONS opts) throws RecommenderException, IOException { | 1 |
janishar/JPost | android-jpost/src/main/java/com/mindorks/androidjpost/AndroidBroadcastCenter.java | [
"public class AndroidPrivateChannel<\n Q extends PriorityBlockingQueue<WeakReference<ChannelPost>>,\n M extends ConcurrentHashMap<Integer,WeakReference<Object>>>\n extends PrivateChannel<Q,M> {\n\n public AndroidPrivateChannel(Integer channelId, ChannelState state, ChannelType type, Q postQu... | import com.mindorks.androidjpost.droid.AndroidPrivateChannel;
import com.mindorks.androidjpost.droid.AndroidPublicChannel;
import com.mindorks.jpost.core.BroadcastCenter;
import com.mindorks.jpost.core.Channel;
import com.mindorks.jpost.core.ChannelPost;
import com.mindorks.jpost.core.ChannelState;
import com.mindorks.... | /*
* Copyright (C) 2016 Janishar Ali Anwar
*
* 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... | ChannelState.OPEN, | 5 |
igd-geo/mongomvcc | src/test/java/de/fhg/igd/mongomvcc/impl/MongoDBVDatabaseBenchmark.java | [
"public interface VBranch {\n\t/**\n\t * @return the CID of the branch's head\n\t */\n\tlong getHead();\n\t\n\t/**\n\t * <p>Gets or creates a database collection. Collections have no special\n\t * meaning, they are just used to group objects.</p>\n\t * <p>The collection's state depends on the branch currently check... | import static org.junit.Assert.assertTrue;
import java.util.Map;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import com.carrotsearch.junitbenchmarks.AbstractBenchmark;
import com.carrotsearch.junitbenchmarks.BenchmarkOptions;
import com.... | // This file is part of MongoMVCC.
//
// Copyright (c) 2012 Fraunhofer IGD
//
// MongoMVCC is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any l... | VCollection coll = _master.getCollection("persons"); | 1 |
eguller/MouseRecorder | src/main/java/com/eguller/mouserecorder/ui/MainWindow.java | [
"public interface Config {\n public Config activateMinimizeOnPlay();\n\n public Config deactivateMinimizeOnPlay();\n\n public Config activateMinimizeOnRecord();\n\n public Config deactivateMinimizeOnRecord();\n\n public Config setSpeed(double speed);\n\n public double getSpeed();\n\n public boo... | import com.eguller.mouserecorder.config.Config;
import com.eguller.mouserecorder.format.def.DefaultFormat;
import com.eguller.mouserecorder.player.api.LoopEventListener;
import com.eguller.mouserecorder.player.api.Player;
import com.eguller.mouserecorder.player.event.LoopStartedEvent;
import com.eguller.mouserecorder.r... | package com.eguller.mouserecorder.ui;
/**
* User: eguller
* Date: 11/24/13
* Time: 3:28 PM
*/
public class MainWindow extends JFrame implements Observer, LoopEventListener, KeyListener {
JMenuBar menuBar;
JButton playButton;
JButton recordButton;
JButton stopButton;
JMenu fileMenu;
JMen... | ButtonStates.PRERECORD.apply(this); | 7 |
Open-RIO/ToastAPI | src/main/java/jaci/openrio/toast/core/command/cmd/CommandProfiler.java | [
"public class Toast extends RobotBase {\n\n private static String[] tastes = new String[] {\"Delicious\", \"Yummy\", \"Like a buttery heaven\", \"Needs more salt\", \"Hot, Hot, HOT!!\", \"TOTE-aly delicious\"};\n\n private static Toast instance;\n\n public Toast() {\n super();\n instance = th... | import com.grack.nanojson.JsonWriter;
import jaci.openrio.toast.core.Toast;
import jaci.openrio.toast.core.command.AbstractCommand;
import jaci.openrio.toast.core.command.IHelpable;
import jaci.openrio.toast.lib.log.Logger;
import jaci.openrio.toast.lib.math.MathHelper;
import jaci.openrio.toast.lib.profiler.Profiler;
... | package jaci.openrio.toast.core.command.cmd;
/**
* The profiler command will print out data related to Toast's main, initialization profiler. This command comes with a
* few flags to modify the output:
* --json, -j Print the data as a JSON Object
* --export, -e Export the data to file
* -o ... | for (ProfilerEntity ent : section.entities()) { | 4 |
XYScience/StopApp | app/src/main/java/com/sscience/stopapp/activity/SettingActivity.java | [
"public abstract class BaseActivity extends AppCompatActivity {\n\n private static final int REQUEST_PERMISSION_CODE = 1000;\n\n protected abstract int getContentLayout();\n\n protected abstract void doOnCreate(@Nullable Bundle savedInstanceState);\n\n private PermissionCallback mPermissionCallback;\n\n... | import android.app.Activity;
import android.content.ComponentName;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Coordina... | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
if (TextUtils.isEmpty((CharSequence) SharedPreferenceUtil
.get(SettingActivity.this, ShortcutsManager.SP_ADD_SHORTCUT_MODE, ""))) {
AppListActivity.actionStartActivity(Settin... | AppsRepository appsRepository = new AppsRepository(this); | 1 |
krokers/exchange-rates-mvvm | presentation/src/main/java/eu/rampsoftware/er/di/CurrenciesActivityModule.java | [
"public interface CurrencyRepository {\n\n Observable<CurrencyData> getCurrencies(final Date date);\n\n Observable<SingleValue> getSeries(Date from, Date to, String currencyCode);\n}",
"public interface PreferencesData {\n void setCurrenciesExchangeDate(Date date);\n Optional<Date> getCurrenciesExchan... | import android.app.Activity;
import dagger.Module;
import dagger.Provides;
import eu.rampsoftware.er.data.CurrencyRepository;
import eu.rampsoftware.er.data.PreferencesData;
import eu.rampsoftware.er.domain.usecases.GetCurrenciesRatesDate;
import eu.rampsoftware.er.domain.usecases.GetCurrenciesUseCase;
import eu.rampso... | package eu.rampsoftware.er.di;
/**
* Dagger module responsible for providing {@link CurrenciesActivitySubComponent} dependencies. Scope
* of provided dependencies must match the scope of component, which is {@link CurrenciesActivityScope}.
*/
@Module
public class CurrenciesActivityModule implements ICurrenciesAc... | final PreferencesData preferencesData) { | 1 |
SpongePowered/event-impl-gen | src/main/java/org/spongepowered/eventimplgen/processor/EventImplWriter.java | [
"public final class AnnotationUtils {\n\n private AnnotationUtils() {\n }\n\n @SuppressWarnings({\"unchecked\", \"TypeParameterUnusedInFormals\"})\n public static <T> T getValue(final AnnotationMirror anno, final String key) {\n if (anno == null) {\n return null;\n }\n\n ... | import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.JavaFile;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.spongepowered.api.util.annotation.eventgen.ImplementedBy;
import org.spongepowered.eventimplgen.AnnotationUtils;
import org.spongepowered.eventimplgen.eventgencore.Proper... | /*
* This file is part of Event Implementation Generator, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documenta... | final TypeElement event, final List<Property> property, final Set<? extends Element> originating) { | 1 |
monsterLin/Pigeon | app/src/main/java/com/monsterlin/pigeon/ui/family/CreateFamilyActivity.java | [
"public class MainActivity extends AppCompatActivity {\n\n private Toolbar mToolBar ;\n private BottomBar mBottomBar;\n private ViewPager mVpContent;\n private ViewPagerAdapter adapter;\n\n private List<Fragment> fragmentList;\n private long exitTime = 0;\n\n\n @Override\n public void onCrea... | import android.support.design.widget.TextInputLayout;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import com.monsterlin.pigeon.MainActivity;
import com.monsterlin.pigeon.R;
impo... | package com.monsterlin.pigeon.ui.family;
/**
* @author : monsterLin
* @version : 1.0
* @email : monster941025@gmail.com
* @github : https://github.com/monsterLin
* @time : 2017/8/5
* @desc : 创建家庭
*/
public class CreateFamilyActivity extends BaseActivity {
private Toolbar mToolBar;
private TextInputL... | SPUtils.putBoolean(FamilyConfig.SPEXIST, true); | 6 |
MaLeLabTs/RegexGenerator | Random Regex Turtle/src/it/units/inginf/male/terminalsets/TokenizedTerminalSetBuilder.java | [
"public class Configuration {\n\n private static final Logger LOG = Logger.getLogger(Configuration.class.getName()); \n \n /**\n * Initializes with default values, parameters and operators.\n */\n public Configuration() {\n this.evolutionParameters = new EvolutionParameters();\n t... | import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import it.units.inginf.male.configuration.Configuration;
import it.units.inginf.male.inputs.Context;
import it.units.inginf.male.inputs.DataSet;
import it.units.inginf.male.inputs.DataSet.Example;
import it.units.inginf.ma... | /*
* Copyright (C) 2015 Machine Learning Lab - University of Trieste,
* Italy (http://machinelearning.inginf.units.it/)
*
* 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 ... | NodeFactory nodeFactory = configuration.getNodeFactory(); | 5 |
zaproxy/zaproxy | zap/src/main/java/org/parosproxy/paros/extension/history/ExtensionHistory.java | [
"public final class Constant {\n // ZAP: rebrand\n public static final String PROGRAM_NAME = \"OWASP ZAP\";\n public static final String PROGRAM_NAME_SHORT = \"ZAP\";\n /** @deprecated (2.9.0) Do not use, it will be removed. */\n @Deprecated public static final String ZAP_HOMEPAGE = \"http://www.owas... | import org.parosproxy.paros.network.HttpMessage;
import org.parosproxy.paros.view.View;
import org.zaproxy.zap.ZAP;
import org.zaproxy.zap.eventBus.Event;
import org.zaproxy.zap.eventBus.EventConsumer;
import org.zaproxy.zap.extension.alert.AlertEventPublisher;
import org.zaproxy.zap.extension.alert.ExtensionAlert;
imp... |
if (hasView()) {
getView().displayMessage(null);
}
} else {
try {
EventQueue.invokeAndWait(
new Runnable() {
@Override
public void run() {
... | public void sessionModeChanged(Mode mode) { | 2 |
ErinDavid/elastic-config | elastic-config-spring/src/main/java/com/github/config/spring/namespace/parser/SpringZookeeperElasticConfigGroup.java | [
"@Setter\n@Getter\n@ToString\n@NoArgsConstructor\npublic class ZookeeperConfigProfile extends ConfigProfile {\n\n\tpublic ZookeeperConfigProfile(String serverlist, String namespaces, String rootNode, String version) {\n\t\tsuper(rootNode, version);\n\t\tthis.serverlist = serverlist;\n\t\tthis.namespaces = namespace... | import java.beans.PropertyDescriptor;
import java.io.File;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Map;
import lombok.Setter;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues... | package com.github.config.spring.namespace.parser;
/**
* 基于Spring的Zookeeper的注册中心配置.
*
* @author ZhangWei
*/
@Slf4j
public final class SpringZookeeperElasticConfigGroup extends ZookeeperElasticConfigGroup implements
BeanFactoryPostProcessor, ApplicationContextAware, PriorityOrdered {
private static fi... | PropertySourcesEnum.LOCALPROPERTIES.getName(), optional.get()); | 5 |
atzedijkstra/ssm | src/nl/uu/cs/ssmui/StepManager.java | [
"public class Machine\n{\n protected Memory memory ;\n protected Registers registers ;\n protected MachineState state ;\n \n private Messenger messenger ;\n \n public Machine( MachineState st, Messenger m )\n {\n state = st ;\n m... | import java.util.Vector;
import nl.uu.cs.ssm.Machine;
import nl.uu.cs.ssm.MachineState;
import nl.uu.cs.ssm.MachineStateEvent;
import nl.uu.cs.ssm.MachineStateListener;
import nl.uu.cs.ssm.Memory;
import nl.uu.cs.ssm.MemoryCellEvent;
import nl.uu.cs.ssm.MemoryCellListener;
import nl.uu.cs.ssm.Registers;
import nl.uu.cs... | /**
* Simple Stack Machine
*
* Written by Atze Dijkstra, atze@cs.uu.nl,
* Copyright Utrecht University.
*
*/
package nl.uu.cs.ssmui ;
public class StepManager
implements MemoryCellListener, MachineStateListener
{
private MachineState machineState ;
private Memory memory ; | private Registers registers ; | 7 |
xylo/JErgometer | src/org/jergometer/gui/MainWindow.java | [
"public class VelocityUtils {\r\n\tprivate static boolean initialized = false;\r\n\r\n\tpublic static void init() throws Exception {\r\n\t\tif (initialized) return;\r\n\r\n\t\t// initialize Velocity\r\n\t\tInputStream inputStream = StreamUtils.getInputStream(\"velocity.properties\");\r\n\t\tProperties properties = ... | import de.endrullis.utils.VelocityUtils;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.exception.ResourceNotFoundException;
import org.jergometer.Jergometer;
import org.jergometer.control.BikeProgram;
import org.jergometer.model.*;
import org.jergomet... | package org.jergometer.gui;
/**
* Main window.
*/
public class MainWindow extends JFrame implements ActionListener, TreeSelectionListener, ListSelectionListener, KeyListener {
private static double kcalFactor = 0.239005736;
private Properties iconMap = new Properties();
{
try {
| iconMap.load(StreamUtils.getInputStream("org/jergometer/images/icon_map.properties"));
| 5 |
tekrei/JavaExamples | ThreadSync/src/main/java/ds/Main.java | [
"public class FlourProducer extends Thread {\n\n private final Silo silo;\n\n public FlourProducer(Silo silo) {\n super(\"Flour Producer\");\n this.silo = silo;\n }\n\n public void run() {\n while (true) {\n try {\n sleep((int) (Math.random() * 100));\n ... | import ds.producer.FlourProducer;
import ds.producer.OilProducer;
import ds.producer.SugarProducer;
import ds.shop.HalvahShop;
import ds.shop.HotFlakyPastyShop;
import ds.silo.Silo; | package ds;
public class Main {
public static void main(String[] args) {
Silo sugarSilo = new Silo("Sugar");
Silo oilSilo = new Silo("Oil");
Silo flourSilo = new Silo("Flour");
new SugarProducer(sugarSilo).start(); | new OilProducer(oilSilo).start(); | 1 |
kdgregory/pathfinder | lib-servlet/src/test/java/com/kdgregory/pathfinder/servlet/TestServletInspector.java | [
"public enum HttpMethod\n{\n ALL(\"\"),\n GET(\"GET\"),\n POST(\"POST\"),\n PUT(\"PUT\"),\n DELETE(\"DELETE\");\n\n private String stringValue;\n\n HttpMethod(String stringValue)\n {\n this.stringValue = stringValue;\n }\n\n @Override\n public String toString()\n {\n ... | import org.junit.Test;
import static org.junit.Assert.*;
import com.kdgregory.pathfinder.core.HttpMethod;
import com.kdgregory.pathfinder.core.PathRepo;
import com.kdgregory.pathfinder.core.WarMachine;
import com.kdgregory.pathfinder.core.impl.PathRepoImpl;
import com.kdgregory.pathfinder.test.WarNames;
import com.kdgr... | // Copyright (c) Keith D Gregory
//
// 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 ... | PathRepo repo = new PathRepoImpl(); | 3 |
Piasy/decaf-mind-compiler | decaf_PA4/src/decaf/Driver.java | [
"public abstract class Tree {\n\n /**\n * Toplevel nodes, of type TopLevel, representing entire source files.\n */\n public static final int TOPLEVEL = 1;\n\n /**\n * Import clauses, of type Import.\n */\n public static final int IMPORT = TOPLEVEL + 1;\n\n /**\n * Class definition... | import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import decaf.tree.Tree;
import decaf.backend.Mips;
import decaf.dataflow.FlowGraph;
import decaf.error.DecafError;
import decaf.frontend.Lexer;
import dec... | package decaf;
public final class Driver {
private static Driver driver;
private Option option;
private List<DecafError> errors;
private ScopeStack table;
private Lexer lexer;
private Parser parser;
public ScopeStack getTable() {
return table;
}
public static Driver getDriver() {
return driver;
... | TypeCheck.checkType(tree); | 7 |
kinnla/eniac | src/eniac/data/type/EType.java | [
"public class EData extends Observable implements Comparable<EData> {\n\n\t// static key indicating that that a repaint is recommended.\n\tpublic static final String REPAINT = \"repaint\"; //$NON-NLS-1$\n\n\tpublic static final String PAINT_IMMEDIATELY = \"paint_immediately\"; //$NON-NLS-1$\n\n\tpublic enum Tag {\n... | import java.util.Arrays;
import eniac.data.model.EData;
import eniac.data.view.EPanel;
import eniac.skin.Descriptor;
import eniac.util.EProperties;
import eniac.util.StringConverter; | /*******************************************************************************
* Copyright (c) 2003-2005, 2013 Till Zoppke.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available... | private Descriptor[] _descriptors; | 2 |
mslosarz/nextrtc-signaling-server | src/test/java/org/nextrtc/signalingserver/cases/TextMessageTest.java | [
"@ContextConfiguration(classes = {TestConfig.class})\n@RunWith(SpringJUnit4ClassRunner.class)\npublic abstract class BaseTest {\n\n @Autowired\n private CreateConversation create;\n\n @Autowired\n private JoinConversation join;\n\n @Autowired\n private Members members;\n\n @Autowired\n priva... | import org.junit.Test;
import org.nextrtc.signalingserver.BaseTest;
import org.nextrtc.signalingserver.MessageMatcher;
import org.nextrtc.signalingserver.domain.Member;
import org.nextrtc.signalingserver.domain.Signal;
import org.nextrtc.signalingserver.repository.Members;
import org.springframework.beans.factory.annot... | package org.nextrtc.signalingserver.cases;
public class TextMessageTest extends BaseTest {
@Autowired
private TextMessage textMessage;
@Autowired | private Members members; | 4 |
mikaelhg/openblocks | src/main/java/edu/mit/blocks/codeblocks/Block.java | [
"public enum PositionType { SINGLE, MIRROR, BOTTOM, TOP };",
"public class BlockImageIcon extends JLabel {\n\n private static final long serialVersionUID = 328149080423L;\n\n /**\n * ImageLocation specifies the relative location of this BlockImageIcon within the visible\n * Block instance of this Bl... | import java.awt.Color;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import o... | i++;
} else {
index++;
}
}
}
/**
* Returns true if the given expandable socket can be removed.
*/
private boolean canRemoveSocket(BlockConnector socket) {
int total = sockets.size();
int first = -1;
... | public boolean setSocketAt(int index, String kind, PositionType pos, String label, boolean isLabelEditable, boolean isExpandable, Long blockID) {
| 0 |
TORU0239/ViperUsage | app/src/main/java/toru/io/my/viperusage/view/InitActivity.java | [
"public class InstagramItemModel {\n private String id;\n private String code;\n\n private UserModel user;\n\n private ImageModel images;\n\n @SerializedName(\"created_time\")\n private long createdTime;\n\n @SerializedName(\"caption\")\n private CaptionModel caption;\n\n @SerializedName(... | import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import java.util.ArrayList;
import java.util.List;
import toru.io.my.viperusage.R;
import toru.io.my.viperusage.databindin... | package toru.io.my.viperusage.view;
public class InitActivity extends AppCompatActivity implements InitView {
private static final String TAG = InitActivity.class.getSimpleName();
private InitPresenter presenter;
private ActivityInitBinding binding;
@Override
protected void onCreate(Bundle sa... | presenter = new InitPresenterImp(this); | 3 |
andrew-nguyen/ucanaccess | src/main/java/net/ucanaccess/converters/Persist2Jet.java | [
"public class InsertCommand implements ICommand {\n\tprivate Database dbIO;\n\tprivate String execId;\n\tprivate Object[] newRow;\n\tprivate Table table;\n\tprivate String tableName;\n\n\tpublic InsertCommand(String tableName, Database dbIO, Object[] newRow,\n\t\t\tString execId) {\n\t\tsuper();\n\t\tthis.tableName... | import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.ut... | /*
Copyright (c) 2012 Marco Amadei.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in th... | DBReference.addOnReloadRefListener(new OnReloadReferenceListener() { | 5 |
konifar/annict-android | app/src/test/java/com/konifar/annict/viewmodel/MyProgramsViewModelTest.java | [
"public class MockHelper {\n\n public static List<Program> mockPrograms(int programsCount) {\n List<Program> mockPrograms = new ArrayList<>();\n\n for (int i = 0; i < programsCount; i++) {\n mockPrograms.add(new Program());\n }\n return mockPrograms;\n }\n}",
"public c... | import com.konifar.annict.BuildConfig;
import com.konifar.annict.helper.MockHelper;
import com.konifar.annict.helper.RxHelper;
import com.konifar.annict.model.Program;
import com.konifar.annict.repository.ProgramRepositoryImpl;
import com.konifar.annict.util.PageNavigator;
import org.junit.After;
import org.junit.Befor... | package com.konifar.annict.viewmodel;
@RunWith(RobolectricTestRunner.class)
@Config(constants = BuildConfig.class, sdk = 21)
public class MyProgramsViewModelTest {
private MyProgramsViewModel viewModel;
@Mock
private Context context;
@Mock
private ProgramRepositoryImpl repository;
@Mo... | private PageNavigator pageNavigator; | 4 |
tfiskgul/mux2fs | core/src/test/java/se/tfiskgul/mux2fs/mux/MuxerTest.java | [
"public static final int SUCCESS = 0;",
"public abstract class Fixture {\n\n\tprotected Path mockPath(String name, FileSystem fileSystem) {\n\t\tPath path = mock(Path.class);\n\t\twhen(path.getFileSystem()).thenReturn(fileSystem);\n\t\twhen(path.toString()).thenReturn(name);\n\t\tFile file = mock(File.class);\n\t... | import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.NANOSECONDS;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyInt;
import static org.mockito.M... | /*
MIT License
Copyright (c) 2017 Carl-Frederik Hallberg
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, ... | public class MuxerTest extends Fixture { | 1 |
jDramaix/SlidingPuzzle | src/be/dramaix/ai/slidingpuzzle/server/search/GraphSearch.java | [
"public class Action implements IsSerializable{\n\t\n\tprivate Move m;\n\tprivate CellLocation cell;\n\t\n\tpublic Action() {}\n\t\n\tpublic Action(CellLocation cell, Move m) {\n\t\tthis.m = m;\n\t\tthis.cell = cell;\n\t}\n\t\n\tpublic CellLocation getCellLocation() {\n\t\treturn cell;\n\t}\n\t\n\tpublic Move getMo... | import java.util.HashSet;
import java.util.List;
import java.util.Queue;
import java.util.Set;
import be.dramaix.ai.slidingpuzzle.shared.Action;
import be.dramaix.ai.slidingpuzzle.shared.Node;
import be.dramaix.ai.slidingpuzzle.shared.Path;
import be.dramaix.ai.slidingpuzzle.shared.PuzzleSolution;
import be.dramaix.ai.... | /*
* Copyright 2011 Julien Dramaix.
*
* 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 ... | private Set<Node> frontierSet; | 1 |
CS-Worcester/TaskButler | src/edu/worcester/cs499summer2012/activity/EditCategoriesActivity.java | [
"public class CategoryListAdapter extends ArrayAdapter<Category> {\n\t/**************************************************************************\n\t * Static fields and methods *\n\t **************************************************************************/\n\t\n\tstat... | import java.util.ArrayList;
import java.util.GregorianCalendar;
import yuku.ambilwarna.AmbilWarnaDialog;
import yuku.ambilwarna.AmbilWarnaDialog.OnAmbilWarnaListener;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListen... | View category_name_view = li.inflate(R.layout.dialog_category_name, null);
et_category_name = (EditText) category_name_view.findViewById(R.id.edit_category_name);
et_category_name.setText(selected_category.getName());
old_name = selected_category.getName();
AlertDialog.Builder builder = new AlertDial... | ArrayList<Task> tasks = data_source.getTasks(true, selected_category); | 5 |
Fivium/ScriptRunner | src/com/fivium/scriptrunner2/install/Installer.java | [
"public enum CommandLineOption {\n BUILD(\"build\")\n , RUN(\"run\")\n , INSTALL(\"install\")\n , UPDATE(\"update\")\n , PARSE_SCRIPTS(\"parse\")\n , NO_EXEC(\"noexec\")\n , LOG_DIRECTORY(\"logdir\")\n , LOG_STANDARD_OUT(\"logstdout\")\n , LOG_DEBUG(\"logdebug\")\n , SKIP_VERSION_CHECK(\"noversioncheck\... | import com.fivium.scriptrunner2.CommandLineOption;
import com.fivium.scriptrunner2.CommandLineWrapper;
import com.fivium.scriptrunner2.Logger;
import com.fivium.scriptrunner2.PatchScript;
import com.fivium.scriptrunner2.database.DatabaseConnection;
import com.fivium.scriptrunner2.database.PatchRunController;
import com... | package com.fivium.scriptrunner2.install;
/**
* Manages the first-run installation of the ScriptRunner metadata tables. This includes creating the promotion user
* (PROMOTEMGR by default), creating the tables and migrating any legacy PatchScripts to the new format.<br><br>
*
* <strong>IMPORTANT:</strong> You... | PromotionController lPromotionController = new PromotionController(lDatabaseConnection, INSTALL_PROMOTION_LABEL); | 5 |
dkhmelenko/Varis-Android | app/src/main/java/com/khmelenko/lab/varis/widget/BuildView.java | [
"public final class BuildStateHelper {\n\n private static final String STATE_CREATED = \"created\";\n private static final String STATE_STARTED = \"started\";\n private static final String STATE_PASSED = \"passed\";\n private static final String STATE_CANCELED = \"canceled\";\n private static final S... | import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.khmelenko.lab.varis.R;
import com.khmel... | package com.khmelenko.lab.varis.widget;
/**
* View with build info
*
* @author Dmytro Khmelenko
*/
public class BuildView extends LinearLayout {
@BindView(R.id.build_indicator)
View mIndicator;
@BindView(R.id.build_number)
TextView mTitle;
@BindView(R.id.build_pull_request_title)
Text... | String formattedDate = DateTimeUtils.parseAndFormatDateTime(finishedAt); | 4 |
javyuan/jeesite-api | src/main/java/com/zlwh/hands/admin/modules/user/service/CUserService.java | [
"@MyBatisDao\npublic interface CUserDao extends CrudDao<CUser> {\n\n\tint getInterestCount(String userId);\n\n}",
"public class CSession extends DataEntity<CSession> {\n\t\n\tprivate static final long serialVersionUID = 1L;\n\tprivate String userId;\t\t\t\n\tprivate String deviceType;\t\t\n\tprivate String loginI... | import java.util.Date;
import java.util.List;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.thinkgem.jeesite.common.persistence.Page;
i... | /**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.zlwh.hands.admin.modules.user.service;
/**
* 客户端用户Service
* @author yuanjifeng
* @version 2016-05-26
*/
@Service
@Transactional(readOnly = true) | public class CUserService extends CrudService<CUserDao, CUser> { | 0 |
DanielShum/MaterialAppBase | materialAppBaseLibrary/src/main/java/com/daililol/material/appbase/base/BaseNavigationDrawerActivity.java | [
"public class BaseNavigationDrawerListAdapter extends BaseAdapter{\n\n\tprivate Context context;\n\tprivate ArrayList<MenuItem> menuList;\n private int selectedItem = -1;\n\t\n\t\n\tpublic void addItem(String text, Drawable icon, MenuItem.Type type){\n\t\tmenuList.add(new MenuItem(text, icon, type));\n\t\tthis.n... | import android.annotation.SuppressLint;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.widget.DrawerLayout.DrawerListener;
import android.support.... | package com.daililol.material.appbase.base;
public abstract class BaseNavigationDrawerActivity extends BaseFragmentActivity implements DrawerListener,
AdapterView.OnItemClickListener{
/**
* An activity will be created like this
* -------------------------------------- -----------------------... | this.requestHomeIcon(DrawableUtil.getDrawable(this, R.drawable.ic_menu_black_24dp)); | 3 |
jclehner/AppOpsXposed | src/at/jclehner/appopsxposed/ApkVariant.java | [
"public class Res\n{\n\tpublic static int[] icons = new int[Constants.ICONS.length];\n\n\tpublic static XModuleResources settingsRes;\n\tpublic static XModuleResources modRes;\n\tpublic static XSharedPreferences modPrefs;\n\n\tpublic static int getSettingsIdentifier(String name) {\n\t\treturn settingsRes.getIdentif... | import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import android.app.Activity;
import android.app.Fragment;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.os.Bundle;
impor... | /*
* AppOpsXposed - AppOps for Android 4.3+
* Copyright (C) 2013 Joseph C. Lehner
*
* 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)
* ... | new AOSP() // must be the last entry! | 2 |
Nantes1900/Nantes-1900 | src/test/fr/nantes1900/models/PolygonTest.java | [
"public class Edge {\r\n\r\n /**\r\n * Array of two points describing the edge.\r\n */\r\n private final Point[] points = new Point[2];\r\n\r\n /**\r\n * List of triangles containing this edge. The can be two triangles maximum.\r\n */\r\n private List<Triangle> triangles = new ArrayList<... | import java.util.ArrayList;
import java.util.List;
import javax.vecmath.Vector3d;
import junit.framework.Assert;
import junit.framework.TestCase;
import org.junit.Test;
import fr.nantes1900.models.basis.Edge;
import fr.nantes1900.models.basis.Mesh;
import fr.nantes1900.models.basis.Point;
import fr.nantes1900.... | package test.fr.nantes1900.models;
/**
* A set of tests for the class Polyline.
* @author Daniel Lefevre
*/
public class PolygonTest extends TestCase {
/**
* Test attribute.
*/
private final Point p1 = new Point(1, 0, -1);
/**
* Test attribute.
*/
privat... | private final Polygon p = new Polygon();
| 2 |
chucknorris-io/chuck-api | src/test/java/io/chucknorris/api/feed/FeedControllerTest.java | [
"@Data\npublic class DailyChuck {\n\n private Long issueNumber;\n private DailyChuckIssue[] issues;\n\n /**\n * Adds a DailyChuckIssue {@link DailyChuckIssue} to the DailyChuck instance and increases the\n * issue number {@link DailyChuck#issueNumber} by one.\n */\n public void addIssue(DailyChuckIssue da... | import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import com.google.common.util.concurrent.AtomicDouble... | package io.chucknorris.api.feed;
@RunWith(MockitoJUnitRunner.class)
public class FeedControllerTest {
private DailyChuck dailyChuck;
private DailyChuckIssue dailyChuckIssue;
@Mock
private DailyChuckService dailyChuckService;
@Mock | private DateUtil dateUtil; | 5 |
hamadmarri/Biscuit | main/java/com/biscuit/commands/planner/UnplanSprint.java | [
"public class ColorCodes {\n\n\t// with normal background\n\tpublic static final String RESET = \"\\u001B[0m\";\n\tpublic static final String BLACK = \"\\u001B[30;1m\";\n\tpublic static final String RED = \"\\u001B[31;1m\";\n\tpublic static final String GREEN = \"\\u001B[32;1m\";\n\tpublic static final String YELLO... | import java.io.IOException;
import com.biscuit.ColorCodes;
import com.biscuit.commands.Command;
import com.biscuit.models.Project;
import com.biscuit.models.Release;
import com.biscuit.models.Sprint;
import com.biscuit.models.enums.Status;
import com.biscuit.models.services.Finder.Releases;
import com.biscuit.models.se... | package com.biscuit.commands.planner;
public class UnplanSprint implements Command {
ConsoleReader reader = null; | Project project = null; | 2 |
cm-heclouds/AndroidSDK | app/src/main/java/com/chinamobile/iot/onenet/sdksample/activity/MainActivity.java | [
"public class OneNetApi {\n\n public static final String LOG_TAG = \"OneNetApi\";\n\n private static String sAppKey;\n\n static boolean sDebug;\n\n private static HttpExecutor sHttpExecutor;\n\n /**\n * 初始化SDK\n *\n * @param application Application实例\n * @param debug 是否开启调试模式(打印... | import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.NavigationView;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.G... | package com.chinamobile.iot.onenet.sdksample.activity;
public class MainActivity extends AppCompatActivity {
private Toolbar mToolbar;
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mDrawerToggle;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
s... | fragment = TriggerListFragment.newInstance(); | 4 |
chanedi/QuickProject | QuickProject-Core/src/main/java/chanedi/service/EntityServiceImpl.java | [
"public interface EntityDAO<T extends Entity> {\n\n /**\n * 默认获取单表所有数据。可通过mapper.xml覆盖默认sql。\n * @return\n */\n @SelectProvider(type = BaseSQLProvider.class, method = \"getAll\")\n @ResultMap(\"getMap\")\n public List<T> getAll();\n\n @SelectProvider(type = BaseSQLProvider.class, method =... | import chanedi.dao.EntityDAO;
import chanedi.dao.complexQuery.CustomQueryParam;
import chanedi.dao.complexQuery.Sort;
import chanedi.exception.DataCommitException;
import chanedi.exception.LogicDeleteNotSupportException;
import chanedi.model.Entity;
import chanedi.model.ILogicDeletable;
import org.slf4j.Logger;
import ... | package chanedi.service;
/**
* Created by Chanedi
*/
public abstract class EntityServiceImpl<T extends Entity> implements EntityService<T> {
protected final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private EntityDAO<T> entityDAO;
public static Class<?> getEntityClass(Entity... | if (!(t instanceof ILogicDeletable)) { | 6 |
maxdemarzi/grittier_ext | src/main/java/com/maxdemarzi/tags/Tags.java | [
"public enum Labels implements Label {\n User,\n Post,\n Tag\n}",
"public enum RelationshipTypes implements RelationshipType {\n BLOCKS,\n FOLLOWS,\n MUTES,\n LIKES,\n REPLIED_TO\n}",
"@Path(\"/users\")\npublic class Users {\n\n private final GraphDatabaseService db;\n private sta... | import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;
import com.maxdemarzi.Labels;
import com.maxdemarzi.RelationshipTypes;
import com.maxdemarzi.users.Users;
import org.neo4j.dbms.api.DatabaseManagementService;
i... | package com.maxdemarzi.tags;
@Path("/tags")
public class Tags {
private static final Pattern hashtagPattern = Pattern.compile("#(\\S+)");
private static GraphDatabaseService db = null;
private static final ObjectMapper objectMapper = new ObjectMapper();
public Tags(@Context DatabaseManagementServ... | user = Users.findUser(username, tx); | 2 |
alexvasilkov/Events | sample/src/main/java/com/alexvasilkov/events/sample/ui/adapter/RepoListAdapter.java | [
"public class Events {\n\n private static final Dispatcher dispatcher = new Dispatcher();\n\n private Events() {\n // No instances\n }\n\n /**\n * Initializes event bus.\n *\n * @deprecated This method does nothing, do not use it.\n */\n @Deprecated\n @SuppressWarnings(\"unu... | import android.content.Context;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.alexvasilkov.android.commons.utils.Views;
import com.alexvasilkov... | package com.alexvasilkov.events.sample.ui.adapter;
public class RepoListAdapter extends RecyclerView.Adapter<RepoListAdapter.ViewHolder>
implements View.OnClickListener {
| private List<Repository> repositories; | 1 |
yuqirong/NewsPublish | src/com/cjlu/newspublish/services/impl/UserServiceImpl.java | [
"@Repository(\"commentDao\")\npublic class CommentDaoImpl extends BaseDaoImpl<Comment> {\n\n\tpublic List<Comment> getViewNewsAllComment(Integer newsId) {\n\t\tString hql = \"FROM Comment c WHERE c.news.id = ?\";\n\t\treturn this.findEntityByHQL(hql, newsId);\n\t}\n\n\tpublic void deleteCommentByNewsId(Integer id) ... | import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cjlu.newspublish.daos.impl.CommentDaoImpl;
import com.cjlu.newspublish.daos.impl.UserDaoImpl;
import com.cjlu.newspublish.daos.impl.VisitorCounterDaoImpl;
import com.cjlu.newsp... | package com.cjlu.newspublish.services.impl;
@Service("userService")
public class UserServiceImpl extends BaseServiceImpl<User> implements
UserService {
@Autowired
private UserDaoImpl userDao;
@Autowired
private CommentDaoImpl commentDao;
@Autowired | private VisitorCounterDaoImpl visitorCounterDao; | 2 |
RationaleEmotions/SimpleSe | src/test/java/com/rationaleemotions/internal/PageParserTest.java | [
"public final class PageParser {\n\n private PageParser() {\n //defeat instantiation\n }\n\n public static PageElement parsePage(String fileName) throws FileNotFoundException {\n return new Gson().fromJson(new FileReader(fileName), PageElement.class);\n }\n}",
"public class Element {\n private static f... | import com.rationaleemotions.internal.parser.PageParser;
import com.rationaleemotions.internal.parser.pojos.Element;
import com.rationaleemotions.internal.parser.pojos.PageElement;
import com.rationaleemotions.internal.parser.pojos.Wait;
import com.rationaleemotions.page.WebElementType;
import java.io.FileNotFoundExcep... | package com.rationaleemotions.internal;
public class PageParserTest {
@Test
public void testParser() throws FileNotFoundException { | PageElement loginPage = PageParser.parsePage("src/test/resources/LoginPage.json"); | 2 |
almondtools/rexlex | src/main/java/com/almondtools/rexlex/pattern/DefaultMatcherBuilder.java | [
"public interface TokenType {\n\n\tboolean error();\n\tboolean accept();\n\n}",
"public interface Automaton {\n\t\n\tString getId();\n\tTokenType getErrorType();\n\t\n\tAutomatonProperty getProperty();\n\tIterable<String> getSamples(int length);\n\t\n\t<T extends Token> Iterator<T> tokenize(CharProvider chars, To... | import com.almondtools.rexlex.TokenType;
import com.almondtools.rexlex.automaton.Automaton;
import com.almondtools.rexlex.automaton.AutomatonMatcher;
import com.almondtools.rexlex.automaton.AutomatonMatcherListener;
import com.almondtools.rexlex.automaton.FromGenericAutomaton.ToTabledAutomaton;
import com.almondtools.r... | package com.almondtools.rexlex.pattern;
public class DefaultMatcherBuilder implements MatcherBuilder {
private ToAutomaton<GenericAutomaton, ?> builder;
private Automaton automaton;
public DefaultMatcherBuilder(ToAutomaton<GenericAutomaton, ?> builder) {
this.builder = builder;
}
public DefaultMatcherBuild... | public boolean reportMatch(CharProvider chars, long start, TokenType accepted) { | 0 |
open-io/oio-api-java | src/test/java/io/openio/sds/storage/rawx/RawxClientTest.java | [
"public class RequestContext {\n\n private DeadlineManager dm;\n\n private String reqId = null;\n private int reqStart = -1;\n private int rawTimeout = -1;\n private int deadline = -1;\n\n /**\n * Build a new {@link RequestContext} with a default 30s timeout.\n */\n public RequestContex... | import io.openio.sds.RequestContext;
import io.openio.sds.TestHelper;
import io.openio.sds.TestSocketProvider;
import io.openio.sds.exceptions.OioException;
import io.openio.sds.http.OioHttp;
import io.openio.sds.http.OioHttpRequest;
import io.openio.sds.http.OioHttpSettings;
import io.openio.sds.models.ObjectInfo;
imp... | package io.openio.sds.storage.rawx;
public class RawxClientTest {
String NAMESPACE = "OPENIO";
String ACCOUNT_NAME = "testaccount";
String CONTAINER_NAME = "testcontainer";
String OBJECT_NAME = "testobject";
OioUrl newObjectOioUrl() {
return OioUrl.url(ACCOUNT_NAME, CONTAINER_NAME, OBJECT_NAME);
}
void... | OioHttp http = OioHttp.http(new OioHttpSettings(), socketProvider); | 6 |
mast-group/itemset-mining | itemset-miner/src/test/java/itemsetmining/main/ItemsetMiningTest.java | [
"public class Itemset extends AbstractItemset implements Serializable {\n\tprivate static final long serialVersionUID = 4667217256957834826L;\n\n\t/**\n\t * Constructor\n\t */\n\tpublic Itemset() {\n\t\tthis.items = new BitSet();\n\t}\n\n\t/**\n\t * Constructor\n\t * \n\t * @param items\n\t * a collectio... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import itemsetmining.itemset.Itemset;
import itemsetmining.main.InferenceAlgorithms.InferGreedy;
import itemsetmining.main.InferenceAlgorithms.InferPrimalDual;
import itemsetmining.main.InferenceAlgorithms.InferenceAlgorithm;
import... | package itemsetmining.main;
public class ItemsetMiningTest {
@Test
public void testDoInference() {
| final Itemset s1 = new Itemset(1); | 0 |
jhclark/bigfatlm | src/bigfat/step5/InterpolateOrdersIteration.java | [
"public class BigFatLM extends Configured implements Tool {\n\n\tpublic static final String PROGRAM_NAME = \"BigFatLM\";\n\tpublic static final int ZEROTON_ID = 0;\n\tpublic static final String UNK = \"<unk>\";\n\tpublic static final int UNK_ID = -1;\n\tpublic static final String BOS = \"<s>\";\n\tpublic static fin... | import jannopts.Option;
import jannopts.validators.HdfsPathCheck;
import java.io.IOException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
import org.apache.hadoop.mapreduce.lib.input.... | package bigfat.step5;
public class InterpolateOrdersIteration implements HadoopIteration {
@Option(shortName = "i", longName = "uninterpolatedIn", usage = "HDFS input path of uninterpolated model")
@HdfsPathCheck(exists = true)
String uninterpolatedIn;
@Option(shortName = "o", longName = "interpolatedOut", ... | job.setSortComparatorClass(NgramComparator.class); | 3 |
Sleeksnap/sleeksnap | src/org/sleeksnap/gui/options/InfoPanel.java | [
"public class Constants {\n\tpublic static class Application {\n\t\tpublic static final String NAME = \"Sleeksnap\";\n\t\tpublic static final String URL = \"http://sleeksnap.com\";\n\t\tpublic static final String UPDATE_URL = \"http://sleeksnap.com/build/\";\n\t}\n\n\tpublic static class Configuration {\n\t\tpublic... | import org.sleeksnap.gui.OptionPanel;
import org.sleeksnap.updater.Updater;
import org.sleeksnap.updater.Updater.VerificationMode;
import org.sleeksnap.util.Util;
import org.sleeksnap.util.Utils.FileUtils;
import com.sun.jna.Platform;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.... | /**
* Sleeksnap, the open source cross-platform screenshot uploader
* Copyright (C) 2012 Nikki <nikki@nikkii.us>
*
* 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 L... | Updater.verifyAutostart(FileUtils.getJarFile(OptionPanel.class), VerificationMode.INSERT); | 3 |
lukas-krecan/JsonUnit | json-unit-spring/src/main/java/net/javacrumbs/jsonunit/spring/AbstractSpringMatchers.java | [
"public class Configuration {\n private static final DifferenceListener DUMMY_LISTENER = (difference, context) -> {};\n\n private static final String DEFAULT_IGNORE_PLACEHOLDER = \"${json-unit.ignore}\";\n private static final String ALTERNATIVE_IGNORE_PLACEHOLDER = \"#{json-unit.ignore}\";\n private st... | import net.javacrumbs.jsonunit.core.Configuration;
import net.javacrumbs.jsonunit.core.Option;
import net.javacrumbs.jsonunit.core.internal.Path;
import net.javacrumbs.jsonunit.core.internal.matchers.InternalMatcher;
import net.javacrumbs.jsonunit.core.listener.DifferenceListener;
import org.hamcrest.Matcher;
import or... | /**
* Copyright 2009-2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless requir... | final Configuration configuration; | 0 |
haodynasty/AndroidBleManager | app/src/main/java/com/blakequ/androidblemanager/ui/connect/ConnectOneFragment.java | [
"public class DeviceStateAdapter extends BaseArrayListAdapter<BluetoothLeDevice>{\n\n private Holder mHolder;\n private Map<String, ConnectState> map;\n public DeviceStateAdapter(Context context) {\n super(context);\n map = new HashMap<>();\n }\n\n\n /**\n * 更新为选择状态\n * @param a... | import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import and... | package com.blakequ.androidblemanager.ui.connect;
/**
* Copyright (C) BlakeQu All Rights Reserved <blakequ@gmail.com>
* <p/>
* Licensed under the blakequ.com License, Version 1.0 (the "License");
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distribu... | public void onConnectStateChanged(String address, ConnectState state) { | 7 |
google/Accessibility-Test-Framework-for-Android | src/main/java/com/google/android/apps/common/testing/accessibility/framework/suggestions/BaseTextContrastFixSuggestionProducer.java | [
"public class AccessibilityHierarchyCheckResult extends AccessibilityCheckResult {\n\n private final int resultId;\n private final @Nullable ViewHierarchyElement element;\n private final @Nullable ResultMetadata metadata;\n private final ImmutableList<Answer> answers;\n\n /**\n * Constructor when there are {... | import com.google.android.apps.common.testing.accessibility.framework.AccessibilityHierarchyCheckResult;
import com.google.android.apps.common.testing.accessibility.framework.Parameters;
import com.google.android.apps.common.testing.accessibility.framework.ResultMetadata;
import com.google.android.apps.common.testing.a... | package com.google.android.apps.common.testing.accessibility.framework.suggestions;
/**
* Base class which produces a {@link SetViewAttributeFixSuggestion} to fix a text low contrast
* issue.
*/
abstract class BaseTextContrastFixSuggestionProducer
implements FixSuggestionProducer<SetViewAttributeFixSuggestion>... | AccessibilityHierarchyCheckResult checkResult, | 0 |
Team236/2016-Robot | src/org/usfirst/frc/team236/robot/commands/profiled/LowShot.java | [
"public class AutoMap {\n // The distance we turn to shoot for the goal\n public static final double turnForGoalDegrees = 58;\n\n public static final FollowParameters params = new FollowParameters(0, .06, .01);\n\n /*\n * Drives from the midfield to the position aligned with the left goal by\n *... | import org.usfirst.frc.team236.robot.AutoMap;
import org.usfirst.frc.team236.robot.commands.Cock;
import org.usfirst.frc.team236.robot.commands.Eject;
import org.usfirst.frc.team236.robot.commands.Intake;
import org.usfirst.frc.team236.robot.commands.ShiftDown;
import org.usfirst.frc.team236.robot.commands.ShootCycle;
... | package org.usfirst.frc.team236.robot.commands.profiled;
/**
*
*/
public class LowShot extends CommandGroup {
public LowShot(Profile toSpin, Profile toLowGoal) {
addParallel(new ShiftDown());
addParallel(new Intake());
addSequential(new GoBottomFromTop());
addParallel(new Cock());
addParallel(new Intak... | addSequential(new TurnWithGyro(180 - AutoMap.turnForGoalDegrees)); | 7 |
HopEdia/android-client | app/src/main/java/io/github/hopedia/SearchActivity.java | [
"public class Barcode extends Modifications<String> {\n\tpublic String format;\n public String type;\n\n public Barcode() {\n super();\n }\n public Barcode(String _value, String format, String type) {\n super(_value);\n this.format = format;\n this.type = type;\n }\n\n\tpu... | import android.app.SearchManager;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.ViewStub;
import andr... | package io.github.hopedia;
/** Hop Edia android client
Copyright (C) 2016 koko-ng <koko.fr.mu@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
... | item.name = new Name[]{new Name(name)}; | 3 |
antelink/SourceSquare | src/main/java/com/antelink/sourcesquare/results/ResultBuilder.java | [
"public class SourceSquareResults {\n\n private TreemapNode rootNode;\n\n private Collection<Badge> badges;\n\n private int nodeLevel;\n\n public SourceSquareResults() {\n super();\n }\n\n public TreemapNode getRootNode() {\n return this.rootNode;\n }\n\n public void setRootNod... | import com.antelink.sourcesquare.SourceSquareResults;
import com.antelink.sourcesquare.badge.BadgesProcessor;
import com.antelink.sourcesquare.event.base.EventBus;
import com.antelink.sourcesquare.event.events.ScanCompleteEvent;
import com.antelink.sourcesquare.event.events.SourceSquareResultsReadyEvent;
import com.ant... | /**
* Copyright (C) 2009-2012 Antelink SAS
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License Version 3 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHO... | this.eventBus.fireEvent(new SourceSquareResultsReadyEvent(results)); | 4 |
CvvT/DexTamper | src/org/jf/dexlib2/analysis/ClassPath.java | [
"public final class DexFileFactory {\n @Nonnull\n public static DexBackedDexFile loadDexFile(@Nonnull String path, int api) throws IOException {\n return loadDexFile(path, api, false);\n }\n\n @Nonnull\n public static DexBackedDexFile loadDexFile(@Nonnull String path, int api, boolean experime... | import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.collect.*;
import org.jf.dexlib2.DexFileFactory;
import org.jf.dexlib2.DexFileFa... | if (type.charAt(0) == '[') {
return new ArrayProto(ClassPath.this, type);
} else {
return new ClassProto(ClassPath.this, type);
}
}
};
@Nonnull private LoadingCache<String, TypeProto> loadedClasses = CacheBuilder.newBuilder().build(cla... | } catch (DexFileNotFound ex) { | 1 |
FedericoPecora/coordination_oru | src/main/java/se/oru/coordination/coordination_oru/tests/TestTrajectoryEnvelopeCoordinatorWithMotionPlanner20.java | [
"public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m... | import java.io.File;
import java.util.Comparator;
import org.metacsp.multi.spatioTemporal.paths.Pose;
import com.vividsolutions.jts.geom.Coordinate;
import se.oru.coordination.coordination_oru.ConstantAccelerationForwardModel;
import se.oru.coordination.coordination_oru.CriticalSection;
import se.oru.coordination.coord... | package se.oru.coordination.coordination_oru.tests;
@DemoDescription(desc = "Example showing that parked robots can lead to deadlocks.")
public class TestTrajectoryEnvelopeCoordinatorWithMotionPlanner20 {
public static void main(String[] args) throws InterruptedException {
double MAX_ACCEL = 1.0;
double MAX... | Missions.enqueueMission(new Mission(2,rsp.getPath())); | 8 |
idega/se.agura.memorial | src/java/se/agura/memorial/obituary/presentation/ObituaryInformationDisplayBackingBean.java | [
"public class ObituarySessionBean extends IBOSessionBean implements ObituarySession{\n\t\n\tprivate Integer databaseId = null;\n\t\n\tprivate String obituaryText = null;\n\tprivate String personFullName = null;\t\n\tprivate String tmpObituaryText = null;\n\tprivate String tmpGraveImagePath = null;\n\tprivate Strin... | import java.awt.Color;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.RemoteException;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.faces.context.FacesContext;
import javax.servlet.ServletEx... | package se.agura.memorial.obituary.presentation;
public class ObituaryInformationDisplayBackingBean {
private String obituaryText = null;
private String graveImagePath = null;
private String personImagePath = null;
private static final String IW_BUNDLE_IDENTIFIER = "se.agura.memorial";
private static f... | SearchImplBroker sib = (SearchImplBroker) IBOLookup.getServiceInstance(iwc, SearchImplBroker.class); | 5 |
quartzweb/quartz-web | src/main/java/com/github/quartzweb/service/strategy/JobServiceStrategy.java | [
"public class UnsupportedClassException extends RuntimeException {\n public UnsupportedClassException() {\n }\n\n public UnsupportedClassException(String message) {\n super(message);\n }\n\n public UnsupportedClassException(String message, Throwable cause) {\n super(message, cause);\n ... | import com.github.quartzweb.exception.UnsupportedClassException;
import com.github.quartzweb.job.MethodInvoker;
import com.github.quartzweb.manager.web.JobInfosVO;
import com.github.quartzweb.manager.web.QuartzWebManager;
import com.github.quartzweb.service.JSONResult;
import com.github.quartzweb.service.QuartzWebURL;
... | /**
* Licensed under the Apache License, Version 2.0 (the "License");
*/
package com.github.quartzweb.service.strategy;
/**
* @author quxiucheng [quxiuchengdev@gmail.com]
*/
public class JobServiceStrategy implements ServiceStrategy<JobServiceStrategyParameter> {
@Override
public JSONResult service(Serv... | throw new UnsupportedClassException(jobClass + " must extends org.quartz.Job "); | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.