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 |
|---|---|---|---|---|---|---|
suewonjp/civilizer | src/main/java/com/civilizer/dao/hibernate/FragmentDaoImpl.java | [
"public interface FragmentDao {\n \n public List<?> executeQueryForResult(String query);\n\n public void executeQuery(String query, boolean sql);\n \n\tpublic long countAll(boolean includeTrashed);\n\t\n\tpublic long countByTagId(long tagId, boolean includeTrashed);\n\n\tpublic long countByTagIds(Collec... | import java.util.*;
import javax.annotation.Resource;
import org.hibernate.Criteria;
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transact... | package com.civilizer.dao.hibernate;
@Repository("fragmentDao")
@Transactional
public final class FragmentDaoImpl implements FragmentDao {
private SessionFactory sessionFactory;
@Resource(name = "sessionFactory")
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFacto... | public long countByTagAndItsDescendants(long tagId, boolean includeTrashed, TagDao tagDao) { | 1 |
TinkerPatch/tinkerpatch-sdk | tinkerpatch-sdk/src/main/java/com/tencent/tinker/server/TinkerServerClient.java | [
"public interface ConfigRequestCallback {\n void onSuccess(String jsonConfig);\n void onFail(Exception e);\n}",
"public class DefaultPatchRequestCallback implements PatchRequestCallback {\n private static final String TAG = \"Tinker.RequestCallback\";\n\n public static final String TINKER_DOWNLOAD_FAI... | import com.tencent.tinker.loader.TinkerRuntimeException;
import com.tencent.tinker.loader.shareutil.ShareTinkerInternals;
import com.tencent.tinker.server.client.ConfigRequestCallback;
import com.tencent.tinker.server.client.DefaultPatchRequestCallback;
import com.tencent.tinker.server.client.PatchRequestCallback;
impo... | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Shengjie Sim Sun
*
* 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 ... | final TinkerClientAPI clientAPI; | 3 |
lisicnu/Log4Android | src/main/java/com/github/lisicnu/log4android/config/Configurator.java | [
"public enum Level {\n\tFATAL(Level.FATAL_INT),\n\tERROR(Level.ERROR_INT),\n\tWARN(Level.WARN_INT),\n\tINFO(Level.INFO_INT),\n\tDEBUG(Level.DEBUG_INT),\n\tTRACE(Level.TRACE_INT),\n\tOFF(Level.OFF_INT);\n\t\n\tpublic static final int FATAL_INT = 16;\n\tpublic static final int ERROR_INT = 8;\n\tpublic static final in... | import android.content.Context;
import android.content.res.AssetManager;
import android.content.res.Resources;
import android.content.res.Resources.NotFoundException;
import android.util.Log;
import com.github.lisicnu.log4android.Level;
import com.github.lisicnu.log4android.Logger;
import com.github.lisicnu.log4android... | /**
*
*/
package com.github.lisicnu.log4android.config;
/**
* The {@link Configurator} is used for configuration via a properties file. The
* properties file should be put in one of the following directories: <br/>
* <br/>
* <font color='red'>Note: <br/>
* call this method before your application's first log... | Level level = stringToLevel(levelString); | 0 |
xqbase/metric | collector-sql/src/main/java/com/xqbase/metric/Collector.java | [
"public class ManagementMonitor implements Runnable, AutoCloseable {\r\n\tprivate static double MB(long value) {\r\n\t\treturn (double) value / 1048576;\r\n\t}\r\n\r\n\tprivate static double PERCENT(long dividend, long divisor) {\r\n\t\treturn divisor == 0 ? 0 : (double) dividend * 100 / divisor;\r\n\t}\r\n\r\n\tpr... | import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetSocketAddress;
import java.sql.Driver;
import java.sql.SQLException;
import jav... | }
return true;
}
private static List<MetricName> getNames() throws SQLException {
List<MetricName> names = new ArrayList<>();
DB.query(row -> {
MetricName name = new MetricName();
name.id = row.getInt("id");
name.name = row.getString("name");
name.minuteSize = row.getInt("minute_size");... | for (MetricEntry entry : Metric.removeAll()) {
| 2 |
maksim-m/Popular-Movies-App | app/src/main/java/me/maxdev/popularmoviesapp/ui/MainActivity.java | [
"public class PopularMoviesApp extends Application {\n\n private NetworkComponent networkComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n networkComponent = DaggerNetworkComponent.builder()\n .appModule(new AppModule(this))\n .networkModu... | import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.CoordinatorLayout;
import ... | package me.maxdev.popularmoviesapp.ui;
public class MainActivity extends AppCompatActivity implements OnItemSelectedListener,
NavigationView.OnNavigationItemSelectedListener {
private static final String SELECTED_MOVIE_KEY = "MovieSelected";
private static final String SELECTED_NAVIGATION_ITEM_KEY... | FavoritesService favoritesService; | 1 |
nerdammer/spash | core/src/main/java/it/nerdammer/spash/shell/command/spi/CatCommand.java | [
"public interface FileSystemFacade {\n\n /**\n * Returns the defaul filesystem.\n *\n * @return the filesystem\n */\n FileSystem getFileSystem();\n\n /**\n * Returns a collection of paths contained in the given path.\n *\n * @param path the base path\n * @return the sub path... | import it.nerdammer.spash.shell.api.fs.FileSystemFacade;
import it.nerdammer.spash.shell.api.fs.SpashFileSystem;
import it.nerdammer.spash.shell.api.spark.SpashSparkSubsystem;
import it.nerdammer.spash.shell.command.AbstractCommand;
import it.nerdammer.spash.shell.command.CommandResult;
import it.nerdammer.spash.shell.... | package it.nerdammer.spash.shell.command.spi;
/**
* Command to get the content of a file or directory.
*
* @author Nicola Ferraro
*/
public class CatCommand extends AbstractCommand {
public CatCommand(String commandString) {
super(commandString);
}
@Override
public CommandResult execute... | SpashCollection<String> content = new SpashCollectionEmptyAdapter<>(); | 8 |
kefirfromperm/kefirbb | test/org/kefirsf/bb/test/blackbox/BBProcessorTest.java | [
"public class BBProcessorFactory implements TextProcessorFactory {\n /**\n * Instance of this class. See the Singleton pattern\n */\n private static final BBProcessorFactory instance = new BBProcessorFactory();\n private final ConfigurationFactory configurationFactory = ConfigurationFactory.getInst... | import org.junit.Test;
import org.kefirsf.bb.BBProcessorFactory;
import org.kefirsf.bb.ConfigurationFactory;
import org.kefirsf.bb.TextProcessor;
import org.kefirsf.bb.conf.Configuration;
import java.util.HashMap;
import java.util.Map;
import static org.kefirsf.bb.test.Assert.assertProcess; | package org.kefirsf.bb.test.blackbox;
/**
* Класс для тестирования обработчика BB-кодов
*
* @author Vitaliy Samolovskih aka Kefir
*/
public class BBProcessorTest {
private final BBProcessorFactory factory = BBProcessorFactory.getInstance();
@Test
public void testPrefix() {
TextProcessor pro... | Configuration configuration = ConfigurationFactory.getInstance().create(); | 3 |
SalmanTKhan/MyAnimeViewer | app/src/main/java/com/taskdesignsinc/android/myanimeviewer/fragment/HistoryMaterialFragment.java | [
"public class MAVApplication extends MultiDexApplication {\n\n static {\n AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);\n }\n\n private static MAVApplication application = null;\n\n private RefWatcher refWatcher;\n private BoxStore boxStore;\n private DataRepository mDataRepo... | import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.AsyncTaskLoader;
import android.support.v4... | package com.taskdesignsinc.android.myanimeviewer.fragment;
public class HistoryMaterialFragment extends Fragment
implements OnQueryTextListener, OnCloseListener,
LoaderManager.LoaderCallbacks<List<HistoryRecord>> {
private static final String TAG = HistoryMaterialFragment.class.getSimpleName(); | HistoryRecyclerAdapter mAdapter; | 1 |
philliphsu/ClockPlus | app/src/main/java/com/philliphsu/clock2/alarms/ui/AlarmsFragment.java | [
"@AutoValue\npublic abstract class Alarm extends ObjectWithId implements Parcelable {\n private static final int MAX_MINUTES_CAN_SNOOZE = 30;\n\n // =================== MUTABLE =======================\n private long snoozingUntilMillis;\n private boolean enabled;\n private final boolean[] recurringDa... | import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.Loader;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.philliphsu.bottomsheetpickers.ti... | /*
* Copyright 2017 Phillip Hsu
*
* This file is part of ClockPlus.
*
* ClockPlus 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 versio... | return makeTag(AlarmsFragment.class, R.id.fab); | 8 |
DorsetProject/dorset-framework | agents/web-api/src/main/java/edu/jhuapl/dorset/agents/FlickrAgent.java | [
"public class Response {\n private final Type type;\n private final String text;\n private final String payload;\n private final ResponseStatus status;\n\n /**\n * Create a response\n *\n * @param text the text of the response\n */\n public Response(String text) {\n this.ty... | import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.bind.DatatypeConverter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson... | /*
* Copyright 2016 The Johns Hopkins University Applied Physics Laboratory 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/li... | HttpRequest httpRequest = HttpRequest.get(url); | 7 |
FedericoPecora/coordination_oru | src/main/java/se/oru/coordination/coordination_oru/tests/TestTrajectoryEnvelopeCoordinatorWithMotionPlanner.java | [
"public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m... | import java.io.File;
import java.util.Comparator;
import org.metacsp.multi.spatioTemporal.paths.Pose;
import org.metacsp.multi.spatioTemporal.paths.PoseSteering;
import org.metacsp.multi.spatioTemporal.paths.TrajectoryEnvelope;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
... | package se.oru.coordination.coordination_oru.tests;
@DemoDescription(desc = "Coordination on paths obtained from the ReedsSheppCarPlanner for two robots navigating in opposing directions.")
public class TestTrajectoryEnvelopeCoordinatorWithMotionPlanner {
public static void main(String[] args) throws Interrupted... | tec.addComparator(new Comparator<RobotAtCriticalSection> () { | 3 |
gaffo/scumd | src/exttest/java/com/asolutions/scmsshd/test/integration/PushTest.java | [
"public class SCuMD extends SshServer {\n\n\t/**\n\t * @param args\n\t */\n\tpublic static void main(String[] args) {\n\t\tif (args.length != 1) {\n\t\t\tSystem.err.println(\"Usage: SCuMD pathToConfigFile\");\n\t\t\treturn;\n\t\t}\n\t\tnew FileSystemXmlApplicationContext(args[0]);\n\t}\n\n\tpublic SCuMD() {\n\t\tif... | import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import org.apache.commons.io.FileUtils;
import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.spearce.jgi... | package com.asolutions.scmsshd.test.integration;
public class PushTest extends IntegrationTestCase {
private static final String ORIGIN = "origin";
private static final String REFSPEC = "master";
private File toRepoDir;
private File fromRepoDir;
private Repository fromRepository;
private Ref fromRefMaster... | sshd.setPublickeyAuthenticator(new AlwaysPassPublicKeyAuthenticator()); | 1 |
BottleRocketStudios/Android-Vault | SampleApplication/app/src/main/java/com/bottlerocketstudios/vaultsampleapplication/vault/VaultLocator.java | [
"public interface SharedPreferenceVault extends SharedPreferences {\n /**\n * Remove all stored values and destroy cryptographic keys associated with the vault instance.\n * <strong>This will permanently destroy all data in the preference file.</strong>\n */\n void clearStorage();\n\n /**\n ... | import android.content.Context;
import android.util.Log;
import com.bottlerocketstudios.vault.SharedPreferenceVault;
import com.bottlerocketstudios.vault.SharedPreferenceVaultFactory;
import com.bottlerocketstudios.vault.SharedPreferenceVaultRegistry;
import com.bottlerocketstudios.vault.keys.generator.Aes256KeyFromPas... | package com.bottlerocketstudios.vaultsampleapplication.vault;
/**
* Example initialization and place to keep reference to your vaults. This example instantiates all three
* supported types, while most applications will only need one.
*/
public class VaultLocator {
private static final String TAG = VaultLocat... | if (SharedPreferenceVaultFactory.canUseKeychainAuthentication(context) && SharedPreferenceVaultRegistry.getInstance().getVault(KEYCHAIN_AUTHENTICATED_KEY_INDEX) == null) { | 1 |
KostyaSha/github-integration-plugin | github-pullrequest-plugin/src/main/java/org/jenkinsci/plugins/github/pullrequest/trigger/check/PullRequestToCauseConverter.java | [
"public class GitHubPRDecisionContext extends GitHubDecisionContext<GitHubPREvent, GitHubPRCause> {\n private final GHPullRequest remotePR;\n private final GitHubPRPullRequest localPR;\n private final GitHubPRUserRestriction prUserRestriction;\n private final GitHubPRRepository localRepo;\n\n protect... | import com.github.kostyasha.github.integration.generic.GitHubPRDecisionContext;
import com.github.kostyasha.github.integration.multibranch.GitHubSCMSource;
import com.github.kostyasha.github.integration.multibranch.handler.GitHubPRHandler;
import com.google.common.base.Function;
import hudson.model.TaskListener;
import... | package org.jenkinsci.plugins.github.pullrequest.trigger.check;
/**
* @author lanwen (Merkushev Kirill)
*/
public class PullRequestToCauseConverter implements Function<GHPullRequest, GitHubPRCause> {
private static final Logger LOGGER = LoggerFactory.getLogger(PullRequestToCauseConverter.class);
private ... | private final GitHubPRTrigger trigger; | 6 |
lukaspili/Volley-Ball | samples/src/main/java/com/siu/android/volleyball/samples/volley/request/ScenarioRequest.java | [
"public class BallResponse<T> {\n\n public static enum ResponseSource {\n LOCAL, CACHE, NETWORK\n }\n\n protected Response<T> mResponse;\n protected ResponseSource mResponseSource;\n protected boolean mIdentical = false;\n\n /**\n * Returns whether this response is considered successful... | import com.android.volley.NetworkResponse;
import com.android.volley.Response;
import com.siu.android.volleyball.BallResponse;
import com.siu.android.volleyball.request.CompleteRequest;
import com.siu.android.volleyball.response.ResponseListener;
import com.siu.android.volleyball.samples.util.ScenarioUtils;
import com.... | package com.siu.android.volleyball.samples.volley.request;
/**
* Created by lukas on 9/3/13.
*/
public class ScenarioRequest extends CompleteRequest<String> {
public static final int METHOD = Method.GET;
public static final String URL = "http://foo.com/bar";
protected int mLocalWait;
protected int... | public ScenarioRequest(ResponseListener<String> responseListener, Response.ErrorListener errorListener, int localWait, int cacheAndNetworkWait) { | 2 |
WSDOT/social-analytics | src/main/java/gov/wa/wsdot/apps/analytics/client/activities/twitter/view/ranking/RankingView.java | [
"public interface ClientFactory {\n EventBus getEventBus();\n PlaceController getPlaceController();\n AnalyticsView getAnalyticsView();\n}",
"public class DateSubmitEvent extends GenericEvent {\n\n\n private final String dateRange;\n private final String account;\n private final Date startDate;\... | import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.dom.client.Style;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.jsonp.client.JsonpRequ... | /*
* Copyright (c) 2016 Washington State Department of Transportation
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later ver... | String url = Consts.HOST_URL + "/summary/statuses/retweets/" + listType + "/" + screenName + startDate + endDate; | 4 |
Tyde/TuCanMobile | app/src/main/java/com/dalthed/tucan/scraper/MessagesScraper.java | [
"@ReportsCrashes(formKey = \"\", // will not be used\n\thttpMethod = Method.PUT,\n\treportType = Type.JSON,\n\tformUri = \"http://dttyde.de:5984/acra-tucan/_design/acra-storage/_update/report\",\n\tformUriBasicAuthLogin = \"tucanApp\",\n formUriBasicAuthPassword = \"thordielrbl\")\n//@ReportsCrashes(formUri = \"... | import com.dalthed.tucan.Connection.CookieManager;
import com.dalthed.tucan.Connection.RequestObject;
import com.dalthed.tucan.Connection.SimpleSecureBrowser;
import com.dalthed.tucan.adapters.ThreeLinesAdapter;
import com.dalthed.tucan.exceptions.LostSessionException;
import com.dalthed.tucan.exceptions.TucanDownExcep... | /**
* This file is part of TuCan Mobile.
*
* TuCan Mobile 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.
*
* TuCan Mobile is d... | public MessagesScraper(Context context, AnswerObject result) { | 1 |
TonnyL/Espresso | app/src/main/java/io/github/marktony/espresso/service/ReminderService.java | [
"public class AppWidgetProvider extends android.appwidget.AppWidgetProvider {\n\n private static final String REFRESH_ACTION = \"io.github.marktony.espresso.appwidget.action.REFRESH\";\n\n public static Intent getRefreshBroadcastIntent(Context context) {\n return new Intent(REFRESH_ACTION)\n ... | import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.media.RingtoneManager;
import android.os.IBinder;
import an... | /*
* Copyright(c) 2017 lizhaotailang
*
* 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... | List<Package> results = rlm.copyFromRealm( | 1 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/ui/ListArticleActivity.java | [
"public abstract class BenihActivity extends RxAppCompatActivity\n{\n @Override\n protected void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(getActivityView());\n ButterKnife.bind(this);\n Timber.tag(getClass().getSimpleName());... | import id.zelory.codepolitan.ui.fragment.SearchArticlesFragment;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import butterknife.Bind;
import id.zelory.benih.BenihActivity;
import id.zelory.codepolitan.R;... | /*
* 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... | .replace(R.id.list_container, ArticlesByCategoryFragment.getInstance(getIntent().getParcelableExtra(KEY_DATA))) | 1 |
Lambda-3/DiscourseSimplification | src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/rules/NonRestrictiveRelativeClauseWhereExtractor.java | [
"public enum Relation {\n\n UNKNOWN,\n\n // Coordinations\n UNKNOWN_COORDINATION, // the default for coordination\n CONTRAST,\n CAUSE_C,\n RESULT_C,\n LIST,\n DISJUNCTION,\n TEMPORAL_AFTER_C,\n TEMPORAL_BEFORE_C,\n\n // Subordinations\n UNKNOWN_SUBORDINATION, // the default for s... | import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeExtractionUtils;
import org.lambda3.text.simplification.discourse.utils.words.WordsUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import edu.stanford.nlp.ling.Word;
import edu.stanfor... | /*
* ==========================License-Start=============================
* DiscourseSimplification : SubordinationPostExtractor
*
* Copyright © 2017 Lambda³
*
* GNU General Public License 3
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public Lic... | Relation relation = Relation.SPATIAL; | 0 |
FedericoPecora/coordination_oru | src/main/java/se/oru/coordination/coordination_oru/tests/safetyAndLiveness/nRobotsDeadlock.java | [
"public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m... | import java.io.File;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.util.Calendar;
import java.util.Comparator;
import java.util.HashMap;
import org.metacsp.multi.spatioTemporal.paths.Pose;
import com.vividsolutions.jts.geom.Coordinate;
import se.oru.coordination.coordination_oru.ConstantAccel... | package se.oru.coordination.coordination_oru.tests.safetyAndLiveness;
@DemoDescription(desc = "Coordination with deadlock-inducing ordering heuristic (paths obtained with the ReedsSheppCarPlanner).")
public class nRobotsDeadlock {
private static void initStat(String fileName, String stat) {
try {
... | ReedsSheppCarPlanner rsp = new ReedsSheppCarPlanner(); | 3 |
situx/SemanticDictionary | src/main/java/com/github/situx/cunei/dict/importhandler/cuneiform/ImportHandler.java | [
"public class POSTag implements Comparable<POSTag>{\n\n public String getConceptURI() {\n return conceptURI;\n }\n\n public void setConceptURI(String conceptURI) {\n this.conceptURI = conceptURI;\n }\n\n private POSTags postag=POSTags.NOUN;\n private String postagstr=\"\";\n priva... | import com.github.situx.cunei.akkad.dict.chars.cuneiform.*;
import com.github.situx.cunei.akkad.dict.utils.POSTag;
import com.github.situx.cunei.akkad.dict.utils.Transliteration;
import com.github.situx.cunei.akkad.util.enums.methods.CharTypes;
import com.github.situx.cunei.akkad.util.enums.util.Options;
import com.git... | package com.github.situx.cunei.akkad.dict.importhandler.cuneiform;
/**
* Created with IntelliJ IDEA.
* User: Timo Homburg
* Date: 06.11.13
* Time: 17:59
* ImportHandler for the cunei dictionaries and map format.
*/
public class ImportHandler extends DefaultHandler2 {
private final Map<String, CuneiChar> re... | case Tags.TRANSLITERATION: this.transliteration=false; | 3 |
profesorfalken/jSensors | src/test/java/com/profesorfalken/jsensors/unit/JSensorsTest.java | [
"public enum JSensors {\r\n\r\n\tget;\r\n\r\n\tprivate static final Logger LOGGER = LoggerFactory.getLogger(JSensors.class);\r\n\r\n\tfinal Map<String, String> baseConfig;\r\n\r\n\tprivate Map<String, String> usedConfig = null;\r\n\r\n\tstatic {\r\n\t\tcheckRights();\r\n\t}\r\n\r\n\tprivate static void checkRights(... | import com.profesorfalken.jsensors.JSensors;
import com.profesorfalken.jsensors.model.components.Cpu;
import com.profesorfalken.jsensors.model.components.Disk;
import com.profesorfalken.jsensors.model.components.Gpu;
import com.profesorfalken.jsensors.model.sensors.Fan;
import com.profesorfalken.jsensors.model.sen... | /*
* Copyright 2016-2018 Javier Garcia Alonso.
*
* 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 applicab... | List<Gpu> gpus = getJSensorsStub(testset).components().gpus;
| 3 |
jurihock/voicesmith | voicesmith/src/de/jurihock/voicesmith/dsp/processors/VadProcessor.java | [
"public final class Preferences\n{\n\t// TODO: Try different audio sources\n\t// public static final int PCM_IN_SOURCE = MediaRecorder.AudioSource.MIC;\n\t// public static final int PCM_IN_SOURCE =\n\t// MediaRecorder.AudioSource.VOICE_CALL;\n\t// public static final int PCM_IN_SOURCE =\n\t// MediaRecorder.AudioSou... | import android.content.Context;
import de.jurihock.voicesmith.Preferences;
import de.jurihock.voicesmith.Utils;
import de.jurihock.voicesmith.dsp.LuenbergerObserver;
import de.jurihock.voicesmith.dsp.SchmittTrigger;
import static de.jurihock.voicesmith.dsp.Math.ceil;
import static de.jurihock.voicesmith.dsp.Math.rms;
i... | /*
* Voicesmith <http://voicesmith.jurihock.de/>
*
* Copyright (c) 2011-2014 Juergen Hock
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your... | private final LuenbergerObserver energyObserver; | 2 |
lazyparser/xbot_head | app/src/main/java/cn/ac/iscas/xlab/droidfacedog/mvp/interaction/InteractionFragment.java | [
"public class RosConnectionService extends Service{\n\n public static final String TAG = \"RosConnectionService\";\n public static final String SUBSCRIBE_ROBOT_STATUS = \"/robot_status\";\n public static final String SUBSCRIBE_MUSEUM_POSITION = \"/museum_pos\";\n \n //解说词播放状态\n public static final... | import android.Manifest;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.ImageFormat;
import android.graphics.PointF;
import android.graphics.RectF;
import android.graphics.SurfaceTexture;
import android.hardware.camera2.CameraAcce... |
//原先的bitmap格式是ARGB_8888,以下的步骤是把格式转换为RGB_565
ByteArrayOutputStream bout = new ByteArrayOutputStream();
face.compress(Bitmap.CompressFormat.JPEG, 100, bout);
BitmapFactory.Options options = new BitmapFactory.Options();
op... | previewSize = Util.getPreferredPreviewSize(configMap.getOutputSizes(ImageFormat.JPEG), width, height); | 4 |
GoogleCloudPlatform/gcs-uploader | app-desktop/src/main/java/com/google/ce/media/contentuploader/ui/FileTaskTableModel.java | [
"@Component\npublic class AuthConfig {\n public static final long REFRESH_THRESHOLD_SECS = 60*10L; //10 minutes\n public static final Object REFRESH_LOCK = new Object();\n private final EnvConfig envConfig;\n\n private AuthInfo authInfo;\n private GoogleCredentials credentials;\n private Storage storage;\n\n ... | import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import com.google.ce.media.contentuploader.config.AuthConfig;
import com.google.ce.media.contentuploader.exec.MonitorTask;
import com.google.ce.media.contentuploader.exec.UploadTaskPool;
import c... | /*
* Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to ... | private final UploadTaskPool uploadTaskPool; | 2 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/KeenClient.java | [
"public class InvalidEventException extends KeenException {\n private static final long serialVersionUID = -8714276749665293346L;\n\n public InvalidEventException() {\n super();\n }\n\n public InvalidEventException(Throwable cause) {\n super(cause);\n }\n\n public InvalidEventExcepti... | import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.io.StringWriter;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.... | eventStore.remove(handle);
// iff eventStore.remove succeeds we can do some housekeeping and remove the
// key from the attempts hash.
attempts.remove(attemptsKey);
}
... | Request request = new Request(url, HttpMethods.POST, writeKey, source, proxy, connectTimeout, readTimeout); | 3 |
YugengWang/OneWeather | app/src/main/java/com/yoga/oneweather/model/db/DBManager.java | [
"public class MyApplication extends Application {\n\n private static Context context;\n private static Gson mGson = new Gson();\n\n\n\n @Override\n public void onCreate() {\n super.onCreate();\n context = getApplicationContext();\n LitePal.initialize(context);\n DBManager.get... | import android.os.Environment;
import android.widget.Toast;
import com.yoga.oneweather.MyApplication;
import com.yoga.oneweather.model.entity.city.County;
import com.yoga.oneweather.model.entity.weather.Weather;
import com.yoga.oneweather.ui.WeatherActivity;
import com.yoga.oneweather.util.FileUtil;
import com.yoga.one... | package com.yoga.oneweather.model.db;
/**
* Created by wyg on 2017/7/21.
*/
public class DBManager {
private static DBManager dbManager;
private String CITY_INITED = "CITY_INITED";
private String DB_PATH = File.separator + "data"
+ Environment.getDataDirectory().getAbsolutePath() + File.... | String allcities = FileUtil.assertFile2String("ChinaCityList.json", MyApplication.getContext()); | 4 |
MindscapeHQ/raygun4android | provider/src/main/java/com/raygun/raygun4android/CrashReporting.java | [
"public class RaygunLogger {\n\n public static void d(String string) {\n if (string != null) {\n Timber.tag(RaygunSettings.LOGGING_TAG).d(string);\n }\n }\n\n public static void i(String string) {\n if (string != null) {\n Timber.tag(RaygunSettings.LOGGING_TAG).i(... | import android.content.ComponentName;
import android.content.Intent;
import android.os.Build;
import com.google.gson.Gson;
import com.raygun.raygun4android.logging.RaygunLogger;
import com.raygun.raygun4android.messages.crashreporting.RaygunBreadcrumbMessage;
import com.raygun.raygun4android.messages.crashreporting.Ray... |
}
return breadcrumb;
}
private static boolean shouldProcessBreadcrumbLocation() {
return CrashReporting.shouldProcessBreadcrumbLocation;
}
static void shouldProcessBreadcrumbLocation(boolean shouldProcessBreadcrumbLocation) {
CrashReporting.shouldProcessBreadcrumbLoca... | Intent intent = new Intent(RaygunClient.getApplicationContext(), CrashReportingPostService.class); | 4 |
uustory/u8updateserver | src/com/u8/server/web/DownloadAction.java | [
"public class StateCode {\r\n\r\n public static final int CODE_SUCCESS = 1;\r\n public static final int CODE_GAME_NONE = 2;\r\n public static final int CODE_CHANNEL_NONE = 3;\r\n public static final int CODE_MASTER_NONE = 4;\r\n public static final int CODE_AUTH_FAILED = 5;\r\n public static final... | import com.u8.server.common.UActionSupport;
import com.u8.server.constants.StateCode;
import com.u8.server.data.UUpdateLog;
import com.u8.server.data.UUser;
import com.u8.server.log.Log;
import com.u8.server.service.UUpdateLogManager;
import com.u8.server.service.UUserManager;
import com.u8.server.utils.EncryptU... | package com.u8.server.web;
/***
* 用户登录
*/
@Controller
@Namespace("/user")
public class DownloadAction extends UActionSupport{
private final String UPDATE_FOLDER = "updates/";
private Integer userID;
private String sdk;
private String sdkType;
private String sdkVersion;
... | UUser user = userManager.getUser(this.userID);
| 2 |
integeruser/jgltut | src/integeruser/jgltut/tut17/DoubleProjection.java | [
"public enum MouseButtons {\n MB_LEFT_BTN,\n MB_RIGHT_BTN,\n MB_MIDDLE_BTN\n}",
"public static class ViewData {\n public Vector3f targetPos;\n public Quaternionf orient;\n public float radius;\n public float degSpinRotation;\n\n public ViewData(Vector3f targetPos, Quaternionf orient, float... | import integeruser.jglsdk.glutil.MousePoles.MouseButtons;
import integeruser.jglsdk.glutil.MousePoles.ViewData;
import integeruser.jglsdk.glutil.MousePoles.ViewPole;
import integeruser.jglsdk.glutil.MousePoles.ViewScale;
import integeruser.jgltut.Tutorial;
import integeruser.jgltut.commons.LightBlock;
import integeruse... | sphereMesh.render("flat");
glDepthMask(true);
glEnable(GL_DEPTH_TEST);
glUniform4f(unlitObjectColorUnif, 1.0f, 1.0f, 1.0f, 1.0f);
sphereMesh.render("flat");
modelMatrix.popMatrix();
}
{
final float zNear = 1.0f;
... | private ViewScale initialViewScale = new ViewScale( | 3 |
wieden-kennedy/composite-framework | src/main/java/com/wk/lodge/composite/web/CompositeController.java | [
"public class Session {\n @Id\n @GeneratedValue\n @Column(name=\"_id\")\n private String _id;\n\n @GeneratedValue\n @Column(name=\"_rev\")\n private String _rev;\n private boolean _deleted;\n\n private String applicationId;\n private ArrayList<Device> devices;\n private float[] geoL... | import com.google.gson.Gson;
import com.wk.lodge.composite.model.Session;
import com.wk.lodge.composite.registry.DeviceRegistry;
import com.wk.lodge.composite.service.SessionService;
import com.wk.lodge.composite.web.socket.message.inbound.JoinMessage;
import com.wk.lodge.composite.web.socket.message.inbound.PairMessag... |
package com.wk.lodge.composite.web;
@Controller
public class CompositeController {
private static final Log logger = LogFactory.getLog(CompositeController.class);
private SimpMessagingTemplate template;
private final SessionService sessionService;
private final DeviceRegistry deviceRegistry;
pr... | public String sync(SyncMessage s) { | 5 |
ikantech/IkantechSupport | src/com/ikantech/support/widget/YiFragment.java | [
"public class YiDialogProxy\n{\n\tprivate static final int MSG_SHOW_MSG_DIALOG = 0x01;\n\tprivate static final int MSG_SHOW_MSG_DIALOG_IN_SIZE = 0x02;\n\tprivate static final int MSG_SHOW_PROGRESS_DIALOG = 0x03;\n\tprivate static final int MSG_CANCEL_MSG_DIALOG = 0x04;\n\tprivate static final int MSG_CANCEL_PROGRES... | import android.content.ServiceConnection;
import android.content.DialogInterface.OnCancelListener;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.app.Fragment;
import android.view.View;
import com.ikantech.support.R;
import com.ikantech.support.proxy.YiActivityProxy;
import com.ikantech.... | package com.ikantech.support.widget;
public abstract class YiFragment extends Fragment implements
YiHandlerProxiable, YiToastProxiable, YiDialogProxiable,
YiDialogExtProxiable, YiLocalServiceServiceBinderProxiable
{
private YiHandlerProxy mHandlerProxy;
protected YiActivityProxy mActivityProxy;
@Override
pu... | public YiLocalServiceBinder getLocalService() | 4 |
stoussaint/spring-data-marklogic | src/test/java/com/_4dconcept/springframework/data/marklogic/repository/query/PartTreeMarklogicQueryTest.java | [
"public interface MarklogicOperations {\n\n /**\n * Insert the given object.\n * Content will be converted if not one of supported type.\n * Uri will be computed as well as creation options (such as defaultCollection)\n * Insert is used to initially store the object into the database. To update a... | import com._4dconcept.springframework.data.marklogic.core.MarklogicOperations;
import com._4dconcept.springframework.data.marklogic.core.convert.MappingMarklogicConverter;
import com._4dconcept.springframework.data.marklogic.core.convert.MarklogicConverter;
import com._4dconcept.springframework.data.marklogic.core.mapp... |
@Test
public void setFieldsWithContainingKeyWordShouldBeConsideredAsOrCriteria() {
Set<String> skills = new LinkedHashSet<>();
skills.add("foo");
skills.add("bar");
Query query = deriveQueryFromMethod("findBySkillsContaining", skills);
assertThat(query.getCriteria().ge... | interface Repo extends MarklogicRepository<Person, Long> { | 6 |
PunchThrough/bean-sdk-android | sdk/src/main/java/com/punchthrough/bean/sdk/internal/ble/GattClient.java | [
"public class BatteryProfile extends BaseProfile {\n\n protected static final String TAG = \"BatteryProfile\";\n protected boolean ready = false;\n private BluetoothGattService mBatteryService;\n private BatteryLevelCallback mCallback;\n\n public BatteryProfile(GattClient client) {\n super(cli... | import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.bluetooth.BluetoothGattCallback;
import android.bluetooth.BluetoothGattCharacteristic;
import android.bluetooth.BluetoothGattDescriptor;
import android.bluetooth.BluetoothGattService;
import android.content.Context;
import ... | package com.punchthrough.bean.sdk.internal.ble;
/**
* Encapsulation of a GATT client in a typical central/peripheral BLE connection where the
* GATT client is running on the central device.
*/
public class GattClient {
private static final String TAG = "GattClient";
// Profiles
private final GattSe... | mOADProfile = new OADProfile(this, new Watchdog(handler)); | 7 |
shyampurk/bluemix-todo-app | Android-Client/app/src/main/java/vitymobi/com/todobluemix/ActivityTaskDetails.java | [
"public class TaskCommentsAdapter extends BaseAdapter {\n\n private Context parentContext;\n private LayoutInflater mInflater;\n private ArrayList<CommentTemplate> taskComments;\n\n\n public TaskCommentsAdapter(Context parentReference, ArrayList<CommentTemplate> commentsList){\n this.parentConte... | import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.os.Bundle;
import android... | package vitymobi.com.todobluemix;
/**
* Created by manishautomatic on 22/03/16.
*/
public class ActivityTaskDetails extends AppCompatActivity implements View.OnClickListener {
private ListView mLstVwTaskComments;
private TaskCommentsAdapter mAdapter;
private ArrayList<CommentTemplate> commentsList ... | private void processToggleStatusCallback(HandlerResponseMessage responseMessage) { | 6 |
FacePlusPlus/MegviiFacepp-Android-SDK | faceppdemo/src/main/java/com/facepp/demo/facecompare/FaceCompareManager.java | [
"public class FeatureInfoSettingActivity extends Activity implements View.OnClickListener, AdapterView.OnItemClickListener {\n\n private ListView mListView;\n private TextView mCancleText, mSureText;\n private FeatureInfoAdapter mAdapter;\n private FaceActionInfo mFaceActionInfo;\n private DialogUtil... | import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Rect;
import android.util.Log;
import android.widget.Toast;
import com.facepp.demo.FeatureInfoSettingActivity;
import com.facepp.demo.OpenglActivity;
import com.facepp.demo.bean.FaceActionInfo;
import ... | if (featureInfos != null) {
synchronized (this) {
mFeatureData = Arrays.asList(featureInfos);
mFeatureData = new ArrayList<>(mFeatureData);
}
}
}
public void refresh(Context ctx) {
FeatureInfo[] arr = new FeatureInfo[mFeatureData.s... | Intent intent = new Intent(activity, FeatureInfoSettingActivity.class); | 0 |
dexter/elianto | src/main/java/it/cnr/isti/hpc/dexter/annotate/dao/SqliteDao.java | [
"@DatabaseTable(tableName = \"actions\")\npublic class Action {\n\n\tpublic enum Type {\n\t\tGET_DOCUMENT, SAVE_STEP1, SAVE_STEP2, SAVE_SKIPPED;\n\t};\n\n\t@DatabaseField(generatedId = true)\n\tint id;\n\n\t@DatabaseField(foreign = true, canBeNull = false, columnName = \"docId\")\n\tprivate Document doc;\n\t\n\t@Da... | import it.cnr.isti.hpc.dexter.annotate.bean.Action;
import it.cnr.isti.hpc.dexter.annotate.bean.AnnotatedSpot;
import it.cnr.isti.hpc.dexter.annotate.bean.AnnotationStatus;
import it.cnr.isti.hpc.dexter.annotate.bean.Document;
import it.cnr.isti.hpc.dexter.annotate.bean.EntityDescription;
import it.cnr.isti.hpc.dexter.... | /**
* Copyright 2013 Diego Ceccarelli
*
* 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 ... | Dao<User, String> accountDao; | 5 |
iZettle/dropwizard-metrics-influxdb | dropwizard-metrics-influxdb/src/main/java/com/izettle/metrics/dw/InfluxDbReporterFactory.java | [
"public class InfluxDBKafkaSender extends InfluxDbBaseSender {\n private static final String KAFKA_CLIENT_ID = \"metrics_influxdb_reporter\";\n private final KafkaProducer<byte[], byte[]> kafkaProducer;\n private final String topic;\n\n public InfluxDBKafkaSender(String database, TimeUnit timePrecision,... | import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;
import javax.activation.UnsupportedDataTypeException;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.con... |
@JsonProperty
public void setReadTimeout(int readTimeout) {
this.readTimeout = readTimeout;
}
@JsonProperty
public boolean getGroupGauges() {
return groupGauges;
}
@JsonProperty
public void setGroupGauges(boolean groupGauges) {
this.groupGauges = groupGauges;
... | new InfluxDbLoggerSender( | 2 |
msteiger/jxmapviewer2 | examples/src/sample3_interaction/Sample3.java | [
"public class JXMapViewer extends JPanel implements DesignMode\r\n{\r\n private static final long serialVersionUID = -3530746298586937321L;\r\n\r\n /**\r\n * The zoom level. Generally a value between 1 and 15 (TODO Is this true for all the mapping worlds? What does this\r\n * mean if some mapping syst... | import java.awt.BorderLayout;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.WindowConstants;
import javax.swing.event.MouseInputListener;
import org.jxmapviewer.JXMapViewer;
import o... | package sample3_interaction;
/**
* A simple sample application that shows
* a OSM map of Europe
* @author Martin Steiger
*/
public class Sample3
{
/**
* @param args the program args (ignored)
*/
public static void main(String[] args)
{
// Create a TileFactoryInfo f... | TileFactoryInfo info = new OSMTileFactoryInfo();
| 1 |
saltedge/saltedge-android | app/src/main/java/com/saltedge/sdk/sample/features/CurrenciesRatesActivity.java | [
"public interface FetchCurrencyRatesResult {\n\n /**\n * Callback method is invoked when Fetch Currency Rates operation finished with success\n *\n * @param rates List of SECurrencyRate objects\n */\n void onFetchCurrenciesSuccess(List<SECurrencyRate> rates);\n\n /**\n * Callback method... | import android.app.ActionBar;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.saltedge.sdk.interfaces.FetchCurrencyRatesResul... | /*
Copyright © 2019 Salt Edge. https://saltedge.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publis... | CurrenciesRatesAdapter adapter = new CurrenciesRatesAdapter(this, new ArrayList<>(rates)); | 3 |
rburgst/okhttp-digest | src/main/java/com/burgstaller/okhttp/digest/DigestAuthenticator.java | [
"public class BasicHeaderValueFormatter {\n public static final BasicHeaderValueFormatter DEFAULT = new BasicHeaderValueFormatter();\n\n public StringBuilder formatNameValuePair(StringBuilder charBuffer, NameValuePair nvp, boolean quote) {\n\n charBuffer.append(nvp.getName());\n String value = ... | import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Formatter;
import java.uti... | /*
* This file incorporates work covered by the following copyright and
* permission notice:
*
* 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 A... | ParserCursor cursor = new ParserCursor(pos, buffer.length()); | 7 |
kwanghoon/MySmallBasic | MySmallBasic/src/com/coducation/smallbasic/lib/Facebook.java | [
"public class ArrayV extends Value {\r\n\tpublic ArrayV(){\r\n\t\tarrmap = new LinkedHashMap<String, Pair<String,Value>>();\r\n\t}\r\n\t\r\n\t\r\n\tpublic Value get(String index) {\r\n\t\tPair<String,Value> psv = arrmap.get(index.toUpperCase());\r\n\t\treturn psv==null ? null : psv.b;\r\n\t}\r\n\r\n\tpublic void pu... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Scanner;
import com.coducation.smallbasic.ArrayV;
import com.coducation.smallbasic.DoubleV;
import com.coducation.smallbasic.InterpretException;
import com.... | package com.coducation.smallbasic.lib;
public class Facebook {
static String Accesstoken = new String();
public static Value SaveToken(ArrayList<Value> args) {
if (args.get(0) instanceof DoubleV) {
Accesstoken = args.get(0).toString();
} else if (args.get(0) instanceof StrV) {
Accesstoken = ((StrV) ar... | ArrayV myinfor = new ArrayV(); | 0 |
channelaccess/ca | src/main/java/org/epics/ca/impl/search/ChannelSearchManager.java | [
"public class Constants\n{\n\n/*- Public attributes --------------------------------------------------------*/\n\n public enum ChannelProperties\n {\n nativeType, nativeTypeCode, remoteAddress, nativeElementCount\n }\n\n /**\n * String value of the JVM property key which specifies whether to strip t... | import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Logger;
import org.epics.ca.Constants;
import org.epics.ca.impl.UdpBroadcastTransport;
import org.epics.ca.impl.ChannelImpl;
import org.epics.ca.impl.Messages;
import ... | /*- Package Declaration ------------------------------------------------------*/
package org.epics.ca.impl.search;
/*- Imported packages --------------------------------------------------------*/
/*- Interface Declaration ----------------------------------------------------*/
/*- Class Declaration ----------------... | sendBuffer = ByteBuffer.allocateDirect( Constants.MAX_UDP_SEND ); | 0 |
eHarmony/pho | src/main/java/com/eharmony/pho/query/criterion/expression/Expression.java | [
"public interface Criterion {\n}",
"public enum Operator implements Symbolic {\n EQUAL(\"=\"), NOT_EQUAL(\"!=\"), GREATER_THAN(\">\"), GREATER_THAN_OR_EQUAL(\">=\"), LESS_THAN(\"<\"), LESS_THAN_OR_EQUAL(\n \"<=\"),\n\n BETWEEN(\"between\"),\n \n LIKE(\"like\"), ILIKE(\"ilike\"),\n\n NULL... | import com.eharmony.pho.query.criterion.Criterion;
import com.eharmony.pho.query.criterion.Operator;
import com.eharmony.pho.query.criterion.WithOperator;
import com.eharmony.pho.query.criterion.WithProperty;
import com.eharmony.pho.query.criterion.projection.AggregateProjection; | package com.eharmony.pho.query.criterion.expression;
/**
* An abstract expression with an operator that acts on a property name.
*/
public abstract class Expression implements Criterion, WithOperator, WithProperty {
private final Operator operator;
private final String propertyName; | private final AggregateProjection aggregateProjection; | 4 |
eriq-augustine/jocr | src/com/eriqaugustine/ocr/drivers/PLOVESizeTest.java | [
"public interface OCRClassifier {\n public String classify(WrapImage image);\n}",
"public class PLOVEClassifier extends CharacterClassifier {\n private static Logger logger = LogManager.getLogger(PLOVEClassifier.class.getName());\n\n public PLOVEClassifier(String trainingCharacters, String[] fonts, FeatureV... | import com.eriqaugustine.ocr.classifier.OCRClassifier;
import com.eriqaugustine.ocr.classifier.PLOVEClassifier;
import com.eriqaugustine.ocr.classifier.reduce.FeatureVectorReducer;
import com.eriqaugustine.ocr.classifier.reduce.NoReducer;
import com.eriqaugustine.ocr.classifier.reduce.KLTReducer;
import com.eriqaugusti... | package com.eriqaugustine.ocr.drivers;
/**
* Quck test for PLOVEClassifier.
*/
public class PLOVESizeTest extends KanjiClassifierTest {
public static void main(String[] args) throws Exception {
PLOVESizeTest test = new PLOVESizeTest();
System.out.println("ScaleSize,ReduceSize,TotalTimeMS,Hits");
... | PLOVE.SCALE_SIZE = size; | 5 |
antest1/kcanotify | app/src/main/java/com/antest1/kcanotify/ShipInfoSortActivity.java | [
"public static void loadTranslationData(Context context) {\n loadTranslationData(context, false);\n}",
"public static final String PREF_KCA_LANGUAGE = \"kca_language\";",
"public static final String PREF_SHIPINFO_SORTKEY = \"shipinfo_sortkey\";",
"public static String getStringPreferences(Context ctx, Stri... | import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.PorterDuff;
import android.os.Build;
import android.os.Bundle;
import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.To... | package com.antest1.kcanotify;
public class ShipInfoSortActivity extends AppCompatActivity {
Toolbar toolbar;
static Gson gson = new Gson();
LinearLayout listview;
TextView listcounter;
public int count;
public List<Integer> sort_items = new ArrayList<>();
public SparseArray<String> so... | String pref_sort_list = getStringPreferences(getApplicationContext(), PREF_SHIPINFO_SORTKEY); | 2 |
signalfx/signalfx-java | signalfx-yammer/src/test/java/com/signalfx/codahale/metrics/SignalFxReporterTest.java | [
"public interface MetricMetadata {\n public static final String SOURCE = \"source\";\n public static final String METRIC = \"metric\";\n public Map<String, String> getTags(Metric metric);\n public Optional<SignalFxProtocolBuffers.MetricType> getMetricType(Metric metric);\n\n /**\n * Create an obj... | import static org.junit.Assert.*;
import org.junit.Test;
import com.yammer.metrics.core.Counter;
import com.yammer.metrics.core.Gauge;
import com.yammer.metrics.core.MetricName;
import com.yammer.metrics.core.MetricsRegistry;
import com.yammer.metrics.core.MetricPredicate;
import com.yammer.metrics.core.Histogram;
impo... | package com.signalfx.codahale.metrics;
public class SignalFxReporterTest {
private void testReporter(){
StoredDataPointReceiver dbank = new StoredDataPointReceiver();
assertEquals(0, dbank.addDataPoints.size());
MetricsRegistry metricRegistery = new MetricsRegistry();
SignalFx... | SfUtil.cumulativeCounter(metricRegistery, counterCallbackName, metricMetadata, new Gauge<Long>() { | 1 |
worldsproject/Fluxware-Game-Engine | src/tests/simple/roomtypes/PointedHex.java | [
"public class Game\n{\n\t//Sets the default size of the window that the game is displayed in.\n\tprivate Dimension size = new Dimension(800, 600);\n\n\t//Sets whether the window will display in fullscreen. Default false.\n\tprivate boolean fullscreen;\n\n\t//The current room that the game is displaying.\n\tprivate ... | import gui.Game;
import level.HexRoom;
import level.Type;
import sprites.Sprite;
import util.ImageData; | package tests.simple.roomtypes;
public class PointedHex extends Game
{
public PointedHex(HexRoom r)
{
super(r, true);
ImageData one = util.ImageUtil.loadTexture("/tests/resources/hex/pointed/clayHex.png");
Sprite a = new Sprite(one, 0, 0);
Sprite b = new Sprite(one, 1, 0);
Sprite c = new Sprite(one,... | HexRoom hr = new HexRoom(500, 500, 55, 64, Type.POINTED_HEX); | 2 |
idealo/mongodb-slow-operations-profiler | src/main/java/de/idealo/mongodb/slowops/servlet/CommandResult.java | [
"public final class CollectorManagerInstance {\n\n private static final CollectorManager INSTANCE = new CollectorManager();\n \n private CollectorManagerInstance(){};//no Instances of this!\n\n public static void init(){\n INSTANCE.startup();\n }\n\n public static void terminate(){\n ... | import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.mongodb.ServerAddress;
import de.idealo.mongodb.slowops.collector.CollectorManagerInstance;
import de.idealo.mongodb.slowops.collector.ProfilingReader;
import de.idealo.mongodb.slowops.command.*;
import de.idealo.mongodb.slowops.dto.CommandResult... | /*
* Copyright (c) 2013 idealo internet GmbH -- all rights reserved.
*/
package de.idealo.mongodb.slowops.servlet;
@WebServlet("/cmd")
public class CommandResult extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final Logger LOG = LoggerFactory.getLogger(CommandResult.class);
... | CommandResultDto result = null; | 2 |
sqrlserverjava/sqrl-server-base | src/main/java/com/github/sqrlserverjava/backchannel/nut/SqrlNutTokenFactory.java | [
"@XmlRootElement\npublic class SqrlConfig {\n\t// @formatter:off\n\t/* *********************************************************************************************/\n\t/* *************************************** REQUIRED ********************************************/\n\t/* *******************************************... | import java.net.InetAddress;
import java.net.URI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.sqrlserverjava.SqrlConfig;
import com.github.sqrlserverjava.SqrlConfigOperations;
import com.github.sqrlserverjava.backchannel.SqrlTifFlag;
import com.github.sqrlserverjava.exception.SqrlClientRe... | package com.github.sqrlserverjava.backchannel.nut;
// @formatter:off
/**
* Factory pattern class for marshaling and unmarshaling of SQRL "nut" tokens. The SQRL spec suggests a possible format,
* but does not mandate the format. This library supports multiple layouts of the token to support the following:
*
* 1... | throws SqrlClientRequestProcessingException { | 3 |
simonpercic/WaterfallCache | waterfallcache/src/androidTest/java/com/github/simonpercic/waterfallcache/expire/LazyExpirableCacheTest.java | [
"public final class ObservableTestUtils {\n\n private ObservableTestUtils() {\n //no instance\n }\n\n public static <T> void testObservable(Observable<T> observable, Action1<T> assertAction, boolean assertNotNull) {\n observable = observable.subscribeOn(Schedulers.immediate());\n\n Tes... | import com.github.simonpercic.waterfallcache.ObservableTestUtils;
import com.github.simonpercic.waterfallcache.WaterfallCache;
import com.github.simonpercic.waterfallcache.cache.RxCache;
import com.github.simonpercic.waterfallcache.expire.LazyExpirableCache.TimedValue;
import com.github.simonpercic.waterfallcache.model... | package com.github.simonpercic.waterfallcache.expire;
/**
* @author Simon Percic <a href="https://github.com/simonpercic">https://github.com/simonpercic</a>
*/
public class LazyExpirableCacheTest {
private WaterfallCache waterfallCache;
@Mock RxCache mockCache;
@Mock SimpleTimeProvider simpleTimeP... | new TimedValue<>(new SimpleObject(testValue), currentTime - TimeUnit.SECONDS.toMillis(15)))); | 3 |
iGoodie/TwitchSpawn | src/main/java/net/programmer/igoodie/twitchspawn/tslanguage/parser/TSLParser.java | [
"public interface TSLFlowNode {\n\n /**\n * Chains given node to this one\n *\n * @param next Next node\n * @return The next node if chained successfully.\n * Returns null otherwise\n */\n default TSLFlowNode chain(TSLFlowNode next) {\n throw new UnsupportedOperationException(\"... | import com.google.gson.JsonArray;
import com.google.gson.JsonParseException;
import com.google.gson.JsonParser;
import net.programmer.igoodie.twitchspawn.tslanguage.TSLFlowNode;
import net.programmer.igoodie.twitchspawn.tslanguage.action.TSLAction;
import net.programmer.igoodie.twitchspawn.tslanguage.event.TSLEvent;
im... | package net.programmer.igoodie.twitchspawn.tslanguage.parser;
public class TSLParser {
private static Pattern PERCENTAGE_PATTERN = Pattern.compile("(?<decimal>\\d{1,3})(\\.(?<fraction>\\d{1,2}))?");
public static int parsePercentage(String percentageString) {
Matcher matcher = PERCENTAGE_PATTERN.ma... | GsonUtils.removeInvalidTextComponent(parsedMessage); // <-- Will also remove null elements created by trailing comma chars | 8 |
CaMnter/Robotlegs4Android | robotlegs4android/src/main/java/com/camnter/robotlegs4android/adapter/SwiftSuspendersInjector.java | [
"public class XML {\n public String name = \"\";\n public Map<String, String> prototype = new HashMap<>();\n public Object child = new XMLList();\n public XML parent;\n\n /**\n * Add an XML node, the XML node's parent node points to the corresponding\n * XMLList\n * 添加一个XML节点,该XML节点的父节点指向... | import com.camnter.robotlegs4android.base.XML;
import com.camnter.robotlegs4android.core.IInjector;
import com.camnter.robotlegs4android.mvcs.Actor;
import com.camnter.robotlegs4android.mvcs.Command;
import com.camnter.robotlegs4android.mvcs.Mediator;
import com.camnter.robotlegs4android.swiftsuspenders.Injector; | /*
* Copyright (C) 2015 CaMnter yuanyu.camnter@gmail.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | .setValue("name", Actor.class.getName()) | 2 |
dariober/ASCIIGenome | src/main/java/tracks/TrackIntervalFeature.java | [
"public class Xterm256 {\n\n\tpublic static final LinkedHashMap<String, Integer> xtermNameToNumber= new LinkedHashMap<String, Integer>();\n\tpublic static final LinkedHashMap<Integer, String> contrastColor= new LinkedHashMap<Integer, String>(); \n\t// static final HashMap<Integer, String> intColorToName= new HashMa... | import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Patter... | package tracks;
public class TrackIntervalFeature extends Track {
protected List<IntervalFeature> intervalFeatureList= new ArrayList<IntervalFeature>();
/**For GTF/GFF data: Use this attribute to get the feature names
* */
protected TabixReader tabixReader; // Leave *protected* for TrackBookmark to work
... | public TrackIntervalFeature(final String filename, GenomicCoords gc) throws IOException, InvalidGenomicCoordsException, ClassNotFoundException, InvalidRecordException, SQLException{ | 5 |
OpenSensing/funf-v4 | funf_v4/src/main/java/edu/mit/media/funf/pipeline/BasicPipeline.java | [
"public class FunfManager extends Service {\n\t\n\tpublic static final String \n\tACTION_KEEP_ALIVE = \"funf.keepalive\",\n\tACTION_INTERNAL = \"funf.internal\";\n\t\n\tprivate static final String \n\tPROBE_TYPE = \"funf/probe\",\n\tPIPELINE_TYPE = \"funf/pipeline\";\n\t\n\tprivate static final String \n\tDISABLED_... | import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.content.ContentValues;
import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.... | /**
*
* Funf: Open Sensing Framework Copyright (C) 2013 Alan Gardner
*
* This file is part of Funf.
*
* Funf is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser
* General Public License as published by the Free Software Foundation, either version 3 of the
* License, o... | archive = new DefaultArchive(manager, name); | 4 |
xdtianyu/Kindle | app/src/main/java/org/xdty/kindle/di/AppComponent.java | [
"public class BookRepository implements BookDataSource {\n\n @Inject\n BookService mBookService;\n\n @Inject\n Database mDatabase;\n\n private Books mBooks;\n\n private Map<String, Review> mReviewCache = new HashMap<>();\n private Map<String, Book> mBookCache = new HashMap<>();\n\n public Bo... | import org.xdty.kindle.data.BookRepository;
import org.xdty.kindle.di.modules.AppModule;
import org.xdty.kindle.module.database.DatabaseImpl;
import org.xdty.kindle.presenter.DetailPresenter;
import org.xdty.kindle.presenter.MainPresenter;
import org.xdty.kindle.view.BooksAdapter;
import javax.inject.Singleton;
import ... | package org.xdty.kindle.di;
@Singleton
@Component(modules = AppModule.class)
public interface AppComponent {
void inject(BookRepository bookRepository);
void inject(DatabaseImpl database);
| void inject(BooksAdapter booksAdapter); | 5 |
jaredrummler/TrueTypeParser | lib-truetypeparser/src/main/java/com/jaredrummler/fontreader/fonts/GlyphSubtable.java | [
"public class AdvancedTypographicTableFormatException extends RuntimeException {\n\n /**\n * Instantiate ATT format exception.\n */\n public AdvancedTypographicTableFormatException() {\n super();\n }\n\n /**\n * Instantiate ATT format exception.\n *\n * @param message\n * a message string\n ... | import com.jaredrummler.fontreader.complexscripts.fonts.AdvancedTypographicTableFormatException;
import com.jaredrummler.fontreader.complexscripts.fonts.GlyphClassMapping;
import com.jaredrummler.fontreader.complexscripts.fonts.GlyphCoverageMapping;
import com.jaredrummler.fontreader.complexscripts.fonts.GlyphDefinitio... | /*
* Copyright (C) 2016 Jared Rummler <jared.rummler@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... | public GlyphCoverageMapping getCoverage() { | 2 |
wisedog/Whoochoo | src/net/wisedog/android/whooing/Whooing.java | [
"public class MainFragmentActivity extends Activity{\n\t\n //for left sliding menu\n private DrawerLayout mDrawerLayout;\n private ListView mDrawerList;\n\n /** Adpater for left menu*/\n private DrawerAdapter mAdapter;\n \n public boolean mDirtyFlagModifyBbs = false;\n \n\t@Override\n pro... | import net.wisedog.android.whooing.activity.MainFragmentActivity;
import net.wisedog.android.whooing.auth.WhooingAuthMain;
import net.wisedog.android.whooing.engine.DataRepository;
import net.wisedog.android.whooing.engine.DataRepository.onLoadingMessage;
import net.wisedog.android.whooing.widget.WiTextView;
import and... | /*
* Copyright (C) 2013 Jongha Kim
*
* 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... | DataRepository repository = WhooingApplication.getInstance().getRepo(); | 2 |
Azure/azure-storage-android | microsoft-azure-storage-test/src/com/microsoft/azure/storage/queue/CloudQueueTests.java | [
"public final class OperationContext {\n\n /**\n * The default log level, or null if disabled. The default can be overridden to turn on logging for an individual\n * operation context instance by using setLoggingEnabled.\n */\n private static Integer defaultLogLevel;\n\n /**\n * Indicates w... | import static org.junit.Assert.*;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.InvalidKeyException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.EnumSet;
import java.util.GregorianCalendar;
import java.... | /**
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | @Category({ DevFabricTests.class, DevStoreTests.class }) | 4 |
Deamon5550/VisualScripting | src/test/java/com/thevoxelbox/test/ProgramFlowTest.java | [
"public static <T> Provider<T> mock(T value)\n{\n return new Provider<T>(mockNode, value);\n}",
"public class CheckRunNode extends AbstractNode\n{\n\n int expected;\n\n /**\n * Creates a new {@link CheckRunNode}.\n * \n * @param e The expected number of runs\n */\n public CheckRunNode(... | import com.thevoxelbox.vsl.nodes.StaticValueNode;
import com.thevoxelbox.vsl.nodes.control.ForEachNode;
import com.thevoxelbox.vsl.nodes.control.ForLoop;
import com.thevoxelbox.vsl.nodes.control.IfStatement;
import static com.thevoxelbox.test.util.MockUtility.mock;
import org.junit.Before;
import org.junit.Test;
import... | /*
* The MIT License (MIT)
*
* Copyright (c) 2014 The VoxelBox
*
* 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,... | IfStatement ifs = new IfStatement(mock(true)); | 6 |
kraken-io/kraken-java | src/main/java/io/kraken/client/impl/DefaultKrakenIoClient.java | [
"public interface KrakenIoClient {\n SuccessfulUploadResponse directUpload(DirectUploadRequest directUploadRequest);\n SuccessfulUploadResponse directUpload(DirectFileUploadRequest directFileUploadRequest);\n SuccessfulUploadResponse imageUrlUpload(ImageUrlUploadRequest imageUrlUploadRequest);\n\n Succe... | import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
import io.kraken.client.KrakenIo... | /**
* Copyright (C) 2015 Nekkra UG (oss@kraken.io)
*
* 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 appli... | public SuccessfulUploadCallbackUrlResponse directUpload(DirectUploadCallbackUrlRequest directUploadCallbackUrlRequest) { | 7 |
joelhockey/jacknji11 | src/main/java/org/pkcs11/jacknji11/jna/JNA_CK_C_INITIALIZE_ARGS.java | [
"public class CK_C_INITIALIZE_ARGS {\n\n /**\n * True if application threads which are executing calls to the library may not use native operating system calls to\n * spawn new threads; false if they may.\n */\n public static final long CKF_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001;\n /** Tru... | import java.util.List;
import com.sun.jna.Callback;
import com.sun.jna.NativeLong;
import com.sun.jna.Pointer;
import com.sun.jna.Structure;
import com.sun.jna.ptr.PointerByReference;
import org.pkcs11.jacknji11.CK_C_INITIALIZE_ARGS;
import org.pkcs11.jacknji11.CK_C_INITIALIZE_ARGS.CK_CREATEMUTEX;
import org.pkcs11.jac... | /*
* Copyright 2010-2011 Joel Hockey (joel.hockey@gmail.com). 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 ri... | new NativePointer(Pointer.nativeValue(mutex.getPointer()))))); | 5 |
PPiMapBuilder/PPiMapBuilder | src/main/java/ch/picard/ppimapbuilder/networkbuilder/query/tasks/interactome/DeferredFetchUniProtEntryTask.java | [
"public class JSONUtils {\n\n\tpublic static List<String> jsonListToStringList(JSONable... jsonAbles) {\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tfor (JSONable jsonAble : jsonAbles) {\n\t\t\tlist.add(jsonAble.toJSON());\n\t\t}\n\t\treturn list;\n\t}\n\n\tpublic static List<String> jsonListToString... | import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyRow;
import org.cytoscape.work.AbstractTask;
import org.cytoscape.work.TaskMonitor;
import java.util.*;
import java.util.concurrent.Callable;
import ch.picard.ppimapbuilder.data.JSONUtils;
import ch.picard.ppimapbuilde... | /*
* This file is part of PPiMapBuilder.
*
* PPiMapBuilder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PPiMapBuilder is... | JSONUtils.jsonListToStringList(cellularComponent) | 0 |
dmillerw/RemoteIO | src/main/java/me/dmillerw/remoteio/core/proxy/ClientProxy.java | [
"@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = \"required-after:Forge@[12.18.2.2099,)\")\npublic class RemoteIO {\n\n @Mod.Instance(\"remoteio\")\n public static RemoteIO instance;\n\n @SidedProxy(\n serverSide = ModInfo.CORE_PACKAGE + \".cor... | import me.dmillerw.remoteio.RemoteIO;
import me.dmillerw.remoteio.block.BlockRemoteInterface;
import me.dmillerw.remoteio.block.ModBlocks;
import me.dmillerw.remoteio.client.model.loader.BaseModelLoader;
import me.dmillerw.remoteio.client.render.RenderTileRemoteInterface;
import me.dmillerw.remoteio.lib.property.Render... | package me.dmillerw.remoteio.core.proxy;
/**
* Created by dmillerw
*/
public class ClientProxy extends CommonProxy implements IProxy {
@Override
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
ModelLoaderRegistry.registerLoader(new BaseModelLoader());
... | public void handleClientBlockActivationMessage(CActivateBlock message) { | 6 |
TooTallNate/Java-WebSocket | src/main/java/org/java_websocket/server/WebSocketServer.java | [
"public abstract class AbstractWebSocket extends WebSocketAdapter {\n\n /**\n * Logger instance\n *\n * @since 1.4.0\n */\n private final Logger log = LoggerFactory.getLogger(AbstractWebSocket.class);\n\n /**\n * Attribute which allows you to deactivate the Nagle's algorithm\n *\n * @since 1.3.3\n ... | import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.CancelledKeyException;
import java.nio.channels.ClosedByInterruptException;
import java.nio.channels.SelectableChannel;... | /*
* Copyright (c) 2010-2020 Nathan Rajlich
*
* 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... | private final Collection<WebSocket> connections; | 1 |
naotawool/salary-calculation | src/main/java/salarycalculation/web/resources/EmployeeResource.java | [
"public class EmployeeRepositoryDao implements EmployeeRepository {\n\n private OrganizationRepository organizationRepository;\n private EmployeeDao dao;\n private EmployeeTransformer transformer;\n\n public EmployeeRepositoryDao() {\n this.dao = new EmployeeDao();\n this.organizationRepos... | import java.util.List;
import java.util.stream.Collectors;
import javax.validation.constraints.NotNull;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import com.codahale.metrics.annotation.Timed;
import salarycalculation.d... | package salarycalculation.web.resources;
/**
* 従業員に関するリクエストを受け付けるクラス。
*
* @author naotake
*/
@Path("/employee")
@Produces(MediaType.APPLICATION_JSON + "; charset=utf-8")
public class EmployeeResource {
private EmployeeRepository repository;
public EmployeeResource() {
repository = new Employe... | Employees employees = repository.findAll(); | 3 |
stardogventures/stardao | stardao-dynamodb/src/main/java/io/stardog/stardao/dynamodb/AbstractDynamoDao.java | [
"public abstract class AbstractDao<M,P,K,I> implements Dao<M,P,K> {\n private final Class<M> modelClass;\n private final Class<P> partialClass;\n private final FieldData fieldData;\n\n public AbstractDao(Class<M> modelClass, Class<P> partialClass) {\n this.modelClass = modelClass;\n this.p... | import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import com.amazonaws.services.dynamodbv2.document.Index;
import com.amazonaws.services.dynamodbv2.document.Item;
import com.amazonaws.services.dynamodbv2.document.ItemCollection;
import com.amazonaws.ser... | package io.stardog.stardao.dynamodb;
public abstract class AbstractDynamoDao<M,P,K,I> extends AbstractDao<M,P,K,I> {
protected final ItemMapper<M> modelMapper;
protected final ItemMapper<P> partialMapper;
protected final AmazonDynamoDB db;
protected final Table table;
protected final String table... | this.modelMapper = new JacksonItemMapper<>(modelClass, getFieldData()); | 6 |
bkueng/clash_of_balls | src/com/sapos_aplastados/game/clash_of_balls/network/NetworkClient.java | [
"public class Vector {\n\t\n\t// 2D vector\n\tpublic float x;\n\tpublic float y;\n\n\tpublic Vector() {\n\t\tx = 0.0f;\n\t\ty = 0.0f;\n\t}\n\tpublic Vector(Vec2 v) {\n\t\tx = v.x;\n\t\ty = v.y;\n\t}\n\n\tpublic Vector(float fx, float fy) {\n\t\tx = fx;\n\t\ty = fy;\n\t}\n\n\tpublic Vector(Vector src) {\n\t\tx = src... | import com.sapos_aplastados.game.clash_of_balls.network.Networking.AllJoynErrorData;
import com.sapos_aplastados.game.clash_of_balls.network.Networking.ConnectedClient;
import com.sapos_aplastados.game.clash_of_balls.network.Networking.NetworkData;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
im... | /*
* Copyright (C) 2012-2013 Hans Hardmeier <hanshardmeier@gmail.com>
* Copyright (C) 2012-2013 Andrin Jenal
* Copyright (C) 2012-2013 Beat Küng <beat-kueng@gmx.net>
*
* 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
* ... | private Vector m_sensor_update=new Vector(); | 0 |
patrickzib/SFA | src/test/java/sfa/SFASupervisedReproducibleIntervals.java | [
"public class TimeSeries implements Serializable {\n private static final long serialVersionUID = 6340030797230203868L;\n\n protected double[] data = null;\n\n protected double mean = 0;\n protected double stddev = 1;\n\n protected boolean normed = false;\n protected Double label = null;\n\n public static bo... | import org.junit.Assert;
import org.junit.Test;
import org.junit.internal.ArrayComparisonFailure;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import sfa.timeseries.TimeSeries;
import sfa.timeseries.TimeSeriesLoader;
import sfa.transformation.SFA;
import sfa.transformation.SFA.HistogramType;
import... | // Copyright (c) 2016 - Patrick Schäfer (patrick.schaefer@zib.de)
// Distributed under the GLP 3.0 (See accompanying file LICENSE)
package sfa;
/**
* Extracts windows from a time series and transforms each window using SFA.
*
*/
@RunWith(JUnit4.class)
public class SFASupervisedReproducibleIntervals {
@Test
p... | SFASupervised sfa = new SFASupervised(HistogramType.INFORMATION_GAIN); | 3 |
OpsLabJPL/MarsImagesAndroid | MarsImages/Rajawali/src/main/java/rajawali/renderer/plugins/LensFlarePlugin.java | [
"public class Camera extends ATransformable3D {\n\tprotected float[] mVMatrix = new float[16];\n\tprotected float[] mInvVMatrix = new float[16];\n\tprotected float[] mRotationMatrix = new float[16];\n\tprotected float[] mProjMatrix = new float[16];\n\tprotected float mNearPlane = 1.0f;\n\tprotected float mFarPlane ... | import java.nio.ByteBuffer;
import java.util.Stack;
import android.graphics.Bitmap.Config;
import android.opengl.GLES20;
import rajawali.Camera;
import rajawali.materials.TextureInfo;
import rajawali.materials.TextureManager.FilterType;
import rajawali.materials.TextureManager.TextureType;
import rajawali.materials.Tex... | " gl_FragColor = vec4(1.0, 0.0, 1.0, 0.0);\n" +
" } else if (uRenderType == 2) {\n" +
" gl_FragColor = texture2D(uMap, vTextureCoord);\n" +
" } else {\n" +
" vec4 texture = texture2D(uMap, vTextureCoord);\n" +
" if (uDebugMode == 1) {\n" +
... | public LensFlarePlugin(RajawaliRenderer renderer) { | 6 |
shyampurk/bluemix-todo-app | Android-Client/src/main/java/vitymobi/com/todobluemix/ActivityTaskDetails.java | [
"public class TaskCommentsAdapter extends BaseAdapter {\n\n private Context parentContext;\n private LayoutInflater mInflater;\n private ArrayList<CommentTemplate> taskComments;\n\n\n public TaskCommentsAdapter(Context parentReference, ArrayList<CommentTemplate> commentsList){\n this.parentConte... | import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
i... | package vitymobi.com.todobluemix;
/**
* Created by manishautomatic on 22/03/16.
*/
public class ActivityTaskDetails extends AppCompatActivity implements View.OnClickListener {
private ListView mLstVwTaskComments;
private TaskCommentsAdapter mAdapter; | private ArrayList<CommentTemplate> commentsList = new ArrayList<>(); | 4 |
scauwe/Generic-File-Driver-for-IDM | shim/src/main/java/info/vancauwenberge/filedriver/filereader/xml/XMLFileReader.java | [
"public abstract class AbstractStrategy implements IStrategy{\n\n\tpublic interface IStrategyParameters{\n\t\tpublic String getParameterName();\n\t\tpublic String getDefaultValue();\n\t\tpublic DataType getDataType();\n\t\tpublic Constraint[] getConstraints();\n\t}\n\t\n\tpublic static String getStringValueFor(ISt... | import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.util.Map;
imp... | /*******************************************************************************
* Copyright (c) 2007, 2018 Stefaan Van Cauwenberge
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0 (the "License"). If a copy of the MPL was not distributed with this
* file, You can obtain on... | public void openFile(final File initialFile) throws ReadException { | 2 |
luoyuan800/IPMIUtil4J | src/test/request/TestAlarmsRequest.java | [
"public class LocalIPMIClient extends IPMIClient {\n\n\tpublic LocalIPMIClient(Platform platform) {\n\t\tsuper(\"127.0.0.1\",\"\", \"\", null, platform);\n\t}\n\n}",
"public class Command {\n\tpublic OutputResult exeCmd(String commandStr) {\n\t\tBufferedReader br = null;\n\t\tOutputResult out = new OutputResult()... | import client.LocalIPMIClient;
import command.Command;
import org.junit.Assert;
import org.junit.Test;
import param.Platform;
import respond.AlarmRespond;
import respond.ChassisStatusRespond;
import java.io.IOException;
import static org.mockito.Matchers.contains;
import static org.mockito.Mockito.mock;
import static o... | /*
* TestAlarmsRequest.java
* Date: 7/17/2015
* Time: 9:47 AM
*
* Copyright 2015 luoyuan.
* ALL RIGHTS RESERVED.
*/
package request;
public class TestAlarmsRequest {
@Test
public void testAlarms() throws IOException {
Command command = mock(Command.class);
when(command.exeCmd(contain... | LocalIPMIClient client = new LocalIPMIClient(Platform.Win64); | 2 |
konifar/annict-android | app/src/main/java/com/konifar/annict/view/fragment/SearchSeasonFragment.java | [
"public abstract class ArrayRecyclerAdapter<T, VH extends RecyclerView.ViewHolder>\n extends RecyclerView.Adapter<VH> implements Iterable<T> {\n\n protected final ArrayList<T> list;\n\n final Context context;\n\n public ArrayRecyclerAdapter(@NonNull Context context) {\n this.context = context;\n ... | import com.annimon.stream.Stream;
import com.konifar.annict.R;
import com.konifar.annict.databinding.FragmentSearchSeasonBinding;
import com.konifar.annict.databinding.ItemSearchBinding;
import com.konifar.annict.pref.DefaultPrefs;
import com.konifar.annict.view.widget.ArrayRecyclerAdapter;
import com.konifar.annict.vi... | package com.konifar.annict.view.fragment;
public class SearchSeasonFragment extends BaseFragment implements TabPage {
private static final String TAG = SearchSeasonFragment.class.getSimpleName();
@Inject
SearchSeasonViewModel viewModel;
@Inject
CompositeSubscription compositeSubscription;
... | extends ArrayRecyclerAdapter<SearchItemViewModel, BindingHolder<ItemSearchBinding>> { | 0 |
JanWiemer/jacis | src/test/java/org/jacis/JacisContainerTest.java | [
"@JacisApi\npublic class JacisContainer {\n\n /** {@link JacisTransactionAdapter} to bind the Jacis Store to externally managed transactions. */\n private final JacisTransactionAdapter txAdapter;\n /** Map assigning the stores (values of type {@link JacisStoreImpl}) to the store identifiers (keys of type {@link ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.jacis.container.JacisContainer;
import org.jacis.container.JacisObjectTypeSpec;
import org.jacis.plugin.objectadapter.cloning.JacisCloningObjectAdapter;
import org.jacis.store.JacisStore;
import org.jacis.store.J... | /*
* Copyright (c) 2016. Jan Wiemer
*/
package org.jacis;
public class JacisContainerTest {
private static final Logger log = LoggerFactory.getLogger(JacisContainerTest.class);
@Test
public void testCreateContainer() {
JacisContainer container = new JacisContainer();
assertNotNull(c... | JacisStore<String, TestObject> store = container.getStore(String.class, TestObject.class);
| 3 |
sebastienD/genetic-car | genetic-car-server/src/main/java/fr/genetic/server/web/controller/SimulationController.java | [
"public class Game {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(Game.class);\n\n private static Map<Team, RunBoard> players = new ConcurrentHashMap<>();\n\n public static void clearGame() {\n LOGGER.info(\"Delete all simulation\");\n players.clear();\n }\n\n public... | import fr.genetic.server.game.Game;
import fr.genetic.server.game.RunBoard;
import fr.genetic.server.simulation.CarDefinition;
import fr.genetic.server.simulation.Simulation;
import fr.genetic.server.game.Team;
import fr.genetic.server.web.validator.CarViewListValidator;
import fr.genetic.server.web.view.CarScoreView;
... | package fr.genetic.server.web.controller;
@RestController
public class SimulationController {
@Autowired
private SimpMessagingTemplate template;
@Autowired
private CarViewListValidator carValidator;
@RequestMapping(value="/simulation/evaluate/{team}", method = RequestMethod.POST)
public Li... | RunBoard runBoard = Game.getRunBoard(team); | 1 |
neowu/core-ng-demo-project | demo-service/src/main/java/app/demo/customer/service/CustomerService.java | [
"public class CreateCustomerRequest {\n @NotNull\n @NotBlank\n @Property(name = \"email\")\n public String email;\n\n @NotNull\n @NotBlank\n @Property(name = \"first_name\")\n public String firstName;\n\n @NotBlank\n @Property(name = \"last_name\")\n public String lastName;\n}",
"... | import app.demo.api.customer.CreateCustomerRequest;
import app.demo.api.customer.CustomerView;
import app.demo.api.customer.SearchCustomerRequest;
import app.demo.api.customer.SearchCustomerResponse;
import app.demo.api.customer.UpdateCustomerRequest;
import app.demo.customer.domain.Customer;
import app.demo.customer.d... | package app.demo.customer.service;
public class CustomerService {
@Inject
Repository<Customer> customerRepository;
public CustomerView get(Long id) {
Customer customer = customerRepository.get(id).orElseThrow(() -> new NotFoundException("customer not found, id=" + id));
return view(custo... | public CustomerView create(CreateCustomerRequest request) { | 0 |
Thomas-Bergmann/Tournament | de.hatoka.group/src/main/java/de/hatoka/group/internal/business/GroupBOImpl.java | [
"public interface GroupBO\n{\n /**\n * @return userRef of owner\n */\n String getOwner();\n\n /**\n * Removes the group\n */\n void remove();\n\n /**\n * @return name of group\n */\n String getName();\n\n /**\n * Create member for given user\n * @param userRef\n ... | import java.util.Collection;
import java.util.Optional;
import java.util.stream.Collectors;
import de.hatoka.group.capi.business.GroupBO;
import de.hatoka.group.capi.business.GroupBusinessFactory;
import de.hatoka.group.capi.business.MemberBO;
import de.hatoka.group.capi.dao.GroupDao;
import de.hatoka.group.capi.dao.Me... | package de.hatoka.group.internal.business;
public class GroupBOImpl implements GroupBO
{
private GroupPO groupPO;
private final GroupDao groupDao;
private final MemberDao memberDao; | private final GroupBusinessFactory factory; | 1 |
ypresto/miniguava | miniguava-collect-immutables/src/main/java/net/ypresto/miniguava/collect/immutables/InternalUtils.java | [
"public static <T> T checkNotNull(T reference) {\n if (reference == null) {\n throw new NullPointerException();\n }\n return reference;\n}",
"public class Joiner {\n /**\n * Returns a joiner which automatically places {@code separator} between consecutive elements.\n */\n @CheckReturnValue\n public s... | import static net.ypresto.miniguava.base.Preconditions.checkNotNull;
import net.ypresto.miniguava.annotations.MiniGuavaSpecific;
import net.ypresto.miniguava.base.Joiner;
import net.ypresto.miniguava.base.Joiner.MapJoiner;
import net.ypresto.miniguava.collect.UnmodifiableIterator;
import net.ypresto.miniguava.collect.i... | /*
* Copyright (C) 2016 The Guava 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 applicable law or agre... | checkNotNull(entry); | 0 |
dwslab/RoCA | src/main/java/de/dwslab/risk/gui/jgraphx/EditorToolBar.java | [
" @SuppressWarnings(\"serial\")\n public static class ColorAction extends AbstractAction {\n\n /**\n*\n*/\n protected String name, key;\n\n /**\n *\n * @param key\n */\n public ColorAction(String name, String key) {\n this.name = name;\n this.key = key;\n }\n\n ... | import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;
import javax.swing.JToolBar;
import javax.swing.TransferHandler;
import com.mxgraph.... | package de.dwslab.risk.gui.jgraphx;
public class EditorToolBar extends JToolBar {
/**
*
*/
private static final long serialVersionUID = -8015443128436394471L;
/**
*
* @param frame
* @param orientation
*/
private boolean ignoreZoomChange = false;
/**
*
... | add(editor.bind("Bold", new FontStyleAction(true), | 1 |
joffrey-bion/fx-log | src/main/java/org/hildan/fxlog/view/StyledTableCell.java | [
"public class Colorizer extends RuleSet<LogEntry, Style, Filter, StyleRule> implements Named {\n\n private final StringProperty name;\n\n /**\n * Creates a new Colorizer with no rules.\n *\n * @param name\n * a name for this Colorizer\n */\n public Colorizer(@NotNull String name... | import javafx.beans.binding.Binding;
import javafx.beans.property.Property;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.*;
import org.fxmisc.easybind.EasyBind;
import org.hildan.fxlog.coloring.Colorizer;
import org.hildan.fxlog.coloring.Style... | package org.hildan.fxlog.view;
/**
* A table cell that can be styled using a {@link Colorizer}.
*/
public class StyledTableCell extends TableCell<LogEntry, String> {
private static final String STYLE_BINDING_KEY = "styleBinding";
private final SearchableLabel text;
| private final Property<Colorizer> colorizer = new SimpleObjectProperty<>(); | 0 |
hugmanrique/PokeData | src/main/java/me/hugmanrique/pokedata/tiles/Tileset.java | [
"public class Data {\n protected Data() {}\n\n public Data(ROM rom) {}\n\n public Data(ROM rom, int offset) {\n this(rom.seekAndGet(offset));\n }\n}",
"public class Lz77 {\n public static int getDataLength(ROM rom, int offset) {\n byte[] data = rom.readBytes(offset, 0x10);\n\n ... | import lombok.Getter;
import me.hugmanrique.pokedata.Data;
import me.hugmanrique.pokedata.compression.Lz77;
import me.hugmanrique.pokedata.graphics.ImageType;
import me.hugmanrique.pokedata.graphics.Palette;
import me.hugmanrique.pokedata.graphics.ROMImage;
import me.hugmanrique.pokedata.loaders.ROMData;
import me.hugm... | package me.hugmanrique.pokedata.tiles;
/**
* @author Hugmanrique
* @since 02/07/2017
*/
@Getter
public class Tileset extends Data {
public static final int MAX_TIME = 1; // TODO Default to 1, make configurable
//public static final int MAIN_PAL_COUNT = 8;
// TODO This is for FireRed, add to ROMData
... | private ROMImage image; | 4 |
w-shackleton/droidpad-android | src/uk/digitalsquid/droidpad/ButtonView.java | [
"public abstract class Item implements Serializable {\n\tprivate static final long serialVersionUID = -2217591684825043179L;\r\n\t\r\n\tpublic static final int FLAG_BUTTON\t\t\t= 0x1;\n\tpublic static final int FLAG_TOGGLE_BUTTON\t= 0x2 | FLAG_BUTTON;\n\tpublic static final int FLAG_SLIDER\t\t\t= 0x4;\n\tpublic sta... | import uk.digitalsquid.droidpad.buttons.Item;
import uk.digitalsquid.droidpad.buttons.Item.ScreenInfo;
import uk.digitalsquid.droidpad.buttons.Layout;
import uk.digitalsquid.droidpad.buttons.ModeSpec;
import uk.digitalsquid.droidpad.buttons.Slider;
import android.content.Context;
import android.graphics.Canvas;
import ... | /* This file is part of DroidPad.
*
* DroidPad is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DroidPad is distributed... | private ScreenInfo tmpScreenInfo = new ScreenInfo(); | 1 |
noear/SiteD | demo/android/App.java | [
"public class DdApi extends SdApi {\n /*\n * v27: 支持新的插件格式架构\n * : 增加 meta.contact\n * v26: 增加showNav,donwAll控制属性;\n * : section[2]支持t=10(原始大小图片,居中);支持只有group的Item\n * : 增加btype; dtag 改为 btag\n * : 4,5,6,7,增加{name,logo,list:[...]}格式,确可能有name 和 logo\n * : 支付 search 结果跳转到tag\n ... | import android.app.ActivityManager;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import com.alibaba.sdk.android.A... | package org.noear.ddcat;
/**
* Created by yuety on 14-8-6.
*/
public class App extends Application {
private static App mCurrent;
public void onCreate() {
super.onCreate();
mCurrent = this;
| DdApi.tryInit(new DdFactory(), new DdLogListener()); | 1 |
pnoker/mybatisGenerator | src/main/java/org/mybatis/generator/codegen/mybatis3/model/ExampleGenerator.java | [
"public interface CommentGenerator {\n\n /**\n * Adds properties for this instance from any properties configured in the\n * CommentGenerator configuration.\n * \n * <p>This method will be called before any of the other methods.\n * \n * @param properties\n * All properties... | import static org.mybatis.generator.internal.util.JavaBeansUtil.getGetterMethodName;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import static org.mybatis.generator.internal.util.messages.Messages.getString;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List... | /**
* Copyright 2006-2017 the original author or authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless requir... | for (IntrospectedColumn introspectedColumn : introspectedTable | 2 |
moxious/neoprofiler | src/main/java/org/mitre/neoprofiler/NeoProfiler.java | [
"public class HTMLMaker {\n\tpublic HTMLMaker() { ; } \n\t\n\tpublic String generateGraph(DBProfile profile) { \n\t\tStringBuffer b = new StringBuffer(\"var links = [\\n\");\n\t\t\n\t\tfor(NeoProfile p : profile.getProfiles()) {\n\t\t\tif(p instanceof LabelProfile) {\t\t\t\t\n\t\t\t\tLabelProfile lp = (LabelProfile... | import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.GnuParser;
import o... | package org.mitre.neoprofiler;
public class NeoProfiler {
protected Driver driver = null;
protected String storageLoc = null;
protected Session session = null; | protected List<Profiler> schedule = new ArrayList<Profiler>(); | 5 |
reines/httptunnel | src/test/java/com/yammer/httptunnel/client/HttpTunnelClientChannelTest.java | [
"public class FakeChannelSink extends AbstractChannelSink {\n\n\tpublic final Queue<ChannelEvent> events;\n\n\tpublic FakeChannelSink() {\n\t\tevents = new LinkedList<ChannelEvent>();\n\t}\n\n\t@Override\n\tpublic void eventSunk(ChannelPipeline pipeline, ChannelEvent e) throws Exception {\n\t\tevents.add(e);\n\t}\n... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import java.net.*;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.Chann... | /*
* Copyright 2009 Red Hat, Inc.
*
* Red Hat 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 ... | HttpTunnelClientChannelFactory factory = new HttpTunnelClientChannelFactory( | 5 |
LTTPP/Eemory | org.lttpp.eemory/src/org/lttpp/eemory/exception/EDAMNotFoundHandler.java | [
"public abstract class EeClipper {\n\n private boolean valid = true;\n\n public abstract void clipFile(ENNote args) throws Exception;\n\n public abstract void clipSelection(ENNote args) throws Exception;\n\n public abstract Map<String, ENObject> listNotebooks() throws Exception;\n\n public abstract M... | import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.core.runtime.IStatus;
import org.lttpp.eemory.client.EeClipper;
import org.lttpp.eemory.client.EeClipperFactory;
import org.lttpp.eemory.client.impl.model.ENNoteImpl;
import org.lttpp... | package org.lttpp.eemory.exception;
public class EDAMNotFoundHandler {
private final String token;
public EDAMNotFoundHandler(final String token) {
this.token = token;
}
public IStatus fixNotFoundException(final EDAMNotFoundException e, final ENNote args) {
if (e.getIdentifier().e... | return fixNotFoundNotebookGuid(args) ? LogUtil.ok() : LogUtil.error(e); | 4 |
airomem/airomem | airomem-chatsample/airomem-chatsample-data/src/main/java/pl/setblack/airomem/chatsample/execute/ChatControllerImpl.java | [
"public class Chat implements ChatView, Serializable {\n\n private CopyOnWriteArrayList<Message> messages;\n\n public Chat() {\n this.messages = new CopyOnWriteArrayList<>();\n }\n\n public void addMessage(String nick, String content, LocalDateTime time) {\n assert WriteChecker.hasPrevalan... | import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import pl.setblack.airomem.chatsample.data.Chat;
import pl.setblack.airomem.chatsample.view.ChatView;
import pl.setblack.airomem.chatsample.view.Messa... | /*
* Created by Jarek Ratajski
*/
package pl.setblack.airomem.chatsample.execute;
/**
*
* @author jarekr
*/
@ApplicationScoped
public class ChatControllerImpl implements ChatController {
| private PersistenceController<DataRoot<ChatView, Chat>, ChatView> controller; | 4 |
javaBin/AndroiditoJZ12 | android/src/main/java/com/google/android/apps/iosched/calendar/SessionCalendarService.java | [
"public class ScheduleContract {\n\n /**\n * Special value for {@link SyncColumns#UPDATED} indicating that an entry\n * has never been updated, or doesn't exist yet.\n */\n public static final long UPDATED_NEVER = -2;\n\n /**\n * Special value for {@link SyncColumns#UPDATED} indicating that... | import android.annotation.TargetApi;
import android.app.IntentService;
import android.content.ContentProviderOperation;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Intent;
import android.content.OperationApplicationException;
import android.database.Cursor;
impor... | /*
* Copyright 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... | LOGE(TAG, "Error adding all sessions to Google Calendar", e); | 2 |
jchampemont/WTFDYUM | src/main/java/com/jeanchampemont/wtfdyum/service/feature/impl/NotifyUnfollowFeatureStrategy.java | [
"public class Event {\n\n public Event() {\n // left deliberately empty\n }\n\n public Event(final EventType type, final String additionalData) {\n this.type = type;\n this.additionalData = additionalData;\n }\n\n private EventType type;\n\n private String additionalData;\n\n ... | import java.util.HashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import com.google.common.primitives.Longs;
import com.jeanchampemont.wtfdyum.dto.Event;
import com.jeanchampemont.wtfdyum.dto.Feature;
import com.jeanchampemont.wtfdyum.dto.Principal;
import com.jeanchampemont.wtfdyum.dto.... | /*
* Copyright (C) 2015, 2016 WTFDYUM
*
* This file is part of the WTFDYUM project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*... | final FollowersService followersService, | 5 |
loklak/loklak_server | src/org/loklak/harvester/TwitterScraper.java | [
"public abstract class AbstractObjectEntry extends Post implements ObjectEntry {\n\n public final static String TIMESTAMP_FIELDNAME = \"timestamp\"; // the harvesting time, NOT used for identification\n public final static String CREATED_AT_FIELDNAME = \"created_at\"; // the tweet time as embedded in the ... | import org.loklak.objects.AbstractObjectEntry;
import org.loklak.objects.BasicTimeline.Order;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.... | /**
* TwitterScraper
* Copyright 22.02.2015 by Michael Peter Christen, @0rb1t3r
*
* 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 ... | public static TwitterTimeline search( | 8 |
DMCApps/NavigationFragment | navigation-fragment/src/main/java/com/github/dmcapps/navigationfragment/v7/NavigationFragment.java | [
"public class NavigationManager implements Serializable {\n private static final String TAG = NavigationManager.class.getSimpleName();\n\n private transient NavigationManagerListener mListener;\n private transient WeakReference<NavigationManagerContainer> mContainer;\n\n // I don't like this ... but I'm... | import android.os.Bundle;
import android.support.v4.app.Fragment;
import com.github.dmcapps.navigationfragment.common.core.NavigationManager;
import com.github.dmcapps.navigationfragment.common.core.PresentationTransaction;
import com.github.dmcapps.navigationfragment.common.interfaces.Navigation;
import com.github.dmc... | package com.github.dmcapps.navigationfragment.v7;
/**
* This is the NavigationFragment that all classes in the stack must implement
* The extension of this class in the child fragments allows access to the presenting
* and dismissing of existing {@link Fragment} in the stack. The class will also generate
* and ... | ActionBarManager.setTitle(getActivity(), mTitle); | 4 |
otto-de/edison-jobtrigger | src/test/java/de/otto/edison/jobtrigger/discovery/DiscoveryServiceTest.java | [
"public class JobDefinition {\n private final String definitionUrl;\n private final String env;\n private final String service;\n private final String triggerUrl;\n private final String jobType;\n private final String description;\n private final Optional<String> cron;\n private Optional<Dur... | import com.google.common.collect.ImmutableList;
import com.google.gson.Gson;
import de.otto.edison.jobtrigger.definition.JobDefinition;
import de.otto.edison.jobtrigger.security.BasicAuthCredentials;
import de.otto.edison.jobtrigger.security.BasicAuthHeaderProvider;
import de.otto.edison.registry.service.RegisteredServ... | package de.otto.edison.jobtrigger.discovery;
@RunWith(MockitoJUnitRunner.class)
public class DiscoveryServiceTest {
public static final String ENV_NAME = "someEnv";
public static final String DEFAULT_TRIGGER_URL = "someTriggerUrl";
DiscoveryService testee;
@Mock
private AsyncHttpClient httpCl... | private BasicAuthHeaderProvider basicAuthHeaderProvider; | 2 |
farmerbb/SecondScreen | app/src/main/java/com/farmerbb/secondscreen/activity/FragmentContainerActivity.java | [
"public final class OverscanFragment extends PreferenceFragment implements\n OnPreferenceClickListener,\n SharedPreferences.OnSharedPreferenceChangeListener {\n\n boolean prefChange = false;\n boolean currentProfile = false;\n boolean testOverscan = false;\n\n /* The activity that creates ... | import android.app.DialogFragment;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Build;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import androidx.appcompat.app.AppCompatActivity;
import android.view.Window;
import com.farmerbb.secondscreen.R;
import... | /* Copyright 2015 Braden Farmer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | SettingsFragment.Listener, | 1 |
magnusmickelsson/pokeraidbot | src/main/java/pokeraidbot/domain/raid/signup/EmoticonSignUpMessageListener.java | [
"public class BotService {\n private static final Logger LOGGER = LoggerFactory.getLogger(BotService.class);\n private final Set<EventListener> extraListeners = new CopyOnWriteArraySet<>();\n private TrackingService trackingService;\n private String ownerId;\n private String token;\n private JDA b... | import net.dv8tion.jda.api.MessageBuilder;
import net.dv8tion.jda.api.entities.MessageReaction;
import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.GenericEvent;
import net.dv8tion.jda.api.events.message.guild.react.GenericGuildMessageReactionEvent;
import net.dv8tion.jda.api.events.message.guil... | package pokeraidbot.domain.raid.signup;
public class EmoticonSignUpMessageListener implements EventListener {
private static final Logger LOGGER = LoggerFactory.getLogger(EmoticonSignUpMessageListener.class); | private final BotService botService; | 0 |
charliem/OCM | OCM Compiler/src/com/kissintellignetsystems/ocm/compiler/csharp/CSharpGenerator.java | [
"public abstract class Generator \n{\n\tpublic abstract void generate(List<ASTColumnFamily> columnFamilies, String namespace, String directory, String keyspace);\n}",
"public class ASTSuperFamily extends SimpleNode \n{\n\t\n\tprivate String name;\n\tprivate String nameUpperCase;\n\n\tpublic ASTSuperFamily(int id)... | import com.kissintellignetsystems.ocm.compiler.Generator;
import com.kissintellignetsystems.ocm.compiler.parser.ASTSuperFamily;
import com.kissintellignetsystems.ocm.compiler.parser.ASTDynamicSuperFamily;
import com.kissintellignetsystems.ocm.compiler.parser.ASTField;
import com.kissintellignetsystems.ocm.compiler.pars... | /*
Copyright 2009 KISS Intelligent Systems Limited
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 t... | else if(familyObj instanceof ASTDynamicSuperFamily) | 2 |
cettia/asity | example-spring-webflux5/src/main/java/io/cettia/asity/example/spring/webflux5/EchoServer.java | [
"@FunctionalInterface\npublic interface Action<T> {\n\n /**\n * Some action is taken.\n */\n void on(T object);\n\n}",
"public class AsityHandlerFunction implements HandlerFunction<ServerResponse> {\n\n private Actions<ServerHttpExchange> httpActions = new ConcurrentActions<>();\n\n @Override\n public Mo... | import io.cettia.asity.action.Action;
import io.cettia.asity.bridge.spring.webflux5.AsityHandlerFunction;
import io.cettia.asity.bridge.spring.webflux5.AsityWebSocketHandler;
import io.cettia.asity.example.echo.HttpEchoServer;
import io.cettia.asity.example.echo.WebSocketEchoServer;
import io.cettia.asity.http.ServerHt... | /*
* Copyright 2018 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... | public Action<ServerHttpExchange> httpAction() { | 4 |
fireshort/spring-boot-quickstart | src/main/java/org/springside/examples/quickstart/service/task/TaskService.java | [
"@Entity\n@Table(name = \"ss_task\")\npublic class Task extends IdEntity {\n\n\tprivate String title;\n\tprivate String description;\n\tprivate User user;\n\n\t// JSR303 BeanValidator的校验规则\n\t@NotBlank\n\tpublic String getTitle() {\n\t\treturn title;\n\t}\n\n\tpublic void setTitle(String title) {\n\t\tthis.title = ... | import org.springside.examples.quickstart.entity.Task;
import org.springside.examples.quickstart.repository.TaskDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort... | /*******************************************************************************
* Copyright (c) 2005, 2014 springside.github.io
*
* Licensed under the Apache License, Version 2.0 (the "License");
*******************************************************************************/
package org.springside.examples.quicks... | private TaskDao taskDao; | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.