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
rnewson/couchdb-lucene
src/main/java/com/github/rnewson/couchdb/lucene/DocumentConverter.java
[ "public final class Database {\n\n private final HttpClient httpClient;\n\n private final String url;\n\n public Database(final HttpClient httpClient, final String url) {\n this.httpClient = httpClient;\n this.url = url.endsWith(\"/\") ? url : url + \"/\";\n }\n\n public boolean create(...
import com.github.rnewson.couchdb.lucene.couchdb.CouchDocument; import com.github.rnewson.couchdb.lucene.couchdb.Database; import com.github.rnewson.couchdb.lucene.couchdb.View; import com.github.rnewson.couchdb.lucene.couchdb.ViewSettings; import com.github.rnewson.couchdb.lucene.rhino.JSLog; import com.github.rnewson...
/* * Copyright Robert Newson * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writ...
final ViewSettings defaults,
2
emina/kodkod
examples/kodkod/examples/alloy/DiffEg.java
[ "public abstract class Expression extends Node {\n\t\n\t/** The universal relation: contains all atoms in a {@link kodkod.instance.Universe universe of discourse}. */\n\tpublic static final Expression UNIV = new ConstantExpression(\"univ\", 1);\n\t\n\t/** The identity relation: maps all atoms in a {@link kodkod.in...
import java.util.ArrayList; import java.util.List; import kodkod.ast.Expression; import kodkod.ast.Formula; import kodkod.ast.Relation; import kodkod.ast.Variable; import kodkod.engine.Solution; import kodkod.engine.Solver; import kodkod.instance.Bounds; import kodkod.instance.TupleFactory; import kodkod.instance.Unive...
package kodkod.examples.alloy; /* -- A simple access control policy framework sig Subject {} sig Resource {} sig Action {} one sig Request {s : Subject, r : Resource, a : Action } -- predicates from policies sig Conflicted {s : Subject, r : Resource} -- An access rule pred RevPaperNoConflict (req : Request) { ...
public final Formula revPaperNoConflict(Expression req) {
0
domoinc/domo-java-sdk
domo-java-sdk-all/src/main/java/com/domo/sdk/tasks/TasksClient.java
[ "public class RequestException extends RuntimeException {\n\n private ErrorResponse errorResponse;\n\n public RequestException(String msg) {\n super(msg);\n }\n\n public RequestException(String msg, Throwable throwable) {\n super(msg, throwable);\n }\n\n public RequestException(int s...
import com.domo.sdk.request.RequestException; import com.domo.sdk.request.Transport; import com.domo.sdk.request.UrlBuilder; import com.domo.sdk.tasks.model.Attachment; import com.domo.sdk.tasks.model.Project; import com.domo.sdk.tasks.model.ProjectList; import com.domo.sdk.tasks.model.Task; import com.google.gson.refl...
transport.putJson(url, userIds); } public List<ProjectList> getProjectLists(String projectId) { HttpUrl url = urlBuilder.fromPathSegments(URL_BASE) .addPathSegment(projectId) .addPathSegment("lists") .build(); return transport.getJson(url...
public List<Attachment> getAttachments(String projectId, String listId, String taskId, int limit, int offset){
3
jurihock/voicesmith
voicesmith/src/de/jurihock/voicesmith/dsp/stft/StftPostprocessor.java
[ "public static native float max(float a, float b);", "public static native float min(float a, float b);", "public static int round(float value)\n{\n\treturn java.lang.Math.round(value);\n}", "public interface Disposable\n{\n\tvoid dispose();\n}", "public final class KissFFT implements Disposable\n{\n\tpriva...
import static de.jurihock.voicesmith.dsp.Math.max; import static de.jurihock.voicesmith.dsp.Math.min; import static de.jurihock.voicesmith.dsp.Math.round; import java.util.Arrays; import de.jurihock.voicesmith.Disposable; import de.jurihock.voicesmith.dsp.KissFFT; import de.jurihock.voicesmith.dsp.Window; import de.jur...
/* * 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...
window = new Window(frameSize, true).hann();
5
Effervex/CycDAG
src/graph/module/cli/AnalyticsCommand.java
[ "public enum CommonConcepts {\r\n\tAND(\"and\"),\r\n\tARG1GENL(\"arg1Genl\"),\r\n\tARG1ISA(\"arg1Isa\"),\r\n\tARG1NOTGENL(\"arg1NotGenl\"),\r\n\tARG1NOTISA(\"arg1NotIsa\"),\r\n\tARG2GENL(\"arg2Genl\"),\r\n\tARG2ISA(\"arg2Isa\"),\r\n\tARG2NOTGENL(\"arg2NotGenl\"),\r\n\tARG2NOTISA(\"arg2NotIsa\"),\r\n\tARGGENL(\"argG...
import graph.core.CommonConcepts; import graph.core.CycDAG; import graph.core.DAGNode; import graph.core.Node; import graph.core.cli.DAGPortHandler; import graph.inference.CommonQuery; import graph.inference.QueryObject; import graph.inference.QueryResult; import graph.inference.Substitution; import graph.infe...
package graph.module.cli; public class AnalyticsCommand extends Command { private static final String MEMBERS = "# Members"; private static final String MAX_SUBTYPES = "# Max Subtypes"; private static final String MIN_SUPERTYPES = "# Min Supertypes"; private static final String COMMENTED = "Commented...
private FunctionIndex funcIndex_;
7
campaignmonitor/createsend-java
src/com/createsend/Lists.java
[ "public class PagedResult<T> {\r\n public T[] Results;\r\n public String ResultsOrderedBy;\r\n public String OrderDirection;\r\n public int PageNumber;\r\n public int PageSize;\r\n public int RecordsOnThisPage;\r\n public int TotalNumberOfRecords;\r\n public int NumberOfPages;\r\n \r\n ...
import com.createsend.models.PagedResult; import com.createsend.models.lists.CustomField; import com.createsend.models.lists.CustomFieldForCreate; import com.createsend.models.lists.CustomFieldForUpdate; import com.createsend.models.lists.List; import com.createsend.models.lists.ListForUpdate; import com.createse...
/** * Copyright (c) 2011 Toby Brain * * 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, mer...
return active(JsonProvider.ApiDateFormat.format(subscribedFrom),
8
GoogleChrome/custom-tabs-client
customtabs/src/android/support/customtabs/trusted/TwaLauncher.java
[ "public class CustomTabsClient {\n private final ICustomTabsService mService;\n private final ComponentName mServiceComponentName;\n private final Context mApplicationContext;\n\n /**@hide*/\n CustomTabsClient(ICustomTabsService service, ComponentName componentName,\n Context applicationCo...
import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.support.annotation.Nullable; import android.support.customtabs.CustomTabsClient; import android.support.customtabs.CustomTabsIntent; import android.support.customtabs.CustomTabsSer...
// Copyright 2019 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
@Nullable SplashScreenStrategy splashScreenStrategy,
5
daquexian/chaoli-forum-for-android-2
app/src/main/java/com/daquexian/chaoli/forum/view/MainActivity.java
[ "public class Me {\n private static User me = new User();\n\n public static void clear(){\n me = new User();\n }\n\n public static boolean isEmpty(){\n return me.isEmpty();\n }\n\n public static int getMyUserId(){\n return me.getUserId();\n }\n\n public static String get...
import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.databinding.DataBindingUtil; import android.databinding.Observable; import android.databinding.ObservableBoolean; import android.databinding.ObservableInt; import android.net.Uri; import android.os.B...
Action viewAction = Action.newAction( Action.TYPE_VIEW, // TODO: choose an action type. "Main Page", // TODO: Define a mTitle for the content shown. // TODO: If you have web page content that matches this app activity's content, // make sure this auto-generated web page URL is correct. // Oth...
public void setViewModel(BaseViewModel viewModel) {
6
noctarius/snowcast
src/main/java/com/noctarius/snowcast/impl/operations/DestroySequencerDefinitionOperation.java
[ "public class NodeSequencerService\n implements SequencerService, ManagedService, MigrationAwareService, RemoteService,\n EventPublishingService<Object, Object> {\n\n private static final MethodType FUTURE_GET_TYPE = MethodType.methodType(Object.class);\n private static final MethodTy...
import com.hazelcast.instance.MemberImpl; import com.hazelcast.spi.BackupAwareOperation; import com.hazelcast.spi.EventRegistration; import com.hazelcast.spi.NodeEngine; import com.hazelcast.spi.Operation; import com.hazelcast.spi.OperationService; import com.noctarius.snowcast.impl.NodeSequencerService; import com.noc...
/* * Copyright (c) 2015-2017, Christoph Engelbert (aka noctarius) and * contributors. 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...
NodeSequencerService sequencerService = getService();
0
andrew-nguyen/ucanaccess
src/main/java/net/ucanaccess/jdbc/UcanaccessConnection.java
[ "public class CompositeCommand implements ICommand {\n\tprivate ArrayList<ICursorCommand> composite = new ArrayList<ICursorCommand>();\n\tprivate Map<String, Object> currentRow;\n\tprivate String execId;\n\tprivate IndexSelector indexSelector;\n\tprivate ArrayList<ICursorCommand> rollbackCache=new ArrayList<ICursor...
import java.io.IOException; import java.sql.Array; import java.sql.Blob; import java.sql.CallableStatement; import java.sql.Clob; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.NClob; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLClientInfoException; imp...
/* Copyright (c) 2012 Marco Amadei. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in th...
return ((CompositeCommand) last).add(c4ioc);
0
strassl/Lampshade
lampshade/src/main/java/eu/prismsw/lampshade/fragments/SavedArticlesFragment.java
[ "public class RemoveActionMode {\n\tpublic Activity activity;\n\t\n\tpublic ActionMode mActionMode;\n\tpublic Uri selectedUrl;\n\n public Uri contentUri;\n\n\tpublic RemoveActionMode(Activity activity, Uri contentUri) {\n\t\tthis.activity = activity;\n this.contentUri = contentUri;\n\t}\n\t\n\tpublic void...
import android.app.Activity; import android.app.DialogFragment; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.support.v4.widget.CursorAdapter; import android.support.v4.widget.SimpleCursorAdapter; import android.view.LayoutInflater; import android.view.View; import and...
package eu.prismsw.lampshade.fragments; public class SavedArticlesFragment extends DialogFragment { public RemoveActionMode removeActionMode; public TropesApplication application; public OnRemoveListener removeListener; public OnInteractionListener interactionListener; public Uri contentUri = A...
String[] uiBindFrom = { SavedArticlesHelper.ARTICLES_COLUMN_TITLE };
4
jasonwyatt/SQLite-Performance
app/src/main/java/co/jasonwyatt/sqliteperf/inserts/SQLiteStatementVsRoomInsertAllFragment.java
[ "public class App extends Application {\n private static App sInstance;\n\n @Override\n public void onCreate() {\n super.onCreate();\n sInstance = this;\n }\n\n public static App getInstance() {\n return sInstance;\n }\n}", "public interface TestCase {\n void resetCase();...
import java.util.HashMap; import java.util.Locale; import java.util.Map; import co.jasonwyatt.sqliteperf.App; import co.jasonwyatt.sqliteperf.R; import co.jasonwyatt.sqliteperf.TestCase; import co.jasonwyatt.sqliteperf.TestSuiteFragment; import co.jasonwyatt.sqliteperf.inserts.integers.IntegerRoomTestCase; import co.ja...
package co.jasonwyatt.sqliteperf.inserts; /** * @author jason */ public class SQLiteStatementVsRoomInsertAllFragment extends TestSuiteFragment { @Override protected String getChartTitle() { return App.getInstance().getString(R.string.insert_performance_sqlitestatement_vs_room); } @Overrid...
new IntegerRoomTestCase(1000, 2),
3
Fedict/dcattools
scrapers/src/main/java/be/fedict/dcat/scrapers/fpsfinance/HtmlFpsFinance.java
[ "public class Cache {\n private static final Logger logger = LoggerFactory.getLogger(Cache.class);\n \n private DB db = null;\n private static final String CACHE = \"cache\";\n private static final String URLS = \"urls\";\n private static final String PAGES = \"pages\";\n\n /**\n * Stor...
import be.fedict.dcat.scrapers.Cache; import be.fedict.dcat.scrapers.Page; import be.fedict.dcat.helpers.Storage; import be.fedict.dcat.scrapers.Html; import be.fedict.dcat.vocab.MDR_LANG; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.uti...
/* * Copyright (c) 2017, FPS BOSA DG DT * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this * list of condit...
private void generateDist(Storage store, IRI dataset, int seq, URL access, String text, Element link, String lang)
2
jSCADA/jscada-core
src/test/java/ch/hevs/jscada/ScadaSystemTest.java
[ "@SuppressWarnings(\"serial\")\npublic class DuplicateIdException extends Exception {\n\t/**\n\t * Creates a DuplicateIdException with the given description message.\n\t * \n\t * @param id\tDuplicate ID.\n\t */\n\tpublic DuplicateIdException(String id) {\n\t\tsuper(\"A datapoint with the ID \\\"\" + id + \"\\\" exi...
import ch.hevs.jscada.model.DuplicateIdException; import ch.hevs.jscada.io.ConnectionGroup; import ch.hevs.jscada.io.field.dummy.DummyConnection; import ch.hevs.jscada.model.BooleanDataPoint; import ch.hevs.jscada.model.Process; import org.junit.Test; import static org.junit.Assert.*;
package ch.hevs.jscada; public class ScadaSystemTest { @Test public void creationAndDefaultProperties() { ScadaSystem scadaSystem = new ScadaSystem(); assertNotNull(scadaSystem.getProcess()); assertTrue(scadaSystem.getProcess() instanceof Process); assertEquals(scadaSystem.get...
new BooleanDataPoint("test", scadaSystem.getProcess());
3
huijimuhe/common-layout-android
CommonLayout/app/src/main/java/com/huijimuhe/commonlayout/xc/detail/xcDetailActivity.java
[ "public class AppContext extends Application {\n private static AppContext INSTANCE=null;\n\n @Override\n public void onCreate() {\n super.onCreate();\n INSTANCE=this;\n }\n\n public static AppContext getInstance(){return INSTANCE;}\n}", "public class xcDetailRepository {\n\n publi...
import android.content.Intent; import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import com.huijimuhe.commonlayout.AppContext; import com.huijimuhe.commonla...
package com.huijimuhe.commonlayout.xc.detail; public class xcDetailActivity extends AppCompatActivity implements xcDetailContract.View { private static final String TAG_LOADING = "loading"; private static final String TAG_CONTAINER = "container";
private xcDetailPresenter mPresenter;
3
kakao/hbase-tools
hbase0.98/hbase-manager-0.98/src/main/java/com/kakao/hbase/manager/command/MC.java
[ "public abstract class Args {\n public static final String OPTION_REGION = \"region\";\n public static final String OPTION_OUTPUT = \"output\";\n public static final String OPTION_SKIP_EXPORT = \"skip-export\";\n public static final String OPTION_VERBOSE = \"verbose\";\n public static final String OP...
import java.io.IOException; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; import com.google.common.annotations.VisibleForTesting; import com.kakao.hbase.common.Args; import com.kakao.hbase.common.Constant; import com.kakao.hbase.common.util.Util; import com.kakao.hbase.specific.CommandAdapter; i...
/* * Copyright 2015 Kakao 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 agre...
Constant.SMALL_WAIT_INTERVAL_MS : Constant.LARGE_WAIT_INTERVAL_MS;
1
talklittle/reddit-is-fun
src/com/andrewshu/android/reddit/common/tasks/SaveTask.java
[ "public class Common {\n\t\n\tprivate static final String TAG = \"Common\";\n\t\n\t// 1:subreddit 2:threadId 3:commentId\n\tprivate static final Pattern COMMENT_LINK = Pattern.compile(Constants.COMMENT_PATH_PATTERN_STRING);\n\tprivate static final Pattern REDDIT_LINK = Pattern.compile(Constants.REDDIT_PATH_PATTERN_...
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import org.apache.http.HttpEntity; import org.apache.http.HttpException; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apa...
package com.andrewshu.android.reddit.common.tasks; public class SaveTask extends AsyncTask<Void, Void, Boolean> { private static final String TAG = "SaveWorker"; private ThingInfo mTargetThreadInfo; private String mUserError = "Error voting."; private String mUrl; private boolean mSave;
private RedditSettings mSettings;
4
emop/EmopAndroid
src/com/weibo/sdk/android/sso/SsoHandler.java
[ "public class Constants {\r\n\tpublic static final String APP_ID = \"\";\r\n\tpublic static final String TAG_EMOP = \"emop\";\r\n\t\r\n\tpublic static final String PREFS_NAME = \"taodianhuo_perfs\";\r\n\t\r\n\tpublic static final String PREFS_OAUTH_ID = \"fmei_user_id\";\r\n\tpublic static final String PREFS_TRACK_...
import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.co...
// Prefer single sign-on, where available. bindSucced = bindRemoteSSOService(mAuthActivity); // Otherwise fall back to traditional dialog. if (!bindSucced) { startWebLogin(); } } public void startWebLogin(){ Intent intent = new Intent(); intent.setCl...
FmeiClient client = FmeiClient.getInstance(null);
2
statefulj/statefulj
statefulj-persistence/statefulj-persistence-jpa/src/test/java/org/statefulj/persistence/jpa/embedded/EmbeddedJPAPersisterTest.java
[ "public interface Persister<T> {\n\n\t/**\n\t * Returns the current state. This will not call into the underlying database\n\t *\n\t * @param stateful Stateful Entity\n\t * @return current State of the Stateful Entity\n\t */\n\tState<T> getCurrent(T stateful);\n\n\t/**\n\t * Set the current state to the next stat...
import org.statefulj.fsm.model.State; import org.statefulj.persistence.jpa.model.StatefulEntity; import org.statefulj.persistence.jpa.utils.UnitTestUtils; import static org.junit.Assert.*; import java.lang.reflect.Field; import javax.annotation.Resource; import org.junit.Test; import org.junit.runner.RunWith; import or...
/*** * * Copyright 2014 Andrew Hall * * 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...
State<EmbeddedOrder> stateA;
2
jazdw/jnaCan
core/src/net/jazdw/jnacan/BcmMessage.java
[ "public static class ReverseEnumMap<V, E extends Enum<E> & ValueEnum<V>> {\n private Map<V, E> map = new HashMap<V, E>();\n Class<E> valueType;\n \n public ReverseEnumMap(Class<E> valueType) {\n this.valueType = valueType;\n \n for (E e : valueType.getEnumConstants()) {\n ...
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.EnumSet; import java.util.List; import net.jazdw.jnacan.Utils.ReverseEnumMap; import net.jazdw.jnacan.Utils.ValueEnum; import net.jazdw.jnacan.c.CLibrary; import net.jazdw.jnacan.c.bcm_msg; import net.jazdw.jnacan.c.bcm_...
/* * Copyright (C) 2014 Jared Wiltshire. All rights reserved. * @author Jared Wiltshire */ package net.jazdw.jnacan; /** * Copyright (C) 2014 Jared Wiltshire. All rights reserved. * @author Jared Wiltshire */ @Data public class BcmMessage implements CanMessage<bcm_msg_head> { BcmOperation operation; En...
private static ReverseEnumMap<Integer, BcmOperation> map = ReverseEnumMap.create(BcmOperation.class);
0
tkrajina/10000sentences
10000sentencesapp/src/main/java/info/puzz/a10000sentences/activities/adapters/CollectionsAdapter.java
[ "public class Application extends android.app.Application {\n\n public static DiComponent COMPONENT;\n\n @Override\n public void onCreate() {\n super.onCreate();\n initIconify();\n initActiveAndroid();\n initDagger();\n }\n\n private void initDagger() {\n COMPONENT ...
import android.content.Context; import android.databinding.DataBindingUtil; import android.support.annotation.NonNull; import android.support.v4.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import java.util.HashMa...
package info.puzz.a10000sentences.activities.adapters; public class CollectionsAdapter extends ArrayAdapter<SentenceCollection> { Map<String, Language> languages = new HashMap<>(); @Inject Dao dao; public <T extends BaseActivity> CollectionsAdapter(T activity, List<SentenceCollection> cols) { ...
CollectionActivity.start((BaseActivity) getContext(), collection.getCollectionID());
2
rubenlagus/Tsupport
TMessagesProj/src/main/java/org/telegram/ui/LanguageSelectActivity.java
[ "public class AndroidUtilities {\n\n private static final Hashtable<String, Typeface> typefaceCache = new Hashtable<>();\n private static int prevOrientation = -10;\n private static boolean waitingForSms = false;\n private static final Object smsLock = new Object();\n\n public static int statusBarHei...
import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.view.Gravity; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.Adap...
/* * This is the source code of Telegram for Android v. 1.3.x. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Nikolai Kudashov, 2013-2014. */ package org.telegram.ui; public class LanguageSelectActivity extends BaseF...
ActionBarMenu menu = actionBar.createMenu();
5
ysmintor/Retrofit2RxjavaDemo
app/src/main/java/york/com/retrofit2rxjavademo/activity/MockDataActivity.java
[ "public class MockBean {\n /**\n * address : 北京市海淀区清华大学\n * website : www.tsinghua.edu.cn\n * email : zsb@mail.tsinghua.edu.cn\n * parent : 教育部\n * type : 211 985\n * phone : 010-62770334;010-62782051\n * info : 院士:68人 博士点:198个 硕士点:181个\n * city : 北京\n * name : 清华大学\n * p...
import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.TextView; import javax.inject.Inject; import dagger.android.AndroidInjection; i...
package york.com.retrofit2rxjavademo.activity; public class MockDataActivity extends AppCompatActivity { private static final String TAG = "MockDataActivity"; private TextView mTv; private Button mBtn1; private Button mBtn2; private Context mContext; @Inject ServiceFactory mServiceFac...
.compose(new DefaultTransformer<MockBean>())
5
HumBuch/HumBuch
src/test/java/de/dhbw/humbuch/viewmodel/TeachingMaterialViewModelTest.java
[ "public class GuiceJUnitRunner extends BlockJUnit4ClassRunner {\n\tprivate Injector injector;\n\n\t/**\n\t * Specifies the Guice {@link Module} classes which should be used when\n\t * injecting a JUnit test class\n\t */\n\t@Target(ElementType.TYPE)\n\t@Retention(RetentionPolicy.RUNTIME)\n\t@Inherited\n\tpublic @int...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import java.util.Calendar; import java.util.Date; import javax.persistence.EntityManager; import org.hibernate.criterion.Restrictions; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; impo...
package de.dhbw.humbuch.viewmodel; @RunWith(GuiceJUnitRunner.class) @GuiceModules({ TestModuleWithoutSingletons.class }) /** * @author Martin Wentzel */ public class TeachingMaterialViewModelTest extends BaseTest { private TeachingMaterialViewModel teachingMaterialViewModel; private DAO<Teac...
public void setInjected(TestPersistenceInitialiser persistenceInitialiser,
5
leonarduk/unison
src/test/java/uk/co/sleonard/unison/datahandling/HibernateHelperTest.java
[ "public class Location implements java.io.Serializable {\n\n\t/**\n\t *\n\t */\n\tprivate static final long serialVersionUID = -4937544540164453405L;\n\n\t/** The City. */\n\n\tprivate String City;\n\n\t/** The Country. */\n\tprivate String Country;\n\n\t/** The Country code. */\n\tprivate String CountryCode;\n\n\t...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.Matchers.anyInt; import static org.mockito.Matchers.anyString; import static org...
package uk.co.sleonard.unison.datahandling; /** * The Class HibernateHelperTest. * * @author Stephen <github@leonarduk.com> * @since v1.0.0 * */ public class HibernateHelperTest { private HibernateHelper helper; private Session session; /** * Setup. */ @Before public void setUp() throws Exceptio...
UsenetUser user = new UsenetUser("User", "my@email.com", "private", actual, null);
5
impiaaa/MyWorldGen
src/main/java/net/boatcake/MyWorldGen/Schematic.java
[ "public abstract class BlockAnchorLogic {\n\tprivate static Map<String, BlockAnchorLogic> blockNameToLogic = new HashMap<String, BlockAnchorLogic>();\n\n\tpublic static BlockAnchorLogic get(String blockName) {\n\t\treturn blockNameToLogic.get(blockName.toLowerCase(Locale.ROOT));\n\t}\n\n\tpublic static boolean isAn...
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Random; import org.apache.logging.log4j.Level; import com.google.common.collect.Lists; import net.boatcake.MyWorldGen.blocks.BlockAnchorLogic; imp...
package net.boatcake.MyWorldGen; public class Schematic { public short width; public short height; public short length; private int blocks[][][]; private int meta[][][]; public NBTTagList entities; public NBTTagList tileEntities; public Map<Integer, Block> idMap;
public Map<Integer, BlockAnchorLogic> matchingMap;
0
fabioz/eclipse.spellchecker
src/eclipse/spellchecker/AddWordProposal.java
[ "public interface ISpellCheckEngine {\n\n\t/**\n\t * Returns a spell checker configured with the global\n\t * dictionaries and the locale dictionary that correspond to the current\n\t * {@linkplain PreferenceConstants#SPELLING_LOCALE locale preference}.\n\t * <p>\n\t * <strong>Note:</strong> Changes to the spelling...
import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.MessageDialogWithToggle; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext; import org.eclipse.swt.graphics....
/******************************************************************************* * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, an...
JavaUIMessages.Spelling_add_askToConfigure_title,
5
abuchanan920/historybook
src/main/java/com/difference/historybook/proxyfilter/IndexingProxyFilter.java
[ "public interface Index extends AutoCloseable {\n\t/**\n\t * Adds a given page to an index collection\n\t * \n\t * @param collection a namespace for an index. Allows storing multiple indexes within the same backing store.\n\t * @param url the url of the page being indexed\n\t * @param timestamp ...
import java.time.Instant; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.difference.historybook.index.Index; import com.difference.historybook.index.IndexException; import com.difference.historybook.proxy.ProxyFilte...
/* * Copyright 2016 Andrew W. Buchanan (buchanan@difference.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...
if (new IndexingProxyResponseInfoSelector().test(new ProxyTransactionInfo(url, response.getStatus(), response.getHeaders()))) {
5
taoneill/war
war/src/main/java/com/tommytony/war/command/ZoneSetter.java
[ "public class War extends JavaPlugin {\n\tstatic final boolean HIDE_BLANK_MESSAGES = true;\n\tpublic static War war;\n\tprivate static ResourceBundle messages = ResourceBundle.getBundle(\"messages\");\n\tprivate final List<OfflinePlayer> zoneMakerNames = new ArrayList<>();\n\tprivate final List<String> commandWhite...
import java.util.logging.Level; import org.bukkit.block.Block; import org.bukkit.entity.Player; import com.tommytony.war.War; import com.tommytony.war.Warzone; import com.tommytony.war.config.WarConfig; import com.tommytony.war.mapper.WarYmlMapper; import com.tommytony.war.mapper.WarzoneYmlMapper; import com.tommytony....
package com.tommytony.war.command; public class ZoneSetter { private final Player player; private final String zoneName; public ZoneSetter(Player player, String zoneName) { this.player = player; this.zoneName = zoneName; } public void placeNorthwest() {
Warzone warzone = War.war.findWarzone(this.zoneName);
1
katjas/PDFrenderer
src/com/sun/pdfview/font/NativeFont.java
[ "public abstract class BaseWatchable implements Watchable, Runnable {\r\n\r\n /** the current status, from the list in Watchable */\r\n private int status = Watchable.UNKNOWN;\r\n /** a lock for status-related operations */\r\n private final Object statusLock = new Object();\r\n /** a lock for parsin...
import java.awt.Font; import java.awt.FontFormatException; import java.awt.font.FontRenderContext; import java.awt.font.GlyphVector; import java.awt.font.OpenType; import java.awt.geom.AffineTransform; import java.awt.geom.GeneralPath; import java.io.ByteArrayInputStream; import java.io.IOException; import jav...
/* * Copyright 2004 Sun Microsystems, Inc., 4150 Network Circle, * Santa Clara, California 95054, U.S.A. All rights reserved. * * 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;...
public NativeFont (String baseFont, PDFObject fontObj,
2
mtsar/mtsar
src/test/java/mtsar/processors/task/RandomAllocatorTest.java
[ "@XmlRootElement\npublic class Stage {\n private final Definition definition;\n private final WorkerRanker workerRanker;\n private final TaskAllocator taskAllocator;\n private final AnswerAggregator answerAggregator;\n\n @Inject\n public Stage(Definition definition, WorkerRanker workerRanker, Task...
import static mtsar.TestHelper.fixture; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; import mtsar.api.Stage; import mtsar.api.Task; import mtsar.api.TaskAllocation; import mtsar.api.Worker; import mtsar.api.sql.TaskDAO; import mtsar.processors.TaskAllocator; import org....
/* * Copyright 2015 Dmitry Ustalov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
private static final TaskAllocator allocator = new RandomAllocator(stage, taskDAO);
5
R2RML-api/R2RML-api
r2rml-api-core/src/main/java/eu/optique/r2rml/api/model/impl/PredicateObjectMapImpl.java
[ "@W3C_R2RML_Recommendation(R2RMLVocabulary.TYPE_GRAPH_MAP)\r\npublic interface GraphMap extends TermMap {\r\n\r\n}", "@W3C_R2RML_Recommendation(R2RMLVocabulary.TYPE_OBJECT_MAP)\r\npublic interface ObjectMap extends TermMap {\r\n\r\n /**\r\n * {@inheritDoc}\r\n *\r\n * The possible values for the te...
import eu.optique.r2rml.api.model.RefObjectMap; import eu.optique.r2rml.api.model.TermMap; import org.apache.commons.rdf.api.BlankNodeOrIRI; import org.apache.commons.rdf.api.RDF; import org.apache.commons.rdf.api.Triple; import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import...
/******************************************************************************* * Copyright 2013, the Optique Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * h...
private ArrayList<GraphMap> graphList;
0
nicolasbrailo/VlcFreemote
app/src/main/java/com/nicolasbrailo/vlcfreemote/model/VlcPath.java
[ "public class Bookmarks extends LocalSettings {\n\n private static final int DB_VERSION = 1;\n private static final String DB_NAME = \"bookmarks.db\";\n private static final String TABLE_NAME = \"bookmarks\";\n private static final String COLUMN_IP = \"ip\";\n private static final String COLUMN_VLCPO...
import android.content.Context; import android.os.Handler; import android.util.Log; import com.nicolasbrailo.vlcfreemote.local_settings.Bookmarks; import com.nicolasbrailo.vlcfreemote.local_settings.PlayedFiles; import com.nicolasbrailo.vlcfreemote.local_settings.RememberedServers; import com.nicolasbrailo.vlcfreemote....
package com.nicolasbrailo.vlcfreemote.model; public class VlcPath { public interface UICallback { void onNewDirListAvailable(List<Cmd_DirList.DirListEntry> results); void onDirListFatalFailure(VlcPath_ApplicationError vlcPath_applicationError); } public interface RandomSubdirCallback {...
private final RemoteVlc.ConnectionProvider vlcProvider;
4
Lzw2016/fastdfs-java-client
src/main/java/org/cleverframe/fastdfs/protocol/storage/request/DeleteFileRequest.java
[ "public final class CmdConstants {\n /**\n * 客户端关闭连接命令\n */\n public static final byte FDFS_PROTO_CMD_QUIT = 82;\n /**\n * 连接状态检查命令\n */\n public static final byte FDFS_PROTO_CMD_ACTIVE_TEST = 111;\n /**\n * 服务端正确返回报文状态\n */\n public static final byte FDFS_PROTO_CMD_RESP = ...
import org.cleverframe.fastdfs.constant.CmdConstants; import org.cleverframe.fastdfs.constant.OtherConstants; import org.cleverframe.fastdfs.protocol.BaseRequest; import org.cleverframe.fastdfs.protocol.ProtocolHead; import org.cleverframe.fastdfs.mapper.DynamicFieldType; import org.cleverframe.fastdfs.mapper.FastDFSCo...
package org.cleverframe.fastdfs.protocol.storage.request; /** * 作者:LiZW <br/> * 创建时间:2016/11/20 17:05 <br/> */ public class DeleteFileRequest extends BaseRequest { /** * 组名 */ @FastDFSColumn(index = 0, max = OtherConstants.FDFS_GROUP_NAME_MAX_LEN) private String groupName; /** * 路径名...
this.head = new ProtocolHead(CmdConstants.STORAGE_PROTO_CMD_DELETE_FILE);
0
5GSD/AIMSICDL
AIMSICD/src/main/java/zz/aimsicd/lite/adapters/DrawerMenuAdapter.java
[ "public class DrawerMenu {\n\n /**\n * Constants of id for NavDrawerItem\n * <p>Relates to {@link NavDrawerItem#getId()}<br />\n */\n public static class ID {\n\n\n /**\n * Constants of section of menu\n */\n public static final int SECTION_MAIN = 10;\n public ...
import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.ArrayAdapter; import android.widget.ImageView; import android.widget.TextView; import ...
/* Android IMSI-Catcher Detector | (c) AIMSICD Privacy Project * ----------------------------------------------------------- * LICENSE: http://git.io/vki47 | TERMS: http://git.io/vki4o * ----------------------------------------------------------- */ package zz.aimsicd.lite.adapters; public class DrawerMenuAda...
return DrawerMenu.COUNT_OF_MENU_TYPE;
0
norbertmartin12/site-monitor
app/src/main/java/org/site_monitor/receiver/internal/NetworkBroadcastReceiver.java
[ "@DatabaseTable\npublic class SiteCall implements Parcelable {\n public static final Creator<SiteCall> CREATOR = new Creator<SiteCall>() {\n @Override\n public SiteCall createFromParcel(Parcel in) {\n return new SiteCall(in);\n }\n\n @Override\n public SiteCall[] new...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.net.ConnectivityManager; import android.util.Log; import org.site_monitor.BuildConfig; import org.site_monitor.model.bo.SiteCall; import org.site_monitor.model.bo.SiteS...
/* * Copyright (c) 2016 Martin Norbert * 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...
SiteSettings siteSettings = intent.getParcelableExtra(BroadcastUtil.EXTRA_SITE);
4
elibom/jogger
src/main/java/com/elibom/jogger/http/servlet/ServletResponse.java
[ "public class Asset {\n\n\t/**\n\t * The input stream of the asset.\n\t */\n\tprivate final InputStream inputStream;\n\n\t/**\n\t * The name of the asset.\n\t */\n\tprivate final String name;\n\n\t/**\n\t * The content length of the asset.\n\t */\n\tprivate final long length;\n\n\t/**\n\t * The epoch timestamp when...
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.Closeable; import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.elibom.jogger.asset.Asset; import com.elibom.jogger.http.Cookie; import com.elibom.jogg...
package com.elibom.jogger.http.servlet; /** * A {@link Response} implementation based on the Servlet API. * * @author German Escobar */ public class ServletResponse implements Response { /** * The underlying Servlet Response. */ private HttpServletResponse response; private TemplateEngine templateEngin...
public Response write(Asset asset) {
0
MHAVLOVICK/Sketchy
src/main/java/com/sketchy/server/action/SaveDrawingSettings.java
[ "public enum SketchyContext {\n\tINSTANCE;\n\t\n\tprivate static NumberFormat nf = NumberFormat.getInstance();\n\n\tpublic static final Map<String, String> PEN_SIZES = new LinkedHashMap<String, String>();\n\tstatic{\n\t\tnf.setMinimumIntegerDigits(1);\n\t\tnf.setMinimumFractionDigits(1);\n\t\t\n\t\tfor (double penS...
import javax.servlet.http.HttpServletRequest; import com.sketchy.SketchyContext; import com.sketchy.drawing.DrawingProperties; import com.sketchy.drawing.DrawingSize; import com.sketchy.metadata.MetaDataObject; import com.sketchy.server.HttpServer; import com.sketchy.server.JSONServletResult; import com.sketchy.server....
/* Sketchy Copyright (C) 2015 Matthew Havlovick http://www.quickdrawbot.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your op...
SketchyContext.save(HttpServer.SKETCHY_PROPERTY_FILE);
4
olerass/presenter-first-android
chapter3-geoquiz/app/src/main/java/com/olerass/pfexample/android/geoquiz/platform/QuizActivity.java
[ "public class Question {\n private String text;\n private boolean correctAnswer;\n\n public Question(String text, boolean correctAnswer) {\n this.text = text;\n this.correctAnswer = correctAnswer;\n }\n\n public String getText() {\n return text;\n }\n\n public boolean getCo...
import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import com.olerass.pfexample.android.geoquiz.R; import com.olerass.pfexample.android.geoquiz.domain.question.Question; import com.olerass.pfexample.android.geoquiz.domain.question.QuestionPresenter; import com.olerass.pfexample.android.geoquiz.d...
package com.olerass.pfexample.android.geoquiz.platform; public class QuizActivity extends AppCompatActivity { private StandardQuestionModel model; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_quiz); ...
QuestionView view = new AndroidQuestionView(this);
2
kravchik/senjin
src/main/java/yk/senjin/examples/blend/WatchBlend.java
[ "public class DDDUtils {//TODO extract to another lib\n\n public static final float PI = (float) Math.PI;\n\n public static Matrix4f QtoM(Quaternionf q) {\n float x2 = q.i * q.i;\n float y2 = q.j * q.j;\n float z2 = q.k * q.k;\n float xy = q.i * q.j;\n float xz = q.i * q.k;\...
import org.lwjgl.LWJGLException; import yk.jcommon.fastgeom.Vec2f; import yk.jcommon.fastgeom.Vec3f; import yk.senjin.DDDUtils; import yk.senjin.Simple3DWatch; import yk.senjin.SomeTexture; import yk.senjin.examples.specular.SpecularF; import yk.senjin.examples.specular.SpecularV; import yk.senjin.examples.specular.Spe...
package yk.senjin.examples.blend; /** * Created with IntelliJ IDEA. * User: yuri * Date: 23/10/15 * Time: 21:21 */ public class WatchBlend extends Simple3DWatch { public SpecularF specularF; public SpecularV specularV; public GProgram specularProgram; public AVboTyped vbo1; public SomeText...
public AVboShortIndices indices;
5
reapzor/FiloFirmata
src/main/java/com/bortbort/arduino/FiloFirmata/Parser/Builders/DigitalPortBuilder.java
[ "public enum DigitalPinValue {\n LOW (0x00), // Digital Low\n HIGH (0x01); // Digital High\n\n private Byte byteValue;\n private Integer intValue;\n\n DigitalPinValue(int byteValue) {\n this.byteValue = (byte) byteValue;\n intValue = byteValue;\n }\n\n /**\n * Get Byte Va...
import com.bortbort.arduino.FiloFirmata.DigitalPinValue; import com.bortbort.arduino.FiloFirmata.Messages.DigitalPortMessage; import com.bortbort.arduino.FiloFirmata.Messages.Message; import com.bortbort.arduino.FiloFirmata.Parser.CommandBytes; import com.bortbort.arduino.FiloFirmata.Parser.MessageBuilder; import com.b...
package com.bortbort.arduino.FiloFirmata.Parser.Builders; /** * Created by chuck on 1/11/2016. */ public class DigitalPortBuilder extends MessageBuilder { private static final Logger log = LoggerFactory.getLogger(DigitalPortBuilder.class); public DigitalPortBuilder() { super(CommandBytes.DIGITAL_M...
if (FirmataHelper.fastReadBytesWithTimeout(inputStream, valueByteBody, 2000)) {
5
indexiatech/antiquity
src/test/java/co/indexia/antiquity/graph/VersionedGraphTestSuite.java
[ "@Factory\npublic static <T> Matcher<T> elementHasProperty(String key, Object value) {\n return new ElementHasProperty(key, value);\n}", "@Factory\npublic static <T> Matcher<T> hasAmount(int expected) {\n return new HasAmount(expected);\n}", "@Factory\npublic static <T> Matcher<T> elementIds(TYPE type, Ob...
import static co.indexia.antiquity.graph.matchers.ElementHasProperty.elementHasProperty; import static co.indexia.antiquity.graph.matchers.HasAmount.hasAmount; import static co.indexia.antiquity.graph.matchers.HasElementIds.ID.HARD_ID; import static co.indexia.antiquity.graph.matchers.HasElementIds.TYPE.CONTAINS; impor...
V ver2 = last(); HistoricVersionedVertex<V> hv2 = (HistoricVersionedVertex<V>) graph.getHistoricGraph().getVertex(v2.getId()); // expect the -start- version of hv1 assertThat(hv2.getVersion(), is(Range.range(ver2, ver2))); // list Boolean ver1Found = false; Boole...
assertThat(graph.getVertices(), elementIds(CONTAINS, v2ActiveLoaded.getId(), v3ActiveLoaded.getId()));
2
Whiley/Jasm
src/test/java/jasm/testing/JKitValidTests.java
[ "public final class ClassFileReader {\t\n\tprivate final byte[] bytes; // byte array of class\n\tprivate final int[] items; // start indices of constant pool items\t\n\tprivate final HashMap<Integer,Constant.Info> constantPool;\t\t\n\tprivate final HashMap<String,BytecodeAttribute.Reader> attributeReader...
import java.io.StringReader; import jasm.io.ClassFileReader; import jasm.io.ClassFileWriter; import jasm.lang.ClassFile; import jasm.verifier.ClassFileVerifier; import jasm.verifier.TypeAnalysis; import org.junit.*; import static org.junit.Assert.fail; import java.io.BufferedReader; import java.io.File; impor...
// This file is part of the Java Compiler Kit (JKit) // // The Java Compiler Kit is free software; you can // redistribute it and/or modify it under the terms of the // GNU General Public License as published by the Free Software // Foundation; either version 2 of the License, or (at your // option) any later ver...
new ClassFileWriter(new FileOutputStream(newClassFile)).write(cf);
1
liuyanggithub/Hi
src/com/ly/hi/im/ui/SetMyInfoActivity.java
[ "public class CustomApplication extends Application {\n\n\tpublic static CustomApplication mInstance;\n\tpublic LocationClient mLocationClient;\n\tpublic MyLocationListener mMyLocationListener;\n\t\n\n\tpublic static BmobGeoPoint lastPoint = null;// ÉÏÒ»´Î¶¨Î»µ½µÄ¾­Î³¶È\n\t\n\t/**\n * ÇëÇó¶ÓÁÐ\n */\n pri...
import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; imp...
}); } }); // ÏÔʾȷÈ϶Ի°¿ò dialog.show(); dialog = null; } RelativeLayout layout_choose; RelativeLayout layout_photo; PopupWindow avatorPop; public String filePath = ""; private void showAvatarPop() { View view = LayoutInflater.from(this).inflate(R.layout.pop_showavator, null); layout_choos...
degree = PhotoUtil.readPictureDegree(file.getAbsolutePath());
6
Rubentxu/DreamsLibGdx
core/src/main/java/com/rubentxu/juegos/core/managers/world/CheckPointManager.java
[ "public class BaseGame implements ApplicationListener {\n private boolean init = false;\n private BaseScreen currScreen;\n private BaseScreen nextScreen;\n private FrameBuffer currFbo;\n private FrameBuffer nextFbo;\n private SpriteBatch batch;\n private float t;\n private ScreenTransition s...
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.physics.box2d.Contact; import com.badlogic.gdx.physics.box2d.ContactImpulse; import com.badlogic.gdx.physics.box2d.Fixture; import com.badlogic.gdx.physics.box2d.Manifold; import com.badlogic.gdx.physics.box2d.joints.PrismaticJoint; import com.rubentxu.juegos.core.Ba...
package com.rubentxu.juegos.core.managers.world; public class CheckPointManager extends AbstractWorldManager { @Override public void handleBeginContact(Contact contact) {
CheckPoint checkPoint = getCheckPoint(contact);
4
wesabe/grendel
src/test/java/com/wesabe/grendel/entities/tests/DocumentTest.java
[ "@Entity\n@Table(name=\"documents\")\n@IdClass(DocumentPK.class)\n@NamedQueries({\n\t@NamedQuery(\n\t\tname=\"com.wesabe.grendel.entities.Document.ByOwnerAndName\",\n\t\tquery=\"SELECT d FROM Document AS d WHERE d.name = :name AND d.owner = :owner\"\n\t)\n})\npublic class Document implements Serializable {\n\tpriva...
import static org.fest.assertions.Assertions.*; import static org.mockito.Mockito.*; import java.io.FileInputStream; import java.lang.reflect.Field; import java.security.SecureRandom; import javax.ws.rs.core.MediaType; import org.joda.time.DateTime; import org.joda.time.DateTimeUtils; import org.joda.time.DateTimeZone;...
package com.wesabe.grendel.entities.tests; @RunWith(Enclosed.class) public class DocumentTest { public static class A_Fresh_Document { private User owner; private String name; private DateTime now; @Before public void setup() throws Exception { this.now = new DateTime(2009, 12, 27, 10, 0, 43, 0, ...
final Document doc = new Document(owner, name, MediaType.APPLICATION_OCTET_STREAM_TYPE);
0
idega/is.idega.idegaweb.egov.course
src/java/is/idega/idegaweb/egov/course/business/CourseWriter.java
[ "public class CourseConstants {\n\n\tpublic static final String CASE_CODE_KEY = \"COURSEA\";\n\n\tpublic static final String IW_BUNDLE_IDENTIFIER = \"is.idega.idegaweb.egov.course\";\n\n\tpublic static final String ADMINISTRATOR_ROLE_KEY = \"afterSchoolCareAdministrator\";\n\tpublic static final String SUPER_ADMINI...
import is.idega.idegaweb.egov.course.CourseConstants; import is.idega.idegaweb.egov.course.data.Course; import is.idega.idegaweb.egov.course.data.CoursePrice; import is.idega.idegaweb.egov.course.data.CourseType; import is.idega.idegaweb.egov.course.presentation.CourseBlock; import java.io.ByteArrayOutputStream; import...
/* * $Id$ Created on Mar 28, 2007 * * Copyright (C) 2007 Idega Software hf. All Rights Reserved. * * This software is the proprietary information of Idega hf. Use is subject to license terms. */ package is.idega.idegaweb.egov.course.business; public class CourseWriter extends DownloadWriter implements Med...
CourseType type = course.getCourseType();
3
massivedisaster/ADAL
sample/src/androidTest/java/com/massivedisaster/adal/tests/unit/suite/adapters/AbstractBaseAdapterTests.java
[ "public abstract class AbstractLoadMoreBaseAdapter<T> extends AbstractBaseAdapter<T> {\n\n public static final int VIEW_TYPE_ITEM = 0;\n public static final int VIEW_TYPE_LOAD = 1;\n public static final int VIEW_TYPE_HEADER = 2;\n\n private static final int INVALID_RESOURCE_ID = -1;\n\n protected OnC...
import android.support.test.filters.LargeTest; import android.support.test.runner.AndroidJUnit4; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import com.massivedisaster.adal.adapter.AbstractLoadMoreBaseAdapter; import com.massivedisaster.adal.sample.feature.networ...
/* * ADAL - A set of Android libraries to help speed up Android development. * * Copyright (c) 2017 ADAL * * 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, includin...
private AdapterPost mAdapterPost;
1
EsotericSoftware/yamlbeans
src/com/esotericsoftware/yamlbeans/parser/Parser.java
[ "public enum TokenType {\r\n\tDOCUMENT_START, //\r\n\tDOCUMENT_END, //\r\n\tBLOCK_MAPPING_START, //\r\n\tBLOCK_SEQUENCE_START, //\r\n\tBLOCK_ENTRY, //\r\n\tBLOCK_END, //\r\n\tFLOW_ENTRY, //\r\n\tFLOW_MAPPING_END, //\r\n\tFLOW_MAPPING_START, //\r\n\tFLOW_SEQUENCE_END, //\r\n\tFLOW_SEQUENCE_START, //\r\n\tKEY, //\r\n...
import java.io.IOException; import java.io.Reader; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import static com.esotericsoftware.yamlbeans.tokenizer.TokenType.*; import com.esotericsoftware.yamlbeans.Version; import com.esotericsoftware.yamlbeans.tokenizer.AliasT...
/* * Copyright (c) 2008 Nathan Sweet, Copyright (c) 2006 Ola Bini * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, cop...
public Event getNextEvent () throws ParserException, TokenizerException {
8
c-rack/cbor-java
src/test/java/co/nstant/in/cbor/decoder/CborDecoderTest.java
[ "public class CborBuilder extends AbstractBuilder<CborBuilder> {\n\n private final LinkedList<DataItem> dataItems = new LinkedList<>();\n\n public CborBuilder() {\n super(null);\n }\n\n public CborBuilder reset() {\n dataItems.clear();\n return this;\n }\n\n public List<DataIt...
import static org.hamcrest.core.StringContains.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import java.io.ByteArrayInputStream; import j...
}); cborDecoder.decodeNext(); } @Test public void shouldSetAutoDecodeInfinitiveMaps() { InputStream inputStream = new ByteArrayInputStream(new byte[] { 0, 1, 2 }); CborDecoder cborDecoder = new CborDecoder(inputStream); assertTrue(cborDecoder.isAutoDecodeInfinitiveM...
encodeTypeAndLength(MajorType.UNICODE_STRING, length.longValue());
5
632team/EasyHousing
src/com/easyhousing/controller/adminBuildingController.java
[ "public interface BuildingDealDao {\n\t\n\tpublic void insertBuildingDeal(BuildingDeal u);\n\tpublic int deleteBuildingDeal(BuildingDeal u);\n\tpublic int updateBuildingDeal(BuildingDeal u);\n\tpublic BuildingDeal selectBuildingDeal(BuildingDeal u);\n\tpublic List<BuildingDeal> selectAllByUserId(int id);\n\tpublic ...
import java.io.IOException; import java.util.Date; import java.util.List; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.format.annotation.DateTimeFormat; imp...
package com.easyhousing.controller; /** * 楼盘信息的增删改查,楼盘成交记录的增删改查 */ @Controller public class adminBuildingController { @Autowired
private BuildingInfoDao buildingInfoDao;
1
Epic-Breakfast-Productions/OWAT
implementations/java/OWAT-lib/src/main/java/com/ebp/owat/lib/datastructure/matrix/linked/utils/nodePosition/NodePosition.java
[ "public class LinkedScramblingMatrix<T> extends ScrambleMatrix<T> {\n\t/**\n\t * The frequency of how often reference nodes are added.\n\t */\n\tprivate static final long ADD_REFERENCE_FREQUENCY = 100;\n\n\n\tprivate long curAddCount = 0;\n\n\t/** The number of elements held in the matrix. */\n\tprotected long numE...
import com.ebp.owat.lib.datastructure.matrix.linked.LinkedScramblingMatrix; import com.ebp.owat.lib.datastructure.matrix.linked.utils.Direction; import com.ebp.owat.lib.datastructure.matrix.linked.utils.LinkedMatrixNode; import com.ebp.owat.lib.datastructure.matrix.utils.coordinate.Coordinate; import com.ebp.owat.lib.d...
package com.ebp.owat.lib.datastructure.matrix.linked.utils.nodePosition; /** * Describes the position of a node on the matrix * * @param <T> The type of value the nodes hold. */ public class NodePosition<T> extends MatrixCoordinate { protected LinkedMatrixNode<T> node = null;
private NodePosition(LinkedScramblingMatrix<T> matrix, Coordinate coord) {
3
SynBioDex/SBOLDesigner
src/main/java/edu/utah/ece/async/sboldesigner/sbol/editor/dialog/PartEditDialog.java
[ "public class CharSequenceUtil {\r\n\tprivate CharSequenceUtil() {}\r\n\t\r\n\tpublic static CharSequence shorten(final CharSequence seq, final int maxLength) {\r\n\t\tint length = seq.length();\r\n\t\tif (length < maxLength) {\r\n\t\t\treturn seq;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tint endLength = maxLength / 3;\r\n\...
import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; import java.awt.Cursor; import java.awt.Desktop; import java.awt.Dimension; import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.M...
dialog.name.setEnabled(false); dialog.displayId.setEnabled(false); dialog.roleRefinement.setEnabled(false); dialog.roleSelection.setEnabled(false); dialog.typeSelection.setEnabled(false); } dialog.updateParents = updateParents; dialog.setVisible(true); return dialog.CD; } catc...
FormBuilder builder = new FormBuilder();
6
aponom84/MetrizedSmallWorld
src/main/java/org/latna/msw/evaluation/StabilityTest.java
[ "public abstract class MetricElement {\n private final List<MetricElement> friends;\n\n public MetricElement() {\n friends = Collections.synchronizedList(new ArrayList());\n }\n \n /**\n * Calculate metric between current object and another.\n * @param gme any element for whose metric ...
import org.latna.msw.MetricElement; import org.latna.msw.SearchResult; import org.latna.msw.TestLib; import org.latna.msw.EvaluatedElement; import org.latna.msw.MetrizedSmallWorld; import org.latna.msw.AbstractMetricStructure; import org.latna.msw.TestResult; import org.latna.msw.euclidian.EuclidianFactory; import java...
package org.latna.msw.evaluation; /** * * @author Alexander Ponomarenko aponom84@gmail.com */ public class StabilityTest { public static final int NUMBER_OF_THREADS = 48; public static void main(String[] args) throws IOException { int numberOfGlobalTrials = 10; //how many times we build data grap...
MetricElement toRemove = TestLib.getRandomElement(db.getElements());
2
andysan/jotify
src/de/felixbruns/jotify/api/media/parser/XMLMediaParser.java
[ "public class Album extends Media {\n\t/**\n\t * Name of this album.\n\t */\n\tprivate String name;\n\t\n\t/**\n\t * Artist of this album.\n\t */\n\tprivate Artist artist;\n\t\n\t/**\n\t * The identifier for this albums cover image (32-character string).\n\t */\n\tprivate String cover;\n\t\n\t/**\n\t * The type of ...
import java.io.ByteArrayInputStream; import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.stream.XMLStreamConstants; import javax.xml.stream.XMLStreamException; import de.felixbruns.jotify.api.media.Album...
package de.felixbruns.jotify.api.media.parser; public class XMLMediaParser extends XMLParser implements XMLStreamConstants { private static final int SUPPORTED_RESULT_VERSION = 1; private static final int SUPPORTED_ARTIST_VERSION = 1; private static final int SUPPORTED_ALBUM_VERSION = 1; /** * Create a new...
private List<Biography> parseBios() throws XMLStreamException, XMLParserException {
2
TheCount/jhilbert
src/main/java/jhilbert/expressions/impl/ExpressionFactory.java
[ "public interface Functor extends Term {\n\n\t/**\n\t * Returns an unmodifiable {@link List} of input {@link Kind}s.\n\t *\n\t * @return unmodifiable list of input kinds.\n\t */\n\tpublic List<? extends Kind> getInputKinds();\n\n\t/**\n\t * Returns the definition depth of this <code>Functor</code>.\n\t * This funct...
import jhilbert.data.Module; import jhilbert.data.Variable; import jhilbert.expressions.Expression; import jhilbert.expressions.ExpressionException; import jhilbert.scanners.TokenFeed; import java.util.List; import java.util.Map; import java.util.Set; import jhilbert.data.Functor; import jhilbert.data.Kind;
/* JHilbert, a verifier for collaborative theorem proving Copyright © 2008, 2009, 2011 The JHilbert Authors See the AUTHORS file for the list of JHilbert authors. See the commit logs ("git log") for a list of individual contributions. This program is free software: you can redistribute it and/...
public @Override ExpressionImpl createExpression(final Functor functor, final List<Expression> children) {
0
encircled/Joiner
joiner-core/src/test/java/cz/encircled/joiner/core/resolver/AliasResolverUnitTest.java
[ "@ExtendWith(SpringExtension.class)\n@SpringJUnitConfig(classes = {TestConfig.class})\n@ContextConfiguration(classes = {TestConfig.class})\n@Transactional\n@EnableTransactionManagement\n@TestExecutionListeners(listeners = {TestDataListener.class, DependencyInjectionTestExecutionListener.class, TransactionalTestExec...
import cz.encircled.joiner.core.AbstractTest; import cz.encircled.joiner.core.AliasResolver; import cz.encircled.joiner.core.DefaultAliasResolver; import cz.encircled.joiner.exception.JoinerException; import cz.encircled.joiner.model.QAddress; import cz.encircled.joiner.model.QContact; import cz.encircled.joiner.model....
package cz.encircled.joiner.core.resolver; /** * @author Vlad on 06-Sep-16. */ public class AliasResolverUnitTest extends AbstractTest { @Test public void testCollectionAssociationFoundOnParent() { AliasResolver resolver = new DefaultAliasResolver(entityManager); JoinDescription left = J.l...
assertThrows(JoinerException.class, () -> resolver.resolveJoinAlias(J.left(QPassword.password), QGroup.group));
3
Jardo-51/user_module
core/src/main/java/com/jardoapps/usermodule/UserManager.java
[ "public class PasswordResetToken {\r\n\r\n\tprivate final int userId;\r\n\tprivate final Date creationTime;\r\n\tprivate final String key;\r\n\r\n\tpublic Date getCreationTime() {\r\n\t\treturn creationTime;\r\n\t}\r\n\r\n\tpublic String getKey() {\r\n\t\treturn key;\r\n\t}\r\n\r\n\tpublic int getUserId() {\r\n\t\t...
import org.slf4j.LoggerFactory; import com.jardoapps.usermodule.containers.PasswordResetToken; import com.jardoapps.usermodule.containers.SocialAccountDetails; import com.jardoapps.usermodule.containers.UserPassword; import com.jardoapps.usermodule.defines.EmailType; import com.jardoapps.usermodule.utils.EmailUtil...
* User) */ public ResultCode registerUserManually(String email, String name, int rank) { ResultCode checkResult = checkRegistrationPreconditions(email, name); if (checkResult != ResultCode.OK) { return checkResult; } String controlCode = generateRandomMD5Hash(); UserPassword userPas...
public boolean sendTestingEmail(EmailType emailType, String address) {
3
MarchMachao/ZHFS-WEB
src/main/java/com/smates/dbc2/controller/TagInfoController.java
[ "public class TagInformation {\r\n\tprivate String tagNum;\r\n\tprivate String name;\r\n\tprivate Integer age;\r\n\tprivate String sex;\r\n\tprivate String maritalStatus;\r\n\tprivate String useFull;\r\n\tprivate String image;\r\n\tprivate String health;\r\n\r\n\tpublic TagInformation() {\r\n\t}\r\n\r\n\tpublic Tag...
import java.util.List; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springfram...
package com.smates.dbc2.controller; /** * @author 刘晓庆 */ @Controller public class TagInfoController { private Logger logger = Logger.getLogger(TagInfoController.class); @Autowired private TagInforService tagInforService; @Autowired private QniuHelper qniuHelper; @ResponseBody @RequestM...
public BaseMsg addTagInfoByTagNum(MultipartFile image, String tagNum, String name, Integer age, String sex,
5
horrorho/LiquidDonkey
src/main/java/com/github/horrorho/liquiddonkey/cloud/client/SnapshotClient.java
[ "static String path(String... parts) {\n return Arrays.asList(parts).stream().collect(Collectors.joining(\"/\"));\n}", "public final class ICloud {\n private ICloud() {}\n public static void registerAllExtensions(\n com.google.protobuf.ExtensionRegistry registry) {\n }\n public interface MBSAccountOrB...
import static com.github.horrorho.liquiddonkey.cloud.client.Util.path; import com.github.horrorho.liquiddonkey.cloud.protobuf.ICloud; import com.github.horrorho.liquiddonkey.cloud.protobuf.ProtoBufArray; import com.github.horrorho.liquiddonkey.http.ResponseHandlerFactory; import com.github.horrorho.liquiddonkey.setting...
/* * The MIT License * * Copyright 2015 Ahseya. * * Permission is hereby granted, free from charge, to any person obtaining a copy * from this software and associated documentation list (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modif...
= ResponseHandlerFactory.of(inputStream -> ProtoBufArray.decode(inputStream, ICloud.MBSFile.PARSER));
3
rgladwell/m2e-android
me.gladwell.eclipse.m2e.android/src/main/java/me/gladwell/eclipse/m2e/android/PluginModule.java
[ "public class ConfigurationModule extends AbstractModule {\n\n @Override\n protected void configure() {\n bind(File.class).toInstance(AndroidMavenPlugin.getDefault().getStateLocation().toFile());\n\n bind(ClasspathLoader.class).to(ObjectSerializationClasspathPersister.class);\n bind(Class...
import me.gladwell.eclipse.m2e.android.configuration.ConfigurationModule; import me.gladwell.eclipse.m2e.android.configuration.classpath.ClasspathModule; import me.gladwell.eclipse.m2e.android.configuration.workspace.WorkspaceModule; import me.gladwell.eclipse.m2e.android.project.ProjectModule; import me.gladwell.eclip...
/******************************************************************************* * Copyright (c) 2012, 2013, 2014, 2015 Ricardo Gladwell, Csaba Kozák * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this di...
install(new ResolutionModule());
4
taoneill/war
war/src/main/java/com/tommytony/war/command/JoinCommand.java
[ "public class Team {\n\tprivate final Warzone warzone;\n\tRandom teamSpawnRandomizer = new Random();\n\tprivate List<Player> players = new ArrayList<Player>();\n\tprivate List<Player> teamChatPlayers = new ArrayList<Player>();\n\tprivate List<Location> teamSpawns;\n\tprivate Location teamFlag = null;\n\tprivate Str...
import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import com.tommytony.war.Team; import com.tommytony.war.War; import com.tommytony.war.Warzone; import com.tommytony.war.config.TeamKind; import com.tommytony.war.config.WarzoneConfig; import com.tommytony.war.structure.ZoneLobby;
package com.tommytony.war.command; /** * Joins a team. * * @author Tim Düsterhus */ public class JoinCommand extends AbstractWarCommand { public JoinCommand(WarCommandHandler handler, CommandSender sender, String[] args) { super(handler, sender, args); } @Override public boolean handle() { if (!(this.ge...
if (zone.getWarzoneConfig().getBoolean(WarzoneConfig.DISABLED)) {
4
apache/incubator-taverna-mobile
app/src/main/java/org/apache/taverna/mobile/ui/tutorial/TutorialActivity.java
[ "@Singleton\npublic class PreferencesHelper {\n\n public static final String PREF_KEY_PLAYER_LOGGED_IN = \"pref_player_logged_in\";\n\n public static final String PREF_KEY_PLAYER_URL = \"pref_key_player_url\";\n\n private static final String PREF_KEY_USER_ID = \"pref_user_id\";\n\n private static final ...
import org.apache.taverna.mobile.R; import org.apache.taverna.mobile.data.local.PreferencesHelper; import org.apache.taverna.mobile.data.model.TutorialSliderEnum; import org.apache.taverna.mobile.ui.adapter.TutorialSliderAdapter; import org.apache.taverna.mobile.ui.base.BaseActivity; import org.apache.taverna.mobile.ui...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
PreferencesHelper preferencesHelper;
0
Freelander/ting
app/src/main/java/com/music/ting/ui/activity/UserProfileActivity.java
[ "public class GsonRequest<T> extends Request<T> {\n private static final String TAG = \"Ting\";\n\n private Gson GSON = new Gson();\n\n private final Class<T> mClazz;\n private Type type ;\n\n private Listener mListener;\n private Map<String, String> mHeader;\n\n public GsonRequest(int method,...
import android.annotation.TargetApi; import android.content.Intent; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.support.v4.view.ViewPager; import android.support.v7.widget...
package com.music.ting.ui.activity; /** * Created by Jun on 2015/6/20. */ public class UserProfileActivity extends SwipeBackActivity { @InjectView(R.id.toolbar) Toolbar toolbar; @InjectView(R.id.user_image) RoundImageView userImage; @InjectView(R.id.user_name) TextView us...
fragments.add(new UserCommentsFragment(mUserInfo.getUser().getId()));
6
ResearchStack/ResearchStack
skin/src/main/java/org/researchstack/skin/ui/layout/SignUpPinCodeCreationStepLayout.java
[ "public class StepResult<T> extends Result {\n /**\n * When StepResult only has a single value, pair that value with the following key\n */\n public static final String DEFAULT_KEY = \"answer\";\n\n private Map<String, T> results;\n\n private AnswerFormat answerFormat;\n\n /**\n * Creates...
import android.content.Context; import android.content.res.Resources; import android.os.Handler; import android.support.v4.content.ContextCompat; import android.util.AttributeSet; import android.view.View; import android.view.inputmethod.InputMethodManager; import com.jakewharton.rxbinding.widget.RxTextView; import org...
package org.researchstack.skin.ui.layout; public class SignUpPinCodeCreationStepLayout extends PinCodeLayout implements StepLayout { public static final String RESULT_OLD_PIN = "PassCodeCreationStep.oldPin"; protected StepCallbacks callbacks; protected PassCodeCreationStep step; protected StepResul...
summaryColor = ThemeUtils.getTextColorPrimary(getContext());
4
DaiDongLiang/DSC
src/main/java/net/floodlightcontroller/linkdiscovery/internal/LinkDiscoveryManager.java
[ "public class FloodlightContext {\n\t//一个线程安全的HashMap仓库\n protected ConcurrentHashMap<String, Object> storage =\n new ConcurrentHashMap<String, Object>();\n\n public ConcurrentHashMap<String, Object> getStorage() {\n return storage;\n }\n}", "public interface IShutdownService extends IF...
import java.net.NetworkInterface; import java.net.SocketException; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; import j...
/** * Copyright 2011, Big Switch Networks, Inc. * Originally created by David Erickson, Stanford University * * 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 * * ...
IOFSwitch iofSwitch = switchService.getSwitch(sw);
2
coding4people/mosquito-report-api
src/test/java/com/coding4people/mosquitoreport/api/controllers/PostFocusControllerTest.java
[ "abstract public class WithServer extends JerseyTest implements BaseTest {\r\n @Override\r\n protected ResourceConfig configure() {\r\n MockitoAnnotations.initMocks(this);\r\n\r\n return new Config().configureFramework().register(new MockBinder(this));\r\n }\r\n}\r", "public static class F...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.mockito.Matchers.any; import static org.mockito.Mockito.verify; import javax.ws.rs.client.Entity; import javax.ws.rs.core.Response; import org.glassfish.jersey.server.ResourceConfig; import org.junit.Test...
package com.coding4people.mosquitoreport.api.controllers; public class PostFocusControllerTest extends WithServer { @Mock private FocusRepository focusRepository; @Mock
private FocusIndexer focusIndexer;
2
santanusinha/dropwizard-db-sharding-bundle
src/test/java/io/appform/dropwizard/sharding/dao/LookupDaoTest.java
[ "@Entity\n@Table(name=\"audits\")\n@Data\n@NoArgsConstructor\n@AllArgsConstructor\n@ToString\n@Builder\npublic class Audit {\n @Id\n @GeneratedValue(strategy = GenerationType.IDENTITY)\n @Column(name = \"id\")\n private long id;\n\n @Column(name = \"text\")\n private String text;\n\n @ManyToOne...
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Lists; import io.appform.dropwizard.sharding.dao.testdata.entities.Audit; import io.appform.dropwizard.sharding.dao.testdata.entities.Phone; import io.appform.dropwizard.sharding.dao.testdata....
/* * Copyright 2016 Santanu Sinha <santanu.sinha@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 appl...
final ShardManager shardManager = new BalancedShardManager(sessionFactories.size());
4
iloveeclipse/anyedittools
AnyEditTools/src/de/loskutov/anyedit/actions/internal/StartupHelper2.java
[ "public class AnyEditToolsPlugin extends AbstractUIPlugin {\n\n private static AnyEditToolsPlugin plugin;\n\n private static boolean isSaveHookInitialized;\n\n /**\n * The constructor.\n */\n public AnyEditToolsPlugin() {\n super();\n if(plugin != null) {\n throw new Ill...
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import org.eclipse.core.commands.Command; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.commands.IExecutionListener; import org.eclipse.core.commands.NotHa...
/******************************************************************************* * Copyright (c) 2011 Andrey Loskutov. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at...
final Spaces spacesAction;
2
oskopek/StudyGuide
src/test/java/com/oskopek/studyguide/persistence/JsonDataReaderWriterTest.java
[ "public abstract class CourseEnrollmentConstraint extends DefaultConstraint {\n\n private CourseEnrollment courseEnrollment;\n\n /**\n * Private default constructor, needed by CDI.\n */\n protected CourseEnrollmentConstraint() {\n // needed for CDI\n }\n\n /**\n * Default construct...
import com.google.common.eventbus.EventBus; import com.oskopek.studyguide.constraint.CourseEnrollmentConstraint; import com.oskopek.studyguide.constraint.GlobalConstraint; import com.oskopek.studyguide.model.DefaultStudyPlan; import com.oskopek.studyguide.model.StudyPlan; import com.oskopek.studyguide.model.courses.Cou...
package com.oskopek.studyguide.persistence; /** * Probably deserves more thorough testing. */ public class JsonDataReaderWriterTest { private JsonDataReaderWriter jsonDataReaderWriter; private Path jsonPath; private StudyPlan plan; private EventBus mockedEventBus; @Before public void setU...
constraint.fireBrokenEvent("", (Course) null);
4
CROW-NDOV/displaydirect
distribution/src/main/java/nl/crowndov/displaydirect/distribution/messages/DisplayDirectMessageFactory.java
[ "public final class DisplayDirectMessage {\n private DisplayDirectMessage() {}\n public static void registerAllExtensions(\n com.google.protobuf.ExtensionRegistryLite registry) {\n }\n\n public static void registerAllExtensions(\n com.google.protobuf.ExtensionRegistry registry) {\n registerAllExten...
import nl.crowndov.displaydirect.common.messages.DisplayDirectMessage; import nl.crowndov.displaydirect.common.stats.domain.LogMessage; import nl.crowndov.displaydirect.common.stats.domain.Metric; import nl.crowndov.displaydirect.distribution.Configuration; import nl.crowndov.displaydirect.distribution.domain.client.Su...
} } b = b.addDestination(dest.build()); } if (config.getStopCode() != Subscription.FieldDelivery.NEVER) { if (message.getStopCode() != null) { b = b.addStopCode(message.getStopCode()); } else...
public static byte[] toMonitoringLogs(List<LogMessage> input) {
1
vgoldin/cqrs-eventsourcing-kafka
services-infrastructure-eventstore/src/main/java/io/plumery/eventstore/EventStoreAwareRepository.java
[ "public abstract class AggregateRoot {\n private static final Logger logger = LoggerFactory.getLogger(AggregateRoot.class);\n\n private static final String APPLY_METHOD_NAME = \"apply\";\n private final List<Event> changes = new ArrayList<>();\n\n public ID id;\n public int version;\n\n protected ...
import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; import io.plumery.core.AggregateRoot; import io.plumery.core.Event; import io.plumery.core.ID; import io.plumery.core.infrastructure.EventStore; import io.plumery.core.infrastructure.Repository; import io.plumery.eventstore.excepti...
package io.plumery.eventstore; /** * Generic Event Store aware Repository implementation */ public abstract class EventStoreAwareRepository<T extends AggregateRoot> implements Repository<T> { protected EventStore store; @Override public void save(T aggregate, int version) { Preconditions.check...
Iterable<? extends Event> events = store.getEventsForAggregate(aggregate.getClass(), id.toString());
1
ThreeTen/threetenbp
src/main/java/org/threeten/bp/temporal/TemporalQueries.java
[ "public final class LocalDate\n extends ChronoLocalDate\n implements Temporal, TemporalAdjuster, Serializable {\n\n /**\n * The minimum supported {@code LocalDate}, '-999999999-01-01'.\n * This could be used by an application as a \"far past\" date.\n */\n public static final LocalDa...
import static org.threeten.bp.temporal.ChronoField.EPOCH_DAY; import static org.threeten.bp.temporal.ChronoField.NANO_OF_DAY; import static org.threeten.bp.temporal.ChronoField.OFFSET_SECONDS; import org.threeten.bp.LocalDate; import org.threeten.bp.LocalTime; import org.threeten.bp.OffsetDateTime; import org.threeten....
/* * Copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the abov...
public static final TemporalQuery<LocalDate> localDate() {
0
reines/game
game-server/src/main/java/com/game/server/handlers/item/EquipableHandler.java
[ "public class Inventory implements Iterable<Item>, Serializable {\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic static final int MAX_SIZE = 40;\n\n\tprotected List<Item> items;\n\n\tpublic Inventory() {\n\t\titems = new ArrayList<Item>();\n\t}\n\n\tpublic int add(Item item) {\n\t\t// TODO: Handle ...
import com.game.common.model.Inventory; import com.game.common.model.Item; import com.game.server.Server; import com.game.server.WorldManager; import com.game.server.handlers.ItemHandler; import com.game.server.model.Player;
package com.game.server.handlers.item; public class EquipableHandler implements ItemHandler { @Override
public void handleItem(Server server, WorldManager world, Player player, Item item, int index) {
2
oehf/ipf-oht-atna
auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/XDSRegistryAuditor.java
[ "public abstract class IHETransactionEventTypeCodes extends CodedValueType\n{\n\t/**\n\t * Create a new IHE Event Code using a specific code and value\n\t * \n\t * @param value Coded value for IHE event code\n\t * @param meaning Display name for IHE event code\n\t */\n\tprotected IHETransactionEventTypeCodes(String...
import org.openhealthtools.ihe.atna.auditor.codes.ihe.IHETransactionEventTypeCodes; import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes.RFC3881EventOutcomeCodes; import org.openhealthtools.ihe.atna.auditor.context.AuditorModuleContext; import org.openhealthtools.ihe.atna.auditor.events.ihe.Impor...
/******************************************************************************* * Copyright (c) 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is a...
RFC3881EventOutcomeCodes eventOutcome,
1
DiatomStudio/SketchChair
src/cc/sketchchair/ragdoll/ergoDoll.java
[ "public class GLOBAL {\n\n\tpublic static boolean useMaskedUpdating = false;\n\n\tstatic SketchProperties sketchProperties = new SketchProperties();\n\t\n\tpublic static double CAM_OFFSET_X = 300;\n\tpublic static double CAM_OFFSET_Y = -900;\n\tpublic static int windowWidth;\n\tpublic static int windowHeight;\n\tpu...
import java.util.HashMap; import java.util.Map; import cc.sketchchair.core.GLOBAL; import cc.sketchchair.core.LOGGER; import cc.sketchchair.core.SETTINGS; import cc.sketchchair.core.SketchChair; import cc.sketchchair.core.UITools; import cc.sketchchair.functions.functions; import com.bulletphysics.BulletGlobals; import...
//BODYPART_LEFT_UPPER_LEG bodies[BodyPart.BODYPART_LEFT_UPPER_LEG.ordinal()].getMotionState() .getWorldTransform(transform); transform.setIdentity(); transform.set(new Matrix4f(0.29188365f, 0.9564537f, -4.4153258E-4f, 109.79127f, -0.9526396f, 0.29067844f, -0.0893526f, 44.345417f * this.scale, -0.085...
if (GLOBAL.uiTools.getCurrentTool() == UITools.SCALE_TOOL
4
google/Accessibility-Test-Framework-for-Android
src/main/java/com/google/android/apps/common/testing/accessibility/framework/suggestions/TextColorFixSuggestionProducer.java
[ "public interface ResultMetadata {\n\n /**\n * Retrieves a {@code boolean} value stored within metadata. A {@link RuntimeException} is thrown\n * in the case the provided {@code key} is not stored within metadata or is stored as another\n * type.\n *\n * @param key The key of the value to retrieve\n * ...
import com.google.android.apps.common.testing.accessibility.framework.ResultMetadata; import com.google.android.apps.common.testing.accessibility.framework.checks.TextContrastCheck; import com.google.android.apps.common.testing.accessibility.framework.replacements.TextUtils; import com.google.android.apps.common.testin...
package com.google.android.apps.common.testing.accessibility.framework.suggestions; /** * A {@link FixSuggestionProducer} which produces a {@link SetViewAttributeFixSuggestion} to fix a * text low contrast issue. * * <p>If a similar text color which meets the contrast ratio requirement could be found, produces a ...
case TextContrastCheck.RESULT_ID_TEXTVIEW_CONTRAST_NOT_SUFFICIENT:
1
sivaprasadreddy/jcart
jcart-admin/src/main/java/com/sivalabs/jcart/admin/web/controllers/RoleController.java
[ "public class SecurityUtil\n{\n\t\n\tpublic static final String MANAGE_CATEGORIES = \"ROLE_MANAGE_CATEGORIES\";\n\tpublic static final String MANAGE_PRODUCTS = \"ROLE_MANAGE_PRODUCTS\";\n\tpublic static final String MANAGE_ORDERS = \"ROLE_MANAGE_ORDERS\";\n\tpublic static final String MANAGE_CUSTOMERS = \"ROLE_MANA...
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.annotation.Secured; import org.springframework.stereotype.Controller; import org.spr...
/** * */ package com.sivalabs.jcart.admin.web.controllers; /** * @author Siva * */ @Controller @Secured(SecurityUtil.MANAGE_ROLES) public class RoleController extends JCartAdminBaseController { private static final String viewPrefix = "roles/"; @Autowired protected SecurityService securityService; @Auto...
public List<Permission> permissionsList(){
2
groupon/Selenium-Grid-Extras
SeleniumGridExtras/src/main/java/com/groupon/seleniumgridextras/tasks/StartGrid.java
[ "public class BrowserVersionDetector {\n\n// TODO: Dima finish this when you have some free time. Good idea but using classloader is a bad ide\n// TODO: Java is not good with dynamic jar loading in way you want. Instead go with a mini grid with 1\n// TODO: node and do all of the stuff via simple HTTP calls, CURL...
import com.google.gson.JsonObject; import com.groupon.seleniumgridextras.browser.BrowserVersionDetector; import com.groupon.seleniumgridextras.config.GridNode; import com.groupon.seleniumgridextras.config.RuntimeConfig; import com.groupon.seleniumgridextras.config.capabilities.Capability; import com.groupon.seleniumgri...
/** * Copyright (c) 2013, Groupon, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditi...
return execute(RuntimeConfig.getConfig().getDefaultRole());
2
srcdeps/srcdeps-core
srcdeps-core/src/main/java/org/srcdeps/core/impl/scm/DefaultScmService.java
[ "public class BuildRequest {\n /**\n *\n * A builder for {@link BuildRequest}s.\n *\n */\n public static class BuildRequestBuilder {\n\n private boolean addDefaultBuildArguments = true;\n private boolean addDefaultBuildEnvironment = true;\n private List<String> buildArgume...
import java.nio.file.Path; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.srcdeps.core.BuildRequest; import org.srcdeps.core.Scm; import org.srcdeps.core.ScmException; import org.srcdeps.core...
/** * Copyright 2015-2019 Maven Source Dependencies * Plugin contributors as indicated by the @author tags. * * 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...
public String checkout(BuildRequest request) throws ScmException {
0
damianbrunold/jbead
src/ch/jbead/view/BasePanel.java
[ "public interface ModelListener {\n\n public void pointChanged(Point pt);\n public void modelChanged();\n public void colorChanged(byte colorIndex);\n public void colorsChanged();\n public void scrollChanged(int scroll);\n public void shiftChanged(int shift);\n public void zoomChanged(int gridx...
import javax.swing.JComponent; import ch.jbead.Model; import ch.jbead.ModelListener; import ch.jbead.Point; import ch.jbead.Selection; import ch.jbead.View; import ch.jbead.ViewListener;
/** jbead - http://www.jbead.ch Copyright (C) 2001-2012 Damian Brunold 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 la...
public abstract void redraw(Point pt);
1
micdoodle8/Crossbow_Mod_2
src/main/java/micdoodle8/mods/crossbowmod/item/ItemGoldCrossbow.java
[ "@Mod(modid = \"CrossbowMod2\", name = \"Crossbow Mod 2 1.6\", version = \"a0.1.6\")\npublic class CrossbowModCore\n{\n @SidedProxy(clientSide = \"micdoodle8.mods.crossbowmod.client.ClientProxy\", serverSide = \"micdoodle8.mods.crossbowmod.CommonProxy\")\n public static CommonProxy proxy;\n @Instance\n ...
import java.util.List; import micdoodle8.mods.crossbowmod.CrossbowModCore; import micdoodle8.mods.crossbowmod.entity.EntityBolt; import micdoodle8.mods.crossbowmod.entity.EntityGoldBolt; import micdoodle8.mods.crossbowmod.entity.EntityIronBolt; import micdoodle8.mods.crossbowmod.entity.EntityStoneBolt; import micdoodle...
package micdoodle8.mods.crossbowmod.item; public class ItemGoldCrossbow extends ItemCrossbow { public ItemGoldCrossbow() { super(); CrossbowModCore.goldCrossbowsList.add(this); } @Override public EntityBolt getEntity(World world, EntityLivingBase entityliving, float f) { ...
return new EntityStoneBolt(world, entityliving, 1.66F, f);
4
e-gov/AJ
filter/src/test/java/ee/ria/dumonitor/filter/processor/MessageProcessorTest.java
[ "public final class IOUtil {\n\n public static final Charset UTF_8 = Charset.forName(\"UTF-8\");\n\n private static final Logger LOG = LoggerFactory.getLogger(IOUtil.class);\n\n private static final int BUFFER_SIZE = 4096;\n\n private IOUtil() {\n throw new UnsupportedOperationException();\n }\n\n /**\n ...
import org.mockito.ArgumentMatcher; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import java.util.Date; import static ee.ria.dumonitor.common.util.ObjectUtil.eq; import static org.mockito.Matchers.argThat; import static org.mockito.Mockito.verify; import static...
/* * MIT License * Copyright (c) 2016 Estonian Information System Authority (RIA) * * 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...
LogEntry logEntry = getLogEntry("47101010033");
2
cyriux/mpcmaid
MpcMaid/src/com/mpcmaid/gui/WidgetPanel.java
[ "public interface Element {\n\n\tParameter[] getParameters();\n\n\tObject get(Parameter parameter);\n\n\tvoid set(Parameter parameter, Object value);\n\n}", "public class Parameter {\n\n\tpublic static interface Type {\n\n\t\tObject get(BaseElement element, Parameter parameter);\n\n\t\tvoid set(BaseElement elemen...
import java.awt.Component; import java.awt.GridLayout; import javax.swing.JLabel; import javax.swing.JPanel; import com.mpcmaid.pgm.Element; import com.mpcmaid.pgm.Parameter; import com.mpcmaid.pgm.Range; import com.mpcmaid.pgm.Parameter.TuningType; import com.mpcmaid.pgm.Parameter.EnumType; import com.mpcmaid.pgm.Para...
package com.mpcmaid.gui; /** * @pattern Composite target=BindingCapable * @pattern Composite target=JComponent * * @author cyrille martraire */ public class WidgetPanel extends JPanel implements BindingCapable { private final Element element; public WidgetPanel(Element element) { this.element = element;...
} else if (parameter.getType() instanceof TextType) {
6
vert-x3/vertx-jdbc-client
src/main/java/io/vertx/ext/jdbc/impl/JDBCClientImpl.java
[ "@VertxGen\npublic interface JDBCClient extends SQLClient {\n\n /**\n * The default data source provider is C3P0\n */\n String DEFAULT_PROVIDER_CLASS = \"io.vertx.ext.jdbc.spi.impl.C3P0DataSourceProvider\";\n\n /**\n * The name of the default data source\n */\n String DEFAULT_DS_NAME = \"DEFAULT_DS\";\...
import io.vertx.core.*; import io.vertx.core.impl.ContextInternal; import io.vertx.core.impl.VertxInternal; import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; import io.vertx.core.spi.metrics.PoolMetrics; import io.vertx.core.spi.metrics.VertxMetrics; import io.vertx.ext.jdbc.JDBCClient; import ...
executeDirect(new JDBCUpdate(helper, null, sql, null), resultHandler); return this; } @Override public JDBCClient updateWithParams(String sql, JsonArray in, Handler<AsyncResult<UpdateResult>> resultHandler) { executeDirect(new JDBCUpdate(helper, null, sql, in), resultHandler); return this; } ...
public SQLClient getConnection(Handler<AsyncResult<SQLConnection>> handler) {
7
hai-nguyen/Impala
impala/src/main/java/hainguyen/impala/feature/login/presenter/LoginPresenterImpl.java
[ "public class ApplicationBus {\n\n private boolean login;\n\n public boolean isLogin() {\n return login;\n }\n\n public void setLogin(boolean login) {\n this.login = login;\n }\n}", "public class ImpalaScheduler {\n public interface SchedulerProvider {\n Scheduler mainThread...
import android.content.ContentResolver; import java.util.List; import javax.inject.Inject; import hainguyen.impala.application.ApplicationBus; import hainguyen.impala.application.scheduler.ImpalaScheduler; import hainguyen.impala.appsenum.Enums; import hainguyen.impala.data.UserProfile; import hainguyen.impala.feature....
package hainguyen.impala.feature.login.presenter; public class LoginPresenterImpl implements LoginPresenter { private LoginView loginView; UserProfile userProfile; ContactUtil contactUtil; ApplicationBus bus; CompositeSubscription loginSubscriptions;
ScopeHelper scopeHelper;
5
tobyweston/tempus-fugit
src/test/java/com/google/code/tempusfugit/temporal/TimerTest.java
[ "public class ClassInvariantViolation extends RuntimeException {\n\n public ClassInvariantViolation() {\n super();\n }\n\n public ClassInvariantViolation(String message) {\n super(message);\n }\n\n public ClassInvariantViolation(String message, Throwable cause) {\n super(message,...
import static org.hamcrest.core.IsEqual.equalTo; import static org.hamcrest.number.OrderingComparison.greaterThan; import com.google.code.tempusfugit.ClassInvariantViolation; import com.google.code.tempusfugit.concurrency.ThreadUtils; import org.junit.Test; import java.util.function.Function; import java.util.function....
/* * Copyright (c) 2009-2018, toby weston & tempus-fugit committers * * 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...
assertThat(timer.elapsedTime(), is(millis(0)));
3
AppleDash/SaneEconomy
SaneEconomyCore/src/main/java/org/appledash/saneeconomy/listeners/JoinQuitListener.java
[ "public class SaneEconomy extends SanePlugin implements ISaneEconomy {\n private static SaneEconomy instance;\n private EconomyManager economyManager;\n private VaultHook vaultHook;\n private TransactionLogger transactionLogger;\n private GithubVersionChecker versionChecker;\n\n private final Map<...
import org.appledash.saneeconomy.SaneEconomy; import org.appledash.saneeconomy.economy.backend.EconomyStorageBackend; import org.appledash.saneeconomy.economy.economable.Economable; import org.appledash.saneeconomy.economy.transaction.Transaction; import org.appledash.saneeconomy.economy.transaction.TransactionReason; ...
package org.appledash.saneeconomy.listeners; /** * Created by AppleDash on 6/13/2016. * Blackjack is still best pony. */ public class JoinQuitListener implements Listener { private final SaneEconomy plugin; public JoinQuitListener(SaneEconomy plugin) { this.plugin = plugin; } @EventHandl...
this.plugin.getMessenger().sendMessage(player, "An update is available! The currently-installed version is {1}, but the newest available is {2}. Please go to {3} to update!", this.plugin.getDescription().getVersion(), this.plugin.getVersionChecker().getNewestVersion(), GithubVersionChecker.DOWNLOAD_URL);
5
hecoding/Pac-Man
src/jeco/core/algorithm/moga/SPEA2.java
[ "public abstract class Algorithm<V extends Variable<?>> extends AlgObservable {\n\n protected Problem<V> problem = null;\n // Attribute to stop execution of the algorithm.\n protected boolean stop = false;\n \n /**\n * Allows to stop execution after finishing the current generation; must be\n * taken into ...
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import jeco.core.algorithm.Algorithm; import jeco.core.operator.comparator.ArrayDominance; import jeco.core.operator.comparator.PropertyComparator; import jeco.core.operator.comparator.SolutionDominance; imp...
package jeco.core.algorithm.moga; /** * * * Input parameters: * - MAX_GENERATIONS * - MAX_POPULATION_SIZE * * Operators: * - CROSSOVER: Crossover operator * - MUTATION: Mutation operator * - SELECTION: Selection operator * * @author José L. Risco-Martín * */ public class SPEA2<T extends Variable<?>...
public SPEA2(Problem<T> problem, int maxPopulationSize, int maxGenerations, MutationOperator<T> mutationOperator, CrossoverOperator<T> crossoverOperator, SelectionOperator<T> selectionOperator) {
3
mengdd/TodoRealm
app/src/main/java/com/ddmeng/todorealm/home/HomeListFragment.java
[ "public class MainActivity extends AppCompatActivity {\n\n private TodoRepository todoRepository;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n showHomeList();\n\n todoReposi...
import android.content.DialogInterface; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; import android.support.v7.vie...
package com.ddmeng.todorealm.home; public class HomeListFragment extends Fragment implements HomeListContract.View, HomeListAdapter.HomeListCallback { public static final String TAG = "HomeListFragment"; @BindView(R.id.toolbar) Toolbar toolbar; @BindView(R.id.home_list) RecyclerView homeList;...
DividerDecoration dividerDecoration = new DividerDecoration(dividerDrawable, homeListAdapter);
4
didi/VirtualAPK
CoreLibrary/src/main/java/com/didi/virtualapk/internal/ResourcesManager.java
[ "public class Resources {\n \n public Resources(AssetManager assets, DisplayMetrics metrics, Configuration config) {\n throw new RuntimeException(\"Stub!\");\n }\n \n public final AssetManager getAssets() {\n throw new RuntimeException(\"Stub!\");\n }\n \n public int getColor(i...
import android.annotation.TargetApi; import android.app.Activity; import android.app.ActivityThread; import android.app.LoadedApk; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.res.AssetManager; import android.content.res.Configuration; import android.content.res.Reso...
/* * Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd. 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/license...
Reflector reflector = Reflector.on(AssetManager.class).method("addAssetPath", String.class);
4
opensciencemap/vtm-app
src/org/oscim/app/RouteSearch.java
[ "public class GeocoderNominatim {\n\n\tfinal static Logger log = LoggerFactory.getLogger(GeocoderNominatim.class);\n\n\tpublic static final String NOMINATIM_SERVICE_URL = \"http://nominatim.openstreetmap.org/\";\n\tpublic static final String MAPQUEST_SERVICE_URL = \"http://open.mapquestapi.com/nominatim/v1/\";\n\n\...
import java.io.IOException; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; import org.oscim.android.canvas.AndroidGraphics; import org.oscim.core.GeoPoint; import org.oscim.layers.PathLayer; import org.oscim.layers.marker.MarkerItem.HotspotPlace; import org.oscim.layers.marker.Marker...
/* * Copyright 2012 osmdroid: M.Kergall * Copyright 2012 Hannes Janetzek * * This program is free software: you can redistribute it and/or modify it under the * terms of the GNU Lesser General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any l...
private final ItemizedOverlayWithBubble<ExtendedMarkerItem> mItineraryMarkers;
3
mauriciogracia/DGuitarSoftware
DGuitar/src/dguitar/codecs/guitarPro/version4/GP4InputStream.java
[ "public class GPBeat {\n /**\n * Whether this beat is empty.\n */\n private boolean _emptyBeat;\n\n /**\n * Whether this beat is a rest.\n */\n private boolean _restBeat;\n\n /**\n * This beat's duration.\n * @see GPDuration\n */\n private GPDuration _duration;\n\n /...
import java.io.IOException; import java.io.InputStream; import java.util.List; import dguitar.codecs.guitarPro.GPBeat; import dguitar.codecs.guitarPro.GPBend; import dguitar.codecs.guitarPro.GPBendPoint; import dguitar.codecs.guitarPro.GPBendType; import dguitar.codecs.guitarPro.GPChordDiagram; import dguitar.codecs.gu...
this.skip(3); CD.setRoot(readRoot()); CD.setChordType(readChordType()); CD.setNineElevenThirteen(readUnsignedByte()); CD.setBass(GPChordNote.valueOf(readInt())); CD.setTonalityType(readTonalityType(4)); CD.setAddedNote(readUnsignedByte()); CD.setNam...
private GPBend readBend() throws IOException {
1
AwaisKing/Linked-Words
app/src/main/java/awais/backworddictionary/dialogs/WordDialog.java
[ "public final class DefinitionsAdapter<T> implements ListAdapter {\n private final boolean isExpanded;\n private final List<T> items;\n private final LayoutInflater layoutInflater;\n private final View.OnClickListener onClickListener;\n private final String currentWord;\n private int topMargin = 0...
import android.app.Dialog; import android.app.SearchManager; import android.content.Context; import android.content.Intent; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.view.Window; import androidx.annota...
package awais.backworddictionary.dialogs; public final class WordDialog extends Dialog implements android.view.View.OnClickListener { private static final int ALERT_DIALOG_THEME = R.style.DefinitionsDialogTheme; private static final Exception EMPTY_EXCEPTION = new Exception(); private final String wor...
CustomTabActivityHelper.openCustomTab(context, customTabsIntent.build(),
3
pasqualesalza/elephant56
elephant56/src/main/java/it/unisa/elephant56/core/generator/RandomGenerationsBlockExecutor.java
[ "public class IndividualWrapper<IndividualType extends Individual, FitnessValueType extends FitnessValue>\r\n implements Comparable<IndividualWrapper<IndividualType, FitnessValueType>>, Cloneable {\r\n\r\n private IndividualType individual;\r\n private FitnessValueType fitnessValue;\r\n private Bool...
import it.unisa.elephant56.core.common.IndividualWrapper; import it.unisa.elephant56.core.common.Properties; import it.unisa.elephant56.core.reporter.time.GenerationsBlockTimeReporter; import it.unisa.elephant56.user.common.FitnessValue; import it.unisa.elephant56.user.common.Individual; import it.unisa.elephant56...
package it.unisa.elephant56.core.generator; public class RandomGenerationsBlockExecutor extends GenerationsBlockExecutor { public RandomGenerationsBlockExecutor() { super(); } @Override @SuppressWarnings("unchecked") public void run() throws IOException, NoSuchMet...
Initialisation<Individual, FitnessValue> initalisationClassInstance = null;
4
killbill/killbill-meter-plugin
src/test/java/org/killbill/billing/plugin/meter/timeline/aggregator/TestTimelineAggregator.java
[ "public interface MeterConfig {\n\n @Config(\"org.killbill.billing.plugin.meter.timelines.length\")\n @Description(\"How long to buffer data in memory before flushing it to the database\")\n @Default(\"60m\")\n TimeSpan getTimelineLength();\n\n // This is used to predict the number of samples between...
import java.io.IOException; import java.util.Map; import java.util.Properties; import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.killbill.billing.plugin.meter.MeterConfig; import org.killbill.billing.plugin.meter.MeterTestS...
/* * Copyright 2010-2014 Ning, Inc. * Copyright 2014 The Billing Project, LLC * * Ning 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/lice...
private static final SampleCoder sampleCoder = new DefaultSampleCoder();
2
tsauvine/omr
src/omr/gui/Gui.java
[ "public class CsvSerializer {\n\n public void saveAnswers(Project project, File file) throws IOException {\n \n SheetStructure structure = project.getSheetStructure();\n \n PrintStream fout = null;\n try {\n fout = new PrintStream(new FileOutputStream (file));\n ...
import java.awt.*; import java.io.File; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import javax.swing.*; import omr.CsvSerializer; import omr.Deserializer; import omr.Project; import omr.SendFeedbacksTask; import omr.Serializer; import omr.Task; import omr.gui.calibration.CalibratePane...
} else { return save(this.projectFile); } } /** * Shows a "Save as" dialog, then saves the current project to the chosen file. If the file exists, user is prompted for confirmation. * @return True if file was succesfully saved. False if user cancels or an saving fails....
CsvSerializer serializer = new CsvSerializer();
0
fenli/elf
core/src/main/java/com/fenlisproject/elf/core/base/BaseActivity.java
[ "public class AppEnvironment {\n\n /* Private Directory */\n private final String mPrivateFilesDirectory;\n private final String mPrivateDatabaseDirectory;\n private final String mPrivateImagesDirectory;\n private final String mPrivateCacheDirectory;\n private final String mPrivateTempDirectory;\n...
import android.os.Bundle; import android.os.Handler; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v7.app.AppCompatActivity; import android.view.Menu; import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.w...
@Override public boolean onTouch(View v, MotionEvent event) { return ElfCaller.callOnTouchListener(this, v.getId(), event); } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ElfCaller.callOnItemClickListener(this, parent.getId(), positio...
public SessionStorage getDefaultSessionStorage() {
2
forge/furnace
manager/tests/src/test/java/org/jboss/forge/furnace/manager/impl/AddonManagerInstallTest.java
[ "public interface Furnace extends AutoCloseable\n{\n /**\n * Start this {@link Furnace} instance in a new background {@link Thread}. Return a {@link Future} that can be used\n * to block until the container has started.\n */\n public Future<Furnace> startAsync();\n\n /**\n * Start this {@link Furn...
import static org.hamcrest.CoreMatchers.everyItem; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.isA; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.net.URL; import java.util.List; import java.util.ServiceLoader; import ja...
/* * Copyright 2012 Red Hat, Inc. and/or its affiliates. * * Licensed under the Eclipse Public License version 1.0, available at * http://www.eclipse.org/legal/epl-v10.html */ package org.jboss.forge.furnace.manager.impl; public class AddonManagerInstallTest { private static String previousUserSettings; ...
AddonInfo addonInfo = deployRequest.getRequestedAddonInfo();
4
gp15237125756/PoiExcelExport2.0
extention/XSSFCellStyleLib.java
[ "public class CellStyleConvert implements ICellStyleConvert {\n\t@Override\n\tpublic void convert(CellStyle k, ICellStyleFactory v,XSSFCellStyleLib lib) {\n<<<<<<< HEAD\n=======\n\t\t// TODO Auto-generated method stub\n>>>>>>> fe2012a7f8558d8df36b789847bdc41c788d6eaf\n\t\tXSSFCellStyleRule rule=new XSSFCellStyleRul...
import java.util.LinkedHashMap; import java.util.Map; import org.apache.poi.xssf.usermodel.XSSFCellStyle; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import com.ld.datacenter.poi.convert.CellStyleConvert; import com.ld.datacenter.poi.convert.ICellStyleConvert; import com.ld.datacenter.poi.exception.CellStyleNotF...
package com.ld.datacenter.poi.extention; <<<<<<< HEAD import com.ld.datacenter.poi.style.TitleCellStyleImpl; ======= >>>>>>> fe2012a7f8558d8df36b789847bdc41c788d6eaf /** * 定義cell樣式庫,可以動態追加 * @author Cruz * @version 01-00 * @Date 2017/3/31 13:22 */ public class XSSFCellStyleLib { /** 樣式緩存*/
private final Map<CellStyle,XSSFCellStyle> CELL_STYLE_MAP=new LinkedHashMap<CellStyle, XSSFCellStyle>();
3