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 |
|---|---|---|---|---|---|---|
AnujaK/restfiddle | src/main/java/com/restfiddle/sample/data/SampleDataGenerator.java | [
"@RestController\n@EnableAutoConfiguration\n@ComponentScan\n@Transactional\npublic class ConversationController {\n Logger logger = LoggerFactory.getLogger(ConversationController.class);\n\n @Resource\n private ConversationRepository conversationRepository;\n\n @Autowired\n private RfRequestRepositor... | import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.mongodb.core.Mon... | /*
* Copyright 2014 Ranjan Kumar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... | if (CommonUtil.isNotNull(user)) { | 7 |
MinecraftForge/Srg2Source | src/main/java/net/minecraftforge/srg2source/extract/MixinProcessor.java | [
"public interface IAnnotationProcessor {\n String getType();\n default boolean process(NormalAnnotation node) {\n throw new IllegalArgumentException('@' + getType() + \" can not be a normal annotation, it is expected to have no value\");\n }\n\n default boolean process(SingleMemberAnnotation node... | import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
import net.minecraftforge.srg2source.mixin.IAnnotationProcessor;
import net.minecraftforge.srg2source.mixin.MixinAnnotation;
import net.minecraftforge.srg2source.mixin.MixinInfo;
import net.minecraftforge.srg2source.mixin.MixinInfo.InterfaceInfo;
import net.minecr... | /*
* Srg2Source
* Copyright (c) 2020.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be u... | ShadowInfo shadow = info.getShadow(name, desc); | 4 |
sys1yagi/fragment-creator | processor/src/main/java/com/sys1yagi/fragmentcreator/writer/FragmentCreatorBuilderGenerator.java | [
"public class UnsupportedTypeException extends RuntimeException {\n\n public UnsupportedTypeException(String message) {\n super(message);\n }\n}",
"public class FragmentCreatorModel {\n\n private TypeElement element;\n\n private String packageName;\n\n private String originalClassName;\n\n ... | import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.MethodSpec;
import com.squareup.javapoet.TypeName;
import com.squareup.javapoet.TypeSpec;
import com.sys1yagi.fragmentcreator.annotation.Args;
import com.sys1yagi.fragmentcreator.exception.UnsupportedTypeExcepti... | package com.sys1yagi.fragmentcreator.writer;
public class FragmentCreatorBuilderGenerator {
ProcessingEnvironment environment;
public FragmentCreatorBuilderGenerator(ProcessingEnvironment environment) {
this.environment = environment;
}
| public TypeSpec create(FragmentCreatorModel model) { | 1 |
ra4king/LWJGL-OpenGL-Tutorials | src/rosick/jglsdk/glimg/DdsLoader.java | [
"enum BitDepth {\r\n\tCOMPRESSED, // Used for compressed data types. They do not have a bitdepth.\r\n\t\t\r\n\tPER_COMP_8, // Each component takes up 8 bits.\r\n\tPER_COMP_16, // Each component takes up 16 bits.\r\n\tPER_COMP_32, // Each component takes up 32 bits.\r\n\tNUM_PER_COMPONENT,\r\n\t\t\r\n\tPACKED_16_BIT... | import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import rosick.jglsdk.glimg.ImageFormat.BitDepth;
import rosick.jglsdk.glimg.ImageFormat.ComponentOrder;
import rosick.jglsdk.glimg.ImageFormat.PixelComponents;
import rosick.jglsdk.glimg.ImageFo... | package rosick.jglsdk.glimg;
/**
* Visit https://github.com/integeruser/jglsdk for project info, updates and license terms.
*
* @author integeruser
*/
public class DdsLoader {
public static ImageSet load(InputStream dds) throws IOException {
byte[] ddsFile = readDdsFile(dds);
// Check the f... | UncheckedImageFormat ddsFormat = getFormat(ddsHeader, dds10Header);
| 4 |
i2p/i2p.itoopie | src/net/i2p/itoopie/i2pcontrol/methods/GetEcho.java | [
"public class InvalidParametersException extends Exception {\n\n\t/**\n\t * Signifies that the paramers we sent were invalid for the used JSONRPC2\n\t * method.\n\t */\n\tprivate static final long serialVersionUID = 4044188679464846005L;\n\n}",
"public class InvalidPasswordException extends Exception {\n\n\t/**\n... | import java.util.HashMap;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.i2p.itoopie.i2pcontrol.InvalidParametersException;
import net.i2p.itoopie.i2pcontrol.InvalidPasswordException;
import net.i2p.itoopie.i2pcontrol.JSONRPC2Interface;
import net.i... | package net.i2p.itoopie.i2pcontrol.methods;
public class GetEcho {
@SuppressWarnings("unchecked")
public static String execute(String str)
throws InvalidPasswordException, JSONRPC2SessionException {
JSONRPC2Request req = new JSONRPC2Request("Echo", JSONRPC2Interface.incrNonce());
@SuppressWarnings("ra... | JSONRPC2Response resp = null; | 5 |
iChun/Hats | src/main/java/me/ichun/mods/hats/common/item/ItemHatLauncher.java | [
"public class WorkspaceHats extends Workspace\n implements IHatSetter\n{\n public static final DecimalFormat FORMATTER = new DecimalFormat(\"#,###,###\");\n\n public final boolean fallback;\n public final @Nonnull LivingEntity hatEntity;\n public final HatsSavedData.HatPart hatDetails;\n publi... | import me.ichun.mods.hats.client.gui.WorkspaceHats;
import me.ichun.mods.hats.client.render.ItemRenderHatLauncher;
import me.ichun.mods.hats.common.Hats;
import me.ichun.mods.hats.common.entity.EntityHat;
import me.ichun.mods.hats.common.hats.HatHandler;
import me.ichun.mods.hats.common.packet.PacketEntityHatDetails;
i... | package me.ichun.mods.hats.common.item;
public class ItemHatLauncher extends Item
implements DualHandedItem
{
public static final String STACK_HAT_PART_TAG = "hats_hatPart";
public ItemHatLauncher(Properties properties)
{
super(DistExecutor.unsafeRunForDist(() -> () -> attachISTER(prope... | part = HatHandler.getHatPart(is).createCopy(); | 4 |
Airpy/KeywordDrivenAutoTest | src/test/java/com/keyword/automation/bill/warehouse/Test003_Warehouse_TestPriceBill.java | [
"public class BrowserKeyword {\n // 不允许被初始化\n private BrowserKeyword() {\n\n }\n\n /**\n * 使用默认浏览器打开指定url\n *\n * @param requestUrl 请求url地址\n */\n public static void browserOpen(String requestUrl) {\n BrowserType bType = BrowserType.valueOf(Constants.DEFAULT_BROWSER);\n ... | import com.keyword.automation.action.BrowserKeyword;
import com.keyword.automation.base.utils.LogUtils;
import com.keyword.automation.bean.BillCell;
import com.keyword.automation.bean.BillHeader;
import com.keyword.automation.customer.BillKeyword;
import com.keyword.automation.customer.LoginKeyword;
import com.keyword.... | package com.keyword.automation.bill.warehouse;
/**
* 入口:仓库-制作单据-成本调价单<br/>
* 主要测试功能:
* 1、新增成本调价单
*
* @author Amio_
*/
public class Test003_Warehouse_TestPriceBill {
private static List<BillCell> billCellList = new ArrayList<BillCell>();
private static BillHeader billHeader = new BillHeader();
priva... | BrowserKeyword.browserQuit(); | 0 |
mp911de/spinach | src/test/java/biz/paluch/spinach/SslTest.java | [
"public static String host() {\n return System.getProperty(\"host\", \"localhost\");\n}",
"public static int sslPort() {\n return Integer.valueOf(System.getProperty(\"sslport\", \"7443\"));\n}",
"public class DefaultDisqueClient {\n\n public final static DefaultDisqueClient instance = new DefaultDisque... | import com.lambdaworks.redis.ClientOptions;
import com.lambdaworks.redis.JavaRuntime;
import com.lambdaworks.redis.RedisConnectionException;
import com.lambdaworks.redis.resource.ClientResources;
import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.sslPort;
import static org... | /*
* Copyright 2016 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... | assumeTrue("Assume that stunnel runs on port 7443", Sockets.isOpen(host(), sslPort())); | 1 |
easemob/emchat-server-examples | emchat-server-java/src/main/java/com/easemob/server/example/api/impl/EasemobSendMessage.java | [
"public interface SendMessageAPI {\r\n\r\n\tObject sendMessage(Object payload);\r\n}\r",
"public class OrgInfo {\n\n public static String ORG_NAME;\n public static String APP_NAME;\n public static final Logger logger = LoggerFactory.getLogger(OrgInfo.class);\n\n static {\n InputStream inputStre... | import com.easemob.server.example.api.SendMessageAPI;
import com.easemob.server.example.comm.OrgInfo;
import com.easemob.server.example.comm.ResponseHandler;
import com.easemob.server.example.comm.EasemobAPI;
import com.easemob.server.example.comm.TokenUtil;
import io.swagger.client.ApiException;
import io.swagger.clie... | package com.easemob.server.example.api.impl;
public class EasemobSendMessage implements SendMessageAPI {
private ResponseHandler responseHandler = new ResponseHandler();
private MessagesApi api = new MessagesApi();
@Override
public Object sendMessage(final Object payload) { | return responseHandler.handle(new EasemobAPI() { | 3 |
ulisesbocchio/spring-boot-security-saml | spring-boot-security-saml/src/main/java/com/github/ulisesbocchio/spring/boot/security/saml/configurer/builder/MetadataManagerConfigurer.java | [
"public class LocalExtendedMetadata extends ExtendedMetadata {\n public LocalExtendedMetadata() {\n super.setLocal(true);\n }\n\n @Override\n public void setLocal(boolean local) {\n throw new IllegalStateException(\"This implementation is only for Local (SP) Metadata\");\n }\n}",
"pub... | import com.github.ulisesbocchio.spring.boot.security.saml.bean.override.LocalExtendedMetadata;
import com.github.ulisesbocchio.spring.boot.security.saml.configurer.ServiceProviderBuilder;
import com.github.ulisesbocchio.spring.boot.security.saml.properties.IdentityProvidersProperties;
import com.github.ulisesbocchio.sp... | package com.github.ulisesbocchio.spring.boot.security.saml.configurer.builder;
/**
* Builder configurer that takes care of configuring/customizing the {@link MetadataManager} bean.
* <p>
* Common strategy across most internal configurers is to first give priority to a Spring Bean if present in the
* Context. So... | extendedDelegateConfig = builder.getSharedObject(SAMLSSOProperties.class).getExtendedDelegate(); | 3 |
kw0516/Facepp-android-online | src/com/xiaoying/facedemo/MainActivity.java | [
"public class DetectActivity extends Activity {\n\t\n\tpublic static final int REQUEST_PICK_PERSON = 1000;\n\t\n\tpublic static final int REQUEST_CREATE_PERSON = 1001;\n\t\n\tprivate String tag = DetectActivity.class.getSimpleName();\n\t\n\tprivate TitleBar mTitleBar = null;\n\t\n\tprivate MarkFaceView mMarkView = ... | import java.io.File;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.util.DisplayMetrics;
import android... | package com.xiaoying.facedemo;
public class MainActivity extends Activity implements View.OnClickListener {
private String tag = MainActivity.class.getSimpleName();
public static final String EXTRA_IMAGE = "extra_image";
public static final int REQUEST_PICK_PIC = 1000;
public static final int REQUEST_TAKE... | Intent intent = new Intent(this, GroupListActivity.class); | 1 |
gejiaheng/Protein | app/src/main/java/com/ge/protein/user/followee/FolloweeListPresenter.java | [
"@AutoValue\npublic abstract class Followee implements Parcelable {\n\n public abstract long id();\n\n public abstract String created_at();\n\n public abstract User followee();\n\n public static TypeAdapter<Followee> typeAdapter(Gson gson) {\n return new AutoValue_Followee.GsonTypeAdapter(gson).n... | import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.view.View;
import com.airbnb.epoxy.EpoxyModel;
import com.ge.protein.R;
import com.ge.protein.data.model.Followee;
import com.ge.protein.data.model.User;
import com.ge.protein... | /*
* Copyright 2017 Jiaheng Ge
*
* 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 ... | Collection<FolloweeModel> epoxyModels = new ArrayList<>(); | 4 |
pangliang/MirServer-Netty | GameServer/src/main/java/com/zhaoxiaodan/mirserver/gameserver/handler/SellItemHandler.java | [
"@Entity\npublic class Player extends AnimalObject {\n\n\tprivate static final Logger logger = LogManager.getLogger();\n\n\tpublic static final String SCRIPT_NAME = \"PlayerScript\";\n\n\tstatic {\n\t\ttry {\n\t\t\tScriptEngine.loadScript(SCRIPT_NAME);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}... | import com.zhaoxiaodan.mirserver.gameserver.entities.Player;
import com.zhaoxiaodan.mirserver.gameserver.objects.Merchant;
import com.zhaoxiaodan.mirserver.gameserver.engine.MerchantEngine;
import com.zhaoxiaodan.mirserver.gameserver.engine.ScriptEngine;
import com.zhaoxiaodan.mirserver.network.Protocol;
import com.zha... | package com.zhaoxiaodan.mirserver.gameserver.handler;
public class SellItemHandler extends PlayerHandler {
@Override
public void onPacket(ClientPacket packet, Player player) throws Exception {
int npcInGameId = packet.recog;
Merchant merchant = MerchantEngine.getMerchant(npcInGameId);
if (merchant == null)... | Boolean rs = (Boolean) ScriptEngine.exce(merchant.scriptName, "sell", merchant, player, itemId); | 3 |
duniter-gchange/gchange-pod | gchange-pod-es-plugin/src/main/java/org/duniter/elasticsearch/gchange/rest/RestModule.java | [
"public class RestMarketLikeAction {\n\n @Inject\n public RestMarketLikeAction(RestLikeGetAction getAction,\n RestLikePostAction postAction) {\n\n getAction.allowLikeIndex(MarketIndexDao.INDEX, MarketRecordDao.TYPE);\n postAction.allowLikeIndex(MarketIndexDao.INDEX... | import org.duniter.elasticsearch.gchange.rest.like.RestMarketLikeAction;
import org.duniter.elasticsearch.gchange.rest.market.*;
import org.duniter.elasticsearch.gchange.rest.market.search.CustomSearchAction;
import org.duniter.elasticsearch.gchange.rest.mixed.RestMixedSearchAction;
import org.duniter.elasticsearch.gch... | package org.duniter.elasticsearch.gchange.rest;
/*
* #%L
* duniter4j-elasticsearch-plugin
* %%
* Copyright (C) 2014 - 2016 EIS
* %%
* 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, eithe... | bind(RestMarketLikeAction.class).asEagerSingleton(); | 0 |
apache/whirr | services/cassandra/src/test/java/org/apache/whirr/service/cassandra/integration/CassandraServiceTest.java | [
"public class Cluster {\n \n /**\n * This class represents a real node running in a cluster. An instance has\n * one or more roles.\n * @see org.apache.whirr.service.ClusterSpec.InstanceTemplate\n */\n public static class Instance {\n private final Credentials loginCredentials;\n private final Set<... | import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.cassandra.thrift.Cassandra;
import org.apache.cassandra.thrift.TokenR... | /**
* 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 ClusterSpec clusterSpec; | 1 |
zetbaitsu/CodePolitan | app/src/main/java/id/zelory/codepolitan/data/database/DataBaseHelper.java | [
"public enum BenihScheduler\n{\n HARVEST;\n private final Observable.Transformer newThread;\n private final Observable.Transformer io;\n private final Observable.Transformer computation;\n\n BenihScheduler()\n {\n newThread = new Observable.Transformer()\n {\n @Override\n ... | import rx.Observable;
import android.database.Cursor;
import com.squareup.sqlbrite.BriteDatabase;
import com.squareup.sqlbrite.SqlBrite;
import java.util.ArrayList;
import java.util.List;
import id.zelory.benih.util.BenihScheduler;
import id.zelory.codepolitan.BuildConfig;
import id.zelory.codepolitan.CodePolitanApplic... | /*
* Copyright (c) 2015 Zelory.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | .compose(BenihScheduler.pluck().applySchedulers(BenihScheduler.Type.IO)) | 0 |
dan-silver/cast-dashboard-android-app | app/src/main/java/com/silver/dan/castdemo/settingsFragments/GoogleCalendarListAdapter.java | [
"public class CastCommunicator {\n CastSession mCastSession;\n\n public CastCommunicator(CastSession session) {\n this.mCastSession = session;\n }\n\n public void sendWidgetProperty(Widget widget, String property, Object value) {\n try {\n JSONObject propertyValue = new JSONObje... | import android.graphics.Color;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.TextView;
import com.silver.dan.castdemo.CastCommunicator... | package com.silver.dan.castdemo.settingsFragments;
public class GoogleCalendarListAdapter extends RecyclerView.Adapter<GoogleCalendarListAdapter.CalendarViewHolder> {
private final Widget widget;
private List<GoogleCalendarWidget.Calendar> calendars = new ArrayList<>();
public static class CalendarView... | new CastCommunicator(MainActivity.mCastSession).sendWidget(widget, holder.calendarName.getContext()); | 1 |
mojohaus/mrm | mrm-servlet/src/main/java/org/codehaus/mojo/mrm/servlet/FileSystemServlet.java | [
"public class DefaultDirectoryEntry\n extends AbstractEntry\n implements DirectoryEntry\n{\n /**\n * Ensure consistent serialization.\n *\n * @since 1.0\n */\n private static final long serialVersionUID = 1L;\n\n /**\n * Creates an entry in the specified file system with the speci... | import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Reader;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.... | /*
* Copyright 2011 Stephen Connolly
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | this.fileSystem = new MemoryFileSystem(); | 5 |
urbanairship/datacube | src/test/java/com/urbanairship/datacube/HBaseBackfillIntegrationTest.java | [
"enum CommitType {\n READ_COMBINE_CAS,\n INCREMENT,\n OVERWRITE\n}",
"public class HBaseBackfillMerger implements Runnable {\n private static final Logger log = LoggerFactory.getLogger(HBaseBackfillMerger.class);\n\n static final String CONFKEY_COLUMN_FAMILY = \"hbasebackfiller.cf\";\n static fi... | import com.google.common.collect.ImmutableList;
import com.urbanairship.datacube.DbHarness.CommitType;
import com.urbanairship.datacube.backfill.HBaseBackfillMerger;
import com.urbanairship.datacube.backfill.HBaseSnapshotter;
import com.urbanairship.datacube.bucketers.EnumToOrdinalBucketer;
import com.urbanairship.data... | /*
Copyright 2012 Urban Airship and Contributors
*/
package com.urbanairship.datacube;
public class HBaseBackfillIntegrationTest extends EmbeddedClusterTestAbstract {
private enum Color {RED, BLUE}
private static final DateTime midnight = new DateTime(DateTimeZone.UTC).minusDays(1).
withHourOfD... | new EnumToOrdinalBucketer<Color>(1), false, 1); | 3 |
Esri/military-apps-library-java | source/MilitaryAppsLibrary/test/com/esri/militaryapps/controller/test/PositionReportControllerTest.java | [
"public abstract class LocationController {\n \n private double speedMultiplier = 0;\n\n /**\n * Location modes.\n */\n public enum LocationMode {\n /**\n * Use the location service, such as a GPS service, to get real locations.\n */\n LOCATION_SERVICE,\n /**... | import com.esri.militaryapps.controller.LocationController;
import com.esri.militaryapps.controller.LocationController.LocationMode;
import com.esri.militaryapps.controller.MessageController;
import com.esri.militaryapps.controller.MessageControllerListener;
import com.esri.militaryapps.controller.PositionReportControl... | /*******************************************************************************
* Copyright 2013-2014 Esri
*
* 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.... | protected LocationProvider createLocationServiceProvider() { | 6 |
OHDSI/WhiteRabbit | rabbitinahat/src/main/java/org/ohdsi/rabbitInAHat/ETLWordDocumentGenerator.java | [
"public class CustomXWPFDocument extends XWPFDocument {\r\n\t\r\n\tpublic CustomXWPFDocument() {\r\n\t\tsuper();\r\n\t}\r\n\t\r\n\tpublic CustomXWPFDocument(InputStream in) throws IOException {\r\n\t\tsuper(in);\r\n\t}\r\n\t\r\n\tpublic void addPicture(BufferedImage image, int width, int height) throws InvalidForma... | import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.apache.poi.xwpf.usermodel.BreakType;
import org.apache... | /*******************************************************************************
* Copyright 2019 Observational Health Data Sciences and Informatics
*
* This file is part of WhiteRabbit
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance wit... | Mapping<Field> fieldtoFieldMapping = etl.getFieldToFieldMapping(sourceTable, targetTable);
| 5 |
xuzhenyang/ZeroCola | src/main/java/co/lilpilot/blog/controller/PostController.java | [
"@Data\npublic class CustomPage<T> {\n private int pageIndex;\n private int pageSize;\n private int totalPage;\n private int totalNumber;\n private List<T> data = Collections.emptyList();\n\n public CustomPage() {\n this.pageIndex = 1;\n this.pageSize = 10;\n this.totalPage = ... | import co.lilpilot.blog.model.CustomPage;
import co.lilpilot.blog.model.Post;
import co.lilpilot.blog.model.vo.PostListVO;
import co.lilpilot.blog.service.PostService;
import co.lilpilot.blog.util.Result;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.... | package co.lilpilot.blog.controller;
/**
* Created by lilpilot on 2017/5/8.
*/
@RestController
@RequestMapping("/api/v1")
@Slf4j
public class PostController {
@Autowired
private PostService postService;
@GetMapping("/posts")
@ApiOperation(value = "获取所有文章(打开状态)")
@ApiImplicitParams({
... | public Result<CustomPage<PostListVO>> getOpenPosts( | 2 |
tonyconstantinides/LiveMultimedia | app/src/main/java/com/constantinnovationsinc/livemultimedia/recorders/AVRecorder.java | [
"public class MultimediaApp extends Application {\n private static final String TAG = MultimediaApp.class.getCanonicalName();\n public ArrayBlockingQueue<ByteBuffer> mSavedAudioData = null;\n\n public synchronized void saveAudioData(ByteBuffer data) {\n mSavedAudioData.add(data);\n }\n\n pub... | import android.content.Context;
import android.media.MediaFormat;
import android.util.Log;
import android.app.Activity;
import android.os.Environment;
import android.media.SoundPool;
import android.media.AudioManager;
import com.constantinnovationsinc.livemultimedia.app.MultimediaApp;
import com.constantinnovationsinc.... | /*
* Copyright 2015 Constant Innovations 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 ... | String url = "http://" + DeviceNetwork.getLocalIpAddress() + ":8080"; | 3 |
janoliver/pOT-Droid | src/main/java/com/mde/potdroid/fragments/PaginateFragment.java | [
"public class BoardActivity extends BaseActivity {\n\n private BoardFragment mBoardFragment;\n private Integer mBoardId = 0;\n private Integer mPage = 0;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n setArgs(getIntent());\... | import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.view.*;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import com.mde.potdroid.BoardActivity;
import com.mde.potdroid.BookmarkActivity;
im... | package com.mde.potdroid.fragments;
/**
* This Fragment extends BaseFragment and provides some more methods and an interface
* for those Fragments who have pagination functionality.
*/
abstract public class PaginateFragment extends BaseFragment {
private LinearLayout mFastscrollLayout;
private FloatingAct... | intent = new Intent(getBaseActivity(), ForumActivity.class); | 2 |
B2MSolutions/reyna | reyna-test/src/com/b2msolutions/reyna/services/StoreServiceTest.java | [
"public class Time {\n\n private final int minuteOfDay;\n\n public Time(int hour, int minute) {\n if(hour >= 24 || minute >= 60 || hour < 0 || minute < 0) {\n throw new InvalidParameterException(\"Invalid time\");\n }\n\n this.minuteOfDay = (hour * 60) + minute;\n }\n\n p... | import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.b2msolutions.reyna.*;
import com.b2msolutions.reyna.blackout.Time;
import com.b2msolutions.reyna.blackout.TimeRange;
import com.b2msolutions.reyna.system.Logger;
import com.b2msolutions.reyna.system.Message;
import com.b2... | package com.b2msolutions.reyna.services;
@RunWith(RobolectricTestRunner.class)
public class StoreServiceTest {
@Mock Repository repository;
private StoreService storeService;
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
this.storeService = org.robolectric.Robo... | assertEquals(Log.DEBUG, Logger.getLevel()); | 2 |
thedudeguy/JukeIt | src/main/java/com/chrischurchwell/jukeit/material/blocks/JukeboxBlock.java | [
"public class JukeIt extends JavaPlugin {\r\n\t\r\n\tprivate static JukeIt instance;\r\n\tpublic Server HTTPserver;\r\n\tSelectChannelConnector HTTPconnector;\r\n\t\r\n\tBlocks blocks;\r\n\tItems items;\r\n\t\r\n\tpublic static JukeIt getInstance() {\r\n\t\treturn instance;\r\n\t}\r\n\t\r\n\tpublic static void info... | import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.block.SpoutBlock;
im... | /**
* This file is part of JukeIt
*
* Copyright (C) 2011-2013 Chris Churchwell
*
* 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 o... | Debug.debug("Attempting to start jukebox with url ", url);
| 7 |
lacuna/bifurcan | src/io/lacuna/bifurcan/durable/codecs/List.java | [
"public class BlockPrefix {\n\n public enum BlockType {\n // root (2 bits)\n PRIMITIVE,\n TABLE,\n DIFF, // continuation\n COLLECTION, // continuation\n\n // 3 bits preceded by COLLECTION\n HASH_MAP,\n SORTED_MAP,\n HASH_SET,\n SORTED_SET,\n LIST,\n COLLECTION_PLACEHOLDER_... | import io.lacuna.bifurcan.*;
import io.lacuna.bifurcan.durable.BlockPrefix;
import io.lacuna.bifurcan.durable.BlockPrefix.BlockType;
import io.lacuna.bifurcan.durable.Util;
import io.lacuna.bifurcan.durable.io.DurableBuffer;
import java.util.Iterator;
import static io.lacuna.bifurcan.durable.codecs.Core.encodeBlock; | package io.lacuna.bifurcan.durable.codecs;
/**
* An indexed list, encoded as:
* - the number of elements [VLQ]
* - number of SkipTable tiers [uint8]
* - a SkipTable over the blocks of elements (unless number of tiers is 0)
* - zero or more ENCODED blocks generated by {@link IDurableEncoding.List#elementEncodin... | DurableBuffer elements = new DurableBuffer(); | 3 |
xda/XDA-One | android/src/main/java/com/xda/one/ui/helper/UrlParseHelper.java | [
"public interface Consumer<T> {\n\n public void run(T data);\n}",
"public interface Forum extends Parcelable {\n\n public String getTitle();\n\n public int getForumId();\n\n public int getParentId();\n\n public String getForumSlug();\n\n public boolean isSubscribed();\n\n public void setSubsc... | import com.xda.one.api.inteface.PostClient;
import com.xda.one.api.misc.Consumer;
import com.xda.one.api.model.interfaces.Forum;
import com.xda.one.api.model.response.container.ResponsePostContainer;
import com.xda.one.api.retrofit.RetrofitPostClient;
import com.xda.one.db.ForumDbHelper;
import com.xda.one.model.augmen... | package com.xda.one.ui.helper;
public class UrlParseHelper {
private static final Pattern PAGE_PATTERN = Pattern.compile("page(\\d+)");
private static final Pattern THREAD_PATTERN = Pattern.compile("-t(\\d+)");
public static void parseUrl(final Context context, final Uri uri,
final Consu... | if (Utils.isCollectionEmpty(segments)) { | 7 |
xcsp3team/XCSP3-Java-Tools | src/main/java/org/xcsp/common/structures/AbstractTuple.java | [
"public interface Condition {\n\n\t/**\n\t * Returns an object instance of a class implementing {@code Condition}, built from the specified arguments.\n\t * \n\t * @param operator\n\t * a relational operator {@code TypeConditionOperatorRel}, a set operator\n\t * {@code TypeConditionOperatorSet... | import java.util.stream.IntStream;
import java.util.stream.Stream;
import org.xcsp.common.Condition;
import org.xcsp.common.Condition.ConditionIntset;
import org.xcsp.common.Condition.ConditionIntvl;
import org.xcsp.common.Condition.ConditionSet;
import org.xcsp.common.Condition.ConditionVal;
import org.xcsp.common.Con... | package org.xcsp.common.structures;
public interface AbstractTuple {
boolean match(int[] tuple);
public static class OrdinaryTuple implements AbstractTuple {
public int[] values;
public OrdinaryTuple(int[] values) {
this.values = values;
}
@Override
public boolean match(int[] t) {
assert t.leng... | Utilities.control(Stream.of(values).allMatch(v -> v instanceof Integer || v instanceof ConditionVal || v instanceof ConditionSet), | 4 |
tliron/scripturian | components/scripturian/source/com/threecrickets/scripturian/parser/ProgramParser.java | [
"public class Executable\n{\n\t//\n\t// Constants\n\t//\n\n\t/**\n\t * Prefix prepended to on-the-fly scriptlets stored in the document source.\n\t */\n\tpublic static final String ON_THE_FLY_PREFIX = \"_ON_THE_FLY_\";\n\n\t//\n\t// Static operations\n\t//\n\n\t/**\n\t * If the executable does not yet exist in the ... | import java.util.Collection;
import java.util.Collections;
import com.threecrickets.scripturian.Executable;
import com.threecrickets.scripturian.ExecutableSegment;
import com.threecrickets.scripturian.Parser;
import com.threecrickets.scripturian.ParsingContext;
import com.threecrickets.scripturian.exception.DocumentExc... | /**
* Copyright 2009-2017 Three Crickets LLC.
* <p>
* The contents of this file are subject to the terms of the LGPL version 3.0:
* http://www.gnu.org/copyleft/lesser.html
* <p>
* Alternatively, you can obtain a royalty free commercial license with less
* limitations, transferable or non-transferable, directly f... | public Collection<ExecutableSegment> parse( String sourceCode, ParsingContext parsingContext, Executable executable ) throws ParsingException, DocumentException | 5 |
SumoLogic/sumologic-jenkins-plugin | src/main/java/com/sumologic/jenkins/jenkinssumologicplugin/utility/CommonModelFactory.java | [
"@Extension\npublic final class PluginDescriptorImpl extends BuildStepDescriptor<Publisher> {\n\n private Secret url;\n private transient SumoMetricDataPublisher sumoMetricDataPublisher;\n private static LogSenderHelper logSenderHelper = null;\n private String queryPortal;\n private String sourceCate... | import com.sumologic.jenkins.jenkinssumologicplugin.PluginDescriptorImpl;
import com.sumologic.jenkins.jenkinssumologicplugin.constants.AuditEventTypeEnum;
import com.sumologic.jenkins.jenkinssumologicplugin.constants.EventSourceEnum;
import com.sumologic.jenkins.jenkinssumologicplugin.constants.LogTypeEnum;
import com... | * @return UserName
*/
private static String getUpStreamUser(Cause.UpstreamCause upstreamCause) {
for (Cause upCause : upstreamCause.getUpstreamCauses()) {
if (upCause instanceof Cause.UpstreamCause) {
return getUpStreamUser((Cause.UpstreamCause) upCause);
} ... | testCaseModel.getTestResults().addAll(getTestCaseReport(buildInfo)); | 7 |
irq0/jext2 | src/fusejext2/tasks/Init.java | [
"public class Jext2Context extends Context {\n\tpublic BlockAccess blocks;\n\tpublic Superblock superblock;\n\tpublic BlockGroupAccess blockGroups;\n\n\tpublic FileChannel blockDev;\n\n\tpublic InodeAccess inodes;\n\n\tpublic Jext2Context(FileChannel blockDev) {\n\t\tthis.blockDev = blockDev;\n\t}\n}",
"public cl... | import jext2.InodeAccess;
import java.util.Date;
import fusejext2.Jext2Context;
import jext2.BlockAccess;
import jext2.BlockGroupAccess;
import jext2.Constants;
import jext2.Feature;
import jext2.Superblock;
import jext2.exceptions.IoError;
import jext2.exceptions.JExt2Exception; | /*
* Copyright (c) 2011 Marcel Lauhoff.
*
* This file is part of jext2.
*
* jext2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later vers... | context.inodes = InodeAccess.getInstance(); | 8 |
kumai/kt4j | src/java/kt4j/tsvrpc/KyotoTycoonTsvRpcClient.java | [
"public class Bytes {\n private static final Charset UTF8 = Charset.forName(\"UTF-8\");\n\n private Bytes() {}\n \n /**\n * Returns a byte array encoded by UTF-8 for the specified string.\n */\n public static byte[] utf8(String str) {\n if (str != null) {\n return str.getByt... | import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import kt4j.Bytes;
import kt4j.ExpirationTime;
import kt4j.Operation;
import kt4j.KyotoTycoonOperationFailedException;
import kt4j.... | package kt4j.tsvrpc;
/**
* Kyoto Tycoon Client using TSV-RPC over HTTP.
*
* @author kumai
*/
public class KyotoTycoonTsvRpcClient extends AbstractKyotoTycoonClient {
private String database;
private TsvColumnCodec codec;
public KyotoTycoonTsvRpcClient(String hostname, int port) {
this(host... | Operation operation = call(request); | 2 |
SimpleServer/SimpleServer | src/simpleserver/events/RunningEvent.java | [
"public class Coordinate {\n private int x;\n private int y;\n private int z;\n private Dimension dimension;\n private final int hashCode;\n\n public Coordinate(int x, int y, int z) {\n this(x, y, z, Dimension.EARTH);\n }\n\n public Coordinate(int x, int y, int z, Player player) {\n this(x, y, z, play... | import simpleserver.command.PlayerCommand;
import simpleserver.command.ServerCommand;
import simpleserver.config.xml.CommandConfig;
import simpleserver.config.xml.CommandConfig.Forwarding;
import simpleserver.config.xml.Event;
import simpleserver.log.EventsLog;
import java.io.IOException;
import java.util.ArrayList;
im... | /*
* Copyright (c) 2010 SimpleServer authors (see CONTRIBUTORS)
*
* 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, ... | protected Server server; | 2 |
Hoiio/hoiio-java | src/com/hoiio/sdk/services/SMSService.java | [
"public class HoiioException extends Exception {\n\n\tprivate static final long serialVersionUID = 1L;\n\t\n\tprivate HoiioStatus status;\n\tprivate String response;\n\t\n\t/**\n\t * Constructs the HoiioException object\n\t */\n\tpublic HoiioException() {\n\t\tsuper();\n\t}\n\t\n\t/**\n\t * Constructs the HoiioExce... | import com.hoiio.sdk.objects.sms.BulkSmsTxn;
import com.hoiio.sdk.objects.sms.Sms;
import com.hoiio.sdk.objects.sms.SmsHistory;
import com.hoiio.sdk.objects.sms.SmsRate;
import com.hoiio.sdk.objects.sms.SmsTxn;
import com.hoiio.sdk.util.DateUtil;
import com.hoiio.sdk.util.StringUtil;
import java.util.Date;
import java.... | package com.hoiio.sdk.services;
/*
Copyright (C) 2012 Hoiio Pte Ltd (http://www.hoiio.com)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the ri... | public Sms fetchSms(String txnRef) throws HoiioException { | 3 |
ThreeTen/threetenbp | src/test/java/org/threeten/bp/TestZonedDateTime.java | [
"public final class DateTimeFormatter {\n\n //-----------------------------------------------------------------------\n /**\n * Returns the ISO date formatter that prints/parses a date without an offset,\n * such as '2011-12-03'.\n * <p>\n * This returns an immutable formatter capable of print... | import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.threeten.bp.Month.JANUARY;
import static org.threeten.bp.temporal.ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH;
import static org.threeten.bp.temporal.ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR;
import static org.threet... | }
@Test(expectedExceptions=DateTimeException.class)
public void factory_from_DateTimeAccessor_invalid_noDerive() {
ZonedDateTime.from(LocalTime.of(12, 30));
}
@Test(expectedExceptions=NullPointerException.class)
public void factory_from_DateTimeAccessor_null() {
ZonedDateTime.f... | DateTimeFormatter f = DateTimeFormatter.ofPattern("u M d H m s VV"); | 0 |
kebernet/pretty | src/main/java/com/reachcall/pretty/peering/FailWatcher.java | [
"@XmlRootElement(name = \"configuration\")\n@XmlAccessorType(XmlAccessType.PROPERTY)\npublic class Configuration {\n private Configuration parent;\n private Integer maxRequestsByHost;\n private List<Configuration> children = new LinkedList<Configuration>();\n private List<Destination> destinations;\n ... | import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import com.reachcall.pretty.config.Configuration;
import com.reachcall.pretty.peering.Agent.AgentListener;
import com.reachcall.pretty.peering.beats.Heartbeat;
import com.reachcall.pretty.peering.beats.Initiative;
import com.reach... | /**
* Copyright 2013, Robert Cooper, Reach Health
*
* 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
*/
/*
* To change this template, c... | private ConcurrentHashMap<String, Initiative> myRolls = new ConcurrentHashMap<String, Initiative>(); | 3 |
google/git-appraise-eclipse | ui/src/com/google/appraise/eclipse/ui/contextmenus/ReviewMarkerMenuContribution.java | [
"public class ReviewComment {\n private String author;\n private long timestamp;\n private Boolean resolved;\n private ReviewCommentLocation location;\n private String description;\n \n /**\n * This (if set) is the id of a comment that this comment is in reply to.\n * See the javadoc in {@link ReviewComm... | import com.google.appraise.eclipse.core.client.data.ReviewComment;
import com.google.appraise.eclipse.core.client.data.ReviewCommentLocation;
import com.google.appraise.eclipse.core.client.data.ReviewCommentLocationRange;
import com.google.appraise.eclipse.ui.EditCommentDialog;
import com.google.appraise.eclipse.ui.Rev... | /*******************************************************************************
* Copyright (c) 2015 Google and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available ... | ReviewComment comment = new ReviewComment(); | 0 |
NanYoMy/mybatis-generator | src/main/java/org/mybatis/generator/api/IntrospectedTable.java | [
"public class Context extends PropertyHolder {\n private String id;\n\n private JDBCConnectionConfiguration jdbcConnectionConfiguration;\n\n private SqlMapGeneratorConfiguration sqlMapGeneratorConfiguration;\n\n private JavaTypeResolverConfiguration javaTypeResolverConfiguration;\n\n private JavaMode... | import static org.mybatis.generator.internal.util.StringUtility.isTrue;
import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import org.my... | /*
* Copyright 2006 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | protected TableConfiguration tableConfiguration; | 5 |
valerio-bozzolan/bus-torino | src/it/reyboz/bustorino/fragments/MainScreenFragment.java | [
"public class AppLocationManager implements LocationListener {\n\n public static final int LOCATION_GPS_AVAILABLE = 22;\n public static final int LOCATION_UNAVAILABLE = -22;\n\n private final Context appContext;\n private final LocationManager locMan;\n public static final String DEBUG_TAG = \"BUSTO ... | import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Criteria;
import android.location.Location;
import android.os.Build;
import android.os.Bundle;
import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResult... | + " must implement CommonFragmentListener");
}
if (setupOnAttached) {
if (pendingStopID==null)
//We want the nearby bus stops!
mainHandler.post(new NearbyStopsRequester(context, cr));
else{
///TODO: if there is a stop di... | new AsyncStopsSearcher(fragmentHelper, stopsFinderByNames).execute(query); | 2 |
scrutmydocs/scrutmydocs | src/test/java/org/scrutmydocs/webapp/test/rivers/AdminFSRiverServiceTest.java | [
"public class FSRiver extends AbstractFSRiver {\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n private String protocol;\r\n private String server;\r\n private String username;\r\n private String password;\r\n\r\n /**\r\n\t * We implement here a \"fs\" river\r\n\t */\r\n\t@Override\r\n\... | import java.util.Collection;
import fr.pilato.elasticsearch.river.fs.river.FsRiver;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.junit.Assert;
import org.junit.Test;
import org.scrutmydocs.webapp.api.settings.rivers.fs.data.FSRiver;
import org.scrutmydocs.webapp.api.settings.rivers.fs.help... | /*
* Licensed to scrutmydocs.org (the "Author") under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Author licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you ma... | XContentBuilder xb = new FSRiverHelper().toXContent(
| 1 |
apache/commons-proxy | test/src/test/java/org/apache/commons/proxy2/serialization/SerializationProxyTest.java | [
"public interface ProxyFactory\n{\n //******************************************************************************************************************\n // Other Methods\n //******************************************************************************************************************\n\n /**\n ... | import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.Serializable;
import org.apache.commons.lang3.SerializationException;
import org.apache.commons.lang3.SerializationUtils;
import org.apache.commons.proxy2.ProxyFactory;
import org.apache.commons... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | private static final ThreadLocal<ProxyFactory> PROXY_FACTORY = new ThreadLocal<ProxyFactory>(); | 0 |
scriptkitty/SNC | unikl/disco/calculator/gui/ControlPanelActions.java | [
"public class SNC {\r\n\r\n private final UndoRedoStack undoRedoStack;\r\n private static SNC singletonInstance;\r\n private final List<Network> networks;\r\n private final int currentNetworkPosition;\r\n\r\n private SNC() {\r\n networks = new ArrayList<>();\r\n undoRedoStack = new Undo... | import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import unikl.disco.calculator.SNC;
import unikl.disco.calculator.commands.Command;
import unikl.disco.calculator.commands.ConvoluteVerticesCommand;
import unikl.disco.calculator.commands.RemoveFlowCommand;
import unikl... | /*
* (c) 2017 Michael A. Beck, Sebastian Henningsen
* disco | Distributed Computer Systems Lab
* University of Kaiserslautern, Germany
* All Rights Reserved.
*
* This software is work in progress and is released in the hope that it will
* be useful to the scientific community. It is provided "as is" with... | } catch (NetworkActionException ex) { | 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... | private final ExecutionMode mode; | 0 |
genepi/imputationserver | src/main/java/genepi/imputationserver/steps/InputValidation.java | [
"public class ImputationPipeline {\n\n\tpublic static final String PIPELINE_VERSION = \"michigan-imputationserver-1.6.5\";\n\n\tpublic static final String IMPUTATION_VERSION = \"minimac4-1.0.2\";\n\n\tpublic static final String BEAGLE_VERSION = \"beagle.18May20.d20.jar\";\n\n\tpublic static final String EAGLE_VERSI... | import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Vector;
import cloudgene.sdk.internal.WorkflowContext;
import cloudgene.sdk.internal.WorkflowStep;
import genepi.hadoop.importer.IImporter;
import genepi.hadoop.importer.ImporterFactory;
import genepi.imput... | package genepi.imputationserver.steps;
public class InputValidation extends WorkflowStep {
@Override
public boolean run(WorkflowContext context) {
context.log("Versions:");
context.log(" Pipeline: " + ImputationPipeline.PIPELINE_VERSION);
context.log(" Imputation-Engine: " + ImputationPipeline.IMPUTATION... | PgsPanel pgsPanel = PgsPanel.loadFromProperties(context.getData("pgsPanel")); | 5 |
flyersa/MuninMX | src/com/clavain/jobs/CheckJob.java | [
"public class ReturnDebugTrace {\n private String output;\n private int checktime;\n private int retval;\n private int cid;\n private int user_id;\n\n /**\n * @return the output\n */\n public String getOutput() {\n return output;\n }\n\n /**\n * @param output the output... | import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import static com.clavain.utils.Generic.returnServiceCheck;
import static com.clavain.utils.Generic.checkIsProcessing;
import static com.clavain.utils.Generic.getUnixtime;
import static com.clavain.utils.Databa... | /*
* MuninMX
* Written by Enrico Kern, kern@clavain.com
* www.clavain.com
*
* 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... | if(!checkIsProcessing(rsc.getCid())) | 6 |
heroku/heroku.jar | heroku-api/src/main/java/com/heroku/api/request/addon/AddonRemove.java | [
"public class AddonChange implements Serializable {\n\n private static final long serialVersionUID = 1L;\n\n String state;\n\n public String getState() {\n return state;\n }\n\n private void setState(String state) {\n this.state = state;\n }\n}",
"public class Heroku {\n\n\n pub... | import com.heroku.api.AddonChange;
import com.heroku.api.Heroku;
import com.heroku.api.exception.RequestFailedException;
import com.heroku.api.http.Http;
import com.heroku.api.request.Request;
import com.heroku.api.request.RequestConfig;
import java.util.Collections;
import java.util.Map;
import static com.heroku.api.h... | package com.heroku.api.request.addon;
/**
* TODO: Javadoc
*
* @author Naaman Newbold
*/
public class AddonRemove implements Request<AddonChange> {
private final RequestConfig config;
public AddonRemove(String appName, String addonName) { | this.config = new RequestConfig().app(appName).with(Heroku.RequestKey.AddonName, addonName); | 1 |
confabulation/symbolic | java_sentence_completion/src/confabulation/Main.java | [
"public class GuiConsole extends JPanel implements ActionListener,\n\t\tAncestorListener {\n\n\tprivate static final long serialVersionUID = -1467490432851738156L;\n\n\t/**\n\t * Blocking read from the GuiConsole, like System.in\n\t */\n\tpublic final GuiIn in;\n\t/**\n\t * Print to the console, like System.out\n\t... | import parser.Tokenizer;
import parser.WordTokenizer;
import preprocessor.Preprocessor;
import utils.ArrayTools;
import utils.RuntimeIOException;
import utils.StringTools;
import gui.GuiConsole;
import io.BufferedReader;
import io.LineStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOE... | /**
* Copyright 2011-2012 Bernard Paulus and Cédric Snauwaert
*
* Confabulation_Symbolic 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 ... | err.println(StringTools.fold(80, | 6 |
ProjectInfinity/ReportRTS | src/main/java/com/nyancraft/reportrts/command/sub/UnclaimTicket.java | [
"public class RTSFunctions {\n\n private static ReportRTS plugin = ReportRTS.getPlugin();\n private static DataProvider data = plugin.getDataProvider();\n\n private static final int SECOND_MILLIS = 1000;\n private static final int MINUTE_MILLIS = 60 * SECOND_MILLIS;\n private static final int HOUR_MI... | import com.nyancraft.reportrts.RTSFunctions;
import com.nyancraft.reportrts.RTSPermissions;
import com.nyancraft.reportrts.ReportRTS;
import com.nyancraft.reportrts.data.NotificationType;
import com.nyancraft.reportrts.event.TicketUnclaimEvent;
import com.nyancraft.reportrts.persistence.DataProvider;
import com.nyancra... | package com.nyancraft.reportrts.command.sub;
public class UnclaimTicket {
private static ReportRTS plugin = ReportRTS.getPlugin();
private static DataProvider data = plugin.getDataProvider();
/**
* Initial handling of the Unclaim sub-command.
* @param sender player that sent the command
... | BungeeCord.globalNotify(Message.ticketUnclaim(plugin.tickets.get(ticketId).getStaffName(), args[1]), ticketId, NotificationType.MODIFICATION); | 3 |
xZise/Bukkit-Plugin-Utilties | src/main/java/de/xzise/commands/CommonHelpCommand.java | [
"public final class MinecraftUtil {\n\n public static final int PLAYER_LINES_COUNT = 10;\n /**\n * @deprecated Use {@link #PLAYER_LINES_COUNT} instead.\n */\n // TODO: Remove in BPU 2\n public static final int MAX_LINES_VISIBLE = PLAYER_LINES_COUNT;\n public static final int CONSOLE_LINES_COU... | import de.xzise.commands.SubCommand;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import de.xzise.MinecraftUtil;
import de.xzise.commands.CommandMap;
import de.xzise.commands.CommonHelpableSubCommand;
import de.xzise.commands.FullHelpable;
impo... | /*
* This file is part of Bukkit Plugin Utilities.
*
* Bukkit Plugin Utilities is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later ver... | private final String getSmallHelp(SmallHelpable helpable) { | 5 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/WikiManager.java | [
"public class Project implements Identifiable, Serializable, FluentStyle {\n\tprivate static final long serialVersionUID = 4529305420978716446L;\n\n private final PropertyStorage storage = new PropertyStorage();\n\n /**\n * database ID\n */\n public final static Property<Integer> DATABASE_ID = new ... | import com.taskadapter.redmineapi.bean.Project;
import com.taskadapter.redmineapi.bean.WikiPage;
import com.taskadapter.redmineapi.bean.WikiPageDetail;
import com.taskadapter.redmineapi.internal.RequestParam;
import com.taskadapter.redmineapi.internal.Transport;
import org.apache.http.message.BasicNameValuePair;
import... | package com.taskadapter.redmineapi;
/**
* Works with Wiki entries (read-only at this moment).
* <p>Obtain it via RedmineManager:
* <pre>
RedmineManager redmineManager = RedmineManagerFactory.createWithUserAuth(redmineURI, login, password);
WikiManager wikiManager = redmineManager.getWikiManager();
* </pre>
*
... | WikiPageDetail wikiPageDetail = transport.getChildEntry(Project.class, projectKey, WikiPageDetail.class, urlSafeString, new RequestParam("include", "attachments")); | 3 |
idega/se.idega.idegaweb.commune.accounting | src/java/se/idega/idegaweb/commune/accounting/invoice/business/PaymentThreadHighSchool.java | [
"public interface ExportDataMapping extends IDOEntity {\n\n\t/**\n\t * @see se.idega.idegaweb.commune.accounting.export.data.ExportDataMappingBMPBean#getPrimaryKeyClass\n\t */\n\tpublic Class getPrimaryKeyClass();\n\n\t/**\n\t * @see se.idega.idegaweb.commune.accounting.export.data.ExportDataMappingBMPBean#getOpera... | import java.rmi.RemoteException;
import java.sql.Date;
import java.util.ArrayList;
import java.util.Collection;
import se.idega.idegaweb.commune.accounting.export.data.ExportDataMapping;
import se.idega.idegaweb.commune.accounting.posting.business.PostingException;
import se.idega.idegaweb.commune.accounting.regulation... | package se.idega.idegaweb.commune.accounting.invoice.business;
/**
* Holds most of the logic for the batchjob that creates the information that
* is base for payment data, that is sent to external finance system.
*
* @author Joakim
*
* @see se.idega.idegaweb.commune.accounting.invoice.business.PaymentThread... | cond.add(new ConditionParameter(RuleTypeConstant.CONDITION_ID_COMMUNE, defaultCommune.getPrimaryKey())); | 1 |
Velli20/Tachograph | app/src/main/java/com/velli20/tachograph/FragmentNow.java | [
"public class ListAdapterFragmentNow extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\n public static final int VIEW_TYPE_REGULATION = 1;\n public static final int VIEW_TYPE_ACTIVITY_CHOOSER = 2;\n public static final int VIEW_TYPE_GPS_STATUS = 3;\n public static final int VIEW_TYPE_ERROR = -1;\n... | import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayo... | /*
*
* * MIT License
* *
* * Copyright (c) [2017] [velli20]
* *
* * 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 righ... | mListWorkLimits.addItemDecoration(new SpacesItemDecorationFragmentNow(divider, appCompatElevation)); | 2 |
ls1intum/jReto | Source/src/de/tum/in/www1/jReto/connectivity/packet/CancelledTransferPacket.java | [
"public class Constants {\n\tpublic static final int PACKET_TYPE_SIZE = 4;\n\tpublic static final int INT_SIZE = 4;\n\tpublic static final int UUID_SIZE = 16;\n}",
"public class DataChecker {\n /**\n * Verifies that the data (wrapped in a DataReader) has the expected packet type, and has the minimum require... | import java.nio.ByteBuffer;
import java.util.UUID;
import de.tum.in.www1.jReto.packet.Constants;
import de.tum.in.www1.jReto.packet.DataChecker;
import de.tum.in.www1.jReto.packet.DataReader;
import de.tum.in.www1.jReto.packet.DataWriter;
import de.tum.in.www1.jReto.packet.Packet;
import de.tum.in.www1.jReto.packet.Pac... | package de.tum.in.www1.jReto.connectivity.packet;
/**
* Sent when a transfer was cancelled by the sender of a data transfer, or sent when the cancellation of a transfer is requested by the receiver of the data transfer.
*/
public class CancelledTransferPacket implements Packet {
public final static PacketType TYPE ... | DataWriter data = new DataWriter(LENGTH); | 3 |
BoD/android-contentprovider-generator | etc/sample-generated-code/org/jraf/androidcontentprovidergenerator/sample/provider/SampleProvider.java | [
"@SuppressWarnings({\"ConstantConditions\", \"unused\"})\npublic abstract class BaseContentProvider extends ContentProvider {\n public static final String QUERY_NOTIFY = \"QUERY_NOTIFY\";\n public static final String QUERY_GROUP_BY = \"QUERY_GROUP_BY\";\n public static final String QUERY_HAVING = \"QUERY_H... | import android.database.sqlite.SQLiteOpenHelper;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.util.Log;
import org.jraf.androidcontentprovidergenerator.sample.BuildConfig;
import org.jraf.androidcontentprovidergenerator.sample.provider.base.BaseContentProvider;
import org.jraf.andro... | /*
* This source is part of the
* _____ ___ ____
* __ / / _ \/ _ | / __/___ _______ _
* / // / , _/ __ |/ _/_/ _ \/ __/ _ `/
* \___/_/|_/_/ |_/_/ (_)___/_/ \_, /
* /___/
* repository.
*
* Copyright (C) 2012-2017 Benoit 'BoD' Lubek (BoD@JRAF.org)
*
* This program is fre... | URI_MATCHER.addURI(AUTHORITY, ProductColumns.TABLE_NAME, URI_TYPE_PRODUCT); | 5 |
highsource/tenra | core/src/main/java/org/hisrc/tenra/converter/railwaytransportnetwork/_3/RailwayLinkTypeConverter.java | [
"public interface Converter<I, O> {\n\n\tpublic O convert(I value);\n\n}",
"public class IdentifierPropertyTypeToStringConverter implements\n\t\tConverter<IdentifierPropertyType, String> {\n\t\n\tpublic static final Converter<IdentifierPropertyType, String> INSTANCE = new IdentifierPropertyTypeToStringConverter()... | import inspire.x.specification.gmlas.railwaytransportnetwork._3.RailwayLinkType;
import java.util.List;
import net.opengis.gml.v_3_2_1.ReferenceType;
import org.apache.commons.lang3.Validate;
import org.hisrc.tenra.converter.Converter;
import org.hisrc.tenra.converter.basetypes._3.IdentifierPropertyTypeToStringConverte... | package org.hisrc.tenra.converter.railwaytransportnetwork._3;
public class RailwayLinkTypeConverter implements
Converter<RailwayLinkType, RailwayLink> {
public static final Converter<RailwayLinkType, RailwayLink> INSTANCE = new RailwayLinkTypeConverter();
@Override
public RailwayLink convert(RailwayLinkType... | final String id = CodeWithAuthorityTypeToStringConverter.INSTANCE | 2 |
EladKeyshawn/HackList | app/src/main/java/com/projects/elad/hacklist/presentation/presenters/BookmarksPresenter.java | [
"public class HacklistApplication extends Application {\n\n private AppComponent appComponent;\n @Override\n public void onCreate() {\n super.onCreate();\n }\n\n public static HacklistApplication get(Context context) {\n return (HacklistApplication) context.getApplicationContext();\n ... | import android.content.Context;
import android.widget.Toast;
import com.projects.elad.hacklist.HacklistApplication;
import com.projects.elad.hacklist.data.DataManager;
import com.projects.elad.hacklist.presentation.base.BasePresenter;
import com.projects.elad.hacklist.presentation.views.BookmarksMvpView;
import com.pro... | package com.projects.elad.hacklist.presentation.presenters;
/**
* Created by EladKeyshawn on 25/02/2017.
*/
public class BookmarksPresenter extends BasePresenter<BookmarksMvpView> {
@Inject
DataManager dataManager;
@Inject
Context context;
private Subscription subscription;
public Boo... | ((HacklistApplication) (((FragmentBookmarks) getMvpView()).getActivity().getApplication())).getComponent().inject(this); | 5 |
MHAVLOVICK/Sketchy | src/main/java/com/sketchy/SketchyContext.java | [
"public class DrawingProperties extends MetaDataObject {\n\n\tprivate static final long serialVersionUID = 5559751191321106491L;\n\n\t@Override\t\n\tpublic MetaData getMetaData() {\n\t\t\n\t\tMetaData metaData = new MetaData();\n\t\tmetaData.setHelpUrl(\"docs/DrawingProperties.html\");\n\t\t\n\t\tMetaDataGroup defa... | import java.io.File;
import java.text.NumberFormat;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.commons.io.FileUtils;
import com.sketchy.drawing.DrawingProperties;
import com.sketchy.hardware.HardwareController;
import com.sketchy.hardware.HardwareControllerProperti... | /*
Sketchy
Copyright (C) 2015 Matthew Havlovick
http://www.quickdrawbot.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your op... | public static HardwareController hardwareController; | 1 |
czyrux/GroceryStore | app/src/androidTest/java/de/czyrux/store/test/GroceryStoreActivityCatalogTest.java | [
"public class Product {\n public final String sku;\n public final String title;\n public final String imageUrl;\n public final double price;\n\n public Product(String sku, String title, String imageUrl, double price) {\n this.sku = sku;\n this.title = title;\n this.imageUrl = ima... | import android.support.test.filters.LargeTest;
import android.support.test.rule.ActivityTestRule;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
impo... | package de.czyrux.store.test;
@RunWith(AndroidJUnit4.class)
@LargeTest
public class GroceryStoreActivityCatalogTest {
@Rule
public ActivityTestRule<GroceryStoreActivity> groceryStoreActivityActivityTestRule = new ActivityTestRule<>(GroceryStoreActivity.class, true, false);
@Rule
public RxIdlingR... | Injector.using(TestDependenciesFactory.fromDefault(dataDependencies) | 2 |
bekce/oauthly | app/controllers/UserController.java | [
"public class Utils {\n public static String normalizeUsername(String username){\n if(username == null) return null;\n return username.replaceAll(\"[^A-Za-z0-9]\",\"_\").toLowerCase(Locale.ENGLISH);\n }\n\n public static String normalizeEmail(String email){\n if(email == null) return n... | import com.fasterxml.jackson.databind.JsonNode;
import config.AuthorizationServerSecure;
import config.ResourceServerSecure;
import config.Utils;
import models.Grant;
import models.User;
import play.mvc.BodyParser;
import play.mvc.Controller;
import play.mvc.Result;
import repositories.EventRepository;
import repositor... | package controllers;
/**
* Created by Selim Eren Bekçe on 12.12.2017.
*/
public class UserController extends Controller {
@Inject
private UserRepository userRepository;
@Inject
private EventRepository eventRepository;
@AuthorizationServerSecure(requireAdmin = true)
public Result get() { | User user = request().attrs().get(AuthorizationServerSecure.USER); | 2 |
DigiArea/es5-model | com.digiarea.es5/src/com/digiarea/es5/CaseBlock.java | [
"public abstract class Statement extends Node {\r\n\r\n Statement() {\r\n super();\r\n }\r\n\r\n Statement(JSDocComment jsDocComment, int posBegin, int posEnd) {\r\n super(jsDocComment, posBegin, posEnd);\r\n }\r\n\r\n}\r",
"public class DefaultClause extends Node {\r\n\r\n /** \r\n ... | import com.digiarea.es5.Statement;
import com.digiarea.es5.DefaultClause;
import com.digiarea.es5.CaseClause;
import com.digiarea.es5.NodeList;
import com.digiarea.es5.JSDocComment;
import com.digiarea.es5.visitor.VoidVisitor;
import com.digiarea.es5.visitor.GenericVisitor;
| package com.digiarea.es5;
/**
* The Class CaseBlock.
*/
public class CaseBlock extends Statement {
/**
* The default clause.
*/
private DefaultClause defaultClause;
/**
* The case clauses.
*/
private NodeList<CaseClause> caseClauses;
public DefaultClau... | public <R, C> R accept(GenericVisitor<R, C> v, C ctx) throws Exception {
| 6 |
thedudeguy/JukeIt | src/main/java/com/chrischurchwell/jukeit/material/blocks/JukeboxBlock.java | [
"public class JukeIt extends JavaPlugin {\r\n\t\r\n\tprivate static JukeIt instance;\r\n\tpublic Server HTTPserver;\r\n\tSelectChannelConnector HTTPconnector;\r\n\t\r\n\tBlocks blocks;\r\n\tItems items;\r\n\t\r\n\tpublic static JukeIt getInstance() {\r\n\t\treturn instance;\r\n\t}\r\n\t\r\n\tpublic static void info... | import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.getspout.spoutapi.SpoutManager;
import org.getspout.spoutapi.block.SpoutBlock;
im... | /**
* This file is part of JukeIt
*
* Copyright (C) 2011-2013 Chris Churchwell
*
* 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 o... | ItemStack disc = DiscUtil.createDisc(rpdata);
| 8 |
manuelsc/Raven-Messenger | Raven App/src/main/java/at/flack/activity/NewMailActivity.java | [
"public class MainActivity extends AppCompatActivity {\n\tprivate DrawerLayout mDrawerLayout;\n\tprivate ListView mDrawerList;\n\tprivate ActionBarDrawerToggle mDrawerToggle;\n\n\tprivate CharSequence mTitle;\n\tprivate final String VERSION = \"16.01.30.1\";\n\n\tprivate static int current_fragment = -1;\n\tprivate... | import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.V... | /*
Copyright 2015 Philipp Adam, Manuel Caspari, Nicolas Lukaschek
contact@ravenapp.org
This file is part of Raven.
Raven 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
... | ArrayList<Email> all; | 4 |
salk31/RedQueryBuilder | redquerybuilder-js/src/main/java/com/redspr/redquerybuilder/js/client/ConfigurationAdapter.java | [
"public class Configuration {\n private Database database = new Database();\n\n private final From from = new From();\n\n public void fireEnumerate(EnumerateRequest request, AsyncCallback<Response> callback) {\n }\n\n // XXX not called by CommandBuilder. GWT users meant to use RedQueryBuilder?\n p... | import java.util.ArrayList;
import java.util.List;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.MultiWordSuggestOracle.MultiWordSuggestion;
import com.google.gwt.user.client.ui.Sug... | /*******************************************************************************
* Copyright (c) 2010-2013 Redspr Ltd.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* h... | ConstraintReferential fk = new ConstraintReferential( | 2 |
andreitognolo/raidenjpa | raidenjpa-core/src/main/java/org/raidenjpa/query/executor/QueryExecutor.java | [
"@BadSmell(\"1) Singleton dont allow multi thread - 2) Is it really necessary?\")\npublic class InMemoryDB {\n\n\tprivate static InMemoryDB me;\n\n\tprivate static final Object MUTEX = new Object();\n\t\n\tprivate Long sequence = 1L;\n\t\n\tprivate Map<String, List<Object>> data = new HashMap<String, List<Object>>(... | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.raidenjpa.db.InMemoryDB;
import org.raidenjpa.query.parser.FromClause;
import org.raidenjpa.query.parser.FromClauseItem;
import org.raidenjpa.query.parser.G... | package org.raidenjpa.query.executor;
public class QueryExecutor {
private Integer maxResult;
private int firstResult;
private Map<String, Object> parameters;
private QueryParser queryParser;
public QueryExecutor(String jpql, Map<String, Object> parameters, Integer maxResult) {
this.queryParser = new Quer... | join.setWith(new WithClause()); | 6 |
yyxhdy/ManyEAs | src/jmetal/operators/crossover/HUXCrossover.java | [
"public class Solution implements Serializable {\n\t/**\n\t * Stores the problem\n\t */\n\tprivate Problem problem_;\n\n\t/**\n\t * Stores the type of the encodings.variable\n\t */\n\tprivate SolutionType type_;\n\n\t/**\n\t * Stores the decision variables of the solution.\n\t */\n\tprivate Variable[] variable_;\n\... | import java.util.HashMap;
import java.util.List;
import jmetal.core.Solution;
import jmetal.encodings.solutionType.BinaryRealSolutionType;
import jmetal.encodings.solutionType.BinarySolutionType;
import jmetal.encodings.variable.Binary;
import jmetal.util.Configuration;
import jmetal.util.JMException;
import jmetal.uti... | // HUXCrossover.java
//
// Author:
// Antonio J. Nebro <antonio@lcc.uma.es>
// Juan J. Durillo <durillo@lcc.uma.es>
//
// Copyright (c) 2011 Antonio J. Nebro, Juan J. Durillo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Publi... | Solution parent2) throws JMException { | 5 |
beckchr/juel | modules/impl/src/main/java/de/odysseus/el/ExpressionFactoryImpl.java | [
"public abstract class ELContext {\r\n\tprivate Map<Class<?>, Object> context;\r\n\tprivate Locale locale;\r\n\tprivate boolean resolved;\r\n\r\n\t/**\r\n\t * Returns the context object associated with the given key. The ELContext maintains a\r\n\t * collection of context objects relevant to the evaluation of an ex... | import de.odysseus.el.tree.impl.Builder;
import de.odysseus.el.tree.impl.Cache;
import de.odysseus.el.tree.impl.Builder.Feature;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.util.EnumSet;
import ja... | /*
* Copyright 2006-2009 Odysseus Software 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 app... | private final TypeConverter converter;
| 1 |
Team-Antimatter-Mod/AntiMatterMod | src/main/java/antimattermod/core/client/ClientAntiMatterModCoreProxy.java | [
"@SuppressWarnings(\"WeakerAccess\")\npublic class AntiMatterModRegistry {\n\t\n\t//CreativeTab ======================================================================================================\n\t//鉱石\n\tpublic static final CreativeTabs tabOreBlock = new CreativeTabs(\"amOreBlock\") {\n\t\t@Override\n\t\tpubl... | import antimattermod.core.AntiMatterModRegistry;
import antimattermod.core.Block.TileEntity.TileEntityClayCrucible;
import antimattermod.core.Block.TileEntity.TileEntitySatStove;
import antimattermod.core.Render.RenderMarker;
import antimattermod.core.Energy.Filler.TileMarker;
import antimattermod.core.Energy.Filler.re... | /*
*
*/
package antimattermod.core.client;
/** <h1>ClientAntiMatterModCoreProxy</h1>
* <br>
* @author Raiti
* @version 1.0.0
*
*/
@SuppressWarnings("unused")
public class ClientAntiMatterModCoreProxy extends AntiMatterModCoreProxy {
public static final KeyBinding wrenchSetting = new KeyBinding("WrenchSetti... | MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(AntiMatterModRegistry.clayCrucible), new ItemRenderClayCrucibles(clayCrucibleSpecialRender,new TileEntityClayCrucible())); | 3 |
calibre2opds/calibre2opds | OpdsOutput/src/main/java/com/gmail/dpierron/calibre/trook/TrookSpecificSearchDatabaseManager.java | [
"public class ConfigurationManager {\r\n\r\n public static final String PROFILES_SUFFIX = \".profile.xml\";\r\n private final static String PROFILE_FILENAME = \"profile.xml\";\r\n private final static String DEFAULT_PROFILE = \"default\";\r\n public static final String LOGGING_PREFIX = \"log4j2.\";\r\n public ... | import com.gmail.dpierron.calibre.configuration.ConfigurationManager;
import com.gmail.dpierron.calibre.configuration.DeviceMode;
import com.gmail.dpierron.calibre.datamodel.Author;
import com.gmail.dpierron.calibre.datamodel.Book;
import com.gmail.dpierron.calibre.datamodel.Series;
import com.gmail.dpierron.calib... | stat.executeUpdate("CREATE UNIQUE INDEX RESULTS_INDEX ON results(result_id ASC);");
stat.executeUpdate("CREATE INDEX KEYWORDS_RESULTS_RELATION_INDEX_ON_KEYWORD ON keywords_results_relation(keyword_id ASC);");
stat.executeUpdate("CREATE INDEX KEYWORDS_RESULTS_RELATION_INDEX_ON_RESULTS ON keywords_res... | if (ConfigurationManager.getCurrentProfile().getDeviceMode() == DeviceMode.Nook) {
| 0 |
yfiton/yfiton | yfiton-notifiers/yfiton-notifier-email/src/main/java/com/yfiton/notifiers/email/EmailNotifier.java | [
"public abstract class Notifier {\n\n protected static final Logger log = LoggerFactory.getLogger(Notifier.class);\n\n protected final Stopwatch stopwatch = Stopwatch.createUnstarted();\n\n private HierarchicalINIConfiguration configuration;\n\n public Notifier() {\n try {\n configurat... | import java.util.Optional;
import java.util.Properties;
import com.yfiton.api.Notifier;
import com.yfiton.api.annotation.Parameter;
import com.yfiton.api.exceptions.NotificationException;
import com.yfiton.api.exceptions.ValidationException;
import com.yfiton.api.parameter.Parameters;
import com.yfiton.api.parameter.va... | } else {
password = value;
}
}
}
}
return Check.succeeded();
}
@Override
protected void notify(Parameters parameters) throws NotificationException {
Properties props = new Properties();
... | public void validate(String parameterName, String parameterValue) throws ValidationException { | 2 |
NanYoMy/mybatis-generator | src/main/java/org/mybatis/generator/codegen/ibatis2/sqlmap/SqlMapGenerator.java | [
"public class XmlConstants {\n\n /**\n * Utility Class, no instances\n */\n private XmlConstants() {\n super();\n }\n\n public static final String IBATIS2_SQL_MAP_SYSTEM_ID = \"http://ibatis.apache.org/dtd/sql-map-2.dtd\"; //$NON-NLS-1$\n\n public static final String IBATIS2_SQL_MAP_PU... | import static org.mybatis.generator.internal.util.messages.Messages.getString;
import org.mybatis.generator.api.FullyQualifiedTable;
import org.mybatis.generator.api.dom.xml.Attribute;
import org.mybatis.generator.api.dom.xml.Document;
import org.mybatis.generator.api.dom.xml.XmlElement;
import org.mybatis.generator.co... | /*
* Copyright 2008 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | AbstractXmlElementGenerator elementGenerator = new UpdateByExampleSelectiveElementGenerator(); | 4 |
ralscha/wampspring | src/test/java/ch/rasc/wampspring/pubsub/PubSubReplyAnnotationTest.java | [
"@Configuration\npublic class DefaultWampConfiguration {\n\n\tprivate final List<WampConfigurer> configurers = new ArrayList<>();\n\n\tprivate ObjectMapper objectMapper = null;\n\n\tprotected ObjectMapper internalObjectMapper = null;\n\n\tprotected PathMatcher internalPathMatcher = null;\n\n\tprotected ConversionSe... | import static org.assertj.core.api.Assertions.assertThat;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeoutException;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.boot... |
}
}
@Test
public void testSubscribe4() throws InterruptedException, ExecutionException,
IOException, TimeoutException {
CompletableFutureWebSocketHandler result = new CompletableFutureWebSocketHandler(
3, this.jsonFactory);
try (WebSocketSession webSocketSession = startWebSocketSession(result)) {
... | UnsubscribeMessage unsubscribeMessage = new UnsubscribeMessage( | 4 |
narrowtux/Showcase | src/main/java/com/narrowtux/showcase/Showcase.java | [
"public class DropChestListener implements Listener {\n\t@EventHandler\n\tpublic void onDropChestSuck(DropChestSuckEvent event) {\n\t\tif (Showcase.instance.isShowcaseItem(event.getItem())) {\n\t\t\tevent.setCancelled(true);\n\t\t}\n\t}\n}",
"public class ShowcaseBlockListener implements Listener {\n\t@EventHandl... | import info.somethingodd.bukkit.OddItem.OddItem;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.Input... | /*
* 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... | registerProvider(new FiniteShowcase()); | 6 |
ThomasWrobel/Gwtish | core/src/com/lostagain/nl/GWTish/DeckPanel.java | [
"static public class Alignment {\t\t\n\tHorizontalAlignment horizontal = null;\n\tVerticalAlignment vert = null;\n\n\t/**\n\t * default middle center alignment\n\t */\n\tpublic Alignment() {\n\t\t\t\t\n\t\tthis.horizontal = HorizontalAlignment.Center;\n\t\tthis.vert = VerticalAlignment.Middle;\n\t\t\t\t\n\t}\t\t\... | import java.util.logging.Logger;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.math.Vector3;
import com.lostagain.nl.GWTish.ComplexPanel.Alignment;
import com.lostagain.nl.GWTish.ComplexPanel.HorizontalAlignment;
import com.lostagain.nl.GWTish.ComplexPanel.VerticalAlignment;... | package com.lostagain.nl.GWTish;
/**
* A deck panel is a stack of other panels ontop of eachother
* You can choose to either display one at a time (like GWTs) or multiple at once.
*
*
* @author Tom
*
*/
public class DeckPanel extends ComplexPanel {
final static String logstag = "GWTish.DeckPanel";
public... | Alignment align = contentAlignments.get(widget); | 0 |
gantonious/ViewCellAdapter | viewcelladapter/src/test/java/ca/antonious/viewcelladapter/decoratortests/HeaderSectionDecoratorTests.java | [
"public class TestViewCell extends GenericViewCell<TestViewCell.ViewHolder, String> {\n private int totalPerLine;\n\n public TestViewCell(String identifier) {\n this(identifier, 1);\n }\n\n public TestViewCell(String identifier, int totalPerLine) {\n super(identifier);\n this.totalP... | import org.junit.Test;
import ca.antonious.viewcelladapter.TestViewCell;
import ca.antonious.viewcelladapter.decorators.HeaderSectionDecorator;
import ca.antonious.viewcelladapter.sections.AbstractSection;
import ca.antonious.viewcelladapter.sections.Section;
import ca.antonious.viewcelladapter.viewcells.AbstractViewCe... | package ca.antonious.viewcelladapter.decoratortests;
/**
* Created by George on 2016-12-18.
*/
public class HeaderSectionDecoratorTests {
@Test
public void test_getZero_returnsHeader() {
AbstractSection section = new Section(); | AbstractViewCell headerViewCell = new TestViewCell("HEADER"); | 0 |
Kaysoro/KaellyBot | src/main/java/finders/TwitterFinder.java | [
"public enum Language {\n\n FR(\"Français\", \"FR\"), EN(\"English\", \"EN\"), ES(\"Español\", \"ES\");\n\n private String name;\n private String abrev;\n\n Language(String name, String abrev){\n this.name = name;\n this.abrev = abrev;\n }\n\n public String getName() {\n retur... | import enums.Language;
import listeners.TwitterListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import twitter4j.FilterQuery;
import util.ClientConfig;
import util.Connexion;
import util.Reporter;
import util.Translator;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Re... | package finders;
/**
* Created by steve on 12/01/2017.
*/
public class TwitterFinder{
private final static Logger LOG = LoggerFactory.getLogger(TwitterFinder.class);
private static boolean isReady = false;
private static Map<Long, TwitterFinder> twitterChannels;
private long guildId;
private lo... | if (ClientConfig.TWITTER() != null && !isReady) { | 2 |
hss01248/DialogUtil | dialog/src/main/java/com/hss01248/dialog/material/MaterialDialogHolder.java | [
"public final class R {\n public static final class anim {\n public static int abc_fade_in=0x7f040000;\n public static int abc_fade_out=0x7f040001;\n public static int abc_grow_fade_in_from_bottom=0x7f040002;\n public static int abc_popup_enter=0x7f040003;\n public static int a... | import android.content.Context;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.util.SparseBooleanArray;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android... | package com.hss01248.dialog.material;
/**
* Created by Administrator on 2017/11/19.
*/
public class MaterialDialogHolder extends SuperLvHolder<ConfigBean> {
private LinearLayout materialBackground;
private LinearLayout contentView;
private TextView title;
private ScrollView messageContentRoot;
... | if(bean.type == DefaultConfig.TYPE_MD_MULTI_CHOOSE){ | 6 |
indeedeng/iql | src/main/java/com/indeed/imhotep/iql/IQLQuery.java | [
"public class EZImhotepSession implements Closeable {\n private static final Logger log = Logger.getLogger(EZImhotepSession.class);\n public static int GROUP_LIMIT = 1000000; // 1 mil\n\n private final ImhotepSession session;\n private final Deque<StatReference> statStack = new ArrayDeque<StatReferen... | import au.com.bytecode.opencsv.CSVWriter;
import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.google.common.io.ByteStreams;
import com.google.common.util.concurrent.UncheckedTimeoutException;
import com.indeed.util.core.TreeTimer;
import c... | /*
* Copyright (C) 2014 Indeed Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in ... | Map<Integer, GroupKey> groupKeys = EZImhotepSession.newGroupKeys(); | 1 |
garretyoder/Cluttr | app/src/main/java/org/polaric/cluttr/adapters/MediaAdapter.java | [
"public class Util {\n\n public static final int PERMISSION_REQUEST_STORAGE = 43;\n public static final int PERMISSION_REQUEST_FINGERPRINT=35;\n public static final String FINGERPRINT_KEY=\"cluttr_fingerprint\";\n public static final String PASSWORD_KEY=\"cluttr_password\";\n public static final Stri... | import android.content.Context;
import android.graphics.BitmapFactory;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import org.polaric... | package org.polaric.cluttr.adapters;
public class MediaAdapter extends RealmRecyclerViewAdapter<MediaItem, MediaAdapter.ItemViewHolder> {
private Context context;
private final PublishSubject<MediaItem> onClickSubject = PublishSubject.create();
private final PublishSubject<MediaItem> onLongClickSubject... | private Album album; | 1 |
rsgoncalves/ecco | src/main/java/uk/ac/manchester/cs/diff/axiom/changeset/CategorisedChangeSet.java | [
"public class CategorisedChange extends LogicalChange {\n\n\t/**\n\t * @param axiom\tChanged axiom\n\t * @param isEffectual\ttrue if change is effectual, false otherwise\n\t */\n\tpublic CategorisedChange(OWLAxiom axiom, boolean isEffectual) {\n\t\tsuper(axiom, isEffectual);\n\t}\n}",
"public class CategorisedEff... | import uk.ac.manchester.cs.diff.axiom.change.CategorisedIneffectualAddition.IneffectualAdditionCategory;
import uk.ac.manchester.cs.diff.axiom.change.CategorisedIneffectualRemoval.IneffectualRemovalCategory;
import java.util.HashSet;
import java.util.Set;
import org.semanticweb.owlapi.model.OWLAxiom;
import uk.ac.manch... | return iaTime;
}
/**
* Get the ineffectual additions justification finding time
* @return Justification finding time (in seconds)
*/
public double getIneffectualAdditionJustificationFindingTime() {
return iaJustTime;
}
/**
* Get the ineffectual removals justification finding time
* @return Ju... | for(IneffectualRemovalCategory cat : c.getCategories()) { | 8 |
amrmagdy4/kite | kite-core/src/main/java/edu/umn/cs/kite/indexing/disk/DiskIndex.java | [
"public class KiteInstance {\n private static KiteLaunchTool kite;\n private static FileSystem hdfs;\n\n private static String hdfsRootDirectory = \"/\";\n private static String hdfsHost = \"hdfs://host:port\";\n private static String hdfsUsername = \"amr\";\n private static String hdfsGroupname =... | import edu.umn.cs.kite.common.KiteInstance;
import edu.umn.cs.kite.indexing.memory.MemoryIndexSegment;
import edu.umn.cs.kite.querying.Query;
import edu.umn.cs.kite.streaming.StreamDataset;
import edu.umn.cs.kite.util.ConstantsAndDefaults;
import edu.umn.cs.kite.util.KiteUtils;
import edu.umn.cs.kite.util.TemporalPerio... | package edu.umn.cs.kite.indexing.disk;
/**
* Created by amr_000 on 8/1/2016.
*/
public abstract class DiskIndex<K,V> {
protected String indexUniqueName;
protected StreamDataset stream;
protected List<DiskIndexSegment> indexSegments = new ArrayList<>();
protected List<TemporalPeriod> indexSegmentsT... | public abstract boolean addSegment(MemoryIndexSegment memorySegment, | 1 |
ThreeTen/threetenbp | src/test/java/org/threeten/bp/TestInstant.java | [
"public class DateTimeParseException extends DateTimeException {\n\n /**\n * Serialization version.\n */\n private static final long serialVersionUID = 4304633501674722597L;\n\n /**\n * The text that was being parsed.\n */\n private final String parsedString;\n /**\n * The error i... | import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import static org.threeten.bp.temporal.ChronoField.INSTANT_SECONDS;
import static org.threeten.bp.temporal.ChronoField.MICRO_OF_SECOND;
import static org.threeten.bp.temporal.ChronoField.MILLI_OF_SECOND;
import static org.threeten... | /*
* Copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the abov... | List<TemporalField> list = new ArrayList<TemporalField>(Arrays.<TemporalField>asList(ChronoField.values())); | 1 |
ordina-jworks/microservices-dashboard | microservices-dashboard-server-core/src/main/java/be/ordina/msdashboard/autoconfigure/MicroservicesDashboardServerAutoConfiguration.java | [
"@Configuration\npublic class ApplicationInstanceConfiguration {\n\n\t@Bean\n\tpublic ApplicationInstanceService applicationInstanceService(ApplicationInstanceRepository repository) {\n\t\treturn new ApplicationInstanceService(repository);\n\t}\n\n\t@Bean\n\tActuatorEndpointsDiscovererService actuatorEndpointsDisco... | import be.ordina.msdashboard.applicationinstance.ApplicationInstanceConfiguration;
import be.ordina.msdashboard.catalog.CatalogConfiguration;
import be.ordina.msdashboard.configuration.CommonConfiguration;
import be.ordina.msdashboard.discovery.DiscoveryConfiguration;
import be.ordina.msdashboard.eventstore.InMemoryEve... | /*
* Copyright 2015-2019 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 ap... | InMemoryEventStoreConfiguration.class, SecurityConfiguration.class}) | 4 |
Nanopublication/nanopub-java | src/main/java/org/nanopub/extra/server/FetchIndexFromDb.java | [
"public class MalformedNanopubException extends Exception {\n\n\tprivate static final long serialVersionUID = -1022546557206977739L;\n\n\tpublic MalformedNanopubException(String message) {\n\t\tsuper(message);\n\t}\n\n}",
"public interface Nanopub {\n\n\t// URIs in the nanopub namespace:\n\tpublic static final IR... | import java.io.OutputStream;
import org.eclipse.rdf4j.model.IRI;
import org.eclipse.rdf4j.rio.RDFFormat;
import org.eclipse.rdf4j.rio.RDFHandlerException;
import org.nanopub.MalformedNanopubException;
import org.nanopub.Nanopub;
import org.nanopub.NanopubUtils;
import org.nanopub.extra.index.IndexUtils;
import org.nano... | package org.nanopub.extra.server;
public class FetchIndexFromDb extends FetchIndex {
public static final int maxParallelRequestsPerServer = 5;
private String indexUri;
private NanopubDb db;
private OutputStream out;
private RDFFormat format;
private boolean writeIndex, writeContent;
private int nanopubCount... | if (!IndexUtils.isIndex(np)) { | 3 |
DavidGoldman/MinecraftScripting | scripting/gui/ServerMenu.java | [
"@Mod(modid=ScriptingMod.MOD_ID, name=ScriptingMod.NAME, version=ScriptingMod.VERSION, dependencies = \"after:guilib\")\npublic class ScriptingMod {\n\n\tpublic static final String MOD_ID = \"Scripting\";\n\tpublic static final String NAME = \"In-Game MCEdit Filters & Scripts\";\n\tpublic static final String VERSIO... | import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import scripting.ScriptingMod;
import scripting.core.ScriptCore.State;
import scripting.packet.ScriptPacket;
import scripting.packet.ScriptPacket.PacketType;
import scripting.packet.StatePacket;
import com.mcf.davidee.guilib.basic.FocusedContainer;
impor... | package scripting.gui;
/*
* Slightly modified copy of ClientMenu
*/
public class ServerMenu extends ScriptScreen {
public static final int REFRESH_TICKS = 100;
private final StatePacket pkt;
private Container mainC, labelC;
private Scrollbar scrollbar;
private Label title;
private Button close, toggle... | ScriptingMod.DISPATCHER.sendToServer(ScriptPacket.getRequestPacket(PacketType.STATE)); | 2 |
Wisebite/wisebite_android | app/src/main/java/dev/wisebite/wisebite/adapter/DetailAdapter.java | [
"public class ReviewListActivity extends AppCompatActivity {\n\n public static final String DISH_ID = \"DISH_ID\";\n\n private String id;\n private RestaurantService restaurantService;\n private DishService dishService;\n private MenuService menuService;\n private ReviewService reviewService;\n\n ... | import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import an... | package dev.wisebite.wisebite.adapter;
/**
* Created by albert on 20/03/17.
* @author albert
*/
public class DetailAdapter extends RecyclerView.Adapter<DetailAdapter.DetailHolder> {
private final ArrayList<Menu> menus;
private final ArrayList<Dish> dishes;
private final Context context;
private ... | this.restaurantService = ServiceFactory.getRestaurantService(context); | 4 |
edolganov/props4j | props-common/src/test/java/examples/Ex4_Multi_props.java | [
"public class FileUtil {\n\n\tprivate final static Logger log = getLog(FileUtil.class);\n\tprivate final static String SLASH = \"/\";\n\tprivate final static String INVERSE_SLASH = \"\\\\\";\n\tprivate final static char DOT = '.';\n\t\n\t\n\tpublic static boolean deleteFileOrDirRecursive(File file) {\n\t\tif(file.i... | import static base.props4j.util.FileUtil.*;
import static base.props4j.util.Util.*;
import static examples.ExOps.*;
import base.props4j.impl.FileProps;
import base.props4j.impl.MultiProps;
import java.io.File;
import java.io.IOException; | package examples;
/**
* Example 4: MultiProps for many props sources
*
* @author Evgeny Dolganov
*/
public class Ex4_Multi_props {
public static void main(String[] args) throws IOException {
//you have many files
File file1 = emptyFile("./test-out/test1.properties");
File file2 = emptyFile("./test-... | MultiProps props = new MultiProps(); | 4 |
SoyaLeaf/CalendarII | app/src/main/java/top/soyask/calendarii/ui/activity/ZoomActivity.java | [
"public class EventDao {\n public static final String EVENT = \"EVENT\";\n\n private DBUtils mDBUtils;\n private WeakReference<Context> mContext;\n private static EventDao mEventDao;\n\n private EventDao(DBUtils dBUtils, Context context) {\n this.mDBUtils = dBUtils;\n this.mContext = ne... | import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.SeekBar;
import android.widget.TextView;
imp... | package top.soyask.calendarii.ui.activity;
public class ZoomActivity extends AppCompatActivity
implements SeekBar.OnSeekBarChangeListener, View.OnClickListener {
| private List<Day> mDays = new ArrayList<>(); | 1 |
freenet/plugin-FlogHelper | src/main/java/plugins/floghelper/ui/ContentListToadlet.java | [
"public class DataFormatter {\n\n\t/**\n\t * RFC3339-compliant dates are used in Atom feeds.\n\t */\n\tpublic static final SimpleDateFormat RFC3339 = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'\", java.util.Locale.US);\n\t/**\n\t * Our date format used in the flog (is UTC).\n\t */\n\tpublic static final ... | import plugins.floghelper.data.pluginstore.PluginStoreFlog;
import plugins.floghelper.ui.flog.FlogFactory;
import plugins.floghelper.data.DataFormatter;
import freenet.client.HighLevelSimpleClient;
import freenet.clients.http.PageNode;
import freenet.clients.http.ToadletContext;
import freenet.clients.http.ToadletConte... | /* FlogHelper, Freenet plugin to create flogs
* Copyright (C) 2009 Romain "Artefact2" Dalmaso
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at yo... | final HTMLNode table = this.getPM().getInfobox(null, FlogHelper.getBaseL10n().getString("ContentListOf").replace("${FlogName}", | 1 |
kendzi/kendzi-math | kendzi-straight-skeleton/src/main/java/kendzi/math/geometry/skeleton/debug/display/DisplayFaceNode.java | [
"abstract public class DisplayObject {\n\n\tabstract public void draw(Graphics2D g2d, EquationDisplay disp, boolean selected);\n\n\tabstract public Object drawObject();\n\n\tabstract public DisplayRectBounds getBounds();\n\n}",
"public class DisplayRectBounds {\r\n double minX = Double.MAX_VALUE;\r\n double... | import java.awt.Color;
import java.awt.Graphics2D;
import javax.vecmath.Point2d;
import kendzi.math.geometry.debug.DisplayObject;
import kendzi.math.geometry.debug.DisplayRectBounds;
import kendzi.math.geometry.debug.DrawUtil;
import kendzi.math.geometry.skeleton.path.FaceNode;
import kendzi.math.geometry.skelet... | package kendzi.math.geometry.skeleton.debug.display;
/**
*
* @author Tomasz Kędziora (kendzi)
*/
public class DisplayFaceNode extends DisplayObject {
private FaceQueue lav;
private Color color;
/**
* @param LAV
* @param pColor
*/
public DisplayFaceNode(FaceQu... | DrawUtil.drawLine(p1, p2, selected, g2d, disp);
| 2 |
Davion8948/AndroidVideoPlayer | src/com/timeslily/FileListActivity.java | [
"public class VideoUtil {\n public static final String[] EXTENSIONS = { \".mp4\", \".flv\", \".avi\", \".wmv\", \".m4v\", \".rmvb\", \".mkv\", \".mg2\", \".mov\", \"m2v\" };\n /** 保存最后播放视频列表 */\n public static final String LAST_PLAY_VIDEO_INFO = \"lastPlayInfo\";\n /** sp中保存的属性信息 */\n public static f... | import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import android.app.Activity;
import android.app.ListActivity;
import android.content.ContentValues;
import andr... | package com.timeslily;
/**
* @author zxc
*/
public class FileListActivity extends ListActivity implements OnClickListener {
private ListView listView;
private List<FileItem> fileList = new ArrayList<FileItem>();
private FileAdapter adapter;
/** 返回按钮 */
private TextView backBtn;
/** 取消按钮 */... | cv.put(FolderListColumns.FOLDER_NAME, currentFile.getName()); | 5 |
avram/zandy | src/main/java/com/gimranov/zandy/app/task/APIRequest.java | [
"public class ServerCredentials {\n /**\n * Application key -- available from Zotero\n */\n static final String CONSUMERKEY = \"93a5aac13612aed2a236\";\n static final String CONSUMERSECRET = \"196d86bd1298cb78511c\";\n\n /**\n * This is the zotero:// protocol we intercept\n * It probably... | import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteException;
import android.database.sqlite.SQLiteStatement;
import android.os.Handler;
import android.util.Log;
import com.gimranov.zandy.app.ServerCredentials;
import com.gimranov.zandy.app.XMLResponseParser;
import com... | "created, last_attempt, status, body)" +
" values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?)");
// Why, oh why does bind* use 1-based indexing? And cur.get* uses 0-based!
insert.bindString(1, uuid);
insert.bindLong(2, (long) type);
Str... | public void setBody(Item item) { | 4 |
JosuaKrause/NBTEditor | src/nbt/gui/brush/DesertBrush.java | [
"public class MapViewer extends JComponent implements UpdateReceiver {\n\n private static final long serialVersionUID = 553314683721005657L;\n\n private final MapFrame frame;\n\n private final ChunkPainter painter;\n\n private final ChunkManager manager;\n\n private int offX;\n\n private int offZ;\n\n privat... | import javax.swing.JFrame;
import javax.swing.JOptionPane;
import nbt.gui.MapViewer;
import nbt.map.Biomes;
import nbt.map.Blocks;
import nbt.map.Chunk;
import nbt.map.pos.InChunkPosition;
import nbt.map.pos.Position3D; | package nbt.gui.brush;
/**
* Converts a part of a map into a dessert. That is every stone/dirt block over
* a given height will be replaced by sand and the biome will be changed.
*
* @author Joschi <josua.krause@googlemail.com>
*/
public class DesertBrush extends Brush {
private final boolean sandstone;
... | public DesertBrush(final MapViewer viewer, final int radius, | 0 |
joachimhs/Embriak | backend/src/main/java/no/haagensoftware/netty/server/Main.java | [
"public class NettyWebserverPipelineFactory implements ChannelPipelineFactory {\n\tprivate static Logger logger = Logger.getLogger(NettyWebserverPipelineFactory.class.getName());\n\tprivate List<NettyWebserverRouterPlugin> routerPlugins;\n\tprivate RouterHandler routerhandler = null;\n\t\n\tpublic NettyWebserverPip... | import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.Executors;
import no.haagensoftware.netty.webserver.pipeline.Netty... | package no.haagensoftware.netty.server;
public class Main {
private static Logger logger = Logger.getLogger(Main.class.getName());
public static void main(String[] args) throws Exception{
//new Main().run();
configureLog4J();
configure();
Main main = new Main();
main.run();
}
private static voi... | if (System.getProperty(PropertyConstants.NETTY_PORT) == null) { | 5 |
maksim-m/Popular-Movies-App | app/src/main/java/me/maxdev/popularmoviesapp/ui/detail/MovieDetailFragment.java | [
"public class PopularMoviesApp extends Application {\n\n private NetworkComponent networkComponent;\n\n @Override\n public void onCreate() {\n super.onCreate();\n networkComponent = DaggerNetworkComponent.builder()\n .appModule(new AppModule(this))\n .networkModu... | import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.CardView;
import android.s... | package me.maxdev.popularmoviesapp.ui.detail;
public class MovieDetailFragment extends RxFragment {
private static final String POSTER_IMAGE_BASE_URL = "https://image.tmdb.org/t/p/";
private static final String POSTER_IMAGE_SIZE = "w780";
private static final String ARG_MOVIE = "ArgMovie";
priva... | ((PopularMoviesApp) getActivity().getApplication()).getNetworkComponent().inject(this); | 0 |
msteiger/jxmapviewer2 | examples/src/sample5_tilesets/Sample5.java | [
"public class JXMapViewer extends JPanel implements DesignMode\r\n{\r\n private static final long serialVersionUID = -3530746298586937321L;\r\n\r\n /**\r\n * The zoom level. Generally a value between 1 and 15 (TODO Is this true for all the mapping worlds? What does this\r\n * mean if some mapping syst... | import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.swing.JComboBox;
import ... |
package sample5_tilesets;
/**
* This example demonstrate the use of different {@link TileFactory} elements.
* @author Martin Steiger
*/
public class Sample5
{
/**
* @param args the program args (ignored)
*/
public static void main(String[] args)
{
final List<TileFa... | TileFactoryInfo osmInfo = new OSMTileFactoryInfo();
| 1 |
laithnurie/rhythm | mobile/src/main/java/com/laithlab/rhythm/converter/DTOConverter.java | [
"@RealmClass\npublic class Album extends RealmObject {\n\n private String id;\n private String artistId;\n private String albumTitle;\n private RealmList<Song> songs;\n private String coverPath;\n\n public void setId(String id) {\n this.id = id;\n }\n\n public String getId() {\n ... | import com.laithlab.rhythm.db.Album;
import com.laithlab.rhythm.db.Artist;
import com.laithlab.rhythm.db.Song;
import com.laithlab.rhythm.dto.AlbumDTO;
import com.laithlab.rhythm.dto.ArtistDTO;
import com.laithlab.rhythm.dto.SongDTO;
import java.util.ArrayList;
import java.util.List; | package com.laithlab.rhythm.converter;
public class DTOConverter {
public static List<ArtistDTO> getArtistList(List<Artist> artists) {
List<ArtistDTO> artistDTOs = new ArrayList<>();
for (Artist artist : artists) {
artistDTOs.add(getArtistDTO(artist));
}
return artis... | public static List<SongDTO> getSongList(List<Song> songs) { | 2 |
dmfs/uri-toolkit | rfc3986-uri/src/main/java/org/dmfs/rfc3986/uris/StructuredUri.java | [
"public interface Authority\n{\n /**\n * Returns the {@link Optional} user info part of the authority in encoded form.\n *\n * @return The {@link UriEncoded} user info.\n */\n Optional<? extends UriEncoded> userInfo();\n\n /**\n * Returns the host of this authority.\n *\n * @ret... | import org.dmfs.optional.Absent;
import org.dmfs.optional.Optional;
import org.dmfs.optional.Present;
import org.dmfs.rfc3986.Authority;
import org.dmfs.rfc3986.Fragment;
import org.dmfs.rfc3986.Path;
import org.dmfs.rfc3986.Query;
import org.dmfs.rfc3986.Scheme;
import org.dmfs.rfc3986.Uri;
import org.dmfs.rfc3986.pat... | /*
* Copyright 2017 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... | private final Optional<Fragment> mFragment; | 1 |
Thomas-Bergmann/Tournament | de.hatoka.mail/src/test/java/de/hatoka/mail/internal/dao/MailDaoJpaTest.java | [
"public class CommonDaoModule implements Module\n{\n private long start;\n\n public CommonDaoModule()\n {\n this(0);\n }\n\n public CommonDaoModule(long sequenceStartPosition)\n {\n start = sequenceStartPosition;\n }\n\n @Override\n public void configure(Binder binder)\n ... | import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
import javax.inject.Inject;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import com.google.inject.Guice;
import com.google.inject.Injector;
import de.hatoka.common.capi.modules.CommonDaoModule;
import... | package de.hatoka.mail.internal.dao;
public class MailDaoJpaTest
{
@Rule
public DerbyEntityManagerRule rule = new DerbyEntityManagerRule("MailTestPU");
@Inject
private MailDao mailDao;
@Before
public void createTestObject()
{ | Injector injector = Guice.createInjector(new CommonDaoModule(), new MailDaoJpaModule(), rule.getModule()); | 0 |
seanho/agile-stock | src/hk/reality/stock/service/searcher/StockSearchTask.java | [
"public class PortfolioActivity extends BaseStockActivity {\n private static final String TAG = \"PortfolioActivity\";\n\n public static final int DIALOG_ADD_STOCK = 100;\n public static final int DIALOG_ADD_IN_PROGRESS = 101;\n public static final int DIALOG_DISCLAIMER = 103;\n \n public static f... | import hk.reality.stock.PortfolioActivity;
import hk.reality.stock.R;
import hk.reality.stock.StockApplication;
import hk.reality.stock.model.Portfolio;
import hk.reality.stock.model.Stock;
import hk.reality.stock.service.Lang;
import hk.reality.stock.service.exception.DownloadException;
import hk.reality.stock.service... | package hk.reality.stock.service.searcher;
public class StockSearchTask extends AsyncTask<String, Void, Stock> {
private static final String TAG = "StockSearchTask";
private Error error;
private PortfolioActivity activity;
enum Error {
ERROR_NO_NET, ERROR_DOWNLOAD, ERROR_PARSE, ERROR_UNKNOW... | Portfolio portfolio = StockApplication.getCurrentPortfolio(); | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.