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
qibin0506/Glin
glin/src/main/java/org/loader/glin/helper/ClientHelper.java
[ "public abstract class Callback<T> {\n\n private Context mContext;\n private ChanNode mAfterChanNode;\n\n public final void attach(Context ctx, ChanNode afterChanNode) {\n mContext = ctx;\n mAfterChanNode = afterChanNode;\n }\n\n public final void afterResponse(Result<T> result, RawResu...
import org.loader.glin.Callback; import org.loader.glin.RawResult; import org.loader.glin.Result; import org.loader.glin.cache.ICacheProvider; import org.loader.glin.factory.ParserFactory; import org.loader.glin.interceptor.IResultInterceptor; import java.util.List;
package org.loader.glin.helper; /** * ClientHelper, useful when you convert response, cache your data and intercept your callback */ public final class ClientHelper { private ParserFactory mParserFactory; private ICacheProvider mCacheProvider; private IResultInterceptor mResultInterceptor; public...
public <T> Result<T> parseResponse(Callback<T> callback, RawResult netResult) {
2
sooola/V2EX-Android
app/src/main/java/com/sola/v2ex_android/ui/MyFollowingActivity.java
[ "public class MyFollowing {\n\n public String userName;\n public String title;\n public String userIconUrl;\n public String nodeName;\n public String commentCount;\n public String topicId;\n\n}", "public class V2exUser {\n\n private static V2exUser currentUser;\n\n public String message;\n...
import android.content.Context; import android.content.Intent; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; import com.sola.v2ex_android.R; import com.sola.v2ex_android.model.MyFollowing; import com.sola.v2ex_android.model.V2exUser; import com.sola.v2ex_andr...
package com.sola.v2ex_android.ui; /** * Created by wei on 2016/11/15. * 我关注的人 */ public class MyFollowingActivity extends BaseSwipeRefreshActivity { @BindView(R.id.recycleview) RecyclerView mRecyclerView; MyFollowingAdapter mAdapter; public static Intent getIntent(Context context) { I...
return JsoupUtil.parseMyfollowing(s);
5
FedericoPecora/coordination_oru
src/main/java/se/oru/coordination/coordination_oru/tests/clean/ThreeRobotsAsynchronousGoalPosting.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.util.Comparator; import org.metacsp.multi.spatioTemporal.paths.PoseSteering; import com.vividsolutions.jts.geom.Coordinate; import se.oru.coordination.coordination_oru.ConstantAccelerationForwardModel; import se.oru.coordination.coordination_oru.CriticalSection; import se.oru.coordination.coordination_oru.M...
package se.oru.coordination.coordination_oru.tests.clean; @DemoDescription(desc = "One-shot navigation of 3 robots coordinating on static paths that overlap in a straight portion.") public class ThreeRobotsAsynchronousGoalPosting { public static void main(String[] args) throws InterruptedException { double...
BrowserVisualization viz = new BrowserVisualization();
6
common-workflow-language/cwlviewer
src/test/java/org/commonwl/view/researchobject/ROBundleServiceTest.java
[ "@Service\npublic class CWLTool {\n\n private final Logger logger = LoggerFactory.getLogger(this.getClass());\n\n private String cwlToolVersion;\n\n /**\n * Get the RDF representation of a CWL file\n * @param url The URL of the CWL file\n * @return The RDF representing the CWL file\n * @thr...
import org.apache.jena.query.ResultSet; import org.apache.taverna.robundle.Bundle; import org.apache.taverna.robundle.Bundles; import org.apache.taverna.robundle.manifest.Manifest; import org.apache.taverna.robundle.manifest.PathAnnotation; import org.apache.taverna.robundle.manifest.PathMetadata; import org.commonwl.v...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
when(mockGitService.getRepository(any(GitDetails.class), any(Boolean.class))).thenReturn(gitRepo);
2
vangj/jbayes
src/main/java/com/github/vangj/jbayes/inf/exact/graph/pptc/JoinTree.java
[ "public static Potential marginalizeFor(JoinTree joinTree, Clique clique, List<Node> nodes) {\n Potential potential = getPotential(nodes);\n Potential cliquePotential = joinTree.getPotential(clique);\n\n potential.entries().forEach(entry -> {\n List<PotentialEntry> matchedEntries = cliquePotential.match(entry...
import static com.github.vangj.jbayes.inf.exact.graph.util.PotentialUtil.marginalizeFor; import static com.github.vangj.jbayes.inf.exact.graph.util.PotentialUtil.normalize; import com.github.vangj.jbayes.inf.exact.graph.Node; import com.github.vangj.jbayes.inf.exact.graph.lpd.Potential; import com.github.vangj.jbayes.i...
package com.github.vangj.jbayes.inf.exact.graph.pptc; /** * Join tree. */ public class JoinTree { private final Map<String, Clique> cliques; private final Map<String, Set<Clique>> neighbors; private final Set<Edge> edges; private final Map<String, Potential> potentials; private final Map<String, Map<Str...
return normalize(marginalizeFor(this, clique, Arrays.asList(node)));
1
SecUSo/privacy-friendly-memo-game
app/src/main/java/org/secuso/privacyfriendlymemory/ui/MainActivity.java
[ "public final class Constants {\n\n private Constants(){} // this class should not be initialized\n\n // Preferences Constants\n public final static String FIRST_APP_START = \"FIRST_APP_START\";\n public final static String SELECTED_CARD_DESIGN = \"SELECTED_CARD_DESIGN\";\n public final ...
import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import androi...
package org.secuso.privacyfriendlymemory.ui; public class MainActivity extends AppCompatDrawerActivity { private SharedPreferences preferences = null; private ViewPager viewPager = null; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInsta...
List<Integer> resIdsDeckOne = MemoGameDefaultImages.getResIDs(CardDesign.FIRST, MemoGameDifficulty.Hard, false);
4
mojohaus/mrm
mrm-servlet/src/main/java/org/codehaus/mojo/mrm/impl/maven/FileSystemArtifactStore.java
[ "public interface DirectoryEntry\n extends Entry\n{\n}", "public interface Entry\n extends Serializable\n{\n\n /**\n * Returns the repository that this entry belongs to.\n *\n * @return the repository that this entry belongs to.\n * @since 1.0\n */\n FileSystem getFileSystem();\n\n...
import org.apache.commons.lang.StringUtils; import org.apache.maven.archetype.catalog.ArchetypeCatalog; import org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader; import org.apache.maven.artifact.repository.metadata.Metadata; import org.apache.maven.artifact.repository.metadata.io.xpp3.MetadataXpp3Re...
/* * Copyright 2011 Stephen Connolly * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
public Set<Artifact> getArtifacts( final String groupId, final String artifactId, final String version )
5
jpaoletti/jPOS-Presentation-Manager
modules/pm_struts/src/org/jpos/ee/pm/struts/PMEntitySupport.java
[ "public class Entity extends PMCoreObject {\n\n /**Represents the entity id. This must me unique.*/\n private String id;\n /**The full name of the class represented by the entity.*/\n private String clazz;\n /**A filter for the list of instances of the entity.\n * <br/>{@code <listfilter class=\"...
import org.jpos.ee.pm.core.EntityContainer; import javax.servlet.http.HttpServletRequest; import org.jpos.ee.pm.core.Entity; import org.jpos.ee.pm.core.EntityFilter; import org.jpos.ee.pm.core.EntitySupport; import org.jpos.ee.pm.core.PMSession; import org.jpos.ee.pm.core.PaginatedList;
/* * jPOS Project [http://jpos.org] * Copyright (C) 2000-2010 Alejandro P. Revilla * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (a...
public EntityFilter getFilter() throws PMStrutsException {
1
CloudScale-Project/CloudStore
src/main/java/eu/cloudscale/showcase/servlets/BuyController.java
[ "public interface IAddressDao extends IDao<IAddress>\n{\t\n\tpublic List<IAddress> findAll();\n\n\tpublic IAddress findById(int id);\n\t\n}", "public interface ICountryDao extends IDao<ICountry>\n{\n\n\tpublic ICountry findById(int id);\n\n\tpublic ICountry getByName(String country);\n\t\n\tpublic void createTabl...
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import java.util.Set; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org...
/******************************************************************************* * Copyright (c) 2015 XLAB d.o.o. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * h...
ICustomer customer = null;
6
fuinorg/ddd-4-java
src/test/java/org/fuin/ddd4j/test/BEntity.java
[ "public abstract class AbstractDomainEvent<ID extends EntityId> extends AbstractEvent implements DomainEvent<ID> {\r\n\r\n private static final long serialVersionUID = 1000L;\r\n\r\n @NotNull\r\n @JsonbTypeAdapter(EntityIdPathConverter.class)\r\n @JsonbProperty(\"entity-id-path\")\r\n @XmlJavaTypeAda...
import java.util.ArrayList; import java.util.List; import org.fuin.ddd4j.ddd.AbstractDomainEvent; import org.fuin.ddd4j.ddd.AbstractEntity; import org.fuin.ddd4j.ddd.ApplyEvent; import org.fuin.ddd4j.ddd.ChildEntityLocator; import org.fuin.ddd4j.ddd.DuplicateEntityException; import org.fuin.ddd4j.ddd.EntityIdPath; impo...
/** * Copyright (C) 2015 Michael Schnell. All rights reserved. * http://www.fuin.org/ * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your...
public void doIt(final CId cid) throws EntityNotFoundException {
4
PerficientDigital/AEM-DataLayer
core/src/main/java/com/perficient/aem/datalayer/core/filters/AEMDataLayerInterceptorFilter.java
[ "public class DataLayerConstants {\n\n\tpublic static final String DATA_KEY_PRICE = \"price\";\n\tpublic static final String DATA_KEY_ITEM = \"item\";\n\tpublic static final String DATA_KEY_PROFILE = \"profile\";\n\tpublic static final String DATA_KEY_PROFILE_INFO = \"profileInfo\";\n\tpublic static final String DA...
import java.io.IOException; import java.util.HashSet; import java.util.Set; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.apache.felix.scr.anno...
/* * Copyright 2017 - Perficient * * 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 agr...
DataLayer dataLayer = DataLayerUtil.getDataLayer(slingRequest);
3
manuelsc/Lunary-Ethereum-Wallet
app/src/main/java/rehanced/com/simpleetherwallet/fragments/FragmentChooseRecipient.java
[ "public class AnalyticsApplication extends Application {\n\n private boolean isGooglePlayBuild = false;\n\n @Override\n protected void attachBaseContext(Context base) {\n super.attachBaseContext(base);\n MultiDex.install(this);\n }\n\n public boolean isGooglePlayBuild() {\n retur...
import android.content.Intent; import android.os.Bundle; import androidx.fragment.app.Fragment; import androidx.recyclerview.widget.DefaultItemAnimator; import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; i...
package rehanced.com.simpleetherwallet.fragments; public class FragmentChooseRecipient extends Fragment implements View.OnClickListener, View.OnCreateContextMenuListener { private RecyclerView recyclerView;
private WalletAdapter walletAdapter;
5
blinkfox/zealot
src/test/java/com/blinkfox/zealot/test/core/ConditContextTest.java
[ "public final class BuildSource {\n\n /** xml文件对应的命名空间. */\n private String nameSpace;\n\n /** SQL拼接信息. */\n private SqlInfo sqlInfo;\n\n /** XML节点. */\n private Node node;\n\n /** 参数对象上下文,一般为Bean或者Map. */\n private Object paramObj;\n\n /** 拼接SQL片段的前缀,如:and、or等. */\n private String pre...
import com.blinkfox.zealot.bean.BuildSource; import com.blinkfox.zealot.bean.SqlInfo; import com.blinkfox.zealot.config.ZealotConfigManager; import com.blinkfox.zealot.core.ConditContext; import com.blinkfox.zealot.exception.NodeNotFoundException; import com.blinkfox.zealot.test.config.MyZealotConfig; import org.junit....
package com.blinkfox.zealot.test.core; /** * ConditContext测试类. * @author blinkfox on 2017/4/24. */ public class ConditContextTest { /** * 初始化方法. */ @BeforeClass public static void init() {
ZealotConfigManager.getInstance().initLoad(MyZealotConfig.class);
5
twothe/DaVincing
src/main/java/two/davincing/painting/PaintTool.java
[ "@Mod(modid = DaVincing.MOD_ID, name = DaVincing.MOD_NAME, version = DaVincing.MOD_VERSION)\npublic class DaVincing {\n\n /* Global logger that uses string format type logging */\n public static final Logger log = LogManager.getLogger(DaVincing.class.getSimpleName(), new StringFormatterMessageFactory());\n /* Ta...
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemDye; import net.minecraf...
package two.davincing.painting; public class PaintTool extends ItemBase { public PaintTool() { this.setMaxStackSize(1); } @Override public boolean onItemUse(ItemStack is, EntityPlayer ep, World w, int x, int y, int z, int face, float xs, float ys, float zs) { if (!w.isRemote) { return false; ...
public boolean apply(PixelData img, float[] point, int color, boolean isSneaking) {
5
tonikolaba/BatBat-Game
src/main/java/al/tonikolaba/gamestate/LevelTest.java
[ "public class EnergyParticle extends MapObject {\n\n public static final int ENERGY_UP = 0;\n public static final int ENERGY_LEFT = 1;\n public static final int ENERGY_DOWN = 2;\n public static final int ENERGY_RIGHT = 3;\n private int count;\n private boolean remove;\n private BufferedImage[] ...
import java.util.ArrayList; import al.tonikolaba.entity.EnergyParticle; import al.tonikolaba.entity.Player; import al.tonikolaba.entity.Spirit; import al.tonikolaba.entity.Enemy.EnemyType; import al.tonikolaba.entity.batbat.Piece; import al.tonikolaba.tilemap.Background;
/** * */ package al.tonikolaba.gamestate; /** * @author N.Kolaba * */ public class LevelTest extends GameState { private static final String LEVEL_BOSS_MUSIC_NAME = "level1boss"; private ArrayList<EnergyParticle> energyParticles; private Piece tlp; private Piece trp; private Piece blp; private Piece brp...
enemyTypesInLevel = new EnemyType[] { EnemyType.SPIRIT };
3
edsilfer/marvel-characters
user-intf/src/test/java/br/com/hole19/marvel/bpo/TestCharacterUIService.java
[ "public class Character implements Serializable {\n\n private long id;\n private String name;\n private String description;\n private String modified;\n private Thumbnail thumbnail;\n private String resourceURI;\n private Collection comics;\n private Collection series;\n private Collectio...
import android.content.res.Resources; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.RecyclerView; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ImageView; import android.widget.ListAdapter; import android.widget.ListView; import android.widge...
package br.com.hole19.marvel.bpo; /** * Created by edgar on 04-May-16. */ @RunWith(MockitoJUnitRunner.class) public class TestCharacterUIService { @Mock App mApplication; @Mock StaticResourceProvider mResources; @Mock LoaderManager mLoaderManager; @Mock NotificationManager mNoti...
ActivityTemplate activity = Mockito.mock(ActivityTemplate.class);
6
hecoding/Pac-Man
src/jeco/core/algorithm/de/DifferentialEvolutionInt.java
[ "public abstract class Algorithm<V extends Variable<?>> extends AlgObservable {\n\n protected Problem<V> problem = null;\n // Attribute to stop execution of the algorithm.\n protected boolean stop = false;\n \n /**\n * Allows to stop execution after finishing the current generation; must be\n * taken into ...
import java.util.Collections; import java.util.HashSet; import java.util.Random; import java.util.logging.Logger; import jeco.core.algorithm.Algorithm; import jeco.core.algorithm.ga.SimpleGeneticAlgorithm; import jeco.core.operator.comparator.SimpleDominance; import jeco.core.problem.Problem; import jeco.core.problem.S...
package jeco.core.algorithm.de; /** * Class implementing the differential evolution technique for problem solving. * * Problem manages integer variables * * @author J. M. Colmenar */ public class DifferentialEvolutionInt extends Algorithm<Variable<Integer>> { private static final Logger logger = Logger.ge...
public DifferentialEvolutionInt(Problem<Variable<Integer>> problem, Integer maxPopulationSize, Integer maxGenerations, Boolean stopWhenSolved,
2
SailFlorve/RunHDU
app/src/main/java/com/cxsj/runhdu/RunListFragment.java
[ "public class RecyclerViewSectionAdapter extends BaseSectionQuickAdapter<RunningInfoSection, BaseViewHolder> {\n\n /**\n * Same as QuickAdapter#QuickAdapter(Context,int) but with\n * some initialization data.\n *\n * @param layoutResId The layout resource id of each item.\n * @param sect...
import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view...
package com.cxsj.runhdu; /** * 显示跑步详情页面的Fragment */ public class RunListFragment extends Fragment { private static final String TAG = "RunListFragment"; private RecyclerView todayRecyclerView; private LinearLayout neverRunLayout; private RecyclerViewSectionAdapter viewAdapter; private View vi...
List<RunningInfoSection> sectionList = DataQueryModel.getSectionList(list);
1
WirelessRedstoneGroup/WirelessRedstone
core/src/main/java/net/licks92/wirelessredstone/listeners/PlayerListener.java
[ "public class InternalProvider {\n\n private static InternalBlockData compatBlockData;\n private static InternalWorldEditHooker compatWorldEditHooker;\n\n public static InternalBlockData getCompatBlockData() {\n if (compatBlockData != null) {\n return compatBlockData;\n }\n\n ...
import net.licks92.wirelessredstone.compat.InternalProvider; import net.licks92.wirelessredstone.ConfigManager; import net.licks92.wirelessredstone.Permissions; import net.licks92.wirelessredstone.signs.SignType; import net.licks92.wirelessredstone.signs.WirelessChannel; import net.licks92.wirelessredstone.UpdateChecke...
package net.licks92.wirelessredstone.listeners; public class PlayerListener implements Listener { @EventHandler public void on(PlayerInteractEvent event) { if (!(event.getAction().equals(Action.RIGHT_CLICK_BLOCK))) { return; } if (event.getClickedBlock() == null) { ...
CrossMaterial.SIGN.getHandle()
7
idega/com.idega.xformsmanager
src/java/com/idega/xformsmanager/manager/impl/XFormsManagerDocumentImpl.java
[ "public class UnsupportedXFormException extends IllegalStateException {\n\n\tprivate static final long serialVersionUID = 3311245306534653014L;\n\n\tpublic UnsupportedXFormException() { }\n\n public UnsupportedXFormException(String s) {\n super(s);\n }\n\n public UnsupportedXFormException(String s, ...
import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.chiba.xml.dom.DOMUtil; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import org.w3c.dom.Document; impor...
package com.idega.xformsmanager.manager.impl; /** * @author <a href="mailto:civilis@idega.com">Vytautas Čivilis</a> * @version $Revision: 1.8 $ * * Last modified: $Date: 2009/04/28 12:27:48 $ by $Author: civilis $ */ @FormComponentType(FormComponentType.document) @Service @Scope(BeanDefinition.SCOPE_SINGLETON)
public class XFormsManagerDocumentImpl extends XFormsManagerContainerImpl implements XFormsManagerDocument {
6
NEYouFan/ht-refreshrecyclerview
htrefreshrecyclerview/src/main/java/com/netease/hearttouch/htrefreshrecyclerview/viewimpl/HTBaseRecyclerViewImpl.java
[ "public abstract class HTBaseRecyclerView extends ViewGroup implements HTRefreshRecyclerViewInterface {\n private static final String TAG = HTBaseRecyclerView.class.getSimpleName();\n\n /**\n * 设置全局的默认刷新加载样式\n */\n private static Class<? extends HTBaseViewHolder> sViewHolderClass;\n /**\n * ...
import android.animation.Animator; import android.animation.ValueAnimator; import android.content.Context; import android.support.annotation.Nullable; import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.StaggeredGridLayoutManager; import an...
/* * This source code is licensed under the MIT-style license found in the * LICENSE file in the root directory of this source tree. */ package com.netease.hearttouch.htrefreshrecyclerview.viewimpl; /** * 实现的一种刷新基类 */ abstract class HTBaseRecyclerViewImpl extends HTBaseRecyclerView { private boolean mScre...
int firstVisibleItem = getFirstItemPosition(manager, false);//获取第一个可见的Item位置
5
R2RML-api/R2RML-api
r2rml-api-jena-binding/src/test/java/jenaTest/InMemoryStructureCreation_Test.java
[ "public class JenaR2RMLMappingManager extends R2RMLMappingManagerImpl {\n\n private static JenaR2RMLMappingManager INSTANCE = new JenaR2RMLMappingManager(new JenaRDF());\n\n private JenaR2RMLMappingManager(JenaRDF rdf) {\n super(rdf);\n }\n\n public Collection<TriplesMap> importMappings(Model mod...
import eu.optique.r2rml.api.model.LogicalTable; import eu.optique.r2rml.api.MappingFactory; import eu.optique.r2rml.api.model.ObjectMap; import eu.optique.r2rml.api.model.PredicateMap; import eu.optique.r2rml.api.model.PredicateObjectMap; import eu.optique.r2rml.api.model.SubjectMap; import eu.optique.r2rml.api.m...
/******************************************************************************* * Copyright 2013, the Optique Consortium * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http...
PredicateObjectMap pom = mfact.createPredicateObjectMap(pred, obm);
5
horizon-institute/artcodes-android
app/src/main/java/uk/ac/horizon/artcodes/activity/ExperienceEditActivity.java
[ "public enum Features implements Feature {\n\tshow_welcome(true),\n\tshow_local(false),\n\tlog_scanned_images(true),\n\tedit_colour(false),\n\tedit_features(false),\n\tupload_to_artcodes_co_uk(false),\n\topen_without_touch(false);\n\n\n\tprivate final boolean defaultValue;\n\n\tFeatures(boolean defaultValue) {\n\t\...
import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.view.MenuItem; import android.view.View; import androidx.annotation.NonNull; import an...
/* * 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...
fragments.add(new AvailabilityEditListFragment());
3
wangjiegulu/RapidORM
library/src/main/java/com/wangjie/rapidorm/core/config/TableConfig.java
[ "public class RapidORMConfig {\n /**\n * Print out SQLs if DEBUG is true\n */\n public static boolean DEBUG = true;\n\n /**\n * Bind a field object to {@link com.wangjie.rapidorm.core.config.ColumnConfig} with\n * reflection if is true.\n */\n @Deprecated\n public static boolean B...
import android.database.Cursor; import android.support.annotation.NonNull; import com.wangjie.rapidorm.api.annotations.Column; import com.wangjie.rapidorm.constants.RapidORMConfig; import com.wangjie.rapidorm.core.delegate.database.RapidORMSQLiteDatabaseDelegate; import com.wangjie.rapidorm.core.delegate.sqlitestatemen...
columnConfig.setColumnName(name); // autoincrement columnConfig.setAutoincrement(autoincrement); // notNull columnConfig.setNotNull(notNull); // defaultValue columnConfig.setDefaultValue(defaultValue); // index columnConfig.setIndex(index); ...
public abstract void createTable(RapidORMSQLiteDatabaseDelegate db, boolean ifNotExists) throws Exception;
1
geoparser/geolocator
geo-locator/src/edu/cmu/geoparser/ui/LDCTest.java
[ "public class GetReader {\n\n public static BufferedReader getUTF8FileReader(String filename) throws FileNotFoundException,\n UnsupportedEncodingException {\n File file = new File(filename);\n BufferedReader bin = new BufferedReader(new InputStreamReader(new FileInputStream(file),\n \"utf...
import edu.cmu.geoparser.Disambiguation.ContextDisamb; import edu.cmu.geoparser.io.GetReader; import edu.cmu.geoparser.io.GetWriter; import edu.cmu.geoparser.model.Tweet; import edu.cmu.geoparser.parser.english.EnglishParser; import edu.cmu.geoparser.resource.gazindexing.Index; import edu.cmu.geoparser.resource.gazinde...
/** * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use t...
Index ci = new CollaborativeIndex().config("GazIndex/StringIndex",
4
kraftek/awsdownload
src/main/java/ro/cs/products/landsat/LandsatAWSSearch.java
[ "public abstract class ProductDownloader<T extends ProductDescriptor> {\n private static final String startMessage = \"(%s,%s) %s [size: %skB]\";\n private static final String completeMessage = \"(%s,%s) %s [elapsed: %ss]\";\n private static final String errorMessage =\"Cannot download %s: %s\";\n priva...
import ro.cs.products.ProductDownloader; import ro.cs.products.base.AbstractSearch; import ro.cs.products.base.ProductDescriptor; import ro.cs.products.sentinel2.amazon.Result; import ro.cs.products.sentinel2.amazon.ResultParser; import ro.cs.products.util.Constants; import ro.cs.products.util.Logger; import ro.cs.prod...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
jsonTile = jsonTile.replace(Constants.L8_SEARCH_URL_SUFFIX, "");
5
dsx-tech/blockchain-benchmarking
blockchain-api/src/main/java/uk/dsxt/bb/eris/ErisManager.java
[ "public interface Manager {\n\n String sendTransaction(String to, String from, long amount);\n\n String sendMessage(byte[] body);\n String sendMessage(String from, String to, String message);\n\n List<Message> getNewMessages();\n\n BlockchainBlock getBlock(long id) throws IOException;\n\n Blockcha...
import com.google.gson.Gson; import lombok.extern.log4j.Log4j2; import org.apache.http.HttpResponse; import org.apache.http.client.fluent.Request; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.htt...
/* * ***************************************************************************** * * Blockchain benchmarking framework * * * Copyright (C) 2016 DSX Technologies Limited. * * * * * * This program is free software: you can redistribute it a...
public BlockchainPeer[] getPeers() throws IOException {
4
killbill/killbill-meter-plugin
src/test/java/org/killbill/billing/plugin/meter/timeline/aggregator/TestTimelineAggregator.java
[ "public interface MeterConfig {\n\n @Config(\"org.killbill.billing.plugin.meter.timelines.length\")\n @Description(\"How long to buffer data in memory before flushing it to the database\")\n @Default(\"60m\")\n TimeSpan getTimelineLength();\n\n // This is used to predict the number of samples between...
import java.io.IOException; import java.util.Map; import java.util.Properties; import java.util.UUID; import java.util.concurrent.atomic.AtomicLong; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.killbill.billing.plugin.meter.MeterConfig; import org.killbill.billing.plugin.meter.MeterTestS...
/* * Copyright 2010-2014 Ning, Inc. * Copyright 2014 The Billing Project, LLC * * Ning licenses this file to you under the Apache License, version 2.0 * (the "License"); you may not use this file except in compliance with the * License. You may obtain a copy of the License at: * * http://www.apache.org/lice...
minHeapUsedKindId, new ScalarSample(SampleOpcode.LONG, Long.MIN_VALUE + ts),
5
LaurenceYang/EasyHttp
sample/src/main/java/com/yang/demo/adapter/MainAdapter.java
[ "public class GetActivity extends AppCompatActivity {\n @BindView(R.id.url)\n EditText urlView;\n @BindView(R.id.go)\n Button go;\n @BindView(R.id.body)\n TextView body;\n\n ProgressDialog dialog;\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super....
import android.content.Context; import android.content.Intent; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.yang.demo.activity.GetActivity; import com.yang.d...
package com.yang.demo.adapter; /** * Created by yangyang on 2017/2/17. */ public class MainAdapter extends RecyclerView.Adapter<MainAdapter.ViewHolder> { private ArrayList<MainEntity> mList; private Context mContext; public MainAdapter(Context context) { this.mContext = context; } p...
Intent intent = new Intent(mContext, GetActivity.class);
0
aschaaff/savot
src/main/java/cds/astrores/sax/AstroresSAXEngine.java
[ "public final class SavotCoosys extends MarkupComment implements IDSupport {\n\n // ID attribute\n private String id = null;\n // equinox attribute\n private String equinox = null;\n // epoch attribute\n private String epoch = null;\n // system attribute eq_FK4, eq_FK5, ICRS, ecl_FK4, ecl_FK5, ...
import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; import cds.savot.model.SavotCoosys; import cds.savot.model.SavotData; import cds.savot.model.SavotDefinitions; import cds.savot.model.SavotInfo; import cds.savot.model.SavotLink; import cds.savot.model.SavotOption; import cds.savot.model.SavotValues; ...
* @param enc * encoding (example : UTF-8) */ public AstroresSAXEngine(AstroresSAXConsumer consumer, XmlPullParser parser, InputStream instream, String enc, boolean debug) { try { this.parser = parser; ...
SavotLink currentLink = new SavotLink();
4
gsh199449/spider
src/main/java/com/gs/spider/service/commons/webpage/CommonWebpageService.java
[ "@Component\npublic class CommonWebpageDAO extends IDAO<Webpage> {\n private final static String INDEX_NAME = \"commons\", TYPE_NAME = \"webpage\";\n private static final int SCROLL_TIMEOUT = 1;\n private static final Gson gson = new GsonBuilder()\n .registerTypeAdapter(Date.class, (JsonDeserial...
import com.google.gson.Gson; import com.gs.spider.dao.CommonWebpageDAO; import com.gs.spider.gather.commons.CommonSpider; import com.gs.spider.model.commons.SpiderInfo; import com.gs.spider.model.commons.Webpage; import com.gs.spider.model.utils.ResultBundle; import com.gs.spider.model.utils.ResultBundleBuilder; import...
package com.gs.spider.service.commons.webpage; /** * CommonWebpageService * * @author Gao Shen * @version 16/4/19 */ @Component public class CommonWebpageService { private static final Gson gson = new Gson(); private Logger LOG = LogManager.getLogger(CommonWebpageService.class); @Autowired
private CommonWebpageDAO commonWebpageDAO;
0
oSoc14/Artoria
app/src/main/java/be/artoria/belfortapp/mixare/MixView.java
[ "public class MainActivity extends BaseActivity {\n MainAdapter menuAdapter;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n initGui();\n }\n\n private static boolean downloadin...
import static android.hardware.SensorManager.SENSOR_DELAY_GAME; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import be.artoria.belfortapp.R; import be.artoria.belfortapp.activities.MainActivity; import be.artoria.belfortapp.app.DataManager; import be.artoria.belfortapp.app.PrefUtils; im...
/* * Copyright (C) 2010- Peer internet solutions * * This file is part of be.artoria.belfortapp.mixare. * * 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 Licen...
private static PaintScreen dWindow;
4
Azanor/thaumcraft-api
internal/IInternalMethodHandler.java
[ "public interface ISeal {\n\t\n\t/**\n\t * @return\n\t * A unique string identifier for this seal. A good idea would be to append your modid before the identifier. \n\t * For example: \"thaumcraft:fetch\"\n\t * This will also be used to create the item model for the seal placer so you will have to define a json usi...
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.capabilities.IPlayerKnowledge.EnumKnowledgeType; import thaumcraft.api.capabilities.IPlayerWarp...
package thaumcraft.api.internal; /** * * @author Azanor * * @see IInternalMethodHandler#addKnowledge * @see IInternalMethodHandler#progressResearch * @see IInternalMethodHandler#completeResearch * @see IInternalMethodHandler#doesPlayerHaveRequisites * @see IInternalMethodHandler#addWarpToPlayer * @see IInte...
public void addGolemTask(int dim, Task task);
3
Vedenin/RestAndSpringMVC-CodingChallenge
src/test/java/com.github.vedenin.codingchallenge/OpenExchangeRestClientTest.java
[ "public enum CurrencyEnum {\n EUR(\"EUR\", \"Euro (EUR)\"),\n USD(\"USD\", \"US Dollar (USD)\"),\n GBP(\"GBP\", \"British Pound (GBP)\"),\n NZD(\"NZD\", \"New Zealand Dollar (NZD)\"),\n AUD(\"AUD\", \"Australian Dollar (AUD)\"),\n JPY(\"JPY\", \"Japanese Yen (JPY)\"),\n HUF(\"HUF\", \"Hungarian...
import com.github.vedenin.codingchallenge.common.CurrencyEnum; import com.github.vedenin.codingchallenge.exceptions.RestClientException; import com.github.vedenin.codingchallenge.restclient.RestClient; import com.github.vedenin.codingchallenge.restclient.impl.currencylayer.CurrencyLayerRestClient; import com.github.ved...
package com.github.vedenin.codingchallenge; /** * Created by vvedenin on 2/10/2017. */ public class OpenExchangeRestClientTest { @Test public void ExternalTest() {
RestClient restClient = new OpenExchangeRestClient();
2
xiaoyaoyou1212/BLE
baseble/src/main/java/com/vise/baseble/exception/handler/DefaultBleExceptionHandler.java
[ "public class ConnectException extends BleException {\n private BluetoothGatt bluetoothGatt;\n private int gattStatus;\n\n public ConnectException(BluetoothGatt bluetoothGatt, int gattStatus) {\n super(BleExceptionCode.CONNECT_ERR, \"Connect Exception Occurred! \");\n this.bluetoothGatt = blu...
import com.vise.baseble.exception.ConnectException; import com.vise.baseble.exception.GattException; import com.vise.baseble.exception.InitiatedException; import com.vise.baseble.exception.OtherException; import com.vise.baseble.exception.TimeoutException; import com.vise.log.ViseLog;
package com.vise.baseble.exception.handler; /** * @Description: 异常默认处理 * @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a> * @date: 16/8/14 10:35. */ public class DefaultBleExceptionHandler extends BleExceptionHandler { @Override protected void onConnectException(ConnectException e) { Vise...
protected void onInitiatedException(InitiatedException e) {
2
vector-im/riot-automated-tests
VectorMobileTests/src/test/java/mobilestests_android/RiotDirectMessagesTests.java
[ "public class RiotContactPickerPageObjects extends TestUtilities{\n\tprivate AndroidDriver<MobileElement> driver;\n\tpublic RiotContactPickerPageObjects(AppiumDriver<MobileElement> myDriver) throws InterruptedException{\n\t\tdriver=(AndroidDriver<MobileElement>) myDriver;\n\t\tPageFactory.initElements(new AppiumFie...
import java.io.FileNotFoundException; import java.lang.reflect.Method; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeGroups; import org.testng.annotations.Listeners; import org.testng.annotations.Test; import com.esotericsoftware.yamlbeans.YamlException; import...
newRoomDevice1.addParticipantFromCollapsedActionBar(getMatrixIdFromDisplayName(riotuser2DisplayName)); newRoomDevice1.menuBackButton.click(); //assertion on the inviter device: the new room is NOT seen as an direct message room. Assert.assertFalse(homePage1.isRoomTaggedDirectMessage(homePage1.getRoomByName(riot...
super.checkIfUserLoggedAndHomeServerSetUpAndroid(appiumFactory.getAndroidDriver1(), riotuser1DisplayName, Constant.DEFAULT_USERPWD);
6
gabormakrai/dijkstra-performance
DijkstraPerformance/src/dijkstra/performance/scenario/RandomGrowingWithTheWebFibonacciPriorityQueueScenario.java
[ "public class NeighbourArrayGraphGenerator {\r\n\t\r\n\tpublic int[][] neighbours;\r\n\tpublic double[][] weights;\r\n\t\r\n\tpublic void generateRandomGraph(int size, double p, Random random) {\r\n\t\t\r\n\t\tHashSet<Integer>[] neighboursList = generateList(size);\r\n\r\n\t\t// create random spanning tree\r\n\t\tg...
import java.util.Random; import dijkstra.graph.NeighbourArrayGraphGenerator; import dijkstra.performance.PerformanceScenario; import dijkstra.priority.PriorityQueueDijkstra; import dijkstra.priority.impl.GrowingWithTheWebDijkstraPriorityObject; import dijkstra.priority.impl.GrowingWithTheWebFibonacciPriorityQueue;...
package dijkstra.performance.scenario; public class RandomGrowingWithTheWebFibonacciPriorityQueueScenario implements PerformanceScenario { NeighbourArrayGraphGenerator generator = new NeighbourArrayGraphGenerator(); int[] previous;
GrowingWithTheWebDijkstraPriorityObject[] priorityObjectArray;
3
curtisullerich/attendance
src/test/java/edu/iastate/music/marching/attendance/test/model/interact/EventManagerTest.java
[ "public class AbsenceManager extends AbstractManager {\n\n\tprivate DataTrain train;\n\n\tprivate static final Logger LOG = Logger.getLogger(AbsenceManager.class\n\t\t\t.getName());\n\n\tpublic AbsenceManager(DataTrain dataTrain) {\n\t\tthis.train = dataTrain;\n\t}\n\n\t/**\n\t * This does not store any changes in ...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.text.ParseException; import java.util.List; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.Interval; import org.junit.Test; import edu.iastate.music.marching.attendance.model.inter...
package edu.iastate.music.marching.attendance.test.model.interact; public class EventManagerTest extends AbstractDatastoreTest { @Test public void testLongEvent() { DataTrain train = getDataTrain(); EventManager ec = train.events(); AbsenceManager ac = train.absences(); DateTimeZone zone = train.appDat...
List<Absence> list = ac.getAll(event);
4
AgNO3/jcifs-ng
src/main/java/jcifs/smb/SmbTransportImpl.java
[ "public interface Address {\n\n /**\n * \n * @param type\n * @return instance for type, null if the type cannot be unwrapped\n */\n <T extends Address> T unwrap ( Class<T> type );\n\n\n /**\n * \n * @return the resolved host name, or the host address if it could not be resolved\n ...
import java.io.EOFException; import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; import java.net.SocketException; import java.security.MessageDigest; import jav...
/* port 139 is ok if 445 was requested */ ( prt == 445 && this.port == 139 ) ) && ( laddr == this.localAddr || ( laddr != null && laddr.equals(this.localAddr) ) ) && lprt == this.localPort; } void ssn139 () throws IOException { CIFSContext tc = t...
if ( r.getDialectRevision() == Smb2Constants.SMB2_DIALECT_ANY ) {
3
shopzilla/catalog-api-client
client/src/main/java/com/shopzilla/api/client/brand/AbstractBaseUrlProvider.java
[ "public interface UrlProvider {\n\n public String getProductServiceURL();\n\n public String getTaxonomyServiceURL();\n\n public String getAttributeServiceURL();\n \n public String getClassificationServiceURL();\n\n public String getBrandServiceURL();\n\n public String getMerchantServiceURL();\n...
import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.BooleanUtils; import org.apache.commons.lang.ObjectUtils; import com.shopzilla.api.client.UrlProvider; import com.shopzilla.api.client.model.Attribute; import com.shopzilla.api.client.model.AttributeValue; import com.s...
/** * Copyright 2011 Shopzilla.com * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ag...
public Map<String, ?> makeAttributeParameterMap(AttributeSearchRequest request) {
3
urandom/gearshift
gearshift/src/main/java/org/sugr/gearshift/ui/util/QueueManagementDialogHelper.java
[ "public final class G {\n public static final String PREF_DEBUG = \"debug\";\n\n public static final String PREF_SHOW_STATUS = \"show_status\";\n public static final String PREF_SHOW_ADD_DIALOG = \"show_add_dialog\";\n public static final String PREF_DELETE_DATA = \"delete_data\";\n public static fin...
import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import org.sugr.gearshift.G; import org.sugr.gearshift.R; import org.sugr.gearshift.core.TransmissionSession; import org.sugr.gearshift.service.DataService; import org.sugr.gearshift....
package org.sugr.gearshift.ui.util; public class QueueManagementDialogHelper { private BaseTorrentActivity activity; private AlertDialog dialog; public QueueManagementDialogHelper(BaseTorrentActivity activity) { if (!(activity instanceof TransmissionSessionInterface) || !(activity in...
activity.setRefreshing(true, DataService.Requests.SET_TORRENT_ACTION);
2
MyCATApache/Mycat-JCache
src/main/java/io/mycat/jcache/net/command/binary/BinaryVersionCommand.java
[ "public enum ProtocolBinaryCommand {\r\n PROTOCOL_BINARY_CMD_GET((byte)0x00),\r\n PROTOCOL_BINARY_CMD_SET((byte)0x01),\r\n PROTOCOL_BINARY_CMD_ADD((byte)0x02),\r\n PROTOCOL_BINARY_CMD_REPLACE((byte)0x03),\r\n PROTOCOL_BINARY_CMD_DELETE((byte)0x04),\r\n PROTOCOL_BINARY_CMD_INCREMENT((byte)0x05),\r\...
import java.io.IOException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.mycat.jcache.enums.protocol.binary.ProtocolBinaryCommand; import io.mycat.jcache.enums.protocol.binary.ProtocolResponseStatus; import io.mycat.jcache.net.JcacheGlobalConfig; import io.mycat.jcache.net.command.BinaryComm...
package io.mycat.jcache.net.command.binary; /** version Request: MUST NOT have extras. MUST NOT have key. MUST NOT have value. Response: MUST NOT have extras. MUST NOT have key. MUST have value. Request the server version. The server responds with a packet containing the ver...
BinaryResponseHeader header = buildHeader(conn.getBinaryRequestHeader(),ProtocolBinaryCommand.PROTOCOL_BINARY_CMD_VERSION.getByte(),null,JcacheGlobalConfig.version.getBytes(),null,0l);
5
prefanatic/Hermes
mobile/src/main/java/edu/uri/egr/hermessample/samples/HeartRateActivity.java
[ "public class HermesBLE {\n private static final Hermes hermes = Hermes.get();\n private static final BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();\n\n private HermesBLE() {\n\n }\n\n /**\n * Locates all BLE devices.\n *\n * @param scanPeriod Length in seconds...
import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.graphics.drawable.VectorDrawable; import android.os.Bundle; import android.support.v4.content.res.ResourcesCompat; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.wi...
/* * Copyright 2015 Cody Goldberg * * 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...
BLESelectionDialog dialog = new BLESelectionDialog();
3
SecUSo/privacy-friendly-pedometer
app/src/main/java/org/secuso/privacyfriendlyactivitytracker/activities/DistanceMeasurementActivity.java
[ "public class Factory {\n\n /**\n * Returns the class of the step detector service which should be used\n *\n * The used step detector service depends on different soft- and hardware preferences.\n * @param context An instance of the calling Context\n * @return The class of step detector\n ...
import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.os.Bundle; import android.os.IBinder; import android.preference.PreferenceManager; ...
/* Privacy Friendly Pedometer is licensed under the GPLv3. Copyright (C) 2017 Tobias Neidig 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 ...
Intent serviceIntent = new Intent(this, Factory.getStepDetectorServiceClass(this));
0
ypresto/miniguava
miniguava-collect/src/main/java/net/ypresto/miniguava/collect/Lists.java
[ "public static void checkArgument(boolean expression) {\n if (!expression) {\n throw new IllegalArgumentException();\n }\n}", "public static int checkElementIndex(int index, int size) {\n return checkElementIndex(index, size, \"index\");\n}", "public static <T> T checkNotNull(T reference) {\n if (referen...
import static net.ypresto.miniguava.base.Preconditions.checkArgument; import static net.ypresto.miniguava.base.Preconditions.checkElementIndex; import static net.ypresto.miniguava.base.Preconditions.checkNotNull; import static net.ypresto.miniguava.base.Preconditions.checkPositionIndex; import static net.ypresto.minigu...
private int reverseIndex(int index) { int size = size(); checkElementIndex(index, size); return (size - 1) - index; } private int reversePosition(int index) { int size = size(); checkPositionIndex(index, size); return size - index; } @Override public void ad...
checkState(canRemoveOrSet);
5
BeYkeRYkt/LightAPI
bukkit-common/src/main/java/ru/beykerykt/minecraft/lightapi/bukkit/api/extension/IBukkitExtension.java
[ "public interface IHandler {\n\n /**\n * N/A\n */\n void onInitialization(BukkitPlatformImpl impl) throws Exception;\n\n /**\n * N/A\n */\n void onShutdown(BukkitPlatformImpl impl);\n\n /**\n * Platform that is being used\n *\n * @return One of the proposed options from {@...
import org.bukkit.World; import ru.beykerykt.minecraft.lightapi.bukkit.internal.handler.IHandler; import ru.beykerykt.minecraft.lightapi.common.api.engine.EditPolicy; import ru.beykerykt.minecraft.lightapi.common.api.engine.SendPolicy; import ru.beykerykt.minecraft.lightapi.common.api.engine.sched.ICallback; import ru....
/* * 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...
EditPolicy editPolicy, SendPolicy sendPolicy, ICallback callback);
1
neo4j/docker-neo4j
src/test/java/com/neo4j/docker/neo4jserver/TestPasswords.java
[ "public class DatabaseIO\n{\n\tprivate static Config TEST_DRIVER_CONFIG = Config.builder().withoutEncryption().build();\n\tprivate static final Logger log = LoggerFactory.getLogger( DatabaseIO.class );\n\n\tprivate GenericContainer container;\n\tprivate String boltUri;\n\n\tpublic DatabaseIO( GenericContainer conta...
import com.neo4j.docker.utils.DatabaseIO; import com.neo4j.docker.utils.HostFileSystemOperations; import com.neo4j.docker.utils.Neo4jVersion; import com.neo4j.docker.utils.SetContainerUser; import com.neo4j.docker.utils.TestSettings; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assumptions; imp...
package com.neo4j.docker.neo4jserver; public class TestPasswords { private static Logger log = LoggerFactory.getLogger( TestPasswords.class); private GenericContainer createContainer( boolean asCurrentUser ) { GenericContainer container = new GenericContainer( TestSettings.IMAGE_ID ); co...
SetContainerUser.nonRootUser( container );
3
blacklocus/jres
jres-core/src/main/java/com/blacklocus/jres/request/bulk/JresBulk.java
[ "@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = \"@class\")\npublic interface JresBulkable {\n\n /**\n * @return bulk command\n */\n Object getAction();\n\n /**\n * @return (optional) payload of action, e.g. index operation is followed by the document ...
import com.blacklocus.jres.request.JresBulkable; import com.blacklocus.jres.request.JresJsonRequest; import com.blacklocus.jres.response.bulk.JresBulkReply; import com.blacklocus.jres.strings.JresPaths; import com.blacklocus.jres.strings.ObjectMappers; import com.google.common.base.Function; import com.google.common.co...
/** * Copyright 2015 BlackLocus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
private final Iterable<JresBulkable> actions;
0
LithidSoftware/android_Findex
src/com/lithidsw/findex/MainFragment.java
[ "public class FilePageAdapter extends BaseAdapter {\n\n private static LayoutInflater inflater = null;\n private Context mContext;\n private List<FileInfo> mFiles = new ArrayList<FileInfo>();\n ImageLoader imageLoader;\n boolean isTrash;\n private MrToast mrToast;\n private int mLastPosition;\n...
import android.app.Activity; import android.app.ActivityManager; import android.app.AlertDialog; import android.app.Fragment; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import andro...
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { if (menu.size() > 0) { mSearch = menu.findItem(R.id.action_search); if (mSearch != null) { setupSearch(mSearch); } } } private void setupSearch(MenuItem searchItem) { ...
FileUtils.tagFiles(mActivity, list.get(checked)[0], checkedList);
5
huazhouwang/Synapse
app/src/main/java/io/whz/synapse/neural/NeuralNetwork.java
[ "public class App extends Application {\n public static final String TAG = \"Synapse\";\n private static final String DB_NAME = \"global-db\";\n private static final String PREFERENCE_NAME = \"global-preferences\";\n\n private final Global mGlobal = Global.getInstance();\n\n @Override\n public voi...
import android.support.annotation.NonNull; import android.support.v4.util.Pair; import org.greenrobot.greendao.annotation.NotNull; import java.util.Arrays; import io.whz.synapse.component.App; import io.whz.synapse.matrix.Matrix; import io.whz.synapse.pojo.neural.Batch; import io.whz.synapse.util.MatrixUtil; import io....
package io.whz.synapse.neural; public class NeuralNetwork { private static final String TAG = App.TAG + "-NeuralNetwork"; public static final int INPUT_LAYER_NUMBER = 784; public static final int OUTPUT_LAYER_NUMBER = 10; private final Matrix[] mWeights; private final Matrix[] mBiases; ...
Batch batch;
2
lukaspili/flow-navigation
sample/src/main/java/com/example/flow/ui/screen/PostsScreen.java
[ "public class PostAdapter extends RecyclerView.Adapter<PostAdapter.ViewHolder> {\n\n private final Context context;\n private final List<Post> posts;\n private final Listener listener;\n\n private String addPlaceWithQuery;\n\n public PostAdapter(Context context, List<Post> posts, Listener listener) {...
import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import com.example.flow.R; import com.example.flow.app.adapter.PostAdapter; import com.example.flow.dagger.ScreenScope; import com.example.flow.model.Post; import com.example.flow.mortar.ComponentFactory; import com.example.flow.rest.RestCl...
package com.example.flow.ui.screen; /** * @author Lukasz Piliszczuk <lukasz.pili@gmail.com> */ @Layout(R.layout.screen_posts) public class PostsScreen extends Path implements ComponentFactory<RootActivity.Component> { @Override public Object createComponent(RootActivity.Component component) { r...
public static class Presenter extends ViewPresenter<PostsView> implements PostAdapter.Listener {
0
teivah/TIBreview
src/test/java/com/tibco/exchange/tibreview/processor/resourcerule/CProcessorKeyStoreTest.java
[ "public class TIBResource {\n\tprivate String filePath;\n\tprivate String type;\n\t\n\tprivate static final String REQUEST_GET_TYPE = \"/jndi:namedResource/@type\";\n\t\n\tpublic TIBResource(String filePath) throws Exception {\n\t\tthis.filePath = filePath;\n\t\tthis.type = Util.xpathEval(filePath, Constants.RESOUR...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.List; import org.apache.log4j.Logger; import org.junit.Test; import com.tibco.exchange.tibreview.common.TIBResource; import com.tibco.exchange.tibreview.engine.Context; import com.tibco.exchange.tibreview.mod...
package com.tibco.exchange.tibreview.processor.resourcerule; public class CProcessorKeyStoreTest { private static final Logger LOGGER = Logger.getLogger(CProcessorKeyStoreTest.class); @Test public void testCProcessorKeyStoreTest() { TIBResource fileresource; try { fileresource = new TIBRe...
Tibrules tibrules= RulesParser.getInstance().parseFile("src/test/resources/FileResources/xml/KeystoreProviderResource.xml");
5
artur-tamazian/avro-schema-generator
src/test/java/com/at/avro/integration/HsqlIntegrationTest.java
[ "public class AvroSchema {\n private final String name;\n private final String namespace;\n private final String doc;\n\n private List<AvroField> fields;\n\n private Map<String, String> customProperties = new LinkedHashMap<>();\n\n public AvroSchema(Table table, AvroConfig avroConfig) {\n t...
import com.at.avro.AvroSchema; import com.at.avro.DbSchemaExtractor; import com.at.avro.SchemaGenerator; import com.at.avro.config.AvroConfig; import com.at.avro.config.FormatterConfig; import com.at.avro.formatters.SchemaFormatter; import com.at.avro.mappers.RemovePlural; import com.at.avro.mappers.ToCamelCase; import...
package com.at.avro.integration; /** * @author artur@callfire.com */ public class HsqlIntegrationTest { private static final String CONNECTION_URL = "jdbc:hsqldb:mem:testcase;shutdown=true"; private static Connection CONNECTION;
private AvroConfig avroConfig = new AvroConfig("test.namespace");
3
ldbc-dev/ldbc_snb_datagen_deprecated2015
src/main/java/ldbc/socialnet/dbgen/serializer/CSVOriginal.java
[ "public class DateGenerator {\n\tpublic static long ONE_DAY = 24L * 60L * 60L * 1000L;\n\tpublic static long SEVEN_DAYS = 7L * ONE_DAY;\n\tpublic static long THIRTY_DAYS = 30L * ONE_DAY;\n\tpublic static long ONE_YEAR = 365L * ONE_DAY;\n\tpublic static long TWO_YEARS = 2L * ONE_YEAR;\n\tpublic static...
import java.io.FileOutputStream; import java.io.IOException; import java.util.*; import java.util.zip.GZIPOutputStream; import java.io.OutputStream; import ldbc.socialnet.dbgen.dictionary.*; import ldbc.socialnet.dbgen.generator.DateGenerator; import ldbc.socialnet.dbgen.generator.ScalableGenerator; import ldbc.socialn...
public void serialize(Comment comment) { Vector<String> arguments = new Vector<String>(); date.setTimeInMillis(comment.getCreationDate()); String dateString = DateGenerator.formatDateDetail(date); arguments.add(SN.formId(comment.getMessageId())); arguments.add(dateString); ...
arguments.add(DBP.getUrl(organization.name));
2
ngageoint/geowave-osm
src/main/java/mil/nga/giat/osm/mapreduce/Convert/SimpleFeatureGenerator.java
[ "public class ColumnFamily {\n public static final byte[] NODE = \"n\".getBytes(Schema.CHARSET);\n public static final byte[] WAY = \"w\".getBytes(Schema.CHARSET);\n public static final byte[] RELATION = \"r\".getBytes(Schema.CHARSET);\n}", "public class ColumnQualifier {\n public static final byte[] ...
import java.io.IOException; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.accumulo.core.data.ByteSequence; import org.apache.accumulo.core.data.Key; import org.apache.accumulo.core.data.Value; import org.geotools.feature.s...
ad.convert( mappingVal)); } else if (ad.Type.equals( "mapping_key")) { sfb.set( FeatureDefinitionSet.normalizeOsmNames( ad.Name), ad.convert( mappingKey)); } else if ((ad.Key != null) && !ad.Key.equals( "null")) { if (osmunion.tags.co...
if (Schema.arraysEqual(
2
StumbleUponArchive/hbase
src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSink.java
[ "public final class HConstants {\n /**\n * Status codes used for return values of bulk operations.\n */\n public enum OperationStatusCode {\n NOT_RUN,\n SUCCESS,\n BAD_FAMILY,\n SANITY_CHECK_FAILURE,\n FAILURE;\n }\n\n /** long constant for zero */\n public static final Long ZERO_L = Long.va...
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.client.Delete; import or...
/* * Copyright 2010 The Apache Software Foundation * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the ...
HTableInterface table = null;
4
simlar/simlar-android
app/src/main/java/org/simlar/widgets/NoContactPermissionFragment.java
[ "public final class ContactsProvider\n{\n\tprivate static final ContactsProviderImpl mImpl = new ContactsProviderImpl();\n\n\tprivate ContactsProvider()\n\t{\n\t\tthrow new AssertionError(\"This class was not meant to be instantiated\");\n\t}\n\n\t@FunctionalInterface\n\tpublic interface FullContactsListener\n\t{\n...
import android.app.Activity; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.ContactsContract; import android.view.LayoutInflater; import android.view.View; import ...
/* * Copyright (C) 2013 - 2017 The Simlar Authors. * * This file is part of Simlar. (https://www.simlar.org) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the L...
if (Util.isNullOrEmpty(simlarId)) {
4
xyxyLiu/PluginM
PluginManager/src/main/java/com/reginald/pluginm/core/HostInstrumentation.java
[ "public class ActivityThreadCompat {\n private static final String TAG = \"ActivityThreadCompat\";\n private static final boolean DEBUG = true;\n\n private static Class<?> sClass_ActivityThread;\n private static Method sMtd_currentActivityThread;\n private static Method sMtd_getProcessName;\n priv...
import java.lang.ref.WeakReference; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import com.android.common.ActivityThreadCompat; import com.android.common.ContextCompat; import com.reginald.pluginm.PluginInfo; import com.reginald.pluginm.reflect.Fi...
package com.reginald.pluginm.core; /** * Created by lxy on 17-8-9. */ public class HostInstrumentation extends Instrumentation { public static final String TAG = "HostInstrumentation"; private static Class<?> sIAppTaskClazz; private static Instrumentation sBase; private static Instrumentation m...
ActivityResult result = (ActivityResult) MethodUtils.invokeMethodNoThrow(mBase, "execStartActivity",
4
pfstrack/eldamo
src/main/java/xdb/renderer/XQueryRenderer.java
[ "public final class QueryConfigManager {\n\n private QueryConfigManager() {\n };\n\n private static final Logger LOGGER = Logger.getLogger(QueryConfigManager.class.getName());\n private static volatile Map<String, Controller> controllerMap;\n private static String configRoot;\n\n /**\n * Initi...
import java.io.File; import java.io.IOException; import java.io.PrintWriter; import java.util.List; import java.util.Map; import org.w3c.dom.Element; import org.w3c.dom.Node; import xdb.config.QueryConfigManager; import xdb.control.Renderer; import xdb.dom.XQueryEngine; import xdb.util.CollectionsUtil; import xdb.util....
package xdb.renderer; /** * XQuery-based renderer. It only renders output for the first node in the result (which should generally be the * document node). */ public class XQueryRenderer implements Renderer { private final String xquery; private final String mimeType; private final String outputType; ...
XQueryEngine.query(results.get(0), xquery, flatMap, out, outputType);
2
MrCrayfish/MrCrayfishSkateboardingMod
src/main/java/com/mrcrayfish/skateboarding/tricks/flip/TrickVarialKickflip.java
[ "public enum Difficulty {\n\t\n\tEASY(6, 50), MEDIUM(8, 70), HARD(10, 100), IMPOSSIBLE(12, 150);\n\n\tprivate int performTime;\n\tprivate int extraComboTime;\n\n\tDifficulty(int performTime, int extraComboTime) {\n\t\tthis.performTime = performTime;\n\t\tthis.extraComboTime = extraComboTime;\n\t}\n\t\n\tpublic int ...
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.GlStateManager; import com.mrcrayfish.skateboarding.api.Difficulty; import com.mrcrayfish.skateboarding.api.trick.Flip; import com.mrcrayfish.skateboarding.entity.EntitySkateboard; import com.mrcrayfish.skateboarding.util.TrickHelper;...
package com.mrcrayfish.skateboarding.tricks.flip; public class TrickVarialKickflip extends Flip { @Override
public void updateBoard(EntitySkateboard skateboard)
2
heremaps/here-aaa-java-sdk
here-oauth-client/src/main/java/com/here/account/auth/provider/FromSystemProperties.java
[ "public class OAuth1ClientCredentialsProvider implements ClientCredentialsProvider {\n\n private final Clock clock;\n private final String tokenEndpointUrl;\n private final OAuth1Signer oauth1Signer;\n private final String scope;\n \n /**\n * Construct a new {@code OAuth1ClientCredentialsProvi...
import java.util.Properties; import com.here.account.auth.OAuth1ClientCredentialsProvider; import com.here.account.http.HttpConstants.HttpMethods; import com.here.account.http.HttpProvider.HttpRequestAuthorizer; import com.here.account.oauth2.ClientAuthorizationRequestProvider; import com.here.account.oauth2.ClientCred...
/* * Copyright (c) 2017 HERE Europe B.V. * * 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 a...
this(new SettableSystemClock());
6
bcgov/sbc-qsystem
QSystem/src/ru/apertum/qsystem/server/controller/AIndicatorBoard.java
[ "public enum CustomerState {\n // значени� �о�то�ни� \"очередника\"\n\n /**\n * 0 удален по не�вке :: Was deleted by default\n */\n STATE_DEAD,\n /**\n * 1 �тоит и ждет в очереди :: Standing and waiting in line\n */\n STATE_WA...
import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.LinkedList; import ru.apertum.qsystem.common.CustomerState; import ru.apertum.qsystem.common.QLog; import ru.apertum.qsystem.common.model.ATalkingClock; import ru.apertum.qsystem.common.model.QCustomer; import ru.a...
/* * Copyright (C) 2010 {Apertum}Projects. web: www.apertum.ru email: info@apertum.ru * * 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 ...
QService service = customer.getService();
3
8enet/AppOpsX
app/src/main/java/com/zzzmode/appopsx/ui/main/usagestats/UsageStatsAdapter.java
[ "public final class OtherOp {\n\n public static final int OP_ACCESS_PHONE_DATA = 51001;\n\n public static final int OP_ACCESS_WIFI_NETWORK = 52002;\n\n\n public static final String OP_NAME_ACCESS_PHONE_DATA = \"ACCESS_PHONE_DATA\";\n public static final String OP_NAME_ACCESS_WIFI_NETWORK = \"ACCESS_WIFI_NETWORK...
import android.content.Intent; import androidx.annotation.NonNull; import androidx.core.util.Pair; import androidx.recyclerview.widget.RecyclerView; import androidx.appcompat.widget.SwitchCompat; import android.text.format.DateUtils; import android.view.LayoutInflater; import android.view.View; import android.view.View...
package com.zzzmode.appopsx.ui.main.usagestats; /** * Created by zl on 2017/8/16. */ class UsageStatsAdapter extends RecyclerView.Adapter<UsageStatsAdapter.ViewHolder> implements OnClickListener,OnCheckedChangeListener{ private static final String TAG = "UsageStatsAdapter"; private List<Pair<AppInfo, OpE...
LocalImageLoader.load(holder.imgIcon, pair.first);
2
tupilabs/tap4j
src/test/java/org/tap4j/parser/issueGitHub14/TestDiagnostics.java
[ "public interface TapConsumer {\n\n /**\n * Parses a TAP File.\n *\n * Note: this method only works if the {@code TapConsumer} was constructed\n * with an assumed character set encoding, <em>and</em> {@code file} really\n * is encoded in that assumed encoding.\n *\n * For a more flexi...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.io.File; import org.junit.Test; import org.tap4j.consumer.TapConsumer; import org.tap4j.consumer.TapConsumerFactory; import org.tap4j.model.TestResult; import org.tap4j.model.TestSet; import org.tap4j.parser.issue3406964...
package org.tap4j.parser.issueGitHub14; /** * Diagnostics are added to all test cases, after one with diagnostics was found. * * @since 4.0.3 */ public class TestDiagnostics { @Test public void testDiagnostics() { TapConsumer tapConsumer = TapConsumerFactory.makeTap13YamlConsumer();
TestSet testSet = tapConsumer.load(new File(TestDirectives.class
3
heroku/heroku.jar
heroku-http-ning-async/src/main/java/com/heroku/api/connection/AsyncHttpClientConnection.java
[ "public class Heroku {\n\n\n public enum Config {\n ENDPOINT(\"HEROKU_HOST\", \"heroku.host\", \"heroku.com\");\n public final String environmentVariable;\n public final String systemProperty;\n public final String defaultValue;\n public final String value;\n\n Config(St...
import com.heroku.api.Heroku; import com.heroku.api.exception.HerokuAPIException; import com.heroku.api.exception.RequestFailedException; import com.heroku.api.http.Http; import com.heroku.api.request.Request; import org.asynchttpclient.*; import java.util.Base64; import java.io.IOException; import java.io.UnsupportedE...
package com.heroku.api.connection; public class AsyncHttpClientConnection implements ListenableFutureConnection { private AsyncHttpClient httpClient = new DefaultAsyncHttpClient(); private org.asynchttpclient.Request buildRequest(Request<?> req, Map<String,String> extraHeaders, String key) { BoundR...
if (e.getCause() instanceof RequestFailedException) {
2
Civcraft/BetterShards
BetterShardsBukkit/src/main/java/vg/civcraft/mc/bettershards/command/commands/CreatePortal.java
[ "public class BetterShardsPlugin extends ACivMod{\n\n\tprivate static BetterShardsPlugin instance;\n\tprivate PortalsManager pm;\n\tprivate DatabaseManager db;\n\tprivate String servName;\n\tprivate CombatTagManager combatManager;\n\tprivate RandomSpawnManager randomSpawn;\n\tprivate ConnectionManager connectionMan...
import java.util.List; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import vg.civcraft.mc.bettershards.BetterShardsPlugin; import vg.civcraft.mc.bettershards.manager.PortalsManager; import vg.civcraft.mc.bettershards.misc.Grid; import vg.civcraft.mc.bettershards...
package vg.civcraft.mc.bettershards.command.commands; public class CreatePortal extends PlayerCommand { private PortalsManager pm; public CreatePortal(String name) { super(name); setIdentifier("bsc"); setDescription("Creates a portal from the selection made."); setUsage("/bsc <name>, <PortalType>"); ...
portal = new CircularPortal(args [0], null, true, g.getLeftClickLocation(), g.getRightClickLocation());
6
davidmoten/state-machine
state-machine-persistence/src/test/java/com/github/davidmoten/fsm/persistence/PersistenceAccountTest.java
[ "public final class Account {\n\n public final String id;\n public final BigDecimal balance;\n\n @JsonCreator\n public Account(@JsonProperty(\"id\") String id, @JsonProperty(\"balance\") BigDecimal balance) {\n this.id = id;\n this.balance = balance;\n }\n\n @Override\n public Str...
import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.sql.Connection; import java.sql.DriverManager; import java.util.concurrent.Callable; import java.util.function.Function; import org.junit.Assert; import org.junit.Test; import com.github.davidmoten.fsm.example.account.Account; imp...
package com.github.davidmoten.fsm.persistence; public class PersistenceAccountTest { @Test public void testJsonSerializeAccountRoundTrip() { byte[] bytes = Serializer.JSON.serialize(new Account("dave", BigDecimal.TEN)); System.out.println(new String(bytes)); Account a = Serializer.J...
TestExecutor executor = new TestExecutor();
8
carrotsearch/smartsprites
src/main/java/org/carrot2/labs/smartsprites/SpriteBuilder.java
[ "public class LevelCounterMessageSink implements MessageSink\n{\n /** Number of info messages */\n private int infoCount = 0;\n\n /** Number of warning messages */\n private int warnCount = 0;\n\n public void add(Message message)\n {\n if (MessageLevel.INFO.equals(message.level))\n {...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Ma...
package org.carrot2.labs.smartsprites; /** * Performs all stages of sprite building. This class is not thread-safe. */ public class SpriteBuilder { /** Properties we need to watch for in terms of overriding the generated ones. */ private static final HashSet<String> OVERRIDING_PROPERTIES = Sets.newHashSet...
this(parameters, messageLog, new FileSystemResourceHandler(
3
byhieg/easyweather
app/src/main/java/com/weather/byhieg/easyweather/data/source/local/dao/DaoSession.java
[ "@Entity\npublic class CityEntity{\n\n @Id(autoincrement = true)\n private Long id;\n\n private String cityName;\n\n private String provinceName;\n\n @Generated(hash = 1398242605)\n public CityEntity(Long id, String cityName, String provinceName) {\n this.id = id;\n this.cityName = c...
import java.util.Map; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.AbstractDaoSession; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.identityscope.IdentityScopeType; import org.greenrobot.greendao.internal.DaoConfig; import com.weather.byhieg.easyweather....
package com.weather.byhieg.easyweather.data.source.local.dao; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * {@inheritDoc} * * @see org.greenrobot.greendao.AbstractDaoSession */ public class DaoSession extends AbstractDaoSession { private final DaoConfig cityEntityDaoConfig; private final...
registerDao(ProvinceEntity.class, provinceEntityDao);
2
utapyngo/owl2vcs
src/main/java/owl2vcs/analysis/ConflictFinder.java
[ "public abstract class PrefixChangeData extends CustomOntologyChangeData {\r\n\r\n private static final long serialVersionUID = -1862023752748180868L;\r\n\r\n private final String prefixName;\r\n private final String prefix;\r\n\r\n public PrefixChangeData(String prefixName, String prefix) {\r\n ...
import java.util.Collections; import java.util.HashSet; import java.util.Set; import org.semanticweb.owlapi.change.AxiomChangeData; import org.semanticweb.owlapi.model.OWLAnonymousIndividual; import org.semanticweb.owlapi.model.OWLEntity; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.ow...
package owl2vcs.analysis; /** * This class is used to classify changes into 3 categories: - common changes * (if it happens to both parties to make same changes); - conflicting changes * (which have links to common ontology elements); - other changes * (non-conflicting). * */ public class Conflict...
private final MutableChangeSet conflictsRemote;
3
UWFlow/flow-android
src/com/uwflow/flow_android/fragment/ProfileFragment.java
[ "public class FlowApplication extends Application {\n\n public static final boolean isBlackberry = System.getProperty(\"os.name\").equals(\"qnx\");\n\n private static final String IS_USER_LOGGED_IN_KEY = \"is_user_logged_in\";\n private static final String MIXPANEL_TOKEN = \"0a5e88bd3f288fe8a2d8adf94b45221...
import android.app.AlertDialog; import android.app.ProgressDialog; import android.content.*; import android.graphics.Bitmap; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.content.LocalBroadcastManager; import android.support.v4.view.ViewPager; import android.view.*; import ...
package com.uwflow.flow_android.fragment; public class ProfileFragment extends TrackedFragment implements SharableURL { private String mProfileID;
private ProfilePagerAdapter profilePagerAdapter;
2
protolambda/blocktopograph
app/src/main/java/com/protolambda/blocktopograph/map/MarkerManager.java
[ "public class Log {\n\n //TODO This is kind of lazy, but repeating the Log.d(*msg*) everywhere is obnoxious\n //TODO log only if debug mode is on?\n\n public static final String LOG_TAG = \"Blocktopograph\";\n\n public static void i(String msg){\n android.util.Log.i(LOG_TAG, msg);\n }\n\n p...
import android.util.LongSparseArray; import com.protolambda.blocktopograph.Log; import com.protolambda.blocktopograph.chunk.ChunkManager; import com.protolambda.blocktopograph.map.marker.AbstractMarker; import com.protolambda.blocktopograph.map.marker.CustomNamedBitmapProvider; import com.protolambda.blocktopograph.uti...
package com.protolambda.blocktopograph.map; /** * TODO docs * */ public class MarkerManager { /* TODO marker stuff: - add more marker-icons/types - player markers with name-tags */ // g0: Whole match // g1: Format version (int) // g2: Marker display name...
Log.d("Invalid line in marker file: " + line);
0
danielshaya/reactivejournal
src/main/java/org/reactivejournal/examples/helloworld/HelloWorldTest.java
[ "public class ReactiveValidator {\n private static final Logger LOG = LoggerFactory.getLogger(ReactiveValidator.class.getName());\n private ValidationResult validationResult;\n private DataItemProcessor dataItemProcessor = new DataItemProcessor();\n\n public void validate(String fileName, Publisher flow...
import io.reactivex.Flowable; import io.reactivex.flowables.ConnectableFlowable; import org.junit.Assert; import org.junit.Test; import org.reactivejournal.impl.ReactiveValidator; import org.reactivestreams.Subscriber; import org.reactivestreams.Subscription; import org.reactivejournal.impl.PlayOptions; import org.reac...
package org.reactivejournal.examples.helloworld; /** * A demo example Junit test class to test BytesToWordsProcessor. * Make sure you have run the HelloWorldApp_JounalAsObserver first to generate the journal. */ public class HelloWorldTest { private static final Logger LOG = LoggerFactory.getLogger(HelloWor...
Assert.assertEquals(ValidationResult.Result.OK, reactiveValidator.getValidationResult().getResult());
3
domax/gwt-dynamic-plugins
gwt-dynamic-main/gwt-dynamic-host/src/main/java/org/gwt/dynamic/host/client/main/MainLayout.java
[ "public static native String toStringJSO(JavaScriptObject jso) /*-{\n\treturn JSON.stringify(jso);\n}-*/;", "public class ModuleInfo extends JavaScriptObject {\n\n\tpublic static final ModuleInfo create() {\n\t\treturn JavaScriptObject.createObject().cast();\n\t}\n\t\n\tpublic static final ModuleInfo create(Strin...
import static com.google.gwt.dom.client.BrowserEvents.CLICK; import static com.google.gwt.dom.client.BrowserEvents.KEYDOWN; import static org.gwt.dynamic.common.client.util.JsUtils.toStringJSO; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; import org.gwt.dynamic.common.client.jso.M...
/* * Copyright 2014 Maxim Dominichenko * * Licensed under The MIT License (MIT) (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * https://github.com/domax/gwt-dynamic-plugins/blob/master/LICENSE * * Unless required by applicable...
@UiField(provided = true) CellList<ModuleInfo> cellList =
1
Fivium/ScriptRunner
src/com/fivium/scriptrunner2/loader/PatchScriptLoader.java
[ "public class PatchScript {\n \n private final String mPatchLabel;\n private final int mPatchNumber;\n private final String mDescription;\n private final List<ScriptExecutable> mExecutableList;\n \n private final String mPatchFileHash;\n private final int mPromotionSequencePosition; \n private final Strin...
import com.fivium.scriptrunner2.Logger; import com.fivium.scriptrunner2.PatchScript; import com.fivium.scriptrunner2.PromotionFile; import com.fivium.scriptrunner2.ScriptRunner; import com.fivium.scriptrunner2.database.DatabaseConnection; import com.fivium.scriptrunner2.database.PatchRunController; import com.fivium.sc...
package com.fivium.scriptrunner2.loader; /** * This loader is used to run PatchScripts on the target database. PatchScripts typically contain a combination of * DDL for creating database objects and DML for patching data. Executions are logged in special log tables. * A PatchScript should only be executed once ...
public void promoteFile(ScriptRunner pScriptRunner, PromotionFile pPromotionFile)
1
FernandoOrtegaMartinez/Planket
app/src/androidTest/java/com/fomdeveloper/planket/SearchActivityTest.java
[ "public class ResponseHelper {\n\n public static Single<PhotosContainer> interestingnessResponse(String jsonResponse){\n PhotosContainer photosContainer = new Gson().fromJson(jsonResponse, PhotosContainer.class);\n return Single.just(photosContainer);\n }\n\n public static String getStringFro...
import android.app.Instrumentation; import android.content.Intent; import android.support.test.InstrumentationRegistry; import android.support.test.espresso.intent.Intents; import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import android.widget.TextView; import com.fom...
package com.fomdeveloper.planket; /** * Created by Fernando on 15/01/16. */ @RunWith(AndroidJUnit4.class) public class SearchActivityTest { private static final String A_TEXT = "Text"; private static final String A_TAG = "Tag"; private static final String AN_ID = "123"; private static final St...
MockComponent component = (MockComponent) app.getAppComponent();
2
jipijapa/jipijapa
hibernate4_3/src/main/java/org/jboss/as/jpa/hibernate4/management/HibernateAbstractStatistics.java
[ "public interface EntityManagerFactoryAccess {\n /**\n * returns the entity manager factory that statistics should be obtained for.\n *\n * @throws IllegalStateException if scopedPersistenceUnitName is not found\n *\n * @param scopedPersistenceUnitName is persistence unit name scoped to the c...
import org.jipijapa.management.spi.StatisticName; import org.jipijapa.management.spi.Statistics; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Locale; import java.util.Map; import java.util.ResourceBundle; import java.util.Set; import javax.persistence.EntityManagerF...
/* * JBoss, Home of Professional Open Source * Copyright 2013, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not us...
public Object getValue(String name, EntityManagerFactoryAccess entityManagerFactoryAccess, StatisticName statisticName, PathAddress pathAddress) {
3
shunjikonishi/sendgrid4j
src/test/java/jp/co/flect/sendgrid/InvalidEmailTest.java
[ "public class InvalidEmail extends AbstractModel {\n\t\n\tpublic InvalidEmail(Map<String, Object> map) {\n\t\tsuper(map);\n\t}\n\t\n\tpublic String getReason() { return doGetString(\"reason\");}\n\tpublic Date getCreated() { return doGetDate(\"created\", true);}\n\tpublic String getEmail() { return doGetString(\"em...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; import org.junit.Test; import org.junit.BeforeClass; import java.io.File; import java.io.FileInputStream;...
package jp.co.flect.sendgrid; public class InvalidEmailTest { @Test public void invalidMails() throws Exception { SendGridClient client = new SendGridClient(USERNAME, PASSWORD); InvalidEmail.Get request = new InvalidEmail.Get(); List<InvalidEmail> list = client.getInvalidEmails(request); assertTrue(lis...
WebMail mail = new WebMail();
1
trigor74/travelers-diary
app/src/main/java/com/travelersdiary/fragments/DiaryListFragment.java
[ "public final class Constants {\n // firebase\n public static final String FIREBASE_URL = BuildConfig.FIREBASE_ROOT_URL;\n public static final String FIREBASE_USERS = \"users\";\n public static final String FIREBASE_USER_EMAIL = \"email\";\n public static final String FIREBASE_USER_NAME = \"name\";\n...
import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; import android.support.v7.view.ActionMode; ...
holder.tvDay.setText(""); holder.tvMonth.setText(""); holder.tvYear.setText(""); holder.tvText.setText(""); String img = ""; holder.tvPhotoCount.setText(""); //Note title holder.tvTitle.setTe...
private static IOnItemClickListener onItemClickListener = new IOnItemClickListener() {
4
vineey/archelix-rsql
rsql-querydsl-parent/rsql-querydsl-filter/src/test/java/com/github/vineey/rql/querydsl/filter/QuerydslFilterBuilder_NumberPath_Test.java
[ "public final class QRSQLOperators {\n public static final ComparisonOperator SIZE_EQ = new ComparisonOperator(\"=size=\");\n public static final ComparisonOperator SIZE_NOT_EQ = new ComparisonOperator(\"=sizene=\");\n private final static Logger LOGGER = LoggerFactory.getLogger(QRSQLOperators.class);\n\n ...
import com.github.vineey.rql.filter.operator.QRSQLOperators; import com.github.vineey.rql.filter.parser.DefaultFilterParser; import com.github.vineey.rql.filter.parser.FilterParser; import com.github.vineey.rql.querydsl.filter.util.RSQLUtil; import com.google.common.collect.Maps; import com.querydsl.core.types.Path; im...
/* * MIT License * * Copyright (c) 2016 John Michael Vincent S. Rustia * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use,...
FilterParser filterParser = new DefaultFilterParser();
1
AndyGu/ShanBay
src/com/shanbay/words/review/experience/ExpDataTransferHelper.java
[ "public class Example extends Model\n{\n public String annotation;\n public String first;\n public long id;\n public String last;\n public int likes;\n public String mid;\n public String nickname;\n public String translation;\n public int unlikes;\n public long userid;\n public String username;\n public...
import com.shanbay.words.model.Example; import com.shanbay.words.model.ExampleContent; import com.shanbay.words.model.ExampleData; import com.shanbay.words.model.ExpReview; import com.shanbay.words.model.Roots; import com.shanbay.words.model.RootsContent; import com.shanbay.words.model.RootsData; import com.shanbay.wor...
package com.shanbay.words.review.experience; public class ExpDataTransferHelper { public ExampleData getExampleData(ExpReview paramExpReview) { ExampleData localExampleData = new ExampleData(); ArrayList<ExampleContent> list = new ArrayList<ExampleContent>(); Iterator<Example> localIterator = paramExp...
public VocabularyData getVocabularyData(ExpReview paramExpReview)
7
BottleRocketStudios/Android-GroundControl
GroundControlSample/app/src/main/java/com/bottlerocketstudios/groundcontrolsample/config/controller/ConfigurationController.java
[ "public class Configuration {\n private static final String TAG = Configuration.class.getSimpleName();\n \n private String mVersionPath;\n private Uri mBaseUrl;\n \n public String getVersionPath() {\n return mVersionPath;\n }\n\n public void setVersionPath(String versionPath) {\n ...
import java.io.IOException; import java.util.concurrent.TimeUnit; import okhttp3.OkHttpClient; import okhttp3.Request; import android.content.Context; import android.util.Log; import com.bottlerocketstudios.groundcontrolsample.config.model.Configuration; import com.bottlerocketstudios.groundcontrolsample.config.model.C...
/* * Copyright (c) 2016 Bottle Rocket 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 ...
public CurrentVersion downloadCurrentVersion(Configuration configuration) {
1
ProxyPrint/proxyprint-kitchen
src/main/java/io/github/proxyprint/kitchen/controllers/printshops/ReviewController.java
[ "@Entity\n@Inheritance(strategy=InheritanceType.SINGLE_TABLE)\n@Table(name = \"consumers\")\npublic class Consumer extends User {\n\n @Column(name = \"name\", nullable = false)\n private String name;\n @Column(name = \"email\", nullable = true) // all true because null constraint block adition of employees...
import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import io.github.proxyprint.kitchen.models.consumer.Consumer; import io.github.proxyprint.kitchen.models.printshops.PrintShop; import io.github.proxyprint.kitchen.models.printshops.Review; import io.github.proxyprint.kitch...
/* * Copyright 2016 Pivotal Software, 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 ...
Set<Review> reviews = pShop.getReviews();
1
greghaskins/spectrum
src/test/java/specs/TimeoutSpecs.java
[ "static BlockConfigurationChain timeout(Duration timeout) {\n return new BlockConfigurationChain().with(new BlockTimeout(timeout));\n}", "static Block with(final BlockConfigurationChain configuration, final Block block) {\n return ConfiguredBlock.with(configuration.getBlockConfiguration(), block);\n}", "publi...
import static com.greghaskins.spectrum.Configure.timeout; import static com.greghaskins.spectrum.Configure.with; import static com.greghaskins.spectrum.Spectrum.*; import static java.time.Duration.ofMillis; import static java.time.Duration.ofMinutes; import static org.hamcrest.MatcherAssert.assertThat; import static or...
package specs; @RunWith(Spectrum.class) public class TimeoutSpecs { { describe("A suite with timeouts", () -> { it("will allow things to pass if they run quicker than the timeout", () -> { final Result result = SpectrumHelper.run(() -> {
describe("Suite with generous timeout", with(timeout(ofMillis(1000)), () -> {
0
shillner/unleash-maven-plugin
plugin/src/main/java/com/itemis/maven/plugins/unleash/steps/checks/CheckDependencyVersions.java
[ "public class ArtifactCoordinates {\n private String groupId;\n private String artifactId;\n private String version;\n private String type;\n private String classifier;\n\n public ArtifactCoordinates(String groupId, String artifactId, String version) {\n this(groupId, artifactId, version, null, null);\n }...
import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import javax.inject.Inject; import javax.inject.Named; import org.apache.maven.model.Dependency; import org.apac...
package com.itemis.maven.plugins.unleash.steps.checks; /** * Checks that none of the project modules has SNAPSHOT dependencies since this would potentially lead to * non-reproducible release artifacts. * * @author <a href="mailto:stanley.hillner@itemis.de">Stanley Hillner</a> * @since 1.0.0 */ @ProcessingSte...
Multimap<MavenProject, ArtifactCoordinates> snapshotsByProject = HashMultimap.create();
0
maxpowa/AdvancedHUD
src/main/java/advancedhud/client/huditems/HudItemAir.java
[ "public class HUDRegistry {\n protected static List<HudItem> hudItemList = new ArrayList<HudItem>();\n protected static boolean initialLoadComplete = false;\n protected static List<HudItem> hudItemListActive = new ArrayList<HudItem>();\n\n private static Logger log = LogManager.getLogger(\"AdvancedHUD-A...
import advancedhud.api.Alignment; import advancedhud.api.HUDRegistry; import advancedhud.api.HudItem; import advancedhud.api.RenderAssist; import advancedhud.client.ui.GuiAdvancedHUDConfiguration; import advancedhud.client.ui.GuiScreenHudItem; import advancedhud.client.ui.GuiScreenReposition; import aurelienribon.tween...
package advancedhud.client.huditems; public class HudItemAir extends HudItem { private boolean wasInWater = true; public HudItemAir() { // If we override the constructor, we should ALWAYS call super()! It's important! super(); // Set up tweening for opacity Tween.registerAcce...
return new GuiScreenHudItem(Minecraft.getMinecraft().currentScreen, this);
4
lgvalle/Beautiful-Photos
app/src/main/java/com/lgvalle/beaufitulphotos/gallery/GalleryFragment.java
[ "public abstract class BaseFragment extends Fragment {\n\n\t/**\n\t * Bind layout\n\t */\n\tprotected abstract void initLayout();\n\n\t/**\n\t * @return Activity layout resource\n\t */\n\tprotected abstract int getContentView();\n\n\t@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container...
import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.AbsListView; import android.widget.ListView; import android.widget.ProgressBar; import butterknife.InjectView; import butterknife.OnItemClick; import com.lgvalle.beaufitulphotos.BaseFragment; import com.lgvalle...
package com.lgvalle.beaufitulphotos.gallery; /** * Created by lgvalle on 21/07/14. * <p/> * A PhotoModel Gallery. * <p/> * This is the UI layer of the Gallery. * It is initialized empty and listen for {@link PhotosAvailableEvent} on the bus * When a new event is received, all photos are added to the adapter. ...
BusHelper.register(this);
6
komamj/FileManager
app/src/main/java/com/koma/filemanager/data/FileRepository.java
[ "public class FileManagerApplication extends Application {\n private static Context sContext;\n\n @Override\n public void onCreate() {\n super.onCreate();\n sContext = getApplicationContext();\n enabledStrictMode();\n if (LeakCanary.isInAnalyzerProcess(this)) {\n // T...
import com.koma.filemanager.FileManagerApplication; import com.koma.filemanager.base.BaseFile; import com.koma.filemanager.data.model.ApkFile; import com.koma.filemanager.data.model.AudioFile; import com.koma.filemanager.data.model.Disk; import com.koma.filemanager.data.model.DocumentFile; import com.koma.filemanager.d...
package com.koma.filemanager.data; /** * Created by koma on 11/25/16. */ public class FileRepository implements FileDataSource { private static volatile FileRepository sRespository; private LocalDataSource mLocalDataSource; private FileRepository() { mLocalDataSource = new LocalDataSource(Fi...
public Observable<ArrayList<DocumentFile>> getDocumentFiles() {
5
tomasbjerre/git-changelog-lib
src/test/java/se/bjurr/gitchangelog/api/TemplatesTest.java
[ "public static GitChangelogApi gitChangelogApiBuilder() {\n return new GitChangelogApi();\n}", "public static final String ZERO_COMMIT = \"0000000000000000000000000000000000000000\";", "public static void mock(final RestClient mock) {\n mockedRestClient = mock;\n}", "public class GitHubMockInterceptor imple...
import static java.nio.charset.StandardCharsets.UTF_8; import static se.bjurr.gitchangelog.api.GitChangelogApi.gitChangelogApiBuilder; import static se.bjurr.gitchangelog.api.GitChangelogApiConstants.ZERO_COMMIT; import static se.bjurr.gitchangelog.internal.integrations.rest.RestClient.mock; import java.nio.file.Files;...
package se.bjurr.gitchangelog.api; public class TemplatesTest { private GitChangelogApi baseBuilder; @Before public void before() throws Exception { JiraClientFactory.reset(); final RestClientMock mockedRestClient = new RestClientMock(); mockedRestClient // .addMockedResponse( ...
gitChangelogApiBuilder() //
0
mtsar/mtsar
src/main/java/mtsar/api/Stage.java
[ "public interface AnswerAggregator {\n /**\n * Given a collection of tasks, an aggregator maps these tasks to the aggregated answers.\n *\n * @param tasks tasks.\n * @return Aggregated answers.\n */\n @Nonnull\n Map<Integer, AnswerAggregation> aggregate(@Nonnull Collection<Task> tasks);...
import java.util.Map; import static java.util.Objects.requireNonNull; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; import mtsar...
/* * Copyright 2015 Dmitry Ustalov * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
return putAllOptions(PostgresUtils.parseJSONString(json));
4
Emerjoin/Hi-Framework
Web/src/main/java/org/emerjoin/hi/web/DispatcherServlet.java
[ "public class AppConfigurations {\n\n private String viewsDirectory;\n private String welcomeUrl;\n private String templates[]={\"index\"};\n private List<String> frontiers = new ArrayList<>();\n private List<String> frontierPackages = new ArrayList<>();\n private Tunings tunings = new Tunings();\...
import org.emerjoin.hi.web.config.AppConfigurations; import org.emerjoin.hi.web.config.ConfigProvider; import org.emerjoin.hi.web.boot.BootAgent; import org.emerjoin.hi.web.internal.Router; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.enterprise.inject.spi.CDI; import javax.inject.Inject; impor...
package org.emerjoin.hi.web; /** * Created by Mario Junior. */ @WebServlet(urlPatterns = "/*",name = "Hi-Framework-Dispatcher-Servlet",loadOnStartup = 1) public class DispatcherServlet extends HttpServlet { private static Logger _log = LoggerFactory.getLogger(DispatcherServlet.class); @Inject priva...
private ConfigProvider configProvider;
1
matejdro/WearVibrationCenter
mobile/src/main/java/com/matejdro/wearvibrationcenter/mute/TimedMuteManager.java
[ "public interface CommPaths\n{\n String PHONE_APP_CAPABILITY = \"VibrationCenterPhone\";\n String WATCH_APP_CAPABILITY = \"VibrationCenterWatch\";\n\n String COMMAND_VIBRATE = \"/Command/Vibrate\";\n String COMMAND_ALARM = \"/Command/Alarm\";\n String COMMAND_APP_MUTE = \"/Command/AppMute\";\n Str...
import android.Manifest; import android.annotation.TargetApi; import android.app.AlarmManager; import android.app.Notification; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.c...
package com.matejdro.wearvibrationcenter.mute; public class TimedMuteManager implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, MessageApi.MessageListener { private static final int NOTIFICATION_ID_MUTE_DURATION = 0; private static final String ACTON_UNMUTE ...
ZenModeChange doNotDistrubChange = Preferences.getEnum(service.getGlobalSettings(), GlobalSettings.TIMED_MUTE_ZEN_CHANGE);
5
zaclimon/xipl
tiflibrary/src/main/java/com/google/android/media/tv/companionlibrary/sync/EpgSyncJobService.java
[ "public class Advertisement implements Comparable<Advertisement> {\n /** The advertisement type for VAST. */\n public static final int TYPE_VAST = 0;\n\n private long mStartTimeUtcMillis;\n private long mStopTimeUtcMillis;\n private int mType;\n private String mRequestUrl;\n\n private Advertise...
import android.app.job.JobInfo; import android.app.job.JobParameters; import android.app.job.JobScheduler; import android.app.job.JobService; import android.content.ComponentName; import android.content.ContentProviderOperation; import android.content.ContentResolver; import android.content.Context; import android.cont...
throw new IllegalArgumentException("This class does not extend EpgSyncJobService"); } PersistableBundle persistableBundle = new PersistableBundle(); persistableBundle.putString(EpgSyncJobService.BUNDLE_KEY_INPUT_ID, inputId); persistableBundle.putLong(EpgSyncJobService.BUNDLE...
ModelUtils.updateChannels(
3
emina/kodkod
test/kodkod/test/sys/ExamplesTestWithIncrementalSolver.java
[ "public final class IncrementalSolver implements KodkodSolver {\n\tprivate final Options options;\n\tprivate Translation.Incremental translation;\n\tprivate Boolean outcome;\n\t\n\t/**\n\t * Initializes the solver with the given options.\n\t * @ensures no this.solution' && no this.formulas' && \n\t * no th...
import static kodkod.engine.Solution.Outcome.UNSATISFIABLE; import static org.junit.Assert.assertEquals; import java.util.ArrayList; import java.util.Collection; import java.util.Set; import kodkod.ast.Formula; import kodkod.ast.Relation; import kodkod.engine.IncrementalSolver; import kodkod.engine.Solution; import kod...
package kodkod.test.sys; @RunWith(Parameterized.class) public class ExamplesTestWithIncrementalSolver extends ExamplesTest { private final IncrementalSolver solver; public ExamplesTestWithIncrementalSolver(SATFactory solverOpt) { final Options opt = new Options(); opt.setSolver(solverOpt); this.solve...
final Set<IntSet> parts = SymmetryDetector.partition(bounds);
2
RoboTricker/Transport-Pipes
src/main/java/de/robotricker/transportpipes/listener/PlayerListener.java
[ "public class GeneralConf extends Conf {\n\n @Inject\n public GeneralConf(Plugin configPlugin) {\n super(configPlugin, \"config.yml\", \"config.yml\", true);\n }\n\n public int getMaxItemsPerPipe() {\n return (int) read(\"max_items_per_pipe\");\n }\n\n public boolean isCraftingEnable...
import de.robotricker.transportpipes.config.GeneralConf; import de.robotricker.transportpipes.duct.Duct; import de.robotricker.transportpipes.duct.DuctRegister; import de.robotricker.transportpipes.duct.manager.DuctManager; import de.robotricker.transportpipes.duct.manager.GlobalDuctManager; import de.robotricker.trans...
package de.robotricker.transportpipes.listener; public class PlayerListener implements Listener { @Inject private GlobalDuctManager globalDuctManager; @Inject
private DuctRegister ductRegister;
2
eriche39/simple-orchestrator
samples/src/main/java/com/github/ehe/simpleorchestrator/sample/api/loan/LoanService.java
[ "public interface Orchestrator<P extends Context> {\n\n /**\n * Execute the <code>Task</code>s, by the order of their position in\n * task list,\n * (Note: the tasks are executed in the same thread as the caller)\n *\n * @param context the <code>context</code> object\n * @throws Orchestra...
import com.github.ehe.simpleorchestrator.Orchestrator; import com.github.ehe.simpleorchestrator.impl.OrchestratorImpl; import com.github.ehe.simpleorchestrator.sample.entity.ApplicationResult; import com.github.ehe.simpleorchestrator.sample.entity.LoanApplication; import com.github.ehe.simpleorchestrator.sample.excepti...
/* * * * Copyright (c) 2017. Eric He (eriche39@gmail.com) * * * * This software is licensed under * * * * MIT license * * * */ package com.github.ehe.simpleorchestrator.sample.api.loan; /** * Card (Credit/Debit) application service * * Orchestration: * * application --&gt; CreditScoreTask --&gt;...
private LoanTask loanTask;
7
EinsamHauer/disthene
src/main/java/net/iponweb/disthene/service/index/IndexService.java
[ "public class Metric {\r\n\r\n private MetricKey key;\r\n private double value;\r\n\r\n public Metric(String input, Rollup rollup) {\r\n String[] splitInput = input.split(\"\\\\s\");\r\n // We were interning tenant and path here - we are going to store them all (or almost so) constantly anyho...
import net.engio.mbassy.bus.MBassador; import net.engio.mbassy.listener.Handler; import net.engio.mbassy.listener.Listener; import net.engio.mbassy.listener.References; import net.iponweb.disthene.bean.Metric; import net.iponweb.disthene.config.IndexConfiguration; import net.iponweb.disthene.events.DistheneEvent; impor...
package net.iponweb.disthene.service.index; /** * @author Andrei Ivanov */ @Listener(references= References.Strong) public class IndexService { private static final String SCHEDULER_NAME = "distheneIndexCacheExpire"; private Logger logger = Logger.getLogger(IndexService.class);
private IndexConfiguration indexConfiguration;
1
RamuRChenchaiah/SpringSecurity-registration-login
src/main/java/com/login/security/MyUserDetailsService.java
[ "public interface RoleRepository extends JpaRepository<Role, Long> {\n\n Role findByName(String name);\n\n @Override\n void delete(Role role);\n\n}", "public interface UserRepository extends JpaRepository<User, Long> {\n User findByEmail(String email);\n\n @Override\n void delete(User user);\n\n...
import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.author...
package com.login.security; @Service("userDetailsService") @Transactional public class MyUserDetailsService implements UserDetailsService { @Autowired private UserRepository userRepository; @Autowired
private RoleRepository roleRepository;
0
noties/Scrollable
sample/src/main/java/ru/noties/scrollable/sample/colorful/ColorfulActivity.java
[ "public class ViewPagerUtils {\n\n public interface CurrentView {\n View currentView();\n }\n\n // please note that it registers OnHierarchyChangedListener, so if any has already been registered\n // it will be removed\n public static CurrentView currentView(final ViewPager pager) {\n r...
import android.animation.ValueAnimator; import android.annotation.TargetApi; import android.app.Activity; import android.content.Context; import android.os.Build; import android.os.Bundle; import android.support.annotation.ColorInt; import android.support.v4.content.ContextCompat; import android.support.v4.view.PagerAd...
package ru.noties.scrollable.sample.colorful; public class ColorfulActivity extends BaseActivity { private interface WindowCompat { void setStatusBarColor(int color); } private int mPrimaryColor; private int mAccentColor; @Override public void onCreate(Bundle sis) { super....
final SampleHeaderView sampleHeaderView = findView(R.id.header);
4
stathissideris/ditaa
src/java/org/stathissideris/ascii2image/graphics/Diagram.java
[ "public class ConversionOptions {\n\t\n\tpublic ProcessingOptions processingOptions =\n\t\tnew ProcessingOptions();\n\tpublic RenderingOptions renderingOptions =\n\t\tnew RenderingOptions();\n\t\t\n\tpublic void setDebug(boolean value){\n\t\tprocessingOptions.setPrintDebugOutput(value);\n\t\trenderingOptions.setRen...
import org.stathissideris.ascii2image.text.TextGrid.Cell; import org.stathissideris.ascii2image.text.TextGrid.CellColorPair; import org.stathissideris.ascii2image.text.TextGrid.CellStringPair; import org.stathissideris.ascii2image.text.TextGrid.CellTagPair; import java.awt.Color; import java.awt.Font; import java.awt.g...
/** * ditaa - Diagrams Through Ascii Art * * Copyright (C) 2004-2011 Efstathios Sideris * * ditaa is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your...
.findBoundariesExpandingFrom(copyGrid.new Cell(xi, yi));
5