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
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 * 操作灯泡的回调接口 */ ...
final State state = new State();
1
DDoS/JICI
src/main/java/ca/sapon/jici/lexer/literal/number/LongLiteral.java
[ "public class Environment {\n // TODO make me thread safe\n private static final Map<String, Class<?>> DEFAULT_CLASSES = new HashMap<>();\n private final Map<String, Class<?>> classes = new LinkedHashMap<>(DEFAULT_CLASSES);\n private final Map<String, Variable> variables = new LinkedHashMap<>();\n\n ...
import ca.sapon.jici.lexer.TokenID; import ca.sapon.jici.util.StringUtil; import ca.sapon.jici.evaluator.Environment; import ca.sapon.jici.evaluator.EvaluatorException; import ca.sapon.jici.evaluator.type.PrimitiveType; import ca.sapon.jici.evaluator.type.Type; import ca.sapon.jici.evaluator.value.Value; import ca.sapo...
/* * This file is part of JICI, licensed under the MIT License (MIT). * * Copyright (c) 2015-2016 Aleksi Sapon <http://sapon.ca/jici/> * * 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...
String source = StringUtil.reduceSign(getSource());
8
nextgis/nextgislogger
app/src/main/java/com/nextgis/logger/livedata/InfoExternalsFragment.java
[ "public class PreferencesActivity extends PreferenceActivity implements ServiceConnection {\n private ArduinoEngine mArduinoEngine;\n private AudioEngine mAudioEngine;\n\n @Override\n protected void onCreate(Bundle savedInstance) {\n super.onCreate(savedInstance);\n\n Intent intent = getIn...
import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceActivity; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.LinearLayout; import android.widget.ProgressB...
} private void fillTextViews() { if (mLayoutData.getChildCount() > 0) { ArrayList<InfoItem> infoArray = getData(); for (int i = 0; i < getSensorsCount(); i++) ((TextView) mLayoutData.getChildAt(i).findViewById(R.id.tv_data)).setText(infoArray.get(i).getColumns()....
preferencesActivity.setClass(getActivity(), PreferencesActivity.class);
0
jasonbaldridge/maul
src/main/java/edu/berkeley/nlp/lm/map/HashNgramMap.java
[ "public class ConfigOptions implements Serializable\n{\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = 1L;\n\n\t@Option(gloss = \"Number of longs (8 bytes) used as a block for variable length compression\")\n\tpublic int compressedBlockSize = 16;\n\n\t@Option(gloss = \"Parameter \\\"k\\\" whi...
import java.util.Arrays; import java.util.Collections; import java.util.List; import edu.berkeley.nlp.lm.ConfigOptions; import edu.berkeley.nlp.lm.ContextEncodedNgramLanguageModel.LmContextInfo; import edu.berkeley.nlp.lm.array.CustomWidthArray; import edu.berkeley.nlp.lm.array.LongArray; import edu.berkeley.nlp.lm.col...
package edu.berkeley.nlp.lm.map; /** * * @author adampauls * * @param <T> */ public final class HashNgramMap<T> extends AbstractNgramMap<T> implements ContextEncodedNgramMap<T> { /** * */ private static final long serialVersionUID = 1L; @PrintMemoryCount private ExplicitWordHashMap[] explicitMaps; ...
public static <T> HashNgramMap<T> createImplicitWordHashNgramMap(final ValueContainer<T> values, final ConfigOptions opts,
0
DeanLee77/Nadia
src/testingPackage/DeanTest.java
[ "public class FactBooleanValue<T> extends FactValue{\n\t\n\tprivate boolean value;\n\tprivate Boolean defaultValue; // it is a Boolean Object type because if it is a primitive type then default value is already defined as 'false' \n\t\n\tpublic FactBooleanValue(boolean booleanValue) {\n\t\tsetValue(booleanValue);\n...
import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.script.ScriptEngine; import javax.script...
package testingPackage; public class DeanTest { public static void main(String[] args) { List<Node> lst = new ArrayList<>(); lst.add(new ValueConclusionLine("haha",Tokenizer.getTokens("haha"))); System.out.println(lst.get(0).getNodeName()); lst.remove(lst.get(0)); System.out.println(lst.size()); ...
System.out.println((dp&(DependencyType.getNot()|DependencyType.getKnown())) == (DependencyType.getNot()|DependencyType.getKnown()));
3
VanetSim/VanetSim
src/vanetsim/gui/controlpanels/EditSettingsControlPanel.java
[ "public final class ReRenderManager extends Thread{\r\n\t\r\n\t/** The only instance of this class (singleton). */\r\n\tprivate static final ReRenderManager INSTANCE = new ReRenderManager();\r\n\t\r\n\t/** A variable indicating if a ReRender is scheduled. */\r\n\tprivate boolean doRender_ = false;\r\n\t\r\n\t/**\r\...
import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; import java.text.NumberFormat; import javax...
/* * VANETsim open source project - http://www.vanet-simulator.org * Copyright (C) 2008 - 2013 Andreas Tomandl, Florian Scheuer, Bernhard Gruber * * 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 Softwa...
TextAreaLabel jlabel1 = new TextAreaLabel(Messages.getString("EditSettingsControlPanel.intervalNote1") + SimulationMaster.TIME_PER_STEP + Messages.getString("EditSettingsControlPanel.intervalNote2")); //$NON-NLS-1$ //$NON-NLS-2$
1
SamuelGjk/DiyCode
app/src/main/java/moe/yukinoneko/diycode/module/favorites/FavoritesListAdapter.java
[ "public class Topic {\n @SerializedName(\"id\") public int id; // 话题 id\n @SerializedName(\"title\") public String title; // 标题\n @SerializedName(\"created_at\") public Date createdAt; // 创建时间\n @Seri...
import moe.yukinoneko.diycode.R; import moe.yukinoneko.diycode.bean.Topic; import moe.yukinoneko.diycode.list.BaseRecyclerListAdapter; import moe.yukinoneko.diycode.module.topic.details.TopicDetailsActivity; import moe.yukinoneko.diycode.module.user.UserActivity; import moe.yukinoneko.diycode.tool.ImageLoadHelper; impo...
/* * Copyright (c) 2017 SamuelGjk <samuel.alva@outlook.com> * * This file is part of DiyCode * * DiyCode is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your o...
ImageLoadHelper.loadAvatar(
4
Tanaguru/Tanaguru-Survey
tanaguru-survey-web-app/src/main/java/org/opens/tanaguru/survey/controller/TanaguruSurveyController.java
[ "public interface ProcessResultDataServiceDecorator extends ProcessResultDataService{\n\n /**\n * \n * @param audit\n * @param test\n * @return\n */\n ProcessResult getNetResultFromAuditAndTest(Audit audit, Test test);\n\n}", "public class ForbiddenPageException extends RuntimeException{...
import java.io.IOException; import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; import java.util.NoSuchElementException; import javax.persistence.NoResultException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; imp...
/* * Tanaguru - Automated webpage assessment * Copyright (C) 2008-2011 Open-S Company * * This file is part of Tanaguru. * * Tanaguru 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 vers...
private DetailedSurveyListFactory detailedSurveyListFactory;
7
hamadmarri/Biscuit
main/java/com/biscuit/commands/release/AddRelease.java
[ "public class ColorCodes {\n\n\t// with normal background\n\tpublic static final String RESET = \"\\u001B[0m\";\n\tpublic static final String BLACK = \"\\u001B[30;1m\";\n\tpublic static final String RED = \"\\u001B[31;1m\";\n\tpublic static final String GREEN = \"\\u001B[32;1m\";\n\tpublic static final String YELLO...
import java.io.IOException; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import com.biscuit.ColorCodes; import com.biscuit.commands.Command; import com.biscuit.factories.DateCompleter; import com.biscuit.models.Project; import com.biscuit.models.Release; import com.biscuit.model...
package com.biscuit.commands.release; public class AddRelease implements Command { ConsoleReader reader = null; Project project = null; Release release = new Release(); public AddRelease(ConsoleReader reader, Project project) { super(); this.reader = reader; this.project = project; } public boolean...
reader.println(ColorCodes.GREEN + "Release \"" + release.name + "\" has been added!" + ColorCodes.RESET);
0
jenkinsci/github-plugin
src/main/java/org/jenkinsci/plugins/github/internal/GitHubClientCacheOps.java
[ "@Extension\npublic class GitHubWebHook implements UnprotectedRootAction {\n private static final Logger LOGGER = LoggerFactory.getLogger(GitHubWebHook.class);\n public static final String URLNAME = \"github-webhook\";\n\n // headers used for testing the endpoint configuration\n public static final Stri...
import com.cloudbees.jenkins.GitHubWebHook; import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.hash.Hashing; import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import okhttp3.Cache; import org.apache.commons.i...
package org.jenkinsci.plugins.github.internal; /** * Class with util functions to operate GitHub client cache * * @author lanwen (Merkushev Kirill) * @since 1.14.0 */ public final class GitHubClientCacheOps { private static final Logger LOGGER = LoggerFactory.getLogger(GitHubClientCacheOps.class); pri...
final Set<String> actualNames = from(configs).filter(withEnabledCache()).transform(toCacheDir())
5
mibo/janos
janos-core/src/main/java/org/apache/olingo/odata2/janos/processor/core/data/store/JpaAnnotationDataStore.java
[ "public final class ReadOptions {\n private FilterExpression filter;\n private OrderByExpression orderBy;\n private String skipToken;\n private Integer skip;\n private Integer top;\n\n /**\n * None read options.\n *\n * @return the read options\n */\n public static ReadOptions none() {\n return ne...
import org.apache.olingo.odata2.api.annotation.edm.EdmKey; import org.apache.olingo.odata2.janos.processor.api.data.ReadOptions; import org.apache.olingo.odata2.janos.processor.api.data.ReadResult; import org.apache.olingo.odata2.janos.processor.api.data.store.DataStore; import org.apache.olingo.odata2.janos.processor....
/* * Copyright 2014 The Apache Software Foundation. * * 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...
throw new AnnotationRuntimeException("Unable to create instance of class '" + dataTypeClass + "'.", e);
5
flixel-gdx/flixel-gdx-box2d
flixel-gdx-box2d-examples/src/org/flxbox2d/examples/TestCompound.java
[ "public class B2FlxBox extends B2FlxShape\n{\n\t/**\n\t * Holds the center of an oriented box.\n\t */\n\tprivate Vector2 _center;\n\t\n\t/**\n\t * If the center is filled, it will be a oriented box, otherwise \n\t * it will be an axis-aligned box.\n\t * @param x\t\t\tThe X-coordinate of the point in space.\n\t * @p...
import org.flixel.FlxG; import org.flxbox2d.collision.shapes.B2FlxBox; import org.flxbox2d.collision.shapes.B2FlxCircle; import org.flxbox2d.collision.shapes.B2FlxPolygon; import org.flxbox2d.collision.shapes.B2FlxSprite; import org.flxbox2d.common.B2FlxV2; import org.flxbox2d.common.math.B2FlxMath;
package org.flxbox2d.examples; /** * * @author Ka Wing Chin */ public class TestCompound extends PlayState { @Override public void create() { super.create(); title.setText("Compound Shapes"); B2FlxSprite body; B2FlxCircle cd1; B2FlxCircle cd2; float x; int i; for(i = 0; i < 5; i++) { ...
add(new B2FlxPolygon(320, (-61.5f + 55* -i + 300), new float[][][]{
2
chudooder/FEMultiplayer
src/net/fe/lobbystage/LobbyChatBox.java
[ "public class FEMultiplayer extends Game{\n\tprivate static Stage currentStage;\n\tprivate static Client client;\n\tprivate static Player localPlayer;\n\t\n\tpublic static Player turn;\n\tpublic static ClientOverworldStage map;\n\tpublic static ClientLobbyStage lobby;\n\tpublic static ConnectStage connect;\n\t\n\t/...
import java.util.List; import net.fe.FEMultiplayer; import net.fe.FEResources; import net.fe.network.message.ChatMessage; import org.lwjgl.input.Keyboard; import org.newdawn.slick.Color; import chu.engine.Game; import chu.engine.KeyboardEvent; import chu.engine.MouseEvent; import chu.engine.anim.AudioPlayer; import chu...
package net.fe.lobbystage; public class LobbyChatBox extends TextInputBox { private static final Color UNFOCUSED = new Color(0x58543c); private static final Color FOCUSED = new Color(0x817b58); private static final Color CURSOR = new Color(0xeeeeee); public LobbyChatBox() { super(6, 294, 250, 20, "default...
AudioPlayer.playAudio("cancel", 1, 1);
3
cloudera/director-spi
src/main/java/com/cloudera/director/spi/v2/provider/util/AbstractInstanceProvider.java
[ "public interface Configured {\n\n /**\n * Returns the unmodifiable map of configuration parameter values.\n *\n * @param localizationContext the localization context\n * @return the unmodifiable map of configuration parameter values\n */\n Map<String, String> getConfiguration(LocalizationContext locali...
import com.cloudera.director.spi.v2.model.Configured; import com.cloudera.director.spi.v2.model.Instance; import com.cloudera.director.spi.v2.model.InstanceTemplate; import com.cloudera.director.spi.v2.model.LocalizationContext; import com.cloudera.director.spi.v2.provider.InstanceProvider; import com.cloudera.director...
// (c) Copyright 2015 Cloudera, 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...
public AbstractInstanceProvider(Configured configuration,
0
julianctni/mensaDD
app/src/main/java/com/pasta/mensadd/MainActivity.java
[ "public class AutostartRegister {\n\tprivate static final String TAG = AutostartRegister.class.getName();\n public static void register(PackageManager pm, boolean autostart) {\n Log.i(TAG, \"Autostart is \" + autostart);\n int enabled = autostart ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED :\n...
import android.app.PendingIntent; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; import android.content.res.ColorStateList; import android.graphics.Color; import android.nfc.NfcAdapter; import android.nfc.Tag; import android.nfc.tech.IsoDep; import android....
FragmentController.showMapFragment(getSupportFragmentManager()); updateToolbar(id, getString(R.string.nav_map)); break; case R.id.nav_card_history: FragmentController.showBalanceHistoryFragment(getSupportFragmentManager()); upda...
BalanceHistoryFragment fragment = (BalanceHistoryFragment) getSupportFragmentManager().findFragmentByTag(FragmentController.TAG_BALANCE_HISTORY);
7
michael-rapp/AndroidMaterialValidation
library/src/main/java/de/mrapp/android/validation/Constraints.java
[ "public class ConjunctiveConstraint<Type> implements Constraint<Type> {\n\n /**\n * A array, which contains the single constraints, the constraint consists of.\n */\n private Constraint<Type>[] constraints;\n\n /**\n * Creates a new constraint, which allows to combine multiple constraints in a ...
import androidx.annotation.NonNull; import java.util.regex.Pattern; import de.mrapp.android.validation.constraints.ConjunctiveConstraint; import de.mrapp.android.validation.constraints.DisjunctiveConstraint; import de.mrapp.android.validation.constraints.NegateConstraint; import de.mrapp.android.validation.constraints....
/* * Copyright 2015 - 2019 Michael Rapp * * 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...
return DisjunctiveConstraint.create(constraints);
1
socialsensor/storm-focused-crawler
src/main/java/eu/socialsensor/focused/crawler/StreamMonitor.java
[ "public class EntityExtractionBolt extends BaseRichBolt {\n\n\tprivate static final long serialVersionUID = 7935961067953158062L;\n\n\tprivate OutputCollector _collector;\n\tprivate Logger _logger;\n\n\tprivate String _serializedClassifier;\n\tprivate AbstractSequenceClassifier<CoreLabel> _classifier = null;\n\t\t\...
import java.net.UnknownHostException; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.configuration.XMLConfiguration; import org.apache.log4j.Logger; import eu.socialsensor.focused.crawler.bolts.items.EntityExtractionBolt; import eu.socialsensor.focused.crawler.bolts.items.Even...
package eu.socialsensor.focused.crawler; public class StreamMonitor { private static Logger logger = Logger.getLogger(StreamMonitor.class); /** * @author Manos Schinas - manosetro@iti.gr */ public static void main(String[] args) throws UnknownHostException { XMLConfiguration config; try { if(arg...
eventDetector = new EventDetectionBolt(5, 60);
1
mgilangjanuar/GoSCELE
app/src/main/java/com/mgilangjanuar/dev/goscele/modules/main/adapter/CourseRecyclerViewAdapter.java
[ "public abstract class BaseFragment extends Fragment {\n\n @LayoutRes\n public abstract int findLayout();\n\n @Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(findLayout(), ...
import android.app.AlertDialog; import android.content.Context; import android.content.Intent; import android.graphics.Color; import android.util.TypedValue; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.LinearLayout; import and...
package com.mgilangjanuar.dev.goscele.modules.main.adapter; /** * Created by mgilangjanuar (mgilangjanuar@gmail.com) * * @since 2017 */ public class CourseRecyclerViewAdapter extends BaseRecyclerViewAdapter<CourseRecyclerViewAdapter.ViewHolder> { private Context context; private BaseFragment fragment...
if (fragment instanceof CourseAllFragment && model.isCurrent) {
5
copygirl/copycore
src/net/mcft/copy/core/util/InventoryUtils.java
[ "public class ItemIdentifier {\n\t\n\tprivate final Item item;\n\tprivate final int damage;\n\tprivate final NBTTagCompound data;\n\t\n\tprivate int hashCode;\n\tprivate boolean calculatedHashCode = false;\n\t\n\t// Since, in my opinion, null data and an empty compound are\n\t// equivalent, ItemIdentifiers should n...
import net.mcft.copy.core.api.ItemIdentifier; import net.mcft.copy.core.inventory.IInventoryEnumerable; import net.mcft.copy.core.inventory.IInventoryEnumerable.Element; import net.mcft.copy.core.inventory.InventoryWrapper; import net.mcft.copy.core.inventory.util.InventorySpaceEnumerator; import net.mcft.copy.core.mis...
package net.mcft.copy.core.util; public final class InventoryUtils { private InventoryUtils() { } /** Returns an enumerable version of the inventory. */
public static IInventoryEnumerable asIterable(IInventory inventory) {
1
Darkona/AdventureBackpack2
src/main/java/com/darkona/adventurebackpack/item/ItemHose.java
[ "public class CreativeTabAB\n{\n\n public static final CreativeTabs ADVENTURE_BACKPACK_CREATIVE_TAB = new CreativeTabs(ModInfo.MOD_ID.toLowerCase())\n {\n @Override\n public Item getTabIconItem()\n {\n return ModItems.machete;\n }\n\n @Override\n public Str...
import com.darkona.adventurebackpack.CreativeTabAB; import com.darkona.adventurebackpack.common.Constants; import com.darkona.adventurebackpack.common.ServerActions; import com.darkona.adventurebackpack.fluids.FluidEffectRegistry; import com.darkona.adventurebackpack.init.ModFluids; import com.darkona.adventurebackpack...
package com.darkona.adventurebackpack.item; /** * Created by Darkona on 12/10/2014. */ public class ItemHose extends ItemAB { IIcon drinkIcon; IIcon spillIcon; IIcon suckIcon; final byte HOSE_SUCK_MODE = 0; final byte HOSE_SPILL_MODE = 1; final byte HOSE_DRINK_MODE = 2; public ItemHose...
nbt.setString("fluid", Utils.capitalize(tank.getFluid().getFluid().getName()));
6
edwise/complete-spring-project
src/integration-test/java/com/edwise/completespring/controllers/ITBookControllerTest.java
[ "@Slf4j\n@SpringBootApplication\npublic class Application {\n\n @Autowired\n private DataLoader dataLoader;\n\n public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }\n\n @Bean\n CommandLineRunner init(@Value(\"${db.resetAndLoadOnStartup:true}\") bool...
import com.edwise.completespring.Application; import com.edwise.completespring.dbutils.DataLoader; import com.edwise.completespring.entities.Author; import com.edwise.completespring.entities.Book; import com.edwise.completespring.entities.Publisher; import com.edwise.completespring.testutil.BookBuilder; import com.edwi...
package com.edwise.completespring.controllers; /** * TODO this tests are executed with the same data that is charged only ONCE... maybe is needed to load data with each test. */ @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = {Application.class}, webEnvironment = SpringBootTest.WebEnviro...
.publisher(new Publisher().setName(PUBLISHER_NAME_TEST1).setCountry(PUBLISHER_COUNTRY_TEST1).setOnline(false))
4
razerdp/FriendCircle
module_main/src/main/java/com/razerdp/github/module/main/ui/TimeLineFragment.java
[ "public abstract class BaseAppFragment extends BaseLibFragment {\n}", "public class RandomUtil {\n\n private static final String CHAR_LETTERS = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n private static final String CHAR_NUMBER = \"0123456789\";\n private static final String CHAR_ALL = CH...
import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.razerdp.github.common.base.BaseAppFragment; import com.razerdp.github.lib.utils.RandomUtil; import com.razerdp.github.lib.utils.UIHelper; import com.razerdp.github.module.main.R; import com.razerdp.github.module.main.R...
package com.razerdp.github.module.main.ui; /** * Created by 大灯泡 on 2019/8/3. * <p> * 朋友圈时间线fragment */ public class TimeLineFragment extends BaseAppFragment { @BindView(R2.id.rv_content) RecyclerView mRvContent; @Override public int layoutId() { return R.layout.fragment_time_line; ...
List<SimpleMultiType> multiTypes = new ArrayList<>();
5
idega/com.idega.openid
src/java/com/idega/openid/server/dao/impl/OpenIDServerDAOImpl.java
[ "public class OpenIDConstants {\n\n\tpublic static final String IW_BUNDLE_IDENTIFIER = \"com.idega.openid\";\n\n\tpublic static final String PROPERTY_OPENID_PROVIDER = \"openid.provider\";\n\tpublic static final String PROPERTY_SERVER_URL = \"openid.server.url\";\n\tpublic static final String PROPERTY_END_POINT_URL...
import java.util.Date; import java.util.List; import javax.persistence.Query; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import com...
package com.idega.openid.server.dao.impl; @Repository("openIDServerDAO") @Transactional(readOnly = true) @Scope(BeanDefinition.SCOPE_SINGLETON) public class OpenIDServerDAOImpl extends GenericDaoImpl implements OpenIDServerDAO { @Transactional(readOnly = false) public void createAuthorizedAttribute(String userU...
log.setStatus(OpenIDConstants.STATUS_SUCCESS);
0
jmimo/netty-icap
src/test/java/ch/mimo/netty/handler/codec/icap/socket/SocketTests.java
[ "public final class DataMockery extends Assert {\r\n\r\n\tprivate DataMockery() {\r\n\r\n\t}\r\n\t\r\n\tpublic static final ChannelBuffer createWhiteSpacePrefixedOPTIONSRequest() throws UnsupportedEncodingException {\r\n\t\tChannelBuffer buffer = ChannelBuffers.dynamicBuffer();\r\n\t\taddLine(buffer,\" OPTIONS ica...
import java.io.UnsupportedEncodingException; import java.nio.charset.Charset; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; import org.junit.Test; import ch.mimo.netty.handler.codec....
/******************************************************************************* * Copyright 2012 Michael Mimo Moratti * * 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://ww...
IcapResponse response = (IcapResponse)event.getMessage();
4
rvep/dev_backend
src/main/java/io/abnd/rvep/security/rest/FirebaseAuthController.java
[ "public class FirebaseAuthVerificationRequest implements AuthVerificationRequest {\n\n private String idToken;\n private String email;\n private String provider;\n\n @Override\n public String getIdToken() { return this.idToken; }\n @Override\n public String getEmail() { return this.email; }\n ...
import io.abnd.rvep.security.model.impl.FirebaseAuthVerificationRequest; import io.abnd.rvep.security.model.impl.FirebaseAuthVerificationResponse; import io.abnd.rvep.security.model.intf.AuthVerificationResponse; import io.abnd.rvep.security.service.impl.FirebaseAuthVerifier; import io.abnd.rvep.security.service.impl.R...
package io.abnd.rvep.security.rest; @RestController @RequestMapping("/api/auth/firebase") public class FirebaseAuthController { private FirebaseAuthVerifier fbAuthVerifier; private RvepJwtGenerator jwtGenerator; public FirebaseAuthController(FirebaseAuthVerifier fbAuthVerifier, ...
new FirebaseAuthVerificationResponse();
1
tteguayco/JITRAX
src/es/ull/etsii/jitrax/database/DatabaseComparator.java
[ "public class Attribute {\n\n\tprivate String name;\n\tprivate DataType dataType;\n\t\n\tpublic Attribute(String aName, DataType aDataType) {\n\t\tname = aName;\n\t\tdataType = aDataType;\n\t}\n\t\n\tpublic boolean equals(Object object) {\n\t\tif (object != null && object instanceof Attribute) {\n\t\t\tAttribute an...
import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import es.ull.etsii.jitrax.adt.Attribute; import es.ull.etsii.jitrax.adt.DataType; import es.ull.etsii.jitrax.adt.Databa...
package es.ull.etsii.jitrax.database; /** * Compares a Database object with a database in a DBMS * (it checks whether they have the same attributes, domains, etc). */ public class DatabaseComparator { private static final String NUMBER_REGEXP = "\\d+(\\.\\d+)?";
private Database database;
2
hai-nguyen/Impala
impala/src/main/java/hainguyen/impala/feature/userdetails/view/UserDetailsActivity.java
[ "public class ImpalaApplication extends Application {\n\n private AppComponent appComponent;\n private UserComponent userComponent;\n\n public static ImpalaApplication getInstance() {\n return ContextProvider.getContext();\n }\n\n public void onCreate() {\n super.onCreate();\n Co...
import android.content.Intent; import android.os.Bundle; import android.support.design.widget.Snackbar; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.TextView; import javax.inject.Inject; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick;...
package hainguyen.impala.feature.userdetails.view; public class UserDetailsActivity extends BaseActivity implements UserDetailsView { @Inject
UserDetailsPresenter detailsPresenter;
3
x7hub/Calendar_lunar
src/edu/bupt/calendar/month/MonthByWeekAdapter.java
[ "public class CalendarController {\n private static final boolean DEBUG = false;\n private static final String TAG = \"CalendarController\";\n private static final String REFRESH_SELECTION = Calendars.SYNC_EVENTS + \"=?\";\n private static final String[] REFRESH_ARGS = new String[] { \"1\" };\n priva...
import edu.bupt.calendar.Event; import edu.bupt.calendar.R; import edu.bupt.calendar.Utils; import java.util.ArrayList; import java.util.HashMap; import android.content.Context; import android.content.res.Configuration; import android.text.format.Time; import android.util.Log; import android.view.GestureDetector; impor...
if(Log.isLoggable(TAG, Log.DEBUG)) { Log.d(TAG, "Processed " + events.size() + " events."); } mEventDayList = eventDayList; refresh(); } @SuppressWarnings("unchecked") @Override public View getView(int position, View convertView, ViewGroup parent) { i...
mController.sendEvent(mContext, EventType.GO_TO, day, day, -1,
1
ls1110924/ImmerseMode
immerse/src/main/java/com/yunxian/immerse/impl/TpSbTlNbwFCImmerseMode.java
[ "public final class ImmerseConfiguration {\n\n final ImmerseType mImmerseTypeInKK;\n final ImmerseType mImmerseTypeInL;\n\n public final boolean lightStatusBar;\n public final boolean coverCompatMask;\n public final int coverMaskColor;\n\n private ImmerseConfiguration(@NonNull ImmerseType immerseT...
import android.annotation.TargetApi; import android.app.Activity; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.Build; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.view.Window; import andr...
package com.yunxian.immerse.impl; /** * @author AShuai * @email ls1110924@gmail.com * @date 2017/2/2 18:45 */ @TargetApi(Build.VERSION_CODES.LOLLIPOP) public class TpSbTlNbwFCImmerseMode extends AbsImmerseMode { private final ActivityConfig mActivityConfig; // 兼容性StatusBar,用作设置Drawable时兼容处理使用 pri...
public TpSbTlNbwFCImmerseMode(@NonNull Activity activity, @NonNull ImmerseConfiguration immerseConfiguration) {
0
chrismoos/facebook-bb-sdk
src/samples/strawberry/FriendsListScreen.java
[ "public class FBUser implements User {\r\n\r\n\tprivate JSONObject jsonObject = null;\r\n\tprivate String root = \"me\";\r\n\tprivate String accessToken;\r\n\r\n\tprotected Logger log = Logger.getLogger(getClass());\r\n\r\n\t/**\r\n\t * Create a user instance.\r\n\t * \r\n\t * @param facebook\r\n\t * the...
import java.util.Hashtable; import java.util.Vector; import net.rim.device.api.system.Bitmap; import net.rim.device.api.system.Display; import net.rim.device.api.ui.DrawStyle; import net.rim.device.api.ui.Font; import net.rim.device.api.ui.Graphics; import net.rim.device.api.ui.component.LabelField; import net....
/** * Copyright (c) E.Y. Baskoro, Research In Motion Limited. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to...
String url = Facebook.API_URL + "/" + id + "/picture?type=square";
1
mast-group/naturalize
src/main/java/renaming/tools/CodeReviewAssistant.java
[ "public abstract class AbstractIdentifierRenamings implements\n\t\tINGramIdentifierRenamer {\n\n\tprivate static final Logger LOGGER = Logger\n\t\t\t.getLogger(AbstractIdentifierRenamings.class.getName());\n\n\tprotected AbstractNGramLM ngramLM;\n\n\tprotected double addScopePriors(final String identifierName,\n\t\...
import java.io.File; import java.io.IOException; import java.text.DecimalFormat; import java.util.Collection; import java.util.List; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.HelpFormatter; import org.apache.commons.cli.OptionBuilder; impor...
/** * */ package renaming.tools; /** * A code review assistant. Given a file and either a repository or a * pre-trained LM returns a sorted list of suggested renamings for that file. * * @author Miltos Allamanis <m.allamanis@ed.ac.uk> * */ public class CodeReviewAssistant { /** * @param args * @th...
renamer = new BaseIdentifierRenamings(ngramLM);
1
TrumanDu/AutoProgramming
src/main/java/com/aibibang/web/system/controller/SysRoleController.java
[ "public class BaseController {\r\n\r\n\t/**\r\n\t * 将前台传递过来的日期格式的字符串,自动转化为Date类型\r\n\t * \r\n\t * @param binder\r\n\t */\r\n\t@InitBinder\r\n\tpublic void initBinder(ServletRequestDataBinder binder) {\r\n\r\n\t\tbinder.registerCustomEditor(Date.class, new DateConvertEditor());\r\n\t}\r\n\t\r\n\t/**\r\n\t * 抽取由逗号分隔的...
import java.util.HashMap; import java.util.List; import java.util.Map; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframewo...
package com.aibibang.web.system.controller; /** * * 角色管理controller * * <pre> * 历史记录: * 2016-08-01 22:42 King * 新建文件 * </pre> * * @author * <pre> * SD * King * PG * King * UT * * MA * </pre> * @version $Rev$ * * <p/> $Id$ * */ @Controller @RequestMapping("/sysRole") public class SysR...
private SysRoleService sysRoleService;
6
all4you/redant
redant-core/src/main/java/com/redant/core/controller/ProxyInvocation.java
[ "public class InvocationException extends Exception{\n\tprivate static final long serialVersionUID = 1L;\n\n public InvocationException(String message, Throwable cause) {\n super(message, cause);\n }\n\n}", "public class ValidationException extends RuntimeException{\n\tprivate static final long seria...
import com.redant.core.common.exception.InvocationException; import com.redant.core.common.exception.ValidationException; import com.redant.core.common.util.GenericsUtil; import com.redant.core.common.util.HttpRequestUtil; import com.redant.core.context.RedantContext; import com.redant.core.converter.PrimitiveConverter...
package com.redant.core.controller; /** * 封装了ControllerProxy的调用过程 * @author houyi.wh * @date 2017-10-20 */ public class ProxyInvocation { private static Invocation invocation = new Invocation(); public static Object invoke(ControllerProxy proxy) throws Exception{ Object controller = proxy.getController()...
Map<String, List<String>> paramMap = HttpRequestUtil.getParameterMap(RedantContext.currentContext().getRequest());
4
weiboad/fiery
server/src/main/java/org/weiboad/ragnar/server/controller/web/APIStatisticPage.java
[ "@Component\n@ConfigurationProperties(prefix = \"fiery\")\npublic class FieryConfig {\n\n private int keepdataday;\n\n private String dbpath;\n\n private String indexpath;\n\n private Boolean kafkaenable;\n\n private String kafkaserver;\n\n private String kafkagroupid;\n\n private String mailfr...
import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.Req...
package org.weiboad.ragnar.server.controller.web; @Controller public class APIStatisticPage { //@Autowired //IndexService indexHelper; @Autowired FieryConfig fieryConfig; @Autowired APIStatisticTimeSet apiStatisticTimeSet; Logger log = LoggerFactory.getLogger(PutMetalog.class); @...
ConcurrentHashMap<String, APIStatisticStruct> urllist = apiStatisticTimeSet.getDaySharder(shardtime, false);
2
ZhangJiupeng/AgentX
src/main/java/cc/agentx/server/net/nio/XConnectHandler.java
[ "public class XRequest {\n private Type atyp;\n private String host;\n private int port;\n private int subsequentDataLength;\n private Channel channel = Channel.TCP;\n\n public XRequest(Type atyp, String host, int port, int subsequentDataLength) {\n this.atyp = atyp;\n this.host = ho...
import cc.agentx.protocol.request.XRequest; import cc.agentx.protocol.request.XRequestResolver; import cc.agentx.server.Configuration; import cc.agentx.server.cache.DnsCache; import cc.agentx.util.KeyHelper; import cc.agentx.wrapper.Wrapper; import io.netty.bootstrap.Bootstrap; import io.netty.buffer.ByteBuf; import io...
/* * Copyright 2017 ZhangJiupeng * * 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...
int delay = KeyHelper.generateRandomInteger(2000, 5000);
4
FedericoPecora/coordination_oru
src/main/java/se/oru/coordination/coordination_oru/tests/TestTrajectoryEnvelopeCoordinatorWithMotionPlanner9.java
[ "public class ConstantAccelerationForwardModel implements ForwardModel {\n\t\t\n\tprivate double maxAccel, maxVel;\n\tprivate double temporalResolution = -1;\n\tprivate int trackingPeriodInMillis = 0;\n\tprivate int controlPeriodInMillis = -1;\n\t\n\tpublic ConstantAccelerationForwardModel(double maxAccel, double m...
import java.io.File; import java.util.Comparator; import java.util.logging.Level; import org.metacsp.multi.spatioTemporal.paths.Pose; import org.metacsp.multi.spatioTemporal.paths.PoseSteering; import org.metacsp.multi.spatioTemporal.paths.TrajectoryEnvelope; import org.metacsp.utility.logging.MetaCSPLogging; import co...
package se.oru.coordination.coordination_oru.tests; @DemoDescription(desc = "One-shot navigation of 2 robots showing multiple overlapping critical sections.") public class TestTrajectoryEnvelopeCoordinatorWithMotionPlanner9 { public static void main(String[] args) throws InterruptedException { double MAX_ACC...
ReedsSheppCarPlanner rsp = new ReedsSheppCarPlanner();
5
hishidama/embulk-parser-poi_excel
src/main/java/org/embulk/parser/poi_excel/bean/PoiExcelColumnBean.java
[ "public enum PoiExcelColumnValueType {\r\n\t/** cell value */\r\n\tCELL_VALUE(true, true),\r\n\t/** cell formula */\r\n\tCELL_FORMULA(true, true),\r\n\t/** cell style */\r\n\tCELL_STYLE(true, false),\r\n\t/** cell font */\r\n\tCELL_FONT(true, false),\r\n\t/** cell comment */\r\n\tCELL_COMMENT(true, false),\r\n\t/**...
import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.poi.ss.util.CellReference; import org.embulk.config.ConfigException; import org.embulk.parser.poi_excel.PoiExcelColumnValueType; import org.embulk.parser.poi_excel.PoiExcelParserPlug...
package org.embulk.parser.poi_excel.bean; public class PoiExcelColumnBean { protected final PoiExcelSheetBean sheetBean; protected final Column column; protected final List<ColumnOptionTask> columnTaskList = new ArrayList<>(); protected final List<ColumnCommonOptionTask> allTaskList = new ArrayList<>...
private Optional<PoiExcelCellAddress> cellAddress;
5
mingzuozhibi/mzzb-server
src/main/java/mingzuozhibi/action/DiscSpiderController.java
[ "public interface JmsMessage {\n\n void info(String format, Object... args);\n\n void success(String format, Object... args);\n\n void notify(String format, Object... args);\n\n void warning(String format, Object... args);\n\n void danger(String format, Object... args);\n\n void info(String messag...
import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import mingzuozhibi.jms.JmsMessage; import mingzuozhibi.persist.disc.Disc; import mingzuozhibi.persist.disc.Disc.DiscType; import mingzuozhibi.service.DiscInfo; import mingzuozhibi.service.DiscInfosSpider; import mingzuozhibi.utils.JmsHelper; import...
package mingzuozhibi.action; @RestController public class DiscSpiderController extends BaseController { @Autowired private JmsHelper jmsHelper; @Autowired private JmsTemplate jmsTemplate; @Autowired private JmsMessage jmsMessage; @Autowired private DiscInfosSpider discInfosSpide...
needUpdateAsins(session).forEach(array::put);
6
hamadmarri/Biscuit
main/java/com/biscuit/commands/sprint/EditSprint.java
[ "public class ColorCodes {\n\n\t// with normal background\n\tpublic static final String RESET = \"\\u001B[0m\";\n\tpublic static final String BLACK = \"\\u001B[30;1m\";\n\tpublic static final String RED = \"\\u001B[31;1m\";\n\tpublic static final String GREEN = \"\\u001B[32;1m\";\n\tpublic static final String YELLO...
import java.io.IOException; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import com.biscuit.ColorCodes; import com.biscuit.commands.Command; import com.biscuit.factories.DateCompleter; import com.biscuit.models.Sprint; import com.biscuit.models.enums.Status; import com.biscuit.m...
package com.biscuit.commands.sprint; public class EditSprint implements Command { ConsoleReader reader = null;
Sprint s = new Sprint();
3
zozoh/zdoc
java/test/org/nutz/zdoc/impl/html/MarkdownNode2HtmlTest.java
[ "public class AmFactory {\n\n /**\n * 从工厂中获取一个自动机的实例\n * \n * @param amType\n * 自动机的类型\n * \n * @param amName\n * 自动机的名称\n * \n * @return 自动机实例\n */\n public <T extends Am<?>> T getAm(Class<T> amType, String amName) {\n return ioc.get(amType...
import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; import org.nutz.am.AmFactory; import org.nutz.zdoc.BaseParserTest; import org.nutz.zdoc.Rendering; import org.nutz.zdoc.ZDocNode; import org.nutz.zdoc.impl.MdParser;
package org.nutz.zdoc.impl.html; public class MarkdownNode2HtmlTest extends BaseParserTest { private ZDocNode2Html nd2html; @Before public void before() { parser = new MdParser(); nd2html = new ZDocNode2Html(); } @Test public void test_simple_em() { String s = "X**Y...
protected AmFactory genAmFactory() {
0
CraftedCart/SMBLevelWorkshop
src/main/java/craftedcart/smblevelworkshop/ui/component/OutlinerObject.java
[ "public class Window {\n\n public static SharedDrawable drawable;\n public static IUIScreen uiScreen;\n\n public static boolean running = true;\n\n public static String openGLVersion = \"OpenGL hasn't been initialized\";\n\n public static void init() throws LWJGLException, IOException, FontFormatExce...
import craftedcart.smblevelworkshop.Window; import craftedcart.smblevelworkshop.level.ClientLevelData; import craftedcart.smblevelworkshop.project.ProjectManager; import craftedcart.smblevelworkshop.resource.ResourceManager; import craftedcart.smblevelworkshop.resource.ResourceTexture; import craftedcart.smblevelworksh...
package craftedcart.smblevelworkshop.ui.component; /** * @author CraftedCart * Created on 14/10/2016 (DD/MM/YYYY) */ public class OutlinerObject extends Panel { private String objectName; //UI private final TextButton objectButton = new TextButton(); private final Button visibilityButton ...
if (Window.isShiftDown()) { //Toggle selection on shift
0
Lambda-3/DiscourseSimplification
src/main/java/org/lambda3/text/simplification/discourse/runner/discourse_tree/extraction/rules/LeadNPExtractor.java
[ "public enum Relation {\n\n UNKNOWN,\n\n // Coordinations\n UNKNOWN_COORDINATION, // the default for coordination\n CONTRAST,\n CAUSE_C,\n RESULT_C,\n LIST,\n DISJUNCTION,\n TEMPORAL_AFTER_C,\n TEMPORAL_BEFORE_C,\n\n // Subordinations\n UNKNOWN_SUBORDINATION, // the default for s...
import org.lambda3.text.simplification.discourse.utils.parseTree.ParseTreeExtractionUtils; import org.lambda3.text.simplification.discourse.utils.words.WordsUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Optional; import edu.stanford.nlp.ling.Word; import edu.stanfor...
/* * ==========================License-Start============================= * DiscourseSimplification : SubordinationPostExtractor * * Copyright © 2017 Lambda³ * * GNU General Public License 3 * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public Lic...
public Optional<Extraction> extract(Leaf leaf) throws ParseTreeException {
3
yyxhdy/ManyEAs
src/jmetal/util/offspring/NonUniformMutationOffspring.java
[ "public abstract class Operator implements Serializable {\n \n /**\n * Stores the current operator parameters. \n * It is defined as a Map of pairs <<code>String</code>, <code>Object</code>>, \n * and it allow objects to be accessed by their names, which are specified \n * by the string.\n */\n prote...
import jmetal.core.Operator; import jmetal.core.Solution; import jmetal.operators.mutation.MutationFactory; import jmetal.operators.selection.SelectionFactory; import jmetal.util.JMException; import java.util.HashMap;
/* * NonUniformGenerator.java * * @author Antonio J. Nebro * @version 1.0 * * This class returns a solution after applying SBX and Polynomial mutation */ package jmetal.util.offspring; public class NonUniformMutationOffspring extends Offspring { public Operator mutation_; private Operator selection_; pr...
public Solution getOffspring(Solution solution) {
1
scalyr/Scalyr-Java-Client
src/main/com/scalyr/api/logs/LogService.java
[ "public class ScalyrException extends RuntimeException {\n public ScalyrException(String message) {\n super(message);\n }\n\n public ScalyrException(String message, Throwable cause) {\n super(message, cause);\n }\n}", "public class ScalyrNetworkException extends ScalyrException {\n public ScalyrNetwork...
import com.scalyr.api.ScalyrException; import com.scalyr.api.ScalyrNetworkException; import com.scalyr.api.internal.ScalyrService; import com.scalyr.api.json.JSONArray; import com.scalyr.api.json.JSONObject; import com.scalyr.api.json.JSONStreamAware;
/* * Scalyr client library * Copyright 2012 Scalyr, 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 applic...
public JSONObject uploadEvents(String sessionId, JSONObject sessionInfo,
4
nikacotAndroid/Weather-Guru-MVP
app/src/test/java/mk/petrovski/weathergurumvp/presenter/ManageCityPresenterTest.java
[ "public class TestModels {\n\n public static WeatherResponseModel getWeatherResponseModel(int weatherListSize) {\n List<WeatherModel> list = new ArrayList<>();\n for (int i = 0; i < weatherListSize; i++) {\n list.add(newWeatherModel());\n }\n\n WeatherResponseModel responseModel = new WeatherRespo...
import io.reactivex.Observable; import java.util.List; import mk.petrovski.weathergurumvp.R; import mk.petrovski.weathergurumvp.TestModels; import mk.petrovski.weathergurumvp.data.local.db.CityDetailsModel; import mk.petrovski.weathergurumvp.data.remote.helper.error.ServerNotAvailableException; import mk.petrovski.weat...
package mk.petrovski.weathergurumvp.presenter; /** * Created by Nikola Petrovski on 3/20/2017. */ @RunWith(MockitoJUnitRunner.class) public class ManageCityPresenterTest extends BasePresenterTest<ManageCityPresenter<ManageCityMvpView>, ManageCityMvpView> { @Override ManageCityPresenter<ManageCityMvpView> cr...
ServerNotAvailableException exception = new ServerNotAvailableException();
2
SlimeVoid/LittleBlocks-FML
src/main/java/net/slimevoid/littleblocks/network/packets/executors/PacketLittleBlockActivatedExecutor.java
[ "public interface ILittleWorld extends IBlockAccess {\r\n\r\n public World getParentWorld();\r\n\r\n public boolean isOutdated(World world);\r\n\r\n public boolean isOutSideLittleWorld(int x, int y, int z);\r\n\r\n public void activeChunkPosition(ChunkPosition chunkposition, boolean forced);\r\n\r\n ...
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.slimevoid.library.IPacketExecutor; import net.slimevoid.library.network.PacketUpdate; import net.slimevoid.littleblocks.api.ILittleWorld; import net.slimevoid.littleblocks.blocks.BlockLittleChunk; import net.slimevoid.littlebl...
package net.slimevoid.littleblocks.network.packets.executors; public class PacketLittleBlockActivatedExecutor implements IPacketExecutor { @Override public void execute(PacketUpdate packet, World world, EntityPlayer entityplayer) { if (packet instanceof PacketLittleBlock && packet.getComm...
((BlockLittleChunk) ConfigurationLib.littleChunk).onServerBlockActivated((World) littleworld,
1
SW-Team/java-TelegramBot
src/milk/telegram/method/setter/GameScoreSetter.java
[ "public abstract class SendInstance extends JSONObject{\n\n protected final TelegramBot bot;\n\n public SendInstance(TelegramBot bot){\n this.bot = bot;\n }\n\n public abstract Object send();\n\n public void asyncSend(){\n new Thread(this::send).start();\n }\n\n}", "public abstract...
import milk.telegram.method.SendInstance; import milk.telegram.method.update.Editor; import milk.telegram.type.user.User; import milk.telegram.type.Usernamed; import milk.telegram.bot.TelegramBot; import milk.telegram.type.Identifier; import milk.telegram.type.chat.Channel; import milk.telegram.type.message.Message; im...
package milk.telegram.method.setter; public class GameScoreSetter extends Editor{ public GameScoreSetter(TelegramBot bot){ super(bot); } public long getScore(){ return optLong("score"); } public int getUserId(){ return optInt("user_id"); } public String getChat...
chat_id = chat_id instanceof Channel ? "@" + ((Usernamed) chat_id).getUsername() : ((Identifier) chat_id).getId();
6
narrowtux/Showcase
src/main/java/com/narrowtux/showcase/types/ExchangeShowcaseExtra.java
[ "public class Metrics {\n\n /**\n * The current revision number\n */\n private final static int REVISION = 5;\n\n /**\n * The base url of the metrics domain\n */\n private static final String BASE_URL = \"http://metrics.griefcraft.com\";\n\n /**\n * The url used to report a server...
import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import com.narrowtux.showcase.Metrics; import com.narrowtux.showcase.Showcase; import com.narrowtux.showcase.ShowcaseExtra; import com.narrowtux.showcase.ShowcaseItem; import com.narrowtux.showcase.ShowcasePlayer;
/* * Copyright (C) 2011 Moritz Schmale <narrow.m@gmail.com> * * Showcase 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. * * Th...
private ShowcaseItem showcase = null;
3
exoplatform/task
services/src/test/java/org/exoplatform/task/rest/TestTaskRestService.java
[ "public class TestUtils {\n\n private static Connection conn;\n private static Liquibase liquibase;\n\n public static long EXISTING_TASK_ID = 1;\n public static long UNEXISTING_TASK_ID = 2;\n\n public static long EXISTING_PROJECT_ID = 1;\n public static long UNEXISTING_PROJECT_ID = 2;\n\n public static long ...
import static org.junit.Assert.*; import static org.mockito.Mockito.*; import java.util.*; import javax.ws.rs.core.Response; import javax.ws.rs.ext.RuntimeDelegate; import org.exoplatform.task.TestUtils; import org.exoplatform.task.dao.TaskQuery; import org.exoplatform.task.domain.Priority; import org.exoplatform.task....
when(projectService.getProject(project.getId())).thenReturn(project); when(labelService.getLabel(1)).thenReturn(label1); // When Response response = taskRestService.addLabel(label1); // Then assertEquals(Response.Status.OK.getStatusCode(), response.getStatus()); LabelDto addedLabel = (Labe...
final User user = TestUtils.getUser();
2
mthli/Tweetin
Tweetin/src/io/github/mthli/Tweetin/Fragment/TweetList/MentionFragment.java
[ "public class FlagUnit {\n public static final int COLOR_BLUE = 0;\n public static final int COLOR_ORANGE = 1;\n public static final int COLOR_PINK = 2;\n public static final int COLOR_PURPLE = 3;\n public static final int COLOR_TEAL = 4;\n\n public static final int IN_TIMELINE_FRAGMENT = 0;\n ...
import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.widget.SwipeRefreshLayout; import android.view.View; import android.widget.AbsListView; import android.widget.AdapterView; import io.github.mthli.Tweetin.Flag.FlagUnit; import io.github.mthli.Tweetin.Fragment.Base.ListFragment; import io.g...
package io.github.mthli.Tweetin.Fragment.TweetList; public class MentionFragment extends ListFragment { private TweetAdapter tweetAdapter; public TweetAdapter getTweetAdapter() { return tweetAdapter; }
private List<Tweet> tweetList = new ArrayList<Tweet>();
4
Zerthick/PlayerShopsRPG
src/main/java/io/github/zerthick/playershopsrpg/cmd/cmdexecutors/shop/ShopDestroyExecutor.java
[ "@Plugin(id = \"playershopsrpg\",\n name = \"PlayerShopsRPG\",\n description = \"A region-based player shop plugin.\",\n authors = {\n \"Zerthick\"\n }\n)\npublic class PlayerShopsRPG {\n\n private ShopManager shopManager;\n private EconManager econManager;\n priv...
import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.text.Text; import org.spongepowered.api.text.chat.ChatTypes; import org.spongepowered.api.text.format.TextColors; import java.util.Optional; import com.google.common.collect.ImmutableMap; import io.github.zerthick.playershopsrpg.Play...
/* * Copyright (C) 2016 Zerthick * * This file is part of PlayerShopsRPG. * * PlayerShopsRPG is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any ...
Optional<ShopContainer> shopContainerOptional = shopManager.getShop(player);
2
IPEldorado/RemoteResources
src/com/eldorado/remoteresources/ui/HostsContainer.java
[ "public class ClientConnectionManager {\n\n\tpublic static final String LOCALHOST = IConnectionConstants.LOCALHOST;\n\n\tpublic static final int LOCALPORT = RemoteResourcesConfiguration\n\t\t\t.getInstance().getServerPort();\n\n\tprivate static ClientConnectionManager instance;\n\n\tprivate final Map<String, Client...
import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import com.eldorado.remoteresources.android.client.connection.ClientConnectionManager; import com.eldorado.remoteresources.ui.model.Device; import com.eld...
/* * (C) Copyright 2014 Instituto de Pesquisas Eldorado (http://www.eldorado.org.br/). * * This file is part of the software Remote Resources * * All rights reserved. This file and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 3.0 which ...
ClientConnectionManager.getInstance().addClientChangedListener(
0
nicjansma/tisktasks
src/com/nicjansma/tisktasks/activities/MainActivity.java
[ "public abstract class ServiceLocator\r\n{\r\n //\r\n // members\r\n //\r\n /**\r\n * Application context.\r\n */\r\n private static Context _context = null;\r\n\r\n /**\r\n * API.\r\n */\r\n private static ITodoistApi _api = null;\r\n\r\n /**\r\n * User manager.\r\n ...
import android.content.Intent; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import java.util.ArrayList; import com.nicjansma.tisktasks.R; import com.nicjansma.tisktasks.ServiceLocator; import com.nicjansma.tisktasks.api.TodoistApiResultArray; import com.nicjansma.tisktasks.api.Todoi...
protected int getStringNoItems() { return R.string.no_tasks_today; } @Override protected int getStringLoadingItems() { return R.string.loading_today; } @Override protected void loadFromTodoist() { showProgressDialog(R.string.loading_start_tasks, new Thre...
TaskManager taskManager = (TaskManager) getObjectManager();
4
OnlyInAmerica/BLEMeshChat
app/src/main/java/pro/dbro/ble/data/DataStore.java
[ "public class Message extends CursorModel {\n\n public Message(@NonNull Cursor cursor) {\n super(cursor);\n\n }\n\n public int getId() {\n return mCursor.getInt(mCursor.getColumnIndex(MessageTable.id));\n }\n\n public String getBody() {\n return mCursor.getString(mCursor.getColum...
import android.content.Context; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import java.util.List; import pro.dbro.ble.data.model.Message; import pro.dbro.ble.data.model.MessageCollection; import pro.dbro.ble.data.model.Peer; import pro.dbro.ble.protocol.IdentityPacket; import...
package pro.dbro.ble.data; /** * Data persistence layer. Any data storage mechanism * needs to implement this interface. * * Created by davidbrodsky on 10/20/14. */ public abstract class DataStore { protected Context mContext; public DataStore(@NonNull Context context) { mContext = context.ge...
public abstract Message createOrUpdateMessageWithProtocolMessage(@NonNull MessagePacket protocolMessagePacket);
0
thlcly/Mini-JVM
src/main/java/com/aaront/exercise/jvm/commands/IStoreNCommand.java
[ "@Data\npublic class ClassFile {\n private String magicNumber;\n private int majorVersion;\n private int minorVersion;\n private ClassIndex classIndex;\n private InterfaceIndex interfaceIndex;\n private ConstantPool constantPool;\n private List<ClassAccessFlag> accessFlags;\n private List<Fi...
import com.aaront.exercise.jvm.ClassFile; import com.aaront.exercise.jvm.constant.ConstantPool; import com.aaront.exercise.jvm.engine.ExecutionResult; import com.aaront.exercise.jvm.engine.JavaObject; import com.aaront.exercise.jvm.engine.JavaType; import com.aaront.exercise.jvm.engine.StackFrame; import java.util.Stac...
package com.aaront.exercise.jvm.commands; /** * @author tonyhui * @since 2017/8/23 */ public class IStoreNCommand extends NoOperandCommand { private int pos; public IStoreNCommand(ClassFile clzFile, String opCode, int pos) { super(clzFile, opCode); this.pos = pos; } @Override
public String toString(ConstantPool pool) {
1
BracketCove/Profiler
app/src/main/java/com/wiseass/profiler/photogallery/PhotoGalleryFragment.java
[ "public class Photo {\n private String photoUri;\n\n public Photo(String photoUri) {\n this.photoUri = photoUri;\n }\n\n public String getPhotoUri() {\n return photoUri;\n }\n\n public void setPhotoUri(String photoUri) {\n this.photoUri = photoUri;\n }\n}", "public class P...
import android.app.Activity; import android.app.Fragment; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.StringRes; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.LayoutInf...
package com.wiseass.profiler.photogallery; public class PhotoGalleryFragment extends Fragment implements PhotoGalleryContract.View { private static final String EXTRA_PHOTO_URL = "EXTRA_PHOTO_URL"; private PhotoGalleryContract.Presenter presenter; private GalleryAdapter adapter; private RecyclerView...
public void setAdapterData(List<Photo> photos) {
0
occi4java/occi4java
infrastructure/src/test/java/de/occi/test/OcciLinkTest.java
[ "public class Link extends Entity {\n\t/**\n\t * The Resource instances the Link Link instance originates from.\n\t */\n\tprivate Resource link;\n\t/**\n\t * The Resource instances the Link instance points to.\n\t */\n\tprivate Resource target;\n\n\t/*\n\t * set of existing link instances, for the query interface\n...
import occi.infrastructure.Network; import occi.infrastructure.Network.State; import occi.infrastructure.Storage; import java.net.URISyntaxException; import javax.naming.NamingException; import javax.naming.directory.SchemaViolationException; import org.testng.Assert; import org.testng.annotations.AfterTest; import org...
package de.occi.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....
private Network network;
3
DDoS/JICI
src/main/java/ca/sapon/jici/lexer/literal/number/IntLiteral.java
[ "public class Environment {\n // TODO make me thread safe\n private static final Map<String, Class<?>> DEFAULT_CLASSES = new HashMap<>();\n private final Map<String, Class<?>> classes = new LinkedHashMap<>(DEFAULT_CLASSES);\n private final Map<String, Variable> variables = new LinkedHashMap<>();\n\n ...
import ca.sapon.jici.lexer.TokenID; import ca.sapon.jici.util.StringUtil; import ca.sapon.jici.evaluator.Environment; import ca.sapon.jici.evaluator.EvaluatorException; import ca.sapon.jici.evaluator.type.PrimitiveType; import ca.sapon.jici.evaluator.type.Type; import ca.sapon.jici.evaluator.value.Value; import ca.sapo...
/* * This file is part of JICI, licensed under the MIT License (MIT). * * Copyright (c) 2015-2016 Aleksi Sapon <http://sapon.ca/jici/> * * 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...
public IntLiteral withSign(Symbol sign) {
6
nebhale/JsonPath
src/main/java/com/nebhale/jsonpath/internal/parser/RecoveringPathParser.java
[ "public final class ChildPathComponent extends AbstractChainedPathComponent {\n\n private final String[] names;\n\n public ChildPathComponent(PathComponent delegate, String names) {\n super(delegate);\n this.names = ArrayUtils.parseAsStringArray(names);\n }\n\n @Override\n protected Jso...
import java.util.ArrayList; import java.util.List; import com.nebhale.jsonpath.internal.component.ChildPathComponent; import com.nebhale.jsonpath.internal.component.DeepWildcardPathComponent; import com.nebhale.jsonpath.internal.component.IndexPathComponent; import com.nebhale.jsonpath.internal.component.PathComponent;...
/* * Copyright 2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
if (token.getType() == TokenType.ROOT) {
6
MooSell/Android
app/src/main/java/com/designwall/moosell/model/Order/Order.java
[ "public class BillingAddress {\n private String first_name;\n private String last_name;\n private String company;\n private String address_1;\n private String address_2;\n private String city;\n private String state;\n private String postcode;\n private String country;\n private String...
import com.designwall.moosell.model.Customer.subclass.BillingAddress; import com.designwall.moosell.model.Customer.Customer; import com.designwall.moosell.model.Customer.subclass.ShippingAddress; import com.designwall.moosell.model.Order.subclass.CouponLine; import com.designwall.moosell.model.Order.subclass.FeeLin...
package com.designwall.moosell.model.Order; /** * Created by SCIT on 3/10/2017. */ public class Order { private int id; private int order_number; private String created_at; private String updated_at; private String completed_at; private String status; private String curr...
private List<ShippingLine> shipping_lines;
7
bmatthias/config-builder
src/test/java/com/tngtech/configbuilder/annotation/typetransformer/StringToPrimitiveTransformerTest.java
[ "public class StringOrPrimitiveToPrimitiveTransformer extends ValueTransformer<Object,Object> {\n\n @Override\n public Object transform(Object argument) {\n PropertyEditor editor = PropertyEditorManager.findEditor(genericsAndCastingHelper.castTypeToClass(targetType));\n try {\n editor...
import com.tngtech.configbuilder.annotation.valuetransformer.StringOrPrimitiveToPrimitiveTransformer; import com.tngtech.configbuilder.configuration.ErrorMessageSetup; import com.tngtech.configbuilder.exception.PrimitiveParsingException; import com.tngtech.configbuilder.util.ConfigBuilderFactory; import com.tngtech.con...
package com.tngtech.configbuilder.annotation.typetransformer; @RunWith(MockitoJUnitRunner.class) public class StringToPrimitiveTransformerTest { private StringOrPrimitiveToPrimitiveTransformer stringOrPrimitiveToPrimitiveTransformer; @Mock
private FieldValueTransformer fieldValueTransformer;
4
cyberpython/lingua
src/lingua/ui/gtk/main_window/menus/FileMenu.java
[ "public class StringResources {\n private HashMap<String, String> strings;\n\n private static StringResources instance = null;\n\n\n private StringResources() {\n this.strings = new HashMap<String, String>();\n strings.put(\"app_name\", _(\"Περιβάλλον Ανάπτυξης Για Τη ΓΛΩΣΣΑ\"));\n str...
import lingua.ui.gtk.main_window.actions.SaveFileAsAction; import org.gnome.gtk.Menu; import org.gnome.gtk.MenuItem; import org.gnome.gtk.SeparatorMenuItem; import lingua.resources.StringResources; import lingua.ui.gtk.main_window.actions.ExitApplicationAction; import lingua.ui.gtk.main_window.actions.ExportHTMLAction;...
/* * The MIT License * * Copyright 2012 Georgios Migdos <cyberpython@gmail.com>. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitat...
fileMenu.append(OpenFileAction.getInstance().createMenuItem());
4
achan/android-reddit
src/com/pocketreddit/library/datasources/RedditDataSource.java
[ "public class Link extends UserSubmittedContent {\n private static final long serialVersionUID = 1L;\n\n private boolean clicked;\n private String domain;\n private boolean hidden;\n private boolean selfPost;\n private Object media;\n private Object mediaEmbed;\n private int numComments;\n ...
import com.pocketreddit.library.things.Link; import com.pocketreddit.library.things.Listing; import com.pocketreddit.library.things.Subreddit; import com.pocketreddit.library.things.Thing; import com.pocketreddit.library.things.factories.ThingFactoryException; import com.pocketreddit.library.things.utils.JsonToThingCon...
package com.pocketreddit.library.datasources; public class RedditDataSource { private JsonDataSource dataSource; public RedditDataSource() { dataSource = new LiveDataSource(); } public Listing<Subreddit> getSubreddits(String sessionId) throws DataSourceException { try { r...
public Listing<? extends Thing> getCommentsForLink(Link link) throws DataSourceException {
3
jmimo/netty-icap
src/main/java/ch/mimo/netty/example/icap/simple/IcapServerHandler.java
[ "public class DefaultIcapResponse extends AbstractIcapMessage implements IcapResponse {\n\n\tprivate IcapResponseStatus status;\n\tprivate ChannelBuffer optionsContent;\n\t\n\t/**\n\t * Will create an instance of IcapResponse.\n\t * \n\t * @param version the version of the response.\n\t * @param status the Status c...
import ch.mimo.netty.handler.codec.icap.IcapVersion; import java.nio.charset.Charset; import org.jboss.netty.buffer.ChannelBuffer; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.channel.SimpleChannelUpstreamHandler; import org.jboss.netty.handle...
/******************************************************************************* * Copyright 2012 Michael Mimo Moratti * * 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://ww...
response.addHeader(IcapHeaders.Names.ISTAG,"SimpleServer-version-1.0");
1
EladKeyshawn/HackList
app/src/main/java/com/projects/elad/hacklist/presentation/main/fragments/FragmentHome.java
[ "@PerFragment\n@Component(modules = {HomeFragmentModule.class})\npublic interface HomeFragmentComponent {\n void inject(FragmentHome fragmentHome);\n}", "@Module\npublic class HomeFragmentModule {\n\n\n @Provides\n @PerFragment\n public HomePresenter providePresenter() {\n return new HomePresen...
import android.content.Context; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.app.AlertDialog; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.S...
package com.projects.elad.hacklist.presentation.main.fragments; /** * A simple {@link Fragment} subclass. */ public class FragmentHome extends Fragment implements FastAdapter.OnLongClickListener, SearchView.OnQueryTextListener, HomeMvpView { @Inject HomePresenter homePresenter; @BindView(R.id.all_ha...
private FastAdapter<ListItem> fastAdapter;
2
petitparser/java-petitparser
petitparser-json/src/main/java/org/petitparser/grammar/json/JsonGrammarDefinition.java
[ "public static CharacterParser anyOf(String characters) {\n return anyOf(characters, \"any of '\" + toReadableString(characters) + \"' expected\");\n}", "public static CharacterParser digit() {\n return digit(\"digit expected\");\n}", "public static CharacterParser of(\n CharacterPredicate predicate, Strin...
import static org.petitparser.parser.primitive.CharacterParser.anyOf; import static org.petitparser.parser.primitive.CharacterParser.digit; import static org.petitparser.parser.primitive.CharacterParser.of; import static org.petitparser.parser.primitive.StringParser.of; import org.petitparser.parser.primitive.Character...
package org.petitparser.grammar.json; /** * JSON grammar definition. */ public class JsonGrammarDefinition extends GrammarDefinition { protected static Map<Character, Character> createEscapeTable() { Map<Character, Character> table = new HashMap<>(); table.put('\\', '\\'); table.put('/', '/'); ...
.seq(of('0').or(digit().plus()))
1
horizon-institute/artcodes-android
library/src/main/java/uk/ac/horizon/artcodes/detect/marker/MarkerAreaOrderDetector.java
[ "public interface CameraFocusControl\n{\n void focus(Runnable callback);\n}", "public interface MarkerDetectionHandler\n{\n\tvoid onMarkersDetected(Collection<Marker> markers, ArrayList<MatOfPoint> contours, Mat hierarchy, Size sourceImageSize);\n}", "public class Experience\n{\n\n\tpublic enum Status\n\t{\n...
import uk.ac.horizon.artcodes.camera.CameraFocusControl; import uk.ac.horizon.artcodes.detect.handler.MarkerDetectionHandler; import uk.ac.horizon.artcodes.model.Experience; import uk.ac.horizon.artcodes.process.ImageProcessor; import uk.ac.horizon.artcodes.process.ImageProcessorFactory; import android.content.Context;...
/* * Artcodes recognises a different marker scheme that allows the * creation of aesthetically pleasing, even beautiful, codes. * Copyright (C) 2013-2016 The University of Nottingham * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Pu...
public static class Factory implements ImageProcessorFactory
4
justyoyo/Contrast
pdf417/src/main/java/com/justyoyo/contrast/pdf417/PDF417HighLevelEncoder.java
[ "public enum BarcodeFormat {\n\n /** Aztec 2D barcode format. */\n AZTEC,\n\n /** CODABAR 1D format. */\n CODABAR,\n\n /** Code 39 1D format. */\n CODE_39,\n\n /** Code 93 1D format. */\n CODE_93,\n\n /** Code 128 1D format. */\n CODE_128,\n\n /** Data Matrix 2D barcode format. */\n DATA_MATRIX,\n\n /*...
import android.graphics.Bitmap; import com.justyoyo.contrast.BarcodeFormat; import com.justyoyo.contrast.EncodeHintType; import com.justyoyo.contrast.WriterException; import com.justyoyo.contrast.common.BitMatrix; import com.justyoyo.contrast.common.CharacterSetECI; import com.justyoyo.contrast.common.Compaction; impor...
public PDF417HighLevelEncoder() { } static { //Construct inverse lookups Arrays.fill(MIXED, (byte) -1); for (int i = 0; i < TEXT_MIXED_RAW.length; i++) { byte b = TEXT_MIXED_RAW[i]; if (b > 0) { MIXED[b] = (byte) i; } } ...
BitMatrix result = writer.encode(contents, dimension, dimension, BarcodeFormat.PDF_417, hints);
3
Rubentxu/DreamsLibGdx
core/src/main/java/com/rubentxu/juegos/core/vista/WorldRenderer.java
[ "public class DreamsGame extends BaseGame {\n\n public static boolean DEBUG = false;\n public static FPSLogger log;\n\n @Override\n public void create() {\n Gdx.input.setCatchBackKey(true);\n resourcesManager =new ResourcesManager();\n preferencesManager = PreferencesManager.instanc...
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.OrthographicCamera; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer; import com.badlogic.gdx.utils.Disposable; import com.rube...
package com.rubentxu.juegos.core.vista; public class WorldRenderer implements Disposable { /** * for debug rendering * */ Box2DDebugRenderer debugRenderer; private final DreamsGame game; private World world; private OrthographicCamera cam; private OrthogonalTiledMapRenderer render...
cam.viewportHeight = Constants.WORLD_HEIGHT;
1
ihaolin/wechat
src/main/java/me/hao0/wechat/core/Materials.java
[ "public class WechatException extends RuntimeException {\n\n /**\n * 微信返回的errcode\n */\n private Integer code;\n\n public WechatException(Map<String, ?> errMap) {\n super(\"[\" + errMap.get(\"errcode\") + \"]\" + errMap.get(\"errmsg\"));\n code = (Integer)errMap.get(\"errcode\");\n ...
import com.fasterxml.jackson.databind.JavaType; import com.google.common.collect.Maps; import me.hao0.common.http.Http; import me.hao0.common.json.Jsons; import me.hao0.common.model.Page; import me.hao0.wechat.exception.WechatException; import me.hao0.wechat.model.material.CommonMaterial; import me.hao0.wechat.model.ma...
package me.hao0.wechat.core; /** * 素材组件 * Author: haolin * Email: haolin.h0@gmail.com * Date: 18/11/15 * @since 1.4.0 */ public final class Materials extends Component { /** * 素材总数 */ private static final String COUNT = "https://api.weixin.qq.com/cgi-bin/material/get_materialcount?access_toke...
public <T> Page<T> gets(MaterialType type, Integer offset, Integer count){
3
liuling07/QiQuYingServer
src/com/lling/qiqu/controllers/admin/QuTuAdminController.java
[ "@Entity\n@Table(name = \"t_joke\")\npublic class Joke implements Serializable{\n\n\tprivate static final long serialVersionUID = 4646260119535165219L;\n\n\t//type标记\n\tpublic static final int TYPE_QUSHI = 1;\n\tpublic static final int TYPE_QUTU = 2;\n\tpublic static final int TYPE_MEITU = 3;\n\tpublic static final...
import java.util.Date; import java.util.List; import javax.annotation.Resource; import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springfr...
package com.lling.qiqu.controllers.admin; /** * @ClassName: QuTuAdminController * @Description: 趣图管理控制器 * @author lling * @date 2015-5-30 */ @Controller @RequestMapping("/qutuadmin") public class QuTuAdminController { @Resource
private IJokeService jokeService;
3
tvportal/android
app/src/main/java/com/mitechlt/tvportal/play/activities/MovieActivity.java
[ "public class VideoCastManager extends BaseCastManager\n implements OnMiniControllerChangedListener, OnFailedListener {\n\n public static final String EXTRA_HAS_AUTH = \"hasAuth\";\n public static final String EXTRA_MEDIA = \"media\";\n public static final String EXTRA_START_POINT = \"startPoint\";\...
import android.app.AlertDialog; import android.app.Dialog; import android.content.ContentValues; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.preference.Prefere...
@Override protected void onPause() { if (mCastManager != null) { mCastManager.decrementUiCounter(); mCastManager.removeVideoCastConsumer(mCastConsumer); } super.onPause(); } @Override protected void onDestroy() { if (null != mCastManager) { ...
getContentResolver().insert(FavoritesContentProvider.CONTENT_URI, values);
2
greghaskins/spectrum
src/test/java/specs/VariableSpecs.java
[ "static void beforeAll(final Block block) {\n DeclarationState.instance().addHook(before(new IdempotentBlock(block)), AppliesTo.ATOMIC_ONLY,\n Precedence.SET_UP);\n}", "static void beforeEach(final Block block) {\n DeclarationState.instance().addHook(before(block), AppliesTo.ATOMIC_ONLY, Precedence.LOCAL);...
import static com.greghaskins.spectrum.dsl.specification.Specification.beforeAll; import static com.greghaskins.spectrum.dsl.specification.Specification.beforeEach; import static com.greghaskins.spectrum.dsl.specification.Specification.describe; import static com.greghaskins.spectrum.dsl.specification.Specification.it;...
package specs; @RunWith(Spectrum.class) public class VariableSpecs { {
describe("The Variable convenience wrapper", () -> {
2
mouton5000/DSTAlgoEvaluation
src/graphTheory/graphDrawer/GraphDrawer.java
[ "public class Arc implements Cloneable {\n\n\tprivate Integer input;\n\tprivate Integer output;\n\tprivate boolean isDirected;\n\n\tpublic Arc(Integer input, Integer output, boolean isDirected) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.isDirected = isDirected;\n\t}\n\n\tpublic Integer getInput...
import graphTheory.graph.Arc; import graphTheory.graph.Graph; import graphTheory.latex.TikzTranslator; import graphTheory.utils.Drawing; import graphTheory.utils.Math2; import java.awt.BorderLayout; import java.awt.Button; import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event...
x22 = (int) (sideLength / 2.0 + (double) x2); y22 = (int) (sideLength * Math.tan(alpha) / 2.0 + (double) y2); } else { x22 = (int) (sideLength / (2.0 * Math.tan(alpha)) + (double) x2); y22 = (int) (sideLength / 2.0 + (double) y2); } } Double startAngle = null, middleDistance = null; // If ...
System.out.println(TikzTranslator.translateGraph(graph));
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(); ...
((MumblerRootNode) function.callTarget.getRootNode()).setName("main");
1
TomGrill/gdx-dialogs
android/src/de/tomgrill/gdxdialogs/android/AndroidGDXDialogs.java
[ "public class AndroidGDXButtonDialog implements GDXButtonDialog {\n\n\tprivate Activity activity;\n\n\tprivate AlertDialog.Builder builder;\n\n\tprivate AlertDialog dialog;\n\n\tprivate boolean cancelable;\n\n\tprivate CharSequence message = \"\";\n\tprivate CharSequence title = \"\";\n\n\tprivate ButtonClickListen...
import android.app.Activity; import com.badlogic.gdx.utils.reflect.ClassReflection; import de.tomgrill.gdxdialogs.android.dialogs.AndroidGDXButtonDialog; import de.tomgrill.gdxdialogs.android.dialogs.AndroidGDXProgressDialog; import de.tomgrill.gdxdialogs.android.dialogs.AndroidGDXTextPrompt; import de.tomgrill.gdxdial...
/******************************************************************************* * Copyright 2015 See AUTHORS file. * * 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.apach...
registerDialog(GDXButtonDialog.class.getName(), AndroidGDXButtonDialog.class.getName());
0
thlcly/Mini-JVM
src/test/java/com/aaront/exercise/jvm/loader/ClassFileLoaderTest.java
[ "@Data\npublic class ClassFile {\n private String magicNumber;\n private int majorVersion;\n private int minorVersion;\n private ClassIndex classIndex;\n private InterfaceIndex interfaceIndex;\n private ConstantPool constantPool;\n private List<ClassAccessFlag> accessFlags;\n private List<Fi...
import com.aaront.exercise.jvm.ClassFile; import com.aaront.exercise.jvm.commands.AbstractCommand; import com.aaront.exercise.jvm.commands.BiPushCommand; import com.aaront.exercise.jvm.commands.OneOperandCommand; import com.aaront.exercise.jvm.commands.TwoOperandCommand; import com.aaront.exercise.jvm.constant.*; impor...
} @Test public void testMethods2() { Map<Pair<String, String>, Method> methods = clzFile.getMethods(); ConstantPool pool = clzFile.getConstantPool(); { Method m = methods.get(Pair.of("<init>", "(Ljava/lang/String;I)V")); assertMethodEquals(pool, m, ...
if (cmd instanceof OneOperandCommand) {
3
xargsgrep/PortKnocker
app/src/main/java/com/xargsgrep/portknocker/fragment/HostListFragment.java
[ "public class EditHostActivity extends ActionBarActivity\n{\n public static final int MENU_ITEM_SAVE = 2;\n public static final int MENU_ITEM_DEBUG_INFO = 4;\n\n public static final int TAB_INDEX_HOST = 0;\n public static final int TAB_INDEX_PORTS = 1;\n public static final int TAB_INDEX_MISC = 2;\n\...
import android.app.AlertDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.ListFragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.wid...
/* * Copyright 2014 Ahsan Rabbani * * 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...
((HostListActivity) getActivity()).setDeleteDialog(deleteDialog);
1
nextopcn/xcalendar
src/main/java/cn/nextop/thorin/rcp/support/swt/widget/xcalendar/model/config/widget/AbstractXCalendarWidget.java
[ "public final class Cursors {\n\t//\n\tpublic static final Cursor CURSOR_WAIT = getDefault().getSystemCursor(SWT.CURSOR_WAIT);\n\tpublic static final Cursor CURSOR_HAND = getDefault().getSystemCursor(SWT.CURSOR_HAND);\n\tpublic static final Cursor CURSOR_IBEAM = getDefault().getSystemCursor(SWT.CURSOR_IBEAM);\n\tpu...
import cn.nextop.thorin.rcp.support.swt.utility.graphics.Cursors; import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.XCalendar; import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.XCalendarEvent; import cn.nextop.thorin.rcp.support.swt.widget.xcalendar.event.bus.internal.*; import cn.nextop.thorin.rcp....
package cn.nextop.thorin.rcp.support.swt.widget.xcalendar.model.config.widget; /** * * @author Baoyi Chen */ public abstract class AbstractXCalendarWidget implements XCalendarWidget { // protected Point margin; protected Rectangle bounds; protected boolean disposed; protected final XCalendar popup; prote...
public boolean handle(final XCalendarEvent event) {
2
x-hansong/EasyChat
Server/src/main/java/com/easychat/controller/UserController.java
[ "public class BadRequestException extends BasicException{\n public BadRequestException(String error, String description) {\n super(error, description);\n }\n}", "public class UserDTO {\n private String name;\n\n private String password;\n\n public String getPassword() {\n return passw...
import com.easychat.exception.BadRequestException; import com.easychat.model.dto.input.UserDTO; import com.easychat.model.dto.output.UserDetailDTO; import com.easychat.model.entity.User; import com.easychat.model.error.ErrorType; import com.easychat.model.msg.FriendInviteMsg; import com.easychat.service.UserService; im...
package com.easychat.controller; /** * Created by yonah on 15-10-18. */ @RestController @RequestMapping("/v1/users") public class UserController { private UserService userService; private SimpMessagingTemplate simpMessagingTemplate; @InitBinder("userDTO")//这里要填需要校验的变量名 protected void initBinder(...
public UserDTO addUser(@RequestBody @Valid UserDTO userDTO) {
1
BracketCove/Profiler
app/src/main/java/com/wiseass/profiler/createaccount/CreateAccountFragment.java
[ "public class AuthInjection {\n\n public static AuthSource provideAuthSource(){\n return FirebaseAuthService.getInstance();\n }\n\n}", "public class DatabaseInjection {\n public static DatabaseSource provideDatabaseSource() {\n return FakeDatabaseService.getInstance();\n }\n}", "public...
import android.content.Intent; import android.os.Bundle; import android.app.Fragment; import android.support.annotation.StringRes; import android.support.v4.content.ContextCompat; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.wi...
package com.wiseass.profiler.createaccount; /** * A simple {@link Fragment} subclass. */ public class CreateAccountFragment extends Fragment implements CreateAccountContract.View { private Button createAccount; private TextView emailLabel, passwordLabel, confirmLabel, nameLabel; private EditText emai...
Intent i = new Intent(getActivity(), ProfilePageActivity.class);
4
guardianproject/ObscuraCam
app/src/main/java/org/witness/obscuracam/ui/ImageRegion.java
[ "public class BlurObscure implements RegionProcesser {\n\n\tBitmap originalBmp;\n\tProperties mProps;\n\tPaint mPaint;\n\t\n\tprivate final static int BLUR_OFFSET = 10;\n\n\tpublic BlurObscure(Paint paint) {\n\t\tmProps = new Properties ();\n\t\tmProps.put(\"obfuscationType\", this.getClass().getName());\n\t\tmPain...
import android.content.res.Resources; import android.graphics.Matrix; import android.graphics.PointF; import android.graphics.RectF; import android.graphics.drawable.Drawable; import android.util.Log; import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; import org.witness.obscuraca...
package org.witness.obscuracam.ui; public class ImageRegion { public static final String LOGTAG = "SSC.ImageRegion"; // Rect for this when unscaled public RectF mBounds; // Start point for touch events PointF mStartPoint = null; public static final int REDACT = 0; // PaintSquareObscure public static fin...
RegionProcesser mRProc;
5
Beloumi/PeaFactory
src/peafactory/peas/editor_pea/EditorType.java
[ "public final class PeaFactory {\n\n\t// i18n: \t\n\tprivate static String language; \n\tprivate static Locale currentLocale;\n\tprivate static Locale defaultLocale = Locale.getDefault();\n\tprivate static ResourceBundle languageBundle;\n\tpublic static final Charset UTF_8 = Charset.forName(\"UTF-8\");\n\t\n\tpriva...
import cologne.eck.peafactory.PeaFactory; import cologne.eck.peafactory.crypto.CipherStuff; import cologne.eck.peafactory.gui.*; import cologne.eck.peafactory.peagen.DataType; import cologne.eck.peafactory.peagen.JarStuff; import cologne.eck.peafactory.tools.ReadResources; import cologne.eck.peafactory.tools.WriteResou...
package cologne.eck.peafactory.peas.editor_pea; /* * Peafactory - Production of Password Encryption Archives * Copyright (C) 2015 Axel von dem Bruch * * This library 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 Softw...
String dirName = JarStuff.getJarFileName().substring(0, (JarStuff.getJarFileName().length() - 4)); // extract ".jar"
3
vsilaev/tascalate-concurrent
src/main/java/net/tascalate/concurrent/AbstractCompletableTask.java
[ "static boolean cancelPromise(CompletionStage<?> promise, boolean mayInterruptIfRunning) {\n if (promise instanceof Future) {\n Future<?> future = (Future<?>) promise;\n return future.cancel(mayInterruptIfRunning);\n } else {\n return CancelMethodsCache.cancellationOf(promise.getClass())\...
import static net.tascalate.concurrent.SharedFunctions.cancelPromise; import static net.tascalate.concurrent.SharedFunctions.iif; import static net.tascalate.concurrent.SharedFunctions.unwrapCompletionException; import static net.tascalate.concurrent.SharedFunctions.unwrapExecutionException; import static net.tascalate...
// Don't need to run anything return null; } CompletionStage<T> returned = fn.apply(failure); nextStage.intermediateStage = returned; if (nextStage.isCancelled()) { can...
return wrapExecutionException(
4
GoogleCloudPlatform/weasis-chcapi-extension
src/main/java/org/weasis/dicom/google/api/ui/dicomstore/LoadStudiesTask.java
[ "public class GoogleAPIClient {\n\n private static final String APPLICATION_NAME = \"Weasis-GoogleDICOMExplorer/1.0\";\n\n /**\n * Directory to store user credentials.\n */\n private static final java.io.File DATA_STORE_DIR = new java.io.File(System.getProperty(\"user.home\"), \".weasis/google_auth...
import org.weasis.dicom.google.api.GoogleAPIClient; import org.weasis.dicom.google.api.model.DicomStore; import org.weasis.dicom.google.api.model.StudyModel; import org.weasis.dicom.google.api.model.StudyQuery; import org.weasis.dicom.google.api.ui.StudyView; import java.time.LocalDate; import java.time.LocalTime; impo...
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
List<StudyModel> studies = api.fetchStudies(store, query);
2
Kestutis-Z/World-Weather
WorldWeather/app/src/main/java/com/haringeymobile/ukweather/RefreshingActivity.java
[ "public class GeneralDatabaseService extends IntentService {\n\n private static final String APP_PACKAGE = \"com.haringeymobile.ukweather\";\n public static final String ACTION_INSERT_OR_UPDATE_CITY_RECORD = APP_PACKAGE\n + \".insert_or_update_city_records\";\n public static final String ACTION_...
import android.content.DialogInterface; import android.content.Intent; import android.content.res.Resources; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Parcelable; import android.support.annotation.NonNull; import android.support.v4.util.LruCache; import android.support.v7.app.AlertDial...
package com.haringeymobile.ukweather; /** * An activity that may display some weather data (e.g. current weather, or weather forecast), and * if it does so, it refreshes the data each time it becomes visible. */ public abstract class RefreshingActivity extends ThemedActivity implements WorkerFragmentToRet...
Intent intent = new Intent(this, GeneralDatabaseService.class);
0
Androguide/Pimp_my_Z1
PimpMyZ1/src/com/androguide/honamicontrol/kernel/misc/MiscActivity.java
[ "public class CardSeekBarVibrator extends Card {\n\n public CardSeekBarVibrator(String title, String desc, String color, ActionBarActivity fa) {\n super(title, desc, color, fa);\n }\n\n private static int WARNING_THRESHOLD = 80;\n\n @TargetApi(Build.VERSION_CODES.JELLY_BEAN)\n @Override\n p...
import com.androguide.honamicontrol.cards.CardSpinner; import com.androguide.honamicontrol.helpers.CPUHelper; import com.androguide.honamicontrol.helpers.Helpers; import com.fima.cardsui.objects.CardStack; import com.fima.cardsui.views.CardTextStripe; import com.fima.cardsui.views.CardUI; import java.util.ArrayList; im...
/** Copyright (C) 2013 Louis Teboul (a.k.a Androguide) * * admin@pimpmyrom.org || louisteboul@gmail.com * http://pimpmyrom.org || http://androguide.fr * 71 quai Clémenceau, 69300 Caluire-et-Cuire, FRANCE. * * This program is free software; you can redistribute it and/or modify * it under the...
getString(R.string.fastcharge_warning_text) + "\n\nFast Charge " + CPUHelper.readOneLineNotRoot(FAST_CHARGE_VERSION),
2
MizzleDK/Mizuu
app/src/main/java/com/miz/mizuu/fragments/ActorDetailsFragment.java
[ "public class TMDbMovieService extends MovieApiService {\n\n\tprivate static TMDbMovieService mService;\n\n\tprivate final String mTmdbApiKey;\n\tprivate final Context mContext;\n\n\tpublic static TMDbMovieService getInstance(Context context) {\n\t\tif (mService == null)\n\t\t\tmService = new TMDbMovieService(conte...
import android.app.Activity; import android.graphics.Color; import android.graphics.Typeface; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; import android.t...
} }); mTvCards.setSeeMoreOnClickListener(new OnClickListener() { @Override public void onClick(View v) { startActivity(IntentUtils.getActorTvShowsIntent(mContext, mActor.getName(), mActor.getId(), mToolbarColor)); } ...
TMDbMovieService service = TMDbMovieService.getInstance(mContext);
0
Zuehlke/SHMACK
sparkjobs/src/test/java/com/zuehlke/shmack/sparkjobs/wordcount/WordCountRemoteTest.java
[ "protected static <T> void assertPosition(final SortedCounts<T> sortedCounts, final int position,\n\t\tfinal int expectedCount, final T expectedValue) {\n\tfinal Entry<T> entry = sortedCounts.getEntry(position);\n\tassertEquals(expectedCount, entry.getCount());\n\tassertEquals(expectedValue, entry.getValue());\n}",...
import static org.junit.Assert.assertEquals; import static com.zuehlke.shmack.sparkjobs.wordcount.SortedCountAsserter.assertPosition; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.zuehlke.shmack.sparkjobs.base.HdfsUtils; import com.zuehlke.shmack.sparkjobs.base.RemoteSparkTe...
package com.zuehlke.shmack.sparkjobs.wordcount; public class WordCountRemoteTest { private final static Logger LOGGER = LoggerFactory.getLogger(WordCountRemoteTest.class); @Test public void testWordcountRemote() throws Exception {
RemoteSparkTestRunner runner = new RemoteSparkTestRunner(WordCountRemoteTest.class, "myTest-1");
3
calibre2opds/calibre2opds
OpdsOutput/src/main/java/com/gmail/dpierron/calibre/opds/indexer/Index.java
[ "public class ConfigurationManager {\r\n\r\n public static final String PROFILES_SUFFIX = \".profile.xml\";\r\n private final static String PROFILE_FILENAME = \"profile.xml\";\r\n private final static String DEFAULT_PROFILE = \"default\";\r\n public static final String LOGGING_PREFIX = \"log4j2.\";\r\n public ...
import com.gmail.dpierron.calibre.configuration.ConfigurationManager; import com.gmail.dpierron.calibre.datamodel.Author; import com.gmail.dpierron.calibre.datamodel.Book; import com.gmail.dpierron.calibre.datamodel.DataModel; import com.gmail.dpierron.calibre.datamodel.Tag; import com.gmail.dpierron.tools.Helper;...
package com.gmail.dpierron.calibre.opds.indexer; /** * The index of all the catalog items (books, authors, series, etc.) * composing the catalog, with the keywords to search them full-text */ public class Index { // TODO Make this configurabel? private static final int MIN_KEYWORD_SIZE = 3; priva...
public void indexBook(Book book, String url, String thumbnailUrl) {
2
osiefart/wicket-christmas
src/main/java/com/senacor/wicket/async/christmas/app/websocket/WebsocketPage.java
[ "public class PageRequestCounter extends Label {\n\n public PageRequestCounter(String id) {\n super(id);\n setOutputMarkupId(true);\n setDefaultModel(new CountingModel());\n }\n\n @Override\n public void onEvent(IEvent<?> event) {\n if (event.getPayload() instanceof AjaxRequestTarget) {\n ((Aja...
import java.util.concurrent.ConcurrentHashMap; import org.apache.wicket.Component; import org.apache.wicket.ajax.WebSocketRequestHandler; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.protocol.ws.api.message.TextMessage; import com.senacor.wicket.async.christmas.core.counter.PageRequestCounter;...
package com.senacor.wicket.async.christmas.app.websocket; /** * Seite mit Websockets * * <p> * http://splitshade.wordpress.com/2012/11/04/wicket-6-2-websockets-und-jquery- * visualize-die-richtige-atmosphare-schaffen/ * </p> * <p> * http://wicketinaction.com/2012/07/wicket-6-native-websockets/ * </p> * ...
Component dilbertInformationPanel = new DilbertInformationPanel("dilbertInformation", new DilbertAsyncModel());
3
Azure/azure-storage-android
microsoft-azure-storage-test/src/com/microsoft/azure/storage/file/CloudFileShareTests.java
[ "public final class OperationContext {\n\n /**\n * The default log level, or null if disabled. The default can be overridden to turn on logging for an individual\n * operation context instance by using setLoggingEnabled.\n */\n private static Integer defaultLogLevel;\n\n /**\n * Indicates w...
import com.microsoft.azure.storage.NameValidator; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.SendingRequestEvent; import com.microsoft.azure.storage.StorageErrorCodeStrings; import com.microsoft.azure.storage.StorageEvent; import com.microsoft.azure.storage.StorageException;...
/** * Copyright Microsoft Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
@Category({ SlowTests.class, DevFabricTests.class, DevStoreTests.class })
5
sorinMD/MCTS
src/main/java/mcts/tree/ExpansionPolicy.java
[ "public interface Game {\n\n\t/**\n\t * @return a clone of the game state\n\t */\n\tpublic int[] getState();\n\n\tpublic int getWinner();\n\n\tpublic boolean isTerminal();\n\n\tpublic int getCurrentPlayer();\n\n\t/**\n\t * Updates the state description based on the chosen action\n\t * \n\t * @param a\n\t * ...
import java.util.ArrayList; import java.util.Collections; import java.util.concurrent.ThreadLocalRandom; import mcts.game.Game; import mcts.game.GameFactory; import mcts.seeder.SeedTrigger; import mcts.tree.node.StandardNode; import mcts.tree.node.Key; import mcts.tree.node.TreeNode; import mcts.utils.Options; import m...
package mcts.tree; /** * The default expansion policy. * * @author sorinMD * */ public class ExpansionPolicy { /** * Expands a node and adds all the children to the tree data structure. It * also selects the next one at random. If seeding is used it adds the newly * expanded node to the seed trigger. ...
ArrayList<Key> children = new ArrayList<Key>();
4
BeYkeRYkt/LightAPI
craftbukkit-nms-v1_18_R1/src/main/java/ru/beykerykt/minecraft/lightapi/bukkit/internal/handler/craftbukkit/nms/v1_18_R1/VanillaNMSHandler.java
[ "public class BukkitPlatformImpl implements IPlatformImpl, IBukkitExtension {\n\n private static final String DEFAULT_IMPL_NAME = \"craftbukkit\";\n /**\n * CONFIG\n */\n private final String CONFIG_TITLE = \"general\";\n private final String CONFIG_DEBUG = CONFIG_TITLE + \".debug\";\n privat...
import com.google.common.collect.Lists; import net.minecraft.core.BlockPos; import net.minecraft.core.SectionPos; import net.minecraft.network.protocol.game.ClientboundLightUpdatePacket; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.level.Thre...
/* * The MIT License (MIT) * * Copyright 2021 Vladimir Mikhailov <beykerykt@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitati...
public void onInitialization(BukkitPlatformImpl impl) throws Exception {
0
edeoliveira/MailsterSMTP
src/org/mailster/smtp/DefaultDeliveryHandler.java
[ "public interface MessageListener\n{\n\t/**\n\t * Called once for every RCPT TO during a SMTP exchange.\n\t * \n\t * @param ctx is the context of the message that provides some basic info like \n\t * the credential, the remote ip address or the ability to store some \n\t * private attributes\n\t * @pa...
import java.io.IOException; import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; import java.util.ArrayList; import java.util.List; import org.mailster.smtp.api.MessageListener; import org.mailster.smtp.api.handler.AbstractDeliveryHandler; impo...
package org.mailster.smtp; /** * Default class that extends the {@link AbstractDeliveryHandler} class. * Provides a default implementation for mail delivery. * * @author De Oliveira Edouard &lt;doe_wanted@yahoo.fr&gt; */ public class DefaultDeliveryHandler extends AbstractDeliveryHandler { private static fin...
for (MessageListener listener: getListeners())
0
chanjarster/artemis-disruptor-miaosha
jms-server/src/main/java/me/chanjar/jms/server/config/RequestDisruptorConfiguration.java
[ "public interface JmsMessageSender {\n\n /**\n * 发送Jms消息\n *\n * @param payload 消息主体\n * @throws JMSException\n */\n void sendMessage(MessageDto payload) throws JMSException;\n\n}", "public class DisruptorLifeCycleContainer implements SmartLifecycle {\n\n private static final Logger LOGGER = LoggerFa...
import com.lmax.disruptor.dsl.Disruptor; import me.chanjar.jms.base.sender.JmsMessageSender; import me.chanjar.jms.base.lifecycle.DisruptorLifeCycleContainer; import me.chanjar.jms.server.StartupOrderConstants; import me.chanjar.jms.server.command.infras.CommandDispatcher; import me.chanjar.jms.server.command.infras.De...
package me.chanjar.jms.server.config; @Configuration @EnableConfigurationProperties({ RequestDisruptorConfiguration.DisruptorProperties.class }) public class RequestDisruptorConfiguration implements ApplicationContextAware { private ApplicationContext applicationContext; @Autowired private DisruptorPropertie...
return new DefaultCommandDispatcher();
4
Gikkman/Java-Twirk
src/main/java/com/gikk/twirk/types/usernotice/DefaultUsernoticeBuilder.java
[ "public interface TagMap extends Map<String, String>{\n //***********************************************************\n\t// \t\t\t\tPUBLIC\n\t//***********************************************************\n\t/**Fetches a certain field value that might have been present in the tag.\n\t * If the field was not prese...
import com.gikk.twirk.types.TagMap; import com.gikk.twirk.types.TwitchTags; import com.gikk.twirk.types.emote.Emote; import com.gikk.twirk.types.twitchMessage.TwitchMessage; import com.gikk.twirk.types.usernotice.subtype.Raid; import com.gikk.twirk.types.usernotice.subtype.Ritual; import com.gikk.twirk.types.usernotice...
package com.gikk.twirk.types.usernotice; class DefaultUsernoticeBuilder implements UsernoticeBuilder{ String rawLine; List<Emote> emotes; String messageID; int roomID; long sentTimestamp; String systemMessage; Subscription subscription; Raid raid; Ritual ritual; String message; @Ov...
this.messageID = map.getAsString(TwitchTags.ID);
1
mariok/pinemup
src/main/java/net/sourceforge/pinemup/core/io/notes/server/ServerThread.java
[ "public final class CategoryManager {\n /** The pinboard, which contains all notes. **/\n private PinBoard pinBoard = new PinBoard();\n\n /** Listeners, which will be added per default to new notes. **/\n private final Collection<NoteChangedEventListener> defaultNoteChangedEventListeners = new LinkedList<>(...
import javax.net.ssl.SSLHandshakeException; import javax.xml.stream.XMLStreamException; import java.io.IOException; import java.util.List; import net.sourceforge.pinemup.core.CategoryManager; import net.sourceforge.pinemup.core.io.notes.file.NotesSaveTrigger; import net.sourceforge.pinemup.core.io.notes.file.Note...
/* * pin 'em up * * Copyright (C) 2007-2013 by Mario Ködding * * * 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 late...
.exportNotesToServer(CategoryManager.getInstance().getCategories());
0
AChep/HeadsUp
project/app/src/main/java/com/achep/base/ui/fragments/PreferenceFragment.java
[ "@SuppressWarnings(\"ConstantConditions\")\npublic abstract class ConfigBase implements\n ISubscriptable<ConfigBase.OnConfigChangedListener>,\n IOnLowMemory {\n\n private static final String TAG = \"Config\";\n\n protected static final String PREFERENCES_FILE_NAME = \"config\";\n\n private So...
import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.ListPreference; import android.preference.MultiSelectListPreference; import android.preference.Preference; import android.preference.PreferenceScreen; import and...
/* * Copyright (C) 2015 AChep@xda <artemchep@gmail.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * Th...
private ConfigBase mConfig;
0
dariober/ASCIIGenome
src/main/java/tracks/TrackBookmark.java
[ "public class InvalidGenomicCoordsException extends Exception {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = 1L;\n\n}", "public class InvalidRecordException extends Exception {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = 1L;\n\n}", "public class GenomicCoords...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.io.UnsupportedEncodingException; import java.sql.SQLE...
package tracks; public class TrackBookmark extends TrackIntervalFeature { private final String trackName= "Bookmarks";
public TrackBookmark(GenomicCoords gc, String nameForBookmark) throws IOException, ClassNotFoundException, InvalidRecordException, SQLException, InvalidGenomicCoordsException{
0