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
Bernardo-MG/repository-pattern-java
src/test/java/com/wandrell/pattern/test/integration/repository/access/hsqldb/eclipselink/ITQueryHsqldbEclipselinkJpaRepository.java
[ "public class PersistenceContextPaths {\n\n /**\n * Eclipselink JPA persistence.\n */\n public static final String ECLIPSELINK = \"classpath:context/persistence/jpa-eclipselink.xml\";\n\n /**\n * Hibernate JPA persistence.\n */\n public static final String HIBERNATE = \"classpath:context...
import com.wandrell.pattern.test.util.config.properties.DatabaseScriptsPropertiesPaths; import com.wandrell.pattern.test.util.config.properties.JdbcPropertiesPaths; import com.wandrell.pattern.test.util.config.properties.JpaPropertiesPaths; import com.wandrell.pattern.test.util.config.properties.PersistenceProviderProp...
/** * The MIT License (MIT) * <p> * Copyright (c) 2015 the original author or authors. * <p> * 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 limi...
PersistenceProviderPropertiesPaths.ECLIPSELINK,
5
domoinc/domo-java-sdk
domo-java-sdk-all/src/test/java/com/domo/sdk/tasks/UpdateExample.java
[ "public class ExampleBase {\n\n protected DomoClient client;\n\n @Before\n public void setup() {\n Config config = Config.with()\n .clientId(\"MY_CLIENT_ID\")\n .clientSecret(\"MY_CLIENT_SECRET\")\n .apiHost(\"api.domo.com\")\n .useHttps(true)\n .scope(US...
import com.domo.sdk.ExampleBase; import com.domo.sdk.tasks.model.Project; import com.domo.sdk.tasks.model.ProjectList; import com.domo.sdk.tasks.model.Task; import com.domo.sdk.users.UserClient; import com.domo.sdk.users.model.User; import org.junit.Test; import java.io.*; import java.util.Collections; import java.util...
package com.domo.sdk.tasks; public class UpdateExample extends ExampleBase { @Test public void tasksClient_smokeTest() throws IOException { TasksClient tasksClient = new TasksClient(client.getUrlBuilder(), client.getTransport()); //Get User UserClient userClient = client.userClient()...
Project project = new Project();
1
JEEventStore/JEEventStore
persistence-jpa/src/main/java/org/jeeventstore/persistence/jpa/EventStorePersistenceJPA.java
[ "public interface ChangeSet extends Serializable {\n\n /**\n * Identifies the bucket to which the event stream belongs.\n * \n * @return the identifier\n */\n String bucketId();\n\n /**\n * Identifies the event stream to which this belongs.\n * \n * @return the identifier\n ...
import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Resource; import javax.ejb.EJB; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; import jav...
/* * Copyright (c) 2013 Red Rainbow IT Solutions GmbH, Germany * * 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...
public void persistChanges(ChangeSet changeSet) throws ConcurrencyException, DuplicateCommitException {
2
kifile/Cornerstone
framework/src/main/java/com/kifile/android/cornerstone/utils/ReflectUtils.java
[ "public class ConvertException extends Exception {\n\n private Object o;\n\n public ConvertException() {\n }\n\n public ConvertException(String detailMessage) {\n super(detailMessage);\n }\n\n public ConvertException(String detailMessage, Throwable throwable) {\n super(detailMessage,...
import android.support.annotation.NonNull; import android.util.Log; import com.kifile.android.cornerstone.core.ConvertException; import com.kifile.android.cornerstone.core.FetchException; import com.kifile.android.cornerstone.impl.annotations.Property; import com.kifile.android.cornerstone.impl.fetchers.AnnotationJSONA...
package com.kifile.android.cornerstone.utils; /** * @author kifile */ public class ReflectUtils { public static final String TAG = "Reflect"; /** * 通过反射,从JSONObject中获取数据. * * @param jsonObject * @param key * @param field * @return */ public static Object getValueF...
new DataConverter<>(jsonObject.optJSONArray(key)), itemType).fetch();
4
domkowald/tagrecommender
src/processing/ActCalculator.java
[ "public class DoubleMapComparator implements Comparator<Integer> {\r\n\r\n\tprivate Map<Integer, Double> map;\r\n\t\r\n\tpublic DoubleMapComparator(Map<Integer, Double> map) {\r\n\t\tthis.map = map;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic int compare(Integer key1, Integer key2) {\r\n Double val1 = this.map.get...
import common.DoubleMapComparator; import common.UserData; import common.Utilities; import file.PredictionFileWriter; import file.BookmarkReader; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; import jav...
/* TagRecommender: A framework to implement and evaluate algorithms for the recommendation of tags. Copyright (C) 2013 Dominik Kowald This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Founda...
Map<Integer, Double> sortedResultMap = new TreeMap<Integer, Double>(new DoubleMapComparator(resultMap));
0
robneild/pocket-query-creator
app/src/main/java/org/pquery/webdriver/DownloadTask.java
[ "public class HTTPStatusCodeException extends IOException {\r\n\r\n private static final long serialVersionUID = 6392750451335427514L;\r\n\r\n public int code;\r\n public String reason;\r\n public String body;\r\n\r\n public HTTPStatusCodeException(int statusCode, String statusMessage, String body) {...
import android.content.Context; import org.pquery.R; import org.pquery.util.HTTPStatusCodeException; import org.pquery.util.IOUtils; import org.pquery.util.IOUtils.FileDetails; import org.pquery.util.IOUtils.Listener; import org.pquery.util.Logger; import org.pquery.util.Prefs; import org.pquery.util.Util; imp...
package org.pquery.webdriver; /** * Download file over HTTP */ public class DownloadTask extends RetriableTask<File> { private Context cxt; private String url; private File dir; private String filename; public DownloadTask(int numberOfRetries, int fromPercent, int toPercent, P...
pq = IOUtils.httpGetBytes(cxt, url, cancelledListener, new Listener() {
1
fluxroot/jcpi
src/test/java/com/fluxchess/jcpi/protocols/UciProtocolTest.java
[ "public final class GenericBoard {\n\n\tpublic static final int STANDARDSETUP = 518;\n\n\tprivate final Map<GenericPosition, GenericPiece> board = new HashMap<GenericPosition, GenericPiece>();\n\tprivate final Map<GenericColor, Map<GenericCastling, GenericFile>> castling = new EnumMap<GenericColor, Map<GenericCastl...
import com.fluxchess.jcpi.commands.*; import com.fluxchess.jcpi.models.GenericBoard; import com.fluxchess.jcpi.models.GenericColor; import com.fluxchess.jcpi.models.GenericMove; import com.fluxchess.jcpi.models.GenericPosition; import com.fluxchess.jcpi.options.SpinnerOption; import org.junit.jupiter.api.Test; import j...
@Test public void testPosition() throws IOException { String[] commands = { "position", "position startpos", "a b c d position startpos", "a b c d position startpos moves a2a3", "a b c d position startpos x y z", "a b c d position startpos moves", "a b c d position fen", "a b c d pos...
assertThat(((EngineStartCalculatingCommand) command).getClock(GenericColor.WHITE).longValue()).isEqualTo(100);
1
kciray8/IronBrain
IBServer/src/main/java/org/ironbrain/dao/TryDao.java
[ "@Component\npublic class IB {\n @Autowired\n private ServletContext context;\n\n //For testing purpose\n private static long msOffset = 0;\n\n public static Random rand() {\n return random;\n }\n\n public static void setRandom(Random random) {\n IB.random = random;\n }\n\n ...
import org.hibernate.criterion.Restrictions; import org.ironbrain.IB; import org.ironbrain.SessionData; import org.ironbrain.core.Ticket; import org.ironbrain.core.Try; import org.ironbrain.utils.HtmlUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; ...
package org.ironbrain.dao; @Repository @SuppressWarnings("unchecked") @Transactional public class TryDao extends BaseDao { @Autowired protected SessionData data; @Autowired private RemindDao remindDao;
public Try create(Ticket ticket, int examId, int num, int attemptNum) {
2
stardogventures/stardao
stardao-mongodb/src/main/java/io/stardog/stardao/mongodb/AbstractMongoDao.java
[ "public abstract class AbstractDao<M,P,K,I> implements Dao<M,P,K> {\n private final Class<M> modelClass;\n private final Class<P> partialClass;\n private final FieldData fieldData;\n\n public AbstractDao(Class<M> modelClass, Class<P> partialClass) {\n this.modelClass = modelClass;\n this.p...
import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.mongodb.client.FindIterable; import com.mongodb.client.MongoCollection; import com.mongodb.client.model.IndexModel; import io.stardog.stardao.core.AbstractDao; im...
package io.stardog.stardao.mongodb; public abstract class AbstractMongoDao<M,P,K,I> extends AbstractDao<M,P,K,I> { private final MongoCollection<Document> collection;
private final DocumentMapper<M> modelMapper;
6
SamuelGjk/GComic
app/src/main/java/moe/yukinoneko/gcomic/module/gallery/GalleryPresenter.java
[ "public abstract class BasePresenter<T extends IBaseView> {\n protected CompositeSubscription mCompositeSubscription;\n protected Context mContext;\n protected T iView;\n\n public BasePresenter(Context context, T iView) {\n this.mContext = context;\n this.iView = iView;\n }\n\n publi...
import rx.functions.Action1; import android.content.Context; import java.util.List; import moe.yukinoneko.gcomic.R; import moe.yukinoneko.gcomic.base.BasePresenter; import moe.yukinoneko.gcomic.data.ChapterData; import moe.yukinoneko.gcomic.database.GComicDB; import moe.yukinoneko.gcomic.database.model.ReadHistoryModel...
/* * Copyright (C) 2016 SamuelGjk <samuel.alva@outlook.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * ...
.save(new ReadHistoryModel(comicId, chapterId, position))
3
ryanramage/couch-audio-recorder
src/main/java/com/googlecode/eckoit/audio/SplitAudioRecorderManager.java
[ "public class ConversionFinishedEvent {\n private File finishedFile;\n private File availableToStream;\n private int streamDuration;\n private String segmentCount;\n\n\n public ConversionFinishedEvent(File finishedFile) {\n this.finishedFile = finishedFile;\n }\n\n public File getFinishe...
import com.googlecode.eckoit.events.ConversionFinishedEvent; import com.googlecode.eckoit.events.PostProcessingStartedEvent; import com.googlecode.eckoit.events.RecordingCompleteEvent; import com.googlecode.eckoit.events.RecordingSplitEvent; import com.googlecode.eckoit.events.RecordingStartClickedEvent; import com.goo...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.googlecode.eckoit.audio; /** * * @author ryan */ public class SplitAudioRecorderManager { SplitAudioRecorder recorder = SplitAudioRecorder.getSingletonObject(); ContinousAudioConvereter cac...
if (t instanceof StreamReadyEvent) return; // ignore these.
8
treasure-data/td-jdbc
src/main/java/com/treasuredata/jdbc/command/TDClientAPI.java
[ "public class Config\n implements Constants\n{\n public static final String TD_JDBC_USESSL = \"usessl\";\n public static final String TD_JDBC_USEAPIKEY = \"useapikey\";\n public static final String TD_JDBC_USER = \"user\";\n public static final String TD_JDBC_PASSWORD = \"password\";\n public ...
import com.treasure_data.client.ClientException; import com.treasure_data.client.TreasureDataClient; import com.treasuredata.jdbc.Config; import com.treasuredata.jdbc.TDConnection; import com.treasuredata.jdbc.TDResultSet; import com.treasuredata.jdbc.TDResultSetBase; import com.treasuredata.jdbc.TDResultSetMetaData; i...
/* * 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 ...
private final Config config;
0
dperezcabrera/jpoker
src/main/java/org/poker/api/game/Hand7Evaluator.java
[ "@Immutable\npublic final class Card {\n\n private static final String STRING_RANK_CARDS = \"23456789TJQKA\";\n\n public enum Suit {\n\n SPADE('♠'), HEART('♥'), DIAMOND('♦'), CLUB('♣');\n \n private final char c;\n\n private Suit(char c) {\n this.c = c;\n }\n\n ...
import java.util.List; import net.jcip.annotations.NotThreadSafe; import org.poker.api.core.Card; import org.poker.api.core.IHandEvaluator; import static org.poker.api.game.TexasHoldEmUtil.COMMUNITY_CARDS; import static org.poker.api.game.TexasHoldEmUtil.PLAYER_CARDS; import org.util.combinatorial.Combination;
/* * Copyright (C) 2016 David Pérez Cabrera <dperezcabrera@gmail.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later ve...
public static final int TOTAL_CARDS = PLAYER_CARDS + COMMUNITY_CARDS;
3
SamuelGjk/DiyCode
app/src/main/java/moe/yukinoneko/diycode/module/notification/NotificationsListAdapter.java
[ "public class Notification {\n @SerializedName(\"id\") public int id; // 通知 id\n @SerializedName(\"type\") public String type; // 类型\n @SerializedName(\"read\") public Boolean read; // 是否已读\n @SerializedName(\"actor\") public User actor; ...
import android.support.annotation.NonNull; import android.support.v7.widget.AppCompatImageButton; import android.support.v7.widget.AppCompatTextView; import android.support.v7.widget.RecyclerView; import android.text.method.LinkMovementMethod; import android.view.LayoutInflater; import android.view.View; import android...
/* * Copyright (c) 2017 SamuelGjk <samuel.alva@outlook.com> * * This file is part of DiyCode * * DiyCode is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your o...
UserActivity.launch(v.getContext(), actor.login);
4
TheCount/jhilbert
src/main/java/jhilbert/data/impl/StatementImpl.java
[ "public class ConstraintException extends DataException {\n\n\t/**\n\t * Constructs a new <code>ConstraintException</code> with the\n\t * specified detail message.\n\t *\n\t * @param message detail message.\n\t */\n\tpublic ConstraintException(final String message) {\n\t\tthis(message, null);\n\t}\n\n\t/**\n\t * Co...
import java.util.Set; import jhilbert.data.ConstraintException; import jhilbert.data.DVConstraints; import jhilbert.data.Statement; import jhilbert.data.Variable; import jhilbert.expressions.Anonymiser; import jhilbert.expressions.Expression; import jhilbert.expressions.ExpressionFactory; import org.apache.log4j.Logger...
/* JHilbert, a verifier for collaborative theorem proving Copyright © 2008, 2009, 2011 The JHilbert Authors See the AUTHORS file for the list of JHilbert authors. See the commit logs ("git log") for a list of individual contributions. This program is free software: you can redistribute it and/...
throws ConstraintException {
0
kaliturin/BlackList
app/src/main/java/com/kaliturin/blacklist/receivers/SMSBroadcastReceiver.java
[ "public class BlockEventProcessService extends IntentService {\n private static final String TAG = BlockEventProcessService.class.getName();\n\n private static final String NUMBER = \"NUMBER\";\n private static final String NAME = \"NAME\";\n private static final String BODY = \"BODY\";\n\n public Bl...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.os.Build; import android.os.Bundle; import android.support.annotation.Nullable; import android.telephony.SmsMessage; import android.util.Log; import com.kaliturin.blacklist.R; import com.kaliturin.bla...
/* * Copyright (C) 2017 Anton Kaliturin <kaliturin@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
boolean isDefaultSmsApp = DefaultSMSAppHelper.isDefault(context);
5
mru00/cutlet
CutletLib/src/main/java/com/cutlet/lib/testing/AbstractTestData.java
[ "@ToString\r\npublic class Dimension implements Serializable{\r\n\r\n private double length;\r\n private double width;\r\n\r\n public Dimension(final double length, final double width) {\r\n this.length = length;\r\n this.width = width;\r\n }\r\n\r\n public double getLength() {\r\n ...
import com.cutlet.lib.model.Dimension; import com.cutlet.lib.model.Project; import com.cutlet.lib.model.StockSheet; import com.cutlet.lib.material.Wood; import com.cutlet.lib.model.Panel; import java.util.List; import lombok.NonNull;
/* * Copyright (C) 2017 rudolf.muehlbauer@gmail.com */ package com.cutlet.lib.testing; /** * * @author rmuehlba */ public abstract class AbstractTestData implements TestData { public Project makeProject(@NonNull List<Panel> inputs, final int bladeWidth) { Project project = new Project...
return new StockSheet("wood", new Wood(), new Dimension(length, width), 18);
0
realrolfje/anonimatron
src/main/java/com/rolfje/anonimatron/Anonimatron.java
[ "public class AnonymizerService {\n\tprivate static final Logger LOG = Logger.getLogger(AnonymizerService.class);\n\n\tprivate Map<String, Anonymizer> customAnonymizers = new HashMap<>();\n\tprivate Map<String, String> defaultTypeMapping = new HashMap<>();\n\n\tprivate SynonymCache synonymCache;\n\n\tprivate Set<St...
import com.rolfje.anonimatron.anonymizer.AnonymizerService; import com.rolfje.anonimatron.anonymizer.Hasher; import com.rolfje.anonimatron.anonymizer.SynonymCache; import com.rolfje.anonimatron.commandline.CommandLine; import com.rolfje.anonimatron.configuration.Configuration; import com.rolfje.anonimatron.file.FileAno...
package com.rolfje.anonimatron; /** * Start of a beautiful anonymized new world. * */ public class Anonimatron { public static String VERSION = "UNKNOWN"; static { try { InputStream resourceAsStream = Anonimatron.class.getResourceAsStream("version.txt"); InputStreamReader inputStreamReader = new InputS...
FileAnonymizerService fileService = new FileAnonymizerService(config, anonymizerService);
5
g0dkar/ajuda-ai
ajuda.ai/backend/src/main/java/ajuda/ai/backend/v1/tasks/InitConfigurations.java
[ "public class LoremIpsum {\r\n\tpublic static final String LOREM_IPSUM = \"Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, n...
import java.util.Date; import java.util.HashMap; import java.util.Random; import javax.annotation.PostConstruct; import javax.ejb.Singleton; import javax.ejb.Startup; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.NoResultException; import javax.persistence.Persist...
package ajuda.ai.backend.v1.tasks; /** * Ao inicializar, cadastra a AMA. Temporário. Apenas para testes. * * @author Rafael Lins * */ @Singleton @Startup public class InitConfigurations { @PersistenceContext private EntityManager entityManager; @Inject private Logger log; @Trans...
final Payment payment = new Payment();
1
lexs/webimageloader
webimageloader/src/main/java/com/webimageloader/ImageLoader.java
[ "public class ContentURLStreamHandler extends URLStreamHandler {\n\n private final ContentResolver mResolver;\n\n public ContentURLStreamHandler(ContentResolver resolver) {\n if (resolver == null) {\n throw new NullPointerException();\n }\n mResolver = resolver;\n }\n\n @...
import android.content.ContentResolver; import android.content.Context; import android.graphics.Bitmap; import android.util.Log; import com.webimageloader.content.ContentURLStreamHandler; import com.webimageloader.loader.DiskLoader; import com.webimageloader.loader.LoaderManager; import com.webimageloader.loader.Memory...
package com.webimageloader; /** * This is the main class of WebImageLoader which can be constructed using a * {@link Builder}. It's often more convenient to use the provided * {@link com.webimageloader.ext.ImageHelper} to load images. * <p> * It's safe to call the methods on this class from any thread. However,...
private NetworkLoader.Builder networkBuilder;
4
stoussaint/spring-data-marklogic
src/main/java/com/_4dconcept/springframework/data/marklogic/repository/support/MarklogicRepositoryFactory.java
[ "public interface MarklogicInvokeOperationOptions extends MarklogicOperationOptions {\n\n default Map<Object, Object> params() {\n return new HashMap<>();\n }\n\n default boolean useCacheResult() {\n return true;\n }\n\n}", "public interface MarklogicOperations {\n\n /**\n * Inser...
import com._4dconcept.springframework.data.marklogic.core.MarklogicInvokeOperationOptions; import com._4dconcept.springframework.data.marklogic.core.MarklogicOperations; import com._4dconcept.springframework.data.marklogic.core.mapping.MarklogicPersistentEntity; import com._4dconcept.springframework.data.marklogic.core...
/* * Copyright 2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applica...
private MarklogicOperations marklogicOperations;
1
2fast2fourier/something.apk
Something/src/main/java/net/fastfourier/something/request/ThreadListRequest.java
[ "public class ForumProcessTask implements Runnable {\n private static Pattern forumNameParser = Pattern.compile(\"(-*)\\\\s*(.+)\");\n\n private Document page;\n\n private ForumProcessTask(Document page){\n this.page = page;\n }\n\n @Override\n public void run() {\n processForums(pag...
import android.content.Context; import android.text.TextUtils; import android.util.Log; import com.android.volley.NetworkResponse; import com.android.volley.Request; import com.android.volley.Response; import com.salvadordalvik.fastlibrary.util.FastUtils; import net.fastfourier.something.R; import net.fastfourier.somet...
package net.fastfourier.something.request; /** * Created by matthewshepard on 1/17/14. */ public class ThreadListRequest extends HTMLRequest<ThreadListRequest.ThreadListResponse> { private int forumId; private boolean scrollTo; private Context context; public ThreadListRequest(Context context, ...
if(forumId != Constants.BOOKMARK_FORUMID){
3
wieden-kennedy/composite-framework
src/test/java/com/wk/lodge/composite/web/standalone/StandaloneCompositeTests.java
[ "public class Device {\n private UUID uuid;\n private int width;\n private int height;\n private int performance;\n private int instructions;\n private String location;\n private String country;\n\n public Device(){\n this.uuid = UUID.randomUUID();\n }\n\n public Device(String u...
import com.fasterxml.jackson.databind.ObjectMapper; import com.wk.lodge.composite.model.Device; import com.wk.lodge.composite.model.Session; import com.wk.lodge.composite.registry.DeviceRegistry; import com.wk.lodge.composite.service.SessionService; import com.wk.lodge.composite.web.CompositeController; import com.wk.l...
package com.wk.lodge.composite.web.standalone; /** * Tests for CompositeController that instantiate directly the minimum * infrastructure necessary to test annotated controller methods and do not load * Spring configuration. * * Tests can create a Spring {@link org.springframework.messaging.Message} that * r...
SessionService sessionService;
3
laithnurie/rhythm
mobile/src/main/java/com/laithlab/rhythm/activity/ArtistActivity.java
[ "public class AlbumGridAdapter extends SelectableAdapter<AlbumGridAdapter.ViewHolder> {\n\n private List<AlbumDTO> albums;\n private ClickListener clickListener;\n\n public AlbumGridAdapter(List<AlbumDTO> albums, ClickListener clickListener) {\n this.albums = albums;\n this.clickListener = cl...
import android.Manifest; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7...
package com.laithlab.rhythm.activity; public class ArtistActivity extends RhythmActivity implements AlbumGridAdapter.ClickListener { private static final java.lang.String ARTIST_ID_PARAM = "artistId"; private static final java.lang.String ARTIST_PARAM = "artist"; private DrawerLayout drawerLayout; p...
MusicContent musicContent = new MusicContent();
4
4FunApp/4Fun
server/4FunServer/src/com/mollychin/servlet/LoginServlet.java
[ "public class User {\n\tprivate String userName;\n\tprivate String password;\n\tprivate int sex;\n\tprivate String email;\n\n\tpublic String getUserName() {\n\t\treturn userName;\n\t}\n\n\tpublic void setUserName(String userName) {\n\t\tthis.userName = userName;\n\t}\n\n\tpublic String getPassword() {\n\t\treturn p...
import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.mollychin.bean....
package com.mollychin.servlet; @WebServlet("/LoginServlet") public class LoginServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static int STATE_CODE = ConstantsUtil.LOGIN_USER_ERROR_CODE; protected void doGet(HttpServletRequest request, HttpServletResponse response) thro...
User user = JDBCUtil.userVerify(userName, password);
0
onepf/OPFPush
opfpush/src/test/java/org/onepf/opfpush/OPFPushHelperTest.java
[ "@SuppressWarnings(\"PMD.MissingStaticMethodInNonInstantiatableClass\")\npublic final class Configuration {\n\n @NonNull\n private final List<PushProvider> providers;\n\n @Nullable\n private final EventListener eventListener;\n\n @Nullable\n private final CheckManifestHandler checkManifestHandler;...
import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.Log; import junit.framework.Assert; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; imp...
package org.onepf.opfpush; /** * @author antonpp * @since 14.04.15 */ @Config(sdk = JELLY_BEAN_MR2, manifest = Config.NONE) @RunWith(RobolectricTestRunner.class) public class OPFPushHelperTest extends Assert { private static final String TAG = OPFPushHelperTest.class.getSimpleName(); private static fi...
final Configuration configuration = new Configuration.Builder()
0
peshkira/c3po
c3po-core/src/test/java/com/petpet/c3po/dao/MongoPersistenceLayerTest.java
[ "public class Element implements Model {\n\n /**\n * A back-end related identifier of this object.\n */\n private String id;\n\n /**\n * The collection to which the current element belongs.\n */\n private String collection;\n\n /**\n * Some non-unique name of this element.\n */\n private String na...
import static org.junit.Assert.*; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import junit.framework.Assert; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import ...
/******************************************************************************* * 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 * ...
this.pLayer.remove(Element.class, null);
0
supaldubey/storm
src/test/java/in/cubestack/android/lib/storm/criteria/ProjectionTest.java
[ "public class StormException extends Exception {\r\n\r\n\tprivate static final long serialVersionUID = -563476450614494464L;\r\n\r\n\tpublic StormException(Throwable throwable) {\r\n\t\tsuper(throwable);\r\n\t}\r\n\t\r\n\tpublic StormException(String msg) {\r\n\t\tsuper(msg);\r\n\t}\r\n\r\n\tpublic StormException(S...
import org.junit.Assert; import org.junit.Before; import org.junit.Test; import in.cubestack.android.lib.storm.core.StormException; import in.cubestack.android.lib.storm.core.StormRuntimeException; import in.cubestack.android.lib.storm.criteria.Projection; import in.cubestack.android.lib.storm.criteria.StormProje...
/** * */ package in.cubestack.android.lib.storm.criteria; /** * A core Android SQLite ORM framework build for speed and raw execution. * Copyright (c) 2014 CubeStack. Version built for Flash Back.. * <p/> * Permission is hereby granted, free of charge, to any person obtaining a copy * of this sof...
Assert.assertTrue(exception instanceof StormRuntimeException);
1
pulsarIO/druid-kafka-ext
kafka-eight-ex/src/main/java/com/ebay/pulsar/druid/firehose/kafka/support/BasePartitionCoordinator.java
[ "public interface AssignorContext {\n\t/**\n\t * get ZKConnector.\n\t * \n\t * @return\n\t */\n\tpublic ZKConnector<?> getZkConnector();\n\t/**\n\t * get SimpleController\n\t * @return\n\t */\n\tpublic SimpleController getController() ;\n\t/**\n\t * get KafkaConsumer\n\t * \n\t * @return\n\t */\n\tpublic KafkaConsu...
import java.util.List; import java.util.Map; import java.util.Set; import com.ebay.pulsar.druid.firehose.kafka.support.api.AssignorContext; import com.ebay.pulsar.druid.firehose.kafka.support.api.PartitionCoordinatorStrategy; import com.ebay.pulsar.druid.firehose.kafka.support.data.KafkaConsumerConfig; import com.ebay....
/******************************************************************************* * Copyright © 2012-2015 eBay Software Foundation * This program is licensed under the Apache 2.0 licenses. * Please see LICENSE for more information. *******************************************************************************/ packa...
RebalanceResult rr=calculate(ctx.getConsumer().getConsumerId().toString(),partitions,allConsumers,view);
4
priiduneemre/btcd-cli4j
daemon/src/main/java/com/neemre/btcdcli4j/daemon/DaemonConfigurator.java
[ "@Getter\n@ToString\n@AllArgsConstructor\npublic enum NodeProperties {\n\t\n RPC_PROTOCOL(\"node.bitcoind.rpc.protocol\", \"http\"),\n RPC_HOST(\"node.bitcoind.rpc.host\", \"127.0.0.1\"),\n RPC_PORT(\"node.bitcoind.rpc.port\", \"8332\"),\n RPC_USER(\"node.bitcoind.rpc.user\", \"user\"),\n RPC_PASSWOR...
import java.util.EnumSet; import java.util.Map; import java.util.Set; import java.util.concurrent.Future; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.neemre.btcdcli4j.core.NodeProperties; import com.neemre.btcdcli4j.core.client.BtcdClient; import com.neemre.btcdcli4j.core.common.AgentConfigurato...
package com.neemre.btcdcli4j.daemon; public class DaemonConfigurator extends AgentConfigurator { private static final Logger LOG = LoggerFactory.getLogger(DaemonConfigurator.class); @Override public Set<NodeProperties> getRequiredProperties() { return EnumSet.of(NodeProperties.ALERT_PORT, NodeProperties.BLO...
public boolean checkNodeLiveness(Info info) {
4
thomasjungblut/tjungblut-graph
test/de/jungblut/graph/partition/StoerWagnerMinCutTest.java
[ "public final class AdjacencyList<VERTEX_ID, VERTEX_VALUE, EDGE_VALUE>\n implements Graph<VERTEX_ID, VERTEX_VALUE, EDGE_VALUE> {\n\n private final HashSet<Vertex<VERTEX_ID, VERTEX_VALUE>> vertexSet = new HashSet<>();\n private final HashMap<VERTEX_ID, Vertex<VERTEX_ID, VERTEX_VALUE>> vertexMap = new Ha...
import de.jungblut.graph.AdjacencyList; import de.jungblut.graph.Graph; import de.jungblut.graph.Tuple; import de.jungblut.graph.model.Edge; import de.jungblut.graph.model.Vertex; import de.jungblut.graph.model.VertexImpl; import org.junit.Assert; import org.junit.Test; import java.util.Arrays; import java.util.HashSet...
package de.jungblut.graph.partition; public class StoerWagnerMinCutTest { @Test public void minCutHappyPathWikipediaExampleGraph() { Graph<Integer, String, Integer> g = minCutExampleGraph(); StoerWagnerMinCut<Integer, String>.MinCut minCut = new StoerWagnerMinCut<Integer, String>().computeMi...
g.addVertex(new VertexImpl<>("a", 1));
5
UweTrottmann/MovieTracker
SeriesGuideMovies/src/com/uwetrottmann/movies/util/TraktTask.java
[ "public class ServiceManager {\n /** API key. */\n private String apiKeyValue;\n /** User email. */\n private String username;\n /** User password. */\n private String password_sha;\n /** Connection timeout (in milliseconds). */\n private Integer connectionTimeout;\n /** Read timeout (in ...
import com.jakewharton.trakt.enumerations.Rating; import com.jakewharton.trakt.services.MovieService.CheckinBuilder; import com.uwetrottmann.androidutils.AndroidUtils; import com.uwetrottmann.movies.R; import com.uwetrottmann.movies.entities.TraktStatus; import com.uwetrottmann.movies.ui.CancelCheckInDialogFragment; im...
/* * Copyright 2012 Uwe Trottmann * * 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 ...
} catch (TraktException te) {
1
achellies/AtlasForAndroid
src/android/taobao/atlas/framework/Framework.java
[ "public class BundleArchive implements Archive {\n public static final String REVISION_DIRECTORY = \"version\";\n private File bundleDir;\n private final BundleArchiveRevision currentRevision;\n private final SortedMap<Long, BundleArchiveRevision> revisions;\n\n public BundleArchive(String str, File ...
import android.annotation.SuppressLint; import android.os.Build; import android.os.Build.VERSION; import android.taobao.atlas.framework.bundlestorage.BundleArchive; import android.taobao.atlas.log.Logger; import android.taobao.atlas.log.LoggerFactory; import android.taobao.atlas.runtime.ClassNotFoundInterceptorCallback...
CLASSLOADER_BUFFER_SIZE = getProperty("android.taobao.atlas.classloader.buffersize", (int) PlayerConstant.PLAYER_PLATFORM_WMWEB); LOG_LEVEL = getProperty("android.taobao.atlas.log.level", 6); DEBUG_BUNDLES = getProperty("android.taobao.atlas.debug.bundles", false); DEBUG_PACKAGES = getPr...
String join = StringUtils.join(writeAheads.toArray(), SymbolExpUtil.SYMBOL_COMMA);
7
dubreuia/intellij-plugin-save-actions
src/main/java/com/dubreuia/core/component/Engine.java
[ "public enum ExecutionMode {\n\n /**\n * When the plugin is called normally (the IDE calls the plugin component on frame deactivation or \"save all\"). The\n * {@link #saveSingle} is also called on every document.\n *\n * @see FileDocumentManager#saveAllDocuments()\n */\n saveAll,\n\n /...
import com.dubreuia.core.ExecutionMode; import com.dubreuia.core.service.SaveActionsService; import com.dubreuia.model.Action; import com.dubreuia.model.Storage; import com.dubreuia.processors.Processor; import com.dubreuia.processors.Result; import com.dubreuia.processors.ResultCode; import com.dubreuia.processors.Sav...
/* * The MIT License (MIT) * * Copyright (c) 2020 Alexandre DuBreuil * * 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 * t...
List<SimpleEntry<Action, Result<ResultCode>>> results = processorsEligible.stream()
6
mpostelnicu/wicket-spring-jpa-bootstrap-boilerplate
web/src/main/java/org/sample/web/pages/edits/AbstractEditPage.java
[ "public abstract class IndicatingAjaxBootstrapCancelButton extends IndicatingAjaxButton {\r\n\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t/**\r\n\t * @param id\r\n\t * @param model\r\n\t */\r\n\tpublic IndicatingAjaxBootstrapCancelButton(String id, IModel<String> model) {\r\n\t\tsuper(id, model);...
import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.IModel; import org.apache.wicket.model.Model; import org.apache.wicket.request.mapper.parameter.PageParameters; import org.apache.wi...
/** * */ package org.sample.web.pages.edits; /** * @author mpostelnicu * */ public abstract class AbstractEditPage<T extends AbstractPersistable<Long>> extends HeaderFooter { private static final long serialVersionUID = 1L; public static final String PARAM_ID="id"; protected abstract T ne...
add(new IndicatingAjaxBootstrapCancelButton("cancel", new Model<>("Cancel")) {
0
patrickfav/density-converter
src/main/java/at/favre/tools/dconvert/converters/scaling/ImageHandler.java
[ "public class Arguments implements Serializable {\n private static final long serialVersionUID = 7;\n\n public static final float DEFAULT_SCALE = 3f;\n public static final float DEFAULT_COMPRESSION_QUALITY = 0.9f;\n public static final int DEFAULT_THREAD_COUNT = 4;\n public static final int MAX_THREA...
import at.favre.tools.dconvert.arg.Arguments; import at.favre.tools.dconvert.arg.EScalingAlgorithm; import at.favre.tools.dconvert.arg.ImageType; import at.favre.tools.dconvert.util.LoadedImage; import at.favre.tools.dconvert.util.MiscUtil; import at.favre.tools.dconvert.util.NinePatchScaler; import com.twelvemonkeys.i...
/* * Copyright 2016 Patrick Favre-Bulle * * 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 ...
List<ImageType.ECompression> compressionList = Arguments.getOutCompressionForType(args.outputCompressionMode, Arguments.getImageType(imageData.getSourceFile()));
2
spgroup/groundhog
src/java/test/br/ufpe/cin/groundhog/search/SearchGitHubTest.java
[ "@Entity(\"commits\")\npublic class Commit extends GitHubEntity {\n\t@SerializedName(\"sha\")\n @Indexed(unique=true, dropDups=true)\n\t@Id private String sha;\n\t\n\t@SerializedName(\"commiter\")\n\t@Reference private User commiter;\n\t\n\t@SerializedName(\"message\")\n\tprivate String message;\n\t\n\t@Referenc...
import java.util.List; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import br.ufpe.cin.groundhog.Commit; import br.ufpe.cin.groundhog.Contributor; import br.ufpe.cin.groundhog.Language; import br.ufpe.cin.groundhog.Project; import br.ufpe.cin.groundhog.Release; import br.ufpe.cin.groundhog.S...
package br.ufpe.cin.groundhog.search; public class SearchGitHubTest { private SearchGitHub searchGitHub; private Project fakeProject; @Before public void setup() { Injector injector = Guice.createInjector(new SearchModule(), new HttpModule()); searchGitHub = injector.getInstance(SearchGitHub.class); U...
List<Contributor> contributors = searchGitHub.getAllProjectContributors(project);
1
cloudera/director-aws-plugin
provider/src/main/java/com/cloudera/director/aws/ec2/allocation/ondemand/OnDemandAllocator.java
[ "public static final String INSTANCE_LIMIT_EXCEEDED = \"InstanceLimitExceeded\";", "public static final String INSUFFICIENT_INSTANCE_CAPACITY = \"InsufficientInstanceCapacity\";", "public class AWSExceptions {\n\n private static final Logger LOG = LoggerFactory.getLogger(AWSExceptions.class);\n\n /**\n * Er...
import static com.cloudera.director.aws.AWSExceptions.INSTANCE_LIMIT_EXCEEDED; import static com.cloudera.director.aws.AWSExceptions.INSUFFICIENT_INSTANCE_CAPACITY; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.Iterables.getOnlyElement; import static java.util...
// (c) Copyright 2018 Cloudera, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
public Collection<EC2Instance> allocate() throws InterruptedException {
3
Labs64/NetLicensingClient-java
NetLicensingClient/src/test/java/com/labs64/netlicensing/service/ProductModuleServiceTest.java
[ "public final class Constants {\n\n private Constants() {\n }\n\n // CHECKSTYLE:OFF\n\n public static final String ID = \"id\";\n public static final String ACTIVE = \"active\";\n public static final String NUMBER = \"number\";\n public static final String NAME = \"name\";\n public static fi...
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.util.HashMap; import java.util.Map; import javax.ws.rs.Path; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import...
/* 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 in writing, software * distribute...
final ProductModule newModule = new ProductModuleImpl();
2
chenyihan/Simple-SQLite-ORM-Android
src/org/cyy/fw/android/dborm/sqlite/SqliteDBFacade.java
[ "public class AnnotationORMapper extends AbstractORMapper {\n\tprivate static final String TAG = \"AnnotationORMapper\";\n\n\t@Override\n\tprotected ORMapInfo createORMap(Class<?> clazz, String tableName) {\n\t\tORMapInfo mapInfo = new ORMapInfo();\n\t\tmapInfo.setClazz(clazz);\n\t\tmapInfo.setTableName(tableName);...
import java.util.Map; import org.cyy.fw.android.dborm.AnnotationORMapper; import org.cyy.fw.android.dborm.DBAccessException; import org.cyy.fw.android.dborm.ORMapper; import org.cyy.fw.android.dborm.OneToAny; import org.cyy.fw.android.dborm.SQLObject; import org.cyy.fw.android.dborm.UUIDGenerator; import org.cyy...
package org.cyy.fw.android.dborm.sqlite; /** * * SQLite DB Accessed Facade, called by application code.<br> * The facade provides several interface for DB accessing with a OO style by * simple O-R mapping, such as {@link #query(Class, Object)}, * {@link #insert(Object)}, {@link #update(Object, Objec...
private UniqueIDGenerator mIDGenerator;
5
ni3po42/traction.mvc
Demo/src/main/java/ni3po42/android/tractiondemo/views/SwipeEntryView.java
[ "public class UIProperty<T>\nimplements IUIElement<T>\n{\t\t\t\t\n\tprotected String path;\n protected T tempValue;\n\n\tprivate IUIElement.IUIUpdateListener<T> updateListener;\t\t\n\t\n\tprivate boolean _isUpdating;\n\t\n\tprotected String pathAttribute = null;\n\tprotected final IViewBinding parentViewBinding;...
import android.animation.Animator; import android.animation.ObjectAnimator; import android.content.Context; import android.util.AttributeSet; import android.widget.LinearLayout; import traction.mvc.implementations.ui.UIProperty; import traction.mvc.implementations.ui.viewbinding.ViewBindingHelper; import traction.mvc.i...
/* Copyright 2013 Tim Stratton Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
Active.setUIUpdateListener(new IUIElement.IUIUpdateListener<Boolean>() {
3
ccrama/Slide-RSS
app/src/main/java/me/ccrama/rssslide/Widget/ListViewWidgetService.java
[ "public class BaseApplication extends Application {\n\n public static RealmConfiguration config;\n private static ImageLoader defaultImageLoader;\n public static ImageLoader getImageLoader(Context context) {\n if (defaultImageLoader == null || !defaultImageLoader.isInited()) {\n ImageLoad...
import android.appwidget.AppWidgetManager; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.text.Html; import android.view.View; import android.widget.RemoteViews; import android.widget.RemoteViewsService; import java.util.ArrayList; import io.realm.Realm; import m...
package me.ccrama.rssslide.Widget; /** * Created by carlo_000 on 5/4/2016. */ public class ListViewWidgetService extends RemoteViewsService { public RemoteViewsFactory onGetViewFactory(Intent intent) { return new ListViewRemoteViewsFactory(this.getApplicationContext(), intent, "android", ...
BaseApplication.getImageLoader(mContext)
0
s4/core
src/main/java/io/s4/MainApp.java
[ "public class PEContainer implements Runnable, AsynchronousEventProcessor {\n private static Logger logger = Logger.getLogger(PEContainer.class);\n BlockingQueue<EventWrapper> workQueue;\n private List<PrototypeWrapper> prototypeWrappers = new ArrayList<PrototypeWrapper>();\n private Monitor monitor;\n ...
import io.s4.processor.PEContainer; import io.s4.processor.ProcessingElement; import io.s4.util.S4Util; import io.s4.util.Watcher; import io.s4.util.clock.Clock; import io.s4.util.clock.EventClock; import java.io.File; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.uti...
.withDescription("configuration type") .create("t")); CommandLineParser parser = new GnuParser(); CommandLine commandLine = null; String clockType = "wall"; try { commandLine = parser.parse(option...
Clock s4Clock = (Clock) context.getBean("clock");
4
ryft/NetVis
workspace/netvis/src/netvis/visualisations/MulticubeVisualisation.java
[ "public class DataController implements ActionListener {\n\tDataFeeder dataFeeder;\n\tTimer timer;\n\tfinal List<DataControllerListener> listeners;\n\tfinal List<PacketFilter> filters;\n\tfinal List<Packet> allPackets;\n\tfinal List<Packet> filteredPackets;\n\tprivate int noUpdated = 0;\n\tprotected int intervalsCo...
import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.glu.GLU; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JComboBo...
package netvis.visualisations; public class MulticubeVisualisation extends Visualisation { private GLU glu; private GLUT glut; private boolean spin; private float yrot = 0; private Normaliser xNormalizer, yNormalizer, zNormalizer; private static final long serialVersionUID = 1L; public MulticubeVisualisati...
VisControlsContainer visControlsContainer) {
5
MarWoes/viper
src/test/java/de/imi/marw/viper/test/variants/ProgressManagerTest.java
[ "public class TestUtil {\n\n public static String getResourceFile(String fileName) {\n // see https://stackoverflow.com/questions/24499692/access-resources-in-unit-tests\n try {\n URI uri = TestUtil.class.getClassLoader().getResource(fileName).toURI();\n return uri.getRawPath(...
import de.imi.marw.viper.test.util.TestUtil; import de.imi.marw.viper.variants.VariantClusterBuilder; import de.imi.marw.viper.variants.table.CsvTableReader; import de.imi.marw.viper.variants.table.DecisionManager; import de.imi.marw.viper.variants.table.VariantTable; import java.io.IOException; import static org.junit...
/* Copyright (c) 2017 Marius Wöste * * This file is part of VIPER. * * VIPER is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * ...
VariantTable unclustered = new CsvTableReader(';', ",").readTable(TestUtil.getResourceFile("examples-unclustered.csv"));
2
chimenchen/jchmlib
src/app/java/org/jchmlib/app/ChmWeb.java
[ "public class ChmCollectFilesEnumerator implements ChmEnumerator {\n\n public final ArrayList<ChmUnitInfo> files;\n\n public ChmCollectFilesEnumerator() {\n files = new ArrayList<ChmUnitInfo>();\n }\n\n public void enumerate(ChmUnitInfo ui) {\n files.add(ui);\n }\n}", "public class Ch...
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; import java.net.SocketException; import java.nio.ByteBuffer; import java.util.ArrayList; imp...
return listen_socket.getLocalPort(); } } public String getChmTitle() { if (chmFile == null) { return ""; } else { return chmFile.getTitle(); } } public String getChmFilePath() { return chmFilePath == null ? "" : chmFilePath; ...
private HttpRequest request;
6
in-the-keyhole/khs-sherpa
src/main/java/com/khs/sherpa/SherpaContextListener.java
[ "public interface ApplicationContext extends ManagedBeanFactory {\n\n\tpublic static final String CONTEXT_PATH = \"com.khs.sherpa.SHREPA.CONTEXT\";\n\tpublic static final String SHERPA_CONTEXT = \"com.khs.sherpa.SHREPA.CONTEXT\";\n\t\n\tpublic static final String SETTINGS_JSONP = \"com.khs.sherpa.SETTGINS.JSONP\";\...
import com.khs.sherpa.context.factory.InitManageBeanFactory; import com.khs.sherpa.context.factory.ManagedBeanFactory; import com.khs.sherpa.exception.SherpaRuntimeException; import com.khs.sherpa.parser.CalendarParamParser; import com.khs.sherpa.parser.DateParamParser; import com.khs.sherpa.parser.StringParamParser; i...
package com.khs.sherpa; /* * Copyright 2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * U...
applicationContext.setAttribute(CalendarParamParser.DEFAULT, settings.dateFormat());
5
romainmoreau/e-paper
e-paper-jaxb-api/src/main/java/fr/romainmoreau/epaper/jaxb/api/DrawTable.java
[ "public enum Color {\n\tBLACK, DARK_GRAY, LIGHT_GRAY, WHITE;\n}", "public interface EPaperClient extends Closeable {\n\tstatic final int WIDTH = 800;\n\n\tstatic final int HEIGHT = 600;\n\n\tvoid drawImage(int x, int y, InputStream inputStream) throws IOException, EPaperException;\n\n\tvoid refreshAndUpdate() thr...
import java.io.IOException; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import fr.romainmoreau.epaper.client.api.Color; import fr.romainmoreau.epaper.client.api.EPaperClient; import fr.romainmoreau...
package fr.romainmoreau.epaper.jaxb.api; public class DrawTable implements Command { private int x0; private int y0; private int x1; private int y1; private List<Column> columns; private List<Border> verticalBorders; private List<Row> rows; private List<Border> horizontalBorders;
private List<Cell> cells;
4
8enet/AppOpsX
opsxpro/src/main/java/com/zzzmode/appopsx/ApiSupporter.java
[ "public class UserInfo {\n public int id;\n public int serialNumber;\n public String name;\n public String iconPath;\n public int flags;\n\n\n public boolean isPrimary() {\n return false;\n }\n\n public boolean isAdmin() {\n return false;\n }\n\n public boolean isManagedProfile() {\n return false...
import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.UserInfo; import android.os.Bundle; import android.util.Log; import com.zzzmode.appopsx.common.CallerResult; import com.zzzmode.appopsx.common.ClassCaller; import com.zzzmode.appopsx.common.SystemServiceCaller; import com.z...
package com.zzzmode.appopsx; public class ApiSupporter { private static final String TAG = "ApiSupporter"; private LocalServerManager localServerManager; ApiSupporter(LocalServerManager localServerManager) { this.localServerManager = localServerManager; } private void checkConnection() throws Except...
CallerResult callerResult = localServerManager.execNew(caller);
1
lukaspili/Volley-Ball
samples/src/main/java/com/siu/android/volleyball/samples/activity/scenarios/Scenario3Activity.java
[ "@SuppressWarnings(\"rawtypes\")\npublic class BallRequestQueue { //extends RequestQueue {\n\n /**\n * Used for generating monotonically-increasing sequence numbers for requests.\n */\n private AtomicInteger mSequenceGenerator = new AtomicInteger();\n\n /**\n * Staging area for requests that al...
import com.siu.android.volleyball.BallRequestQueue; import com.siu.android.volleyball.samples.volley.fake.FakeCache; import com.siu.android.volleyball.samples.volley.fake.FakeNetwork; import com.siu.android.volleyball.samples.volley.request.ScenarioRequest; import com.siu.android.volleyball.toolbox.VolleyBall; import c...
package com.siu.android.volleyball.samples.activity.scenarios; /** * Scenario 3 * <p/> * 1. Start the request * 2. Cache thread misses * 3. Network thread returns valid response -> post a final response * 4. Local thread returns valid response -> ignored * 5. End */ public class Scenario3Activity extends Scen...
return VolleyBall.newRequestQueue(new VolleyBallConfig.Builder(this)
5
colormine/colormine
demo/src/org/colormine/servlet/ColorMappingServlet.java
[ "public class ColorImage implements Image {\n\n\tprivate BufferedImage _image;\n\n\t/**\n\t * Create from BufferedImage\n\t * \n\t * @param image\n\t */\n\tpublic ColorImage(BufferedImage image) {\n\t\t_image = image;\n\t}\n\n\t/**\n\t * Gets image width\n\t * \n\t * @return image width\n\t */\n\t@Override\n\tpubli...
import java.awt.Color; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Map; import javax.imageio.ImageIO; import javax.servlet.ServletException; import javax.servlet.annotation.MultipartConfig; import javax.servlet.http.HttpServlet;...
package org.colormine.servlet; @MultipartConfig public class ColorMappingServlet extends HttpServlet { private static final long serialVersionUID = -3765738018606119921L; public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request,...
ColorImage colorImage = new ColorImage(image);
0
Darkona/AdventureBackpack2
src/main/java/com/darkona/adventurebackpack/item/ItemHose.java
[ "public class CreativeTabAB\n{\n\n public static final CreativeTabs ADVENTURE_BACKPACK_CREATIVE_TAB = new CreativeTabs(ModInfo.MOD_ID.toLowerCase())\n {\n @Override\n public Item getTabIconItem()\n {\n return ModItems.machete;\n }\n\n @Override\n public Str...
import com.darkona.adventurebackpack.CreativeTabAB; import com.darkona.adventurebackpack.common.Constants; import com.darkona.adventurebackpack.common.ServerActions; import com.darkona.adventurebackpack.fluids.FluidEffectRegistry; import com.darkona.adventurebackpack.init.ModFluids; import com.darkona.adventurebackpack...
package com.darkona.adventurebackpack.item; /** * Created by Darkona on 12/10/2014. */ public class ItemHose extends ItemAB { IIcon drinkIcon; IIcon spillIcon; IIcon suckIcon; final byte HOSE_SUCK_MODE = 0; final byte HOSE_SPILL_MODE = 1; final byte HOSE_DRINK_MODE = 2; public ItemHose...
InventoryBackpack inv = new InventoryBackpack(backpack);
5
GoogleCloudPlatform/endpoints-codelab-android
todoTxtTouch/src/main/java/com/todotxt/todotxttouch/TodoApplication.java
[ "@SuppressWarnings(\"serial\")\npublic class RemoteConflictException extends RemoteException {\n public RemoteConflictException(String message) {\n super(message);\n }\n\n public RemoteConflictException(String message, Throwable cause) {\n super(message, cause);\n }\n}", "public enum Pri...
import android.os.AsyncTask; import android.preference.PreferenceManager; import android.util.Log; import com.todotxt.todotxttouch.remote.RemoteConflictException; import com.todotxt.todotxttouch.task.Priority; import com.todotxt.todotxttouch.task.Sort; import com.todotxt.todotxttouch.task.TaskBag; import com.todotxt.to...
/** * This file is part of Todo.txt for Android, an app for managing your todo.txt file (http://todotxt.com). * * Copyright (c) 2009-2013 Todo.txt for Android contributors (http://todotxt.com) * * LICENSE: * * Todo.txt for Android is free software: you can redistribute it and/or modify it under the terms of the ...
public Sort sort = Sort.PRIORITY_DESC;
2
recommenders/rival
rival-split/src/main/java/net/recommenders/rival/split/parser/LastfmCelma1KParser.java
[ "public class DataModelFactory {\n\n public static <U, I> DataModelIF<U, I> getDefaultModel() {\n return getSimpleModel();\n }\n\n public static <U, I> TemporalDataModelIF<U, I> getDefaultTemporalModel() {\n return getSimpleTemporalModel();\n }\n\n public static <U, I> DataModelIF<U, I>...
import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import net.recommenders.rival.core.DataModelFactory; import net.reco...
/* * Copyright 2015 recommenders.net. * * 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...
BufferedReader br = SimpleParser.getBufferedReader(f);
3
yammer/tenacity
tenacity-core/src/test/java/com/yammer/tenacity/tests/TenacityContainerExceptionMapperTest.java
[ "public class TenacityAuthenticator<C, P extends Principal> implements Authenticator<C, P> {\n private final Authenticator<C, P> underlying;\n private final TenacityPropertyKey tenacityPropertyKey;\n\n private TenacityAuthenticator(Authenticator<C, P> underlying, TenacityPropertyKey tenacityPropertyKey) {\...
import com.google.common.collect.ImmutableMap; import com.yammer.tenacity.core.auth.TenacityAuthenticator; import com.yammer.tenacity.core.config.BreakerboxConfiguration; import com.yammer.tenacity.core.config.TenacityConfiguration; import com.yammer.tenacity.core.errors.TenacityContainerExceptionMapper; import com.yam...
package com.yammer.tenacity.tests; public class TenacityContainerExceptionMapperTest { @Rule public TenacityTestRule tenacityTestRule = new TenacityTestRule(); @SuppressWarnings("unchecked") private Authenticator<String, Principal> mockAuthenticator = mock(Authenticator.class); private final in...
.addProvider(new TenacityContainerExceptionMapper(statusCode))
3
Catalysts/cat-boot
cat-boot-report-pdf/src/test/java/cc/catalysts/boot/report/pdf/impl/TablePaddingTest.java
[ "public class PdfReport implements AutoCloseable {\n private static final Logger LOG = getLogger(PdfReport.class);\n\n private final String fileName;\n private final DocumentWithResources documentWithResources;\n\n public PdfReport(String fileName, DocumentWithResources documentWithResources) {\n ...
import cc.catalysts.boot.report.pdf.PdfReport; import cc.catalysts.boot.report.pdf.PdfReportService; import cc.catalysts.boot.report.pdf.config.DefaultPdfStyleSheet; import cc.catalysts.boot.report.pdf.config.PdfFont; import cc.catalysts.boot.report.pdf.config.PdfPageLayout; import cc.catalysts.boot.report.pdf.config.P...
package cc.catalysts.boot.report.pdf.impl; /** * Created by sfarcas on 7/21/2016. */ public class TablePaddingTest { private static final Logger LOG = getLogger(TablePaddingTest.class); public static final int IMAGE_SIZE_TOO_BIG_FOR_CELL = 1000; public static final int IMAGE_SIZE_SMALL = 50; priv...
pdfReportService = new PdfReportServiceImpl(new DefaultPdfStyleSheet());
2
mhjabreel/FDTKit
src/fdt/estimators/RandomForest.java
[ "public class IntermediateNode extends IntermediateNodeBase {\n\n private static final long serialVersionUID = -1668837612685717472L;\n \n \n private final HashMap<String, Double> classesLambdas = new HashMap<>();\n \n private Nullable<Double> lambda = Nullable.empty();\n \n /**\n *\n ...
import fdt.core.IntermediateNode; import fdt.core.Node; import fdt.core.TrainableIntermediateNode; import fdt.data.Dataset; import fdt.infer.InferenceModelSpec; import fdt.infer.InferenceTreeEstimator; import fdt.utils.RandomFactory; import fdt.utils.Tuple; import java.util.ArrayList; import java.util.Arrays; import ja...
package fdt.estimators; /** * * @author Mohammed Jabreel */ /** * Thus class is used to train a fuzzy random forest. * **/ public class RandomForest implements Estimator{ /** * The number of the trees in the random forest (n). */ protected int numOfEstimators = 100; /** * The...
RandomFactory.setSeed(i - numOfEstimators);
6
Zhuinden/simple-stack
samples/basic-samples/simple-stack-example-basic-java-view/src/main/java/com/zhuinden/navigationexampleview/application/MainActivity.java
[ "@AutoValue\npublic abstract class DashboardKey extends BaseKey {\n public static DashboardKey create() {\n return new AutoValue_DashboardKey();\n }\n\n @Override\n public int layout() {\n return R.layout.dashboard_view;\n }\n}", "@AutoValue\npublic abstract class HomeKey extends Base...
import android.os.Bundle; import com.zhuinden.navigationexampleview.R; import com.zhuinden.navigationexampleview.databinding.ActivityMainBinding; import com.zhuinden.navigationexampleview.screens.DashboardKey; import com.zhuinden.navigationexampleview.screens.HomeKey; import com.zhuinden.navigationexampleview.screens.N...
package com.zhuinden.navigationexampleview.application; public class MainActivity extends AppCompatActivity { private ActivityMainBinding binding; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); binding = ActivityMainBinding.in...
backstack.setHistory(History.of(NotificationKey.create()), StateChange.REPLACE);
2
stacksync/sync-service
src/main/java/com/stacksync/syncservice/handler/SQLSyncHandler.java
[ "public abstract class ConnectionPool {\n\n\tpublic abstract Connection getConnection() throws SQLException;\n\n}", "public class DAOException extends Exception {\n\n\tprivate static final long serialVersionUID = 1L;\n\tprivate DAOError error;\n\t/**\n * Constructs a DAOException with the given detail message...
import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import java.util.UUID; import org.apache.log4j.Logger; import com.stacksync.commons.models.Device; import com.stacksync.commons.models.ItemMetadata; import com.stacksync.commons.models.User; import com.stacksync.commons.models.Workspace; i...
package com.stacksync.syncservice.handler; public class SQLSyncHandler extends Handler implements SyncHandler { private static final Logger logger = Logger.getLogger(SQLSyncHandler.class.getName());
public SQLSyncHandler(ConnectionPool pool) throws SQLException, NoStorageManagerAvailable {
0
celiosilva/leitoor
leitoor/src/main/java/br/com/delogic/leitoor/service/AutenticacaoService.java
[ "@Entity\n@DiscriminatorValue(\"ALUNO\")\npublic class Aluno extends Usuario {\n\n}", "@Entity\n@DiscriminatorValue(\"PROFESSOR\")\npublic class Professor extends Aluno {\n\n}", "@Entity\n@Inheritance(strategy = InheritanceType.SINGLE_TABLE)\n@DiscriminatorColumn(name = \"PERFIL\", length = 50)\npublic abstract...
import br.com.delogic.leitoor.entidade.Aluno; import br.com.delogic.leitoor.entidade.Professor; import br.com.delogic.leitoor.entidade.Usuario; import br.com.delogic.leitoor.exception.LeitoorException; import br.com.delogic.leitoor.exception.RegraNegocioException; import br.com.delogic.leitoor.model.Cadastro; import br...
package br.com.delogic.leitoor.service; public interface AutenticacaoService { RegraNegocioException CONVITE_INVALIDO_EXCEPTION = new RegraNegocioException("Esse convite não é válido"); RegraNegocioException SENHAS_DIFERENTES_EXCEPTION = new RegraNegocioException("As se...
Aluno getAlunoAutenticado();
0
hehonghui/simpledb
app/src/main/java/com/simple/simpledatabase/model/BookModel.java
[ "public interface DbListener<T> {\n void onComplete(T result);\n}", "public class BookDao extends AbsDAO<Book> {\n\n public BookDao() {\n super(\"books\");\n }\n\n @Override\n protected ContentValues convert(Book item) {\n ContentValues newValues = new ContentValues();\n newVal...
import com.simple.database.listeners.DbListener; import com.simple.simpledatabase.dao.BookDao; import com.simple.simpledatabase.domain.Book; import java.util.List; import static com.simple.database.DatabaseHelper.deleteFrom; import static com.simple.database.DatabaseHelper.insertInto; import static com.simple.database....
package com.simple.simpledatabase.model; /** * 接口使用 * Created by mrsimple on 13/8/16. */ public class BookModel { /** * 插入数据 * * @param aBook */ public void insertBook(Book aBook) {
insertInto(BookDao.class).withItem(aBook).execute();
4
tastybento/askygrid
src/com/wasteofplastic/askygrid/commands/AdminCmd.java
[ "public class ASkyGrid extends JavaPlugin {\n // This plugin\n private static ASkyGrid plugin;\n // The ASkyGrid world\n private static World gridWorld = null;\n private static World netherWorld = null;\n private static World endWorld = null;\n // Player folder file\n private File playersFol...
import com.wasteofplastic.askygrid.ASkyGrid; import com.wasteofplastic.askygrid.GridManager; import com.wasteofplastic.askygrid.SafeSpotTeleport; import com.wasteofplastic.askygrid.Settings; import com.wasteofplastic.askygrid.util.Util; import com.wasteofplastic.askygrid.util.VaultHelper; import java.util.ArrayList; im...
/******************************************************************************* * This file is part of ASkyGrid. * * ASkyGrid 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 ...
new SafeSpotTeleport(plugin, player, warpSpot, failureMessage);
2
MagicMicky/HabitRPGJavaAPI
HabitRPGJavaAPI/src/com/magicmicky/habitrpglibrary/onlineapi/BuyItem.java
[ "public static class SpecialReward extends Reward {\n\tprivate static SpecialReward[] weapons= {\n\t\t new SpecialReward(0, \"Training Sword\",\"weapon_0\",\"Training weapon.\",0,0),\n\t\t new SpecialReward(1, \"Sword\",\"weapon_1\",\"Increases experience gain by 3%.\",3,20),\n\t\t new SpecialReward(2, \"A...
import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.json.JSONObject; import com.magicmicky.habitrpglibrary.habits.Reward.SpecialReward; import com.magicmicky.habitrpglibrary.habits.User; import com.magicmicky.habitrpglibrary.habits.UserLook; import com.magic...
package com.magicmicky.habitrpglibrary.onlineapi; public class BuyItem extends WebServiceInteraction { private final static String CMD = "user/buy/";
private SpecialReward itemBought;
0
onepf/OPFPush
samples/pushchat/src/main/java/org/onepf/pushchat/PushChatApplication.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.app.Application; import com.squareup.leakcanary.LeakCanary; import com.squareup.leakcanary.RefWatcher; import org.onepf.opfpush.OPFPush; import org.onepf.opfpush.adm.ADMProvider; import org.onepf.opfpush.configuration.Configuration; import org.onepf.opfpush.gcm.GCMProvider; import org.onepf.opfpush.nokia...
/* * Copyright 2012-2015 One Platform Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
uuid = UuidGenerator.generateUuid(this);
6
ghelmling/beeno
src/java/meetup/beeno/EntityService.java
[ "public class EntityInfo {\n\tprivate Class entityClass = null;\n\tprivate String table = null;\n\tprivate PropertyDescriptor keyProperty = null;\n\t\n\tprivate List<FieldMapping> mappedProps = new ArrayList<FieldMapping>();\n\tprivate Map<String, PropertyDescriptor> propertiesByName = new HashMap<String, PropertyD...
import java.beans.PropertyDescriptor; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.uti...
package meetup.beeno; /** * Parameterized class to handle basic data access requirements for HBase mapped entities. * * TODO: With the update to 0.20, we're no longer clearing values when an entity field is set * to NULL!!! This is a major flaw in the generic implementation, but is not a usage we really * h...
private EntityInfo defaultInfo;
0
makemyownlife/newdda-client
src/main/java/com/elong/pb/newdda/client/router/parser/SqlVisitorRegistry.java
[ "public enum DatabaseType {\n\n H2, MySQL, Oracle, SQLServer, DB2;\n\n public static DatabaseType valueFrom(final String databaseName) {\n try {\n return DatabaseType.valueOf(databaseName);\n } catch (final IllegalArgumentException ex) {\n throw new DatabaseTypeUnsupportedE...
import com.alibaba.druid.sql.visitor.SQLASTOutputVisitor; import com.elong.pb.newdda.client.constants.DatabaseType; import com.elong.pb.newdda.client.exception.DatabaseTypeUnsupportedException; import com.elong.pb.newdda.client.router.parser.visitor.basic.mysql.MySqlDeleteVisitor; import com.elong.pb.newdda.client.rout...
package com.elong.pb.newdda.client.router.parser; /** * SQL访问器注册表. */ public final class SqlVisitorRegistry { private static final Map<DatabaseType, Class<? extends SQLASTOutputVisitor>> SELECT_REGISTRY = new HashMap<DatabaseType, Class<? extends SQLASTOutputVisitor>>(DatabaseType.values().length); priva...
INSERT_REGISTRY.put(DatabaseType.H2, MySqlInsertVisitor.class);
3
3pillarlabs/socialauth
socialauth-filter/src/main/java/de/deltatree/social/web/filter/impl/SocialAuthSecurityFilter.java
[ "public class SocialAuthManager implements Serializable {\n\n\tprivate static final long serialVersionUID = 1620459182486095613L;\n\tprivate final Log LOG = LogFactory.getLog(SocialAuthManager.class);\n\tprivate AuthProvider authProvider;\n\tprivate String providerId;\n\tprivate String currentProviderId;\n\tprivate...
import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServ...
package de.deltatree.social.web.filter.impl; public class SocialAuthSecurityFilter implements Filter { private static final String VAR_PROPERTIES = "properties"; private SASFProperties props; private DefaultSASFSocialAuthManager sdbSocialAuthManager; @Override public void destroy() { } @Override public ...
SASFHelper h = new DefaultSASFHelper(req, this.props,
1
cjstehno/ersatz
ersatz/src/main/java/io/github/cjstehno/ersatz/impl/ErsatzRequestWithContent.java
[ "public enum HttpMethod {\r\n\r\n /**\r\n * Wildcard matching any HTTP method.\r\n */\r\n ANY(\"*\"),\r\n\r\n /**\r\n * HTTP GET method matcher.\r\n */\r\n GET(\"GET\"),\r\n\r\n /**\r\n * HTTP HEAD method matcher.\r\n */\r\n HEAD(\"HEAD\"),\r\n\r\n /**\r\n * HTTP POS...
import io.github.cjstehno.ersatz.cfg.HttpMethod; import io.github.cjstehno.ersatz.cfg.RequestWithContent; import io.github.cjstehno.ersatz.encdec.DecodingContext; import io.github.cjstehno.ersatz.encdec.RequestDecoders; import io.github.cjstehno.ersatz.encdec.ResponseEncoders; import io.github.cjstehno.ersatz.encd...
/** * Copyright (C) 2022 Christopher J. Stehno * * 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 ...
return param(name, stringIterableMatcher(matchers));
6
kasirgalabs/ETUmulator
src/test/java/com/kasirgalabs/etumulator/visitor/SingleDataMemoryVisitorTest.java
[ "public class Assembler {\n private final Linker linker;\n private final Loader loader;\n\n /**\n * Constructs an Assembler object with the given {@link Memory}. Generated address space layout\n * and the data will be loaded in the memory.\n *\n * @param memory Memory for the allocated data...
import static org.junit.Assert.assertEquals; import com.kasirgalabs.etumulator.lang.Assembler; import com.kasirgalabs.etumulator.processor.BaseProcessor; import com.kasirgalabs.etumulator.processor.BaseProcessorUnits; import com.kasirgalabs.etumulator.processor.Memory; import com.kasirgalabs.etumulator.processor.Memory...
package com.kasirgalabs.etumulator.visitor; public class SingleDataMemoryVisitorTest { private final RegisterFile registerFile; private final Memory memory; private final Processor processor;
private final Assembler assembler;
0
x7hub/Calendar_lunar
src/edu/bupt/calendar/month/MonthByWeekFragment.java
[ "public class CalendarController {\n private static final boolean DEBUG = false;\n private static final String TAG = \"CalendarController\";\n private static final String REFRESH_SELECTION = Calendars.SYNC_EVENTS + \"=?\";\n private static final String[] REFRESH_ARGS = new String[] { \"1\" };\n priva...
import android.app.Activity; import android.app.LoaderManager; import android.content.ContentUris; import android.content.CursorLoader; import android.content.Loader; import android.content.res.Resources; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.CalendarC...
/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by app...
String tz = Utils.getTimeZone(mContext, mTZUpdater);
5
flipkart-incubator/ranger
src/test/java/com/flipkart/ranger/healthservice/ServiceProviderIntegrationTest.java
[ "public class ServiceFinderBuilders {\n \n private ServiceFinderBuilders() {\n throw new InstantiationError(\"Must not instantiate this class\");\n }\n \n public static <T> SimpleShardedServiceFinderBuilder<T> shardedFinderBuilder() {\n return new SimpleShardedServiceFinderBuilder<>();\...
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.flipkart.ranger.ServiceFinderBuilders; import com.flipkart.ranger.ServiceProviderBuilders; import com.flipkart.ranger.finder.unsharded.Unsharded...
/** * Copyright 2016 Flipkart Internet Pvt. 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 ...
.withHealthcheck(Healthchecks.defaultHealthyCheck())
3
cheremin/scalarization
junit-integration/src/test/java/ru/cheremin/scalarization/lab/misc/MapGetWithTupleKeyTest.java
[ "public interface Scenario {\n\tpublic long run();\n}", "public class Utils {\n\tpublic static String[] generateStringArray( final int size ) {\n\t\tfinal String[] keys = new String[size];\n\t\tfor( int i = 0; i < size; i++ ) {\n\t\t\tkeys[i] = String.valueOf( i );\n\t\t}\n\t\treturn keys;\n\t}\n\n\tpublic static...
import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ThreadLocalRandom; import com.google.common.collect.ImmutableMap; import gnu.trove.map.hash.THashMap; import org.junit.Ignore; import org.junit.Test; import ru.cheremin.scalarization.Scenario; import ru.cheremin.scalarization...
package ru.cheremin.scalarization.lab.misc; /** * @author ruslan * created 01/09/16 at 23:18 */ public class MapGetWithTupleKeyTest { public static final int SIZE = 32; private static final Pool<String> KEYS = Utils.randomStringsPool( SIZE ); //TODO RC: ensure keys are different from KEYS!!! privat...
final SimplestMap<StringKey, String> simplestMap = new SimplestMap<>( MAP );
3
reines/game
game-server/src/main/java/com/game/server/handlers/item/EquipableHandler.java
[ "public class Inventory implements Iterable<Item>, Serializable {\n\tprivate static final long serialVersionUID = 1L;\n\n\tpublic static final int MAX_SIZE = 40;\n\n\tprotected List<Item> items;\n\n\tpublic Inventory() {\n\t\titems = new ArrayList<Item>();\n\t}\n\n\tpublic int add(Item item) {\n\t\t// TODO: Handle ...
import com.game.common.model.Inventory; import com.game.common.model.Item; import com.game.server.Server; import com.game.server.WorldManager; import com.game.server.handlers.ItemHandler; import com.game.server.model.Player;
package com.game.server.handlers.item; public class EquipableHandler implements ItemHandler { @Override public void handleItem(Server server, WorldManager world, Player player, Item item, int index) { boolean equiped = !item.isEquiped(); // If we are equiping this item, un-equip anything else that uses the sam...
Inventory inventory = player.getInventory();
0
jenkinsci/priority-sorter-plugin
src/main/java/jenkins/advancedqueue/priority/strategy/PriorityJobProperty.java
[ "public class JobGroup {\n\n\tpublic static class PriorityStrategyHolder {\n\t\tprivate int id = 0;\n\t\tprivate PriorityStrategy priorityStrategy;\n\n\t\tpublic PriorityStrategyHolder() {\n\t\t}\n\n\t\t@DataBoundConstructor\n\t\tpublic PriorityStrategyHolder(int id, PriorityStrategy priorityStrategy) {\n\t\t\tthis...
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import hudson.Extension; import hudson.model.Descriptor.FormException; import hudson.model.Job; import hudson.model.JobProperty; import hudson.model.JobPropertyDescriptor; import hudson.util.ListBoxModel; import java.util.List; import java.util.logging.Logger; ...
/* * The MIT License * * Copyright (c) 2013, Magnus Sandberg * * 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...
return PrioritySorterConfiguration.get().getStrategy().getDefaultPriority();
4
InteractiveSystemsGroup/GamificationEngine-Kinben
src/main/java/info/interactivesystems/gamificationengine/dao/MarketPlaceDAO.java
[ "@Entity\n@JsonIgnoreProperties({ \"belongsTo\", \"password\", \"avatar\", \"contactList\" })\npublic class Player {\n\n\t@Id\n\t@GeneratedValue(strategy = GenerationType.IDENTITY)\n\tprivate int id;\n\n\t@NotNull\n\t@ManyToOne\n\tprivate Organisation belongsTo;\n\n\t@NotNull\n\t@Column(unique=true, nullable=false)...
import info.interactivesystems.gamificationengine.entities.Player; import info.interactivesystems.gamificationengine.entities.marketPlace.Bid; import info.interactivesystems.gamificationengine.entities.marketPlace.MarketPlace; import info.interactivesystems.gamificationengine.entities.marketPlace.Offer; import info.int...
package info.interactivesystems.gamificationengine.dao; @Named @Stateless public class MarketPlaceDAO { @PersistenceContext(unitName = PersistenceUnit.PROJECT) private EntityManager em; /** * Stores a new marketplace in the data base. * * @param market * The {@link MarketPlace} that should...
public List<Offer> getOffersByTask(Task task, String apiKey) {
4
danisola/restify
url/src/test/java/com/danisola/restify/url/types/FloatVarTest.java
[ "public class RestParser {\n\n private final Pattern pathPattern;\n private final VarType[] pathTypes;\n private final ParamVar[] paramVars;\n private final int numVars;\n\n RestParser(Pattern pathPattern, VarType[] pathTypes, ParamVar[] paramVars, int numVars) {\n this.pathPattern = pathPatte...
import com.danisola.restify.url.RestParser; import com.danisola.restify.url.RestUrl; import org.junit.Test; import static com.danisola.restify.url.RestParserFactory.parser; import static com.danisola.restify.url.matchers.IsInvalid.isInvalid; import static com.danisola.restify.url.matchers.IsValid.isValid; import static...
package com.danisola.restify.url.types; public class FloatVarTest { @Test public void whenKeyIsWellSetThenValueIsCorrect() { RestParser parser = parser("/users/{}", floatVar("userId")); Float userId = Float.MAX_VALUE;
RestUrl url = parser.parse("http://www.mail.com/users/" + userId);
1
agune/flyJenkins
flyAgent/src/main/java/com/agun/agent/AgentBootstrap.java
[ "public interface ServiceType {\r\n\t/**\r\n\t * agent 의 프로세스 아이디를 구하는 로직\r\n\t * @param agentMeta\r\n\t * @return\r\n\t */\r\n\tpublic int getPid(AgentMeta agentMeta);\r\n\r\n\t/**\r\n\t * \r\n\t * @return\r\n\t */\r\n\tpublic boolean getProduction(AgentMeta agentMeta, String production);\r\n\t\r\n\t/**\r\n\t * 배...
import com.agun.agent.adapter.ServiceType; import com.agun.agent.adapter.TomcatService; import com.agun.agent.model.AgentMemoryStore; import com.agun.agent.model.AgentMeta; import com.agun.agent.model.FlyJenkinsInfo; import com.agun.agent.model.util.ModelAssignUtil; import com.agun.jenkins.CLIHelper; import com.agun.je...
package com.agun.agent; public class AgentBootstrap { static Logger log = Logger.getLogger(AgentBootstrap.class.getName()); private String agentHost = null; public AgentBootstrap(String host){ agentHost = host; } public CLIHelper auth(String rsaPath, String jenkinsHost){ CLIHelper cliHelper = new CLIH...
ServiceType serviceType = null;
0
yuxiangping/mongodb-orm
src/main/java/org/yy/mongodb/orm/executor/parser/FieldExecutor.java
[ "public class MongoORMException extends RuntimeException {\r\n\r\n private static final long serialVersionUID = 3988706952509457604L;\r\n\r\n private static final Logger logger = LoggerFactory.getLogger(MongoORMException.class);\r\n\r\n private String message;\r\n\r\n public MongoORMException(String message) {\...
import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.yy.mongodb.exception.MongoORMException; import org.yy.mongodb.orm.MqlMapConfiguration; import org.yy.mongodb.orm.engine.config.MappingConfig; import org.yy.mongodb.orm.engine.entry.Entry; import org.yy.mongodb.orm.engine.entr...
package org.yy.mongodb.orm.executor.parser; /** * Mongodb MQL field executor. * * <select> * <field> * ...... * </field> * </select> * * @author yy */ public class FieldExecutor implements MqlExecutor<Map<String, Object>> { @Override
public Map<String, Object> parser(String namespace, MqlMapConfiguration configuration, NodeEntry entry, Object target) throws MongoORMException {
4
miurahr/tmpotter
src/main/java/org/tmpotter/filters/pofile/ImportWizardPOFile.java
[ "public static final String getString(final String strKey) {\n return (_bundle.getString(strKey));\n}", "public interface IImportWizardPanel {\n /**\n * Initialize panel when registered.\n * @param controller controller reference.\n * @param pref key-value preference.\n */\n void init(Imp...
import org.tmpotter.util.Localization; import java.io.File; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.filechooser.FileNameExtensionFilter; import static org.tmpotter.util.Localization.getString; import org.tmpotter.ui.wizard.IImportWizardPanel; import...
/* ************************************************************************* * * TMPotter - Bi-text Aligner/TMX Editor * * Copyright (C) 2016 Hiroshi Miura * * This file is part of TMPotter. * * TMPotter is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public...
getString("MSG.ERROR.FILE_NOTFOUND"),
0
chRyNaN/Android-Guitar-Tuner
app/src/main/java/com/chrynan/android_guitar_tuner/ui/activity/AppInfoActivity.java
[ "public class GuitarTunerApplication extends Application {\n\n private static ApplicationComponent applicationComponent;\n\n public static ApplicationComponent getApplicationComponent() {\n return applicationComponent;\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n\n...
import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import com.chrynan....
package com.chrynan.android_guitar_tuner.ui.activity; public class AppInfoActivity extends AppCompatActivity implements AppInfoView { @BindView(R.id.toolbar) Toolbar toolbar; @BindView(R.id.appNameTwoLineCell) TwoLineCell appNameTwoLineCell; @BindView(R.id.packageNameTwoLineCell) TwoLineCe...
.appInfoViewModule(new AppInfoViewModule(this))
1
dmfs/oauth2-essentials
src/main/java/org/dmfs/oauth2/client/grants/ClientCredentialsGrant.java
[ "public interface OAuth2AccessToken\n{\n /**\n * Returns the actual access token String.\n *\n * @return\n *\n * @throws ProtocolException\n */\n public CharSequence accessToken() throws ProtocolException;\n\n /**\n * Returns the access token type.\n *\n * @return\n ...
import org.dmfs.httpessentials.client.HttpRequestExecutor; import org.dmfs.httpessentials.exceptions.ProtocolError; import org.dmfs.httpessentials.exceptions.ProtocolException; import org.dmfs.oauth2.client.OAuth2AccessToken; import org.dmfs.oauth2.client.OAuth2Client; import org.dmfs.oauth2.client.OAuth2Grant; import ...
/* * Copyright 2016 dmfs GmbH * * 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...
return mClient.accessToken(new ClientCredentialsTokenRequest(mScope), executor);
4
ptgoetz/storm-hdfs
src/main/java/org/apache/storm/hdfs/bolt/AbstractHdfsBolt.java
[ "public interface FileNameFormat extends Serializable {\n\n void prepare(Map conf, TopologyContext topologyContext);\n\n /**\n * Returns the filename the HdfsBolt will create.\n * @param rotation the current file rotation number (incremented on every rotation)\n * @param timeStamp current time in ...
import backtype.storm.task.OutputCollector; import backtype.storm.task.TopologyContext; import backtype.storm.topology.OutputFieldsDeclarer; import backtype.storm.topology.base.BaseRichBolt; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org...
/** * 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...
HdfsSecurityUtil.login(conf, hdfsConfig);
5
idekerlab/cyREST
src/main/java/org/cytoscape/rest/internal/resource/StyleResource.java
[ "public class WriterListener {\r\n\r\n\tprivate VizmapWriterFactory jsFactory;\r\n\r\n\t@SuppressWarnings(\"rawtypes\")\r\n\tpublic void registerFactory(final VizmapWriterFactory factory, final Map props) {\r\n\t\tif (factory != null && factory.getClass().getSimpleName().equals(\"CytoscapeJsVisualStyleWriterFactory...
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; import javax.inject.Singleton; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import java...
package org.cytoscape.rest.internal.resource; @Singleton @Path("/v1/styles") public class StyleResource extends AbstractResource {
private final VisualStyleSerializer styleSerializer = new VisualStyleSerializer();
4
googlecreativelab/justaline-android
app/src/main/java/com/arexperiments/justaline/PairSessionManager.java
[ "public class AnalyticsEvents {\n\n public static final String VALUE_TRUE = \"true\";\n\n // Permissions\n public static final String EVENT_CAMERA_PERMISSION_GRANTED = \"camera_permission_granted\";\n public static final String EVENT_CAMERA_PERMISSION_DENIED = \"camera_permission_denied\";\n public s...
import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; import android.os.Handler; import android.os.Looper; import android.support.annotation.NonNull; import androi...
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
mPairingStateChangeListener.onStateChange(PairView.PairState.DISCOVERY_TIMEOUT);
4
airomem/airomem
airomem-chatsample/airomem-chatsample-data/src/main/java/pl/setblack/airomem/chatsample/execute/ChatControllerImpl.java
[ "public class Chat implements ChatView, Serializable {\n\n private CopyOnWriteArrayList<Message> messages;\n\n public Chat() {\n this.messages = new CopyOnWriteArrayList<>();\n }\n\n public void addMessage(String nick, String content, LocalDateTime time) {\n assert WriteChecker.hasPrevalan...
import java.time.LocalDateTime; import java.time.ZoneId; import java.util.List; import javax.annotation.PostConstruct; import javax.enterprise.context.ApplicationScoped; import pl.setblack.airomem.chatsample.data.Chat; import pl.setblack.airomem.chatsample.view.ChatView; import pl.setblack.airomem.chatsample.view.Messa...
/* * Created by Jarek Ratajski */ package pl.setblack.airomem.chatsample.execute; /** * * @author jarekr */ @ApplicationScoped public class ChatControllerImpl implements ChatController {
private PersistenceController<DataRoot<ChatView, Chat>, ChatView> controller;
1
luminis-ams/elastic-rest-spring-wrapper
src/main/java/eu/luminis/elastic/RestClientConfig.java
[ "public class Aggregation {\n private String name;\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n}", "public class AggregationDeserializer extends StdDeserializer<Aggregation> {\n\n private Map<String, Class<? exten...
import com.fasterxml.jackson.core.Version; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import eu.luminis.elastic.search.response.aggregations.Aggregation; import eu.luminis.elastic.search.response.aggregations.AggregationDeserializer; import eu.luminis....
package eu.luminis.elastic; /** * Configuration class */ @Configuration @ComponentScan({ "eu.luminis.elastic.cluster", "eu.luminis.elastic.document", "eu.luminis.elastic.helper", "eu.luminis.elastic.index", "eu.luminis.elastic.search", "eu.luminis.elastic.monitoring" ...
deserializer.register("histogram", HistogramAggregation.class);
5
exoplatform/task
services/src/main/java/org/exoplatform/task/rest/ProjectRestService.java
[ "@Data\n@NoArgsConstructor\npublic class ProjectDto implements Serializable {\n private static final Log LOG = ExoLogger.getLogger(ProjectDto.class);\n\n\n private long id;\n\n private String name;\n\n private String description;\n\n private String color;\n\n private Set<St...
import io.swagger.annotations.*; import org.apache.commons.lang3.StringUtils; import org.exoplatform.commons.utils.HTMLEntityEncoder; import org.exoplatform.commons.utils.ListAccess; import org.exoplatform.services.log.ExoLogger; import org.exoplatform.services.log.Log; import org.exoplatform.services.rest.resource.Res...
this.taskService = taskService; this.commentService = commentService; this.projectService = projectService; this.statusService = statusService; this.userService = userService; this.spaceService = spaceService; this.labelService = labelService; this.identityManager = identityManager; } ...
StatusDto status = statusService.getDefaultStatus(id);
1
jenkinsci/tikal-multijob-plugin
src/test/java/com/tikal/jenkins/plugins/multijob/test/ConditionalPhaseTest.java
[ "@ExportedBean(defaultVisibility = 999)\r\npublic class MultiJobBuild extends Build<MultiJobProject, MultiJobBuild> {\r\n\r\n private List<SubBuild> subBuilds;\r\n private MultiJobChangeLogSet changeSets = new MultiJobChangeLogSet(this);\r\n private Map<String, SubBuild> subBuildsMap = new HashMap<String, ...
import com.tikal.jenkins.plugins.multijob.MultiJobBuild; import hudson.model.Result; import hudson.model.TopLevelItem; import hudson.model.Cause.UserCause; import hudson.model.FreeStyleProject; import hudson.tasks.BuildStep; import hudson.tasks.Shell; import java.util.ArrayList; import java.util.List; import org.jenkin...
package com.tikal.jenkins.plugins.multijob.test; /** * @author Bartholdi Dominik (imod) */ public class ConditionalPhaseTest { @Rule public RestartableJenkinsRule rr = new RestartableJenkinsRule(); @Test public void testConditionalPhase() throws Exception { rr.then(new RestartableJenkins...
MultiJobBuilder firstPhaseBuilder = new MultiJobBuilder("FirstPhase", configTopList, ContinuationCondition.SUCCESSFUL, MultiJobBuilder.ExecutionType.PARALLEL, null);
1
Vauff/Maunz-Discord
src/com/vauff/maunzdiscord/threads/MessageCreateThread.java
[ "public abstract class AbstractCommand\n{\n\t/**\n\t * Holds all messages as keys which await a reaction by a specific user.\n\t * The values hold an instance of {@link Await}\n\t */\n\tpublic static final HashMap<Snowflake, Await> AWAITED = new HashMap<>();\n\n\t/**\n\t * Enum holding the different bot permissions...
import com.vauff.maunzdiscord.commands.templates.AbstractCommand; import com.vauff.maunzdiscord.commands.templates.AbstractLegacyCommand; import com.vauff.maunzdiscord.core.Logger; import com.vauff.maunzdiscord.core.Main; import com.vauff.maunzdiscord.core.MainListener; import com.vauff.maunzdiscord.core.Util; import d...
package com.vauff.maunzdiscord.threads; public class MessageCreateThread implements Runnable { private MessageCreateEvent event; private Thread thread; private String name; public MessageCreateThread(MessageCreateEvent passedEvent, String passedName) { name = passedName; event = passedEvent; } public v...
if (MainListener.cooldownTimestamps.containsKey(author.getId()) && (MainListener.cooldownTimestamps.get(author.getId()) + 2000L) > System.currentTimeMillis())
4
trustsystems/elfinder-java-connector
src/main/java/br/com/trustsystems/elfinder/command/AbstractCommand.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.ElfinderContext; 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.su...
/* * #%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...
options.put(ElFinderConstants.ELFINDER_PARAMETER_ARCHIVERS, ArchiverOption.JSON_INSTANCE);
5
iChun/Hats
src/main/java/me/ichun/mods/hats/client/layer/LayerHat.java
[ "@Mod(Hats.MOD_ID)\npublic class Hats\n{\n public static final String MOD_NAME = \"Hats\";\n public static final String MOD_ID = \"hats\";\n public static final String PROTOCOL = \"1\"; //Network protocol\n\n public static final Logger LOGGER = LogManager.getLogger();\n\n public static ConfigClient c...
import com.mojang.blaze3d.matrix.MatrixStack; import me.ichun.mods.hats.common.Hats; import me.ichun.mods.hats.common.hats.HatHandler; import me.ichun.mods.hats.common.hats.HatInfo; import me.ichun.mods.hats.common.hats.HatResourceHandler; import me.ichun.mods.hats.common.world.HatsSavedData; import me.ichun.mods.ichun...
package me.ichun.mods.hats.client.layer; @SuppressWarnings("unchecked") public class LayerHat<T extends LivingEntity, M extends EntityModel<T>> extends LayerRenderer<T, M> { public LayerHat() { super((IEntityRenderer<T, M>)Minecraft.getInstance().getRenderManager().playerRenderer); // nonnull, we'll j...
if(!HatHandler.hasBeenRandomlyAllocated(referenceEnt))
1
jparsercombinator/jparsercombinator
src/test/java/org/jparsercombinator/examples/expression/SimpleExpressionParser.java
[ "public static <T> ParserCombinatorReference<T> newRef() {\n return new ParserCombinatorReference<>();\n}", "public static ParserCombinator<String> regex(String regex) {\n return regexMatchResult(regex).map(MatchResult::group);\n}", "public static SkipCombinator skip(ParserCombinator<?> skip) {\n return new ...
import static org.jparsercombinator.ParserCombinators.newRef; import static org.jparsercombinator.ParserCombinators.regex; import static org.jparsercombinator.ParserCombinators.skip; import static org.jparsercombinator.ParserCombinators.string; import org.jparsercombinator.ParserCombinator; import org.jparsercombinator...
package org.jparsercombinator.examples.expression; /** * Parser for parsing and evaluating of "fully parenthesized expressions": * * <expression> ::= <integer> | ( "(" <expression> ( "+" | "-" | "*" | "/" ) <expression> ")" ) */ class SimpleExpressionParser implements Parser<Integer> { private Parser<Integer>...
ParserCombinator<Integer> parseInteger = regex("[0-9]+").map(Integer::parseInt);
1
zhangxx0/WOTPlus
app/src/main/java/com/xinxin/wotplus/util/mapper/XvmAllInfoToDayMap.java
[ "public class DaylistEntityForRecent implements Serializable {\n\n private int mark4;\n private int defense;\n private int mark3;\n private int teambattles;\n private int spotted;\n private int mark2;\n private int mark1;\n private int teamwins;\n private int frags;\n private int damag...
import com.xinxin.wotplus.model.DaylistEntityForRecent; import com.xinxin.wotplus.model.TankInfo; import com.xinxin.wotplus.model.XvmAllInfo; import com.xinxin.wotplus.model.XvmMainInfo; import com.xinxin.wotplus.model.XvmMainPageVO; import com.xinxin.wotplus.util.CommonUtil; import java.text.ParseException; import jav...
package com.xinxin.wotplus.util.mapper; /** * Created by xinxin on 2016/5/23. * <p/> * 为 XvmAllInfo 添加近日数据 map */ public class XvmAllInfoToDayMap implements Func1<XvmAllInfo, XvmAllInfo> { private static XvmAllInfoToDayMap INSTANCE = new XvmAllInfoToDayMap(); public XvmAllInfoToDayMap() { } p...
XvmMainPageVO xvmMainPageVO = new XvmMainPageVO();
4
waveaccess/msbotframework4j
msbotframework4j-builder/src/main/java/org/msbotframework4j/builder/wrapper/AbstractBotWrapper.java
[ "public class BotManager {\n\n private final Parameters params = new Parameters();\n\n public static BotManager getInstance() {\n return BotManagerInstanceHolder.INSTANCE;\n }\n\n public Bot load() {\n String botClassName = null;\n try {\n FileBasedConfigurationBuilder<FileBasedConfiguration> buil...
import org.msbotframework4j.builder.BotManager; import org.msbotframework4j.builder.bot.Bot; import org.msbotframework4j.core.json.SerializerFacade; import org.msbotframework4j.core.model.Message; import org.msbotframework4j.logging.BotLogger; import java.io.IOException; import java.io.InputStream; import java.io.Outpu...
package org.msbotframework4j.builder.wrapper; /** * @author Maksim Kanev */ public class AbstractBotWrapper { private final Bot bot; AbstractBotWrapper() {
this.bot = BotManager.getInstance().load();
0
danielflower/multi-module-maven-release-plugin
src/test/java/e2e/NestedModulesTest.java
[ "public class MvnRunner {\n\n private static boolean haveInstalledPlugin = false;\n private final File mvnHome;\n public boolean logToStandardOut = false;\n public String mavenOpts;\n\n public MvnRunner() {\n this(null);\n }\n\n public MvnRunner(File mvnHome) {\n this.mvnHome = mv...
import org.apache.maven.shared.invoker.MavenInvocationException; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.lib.ObjectId; import org.junit.BeforeClass; import org.junit.Test; import scaffolding.MvnRunner; import scaffolding.TestProject; import java.io.IOException; import java.util.List; import static org....
package e2e; public class NestedModulesTest { final String expectedAggregatorVersion = "0.0."; final String expectedParentVersion = "1.2.3."; final String expectedCoreVersion = "2.0."; final String expectedAppVersion = "3.2."; final String expectedServerModulesVersion = "1.0.2.4."; final St...
assertThat(testProject.local, hasCleanWorkingDirectory());
4
butter-fly/belling-admin
src/main/java/com/belling/admin/service/impl/PermissionServiceImpl.java
[ "public interface PermissionMapper extends BaseMapper<Permission, Integer> {\n\t\n\tpublic int enable(@Param(\"isEnable\") Boolean isEnable, @Param(\"idList\") List<Integer> idList);\n\t\n\tpublic int resetPassword(@Param(\"password\") String password, @Param(\"idList\") List<Integer> idList);\n\n\tpublic List<Perm...
import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.belling.admin.mapper.PermissionMapper; ...
package com.belling.admin.service.impl; /** * <pre> * Description * Copyright: Copyright (c)2017 * Company: Sunny * Author: lenovo * Version: 1.0 * Create at: 2017年6月22日 下午9:40:33 * * 修改历史: * 日期 作者 版本 修改描述 * ------------------------------------------------------------------ * ...
public List<NavNode> getNavMenu(Integer userId) {
3
narrowtux/Showcase
src/main/java/com/narrowtux/showcase/types/InfiniteShowcaseExtra.java
[ "public class Metrics {\n\n /**\n * The current revision number\n */\n private final static int REVISION = 5;\n\n /**\n * The base url of the metrics domain\n */\n private static final String BASE_URL = \"http://metrics.griefcraft.com\";\n\n /**\n * The url used to report a server...
import com.narrowtux.showcase.Metrics; import com.narrowtux.showcase.Showcase; import com.narrowtux.showcase.ShowcaseExtra; import com.narrowtux.showcase.ShowcaseItem; import com.narrowtux.showcase.ShowcasePlayer;
/* * Copyright (C) 2011 Moritz Schmale <narrow.m@gmail.com> * * Showcase is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Th...
public boolean onDestroy(ShowcasePlayer player) {
4
badvision/jace
src/main/java/jace/config/Configuration.java
[ "public class Emulator {\r\n\r\n public static Emulator instance;\r\n public static EmulatorUILogic logic = new EmulatorUILogic();\r\n public static Thread mainThread;\r\n\r\n// public static void main(String... args) {\r\n// mainThread = Thread.currentThread();\r\n// instance = new Emulat...
import jace.Emulator; import jace.EmulatorUILogic; import jace.core.Computer; import jace.core.Keyboard; import jace.core.Utility; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.ObjectInputStream; imp...
id = (String) in.readObject(); name = (String) in.readObject(); settings = (Map) in.readObject(); hotkeys = (Map) in.readObject(); Object[] nodeArray = (Object[]) in.readObject(); for (Object child : nodeArray) { children.add((Confi...
public static Computer emulator = Emulator.computer;
2
PistoiaHELM/HELMNotationToolkit
source/org/helm/notation/MonomerFactory.java
[ "public class Attachment implements Serializable {\n\n\tpublic static final String BACKBONE_MONOMER_LEFT_ATTACHEMENT = \"R1\";\n\tpublic static final String BACKBONE_MONOMER_RIGHT_ATTACHEMENT = \"R2\";\n\tpublic static final String BACKBONE_MONOMER_BRANCH_ATTACHEMENT = \"R3\";\n\tpublic static final String BRANCH_M...
import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.URL; import java.util.ArrayList; import java.util.Collec...
/******************************************************************************* * Copyright C 2012, The Pistoia Alliance * * 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 restr...
private static Map<String, Attachment> attachmentDB;
0
godaddy/godaddy-logger
src/main/java/com/godaddy/logging/messagebuilders/JsonMessageBuilder.java
[ "public abstract class LogContext<T>{}", "public class LogMessage extends HashMap<String, Object> {\n\n}", "public abstract class LoggerMessageBuilder<T> implements MessageBuilder<T> {\n\n private List<Object> processedObjects = new LinkedList<>();\n\n protected LoggingConfigs configs;\n\n protected In...
import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Stack; import static java.util.stream.Collectors.toList; import com.godaddy.logging.LogContext; import com.godaddy.log...
/** * Copyright (c) 2015 GoDaddy * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, d...
public RunningLogContext<List<Map<String, Object>>> buildMessage(final LogContext<List<Map<String, Object>>> previous, final Object currentObject) {
0