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
yetanotherx/WorldEditCUI
src/main/java/wecui/render/region/CuboidRegion.java
[ "public class WorldEditCUI {\n\n public static final String VERSION = \"1.4.5\";\n public static final String MCVERSION = \"1.4.5\";\n public static final int protocolVersion = 2;\n protected Minecraft minecraft;\n protected EventManager eventManager;\n protected Obfuscation obfuscation;\n prot...
import wecui.WorldEditCUI; import wecui.render.LineColor; import wecui.render.shapes.Render3DBox; import wecui.render.points.PointCube; import wecui.render.shapes.Render3DGrid; import wecui.util.Vector3; import wecui.util.Vector3m;
package wecui.render.region; /** * Main controller for a cuboid-type region * * @author yetanotherx * @author lahwran */ public class CuboidRegion extends BaseRegion { protected PointCube firstPoint; protected PointCube secondPoint;
public CuboidRegion(WorldEditCUI controller) {
0
dumptruckman/ChestRestock
src/main/java/com/dumptruckman/chestrestock/command/CheckCommand.java
[ "public interface CRChest extends Config, CRChestOptions {\n\n /**\n * Constants related to CRChest.\n */\n class Constants {\n\n /**\n * The minimum for max inventory size.\n */\n public static final int MIN_MAX_INVENTORY_SIZE = 54;\n\n private static int MAX_INVE...
import com.dumptruckman.chestrestock.api.CRChest; import com.dumptruckman.chestrestock.api.CRChestOptions; import com.dumptruckman.chestrestock.api.ChestRestock; import com.dumptruckman.chestrestock.util.Language; import com.dumptruckman.chestrestock.util.Perms; import com.dumptruckman.minecraft.pluginbase.config.Confi...
package com.dumptruckman.chestrestock.command; public class CheckCommand extends TargetedChestRestockCommand { private static final List<ConfigEntry> PROPS_LIST = new LinkedList<ConfigEntry>(); private static final List<String> CHECK_MESSAGES = new LinkedList<String>(); static { //int count = 2...
public CheckCommand(ChestRestock plugin) {
2
Akshansh986/Webkiosk
Webkiosk/src/main/java/com/blackMonster/webkiosk/ui/DetailedAtndActivity.java
[ "public class RefreshBroadcasts {\n public static final String BROADCAST_LOGIN_RESULT = \"BROADCAST_LOGIN_RESULT\";\n public static final String BROADCAST_UPDATE_AVG_ATND_RESULT = \"UPDATE_AVG_ATND_RESULT\";\n public static final String BROADCAST_UPDATE_DETAILED_ATTENDENCE_RESULT = \"UPDATE_DETAILED_ATTEND...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.database.Cursor; import android.os.Bundle; import android.support.v4.content.LocalBroadcastManager; import android.support.v7.app.ActionBar; import android.widget....
package com.blackMonster.webkiosk.ui; public class DetailedAtndActivity extends BaseActivity { public static final String TAG = "DetailedAtndActivity"; public static final String SUB_CODE = "subcode"; public static final String SUB_NAME = "subname"; private String subName; private String code; ...
Cursor cursor = new DetailedAttendanceTable(
4
celiosilva/leitoor
leitoor/src/main/java/br/com/delogic/leitoor/controller/publico/LoginController.java
[ "@Entity\n@Inheritance(strategy = InheritanceType.SINGLE_TABLE)\n@DiscriminatorColumn(name = \"PERFIL\", length = 50)\npublic abstract class Usuario extends Identity<Integer> {\n\n @Id\n @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = \"seq_usuario\")\n @SequenceGenerator(name = \"seq_usuar...
import javax.inject.Inject; import javax.inject.Named; import javax.servlet.http.HttpServletRequest; import org.springframework.security.web.savedrequest.DefaultSavedRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.b...
package br.com.delogic.leitoor.controller.publico; @Controller @RequestMapping("/login") public class LoginController { @Inject @Named("urlHomeProfessor")
private UrlMapping urlHomeProfessor;
5
xvik/guice-validator
src/main/java/ru/vyarus/guice/validator/ValidationModule.java
[ "public class DeclaredMethodMatcher extends AbstractMatcher<Method> {\n\n @Override\n public boolean matches(final Method method) {\n return !method.isSynthetic() || !method.isBridge();\n }\n}", "public class ValidatedMethodMatcher extends AbstractMatcher<Method> {\n\n @Override\n public boo...
import com.google.inject.AbstractModule; import com.google.inject.matcher.Matcher; import com.google.inject.matcher.Matchers; import com.google.inject.name.Names; import ru.vyarus.guice.validator.aop.DeclaredMethodMatcher; import ru.vyarus.guice.validator.aop.ValidatedMethodMatcher; import ru.vyarus.guice.validator.aop...
package ru.vyarus.guice.validator; /** * Validation module. By default, validation executed when {@code @Valid} or any {@code @Constraint} annotation found * on method or method parameter (implicit mode). Alternatively, it could validate only annotated * modules (explicit mode): see {@link #validateAnnotatedOnly(...
final GuiceConstraintValidatorFactory constraintValidatorFactory = new GuiceConstraintValidatorFactory();
3
legobmw99/Stormlight
src/main/java/com/legobmw99/stormlight/modules/world/item/SphereItem.java
[ "@Mod(Stormlight.MODID)\npublic class Stormlight {\n public static final String MODID = \"stormlight\";\n public static final Logger LOGGER = LogManager.getLogger();\n\n public static final CreativeModeTab stormlight_group = new CreativeModeTab(Stormlight.MODID) {\n @Override\n public ItemSta...
import com.legobmw99.stormlight.Stormlight; import com.legobmw99.stormlight.api.ISurgebindingData; import com.legobmw99.stormlight.modules.powers.data.SurgebindingCapability; import com.legobmw99.stormlight.modules.powers.effect.EffectHelper; import com.legobmw99.stormlight.modules.world.WorldSetup; import com.legobmw9...
package com.legobmw99.stormlight.modules.world.item; public class SphereItem extends Item { private final boolean infused; private final Gemstone setting; public SphereItem(boolean infused, Gemstone setting) { super(Stormlight.createStandardItemProperties().stacksTo(infused ? 1 : 4)); th...
if (infused && player.getCapability(SurgebindingCapability.PLAYER_CAP).filter(ISurgebindingData::isKnight).isPresent()) {
2
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 ActionEditListFragment());
2
yyxhdy/ManyEAs
src/jmetal/problems/Viennet3.java
[ "public abstract class Problem implements Serializable {\n\n\t/**\n\t * Defines the default precision of binary-coded variables\n\t */\n\tprivate final static int DEFAULT_PRECISSION = 16;\n\n\t/**\n\t * Stores the number of variables of the problem\n\t */\n\tprotected int numberOfVariables_;\n\n\t/**\n\t * Stores t...
import jmetal.core.Problem; import jmetal.core.Solution; import jmetal.encodings.solutionType.BinaryRealSolutionType; import jmetal.encodings.solutionType.RealSolutionType; import jmetal.util.JMException;
// Viennet3.java // // Author: // Antonio J. Nebro <antonio@lcc.uma.es> // Juan J. Durillo <durillo@lcc.uma.es> // // Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public Li...
public void evaluate(Solution solution) throws JMException {
1
RockinChaos/ItemJoin
src/me/RockinChaos/itemjoin/api/APIUtils.java
[ "public class PlayerHandler {\n\t\n\tprivate static HashMap<String, ItemStack[]> craftingItems = new HashMap<String, ItemStack[]>();\n\tprivate static HashMap<String, ItemStack[]> craftingOpenItems = new HashMap<String, ItemStack[]>();\n\tprivate static HashMap<String, ItemStack[]> creativeCraftingItems = new HashM...
import me.RockinChaos.itemjoin.utils.api.ChanceAPI; import java.util.ArrayList; import java.util.List; import org.bukkit.World; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import me.RockinChaos.itemjoin.handlers.PlayerHandler; import me.RockinChaos.itemjoin.item.ItemCommand; import me.Rockin...
/* * ItemJoin * Copyright (C) CraftationGaming <https://www.craftationgaming.com/> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your ...
final ItemMap probable = ChanceAPI.getChances().getRandom(player);
2
copygirl/copycore
src/net/mcft/copy/core/CoreConfig.java
[ "public class Config extends AbstractConfig {\n\t\n\tprivate final File file;\n\tprivate final Configuration forgeConfig;\n\t\n\tprivate final Map<Setting, Object> settingValues = new HashMap<Setting, Object>();\n\tprivate final Map<String, String> categoryComments = new HashMap<String, String>();\n\t\n\tprivate fi...
import java.io.File; import net.mcft.copy.core.config.Config; import net.mcft.copy.core.config.SyncedSetting; import net.mcft.copy.core.config.setting.BooleanSetting; import net.mcft.copy.core.config.setting.IntegerSetting; import net.mcft.copy.core.config.setting.Setting; import net.mcft.copy.core.tweak.TweakAutoRepla...
package net.mcft.copy.core; public class CoreConfig extends Config { @SyncedSetting public static Setting tweakAutoReplace =
new BooleanSetting("tweaks.autoReplace", TweakAutoReplace.instance.isEnabled()).setComment(
4
fhussonnois/kafkastreams-cep
streams/src/main/java/com/github/fhuss/kafka/streams/cep/state/internal/NFAStoreImpl.java
[ "public class Stage<K, V> implements Serializable, Comparable<Stage<K, V>> {\r\n\r\n private static final int DEFAULT_WINDOW_MS = -1;\r\n\r\n private int id;\r\n private String name;\r\n private StateType type;\r\n private long windowMs;\r\n private List<StateAggregator<K, V, Object>> aggregates;\...
import org.apache.kafka.streams.state.internals.WrappedStateStore; import java.util.List; import com.github.fhuss.kafka.streams.cep.core.nfa.Stage; import com.github.fhuss.kafka.streams.cep.core.state.internal.NFAStates; import com.github.fhuss.kafka.streams.cep.core.state.internal.Runned; import com.github.fhuss.kafka...
/* * 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 n...
this.serdes = new StateSerdes<>(topic, new RunnedKeySerde<>(kSerde), serdes);
6
mouton5000/DSTAlgoEvaluation
src/graphTheory/algorithms/steinerProblems/steinerArborescenceApproximation/GFLACTR2Algorithm.java
[ "public class Arc implements Cloneable {\n\n\tprivate Integer input;\n\tprivate Integer output;\n\tprivate boolean isDirected;\n\n\tpublic Arc(Integer input, Integer output, boolean isDirected) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.isDirected = isDirected;\n\t}\n\n\tpublic Integer getInput...
import graphTheory.graph.Arc; import graphTheory.utils.Couple; import graphTheory.utils.CustomFibonacciHeap; import graphTheory.utils.CustomFibonacciHeapNode; import graphTheory.utils.DoubleBoolean; import graphTheory.utils.TreeIterator; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; i...
package graphTheory.algorithms.steinerProblems.steinerArborescenceApproximation; /** * * Faster Implementation of the G_F_Triangle algorithm. * <p> * This algorithm returns a feasible solution for the Directed Steiner Tree * problem. It is a greedy algorihm which uses a sub-algorihthm named FLAC. * <p> * FLA...
private CustomFibonacciHeap<Integer, DoubleBoolean> sortedSaturating;
2
feldim2425/OC-Minecarts
src/main/java/mods/ocminecart/common/items/ItemCartRemoteModule.java
[ "@Mod(modid = OCMinecart.MODID, name=OCMinecart.NAME, version=OCMinecart.VERSION, dependencies = \"required-after:OpenComputers@[1.6.0.6-beta.4,);\"\n\t\t+ \"after:Waila;\"\n\t\t+ \"after:Railcraft@[9.7.0.0,)\")\npublic class OCMinecart {\n\tpublic static final String MODID = \"ocminecart\";\n\tpublic static final ...
import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import mods.ocminecart.OCMinecart; import mods.ocminecart.Settings; import mods.ocminecart.common.assemble.util.TooltipUtil; import mods.ocminecart.common.entitye...
package mods.ocminecart.common.items; public class ItemCartRemoteModule extends Item implements ItemEntityInteract{ private IIcon icons[] = new IIcon[3]; public static int[] range; public ItemCartRemoteModule(){ super(); this.setMaxStackSize(64); this.setUnlocalizedName(OCMinecart.MODID+".remotemodule")...
RemoteCartExtender ext = RemoteExtenderRegister.getExtender((EntityMinecart) e);
3
thedudeguy/JukeIt
src/main/java/com/chrischurchwell/jukeit/CommandHandler.java
[ "@Entity()\r\n@Table(name=\"jb_url_data\")\r\npublic class URLData {\r\n\t\r\n\tpublic static URLData getEntry(int id) {\r\n\t\t\r\n\t\tURLData entry = JukeIt.getInstance().getDatabase().find(URLData.class)\r\n\t\t\t.where()\r\n\t\t\t\t.eq(\"id\", id)\r\n\t\t\t.findUnique();\r\n\t\t\r\n\t\treturn entry;\r\n\t}\r\n\...
import java.io.File; import java.lang.reflect.Method; import java.util.List; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.World; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; i...
ItemStack disc = DiscUtil.createDisc(color, url); player.getInventory().addItem(disc); player.sendMessage(ChatColor.GOLD.toString() + "You Received a Music Disc."); sender.sendMessage(ChatColor.DARK_GREEN.toString() + "Disc given to " + ChatColor.GOLD.toString() + player.getName()); return true; } ...
PagingList<URLData> pagingList = JukeIt.getInstance().getDatabase().find(URLData.class).findPagingList(perPage);
0
urbanairship/datacube
src/test/java/com/urbanairship/datacube/idservicecompat/OldHBaseIdService.java
[ "public interface IdService {\n byte[] getOrCreateId(int dimensionNum, byte[] input, int numIdBytes) throws IOException, InterruptedException;\n\n Optional<byte[]> getId(int dimensionNum, byte[] input, int numIdBytes) throws IOException, InterruptedException;\n\n /**\n * Utilities to make implementatio...
import com.google.common.collect.HashMultimap; import com.google.common.collect.Multimap; import com.google.common.math.LongMath; import com.urbanairship.datacube.IdService; import com.urbanairship.datacube.Util; import com.urbanairship.datacube.dbharnesses.WithHTable; import com.urbanairship.datacube.dbharnesses.WithH...
package com.urbanairship.datacube.idservicecompat; /** * This class is copied from DataCube v1.3.0, and exists here to verify that * the cutover to the new ID mapping creation method is backwards compatible. */ public class OldHBaseIdService implements IdService { private static final Logger log = LoggerFact...
byte[] id = Util.trailingBytes(columnVal, numIdBytes);
1
5GSD/AIMSICDL
AIMSICD/src/main/java/zz/aimsicd/lite/ui/fragments/DeviceFragment.java
[ "public class AimsicdService extends InjectionService {\n\n public static final String TAG = \"AICDL\";\n public static final String mTAG = \"XXX\";\n\n\n public static boolean isGPSchoiceChecked;\n public static final String GPS_REMEMBER_CHOICE = \"remember choice\";\n SharedPreferences gpsPreferenc...
import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.support.annotation.NonNull; import android.support.v4.wi...
case TelephonyManager.PHONE_TYPE_NONE: // Maybe bad! case TelephonyManager.PHONE_TYPE_SIP: // Maybe bad! case TelephonyManager.PHONE_TYPE_GSM: { content = (HighlightTextView) getView().findViewById(R.id.network_lac); content.upd...
Cell cell = responseToCell(response);
3
awslabs/amazon-sqs-java-messaging-lib
src/main/java/com/amazon/sqs/javamessaging/SQSMessageProducer.java
[ "public class SQSBytesMessage extends SQSMessage implements BytesMessage {\n private static final Log LOG = LogFactory.getLog(SQSBytesMessage.class);\n\n private byte[] bytes;\n\n private ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();\n\n private DataInputStream dataIn;\n \n private...
import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import javax.jms.Destination; import javax.jms.IllegalStateException; import javax.jms.InvalidDestinationException; import javax.jms.JMSException; import ...
/* * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "lice...
} else if (message instanceof SQSTextMessage) {
4
kunka/CoolAndroidBinding
src/com/kk/binding/adapter/BindViewPagerAdapter.java
[ "public class DependencyObject {\r\n private static final String TAG = \"Binding-DependencyObject\";\r\n private HashMap<DependencyProperty, Object> values = new HashMap<DependencyProperty, Object>();\r\n private ArrayList<Binding> bindings = new ArrayList<Binding>();\r\n private ArrayList<CommandBindin...
import android.support.v4.view.ViewPager; import com.kk.binding.kernel.DependencyObject; import com.kk.binding.kernel.OnDataContextChanged; import com.kk.binding.property.PropertyChangedEventArgs; import com.kk.binding.util.BindLog; import com.kk.binding.view.BindViewUtil; import java.util.List;
/* * Copyright (C) 2013 kk-team.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 agre...
dp.setOnDataContextTargetChangedListener(new OnDataContextChanged() {
1
mcalejo/interprolog
src/main/java/com/declarativa/interprolog/examples/HelloWorld.java
[ "public interface PrologEngine{\n \n /** InterProlog version */\n public final static String version = \"3.1.1\";\n\n /** Returns the Prolog system version for this engine */\n public String getPrologVersion();\n \n /** Returns the git log hash */\n public String getGitHash();\n \n // ...
import java.io.File; import com.declarativa.interprolog.PrologEngine; import com.declarativa.interprolog.SolutionIterator; import com.declarativa.interprolog.XSBSubprocessEngine; import com.declarativa.interprolog.SWISubprocessEngine; import com.declarativa.interprolog.util.IPPrologError;
/* Author: Miguel Calejo Contact: info@interprolog.com, www.interprolog.com Copyright InterProlog Consulting / Renting Point Lda, Portugal 2014 Use and distribution, without any warranties, under the terms of the Apache License, as per http://www.apache.org/licenses/LICENSE-2.0.html */ package com.declarativa.interpro...
PrologEngine engine = new SWISubprocessEngine();
0
urbanairship/datacube
src/test/java/com/urbanairship/datacube/MockHbaseHbaseDbHarnessTest.java
[ "public class HourDayMonthBucketer implements Bucketer<DateTime> {\n public static final BucketType hours = new BucketType(\"hour\", new byte[]{1});\n public static final BucketType days = new BucketType(\"day\", new byte[]{2});\n public static final BucketType months = new BucketType(\"month\", new byte[]...
import com.google.common.collect.ImmutableList; import com.google.common.primitives.Longs; import com.urbanairship.datacube.bucketers.HourDayMonthBucketer; import com.urbanairship.datacube.bucketers.StringToBytesBucketer; import com.urbanairship.datacube.dbharnesses.AfterExecute; import com.urbanairship.datacube.dbharn...
package com.urbanairship.datacube; public class MockHbaseHbaseDbHarnessTest { private static final Logger log = LogManager.getLogger(MockHbaseHbaseDbHarnessTest.class); private byte[] CUBE_DATA_TABLE = "t".getBytes(); private byte[] CF = "c".getBytes(); private HbaseDbHarnessConfiguration config =...
hbaseDbHarness.runBatchAsync(writes, new AfterExecute<LongOp>() {
2
jenkinsci/promoted-builds-plugin
src/test/java/hudson/plugins/promoted_builds/conditions/inheritance/DownstreamPassConditionInheritanceTest.java
[ "public final class JobPropertyImpl extends JobProperty<AbstractProject<?,?>> implements ItemGroup<PromotionProcess> {\n /**\n * These are loaded from the disk in a different way.\n */\n private transient /*final*/ List<PromotionProcess> processes = new ArrayList<PromotionProcess>();\n\n /**\n ...
import hudson.plugins.promoted_builds.JobPropertyImpl; import hudson.plugins.promoted_builds.PromotedBuildAction; import hudson.plugins.promoted_builds.PromotionProcess; import hudson.plugins.promoted_builds.Status; import hudson.plugins.promoted_builds.conditions.DownstreamPassCondition; import hudson.plugins.promoted...
/* * The MIT License * * Copyright 2015 Franta Mejta * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, mod...
final PromotionProcess process = property.addProcess("promotion");
2
ppasupat/web-entity-extractor-ACL2014
src/edu/stanford/nlp/semparse/open/model/feature/FeatureType.java
[ "public class BrownClusterTable {\n public static class Options {\n @Option public String brownClusterFilename = null;\n }\n public static Options opts = new Options();\n\n public static Map<String, String> wordClusterMap;\n public static Map<String, Integer> wordFrequencyMap;\n \n public static void init...
import java.util.*; import edu.stanford.nlp.semparse.open.ling.BrownClusterTable; import edu.stanford.nlp.semparse.open.ling.LingData; import edu.stanford.nlp.semparse.open.ling.LingUtils; import edu.stanford.nlp.semparse.open.model.FeatureVector; import edu.stanford.nlp.semparse.open.model.candidate.Candidate; import ...
package edu.stanford.nlp.semparse.open.model.feature; /** * Base class for all feature types. * * A feature type must extends this class and implement 2 methods: * - extract(CandidateGroup group) : For features that are common to all candidates in the same group * - extract(Candidate candidate) : For other fea...
protected void addQuantizedFeatures(FeatureVector v, String domain, String name, double value) {
3
jawher/litil
src/main/java/litil/parser/TDTypeParser.java
[ "public abstract class Type {\n\n public AstNode ast;\n\n public static final class Variable extends Type {\n private static int idx = 1, nIdx = 0;\n public Type instance;\n private int id;\n private String name;\n\n public Variable() {\n id = idx++;\n ...
import litil.ast.Type; import litil.lexer.BaseLexer; import litil.lexer.LookaheadLexer; import litil.lexer.LookaheadLexerWrapper; import litil.lexer.Token; import java.io.InputStreamReader; import java.io.Reader; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
package litil.parser; public class TDTypeParser extends BaseParser { public TDTypeParser(LookaheadLexer lexer) { super.lexer = lexer; } public static void main(String[] args) throws Exception { Reader reader = new InputStreamReader(LitilParser.class.getResourceAsStream("test.types"));
TDTypeParser p = new TDTypeParser(new LookaheadLexerWrapper(new BaseLexer(reader)));
3
sarxos/v4l4j
src/main/java/au/edu/jcu/v4l4j/BGRFrameGrabber.java
[ "public class CaptureChannelException extends V4L4JException {\n\n\tprivate static final long serialVersionUID = -3338859321078232443L;\n\n\tpublic CaptureChannelException(String message) {\n\t\tsuper(message);\n\t}\n\n\tpublic CaptureChannelException(String message, Throwable throwable) {\n\t\tsuper(message, throw...
import au.edu.jcu.v4l4j.exceptions.InitialisationException; import au.edu.jcu.v4l4j.exceptions.StateException; import au.edu.jcu.v4l4j.exceptions.V4L4JException; import au.edu.jcu.v4l4j.exceptions.VideoStandardException; import java.awt.color.ColorSpace; import java.awt.image.DataBuffer; import java.awt.image.PixelInte...
/* * Copyright (C) 2007-2008 Gilles Gigan (gilles.gigan@gmail.com) * eResearch Centre, James Cook University (eresearch.jcu.edu.au) * * This program was developed as part of the ARCHER project * (Australian Research Enabling Environment) funded by a * Systemic Infrastructure Initiative (SII) grant and supported by t...
Tuner t,ImageFormat imf, ThreadFactory factory) throws ImageFormatException {
1
Whiley/Jasm
src/test/java/jasm/testing/JKitValidTests.java
[ "public final class ClassFileReader {\t\n\tprivate final byte[] bytes; // byte array of class\n\tprivate final int[] items; // start indices of constant pool items\t\n\tprivate final HashMap<Integer,Constant.Info> constantPool;\t\t\n\tprivate final HashMap<String,BytecodeAttribute.Reader> attributeReader...
import java.io.StringReader; import jasm.io.ClassFileReader; import jasm.io.ClassFileWriter; import jasm.lang.ClassFile; import jasm.verifier.ClassFileVerifier; import jasm.verifier.TypeAnalysis; import org.junit.*; import static org.junit.Assert.fail; import java.io.BufferedReader; import java.io.File; impor...
// This file is part of the Java Compiler Kit (JKit) // // The Java Compiler Kit is free software; you can // redistribute it and/or modify it under the terms of the // GNU General Public License as published by the Free Software // Foundation; either version 2 of the License, or (at your // option) any later ver...
ClassFile cf = cfr.readClass();
2
4FunApp/4Fun
client/FourFun/app/src/main/java/com/joker/fourfun/ui/fragment/PictureFragment.java
[ "public class Constants {\n public static final String MAIN_ACTIVITY_BUNDLE = \"main_bundle\";\n public static final String MEDIA_BUNDLE = \"media_bundle\";\n public static final String MOVIE_BUNDLE = \"movie_bundle\";\n public static final String PICTURE_BUNDLE = \"picture_bundle\";\n public static ...
import android.os.Bundle; import android.support.v4.view.ViewPager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.joker.fourfun.Constants; import com.joker.fourfun.R; import com.joker.fourfun.adapter.PictureOneAdapter; import com.joker.fourfun.base.BaseMvpFragme...
package com.joker.fourfun.ui.fragment; public class PictureFragment extends BaseMvpFragment<PictureContract.View, PicturePresenter> implements PictureContract.View { @BindView(R.id.vp_content) ViewPager mVpContent; private Bundle mPictureBundle; private List<PictureChildFragment> mFragments...
PictureOneAdapter mAdapter = new PictureOneAdapter(getChildFragmentManager(), mFragments);
1
amao12580/BookmarkHelper
app/src/main/java/pro/kisscat/www/bookmarkhelper/util/storage/BasicStorageUtil.java
[ "public class ConverterException extends RuntimeException {\n\n public ConverterException(String msg) {\n super(msg);\n }\n}", "public class Path {\n public final static String FILE_SPLIT = File.separator;\n\n private static final String INNER_PATH_ROOT = FILE_SPLIT + \"data\";\n public stat...
import java.util.UUID; import pro.kisscat.www.bookmarkhelper.exception.ConverterException; import pro.kisscat.www.bookmarkhelper.util.Path; import pro.kisscat.www.bookmarkhelper.entry.command.CommandResult; import pro.kisscat.www.bookmarkhelper.util.context.ContextUtil; import pro.kisscat.www.bookmarkhelper.entry.file....
package pro.kisscat.www.bookmarkhelper.util.storage; /** * Created with Android Studio. * Project:BookmarkHelper * User:ChengLiang * Mail:stevenchengmask@gmail.com * Date:2016/11/22 * Time:11:25 */ abstract class BasicStorageUtil implements StorageAble { protected static boolean mkdir(String dirPath, Str...
LogHelper.v("mkdirRet false.");
5
qiujuer/OkHttpPacker
okhttp/src/main/java/net/qiujuer/common/okhttp/Http.java
[ "public class CookieManager implements CookieJar {\n private final CookieStore cookieStore;\n\n private CookieManager(PersistentCookieStore cookieStore) {\n this.cookieStore = cookieStore;\n }\n\n public static CookieJar createBySharedPreferences(Context context) {\n return new CookieManag...
import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import okhttp3.Cookie; import okhttp3.CookieJar; import okhttp3.OkHttpClient; import okhttp3.RequestBody; import android.content.Context; import net.qiujuer.common.okhttp.cookie.CookieManager; import net.qiuju...
/* * Copyright (C) 2014-2016 Qiujuer <qiujuer@live.cn> * WebSite http://www.qiujuer.net * Author Qiujuer * * 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...
.cookieJar(CookieManager.createBySharedPreferences(context));
0
AVMf/avmf
src/main/java/org/avmframework/examples/inputdatageneration/line/LineBranchTargetObjectiveFunction.java
[ "public class Vector extends AbstractVector {\n\n public void addVariable(Variable variable) {\n variables.add(variable);\n }\n\n public List<Variable> getVariables() {\n return new ArrayList<>(variables);\n }\n\n public void setVariablesToInitial() {\n for (Variable var : variables) {\n var.setV...
import org.avmframework.Vector; import org.avmframework.examples.inputdatageneration.Branch; import org.avmframework.examples.inputdatageneration.BranchTargetObjectiveFunction; import org.avmframework.examples.inputdatageneration.ControlDependenceChain; import org.avmframework.examples.inputdatageneration.ControlDepend...
package org.avmframework.examples.inputdatageneration.line; public class LineBranchTargetObjectiveFunction extends BranchTargetObjectiveFunction { public LineBranchTargetObjectiveFunction(Branch target) { super(target); } @Override
protected ControlDependenceChain getControlDependenceChainForTarget() {
3
stefanhaustein/HtmlView2
htmlview2/src/main/java/org/kobjects/htmlview2/HtmlView.java
[ "public interface Element extends Node {\n String getLocalName();\n void setAttribute(String name, String value);\n String getAttribute(String name);\n\n Element getFirstElementChild();\n Element getLastElementChild();\n Element getNextElementSibling();\n Element getPreviousElementSibling();\n\n CSSStyleDec...
import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Paint; import android.net.Uri; import android.os.AsyncTask; import android.util.Base64; import android.util.Log; import org.kobjects.dom.Element; import org.kobje...
package org.kobjects.htmlview2; /**  * View corresponding to the HTML root element. Also holds state information such as the location and * css pixel scale. Can't refer to the HTML body element directly because margins, borders and * paddings are managed by the parent HtmlViewGroup. */ public class HtmlView e...
private CssStyleSheet styleSheet;
4
ParaskP7/sample-code-posts
app/src/main/java/io/petros/posts/activity/post/presenter/PostPresenterImpl.java
[ "public interface PostModel {\n\n @Nullable\n User getUser(final Integer userId);\n\n}", "public interface PostView {\n\n void loadPostUserAndPost();\n\n void loadPostUser(final String userEmail, final String userName, final String userUsername);\n\n void notifyUserAboutUserUnavailability();\n\n ...
import android.os.Bundle; import java.util.List; import javax.annotation.Nullable; import io.petros.posts.activity.post.model.PostModel; import io.petros.posts.activity.post.view.PostView; import io.petros.posts.model.Comment; import io.petros.posts.model.Post; import io.petros.posts.model.User; import io.petros.posts....
package io.petros.posts.activity.post.presenter; public class PostPresenterImpl implements PostPresenter { private final PostModel postModel; private final RetrofitService retrofitService; private final RxSchedulers rxSchedulers; private final InternetAvailabilityDetector internetAvailabilityDetec...
@Nullable final User user = postModel.getUser(userId);
4
Vhati/OpenUHS
android-reader/src/main/java/net/vhati/openuhs/androidreader/reader/AudioNodeView.java
[ "public final class AndroidUHSConstants {\n\n\t/** A globally shared tag name for logging. */\n\tpublic static final String LOG_TAG = \"OpenUHS\";\n\n\n\tprivate AndroidUHSConstants() {}\n}", "public abstract class NodeView extends FrameLayout {\n\tprivate UHSNode node = null;\n\tprivate UHSReaderNavCtrl navCtrl ...
import java.io.InputStream; import java.io.IOException; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.Toast; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ne...
package net.vhati.openuhs.androidreader.reader; public class AudioNodeView extends NodeView { private final Logger logger = LoggerFactory.getLogger( AndroidUHSConstants.LOG_TAG ); protected UHSAudioNode audioNode = null; protected AudioPlayerView playerView = null; public AudioNodeView( Context context ) ...
public boolean accept( UHSNode node ) {
5
talklittle/reddit-is-fun
src/com/andrewshu/android/reddit/mail/InboxActivity.java
[ "public abstract class CaptchaCheckRequiredTask extends AsyncTask<Void, Void, Boolean> {\n\t\n\tprivate static final String TAG = \"CaptchaCheckRequiredTask\";\n\t\n\t// Captcha \"iden\"\n private static final Pattern CAPTCHA_IDEN_PATTERN\n \t= Pattern.compile(\"name=\\\"iden\\\" value=\\\"([^\\\"]+)\\\"\");\...
import org.apache.http.client.HttpClient; import android.app.AlertDialog; import android.app.Dialog; import android.app.ProgressDialog; import android.app.TabActivity; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view....
/* * Copyright 2011 Andrew Shu * * This file is part of "reddit is fun". * * "reddit is fun" is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any l...
.putExtra(Constants.WHICH_INBOX_KEY, whichInbox);
3
laithnurie/rhythm
mobile/src/main/java/com/laithlab/rhythm/activity/BrowseActivity.java
[ "public class ArtistGridAdapter extends SelectableAdapter<ArtistGridAdapter.ViewHolder> {\n\n\tprivate List<ArtistDTO> artists;\n\tprivate ClickListener clickListener;\n\n\tpublic ArtistGridAdapter(List<ArtistDTO> artists, ClickListener clickListener) {\n\t\tthis.artists = artists;\n\t\tthis.clickListener = clickLi...
import android.Manifest; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.Color; import android.graphics.PorterDuff; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.ActivityCompa...
package com.laithlab.rhythm.activity; public class BrowseActivity extends RhythmActivity implements MusicDBProgressCallBack, ArtistGridAdapter.ClickListener { private static final int REQUEST_READ_STORAGE = 1; private DrawerLayout drawerLayout; private RecyclerView browseGrid; private View loadingC...
List<Artist> artists = MusicDataUtility.allArtists(getApplicationContext());
7
theblackwidower/KanaQuiz
app/src/main/java/com/noprestige/kanaquiz/questions/QuestionManagement.java
[ "public final class OptionsControl\n{\n private static SharedPreferences sharedPreferences;\n private static SharedPreferences.Editor editor;\n private static Resources resources;\n\n private static final String DEFAULT_QUESTION_SET = \"hiragana_set_1\";\n\n private OptionsControl() {}\n\n @Suppre...
import android.content.Context; import android.content.res.Resources; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import com.noprestige.kanaquiz.R; import com.noprestige.kanaquiz.options.OptionsControl; import com.noprestige.kanaquiz.options....
/* * Copyright 2021 T Duke Perry * * 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 applicabl...
return getSetTitle(number, OptionsControl.getBoolean(R.string.prefid_diacritics));
0
scriptkitty/SNC
unikl/disco/calculator/symbolic_math/ArrivalFactory.java
[ "public class SNC {\r\n\r\n private final UndoRedoStack undoRedoStack;\r\n private static SNC singletonInstance;\r\n private final List<Network> networks;\r\n private final int currentNetworkPosition;\r\n\r\n private SNC() {\r\n networks = new ArrayList<>();\r\n undoRedoStack = new Undo...
import unikl.disco.calculator.SNC; import unikl.disco.calculator.symbolic_math.functions.ConstantFunction; import unikl.disco.calculator.symbolic_math.functions.ExponentialSigma; import unikl.disco.calculator.symbolic_math.functions.PoissonRho; import unikl.disco.calculator.symbolic_math.functions.EBBSigma; import unik...
/* * (c) 2017 Michael A. Beck, Sebastian Henningsen * disco | Distributed Computer Systems Lab * University of Kaiserslautern, Germany * All Rights Reserved. * * This software is work in progress and is released in the hope that it will * be useful to the scientific community. It is provided "as is" with...
SymbolicFunction rho = new PoissonRho(increment_rho, mu);
3
davidmoten/logan
src/main/java/com/github/davidmoten/logan/servlet/DataServlet.java
[ "public static double getMandatoryDouble(HttpServletRequest req, String name) {\n if (req.getParameter(name) == null)\n throw new RuntimeException(\"parameter \" + name + \" is mandatory\");\n else\n try {\n return Double.parseDouble(req.getParameter(name));\n } catch (NumberFo...
import static com.github.davidmoten.logan.servlet.ServletUtil.getMandatoryDouble; import static com.github.davidmoten.logan.servlet.ServletUtil.getMandatoryLong; import static com.github.davidmoten.logan.servlet.ServletUtil.getMandatoryParameter; import java.io.IOException; import java.io.PrintWriter; import java.util....
package com.github.davidmoten.logan.servlet; //@WebServlet(urlPatterns = { "/data" }) public class DataServlet extends HttpServlet { private static final String WILDCARD = "*"; private static Logger log = Logger.getLogger(DataServlet.class.getName()); private static final long serialVersionUID = 104438404544...
Metric metric = Metric.valueOf(getMandatoryParameter(req, "metric"));
2
open-erp-systems/erp-backend
erp-library/src/main/java/com.jukusoft/erp/lib/context/AppContextImpl.java
[ "public interface CacheManager {\n\n /**\n * get instance of cache\n *\n * @param cacheName name of cache\n *\n * @return instance of cache or null, if cache doesnt exists\n */\n public ICache getCache (String cacheName);\n\n /**\n * get instance of cache or create an new one, if ...
import com.hazelcast.core.HazelcastInstance; import com.jukusoft.erp.lib.cache.CacheManager; import com.jukusoft.erp.lib.context.AppContext; import com.jukusoft.erp.lib.database.DatabaseManager; import com.jukusoft.erp.lib.logging.ILogging; import com.jukusoft.erp.lib.message.request.ApiRequest; import com.jukusoft.erp...
package com.jukusoft.erp.lib.context; public class AppContextImpl implements AppContext { //instance of vertx protected Vertx vertx = null; //instance of logger protected ILogging logger = null; //instance of hazelcast protected HazelcastInstance hazelcastInstance = null; //instance of...
protected PermissionManager permissionManager = null;
5
Lemonszz/Anima-Mundi
src/main/java/party/lemons/anima/proxy/GuiProxy.java
[ "public class ContainerAnimaGenerator extends Container\n{\n\tprivate TileEntityAnimaGenerator te;\n\tprivate IItemHandler items;\n\n\tpublic ContainerAnimaGenerator(IInventory playerInventory, TileEntityAnimaGenerator te)\n\t{\n\t\tthis.te = te;\n\t\titems = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPA...
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; import party.lemons.anima.content.block.container.ContainerAnimaGenerator; import party.lemons...
package party.lemons.anima.proxy; /** * Created by Sam on 23/06/2017. */ public class GuiProxy implements IGuiHandler { @Nullable @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { BlockPos pos = new BlockPos(x, y, z); TileEntity te = world.getTileE...
return new GuiAnimaGenerator(new ContainerAnimaGenerator(player.inventory, generator));
6
pentaho/pentaho-cassandra-plugin
core/src/main/java/org/pentaho/di/trans/steps/cassandrainput/CassandraInput.java
[ "public class CassandraUtils {\n\n protected static final Class<?> PKG = CassandraUtils.class;\n\n public static class ConnectionOptions {\n public static final String SOCKET_TIMEOUT = \"socketTimeout\"; //$NON-NLS-1$\n public static final String MAX_LENGTH = \"maxLength\"; //$NON-NLS-1$\n public static ...
import java.util.HashMap; import java.util.Map; import org.pentaho.cassandra.util.CassandraUtils; import org.pentaho.cassandra.ConnectionFactory; import org.pentaho.cassandra.spi.CQLRowHandler; import org.pentaho.cassandra.spi.ITableMetaData; import org.pentaho.cassandra.spi.Connection; import org.pentaho.cassandra.spi...
/******************************************************************************* * * Pentaho Big Data * * Copyright (C) 2002-2018 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the ...
protected Keyspace m_keyspace;
5
hecoding/Pac-Man
src/util/BatchExecutor.java
[ "@SuppressWarnings(\"unused\")\npublic class CustomExecutor {\t\n\t/**\n\t * The main method. Several options are listed - simply remove comments to use the option you want.\n\t *\n\t * @param args the command line arguments\n\t */\n\tpublic GameInfo runExecution(Controller<MOVE> pacManController,Controller<EnumMap...
import pacman.CustomExecutor; import pacman.controllers.Controller; import pacman.controllers.GrammaticalAdapterController; import pacman.controllers.examples.Legacy; import pacman.controllers.examples.NearestPillPacMan; import pacman.controllers.examples.NearestPillPacManVS; import pacman.controllers.examples.RandomGh...
package util; public class BatchExecutor { public static void main(String[] args) { // custom params int numExecutions = 1000; //H vs Legacy String stringPhenotype = "if(_getDistanceToClosestNonEdibleGhost_LE_5_){_huir_}_else{_farmear_}"; //M vs Random //S...
Controller<EnumMap<Constants.GHOST,Constants.MOVE>> ghostController = new RandomGhosts();
3
Nanopublication/nanopub-java
src/main/java/org/nanopub/trusty/MakeTrustyNanopub.java
[ "public class MalformedNanopubException extends Exception {\n\n\tprivate static final long serialVersionUID = -1022546557206977739L;\n\n\tpublic MalformedNanopubException(String message) {\n\t\tsuper(message);\n\t}\n\n}", "public class MultiNanopubRdfHandler extends AbstractRDFHandler {\n\n\tpublic static void pr...
import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; i...
package org.nanopub.trusty; public class MakeTrustyNanopub { @com.beust.jcommander.Parameter(description = "input-nanopub-files", required = true) private List<File> inputNanopubsFiles = new ArrayList<File>(); @com.beust.jcommander.Parameter(names = "-o", description = "Output file") private File singleOutpu...
MultiNanopubRdfHandler.process(inFormat, inputFile, new NanopubHandler() {
1
mpalourdio/SpringBootTemplate
src/main/java/com/mpalourdio/springboottemplate/controllers/PersistenceController.java
[ "public final class MediaType extends org.springframework.http.MediaType {\n\n public static final org.springframework.http.MediaType APPLICATION_VND_API_V1;\n public static final String APPLICATION_VND_API_V1_VALUE = \"application/vnd.api.v1+json;charset=UTF-8\";\n\n public static final org.springframewor...
import com.mpalourdio.springboottemplate.mediatype.MediaType; import com.mpalourdio.springboottemplate.model.Dummy; import com.mpalourdio.springboottemplate.model.RepositoriesService; import com.mpalourdio.springboottemplate.model.entities.People; import com.mpalourdio.springboottemplate.model.entities.Task; import com...
/* * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,...
@GetMapping(value = "/transaction", produces = MediaType.APPLICATION_JSON_VALUE)
0
gems-uff/prov-viewer
src/main/java/br/uff/ic/provviewer/markov/Markov.java
[ "public class VariableNames {\n public static String CollapsedVertexAgentAttribute = \"Agents\";\n public static String CollapsedVertexActivityAttribute = \"Activities\";\n public static String CollapsedVertexEntityAttribute = \"Entities\";\n public static String GraphFile = \"GraphFile\";\n public s...
import br.uff.ic.provviewer.VariableNames; import br.uff.ic.provviewer.Variables; import br.uff.ic.utility.GraphAttribute; import br.uff.ic.utility.Utils; import br.uff.ic.utility.graph.AgentVertex; import br.uff.ic.utility.graph.Edge; import br.uff.ic.utility.graph.Vertex; import edu.uci.ics.jung.visualization.picking...
/* * The MIT License * * Copyright 2020 Kohwalter. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modif...
if (!(e.getTarget() instanceof AgentVertex)) {
4
songbin/frc
FRC/src/main/java/com/frc/redis/migrate/MigrateThread.java
[ "public class DefaultValues\n{\n\tpublic static final String PATH_PROPERTIES_DEFAULT = \"properties/default.properties\";\n\tpublic static final String LUA_LOCK_PROCESS_PATH = \"script/lua/lock_process.lua\";\n\t\n\tpublic static final long THRIFT_MAX_READ_BUF = 16384000L;\n\t\n\tpublic static final String MIGRATE_...
import java.util.Calendar; import java.util.List; import java.util.Set; import java.util.SortedMap; import java.util.TreeMap; import redis.clients.jedis.ScanResult; import com.frc.core.common.DefaultValues; import com.frc.core.redis.RedisClient; import com.frc.loader.PropertiesLoader; import com.frc.node.ClusterAlgo; i...
package com.frc.redis.migrate; /** * @author songbin * @version 2016年8月30日 */ public class MigrateThread implements Runnable { private String getClassName() { return "MigrateThread"; } private final long logIndex = -100; /** one hour */ private long sleep_time = 1000...
int migrate_time = PropertiesLoader.getIntance().getClusterMigrateStartTime();
2
LightSun/Visitor
Visitor/src/test/java/com/heaven7/java/visitor/test/MapVisitServiceTest.java
[ "public class IterationInfo implements Serializable {\n\n\tprivate static final long serialVersionUID = 1L;\n\n\t/** the count of delete */\n\tprivate int deleteCount = 0;\n\t/** the count of update */\n\tprivate int updateCount = 0;\n\t/** the count of filter */\n\tprivate int filterCount = 0;\n\t/** the count of ...
import com.heaven7.java.visitor.*; import com.heaven7.java.visitor.collection.IterationInfo; import com.heaven7.java.visitor.collection.KeyValuePair; import com.heaven7.java.visitor.collection.MapVisitService; import com.heaven7.java.visitor.collection.VisitServices; import com.heaven7.java.visitor.test.help.Student; i...
package com.heaven7.java.visitor.test; public class MapVisitServiceTest extends TestCase { static final int SIZE = 6; final HashMap<String, Integer> map = new HashMap<String, Integer>(); MapVisitService<String, Integer> service; @Override protected void setUp() throws Exception { super.setUp(); // 0 - 5 ...
}, Comparators.<String>getDefaultComparator());
5
Traumflug/Visolate
src/visolate/processor/ToolpathPath.java
[ "public class Util {\n\n public static final double MIN_DY = 1e-6;\n\n public static float distance(float x0, float y0,\n float x1, float y1) {\n return (float) Math.sqrt(distanceSquared(x0, y0, x1, y1));\n }\n\n public static float distanceSquared(float x0, float y0,\n ...
import javax.vecmath.Point2d; import visolate.misc.Util; import visolate.model.Net; import visolate.processor.ToolpathsProcessor; import visolate.processor.ToolpathNode; import visolate.processor.GCodeFileWriter; import java.awt.geom.Point2D; import java.awt.geom.Line2D; import java.io.IOException; import java.util.Lin...
/** * "Visolate" -- compute (Voronoi) PCB isolation routing toolpaths * * Copyright (C) 2004 Marsette A. Vona, III * 2012 Markus Hitter <mah@jump-ing.de> * * 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 ...
ToolpathPath(final ToolpathsProcessor processor, final ToolpathNode seed) {
3
thshdw/lixia-javardp
src/com/lixia/rdp/rdp5/VChannel.java
[ "public abstract class InputJPanel {\r\n\r\n protected static Logger logger = Logger.getLogger(InputJPanel.class);\r\n \r\n\tKeyCode_FileBased newKeyMapper = null;\r\n\r\n\tprotected Vector pressedKeys;\r\n\r\n\tprotected static boolean capsLockOn = false;\r\n\tprotected static boolean numLockOn = false;\r\n\...
import java.io.IOException; import org.apache.log4j.Logger; import com.lixia.rdp.Constants; import com.lixia.rdp.InputJPanel; import com.lixia.rdp.Common; import com.lixia.rdp.Options; import com.lixia.rdp.RdesktopException; import com.lixia.rdp.RdpPacket; import com.lixia.rdp.RdpPacket_Localised; import com.l...
/* VChannel.java * Component: ProperJavaRDP * * Revision: $Revision: 1.1.1.1 $ * Author: $Author: suvarov $ * Date: $Date: 2007/03/08 00:26:39 $ * * Copyright (c) 2005 Propero Limited * * Purpose: Abstract class for RDP5 channels */ package com.lixia.rdp.rdp5; public abstract class VChann...
s = Common.secure.init(Options.encryption ? Secure.SEC_ENCRYPT : 0,length + 8);
6
hhua/product-hunt-android
app/src/main/java/com/hhua/android/producthunt/fragments/FollowingFragment.java
[ "public class ProductHuntApplication extends com.activeandroid.app.Application {\n private static Context context;\n\n @Override\n public void onCreate() {\n super.onCreate();\n ProductHuntApplication.context = this;\n Parse.initialize(this, ApiConfig.PARSE_API_APPLICATION_ID, ApiConfi...
import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.ListView; import com.hhua.android.producthunt.ProductHuntApplication; imp...
package com.hhua.android.producthunt.fragments; public class FollowingFragment extends Fragment { private final String LOG_D = "FollowingFragment"; private ProductHuntClient client; private ListView lvUsers; private List<Follower> followers;
private FollowersArrayAdapter followersArrayAdapter;
4
aikuma/aikuma
Aikuma/src/org/lp20/aikuma/audio/record/ThumbRespeaker.java
[ "public class InterleavedPlayer extends Player {\n\t\n\t/**\n\t * Creates an InterleavedPlayer to play the supplied recording and it's\n\t * original\n\t *\n\t * @param\tcontext\t\tThe android-context creating this player for beep-audio\n\t * @param\trecording\tThe metadata of the recording to play.\n\t * @throws\t...
import android.content.Context; import android.media.AudioFormat; import android.media.AudioManager; import android.media.MediaRecorder; import android.util.Log; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.UUID; import org.lp20.aikuma.audio...
public void recordRespeaking() { if(isMappingToOriginal) { // When creating respeak/interpret on respeak/interpret Log.i("segment", ""+currentOriginalSegment.getEndSample()); mapper.markRespeaking(new Sampler() { @Override public long getCurrentSample() { return currentOriginalSegment.getEndSample...
public void setOnMarkerReachedListener(final OnMarkerReachedListener oml) {
5
gaffo/scumd
depend/minasshd/sshd-core/src/main/java/org/apache/sshd/server/channel/ChannelSession.java
[ "public class ChannelOutputStream extends OutputStream {\n\n private final AbstractChannel channel;\n private final Window remoteWindow;\n private final Logger log;\n private final SshConstants.Message cmd;\n private final byte[] b = new byte[1];\n private Buffer buffer;\n private boolean close...
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import org.apache.sshd.common.NamedFact...
} } if ("auth-agent-req@openssh.com".equals(type)) { return handleAgentForwarding(buffer); } if ("x11-req".equals(type)) { return handleX11Forwarding(buffer); } return false; } /** * Only one of "shell", "exec" or "subsyst...
if (((ServerSession) session).getServerFactoryManager().getShellFactory() == null) {
5
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...
stopLoadMoreAnimation(); mScreenFilled = isCurrentItemSizeOver(false); hideLoadMoreView(!mScreenFilled); mStartPosition = 0; mItemCount = 0; } @Override public void onBindData(RecyclerView.ViewHolder hol...
int pos = Utils.getFirstItemPosition(layoutManager, true);
4
biafra23/EtherWallet
geth-connector/src/main/java/com/jaeckel/geth/GethConnector.java
[ "public class EthAccountsResponse {\n\n public List<String> result;\n\n @Override\n public String toString() {\n return \"EthAccountsResponse{\" +\n// \"id='\" + id + '\\'' +\n// \", jsonrpc='\" + jsonrpc + '\\'' +\n \", result=\" + result +\n ...
import com.jaeckel.geth.json.EthAccountsResponse; import com.jaeckel.geth.json.EthBlockNumberResponse; import com.jaeckel.geth.json.EthGetBalanceResponse; import com.jaeckel.geth.json.EthSyncingResponse; import com.jaeckel.geth.json.NetPeerCountResponse; import com.jaeckel.geth.json.PersonalListAccountsResponse; import...
package com.jaeckel.geth; public class GethConnector implements EthereumJsonRpc { private static final String METHOD_NET_PEER_COUNT = "net_peerCount"; private static final String METHOD_ETH_BLOCK_NUMBER = "eth_blockNumber"; private static final String METHOD_ETH_GET_BALANCE = "eth_getBalance"; priv...
public void netPeerCount(Callback<NetPeerCountResponse> callback) throws IOException {
4
Parrit/Parrit
src/main/java/com/parrit/controllers/RoleController.java
[ "@Getter\n@Setter\n@EqualsAndHashCode\npublic class RolePositionDTO {\n\n @NotNull(message = \"Where are you trying to go? Roles must be with a pairing board!\")\n private Long pairingBoardId;\n\n}", "@Entity\n@Table(name = \"pairing_board\",\n indexes = {\n @Index(name = \"pairing_boa...
import com.parrit.DTOs.ProjectDTO; import com.parrit.DTOs.RoleDTO; import com.parrit.DTOs.RolePositionDTO; import com.parrit.entities.PairingBoard; import com.parrit.entities.Project; import com.parrit.entities.Role; import com.parrit.exceptions.PairingBoardNotFoundException; import com.parrit.exceptions.PairingBoardPo...
package com.parrit.controllers; @RestController public class RoleController { private final ProjectRepository projectRepository; private final RoleRepository roleRepository; @Autowired public RoleController(ProjectRepository projectRepository, RoleRepository roleRepository) { this.projectRe...
public ProjectDTO moveRole(@PathVariable long projectId, @PathVariable long pairingBoardId, @PathVariable long roleId, @RequestBody @Valid RolePositionDTO rolePositionDTO) {
0
MovingBlocks/TerasologyLauncher
src/test/java/org/terasology/launcher/repositories/JenkinsRepositoryAdapterTest.java
[ "public enum Build {\n STABLE,\n NIGHTLY\n}", "public class GameIdentifier {\n\n private static final Logger logger = LoggerFactory.getLogger(GameIdentifier.class);\n\n final String displayVersion;\n final Build build;\n final Profile profile;\n\n public GameIdentifier(String displayVersion, ...
import com.google.gson.Gson; import com.vdurmont.semver4j.Semver; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.pr...
// Copyright 2021 The Terasology Foundation // SPDX-License-Identifier: Apache-2.0 package org.terasology.launcher.repositories; @DisplayName("JenkinsRepositoryAdapter#fetchReleases() should") class JenkinsRepositoryAdapterTest { static Gson gson; static Jenkins.ApiResult validResult; static URL expec...
final ReleaseMetadata releaseMetadata = new ReleaseMetadata("", new Date(1604285977306L));
4
apache/commons-fileupload
src/main/java/org/apache/commons/fileupload2/portlet/PortletFileUpload.java
[ "public interface FileItem extends FileItemHeadersSupport {\n\n // ------------------------------- Methods from javax.activation.DataSource\n\n /**\n * Returns an {@link java.io.InputStream InputStream} that can be\n * used to retrieve the contents of the file.\n *\n * @return An {@link java.i...
import java.io.IOException; import java.util.List; import java.util.Map; import javax.portlet.ActionRequest; import org.apache.commons.fileupload2.FileItem; import org.apache.commons.fileupload2.FileItemFactory; import org.apache.commons.fileupload2.FileItemIterator; import org.apache.commons.fileupload2.FileUpload; im...
/* * 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 ...
public FileItemIterator getItemIterator(final ActionRequest request)
2
chriskearney/stickypunch
stickypunch-http/src/main/java/com/comandante/stickypunch/http/resource/SafariPushResource.java
[ "public interface PackageCreator {\n\n PackageZipEntry getPackage() throws Exception;\n\n}", "public class PackageZipEntry {\n private final byte[] packageZipData;\n private final String id;\n\n public PackageZipEntry(byte[] packageZipData, String id) {\n this.packageZipData = packageZipData;\n...
import com.google.common.base.Optional; import com.comandante.stickypunch.api.model.PackageCreator; import com.comandante.stickypunch.api.model.PackageZipEntry; import com.comandante.stickypunch.api.model.WebPushStore; import com.comandante.stickypunch.api.model.WebPushStoreAuth; import com.comandante.stickypunch.api.m...
package com.comandante.stickypunch.http.resource; @Path("/push/v1/") @Singleton public class SafariPushResource { private static final Logger log = LogManager.getLogger(SafariPushResource.class); private final ObjectMapper mapper; private final WebPushStore webPushStore;
private final WebPushStoreAuth webPushStoreAuth;
3
ghjansen/cas
cas-control/src/main/java/com/ghjansen/cas/control/task/UnitTask.java
[ "public abstract class SimulationController<I extends Simulation, M extends SimulationBuilder> {\n\n private final I simulation;\n private final ExecutorService executor;\n private final Task completeTask;\n private final Task iterationTask;\n private final Task unitTask;\n private final TaskNotif...
import com.ghjansen.cas.control.simulation.SimulationController; import com.ghjansen.cas.core.exception.InvalidCombinationException; import com.ghjansen.cas.core.exception.InvalidStateException; import com.ghjansen.cas.core.exception.InvalidTransitionException; import com.ghjansen.cas.core.exception.TimeLimitReachedExc...
/* * CAS - Cellular Automata Simulator * Copyright (C) 2016 Guilherme Humberto Jansen * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at y...
} catch (InvalidCombinationException e) {
1
roma/roma-java-client
java/client/src/main/java/jp/co/rakuten/rit/roma/client/commands/FailOverFilter.java
[ "public class BadRoutingTableFormatException extends ClientException {\r\n public BadRoutingTableFormatException(String reason) {\r\n super(reason);\r\n }\r\n\r\n private static final long serialVersionUID = -8186833003353745212L;\r\n}", "public class ClientException extends Exception {\n private static fi...
import java.io.IOException; import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import jp.co.rakuten.rit.roma.client.BadRoutingTableFormatException; import jp.co.rakuten.rit.roma.client.ClientException; import jp.co.rakuten.rit.roma.client.Config; import jp.co.rakuten.rit.roma.client....
package jp.co.rakuten.rit.roma.client.commands; public class FailOverFilter extends AbstractCommand { public static long sleepPeriod = Long .parseLong(Config.DEFAULT_RETRY_SLEEP_TIME); public static int retryThreshold = Integer .parseInt(Config.DEFAULT_RETRY_THRESHOLD); public FailOverFi...
ConnectionPool connPool = (ConnectionPool) context
4
CodeNMore/New-Beginner-Java-Game-Programming-Src
Episode 28/TileGame/src/dev/codenmore/tilegame/Game.java
[ "public class Display {\n\n\tprivate JFrame frame;\n\tprivate Canvas canvas;\n\t\n\tprivate String title;\n\tprivate int width, height;\n\t\n\tpublic Display(String title, int width, int height){\n\t\tthis.title = title;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\t\n\t\tcreateDisplay();\n\t}\n\t\n\tpri...
import java.awt.Graphics; import java.awt.image.BufferStrategy; import dev.codenmore.tilegame.display.Display; import dev.codenmore.tilegame.gfx.Assets; import dev.codenmore.tilegame.gfx.GameCamera; import dev.codenmore.tilegame.input.KeyManager; import dev.codenmore.tilegame.states.GameState; import dev.codenmore.tile...
package dev.codenmore.tilegame; public class Game implements Runnable { private Display display; private int width, height; public String title; private boolean running = false; private Thread thread; private BufferStrategy bs; private Graphics g; //States private State gameState; private State menu...
Assets.init();
1
allegro/elasticsearch-reindex-tool
src/test/java/pl/allegro/tech/search/elasticsearch/tools/reindex/embeded/EmbeddedElasticsearchCluster.java
[ "public class ReindexInvokerTest {\n\n private static final String SOURCE_INDEX = \"sourceindex\";\n private static final String TARGET_INDEX = \"targetindex\";\n public static final String DATA_TYPE = \"type\";\n\n private static EmbeddedElasticsearchCluster embeddedElasticsearchCluster;\n\n @BeforeClass\n p...
import static org.elasticsearch.node.NodeBuilder.nodeBuilder; import java.util.stream.Stream; import org.elasticsearch.action.index.IndexRequestBuilder; import org.elasticsearch.client.Client; import org.elasticsearch.client.IndicesAdminClient; import org.elasticsearch.common.settings.Settings; import org.elasticsearch...
package pl.allegro.tech.search.elasticsearch.tools.reindex.embeded; public final class EmbeddedElasticsearchCluster { public static final String CLUSTER_NAME = "ReindexInvoker_cluster"; public static final int ELS_PORT = 9211; public static final int ELS_TCP_PORT = 9311; private final Node dataNode; pr...
return ElasticSearchQueryBuilder.builder().setQuery(query).build();
4
point85/caliper
src/test/java/org/point85/uom/test/library/TestUnits.java
[ "public enum Constant {\n\tLIGHT_VELOCITY, LIGHT_YEAR, GRAVITY, PLANCK_CONSTANT, BOLTZMANN_CONSTANT, AVAGADRO_CONSTANT, GAS_CONSTANT, \n\tELEMENTARY_CHARGE, ELECTRIC_PERMITTIVITY, MAGNETIC_PERMEABILITY, FARADAY_CONSTANT, ELECTRON_MASS, PROTON_MASS, \n\tSTEFAN_BOLTZMANN, HUBBLE_CONSTANT, CAESIUM_FREQUENCY, LUMINOUS_...
import org.junit.Test; import org.point85.uom.Constant; import org.point85.uom.Prefix; import org.point85.uom.Quantity; import org.point85.uom.Unit; import org.point85.uom.UnitOfMeasure; import org.point85.uom.UnitType; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static...
/* MIT License Copyright (c) 2016 Kent Randall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, d...
Map<UnitOfMeasure, Integer> terms = sys.getUOM(Unit.NEWTON).getBaseUnitsOfMeasure();
3
roybailey/research-graphql
research-graphql-server/src/main/java/me/roybailey/springboot/graphql/domain/schema/Query.java
[ "@JsonInclude(JsonInclude.Include.NON_NULL)\n@JsonPropertyOrder({\n \"id\",\n \"userId\",\n \"items\",\n \"status\"\n})\n@lombok.Builder\n@lombok.NoArgsConstructor\n@lombok.AllArgsConstructor\npublic class OrderDto {\n\n @JsonProperty(\"id\")\n private String id;\n /**\n * \n * (Require...
import com.coxautodev.graphql.tools.GraphQLRootResolver; import me.roybailey.data.schema.OrderDto; import me.roybailey.data.schema.ProductDto; import me.roybailey.data.schema.UserDto; import me.roybailey.springboot.service.OrderAdaptor; import me.roybailey.springboot.service.ProductAdaptor; import me.roybailey.springbo...
package me.roybailey.springboot.graphql.domain.schema; @Service public class Query implements GraphQLRootResolver { @Autowired ProductAdaptor productAdaptor; @Autowired UserAdaptor userAdaptor; @Autowired OrderAdaptor orderAdaptor; public List<ProductDto> products() { return ...
public List<UserDto> users() {
2
yjfnypeu/Router-RePlugin
RePluginDemo/app/src/main/java/com/lzh/replugindemo/HostApplication.java
[ "public class RePluginVerification implements RemoteVerify{\n\n @Override\n public boolean verify(Context context) throws Exception {\n return Process.myUid() == Binder.getCallingUid();\n }\n}", "public interface IPluginCallback {\n\n /**\n * 当此uri所代表的路由为无效时。回调通知到此.\n *\n * <p>若通知到此...
import android.app.Activity; import android.app.ProgressDialog; import android.net.Uri; import com.alibaba.fastjson.JSON; import com.lzh.compiler.parceler.Parceler; import com.lzh.compiler.parceler.annotation.FastJsonConverter; import com.lzh.nonview.router.Router; import com.lzh.nonview.router.RouterConfiguration; imp...
package com.lzh.replugindemo; // 指定生成路由的baseUrl。此baseUrl会与使用RouteRule所指定的path所组合。形成一个完整的路由地址。 // 生成的路由表。参考下方添加路由规则的RouterRuleCreator类。 @RouteConfig(baseUrl = "host://") public class HostApplication extends RePluginApplication{ @Override public void onCreate() { super.onCreate(); // 启动远程路由前...
HostRouterConfiguration.init("com.lzh.replugindemo", this);
2
alternativeTime/GlycanBuilderVaadin7Version
glycanbuilderv/src/ac/uk/icl/dell/vaadin/canvas/basiccanvas/BasicCanvas.java
[ "public class Font extends HashMap<Character,FontCharacter> implements Serializable{\n\tprivate static final long serialVersionUID=5024626343913116045L;\n\t\n\tprivate String fontName;\n\tpublic float characterSetMaxHeight=-1f;\n\tpublic float characterSetMinHeight=1000f;\n\t\n\tpublic ArrayList<FontCharacter> orde...
import java.util.ArrayList; import java.util.List; import ac.uk.icl.dell.vaadin.canvas.basiccanvas.font.Font; import ac.uk.icl.dell.vaadin.canvas.basiccanvas.font.FontCharacter; import ac.uk.icl.dell.vaadin.canvas.basiccanvas.font.FontPoint; import ac.uk.icl.dell.vaadin.canvas.basiccanvas.font.FontSegment; import ac.uk...
/* * Copyright (c) 2014. Matthew Campbell <matthew.campbell@mq.edu.au>, David R. Damerell <david@nixbioinf.org>. * * This file is part of GlycanBuilder Vaadin Release and its affliated projects EUROCarbDB, UniCarb-DB and UniCarbKB. * * This program is free software free software: you can redistribute it and/or mod...
for(FontPoint fontPoint:fontSegment){
2
osiam/connector4java
src/main/java/org/osiam/client/OsiamUserService.java
[ "public class ConnectionInitializationException extends OsiamClientException {\n\n private static final long serialVersionUID = -6114330785799547036L;\n\n public ConnectionInitializationException(String message) {\n super(message);\n }\n\n public ConnectionInitializationException(String message, ...
import org.osiam.client.user.BasicUser; import org.osiam.resources.scim.SCIMSearchResult; import org.osiam.resources.scim.UpdateUser; import org.osiam.resources.scim.User; import javax.ws.rs.ProcessingException; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; im...
/** * The MIT License (MIT) * * Copyright (C) 2013-2016 tarent solutions GmbH * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the ri...
SCIMSearchResult<User> searchUsers(Query query, AccessToken accessToken) {
5
ollipekka/gdx-soundboard
desktop/src/com/gdx/musicevents/tool/transitions/EffectDecorator.java
[ "public interface Effect {\n public void update(float dt);\n public boolean isDone();\n}", "public class FadeIn implements StartEffect {\n protected transient float originalVolume;\n protected final float totalTime;\n protected transient float elapsedTime = 0;\n protected final float offset;\n ...
import com.gdx.musicevents.effects.Effect; import com.gdx.musicevents.effects.FadeIn; import com.gdx.musicevents.effects.FadeOut; import com.gdx.musicevents.effects.Play; import com.gdx.musicevents.effects.Stop;
package com.gdx.musicevents.tool.transitions; public class EffectDecorator { String name; Effect effect; public EffectDecorator(String name, Effect effect) { this.name = name; this.effect = effect; } @Override public String toString() { return name + "(" + getEffectNa...
if(effect instanceof Play){
3
rubenlagus/Tsupport
TMessagesProj/src/main/java/org/telegram/android/ContactsController.java
[ "public class BuildVars {\n public static boolean DEBUG_VERSION = true;\n public static int APP_ID = 0; // YOUR API ID\n public static String APP_HASH = \"YOUR-API-HASH\";\n public static String HOCKEY_APP_HASH = \"YOUR-HOCKEY-HASH\";\n\n public static String GCM_SENDER_ID = \"YOUR-GCM-SENDER-ID\";\n...
import android.accounts.Account; import android.accounts.AccountManager; import android.app.Activity; import android.content.ContentProviderOperation; import android.content.ContentProviderResult; import android.content.ContentResolver; import android.content.SharedPreferences; import android.database.Cursor; import an...
/* * This is the source code of Telegram for Android v. 1.3.x. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Nikolai Kudashov, 2013. */ package org.telegram.android; public class ContactsController { private Ac...
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
4
amymcgovern/spacesettlers
src/spacesettlers/actions/RawAction.java
[ "public class Drone extends AbstractActionableObject {\r\n\tpublic static final int DRONE_RADIUS = 8;\r\n\tpublic static final int DRONE_MASS = 20;\r\n\tpublic static final int DRONE_INITIAL_ENERGY = 500;\r\n\tpublic static final int DRONE_MAX_ENERGY = 500;\r\n\r\n\t/**\r\n\t * The action the drone is currently exe...
import spacesettlers.objects.Drone; import spacesettlers.objects.Ship; import spacesettlers.simulator.Toroidal2DPhysics; import spacesettlers.utilities.Movement; import spacesettlers.utilities.Vector2D;
package spacesettlers.actions; /** * A raw action simply sets the acceleration (translational or rotational) directly * from the client (no PD control so the ship better know what it is doing). This * was mainly intended to be used for the human controlled ship but can be used by any * client that wants to direc...
public Movement getMovement(Toroidal2DPhysics space, Ship ship) {
2
ground-context/ground
modules/common/test/edu/berkeley/ground/common/model/core/NodeVersionTest.java
[ "public static String convertFromClassToString(Object object) {\n return Json.stringify(Json.toJson(object));\n}", "public static Object convertFromStringToClass(String body, Class<?> klass) {\n return Json.fromJson(Json.parse(body), klass);\n}", "public static String readFromFile(String filename) throws Grou...
import static edu.berkeley.ground.common.util.ModelTestUtils.convertFromClassToString; import static edu.berkeley.ground.common.util.ModelTestUtils.convertFromStringToClass; import static edu.berkeley.ground.common.util.ModelTestUtils.readFromFile; import static org.junit.Assert.assertEquals; import static org.junit.As...
/** * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed ...
tagsMap.put("testtag", new Tag(1, "testtag", "tag", GroundType.STRING));
3
VanetSim/VanetSim
src/vanetsim/simulation/WorkerThread.java
[ "public final class ErrorLog {\r\n\r\n\t/** The <code>java.util.logging.Logger</code> instance. */\r\n\tprivate static Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME); //$NON-NLS-1$\r\n\r\n\t/**\r\n\t * Sets the parameters for the static class.\r\n\t *\r\n\t * @param level\tthe minimum level for error m...
import java.util.Iterator; import java.util.LinkedHashSet; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; import vanetsim.ErrorLog; import vanetsim.gui.Renderer; import vanetsim.localization.Messages; import vanetsim.map.Node; import vanetsim.map.Region; import v...
/* * VANETsim open source project - http://www.vanet-simulator.org * Copyright (C) 2008 - 2013 Andreas Tomandl, Florian Scheuer, Bernhard Gruber * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Softwa...
Vehicle[][] vehicles = new Vehicle[ourRegionsLength][];
5
nimble-platform/identity-service
identity-service/src/main/java/eu/nimble/core/infrastructure/identity/mail/EmailService.java
[ "@Component\r\n@Configuration\r\n@EnableConfigurationProperties\r\n@ConfigurationProperties(prefix = \"nimble\")\r\npublic class NimbleConfigurationProperties {\r\n\r\n private LanguageID defaultLanguageID = LanguageID.ENGLISH;\r\n\r\n public LanguageID getDefaultLanguageID() {\r\n return defaultLangua...
import com.google.common.base.Strings; import eu.nimble.core.infrastructure.identity.config.NimbleConfigurationProperties; import eu.nimble.core.infrastructure.identity.config.message.NimbleMessageCode; import eu.nimble.core.infrastructure.identity.entity.CompanyDetailsUpdates; import eu.nimble.core.infrastructure....
package eu.nimble.core.infrastructure.identity.mail; @Service @SuppressWarnings("Duplicates") public class EmailService { private static final Logger logger = LoggerFactory.getLogger(EmailService.class); @Autowired private JavaMailSender emailSender; @Autowired
private UblUtils ublUtils;
5
codebulb/LambdaOmega
src/test/java/ch/codebulb/lambdaomega/LBaseTest.java
[ "public static <T> L<T> L(Stream<T> stream) {\n return new L(stream.collect(Collectors.toList()));\n}", "public static <T> L<T> l() {\n return new L<>(new ArrayList<>());\n}", "public static <T> List<T> list(T... ts) {\n return l(ts).l;\n}", "public static final List<Integer> EXPECTED_LIST = new Arra...
import static ch.codebulb.lambdaomega.L.L; import static ch.codebulb.lambdaomega.L.l; import static ch.codebulb.lambdaomega.L.list; import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_LIST; import static ch.codebulb.lambdaomega.TestUtil.EXPECTED_NESTED_LIST; import static ch.codebulb.lambdaomega.TestUtil.assertEqua...
package ch.codebulb.lambdaomega; /** * Basic test cases for {@link L}. */ public class LBaseTest { @BeforeClass public static void beforeClass() { L.TEST_DISABLE_HELPER_MAP_CONVERSION = true; } @Test public void testObject() { assertTrue(l().equals(l())); assertTrue(...
assertTrue(list(0, 1, 2).equals(l(0, 1, 2).l));
2
greenfrvr/anny-prefs
annyprefs-compiler/src/main/java/com/greenfrvr/annyprefs/compiler/components/PrefInstanceGenerator.java
[ "public interface DataSource {\n\n String name();\n\n String prefsName();\n\n String packageName();\n\n List<PrefField> prefs();\n\n}", "public class RemoveInnerInstance extends InnerInstanceGenerator {\n\n RemoveInnerInstance(DataSource dataSource){\n super(dataSource);\n }\n\n public...
import com.greenfrvr.annyprefs.compiler.DataSource; import com.greenfrvr.annyprefs.compiler.components.inner.RemoveInnerInstance; import com.greenfrvr.annyprefs.compiler.components.inner.RestoreInnerInstance; import com.greenfrvr.annyprefs.compiler.components.inner.SaveInnerInstance; import com.greenfrvr.annyprefs.comp...
package com.greenfrvr.annyprefs.compiler.components; /** * Created by greenfrvr */ public class PrefInstanceGenerator implements com.greenfrvr.annyprefs.compiler.components.util.Constructor, com.greenfrvr.annyprefs.compiler.components.util.Generator { private TypeSpec typeSpec; private DataSource data; ...
builder.addField(SaveInnerInstance.init(data).construct())
3
sksamuel/camelwatch
camelwatch-web/src/main/java/camelwatch/web/EndpointController.java
[ "public class CamelBean {\r\n\r\n\tprivate final Map<String, Object>\tproperties\t= Maps.newTreeMap();\r\n\r\n\tprivate String\t\t\t\tname;\r\n\r\n\tprivate String\t\t\t\tdescription;\r\n\r\n\tpublic String getDescription() {\r\n\t\treturn description;\r\n\t}\r\n\r\n\tpublic String getName() {\r\n\t\treturn name;\r...
import org.camelwatch.api.CamelBean; import org.camelwatch.api.CamelConnection; import org.camelwatch.api.CamelConnectionFactory; import org.camelwatch.api.Message; import org.camelwatch.api.endpoint.EndpointOperations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ster...
package camelwatch.web; /** * @author Stephen K Samuel samspade79@gmail.com 1 Jul 2012 19:02:59 */ @Controller @RequestMapping("endpoint") public class EndpointController { private static final int MAX_OVERVIEW_MESSAGES = 15; @Autowired private CamelConnectionFactory connectionFactory; ...
public Message browseMessageAsXml(@RequestParam("endpointName") String endpointName,
3
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkicklist/SongkickListActivity.java
[ "@Singleton\n@Component(modules = {\n ApplicationModule.class, SerializationModule.class, NetworkModule.class\n})\npublic interface ApplicationInjectionComponent extends DependencyDescription {\n final class Initializer {\n /* 10 MiB */\n private static final long CACHE_SIZE = 10 * 1024 * 10...
import java.util.List; import rx.Observable; import rx.functions.Action1; import android.os.Bundle; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.View; import android.widget.EditText; import android.widg...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
public Observable<Artist> getArtistClicks() {
3
paolodongilli/SASAbus
src/it/sasabz/android/sasabus/classes/dialogs/ConnectionDialog.java
[ "public class MyXMLConnectionAdapter extends BaseAdapter {\r\n\tprivate final Vector<XMLConnection> list;\r\n\r\n\t\r\n\t/**\r\n\t * This constructor creates an object with the following parameters\r\n\t * @param context is the context to work with\r\n\t * @param whereId is the resource id where to place the string...
import it.sasabz.android.sasabus.R; import it.sasabz.android.sasabus.R.string; import it.sasabz.android.sasabus.classes.adapter.MyXMLConnectionAdapter; import it.sasabz.android.sasabus.classes.hafas.XMLConnection; import it.sasabz.android.sasabus.classes.hafas.XMLJourney; import it.sasabz.android.sasabus.fragments...
/** * * ConnectionDialog.java * * * Copyright (C) 2012 Markus Windegger * * This file is part of SasaBus. * SasaBus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of t...
MyXMLConnectionAdapter adapter = new MyXMLConnectionAdapter(list);
0
irq0/jext2
src/jext2/DirectoryInode.java
[ "public class DirectoryNotEmpty extends JExt2Exception {\n\tstatic final long serialVersionUID = 42;\n\tprotected final static int ERRNO = Errno.ENOTEMPTY;\n\n\tpublic int getErrno() {\n\t\treturn ERRNO;\n\t}\n}", "public class FileExists extends JExt2Exception {\n\tstatic final long serialVersionUID = 42;\n\tpro...
import jext2.exceptions.FileTooLarge; import jext2.exceptions.IoError; import jext2.exceptions.JExt2Exception; import jext2.exceptions.NoSpaceLeftOnDevice; import jext2.exceptions.NoSuchFileOrDirectory; import jext2.exceptions.TooManyLinks; import java.nio.ByteBuffer; import java.util.Date; import java.util.Iterator; i...
/* * Copyright (c) 2011 Marcel Lauhoff. * * This file is part of jext2. * * jext2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later vers...
public void addLink(Inode inode, String name) throws JExt2Exception, FileExists, NoSpaceLeftOnDevice, FileNameTooLong, TooManyLinks, FileTooLarge {
6
amzn/amazon-instant-access-sdk-java
src/main/java/examples/servlet/AccountLinkingServletImpl.java
[ "public class CredentialStore {\n private static final Log log = LogFactory.getLog(CredentialStore.class);\n\n private HashMap<String, Credential> store;\n\n public CredentialStore() {\n store = new HashMap<String, Credential>();\n }\n\n /**\n * Gets the credential for a given public key.\...
import com.amazon.dtasdk.signature.CredentialStore; import com.amazon.dtasdk.v2.serialization.messages.GetUserIdSerializableResponseValue; import com.amazon.dtasdk.v3.serialization.messages.GetUserIdSerializableRequest; import com.amazon.dtasdk.v3.serialization.messages.GetUserIdSerializableResponse; import com.amazon....
/* * Copyright 2016-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "lice...
public CredentialStore getCredentialStore() {
0
tylersuehr7/clean-architecture
app/src/main/java/com/tylersuehr/cleanarchitecture/ui/people/PeopleActivity.java
[ "public final class Injector {\n public static PersonRepository providePeopleRepo(Context appCtx) {\n return PersonRepository.getInstance(new LocalPersonRepository(\n DatabaseClient.getInstance(appCtx), new PersonMapper()\n ));\n }\n}", "public interface IPersonRepository {\n ...
import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import com.tylersuehr.cleanarchitecture.R; import com.tylersuehr.cleanarchitecture.data.Injector; import com.tylersuehr.cleanarchitecture.data.repositories.peo...
package com.tylersuehr.cleanarchitecture.ui.people; /** * Copyright 2017 Tyler Suehr * * @author Tyler Suehr * @version 1.0 */ public class PeopleActivity extends AppCompatActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
IPersonRepository personRepo = Injector.providePeopleRepo(getApplicationContext());
0
AdeptJ/adeptj-runtime
src/main/java/com/adeptj/runtime/core/Launcher.java
[ "public enum BundleContextHolder {\n\n INSTANCE;\n\n private BundleContext bundleContext;\n\n public BundleContext getBundleContext() {\n return this.bundleContext;\n }\n\n public void setBundleContext(BundleContext bundleContext) { // NOSONAR\n this.bundleContext = bundleContext;\n ...
import java.util.Optional; import static com.adeptj.runtime.common.Constants.SERVER_STOP_THREAD_NAME; import static org.apache.commons.lang3.SystemUtils.JAVA_RUNTIME_NAME; import static org.apache.commons.lang3.SystemUtils.JAVA_RUNTIME_VERSION; import com.adeptj.runtime.common.BundleContextHolder; import com.adeptj.run...
/* ############################################################################### # # # Copyright 2016, AdeptJ (http://www.adeptj.com) # # ...
Optional.ofNullable(BundleContextHolder.getInstance().getBundleContext())
0
mzule/AndroidWeekly
app/src/main/java/com/github/mzule/androidweekly/ui/activity/MainActivity.java
[ "public interface ApiCallback<T> {\n\n void onSuccess(T data, boolean fromCache);\n\n void onFailure(Exception e);\n\n}", "public class ArticleApi {\n //TODO new thread to threadhandler\n private Handler handler = new Handler();\n private ArticleDao articleDao;\n\n public ArticleApi() {\n ...
import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.View; import android.widget.AdapterView; import android.widget.ListView; import com.github.mzule.androidweekly.R; import com.github.mzule.androidweekly.api.ApiCallback; import com.github.mzule.androidweekly....
package com.github.mzule.androidweekly.ui.activity; @Layout(R.layout.activity_main) public class MainActivity extends BaseActivity { @Bind(R.id.drawerLayout) DrawerLayout drawerLayout; @Bind(R.id.listView) ListView listView; @Bind(R.id.progressView) ProgressView progressView; @Bind(R.id...
private List<Issue> issues;
3
shillner/unleash-maven-plugin
plugin/src/main/java/com/itemis/maven/plugins/unleash/steps/actions/tycho/AbstractTychoVersionsStep.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.io.IOException; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.inject.Named; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProject; import org.codehaus.plexus.PlexusConta...
package com.itemis.maven.plugins.unleash.steps.actions.tycho; /** * An abstract step for version upgrades using Eclipse Tycho which upgrades versions in POMs as well as MANIFESTs and * bundle references. * * @author <a href="mailto:stanley.hillner@itemis.de">Stanley Hillner</a> * @since 1.1.0 */ public abstr...
Optional<Document> parsedPOM = PomUtil.parsePOM(this.project);
3
vgoldin/cqrs-eventsourcing-kafka
services-inventoryitem-api/src/main/java/io/plumery/inventoryitem/api/denormalizer/KafkaDenormalizer.java
[ "public class InventoryItemApiConfiguration extends Configuration {\n @Valid\n @NotNull\n private KafkaConfigurationFactory kafkaConfigurationFactory;\n private CommandDispatcherFactory commandDispatcherFactory;\n private StreamBroadcasterFactory streamBroadcasterFactory;\n\n @JsonProperty(\"kafka...
import io.dropwizard.lifecycle.Managed; import io.plumery.inventoryitem.api.InventoryItemApiConfiguration; import io.plumery.inventoryitem.api.denormalizer.handler.InventoryItemCreatedHandler; import io.plumery.inventoryitem.api.denormalizer.handler.InventoryItemDeactivatedHandler; import io.plumery.inventoryitem.api.d...
package io.plumery.inventoryitem.api.denormalizer; /** * Created by ben.goldin on 13/02/2017. */ public class KafkaDenormalizer implements Managed { private static final String INVENTORY_ITEM_TOPIC = "InventoryItem"; private final String bootstrap; private KafkaStreams kafkaStreams; public KafkaDe...
filteredStreams[0].process(InventoryItemCreatedHandler::new);
1
hillfly/WifiChat
src/hillfly/wifichat/activity/LoginActivity.java
[ "public class SimpleListDialogAdapter extends BaseArrayListAdapter {\n\n\tpublic SimpleListDialogAdapter(Context context, List<String> datas) {\n\t\tsuper(context, datas);\n\t}\n\n\tpublic SimpleListDialogAdapter(Context context, String... datas) {\n\t\tsuper(context, datas);\n\t}\n\n\t@Override\n\tpublic View getV...
import hillfly.wifichat.R; import hillfly.wifichat.adapter.SimpleListDialogAdapter; import hillfly.wifichat.common.BaseActivity; import hillfly.wifichat.common.dialog.SimpleListDialog; import hillfly.wifichat.common.dialog.SimpleListDialog.onSimpleListItemClickListener; import hillfly.wifichat.model.Users; import hillf...
package hillfly.wifichat.activity; /** * @fileName LoginActivity.java * @description 用户登陆类 */ public class LoginActivity extends BaseActivity implements OnClickListener, onSimpleListItemClickListener, OnDateChangedListener { // 登陆年龄限制 private static final int MAX_AGE = 80; private static fi...
SharePreferenceUtils sp = new SharePreferenceUtils();
7
jpush/jbox
android/JBox/app/src/main/java/com/jiguang/jbox/ui/main/MainActivity.java
[ "public class AppApplication extends Application {\n private static Context mContext;\n\n public static boolean shouldUpdateData = false;\n\n public static String currentDevKey = \"\";\n public static String currentChannelName = \"\";\n\n @Override public void onCreate() {\n super.onCreate();\n mContext ...
import android.Manifest; import android.os.Bundle; import android.os.Handler; import android.support.v4.app.FragmentActivity; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.view.MotionEvent; import android.view.View; import android.widget.AbsListView; import ...
mDrawerLayout.closeDrawers(); break; } return false; } }); mDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager().findFragmentById( R.id.navigation_drawer); mTopBar = (...
Developer dev = new Select()
2
timeforcoffee/timeforcoffee-android
wear/src/main/java/ch/liip/timeforcoffee/TimeForCoffeeWearModule.java
[ "public class ConnectionService {\n\n private final EventBus eventBus;\n private final BackendService backendService;\n\n @Inject\n public ConnectionService(EventBus eventBus, BackendService backendService) {\n this.backendService = backendService;\n this.eventBus = eventBus;\n this...
import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.greenrobot.eventbus.EventBus; import java.util.Date; import javax.inject.Singleton; import ch.liip.timeforcoffee.api.ConnectionService; import ch.liip.timeforcoffee.api.DepartureService; import ch.liip.timeforcoffee.api.StationService; import c...
package ch.liip.timeforcoffee; @Module( injects = { WearPresenter.class, StationListFragment.class, DepartureListFragment.class, } ) class TimeForCoffeeWearModule { @Provides @Singleton EventBus provideEventBus() { return EventB...
StationService provideStationService(EventBus eventBus, OpenDataService openDataService) {
2
sandflow/regxmllib
src/main/java/com/sandflow/smpte/tools/GenerateDictionaryXMLSchema.java
[ "public class XMLSchemaBuilder {\n\n private final static Logger LOG = Logger.getLogger(XMLSchemaBuilder.class.getName());\n\n public static final String REGXML_NS = \"http://sandflow.com/ns/SMPTEST2001-1/baseline\";\n private final static String XMLNS_NS = \"http://www.w3.org/2000/xmlns/\";\n private s...
import com.sandflow.smpte.klv.exceptions.KLVException; import com.sandflow.smpte.regxml.FragmentBuilder; import com.sandflow.smpte.regxml.XMLSchemaBuilder; import com.sandflow.smpte.regxml.dict.MetaDictionary; import com.sandflow.smpte.regxml.dict.MetaDictionaryCollection; import com.sandflow.smpte.regxml.dict.exceptio...
/* * Copyright (c) 2014, Pierre-Anthony Lemieux (pal@sandflow.com) * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notic...
new EventHandler() {
4
Zerokyuuni/Ex-Aliquo
exaliquo/bridges/Thaumcraft/ExThaumiquo.java
[ "public static Block getBlock(Info info)\n{\n\tBlock block = findBlock(info.mod, info.sname);\n\treturn (block != null) ? block : debugBlockInfo(info);\n}", "public static int getIDs(Info info)\n{\n\tif (info.type == \"block\")\n\t{\n\t\tBlock id = findBlock(info.mod, info.sname);\n\t\treturn (id != null) ? id.bl...
import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.logging.Level; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item...
package exaliquo.bridges.Thaumcraft; public class ExThaumiquo { protected static void initThaumiquo() { addWorkbenchRecipes(); addCrucibleRecipes(); addArcaneRecipes(); addInfusionRecipes(); addAspectstoNihilo(); addPages(); addResearch(); if (Configurations.harderWands) { changePrimalWands...
new ItemStack(getItem(Info.resources), 1, 8)).setPages(new ResearchPage[] {
2
nikolavp/approval
approval-core/src/test/java/com/github/approval/ApprovalTest.java
[ "public interface Converter<T> {\n /**\n * Gets the raw representation of the type object. This representation will be written in the files you are going to then use in the approval process.\n *\n * @param value the object that you want to convert\n * @return the raw representation of the object\...
import com.github.approval.converters.Converter; import com.github.approval.converters.Converters; import com.github.approval.converters.DefaultConverter; import com.github.approval.example.Entity; import com.github.approval.utils.FileSystemUtils; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.ju...
package com.github.approval; /* * #%L * approval * %% * Copyright (C) 2014 Nikolavp * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICE...
Converter<Entity> converter = Mockito.mock(Converter.class);
0
SilenceDut/NBAPlus
app/src/main/java/com/me/silencedut/nbaplus/ui/fragment/DrawerFragment.java
[ "public class AppService {\n private static final AppService NBAPLUS_SERVICE=new AppService();\n private static Gson sGson;\n private static EventBus sBus ;\n private static DBHelper sDBHelper;\n private static NbaplusAPI sNbaplusApi;\n private static NewsDetileAPI sNewsDetileApi;\n private sta...
import android.content.res.Configuration; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.os.Build; import android.os.Bundle; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; ...
package com.me.silencedut.nbaplus.ui.fragment; /** * Created by SilenceDut on 2015/11/28. */ public class DrawerFragment extends BaseFragment { private static final int DOWNSCALE=8; private static final int BLUR_RADIUS=15; private ActionBarDrawerToggle mDrawerToggle; private DrawerLayout mDrawerL...
mBitmap = BitmapUtils.drawViewToBitmap(mContentLayout,
5
nextgis/android_maplib
src/main/java/com/nextgis/maplib/display/FieldStyleRule.java
[ "public interface IJSONStore\n{\n /**\n * Store object in json\n * @return json object with stored data\n * @throws JSONException\n */\n JSONObject toJSON()\n throws JSONException;\n\n /**\n * Restore object from json\n * @param jsonObject where the stored data are\n ...
import java.util.Map; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicReference; import com.nextgis.maplib.api.IJSONStore; import com.nextgis.maplib.api.IStyleRule; import com.nextgis.maplib.datasource.Feature; import com.nextgis.maplib.map.VectorLayer; import com.nextgis.maplib.util.Constants; impor...
/* * Project: NextGIS Mobile * Purpose: Mobile GIS for Android. * Author: Stanislav Petriakov, becomeglory@gmail.com * ***************************************************************************** * Copyright (c) 2016-2017 NextGIS, info@nextgis.com * * This program is free software: you can redistribute it a...
Feature feature = mLayer.getFeature(featureId);
2
lukaspili/Volley-Ball
samples/src/main/java/com/siu/android/volleyball/samples/activity/scenarios/Scenario7Activity.java
[ "@SuppressWarnings(\"rawtypes\")\npublic class BallRequestQueue { //extends RequestQueue {\n\n /**\n * Used for generating monotonically-increasing sequence numbers for requests.\n */\n private AtomicInteger mSequenceGenerator = new AtomicInteger();\n\n /**\n * Staging area for requests that al...
import com.siu.android.volleyball.BallRequestQueue; import com.siu.android.volleyball.samples.volley.fake.FakeCache; import com.siu.android.volleyball.samples.volley.fake.FakeNetwork; import com.siu.android.volleyball.samples.volley.request.ScenarioRequest; import com.siu.android.volleyball.toolbox.VolleyBall; import c...
package com.siu.android.volleyball.samples.activity.scenarios; /** * Scenario 7 * <p/> * 1. Start the request * 2. Cache thread hits soft cache -> post an intermediate response * 3. Local thread returns valid response -> intermediate response ignored * 4. Network thread returns valid response -> post a final re...
.network(new FakeNetwork(true, false, 2))
2
martin-lizner/trezor-ssh-agent
src/main/java/com/trezoragent/gui/AgentPopUpMenu.java
[ "public abstract class DeviceService {\n\n protected HardwareWalletService hardwareWalletService;\n protected HardwareWalletClient client;\n protected String deviceKey;\n byte[] signedData;\n byte[] challengeData;\n protected ReadDeviceData asyncKeyData;\n protected ReadDeviceData asyncSignData...
import com.trezoragent.sshagent.DeviceService; import com.trezoragent.sshagent.SSHAgent; import com.trezoragent.sshagent.DeviceWrapper; import com.trezoragent.utils.AgentConstants; import static com.trezoragent.utils.AgentConstants.*; import com.trezoragent.utils.LocalizedLogger; import java.awt.*; import java.awt.even...
package com.trezoragent.gui; /** * * @author Martin Lizner * * Class renders menu in System Tray * */ public class AgentPopUpMenu extends JPopupMenu { private final String ABOUT_BUTTON_LOCALIZED_KEY = "ABOUT"; private final String SHOW_LOG_FILE_KEY = "SHOW_LOG_FILE"; private final String EDIT_SETT...
JMenuItem viewLog = new JMenuItem(LocalizedLogger.getLocalizedMessage(SHOW_LOG_FILE_KEY));
5
tastybento/askygrid
src/com/wasteofplastic/askygrid/commands/Challenges.java
[ "public class ASkyGrid extends JavaPlugin {\n // This plugin\n private static ASkyGrid plugin;\n // The ASkyGrid world\n private static World gridWorld = null;\n private static World netherWorld = null;\n private static World endWorld = null;\n // Player folder file\n private File playersFol...
import java.io.File; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.UUID; import net.milkbowl.vault.economy.EconomyResponse; import org.ap...
/******************************************************************************* * This file is part of ASkyGrid. * * ASkyBlock 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...
private HashMap<UUID, List<CPItem>> playerChallengeGUI = new HashMap<UUID, List<CPItem>>();
2
eedrummer/ccr-importer
src/java/org/ohd/pophealth/api/Evaluator.java
[ "public class InCompleteVocabularyException extends Exception {\n\n public InCompleteVocabularyException(String msg){\n super(msg);\n }\n public InCompleteVocabularyException(){\n super();\n }\n}", "public class RecordCreator {\n\n private final static Logger LOG = Logger.getLogger(Re...
import java.io.Closeable; import java.io.IOException; import java.net.URL; import java.util.ArrayList; import java.util.logging.Level; import java.util.logging.Logger; import org.astm.ccr.ContinuityOfCareRecord; import org.codehaus.jackson.JsonParseException; import org.codehaus.jackson.map.JsonMappingException; import...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.ohd.pophealth.api; /** * This is the main entry class for the popHealth CCR Validator/Importer. Additional * service classes and implementation can be built using this class * * @author ohdohd */ publ...
Record r = rc.createRecord(ccr);
6
farmerbb/SecondScreen
app/src/main/java/com/farmerbb/secondscreen/service/DisplayConnectionService.java
[ "public final class HdmiActivity extends Activity {\n\n private final class FinishReceiver extends BroadcastReceiver {\n @Override\n public void onReceive(Context context, Intent intent) {\n finish();\n }\n }\n\n String filename;\n boolean menu = false;\n IntentFilter ...
import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.Service; import android.content.Intent; import android.content.SharedPreferences; import android.hardware.display.DisplayManager; import android.os.IBinder; import androidx.annotation.Nul...
/* Copyright 2015 Braden Farmer * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
Intent mainActivityIntent = new Intent(this, MainActivity.class);
1
DavidGoldman/MobSpawnControls2
src/com/mcf/davidee/msc/gui/list/ModListScreen.java
[ "@Mod(modid = \"MSC2\", name=\"Mob Spawn Controls 2\", dependencies = \"after:*\", version=MobSpawnControls.VERSION)\npublic class MobSpawnControls{\n\n\tpublic static final String VERSION = \"1.2.1\";\n\tpublic static final PacketPipeline DISPATCHER = new PacketPipeline();\n\t\n\t@SidedProxy(clientSide = \"com.mcf...
import net.minecraft.client.gui.GuiScreen; import com.mcf.davidee.guilib.basic.FocusedContainer; import com.mcf.davidee.guilib.basic.Label; import com.mcf.davidee.guilib.core.Button; import com.mcf.davidee.guilib.core.Container; import com.mcf.davidee.guilib.core.Scrollbar; import com.mcf.davidee.guilib.focusable.Focus...
package com.mcf.davidee.msc.gui.list; public class ModListScreen extends MSCScreen{ private ModListPacket packet; private Label title; private FocusableLabel[] labels; private Button close, controls, types, groups; private Scrollbar scrollbar; private Container labelContainer, masterContainer; public Mo...
MobSpawnControls.DISPATCHER.sendToServer(MSCPacket.getRequestPacket(PacketType.GROUPS, mod));
4
WassimBenltaief/ReactiveFB
app/src/main/java/com/beltaief/reactivefbexample/views/AlbumsActivity.java
[ "public class ReactiveFB {\n\n private static ReactiveFB mInstance = null;\n private static SimpleFacebookConfiguration mConfiguration =\n new SimpleFacebookConfiguration.Builder().build();\n private static SessionManager mSessionManager = null;\n\n public static void sdkInitialize(Context co...
import android.content.Intent; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.Toast; imp...
package com.beltaief.reactivefbexample.views; public class AlbumsActivity extends AppCompatActivity implements RecyclerViewClickListener { private static final String TAG = AlbumsActivity.class.getSimpleName();
private AlbumsAdapter mAdapter;
6
ga4gh/compliance
cts-java/src/test/java/org/ga4gh/cts/api/references/ReferencesSearchIT.java
[ "public interface URLMAPPING {\n\n /**\n * </p>The urlRoot is a string such as http://localhost:8000<p>\n * @return the URL to be used to reach the target server\n */\n String getUrlRoot();\n\n /**\n * </p>The urlRoot is a string such as http://localhost:8000<p>\n * @param urlRoot URL t...
import com.google.protobuf.InvalidProtocolBufferException; import com.mashape.unirest.http.exceptions.UnirestException; import junitparams.JUnitParamsRunner; import org.ga4gh.ctk.transport.GAWrapperException; import org.ga4gh.ctk.transport.URLMAPPING; import org.ga4gh.ctk.transport.protocols.Client; import org.ga4gh.ct...
package org.ga4gh.cts.api.references; /** * Compliance tests relating to searching reference bases. * * @author Maciek Smuga-Otto */ @RunWith(JUnitParamsRunner.class) @Category(ReferencesTests.class) public class ReferencesSearchIT { private static Client client = new Client(URLMAPPING.getInstance()); ...
Utils.getReferenceSetIdByAssemblyId(client, TestData.REFERENCESET_ASSEMBLY_ID);
2