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 |
|---|---|---|---|---|---|---|
mkopylec/errorest-spring-boot-starter | src/main/java/com/github/mkopylec/errorest/handling/errordata/security/SecurityErrorDataProvider.java | [
"@ConfigurationProperties(\"errorest\")\npublic class ErrorestProperties {\n\n /**\n * HTTP response body format.\n */\n private ResponseBodyFormat responseBodyFormat = FULL;\n /**\n * Properties responsible for handling validation errors.\n */\n private BeanValidationError beanValidatio... | import com.github.mkopylec.errorest.configuration.ErrorestProperties;
import com.github.mkopylec.errorest.handling.errordata.ErrorData;
import com.github.mkopylec.errorest.handling.errordata.ErrorData.ErrorDataBuilder;
import com.github.mkopylec.errorest.handling.errordata.ErrorDataProvider;
import com.github.mkopylec.... | package com.github.mkopylec.errorest.handling.errordata.security;
public abstract class SecurityErrorDataProvider<T extends Throwable> extends ErrorDataProvider<T> {
public static final String SECURITY_ERROR_CODE = "SECURITY_ERROR";
| public SecurityErrorDataProvider(ErrorestProperties errorestProperties) { | 0 |
straumat/blockchain2graph | bitcoin-neo4j/project-back-end/src/main/java/com/oakinvest/b2g/util/providers/RepositoriesProvider.java | [
"@Repository\npublic interface AddressRepository extends Neo4jRepository<BitcoinAddress, Long> {\n\n /**\n * Find an address.\n *\n * @param address address\n * @return address\n */\n Optional<BitcoinAddress> findByAddress(String address);\n\n /**\n * Find a bitcoin address (with de... | import com.oakinvest.b2g.repository.AddressRepository;
import com.oakinvest.b2g.repository.BlockRepository;
import com.oakinvest.b2g.repository.TransactionInputRepository;
import com.oakinvest.b2g.repository.TransactionOutputRepository;
import com.oakinvest.b2g.repository.TransactionRepository;
import org.springframewo... | package com.oakinvest.b2g.util.providers;
/**
* Bitcoin repositories.
*
* Created by straumat on 11/06/17.
*/
@SuppressWarnings("unused")
@Component
public class RepositoriesProvider {
/**
* Bitcoin address repository.
*/ | private final AddressRepository addressRepository; | 0 |
JetBrains/teamcity-vmware-plugin | cloud-vmware-server/src/main/java/jetbrains/buildServer/clouds/vmware/connector/VMWareApiConnectorImpl.java | [
"public abstract class AbstractInstance {\n @NotNull\n public abstract String getName();\n\n public abstract boolean isInitialized();\n\n public abstract Date getStartDate();\n\n public abstract String getIpAddress();\n\n public abstract InstanceStatus getInstanceStatus();\n\n @Nullable\n public abstract St... | import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Pair;
import com.vmware.vim25.*;
import com.vmware.vim25.mo.*;
import com.vmware.vim25.mo.util.MorUtil;
import java.net.InetAddress;
import java.net.Malforme... | /*
* Copyright 2000-2022 JetBrains s.r.o.
*
* 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 agre... | private synchronized Folder getRootFolder() throws VmwareCheckedCloudException { | 4 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/internal/instantiation/SqlArrayConversion.java | [
"public class DatabaseSQLException extends DatabaseException {\n\n public DatabaseSQLException(@NotNull String message, @NotNull SQLException cause) {\n super(message, cause);\n }\n\n public DatabaseSQLException(@NotNull SQLException cause) {\n super(cause);\n }\n\n @Override\n publi... | import java.sql.Array;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
import org.dalesbred.DatabaseSQLException;
import org.dalesbred.internal.jdbc.ResultSetUtils;
import org.dalesbred.internal.jdbc.SqlUtils;
import org.dal... | /*
* Copyright (c) 2017 Evident Solutions Oy
*
* 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... | boolean allowNulls = !TypeUtils.isPrimitive(elementType); | 3 |
Kunzisoft/RememBirthday | RememBirthday-UI/src/main/java/com/kunzisoft/remembirthday/activity/ListContactsBirthdayFragment.java | [
"public class ContactAdapter<T extends ContactViewHolder> extends RecyclerView.Adapter<T>{\n\n private static final String TAG = \"ContactBirthdayAdapter\";\n\n public static final int POSITION_UNDEFINED = -1;\n\n private Context context;\n private OnClickItemContactListener onClickItemContactListener;\... | import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.LinearLayoutMa... | package com.kunzisoft.remembirthday.activity;
/**
* Created by joker on 08/01/17.
*/
public class ListContactsBirthdayFragment extends AbstractListContactsFragment implements OnClickItemContactListener {
public final static String TAG_DETAILS_FRAGMENT = "TAG_DETAILS_FRAGMENT";
private final static String ... | private int currentContactPosition = ContactAdapter.POSITION_UNDEFINED; | 0 |
stephenh/mirror | src/main/java/mirror/Mirror.java | [
"@Command(name = \"client\", description = \"two-way real-time sync\")\npublic static class MirrorClientCommand extends BaseCommand {\n @Option(name = { \"-h\", \"--host\" }, description = \"host name of remote server to connect to\")\n public String host;\n\n @Option(name = { \"-p\", \"--port\" }, description =... | import static org.apache.commons.lang3.StringUtils.chomp;
import static org.apache.commons.lang3.StringUtils.substringAfterLast;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetSocketAddress;
import java.net.URL;
import java.nio.file.Paths;
import java.util.ArrayList;
im... | package mirror;
@Cli(name = "mirror", description = "two-way, real-time sync of files across machines", commands = {
MirrorClientCommand.class,
MirrorServerCommand.class,
VersionCommand.class }, defaultCommand = Help.class)
public class Mirror {
private static final Logger log = LoggerFactory.getLogger(M... | TaskFactory taskFactory = new ThreadBasedTaskFactory(); | 3 |
kakao/hbase-tools | hbase0.98/hbase-snapshot-0.98/src/main/java/com/kakao/hbase/snapshot/Snapshot.java | [
"public class SnapshotArgs extends Args {\n public static final String COMMA = \",\";\n public static final int KEEP_UNLIMITED = 0;\n static final int KEEP_DEFAULT = KEEP_UNLIMITED;\n static final String ENTRY_DELIMITER = \"/\";\n\n private final Map<String, Boolean> tableFlushMap = new HashMap<>();\... | import java.util.*;
import com.google.common.annotations.VisibleForTesting;
import com.kakao.hbase.SnapshotArgs;
import com.kakao.hbase.common.Args;
import com.kakao.hbase.common.HBaseClient;
import com.kakao.hbase.common.util.Util;
import com.kakao.hbase.specific.SnapshotAdapter;
import org.apache.hadoop.hbase.client.... |
for (Map.Entry<String, String> entry : failedSnapshotMap.entrySet()) {
String snapshotName = entry.getKey();
String tableName = entry.getValue();
if (exists(admin, tableName) || skipCheckTableExistence) {
snapshot(zooKeeper, tableName, sna... | List<SnapshotDescription> sd = SnapshotAdapter.getSnapshotDescriptions(admin, getPrefix(tableName) + ".*"); | 4 |
opensciencemap/vtm-app | src/org/oscim/app/TileMap.java | [
"@SuppressWarnings(\"deprecation\")\npublic class Compass extends Layer implements SensorEventListener,\n Map.UpdateListener {\n\n\t// final static Logger log = LoggerFactory.getLogger(Compass.class);\n\n\tpublic enum Mode {\n\t\tOFF, C2D, C3D,\n\t}\n\n\tprivate final SensorManager mSensorManager;\n\tprivate... | import java.util.Map;
import org.oscim.android.MapActivity;
import org.oscim.android.MapView;
import org.oscim.app.location.Compass;
import org.oscim.app.location.LocationDialog;
import org.oscim.app.location.LocationHandler;
import org.oscim.app.preferences.EditPreferences;
import org.oscim.core.GeoPoint;
import org.o... | if (!item.isChecked()) {
// FIXME
//mMapView.getMapViewPosition().setTilt(0);
mCompass.setMode(Compass.Mode.C2D);
} else {
mCompass.setMode(Compass.Mode.OFF);
}
break;
case R.id.menu_compass_3d:
if (!item.isChecked()) {
mCompass.setMode(Compass.Mode.C3D);
} else {
... | POI poi = App.poiSearch.getPOIs().get(id); | 5 |
jbosgi/jbosgi-resolver | api/src/main/java/org/jboss/osgi/resolver/spi/AbstractResourceBuilder.java | [
"public final class MavenCoordinates {\n\n private final String groupId;\n private final String artifactId;\n private final String type;\n private final String version;\n private final String classifier;\n\n public static MavenCoordinates parse(String coordinates) {\n MavenCoordinates resul... | import static org.jboss.osgi.metadata.OSGiMetaData.ANONYMOUS_BUNDLE_SYMBOLIC_NAME;
import static org.jboss.osgi.resolver.ResolverMessages.MESSAGES;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleI... | /*
* #%L
* JBossOSGi Resolver API
* %%
* Copyright (C) 2010 - 2012 JBoss by Red Hat
* %%
* 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/LICENS... | public XRequirement addRequirement(String namespace, Map<String, Object> atts, Map<String, String> dirs) { | 4 |
qcloudsms/qcloudsms_java | src/main/java/com/github/qcloudsms/FileVoiceSender.java | [
"public interface HTTPClient {\n\n /**\n * Fetch HTTP response by given HTTP request,\n *\n * @param request Specify which to be fetched.\n *\n * @return the response to the request.\n * @throws IOException connection problem.\n * @throws URISyntaxException url syntax problem.\n ... | import com.github.qcloudsms.httpclient.HTTPClient;
import com.github.qcloudsms.httpclient.HTTPException;
import com.github.qcloudsms.httpclient.HTTPMethod;
import com.github.qcloudsms.httpclient.HTTPRequest;
import com.github.qcloudsms.httpclient.HTTPResponse;
import com.github.qcloudsms.httpclient.DefaultHTTPClient;
i... | package com.github.qcloudsms;
public class FileVoiceSender extends SmsBase {
private String url = "https://cloud.tim.qq.com/v5/tlsvoicesvr/sendfvoice";
public FileVoiceSender(int appid, String appkey) { | super(appid, appkey, new DefaultHTTPClient()); | 5 |
RedMadRobot/Chronos | chronos/src/main/java/com/redmadrobot/chronos/gui/fragment/ChronosFragment.java | [
"public final class ChronosConnector {\n\n private final static String KEY_CHRONOS_LISTENER_ID = \"chronos_listener_id\";\n\n private ChronosListener mChronosListener;\n\n private Object mGUIClient;\n\n /**\n * GUI client should call this method in its own onCreate() method.\n *\n * @param c... | import com.redmadrobot.chronos.ChronosConnector;
import com.redmadrobot.chronos.ChronosOperation;
import com.redmadrobot.chronos.gui.ChronosConnectorWrapper;
import com.redmadrobot.chronos.gui.fragment.dialog.ChronosDialogFragment;
import com.redmadrobot.chronos.gui.fragment.dialog.ChronosSupportDialogFragment;
import ... | package com.redmadrobot.chronos.gui.fragment;
/**
* A Fragment that is connected to Chronos.
*
* @author maximefimov
* @see ChronosDialogFragment
* @see ChronosSupportDialogFragment
* @see ChronosSupportFragment
*/
@SuppressWarnings("unused")
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public abstract class Ch... | public final int runOperation(@NonNull final ChronosOperation operation, | 1 |
xiaoyaoyou1212/BLE | baseble/src/main/java/com/vise/baseble/exception/handler/DefaultBleExceptionHandler.java | [
"public class ConnectException extends BleException {\n private BluetoothGatt bluetoothGatt;\n private int gattStatus;\n\n public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {\n super(BleExceptionCode.CONNECT_ERR, \"Connect Exception Occurred! \");\n this.bluetoothGatt = blu... | import com.vise.baseble.exception.ConnectException;
import com.vise.baseble.exception.GattException;
import com.vise.baseble.exception.InitiatedException;
import com.vise.baseble.exception.OtherException;
import com.vise.baseble.exception.TimeoutException;
import com.vise.log.ViseLog; | package com.vise.baseble.exception.handler;
/**
* @Description: 异常默认处理
* @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a>
* @date: 16/8/14 10:35.
*/
public class DefaultBleExceptionHandler extends BleExceptionHandler {
@Override
protected void onConnectException(ConnectException e) {
Vise... | protected void onTimeoutException(TimeoutException e) { | 4 |
MinecraftForge/Srg2Source | src/main/java/net/minecraftforge/srg2source/extract/RangeExtractor.java | [
"public interface InputSupplier extends Closeable {\n /**\n * The absolute path of the root entity of the given resource, be it a file or directory.\n * The passed resource may only be useful when there are resources from multiple roots.\n * @param resource The resource to find the root for\n * @... | import java.io.BufferedReader;
import java.io.CharArrayWriter;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.H... | /*
* Srg2Source
* Copyright (c) 2020.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be u... | public void setSourceCompatibility(SourceVersion value) { | 1 |
TU-Berlin-SNET/jTR-ABE | src/main/java/trabe/lw14/policy/Lw14PolicyLeafNode.java | [
"public class AbeOutputStream extends DataOutputStream {\n \n private final AbePublicKey pubKey;\n\n public AbeOutputStream(OutputStream out, AbePublicKey pubKey) {\n super(out);\n this.pubKey = pubKey;\n }\n\n // only used for the curve parameters and attributes, no need for fancy enco... | import java.io.IOException;
import it.unisa.dia.gas.jpbc.ElementPowPreProcessing;
import it.unisa.dia.gas.jpbc.Pairing;
import trabe.AbeOutputStream;
import trabe.AbePrivateKey;
import trabe.AbePublicKey;
import trabe.AbeSettings;
import trabe.lw14.Lw14PrivateKeyComponent;
import trabe.lw14.Lw14Util;
import it... | package trabe.lw14.policy;
public class Lw14PolicyLeafNode extends Lw14PolicyAbstractNode {
private Lw14PrivateKeyComponent satisfyingComponent = null;
/** G1 **/
private Element hashedAttribute;
/** G1 **/
private Element p1;
/** G1 **/
private Element p2;
/** G1 **/
... | hashedAttribute = Lw14Util.elementZrFromString(attribute, publicKey);
| 5 |
wrey75/WaveCleaner | src/main/java/com/oxande/xmlswing/components/ComponentUI.java | [
"public class AttributeDefinition {\r\n\t\r\n\tpublic final static Map<String, String> ALIGNS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CLOSE_OPERATIONS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CURSORS = new HashMap<String, String>();\r\n\tpub... | import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.EventObject;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import org.w3c.dom.Element;
import co... | else if( tagName.equals("textComponent")){
component = new JTextComponentUI();
}
else if( tagName.equals("textarea")){
component = new JTextAreaUI();
}
else if( tagName.equals("list")){
component = new JListUI();
}
else if( tagName.equals("toolbar")){
component = new JToolBarUI();... | method.setReturnType( new JavaType("void", JavaType.PROTECTED ));
| 8 |
sunhong/jcurses | src/jcurses/widgets/PopUpList.java | [
"public class ValueChangedListenerManager extends ListenerManager {\r\n\t\r\n\tprotected void doHandleEvent(Event event, Listener listener) {\r\n\t\t((ValueChangedListener)listener).valueChanged((ValueChangedEvent)event);\r\n\t}\r\n\t\r\n\tprotected void verifyListener(Listener listener) {\r\n\t\tif (!(listener ins... | import jcurses.event.ValueChangedListenerManager;
import jcurses.event.ValueChangedListener;
import jcurses.event.ValueChangedEvent;
import jcurses.system.CharColor;
import jcurses.system.InputChar;
import jcurses.system.Toolkit;
import jcurses.util.Rectangle;
import java.util.Vector;
| package jcurses.widgets;
/**
* This class implements a popup list.
* Such list has always one of the items selected and gives the possibility to change
* this selection ( througth an popup menu that is shown, if the user typed 'enter')
*
*/
public class PopUpList extends Widget {
private int ... | private static CharColor __popUpDefaultColors = new CharColor(CharColor.WHITE, CharColor.BLACK);
| 2 |
gruter/utogen | src/main/java/generator/gui/TableAssignGeneratorPanel.java | [
"public class DBForeignKey\n{\n private String masterTable, detailsTable;\n private String masterField, detailsField;\n private int fromNum, toNum, cardinalityType;\n\n\n public DBForeignKey()\n {\n\n }\n\n\n public DBForeignKey(String masterTable, String masterField, String detailsTable, Strin... | import generator.db.DBForeignKey;
import generator.db.DBUtils;
import generator.extenders.RandomiserInstance;
import generator.db.DBTableGenerator;
import generator.misc.ApplicationContext;
import generator.misc.RandomiserType;
import generator.misc.TableUtilities;
import generator.misc.Utils;
import java.awt.C... | /*
* TableAssignGeneratorPanel.java
*
* Created on 24 May 2007, 03:20
*/
package generator.gui;
/**
*
* @author Michael
*/
public class TableAssignGeneratorPanel extends javax.swing.JPanel
{
private Vector<RandomiserInstance> vRI;
private Vector<RandomiserType> vRT;
private Defau... | Utils utils = new Utils();
| 4 |
jordw/heftydb | src/test/java/com/jordanwilliams/heftydb/test/integration/IteratorTest.java | [
"public class Tuple implements Comparable<Tuple> {\n\n public static Serializer<Tuple> SERIALIZER = new Serializer<Tuple>() {\n @Override\n public int size(Tuple tuple) {\n int size = 0;\n\n //Key\n size += Sizes.INT_SIZE;\n size += tuple.key().size();\n ... | import com.jordanwilliams.heftydb.data.Tuple;
import com.jordanwilliams.heftydb.db.Config;
import com.jordanwilliams.heftydb.db.HeftyDB;
import com.jordanwilliams.heftydb.db.Record;
import com.jordanwilliams.heftydb.db.Snapshot;
import com.jordanwilliams.heftydb.test.base.ParameterizedIntegrationTest;
import com.jordan... | /*
* Copyright (c) 2014. Jordan Williams
*
* 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 ag... | CompareHelper.compareKeyValue(tupleIterator, dbIterator); | 7 |
vonZeppelin/planning-poker | src/main/java/org/lbogdanov/poker/web/page/MySessionsPage.java | [
"public interface PagingList<T> {\n\n /**\n * Returns all pages in a single list.\n * \n * @return the list with data\n */\n public List<T> getAsList();\n\n /**\n * Returns page size.\n * \n * @return the number of rows per page\n */\n public int getPageSize();\n\n /**... | import java.text.DateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import javax.inject.Inject;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.attributes.AjaxCallListener;
im... | /**
* Copyright 2012 Leonid Bogdanov
*
* 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 UserService userService; | 3 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/adapter/viewholder/AbstractArticleViewHolder.java | [
"public abstract class BenihItemViewHolder<Data> extends RecyclerView.ViewHolder implements\n View.OnClickListener,\n View.OnLongClickListener\n{\n private OnItemClickListener itemClickListener;\n private OnLongItemClickListener longItemClickListener;\n private boolean hasHeader = false;\n\n ... | import id.zelory.codepolitan.controller.ReadLaterController;
import id.zelory.codepolitan.data.model.Article;
import id.zelory.codepolitan.ui.view.CodePolitanImageView;
import static id.zelory.benih.adapter.BenihRecyclerAdapter.OnItemClickListener;
import static id.zelory.benih.adapter.BenihRecyclerAdapter.OnLongItemCl... | /*
* Copyright (c) 2015 Zelory.
*
* 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 agre... | thumbnail.setBackgroundColor(BenihUtils.getRandomColor()); | 1 |
bbuenz/provisions | src/main/java/edu/stanford/crypto/proof/assets/AssetProof.java | [
"public final class ECConstants {\n static {\n SecP256K1Curve curve = new SecP256K1Curve();\n BigInteger hash = BigInteger.ZERO;\n try {\n MessageDigest sha256 = sha256 = MessageDigest.getInstance(\"SHA-256\");\n sha256.update(\"PROVISIONS\".getBytes());\n ha... | import edu.stanford.crypto.ECConstants;
import edu.stanford.crypto.SQLDatabase;
import edu.stanford.crypto.database.Database;
import edu.stanford.crypto.proof.Proof;
import edu.stanford.crypto.proof.binary.BinaryProof;
import org.bouncycastle.math.ec.ECPoint;
import java.sql.Connection;
import java.sql.PreparedStatemen... | /*
* Decompiled with CFR 0_110.
*/
package edu.stanford.crypto.proof.assets;
public class AssetProof
implements Proof, | SQLDatabase { | 1 |
chms/jdotxt | src/com/chschmid/jdotxt/Jdotxt.java | [
"@SuppressWarnings(\"serial\")\n// The application main window\npublic class JdotxtGUI extends JFrame {\n\t\n\t// Minimal and maximal window dimension settings\n\tpublic static int MIN_WIDTH = 640;\n\tpublic static int MIN_HEIGHT = 480;\n\t\n\t// Lines to scroll using the mouse wheel\n\tpublic static int SCROLL_AMO... | import com.sun.jna.NativeLong;
import com.sun.jna.WString;
import com.todotxt.todotxttouch.task.LocalFileTaskRepository;
import com.todotxt.todotxttouch.task.TaskBag;
import com.todotxt.todotxttouch.task.TaskBagFactory;
import java.awt.EventQueue;
import java.io.File;
import java.io.IOException;
import java.util.prefs.... | /**
* jdotxt
*
* Copyright (C) 2013-2015 Christian M. Schmid
*
* jdotxt is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program... | taskBag = TaskBagFactory.getTaskBag(); | 6 |
Daskiworks/ghwatch | app/src/main/java/com/daskiworks/ghwatch/MainActivity.java | [
"public class PreferencesUtils {\n\n private static final String TAG = PreferencesUtils.class.getSimpleName();\n\n /*\n * Names of user edited preferences.\n */\n public static final String PREF_SERVER_CHECK_PERIOD = \"pref_serverCheckPeriod\";\n public static final String PREF_SERVER_CHECK_WIFI_ONLY = \"pr... | import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import androidx.swiperefreshlayout.widget.Swip... | setDebugMenuItemVisibility(menu, R.id.action_donationTogle);
if (repositoriesListViewTablet != null) {
if (menu.findItem(R.id.action_open_filter_dialog) != null) {
menu.findItem(R.id.action_open_filter_dialog).setVisible(false);
}
}
return super.onCreateOptionsMenu(menu);
}
pro... | Notification tr = (Notification) notificationsListAdapter.getItem(position); | 6 |
otale/tale | src/main/java/com/tale/controller/admin/PagesController.java | [
"public abstract class BaseController {\n\n public static String THEME = \"themes/default\";\n\n protected MapCache cache = MapCache.single();\n\n public String render(String viewName) {\n return THEME + \"/\" + viewName;\n }\n\n public BaseController title(Request request, String title) {\n ... | import com.blade.ioc.annotation.Inject;
import com.blade.kit.JsonKit;
import com.blade.kit.StringKit;
import com.blade.mvc.Const;
import com.blade.mvc.annotation.GetRoute;
import com.blade.mvc.annotation.Param;
import com.blade.mvc.annotation.Path;
import com.blade.mvc.annotation.PathParam;
import com.blade.mvc.http.Re... | package com.tale.controller.admin;
/**
* @author biezhi
* @date 2018/6/5
*/
@Slf4j
@Path("admin")
public class PagesController extends BaseController {
@Inject
private ContentsService contentsService;
@Inject
private MetasService metasService;
@Inject
private OptionsService optionsServi... | String themePath = Const.CLASSPATH + File.separatorChar + "templates" + File.separatorChar + "themes" + File.separatorChar + Commons.site_theme(); | 1 |
cloud-software-foundation/c5-replicator | c5-general-replication/src/main/java/c5db/replication/C5GeneralizedReplicationService.java | [
"public interface GeneralizedReplicationService {\n\n ListenableFuture<GeneralizedReplicator> createReplicator(String quorumId, Collection<Long> peerIds);\n\n public Reader<ReplicatorEntry> getLogReader(String quorumId);\n}",
"@ModuleTypeBinding(ModuleType.Log)\npublic interface LogModule extends C5Module {\n ... | import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.function.Consumer;
import c5db.interfaces.GeneralizedReplicationService;
import c5db.interfaces.LogModule;
import c5db.interfaces.ReplicationModule;
import c5db.interfaces.log.Reader;
import c5db.interfaces.replication.Gene... | /*
* Copyright 2014 WANdisco
*
* WANdisco licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | public Reader<ReplicatorEntry> getLogReader(String quorumId) { | 2 |
devmil/parrot-zik-2-supercharge | 03_project/Zik Widget/src/main/java/de/devmil/parrotzik2supercharge/widget/WidgetUpdateService.java | [
"public class ApiData {\n\n private static String KEY_BATTERYPERCENT = \"batteryPercent\";\n private static String KEY_NOISE_CONTROL = \"noiseControl\";\n private static String KEY_IS_CONNECTED = \"isConnected\";\n\n public ApiData(int batteryPercent,\n NoiseControlMode noiseControlMod... | import android.app.Notification;
import android.app.PendingIntent;
import android.app.Service;
import android.appwidget.AppWidgetManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
imp... | package de.devmil.parrotzik2supercharge.widget;
public class WidgetUpdateService extends Service
implements ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
private static String ACTION_UPDATE = "com.elinext.zikwidget.UPDATE";
private static String ACTION_STOP = "com.elinext.zikwid... | remoteViews.setImageViewResource(ncImageId, ImageHelper.getNoiseControlImage(ZikApi.getNoiseControlMode() == NoiseControlMode.Street2)); | 2 |
Thomas-Bergmann/Tournament | de.hatoka.mail/src/test/java/de/hatoka/mail/internal/dao/MailDaoJpaTest.java | [
"public class CommonDaoModule implements Module\n{\n private long start;\n\n public CommonDaoModule()\n {\n this(0);\n }\n\n public CommonDaoModule(long sequenceStartPosition)\n {\n start = sequenceStartPosition;\n }\n\n @Override\n public void configure(Binder binder)\n ... | import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
import javax.inject.Inject;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import com.google.inject.Guice;
import com.google.inject.Injector;
import de.hatoka.common.capi.modules.CommonDaoModule;
import... | package de.hatoka.mail.internal.dao;
public class MailDaoJpaTest
{
@Rule
public DerbyEntityManagerRule rule = new DerbyEntityManagerRule("MailTestPU");
@Inject
private MailDao mailDao;
@Before
public void createTestObject()
{
Injector injector = Guice.createInjector(new Comm... | MailPO mail = mailDao.createAndInsert("TestAccount"); | 1 |
TarsierMessenger/TarsierMessenger | app/src/main/java/ch/tarsier/tarsier/ui/adapter/BubbleAdapter.java | [
"public class Tarsier extends Application {\n\n private static final String TARSIER_TAG = \"TarsierApp\";\n private static Tarsier app;\n\n private UserPreferences mUserPreferences;\n private Database mDatabase;\n private EventHandler mEventHandler;\n\n private PeerRepository mPeerRepository;\n ... | import android.content.Context;
import android.graphics.Bitmap;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Relativ... | package ch.tarsier.tarsier.ui.adapter;
/**
* Custom class to display the bubbles in the ChatActivity ListView
*
* Inspired from https://github.com/AdilSoomro/Android-Speech-Bubble
* and https://github.com/survivingwithandroid/Surviving-with-android/tree/master/EndlessAdapter
*
* @see ch.tarsier.tarsier.ui.acti... | } catch (NoSuchModelException e) { | 3 |
avarabyeu/restendpoint | src/test/java/com/github/avarabyeu/restendpoint/http/mock/RestEndpointsTest.java | [
"@Ignore\npublic class BaseRestEndointTest {\n\n public static final String SERIALIZED_STRING = \"{\\\"intField\\\":100,\\\"stringField\\\":\\\"test string\\\"}\";\n public static final String SERIALIZED_STRING_PATTERN = \"{\\\"intField\\\":%d,\\\"stringField\\\":\\\"%s\\\"}\";\n public static final String... | import com.github.avarabyeu.restendpoint.http.BaseRestEndointTest;
import com.github.avarabyeu.restendpoint.http.Injector;
import com.github.avarabyeu.restendpoint.http.RestEndpoint;
import com.github.avarabyeu.restendpoint.http.RestEndpoints;
import com.github.avarabyeu.restendpoint.http.exception.RestEndpointIOExcept... | /*
* Copyright (C) 2014 Andrei Varabyeu
*
* 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... | @Test(expected = SerializerException.class) | 5 |
evolvingstuff/RecurrentJava | src/datasets/EmbeddedReberGrammar.java | [
"public class DataSequence implements Serializable {\n\n\tprivate static final long serialVersionUID = 1L;\n\tpublic List<DataStep> steps = new ArrayList<>();\n\t\n\tpublic DataSequence() {\n\t\t\n\t}\n\t\n\tpublic DataSequence(List<DataStep> steps) {\n\t\tthis.steps = steps;\n\t}\n\t\n\t@Override\n\tpublic String ... | import java.util.*;
import datastructs.DataSequence;
import datastructs.DataSet;
import datastructs.DataStep;
import loss.LossMultiDimensionalBinary;
import loss.LossSumOfSquares;
import model.Model;
import model.Nonlinearity;
import model.SigmoidUnit; | package datasets;
public class EmbeddedReberGrammar extends DataSet {
static public class State {
public State(Transition[] transitions) {
this.transitions = transitions;
}
public Transition[] transitions;
}
static public class Transition {
public Transition(int next_state_id, int token) {
this.... | List<DataStep> steps = new ArrayList<>();; | 2 |
ChiralBehaviors/Kramer | kramer/src/main/java/com/chiralbehaviors/layout/style/PrimitiveStyle.java | [
"public static final EventType<SelectionEvent> DOUBLE_SELECT;",
"public static final EventType<SelectionEvent> SINGLE_SELECT;",
"public static final EventType<SelectionEvent> TRIPLE_SELECT;",
"public class PrimitiveLayout extends SchemaNodeLayout {\n protected int averageCardinality;\n ... | import javafx.geometry.Point2D;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.Region;
import javafx.util.Duration;
import static com.chiralbehaviors.layout.cell.control.SelectionEvent.DOUBLE_SELECT;
import static com.chiralbehaviors.layout.... | /**
* Copyright (c) 2017 Chiral Behaviors, LLC, all rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless req... | public PrimitiveLayoutCell(PrimitiveLayout p, String style, | 3 |
ehsane/rainbownlp | src/main/java/rainbownlp/machinelearning/MLExample.java | [
"@Entity\n@Table( name = \"Artifact\" )\npublic class Artifact {\n\tString content;\n\tString generalized_content;\n\tList<Artifact> childsArtifact;\n\tArtifact parentArtifact;\n\tArtifact nextArtifact;\n\tArtifact previousArtifact;\n\tType artifactType;\n\tprivate String artifactOptionalCategory;\n\t\n\t@Transient... | import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
impor... | package rainbownlp.machinelearning;
@Entity
@Table( name = "MLExample" )
public class MLExample implements Serializable {
int exampleId;
String predictedClass;
String expectedClass;
boolean forTrain;
String corpusName;
String predictionEngine;
Artifact relatedArtifact;
Phrase relatedPhrase;
PhraseLin... | hibernateSession = HibernateUtil.sessionFactory.openSession(); | 7 |
pxb1988/dex2jar | dex-translator/src/test/java/com/googlecode/dex2jar/test/TestUtils.java | [
"public abstract interface DexConstants {\r\n\r\n int ACC_PUBLIC = 0x0001; // class, field, method\r\n int ACC_PRIVATE = 0x0002; // class, field, method\r\n int ACC_PROTECTED = 0x0004; // class, field, method\r\n int ACC_STATIC = 0x0008; // field, method\r\n int ACC_FINAL = 0x0010; // class, field, m... | import com.android.dx.cf.direct.DirectClassFile;
import com.android.dx.cf.direct.StdAttributeFactory;
import com.android.dx.cf.iface.ParseException;
import com.android.dx.command.dexer.DxContext;
import com.android.dx.dex.DexOptions;
import com.android.dx.dex.cf.CfOptions;
import com.android.dx.dex.cf.CfTranslator;
imp... | buf.setAccessible(true);
}
static void printAnalyzerResult(MethodNode method, Analyzer a, final PrintWriter pw)
throws IllegalArgumentException, IllegalAccessException {
Frame[] frames = a.getFrames();
Textifier t = new Textifier();
TraceMethodVisitor mv = new TraceM... | final LambadaNameSafeClassAdapter rca = new LambadaNameSafeClassAdapter(cw); | 2 |
tticoin/JointER | src/jp/tti_coin/main/java/data/nlp/joint/JointFeatureGenerator.java | [
"public abstract class FeatureGenerator {\n\tprotected Parameters params;\n\tpublic FeatureGenerator(Parameters params){\n\t\tthis.params = params;\n\t\tinit();\n\t}\n\tpublic SparseFeatureVector calculateFeature(Instance instance, Label y, int size){\n\t\tSparseFeatureVector fv = new SparseFeatureVector(params);\n... | import java.util.Arrays;
import java.util.List;
import java.util.Vector;
import model.FeatureGenerator;
import model.SparseFeatureVector;
import model.StringSparseVector;
import config.Parameters;
import data.Instance;
import data.Label;
import data.LabelUnit;
import data.nlp.Node; | package data.nlp.joint;
public class JointFeatureGenerator extends FeatureGenerator {
public JointFeatureGenerator(Parameters params) {
super(params);
}
@Override
public void init() {}
@Override | public SparseFeatureVector calculateFeature(Instance instance, Label y, int lastIndex, int target, LabelUnit candidateLabelUnit, boolean local) { | 4 |
kontalk/desktopclient-java | src/main/java/org/kontalk/crypto/Decryptor.java | [
"public final class Contact extends Observable implements Searchable {\n private static final Logger LOGGER = Logger.getLogger(Contact.class.getName());\n\n /**\n * Online status of one contact.\n */\n public enum Online {UNKNOWN, YES, NO, ERROR}\n\n /**\n * XMPP subscription status in roste... | import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Path;
import java.text.ParseException;
import java.ut... | /*
* Kontalk Java client
* Copyright (C) 2016 Kontalk Devteam <devteam@kontalk.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your ... | MessageContent content; | 3 |
micmiu/micmiu-web-sh | src/main/java/com/micmiu/framework/web/v1/system/service/impl/PermissionServiceImpl.java | [
"public interface BasicDao<E, ID extends Serializable> {\r\n\r\n\t/**\r\n\t * 按ID返回实体对象.\r\n\t *\r\n\t * @param id\r\n\t * @return T 按返回实体。\r\n\t */\r\n\tpublic E findById(ID id);\r\n\r\n\t/**\r\n\t * 查询所有的实体\r\n\t *\r\n\t * @return\r\n\t */\r\n\tpublic List<E> findAll();\r\n\r\n\t/**\r\n\t * 保存实体对象\r\n\t *\r\n\t *... | import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.micmiu.framework.web.v1.base.dao.BasicDao;
import com.micmiu.framework.web.v1.base.service.impl.BasicServiceImpl;
import com.micmiu.framework.web.v1.system.dao.PermissionDao;
import com.micmiu.framew... | package com.micmiu.framework.web.v1.system.service.impl;
/**
*
* @author <a href="http://www.micmiu.com">Michael Sun</a>
*/
@Service("permissionService")
public class PermissionServiceImpl extends BasicServiceImpl<Permission, Long>
implements PermissionService {
private PermissionDao permissionDao;
@Overri... | public BasicDao<Permission, Long> getBasicDao() { | 0 |
mru00/cutlet | CutletLib/src/main/java/com/cutlet/lib/testing/RandomData.java | [
"@ToString\r\npublic class Dimension implements Serializable{\r\n\r\n private double length;\r\n private double width;\r\n\r\n public Dimension(final double length, final double width) {\r\n this.length = length;\r\n this.width = width;\r\n }\r\n\r\n public double getLength() {\r\n ... | import com.cutlet.lib.model.Dimension;
import com.cutlet.lib.model.Panel;
import com.cutlet.lib.model.PanelInstance;
import com.cutlet.lib.model.Project;
import com.cutlet.lib.model.StockSheet;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
| /*
* Copyright (C) 2017 rudolf.muehlbauer@gmail.com
*/
package com.cutlet.lib.testing;
/**
*
* @author rmuehlba
*/
public class RandomData extends AbstractTestData {
private final int seed;
public RandomData(int seed) {
this.seed = seed;
}
@Override
public Proj... | StockSheet sheet = makeSheet(800, 600);
| 4 |
mgilangjanuar/GoSCELE | app/src/main/java/com/mgilangjanuar/dev/goscele/modules/main/adapter/CourseRecyclerViewAdapter.java | [
"public abstract class BaseFragment extends Fragment {\n\n @LayoutRes\n public abstract int findLayout();\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(findLayout(), ... | import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import and... | package com.mgilangjanuar.dev.goscele.modules.main.adapter;
/**
* Created by mgilangjanuar (mgilangjanuar@gmail.com)
*
* @since 2017
*/
public class CourseRecyclerViewAdapter extends BaseRecyclerViewAdapter<CourseRecyclerViewAdapter.ViewHolder> {
private Context context;
private BaseFragment fragment... | Intent intent = new Intent(v.getContext(), CourseActivity.class); | 3 |
AudiophileDev/T2M | src/com/audiophile/t2m/music/MelodyTrack.java | [
"public class Utils {\n\n /**\n * Applies a one-dimensional gaussian blur to the array, to remove jumps between values.\n * The original array is not changed.\n *\n * @param data The source data, which is blurred.\n * @param radius The radius of the blur. Maximum is the half of the data arr... | import com.audiophile.t2m.Utils;
import com.audiophile.t2m.io.CSVTools;
import com.audiophile.t2m.text.Sentence;
import com.audiophile.t2m.text.Word;
import javax.sound.midi.InvalidMidiDataException;
import javax.sound.midi.Track;
import java.io.IOException;
import java.util.ArrayList;
import static com.audiophile.t2m.... | package com.audiophile.t2m.music;
public class MelodyTrack implements TrackGenerator {
/**
*
*/
private static final int numOfChars = 255, numOfNotes = 128;
/**
* The basic key of the whole music piece
*/
private final Harmony baseKey;
/**
* Maps each letter to a corresp... | MidiUtils.ChangeInstrument(ensemble.instruments[currentVoice], track, channel, 0); | 4 |
mohnishbasha/terraform-ui | src/main/java/com/glitterlabs/terraformui/service/ProjectService.java | [
"public interface CloudRepository extends CrudRepository<Cloud, Long> {\n\t@Cacheable(\"clouds\")\n\tCloud findByName(String name);\n}",
"public interface ProjectRepository extends CrudRepository<Project, Long> {\n\n\t/**\n\t * Find by name.\n\t *\n\t * @param name the name\n\t * @return the list of projects\n\t ... | import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowire... | package com.glitterlabs.terraformui.service;
/**
* The Class CloudProjectService.
*/
@Service
public class ProjectService {
private static final Logger LOG = LoggerFactory.getLogger(ProjectService.class);
/** The project dao. */
@Autowired
private ProjectRepository projectdao;
@Autowired
private CloudRep... | final Cloud cloud = this.cloudDao.findByName(cloudType.toUpperCase()); | 2 |
tltv/gantt | gantt-addon/src/main/java/org/tltv/gantt/client/GanttWidget.java | [
"public static native double getBoundingClientRectWidth(com.google.gwt.dom.client.Element element)\n/*-{\n if(!element) {\n return 0.0;\n }\n if (element.getBoundingClientRect) {\n var rect = element.getBoundingClientRect();\n return rect.right - rect.left;\n } else {\n return elemen... | import static org.tltv.gantt.client.shared.GanttUtil.getBoundingClientRectWidth;
import static org.tltv.gantt.client.shared.GanttUtil.getMarginByComputedStyle;
import static org.tltv.gantt.client.shared.GanttUtil.getTouchOrMouseClientX;
import static org.tltv.gantt.client.shared.GanttUtil.getTouchOrMouseClientY;
import... | public void onScroll(ScrollEvent event) {
final Element element = event.getNativeEvent().getEventTarget().cast();
if (element != container) {
return;
}
AnimationScheduler.get().requestAnimationFrame(new AnimationCallback() {
@Overr... | getTouchOrMouseClientY(event.getNativeEvent())); | 3 |
johnzweng/bankomatinfos | src/at/zweng/bankomatinfos/ui/ListAdapterQuickTransactions.java | [
"public static String byte2Hex(byte b) {\r\n\tString[] HEX_DIGITS = { \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\r\n\t\t\t\"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\" };\r\n\tint nb = b & 0xFF;\r\n\tint i_1 = (nb >> 4) & 0xF;\r\n\tint i_2 = nb & 0xF;\r\n\treturn HEX_DIGITS[i_1] + HEX_DIGITS[i... | import static at.zweng.bankomatinfos.util.Utils.byte2Hex;
import static at.zweng.bankomatinfos.util.Utils.bytesToHex;
import static at.zweng.bankomatinfos.util.Utils.formatBalance;
import static at.zweng.bankomatinfos.util.Utils.formatDateOnly;
import static at.zweng.bankomatinfos.util.Utils.formatDateWithTime;
im... | /**
*
*/
package at.zweng.bankomatinfos.ui;
/**
* list adapter for the Quick transaction list
*
* @author Johannes Zweng <johannes@zweng.at>
*/
public class ListAdapterQuickTransactions extends BaseAdapter {
private Context _context;
private List<QuickTransactionLogEntry> _txList;
priva... | rawData.setText(prettyPrintString(bytesToHex(tx.getRawEntry()), 2));
| 1 |
jprante/elasticsearch-knapsack | src/test/java/org/xbib/suites/KnapsackTestSuite.java | [
"public class KnapsackExportTests extends NodeTestUtils {\n\n private final static ESLogger logger = ESLoggerFactory.getLogger(KnapsackExportTests.class.getName());\n\n @Test\n public void testMinimalExport() throws Exception {\n File exportFile = File.createTempFile(\"minimal-export-\", \".bulk\");... | import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.xbib.elasticsearch.plugin.knapsack.KnapsackExportTests;
import org.xbib.elasticsearch.plugin.knapsack.KnapsackImportTests;
import org.xbib.elasticsearch.plugin.knapsack.KnapsackSimpleTests;
import org.xbib.elasticsearch.plugin.knapsack.Knapsack... | package org.xbib.suites;
@RunWith(ListenerSuite.class)
@Suite.SuiteClasses({
KnapsackSimpleTests.class,
KnapsackExportTests.class,
KnapsackImportTests.class,
KnapsackTarTests.class,
KnapsackZipTests.class,
KnapsackCpioTests.class, | KnapsackBulkTests.class, | 4 |
redsolution/bst | bst/src/main/java/ru/redsolution/bst/ui/ChooseActivity.java | [
"public class BST extends Application {\n\n\tprivate static final String HOST_URL = \"https://online.moysklad.ru\";\n\tprivate static final String IMPORT_URL = HOST_URL\n\t\t\t+ \"/exchange/rest/ms/xml/%s/list?start=%d&count=%d\";\n\tprivate static final String INVENTORY_URL = HOST_URL\n\t\t\t+ \"/exchange/rest/ms/... | import ru.redsolution.bst.R;
import ru.redsolution.bst.data.BST;
import ru.redsolution.bst.data.table.BaseDatabaseException;
import ru.redsolution.bst.data.table.BaseGoodTable;
import ru.redsolution.bst.data.table.CustomGoodTable;
import ru.redsolution.bst.data.table.GoodFolderTable;
import ru.redsolution.bst.data.tabl... | /**
* Copyright (c) 2013, Redsolution LTD. All rights reserved.
*
* This file is part of Barcode Scanner Terminal project;
* you can redistribute it and/or modify it under the terms of
*
* Barcode Scanner Terminal is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the imp... | } else if (tableName.equals(GoodFolderTable.getInstance() | 4 |
xSAVIKx/AndroidScreencast | src/main/java/com/github/xsavikx/androidscreencast/app/DeviceChooserApplication.java | [
"@Singleton\npublic class AndroidDebugBridgeWrapper {\n private final String adbPath;\n private AndroidDebugBridge adb;\n\n @Inject\n public AndroidDebugBridgeWrapper(@Named(ADB_PATH_KEY) String adbPath) {\n this.adbPath = adbPath;\n }\n\n public IDevice[] getDevices() {\n return get... | import com.android.ddmlib.IDevice;
import com.github.xsavikx.androidscreencast.api.adb.AndroidDebugBridgeWrapper;
import com.github.xsavikx.androidscreencast.configuration.ApplicationConfiguration;
import com.github.xsavikx.androidscreencast.exception.NoDeviceChosenException;
import com.github.xsavikx.androidscreencast... | /*
* Copyright 2020 Yurii Serhiichuk
*
* 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 agree... | final ApplicationConfiguration applicationConfiguration) { | 1 |
R2RML-api/R2RML-api | r2rml-api-jena-binding/src/test/java/jenaTest/SerializeSubMapTest.java | [
"public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod... | import org.apache.jena.rdf.model.ResourceFactory;
import eu.optique.r2rml.api.MappingFactory;
import eu.optique.r2rml.api.model.SubjectMap;
import eu.optique.r2rml.api.model.Template;
import eu.optique.r2rml.api.model.R2RMLVocabulary;
import java.util.Set;
import eu.optique.r2rml.api.binding.jena.JenaR2RMLMapping... | /*******************************************************************************
* Copyright 2013, the Optique Consortium
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http... | if(ResourceFactory.createResource(R2RMLVocabulary.PROP_TEMPLATE).equals(stmt.getPredicate())){
| 4 |
isisaddons/isis-app-todoapp | integtests/src/test/java/todoapp/integtests/tests/ToDoItemDtoIntegTest.java | [
"@Mixin\npublic class ToDoItem_asV1_1 implements Dto {\n\n private final ToDoItem toDoItem;\n\n public ToDoItem_asV1_1(final ToDoItem toDoItem) {\n this.toDoItem = toDoItem;\n }\n\n @Action(\n semantics = SemanticsOf.SAFE,\n restrictTo = RestrictTo.PROTOTYPING\n )\n @A... | import org.apache.isis.applib.services.jaxb.JaxbService;
import static org.assertj.core.api.Assertions.assertThat;
import todoapp.app.viewmodels.todoitem.ToDoItem_asV1_1;
import todoapp.app.viewmodels.todoitem.v1.ToDoItemV1_1;
import todoapp.app.viewmodels.todoitem.v1.dto.ToDoItemV11;
import todoapp.dom.todoitem.ToDoIt... | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License")... | ToDoItem toDoItem; | 2 |
iGoodie/TwitchSpawn | src/main/java/net/programmer/igoodie/twitchspawn/tslanguage/event/builder/TwitchFollowBuilder.java | [
"public class CredentialsConfig {\n\n public static CredentialsConfig create(String filepath) throws ParsingException {\n return create(new File(filepath));\n }\n\n public static CredentialsConfig create(File file) throws ParsingException {\n try {\n // File is not there, create an... | import net.programmer.igoodie.twitchspawn.configuration.CredentialsConfig;
import net.programmer.igoodie.twitchspawn.tracer.Platform;
import net.programmer.igoodie.twitchspawn.tslanguage.event.EventArguments;
import net.programmer.igoodie.twitchspawn.tslanguage.event.TSLEventPair;
import net.programmer.igoodie.twitchsp... | package net.programmer.igoodie.twitchspawn.tslanguage.event.builder;
public class TwitchFollowBuilder extends EventBuilder {
@Override | public <T> EventArguments build(CredentialsConfig.Streamer streamer, TSLEventPair eventPair, T rawData, Platform platform) { | 1 |
vsite-hr/hive | src/main/java/hr/vsite/hive/services/javafx/scenes/SensorsScene.java | [
"@Singleton\npublic class HiveEventBus extends AsyncEventBus {\n\n\tHiveEventBus() {\n\t\tthis(Executors.newWorkStealingPool(), new SubscriberExceptionHandler() {\n\t\t\t@Override\n\t\t\tpublic void handleException(Throwable exception, SubscriberExceptionContext context) {\n\t\t\t\tlog.error(\"Error in event handle... | import java.util.HashMap;
import java.util.Map;
import javax.inject.Inject;
import com.google.common.eventbus.Subscribe;
import hr.vsite.hive.HiveEventBus;
import hr.vsite.hive.dao.HiveDao;
import hr.vsite.hive.sensors.Sensor;
import hr.vsite.hive.sensors.SensorFilter;
import hr.vsite.hive.ticks.ValueTickEvent;
import ... | package hr.vsite.hive.services.javafx.scenes;
/**
* <p><b>WARNING</b>:</p>
*
* <p>Prototype class, for presentation only.</p>
*
* </>Heavy refactoring needed!</p>
*/
public class SensorsScene extends Scene {
@Inject | public SensorsScene(HiveDao dao, HiveEventBus eventBus) { | 0 |
maxpowa/AdvancedHUD | src/main/java/advancedhud/client/huditems/HudItemBossBar.java | [
"public class HUDRegistry {\n protected static List<HudItem> hudItemList = new ArrayList<HudItem>();\n protected static boolean initialLoadComplete = false;\n protected static List<HudItem> hudItemListActive = new ArrayList<HudItem>();\n\n private static Logger log = LogManager.getLogger(\"AdvancedHUD-A... | import advancedhud.api.Alignment;
import advancedhud.api.HUDRegistry;
import advancedhud.api.HudItem;
import advancedhud.api.RenderAssist;
import advancedhud.client.ui.GuiAdvancedHUDConfiguration;
import advancedhud.client.ui.GuiScreenHudItem;
import advancedhud.client.ui.GuiScreenReposition;
import net.minecraft.clien... | package advancedhud.client.huditems;
public class HudItemBossBar extends HudItem {
@Override
public String getName() {
return "bossbar";
}
@Override
public String getButtonLabel() {
return "BOSSBAR";
}
@Override
public Alignment getDefaultAlignment() {
return... | return new GuiScreenHudItem(Minecraft.getMinecraft().currentScreen, this); | 4 |
dragonite-network/dragonite-java | dragonite-sdk/src/main/java/com/vecsight/dragonite/sdk/socket/DragoniteServerSocket.java | [
"public class ConnectionNotAliveException extends DragoniteException {\n\n public ConnectionNotAliveException() {\n super(\"Connection is not alive\");\n }\n\n public ConnectionNotAliveException(final String msg) {\n super(msg);\n }\n\n}",
"public class IncorrectSizeException extends Dra... | import com.vecsight.dragonite.sdk.exception.ConnectionNotAliveException;
import com.vecsight.dragonite.sdk.exception.IncorrectSizeException;
import com.vecsight.dragonite.sdk.exception.SenderClosedException;
import com.vecsight.dragonite.sdk.misc.DragoniteGlobalConstants;
import com.vecsight.dragonite.sdk.msg.Message;
... | /*
* The Dragonite Project
* -------------------------
* See the LICENSE file in the root directory for license information.
*/
package com.vecsight.dragonite.sdk.socket;
public class DragoniteServerSocket extends DragoniteSocket {
private final ReceiveHandler receiver;
private final ResendHandler re... | protected void onHandleMessage(final Message message, final int pktLength) { | 4 |
PedroGomes/TPCw-benchmark | src/org/uminho/gsd/benchmarks/interfaces/executor/AbstractDatabaseExecutorFactory.java | [
"public class BenchmarkExecutor {\n\n //Node id\n private BenchmarkNodeID nodeId;\n\n //Benchmark interfaces\n private AbstractWorkloadGeneratorFactory workloadInterface;\n private AbstractDatabaseExecutorFactory databaseInterface;\n\n /**\n * number of clients on each benchmarking node *\n ... | import org.uminho.gsd.benchmarks.benchmark.BenchmarkExecutor;
import org.uminho.gsd.benchmarks.benchmark.BenchmarkNodeID;
import org.uminho.gsd.benchmarks.dataStatistics.ResultHandler;
import org.uminho.gsd.benchmarks.helpers.JsonUtil;
import org.uminho.gsd.benchmarks.helpers.TPM_counter;
import java.io.*;
import java.... | /*
* *********************************************************************
* Copyright (c) 2010 Pedro Gomes and Universidade do Minho.
* All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy... | Map<String, Map<String, String>> map = JsonUtil.getStringMapMapFromJsonString(jsonString_r); | 3 |
njustesen/hero-aicademy | src/ai/evolution/OnlineIslandEvolution.java | [
"public class GameState {\n\t\n\tpublic static int TURN_LIMIT = 100;\n\tpublic static boolean RANDOMNESS = false;\n\tpublic static int STARTING_AP = 3;\n\tpublic static int ACTION_POINTS = 5;\n\t\n\tprivate static final int ASSAULT_BONUS = 300;\n\tprivate static final double INFERNO_DAMAGE = 350;\n\tprivate static ... | import game.GameState;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import ui.UI;
import action.Action;
import action.SingletonAction;
import ai.A... | package ai.evolution;
public class OnlineIslandEvolution implements AI, AiVisualizor {
public int popSize;
public int budget;
public double killRate;
public double mutRate;
public IStateEvaluator evaluator;
public List<Action> actions;
private List<RollingThread> threads;
private ExecutorService execut... | RollingThread thread = new RollingThread(new OnlineEvolution(useHistory, popSize, mutRate, killRate, budget, evaluator.copy()), new GameState(null), table); | 0 |
ctodb/push | cn.ctodb.push.server/src/main/java/cn/ctodb/push/server/filter/AuthFilter.java | [
"public class Connection {\n\n private ChannelHandlerContext chc;\n\n public void send(Packet packet) {\n chc.channel().writeAndFlush(packet);\n }\n\n public ChannelHandlerContext getChc() {\n return chc;\n }\n\n public void setChc(ChannelHandlerContext chc) {\n this.chc = chc... | import cn.ctodb.push.core.Connection;
import cn.ctodb.push.core.Filter;
import cn.ctodb.push.core.FilterResult;
import cn.ctodb.push.dto.Command;
import cn.ctodb.push.dto.Error;
import cn.ctodb.push.dto.ErrorCode;
import cn.ctodb.push.dto.Packet;
import cn.ctodb.push.server.session.Session;
import cn.ctodb.push.server.... | package cn.ctodb.push.server.filter;
/**
* All rights Reserved, Designed By www.ctodb.cn
*
* @version V1.0
* @author: lichaohn@163.com
* @Copyright: 2018 www.ctodb.cn Inc. All rights reserved.
*/
public class AuthFilter implements Filter {
private Logger logger = LoggerFactory.getLogger(AuthFilter.class);... | public FilterResult exec(Packet packet, Connection connection) { | 2 |
webpagebytes/demo-cms-app | src/main/java/com/webpagebytes/wpbsample/database/WPBDatabase.java | [
"public class Account {\r\n\tprivate int user_id;\r\n\tprivate long balance;\r\n\t\r\n\tpublic int getUser_id() {\r\n\t\treturn user_id;\r\n\t}\r\n\tpublic void setUser_id(int user_id) {\r\n\t\tthis.user_id = user_id;\r\n\t}\r\n\tpublic long getBalance() {\r\n\t\treturn balance;\r\n\t}\r\n\tpublic void setBalance(l... | import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Tim... | {
statement = connection.prepareStatement(GET_ACC_OPERATIONS_STATS_BY_DAYS);
statement.setInt(1, type);
statement.setInt(2, days);
ResultSet rs = statement.executeQuery();
while (rs.next())
{
result.put(rs.getDate(1), rs.getInt(2));
}
}
finally
{
if (statement != null)
... | public List<AccountOperation> getAccountOperationsForUser(int user_id, Date date, int count) throws SQLException
| 1 |
cristcost/sensormix | sensormix-dataservice-bundle/src/main/java/com/google/developers/gdgfirenze/serializer/Serializer.java | [
"@SuppressWarnings(\"serial\")\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlType(name = \"AbstractSample\")\n@XmlSeeAlso({\n NumericValueSample.class, PositionSample.class, WifiSignalSample.class\n})\npublic abstract class AbstractSample implements Serializable {\n\n @XmlAttribute(required = true, name = \"senso... | import com.google.developers.gdgfirenze.model.AbstractSample;
import com.google.developers.gdgfirenze.model.NumericValueSample;
import com.google.developers.gdgfirenze.model.PositionSample;
import com.google.developers.gdgfirenze.model.StringValueSample;
import com.google.developers.gdgfirenze.model.WifiSignalSampl... | /*
* Copyright 2013, Cristiano Costantini, Giuseppe Gerla, Michele Ficarra, Sergio Ciampi, Stefano
* Cigheri.
*
* 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.apac... | k.register(StringValueSample.class, 203);
| 3 |
Talon876/RSIRCBot | src/org/nolat/rsircbot/commands/HiscoreCommand.java | [
"public class RSIRCBot extends ListenerAdapter<PircBotX> {\n\n private PircBotX bot;\n\n public static final String VERSION = \"1.3.1a\";\n\n private final Settings settings;\n\n public RSIRCBot(Settings settings) {\n this.settings = settings;\n Configuration.Builder<PircBotX> builder = ne... | import java.io.IOException;
import org.nolat.rsircbot.RSIRCBot;
import org.nolat.rsircbot.data.HiscoreData;
import org.nolat.rsircbot.data.RankLevelXp;
import org.nolat.rsircbot.tools.Calculate;
import org.nolat.rsircbot.tools.Names;
import org.nolat.rsircbot.tools.RSFormatter;
import org.nolat.rsircbot.tools.Spellchec... | package org.nolat.rsircbot.commands;
public class HiscoreCommand extends Command {
public HiscoreCommand() {
super("hiscore");
addAlternativeCommand("highscore");
setArgString("<username> <skill>");
setHelpMessage("Retrieves the hiscore data for the given username and skill");
... | + RSFormatter.format(Calculate.xpUntilLevelUp(rlx.getXp())) | 5 |
NonVolatileComputing/Mnemonic | core/src/test/java/com/intel/bigdatamem/MemBufferHolderCachePoolNGTest.java | [
"public class BigDataMemAllocator extends CommonAllocator<BigDataMemAllocator> {\n\n private boolean m_activegc = true;\n private long m_gctimeout = 100;\n private long m_nid = -1;\n private VolatileMemoryAllocatorService m_vmasvc = null;\n\n /**\n * Constructor, it initializes and allocate a mem... | import static org.testng.Assert.*;
import org.testng.annotations.Test;
import com.intel.bigdatamem.BigDataMemAllocator;
import com.intel.bigdatamem.CachePool;
import com.intel.bigdatamem.ContainerOverflowException;
import com.intel.bigdatamem.EvictFilter;
import com.intel.bigdatamem.DropEvent;
import com.intel.bigdatam... | package com.intel.bigdatamem;
/**
* test the functionalities of MemBufferHolderCachePool class
*
* @author Wang, Gang(Gary) {@literal <gang1.wang@intel.com>}
*/
public class MemBufferHolderCachePoolNGTest {
/**
* test to aggressively allow any MemBufferHolder objects in pool to be able
* to drop at will ... | new MemClustering.NodeConfig<BigDataMemAllocator>( | 0 |
apache/creadur-rat | apache-rat-core/src/main/java/org/apache/rat/Report.java | [
"public class XmlReportFactory {\n public static final RatReport createStandardReport(IXmlWriter writer,\n final ClaimStatistic pStatistic, ReportConfiguration pConfiguration) {\n final List<RatReport> reporters = new ArrayList<>();\n if (pStatistic != null) {\n reporters.add(... | import org.apache.commons.cli.*;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.rat.api.RatException;
import org.apache.rat.report.IReportable;
import org.apache.rat.report.RatReport;
import org.apache.rat.report.claim.Cl... | "Allows multiple arguments.")
.build();
opts.addOption(exclude);
final Option excludeFile = Option.builder(EXCLUDE_FILE_CLI)
.argName("fileName")
.longOpt("exclude-file")
.hasArgs()
.desc("Excludes f... | return new ArchiveWalker(base, inputFileFilter); | 3 |
Petschko/Java-RPG-Maker-MV-Decrypter | src/main/java/org/petschko/rpgmakermv/decrypt/gui/Update.java | [
"public class Const {\n\tpublic static final String CREATOR = \"Petschko\";\n\tpublic static final String CREATOR_URL = \"https://petschko.org/\";\n\tpublic static final String CREATOR_DONATION_URL = \"https://www.paypal.me/petschko\";\n\n\t// System Constance's\n\tpublic static final String DS = System.getProperty... | import org.petschko.lib.Const;
import org.petschko.lib.gui.JOptionPane;
import org.petschko.lib.gui.notification.ErrorWindow;
import org.petschko.lib.gui.notification.InfoWindow;
import org.petschko.lib.update.UpdateException;
import org.petschko.rpgmakermv.decrypt.App;
import org.petschko.rpgmakermv.decrypt.Config;
im... | package org.petschko.rpgmakermv.decrypt.gui;
/**
* @author Peter Dragicevic
*/
class Update {
private GUI gui;
private org.petschko.lib.update.Update update = null;
private String[] options;
private boolean autoOptionExists = false;
private boolean ranAutomatically = false;
/**
* Update constructor
*
... | int response = JOptionPane.showOptionDialog( | 1 |
Wisebite/wisebite_android | app/src/main/java/dev/wisebite/wisebite/service/ServiceFactory.java | [
"public class DishRepository extends FirebaseRepository<Dish> {\n\n public static final String OBJECT_REFERENCE = \"dish\";\n public static final String NAME_REFERENCE = \"name\";\n public static final String PRICE_REFERENCE = \"price\";\n public static final String DESCRIPTION_REFERENCE = \"description... | import android.content.Context;
import dev.wisebite.wisebite.repository.DishRepository;
import dev.wisebite.wisebite.repository.ImageRepository;
import dev.wisebite.wisebite.repository.MenuRepository;
import dev.wisebite.wisebite.repository.OpenTimeRepository;
import dev.wisebite.wisebite.repository.OrderItemRepository... | package dev.wisebite.wisebite.service;
/**
* Created by albert on 13/03/17.
* @author albert
*/
public final class ServiceFactory {
private static DishService dishService;
private static ImageService imageService;
private static MenuService menuService;
private static OpenTimeService openTimeServ... | new UserRepository(context)); | 8 |
florent37/OCiney | app/src/main/java/com/bdc/ociney/modele/Person/Person.java | [
"public class Feature {\n\n @Expose\n private Integer code;\n @Expose\n private Publication publication;\n @Expose\n private String title;\n @Expose\n private Picture picture;\n @Expose\n private List<ModelObject> category = new ArrayList<ModelObject>();\n\n public Integer getCode()... | import com.google.gson.annotations.Expose;
import com.bdc.ociney.modele.Feature;
import com.bdc.ociney.modele.Link;
import com.bdc.ociney.modele.Media;
import com.bdc.ociney.modele.ModelObject;
import com.bdc.ociney.modele.News;
import com.bdc.ociney.modele.Participation;
import com.bdc.ociney.modele.Picture;
import co... | package com.bdc.ociney.modele.Person;
public class Person implements Comparable {
@Expose
private Integer code;
@Expose
private Integer gender;
@Expose
private List<ModelObject> nationality = new ArrayList<ModelObject>();
@Expose
private String activityShort;
@Expose
private... | private List<Feature> feature = new ArrayList<Feature>(); | 0 |
atzedijkstra/ssm | src/nl/uu/cs/ssmui/StackTableModel.java | [
"public class ColoredText\n{\n\tpublic static final ColoredText blankDefault = new ColoredText( \"\", Color.gray ) ;\n\n private String text \t\t;\n private Color color ;\n \n public ColoredText( String t, Color c )\n {\n text = t ;\n color = c ... | import javax.swing.event.TableModelEvent;
import javax.swing.table.AbstractTableModel;
import nl.uu.cs.ssm.ColoredText;
import nl.uu.cs.ssm.MachineState;
import nl.uu.cs.ssm.Memory;
import nl.uu.cs.ssm.MemoryAnnotation;
import nl.uu.cs.ssm.MemoryCellEvent;
import nl.uu.cs.ssm.MemoryCellListener;
import nl.uu.cs.ssm.Reg... | package nl.uu.cs.ssmui;
public class StackTableModel extends AbstractTableModel
implements MemoryCellListener
{
private static final long serialVersionUID = 1L ;
private static final int C_ADDRESS = 0 ;
private static final int C_VALUE = 1 ;
protected static final int C_REGPTRS = 2 ;
public ... | public void cellChanged( MemoryCellEvent e ) | 4 |
DavidShepherdson/jira-suite-utilities | src/main/java/com/googlecode/jsu/workflow/WorkflowValueFieldConditionPluginFactory.java | [
"public class ComparisonType {\r\n private final int id;\r\n private final String value;\r\n private final String mnemonic;\r\n\r\n /**\r\n * @param id\r\n * @param value\r\n */\r\n public ComparisonType(int id, String value, String mnemonic) {\r\n this.id = id;\r\n this.val... | import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.atlassian.jira.issue.fields.Field;
import com.atlassian.jira.plugin.workflow.AbstractWorkflowPluginFactory;
import com.atlassian.jira.plugin.workflow.WorkflowPluginConditionFactory;
import com.googlecode.jsu.helpers.ComparisonType;
import... | package com.googlecode.jsu.workflow;
/**
* @author Gustavo Martin.
*
* This class defines the parameters available for Value Field Condition.
*
*/
public class WorkflowValueFieldConditionPluginFactory extends
AbstractWorkflowPluginFactory implements WorkflowPluginConditionFactory {
private final Co... | List<ComparisonType> comparisonList = conditionCheckerFactory.getComparisonTypes(); | 0 |
heribender/SocialDataImporter | SDI-core/src/main/java/ch/sdi/core/impl/mail/MailJobDefault.java | [
"public class SdiException extends Exception\n{\n private static final long serialVersionUID = 1L;\n\n public static final int EXIT_CODE_NO_ERROR = 0;\n public static final int EXIT_CODE_UNKNOWN_ERROR = 1;\n public static final int EXIT_CODE_PARSE_ERROR = 2;\n public static final int EXIT_CODE_CONFIG... | import org.apache.commons.mail.Email;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import ch.sdi.core.exc.SdiException;
... | /**
* Copyright (c) 2014 by the original author or authors.
*
* This code 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.
... | public void execute( Person<?> aPerson ) throws SdiException | 1 |
aeshell/aesh-extensions | aesh/src/main/java/org/aesh/extensions/highlight/scanner/JavaScanner.java | [
"public class StringScanner {\n\n private StringSequence sequence;\n\n public StringScanner(String source) {\n this.sequence = new StringSequence(source);\n }\n\n public MatchResult scan(String pattern) {\n return scan(Pattern.compile(pattern));\n }\n\n public MatchResult scan(Patter... | import org.aesh.extensions.highlight.StringScanner;
import org.aesh.extensions.highlight.Encoder;
import org.aesh.extensions.highlight.Scanner;
import org.aesh.extensions.highlight.TokenType;
import org.aesh.extensions.highlight.WordList;
import org.aesh.extensions.highlight.scanner.java.BuiltInTypes;
import java.util.... | /*
* JBoss, Home of Professional Open Source
* Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Vers... | .add(BuiltInTypes.PREDEFINED_TYPES, TokenType.predefined_type) | 5 |
Airpy/KeywordDrivenAutoTest | src/test/java/com/keyword/automation/bill/purchase/Test001_Purchase_TestPurchaseOrderBill.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.purchase;
/**
* 入口:采购-制作单据-采购订单<br/>
* 主要测试功能:
* 1、新增采购订单
*
* @author Amio_
*/
public class Test001_Purchase_TestPurchaseOrderBill {
private static List<BillCell> billCellList = new ArrayList<BillCell>(); | private static BillHeader billHeader = new BillHeader(null, "测试供应商", null, "刘振峰", null, false, "这是一个单据备注"); | 3 |
mcxiaoke/Android-Next | samples/src/main/java/com/mcxiaoke/next/samples/ListViewExtendSamples.java | [
"public class SimpleTaskCallback<Result> implements TaskCallback<Result> {\n\n @Override\n public void onTaskStarted(String name, Bundle extras) {\n\n }\n\n @Override\n public void onTaskFinished(String name, Bundle extras) {\n\n }\n\n @Override\n public void onTaskCancelled(String name, Bun... | import android.annotation.TargetApi;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import butterknife.BindView;
import butterknife.ButterKnife;
import com.mcxiaoke.next.task.SimpleTaskCallback;
import com.mcxiaoke.next.task.TaskCallback;
import com.mcxiaoke.next.task.TaskQueue;
import com.mcxiaoke.ne... | package com.mcxiaoke.next.samples;
/**
* EndlessListView使用示例
* User: mcxiaoke
* Date: 13-10-25
* Time: 下午4:44
*/
@TargetApi(VERSION_CODES.HONEYCOMB)
public class ListViewExtendSamples extends BaseActivity {
public static final String TAG = ListViewExtendSamples.class.getSimpleName();
@BindView(android.... | mListView.setOnRefreshListener(new OnRefreshListener() { | 4 |
sewerk/Bill-Calculator | persistence/src/main/java/pl/srw/billcalculator/persistence/type/BillType.java | [
"public interface Bill {\n\n Long getId();\n Long getPricesId();\n\n Date getDateFrom();\n void setDateFrom(Date dateFrom);\n Date getDateTo();\n void setDateTo(Date dateTo);\n Double getAmountToPay();\n void setAmountToPay(Double value);\n}",
"@Entity(active = true)\npublic class PgeG11Bi... | import org.greenrobot.greendao.AbstractDao;
import pl.srw.billcalculator.db.Bill;
import pl.srw.billcalculator.db.PgeG11Bill;
import pl.srw.billcalculator.db.PgeG12Bill;
import pl.srw.billcalculator.db.PgnigBill;
import pl.srw.billcalculator.db.Prices;
import pl.srw.billcalculator.db.TauronG11Bill;
import pl.srw.billca... | package pl.srw.billcalculator.persistence.type;
/**
* Created by Kamil Seweryn.
*/
public enum BillType {
PGE_G11,
PGE_G12,
PGNIG,
TAURON_G11,
TAURON_G12;
public AbstractDao<? extends Bill, Long> getDao() {
assertNotNull(Database.getSession());
switch (this) {
c... | else if (bill instanceof TauronG11Bill) return BillType.TAURON_G11; | 4 |
be-hase/relumin | src/main/java/com/behase/relumin/service/UserServiceImpl.java | [
"public class Constants {\n private Constants() {\n }\n\n ;\n\n public static final int ALL_SLOTS_SIZE = 16384;\n\n public static final String ERR_CODE_INVALID_PARAMETER = \"400_000\";\n public static final String ERR_CODE_REDIS_SET_FAILED = \"500_000\";\n public static final String ERR_CODE_AL... | import com.behase.relumin.Constants;
import com.behase.relumin.exception.InvalidParameterException;
import com.behase.relumin.model.LoginUser;
import com.behase.relumin.model.Role;
import com.behase.relumin.util.ValidationUtils;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind... | package com.behase.relumin.service;
@Service
public class UserServiceImpl implements UserService {
public static final TypeReference<List<LoginUser>> LIST_LOGIN_USER_TYPE = new TypeReference<List<LoginUser>>() {
};
@Autowired
private JedisPool dataStoreJedisPool;
@Autowired
private ObjectMa... | user.setRole(Role.get(role).getAuthority()); | 3 |
TheTorbinWren/OresPlus | src/main/java/tw/oresplus/core/OreEventHandler.java | [
"@Mod(modid = References.MOD_ID, name = References.MOD_NAME, version = References.MOD_VERSION, dependencies=\"required-after:Forge@10.13.0.1180;after:TConstruct\")\npublic class OresPlus {\n\t\n\t@SidedProxy(clientSide=\"tw.oresplus.client.ClientProxy\", serverSide=\"tw.oresplus.core.ServerProxy\") \n\tpublic stati... | import java.util.ArrayList;
import tw.oresplus.OresPlus;
import tw.oresplus.blocks.BlockManager;
import tw.oresplus.worldgen.IOreGenerator;
import tw.oresplus.worldgen.OreGenType;
import tw.oresplus.worldgen.OreGenerators;
import tw.oresplus.worldgen.OreGeneratorsEnd;
import tw.oresplus.worldgen.OreGeneratorsNether;
im... | package tw.oresplus.core;
public class OreEventHandler {
@SubscribeEvent
public void chunkLoad(ChunkDataEvent.Load event) {
NBTTagCompound oresPlusRegen = event.getData().getCompoundTag("OresPlus");
if (oresPlusRegen.hasNoTags()) { // regen info not found, checking for old regen key
oresPlusRegen.setStri... | sources = OreGeneratorsEnd.values(); | 5 |
OneNoteDev/Android-REST-API-Explorer | app/src/main/java/com/microsoft/o365_android_onenote_rest/BaseActivity.java | [
"@Module(library = true)\npublic class AzureADModule {\n\n private final Builder mBuilder;\n\n protected AzureADModule(Builder builder) {\n mBuilder = builder;\n }\n\n public static class Builder {\n\n private static final String SHARED_PREFS_DEFAULT_NAME = \"AzureAD_Preferences\";\n\n ... | import com.microsoft.AzureADModule;
import com.microsoft.AzureAppCompatActivity;
import com.microsoft.live.LiveAuthClient;
import com.microsoft.o365_android_onenote_rest.application.SnippetApp;
import com.microsoft.o365_android_onenote_rest.conf.ServiceConstants;
import com.microsoft.o365_android_onenote_rest.inject.Az... | /*
* Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
*/
package com.microsoft.o365_android_onenote_rest;
public abstract class BaseActivity
extends AzureAppCompatActivity
implements ObjectGraphInjector {
@Inject
p... | return new Object[]{new AzureModule()}; | 4 |
xushaomin/apple-deploy | src/main/java/com/appleframework/deploy/plus/shell/ShellDeployPlus.java | [
"public class ProjectWithBLOBs extends Project implements Serializable {\r\n \r\n\tprivate String hosts;\r\n\r\n private String preDeploy;\r\n\r\n private String postDeploy;\r\n\r\n private String afterDeploy;\r\n\r\n private static final long serialVersionUID = 1L;\r\n\r\n public String getHosts(... | import com.appleframework.config.core.util.StringUtils;
import com.appleframework.deploy.entity.ProjectWithBLOBs;
import com.appleframework.deploy.entity.Task;
import com.appleframework.deploy.model.DeployParam;
import com.appleframework.deploy.model.DeployType;
import com.appleframework.deploy.model.EnvType;
imp... | package com.appleframework.deploy.plus.shell;
public class ShellDeployPlus implements DeployPlus {
public void doDeploy(Task task, ProjectWithBLOBs project) {
Constants.BOOT_STATUS_MAP.put(task.getId(), false);
try {
// pre deploy
if (!StringUtils.isEmpty(project.getPreDeploy())) {
WebSocke... | DeployParam param = new DeployParam();
| 2 |
Mahoney/sysout-over-slf4j | sysout-over-slf4j-context/src/test/java/uk/org/lidalia/sysoutslf4j/context/SysOutOverSLF4JTests.java | [
"public abstract class SysOutOverSLF4JTestCase {\n\n protected ClassLoader originalContextClassLoader;\n protected PrintStream SYS_OUT;\n protected PrintStream SYS_ERR;\n\n @Before\n public void resetLoggers() {\n TestLoggerFactory.clearAll();\n }\n\n @Before\n public void storeOrigin... | import java.io.PrintStream;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor;
import org.powermock.modules.junit4.PowerMockRunner;
import or... | /*
* Copyright (c) 2009-2012 Robert Elliot
* All rights reserved.
*
* 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 ... | public class SysOutOverSLF4JTests extends SysOutOverSLF4JTestCase { | 0 |
hea3ven/BuildingBricks | src/main/java/com/hea3ven/buildingbricks/core/item/ItemTrowel.java | [
"@Mod(modid = ModBuildingBricks.MODID, version = ModBuildingBricks.VERSION,\n\t\tdependencies = ModBuildingBricks.DEPENDENCIES,\n\t\tguiFactory = \"com.hea3ven.buildingbricks.core.config.BuildingBricksConfigGuiFactory\",\n\t\tupdateJSON = \"https://raw.githubusercontent.com/hea3ven/BuildingBricks/version/media/upda... | import java.util.List;
import java.util.stream.Collectors;
import com.google.common.collect.ImmutableSet;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import ... | package com.hea3ven.buildingbricks.core.item;
public class ItemTrowel extends Item implements ItemMaterial {
public static boolean trowelsInCreative = true;
public ItemTrowel() {
setHasSubtypes(true);
}
@Override
public void setMaterial(ItemStack stack, Material mat) {
if (mat == null) {
if (stack.... | return MaterialRegistry.get(stack.getTagCompound().getString("material")); | 7 |
gemserk/jresourcesmanager | resourcesmanager-tests/src/main/java/com/gemserk/resources/tests/JFrameWithImageResourceLoaderProviderSample.java | [
"public class Resource<T> {\n\n\tT data = null;\n\n\tDataLoader<T> dataLoader;\n\n\tprotected Resource(DataLoader<T> dataLoader) {\n\t\tthis(dataLoader, true);\n\t}\n\n\tprotected Resource(DataLoader<T> dataLoader, boolean deferred) {\n\t\tthis.dataLoader = dataLoader;\n\t\tif (!deferred)\n\t\t\treload();\n\t}\n\n\... | import java.awt.Color;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import com.gemserk.r... | package com.gemserk.resources.tests;
public class JFrameWithImageResourceLoaderProviderSample {
@SuppressWarnings("serial")
public static void main(String[] args) {
| final ResourceManager<String> resourceManager = new ResourceManagerImpl<String>(); | 2 |
xwang1024/SIF-Resource-Explorer | src/main/java/me/xwang1024/sifResExplorer/controller/UnitsBoxController.java | [
"public class Unit {\r\n\tprivate int id;\r\n\tprivate int unitNo;\r\n\tprivate String name;\r\n\tprivate String eponym;\r\n\tprivate Card[] card; // normal, idolize normal, idolize rankMax, idolize\r\n\t\t\t\t\t\t\t// bondMax, idolize doubleMax\r\n\tprivate String[] avatar; // normal, idolize\r\n\tprivate String[]... | import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import javax.imageio.ImageIO;
import javafx.beans.value.ChangeListener;
impo... | leaderSkillTypeBox.setValue(null);
updateTableData();
refreshSelectStat();
}
@FXML
public void onSelectAllAction(ActionEvent event) {
logger.debug("onSelectAllAction");
ObservableList<UnitLine> list = unitsTable.getItems();
for (UnitLine item : list) {
item.setSelected(true);
}
}
@... | new ProgressStage(ApplicationContext.stageStack.peek().getStage(), task);
| 3 |
HumBuch/HumBuch | src/test/java/de/dhbw/humbuch/view/StudentInformationViewTest.java | [
"public class GuiceJUnitRunner extends BlockJUnit4ClassRunner {\n\tprivate Injector injector;\n\n\t/**\n\t * Specifies the Guice {@link Module} classes which should be used when\n\t * injecting a JUnit test class\n\t */\n\t@Target(ElementType.TYPE)\n\t@Retention(RetentionPolicy.RUNTIME)\n\t@Inherited\n\tpublic @int... | import org.junit.runner.RunWith;
import com.google.inject.Inject;
import de.dhbw.humbuch.guice.GuiceJUnitRunner;
import de.dhbw.humbuch.guice.TestModule;
import de.dhbw.humbuch.guice.GuiceJUnitRunner.GuiceModules;
import de.dhbw.humbuch.model.DAO;
import de.dhbw.humbuch.model.entity.TestPersistenceInitialiser;
import d... | package de.dhbw.humbuch.view;
@RunWith(GuiceJUnitRunner.class)
@GuiceModules({ TestModule.class })
public class StudentInformationViewTest extends BaseTest {
@Inject
public void setInjected(MVVMConfig mvvmConfig,
TestPersistenceInitialiser testPersistenceInitialiser,
StudentInformationView view, Properties... | DAO<User> daoUser) { | 4 |
guillaume-alvarez/ShapeOfThingsThatWere | core/src/com/galvarez/ttw/screens/overworld/controls/OverworldSelectorController.java | [
"public final class GameMap {\n\n public final Terrain[][] map;\n\n private final Entity[][] entityByCoord;\n\n private final MapPosition[][] posByCoord;\n\n private final Influence[][] influenceByCoord;\n\n public final int width, height;\n\n /** Represents the whole map as a single image. */\n public final... | import com.artemis.World;
import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.InputAdapter;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.math.Vector3;
import com.galvarez.ttw.model.map.GameMap;
import com.galvarez.ttw.model.map.MapPosition;
import com.galvarez.ttw.model.map.MapTo... | package com.galvarez.ttw.screens.overworld.controls;
public final class OverworldSelectorController extends InputAdapter {
private final OrthographicCamera camera;
private final GameMap gameMap;
private final InputManager inputManager;
/**
* We need a copy of the screen implementing this controller (wh... | MapPosition coords = MapTools.window2world(mousePosition.x, mousePosition.y, camera); | 2 |
mediashelf/fedora-client | fedora-client-core/src/test/java/com/yourmediashelf/fedora/client/request/BatchIT.java | [
"public static AddDatastream addDatastream(String pid, String dsId) {\n return new AddDatastream(pid, dsId);\n}",
"public static GetDatastreamDissemination getDatastreamDissemination(\n String pid, String dsId) {\n return new GetDatastreamDissemination(pid, dsId);\n}",
"public static Ingest ingest(... | import static com.yourmediashelf.fedora.client.FedoraClient.addDatastream;
import static com.yourmediashelf.fedora.client.FedoraClient.getDatastreamDissemination;
import static com.yourmediashelf.fedora.client.FedoraClient.ingest;
import static com.yourmediashelf.fedora.client.FedoraClient.purgeObject;
import static or... | /**
* Copyright (C) 2010 MediaShelf <http://www.yourmediashelf.com/>
*
* This file is part of fedora-client.
*
* fedora-client is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of ... | response = getDatastreamDissemination(pid, dsid).execute(); | 1 |
badvision/jace | src/main/java/jace/hardware/CardMockingboard.java | [
"public abstract class Card extends Device {\r\n\r\n private final PagedMemory cxRom;\r\n private final PagedMemory c8Rom;\r\n private int slot;\r\n private RAMListener ioListener;\r\n private RAMListener firmwareListener;\r\n private RAMListener c8firmwareListener;\r\n\r\n /**\r\n * Create... | import jace.config.ConfigurableField;
import jace.config.Name;
import jace.core.Card;
import jace.core.Computer;
import jace.core.Motherboard;
import jace.core.RAMEvent;
import jace.core.RAMEvent.TYPE;
import jace.core.RAMListener;
import jace.core.SoundMixer;
import jace.hardware.mockingboard.PSG;
import jac... | /*
* Copyright (C) 2012 Brendan Robert (BLuRry) brendan.robert@gmail.com.
*
* 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 op... | protected void handleFirmwareAccess(int register, TYPE type, int value, RAMEvent e) {
| 4 |
skyem123/skyeZ80emu | src/main/java/uk/co/skyem/projects/emuZ80/Main.java | [
"public class Assembler {\n\n\tprivate static final HashMap<String, Supplier<Instruction>> instructions = new HashMap<>();\n\tprivate static final HashMap<String, Supplier<ASMDirective>> asmDirectives = new HashMap<>();\n\n\tstatic {\n\t\tregisterInstruction(\"LD\", LD::new);\n\t\tregisterInstruction(\"NOP\", NOP::... | import uk.co.skyem.projects.emuZ80.asm.Assembler;
import uk.co.skyem.projects.emuZ80.bus.Memory;
import uk.co.skyem.projects.emuZ80.bus.SimpleIO;
import uk.co.skyem.projects.emuZ80.cpu.Core;
import uk.co.skyem.projects.emuZ80.cpu.Flags;
import uk.co.skyem.projects.emuZ80.cpu.MemoryRouter;
import uk.co.skyem.projects.em... | package uk.co.skyem.projects.emuZ80;
public class Main {
public static String toHexString(byte data) {
return Integer.toHexString(Byte.toUnsignedInt(data));
}
public static String toHexString(short data) {
return Integer.toHexString(Short.toUnsignedInt(data));
}
public static String toHexString(int data)... | listFlag(Flags.ADD_SUB, "ADD/SUB", cpuCore.registers.flags.getData()); | 4 |
jaytaylor/jaws | src/edu/smu/tspell/wordnet/impl/file/synset/AdjectiveReferenceSynset.java | [
"public interface AdjectiveSynset extends Synset\n{\n\n\t/**\n\t * Predicate position.\n\t */\n\tpublic final static String PREDICATE_POSITION = \"p\";\n\n\t/**\n\t * Prenominal position.\n\t */\n\tpublic final static String PRENOMINAL_POSITION = \"a\";\n\n\t/**\n\t * Immediately postnominal position.\n\t */\n\tpub... | import edu.smu.tspell.wordnet.impl.file.ReferenceSynset;
import edu.smu.tspell.wordnet.impl.file.RelationshipPointers;
import edu.smu.tspell.wordnet.impl.file.RelationshipType;
import edu.smu.tspell.wordnet.impl.file.RetrievalException;
import edu.smu.tspell.wordnet.impl.file.SenseKey;
import edu.smu.tspell.wordnet.imp... | /*
Java API for WordNet Searching 1.0
Copyright (c) 2007 by Brett Spell.
This software is being provided to you, the LICENSEE, by under the following
license. By obtaining, using and/or copying this software, you agree that
you have read, understood, and will comply with these terms and conditions:
P... | public boolean isHeadSynset() throws WordNetException | 2 |
wesabe/grendel | src/test/java/com/wesabe/grendel/resources/tests/DocumentsResourceTest.java | [
"public class Credentials {\n\t/**\n\t * An authentication challenge {@link Response}. Use this when a client's\n\t * provided credentials are invalid.\n\t */\n\tpublic static final Response CHALLENGE =\n\t\tResponse.status(Status.UNAUTHORIZED)\n\t\t\t.header(HttpHeaders.WWW_AUTHENTICATE, \"Basic realm=\\\"Grendel\... | import static org.fest.assertions.Assertions.*;
import static org.mockito.Mockito.*;
import javax.ws.rs.core.UriInfo;
import org.junit.Before;
import org.junit.Test;
import org.junit.experimental.runners.Enclosed;
import org.junit.runner.RunWith;
import com.google.common.collect.ImmutableSet;
import com.wesabe.grendel.... | package com.wesabe.grendel.resources.tests;
@RunWith(Enclosed.class)
public class DocumentsResourceTest {
public static class Listing_A_Users_Documents {
protected Document document;
protected Credentials credentials;
protected User user;
protected Session session;
protected UserDAO userDAO;
protected... | final DocumentListRepresentation docs = resource.listDocuments(uriInfo, credentials, "bob"); | 5 |
XhinLiang/MDPreference | material/src/main/java/com/rey/material/dialog/SimpleDialog.java | [
"public class BlankDrawable extends Drawable {\n\n\tprivate static BlankDrawable mInstance;\n\t\n\tpublic static BlankDrawable getInstance(){\n\t\tif(mInstance == null)\n\t\t\tsynchronized (BlankDrawable.class) {\n\t\t\t\tif(mInstance == null)\n\t\t\t\t\tmInstance = new BlankDrawable();\n\t\t\t}\n\t\t\n\t\treturn m... | import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v4.view.ViewCompat;
import android.text.TextUtils;
import android.view.Gravity;
i... | mScrollView.addView(mMessage);
}
mMessage.setText(message);
if (!TextUtils.isEmpty(message)) {
mMode = MODE_MESSAGE;
super.contentView(mScrollView);
}
return this;
}
/**
* Set a message text to this SimpleDialog.
*
* @p... | mListView.setOverScrollMode(ListView.OVER_SCROLL_NEVER); | 2 |
sandflow/regxmllib | src/main/java/com/sandflow/smpte/regxml/XMLSchemaBuilder.java | [
"@XmlAccessorType(XmlAccessType.NONE)\npublic class CharacterTypeDefinition extends Definition {\n\npublic CharacterTypeDefinition() { }\n\n @Override\n public void accept(DefinitionVisitor visitor) throws DefinitionVisitor.VisitorException {\n visitor.visit(this);\n }\n\n}",
"@XmlAccessorType(Xml... | import com.sandflow.smpte.klv.exceptions.KLVException;
import com.sandflow.smpte.regxml.dict.DefinitionResolver;
import com.sandflow.smpte.regxml.dict.MetaDictionary;
import com.sandflow.smpte.regxml.dict.definitions.CharacterTypeDefinition;
import com.sandflow.smpte.regxml.dict.definitions.ClassDefinition;
import com.... | /*
* Copyright (c) 2014, Pierre-Anthony Lemieux (pal@sandflow.com)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notic... | } else if (definition instanceof RenameTypeDefinition) { | 4 |
gen2brain/bukanir | android/src/main/java/com/bukanir/android/fragments/MoviesListFragment.java | [
"public class Favorites {\n\n private Context context;\n private SharedPreferences preferences;\n\n public Favorites(Context context) {\n this.context = context.getApplicationContext();\n preferences = PreferenceManager.getDefaultSharedPreferences(this.context);\n }\n\n public ArrayList... | import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.AsyncTask;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.M... | package com.bukanir.android.fragments;
public class MoviesListFragment extends Fragment {
public static final String TAG = "MoviesListFragment";
private Movie movie;
private Summary summary;
ArrayList<Movie> movies;
boolean twoPane; | private Favorites favorites; | 0 |
alphagov/locate-api | locate-api-service/src/test/uk/gov/gds/locate/api/LocateApiServiceTest.java | [
"public class BearerTokenAuthProvider implements InjectableProvider<Auth, Parameter> {\n\n private final LocateApiConfiguration configuration;\n private final UsageDao usageDao;\n private final Authenticator<String, AuthorizationToken> authenticator;\n\n\n public BearerTokenAuthProvider(LocateApiConfigu... | import com.mongodb.MongoException;
import com.sun.jersey.api.core.ResourceConfig;
import com.yammer.dropwizard.config.Environment;
import com.yammer.dropwizard.config.FilterBuilder;
import com.yammer.dropwizard.json.ObjectMapperFactory;
import org.eclipse.jetty.servlets.CrossOriginFilter;
import org.junit.Before;
impor... | package uk.gov.gds.locate.api;
public class LocateApiServiceTest {
private LocateApiService locateApiService = new LocateApiService();
private Environment environment = mock(Environment.class);
private LocateApiConfiguration configuration = mock(LocateApiConfiguration.class);
private MongoConfigura... | verify(environment, times(1)).addResource(isA(PostcodeToAuthorityResource.class)); | 5 |
jhclark/bigfatlm | src/bigfat/step4/UninterpolatedIteration.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.filecache.DistributedCache;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapreduce.Job;
import org.apache.hadoop.mapreduce.lib.input.FileInput... | package bigfat.step4;
public class UninterpolatedIteration implements HadoopIteration {
@Option(shortName = "c", longName = "adjustedCountsIn", usage = "HDFS input path of adjusted counts")
@HdfsPathCheck(exists = true)
String adjustedCountsIn;
@Option(shortName = "d", longName = "discountFile", usage = "H... | HadoopUtils.runJob(job); | 4 |
mp911de/spinach | src/main/java/biz/paluch/spinach/impl/DisqueConnectionImpl.java | [
"public enum CommandType implements ProtocolKeyword {\n // Jobs\n ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,\n\n // Queues\n ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,\n\n // AOF\n BGREWRITEAOF,\n\n // Server commands\n AUTH, CONFIG, CLUSTER, CLIENT, COMMAN... | import com.lambdaworks.redis.codec.RedisCodec;
import com.lambdaworks.redis.protocol.CompleteableCommand;
import com.lambdaworks.redis.protocol.RedisCommand;
import io.netty.channel.ChannelHandler;
import static com.lambdaworks.redis.protocol.CommandType.AUTH;
import java.lang.reflect.Proxy;
import java.util.concurrent... | /*
* Copyright 2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | protected DisqueCommands<K, V> sync; | 4 |
SamuelGjk/DiyCode | app/src/main/java/moe/yukinoneko/diycode/module/notification/NotificationsListAdapter.java | [
"public class Notification {\n @SerializedName(\"id\") public int id; // 通知 id\n @SerializedName(\"type\") public String type; // 类型\n @SerializedName(\"read\") public Boolean read; // 是否已读\n @SerializedName(\"actor\") public User actor; ... | import android.support.annotation.NonNull;
import android.support.v7.widget.AppCompatImageButton;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.RecyclerView;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android... | /*
* Copyright (c) 2017 SamuelGjk <samuel.alva@outlook.com>
*
* This file is part of DiyCode
*
* DiyCode is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your o... | holder.textContent.setText(convertReplyContent(content, holder.textContent)); | 7 |
machisuji/Wandledi | core/src/main/java/org/wandledi/Element.java | [
"public interface InsertionIntent {\n\n void insert(Spell parent);\n}",
"public interface ReplacementIntent {\n\n void replace(String label, Attributes attributes, Spell parent);\n}",
"public interface StringTransformation {\n String transform(String input);\n}",
"public class TransformedAttribute {\... | import java.util.Collection;
import org.wandledi.spells.InsertionIntent;
import org.wandledi.spells.ReplacementIntent;
import org.wandledi.spells.StringTransformation;
import org.wandledi.spells.TransformedAttribute;
import org.wandledi.wandlet.Response; | package org.wandledi;
/**An HTML element.
*
* @author Markus Kahl
*/
public interface Element {
/**Creates a charged version of this element whose spells have the
* given number of charges by default.
*
* @param charges The number of charges which the spells on this element shall have.
* ... | public void changeAttributes(TransformedAttribute... attributes); | 3 |
CS-SI/Stavor | stavor/src/main/java/cs/si/stavor/app/Installer.java | [
"public class MainActivity extends ActionBarActivity implements\n\t\tNavigationDrawerFragment.NavigationDrawerCallbacks {\n\n\t/**\n\t * Fragment managing the behaviors, interactions and presentation of the\n\t * navigation drawer.\n\t */\n\tprivate NavigationDrawerFragment mNavigationDrawerFragment;\n\t\n\t/**\n\t... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import org.apache.commons.math3.util.FastMath;
import org.orekit.errors.OrekitException;
import org.orekit.time.AbsoluteDate;
import org.orekit.time.TimeScalesFactory;
import cs.si.... | package cs.si.stavor.app;
/**
* Provides initial app installation functions
* @author Xavier Gibert
*
*/
public class Installer {
/* Checks if external storage is available for read and write */
private static boolean isExternalStorageWritable() {
String state = Environment.getExternalStorageState();
... | values.put(MissionEntry.COLUMN_NAME_CLASS, SerializationUtil.serialize(mission)); | 2 |
chenyihan/Simple-SQLite-ORM-Android | src/org/cyy/fw/android/dborm/sqlite/SQLBuilder.java | [
"public final class ORMUtil {\n\tprivate ORMUtil() {\n\t\tsuper();\n\t}\n\n\t/**\n\t * \n\t * Look up relation target POJO class<BR>\n\t * \n\t * @param mainClass\n\t * relation source class\n\t * @param childFieldName\n\t * relation attribute name\n\t * @return the target class, null if faile... | import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.Vector;
import org.cyy.fw.android... | private QueryAidParameter aidParameter;
String combineSqlFragment() {
StringBuffer sql = new StringBuffer();
StringBuffer select = this.buildSelectSegment();
if (select.toString().endsWith(COMMA)) {
select.replace(select.length() - 1, select.length(), "");
}
if (from.toString().endsWith(COMMA)) ... | ORMapInfo mapInfo = getOrMapInfo(mainClass, tableMap); | 1 |
CorwinJV/MobTotems | src/main/java/com/corwinjv/mobtotems/blocks/ModBlocks.java | [
"public class Reference {\n public static final String MOD_ID = \"mobtotems\";\n public static final String MOD_NAME = \"Mob Totems\";\n public static final String MOD_VERSION = \"1.12.1-0.3.0\";\n public static final String RESOURCE_PREFIX = MOD_ID + \":\";\n\n public static final String GUI_FACTORY... | import com.corwinjv.mobtotems.Reference;
import com.corwinjv.mobtotems.blocks.items.TotemWoodItemBlock;
import com.corwinjv.mobtotems.blocks.tiles.IncenseKindlingBoxTileEntity;
import com.corwinjv.mobtotems.blocks.tiles.OfferingBoxTileEntity;
import com.corwinjv.mobtotems.blocks.tiles.SacredLightTileEntity;
import com.... | package com.corwinjv.mobtotems.blocks;
/**
* Created by CorwinJV on 9/1/14.
*/
@Mod.EventBusSubscriber(modid = Reference.MOD_ID)
public class ModBlocks {
public static final HashSet<ItemBlock> ITEM_BLOCKS = new HashSet<>();
public static final String TOTEM_WOOD_NAME = "totem_wood";
public static fina... | GameRegistry.registerTileEntity(SacredLightTileEntity.class, Reference.RESOURCE_PREFIX + SACRED_LIGHT_NAME); | 4 |
UweTrottmann/MovieTracker | SeriesGuideMovies/src/com/uwetrottmann/movies/util/MoviesUpdateTask.java | [
"public class ServiceManager {\n /** API key. */\n private String apiKeyValue;\n /** User email. */\n private String username;\n /** User password. */\n private String password_sha;\n /** Connection timeout (in milliseconds). */\n private Integer connectionTimeout;\n /** Read timeout (in ... | import com.jakewharton.trakt.entities.Movie;
import com.uwetrottmann.movies.R;
import com.uwetrottmann.movies.provider.MoviesContract;
import com.uwetrottmann.movies.provider.MoviesContract.Movies;
import java.util.ArrayList;
import java.util.List;
import android.content.ContentProviderOperation;
import android.content... | /*
* Copyright 2012 Uwe Trottmann
*
* 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 ... | ServiceManager serviceManager; | 0 |
stackify/stackify-api-java | src/main/java/com/stackify/api/common/log/direct/LogManager.java | [
"public class ApiClients {\n\n\t/**\n\t * Logger\n\t */\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(ApiClients.class);\n\n\t/**\n\t * Gets the client name from the properties file\n\t * @param fileName Properties file name\n\t * @param defaultClientName Default client name\n\t * @return The clie... | import com.stackify.api.common.ApiClients;
import com.stackify.api.common.ApiConfiguration;
import com.stackify.api.common.ApiConfigurations;
import com.stackify.api.common.log.LogAppender;
import com.stackify.api.common.mask.MaskerConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util... | /*
* Copyright 2014 Stackify
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writ... | private static LogAppender<LogEvent> LOG_APPENDER = null; | 3 |
lixiaocong/lxcCMS | src/main/java/com/lixiaocong/cms/service/impl/CommentServiceImpl.java | [
"@Entity(name = \"Article\")\npublic class Article extends AbstractEntity {\n @Column(nullable = false)\n private String title;\n\n @Lob\n @Column(nullable = false)\n private String content;\n\n @ManyToOne(optional = false)\n private User user;\n\n @Column(nullable = false)\n private Stri... | import com.lixiaocong.cms.entity.Article;
import com.lixiaocong.cms.entity.Comment;
import com.lixiaocong.cms.entity.User;
import com.lixiaocong.cms.repository.IArticleRepository;
import com.lixiaocong.cms.repository.ICommentRepository;
import com.lixiaocong.cms.repository.IUserRepository;
import com.lixiaocong.cms.ser... | /*
BSD 3-Clause License
Copyright (c) 2016, lixiaocong(lxccs@iCloud.com)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright not... | public class CommentServiceImpl implements ICommentService { | 6 |
maruohon/worldutils | src/main/java/fi/dy/masa/worldutils/command/SubCommandBlockStats.java | [
"@Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.MOD_VERSION, certificateFingerprint = Reference.FINGERPRINT,\n guiFactory = \"fi.dy.masa.worldutils.config.WorldUtilsGuiFactory\",\n updateJSON = \"https://raw.githubusercontent.com/maruohon/worldutils/master/update.json\",\n ac... | import java.io.File;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Nullable;
import com.google.common.collect.Maps;
import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.min... | package fi.dy.masa.worldutils.command;
public class SubCommandBlockStats extends SubCommand
{
private final Map<UUID, BlockStats> blockStats = Maps.newHashMap();
private final BlockStats blockStatsConsole = new BlockStats();
public SubCommandBlockStats(CommandWorldUtils baseCommand)
{
super(b... | if (TaskScheduler.getInstance().hasTasks()) | 5 |
Vedenin/RestAndSpringMVC-CodingChallenge | src/test/java/com.github.vedenin.codingchallenge/OpenExchangeRestClientTest.java | [
"public enum CurrencyEnum {\n EUR(\"EUR\", \"Euro (EUR)\"),\n USD(\"USD\", \"US Dollar (USD)\"),\n GBP(\"GBP\", \"British Pound (GBP)\"),\n NZD(\"NZD\", \"New Zealand Dollar (NZD)\"),\n AUD(\"AUD\", \"Australian Dollar (AUD)\"),\n JPY(\"JPY\", \"Japanese Yen (JPY)\"),\n HUF(\"HUF\", \"Hungarian... | import com.github.vedenin.codingchallenge.common.CurrencyEnum;
import com.github.vedenin.codingchallenge.exceptions.RestClientException;
import com.github.vedenin.codingchallenge.restclient.RestClient;
import com.github.vedenin.codingchallenge.restclient.impl.currencylayer.CurrencyLayerRestClient;
import com.github.ved... | package com.github.vedenin.codingchallenge;
/**
* Created by vvedenin on 2/10/2017.
*/
public class OpenExchangeRestClientTest {
@Test
public void ExternalTest() {
RestClient restClient = new OpenExchangeRestClient();
BigDecimal convertRates = restClient.getCurrentExchangeRates(CurrencyEnum... | } catch (RestClientException exception) { | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.