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
richkmeli/Richkware-Manager-Server
src/main/java/it/richkmeli/rms/data/LoadDatabase.java
[ "@Component\npublic class ConfigurationDatabaseManager {\n private static ConfigurationRepository configurationRepository;\n\n @Autowired\n public ConfigurationDatabaseManager(ConfigurationRepository configurationRepository) {\n this.configurationRepository = configurationRepository;\n }\n\n p...
import it.richkmeli.jframework.util.RandomStringGenerator; import it.richkmeli.rms.data.entity.configuration.ConfigurationDatabaseManager; import it.richkmeli.rms.data.entity.configuration.ConfigurationEnum; import it.richkmeli.rms.data.entity.configuration.ConfigurationManager; import it.richkmeli.rms.data.entity.devi...
package it.richkmeli.rms.data; // Annotating a class with the @Configuration annotation indicates // that the class will be used by JavaConfig as a source of bean definitions. @Configuration class LoadDatabase { @Bean CommandLineRunner initDatabase(AuthDatabaseSpringManager authDatabaseSpringManager, Device...
Rmc rmc = new Rmc(u1, "test_rmc_ID");
6
grennis/MongoExplorer
app/src/main/java/com/innodroid/mongobrowser/ui/ConnectionEditDialogFragment.java
[ "public class Constants {\n\tpublic static final String LOG_TAG = \"mongoexp\";\n\n\tpublic static final String ARG_CONNECTION_ID = \"connid\";\n\tpublic static final String ARG_COLLECTION_INDEX = \"collname\";\n\tpublic static final String ARG_ACTIVATE_ON_CLICK = \"actonclick\";\n\tpublic static final String ARG_D...
import android.app.Activity; import android.app.Dialog; import android.content.ContentUris; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.LoaderManager.LoaderCallbacks; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loa...
package com.innodroid.mongobrowser.ui; public class ConnectionEditDialogFragment extends BaseDialogFragment implements LoaderCallbacks<Cursor> { @Bind(R.id.edit_connection_name) TextView mNameView; @Bind(R.id.edit_connection_server) TextView mServerView; @Bind(R.id.edit_connection_port) TextView mPortView; @Bin...
return UiUtils.buildAlertDialog(view, R.drawable.ic_mode_edit_black, R.string.title_edit_connection, true, 0, new UiUtils.AlertDialogCallbacks() {
4
lheido/LheidoSMS
app/src/main/java/com/lheidosms/fragment/SmsBaseFragment.java
[ "public abstract class SmsBaseAdapter extends BaseAdapter {\n protected final String mPhoneContact;\n protected LheidoUtils.UserPref userPref;\n protected ArrayList<Message> mList;\n protected Context mContext;\n\n public SmsBaseAdapter(Context context,String contactPhone, ArrayList<Message> conversa...
import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.IntentFilter; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.v4.app.Fragment; import android.support.v4.widget.SwipeRefreshLayout; import android.t...
package com.lheidosms.fragment; /** * Created by lheido on 30/10/14. */ public abstract class SmsBaseFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener { public static final String ARG_CONVERSATION_ID = "conversation_id"; public static final String ARG_CONVERSATION_COUNT = "convers...
((MainLheidoSMS) activity).onSectionAttached(getArguments().getString(ARG_CONTACT_NAME));
1
WojciechZankowski/iextrading4j-hist
iextrading4j-hist-test/src/test/java/pl/zankowski/iextrading4j/hist/test/segment/TOPS15SegmentTest.java
[ "public enum IEXMessageType implements IEXByteEnum {\n\n QUOTE_UPDATE((byte) 0x51),\n TRADE_REPORT((byte) 0x54),\n TRADE_BREAK((byte) 0x42),\n SYSTEM_EVENT((byte) 0x53),\n SECURITY_DIRECTORY((byte) 0x44),\n TRADING_STATUS((byte) 0x48),\n OPERATIONAL_HALT_STATUS((byte) 0x4f),\n SHORT_SALE_PRI...
import org.junit.jupiter.api.Test; import pl.zankowski.iextrading4j.hist.api.IEXMessageType; import pl.zankowski.iextrading4j.hist.api.field.IEXPrice; import pl.zankowski.iextrading4j.hist.api.message.IEXMessage; import pl.zankowski.iextrading4j.hist.api.message.IEXMessageHeader; import pl.zankowski.iextrading4j.hist.a...
package pl.zankowski.iextrading4j.hist.test.segment; class TOPS15SegmentTest extends ExtendedUnitTestBase { @Test void testTOPS15Segment() throws IOException { final byte[] packet = loadPacket("TOPS15Segment.dump"); final IEXTOPSMessageBlock segment = (IEXTOPSMessageBlock) IEXTOPSMessageBl...
assertThat(message.getBidPrice()).isEqualTo(new IEXPrice(0));
1
xvik/generics-resolver
src/main/java/ru/vyarus/java/generics/resolver/util/type/CommonTypeFactory.java
[ "public class ParameterizedTypeImpl implements ParameterizedType {\n\n private final Type rawType;\n private final Type[] actualArguments;\n private final Type ownerType;\n\n public ParameterizedTypeImpl(final Type rawType, final Type... actualArguments) {\n this(rawType, actualArguments, null);\...
import ru.vyarus.java.generics.resolver.context.container.ParameterizedTypeImpl; import ru.vyarus.java.generics.resolver.context.container.WildcardTypeImpl; import ru.vyarus.java.generics.resolver.util.ArrayTypeUtils; import ru.vyarus.java.generics.resolver.util.GenericsResolutionUtils; import ru.vyarus.java.generics.r...
package ru.vyarus.java.generics.resolver.util.type; /** * Calculates common (base) type for provided types (maximum type to which both types could be downcasted). * Assumed to be used through {@link ru.vyarus.java.generics.resolver.util.TypeUtils#getCommonType(Type, Type)}. * Direct usage makes sense only when le...
return res.size() == 1 ? res.get(0) : WildcardTypeImpl.upper(res.toArray(new Type[0]));
1
samtingleff/jchronic
src/main/java/com/mdimension/jchronic/handlers/SRPHandler.java
[ "public class Chronic {\n public static final String VERSION = \"0.2.3\";\n\n private Chronic() {\n // DO NOTHING\n }\n\n public static Span parse(String text) {\n return Chronic.parse(text, new Options());\n }\n\n /**\n * Parses a string containing a natural language date or time. If the parser\n *...
import java.util.List; import com.mdimension.jchronic.Chronic; import com.mdimension.jchronic.Options; import com.mdimension.jchronic.repeaters.Repeater; import com.mdimension.jchronic.tags.Pointer; import com.mdimension.jchronic.tags.Scalar; import com.mdimension.jchronic.utils.Span; import com.mdimension.jchronic.uti...
package com.mdimension.jchronic.handlers; public class SRPHandler implements IHandler { public Span handle(List<Token> tokens, Span span, Options options) { int distance = tokens.get(0).getTag(Scalar.class).getType().intValue(); Repeater<?> repeater = tokens.get(1).getTag(Repeater.class);
Pointer.PointerType pointer = tokens.get(2).getTag(Pointer.class).getType();
3
marcocor/smaph
src/main/java/it/unipi/di/acube/smaph/learn/GenerateTrainingAndTest.java
[ "public class QueryInformation {\n\tpublic boolean includeSourceNormalSearch;\n\tpublic boolean includeSourceWikiSearch;\n\tpublic boolean includeSourceSnippets;\n\tpublic Double webTotalNS;\n\tpublic List<String> allBoldsNS;\n\tpublic HashMap<Integer, Integer> idToRankNS;\n\tpublic List<Pair<String, Integer>> bold...
import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Vector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import it.unimi.dsi.logging.ProgressLogger; import it.unipi.di.acube.batframework.data.Annotation; import it.unipi.di.acube.batframework.data.Tag; import it.unipi.di.a...
/** * Copyright 2014 Marco Cornolti * * 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...
public static void gatherExamples(SmaphAnnotator smaph, A2WDataset ds,
1
jadler-mocking/jadler
jadler-core/src/test/java/net/jadler/JadlerMockerTest.java
[ "public class JadlerException extends RuntimeException {\n\n /**\n * @param cause the cause of this exception\n * @see RuntimeException#RuntimeException(java.lang.Throwable)\n */\n public JadlerException(final Throwable cause) {\n super(cause);\n }\n\n /**\n * @param message the d...
import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.encoder.PatternLayoutEncoder; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.OutputStreamAppender; import net.jadler.exception.JadlerException; import net.jadler.mocking.Verifica...
/* * Copyright (c) 2012 - 2022 Jadler contributors * This program is made available under the terms of the MIT License. */ package net.jadler; public class JadlerMockerTest { private static final int DEFAULT_STATUS = 204; private static final String HEADER_NAME1 = "h1"; private static final String ...
final StubHttpServerManager mocker = new JadlerMocker(server);
7
greengrowapps/ggarest
GgaRestAndroidLib/ggarest/src/androidTest/java/com/greengrowapps/ggarest/MockTest.java
[ "public class AlreadyExecutingException extends RuntimeException{\n}", "public interface OnListResponseListener<T> {\n\n void onResponse(int code, List<T> object, Response fullResponse);\n}", "public interface OnObjResponseListener<T> {\n\n void onResponse(int code, T object, Response fullResponse);\n}", ...
import com.greengrowapps.ggarest.exceptions.AlreadyExecutingException; import com.greengrowapps.ggarest.listeners.OnListResponseListener; import com.greengrowapps.ggarest.listeners.OnObjResponseListener; import com.greengrowapps.ggarest.listeners.OnResponseListener; import com.greengrowapps.ggarest.listeners.OnTimeoutL...
package com.greengrowapps.ggarest; public class MockTest extends GgaRestTest { private static final int CONNECTION_TIMEOUT = 30*1000; public void testMockGet() throws Exception { final Webservice ws = getWebserviceInstance(); ws.mockGet("http://www.google.com") .responseC...
.onResponse(SimpleObj.class, 204, new OnObjResponseListener<SimpleObj>() {
2
lingganhezi/dedecmsapp
android/myapp/src/com/lingganhezi/myapp/service/LoginService.java
[ "public class AppContext extends Application {\n\tprivate final String TAG = AppContext.class.getSimpleName();\n\tprivate static AppContext mInstance;\n\tprivate RequestQueuePool mRequestQueuePool;\n\tprivate RequestQueuePool mMulitiRequestQueuePool;\n\n\t@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();...
import java.util.HashMap; import java.util.Map; import org.json.JSONObject; import com.android.volley.Request; import com.lingganhezi.myapp.AppContext; import com.lingganhezi.myapp.ConfigHelper; import com.lingganhezi.myapp.Constant; import com.lingganhezi.myapp.HttpHelper; import com.lingganhezi.myapp.entity.LoginUser...
package com.lingganhezi.myapp.service; public class LoginService extends BaseService { private final String TAG = LoginService.class.getSimpleName(); private static LoginService instance; /** * MSG 编号 100~200 */ public final static int MSG_LOGIN_SUCCESS = 100; public final static int MSG_LOGIN_FAILD = 101...
Request request = new JsonObjectRequest(LOGIN_URL, params, new ResultResponeListener() {
7
mosquitolabs/referendum_1o_android
app/src/main/java/com/referendum/uoctubre/fragments/InfoFragment.java
[ "public class HashtagAdapter extends RecyclerView.Adapter<GenericRecyclerViewViewHolder> {\n private OnHashtagRemovedListener onHashtagRemovedListener;\n private List<Hashtag> hashtagsList;\n\n public HashtagAdapter(List<Hashtag> hashtagsList, OnHashtagRemovedListener onHashtagRemovedListener) {\n t...
import android.content.DialogInterface; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.app.AlertDialog; import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.LinearLayoutManager; impor...
package com.referendum.uoctubre.fragments; public class InfoFragment extends BaseFragment { public static final String TAG = "info_fragment"; public static InfoFragment newInstance() { Bundle args = new Bundle(); InfoFragment fragment = new InfoFragment(); fragment.setArguments(a...
hashtagsRecyclerView.setAdapter(new HashtagAdapter(hashtagsList, new HashtagAdapter.OnHashtagRemovedListener() {
0
hoijui/JavaOSC
modules/core/src/main/java/com/illposed/osc/argument/handler/StringArgumentHandler.java
[ "public interface BytesReceiver {\n\n\t/**\n\t * Relative <i>put</i> method&nbsp;&nbsp;<i>(optional operation)</i>.\n\t *\n\t * <p> Writes the given byte into this buffer at the current\n\t * position, and then increments the position. </p>\n\t *\n\t * @param data\n\t * The byte to be written\n\t *\n\t * @...
import com.illposed.osc.BytesReceiver; import com.illposed.osc.OSCParseException; import com.illposed.osc.OSCParser; import com.illposed.osc.OSCSerializer; import com.illposed.osc.argument.ArgumentHandler; import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.charset.CharacterCodingException; import java....
// SPDX-FileCopyrightText: 2015-2017 C. Ramakrishnan / Illposed Software // SPDX-FileCopyrightText: 2021 Robin Vobruba <hoijui.quaero@gmail.com> // // SPDX-License-Identifier: BSD-3-Clause package com.illposed.osc.argument.handler; /** * Parses and serializes an OSC string type. */ public class StringArgumentHandl...
public void serialize(final BytesReceiver output, final String value) {
0
TonnyL/Espresso
app/src/main/java/io/github/marktony/espresso/mvp/packages/PackagesFragment.java
[ "public class AppWidgetProvider extends android.appwidget.AppWidgetProvider {\n\n private static final String REFRESH_ACTION = \"io.github.marktony.espresso.appwidget.action.REFRESH\";\n\n public static Intent getRefreshBroadcastIntent(Context context) {\n return new Intent(REFRESH_ACTION)\n ...
import android.content.ActivityNotFoundException; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.content.Intent; import android.graphics.Canvas; import android.os.Bundle; import android.provider.Settings; import android.support.annotation.NonNull...
/* * Copyright(c) 2017 lizhaotailang * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agre...
getActivity().sendBroadcast(AppWidgetProvider.getRefreshBroadcastIntent(getContext()));
0
osiam/connector4java
src/main/java/org/osiam/client/AbstractOsiamService.java
[ "@JsonIgnoreProperties(ignoreUnknown = true)\npublic class AccessToken {\n\n @JsonProperty(\"access_token\")\n private String token;\n @JsonProperty(\"expires_at\")\n private Date expiresAt;\n @JsonSerialize(using = ScopeSerializer.class)\n @JsonDeserialize(using = ScopeDeserializer.class)\n @J...
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JavaType; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.Obj...
/** * The MIT License (MIT) * * Copyright (C) 2013-2016 tarent solutions GmbH * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the ri...
UserDeserializer userDeserializer =
3
jhclark/bigfatlm
src/bigfat/step6/RenormalizeBackoffsMapper.java
[ "public class BigFatLM extends Configured implements Tool {\n\n\tpublic static final String PROGRAM_NAME = \"BigFatLM\";\n\tpublic static final int ZEROTON_ID = 0;\n\tpublic static final String UNK = \"<unk>\";\n\tpublic static final int UNK_ID = -1;\n\tpublic static final String BOS = \"<s>\";\n\tpublic static fin...
import jannopts.Option; import java.io.IOException; import org.apache.hadoop.mapreduce.Counter; import org.apache.hadoop.mapreduce.Mapper; import bigfat.BigFatLM; import bigfat.datastructs.FastIntArrayList; import bigfat.datastructs.Ngram; import bigfat.hadoop.HadoopUtils; import bigfat.step5.InterpolateOrdersInfo;
package bigfat.step6; public class RenormalizeBackoffsMapper extends
Mapper<Ngram, InterpolateOrdersInfo, RenormalizeBackoffsKey, RenormalizeBackoffsInfo> {
4
PistoiaHELM/HELMNotationToolkit
test/org/helm/notation/tools/SimpleNotationParserTest.java
[ "public class MonomerException extends Exception {\n\n\t/**\n\t * Creates a new instance of <code>MonomerException</code> without detail\n\t * message.\n\t */\n\tpublic MonomerException() {\n\t}\n\n\t/**\n\t * Constructs an instance of <code>MonomerException</code> with the\n\t * specified detail message.\n\t * \n\...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.Arrays; import java.util.List; import java.util.Map; import org.helm.notation.MonomerException; import org.helm.notation.MonomerFactory; import org.helm.notation.NotationException; import...
package org.helm.notation.tools; public class SimpleNotationParserTest { public String getSimpleRNANotation() { return "P.R(A)[sP].RP.R(G)P.[LR]([5meC])"; } /* * public String getInlineSmilesModP(){ return * "[OP([*])([*])=O |$;;_R1;_R2;$|].R(A)[sP].RP.R(G)[OP([*])([*])=O |$;;_R1;_R2;$|].[LR]([5meC])" ...
MonomerException, StructureException, JDOMException, IOException {
0
AlexanderMisel/gnubridge
src/main/java/org/gnubridge/core/bidding/rules/RebidWeakTwo.java
[ "public class Hand {\n\tList<Card> cards;\n\n\t/**\n\t * Caching optimization for pruning played cards\n\t * and perhaps others\n\t */\n\tList<Card> orderedCards;\n\tSuit color;\n\tList<Card> colorInOrder;\n\n\tpublic Hand() {\n\t\tthis.cards = new ArrayList<Card>();\n\t}\n\n\tpublic Hand(Card... cards) {\n\t\tthis...
import org.gnubridge.core.Hand; import org.gnubridge.core.bidding.Auctioneer; import org.gnubridge.core.bidding.Bid; import org.gnubridge.core.bidding.PointCalculator; import org.gnubridge.core.deck.Clubs; import org.gnubridge.core.deck.Diamonds; import org.gnubridge.core.deck.Hearts; import org.gnubridge.core.deck.NoT...
package org.gnubridge.core.bidding.rules; public class RebidWeakTwo extends Rebid { public RebidWeakTwo(Auctioneer a, Hand h) { super(a, h); } @Override protected boolean applies() { return super.applies() && opening.getValue() == 2 && !opening.getTrump().equals(Clubs.i()) && response.getValue() == 2 &&...
return new Bid(3, NoTrump.i());
5
eHarmony/pho
src/main/java/com/eharmony/pho/query/builder/QueryUpdateBuilder.java
[ "public enum QueryOperationType {\n\n SELECT, UPDATE, INSERT, DELETE;\n \n}", "public interface QueryUpdate<T> {\n\n /**\n * The list of properties to return. An empty collection means all properties.\n * \n * @return the fields to be updated\n */\n public List<String> getSelectedField...
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import com.eharmony.pho.query.QueryOperationType; import com.eharmony.pho.query.QueryUpdate; import com.eharmony.pho.query.QueryUpdateImpl; import com.eharmony.pho.query.criterion.Criterion; import com.eharmony.pho...
package com.eharmony.pho.query.builder; /** * Builder for saving objects * * @param <T> * the entity type being saved */ public class QueryUpdateBuilder<T> { private final T entity; private List<Criterion> criteria = new ArrayList<Criterion>(); private List<String> selectedFields = Coll...
return new QueryUpdateImpl<T>(entity, rootCriterion, selectedFields, queryOperationType);
2
gustav9797/PowerfulPerms
PowerfulPerms/src/main/java/com/github/gustav9797/PowerfulPerms/common/PermissionManagerMiddle.java
[ "public abstract class Database implements IDatabase {\n public IScheduler scheduler;\n public static String tblGroupParents = \"groupparents\";\n public static String tblGroupPermissions = \"grouppermissions\";\n public static String tblGroupPrefixes = \"groupprefixes\";\n public static String tblGr...
import java.util.Date; import java.util.LinkedHashMap; import java.util.List; import java.util.UUID; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import com.github.gustav9797.PowerfulPerms.database.Database; import com.github.gustav9797.Powerf...
package com.github.gustav9797.PowerfulPerms.common; public class PermissionManagerMiddle extends PermissionManagerBase implements PermissionManager { protected ListeningExecutorService service = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()); // protected ListeningExecutorService same...
public ListenableFuture<Response> createPlayer(String name, UUID uuid) {
7
chenjishi/usite
u148/app/src/main/java/com/chenjishi/u148/home/FeedListAdapter.java
[ "public class Config {\n\n private static final long TWO_DAYS = 2 * 24 * 60 * 60 * 1000;\n\n private static final String CONFIG_FILE_NAME = \"u148_config\";\n\n private static final long VERSION_CHECK_INTERVAL = 24 * 60 * 60 * 1000;\n\n private static final String KEY_NEXT_TOKEN = \"next_from\";\n\n ...
import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.support.v7.widget.RecyclerView; import android.text.Html; import android.text.TextUtils; import android.util.SparseArray; import android.view.LayoutInflater; import android.view.View; import android.view....
package com.chenjishi.u148.home; /** * Created by chenjishi on 16/2/2. */ public class FeedListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private static final int ITEM_TYPE_FEED = 0; private static final int ITEM_TYPE_FOOTER = 1; private final ArrayList<Feed> mDataList = new Arr...
holder.gifView.setImageUrl(url, Utils.dp2px(mContext, 90));
4
ni3po42/traction.mvc
traction/src/main/java/traction/mvc/implementations/ui/viewbinding/GenericViewBinding.java
[ "public class BindingInventory\n extends ObservableObject\n{\n\t/**\n\t * patterns for parsing property chains\n\t */\n\tprivate final static Pattern pathPattern = Pattern.compile(\"(\\\\\\\\|[\\\\.]*)(.+)\");\n\tprivate final static Pattern split = Pattern.compile(\"\\\\.\");\n\n\t//used for determining a range...
import java.lang.ref.WeakReference; import traction.mvc.observables.BindingInventory; import traction.mvc.implementations.ui.UIProperty; import traction.mvc.implementations.ui.UIHandler; import traction.mvc.interfaces.IUIElement; import traction.mvc.interfaces.IViewBinding; import traction.mvc.util.Log; import android....
/* Copyright 2013 Tim Stratton Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
public UIHandler getUIHandler()
2
InfinityRaider/NinjaGear
src/main/java/com/infinityraider/ninjagear/item/ItemShuriken.java
[ "@Mod(Reference.MOD_ID)\npublic class NinjaGear extends InfinityMod<IProxy, Config> {\n public static NinjaGear instance;\n\n public NinjaGear() {\n super();\n }\n\n @Override\n public String getModId() {\n return Reference.MOD_ID;\n }\n\n @Override\n protected void onModConstr...
import com.infinityraider.ninjagear.NinjaGear; import com.infinityraider.ninjagear.api.v1.IHiddenItem; import com.infinityraider.ninjagear.entity.EntityShuriken; import com.infinityraider.ninjagear.handler.NinjaAuraHandler; import com.infinityraider.ninjagear.reference.Reference; import com.infinityraider.ninjagear.reg...
package com.infinityraider.ninjagear.item; @MethodsReturnNonnullByDefault public class ItemShuriken extends ItemBase implements IHiddenItem { public ItemShuriken() {
super("shuriken", new Properties().group(ItemRegistry.CREATIVE_TAB));
6
quaap/Primary
app/src/main/java/com/quaap/primary/base/SubjectBaseActivity.java
[ "public class MainActivity extends CommonBaseActivity {\n\n public static final String USERNAME = \"username\";\n public static final String SUBJECTCODE = \"subjectcode\";\n public static final String LEVELSETDONE = \"levelsetdone\";\n private List<String> avatarlist = new ArrayList<>();\n private Ho...
import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.graphics.Point; import android.graphics.Typeface; import android.media.AudioManager; import android.os.Bundle; import android.os.Handler; import android.prefe...
package com.quaap.primary.base; /** * Created by tom on 12/15/16. * <p> * Copyright (C) 2016 Tom Kliethermes * <p> * 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 t...
soundEffects = ((Primary)getApplicationContext()).getSoundEffects();
1
jchampemont/WTFDYUM
src/main/java/com/jeanchampemont/wtfdyum/web/AdminController.java
[ "public enum Feature {\n\n NOTIFY_UNFOLLOW(\"Send me a direct message when someone stops following me\", \"unfollow notifications\"),\n\n TWEET_UNFOLLOW(\"Send a public tweet with @mention when someone stops following me\", \"unfollow tweet\");\n\n private Feature(final String message, final String shortNa...
import java.util.Map; import java.util.stream.Collectors; import static java.util.stream.Collectors.toMap; import com.jeanchampemont.wtfdyum.dto.Feature; import com.jeanchampemont.wtfdyum.security.Secured; import com.jeanchampemont.wtfdyum.service.AdminService; import com.jeanchampemont.wtfdyum.service.AuthenticationSe...
/* * Copyright (C) 2018 WTFDYUM * * This file is part of the WTFDYUM project. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Un...
result.getModel().put("user", twitterService.getUser(SessionManager.getPrincipal(), userId));
5
dkpro/dkpro-statistics
dkpro-statistics-agreement/src/test/java/org/dkpro/statistics/agreement/coding/Krippendorff1980Test.java
[ "public interface ICategorySpecificAgreement\n{\n /**\n * Calculates the inter-rater agreement for the given category.\n * \n * @see ICategorySpecificAgreement\n */\n /*\n * TODO @throws NullPointerException if the study is null or the given category is null.\n * \n * @throws Array...
import org.dkpro.statistics.agreement.ICategorySpecificAgreement; import org.dkpro.statistics.agreement.distance.IDistanceFunction; import org.dkpro.statistics.agreement.distance.IntervalDistanceFunction; import org.dkpro.statistics.agreement.distance.NominalDistanceFunction; import org.dkpro.statistics.agreement.dista...
/* * Copyright 2014 * Ubiquitous Knowledge Processing (UKP) Lab * Technische Universität Darmstadt * * 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...
IDistanceFunction distFunc = new IntervalDistanceFunction();
2
Kindrat/cassandra-client
src/main/java/com/github/kindrat/cassandra/client/ui/window/editor/main/filter/FilterTextField.java
[ "public enum Combiner {\n OR, AND\n}", "@Getter\n@RequiredArgsConstructor\npublic enum Operator {\n EQ(\"=\"), GT(\">\"), GE(\">=\"), LT(\"<\"), LE(\"<=\"), NE(\"!=\"), LIKE(\"LIKE\");\n\n private final String value;\n\n public static Operator fromValue(String value) {\n return stream(Operator....
import com.datastax.driver.core.ColumnMetadata; import com.datastax.driver.core.TableMetadata; import com.github.kindrat.cassandra.client.filter.Combiner; import com.github.kindrat.cassandra.client.filter.Operator; import com.github.kindrat.cassandra.client.filter.condition.*; import com.github.kindrat.cassandra.client...
package com.github.kindrat.cassandra.client.ui.window.editor.main.filter; @Slf4j public class FilterTextField extends TextField { private final List<StateCondition> stateConditions = new ArrayList<>(); private final ContextMenu context = new ContextMenu(); private Map<String, ColumnMetadata> columnsByNa...
List<String> combiners = stream(Combiner.values()).map(Enum::name).collect(Collectors.toList());
0
PearsonEducation/StatsPoller
src/main/java/com/pearson/statspoller/internal_metric_collectors/linux/Uptime/UptimeCollector.java
[ "public abstract class InternalCollectorFramework {\n \n private static final Logger logger = LoggerFactory.getLogger(InternalCollectorFramework.class.getName());\n \n protected final int NUM_FILE_WRITE_RETRIES = 3;\n protected final int DELAY_BETWEEN_WRITE_RETRIES_IN_MS = 100;\n \n private fin...
import com.pearson.statspoller.internal_metric_collectors.InternalCollectorFramework; import com.pearson.statspoller.metric_formats.graphite.GraphiteMetric; import com.pearson.statspoller.utilities.core_utils.StackTrace; import com.pearson.statspoller.utilities.core_utils.Threads; import com.pearson.statspoller.utiliti...
package com.pearson.statspoller.internal_metric_collectors.linux.Uptime; /** * @author Jeffrey Schmidt */ public class UptimeCollector extends InternalCollectorFramework implements Runnable { private static final Logger logger = LoggerFactory.getLogger(UptimeCollector.class.getName()); public Upti...
if (sleepTimeInMs >= 0) Threads.sleepMilliseconds(sleepTimeInMs);
3
junwei-wang/cpabe
cpabe-api/src/main/java/co/junwei/cpabe/Cpabe.java
[ "public class LangPolicy {\n\n\tpublic static String[] parseAttribute(String s) {\n\t\tArrayList<String> str_arr = new ArrayList<String>();\n\t\tStringTokenizer st = new StringTokenizer(s);\n\t\tString token;\n\t\tString res[];\n\t\tint len;\n\n\t\twhile (st.hasMoreTokens()) {\n\t\t\ttoken = st.nextToken();\n\t\t\t...
import co.junwei.cpabe.policy.LangPolicy; import it.unisa.dia.gas.jpbc.Element; import java.io.IOException; import java.security.NoSuchAlgorithmException; import co.junwei.bswabe.Bswabe; import co.junwei.bswabe.BswabeCph; import co.junwei.bswabe.BswabeCphKey; import co.junwei.bswabe.BswabeElementBoolean; import co.junw...
package co.junwei.cpabe; public class Cpabe { /** * @param * @author Junwei Wang(wakemecn@gmail.com) */ public void setup(String pubfile, String mskfile) throws IOException, ClassNotFoundException { byte[] pub_byte, msk_byte; BswabePub pub = new BswabePub(); BswabeMsk msk = new BswabeMsk(); Bswa...
pub_byte = SerializeUtils.serializeBswabePub(pub);
8
eviltester/testtoolhub
src/main/java/uk/co/compendiumdev/javafortesters/gui/javafx/stages/CannedTextTreeStage.java
[ "public class CannedText {\n private static TreeBranch<CannedTextItem> defaultTree;\n\n public static TreeBranch<CannedTextItem> getDefaultTree() {\n TreeBranch<CannedTextItem> root = null;\n\n // does a resource file exist?\n if(CannedText.class.getResource(\"defaultCannedText.txt\")!=nu...
import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; import javafx.scene.input.MouseEvent; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; import uk.co.compendiumdev.javafortesters.doma...
package uk.co.compendiumdev.javafortesters.gui.javafx.stages; public class CannedTextTreeStage extends Stage { private static CannedTextTreeStage cannedTextTreeSingletonStage=null; public static void singletonActivate() { if(cannedTextTreeSingletonStage==null) cannedTextTreeSingletonS...
final CannedTextItemTreeFinder finder = new CannedTextItemTreeFinder(treeRoot);
2
6ag/BaoKanAndroid
app/src/main/java/tv/baokan/baokanandroid/ui/fragment/NewsListFragment.java
[ "public class NewsListRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\n\n public static interface OnItemTapListener {\n public abstract void onItemTapListener(ArticleListBean articleListBean);\n }\n\n // item类型枚举\n private enum NEWS_ITEM_TYPE {\n HEADER_VIEW, //...
import android.os.Bundle; import android.os.Handler; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; import android.widget.Toast; import com.facebook.drawee.backends.pipeline.Fresco; import com.lcodecore.tkrefreshlayout.RefreshListenerAdapte...
package tv.baokan.baokanandroid.ui.fragment; public class NewsListFragment extends BaseFragment { private static final String TAG = "NewsListFragment"; private String classid; // 栏目id private int pageIndex = 1; // 当前页码 private TwinklingRefreshLayout refreshLayout; // 上下拉刷新 private Re...
if (NetworkUtils.shared.isNetworkConnected(mContext)) {
6
Praqma/pretested-integration-plugin
src/test/java/org/jenkinsci/plugins/pretestedintegration/integration/scm/git/TwoBranchHeadsIT.java
[ "public abstract class IntegrationStrategy implements Describable<IntegrationStrategy>, ExtensionPoint {\n\n /**\n * {@inheritDoc}\n */\n @Override\n public Descriptor<IntegrationStrategy> getDescriptor() {\n return (IntegrationStrategyDescriptor<?>) Jenkins.getInstance().getDescriptorOrDie(ge...
import antlr.ANTLRException; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import hudson.model.Result; import hudson.plugins.git.BranchSpec; import hudson.plugins.git.extensions.GitSCMExtension; import hudson.plugins.git.extensions.impl.CleanCheckout; import hudson.plugins.git.extensions.imp...
package org.jenkinsci.plugins.pretestedintegration.integration.scm.git; /** * <h3>Integration test for multiple branch heads on same commit</h3> * <p> * Test integration of commit with two branch heads: * https://trello.com/c/MFzaEMDz</p> * <p> * This test's purpose is to test the fact that we do not handle ...
FreeStyleProject project = configurePretestedIntegrationPlugin(new SquashCommitStrategy(), repo1Url);
4
occi4java/occi4java
http/src/test/java/de/occi/test/TestRestCompute.java
[ "public class OcciConfig extends XMLConfiguration {\n\tprivate static final long serialVersionUID = 1L;\n\tprivate static final Logger LOGGER = LoggerFactory\n\t\t\t.getLogger(OcciConfig.class);\n\t/**\n\t * Instance of OcciConfig\n\t */\n\tprivate static OcciConfig instance = null;\n\tprivate static ConfigurationF...
import org.restlet.Response; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.representation.Representation; import org.restlet.resource.ClientResource; import org.testng.Assert; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.test...
/** * Copyright (C) 2010-2011 Sebastian Heckmann, Sebastian Laag * * Contact Email: <sebastian.heckmann@udo.edu>, <sebastian.laag@udo.edu> * * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); * you may not use this file except in compliance with the License. * You may obt...
State.active, null);
4
gentoku/pinnacle-api-client
src/pinnacle/api/dataobjects/Bets.java
[ "public class Json {\n\n\tprivate JsonObject jsonObject;\n\n\t/**\n\t * Private constructor by JsonObject.\n\t * \n\t * @param json\n\t */\n\tprivate Json(JsonObject jsonObject) {\n\t\tthis.jsonObject = jsonObject;\n\t}\n\n\t/**\n\t * Factory\n\t * \n\t * @param text\n\t * @return\n\t * @throws PinnacleException\n\...
import java.math.BigDecimal; import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.Stream; import pinnacle.api.Json; import pinnacle.api.PinnacleException; import pinnacle.api.enums.BETLIST_BET_TYPE; import pin...
private Integer wagerNumber; public Integer wagerNumber() { return this.wagerNumber; } private Instant placedAt; public Instant placedAt() { return this.placedAt; } private BigDecimal win; public BigDecimal win() { return this.win; } private BigDecimal risk; public BigDecimal risk(...
private LEG_BET_STATUS legBetStatus;
4
davidmoten/grumpy
grumpy-ogc/src/main/java/com/github/davidmoten/grumpy/wms/reduction/Reducer.java
[ "public static List<Rectangle> quarter(Rectangle region) {\n List<Rectangle> list = new ArrayList<Rectangle>();\n for (Rectangle r : splitHorizontally(region))\n list.addAll(splitVertically(r));\n return list;\n}", "public static List<Rectangle> splitHorizontally(Rectangle region) {\n List<Rect...
import static com.github.davidmoten.grumpy.wms.reduction.RectangleUtil.quarter; import static com.github.davidmoten.grumpy.wms.reduction.RectangleUtil.splitHorizontally; import static com.github.davidmoten.grumpy.wms.reduction.RectangleUtil.splitVertically; import java.awt.Graphics2D; import java.awt.Point; import java...
package com.github.davidmoten.grumpy.wms.reduction; public class Reducer { public static <T> void render(Graphics2D g, Function<Position, T> function, Projector projector, RectangleSampler sampler, ValueRenderer<T> regionRenderer) { Rectangle region = WmsUtil.toTargetRectangle(projector); ...
return splitHorizontally(region);
1
thehiflyer/Fettle
src/main/java/se/fearless/fettle/impl/MutableTransitionModelImpl.java
[ "public interface Action<S, E, C> {\n\t/**\n\t * Called when a transition occurs\n\t * @param from the state the machine was in before the transition\n\t * @param to the state the machine is in after the transition\n\t * @param causedBy the event that triggered the transition\n\t * @param context the context in whi...
import se.fearless.fettle.Action; import se.fearless.fettle.Condition; import se.fearless.fettle.MutableTransitionModel; import se.fearless.fettle.StateMachine; import se.fearless.fettle.StateMachineTemplate; import se.fearless.fettle.Transition; import se.fearless.fettle.util.GuavaReplacement; import java.util.Collect...
package se.fearless.fettle.impl; public class MutableTransitionModelImpl<S, E, C> extends AbstractTransitionModel<S, E, C> implements MutableTransitionModel<S, E, C> { private MutableTransitionModelImpl(Class<S> stateClass, Class<E> eventClass, C defaultContext) { super(stateClass, eventClass, defaultContext); ...
public StateMachine<S, E, C> newStateMachine(S init, Lock lock) {
7
wakarimasenco/ChanExplorer
src/co/wakarimasen/chanexplorer/AutoUpdater.java
[ "public class Parser {\n\n\tprivate final static Pattern post_omitted = Pattern.compile(\"([0-9]+) post[s]{0,1} omitted\");\n\tprivate final static Pattern post_image_omitted = Pattern.compile(\"([0-9]+) post[s]{0,1} and ([0-9]+) image repl\");\n\tprivate final static Pattern sz_match = Pattern.compile(\"([0-9]+)x(...
import java.io.FileNotFoundException; import java.io.IOException; import java.net.MalformedURLException; import co.wakarimasen.chanexplorer.imageboard.Parser; import co.wakarimasen.chanexplorer.imageboard.Post; import co.wakarimasen.chanexplorer.imageboard.Parser.BannedException; import co.wakarimasen.chanexplorer.imag...
default: time *= 1000 * 1000 * 1000; break; } showNotification(); if (mAdapter != null) { for (int i = 0; i < mAdapter.getCount(); i++) { ChanPage cp = mAdapter.getChanFragmentByPosition(i); if (cp != null) { if (cp.getThreadId() != -1) { String url = Http.Chan.threadURL(c...
} catch (NotFoundException e) {
4
wepay/kafka-connect-bigquery
kcbq-connector/src/test/java/com/wepay/kafka/connect/bigquery/convert/logicaltype/DebeziumLogicalConvertersTest.java
[ "public static class DateConverter extends LogicalTypeConverter {\n /**\n * Create a new DateConverter.\n */\n public DateConverter() {\n super(Date.SCHEMA_NAME,\n Schema.Type.INT32,\n LegacySQLTypeName.DATE);\n }\n\n @Override\n public String convert(Object kafkaConnectObject) {\n ...
import org.apache.kafka.connect.data.Schema; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; import com.google.cloud.bigquery.LegacySQLTypeName; import com.wepay.kafka.connect.bigquery.convert.logicaltype.DebeziumLogicalConverters.DateConverter; import com.wepay....
package com.wepay.kafka.connect.bigquery.convert.logicaltype; /* * Copyright 2016 WePay, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICE...
MicroTimestampConverter converter = new MicroTimestampConverter();
2
shwenzhang/AndResGuard
AndResGuard-core/src/main/java/com/tencent/mm/androlib/ApkDecoder.java
[ "public class ResPackage {\n private final String mName;\n\n private final Map<Integer, String> mSpecNamesReplace;\n private final Map<String, Set<String>> mSpecNamesBlock;\n private boolean mCanProguard = false;\n\n public ResPackage(int id, String name) {\n this.mName = name;\n mSpecNamesReplace = new ...
import com.tencent.mm.androlib.res.data.ResPackage; import com.tencent.mm.androlib.res.decoder.ARSCDecoder; import com.tencent.mm.androlib.res.decoder.RawARSCDecoder; import com.tencent.mm.androlib.res.util.ExtFile; import com.tencent.mm.directory.DirectoryException; import com.tencent.mm.resourceproguard.Configuration...
public boolean hasResources() throws AndrolibException { try { return apkFile.getDirectory().containsFile("resources.arsc"); } catch (DirectoryException ex) { throw new AndrolibException(ex); } } private void ensureFilePath() throws IOException { Utils.cleanDir(mOutDir); String u...
ResPackage[] pkgs = ARSCDecoder.decode(apkFile.getDirectory().getFileInput("resources.arsc"), this);
1
jaksab/EasyNetwork
app/src/main/java/pro/oncreate/easynetwork/DevActivity.java
[ "@SuppressWarnings(\"unused,WeakerAccess\")\npublic class EasyNet {\n\n\n //\n // Fields\n //\n\n public static final String CACHE_DIR_NAME = \"easy-network-cache\";\n\n volatile private static EasyNet config;\n private boolean writeLogs = BuildConfig.DEBUG;\n private Request request;\n priv...
import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.ProgressBar; import android.widget.Toast; import pro.oncreate.easynet.EasyNet; import pro.oncreate.easynet.data.NError; import pro.oncreate.easynet.models.NRequestModel; im...
package pro.oncreate.easynetwork; public class DevActivity extends AppCompatActivity implements View.OnClickListener { private ProgressBar progressBar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dev...
EasyNet.get()
0
tang-jie/AvatarMQ
src/com/newlandframework/avatarmq/producer/AvatarMQProducer.java
[ "public interface AvatarMQAction {\n\n void start();\n\n void init();\n\n void shutdown();\n}", "public enum MessageSource {\n\n AvatarMQConsumer(1),\n AvatarMQBroker(2),\n AvatarMQProducer(3);\n\n private int source;\n\n private MessageSource(int source) {\n this.source = source;\n...
import com.newlandframework.avatarmq.core.AvatarMQAction; import com.newlandframework.avatarmq.model.MessageSource; import com.newlandframework.avatarmq.model.MessageType; import com.newlandframework.avatarmq.model.RequestMessage; import com.newlandframework.avatarmq.model.ResponseMessage; import com.newlandframework.a...
/** * Copyright (C) 2016 Newland Group Holding Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by appli...
RequestMessage request = new RequestMessage();
3
dominiks/uristmapsj
src/main/java/org/uristmaps/renderer/SatRenderer.java
[ "public class BiomeInfo {\n\n private static Map<Integer, String> colorTranslation;\n\n /**\n * The loaded biome data.\n */\n private static String[][] biomeData;\n\n static {\n colorTranslation = new HashMap<>();\n colorTranslation.put(makeColor(128,128,128), \"mountain\");\n ...
import org.uristmaps.BiomeInfo; import org.uristmaps.StructureInfo; import org.uristmaps.Tilesets; import org.uristmaps.data.Coord2; import org.uristmaps.data.RenderSettings; import org.uristmaps.util.BuildFiles; import java.awt.*; import java.awt.image.BufferedImage; import java.util.Map;
package org.uristmaps.renderer; /** * Renders an image from a tileset onto the map-tile. */ public class SatRenderer extends LayerRenderer { /** * The index for the tileset that is used. */ private Map<String, Coord2> tilesIndex; /** * The tileset image used for rendering. */ ...
if (BuildFiles.getTilesetImage(renderSettings.getGraphicsSize()).exists()) {
5
leelit/STUer-client
app/src/main/java/com/leelit/stuer/module_baseinfo/date/presenter/DatePresenter.java
[ "public class DatingInfo extends BaseInfo {\n\n String type;\n String description = \"\";\n\n public String getType() {\n return type;\n }\n\n public void setType(String type) {\n this.type = type;\n }\n\n public String getDescription() {\n return description;\n }\n\n ...
import com.leelit.stuer.bean.DatingInfo; import com.leelit.stuer.constant.NetConstant; import com.leelit.stuer.base_presenter.IPresenter; import com.leelit.stuer.base_view.viewinterface.IBaseInfoView; import com.leelit.stuer.module_baseinfo.date.model.DateModel; import java.util.List; import okhttp3.ResponseBody; impor...
package com.leelit.stuer.module_baseinfo.date.presenter; /** * Created by Leelit on 2016/3/8. */ public class DatePresenter implements IPresenter { private DateModel mModel = new DateModel();
private IBaseInfoView mView;
3
SecUSo/privacy-friendly-weather
app/src/main/java/org/secuso/privacyfriendlyweather/activities/ForecastCityActivity.java
[ "@Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)\npublic abstract class AppDatabase extends RoomDatabase {\n public static final String DB_NAME = \"PF_WEATHER_DB.db\";\n static final int VERSION = 7;\n static...
import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; import android.widget.TextView; import andr...
package org.secuso.privacyfriendlyweather.activities; public class ForecastCityActivity extends BaseActivity implements IUpdateableCityUI { private WeatherPagerAdapter pagerAdapter; private MenuItem refreshActionButton; private MenuItem rainviewerButton; private int cityId = -1; private View...
AppDatabase db = AppDatabase.getInstance(this);
0
elefher/CpuHandler
src/com/cpu/handler/MainActivity.java
[ "public class CpuGpuFreqVoltages {\n\n\t/*private final static String cpufreq_sys_volts = \"/sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels\";\n\tprivate final static String gpufreq_sys_volts = \"/sys/devices/system/cpu/cpufreq/vdd_table/vdd_levels_GPU\";\n\t* gpufreq_sys_volts is an unsued feature!!!\n\t*/\n\...
import java.util.ArrayList; import android.app.Activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.text.SpannableString; import android.text.method.LinkMovementMethod; import android.text.util.Linkify; import android.u...
package com.cpu.handler; public class MainActivity extends Activity { ArrayList<String> items; Activity that = this; private StartAppAd startAppAd = new StartAppAd(this); @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); ...
startActivity(new Intent().setClass(that, ControlCpu.class)
2
JoelGodOfwar/SinglePlayerSleep
1.13_2.13.43.1/src/com/github/joelgodofwar/sps/SinglePlayerSleep.java
[ "public class ChatColorUtils \r\n{\r\n public static String setColors(String s)\r\n {\r\n\t return s.replace(\"&0\", \"\" + ChatColor.BLACK).replace(\"&1\", \"\" + ChatColor.DARK_BLUE)\r\n\t \t\t.replace(\"&2\", \"\" + ChatColor.DARK_GREEN).replace(\"&3\", \"\" + ChatColor.DARK_AQUA)\r\n\t \t\t.replace(\...
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.nio.file.CopyOption; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.Standa...
String damsg = "{\"text\":\"broadcastString\"}"; String msgcolor1 = ChatColorUtils.setColorsByName(getConfig().getString("sleepmsgcolor", "YELLOW")); damsg = damsg.replace("broadcastString", message); sendJson(damsg); //SendJsonMessages.SendAllJsonMessage(damsg, "", world); //getServer().broadcastM...
nick = Format.color(nick);
5
hoko/hoko-android
hoko/src/main/java/com/hokolinks/Hoko.java
[ "public class AnnotationParser {\n\n // Route link\n\n /**\n * Get the route annotated with DeeplinkRoute on a certain class.\n *\n * @param classObject A classObject (usually an activity).\n * @return The route string.\n */\n private static String routeFromClass(Class classObject) {\n ...
import android.content.Context; import com.hokolinks.deeplinking.AnnotationParser; import com.hokolinks.deeplinking.Deeplinking; import com.hokolinks.model.App; import com.hokolinks.model.exceptions.SetupCalledMoreThanOnceException; import com.hokolinks.model.exceptions.SetupNotCalledYetException; import com.hokolinks....
package com.hokolinks; /** * Hoko is an easy-to-use Framework to handle Deeplinking and the Analytics around it. * * This is a simple drop-in class for handling incoming deeplinks. * With the Hoko framework you can map routes to your activities, add handlers that trigger when * deeplinks are the point of entry ...
HokoLog.e(new SetupCalledMoreThanOnceException());
5
graywolf336/CasinoSlots
src/main/java/com/craftyn/casinoslots/actions/impl/CommandAction.java
[ "public class CasinoSlots extends JavaPlugin {\r\n private Economy economy = null;\r\n private PluginManager pm = null;\r\n private Towny towny = null;\r\n private WorldGuardPlugin worldGuard = null;\r\n private Update update;\r\n private int updateCheckTask;\r\n\r\n public boolean useTowny = f...
import org.bukkit.entity.Player; import com.craftyn.casinoslots.CasinoSlots; import com.craftyn.casinoslots.actions.Action; import com.craftyn.casinoslots.classes.Reward; import com.craftyn.casinoslots.classes.SlotType; import com.craftyn.casinoslots.exceptions.ActionLoadingException; import com.craftyn.casinoslots.uti...
package com.craftyn.casinoslots.actions.impl; /** * The command action. Usage: - command The command goes here * * @author graywolf336 * @since 3.0.0 * @version 1.0.0 */ public class CommandAction extends Action { private String name = "Command";
private CasinoSlots plugin;
0
rpgleparser/examples
rpgleparser-examples/src/main/java/fixed2free/SymbolTableBuilder.java
[ "public class ColumnInfo {\n\tprivate String fieldName;\n\tprivate String dataType;\n\tprivate String use;\n\tprivate Integer outputBufferPosition;\n\tprivate Integer inputBufferPosition;\n\tprivate Integer fieldLengthInBytes;\n\tprivate Integer digits;\n\tprivate Integer decimalPositions;\n\tprivate String fieldTe...
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; import org.antlr.v4.runtime.CommonToken; import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; import org.antl...
// curSym.addAttribute(category, value); } } @Override public void enterDir_copy(Dir_copyContext ctx) { // TODO Auto-generated method stub super.enterDir_copy(ctx); } @Override public void enterDir_define(Dir_defineContext ctx) { Symbol s = new Symbol(); s.setName(ctx.name.getText()); s.addAttribu...
HashMap<String, RecordFormat> recFmts = temp1.getRecordFormats();
4
bitsoex/bitso-java
src/test/java/com/bitso/BitsoMockTest.java
[ "@SuppressWarnings(\"serial\")\npublic class BitsoAPIException extends Exception {\n private int mErrorCode = 101;\n\n public BitsoAPIException() {\n super();\n }\n\n public BitsoAPIException(String message, Throwable cause, boolean enableSuppression,\n boolean writableStackTrace) {\n ...
import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; import com.bitso.exceptions.BitsoAPIE...
package com.bitso; public class BitsoMockTest extends BitsoTest { private BookInfo[] mockAvailableBooks; private BitsoTicker[] mockTicker; private BitsoOrderBook mockOrderBook; private BitsoAccountStatus mockAccountStatus; private BitsoBalance mockBalance; private BitsoFee mockFee; priv...
BitsoPayloadException, BitsoServerException {
3
jVoid/jVoid
src/main/java/io/jvoid/instrumentation/provider/app/TrackerMethodInstrumenter.java
[ "public interface JVoidConfiguration {\n\n String dbUrl();\n\n String dbUsername();\n\n String dbPassword();\n\n String basePackage();\n\n String excludes();\n\n String includes();\n\n Boolean heuristicExcludeCglib();\n\n Boolean heuristicExcludeJacoco();\n\n Boolean heuristicExcludeGroov...
import com.google.inject.Inject; import io.jvoid.configuration.JVoidConfiguration; import io.jvoid.execution.JVoidExecutionContext; import io.jvoid.instrumentation.JVoidInstrumentationHelperHolder; import io.jvoid.instrumentation.provider.ProviderUtil; import io.jvoid.instrumentation.provider.api.MethodInstrumenter; im...
package io.jvoid.instrumentation.provider.app; /** * The {@code MethodInstrumenter} for the application classes. For each method, * we notify of its execution under the running test. In that way we are going to * be able to check whether a certain test involves this method, re-executing the * test in case the me...
JClass jClass = jClassHolder.getJClassUnderInstrumentation();
6
Bigkoo/Android-PickerView
pickerview/src/main/java/com/bigkoo/pickerview/builder/OptionsPickerBuilder.java
[ "public class PickerOptions {\n\n //constant\n private static final int PICKER_VIEW_BTN_COLOR_NORMAL = 0xFF057dff;\n private static final int PICKER_VIEW_BG_COLOR_TITLE = 0xFFf5f5f5;\n private static final int PICKER_VIEW_COLOR_TITLE = 0xFF000000;\n private static final int PICKER_VIEW_BG_COLOR_DEFAU...
import android.content.Context; import android.graphics.Typeface; import android.support.annotation.ColorInt; import android.view.View; import android.view.ViewGroup; import com.bigkoo.pickerview.configure.PickerOptions; import com.bigkoo.pickerview.listener.CustomListener; import com.bigkoo.pickerview.listener.OnOptio...
*/ public OptionsPickerBuilder setDividerColor(@ColorInt int dividerColor) { mPickerOptions.dividerColor = dividerColor; return this; } /** * Set item divider line type. * * @param dividerType enum Type {@link WheelView.DividerType} */ public OptionsPickerBuilde...
public <T> OptionsPickerView<T> build() {
3
Samourai-Wallet/sentinel-android
app/src/main/java/com/samourai/sentinel/sweep/SendFactory.java
[ "public class SamouraiSentinel {\n\n private static NetworkParameters networkParams = null;\n\n private static HashMap<String,String> xpubs = null;\n private static HashMap<String,String> legacy = null;\n private static HashMap<String,String> bip49 = null;\n private static HashMap<String,String> bip8...
import android.content.Context; import android.widget.Toast; import com.samourai.sentinel.SamouraiSentinel; import com.samourai.sentinel.hd.HD_WalletFactory; import org.bitcoinj.core.Address; import org.bitcoinj.core.AddressFormatException; import org.bitcoinj.core.Coin; import org.bitcoinj.core.DumpedPrivateKey; impor...
} Transaction signedTx = signTransaction(unsignedTx, keyBag); if(signedTx == null) { return null; } else { String hexString = new String(Hex.encode(signedTx.bitcoinSerialize())); if(hexString.length() > (100 * 1024)) { To...
final P2SH_P2WPKH p2shp2wpkh = new P2SH_P2WPKH(key.getPubKey(), SamouraiSentinel.getInstance().getCurrentNetworkParams());
2
Chanven/CommonPullToRefresh
cptr_demo/src/com/chanven/cptr/demo/GridViewAtivity.java
[ "public class PtrClassicFrameLayout extends PtrFrameLayout {\n\n private PtrClassicDefaultHeader mPtrClassicHeader;\n\n public PtrClassicFrameLayout(Context context) {\n super(context);\n initViews();\n }\n\n public PtrClassicFrameLayout(Context context, AttributeSet attrs) {\n supe...
import com.chanven.lib.cptr.loadmore.OnLoadMoreListener; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.support.v7.app.AppCompatActivity; import android.view.LayoutInflater; import android.view.View; import android.v...
/* Copyright 2015 chanven Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distribu...
public void onRefreshBegin(PtrFrameLayout frame) {
2
WeDevelopTeam/HeroVideo-master
app/src/main/java/com/github/bigexcalibur/herovideo/mvp/detail/ui/VideoDetailsActivity.java
[ "public abstract class RxBaseActivity extends RxAppCompatActivity implements ThemePickDialog.ClickListener, IRxBaseView {\n\n private Unbinder bind;\n private RxBaseViewPresenter mRxBaseViewPresenter;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInsta...
import android.annotation.SuppressLint; import android.app.Activity; import android.content.Intent; import android.content.res.ColorStateList; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.support.design.widget.AppBarLayout; import android.support.design.widget.Collaps...
package com.github.bigexcalibur.herovideo.mvp.detail.ui; /** * 视频详情界面 */ public class VideoDetailsActivity extends RxBaseActivity { @BindView(R.id.toolbar) Toolbar mToolbar; @BindView(R.id.collapsing_toolbar) CollapsingToolbarLayout mCollapsingToolbarLayout; @BindView(R.id.video_preview) ...
.load(UrlHelper.getClearVideoPreviewUrl(imgUrl))
3
joelhockey/jacknji11
src/main/java/org/pkcs11/jacknji11/jffi/JFFI_CK_C_INITIALIZE_ARGS.java
[ "public class CK_C_INITIALIZE_ARGS {\n\n /**\n * True if application threads which are executing calls to the library may not use native operating system calls to\n * spawn new threads; false if they may.\n */\n public static final long CKF_LIBRARY_CANT_CREATE_OS_THREADS = 0x00000001;\n /** Tru...
import org.pkcs11.jacknji11.NativePointer; import org.pkcs11.jacknji11.NativePointerByReference; import jnr.ffi.Struct; import jnr.ffi.annotations.Delegate; import jnr.ffi.byref.PointerByReference; import org.pkcs11.jacknji11.CK_C_INITIALIZE_ARGS; import org.pkcs11.jacknji11.CK_C_INITIALIZE_ARGS.CK_CREATEMUTEX; import ...
/* * Copyright 2010-2011 Joel Hockey (joel.hockey@gmail.com). All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the ri...
public long invoke(NativePointerByReference mutex) {
6
byoutline/CachedField
eventbuscachedfield/src/main/java/com/byoutline/eventbuscachedfield/EventBusCachedFieldWithArgBuilder.java
[ "public interface ProviderWithArg<RETURN_TYPE, ARG_TYPE> {\n\n RETURN_TYPE get(ARG_TYPE arg);\n}", "@AutoValue\npublic abstract class DbCacheArg<ARG_TYPE> {\n\n public static <ARG_TYPE> DbCacheArg<ARG_TYPE> create(@Nullable ARG_TYPE arg, @Nonnull FetchType fetchType) {\n return new AutoValue_DbCacheA...
import com.byoutline.cachedfield.ProviderWithArg; import com.byoutline.cachedfield.dbcache.DbCacheArg; import com.byoutline.cachedfield.dbcache.DbCachedValueProviderWithArg; import com.byoutline.cachedfield.dbcache.DbWriterWithArg; import com.byoutline.eventbuscachedfield.internal.EventIBus; import com.byoutline.ibusca...
package com.byoutline.eventbuscachedfield; /** * Fluent interface builder of {@link EventBusCachedField}. If you do not like * fluent interface create {@link EventBusCachedField} by one of its constructors. * * @param <RETURN_TYPE> Type of object to be cached. * @author Sebastian Kacprzak <sebastian.kacprzak at...
private static class ConstructorWrapper<RETURN_TYPE, ARG_TYPE> implements CachedFieldWithArgConstructorWrapper<RETURN_TYPE, ARG_TYPE, EventBus, EventBusCachedFieldWithArg<RETURN_TYPE, ARG_TYPE>> {
6
google/agera
agera/src/test/java/com/google/android/agera/RepositoryDisposerTest.java
[ "@NonNull\npublic static <F, T> Function<F, T> staticFunction(@NonNull final T object) {\n return new StaticProducer<>(object);\n}", "@NonNull\n@SuppressWarnings(\"unchecked\")\npublic static <T> Predicate<T> falsePredicate() {\n return FALSE_CONDICATE;\n}", "@NonNull\n@SuppressWarnings(\"unchecked\")\npublic...
import static com.google.android.agera.Functions.staticFunction; import static com.google.android.agera.Predicates.falsePredicate; import static com.google.android.agera.Predicates.truePredicate; import static com.google.android.agera.Repositories.repositoryWithInitialValue; import static com.google.android.agera.Repos...
/* * Copyright 2015 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 applica...
.check(truePredicate()).orEnd(staticFunction(BREAK_VALUE))
2
jenkinsci/tikal-multijob-plugin
src/test/java/com/tikal/jenkins/plugins/multijob/test/PhaseJobsConfigTest.java
[ "@Restricted(NoExternalUse.class)\npublic class MultiJobParametersAction extends ParametersAction {\n\n private List<ParameterValue> parameters;\n\n public MultiJobParametersAction(@Nonnull List<ParameterValue> parameters) {\n super(parameters);\n this.parameters = parameters;\n }\n\n publ...
import com.tikal.jenkins.plugins.multijob.MultiJobParametersAction; import hudson.model.Action; import hudson.model.ParameterValue; import hudson.model.TaskListener; import hudson.model.AbstractBuild; import hudson.model.AbstractProject; import hudson.model.Cause.UserIdCause; import hudson.model.CauseAction; import hud...
PhaseJobsConfig pjc = new PhaseJobsConfig("dummy", "dummyAlias", "", true, null, KillPhaseOnJobResultCondition.NEVER, false, false, "", 0, false, false, "",false, false); List<Action> actions = pjc.getActions(mjb, TaskListener.NULL, projectB, true); // check single ParametersAction created assertEquals(1, ac...
MultiJobProject projectA = new MultiJobProject(Hudson.getInstance(), "ssss");
2
Tanaguru/Contrast-Finder
contrast-finder-hsv/src/main/java/org/opens/color/finder/hsv/ColorFinderRgb.java
[ "public abstract class AbstractColorFinder implements ColorFinder {\n\n private static final Logger LOGGER = Logger.getLogger(AbstractColorFinder.class);\n private static final float MAX_HUE = 360.0f;\n private static final float MIN_HUE = 1.0f;\n private static final float MAX_COEFFICIENT_LEVEL = 2.5f;...
import java.awt.Color; import java.util.Map; import org.apache.log4j.Logger; import org.opens.colorfinder.AbstractColorFinder; import org.opens.colorfinder.result.ColorCombinaison; import org.opens.colorfinder.result.factory.ColorCombinaisonFactoryImpl; import org.opens.colorfinder.result.factory.ColorResultFactoryImpl...
/* * Contrast Finder * Copyright (C) 2008-2013 Open-S Company * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later ve...
newColor = ColorConverter.offsetRgbColor(newColor,
4
JoshuaD84/HypnosMusicPlayer
src/net/joshuad/hypnos/library/Track.java
[ "public class Hypnos extends Application {\n\n\tprivate static final Logger LOGGER = Logger.getLogger( Hypnos.class.getName() );\n\t\n\tpublic enum ExitCode {\n\t\tNORMAL,\n\t\tUNKNOWN_ERROR,\n\t\tAUDIO_ERROR, \n\t\tUNSUPPORTED_OS\n\t}\n\t\n\tpublic enum OS {\n\t\tWIN_XP ( \"Windows XP\" ),\n\t\tWIN_VISTA ( \"Windo...
import java.awt.image.BufferedImage; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.nio.channels.ClosedByInterruptException; import java.nio.file.DirectoryStream; imp...
package net.joshuad.hypnos.library; public class Track implements Serializable, AlbumInfoSource { private static transient final Logger LOGGER = Logger.getLogger( Track.class.getName() ); private static final long serialVersionUID = 1L; public static final int NO_TRACK_NUMBER = -885533; public enu...
return Utils.isImageFile ( entry );
4
ground-context/ground
modules/common/test/edu/berkeley/ground/common/model/usage/LineageGraphVersionTest.java
[ "public static String convertFromClassToString(Object object) {\n return Json.stringify(Json.toJson(object));\n}", "public static Object convertFromStringToClass(String body, Class<?> klass) {\n return Json.fromJson(Json.parse(body), klass);\n}", "public static String readFromFile(String filename) throws Grou...
import static edu.berkeley.ground.common.util.ModelTestUtils.convertFromClassToString; import static edu.berkeley.ground.common.util.ModelTestUtils.convertFromStringToClass; import static edu.berkeley.ground.common.util.ModelTestUtils.readFromFile; import static org.junit.Assert.assertEquals; import static org.junit.As...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
final String expected = convertFromClassToString(convertFromStringToClass(readFromFile
1
ResearchStack/ResearchStack
skin/src/main/java/org/researchstack/skin/task/OnboardingTask.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 org.researchstack.backbone.result.StepResult; import org.researchstack.backbone.result.TaskResult; import org.researchstack.backbone.step.Step; import org.researchstack.backbone.task.Task; import org.researchstack.backbone.ui.step.body.NotImplementedStepBody; import org.researchstack.skin.R; import org.researchs...
package org.researchstack.skin.task; public abstract class OnboardingTask extends Task { public static final String SignUpInclusionCriteriaStepIdentifier = "InclusionCriteria"; public static final String SignUpEligibleStepIdentifier = "Eligible"; public static final String SignUpIneligibleStepIdentifier =...
StepResult<Boolean> stepResult = (StepResult<Boolean>) result.getStepResult(SignUpTask.SignUpInclusionCriteriaStepIdentifier);
0
heroku/heroku.jar
heroku-api-integration-tests/src/test/java/com/heroku/api/parser/JsonParseTest.java
[ "public class App implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n String id;\n String name;\n Domain domain_name;\n String created_at;\n App.Owner owner;\n String web_url;\n App.Stack stack;\n String requested_stack;\n String git_url;\n String buil...
import com.heroku.api.App; import com.heroku.api.Heroku; import com.heroku.api.exception.ParseException; import com.heroku.api.request.app.AppInfo; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.io.UnsupportedEncodingException; import java.lang.refl...
package com.heroku.api.parser; /** * @author mh * @since 04.01.12 */ public class JsonParseTest { private static final Type APP_LIST_TYPE = new TypeReference<List<App>>() { }.getType(); @DataProvider Object[][] getParsers() { return new Object[][]{{new GsonParser()}, {new JacksonParser(...
App a = new App().on(Heroku.Stack.Heroku18);
1
zznate/intravert-ug
src/main/java/io/teknek/intravert/action/impl/SliceAction.java
[ "public interface Action {\n void doAction(Operation operation, Response response, RequestContext request, ApplicationContext application);\n}", "public class Operation {\n private String type;\n private String id;\n private Map<String,Object> arguments;\n \n public Operation(){\n arguments = new HashMap...
import java.nio.charset.CharacterCodingException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.cassandra.db.ColumnFamily; import org.apache.cassandra.db.ConsistencyLevel; import org.apache.cassand...
package io.teknek.intravert.action.impl; public class SliceAction implements Action { @Override
public void doAction(Operation operation, Response response, RequestContext request,
1
godstale/retrowatch
RetroWatch_Android/RetroWatchLE/src/com/hardcopy/retrowatchle/contents/FeedManager.java
[ "public class HttpAsyncTask extends AsyncTask<Void, Integer, String> implements HttpInterface\n{\n\t// Global variables\n\tpublic static final String tag = \"HttpAsyncTask\";\n\t\n//\tprivate Map<String, String> mMap;\t// Disabled\n\tprivate int mType;\n\tprivate String mURL = null;\n\tprivate int mResultStatus = M...
import android.app.ActivityManager.RunningTaskInfo; import android.content.Context; import android.content.SharedPreferences; import android.content.res.Resources; import android.database.Cursor; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.hardcopy.retrowatchle.connectivity....
public class DataExtractThread extends Thread { //---------- Thread status public static final int THREAD_STATUS_ERROR = -1; public static final int THREAD_STATUS_IDLE = 0; public static final int THREAD_STATUS_UPDATING = 1; public static final int THREAD_STATUS_WAITING = 2; public static final int THREA...
HttpAsyncTask task = new HttpAsyncTask(mHTTPListener, type, requestURL, HttpInterface.REQUEST_TYPE_GET);
0
MHAVLOVICK/Sketchy
src/main/java/com/sketchy/plotter/impl/XYPlotterControllerProperties.java
[ "public class MetaData {\n\t\n\tprivate List<MetaDataGroup> metaDataGroups = new ArrayList<MetaDataGroup>();\n\tprivate String helpUrl=null;\n\n\tpublic List<MetaDataGroup> getMetaDataGroups() {\n\t\treturn metaDataGroups;\n\t}\n\t\n\tpublic void add(MetaDataGroup metaDataGroup){\n\t\tmetaDataGroups.add(metaDataGro...
import com.sketchy.metadata.MetaData; import com.sketchy.metadata.MetaDataGroup; import com.sketchy.metadata.MetaDataProperty; import com.sketchy.metadata.MetaDataProperty.AttributeType; import com.sketchy.plotter.PlotterController; import com.sketchy.plotter.PlotterControllerProperties;
/* 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...
public Class<? extends PlotterController> getImplementationClass() {
4
austinmiller/augustmc
examples/src/main/java/aug/script/examples/java/MongoUsingClient.java
[ "@SuppressWarnings(\"unused\")\npublic interface ProfileInterface {\n\n /**\n * <p>Send a string to the server.</p>\n *\n * <p>A newline will be automatically appended. Any existing newlines will be sent as well.</p>\n *\n * <p>This generates a high-priority event.</p>\n */\n void sen...
import aug.script.framework.ProfileInterface; import aug.script.framework.ReloadData; import aug.script.framework.RunnableReloader; import aug.script.framework.SchedulerInterface; import aug.script.framework.mongo.SchedulerObserver; import aug.script.framework.tools.Util; import org.mongodb.scala.MongoClient; import or...
package aug.script.examples.java; /** * <p>Example using Mongo. It is necessary to setup mongo tab. It can take some * time before initDB is called on the first load. After everything goes off, try * reloading to see how long it takes.</p> * * <p>MongoDB is supported on all platforms and highly flexible.</p...
public void init(ProfileInterface profileInterface, ReloadData reloadData) {
1
aksalj/africastalking-java
libs/sms/src/main/java/com/africastalking/SmsService.java
[ "public final class FetchMessageResponse {\n\n @SerializedName(\"SMSMessageData\")\n public SmsMessageData data;\n\n public static final class SmsMessageData {\n @SerializedName(\"Recipients\")\n public List<Message> messages = new ArrayList<>();\n }\n\n @Override\n public String toS...
import com.africastalking.sms.FetchMessageResponse; import com.africastalking.sms.FetchSubscriptionResponse; import com.africastalking.sms.Message; import com.africastalking.sms.Recipient; import com.africastalking.sms.SendMessageResponse; import com.africastalking.sms.Subscription; import com.africastalking.sms.Subscr...
* </p> * @param lastReceivedId * @param callback */ public void fetchMessages(String lastReceivedId, final Callback<List<Message>> callback) { sms.fetchMessages(mUsername, lastReceivedId).enqueue(makeCallback(new Callback<FetchMessageResponse>() { @Override public...
public SubscriptionResponse createSubscription(String shortCode, String keyword, String phoneNumber, String checkoutToken) throws IOException {
6
data-integrations/salesforce
src/e2e-test/java/io/cdap/plugin/salesforcebatchsource/stepsdesign/DesignTimeSteps.java
[ "public class SalesforcePropertiesPageActions {\n private static final Logger logger = LoggerFactory.getLogger(SalesforcePropertiesPageActions.class);\n\n static {\n SeleniumHelper.getPropertiesLocators(SalesforcePropertiesPage.class);\n }\n\n public static void fillReferenceName(String referenceName) {\n ...
import io.cdap.e2e.utils.CdfHelper; import io.cdap.plugin.salesforcebatchsource.actions.SalesforcePropertiesPageActions; import io.cdap.plugin.utils.SchemaTable; import io.cdap.plugin.utils.enums.SOQLQueryType; import io.cdap.plugin.utils.enums.SObjects; import io.cdap.plugin.utils.enums.SalesforceBatchSourceProperty; ...
/* * Copyright © 2022 Cask Data, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
SalesforceBatchSourceProperty.REFERENCE_NAME);
4
bingoogolapple/Android-Training
SmartBulb/src/com/bingoogol/smartbulb/engine/LightsController.java
[ "public class LightEntry implements Serializable, Comparable<LightEntry> {\r\n\r\n\tprivate static final long serialVersionUID = 7312139389339796315L;\r\n\r\n\t// 灯的状态\r\n\tprivate State state;\r\n\r\n\t// 灯泡id\r\n\tprivate String id;\r\n\r\n\t// 类型\r\n\tprivate String type;\r\n\r\n\t// 灯泡名称\r\n\tprivate String nam...
import java.util.ArrayList; import java.util.Iterator; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.os.Message; import android.util.Log; import com.bingoogol.smartbulb.domain.http.LightEntry; import com.bingoogol.smartbulb.domain.http.State; import com.bi...
package com.bingoogol.smartbulb.engine; /** * Light控制器 * * @author 王浩 bingoogol@sina.com */ public class LightsController { protected static final String TAG = "LightsController"; /** * 获取当前桥接器链接的所有灯的信息,每个点灯信息包括一个唯一id和指定的名称 * * @param lightCallback * 操作灯泡的回调接口 */ ...
public void getAllLights(LightCallback lightCallback) {
2
jshvarts/OfflineSampleApp
app/src/main/java/com/example/offline/di/CommentsActivityModule.java
[ "public class DeleteCommentUseCase {\n private final LocalCommentRepository localCommentRepository;\n\n public DeleteCommentUseCase(LocalCommentRepository localCommentRepository) {\n this.localCommentRepository = localCommentRepository;\n }\n\n public Completable deleteComment(Comment comment) {\...
import com.example.offline.domain.DeleteCommentUseCase; import com.example.offline.domain.GetCommentsUseCase; import com.example.offline.domain.LocalCommentRepository; import com.example.offline.domain.RemoteCommentRepository; import com.example.offline.domain.services.SyncCommentLifecycleObserver; import com.example.o...
package com.example.offline.di; /** * Define CommentsActivity-specific dependencies here. */ @Module public class CommentsActivityModule { @Provides
CommentsViewModelFactory provideCommentsViewModelFactory(GetCommentsUseCase getCommentsUseCase,
1
copygirl/copycore
src/net/mcft/copy/core/container/ContainerBase.java
[ "@Mod(modid = copycore.MOD_ID, version = \"@VERSION@\",\n guiFactory = \"net.mcft.copy.core.client.gui.CoreGuiFactory\")\npublic class copycore {\n\t\n\tpublic static final String MOD_ID = \"copycore\";\n\t\n\t@SidedProxy(clientSide = \"net.mcft.copy.core.proxy.ClientProxy\",\n\t serverSide = \"net.m...
import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import net.mcft.copy.core.copycore; import net.mcft.copy.core.client.gui.GuiContainerBase; import net.mcft.copy.core.inventory.slot.InventorySlots; import net.mcft.copy.core.inventory...
package net.mcft.copy.core.container; public class ContainerBase extends Container { // To anyone reading through the code of this class, // I promise, it made sense to put all of this in here, // even if it looks really messy. I hope you can make // some sense to you. public static final String TAG_TITLE ...
public Class<? extends GuiContainerBase> getGuiClass() { return GuiContainerBase.class; }
1
spacecowboy/NotePad
app/src/main/java/com/nononsenseapps/notepad/ui/widget/ListWidgetProvider.java
[ "public class Task extends DAO {\n\n\t// Used to separate tasks with due dates from completed and from tasks with\n\t// no date\n\tpublic static final String SECRET_TYPEID = \"secret_typeid\";\n\tpublic static final String SECRET_TYPEID2 = \"secret_typeid2\";\n\n\t// SQL convention says Table name should be \"singu...
import android.annotation.TargetApi; import android.app.PendingIntent; import android.appwidget.AppWidgetManager; import android.appwidget.AppWidgetProvider; import android.appwidget.AppWidgetProviderInfo; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Build; im...
/* * Copyright (c) 2015 Jonas Kalderstam. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is ...
Log.d("widgetwork", "CLICK ACTION RECEIVED");
6
linkedin/Spyglass
spyglass/src/main/java/com/linkedin/android/spyglass/suggestions/SuggestionsAdapter.java
[ "public interface Suggestible extends Parcelable {\n\n\t/**\n\t * Must be unique (useful for eliminating duplicate suggestions)\n\t *\n\t * @return int the suggestible id\n\t */\n\tint getSuggestibleId();\n\n\t/**\n\t * Main text for the given suggestion, as will be shown to the user. Note other data fields can\n\t...
import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import android.content.Context; import android.content.res.Resources; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import androidx.annotation.No...
/* * Copyright 2015 LinkedIn Corp. 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 law or...
private SuggestionsVisibilityManager mSuggestionsVisibilityManager;
2
baloise/rocket-chat-rest-client
src/main/java/com/github/baloise/rocketchatrestclient/RocketChatRestApiV1Groups.java
[ "public class Group extends Room {\n public Group() {\n super();\n this.setType(RoomType.PRIVATE_GROUP);\n }\n \n public Group(String name) {\n super();\n this.setType(RoomType.PRIVATE_GROUP);\n this.setName(name);\n }\n \n public Group(String id, String name)...
import java.io.IOException; import com.github.baloise.rocketchatrestclient.model.Group; import com.github.baloise.rocketchatrestclient.model.Room; import com.github.baloise.rocketchatrestclient.model.User; import com.github.baloise.rocketchatrestclient.requests.RoomAndUserRequest; import com.github.baloise.rocketchatre...
package com.github.baloise.rocketchatrestclient; public class RocketChatRestApiV1Groups { private static final String ROOM_ID_PARAM_KEY = "roomId"; private RocketChatClientCallBuilder callBuilder; protected RocketChatRestApiV1Groups(RocketChatClientCallBuilder callBuilder) { this.callBuilder = c...
RocketChatClientResponse res = this.callBuilder.buildCall(RocketChatRestApiV1.GroupsCreate, null, new RoomCreateRequest(group.getName(),group.getUsernames()));
4
Doridian/SteamMobileLib
src/main/java/de/doridian/steammobile/connection/MessageHandler.java
[ "public class Friend {\n\tpublic enum State {\n\t\tOFFLINE(0),\n\t\tONLINE(1),\n\t\tBUSY(2),\n\t\tAWAY(3),\n\t\tSNOOZE(4),\n\t\tINVALID(-1);\n\n\t\tint sid;\n\t\tState(int id) {\n\t\t\tsid = id;\n\t\t}\n\n\t\tpublic static State getByID(int id) {\n\t\t\tfor(State s : State.values()) {\n\t\t\t\tif(s.sid == id) retur...
import de.doridian.steammobile.friend.Friend; import de.doridian.steammobile.messages.Message; import de.doridian.steammobile.messages.PersonaRelationshipMessage; import de.doridian.steammobile.messages.PersonaStateMessage; import de.doridian.steammobile.methods.RequestException; import de.doridian.steammobile.methods....
package de.doridian.steammobile.connection; public class MessageHandler { private final SteamConnection connection; private final DefaultMessageListener defaultMessageListener; private String lastMessageID; private boolean isLoggedOn = false; public MessageHandler(SteamConnection connection) { this.connect...
Logon msg = new Logon(connection);
6
nchambers/probschemas
src/main/java/nate/probschemas/DomainVerbDetector.java
[ "public class CalculateIDF {\n private String _parsesDir = \"\";\n private String _outputDir = \".\";\n private String _outputPath = \"tokens.idf\";\n private String _outputLemmaPath = \"tokens-lemmas.idf\";\n private String _duplicatesPath = \"duplicates\";\n private Set<String> _duplicates;\n\n private boo...
import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import nate.CalculateIDF; import nate.CountVerbDepCorefs; import nate.IDFMap; import nate.util.Pair; import nate.WordEvent; import nate.util.SortableScore; import nate.util.U...
package nate.probschemas; /** * Takes two IDF counts: words from a single domain, and from a general corpus. * Given these counts, it detects the top words for that domain. There are a * couple approaches, the best seems to be relative frequency ratios. The * Filatova approach of domain conditional probability...
Util.scaleToUnit(arr);
6
marcb1/droid-ssh
scp/src/main/java/marc/scp/activities/AddFolderPair.java
[ "public class Constants\n{\n public final static String LOG_PREFIX = \"DROID_SSH.\";\n\n public final static String PREFERENCE_PARCEABLE = \"com.whomarc.scp.PREFERENCE\";\n public final static String FILE_PARCEABLE = \"com.whomarc.scp.FILE\";\n\n // terminal constants\n public final static String RIG...
import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import java.io.File; import java.util.ArrayL...
package marc.scp.activities; /** * Created by Marc on 5/15/14. */ public class AddFolderPair extends Activity { //singleton instances private Database _dbInstance;
private Dialogs _dialogInstance;
1
mapsforge/mapsforge
mapsforge-samples-android/src/main/java/org/mapsforge/samples/android/ClusterMapActivity.java
[ "public class LatLong implements Comparable<LatLong> {\n /**\n * The RegEx pattern to read WKT points.\n */\n private static final Pattern WKT_POINT_PATTERN = Pattern\n .compile(\".*POINT\\\\s?\\\\(([\\\\d\\\\.]+)\\\\s([\\\\d\\\\.]+)\\\\).*\");\n\n /**\n * The internal latitude value...
import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.view.Menu; import android.view.MenuItem; import android.view.Window; import android.widget.Toast; import org.mapsforge.core.graphics.*; import org.mapsforge.cor...
/* * Copyright 2014 Martin Vennekamp * Copyright 2015 mapsforge.org * Copyright 2019 devemux86 * * 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...
if (ManyDummyContent.MANYITEMS.isEmpty()) {
4
SilentChaos512/ScalingHealth
src/main/java/net/silentchaos512/scalinghealth/event/DifficultyEvents.java
[ "@Mod(ScalingHealth.MOD_ID)\npublic class ScalingHealth {\n public static final String MOD_ID = \"scalinghealth\";\n public static final String MOD_NAME = \"Scaling Health\";\n public static final String VERSION = \"2.5.3\";\n\n public static final Random random = new Random();\n\n public static fina...
import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.MobEntity; import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.INBT; import net.minecraft.util.text.StringTextComponent; import net.minecraf...
package net.silentchaos512.scalinghealth.event; @Mod.EventBusSubscriber(modid = ScalingHealth.MOD_ID) public final class DifficultyEvents { private static final boolean PRINT_DEBUG_INFO = true; public static final Marker MARKER = MarkerManager.getMarker("Difficulty"); private DifficultyEvents() {} ...
boolean exempt = SHDifficulty.isPlayerExempt((PlayerEntity) entity);
3
ivannp/tradelib
src/test/java/net/tradelib/core/AccountTest.java
[ "public class Account {\n public static final String DEFAULT_NAME = \"DefaultAccount\";\n \n private String name;\n \n private class Summary {\n LocalDateTime ts;\n double addition = 0.0;\n double withdrawal = 0.0;\n double interest = 0.0;\n double realizedPnl = 0.0;\n double...
import org.junit.Test; import com.opencsv.CSVReader; import static org.junit.Assert.*; import java.io.FileReader; import java.math.BigDecimal; import java.net.URI; import java.nio.file.Paths; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import net.tradelib.core....
// Copyright 2015 Ivan Popivanov // // 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 ...
PositionPnl posPnl = account.getPositionPnl(esInstrument);
2
jesuino/kie-ml
providers/kie-ml-weka/src/main/java/org/fxapps/ml/api/provider/impl/WekaKieMLProvider.java
[ "@XmlRootElement(name = \"input\")\npublic class Input {\n\t\n\t/**\n\t * An URL containing the payload to be converted. This accepts Java URL format.\n\t */\n\tprivate String url;\n\t\n\t/**\n\t * A text used in the predict\n\t */\n\tprivate String text;\n\t\n\t/**\n\t * Raw binary data\n\t */\n\tprivate byte[] ra...
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.StringReader; import java.net.URL; import java.util.HashMap; import org.fxapps.ml.api.model.Input; import org.fxapps.ml.api.model.Model; import org.fxapps.ml.api.model.Result; import org.fxapps.ml.api.provider.ML...
package org.fxapps.ml.api.provider.impl; /** * * The Weka provider implementation that can be used to make predictions based * on Weka classifiers * * @author wsiqueir * */ public class WekaKieMLProvider implements MLProvider { // TODO: THis is a very preliminary weka support as a proof of concept - // m...
public Result run(KieMLContainer kc, Model model, Input input) {
0
AlexanderMisel/gnubridge
src/main/java/org/gnubridge/core/bidding/rules/TakeoutDouble.java
[ "public class Hand {\n\tList<Card> cards;\n\n\t/**\n\t * Caching optimization for pruning played cards\n\t * and perhaps others\n\t */\n\tList<Card> orderedCards;\n\tSuit color;\n\tList<Card> colorInOrder;\n\n\tpublic Hand() {\n\t\tthis.cards = new ArrayList<Card>();\n\t}\n\n\tpublic Hand(Card... cards) {\n\t\tthis...
import java.util.Set; import org.gnubridge.core.Hand; import org.gnubridge.core.bidding.Auctioneer; import org.gnubridge.core.bidding.Bid; import org.gnubridge.core.bidding.Double; import org.gnubridge.core.bidding.PointCalculator; import org.gnubridge.core.deck.Suit; import org.gnubridge.core.deck.Trump;
package org.gnubridge.core.bidding.rules; public class TakeoutDouble extends BiddingRule { private final PointCalculator pc; public TakeoutDouble(Auctioneer a, Hand h) { super(a, h); pc = new PointCalculator(hand); } @Override protected boolean applies() { int HCP = pc.getHighCardPoints(); if ((auct...
protected Bid prepareBid() {
2
ralscha/wampspring
src/main/java/ch/rasc/wampspring/config/DefaultWampConfiguration.java
[ "public class EventMessenger {\n\n\tprivate final MessageChannel brokerChannel;\n\n\tprivate final MessageChannel clientOutboundChannel;\n\n\tprivate volatile long sendTimeout = -1;\n\n\tpublic EventMessenger(MessageChannel brokerChannel,\n\t\t\tMessageChannel clientOutboundChannel) {\n\n\t\tAssert.notNull(brokerCh...
import java.util.ArrayList; import java.util.List; import java.util.concurrent.Executor; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.CustomScopeConfigurer; import org.sprin...
for (WampConfigurer wc : this.configurers) { wc.configureClientInboundChannel(channel); } } @Bean public Executor clientInboundChannelExecutor() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setThreadNamePrefix("wampClientInboundChannel-"); executor.setCorePoolSize(Runtime....
public EventMessenger eventMessenger() {
0
ceefour/webdav-servlet
src/test/java/net/sf/webdav/methods/DoUnlockTest.java
[ "public interface ITransaction {\n\n Principal getPrincipal();\n\n}", "public interface IWebdavStore {\n\n /**\n * Life cycle method, called by WebdavServlet's destroy() method. Should be used to clean up resources.\n */\n void destroy();\n\n /**\n * Indicates that a new request or transac...
import java.io.ByteArrayInputStream; import java.io.PrintWriter; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import net.sf.webdav.ITransaction; import net.sf.webdav.IWebdavStore; import net.sf.webdav.StoredObject; import net.sf.webdav.WebdavStatus; import net.sf.webdav.l...
package net.sf.webdav.methods; public class DoUnlockTest extends MockTest { static IWebdavStore mockStore; static HttpServletRequest mockReq; static HttpServletResponse mockRes;
static ITransaction mockTransaction;
0
nextgis/android_maplib
src/main/java/com/nextgis/maplib/display/SimpleTiledPolygonStyle.java
[ "public abstract class GeoGeometry\n implements Serializable\n{\n protected static final long serialVersionUID = -1241179697270831761L;\n protected int mCRS;\n\n\n public boolean project(int toCrs)\n {\n return (mCRS == CRS_WGS84 && toCrs == CRS_WEB_MERCATOR ||\n mCRS == CRS...
import com.nextgis.maplib.datasource.GeoMultiPolygon; import com.nextgis.maplib.datasource.GeoPoint; import com.nextgis.maplib.datasource.GeoPolygon; import org.json.JSONException; import org.json.JSONObject; import java.util.List; import static com.nextgis.maplib.util.Constants.JSON_NAME_KEY; import static com.nextgis...
/* * Project: NextGIS Mobile * Purpose: Mobile GIS for Android. * Author: Dmitry Baryshnikov (aka Bishop), bishop.dev@gmail.com * Author: NikitaFeodonit, nfeodonit@yandex.com * Author: Stanislav Petriakov, becomeglory@gmail.com * ****************************************************************************...
public void onDraw(GeoGeometry geoGeometry, GISDisplay display) {
0
lambdazen/pixy
src/main/java/com/lambdazen/pixy/pipemakers/Is2.java
[ "public interface PipeMaker {\n\t/** Returns the signature as relationName + \"/\" + arity */\n\tpublic String getSignature();\n\n\t/** Given the bindings, this method returns a PixyPipe and adds any new replacements typically of the form x -> $x */\n\tpublic PixyPipe makePipe(List<PixyDatum> bindings, Map<String, ...
import java.util.List; import java.util.Map; import com.lambdazen.pixy.PipeMaker; import com.lambdazen.pixy.PixyDatum; import com.lambdazen.pixy.PixyDatumType; import com.lambdazen.pixy.PixyPipe; import com.lambdazen.pixy.VariableGenerator; import com.lambdazen.pixy.pipes.ConnectPipe; import com.lambdazen.pixy.pipes.Ev...
package com.lambdazen.pixy.pipemakers; public class Is2 implements PipeMaker { @Override public String getSignature() { return "(is)/2"; } @Override public PixyPipe makePipe(List<PixyDatum> bindings, Map<String, PixyDatum> replacements, VariableGenerator varGen) { // Eval pipe, then as() if var, match() i...
return new ConnectPipe(new EvalPipe(null, list), new MatchPipe(target.getAtomVarName()));
8
optimaize/command4j
src/test/java/com/optimaize/command4j/ext/extensions/loadlimit/maxconcurrent/MaxConcurrentRunningExtensionTest.java
[ "public interface CommandExecutor {\n\n /**\n * Executes it in the current thread, and blocks until it either finishes successfully or aborts by\n * throwing an exception.\n *\n * @param <A> argument\n * @param <R> Result\n */\n @NotNull\n <A, R> Optional<R> execute(@NotNull Command...
import com.google.common.base.Optional; import com.google.common.base.Stopwatch; import com.google.common.util.concurrent.ListenableFuture; import com.optimaize.command4j.CommandExecutor; import com.optimaize.command4j.CommandExecutorBuilder; import com.optimaize.command4j.CommandExecutorService; import com.optimaize.c...
package com.optimaize.command4j.ext.extensions.loadlimit.maxconcurrent; /** * @author Fabian Kessler */ public class MaxConcurrentRunningExtensionTest { /** * This must work: even though we run 10, and only 2 are allowed at once, only one is running at any given * time because we run with just 1 th...
CommandExecutorService executorService = commandExecutor.service(javaExecutor);
2
cesquivias/mumbler
lang/src/main/java/mumbler/truffle/TruffleMumblerMain.java
[ "@TypeSystemReference(MumblerTypes.class)\n@NodeInfo(language = \"Mumbler Language\", description = \"The abstract base node for all expressions\")\npublic abstract class MumblerNode extends Node {\n @CompilationFinal\n private SourceSection sourceSection;\n\n @CompilationFinal\n private boolean isTail ...
import java.io.Console; import java.io.File; import java.io.FileReader; import java.io.IOException; import com.beust.jcommander.JCommander; import com.oracle.truffle.api.frame.FrameSlot; import com.oracle.truffle.api.frame.MaterializedFrame; import com.oracle.truffle.api.source.Source; import mumbler.truffle.node.Mumbl...
package mumbler.truffle; public class TruffleMumblerMain { private static final String PROMPT = "\u27AB "; private static Flags flags; public static void main(String[] args) throws IOException { assert args.length < 2 : "Mumbler only accepts 1 or 0 files"; flags = new Flags(); ...
Converter converter = new Converter(null, flags.tailCallOptimizationEnabled);
2
NessComputing/components-ness-httpclient
client/src/test/java/com/nesscomputing/httpclient/TestVariousThings.java
[ "public final class HttpClient implements Closeable\n{\n private final HttpClientFactory httpClientFactory;\n\n /**\n * Creates a new HTTP client with the default implementation (currently Apache HTTPClient 4) and default settings.\n */\n public HttpClient()\n {\n this(new HttpClientDefau...
import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.notNullValue; import java.io.IOException; import java.util.List; import javax.servlet.http.Cookie; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.jun...
/** * Copyright (C) 2012 Ness Computing, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
private final HttpClientResponseHandler<String> responseHandler = new ContentResponseHandler<String>(new StringResponseConverter());
5
kittylyst/ocelotvm
src/test/java/ocelot/TestInterp.java
[ "public static JVMValue entry(double d) {\n return new JVMValue(JVMType.D, Double.doubleToLongBits(d));\n}", "public final class OtKlassParser {\n\n// private \n private final byte[] clzBytes;\n private final String filename;\n\n private int major = 0;\n private int minor = 0;\n\n private int...
import static ocelot.JVMValue.entry; import ocelot.classfile.OtKlassParser; import static ocelot.classfile.OtKlassParser.ACC_PRIVATE; import static ocelot.classfile.OtKlassParser.ACC_PUBLIC; import static ocelot.classfile.OtKlassParser.ACC_STATIC; import static org.junit.Assert.assertEquals; import static org.junit.Ass...
package ocelot; /** * @author ben */ public class TestInterp { private InterpMain im; private SharedKlassRepo repo; @Before public void setup() { repo = SharedKlassRepo.of(); } private byte[] buf; @Test @Ignore public void hello_world_loaded_from_file_executes() th...
OtKlass klass = OtKlassParser.of(null, buf, fName);
1
StumbleUponArchive/hbase
src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java
[ "public final class HConstants {\n /**\n * Status codes used for return values of bulk operations.\n */\n public enum OperationStatusCode {\n NOT_RUN,\n SUCCESS,\n BAD_FAMILY,\n SANITY_CHECK_FAILURE,\n FAILURE;\n }\n\n /** long constant for zero */\n public static final Long ZERO_L = Long.va...
import java.io.EOFException; import java.io.IOException; import java.io.InterruptedIOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; import java.util.LinkedList; import java.ut...
// It was probably already split. logWriters.put(region, BAD_WRITER); continue; } else { logWriters.put(region, wap); } } wap.w.append(entry); outputSink.updateRegionMaximumEditLogSeqNum(entry); editsCount++; // ...
Path rootdir = FSUtils.getRootDir(conf);
5
groupon/vertx-memcache
src/main/java/com/groupon/vertx/memcache/command/MemcacheCommand.java
[ "public class MemcacheException extends RuntimeException {\n private static final long serialVersionUID = -386882705199382789L;\n\n public MemcacheException(String message) {\n super(message);\n }\n}", "public class MemcacheCommandResponse {\n private final JsendStatus status;\n private fina...
import io.vertx.core.Handler; import com.groupon.vertx.memcache.MemcacheException; import com.groupon.vertx.memcache.client.response.MemcacheCommandResponse; import com.groupon.vertx.memcache.parser.DeleteLineParser; import com.groupon.vertx.memcache.parser.LineParser; import com.groupon.vertx.memcache.parser.LineParse...
/** * Copyright 2014 Groupon.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 applicable law or agreed to...
parser = new TouchLineParser();
8
Condroidapp/android
Condroid/src/main/java/cz/quinix/condroid/database/DataProvider.java
[ "public class Annotation implements Serializable, DBInsertable {\r\n\r\n\tprivate static final long serialVersionUID = 29890241539328629L;\r\n\r\n\tprivate int pid;\r\n\r\n\tprivate String author;\r\n\r\n\tprivate String imdb;\r\n\r\n\tprivate String title;\r\n\r\n\tprivate AnnotationType type = new AnnotationType(...
import android.database.Cursor; import android.util.Log; import com.google.inject.Inject; import com.google.inject.Singleton; import org.joda.time.DateTimeZone; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; import java.text.DateFormat; import java.text.ParseException...
package cz.quinix.condroid.database; @Singleton public class DataProvider { public static int ITEMS_PER_PAGE = 40; @Inject private CondroidDatabase mDatabase;
private Convention con;
1
Aurilux/Cybernetica
src/main/java/com/vivalux/cyb/item/module/ModuleLexica.java
[ "@Mod(modid = CYBModInfo.MOD_ID,\n name = CYBModInfo.MOD_NAME,\n guiFactory = CYBModInfo.GUI_FACTORY,\n version = CYBModInfo.MOD_VERSION)\npublic class Cybernetica {\n\t@Instance(CYBModInfo.MOD_ID)\n\tpublic static Cybernetica instance;\n\n\t@SidedProxy(clientSide = CYBModInfo.CLIENT_PROXY, serverSide = CY...
import com.vivalux.cyb.Cybernetica; import com.vivalux.cyb.api.Implant.ImplantType; import com.vivalux.cyb.api.Module; import com.vivalux.cyb.handler.GuiHandler; import com.vivalux.cyb.init.CYBItems; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; ...
package com.vivalux.cyb.item.module; public class ModuleLexica extends Module { public ModuleLexica(String str, String str2) { CYBItems.setItem(this, str, str2); this.setCompatibles(EnumSet.of(ImplantType.TORSO)); } @Override public ItemStack onItemRightClick(ItemStack stack, World w...
Cybernetica.proxy.currentLexicaTopic = "home";
0
awslabs/amazon-sqs-java-messaging-lib
src/test/java/com/amazon/sqs/javamessaging/message/SQSMessageTest.java
[ "public static final String APPROXIMATE_RECEIVE_COUNT = \"ApproximateReceiveCount\";", "public static final String JMSX_DELIVERY_COUNT = \"JMSXDeliveryCount\";", "public class SQSMessagingClientConstants {\n\n public static final String UNSUPPORTED_METHOD = \"Unsupported Method\";\n\n public static final ...
import static com.amazon.sqs.javamessaging.SQSMessagingClientConstants.APPROXIMATE_RECEIVE_COUNT; import static com.amazon.sqs.javamessaging.SQSMessagingClientConstants.JMSX_DELIVERY_COUNT; import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org...
msg.checkBodyWritePermissions(); msg.setBodyWritePermissions(false); try { msg.checkBodyWritePermissions(); } catch (MessageNotWriteableException exception) { assertEquals("Message body is not writable", exception.getMessage()); } msg.checkPro...
systemAttributes.put(APPROXIMATE_RECEIVE_COUNT, "100");
0
michel-kraemer/vertx-lang-typescript
src/test/java/de/undercouch/vertx/lang/typescript/TestExamplesRunner.java
[ "public class InMemoryCache implements Cache {\r\n // TODO use soft keys\r\n private Map<Source, String> cache = new HashMap<>();\r\n \r\n @Override\r\n public String get(Source src) {\r\n return cache.get(src);\r\n }\r\n\r\n @Override\r\n public void put(Source src, String value) {\r\n cache.put(src,...
import de.undercouch.vertx.lang.typescript.compiler.Source; import de.undercouch.vertx.lang.typescript.compiler.SourceFactory; import de.undercouch.vertx.lang.typescript.compiler.TypeScriptCompiler; import de.undercouch.vertx.lang.typescript.compiler.V8Compiler; import java.io.File; import java.io.IOException; im...
// Copyright 2015 Michel Kraemer // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
public Source getSource(String filename, String baseFilename) throws IOException {
3
sing-group/bicycle
src/test/java/es/cnio/bioinfo/bicycle/testsimulated/SimulatedNonDirectionalDataAnalysisTest.java
[ "public class Project {\n\n\tprivate static final Logger logger = Logger.getLogger(Project.class.getSimpleName());\n\n\tpublic static final String WORKING_DIRECTORY = \"workingDirectory\" + File.separator;\n\tpublic static final String OUTPUT_DIRECTORY = \"output\" + File.separator;\n\tpublic static final String CO...
import static org.junit.Assert.assertTrue; import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.P...
/* Copyright 2012 Daniel Gonzalez Peña, Osvaldo Graña This file is part of the bicycle Project. bicycle Project is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opti...
private Project prepareProject() throws IOException {
0
goaop/idea-plugin
src/com/aopphp/go/pattern/CodePattern.java
[ "public class PointcutQueryLanguage extends Language {\n public static final PointcutQueryLanguage INSTANCE = new PointcutQueryLanguage();\n\n private PointcutQueryLanguage() {\n super(\"Go! AOP Pointcut query\");\n }\n}", "public interface AnnotatedAccessPointcut extends PsiElement {\n\n @NotNul...
import com.aopphp.go.PointcutQueryLanguage; import com.aopphp.go.psi.AnnotatedAccessPointcut; import com.aopphp.go.psi.AnnotatedExecutionPointcut; import com.aopphp.go.psi.AnnotatedWithinPointcut; import com.aopphp.go.psi.PointcutTypes; import com.intellij.patterns.ElementPattern; import com.intellij.patterns.PlatformP...
package com.aopphp.go.pattern; /** * Code pattern contains some useful patterns for matching items */ public class CodePattern extends PlatformPatterns { /** * Matching name part after left parenthesis and one of annotation pointcut type * \@execution(<className>) * \@access(<className>) ...
psiElement(PointcutTypes.T_NAME_PART).withSuperParent(2, AnnotatedExecutionPointcut.class),
2
idega/se.idega.idegaweb.commune.accounting
src/java/se/idega/idegaweb/commune/accounting/invoice/presentation/RegularInvoiceEntriesList.java
[ "public abstract class AccountingBlock extends CommuneBlock {\n\t\n\tpublic final static String IW_ACCOUNTING_BUNDLE_IDENTIFER = \"se.idega.idegaweb.commune.accounting\";\n\tprivate AccountingBusiness business;\n\tprivate AccountingSession session;\n\t\n\t\n\tpublic void _main(IWContext iwc) throws Exception{\n\t\t...
import java.rmi.RemoteException; import java.sql.Date; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import javax.ejb.CreateException; import javax.ejb.EJBException; import javax.ejb.EJBLocalHome; import javax.ejb.EJBLocalObject; impo...
RegularInvoiceEntryHome home = getRegularInvoiceEntryHome(); RegularInvoiceEntry entry = null; if (home != null){ try{ entry = home.findByPrimaryKey(pk); }catch(FinderException ex){ ex.printStackTrace(); } } return entry; } private RegularInvoiceEntryHome getRegularInvoiceEntryHome() { R...
ButtonPanel bp = new ButtonPanel(this);
1