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
greengrowapps/ggarest
GgaRestJavaLib/ggarest/src/main/java/com/greengrowapps/ggarest/GgaRest.java
[ "public class JsonSerializer implements Serializer {\n\n private final ObjectMapper mapper = new ObjectMapper();\n\n @Override\n public <T> T fromString(String string, Class<T> clazz) throws IOException {\n return mapper.readValue(string, clazz);\n }\n\n @Override\n public String fromObject...
import com.greengrowapps.ggarest.serialization.JsonSerializer; import com.greengrowapps.ggarest.serialization.Serializer; import com.greengrowapps.ggarest.streams.StreamConverter; import com.greengrowapps.ggarest.streams.StreamConverterImpl; import com.greengrowapps.ggarest.webservice.RequestExecutionFactoryJava;
package com.greengrowapps.ggarest; public class GgaRest { private GgaRest(){ } public static Webservice ws() {
return new WebserviceImpl(new RequestExecutionFactoryJava(), new JsonSerializer(), new StreamConverterImpl("UTF-8"));
0
se-bastiaan/TVNL-AndroidTV
app/src/main/java/eu/se_bastiaan/tvnl/network/service/RadioboxApiService.java
[ "public class RadioboxAudiofragment {\n\n private Long id;\n private String url;\n private String description;\n @SerializedName(\"startdatetime\")\n private Date startDate;\n @SerializedName(\"stopdatetime\")\n private Date stopDate;\n\n public Long getId() {\n return id;\n }\n\n ...
import eu.se_bastiaan.tvnl.model.RadioboxAudiofragment; import eu.se_bastiaan.tvnl.model.RadioboxBroadcast; import eu.se_bastiaan.tvnl.model.RadioboxChannel; import eu.se_bastiaan.tvnl.model.RadioboxSearch; import eu.se_bastiaan.tvnl.model.RadioboxTrack; import eu.se_bastiaan.tvnl.model.RadioboxVideostream; import retr...
package eu.se_bastiaan.tvnl.network.service; public interface RadioboxApiService { @GET("broadcast/search.json")
Single<RadioboxSearch<RadioboxBroadcast>> broadcastSearch(@Query("q") String query, @Query("max-results") Integer limit, @Query("order") String order);
3
noctarius/snowcast
src/main/java/com/noctarius/snowcast/impl/operations/BackupDetachLogicalNodeOperation.java
[ "public final class SnowcastEpoch {\n\n private static final long INITIALIZATION_TIMESTAMP = System.currentTimeMillis();\n private static final long INITIALIZATION_NANOTIME = System.nanoTime();\n\n private final long offset;\n\n private SnowcastEpoch(@Nonnegative long offset) {\n this.offset = of...
import com.hazelcast.nio.Address; import com.hazelcast.nio.ObjectDataInput; import com.hazelcast.nio.ObjectDataOutput; import com.hazelcast.spi.BackupOperation; import com.noctarius.snowcast.SnowcastEpoch; import com.noctarius.snowcast.impl.NodeSequencerService; import com.noctarius.snowcast.impl.SequencerDataSerialize...
/* * Copyright (c) 2015-2017, Christoph Engelbert (aka noctarius) and * contributors. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/li...
SnowcastEpoch epoch = SnowcastEpoch.byTimestamp(epochOffset);
0
stefanhaustein/nativehtml
android/src/main/java/org/kobjects/nativehtml/android/AndroidCss.java
[ "public class Css {\n /**\n * Specificity weight for element name and pseudoclass selectors.\n */\n static final int SPECIFICITY_D = 1;\n /**\n * Specificity weight for element name selectors.\n */\n static final int SPECIFICITY_C = 100 * SPECIFICITY_D;\n /**\n * Specificity weight for id selectors.\...
import android.graphics.Paint; import android.graphics.Typeface; import android.view.View; import org.kobjects.nativehtml.css.Css; import org.kobjects.nativehtml.css.CssEnum; import org.kobjects.nativehtml.css.CssProperty; import org.kobjects.nativehtml.css.CssStyleDeclaration; import org.kobjects.nativehtml.css.CssUni...
package org.kobjects.nativehtml.android; class AndroidCss { static final int PAINT_MASK = ~(Paint.STRIKE_THRU_TEXT_FLAG | Paint.UNDERLINE_TEXT_FLAG); static int getTextStyle(CssStyleDeclaration style) { int flags = 0;
if (style.get(CssProperty.FONT_WEIGHT, CssUnit.NUMBER) > 600) {
2
JeffreyFalgout/ThrowingStream
throwing-stream/src/main/java/name/falgout/jeffrey/throwing/stream/ThrowingStream.java
[ "public interface ThrowingBaseSpliterator<E, X extends Throwable, S extends ThrowingBaseSpliterator<E, X, S>> {\n public static interface ThrowingSpliterator<E, X extends Throwable>\n extends ThrowingBaseSpliterator<E, X, ThrowingSpliterator<E, X>> {}\n\n public static interface OfPrimitive<E, E_CONS, X exte...
import java.util.function.Function; import java.util.stream.DoubleStream; import java.util.stream.IntStream; import java.util.stream.LongStream; import java.util.stream.Stream; import name.falgout.jeffrey.throwing.ThrowingBaseSpliterator; import name.falgout.jeffrey.throwing.ThrowingFunction; import name.falgout.jeffre...
package name.falgout.jeffrey.throwing.stream; /** * <p> * A standard {@link Stream} does not allow you to throw any checked exceptions. This class is a * mirror of {@code Stream} except this class allows for checked exceptions. Each method in the * exception-free API has its mirror here using interfaces which su...
public ThrowingIterator<T, X> iterator();
2
jrenner/gdx-proto
core/src/org/jrenner/fps/View.java
[ "public abstract class Entity {\n\tpublic int id = -1;\n\tpublic static Array<Entity> list;\n\tpublic static Array<Integer> destroyQueue;\n\tpublic static IntMap<Entity> idMap;\n\tpublic static Array<Integer> usedIDs;\n\tprotected static Quaternion q = new Quaternion();\n\tprotected static Matrix4 mtx = new Matrix4...
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.PerspectiveCamera; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g3d.Environment; import com.badlogic.gdx.gr...
package org.jrenner.fps; public class View implements Disposable { public static View inst; private GL20 gl; public static int width, height; private PerspectiveCamera camera; private Environment environ, basicEnviron; private PointLight camLight; private DirectionalLight dirLight; public HUD hud; private ...
Entity playerEntity = Main.inst.client.player.entity;
0
mouton5000/DSTAlgoEvaluation
src/graphTheory/instances/steiner/eoliennes/EolienneInstance.java
[ "public class Arc implements Cloneable {\n\n\tprivate Integer input;\n\tprivate Integer output;\n\tprivate boolean isDirected;\n\n\tpublic Arc(Integer input, Integer output, boolean isDirected) {\n\t\tthis.input = input;\n\t\tthis.output = output;\n\t\tthis.isDirected = isDirected;\n\t}\n\n\tpublic Integer getInput...
import graphTheory.graph.Arc; import graphTheory.graph.DirectedGraph; import graphTheory.instances.steiner.classic.SteinerDirectedInstance; import graphTheory.utils.Collections2; import graphTheory.utils.WeightedQuickUnionPathCompressionUF; import java.util.*;
package graphTheory.instances.steiner.eoliennes; /** * Created by mouton on 01/03/16. */ public class EolienneInstance extends SteinerDirectedInstance implements Cloneable { public EolienneInstance(DirectedGraph g) { super(g); staticCapacityCosts = new HashMap<Integer, Double>(); ...
public Double getStaticCableCost(Arc a, Integer capacity){
0
freenet/plugin-FlogHelper
src/main/java/plugins/floghelper/ui/PreviewToadlet.java
[ "public class FlogHelper implements FredPlugin, FredPluginThreadless, FredPluginBaseL10n, FredPluginL10n, FredPluginThemed, FredPluginVersioned, FredPluginRealVersioned, FredPluginTalker {\n\n\tpublic static final String l10nFilesBasePath = \"l10n/\";\n\tpublic static final String l10nFilesMask = \"UI_${lang}.l10n\...
import plugins.floghelper.ui.flog.FlogFactory; import plugins.floghelper.ui.flog.IndexBuilder; import freenet.client.DefaultMIMETypes; import freenet.client.HighLevelSimpleClient; import freenet.clients.http.PageNode; import freenet.clients.http.ToadletContext; import freenet.clients.http.ToadletContextClosedException;...
/* FlogHelper, Freenet plugin to create flogs * Copyright (C) 2009 Romain "Artefact2" Dalmaso * * 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 yo...
IndexBuilder builder = new IndexBuilder(flog);
5
374901588/PaperPlane
app/src/main/java/com/hut/zero/bookmarks/BookmarksFragment.java
[ "public class BookmarksAdapter extends RecyclerView.Adapter<BaseViewHolder> {\n\n private Context context;\n\n public static final int TYPE_ZHIHU_NORMAL = 0;\n public static final int TYPE_ZHIHU_WITH_HEADER = 1;\n public static final int TYPE_GUOKE_NORMAL = 2;\n public static final int TYPE_GUOKE_WIT...
import android.content.Intent; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v7.widget.LinearLayoutManager; import android.view.LayoutInflater; import android.view.Menu; import android.view...
/* * Copyright 2017 lizhaotailang * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
BeanType beanType = null;
1
indeedeng/lsmtree
recordcache/src/main/java/com/indeed/lsmtree/recordcache/PersistentRecordCache.java
[ "public enum StorageType {\n INLINE,\n BLOCK_COMPRESSED\n}", "public final class Store<K, V> implements Closeable {\n\n private static final Logger log = Logger.getLogger(Store.class);\n\n private final AtomicSharedReference<GenerationState<K,V>> generationState;\n\n private final File root;\n\n ...
import com.google.common.collect.Iterators; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.indeed.util.core.Either; import com.indeed.util.core.threads.NamedThreadFactory; import com.indeed.util.serialization.LongSerializer; import com.indeed.util.serialization.Serializer; imp...
public List<Either<Exception, P2<K,V>>> call() { final List<Either<Exception, P2<K,V>>> ret = Lists.newArrayList(); for (Long address : addresses) { try { Put<K, V> put = null; try { put = lookupAddress(null,...
StoreBuilder<K, Long> indexBuilder = new StoreBuilder(indexDir, keySerializer, new LongSerializer());
2
corehunter/corehunter3
corehunter-base/src/test/java/org/corehunter/tests/data/simple/CoreHunterDataTest.java
[ "public enum CoreHunterObjectiveType {\n AV_ENTRY_TO_NEAREST_ENTRY(\"Average Entry to Nearest Entry\", \"EN\") ,\n AV_ACCESSION_TO_NEAREST_ENTRY(\"Average Accession to Nearest Entry\", \"AN\") ,\n AV_ENTRY_TO_ENTRY(\"Average Entry to Entry\", \"EE\"),\n SHANNON_DIVERSITY(\"Shannon diversity index\", \"S...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.io.IOException; import java.nio.file.Paths; import org.corehunter.CoreHunterObjectiveType; import org.corehunter.data.CoreHunterData; import org.corehunter.data.DistanceMatri...
/*--------------------------------------------------------------*/ /* 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 ...
FrequencyGenotypeData geno = readMarkerData(MARKERS_NON_UNIQUE_NAMES);
8
DaiDongLiang/DSC
src/main/java/net/dsc/cluster/ClusterManager.java
[ "public class ControllerMembershipListener implements MembershipListener {\n\t\n\tprivate static IControllerListener cluster;\n\t\n\tpublic ControllerMembershipListener(IControllerListener c) {\n\t\tthis.cluster=c;\n\t}\n\tpublic ControllerMembershipListener() { }\n\t@Override\n\tpublic void memberAdded(MembershipE...
import static net.dsc.cluster.HazelcastTableNameConstant.CONTROLLER_LOAD_MAP_NAME; import static net.dsc.cluster.HazelcastTableNameConstant.CONTROLLER_MAP_NAME; import static net.dsc.cluster.HazelcastTableNameConstant.CONTROLLER_SWITCH_MULITMAP_NAME; import static net.dsc.cluster.HazelcastTableNameConstant.MASTER_MAP; ...
@Override public Map<String, String> getMasterMapFromCS() { Map<String, String> master=new HashMap<String, String>(); for(ControllerModel c:controllerMappingSwitch.keySet()){ for(SwitchConnectModel s:controllerMappingSwitch.get(c)){ if(s.getRole().equals(OFControllerRole.ROLE_MASTER.toString())){ mast...
hazelcast.addMemberListener(new ControllerMembershipListener(this));
0
googleapis/java-trace
google-cloud-trace/src/main/java/com/google/cloud/trace/v1/stub/TraceServiceStubSettings.java
[ "public static class ListTracesPagedResponse\n extends AbstractPagedListResponse<\n ListTracesRequest,\n ListTracesResponse,\n Trace,\n ListTracesPage,\n ListTracesFixedSizeCollection> {\n\n public static ApiFuture<ListTracesPagedResponse> createAsync(\n PageContext<ListT...
import static com.google.cloud.trace.v1.TraceServiceClient.ListTracesPagedResponse; import com.google.api.core.ApiFunction; import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; import com.google....
/* * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to...
private final UnaryCallSettings<PatchTracesRequest, Empty> patchTracesSettings;
4
1and1/reactive
reactive-http/src/main/java/net/oneandone/reactive/sse/client/ClientSseSource.java
[ "public class ConnectException extends RuntimeException {\n \n private static final long serialVersionUID = 4790384678606033160L;\n\n public ConnectException(String reason) {\n super(reason);\n }\n \n public ConnectException(Throwable cause) {\n super(cause);\n }\n \n publi...
import io.netty.handler.codec.http.HttpHeaders; import java.net.URI; import java.nio.ByteBuffer; import java.time.Duration; import java.util.Optional; import java.util.Queue; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurre...
/* * Copyright 1&1 Internet AG, https://github.com/1and1/ * * 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 app...
public ReactiveSource<ServerSentEvent> open() throws ConnectException {
1
simo415/spc
src/com/sijobe/spc/command/KillAll.java
[ "public abstract class Parameter {\n\n private String label;\n private boolean optional;\n private boolean variableLength;\n \n public Parameter(String label, boolean optional) {\n this.label = label;\n this.optional = optional;\n }\n \n public Parameter(String label, boolean optional, boo...
import com.sijobe.spc.validation.Parameter; import com.sijobe.spc.validation.ParameterInteger; import com.sijobe.spc.validation.ParameterString; import com.sijobe.spc.validation.Parameters; import com.sijobe.spc.wrapper.CommandException; import com.sijobe.spc.wrapper.CommandSender; import com.sijobe.spc.wrapper.Entity;...
package com.sijobe.spc.command; /** * Allows the user to kill all of a certain entity type using the specified * type variable, or all mobs if no parameters are specified * * @author simo_415 * @version 1.0 */ @Command ( name = "killall", description = "Kills all of the specified entity type, this will ...
new ParameterInteger("[DISTANCE]",true),
1
mgilangjanuar/GoSCELE
app/src/main/java/com/mgilangjanuar/dev/goscele/modules/main/view/MainActivity.java
[ "public abstract class BaseActivity extends AppCompatActivity {\n\n @LayoutRes\n public abstract int findLayout();\n\n @Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(findLayout());\n ButterKnife.bind(...
import android.os.Bundle; import android.support.annotation.NonNull; import android.support.design.widget.BottomNavigationView; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.view.MenuItem; import com.mgilangjanuar.dev.goscele.R; import com.mgilangjanuar.dev.go...
package com.mgilangjanuar.dev.goscele.modules.main.view; /** * Created by mgilangjanuar (mgilangjanuar@gmail.com) * * @since 2017 */ public class MainActivity extends BaseActivity implements CheckLoginListener { @BindView(R.id.bottom_navigation) BottomNavigationView bottomNavigationView; private M...
redirect(AuthActivity.class, true);
1
f2prateek/dart
dart-processor/src/main/java/dart/processor/ExtraBinderGenerator.java
[ "public static final String DART_MODEL_SUFFIX = \"NavigationModel\";", "public class Dart {\n public static final String EXTRA_BINDER_SUFFIX = \"__ExtraBinder\";\n\n static final Map<Class<?>, Method> EXTRA_BINDERS = new LinkedHashMap<>();\n static final Map<Class<?>, Method> NAVIGATION_MODEL_BINDERS = new Lin...
import java.util.Collection; import java.util.List; import javax.lang.model.element.Modifier; import javax.lang.model.type.TypeMirror; import static dart.common.util.DartModelUtil.DART_MODEL_SUFFIX; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; i...
/* * Copyright 2013 Jake Wharton * Copyright 2014 Prateek Srivastava (@f2prateek) * * 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...
Collection<FieldBinding> fieldBindings = binding.getFieldBindings();
6
BottleRocketStudios/Android-Vault
AndroidVault/vault/src/main/java/com/bottlerocketstudios/vault/SharedPreferenceVaultFactory.java
[ "public class Aes256RandomKeyFactory {\n\n /**\n * Create a randomly generated AES256 key.\n */\n public static SecretKey createKey() {\n RandomKeyGenerator keyGenerator = new RandomKeyGenerator(new PrngSaltGenerator(), EncryptionConstants.AES_256_KEY_LENGTH_BITS);\n return keyGenerator....
import javax.crypto.SecretKey; import android.annotation.TargetApi; import android.app.KeyguardManager; import android.content.Context; import android.os.Build; import android.text.TextUtils; import com.bottlerocketstudios.vault.keys.generator.Aes256RandomKeyFactory; import com.bottlerocketstudios.vault.keys.storage.Co...
/* * Copyright (c) 2016. Bottle Rocket LLC * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or ...
KeyStorage keyStorage = CompatSharedPrefKeyStorageFactory.createKeyStorage(context, Build.VERSION.SDK_INT, keyFileName, keyAlias, keyIndex, EncryptionConstants.AES_CIPHER, presharedSecret, new PrngSaltGenerator());
2
googleads/adwords-scripts-linkchecker
src/main/java/com/google/adwords/scripts/solutions/linkchecker/datastore/Datastore.java
[ "@Cache\n@Entity\npublic class Account {\n @Id private String accountId;\n\n public Account() {}\n\n public Account(String accountId) {\n this.accountId = accountId;\n }\n\n public String getId() {\n return accountId;\n }\n}", "@Cache\n@Entity\npublic class BatchOperation {\n @Id private String batch...
import com.google.adwords.scripts.solutions.linkchecker.model.Account; import com.google.adwords.scripts.solutions.linkchecker.model.BatchOperation; import com.google.adwords.scripts.solutions.linkchecker.model.BatchSubOperation; import com.google.adwords.scripts.solutions.linkchecker.model.Settings; import com.google....
// Copyright 2017, Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
ObjectifyService.register(SharedKey.class);
4
wrey75/WaveCleaner
src/main/java/com/oxande/xmlswing/components/FrameUI.java
[ "public class AttributeDefinition {\r\n\t\r\n\tpublic final static Map<String, String> ALIGNS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CLOSE_OPERATIONS = new HashMap<String, String>();\r\n\tpublic final static Map<String, String> CURSORS = new HashMap<String, String>();\r\n\tpub...
import javax.swing.ImageIcon; import javax.swing.JFrame; import org.w3c.dom.Element; import com.oxande.xmlswing.AttributeDefinition; import com.oxande.xmlswing.AttributesController; import com.oxande.xmlswing.Parser; import com.oxande.xmlswing.AttributeDefinition.ClassType; import com.oxande.xmlswing.UnexpectedT...
package com.oxande.xmlswing.components; /** * Implementation of a Frame. You should never use * directly this class as the normal implementation * comes from the {@link JFrameUI} class. * * @author wrey75 * */ public class FrameUI extends WindowUI { public static final AttributeDefiniti...
public String parse(JavaClass jclass, JavaMethod initMethod, Element root ) throws UnexpectedTag{
7
flixel-gdx/flixel-gdx-box2d
flixel-gdx-box2d-examples/src/org/flxbox2d/examples/TestBreakable.java
[ "public class B2FlxB\n{\n\t/** \n\t * The ratio from meters to pixels. \n\t */\n\tpublic static final float RATIO = 32f;\n\t/**\n\t * The world where the object lives.\n\t */\n\tpublic static World world;\n\t/**\n\t * The contact manager.\n\t */\n\tpublic static B2FlxContactManager contact;\n\t/**\n\t * Let the wor...
import org.flxbox2d.B2FlxB; import org.flxbox2d.collision.shapes.B2FlxBox; import org.flxbox2d.collision.shapes.B2FlxShape; import org.flxbox2d.collision.shapes.B2FlxSprite; import org.flxbox2d.common.math.B2FlxMath; import org.flxbox2d.events.IB2FlxListener; import com.badlogic.gdx.math.Vector2; import com.badlogic.gd...
package org.flxbox2d.examples; /** * * @author Ka Wing Chin */ public class TestBreakable extends PlayState { private B2FlxShape _box; private Vector2 _velocity = new Vector2(); private float _angularVelocity; private B2FlxBox _shape1; private B2FlxBox _shape2; private Fixture _piece1; private Fixture _pie...
maxImpulse = B2FlxMath.max(maxImpulse, impulse.getNormalImpulses()[i]);
4
julianthome/inmemantlr
inmemantlr-api/src/test/java/TestMemObjects.java
[ "public class GenericParser {\n\n private static final Logger LOGGER = LoggerFactory.getLogger(GenericParser.class);\n\n public enum CaseSensitiveType {\n NONE,\n UPPER,\n LOWER\n }\n\n private InmemantlrTool antlr = new InmemantlrTool();\n private DefaultListener listener = new ...
import org.snt.inmemantlr.listener.DefaultTreeListener; import org.snt.inmemantlr.memobjects.MemoryByteCode; import org.snt.inmemantlr.memobjects.MemoryTuple; import org.snt.inmemantlr.memobjects.MemoryTupleSet; import org.snt.inmemantlr.utils.FileUtils; import java.io.File; import java.io.FileNotFoundException; import...
/** * Inmemantlr - In memory compiler for Antlr 4 * * The MIT License (MIT) * * Copyright (c) 2016 Julian Thome <julian.thome.de@gmail.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the S...
MemoryTupleSet set = gp.getAllCompiledObjects();
5
Tonius/SimplyJetpacks
src/main/java/tonius/simplyjetpacks/SimplyJetpacks.java
[ "public class Config {\n \n public static final List<Section> configSections = new ArrayList<Section>();\n private static final Section sectionItem = new Section(false, \"Item Settings\", \"item\");\n private static final Section sectionIntegration = new Section(false, \"Integration Settings\", \"integr...
import net.minecraftforge.oredict.RecipeSorter; import net.minecraftforge.oredict.RecipeSorter.Category; import org.apache.logging.log4j.Logger; import tonius.simplyjetpacks.config.Config; import tonius.simplyjetpacks.crafting.UpgradingRecipe; import tonius.simplyjetpacks.handler.SyncHandler; import tonius.simplyjetpac...
package tonius.simplyjetpacks; @Mod(modid = SimplyJetpacks.MODID, version = SimplyJetpacks.VERSION, dependencies = SimplyJetpacks.DEPENDENCIES, guiFactory = SimplyJetpacks.GUI_FACTORY) public class SimplyJetpacks { public static final String MODID = "simplyjetpacks"; public static final String VERSION ...
RecipeSorter.register(SimplyJetpacks.MODID + ":upgrading", UpgradingRecipe.class, Category.SHAPED, "after:minecraft:shaped");
1
IPEldorado/RemoteResources
src/com/eldorado/remoteresources/android/server/connection/Server.java
[ "public class AndroidDeviceClient implements Serializable {\n\n\tprivate static final long serialVersionUID = -4688390733043132636L;\n\n\t/**\n\t * The device serial number\n\t */\n\tprivate final String serialNumber;\n\n\t/**\n\t * The device model\n\t */\n\tprivate final String model;\n\n\t/**\n\t * The device cl...
import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.InetSocketAddress; import java.net.Socket; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; import com.andr...
/* * (C) Copyright 2014 Instituto de Pesquisas Eldorado (http://www.eldorado.org.br/). * * This file is part of the software Remote Resources * * All rights reserved. This file and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 3.0 which ...
GetDeviceListMessageType messageType) {
3
dxjia/DoubanTop
app/src/main/java/com/dxjia/doubantop/fragments/SwipeRefreshFragment.java
[ "public class ContentItemAdapter extends RecyclerView.Adapter<ContentItemAdapter.ViewHolder> {\n\n final private List<MovieInfoBean> mMoviesList;\n final private MovieInfoActionsListener mActionListener;\n\n public ContentItemAdapter(MovieInfoActionsListener l, List<MovieInfoBean> moviesList) {\n mA...
import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v4.widget.SwipeRefreshLayout; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.text.TextUtils; import android.view.View; import com.dxjia.doubantop.R;...
*/ private void sortListByScore() { if (mMoviesList == null || mMoviesList.size() <= 1) { return; } Collections.sort(mMoviesList, new Comparator<MovieInfoBean>() { @Override public int compare(MovieInfoBean lhs, MovieInfoBean rhs) { r...
new RetrofitCallback<>(mUpdateHandler, successCode, failCode, SearchResultEntity.class));
4
PedroGomes/TPCw-benchmark
TPCW_DOCM_Implementation/src/org/uminho/gsd/benchmarks/TPCW_CassandraOM/database_executor/TPCW_RDBMS_DatanucleusExecutorFactory.java
[ "public class BenchmarkExecutor {\n\n //Node id\n private BenchmarkNodeID nodeId;\n\n //Benchmark interfaces\n private AbstractWorkloadGeneratorFactory workloadInterface;\n private AbstractDatabaseExecutorFactory databaseInterface;\n\n /**\n * number of clients on each benchmarking node *\n ...
import org.uminho.gsd.benchmarks.benchmark.BenchmarkExecutor; import org.uminho.gsd.benchmarks.generic.helpers.NodeKeyGenerator; import org.uminho.gsd.benchmarks.helpers.TPM_counter; import org.uminho.gsd.benchmarks.interfaces.KeyGenerator; import org.uminho.gsd.benchmarks.interfaces.executor.AbstractDatabaseExecutorFa...
/* * ********************************************************************* * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. * All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy...
public TPCW_RDBMS_DatanucleusExecutorFactory(BenchmarkExecutor executor, String conf_file) {
0
onepf/OPFPush
opfpush/src/test/java/org/onepf/opfpush/mock/MockPushProvider.java
[ "public final class OPFPush {\n\n private static volatile OPFPushHelper helper;\n\n private OPFPush() {\n throw new UnsupportedOperationException();\n }\n\n /**\n * Returns the {@link org.onepf.opfpush.OPFPushHelper} instance.\n *\n * @return The {@link org.onepf.opfpush.OPFPushHelper...
import android.support.annotation.NonNull; import android.support.annotation.Nullable; import org.onepf.opfpush.OPFPush; import org.onepf.opfpush.listener.CheckManifestHandler; import org.onepf.opfpush.model.AvailabilityResult; import org.onepf.opfpush.model.PushError; import org.onepf.opfpush.notification.Notification...
package org.onepf.opfpush.mock; /** * @author antonpp * @since 14.04.15 */ @SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass") public final class MockPushProvider implements PushProvider { private final AvailabilityResult availabilityResult; private final String name; private final S...
return new OPFNotificationMaker();
5
LyashenkoGS/analytics4github
src/main/java/com/rhcloud/analytics4github/service/StargazersService.java
[ "public enum GitHubApiEndpoints {\n COMMITS, STARGAZERS\n}", "@ApiModel\npublic class RequestFromFrontendDto {\n @ApiParam(required = true, example = \"mewo2\", value = \"a repository author. Example: mewo2\")\n private String author;\n @ApiParam(required = true, example = \"terrain\", value = \"a rep...
import com.fasterxml.jackson.databind.JsonNode; import com.rhcloud.analytics4github.config.GitHubApiEndpoints; import com.rhcloud.analytics4github.dto.RequestFromFrontendDto; import com.rhcloud.analytics4github.dto.ResponceForFrontendDto; import com.rhcloud.analytics4github.exception.GitHubRESTApiException; import com....
package com.rhcloud.analytics4github.service; /** * @author lyashenkogs */ @Service public class StargazersService { private static Logger LOG = LoggerFactory.getLogger(StargazersService.class); @Autowired private RestTemplate template; public ResponceForFrontendDto stargazersFrequency(RequestFro...
GitHubApiIterator stargazersIterator = new GitHubApiIterator(requestFromFrontendDto.getAuthor() + "/" + requestFromFrontendDto.getRepository(), template, GitHubApiEndpoints.STARGAZERS);
0
xnx3/xunxian
xunxianAutoFight/src/Main.java
[ "public class Lang {\r\n\t\r\n\t/**\r\n\t * 字符型转换为整数型\r\n\t * <li>value:待转换的字符串\r\n\t * <li>errorNum:try异常后的返回值\r\n\t * @return\r\n\t */\r\n\tpublic int Integer_(String value,int errorNum){\r\n\t\tint xnx3_result=0;\r\n\t\t\r\n\t\t//首先判断字符串不能为空\r\n\t\tif(value==null||value.equalsIgnoreCase(\"null\")){\r\n\t\t\txnx3...
import javax.security.auth.callback.ConfirmationCallback; import javax.swing.JDialog; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import org.jvnet.substance.SubstanceLookAndFeel; import org.jvnet.substance.skin.BusinessBlackSteelSkin; import org.jvnet.substance.skin.Substance...
public class Main { public static void main(String[] args) { Command.JForm=new UI.Main(); Command.JForm.setVisible(true);
Command.jframeMessage=new Message();
2
HadoopGenomics/Hadoop-BAM
src/main/java/org/seqdoop/hadoop_bam/BAMInputFormat.java
[ "public class LinearBAMIndex extends CachingBAMFileIndex {\n\n public LinearBAMIndex(SeekableStream stream, SAMSequenceDictionary dict) {\n super(stream, dict);\n }\n \n public LinearIndex getLinearIndex(int idx) {\n return getQueryResults(idx).getLinearInde...
import htsjdk.samtools.AbstractBAMFileIndex; import htsjdk.samtools.BAMFileReader; import htsjdk.samtools.BAMFileSpan; import htsjdk.samtools.BAMIndex; import htsjdk.samtools.Chunk; import htsjdk.samtools.LinearBAMIndex; import htsjdk.samtools.LinearIndex; import htsjdk.samtools.QueryInterval; import htsjdk.samtools.SA...
// Copyright (c) 2010 Aalto University // // 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, publi...
return IntervalUtil.getIntervals(conf, INTERVALS_PROPERTY);
1
neuland/jade4j
src/test/java/de/neuland/jade4j/compiler/CompilerTagErrorTest.java
[ "public class JexlExpressionHandler implements ExpressionHandler {\n\n\tprivate static final int MAX_ENTRIES = 5000;\n\tpublic static Pattern plusplus = Pattern.compile(\"([a-zA-Z0-9-_]*[a-zA-Z0-9])\\\\+\\\\+\\\\s*;{0,1}\\\\s*$\");\n\tpublic static Pattern isplusplus = Pattern.compile(\"\\\\+\\\\+\\\\s*;{0,1}\\\\s*...
import static org.junit.Assert.*; import java.io.File; import java.io.IOException; import java.lang.reflect.Type; import java.util.HashMap; import java.util.Map; import de.neuland.jade4j.expression.JexlExpressionHandler; import org.apache.commons.io.FileUtils; import org.junit.Test; import com.google.gson.Gson; import ...
package de.neuland.jade4j.compiler; public class CompilerTagErrorTest { @Test(expected=Exception.class) public void testTagsWithErrors() { run("tags_with_errors"); } private void run(String testName) { run(testName, false); } private void run(String testName, boolean pre...
JadeModel model = new JadeModel(getModelMap(testName));
3
lsjwzh/FastTextView
app/src/main/java/com/wechat/testdemo/FastTextViewListTestFragment.java
[ "public class AutoScrollHandler {\n\n private ListView listView;\n\n private int itemCount;\n\n private Handler uiHandler = new Handler(Looper.getMainLooper());\n\n public AutoScrollHandler(ListView listView, int itemCount) {\n this.listView = listView;\n this.itemCount = itemCount;\n }\n\n public void ...
import android.content.Context; import android.os.Bundle; import android.os.SystemClock; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.util.Log; import android.util.TypedValue; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGrou...
package com.wechat.testdemo; public class FastTextViewListTestFragment extends Fragment { private ListView listView; private ListAdapter adapter;
private AutoScrollHandler autoScrollHandler;
0
uservoice/uservoice-android-sdk
UserVoiceSDK/src/com/uservoice/uservoicesdk/dialog/SigninDialogFragment.java
[ "public class Session {\n\n private static Session instance;\n\n public static synchronized Session getInstance() {\n if (instance == null) {\n instance = new Session();\n }\n return instance;\n }\n\n public static void reset() {\n instance = null;\n }\n\n pr...
import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.content.Context; import android.content.DialogInterface; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManage...
package com.uservoice.uservoicesdk.dialog; @SuppressLint("ValidFragment") public class SigninDialogFragment extends DialogFragmentBugfixed { private EditText emailField; private EditText nameField; private EditText passwordField; private View passwordFields; private Button forgotPassword; pr...
User.discover(getActivity(), emailField.getText().toString(), new Callback<User>() {
5
android10/arrow
src/main/java/com/fernandocejas/arrow/collections/MoreCollections.java
[ "public interface Predicate<T> {\n /**\n * Returns the result of applying this predicate to {@code input}. This method is <i>generally\n * expected</i>, but not absolutely required, to have the following properties:\n *\n * <ul>\n * <li>Its execution does not cause any observable side effects.\n * <li>...
import com.fernandocejas.arrow.functions.Predicate; import com.fernandocejas.arrow.strings.Joiner; import com.fernandocejas.arrow.strings.Strings; import java.util.Collection; import org.jetbrains.annotations.Nullable; import static com.fernandocejas.arrow.checks.Preconditions.checkNotNull; import static com.fernandoce...
/** * Copyright (C) 2007 The Guava Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agr...
checkNotNull(collection);
3
paphus/Project-Libre
android/src/com/paphus/sdk/activity/actions/HttpGetInstancesAction.java
[ "public class ChooseBotActivity extends Activity {\n\t\n\tpublic List<WebMediumConfig> instances;\n\tpublic WebMediumConfig instance;\n\n\t@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_choosebot);\n\t\t\n\t\tthis.instanc...
import java.util.List; import android.app.Activity; import android.content.Intent; import com.paphus.sdk.activity.ChooseBotActivity; import com.paphus.sdk.activity.ChooseDomainActivity; import com.paphus.sdk.activity.MainActivity; import com.paphus.sdk.activity.forum.ChooseForumActivity; import com.paphus.sdk.activity....
package com.paphus.sdk.activity.actions; public class HttpGetInstancesAction extends HttpUIAction { BrowseConfig config; List<WebMediumConfig> instances; public HttpGetInstancesAction(Activity activity, BrowseConfig config) { super(activity); this.config = config; } @Override protected String doInBackgr...
Intent intent = new Intent(this.activity, ChooseForumActivity.class);
3
trustsystems/elfinder-java-connector
src/main/java/br/com/trustsystems/elfinder/command/ArchiveCommand.java
[ "public final class ElFinderConstants {\n\n //global constants\n public static final int ELFINDER_TRUE_RESPONSE = 1;\n public static final int ELFINDER_FALSE_RESPONSE = 0;\n\n //options\n public static final String ELFINDER_VERSION_API = \"2.1\";\n\n //security\n // regex that matches any chara...
import br.com.trustsystems.elfinder.ElFinderConstants; import br.com.trustsystems.elfinder.core.Target; import br.com.trustsystems.elfinder.service.ElfinderStorage; import br.com.trustsystems.elfinder.service.VolumeHandler; import br.com.trustsystems.elfinder.support.archiver.Archiver; import br.com.trustsystems.elfind...
/* * #%L * %% * Copyright (C) 2015 Trustsystems Desenvolvimento de Sistemas, LTDA. * %% * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice...
Object[] archiveInfos = {getTargetInfo(request, new VolumeHandler(targetArchive, elfinderStorage))};
3
mauersu/redis-admin
src/main/java/com/mauersu/controller/ZSetConroller.java
[ "public class WorkcenterResponseBodyJson implements ResponseBody , WebConstant{\n\t\n\tpublic final String returncode; //200 success 500 server-error 600 business-exception\n\tpublic final String returnmsg; \n\tpublic final String returnmemo;//{SUCCESS/FAILURE}:{errorcode}:{errormsg}\n\tpublic final Object data;/...
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.Requ...
package com.mauersu.controller; @Controller @RequestMapping("/zset") public class ZSetConroller extends RedisApplication implements Constant { @Autowired
private ZSetService zsetService;
3
beckchr/juel
modules/impl/src/main/java/de/odysseus/el/tree/impl/ast/AstIdentifier.java
[ "public abstract class ELContext {\r\n\tprivate Map<Class<?>, Object> context;\r\n\tprivate Locale locale;\r\n\tprivate boolean resolved;\r\n\r\n\t/**\r\n\t * Returns the context object associated with the given key. The ELContext maintains a\r\n\t * collection of context objects relevant to the evaluation of an ex...
import de.odysseus.el.tree.IdentifierNode; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; import javax.el.ELContext; import javax.el.ELException; import javax.el.MethodExpression; import javax.el.MethodInfo; import javax.el.MethodNotFoundException; ...
throw new PropertyNotFoundException(LocalMessages.get("error.identifier.property.notfound", name)); } return result; } public boolean isLeftValue() { return true; } public boolean isMethodInvocation() { return false; } public boolean isLiteralText() { return false; } public ...
public MethodInfo getMethodInfo(ELContext context) {
1
matthewhorridge/owlexplanation
src/main/java/org/semanticweb/owl/explanation/impl/blackbox/checker/BlackBoxExplanationGeneratorFactory.java
[ "public interface ExplanationGenerator<E> {\n\n /**\n * Gets explanations for an entailment. All explanations for the entailment will be returned.\n *\n * @param entailment The entailment for which explanations will be generated.\n * @return A set containing all of the explanations. The set wil...
import org.semanticweb.owl.explanation.api.ExplanationGenerator; import org.semanticweb.owl.explanation.api.ExplanationGeneratorFactory; import org.semanticweb.owl.explanation.api.ExplanationProgressMonitor; import org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2; import org.semanticweb.owl.e...
package org.semanticweb.owl.explanation.impl.blackbox.checker; /* * Copyright (C) 2008, University of Manchester * * Modifications to the initial code base are copyright of their * respective authors, or their employers as appropriate. Authorship * of the modifications may be determined from the ChangeLog place...
public ExplanationGenerator<E> createExplanationGenerator(OWLOntology ontology) {
0
haodynasty/AndroidBleManager
bluetooth-manager-lib/src/main/java/com/blakequ/bluetooth_manager_lib/connect/multiple/ConnectRequestQueue.java
[ "@TargetApi(18)\npublic final class BleManager {\n private static BleParamsOptions configOptions;\n private BleManager(){\n }\n\n public static BleParamsOptions getBleParamsOptions(){\n if (configOptions == null){\n setBleParamsOptions(BleParamsOptions.createDefault());\n }\n ...
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothGatt; import android.content.Context; import android.os.Looper; import android.os.SystemClock; import com.blakequ.bluetooth_manager_lib.BleManager; import com.blakequ.bluetooth_manager_lib.BleParamsOpt...
package com.blakequ.bluetooth_manager_lib.connect.multiple; /** * Copyright (C) BlakeQu All Rights Reserved <blakequ@gmail.com> * <p/> * Licensed under the blakequ.com License, Version 1.0 (the "License"); * Unless required by applicable law or agreed to in writing, software * distributed under the License is ...
private Map<String, ConnectState> macMap;//<mac address, is connected>
3
gems-uff/prov-viewer
src/main/java/br/uff/ic/provviewer/GUI/GuiInitialization.java
[ "public class Collapser {\n\n /**\n * Method for resetting the Graph to the original state\n *\n * @param variables Variables type\n */\n public void ResetGraph(Variables variables) {\n //Reset graph to the original version\n variables.layout.setGraph(variables.graph);\n f...
import br.uff.ic.utility.Utils; import edu.uci.ics.jung.graph.DirectedGraph; import edu.uci.ics.jung.visualization.control.DefaultModalGraphMouse; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.ToolTipManager; import br.uff.ic.provviewer.Collapser; import br.uff.ic.utility.graph.Edge; impor...
/* * The MIT License * * Copyright 2017 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...
PanCameraToFirstVertex(variables);
4
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/activities/Staff/SearchVehicleActivity.java
[ "public interface CarRentalApiClient {\n /**\n * Return the list of available branches\n *\n * @return list of branches\n * @throws ApiUnauthorizedException if the request wasn't authenticated or authorized\n * @throws ApiException if there was a general error during the request if there was ...
import android.app.ProgressDialog; import android.content.Intent; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.E...
/** * CarRental * * This activity displays a form to search vehicles in the current branch either by registration number or type */ package com.vehiclerental.activities.Staff; public class SearchVehicleActivity extends AppCompatActivity { //public message passing keys public final static String VEHIC...
private CarRentalApiClient apiClient = CarRentalApiClientFactory.getApiClient();
1
yahoo/squidb
squidb-processor/src/com/yahoo/squidb/processor/plugins/PluginEnvironment.java
[ "public abstract class ModelSpec<T extends Annotation> {\n\n protected final T modelSpecAnnotation;\n protected final DeclaredTypeName generatedClassName;\n protected final DeclaredTypeName modelSpecName;\n protected final TypeElement modelSpecElement;\n\n private final List<PropertyGenerator> proper...
import com.yahoo.aptutils.utils.AptUtils; import com.yahoo.squidb.processor.data.ModelSpec; import com.yahoo.squidb.processor.plugins.defaults.AndroidModelPlugin; import com.yahoo.squidb.processor.plugins.defaults.ConstantCopyingPlugin; import com.yahoo.squidb.processor.plugins.defaults.ConstructorPlugin; import com.ya...
/* * Copyright 2015, Yahoo Inc. * Copyrights licensed under the Apache 2.0 License. * See the accompanying LICENSE file for terms. */ package com.yahoo.squidb.processor.plugins; /** * This class maintains a list of known/enabled {@link Plugin} classes. Plugins available by default include * {@link Constructor...
normalPriorityPlugins.add(ViewModelSpecFieldPlugin.class);
8
wuyisheng/libRtmp
app/src/main/java/org/yeshen/video/librtmp/unstable/tools/AndroidUntil.java
[ "public class App extends Application {\n\n public static App ins;\n\n public static App getInstance() {\n return ins;\n }\n\n public static Context getContext() {\n return ins.getApplicationContext();\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n ...
import android.annotation.TargetApi; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.graphics.ImageFormat; import android.hardware.Camera; import android.media.AudioFormat; import android.media.AudioManager; import android.media.AudioRecord; import android.media.MediaCodec; ...
package org.yeshen.video.librtmp.unstable.tools; /********************************************************************* * Created by yeshen on 2017/05/25. * Copyright (c) 2017 yeshen.org. - All Rights Reserved *********************************************************************/ @SuppressWarnings("deprecation"...
throws CameraNotSupportException {
3
fhissen/CrococryptFile
CrococryptFile/main/org/crococryptfile/datafile/DumpWriter.java
[ "public class CountingOutputStream extends OutputStream {\r\n\tprivate long no = 0;\r\n\tprivate long len = 0;\r\n\tprivate OutputStream os;\r\n\t\r\n\tpublic CountingOutputStream(OutputStream os){\r\n\t\tthis.os = os;\r\n\t}\r\n\t\r\n\tpublic void setStartNo(long n){\r\n\t\tno = n;\r\n\t}\r\n\r\n\t@Override\r\n\tp...
import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.zip.Deflater; import java.util.zip.DeflaterOutputStream; import org.crococryptfile.streams.CountingOutputStream; import org....
package org.crococryptfile.datafile; public class DumpWriter { private CountingOutputStream mainstream;
private Suite icroc;
1
syvaidya/openstego
src/main/java/com/openstego/desktop/plugin/dwtkim/DWTKimPlugin.java
[ "public class OpenStegoException extends Exception {\n private static final long serialVersionUID = 668241029491685413L;\n\n /**\n * Error Code - Unhandled exception\n */\n static final int UNHANDLED_EXCEPTION = 0;\n\n /**\n * Map to store error code to message key mapping\n */\n priv...
import com.openstego.desktop.OpenStegoException; import com.openstego.desktop.plugin.template.image.WMImagePluginTemplate; import com.openstego.desktop.util.ImageHolder; import com.openstego.desktop.util.ImageUtil; import com.openstego.desktop.util.LabelUtil; import com.openstego.desktop.util.StringUtil; import com.ope...
/* * Steganography utility to hide messages into cover files * Author: Samir Vaidya (mailto:syvaidya@gmail.com) * Copyright (c) Samir Vaidya */ package com.openstego.desktop.plugin.dwtkim; /** * Plugin for OpenStego which implements the DWT based algorithm by Kim. * <p> * This class is based on the code prov...
DWT dwt;
6
jitsi/otr4j
src/main/java/net/java/otr4j/session/OtrSm.java
[ "public interface OtrEngineHost {\n\tvoid injectMessage(SessionID sessionID, String msg)\n\t\t\tthrows OtrException;\n\n\tvoid unreadableMessageReceived(SessionID sessionID)\n\t\t\tthrows OtrException;\n\n\tvoid unencryptedMessageReceived(SessionID sessionID,\n\t\t\tString msg) throws OtrException;\n\n\tvoid showEr...
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.PublicKey; import java.util.ArrayList; import java.util.List; import net.jav...
package net.java.otr4j.session; /** * Socialist Millionaire Protocol handler. */ public class OtrSm { private SMState smstate; private final OtrEngineHost engineHost; private final Session session; /** * Construct an OTR Socialist Millionaire handler object. * * @param session The session referenc...
smpmsg = SM.step1(smstate, combinedSecret);
2
Kuanghusing/Weather
app/src/main/java/com/kuahusg/weather/Presenter/WeatherFragPresenterImpl.java
[ "public abstract class BasePresenter implements IBasePresenter {\n\n private IBaseView mView;\n // private IDataSource dataSource;\n private WeakReference<IDataSource> dataSourceWeakReference;\n\n public BasePresenter(IBaseView view) {\n this.mView = view;\n }\n\n public IBaseView getVie...
import android.content.Context; import android.content.Intent; import android.net.Uri; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.kuahusg.weather.Presenter.base.BasePresenter; import com.kuahusg.weather.Presenter.interfaceOfPresenter.IWeatherMainFragPresenter; import com.kuahusg.weathe...
package com.kuahusg.weather.Presenter; /** * Created by kuahusg on 16-9-29. */ public class WeatherFragPresenterImpl extends BasePresenter implements IWeatherMainFragPresenter { private IWeatherFragView mView;
public WeatherFragPresenterImpl(IBaseView view) {
2
jgilfelt/Novocation
core/src/main/java/com/novoda/location/provider/LocationUpdateManager.java
[ "public interface Constants {\n\t\n boolean USE_GPS = true;\n boolean REFRESH_DATA_ON_LOCATION_CHANGED = true;\n boolean ENABLE_PASSIVE_UPDATES = false;\n \n int UPDATES_MAX_DISTANCE = 100;\n long UPDATES_MAX_TIME = 5 * 60 * 1000;\n\t\n long DEFAULT_INTERVAL_PASSIVE = 15 * 60 * 1000;\n\tint DEF...
import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.location.Criteria; import android.location.Location; import android.location.LocationManager; import android.os.AsyncTask; import com.novoda.location.Constants; import com.novoda.location.LocatorSettings; imp...
/** * Copyright 2011 Novoda Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
if (ApiLevelDetector.supportsFroyo() && settings.shouldEnablePassiveUpdates()) {
5
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/tests/TestAll.java
[ "public class Equation3nd {\n /**\n * This code find the root by solve the non linear equation:\n * let x in R / [-10, +10] \n * \n * subject to:\n * \n * x^3 - 6x^2 + 11x - 6 = 0\n * \n * \n * @param args\n * @throws IloException \n */\n public static void main(S...
import minlp.samples.non_linear.Equation3nd; import minlp.samples.non_linear.Equation4nd; import minlp.samples.basic.Misture; import minlp.samples.non_linear.NonLinearProd; import minlp.samples.medium.TSP;
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package minlp.tests; /** * * @author Marcio */ public class TestAll { public static void main(String[] args) throws Exception ...
Misture.main(args);
2
petitparser/java-petitparser
petitparser-xml/src/test/java/org/petitparser/grammar/xml/XmlEntityTest.java
[ "public static String encodeXmlAttributeValue(String input) {\n // only \" needs to be encoded in attribute value\n return input.replaceAll(\"\\\"\", \"&quot;\");\n}", "public static String encodeXmlText(String input) {\n // only & and < need to be encoded in text\n return input.replace(\"&\", \"&amp;\").repl...
import static org.junit.Assert.assertEquals; import static org.petitparser.grammar.xml.XmlCharacterParser.encodeXmlAttributeValue; import static org.petitparser.grammar.xml.XmlCharacterParser.encodeXmlText; import org.junit.Test; import org.petitparser.grammar.xml.ast.XmlDocument; import org.petitparser.grammar.xml.ast...
package org.petitparser.grammar.xml; /** * Tests entity encoding and decoding. */ public class XmlEntityTest { private final Parser parser = new XmlParser(); private String decode(String input) {
XmlDocument document = parser.parse("<data>" + input + "</data>").get();
2
confluentinc/rest-utils
core/src/test/java/io/confluent/rest/KafkaExceptionMapperTest.java
[ "public class ErrorMessage {\n\n private int errorCode;\n private String message;\n\n public ErrorMessage(\n @JsonProperty(\"error_code\") int errorCode,\n @JsonProperty(\"message\") String message\n ) {\n this.errorCode = errorCode;\n this.message = message;\n }\n\n @JsonProperty(\"error_code...
import io.confluent.rest.entities.ErrorMessage; import io.confluent.rest.exceptions.KafkaExceptionMapper; import org.apache.kafka.clients.consumer.CommitFailedException; import org.apache.kafka.common.errors.AuthenticationException; import org.apache.kafka.common.errors.AuthorizationException; import org.apache.kafka.c...
/* * Copyright 2019 Confluent Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to i...
KAFKA_AUTHENTICATION_ERROR_CODE);
3
frizbog/gedantic
src/main/java/org/gedantic/web/servlet/AnalyzerServlet.java
[ "public class AnalysisResult {\n\n /**\n * The thing *about* the object that had an issue (Attribute, Source, etc)\n */\n protected final String aspectOfItemWithIssue;\n\n /**\n * The type of object that had an issue (Individual, Family, etc)\n */\n protected final String typeOfItemWithI...
import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.apache.commons.lang.StringEscapeUtils; import org.apache.poi.ss.usermodel.Workbook; import org.geda...
/* * Copyright (c) 2016 Matthew R. Harrah * * MIT License * * 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, * c...
List<AnalysisResult> results = a.analyze(g);
0
taoneill/war
war/src/main/java/com/tommytony/war/mapper/WarzoneYmlMapper.java
[ "public class Team {\n\tprivate final Warzone warzone;\n\tRandom teamSpawnRandomizer = new Random();\n\tprivate List<Player> players = new ArrayList<Player>();\n\tprivate List<Player> teamChatPlayers = new ArrayList<Player>();\n\tprivate List<Location> teamSpawns;\n\tprivate Location teamFlag = null;\n\tprivate Str...
import com.tommytony.war.Team; import com.tommytony.war.War; import com.tommytony.war.Warzone; import com.tommytony.war.config.TeamConfig; import com.tommytony.war.config.TeamKind; import com.tommytony.war.config.WarzoneConfig; import com.tommytony.war.structure.*; import com.tommytony.war.utility.Direction; import com...
package com.tommytony.war.mapper; public class WarzoneYmlMapper { public static Warzone load(String name) { // removed createNewVolume, as it did nothing
File warzoneTxtFile = new File(War.war.getDataFolder().getPath() + "/warzone-" + name + ".txt");
1
Aevi-UK/android-pos-print-api
PrintingExample/src/main/java/com/aevi/example/print/PrintingActivity.java
[ "public class PrinterApi {\n\n public static PrinterManager getPrinterManager(Context context) {\n return new PrinterManagerImpl(context);\n }\n}", "public interface PrinterManager {\n\n /**\n * @return True if the printing service is installed and available\n */\n boolean isPrinterServ...
import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.Spinner; import android.widget.TextView; import android.widg...
package com.aevi.example.print; public class PrintingActivity extends AppCompatActivity { static final Setter<View, Boolean> ENABLED = (view, value, index) -> view.setEnabled(value); private static final String TAG = PrintingActivity.class.getSimpleName(); private static final String KEY_POS_STORE =...
printerStatusDisposable = printerManager.status(printerId).subscribe(new Consumer<PrinterStatus>() {
6
lrtdc/light_drtc
src/main/java/org/light/rtc/timer/AdminNodeTimer.java
[ "public class AdminNodeService {\n\tprivate String[] jobNodeHosts = Constants.jobNodeHosts.split(\",\");\n\tprivate int jobNodeNum = jobNodeHosts.length;\n\tprivate ConcurrentHashMap<Integer,LrtdcClient> jobNodeClientMap;\n\tprivate List<String> userActions;\n\tprivate final SimpleDateFormat timeNumSdf = new Simple...
import java.util.List; import java.util.TimerTask; import java.util.TreeMap; import java.util.concurrent.ConcurrentLinkedQueue; import org.light.rtc.admin.AdminNodeService; import org.light.rtc.base.StreamLogParser; import org.light.rtc.util.ConfigProperty; import org.light.rtc.util.Constants; import org.light....
package org.light.rtc.timer; public class AdminNodeTimer extends TimerTask{ protected FileUtil fu = new FileUtil(); protected static ConcurrentLinkedQueue<String> dataQu = new ConcurrentLinkedQueue<String>(); private static TreeMap<Long,Integer> delayTaskIdDataNums = new TreeMap<Long,Integer>(); protecte...
System.out.println(ConfigProperty.getCurDateTime()+" curLogNum : "+curLogNum);
2
mleoking/LeoTask
leotask/src/app/org/leores/demo/DelimitedReaderDemo.java
[ "public class DelimitedReader extends Logger {\r\n\tprotected static String DEF_DELIMITER = \",\";\r\n\tprotected static String DEF_BEFORE = \"\\\"\";\r\n\tprotected static String DEF_AFTER = \"\\\"\";\r\n\r\n\tprotected BufferedReader bufReader;\r\n\tprotected String delimiter;\r\n\tprotected String before;\r\n\tp...
import java.io.FileNotFoundException; import java.util.List; import org.leores.util.DelimitedReader; import org.leores.util.Logger; import org.leores.util.U; import org.leores.util.able.Processable1; import org.leores.util.data.DataTable;
package org.leores.demo; public class DelimitedReaderDemo extends Demo { String sFile = "dreader.csv"; public void delimitedReader() { String[] rowToStart1 = { "data", "start1" }; String[] columnsToRead = { "c4", "c1" }; String[] rowToEnd = { "data", "end" }; String[] rowToStart2 = { "data", "s...
log("Read from file directly but stops at: " + U.toStr(rowToEnd));
2
yammer/breakerbox
breakerbox-azure/src/test/java/com/yammer/breakerbox/azure/model/tests/ServiceEntityTest.java
[ "public class TableClient {\n\n private final CloudTableClient cloudTableClient;\n private static final Logger LOG = LoggerFactory.getLogger(TableClient.class);\n\n public TableClient(CloudTableClient cloudTableClient) {\n this.cloudTableClient = checkNotNull(cloudTableClient, \"cloudTableClient can...
import com.yammer.breakerbox.azure.TableClient; import com.yammer.breakerbox.azure.TableClientFactory; import com.yammer.breakerbox.azure.model.ServiceEntity; import com.yammer.breakerbox.azure.tests.TableClientTester; import com.yammer.breakerbox.azure.tests.WithConfiguration; import com.yammer.breakerbox.store.Depend...
package com.yammer.breakerbox.azure.model.tests; public class ServiceEntityTest extends WithConfiguration { private ServiceId testServiceId; private DependencyId testDependencyId; private TableClient tableClient;
private TableClientTester tableClientTester;
3
TranquilMarmot/spaceout
src/com/bitwaffle/spaceout/entities/passive/AsteroidField.java
[ "public class Entities {\n\t/** player instance */\n\tpublic static Player player;\n\t/** camera instance */\n\tpublic static Camera camera;\n\t/** the skybox */\n\tpublic static Skybox skybox;\n\n\t/** all the current passive entities */\n\tpublic static ArrayList<Entity> passiveEntities = new ArrayList<Entity>(10...
import java.util.ArrayList; import java.util.Random; import java.util.Stack; import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Matrix4f; import org.lwjgl.util.vector.Quaternion; import org.lwjgl.util.vector.Vector3f; import com.bitwaffle.spaceguts.entities.Entities; import com.bitwaffle.spaceguts.entities.Enti...
package com.bitwaffle.spaceout.entities.passive; /** * Creates asteroids on a timer and keeps em all within a given box * @author TranquilMarmot */ public class AsteroidField extends Entity{ /** Random number generator */ private Random randy; /** List of all asteroids */ private ArrayList<Asteroid> astero...
Render3D.program.setUniform("Light.LightEnabled", false);
2
psidnell/ofexport2
src/test/java/org/psidnell/omnifocus/visitor/TraverserTest.java
[ "public class ApplicationContextFactory {\n\n public static final String CONFIG_XML = \"/config.xml\";\n private static final String CONFIG_PROPERTIES = \"/config.properties\";\n\n public static ApplicationContext getContext() {\n return new ClassPathXmlApplicationContext(CONFIG_XML);\n }\n\n ...
import static org.junit.Assert.assertSame; import static org.junit.Assert.fail; import java.util.LinkedList; import org.easymock.EasyMock; import org.junit.Before; import org.junit.Test; import org.psidnell.omnifocus.ApplicationContextFactory; import org.psidnell.omnifocus.model.Context; import org.psidnell.omnifocus.m...
/* * Copyright 2015 Paul Sidnell * * 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...
Task parent = nodeFactory.createTask("t");
5
xpush/lib-xpush-android
sample/src/main/java/io/xpush/sampleChat/fragments/ProfileFragment.java
[ "public class Constants {\n public static final int REQUEST_SIGNUP = 100;\n\n public static final int REQUEST_EDIT_IMAGE = 111;\n public static final int REQUEST_EDIT_NICKNAME = 112;\n public static final int REQUEST_EDIT_STATUS_MESSAGE = 113;\n\n public static final int REQUEST_INVITE_USER = 201;\n\...
import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.AsyncTask; 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.TextView; import com.fa...
package io.xpush.sampleChat.fragments; public class ProfileFragment extends Fragment { private String TAG = ProfileFragment.class.getSimpleName(); private Context mActivity; private XPushSession mSession; private JSONObject mJsonUserData; @Bind(R.id.nickname_button) View mNicknameButton;...
Intent localIntent = new Intent(mActivity, EditNickNameActivity.class);
4
criticalmaps/criticalmaps-android
app/src/main/java/de/stephanlindauer/criticalmaps/service/ServerSyncService.java
[ "public class App extends Application {\n\n private static AppComponent appComponent;\n\n public static AppComponent components() {\n return appComponent;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n if (BuildConfig.DEBUG) {\n Timber.plant(new T...
import android.app.Service; import android.content.Intent; import android.os.IBinder; import androidx.core.content.ContextCompat; import com.squareup.otto.Subscribe; import java.util.Timer; import java.util.TimerTask; import javax.inject.Inject; import javax.inject.Provider; import de.stephanlindauer.criticalmaps.App; ...
package de.stephanlindauer.criticalmaps.service; public class ServerSyncService extends Service { @SuppressWarnings("FieldCanBeLocal") private final int SERVER_SYNC_INTERVAL = 12 * 1000; // 12 sec -> 5 times a minute private Timer timerPullServer; @Inject LocationUpdateManager locationUpda...
App.components().inject(this);
0
graywolf336/Jail
src/main/java/com/graywolf336/jail/JailTimer.java
[ "public class Jail {\n private JailMain plugin;\n private boolean enabled;\n private HashMap<String, Cell> cells;\n private HashMap<UUID, Prisoner> nocellPrisoners;//prisoners who aren't in a cell\n private String name = \"\", world = \"\";\n private int minX, minY, minZ, maxX, maxY, maxZ;\n pr...
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.Timer; import org.bukkit.entity.Player; import com.graywolf336.jail.beans.Jail; import com.graywolf336.jail.beans.Prisoner; import com.graywolf336.jail.enums.Lang; import com.graywolf336.jail.enums.Settings; import com.graywolf3...
package com.graywolf336.jail; /** * Contains all the logic for counting down the time of the prisoners time. * * @author graywolf336 * @since 2.x.x * @version 3.0.0 */ public class JailTimer { private JailMain pl; private Timer timer; private Long lastTime; private Long afkTime = 0L; pr...
afkTime = Util.getTime(pl.getConfig().getString(Settings.MAXAFKTIME.getPath()));
3
sonyxperiadev/gerrit-events
src/main/java/com/sonymobile/tools/gerrit/gerritevents/dto/attr/Provider.java
[ "public static final String NAME = \"name\";", "public static final String HOST = \"host\";", "public static final String PORT = \"port\";", "public static final String PROTOCOL = \"proto\";", "public static final String SCHEME = \"scheme\";", "public static final String URL = \"url\";", "public static ...
import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.URL; import static com.sonymobile.tools.gerrit.gerritevents.dto.GerritEventKeys.VERSION; import com.sonymobile.tools.gerrit.gerritevents.GerritConnection; import net.sf.json.JSONObject; import com.sonymobile.tools.gerrit.gerritevents.dto.GerritJ...
/* * The MIT License * * Copyright 2013 rinrinne. All rights reserved. * Copyright 2013 Sony Mobile Communications AB. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in ...
url = getString(json, URL);
5
StumbleUponArchive/hbase
src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
[ "public final class HConstants {\n /**\n * Status codes used for return values of bulk operations.\n */\n public enum OperationStatusCode {\n NOT_RUN,\n SUCCESS,\n BAD_FAMILY,\n SANITY_CHECK_FAILURE,\n FAILURE;\n }\n\n /** long constant for zero */\n public static final Long ZERO_L = Long.va...
import java.io.EOFException; import java.io.IOException; import java.io.InterruptedIOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.text.ParseException; import java.util.Abstra...
} /** * Struct-like class that tracks the progress of a batch operation, * accumulating status codes and tracking the index at which processing * is proceeding. */ private static class BatchOperationInProgress<T> { T[] operations; int nextIndexToProcess = 0; OperationStatus[] retCodeDetai...
batchOp.retCodeDetails[i] = new OperationStatus(OperationStatusCode.FAILURE,
1
JCERTIFLab/jcertif-android-2013
src/main/java/com/jcertif/android/fragments/SpeakerDetailFragment.java
[ "public class SpeakerAdapter extends GenericListAdapter<Speaker> {\n\n\tViewHolder holder;\n\tSession session;\n\tprivate int selectedIndex = -1;\n\tprivate int selectedColor;\n\t\n\n\tpublic SpeakerAdapter(Context context, SpeedScrollListener scrollListener,\n\t\t\tList<Speaker> items) {\n\t\tsuper(context, scroll...
import java.util.ArrayList; import java.util.List; import android.content.Intent; import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import and...
/* * Copyright 2013 JCertifLab. * * 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...
private SpeakerAdapter mAdapter;
0
CBSkarmory/AWGW
src/main/java/cbskarmory/units/land/AntiAir.java
[ "public class Player {\n\n public static int numberOfPlayers;\n public final CO CO;\n public final int id;\n private ArrayList<Unit> unitsControlled;\n private int money;\n private ArrayList<Property> propertiesOwned;\n private int commTowers;\n private Color teamColor;\n\n /**\n * Co...
import cbskarmory.Player; import cbskarmory.PassiveFlag.MoveType; import cbskarmory.terrain.Terrain; import cbskarmory.units.HiddenUnit; import cbskarmory.units.Unit; import cbskarmory.weapons.WeaponType;
/* * Copyright(c) 2017 CBSkarmory (https://github.com/CBSkarmory) * * This code 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. * * This code is distributed in the hope that it will be useful, * but WI...
return hypothetical.getDistanceTo((Terrain) toCheck.getLocation()) == 1 && !(toCheck instanceof HiddenUnit) && !MoveType.SEA.equals(toCheck.getMovementType());
1
yuxiangping/mongodb-orm
src/main/java/org/yy/mongodb/orm/builder/dynamic/ListFunction.java
[ "public class ORM {\r\n\r\n private ORM() {}\r\n\r\n /**\r\n * XML file namespace\r\n */\r\n public static final String TAG_NAMESPACE = \"namespace\";\r\n /**\r\n * XML file orm id\r\n */\r\n public static final String TAG_ORM_ID = \"id\";\r\n\r\n /**\r\n * XML file orm db collection\r\n */\r\n p...
import java.util.ArrayList; import java.util.List; import java.util.Properties; import org.apache.commons.lang3.StringUtils; import org.w3c.dom.Node; import org.yy.mongodb.constant.ORM; import org.yy.mongodb.exception.StatementException; import org.yy.mongodb.orm.engine.entry.ColumnType; import org.yy.mongodb.o...
package org.yy.mongodb.orm.builder.dynamic; /** * Dynamic list function. * @author yy */ public class ListFunction implements Function { @Override public void init(Node node, Class<?> clazz, Dynamic dynamic) { Properties attribute = NodeletUtils.parseAttributes(node); String text = nod...
String type = attribute.getProperty(ORM.TAG_TYPE);
0
protovis/protovis-java
protovis-benchmarks/src/pv/benchmark/render/RenderingBenchmark.java
[ "public interface Benchmark {\n\tpublic String name();\n\tpublic void setup();\n\tpublic void takedown();\n\tpublic long[] run(int iterations);\n}", "public class BenchmarkRunner {\n\n\tpublic static BenchmarkRunner instance = new BenchmarkRunner();\n\t\n\tprivate PrintStream out = System.out;\n\tprivate int iter...
import java.util.ArrayList; import java.util.List; import javax.swing.JFrame; import pv.benchmark.Benchmark; import pv.benchmark.BenchmarkRunner; import pv.benchmark.SceneBenchmark; import pv.mark.Scene; import pv.mark.constants.MarkType; import pv.render.awt.CameraControl; import pv.render.awt.gl.GLDisplay; import pv....
package pv.benchmark.render; public class RenderingBenchmark { public static void main(String[] args) { new RenderingBenchmark(); } private static class PDisplay extends GLDisplay { private static final long serialVersionUID = -5204253651992453979L; public void setRenderer(GLRenderer r) { _renderer =...
BenchmarkRunner.instance.iterations(101);
1
sysnetlab/SensorDataCollector
SensorDataCollector.UnitTest/src/sysnetlab/android/sdc/test/RunExperimentFunctionTests.java
[ "public class Experiment implements Parcelable {\r\n private DeviceInformation mDeviceInfo; // on what device?\r\n private String mName;\r\n private Date mDateTimeCreated;\r\n private Date mDateTimeDone;\r\n private List<Tag> mTags;\r\n private List<Note> mNotes;\r\n private List<TaggingAction>...
import java.util.List; import sysnetlab.android.sdc.R; import sysnetlab.android.sdc.datacollector.Experiment; import sysnetlab.android.sdc.datacollector.ExperimentManager; import sysnetlab.android.sdc.datacollector.ExperimentManagerSingleton; import sysnetlab.android.sdc.datastore.StoreSingleton; import sysnetlab...
/* * Copyright (c) 2014, the SenSee authors. Please see the AUTHORS file * for details. * * Licensed under the GNU Public License, Version 3.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.gnu.org/copyl...
ExperimentListFragment experimentListFragment = null;
4
utapyngo/owl2vcs
src/main/java/owl2vcs/changeset/FullChangeSet.java
[ "public class AddPrefixData extends PrefixChangeData {\r\n\r\n private static final long serialVersionUID = 2801228470061214801L;\r\n\r\n public AddPrefixData(String prefixName, String prefix) {\r\n super(prefixName, prefix);\r\n }\r\n\r\n @Override\r\n public <R, E extends Exception> R accept...
import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxOntologyFormat; import org.semanticweb.owlapi.change.AddAxiomData; ...
package owl2vcs.changeset; public class FullChangeSet extends ChangeSet { private final OWLOntology parent; public OWLOntology getParent() { return parent; } private final OWLOntology child; public OWLOntology getChild() { return child; } /** ...
OWLOntology modifiedParent = OntologyUtils.copyOntology(parent);
6
Rubentxu/DreamsLibGdx
core/src/main/java/com/rubentxu/juegos/core/utils/dermetfan/box2d/Box2DMapObjectParser.java
[ "public class Box2dObjectFactory {\n\n\n private com.rubentxu.juegos.core.modelo.World world;\n private World physics;\n private ResourcesManager resourcesManager;\n private float unitScale;\n\n public Box2dObjectFactory(World physics, com.rubentxu.juegos.core.modelo.World world, ResourcesManager res...
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.maps.Map; import com.badlogic.gdx.maps.MapLayer; import com.badlogic.gdx.maps.MapObject; import com.badlogic.gdx.maps.MapObjects; import com.badlogic.gdx.maps.MapProperties; import com.badlogic.gdx.maps.objects.CircleMapObject; import com.badlogic.gdx.maps.obj...
public Fixture createFixture(MapObject mapObject) { MapProperties properties = mapObject.getProperties(); String type = properties.get("type", String.class); Body body = bodies.get(type.equals(aliases.object) ? mapObject.getName() : properties.get(aliases.body, String.class)); ...
Array<Vector2> vertices = new Array<Vector2>(toVector2Array(polygon.getVertices()));
8
GerritCodeReview/plugins_replication
src/test/java/com/googlesource/gerrit/plugins/replication/ReplicationEventsIT.java
[ "public class ProjectDeletionReplicationDoneEvent extends ProjectEvent {\n public static final String TYPE = \"project-deletion-replication-done\";\n\n private final String project;\n\n public ProjectDeletionReplicationDoneEvent(String project) {\n super(TYPE);\n this.project = project;\n }\n\n @Override...
import static com.google.common.truth.Truth.assertThat; import static org.junit.Assert.assertTrue; import com.google.common.base.Objects; import com.google.gerrit.acceptance.PushOneCommit.Result; import com.google.gerrit.acceptance.Sandboxed; import com.google.gerrit.acceptance.TestPlugin; import com.google.gerrit.acce...
isPushCompleted(targetProject, newBranch, TEST_PUSH_TIMEOUT); waitForRefEvent(() -> testDispatcher.getEvents(RefReplicatedEvent.class), newBranch); assertThat(testDispatcher.getEvents(RefReplicatedEvent.class).size()).isEqualTo(1); waitForRefEvent(() -> testDispatcher.getEvents(RefReplicationDoneEven...
() -> testDispatcher.getEvents(project, ProjectDeletionReplicationFailedEvent.class), 1);
1
elixsr/FwdPortForwardingApp
app/src/main/java/com/elixsr/portforwarder/ui/rules/BaseRuleActivity.java
[ "public class RuleValidationException extends ValidationException {\n\n public RuleValidationException() {\n }\n\n public RuleValidationException(String message) {\n super(message);\n }\n\n public RuleValidationException(Throwable cause) {\n super(cause);\n }\n\n public RuleValida...
import android.content.Intent; import android.support.design.widget.TextInputEditText; import android.support.design.widget.TextInputLayout; import android.util.Log; import android.widget.ArrayAdapter; import android.widget.Spinner; import android.widget.Toast; import java.net.InetSocketAddress; import java.net.SocketE...
/* * Fwd: the port forwarding app * Copyright (C) 2016 Elixsr Ltd * * 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 versi...
if (RuleModelValidator.validateRuleName(ruleNameText.getText().toString())) {
8
hdodenhof/holoreader
src/de/hdodenhof/holoreader/services/RefreshFeedService.java
[ "public class Extras {\n public static final String FEEDID = \"feedid\";\n public static final String ARTICLEID = \"articleid\";\n public static final String UNREAD_AFTER = \"unreadAfter\";\n}", "public class Prefs {\n public static final String FIRSTRUN = \"firstrun\";\n public static final String...
import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashSet; import java.util.Locale; import java.uti...
} else if (eventType == XmlPullParser.END_TAG && isItemTag(pullParser.getName(), "")) { pubdate = pubdate != null ? pubdate : updated; guid = guid != null ? guid : link; if (pubdate.before(minimumDate)) { break; ...
mContentResolver.update(RSSContentProvider.URI_ARTICLES, contentValues, ArticleDAO.FEEDID + " = ? AND " + ArticleDAO.PUBDATE + " < ? AND "
2
honeybadger-io/honeybadger-java
honeybadger-java/src/main/java/io/honeybadger/reporter/play/HoneybadgerErrorHandler.java
[ "public class HoneybadgerReporter implements NoticeReporter {\n private static Set<Class<?>> exceptionContextClasses = findExceptionContextClasses();\n\n private ConfigContext config;\n private final Logger logger = LoggerFactory.getLogger(getClass());\n private static final ObjectMapper OBJECT_MAPPER =...
import com.typesafe.config.Config; import io.honeybadger.reporter.HoneybadgerReporter; import io.honeybadger.reporter.NoticeReportResult; import io.honeybadger.reporter.NoticeReporter; import io.honeybadger.reporter.config.ConfigContext; import io.honeybadger.reporter.config.PlayConfigContext; import play.Environment; ...
package io.honeybadger.reporter.play; /** * Error handler for the Play Framework. * * @author <a href="https://github.com/dekobon">Elijah Zupancic</a> * @since 1.0.9 */ public class HoneybadgerErrorHandler extends DefaultHttpErrorHandler { private final NoticeReporter reporter; private final Environment...
NoticeReportResult errorResult = getReporter().reportError(exception, request);
1
luboganev/dejalist
DejalistApp/src/com/luboganev/dejalist/ui/ProductActivity.java
[ "public class CropActivity extends FragmentActivity {\r\n\tprivate final static int REQUEST_CODE_PICK_IMAGE = 1;\r\n\tprivate final static int REQUEST_CODE_TAKE_PHOTO = 2;\r\n\t\r\n\tprivate final static String STATE_FILE_URI = \"state_file_uri\";\r\n\tprivate final static String STATE_DESTINATION_FILE_URI = \"stat...
import static nl.qbusict.cupboard.CupboardFactory.cupboard; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import android.app.ActionBar; import android.app.Activity; import android.content.ContentValues; import andr...
else { try { InputStream is = getContentResolver().openInputStream(uri); String filename = "shared_image_" + System.currentTimeMillis(); File cachedFile = CacheManager.cacheData(getApplicationContext(), is, filename); if(cachedFile != null) cachedFileUri = Uri.fromFile(cachedFile); ...
Cursor c = cupboard().withContext(getApplicationContext()).query(Categories.CONTENT_URI, Category.class).getCursor();
6
Dynious/SoundsCool
java/com/dynious/soundscool/tileentity/TileSoundPlayer.java
[ "@Mod(modid = Reference.modid, name = Reference.name, version = Reference.version)\npublic class SoundsCool\n{\n @Instance(Reference.modid)\n public static SoundsCool instance;\n\n @SidedProxy(clientSide = Reference.clientProxy, serverSide = Reference.commonProxy)\n public static CommonProxy proxy;\n\n ...
import com.dynious.soundscool.SoundsCool; import com.dynious.soundscool.handler.SoundHandler; import com.dynious.soundscool.helper.SoundHelper; import com.dynious.soundscool.network.packet.client.SoundPlayerSelectPacket; import com.dynious.soundscool.network.packet.server.ServerPlaySoundPacket; import com.dynious.sound...
package com.dynious.soundscool.tileentity; public class TileSoundPlayer extends TileEntity { private boolean isPowered = false; private Sound selectedSound; private String lastSoundIdentifier; private long timeSoundFinishedPlaying; public void setPowered(boolean powered) { if (!isPow...
SoundsCool.proxy.getChannel().writeOutbound(new SoundPlayerSelectPacket(this));
0
LearningByExample/reactive-ms-example
src/test/java/org/learning/by/example/reactive/microservices/routers/ApiRouterTest.java
[ "public class GeoLocationNotFoundException extends Exception{\n\n public GeoLocationNotFoundException(final String message) {\n super(message);\n }\n}", "public class ApiHandler {\n\n private static final String ADDRESS = \"address\";\n private static final String EMPTY_STRING = \"\";\n\n private ...
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import org.learning.by.example.reactive.microservices.exceptions.GeoLocationNotFoundException; import org.learning.by.example.reactive.microservices.handlers.ApiH...
package org.learning.by.example.reactive.microservices.routers; @IntegrationTest @DisplayName("ApiRouter Integration Tests")
class ApiRouterTest extends BasicIntegrationTest {
5
ushahidi/SMSSync
smssync/src/main/java/org/addhen/smssync/presentation/service/SmsReceiverService.java
[ "@Singleton\npublic class FileManager {\n\n public static final String LOG_NAME = \"smssync_log\";\n\n static final int MAX_SIZE = 32 * 1024;\n\n private final static String TAG = FileManager.class.getSimpleName();\n\n private PrintWriter mWriter;\n\n private String mDateFormat;\n\n private String...
import com.addhen.android.raiburari.presentation.di.HasComponent; import com.addhen.android.raiburari.presentation.di.component.ApplicationComponent; import org.addhen.smssync.R; import org.addhen.smssync.data.cache.FileManager; import org.addhen.smssync.data.entity.Message; import org.addhen.smssync.data.message.PostM...
* Start the service to process the current event notifications, acquiring the wake lock before * returning to ensure that the service will run. * * @param context - The context of the calling activity. * @param intent - The calling intent. * @return void */ public static void beg...
msg.setMessageUuid(new ProcessSms(mContext).getUuid());
8
Slyce-Inc/SlyceMessaging
slyce-messaging/src/main/java/it/slyce/messaging/utils/asyncTasks/AddNewMessageTask.java
[ "public abstract class Message {\n long date;\n MessageSource source;\n String avatarUrl;\n String displayName;\n String userId;\n String initials;\n\n public long getDate() {\n return date;\n }\n\n public void setDate(long date) {\n this.date = date;\n }\n\n public Me...
import android.content.Context; import android.os.AsyncTask; import android.support.design.widget.Snackbar; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import it.slyce.messaging.R; import java.util.List; import it.slyce.messagin...
package it.slyce.messaging.utils.asyncTasks; public class AddNewMessageTask extends AsyncTask { private List<Message> messages; private List<MessageItem> mMessageItems;
private MessageRecyclerAdapter mRecyclerAdapter;
2
moltin/android-example
app/src/main/java/moltin/example_moltin/activities/DetailActivity.java
[ "public class ShutterbugManager implements ImageCacheListener, ShutterbugDownloaderListener {\n public interface ShutterbugManagerListener {\n void onImageSuccess(ShutterbugManager imageManager, Bitmap bitmap, String url);\n\n void onImageFailure(ShutterbugManager imageManager, String url);\n }\...
import android.app.Dialog; import android.content.Intent; import android.graphics.Point; import android.graphics.Typeface; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.view.Display; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterVi...
package moltin.example_moltin.activities; public class DetailActivity extends SlidingFragmentActivity implements CartFragment.OnFragmentUpdatedListener, CartFragment.OnFragmentChangeListener, NumberPicker.OnValueChangeListener { private SlidingMenu menu; private android.app.Fragment mContent; private...
ArrayList<ModifierItem> modItems=null;
2
trigor74/travelers-diary
app/src/main/java/com/travelersdiary/adapters/DiaryImagesListAdapter.java
[ "public final class Constants {\n // firebase\n public static final String FIREBASE_URL = BuildConfig.FIREBASE_ROOT_URL;\n public static final String FIREBASE_USERS = \"users\";\n public static final String FIREBASE_USER_EMAIL = \"email\";\n public static final String FIREBASE_USER_NAME = \"name\";\n...
import android.content.Intent; import android.support.v4.app.Fragment; import android.support.v4.content.ContextCompat; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import com.bumptech.glide.G...
package com.travelersdiary.adapters; public class DiaryImagesListAdapter extends RecyclerView.Adapter<DiaryImagesListAdapter.ViewHolder> { private final static int IMAGES = 0; private final static int SHOW_ALL = 1; private final static int WARNING = 3; private final static int ITEM_COUNT = 12; ...
mFragment.startActivityForResult(intent, Constants.IMAGES_DELETE_REQUEST_CODE);
0
maxant/genericconnector
demo/genericconnector-demo-javaee-client/src/main/java/ch/maxant/jca_demo/client/TransactionAssistanceSetup.java
[ " public static Acquirer getAcquirer() {\n\t//String baseUrl = \"http://localhost:9081/genericconnector-demo-webservice-acquirer-2.1.1-SNAPSHOT/AcquirerWebService\";\n\tString baseUrl = \"http://a.maxant.ch/AcquirerWebService\";\n\ttry{\n\t\tURL url = new URL(baseUrl + \"?wsdl\");\n\t\tAcquirer svc = new Acquirer...
import javax.ejb.Startup; import ch.maxant.generic_jca_adapter.TransactionAssistanceFactory; import ch.maxant.generic_jca_adapter.TransactionAssistanceFactory.CommitRollbackRecoveryCallback.Builder; import static ch.maxant.jca_demo.client.IntegrationLayer.getAcquirer; import static ch.maxant.jca_demo.client.Integra...
/* Copyright 2015 Ant Kutschera Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agree...
private TransactionAssistanceFactory acquirerFactory;
3
adiyoss/StructED
src/com/structed/models/algorithms/RampLoss.java
[ "public class Consts {\n\n // GENERALS\n\tpublic static final String SPACE = \" \";\n public static final String TAB = \"\\t\";\n public static final String COMMA_NOTE = \",\";\n\tpublic static final String CLASSIFICATION_SPLITTER = \"-\";\n\tpublic static final String COLON_SPLITTER = \":\";\n public s...
import com.structed.constants.ErrorConstants; import com.structed.data.entities.Example; import com.structed.data.entities.Vector; import com.structed.data.Logger; import com.structed.utils.MathHelpers; import java.util.ArrayList; import com.structed.constants.Consts; import com.structed.models.ClassifierData;
/* * The MIT License (MIT) * * StructED - Machine Learning Package for Structured Prediction * * Copyright (c) 2015 Yossi Adi, E-Mail: yossiadidrum@gmail.com * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), t...
public Vector update(Vector currentWeights, Example example, ClassifierData classifierData) {
3
rsgoncalves/ecco
src/main/java/uk/ac/manchester/cs/diff/output/csv/CSVDiffReport.java
[ "public interface AxiomChangeSet extends ChangeSet {\n\t\n\t/**\n\t * Get the set of additions\n\t * @return Set of additions\n\t */\n\tpublic Set<? extends StructuralChange> getAdditions();\n\t\n\t\n\t/**\n\t * Get the set of removals\n\t * @return Set of removals\n\t */\n\tpublic Set<? extends StructuralChange> g...
import uk.ac.manchester.cs.diff.axiom.changeset.AxiomChangeSet; import uk.ac.manchester.cs.diff.concept.changeset.ConceptChangeSet; import uk.ac.manchester.cs.diff.exception.NotImplementedException; import uk.ac.manchester.cs.diff.output.xml.XMLAxiomDiffReport; import uk.ac.manchester.cs.diff.output.xml.XMLConceptDiffR...
package uk.ac.manchester.cs.diff.output.csv; /** * @author Rafael S. Goncalves <br> * Stanford Center for Biomedical Informatics Research (BMIR) <br> * School of Medicine, Stanford University <br> */ public class CSVDiffReport { private XMLDiffReport report; public CSVDiffReport(XMLDiffReport report) { th...
else if(report instanceof XMLConceptDiffReport)
4
mucaho/jnetrobust
jnetrobust-samples/src/main/java/com/github/mucaho/jnetrobust/example/ProtocolHost.java
[ "public abstract class Logger {\n /**\n * Enum representing all possible <code>logging event descriptions</code>.\n */\n public static enum LoggingEvent {\n SEND(\"Data sent\"),\n RECEIVE(\"Data received\"),\n NEWEST(\"Newest data received\"),\n SEND_RETRANSMISSION(\"Data r...
import com.esotericsoftware.kryo.Kryo; import com.esotericsoftware.kryo.io.ByteBufferInput; import com.esotericsoftware.kryo.io.ByteBufferOutput; import com.esotericsoftware.kryo.io.KryoObjectInput; import com.esotericsoftware.kryo.io.KryoObjectOutput; import com.github.mucaho.jnetrobust.Logger; import com.github.mucah...
/* * Copyright (c) 2014 mucaho (https://github.com/mucaho). * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ package com.github.mucaho.jnetrobust.example; /*...
handleExceptionalData(protocolId, new ProtocolException(Logger.LoggingEvent.UNORDERED, value));
0
peshkira/c3po
c3po-webapi/app/controllers/FilterController.java
[ "public class Graph {\n\n private String property;\n private Map<String, String> options;\n private List<String> keys;\n private List<String> values;\n\n public Graph() {\n this.setOptions(new HashMap<String, String>());\n }\n\n public Graph(String p, List<String> keys, List<String> values) {\n this();...
import helpers.Graph; import helpers.PropertyValuesFilter; import helpers.Statistics; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import play.Logger; import play.data.DynamicForm; import play.mvc.Controller; import play.mvc.Result; i...
/******************************************************************************* * Copyright 2013 Petar Petrov <me@petarpetrov.org> * * 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 * ...
Filter tmp = DataHelper.parseFilter(cursor.next());
7
startupheroes/startupheroes-checkstyle
startupheroes-checks/src/main/java/es/startuphero/checkstyle/checks/annotation/ColumnDefaultCheck.java
[ "public static DetailAST getAnnotation(DetailAST ast, String fullAnnotation) {\n DetailAST simpleAnnotationAst =\n AnnotationUtil.getAnnotation(ast, CommonUtils.getSimpleName(fullAnnotation));\n return nonNull(simpleAnnotationAst) ? simpleAnnotationAst\n : AnnotationUtil.getAnnotation(ast, fullAnnotatio...
import com.puppycrawl.tools.checkstyle.api.AbstractCheck; import com.puppycrawl.tools.checkstyle.api.DetailAST; import com.puppycrawl.tools.checkstyle.api.TokenTypes; import java.util.List; import java.util.Map; import java.util.Objects; import static es.startuphero.checkstyle.util.AnnotationUtils.getAnnotation; import...
package es.startuphero.checkstyle.checks.annotation; /** * @author ozlem.ulag */ public class ColumnDefaultCheck extends AbstractCheck { /** * A key is pointing to the warning message text in "messages.properties" file. */ private static final String NOT_MATCHING_MSG_KEY = "column.default.not.matching";...
if (isEntity(ast, typeAnnotation) || isEntity(ast, abstractTypeAnnotation)) {
2
taoneill/war
war/src/main/java/com/tommytony/war/structure/WarHub.java
[ "public class Team {\n\tprivate final Warzone warzone;\n\tRandom teamSpawnRandomizer = new Random();\n\tprivate List<Player> players = new ArrayList<Player>();\n\tprivate List<Player> teamChatPlayers = new ArrayList<Player>();\n\tprivate List<Location> teamSpawns;\n\tprivate Location teamFlag = null;\n\tprivate Str...
import com.tommytony.war.Team; import com.tommytony.war.War; import com.tommytony.war.Warzone; import com.tommytony.war.config.TeamConfig; import com.tommytony.war.config.WarzoneConfig; import com.tommytony.war.utility.Direction; import com.tommytony.war.volume.Volume; import org.bukkit.Location; import org.bukkit.Mate...
package com.tommytony.war.structure; /** * * @author tommytony, Tim Düsterhus * @package com.tommytony.war */ public class WarHub { private Location location; private Volume volume; private Map<String, Block> zoneGateBlocks = new HashMap<String, Block>(); private BlockFace orientation; public WarHub(Locati...
zone = War.war.findWarzone(zoneName);
1
dakshj/TMDb_Sample
app/src/test/java/com/daksh/tmdbsample/di/component/TestAppComponent.java
[ "public class TestTmdbApplication extends TmdbApplication {\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n TestInjector.INSTANCE.initializeAppComponent(this).inject(this);\n }\n}", "@Module\npublic class NetworkModule {\n\n private static final int TIMEOUT = 60;\n\n ...
import com.daksh.tmdbsample.app.TestTmdbApplication; import com.daksh.tmdbsample.di.module.NetworkModule; import com.daksh.tmdbsample.di.module.StorageModule; import com.daksh.tmdbsample.di.module.TestAppModule; import com.daksh.tmdbsample.movielist.MovieListPresenterTest; import javax.inject.Singleton; import dagger.C...
package com.daksh.tmdbsample.di.component; /** * Created by daksh on 08-09-2016. */ @Singleton @Component(modules = { TestAppModule.class,
NetworkModule.class,
1
Predelnik/ChibiPaintMod
src/chibipaint/controller/CPControllerApplication.java
[ "public class ChibiApp extends JFrame\n{\n\n/**\n *\n */\nprivate static final long serialVersionUID = 1L;\nprivate final CPControllerApplication controller;\nprivate final CPMainGUI mainGUI;\n\npublic enum appState\n{\n FREE,\n SAVING,\n LOADING,\n TRANSFORM,\n}\n\nprivate appState curAppState = appState.FREE;...
import java.awt.*; import java.awt.event.WindowEvent; import java.io.*; import java.util.prefs.Preferences; import chibipaint.ChibiApp; import chibipaint.ChibiApp.appState; import chibipaint.engine.CPArtwork; import chibipaint.engine.CPUndo; import chibipaint.file.CPFile; import chibipaint.gui.CPMainGUI; import javax.s...
private static final String FILE_IS_UNSUPPORTED_STRING = "Sorry, but the type of action you are trying to perform is currently unsupported or target file is unsupported or corrupted."; // file_name used only in recent files handling, very scarce use actually private boolean saveLoadImageFile ( final String ext...
for (int i = 0; i < CPMainGUI.RECENT_FILES_COUNT; i++)
5
geoparser/geolocator-2.0
geo-locator/src/edu/cmu/geolocator/parser/Universal/MTNERParser.java
[ "public class LocEntityAnnotation {\n\n /**\n * Those are filled out after generating the loc entity.\n */\n private int toksStart, toksEnd;\n\n private Token[] tokens;\n\n private String NEType;\n\n /**\n * This is absolutely necessary.\n */\n private double latitude;\n\n private double longitude;\n...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import edu.cmu.geolocator.model.LocEntityAnnotation; import edu.cmu.geolocator.model.Sentence; import edu.cmu.geolocator.model.Token; import edu.cmu.geolocator.model.Tweet; imp...
/** * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use t...
public List<LocEntityAnnotation> parse(Tweet tweet) {
3
okumin/influent
influent-transport/src/main/java/influent/internal/nio/NioEventLoop.java
[ "public final class InfluentIOException extends RuntimeException {\n /**\n * Constructs a new {@code InfluentIOException}.\n *\n * @param message the error message\n * @param cause the cause\n */\n public InfluentIOException(final String message, final Throwable cause) {\n super(message, cause);\n }...
import java.util.concurrent.atomic.AtomicReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import influent.exception.InfluentIOException; import influent.internal.nio.NioEventLoopTask.Register; import influent.internal.nio.NioEventLoopTask.Select; import influent.internal.nio.NioEventLoopTask.UpdateIn...
/* * Copyright 2016 okumin * * 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 wr...
addTask(Register.of(selector, channel, key, ops, attachment));
1
Beloumi/PeaFactory
src/peafactory/peas/gui/LockFrame.java
[ "public class PeaSettings {\n\n\tprivate static JDialog keyboard = null;\n\tprivate static final JDialog pswGenerator = null;\n\t\n\tprivate static final boolean BOUND = true;\n\tprivate static final String EXTERNAL_FILE_PATH = null;\n\tprivate static final boolean EXTERN_FILE = true;\n\tprivate static final String...
import cologne.eck.peafactory.tools.WriteResources; import cologne.eck.peafactory.tools.Zeroizer; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.io.File; import javax.swing.JFrame; import settings.PeaSettings; import cologne.eck.peafactory.crypto.CipherStuff; import cologne.eck.pea...
package cologne.eck.peafactory.peas.gui; /* * Peafactory - Production of Password Encryption Archives * Copyright (C) 2015 Axel von dem Bruch * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published * by the Free Software Fou...
if(PeaSettings.getExternFile() == true) {
0
mgoellnitz/dinistiq
src/test/java/dinistiq/test/QualifierTest.java
[ "public interface ClassResolver {\n\n /**\n * Get all available subclasses of a given class which are not abstract.\n *\n * @param <T> generic type variable for the result set\n * @param type type to search subclasses for\n * @return Set of classes implementing the given type\n */\n <T...
import java.util.Set; import javax.inject.Named; import javax.inject.Scope; import org.atinject.tck.auto.Car; import org.testng.Assert; import org.testng.annotations.Test; import dinistiq.ClassResolver; import dinistiq.Dinistiq; import dinistiq.SimpleClassResolver; import dinistiq.test.components.InitialBean; import di...
/** * * Copyright 2016-2020 Martin Goellnitz * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This ...
QualifiedInjection qualifiedInjection = d.findBean(QualifiedInjection.class);
5
Gikkman/Java-Twirk
src/test/java/com/gikk/twirk/types/usernotice/TestUsernotice.java
[ "public class TestBiConsumer<T, U> {\n private BiFunction<T,U, Boolean> test;\n private TestResult res;\n\n public TestResult assign(BiFunction<T, U, Boolean> test){\n this.test = test;\n return res = new TestResult();\n }\n\n public void consume(T t, U u){\n if(test != null) {\n...
import com.gikk.twirk.TestBiConsumer; import com.gikk.twirk.TestResult; import com.gikk.twirk.enums.USER_TYPE; import com.gikk.twirk.types.usernotice.subtype.Raid; import com.gikk.twirk.types.usernotice.subtype.Ritual; import com.gikk.twirk.types.usernotice.subtype.Subscription; import com.gikk.twirk.types.usernotice.s...
assertEquals("6d76ab5c-a595-4ccb-97d1-8d488fc6d128", notice.getMessageID()); assertEquals(24811779, notice.getRoomID()); assertEquals(1547589704222L, notice.getSentTimestamp()); assertEquals("vtho Subscribed at Tier 1. " + "They subscribed for 10 months" + (noShare ? "!" ...
assertEquals(USER_TYPE.STAFF, user.getUserType());
2
loomchild/segment
segment/src/test/java/net/loomchild/segment/srx/io/SrxParsersTest.java
[ "public static Reader getReader(InputStream inputStream) {\n\ttry {\n\t\tReader reader = new InputStreamReader(inputStream, \"utf-8\");\n\t\treturn reader;\n\t} catch (UnsupportedEncodingException e) {\n\t\tthrow new IORuntimeException(e);\n\t}\n}", "public static InputStream getResourceStream(String name) {\n\tI...
import static net.loomchild.segment.util.Util.getReader; import static net.loomchild.segment.util.Util.getResourceStream; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.io.Reader; import java.util.List; import net.loomchild...
} private static final String SRX_2_DOCUMENT_NAME = "net/loomchild/segment/res/test/example.srx"; private void testSrx2(SrxParser parser) { Reader reader = getReader(getResourceStream(SRX_2_DOCUMENT_NAME)); SrxDocument document = parser.parse(reader); assertTrue(document.getCascade()); List<LanguageRule...
List<LanguageMap> leftLanguageMapList = leftDocument.getLanguageMapList();
5
metova/privvy
sample/src/main/java/com/metova/privvy/sample/ui/list/ListActivity.java
[ "public interface PrivvyHost {\n\n void initialize(RouteData... routes);\n\n void replace(RouteData oldComponent, RouteData newComponent);\n\n void goTo(RouteData newComponent);\n}", "public class PrivvyHostDelegate implements PrivvyHost {\n\n private AppCompatActivity hostActivity;\n\n public Priv...
import com.metova.privvy.PrivvyHost; import com.metova.privvy.PrivvyHostDelegate; import com.metova.privvy.RouteData; import com.metova.privvy.sample.R; import com.metova.privvy.sample.SampleApplication; import com.metova.privvy.sample.di.HostComponent; import com.metova.privvy.sample.di.HostModule; import android.os.B...
package com.metova.privvy.sample.ui.list; public class ListActivity extends AppCompatActivity implements PrivvyHost, ListContract.View, ListAdapter.ListClickCallback { @Inject ListComponent listComponent; PrivvyHostDelegate hostDelegate; @BindView(R.id.list_recyclerview) RecyclerView number...
HostComponent hostComponent = SampleApplication.component.newHost()
3
mike10004/xvfb-manager-java
xvfb-testing/src/test/java/com/github/mike10004/xvfbtesting/XvfbRuleTest.java
[ "public class ProcessTrackerRule extends ExternalResource {\n\n private static final Duration DEFAULT_DESTROY_TIMEOUT = Duration.ofMillis(1000);\n\n private final TestWatcher watcher;\n private final AtomicBoolean passage;\n private BasicProcessTracker processTracker;\n private final Duration process...
import com.github.mike10004.xvfbunittesthelp.ProcessTrackerRule; import com.google.common.util.concurrent.JdkFutureAdapters; import io.github.mike10004.subprocess.ProcessMonitor; import io.github.mike10004.subprocess.ProcessResult; import io.github.mike10004.subprocess.ProcessTracker; import io.github.mike10004.subproc...
package com.github.mike10004.xvfbtesting; public class XvfbRuleTest { private static final int FIRST_DISPLAY_NUMBER = 101; // if host has more displays than this number already active, problems will ensue private static final AtomicInteger displayNumbers = new AtomicInteger(FIRST_DISPLAY_NUMBER); priva...
protected void use(XvfbController ctrl) throws Exception {
2