blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7217e72d2ef3b7d465b2a5c4f98eeffd7f710de9 | f9b7dcbd841a0b3dd0fcd2f0941d498346f88599 | /chrome/android/java/src/org/chromium/chrome/browser/toolbar/bottom/BottomTabSwitcherActionMenuCoordinator.java | 6237402edf587ff08f1d7c8c10ca8fefa363455b | [
"BSD-3-Clause"
] | permissive | browser-auto/chromium | 58bace4173da259625cb3c4725f9d7ec6a4d2e03 | 36d524c252b60b059deaf7849fb6b082bee3018d | refs/heads/master | 2022-11-16T12:38:05.031058 | 2019-11-18T12:28:56 | 2019-11-18T12:28:56 | 222,449,220 | 1 | 0 | BSD-3-Clause | 2019-11-18T12:55:08 | 2019-11-18T12:55:07 | null | UTF-8 | Java | false | false | 2,280 | java | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.toolbar.bottom;
import android.content.Context;
import android.content.res.Resources;
import android.view.View;
import android.view.View.OnLongClickListener;
import org.chromium.base.Callback;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.toolbar.top.tab_switcher_action_menu.TabSwitcherActionMenuCoordinator;
import org.chromium.ui.modelutil.MVCListAdapter.ModelList;
import org.chromium.ui.widget.RectProvider;
import org.chromium.ui.widget.ViewRectProvider;
/**
* The main coordinator for the Tab Switcher Action Menu on the bottom toolbar,
* responsible for creating the popup menu and building a list of menu items.
*/
public class BottomTabSwitcherActionMenuCoordinator extends TabSwitcherActionMenuCoordinator {
public static OnLongClickListener createOnLongClickListener(Callback<Integer> onItemClicked) {
return createOnLongClickListener(
new BottomTabSwitcherActionMenuCoordinator(), onItemClicked);
}
@Override
public ModelList buildMenuItems(Context context) {
ModelList itemList = new ModelList();
itemList.add(buildListItemByMenuItemType(context, MenuItemType.NEW_TAB));
itemList.add(buildListItemByMenuItemType(context, MenuItemType.NEW_INCOGNITO_TAB));
itemList.add(buildListItemByMenuItemType(context, MenuItemType.DIVIDER));
itemList.add(buildListItemByMenuItemType(context, MenuItemType.CLOSE_TAB));
return itemList;
}
@Override
protected RectProvider getRectProvider(View anchorView) {
ViewRectProvider rectProvider = new ViewRectProvider(anchorView);
rectProvider.setIncludePadding(true);
// space between the icon and the border of the wrapper
Resources resources = anchorView.getResources();
int paddingLeft =
resources.getDimensionPixelOffset(R.dimen.bottom_toolbar_button_wrapper_width)
- resources.getDimensionPixelOffset(R.dimen.split_toolbar_button_width);
rectProvider.setInsetPx(paddingLeft, 0, 0, 0);
return rectProvider;
}
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
a1523b4c883f6dba9e2219cff1186a4e14a2eb60 | b54e5c5df862755a19a9d76aa98ccf11aa0b70c7 | /core/src/main/java/ro/fortsoft/wicket/dashboard/DashboardUtils.java | 163e07c9d6e2aac3a3e870fabb7b5bb06b377c31 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | pugang/wicket-dashboard | b2d8093eb78cd31942f62cee2c8d79898bc620bc | 45260e6a7dbc512bbd5ddd2b6d42496d88062047 | refs/heads/master | 2021-01-09T20:54:53.281113 | 2013-02-13T20:37:52 | 2013-02-13T20:37:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,222 | java | /*
* Copyright 2012 Decebal Suiu
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package ro.fortsoft.wicket.dashboard;
import java.util.List;
import java.util.Map;
/**
* @author Decebal Suiu
*/
public class DashboardUtils {
public static void updateWidgetLocations(Dashboard dashboard, Map<String, WidgetLocation> widgetLocations) {
List<Widget> widgets = dashboard.getWidgets();
for (Widget widget : widgets) {
String id = widget.getId();
WidgetLocation location = widgetLocations.get(id);
if (!location.equals(widget.getLocation())) {
widget.setLocation(location);
}
}
}
}
| [
"decebal.suiu@gmail.com"
] | decebal.suiu@gmail.com |
a66d0eeaa4ddb47cab2801d4aeab49fc897a9b96 | fc6c869ee0228497e41bf357e2803713cdaed63e | /weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/appbrand/appcache/o.java | 5b39d1f6a78f417e4669dcfc4a6184811c5d1832 | [] | no_license | hyb1234hi/reverse-wechat | cbd26658a667b0c498d2a26a403f93dbeb270b72 | 75d3fd35a2c8a0469dbb057cd16bca3b26c7e736 | refs/heads/master | 2020-09-26T10:12:47.484174 | 2017-11-16T06:54:20 | 2017-11-16T06:54:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,588 | java | package com.tencent.mm.plugin.appbrand.appcache;
import android.content.Context;
import android.content.res.AssetManager;
import com.tencent.gmtrace.GMTrace;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.w;
import java.io.InputStream;
public final class o
{
private static Boolean hJj;
static
{
GMTrace.i(10611522011136L, 79062);
hJj = null;
GMTrace.o(10611522011136L, 79062);
}
public static boolean SF()
{
GMTrace.i(20782273003520L, 154840);
if (hJj == null)
{
ab.bPV();
hJj = Boolean.valueOf(false);
}
boolean bool = hJj.booleanValue();
GMTrace.o(20782273003520L, 154840);
return bool;
}
public static WxaPkgWrappingInfo SG()
{
GMTrace.i(10611387793408L, 79061);
WxaPkgWrappingInfo localWxaPkgWrappingInfo = new WxaPkgWrappingInfo();
localWxaPkgWrappingInfo.hKC = 75;
localWxaPkgWrappingInfo.hKE = true;
GMTrace.o(10611387793408L, 79061);
return localWxaPkgWrappingInfo;
}
private static InputStream oo(String paramString)
{
GMTrace.i(15544023515136L, 115812);
Object localObject = ab.getContext().getAssets();
try
{
localObject = ((AssetManager)localObject).open(paramString);
GMTrace.o(15544023515136L, 115812);
return (InputStream)localObject;
}
catch (Exception localException)
{
w.v("MicroMsg.AppBrand.WxaLocalLibPkg", "openRead file( %s ) failed, exp = %s", new Object[] { paramString, localException });
GMTrace.o(15544023515136L, 115812);
}
return null;
}
public static InputStream openRead(String paramString)
{
GMTrace.i(17289256632320L, 128815);
paramString = a.ok(paramString);
if (SF())
{
InputStream localInputStream = oo("wxa_library/local" + paramString);
if (localInputStream != null)
{
GMTrace.o(17289256632320L, 128815);
return localInputStream;
}
localInputStream = oo("wxa_library/develop" + paramString);
if (localInputStream != null)
{
GMTrace.o(17289256632320L, 128815);
return localInputStream;
}
}
paramString = oo("wxa_library" + paramString);
if (paramString != null)
{
GMTrace.o(17289256632320L, 128815);
return paramString;
}
GMTrace.o(17289256632320L, 128815);
return null;
}
}
/* Location: D:\tools\apktool\weixin6519android1140\jar\classes2-dex2jar.jar!\com\tencent\mm\plugin\appbrand\appcache\o.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"robert0825@gmail.com"
] | robert0825@gmail.com |
cdca47ecfd90ee69bf5dd56bdbd2015b954946ac | c278b2e06e98b0b99ca7350cfc12d2e535db1841 | /recon/recon-core/src/main/java/com/yl/recon/core/Constant.java | f43cae0e15c4fc526e6d37f6f7fd49f62c9bd9f4 | [] | no_license | SplendorAnLin/paymentSystem | ea778c03179a36755c52498fd3f5f1a5bbeb5d34 | db308a354a23bd3a48ff88c16b29a43c4e483e7d | refs/heads/master | 2023-02-26T14:16:27.283799 | 2022-10-20T07:50:35 | 2022-10-20T07:50:35 | 191,535,643 | 5 | 6 | null | 2023-02-22T06:42:24 | 2019-06-12T09:01:15 | Java | UTF-8 | Java | false | false | 1,170 | java | package com.yl.recon.core;
/**
* 常量
*
* @author AnLin
* @since 2017/6/21
*/
public class Constant {
/**
* 系统编码
*/
public static final String SYSTEM_CODE = "RECON-CORE";
/**
* 是否有效:无效
*/
public static final Integer IS_VALID_0 = 0;
/**
* 是否有效:有效
*/
public static final Integer IS_VALID_1 = 1;
/**
* 批量插入最大条数
*/
public static final int BATCH_INSERT_MAX = 1000;
/**
* 对账类型
*/
public static final String RECON_TYPE = "RECON_TYPE";
/**
* 对账日期
*/
public static final String RECON_DATE = "RECON_DATE";
/**
* 账户系统编码
*/
public static final String ACC_SYSTEM_CODE = "ACC_SYSTEM_CODE";
/**
* 订单类:表名
*/
public static final String ORDER_TABLE_NAME = "ORDER_TABLE_NAME";
/**
* A单边
*/
public static final String A = "A";
/**
* B单边
*/
public static final String B = "B";
/**
* 手续费
*/
public static final String FEE = "FEE";
/**
* 是否是手续费
*/
public static final String IS_FEE_TRUE = "TRUE";
/**
* 是否是手续费
*/
public static final String IS_FEE_FALSE = "FALSE";
}
| [
"zl88888@live.com"
] | zl88888@live.com |
7f84fcd24d33b958a53754cdde3aa1d09e39ff72 | 40df4983d86a3f691fc3f5ec6a8a54e813f7fe72 | /app/src/main/java/com/baidu/mobads/p030d/C0276a.java | 282322c332dae82519146e5b725cfafb86550f2b | [] | no_license | hlwhsunshine/RootGeniusTrunAK | 5c63599a939b24a94c6f083a0ee69694fac5a0da | 1f94603a9165e8b02e4bc9651c3528b66c19be68 | refs/heads/master | 2020-04-11T12:25:21.389753 | 2018-12-24T10:09:15 | 2018-12-24T10:09:15 | 161,779,612 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 620 | java | package com.baidu.mobads.p030d;
import android.content.Context;
import android.graphics.Bitmap;
import com.baidu.mobads.interfaces.download.IXAdStaticImgDownloader;
import com.baidu.mobads.openad.p029c.C0275f;
import java.net.URL;
/* renamed from: com.baidu.mobads.d.a */
public class C0276a extends C0275f implements IXAdStaticImgDownloader {
public C0276a(Context context, URL url, String str, String str2) {
super(context, url, str, str2, true);
}
/* renamed from: a */
protected void mo4445a() {
super.mo4445a();
}
public Bitmap getBitmap() {
return null;
}
}
| [
"603820467@qq.com"
] | 603820467@qq.com |
f5de9e2eea6e4863d7637d70547e1fe1199b674d | efca855f83be608cc5fcd5f9976b820f09f11243 | /enterd/src/main/java/org/enterchain/enter/Enter.java | 28d4bce6ab38c98defa4b5242449eb2863a38a64 | [
"Apache-2.0"
] | permissive | enterpact/enterchain | 5438e127c851597cbd7e274526c3328155483e58 | d8b272fa6885e5d263066da01fff3be74a6357a0 | refs/heads/master | 2023-05-28T12:48:02.535365 | 2021-06-09T20:44:01 | 2021-06-09T20:44:01 | 375,483,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,169 | java | /*
* Copyright ConsenSys AG.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/
package org.enterchain.enter;
import static org.apache.logging.log4j.LogManager.getLogger;
import org.enterchain.enter.chainexport.RlpBlockExporter;
import org.enterchain.enter.chainimport.JsonBlockImporter;
import org.enterchain.enter.chainimport.RlpBlockImporter;
import org.enterchain.enter.cli.BesuCommand;
import org.enterchain.enter.cli.logging.BesuLoggingConfigurationFactory;
import org.enterchain.enter.controller.BesuController;
import org.enterchain.enter.services.BesuPluginContextImpl;
import io.netty.util.internal.logging.InternalLoggerFactory;
import io.netty.util.internal.logging.Log4J2LoggerFactory;
import org.apache.logging.log4j.Logger;
import picocli.CommandLine.RunLast;
public final class Enter {
private static final int SUCCESS_EXIT_CODE = 0;
private static final int ERROR_EXIT_CODE = 1;
public static void main(final String... args) {
final Logger logger = setupLogging();
final BesuCommand besuCommand =
new BesuCommand(
logger,
RlpBlockImporter::new,
JsonBlockImporter::new,
RlpBlockExporter::new,
new RunnerBuilder(),
new BesuController.Builder(),
new BesuPluginContextImpl(),
System.getenv());
besuCommand.parse(
new RunLast().andExit(SUCCESS_EXIT_CODE),
besuCommand.exceptionHandler().andExit(ERROR_EXIT_CODE),
System.in,
args);
}
private static Logger setupLogging() {
InternalLoggerFactory.setDefaultFactory(Log4J2LoggerFactory.INSTANCE);
try {
System.setProperty(
"vertx.logger-delegate-factory-class-name",
"io.vertx.core.logging.Log4j2LogDelegateFactory");
System.setProperty(
"log4j.configurationFactory", BesuLoggingConfigurationFactory.class.getName());
System.setProperty("log4j.skipJansi", String.valueOf(false));
} catch (SecurityException e) {
System.out.println(
"Could not set logging system property as the security manager prevented it:"
+ e.getMessage());
}
final Logger logger = getLogger();
Thread.setDefaultUncaughtExceptionHandler(log4jExceptionHandler(logger));
Thread.currentThread().setUncaughtExceptionHandler(log4jExceptionHandler(logger));
return logger;
}
private static Thread.UncaughtExceptionHandler log4jExceptionHandler(final Logger logger) {
return (thread, error) ->
logger.error(
() -> String.format("Uncaught exception in thread \"%s\"", thread.getName()), error);
}
}
| [
"webframes@gmail.com"
] | webframes@gmail.com |
c1bf96e249ebf5d373eed71aa0d1eec7a0a874bd | 9254e7279570ac8ef687c416a79bb472146e9b35 | /paiflow-20210202/src/main/java/com/aliyun/paiflow20210202/models/GetPipelineResponse.java | 15b28b9f5f625453bda9bae15b2399788e677719 | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,029 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.paiflow20210202.models;
import com.aliyun.tea.*;
public class GetPipelineResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("body")
@Validation(required = true)
public GetPipelineResponseBody body;
public static GetPipelineResponse build(java.util.Map<String, ?> map) throws Exception {
GetPipelineResponse self = new GetPipelineResponse();
return TeaModel.build(map, self);
}
public GetPipelineResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public GetPipelineResponse setBody(GetPipelineResponseBody body) {
this.body = body;
return this;
}
public GetPipelineResponseBody getBody() {
return this.body;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
8221622318de8201d9faed44537a0bf6a21216c7 | c37c3fa6b28887a979264fd28be33241c6ba9920 | /edu.eafit.maestria.activa.tva/src/edu/eafit/maestria/activa/metadata/ExtendedSegmentInformationType.java | 5ba806965a0aa427e6dbeb2a9b149a4b12416b63 | [] | no_license | wvelezva/tesisgitrepository | 6d2e4410d7422015efde9dc40a0aaa3308830605 | 1296d4c2cabd5497cf83645e112f416fdd27c6db | refs/heads/master | 2021-01-01T16:20:24.999410 | 2012-07-12T23:45:53 | 2012-07-12T23:45:53 | 2,657,973 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,452 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.05.26 at 11:01:21 AM COT
//
package edu.eafit.maestria.activa.metadata;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import tva.metadata._2011.SegmentInformationType;
/**
* <p>Java class for ExtendedSegmentInformationType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ExtendedSegmentInformationType">
* <complexContent>
* <extension base="{urn:tva:metadata:2011}SegmentInformationType">
* <sequence>
* <element name="EntityRegion" type="{http://maestria.eafit.edu/activa/metadata}EntityRegionType" maxOccurs="unbounded"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ExtendedSegmentInformationType", propOrder = {
"entityRegion"
})
public class ExtendedSegmentInformationType
extends SegmentInformationType
{
@XmlElement(name = "EntityRegion", required = true)
protected List<EntityRegionType> entityRegion;
/**
* Gets the value of the entityRegion property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the entityRegion property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getEntityRegion().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link EntityRegionType }
*
*
*/
public List<EntityRegionType> getEntityRegion() {
if (entityRegion == null) {
entityRegion = new ArrayList<EntityRegionType>();
}
return this.entityRegion;
}
}
| [
"wvelezva@gmail.com"
] | wvelezva@gmail.com |
2aabe6409184f81744173907855838186f6e8d3f | 9a6ea6087367965359d644665b8d244982d1b8b6 | /src/main/java/X/C47782Jn.java | c64f1661ced455c29ea9b5b9e889fb7da0d88ab7 | [] | no_license | technocode/com.wa_2.21.2 | a3dd842758ff54f207f1640531374d3da132b1d2 | 3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9 | refs/heads/master | 2023-02-12T11:20:28.666116 | 2021-01-14T10:22:21 | 2021-01-14T10:22:21 | 329,578,591 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 776 | java | package X;
import java.util.regex.Matcher;
/* renamed from: X.2Jn reason: invalid class name and case insensitive filesystem */
public class C47782Jn {
public final String A00;
public final String A01;
public final String A02;
public final boolean A03;
public C47782Jn(String str, boolean z) {
Matcher matcher = AnonymousClass0R0.A0B.matcher(str);
matcher.find();
this.A00 = matcher.group();
boolean z2 = false;
if (z) {
int indexOf = str.indexOf(164);
this.A01 = str.substring(0, indexOf);
this.A02 = str.substring(indexOf + 1);
this.A03 = matcher.start() > indexOf ? true : z2;
return;
}
this.A02 = "";
this.A01 = "";
}
}
| [
"madeinborneo@gmail.com"
] | madeinborneo@gmail.com |
ffc2feec45c0e0d36b3cf7fe9d3dc8815c601449 | ef589b3133a38e3ccf47087a3976f8ff83c47e90 | /FaultyVersions/AOIS_35/BillCalculation.java | 8a927bf5be3d0510d6038341f9cc2dbb9f71307f | [] | no_license | liubaoli-and/ChinaUnionBillService | 59f9ff171ed9004c7ab4f7b021dcd6c2d3151e82 | 2e329b3fda45be93f036dfcda7c477cdba68b293 | refs/heads/main | 2023-07-22T10:54:10.698669 | 2021-09-09T11:56:25 | 2021-09-09T11:56:25 | 306,785,290 | 4 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,855 | java | // This is mutant program.
// Author : ysma
package ustb.edu.cn.bill.AOIS_35;
import java.io.IOException;
public class BillCalculation
{
private java.lang.String planType = "";
private int planFee = 0;
private int talkTime = 0;
private int flow = 0;
private int callViewTime = 0;
private double talkTimePer = 0;
private double flowPer = 0.3;
private double viewPer = 0.6;
private int talkTimeBench = 0;
private int flowBench = 0;
private double bill = 0;
public double phoneBillCalculation( java.lang.String planType, int planFee, int talkTime, int flow, int callViewTime )
{
if (planType == "A" || planType == "a") {
switch (planFee) {
case 46 :
talkTimeBench = 50;
flowBench = 150;
talkTimePer = 0.25;
break;
case 96 :
talkTimeBench = 96;
flowBench = 240;
talkTimePer = 0.15;
break;
case 286 :
talkTimeBench = 286;
flowBench = 900;
talkTimePer = 0.15;
break;
case 886 :
talkTimeBench = 3000;
flowBench = 3000;
talkTimePer = 0.15;
break;
default :
new java.io.IOException( "Invalid planFee!" );
}
} else {
if (planType == "B" || planType == "b") {
switch (planFee) {
case 46 :
talkTimeBench = 120;
flowBench = 40;
talkTimePer = 0.25;
break;
case 96 :
talkTimeBench = 450;
flowBench = 80;
talkTimePer = 0.15;
break;
case 126 :
talkTimeBench = 680;
flowBench = 100;
talkTimePer = 0.15;
break;
case 186 :
talkTimeBench = 1180;
flowBench = 150;
talkTimePer = 0.15;
break;
default :
new java.io.IOException( "Invalid planFee" );
}
} else {
new java.io.IOException( "Invalid planType!" );
}
}
if (talkTime < talkTimeBench) {
talkTime = talkTimeBench;
}
if (flow < flowBench) {
flow = flowBench;
}
bill = (talkTime - talkTimeBench++) * talkTimePer + (flow - flowBench) * flowPer + planFee;
return bill;
}
}
| [
"57534835+liubaoli-and@users.noreply.github.com"
] | 57534835+liubaoli-and@users.noreply.github.com |
3d77cff510dc3ed421e343b7675c1ae7186aecf3 | 91a6725ec1915ed6e745488e61abc3228686d39a | /object7/src/l1합성/Plan.java | 15cf131464e3bf1407ed8d9d486c8a288118e362 | [] | no_license | bbbnam/object-book | 5cead25a5ef7187744a148332abdeecea096cc4c | a5be03c5087f5b4ef456e048f0700129ee19cd64 | refs/heads/master | 2022-03-28T16:42:14.784970 | 2020-01-04T10:20:00 | 2020-01-04T10:20:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 425 | java | package l1합성;
import java.util.HashSet;
import java.util.Set;
public class Plan {
private Calculator calc;
private Set<Call> calls = new HashSet<>();
public final void addCall(Call call) {
calls.add(call);
}
public final Money calculateFee() {
Money result = Money.ZERO;
for (Call call : calls) result = result.plus(calc.calcCallFee(call));
return result;
}
}
| [
"joenggyu0@gmail.com"
] | joenggyu0@gmail.com |
01bb544ab5275108814ab996801ab75c441a1d51 | 99b367cf4e0482833533fde335bc2246a44d7be1 | /src/com/thinkingInJava/chapter05/initialization/AutoboxingVarargs.java | a12659510a832dfd49c5068d2ebd76a3ac2d9c56 | [] | no_license | zhangrongzhao/ThinkingInJava | c2f93bc4a4b38bd3a9276adf5f8b7fe41374a536 | ceb345ae6ec477886212da8bebb043210333569d | refs/heads/master | 2020-03-14T23:01:42.035528 | 2018-12-20T03:50:18 | 2018-12-20T03:50:18 | 131,834,762 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 396 | java | package com.thinkingInJava.chapter05.initialization;
public class AutoboxingVarargs {
public static void f(Integer... args){
for(Integer i:args){
System.out.println(i+" ");
}
System.out.println();
}
public static void main(String[] args){
f(new Integer(1),new Integer(2));
f(4,5,6,7,8,9);
f(10,new Integer(11),12);
}
}
| [
"rongzhao.zhang@allcure.cn"
] | rongzhao.zhang@allcure.cn |
27d46235ffa0dfad7187f98f355f9ce471cc7a75 | d0c77686746a667d830c8d2b5d777f133f3b83f5 | /JavaAdvance/rpc/rpc01/rpcfx-core/src/main/java/io/kimmking/rpcfx/server/RpcfxInvoker.java | a6f77dac1fef37c2af36060648d9c394fb8fe2c2 | [
"MIT"
] | permissive | xiang12835/JavaLearning | ba8a473bb20ba8462b676b954c7fcc790e3c1bce | c86c2014b512c1ddaeb51e82dcb49367ed86235b | refs/heads/master | 2023-03-15T20:15:35.191227 | 2022-04-23T13:36:40 | 2022-04-23T13:36:40 | 195,542,607 | 0 | 0 | MIT | 2023-03-08T17:35:10 | 2019-07-06T13:29:25 | Java | UTF-8 | Java | false | false | 1,815 | java | package io.kimmking.rpcfx.server;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import io.kimmking.rpcfx.api.RpcfxRequest;
import io.kimmking.rpcfx.api.RpcfxResolver;
import io.kimmking.rpcfx.api.RpcfxResponse;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;
public class RpcfxInvoker {
private RpcfxResolver resolver;
public RpcfxInvoker(RpcfxResolver resolver){
this.resolver = resolver;
}
public RpcfxResponse invoke(RpcfxRequest request) {
RpcfxResponse response = new RpcfxResponse();
String serviceClass = request.getServiceClass();
// 作业1:改成泛型和反射
Object service = resolver.resolve(serviceClass);//this.applicationContext.getBean(serviceClass);
try {
Method method = resolveMethodFromClass(service.getClass(), request.getMethod());
Object result = method.invoke(service, request.getParams()); // dubbo, fastjson,
// 两次json序列化能否合并成一个
response.setResult(JSON.toJSONString(result, SerializerFeature.WriteClassName));
response.setStatus(true);
return response;
} catch ( IllegalAccessException | InvocationTargetException e) {
// 3.Xstream
// 2.封装一个统一的RpcfxException
// 客户端也需要判断异常
e.printStackTrace();
response.setException(e);
response.setStatus(false);
return response;
}
}
private Method resolveMethodFromClass(Class<?> klass, String methodName) {
return Arrays.stream(klass.getMethods()).filter(m -> methodName.equals(m.getName())).findFirst().get();
}
}
| [
"yu.xiang@alibaba-inc.com"
] | yu.xiang@alibaba-inc.com |
728378183c25033750a28782ae9112463dfe0b7a | e4b986385769d06e67487de1f2d24ef34adce7eb | /src/main/java/com/clarifai/grpc/api/SingleAnnotationResponseOrBuilder.java | 4bf895958ad63976826cb2b4d4086d13f8e30a93 | [
"Apache-2.0"
] | permissive | Clarifai/clarifai-java-grpc | 9e76874146890f4dc61671cea77d632fcff96275 | 8d67abdc08567de6a1861f92549d9115ffba66ae | refs/heads/master | 2023-08-30T11:56:50.222128 | 2023-08-29T18:39:01 | 2023-08-29T18:39:01 | 217,546,855 | 7 | 5 | NOASSERTION | 2022-07-20T12:22:19 | 2019-10-25T14:03:41 | Java | UTF-8 | Java | false | true | 1,197 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: proto/clarifai/api/service.proto
package com.clarifai.grpc.api;
public interface SingleAnnotationResponseOrBuilder extends
// @@protoc_insertion_point(interface_extends:clarifai.api.SingleAnnotationResponse)
com.google.protobuf.MessageOrBuilder {
/**
* <code>.clarifai.api.status.Status status = 1;</code>
* @return Whether the status field is set.
*/
boolean hasStatus();
/**
* <code>.clarifai.api.status.Status status = 1;</code>
* @return The status.
*/
com.clarifai.grpc.api.status.Status getStatus();
/**
* <code>.clarifai.api.status.Status status = 1;</code>
*/
com.clarifai.grpc.api.status.StatusOrBuilder getStatusOrBuilder();
/**
* <code>.clarifai.api.Annotation annotation = 2;</code>
* @return Whether the annotation field is set.
*/
boolean hasAnnotation();
/**
* <code>.clarifai.api.Annotation annotation = 2;</code>
* @return The annotation.
*/
com.clarifai.grpc.api.Annotation getAnnotation();
/**
* <code>.clarifai.api.Annotation annotation = 2;</code>
*/
com.clarifai.grpc.api.AnnotationOrBuilder getAnnotationOrBuilder();
}
| [
"rok.povsic@gmail.com"
] | rok.povsic@gmail.com |
22e5aa97d8c1b2d65c854a6af3bc979ca37dec21 | 3e32c6bd71577217b4b5db4890d314dfd17d6593 | /hcms-rest-api/src/main/java/com/abminvestama/hcms/AuthenticationConfiguration.java | 750ab8cdd6b0e8b33e22d807c4bb8db6c5fa6356 | [] | no_license | yauritux/hcms-api | d6e7fd3ac450a170c8065cda6c76224a4ce3c404 | 2e4538e9bc6f4dde70d894295197c00c9c82fe00 | refs/heads/master | 2021-01-10T01:15:00.935233 | 2016-02-03T07:09:54 | 2016-02-03T07:09:54 | 50,981,095 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,188 | java | package com.abminvestama.hcms;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.metrics.CounterService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.configurers.GlobalAuthenticationConfigurerAdapter;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import com.abminvestama.hcms.core.service.api.business.query.UserQueryService;
/**
*
* @author yauri (yauritux@gmail.com)
* @version 1.0.0
* @since 1.0.0
*
*/
@Configuration
@ComponentScan({ "com.abminvestama.hcms.core.model.entity", "com.abminvestama.hcms.core.repository",
"com.abminvestama.hcms.core.service.impl.business.query"
})
public class AuthenticationConfiguration extends GlobalAuthenticationConfigurerAdapter {
private CounterService counterService;
private UserQueryService userQueryService;
@Autowired
public void setCounterService(CounterService counterService) {
this.counterService = counterService;
}
@Autowired
public void setUserQueryService(UserQueryService userQueryService) {
this.userQueryService = userQueryService;
}
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Bean
public AuthenticationProvider authenticationProvider() {
DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider();
authProvider.setPasswordEncoder(passwordEncoder());
authProvider.setUserDetailsService(userDetailsService());
return authProvider;
}
@Bean
public UserDetailsService userDetailsService() {
return new UserDetailsService() {
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
Optional<com.abminvestama.hcms.core.model.entity.User> user
= userQueryService.findByUsername(Optional.ofNullable(username));
if (user.isPresent()) {
List<String> roles = user.get().getRoles().stream().map(role -> role.getName()).collect(Collectors.toList());
return new org.springframework.security.core.userdetails.User(
user.get().getUsername(), user.get().getPassword(),
true, true, true, true,
AuthorityUtils.createAuthorityList(
roles.toArray(new String[roles.size()])
));
}
counterService.increment("counter.login.failure");
throw new UsernameNotFoundException("Could not find user '" + username + "'");
}
};
}
} | [
"yauritux@gmail.com"
] | yauritux@gmail.com |
701ed73350e5e74a17a4ad8759d91b55ed32c922 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/22/22_679d2be60cb1d631b822dbdd216b25e91ccad5d3/DisplayImplJ2D/22_679d2be60cb1d631b822dbdd216b25e91ccad5d3_DisplayImplJ2D_s.java | 875fd3b6f13af372b79bf5eb5e0470b5087efa21 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,222 | java |
//
// DisplayImplJ2D.java
//
/*
VisAD system for interactive analysis and visualization of numerical
data. Copyright (C) 1996 - 1998 Bill Hibbard, Curtis Rueden, Tom
Rink and Dave Glowacki.
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 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License in file NOTICE for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
visad.java2d design:
0. common code in ClassNameJ2D and ClassNameJ3D
DirectManipulationRendererJ2/3D
common methods in visad.DataRenderer
GraphicsModeControlJ2/3D
why isn't GraphicsModeControl a class
where we can put common methods ? ? ? ?
all *ControlJ3D extend Control and implement interfaces
--> looks like interfaces could be abstract classes
extending Control
** done for GraphicsModeControl and ProjectionControl
** not for AnimationControl and ValueControl
MouseBehaviorJ2/3D
extend visad.MouseBehavior
visad.MouseHelper.processEvents
remove Transform3D constructor from make_matrix
DefaultDisplayRendererJ2D/TwoDDisplayRendererJ3D
common methods in visad.DisplayRenderer
ShadowFunctionOrSetTypeJ2/3D, ShadowRealTypeJ2/3D and
ShadowTupleTypeJ2/3D ShadowTypeJ2/3D adapt common
methods in visad.Shadow*Type
1. add VisAD-specific scene graph classes:
canvas, root, trans, direct, cursor_trans & other
scene graph stuff in DisplayRendererJ2D
** done
VisADRay
VisADSceneGraphObject
VisADGroup
VisADSwitch
VisADAppearance
incl VisADGeometryArray
incl Image "texture"
incl red, green, blue, alpha
linewidth and pointsize in GraphicsModeControl
(VisADTexture2D not needed; Image in VisADAppearance)
texture.setImage(0, image2d);
new Shape3D(geometry, appearance);
appearance.setTexture(texture);
(VisADShape not needed; VisADGeometryArray in VisADAppearance)
(VisADTransform not needed; trans in DisplayRendererJnD)
(hence VisADBranchGroup not needed; a VisADBranchGroup
is a VisADGroup that is not a VisADSwitch)
2. add VisADSceneGraphObject as parent of
existing VisAD-specific scene graph classes:
** done
VisADSceneGraphObject
VisADGeometryArray
VisADIndexedTriangleStripArray
VisADLineArray
VisADLineStripArray
VisADPointArray
VisADTriangleArray
VisADQuadArray
3. VisADCanvasJ2D
add BufferedImage[] array with element for each animation step
AnimationControlJ2D.init() invoked in paint
4. DisplayImplJ2D.doAction
super.doAction()
if any scene graph changes canvas.scratchImages()
5. AnimationControlJ2D.selectSwitches()
invoke canvas.renderTrigger() instead of init()
6. ValueControlJ2D.setValue()
invoke canvas.scratchImages()
7. ProjectionControlJ2D.setMatrix()
invoke canvas.scratchImages()
8. VisADCanvasJ2D.paint()
invokes DisplayRendererJ2D.drawCursorStringVector()
which draws cursor strings, Exception strings,
WaitFlag & Animation string
add draw of extra_branch from
DirectManipulationRendererJ2D.addPoint
9. DirectManipulationRendererJ2D
doTransform: create branch and extra_branch
addPoint: add to extra_branch
10. MouseBehaviorJ2D
just do AWTEvent's
11. DefaultDisplayRendererJ2D = TwoDDisplayRendererJ2D
legalDisplayScalar?
12. DisplayAppletJ2D delete
13. DisplayImplJ2D.makeGeometry() delete
14. RemoveBehaviorJ2D delete
15. UniverseBuilderJ2D delete
16. resize event on Display component, and
rebuild BufferedImage[] array
17. AnimationSetControlJ2D.setSet() (new class)
canvas.createImages(s.getLength())
18. VisADCanvasJ2D renderThread
*/
package visad.java2d;
import visad.*;
import java.util.Vector;
import java.util.Enumeration;
import java.rmi.*;
import java.io.*;
import java.awt.*;
/**
DisplayImplJ2D is the VisAD class for displays that use
Java 3D. It is runnable.<P>
DisplayImplJ2D is not Serializable and should not be copied
between JVMs.<P>
*/
public class DisplayImplJ2D extends DisplayImpl {
/** legal values for api */
public static final int JPANEL = 1;
private ProjectionControlJ2D projection = null;
private GraphicsModeControlJ2D mode = null;
/** flag to scratch images in VisADCanvasJ2D */
private boolean scratch;
/** constructor with DefaultDisplayRendererJ2D */
public DisplayImplJ2D(String name)
throws VisADException, RemoteException {
this(name, new DefaultDisplayRendererJ2D(), JPANEL);
}
/** constructor with non-DefaultDisplayRenderer */
public DisplayImplJ2D(String name, DisplayRendererJ2D renderer)
throws VisADException, RemoteException {
this(name, renderer, JPANEL);
}
/** constructor with DefaultDisplayRenderer */
public DisplayImplJ2D(String name, int api)
throws VisADException, RemoteException {
this(name, new DefaultDisplayRendererJ2D(), api);
}
/** constructor with non-DefaultDisplayRenderer */
public DisplayImplJ2D(String name, DisplayRendererJ2D renderer, int api)
throws VisADException, RemoteException {
super(name, renderer);
// a GraphicsModeControl always exists
mode = new GraphicsModeControlJ2D(this);
addControl(mode);
// a ProjectionControl always exists
projection = new ProjectionControlJ2D(this);
addControl(projection);
if (api == JPANEL) {
Component component = new DisplayPanelJ2D(this);
setComponent(component);
}
else {
throw new DisplayException("DisplayImplJ2D: bad graphicsApi");
}
// a GraphicsModeControl always exists
mode = new GraphicsModeControlJ2D(this);
addControl(mode);
// a ProjectionControl always exists
projection = new ProjectionControlJ2D(this);
addControl(projection);
}
public ProjectionControl getProjectionControl() {
return projection;
}
public GraphicsModeControl getGraphicsModeControl() {
return mode;
}
public void setScratch() {
scratch = true;
}
public void doAction() throws VisADException, RemoteException {
scratch = false;
super.doAction();
if (scratch) {
/*
System.out.println("DisplayImplJ2D.doAction: scratch = " + scratch);
*/
VisADCanvasJ2D canvas =
((DisplayRendererJ2D) getDisplayRenderer()).getCanvas();
canvas.scratchImages();
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
515a9b57dc1ffef61c8db9d50756deb25b45879c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/35/35_2493bd3562781cbbebb64808bdbb486b3ebc3ac2/DelegatingStartLaunchConfiguration/35_2493bd3562781cbbebb64808bdbb486b3ebc3ac2_DelegatingStartLaunchConfiguration_s.java | 588876a437aaa880f8db861f90de66bd0ec8ce2c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,609 | java | /*******************************************************************************
* Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.ide.eclipse.as.core.server.internal.launch;
import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.ServerUtil;
import org.jboss.ide.eclipse.as.core.server.internal.BehaviourModel;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.util.DeploymentPreferenceLoader;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class DelegatingStartLaunchConfiguration extends AbstractJBossStartLaunchConfiguration {
public ArrayList<IJBossLaunchDelegate> getSetupParticipants(IServer server) {
return BehaviourModel.getModel().getSetupParticipants(server);
}
// Allow all participants to set some defaults for their own details
// Participants should be careful not to change shared launch keys / values
// unless their operation mode (local / rse / etc) is in use
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IServer server) throws CoreException {
for( Iterator<IJBossLaunchDelegate> i = getSetupParticipants(server).iterator(); i.hasNext(); ) {
i.next().setupLaunchConfiguration(workingCopy, server);
}
}
protected IJBossLaunchDelegate getDelegate(ILaunchConfiguration configuration) throws CoreException {
IServer server = ServerUtil.getServer(configuration);
DeployableServerBehavior beh = ServerConverter.getDeployableServerBehavior(server);
String currentMode = DeploymentPreferenceLoader.getCurrentDeploymentMethodTypeId(beh.getServer());
//return getLaunchDelegates(server).get(currentMode);
return BehaviourModel.getModel().getLaunchDelegate(server, currentMode);
}
public void actualLaunch(ILaunchConfiguration configuration,
String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
getDelegate(configuration).actualLaunch(this, configuration, mode, launch, monitor);
}
/*
* Ensures that the working directory and classpath are 100% accurate.
* Merges proper required params into args and vm args
*/
public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
return getDelegate(configuration).preLaunchCheck(configuration, mode, monitor);
}
public void preLaunch(ILaunchConfiguration configuration,
String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
getDelegate(configuration).preLaunch(configuration, mode, launch, monitor);
}
public void postLaunch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
getDelegate(configuration).postLaunch(configuration, mode, launch, monitor);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
2f259c110eee499662314302f170e75ac35b5d11 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_d81165cfa259243bc257db03425590a1ba265501/Popup/5_d81165cfa259243bc257db03425590a1ba265501_Popup_s.java | f5d975b6b38449711b8f5200b64ec14e1c707ea5 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 752 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Viewer;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
*
* @author mbaxkak4
*/
public class Popup extends JDialog {
private String message;
public Popup (String message)
{
this.message=message;
initComponents();
}
void initComponents(){
JFrame frame=new JFrame();
JPanel panel=new JPanel();
JOptionPane.showMessageDialog(frame,
"Eggs are not supposed to be green.");
setVisible(true);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f9ddb83441730d2284bc3eafb155e3b6c2ec5c52 | 1302a788aa73d8da772c6431b083ddd76eef937f | /WORKING_DIRECTORY/platform_testing/tests/jank/sysapp_wear/src/com/android/wearable/sysapp/janktests/CardsJankTest.java | 14507d372a48e1ef6ea0cae9c3b41014ba27aa5a | [] | no_license | rockduan/androidN-android-7.1.1_r28 | b3c1bcb734225aa7813ab70639af60c06d658bf6 | 10bab435cd61ffa2e93a20c082624954c757999d | refs/heads/master | 2021-01-23T03:54:32.510867 | 2017-03-30T07:17:08 | 2017-03-30T07:17:08 | 86,135,431 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,948 | java | /*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.wearable.sysapp.janktests;
import android.os.Bundle;
import android.support.test.jank.GfxMonitor;
import android.support.test.jank.JankTest;
import android.support.test.jank.JankTestBase;
import android.support.test.uiautomator.UiDevice;
/**
* Jank tests for scrolling & swiping off notification cards on wear
*/
public class CardsJankTest extends JankTestBase {
private UiDevice mDevice;
private SysAppTestHelper mHelper;
/*
* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
@Override
protected void setUp() throws Exception {
super.setUp();
mDevice = UiDevice.getInstance(getInstrumentation());
mHelper = SysAppTestHelper.getInstance(mDevice, this.getInstrumentation());
mDevice.wakeUp();
}
// Prepare device to start scrolling by tapping on the screen
// As this is done using demo cards a tap on screen will stop animation and show
// home screen
public void openScrollCard() throws Exception {
mHelper.hasDemoCards();
mHelper.swipeUp();
}
// Measure card scroll jank
@JankTest(beforeLoop = "openScrollCard", afterTest = "goBackHome",
expectedFrames = SysAppTestHelper.EXPECTED_FRAMES_CARDS_TEST)
@GfxMonitor(processName = "com.google.android.wearable.app")
public void testScrollCard() {
mHelper.swipeUp();
}
// Preparing the cards to full view before dismissing them
public void openSwipeCard() throws Exception {
mHelper.hasDemoCards();
mHelper.swipeUp();
mHelper.swipeUp();
}
// Measure jank when dismissing a card
@JankTest(beforeLoop = "openSwipeCard", afterTest = "goBackHome",
expectedFrames = SysAppTestHelper.EXPECTED_FRAMES_CARDS_TEST)
@GfxMonitor(processName = "com.google.android.wearable.app")
public void testSwipeCard() {
mHelper.swipeRight();
}
// Ensuring that we head back to the first screen before launching the app again
public void goBackHome(Bundle metrics) {
mHelper.goBackHome();
super.afterTest(metrics);
}
/*
* (non-Javadoc)
* @see android.test.InstrumentationTestCase#tearDown()
*/
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
}
| [
"duanliangsilence@gmail.com"
] | duanliangsilence@gmail.com |
ad9a2ee19a04e37a28e8dbfa25884c092bdf0824 | be4a8376b4e8c994a79d117d9fe5ee5508a50fcc | /2.1 (2017-2018)/lostshard/src/main/java/com/lostshard/lostshard/spells/Structures/WallOfStone.java | 54051519fdb7028b4033e956afbface267864c7c | [
"MIT"
] | permissive | BuntsFidleyBits/Lostshard-ARCHIVE | 5b140d36c058421ce02ff12eaee143850a274db1 | 6094e3c12b181e86c313edc7ec2f13fd0907f716 | refs/heads/master | 2021-09-28T13:44:52.398297 | 2018-11-17T14:52:51 | 2018-11-17T14:52:51 | 157,993,584 | 0 | 2 | MIT | 2018-11-17T14:42:58 | 2018-11-17T14:42:58 | null | UTF-8 | Java | false | false | 2,169 | java | package com.lostshard.lostshard.Spells.Structures;
import java.util.ArrayList;
import java.util.UUID;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import com.lostshard.lostshard.Spells.MagicStructure;
public class WallOfStone extends MagicStructure {
protected int buildTicks = 25;
protected int solidTicks = 125;
public WallOfStone(ArrayList<Block> blocks, UUID uuid, int numTicksTillCleanup) {
super(blocks, uuid, numTicksTillCleanup);
}
@Override
public void tick() {
if (!this.isDead()) {
this.setCurTick(this.getCurTick() + 1);
if (this.getCurTick() >= this.getNumTicksTillCleanup())
this.cleanUp();
else if (this.getCurTick() >= this.solidTicks) {
// System.out.println("removing tick");
final int totalBlocks = this.getBlockStates().size();
final int blocksPerTick = (int) Math
.ceil(totalBlocks / ((double) this.getNumTicksTillCleanup() - (double) this.solidTicks));
final int curBlock = (this.getCurTick() - this.solidTicks) * blocksPerTick;
int maxSize = curBlock + blocksPerTick;
if (curBlock + blocksPerTick >= this.getBlockStates().size())
maxSize = this.getBlockStates().size();
for (int i = curBlock; i < maxSize; i++) {
final BlockState b = this.getBlockStates().get(i);
if (b.equals(b.getBlock().getState()))
b.getBlock().setType(Material.AIR);
}
} else if (this.getCurTick() > this.buildTicks) {
// solid ticks
} else {
final int totalBlocks = this.getBlockStates().size();
final int blocksPerTick = (int) Math
.ceil(totalBlocks / ((double) this.getNumTicksTillCleanup() - (double) this.solidTicks));
final int curBlock = (this.getCurTick() - 1) * blocksPerTick;
int maxSize = curBlock + blocksPerTick;
if (curBlock + blocksPerTick >= this.getBlockStates().size())
maxSize = this.getBlockStates().size();
for (int i = curBlock; i < maxSize; i++) {
final Block b = this.getBlockStates().get(i).getBlock();
if (b.getType().equals(Material.AIR)) {
b.setType(Material.STONE);
this.getBlockStates().set(i, b.getState());
}
}
}
}
}
}
| [
"mu@imi.co"
] | mu@imi.co |
c59763b4d39762cb75b10277ad8fcb14b01fb83e | 3e355a798304584431e5e5a1f1bc141e16c330fc | /AL-Game/data/scripts/system/handlers/quest/daevation/_1990ASagesGift.java | b17a0ba543c497d303bb87df09beacea53f417fd | [] | no_license | webdes27/Aion-Lightning-4.6-SRC | db0b2b547addc368b7d5e3af6c95051be1df8d69 | 8899ce60aae266b849a19c3f93f47be9485c70ab | refs/heads/master | 2021-09-14T19:16:29.368197 | 2018-02-27T16:05:28 | 2018-02-27T16:05:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,019 | java | /**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning 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.
*
* Aion-Lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*/
package quest.daevation;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.questEngine.handlers.QuestHandler;
import com.aionemu.gameserver.model.DialogAction;
import com.aionemu.gameserver.questEngine.model.QuestEnv;
import com.aionemu.gameserver.questEngine.model.QuestState;
import com.aionemu.gameserver.questEngine.model.QuestStatus;
/**
* @author kecimis,Tiger
* @reworked vlog
*/
public class _1990ASagesGift extends QuestHandler {
private final static int questId = 1990;
// mob counter
// it's binary. Don't change!
private int ALL = 0;
private int A = 0;
private int B = 0;
private int C = 0;
public _1990ASagesGift() {
super(questId);
}
@Override
public void register() {
int[] mobs = {256617, 253721, 253720, 254514, 254513};
qe.registerQuestNpc(203771).addOnQuestStart(questId);
qe.registerQuestNpc(203771).addOnTalkEvent(questId);
for (int mob : mobs) {
qe.registerQuestNpc(mob).addOnKillEvent(questId);
}
}
@Override
public boolean onDialogEvent(QuestEnv env) {
Player player = env.getPlayer();
QuestState qs = player.getQuestStateList().getQuestState(questId);
DialogAction dialog = env.getDialog();
int targetId = env.getTargetId();
if (qs == null || qs.getStatus() == QuestStatus.NONE) {
if (targetId == 203771) { // Fermina
if (env.getDialog() == DialogAction.QUEST_SELECT) {
if (isDaevanionArmorEquipped(player)) {
return sendQuestDialog(env, 4762);
} else {
return sendQuestDialog(env, 4848);
}
} else {
return sendQuestStartDialog(env);
}
}
} else if (qs.getStatus() == QuestStatus.START) {
int var = qs.getQuestVarById(0);
int var1 = qs.getQuestVarById(1);
if (targetId == 203771) { // Fermina
switch (dialog) {
case QUEST_SELECT: {
if (var == 0) {
return sendQuestDialog(env, 1011);
} else if (var == 2 && var1 == 60) {
return sendQuestDialog(env, 1693);
} else if (var == 3) {
return sendQuestDialog(env, 2034);
}
}
case CHECK_USER_HAS_QUEST_ITEM: {
return checkQuestItems(env, 0, 1, false, 10000, 10001); // 1
}
case SELECT_ACTION_2035: {
int currentDp = player.getCommonData().getDp();
int maxDp = player.getGameStats().getMaxDp().getCurrent();
long burner = player.getInventory().getItemCountByItemId(186000040); // Divine Incense Burner
if (currentDp == maxDp && burner >= 1) {
removeQuestItem(env, 186000040, 1);
player.getCommonData().setDp(0);
changeQuestStep(env, 3, 3, true); // reward
return sendQuestDialog(env, 5);
} else {
return sendQuestDialog(env, 2120);
}
}
case SETPRO2: {
return defaultCloseDialog(env, 1, 2); // 2
}
case SETPRO3: {
qs.setQuestVar(3); // 3
updateQuestStatus(env);
return sendQuestSelectionDialog(env);
}
case FINISH_DIALOG: {
return sendQuestSelectionDialog(env);
}
}
}
} else if (qs.getStatus() == QuestStatus.REWARD) {
if (targetId == 203771) { // Fermina
return sendQuestEndDialog(env);
}
}
return false;
}
@Override
public boolean onKillEvent(QuestEnv env) {
Player player = env.getPlayer();
QuestState qs = player.getQuestStateList().getQuestState(questId);
if (qs != null && qs.getStatus() == QuestStatus.START) {
int var = qs.getQuestVarById(0);
if (var == 2) {
switch (env.getTargetId()) {
case 256617: { // Strange Lake Spirit
if (A >= 0 && A < 30) {
++A;
ALL = C;
ALL = ALL << 7;
ALL += B;
ALL = ALL << 7;
ALL += A;
ALL = ALL << 7;
ALL += 2;// var0
qs.setQuestVar(ALL);
updateQuestStatus(env);
}
break;
}
case 253721:
case 253720: { // Lava Hoverstone
if (B >= 0 && B < 30) {
++B;
ALL = C;
ALL = ALL << 7;
ALL += B;
ALL = ALL << 7;
ALL += A;
ALL = ALL << 7;
ALL += 2;// var0
qs.setQuestVar(ALL);
updateQuestStatus(env);
}
break;
}
case 254514:
case 254513: { // Disturbed Resident
if (C >= 0 && C < 30) {
++C;
ALL = C;
ALL = ALL << 7;
ALL += B;
ALL = ALL << 7;
ALL += A;
ALL = ALL << 7;
ALL += 2;// var0
qs.setQuestVar(ALL);
updateQuestStatus(env);
}
break;
}
}
if (qs.getQuestVarById(0) == 2 && A == 30 && B == 30 && C == 30) {
qs.setQuestVarById(1, 60);
updateQuestStatus(env);
return true;
}
}
}
return false;
}
private boolean isDaevanionArmorEquipped(Player player) {
int plate = player.getEquipment().itemSetPartsEquipped(9);
int chain = player.getEquipment().itemSetPartsEquipped(8);
int leather = player.getEquipment().itemSetPartsEquipped(7);
int cloth = player.getEquipment().itemSetPartsEquipped(6);
int gunner = player.getEquipment().itemSetPartsEquipped(378);
if (plate == 5 || chain == 5 || leather == 5 || cloth == 5 || gunner == 5) {
return true;
}
return false;
}
}
| [
"michelgorter@outlook.com"
] | michelgorter@outlook.com |
e127b9a28d1cea5ffc44e948dca38a627df0ee22 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/MOCKITO-10b-10-26-SPEA2-WeightedSum:TestLen:CallDiversity/org/mockito/internal/handler/NullResultGuardian_ESTest_scaffolding.java | c3788121bfd39baa53320f19828a212c5a7b57d9 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 451 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Apr 06 17:01:26 UTC 2020
*/
package org.mockito.internal.handler;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class NullResultGuardian_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
c416e1cb497da1cfac8564874ff88c79c4f87abf | 314e23f9d1e48d9ae0dd68b0038483e87f4559b7 | /Core/org.emftext.language.java.resource.bcel/src-bcel/org/apache/bcel5_2_0/generic/MethodObserver.java | c224727b60e719f61ad4b336de1ec07a4f311cda | [] | no_license | Adomat/JaMoPP | b0a09df70014166abcfa580cab29be0118a2804d | e335bf2d2eba6fb0577cd45100ff9d92a03fde3e | refs/heads/master | 2020-04-01T14:44:36.334702 | 2017-11-19T09:50:04 | 2017-11-19T09:50:04 | 153,306,205 | 0 | 0 | null | 2018-10-16T15:07:30 | 2018-10-16T15:07:29 | null | UTF-8 | Java | false | false | 1,021 | java | /*
* Copyright 2000-2004 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 applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.apache.bcel5_2_0.generic;
/**
* Implement this interface if you're interested in changes to a MethodGen object
* and register yourself with addObserver().
*
* @version $Id: MethodObserver.java 386056 2006-03-15 11:31:56Z tcurdt $
* @author <A HREF="mailto:m.dahm@gmx.de">M. Dahm</A>
*/
public interface MethodObserver {
public void notify( MethodGen method );
}
| [
"jendrik.johannes@devboost.de"
] | jendrik.johannes@devboost.de |
8b5a7a7863b3ed268c441e78b20337114528526b | f567c98cb401fc7f6ad2439cd80c9bcb45e84ce9 | /src/main/java/com/alipay/api/domain/AlipayOpenInstantdeliveryMerchantagreementSignModel.java | fe33b0613ede92d4bba0333c0d47be3179ffa82f | [
"Apache-2.0"
] | permissive | XuYingJie-cmd/alipay-sdk-java-all | 0887fa02f857dac538e6ea7a72d4d9279edbe0f3 | dd18a679f7543a65f8eba2467afa0b88e8ae5446 | refs/heads/master | 2023-07-15T23:01:02.139231 | 2021-09-06T07:57:09 | 2021-09-06T07:57:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 623 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 即时配送中商家代扣协议签署
*
* @author auto create
* @since 1.0, 2020-12-01 17:07:02
*/
public class AlipayOpenInstantdeliveryMerchantagreementSignModel extends AlipayObject {
private static final long serialVersionUID = 1841831337956796829L;
/**
* 蚂蚁统一会员ID
*/
@ApiField("user_id")
private String userId;
public String getUserId() {
return this.userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
0313aafe8d696d206bfa517bd0c24584f515ce7b | c742cc5d181dd6105a26d586f513177a18e28250 | /src/IB/Hashing_ib_longest_subarray_length.java | 5022668f6d2e70f4f42dd4f004fe6575b230105c | [] | no_license | gaurirawat/Coding | a5542f71be5da538cc438a8d4070ce4c748ee044 | d69fb40befbf9a30774b723fff90ae7cba384f7a | refs/heads/master | 2023-02-20T00:33:31.632223 | 2021-01-22T11:49:14 | 2021-01-22T11:49:14 | 275,333,532 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 625 | java | package IB;
import java.util.HashMap;
//https://www.interviewbit.com/problems/longest-subarray-length/
public class Hashing_ib_longest_subarray_length {
public int solve(int[] a) {
HashMap<Integer, Integer> map=new HashMap<Integer, Integer>();
map.put(0,-1);
int maxLen=0;
int sum=0;
for(int i=0;i<a.length;++i){
sum+=a[i]==0?-1:1;
if(map.get(sum-1)!=null){
maxLen=Math.max(maxLen, i-map.get(sum-1));
}
if(map.get(sum)==null){
map.put(sum, i);
}
}
return maxLen;
}
}
| [
"gaurirawat97@gmail.com"
] | gaurirawat97@gmail.com |
9f520f2ecf26e92b30df9bdc6b41023b82468ca9 | f91fe1065c172a24299146f685811db426ed732e | /mybatis-3-mybatis-3.4.2/src/test/java/org/apache/ibatis/submitted/simplelistparameter/Vehicle.java | 7bb98c242a0f0bda3e6ada1aee7777e3ac7559c4 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | xiaokukuo/soundcode-springmybatis | 649c8c93141fd070a51c63543cd3d21b2b5e9338 | 87e1c24639b37b813ba41b1b6ad05387d1ea768f | refs/heads/master | 2020-03-12T04:11:53.043180 | 2018-08-18T06:06:04 | 2018-08-18T06:06:04 | 130,440,014 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 959 | java | /**
* Copyright 2010-2018 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ibatis.submitted.simplelistparameter;
import java.util.List;
public class Vehicle<T> {
public T name;
public List<T> doors1;
private List<T> doors2;
public List<T> getDoors2() {
return doors2;
}
public void setDoors2(List<T> doors2) {
this.doors2 = doors2;
}
}
| [
"976886537@qq.com"
] | 976886537@qq.com |
e5da7261062469dce505b66eb8c585c4ad36f979 | e84a079606d17a9be48d246058a8e83ebac59c10 | /divine-repository/src/main/java/cn/idongjia/divine/repository/CategoryRepositoryI.java | 5f5e905b4cba6484b68dc9e645e4aae8ab251be8 | [] | no_license | maikezhang/maike_search | ffd40e3f5aea68f4b3acbcd5d264760baf3301c3 | 70395c1cb5865bdf4d437f3c7ca5a1c5b9596e57 | refs/heads/master | 2020-04-08T10:58:43.642851 | 2019-03-11T02:20:29 | 2019-03-11T02:20:29 | 159,289,099 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | package cn.idongjia.divine.repository;
import cn.idongjia.divine.db.mybatis.pojo.CategoryDO;
import java.util.List;
import java.util.Map;
/**
* @author lc on 2018/8/16.
* @class cn.idongjia.divine.repository.CategoryRepositoryI
*/
public interface CategoryRepositoryI {
Map<Long,CategoryDO> mapByCategoryId(List<Long> categoryIds);
CategoryDO getById(Long itemCategoryId);
}
| [
"zhangyingjie@idongjia.cn"
] | zhangyingjie@idongjia.cn |
c9458ec675cab0094c1e0ee458f7e21f5cb9c8bd | dee8d1cfca0c2e46d4621bd19997b84d85b0de7b | /stubs/src/net/minecraft/src/Tessellator.java | 5f3181818aa1fa671091e947e2971d07a937d5c8 | [
"LicenseRef-scancode-public-domain"
] | permissive | TLUL/mcpatcher | 50ab75412b8c05d2c77c06f1720be900e9eff59f | 57c972f1fafbb5c2dd0892ad27953f719d981c95 | refs/heads/master | 2020-04-03T02:52:48.551604 | 2012-06-21T05:34:19 | 2012-06-21T05:34:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package net.minecraft.src;
public class Tessellator {
public static Tessellator instance;
public static boolean convertQuadsToTriangles;
public int rawBuffer[];
public int rawBufferIndex;
public int addedVertices;
public int vertexCount;
public int bufferSize;
public int drawMode;
public boolean isDrawing;
public int texture; // added by ctm
public Tessellator(int bufferSize) {
}
public Tessellator() { // forge replaces 1-arg constructor
}
public void reset() {
}
public int draw() {
return 0;
}
public void startDrawing(int drawMode) {
}
}
| [
"prupe@nc.rr.com"
] | prupe@nc.rr.com |
4f31d9ada2c5f2da74b3ac190b050534813db6eb | cc671bd627b55e050a901028107ed40f03a671fd | /initializr-generator/src/test/java/io/spring/initializr/generator/buildsystem/maven/MavenDistributionManagementTests.java | 0178272d189a5570d10f8d3782eb361f392c9179 | [
"Apache-2.0"
] | permissive | theonefx/initializr | cbbb3bd15b0e8b13c886474a05a38c284176f528 | dbf196f8ca110393c5b9ec86ffcb4ab71455433b | refs/heads/master | 2021-01-08T18:15:10.579231 | 2020-06-15T02:57:48 | 2020-06-15T02:57:48 | 242,104,856 | 1 | 0 | Apache-2.0 | 2020-02-21T09:42:57 | 2020-02-21T09:42:56 | null | UTF-8 | Java | false | false | 4,360 | java | /*
* Copyright 2012-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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.spring.initializr.generator.buildsystem.maven;
import io.spring.initializr.generator.buildsystem.maven.MavenDistributionManagement.DeploymentRepository;
import io.spring.initializr.generator.buildsystem.maven.MavenDistributionManagement.Site;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link MavenDistributionManagement}.
*
* @author Joachim Pasquali
* @author Stephane Nicoll
*/
class MavenDistributionManagementTests {
@Test
void distributionManagementEmpty() {
MavenDistributionManagement result = builder().build();
assertThat(result.isEmpty()).isTrue();
assertThat(result.getRelocation().isEmpty()).isTrue();
assertThat(result.getRepository().isEmpty()).isTrue();
assertThat(result.getSite().isEmpty()).isTrue();
assertThat(result.getSnapshotRepository().isEmpty()).isTrue();
}
@Test
void distributionManagementWithDownloadUrl() {
MavenDistributionManagement mdm = builder().downloadUrl("https://example.com/download").build();
assertThat(mdm.getDownloadUrl()).isEqualTo("https://example.com/download");
}
@Test
void distributionManagementWithRepository() {
MavenDistributionManagement mdm = builder()
.repository((repository) -> repository.id("released-repo").name("released repo")
.url("https://upload.example.com/releases"))
.repository((repository) -> repository.layout("default")).build();
DeploymentRepository repository = mdm.getRepository();
assertThat(repository.getId()).isEqualTo("released-repo");
assertThat(repository.getName()).isEqualTo("released repo");
assertThat(repository.getUrl()).isEqualTo("https://upload.example.com/releases");
assertThat(repository.getLayout()).isEqualTo("default");
assertThat(repository.getUniqueVersion()).isNull();
}
@Test
void distributionManagementWithSnapshotRepository() {
MavenDistributionManagement mdm = builder()
.snapshotRepository((repository) -> repository.id("snapshot-repo").name("snapshot repo")
.url("scp://upload.example.com/snapshots"))
.snapshotRepository((repository) -> repository.uniqueVersion(true)).build();
DeploymentRepository snapshotRepository = mdm.getSnapshotRepository();
assertThat(snapshotRepository.getId()).isEqualTo("snapshot-repo");
assertThat(snapshotRepository.getName()).isEqualTo("snapshot repo");
assertThat(snapshotRepository.getUrl()).isEqualTo("scp://upload.example.com/snapshots");
assertThat(snapshotRepository.getLayout()).isNull();
assertThat(snapshotRepository.getUniqueVersion()).isTrue();
}
@Test
void distributionManagementWithSite() {
MavenDistributionManagement mdm = builder().site((site) -> site.id("website").name("web site"))
.site((site) -> site.url("scp://www.example.com/www/docs/project")).build();
Site site = mdm.getSite();
assertThat(site.getId()).isEqualTo("website");
assertThat(site.getName()).isEqualTo("web site");
assertThat(site.getUrl()).isEqualTo("scp://www.example.com/www/docs/project");
}
@Test
void distributionManagementWithRelocation() {
MavenDistributionManagement mdm = builder()
.relocation(
(relocation) -> relocation.groupId("com.example.new").artifactId("project").version("1.0.0"))
.relocation((relocation) -> relocation.message("Moved to com.example.new")).build();
assertThat(mdm.getRelocation().getGroupId()).isEqualTo("com.example.new");
assertThat(mdm.getRelocation().getArtifactId()).isEqualTo("project");
assertThat(mdm.getRelocation().getVersion()).isEqualTo("1.0.0");
assertThat(mdm.getRelocation().getMessage()).isEqualTo("Moved to com.example.new");
}
private MavenDistributionManagement.Builder builder() {
return new MavenDistributionManagement.Builder();
}
}
| [
"snicoll@pivotal.io"
] | snicoll@pivotal.io |
6ada9b7c0a5859d30a0acaa6df3d66eff928cd7b | 700c1e3decacf5c417dc434220da73a4c6246810 | /javacode/sysframework/com/yinhai/sysframework/menu/IMenu.java | c2f7986d47dc8ed1fcb186d1a5b0f442d1da86ec | [] | no_license | wuxiaohui123/tiantian | 4c042e475b6f824b86b6240d06e70aff8854cd9e | 8b34cc9a8439cd4bb097537afff29b4b2a833e2e | refs/heads/master | 2020-07-22T08:21:06.149310 | 2019-09-10T09:23:17 | 2019-09-10T09:23:17 | 207,128,782 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,360 | java | package com.yinhai.sysframework.menu;
import java.io.Serializable;
public interface IMenu extends Serializable {
Long ROOT_ID = Long.valueOf(1L);
String DISMULTIPOS_YES = "1";
String DISMULTIPOS_NO = "0";
String SECURITYPOLICY_DISPLAY_SECURITY = "1";
String SECURITYPOLICY_NODISPLAY_SECURITY = "2";
String SECURITYPOLICY_NODISPLAY_NOSECURITY = "3";
String SECURITYPOLICY_DISPLAY_NOSECURITY = "4";
String CACHE_YES = "1";
String CACHE_NO = "0";
String AUDITE_STATE_YES = "0";
String AUDITE_STATE_WATE = "1";
String AUDITE_STATE_PASS = "2";
String AUDITE_STATE_FAILURE = "3";
String TYPE_MENU = "01";
String TYPE_BUTTON = "02";
String TYPE_FORMREAD = "03";
String TYPE_FORMWRITE = "04";
String TYPE_GRIDCOLUMNREAD = "05";
String TYPE_GRIDCOLUMNEDITOR = "06";
String MENUTYPE_COMMON = "0";
String MENUTYPE_SYSMG = "1";
String MENUTYPE_BUSINESS = "2";
String MENU_LEAF_NO = "1";
String MENU_LEAF_YES = "0";
Long getMenuid();
Long getPmenuid();
String getMenuname();
String getUrl();
String getMenuidpath();
String getMenunamepath();
String getAccesstimeel();
String getIconSkin();
String getSelectImage();
String getReportid();
boolean isDismultipos();
boolean effective();
String getSecuritypolicy();
String getQuickcode();
Long getSortno();
boolean isParent();
}
| [
"wuxh930911@163.com"
] | wuxh930911@163.com |
f1462759c1512a61c3e2df4244de62b9b351f741 | 54c27348a6b98878f172204e223f322675183b2c | /core/src/main/java/net/tomp2p/replication/Instruction.java | db1cb61d93a58a2002f612bf121a49663d6f8087 | [
"Apache-2.0"
] | permissive | iapilgrim/TomP2P | 85aeb20f502289ef34ebf5798ffa50fd985257dd | fc646662b11a2c47a4ed9ba6a852b6b563145773 | refs/heads/master | 2021-01-20T05:37:40.383548 | 2013-10-23T15:30:39 | 2013-10-23T15:30:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,086 | java | /*
* Copyright 2013 Maxat Pernebayev, Thomas Bocek
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package net.tomp2p.replication;
import java.io.Serializable;
import java.util.Arrays;
/**
* Class that holds the instructions what to do with the differences.
*
* @author Maxat Pernebayev
* @author Thomas Bocek
*
*/
public class Instruction implements Serializable {
private static final long serialVersionUID = 112641683009283845L;
private int reference = -1;
private byte[] literal = null;
public void setReference(int reference) {
this.reference = reference;
}
public void setLiteral(byte[] literal) {
this.literal = literal;
}
public int getReference() {
return reference;
}
public byte[] getLiteral() {
return literal;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof Instruction)) {
return false;
}
Instruction i = (Instruction) obj;
if (reference >= 0) {
return reference == i.reference;
}
return Arrays.equals(literal, i.literal);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("diff->r:");
sb.append(reference);
if (literal != null) {
sb.append(",l:");
for (int i = 0; i < literal.length; i++) {
sb.append(literal[i]).append(",");
}
}
return sb.toString();
}
}
| [
"tom@tomp2p.net"
] | tom@tomp2p.net |
a1b73857dd83afa6a2e946a80fce96710fb6dc72 | 5ef0b4d230dc5243225d149efb44cdcdd2ffea9d | /trunk/tm/src/higraph/model/interfaces/Subgraph.java | 37179f9f638e51b577bf370b32e2cde7e58798c0 | [
"Apache-2.0"
] | permissive | kai-zhu/the-teaching-machine-and-webwriter | 3d3b3dfdecd61e0fb2146b44c42d6467489fd94f | 67adf8f41bb475108c285eb0894906cb0878849c | refs/heads/master | 2021-01-16T20:47:55.620437 | 2016-05-23T12:38:03 | 2016-05-23T12:38:12 | 61,149,759 | 1 | 0 | null | 2016-06-14T19:22:57 | 2016-06-14T19:22:57 | null | UTF-8 | Java | false | false | 2,177 | java | // Copyright 1998--2010 Michael Bruce-Lockhart and Theodore S. Norvell
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
// either express or implied. See the License for the specific language
// governing permissions and limitations under the License.
package higraph.model.interfaces;
/**An interface for a hierarchical subgraph.
* <p> A subgraph is a higraph that is not a wholeGraph. A subgraph
* represents a subset of a particular wholeGraph. That is
* every node in a subgraph is also a node of its wholeGraph
*
* @author Theodore S. Norvell & Michael Bruce-Lockhart
*
* @param <NP> The node payload type. Each node carries a payload.
* @param <EP> The edge payload type. Each edge carries a payload.
* @param <WG> The wholeGraph type.
* @param <SG> The subgraph type.
* @param <N> The node type.
* @param <E> The edge type.
*/
public interface Subgraph
< NP extends Payload<NP>,
EP extends Payload<EP>,
HG extends Higraph<NP,EP,HG,WG,SG,N,E>,
WG extends WholeGraph<NP,EP,HG,WG,SG,N,E>,
SG extends Subgraph<NP,EP,HG,WG,SG,N,E>,
N extends Node<NP,EP,HG,WG,SG,N,E>,
E extends Edge<NP,EP,HG,WG,SG,N,E> >
extends Higraph<NP,EP,HG,WG,SG,N,E>
{
/** Add v to the list of this subgraph's top nodes.
* <p>If v is already a top node, nothing is done.
* <p>If v is a descendant of any top node, nothing is done.
* <p>If v is an ancestor of one or more top nodes u, all such
* u are implicitly removed as a top node before v is made a top node.
*
* @param v a non-deleted node of the associated wholeGraph
*/
void addTop(N v);
/** Remove a top node from this subgraph.
* <p>If v is not already a top node, nothing is done.
* @param v
*/
void removeTop(N v);
}
| [
"theodore.norvell@gmail.com"
] | theodore.norvell@gmail.com |
b01c0ae66e2f64d95ea8b387b65bc2c4bb5097ed | cfcce5acc6c00c0699b529897eac449dfe6db32d | /ch03/taco-cloud-jdbc/src/main/java/tacos/web/IngredientByIdConverter.java | 218fffd2ddc29960453efc8fd920136279bbf218 | [] | no_license | freebz/Spring-in-Action-5 | 109a51f9e47e9e700ef914290cc0f6ee2952c6c4 | 1dbd5c6c34130fe2f31895223c7fc13407250aaf | refs/heads/main | 2023-04-24T18:10:35.675059 | 2021-05-03T16:10:11 | 2021-05-03T16:10:11 | 363,989,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 624 | java | package tacos.web;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;
import tacos.Ingredient;
import tacos.data.IngredientRepository;
@Component
public class IngredientByIdConverter
implements Converter<String, Ingredient> {
private IngredientRepository ingredientRepo;
@Autowired
public IngredientByIdConverter(IngredientRepository ingredientRepo) {
this.ingredientRepo = ingredientRepo;
}
@Override
public Ingredient convert(String id) {
return ingredientRepo.findById(id);
}
}
| [
"freebz@hananet.net"
] | freebz@hananet.net |
78d4a6cd88b6824fa7db2d7dec2ddcf1847c8324 | 881ec42c677f2d954fdc2317ad582c88fb87c752 | /workspace/AbstractClasses/src/com/skilldistillery/abstractclasses/labs/vehicles/Shape.java | ee444c9087c65b33dbde88776dfd49a575c8d51d | [] | no_license | stoprefresh/archive | f51119220fbcb4bccc82306c0483903502f1859e | 0bde3917fb9cb7e002d3abb18088fee9df4371ec | refs/heads/master | 2022-12-21T20:33:08.251833 | 2019-10-17T14:13:10 | 2019-10-17T14:13:10 | 215,808,299 | 0 | 0 | null | 2022-12-16T09:52:36 | 2019-10-17T14:08:48 | Java | UTF-8 | Java | false | false | 413 | java | package com.skilldistillery.abstractclasses.labs.vehicles;
public abstract class Shape {
private int x, y;
public Shape() {}
public Shape(int x, int y) {
super();
setX(x);
setY(y);
}
public abstract double getArea();
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
}
| [
"marsigliamiguel@protonmail.com"
] | marsigliamiguel@protonmail.com |
3104c44ced63573f11bf6b7ed768518aac1ebcd1 | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5652388522229760_0/java/Maricel/CountingSheep.java | 64986e662920b3813428b9e47863b77ae6c1451c | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,457 | java | import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
public class CountingSheep {
public static void main(String[] args) throws FileNotFoundException {
new CountingSheep().readEachTestAndSolve();
}
private void readEachTestAndSolve() throws FileNotFoundException {
Scanner scanner = new Scanner(new File("sheep.txt"));
PrintWriter writer = new PrintWriter(new File("sheep_output.txt"));
int tests = scanner.nextInt();
for (int test = 1; test <= tests; test++) {
System.out.println("Solving case: " + test);
long N = scanner.nextInt();
writer.write("Case #" + test + ": " + solve(N, N) + "\n");
}
scanner.close();
writer.close();
}
private String solve(long N, final long inc) {
if (N == 0) {
return "INSOMNIA";
}
final Set<Long> remainingDigits = new HashSet<>(10);
for (long i = 0; i <= 9; i++) {
remainingDigits.add(i);
}
do {
long nn = N;
while (nn > 0) {
remainingDigits.remove(nn % 10);
nn /= 10;
}
N += inc;
} while (!remainingDigits.isEmpty());
return String.valueOf(N - inc);
}
}
| [
"alexandra1.back@gmail.com"
] | alexandra1.back@gmail.com |
9e2eb0712dc6abfae698571b141c5b1fd86c3f30 | abfa686278125cec79d8c73969eca35a7aa86102 | /multithreading/src/lesson13_callable_and_future/CallableTester.java | 88dc7592217fc2623d452cfc1849fc71a10e1da6 | [] | no_license | rzuniga64/java | abddb21137dedff89588bc825d5fb7fc6a947a50 | 66df9ea67440055fbc250697b1c4d53cf514e7ca | refs/heads/master | 2021-01-17T01:30:28.858025 | 2019-04-23T18:12:08 | 2019-04-23T18:12:08 | 15,201,033 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,585 | java | package lesson13_callable_and_future;
import java.util.concurrent.*;
/**
* Source:
* <a href="http://java-x.blogspot.com.tr/2006/11/java-5-concurrency-callable-and-future.html">
* http://java-x.blogspot.com.tr/2006/11/java-5-concurrency-callable-and-future.html
* </a>
* <p>
* Till Java 1.4, threads could be implemented by either implementing
* {@link java.lang.Runnable} or extending {@link java.lang.Thread}.
* This was quite simple, but had a serious limitation;
* They have a run method that cannot return values. In order to side-step this,
* most programmers use side-effects (writing to a file etc.) to mimic returning
* values to the invoker of the thread. Java 5 introduces the
* {@link java.util.concurrent.Callable} interface, that allows users to
* return values from a thread.
* </p>
* <p>
* {@link java.lang.Runnable} vs {@link java.util.concurrent.Callable} :
* <ul>
* <li>
* Runnable Introduced in Java 1.0. Callable<T> Introduced in Java 1.5 as
* part of
* {@link java.util.concurrent} library.
* </li>
* <li>
* Runnable cannot be parametrized. Callable is a parametrized type whose type
* parameter indicates the return type of its run method Classes implementing.
* </li>
* <li>
* Runnable needs to implement run() method, classes implementing Callable needs
* to implement call() method.
* </li>
* <li>
* Runnable.run() returns no value, Callable.call() returns a value of Type T.
* </li>
* <li>
* Runnable can not throw checked exceptions, Callable can throw checked
* exceptions.
* </li>
* </ul>
* </p>
*
* @author Z.B. Celik <celik.berkay@gmail.com>
*/
class CallableImpl implements Callable<Integer> {
private int myName;
CallableImpl(int i) {
myName = i;
}
public Integer call() {
for (int i = 0; i < 10; i++) {
System.out.println("Thread : " + getMyName() + " value is : " + i);
}
return getMyName();
}
public int getMyName() {
return myName;
}
public void setMyName(int myName) {
this.myName = myName;
}
}
public class CallableTester {
public static void main(String[] args) throws InterruptedException {
Callable<Integer> callable = new CallableImpl(2);
ExecutorService executor = new ScheduledThreadPoolExecutor(1);
Future<Integer> future = executor.submit(callable);
try {
System.out.println("Future value: " + future.get());
} catch (Exception ignored) {}
executor.shutdown();
executor.awaitTermination(1, TimeUnit.HOURS);
}
}
| [
"rzuniga64@gmail.com"
] | rzuniga64@gmail.com |
fbf90a7d30b75557f654f9d319680b083b0e1254 | aa96baadfb2da7f5a8dd9ff3073bf4183fadc062 | /src/main/java/me/libraryaddict/disguise/commands/DisguiseModifyEntityCommand.java | c5a267ed4ff30578681e9656aad83c2133a43989 | [] | no_license | Tominous/LibsDisguises | f4ad96cc01e09bc8a25b94dde986a43b2d6aa3a1 | 18044298f332fe3d6a4e9f48e23894932fc10ad8 | refs/heads/master | 2020-05-15T18:26:27.754803 | 2019-04-20T16:06:08 | 2019-04-20T16:06:08 | 182,426,343 | 1 | 0 | null | 2019-04-20T16:04:47 | 2019-04-20T16:04:47 | null | UTF-8 | Java | false | false | 2,922 | java | package me.libraryaddict.disguise.commands;
import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.parser.DisguisePerm;
import me.libraryaddict.disguise.utilities.parser.DisguisePermissions;
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import org.apache.commons.lang.StringUtils;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements TabCompleter {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage(LibsMsg.NO_CONSOLE.get());
return true;
}
DisguisePermissions permissions = getPermissions(sender);
if (!permissions.hasPermissions()) {
sender.sendMessage(LibsMsg.NO_PERM.get());
return true;
}
if (args.length == 0) {
sendCommandUsage(sender, permissions);
return true;
}
// TODO Validate if any disguises have this arg
LibsDisguises.getInstance().getListener()
.setDisguiseModify(sender.getName(), DisguiseUtilities.split(StringUtils.join(args, " ")));
sender.sendMessage(LibsMsg.DMODIFYENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire()));
return true;
}
@Override
public List<String> onTabComplete(CommandSender sender, Command cmd, String label, String[] origArgs) {
if (!(sender instanceof Player)) {
return new ArrayList<>();
}
String[] args = getPreviousArgs(origArgs);
DisguisePermissions perms = getPermissions(sender);
if (!perms.hasPermissions()) {
return new ArrayList<>();
}
List<String> tabs = new ArrayList<>();
for (DisguisePerm perm : perms.getAllowed()) {
tabs.addAll(getTabDisguiseSubOptions(sender, perms, perm, args, 0, getCurrentArg(args)));
}
return filterTabs(tabs, origArgs);
}
/**
* Send the player the information
*/
@Override
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DMODENT_HELP1.get());
sender.sendMessage(LibsMsg.DMODIFY_HELP3
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN)));
}
}
| [
"github@lib.co.nz"
] | github@lib.co.nz |
ea03e5ed293e157645737049f1932c80c85ab998 | 4b8b83e997c046771c2ba8949d1f8744958e36e9 | /app/src/main/java/org/jf/dexlib2/immutable/instruction/ImmutableInstruction32x.java | ed1099bbb805a58896d8ac9a98cc9b8252b43f02 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | vaginessa/show-java | 978fcf3cfc5e875e3f5f81ad9e47ceb2d60b2dc2 | 31f540fb9e13a74e0a0ead27715888f022bff14c | refs/heads/master | 2021-01-18T04:09:53.521444 | 2015-12-09T20:58:32 | 2015-12-09T20:58:32 | 42,273,420 | 0 | 0 | Apache-2.0 | 2019-01-18T07:06:51 | 2015-09-10T22:12:08 | Java | UTF-8 | Java | false | false | 2,988 | java | /*
* Copyright 2012, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.jf.dexlib2.immutable.instruction;
import org.jf.dexlib2.Format;
import org.jf.dexlib2.Opcode;
import org.jf.dexlib2.iface.instruction.formats.Instruction32x;
import org.jf.dexlib2.util.Preconditions;
import javax.annotation.Nonnull;
public class ImmutableInstruction32x extends ImmutableInstruction implements Instruction32x {
public static final Format FORMAT = Format.Format32x;
protected final int registerA;
protected final int registerB;
public ImmutableInstruction32x(@Nonnull Opcode opcode,
int registerA,
int registerB) {
super(opcode);
this.registerA = Preconditions.checkShortRegister(registerA);
this.registerB = Preconditions.checkShortRegister(registerB);
}
public static ImmutableInstruction32x of(Instruction32x instruction) {
if (instruction instanceof ImmutableInstruction32x) {
return (ImmutableInstruction32x) instruction;
}
return new ImmutableInstruction32x(
instruction.getOpcode(),
instruction.getRegisterA(),
instruction.getRegisterB());
}
@Override
public int getRegisterA() {
return registerA;
}
@Override
public int getRegisterB() {
return registerB;
}
@Override
public Format getFormat() {
return FORMAT;
}
}
| [
"niranjan94@yahoo.com"
] | niranjan94@yahoo.com |
710f8ccd1880fc7fc3884386e17e3aeeaf5d13e6 | d17997fea98e49a05132b7c37e276297a0fec411 | /JavaOOPAdvance/src/IteratorsAndComperators_Exercises/EqualityLogic_07/Main.java | 148db47f31218363a02069d15f92e47c761580e3 | [] | no_license | Invincible9/JavaCore | cb99186da3ad59dd4c7ecd623c4e3700a6cb5897 | 4e005ac85ccde3038f57efbe592494d0b0afbf90 | refs/heads/master | 2021-01-20T02:08:53.404216 | 2019-04-18T12:39:01 | 2019-04-18T12:39:01 | 89,379,476 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,066 | java | package IteratorsAndComperators_Exercises.EqualityLogic_07;
import javax.naming.Name;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
/**
* Created by Mihail on 3/26/2017.
*/
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int countPeople = Integer.parseInt(reader.readLine());
Set<PersonImp> nameComparator = new TreeSet<>(new NameComparator());
Set<PersonImp> ageComparator = new HashSet<>();
while (countPeople-- > 0) {
String[] infoPeople = reader.readLine().split("\\s+");
PersonImp person = new PersonImp(infoPeople[0], Integer.parseInt(infoPeople[1]));
nameComparator.add(person);
ageComparator.add(person);
}
System.out.println(nameComparator.size());
System.out.println(ageComparator.size());
}
}
| [
"Invulnerable89@abv.bg"
] | Invulnerable89@abv.bg |
a41a7ca46eb359c2de7bc0c1cbaf7d1e91798caa | b8f680a3d5f9fa4a6c28fe5dbfc479ecb1079685 | /src/ANXGallery/sources/com/meicam/themehelper/NvsTransDesc.java | bf0d8858909a6cba2af0db6f705e463b7991bc90 | [] | no_license | nckmml/ANXGallery | fb6d4036f5d730f705172e524a038f9b62984c4c | 392f7a28a34556b6784979dd5eddcd9e4ceaaa69 | refs/heads/master | 2020-12-19T05:07:14.669897 | 2020-01-22T15:56:10 | 2020-01-22T15:56:10 | 235,607,907 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 556 | java | package com.meicam.themehelper;
import java.util.ArrayList;
public class NvsTransDesc {
public ArrayList<String> m_fhtransFxList = new ArrayList<>();
public ArrayList<String> m_fulltransFxList = new ArrayList<>();
public ArrayList<String> m_fulltransList = new ArrayList<>();
public ArrayList<String> m_halftransFxList = new ArrayList<>();
public ArrayList<String> m_halftransList = new ArrayList<>();
public ArrayList<String> m_hftransFxList = new ArrayList<>();
public ArrayList<String> m_hftransList = new ArrayList<>();
}
| [
"nico.kuemmel@gmail.com"
] | nico.kuemmel@gmail.com |
d0515c47f8662406b6bbc7153eb63a1789bf4325 | 504f0ba5c18ccc7393e6715f1ce9b236c4f6d99f | /drds-20190123/src/main/java/com/aliyun/drds20190123/models/CheckNewTableNameValidResponse.java | 6eb159e61a7b6df4373de336a527add8f83d2d3d | [
"Apache-2.0"
] | permissive | jhz-duanmeng/alibabacloud-java-sdk | 77f69351dee8050f9c40d7e19b05cf613d2448d6 | ac8bfeb15005d3eac06091bbdf50e7ed3e891c38 | refs/heads/master | 2023-01-16T04:30:12.898713 | 2020-11-25T11:45:31 | 2020-11-25T11:45:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,280 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.drds20190123.models;
import com.aliyun.tea.*;
public class CheckNewTableNameValidResponse extends TeaModel {
@NameInMap("RequestId")
@Validation(required = true)
public String requestId;
@NameInMap("Success")
@Validation(required = true)
public Boolean success;
@NameInMap("Data")
@Validation(required = true)
public Boolean data;
public static CheckNewTableNameValidResponse build(java.util.Map<String, ?> map) throws Exception {
CheckNewTableNameValidResponse self = new CheckNewTableNameValidResponse();
return TeaModel.build(map, self);
}
public CheckNewTableNameValidResponse setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
public CheckNewTableNameValidResponse setSuccess(Boolean success) {
this.success = success;
return this;
}
public Boolean getSuccess() {
return this.success;
}
public CheckNewTableNameValidResponse setData(Boolean data) {
this.data = data;
return this;
}
public Boolean getData() {
return this.data;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
981fd1cbd939c7ae71be0452919f95f09e9874a7 | f4772134546575be4dd006f14c2a3aae2d3e89fd | /spring-kafka/src/main/java/org/springframework/kafka/support/serializer/ErrorHandlingDeserializer.java | 571a326972e049621c4b3f4fe0c4047e27089573 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | denis554/spring-kafka | a739e2551420c6fac424125d3911fbf83039558b | e98664f4293e278a7bb148f1aae2d91bddc1a0d2 | refs/heads/master | 2020-05-02T16:19:58.027809 | 2019-03-27T16:37:01 | 2019-03-27T16:37:01 | 178,065,383 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,141 | java | /*
* Copyright 2018-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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.kafka.support.serializer;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import org.apache.kafka.common.header.Headers;
import org.apache.kafka.common.serialization.Deserializer;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
/**
* Delegating key/value deserializer that catches exceptions, returning them
* in the consumer record.
*
* @param <T> class of the entity, representing messages
*
* @author Gary Russell
* @author Artem Bilan
* @deprecated in favor of {@link ErrorHandlingDeserializer2}.
*
* @since 2.2
*
*/
@Deprecated
public class ErrorHandlingDeserializer<T> implements Deserializer<T> {
/**
* Property name for the delegate key deserializer.
*/
public static final String KEY_DESERIALIZER_CLASS = "spring.deserializer.key.delegate.class";
/**
* Property name for the delegate value deserializer.
*/
public static final String VALUE_DESERIALIZER_CLASS = "spring.deserializer.value.delegate.class";
private Deserializer<T> delegate;
private boolean isKey;
public ErrorHandlingDeserializer() {
}
public ErrorHandlingDeserializer(Deserializer<T> delegate) {
this.delegate = setupDelegate(delegate);
}
@Override
public void configure(Map<String, ?> configs, boolean isKey) {
if (isKey && configs.containsKey(KEY_DESERIALIZER_CLASS)) {
try {
Object value = configs.get(KEY_DESERIALIZER_CLASS);
Class<?> clazz = value instanceof Class ? (Class<?>) value : ClassUtils.forName((String) value, null);
this.delegate = setupDelegate(clazz.newInstance());
}
catch (ClassNotFoundException | LinkageError | InstantiationException | IllegalAccessException e) {
throw new IllegalStateException(e);
}
}
else if (!isKey && configs.containsKey(VALUE_DESERIALIZER_CLASS)) {
try {
Object value = configs.get(VALUE_DESERIALIZER_CLASS);
Class<?> clazz = value instanceof Class ? (Class<?>) value : ClassUtils.forName((String) value, null);
this.delegate = setupDelegate(clazz.newInstance());
}
catch (ClassNotFoundException | LinkageError | InstantiationException | IllegalAccessException e) {
throw new IllegalStateException(e);
}
}
Assert.state(this.delegate != null, "No delegate deserializer configured");
this.delegate.configure(configs, isKey);
this.isKey = isKey;
}
@SuppressWarnings("unchecked")
private Deserializer<T> setupDelegate(Object delegate) {
Assert.isInstanceOf(Deserializer.class, delegate, "'delegate' must be a 'Deserializer', not a ");
return (Deserializer<T>) delegate;
}
@Override
public T deserialize(String topic, byte[] data) {
try {
return this.delegate.deserialize(topic, data);
}
catch (Exception e) {
return deserializationException(null, data, e);
}
}
@Override
public T deserialize(String topic, Headers headers, byte[] data) {
try {
return this.delegate.deserialize(topic, headers, data);
}
catch (Exception e) {
return deserializationException(headers, data, e);
}
}
@Override
public void close() {
this.delegate.close();
}
@SuppressWarnings("unchecked")
private T deserializationException(Headers headers, byte[] data, Exception e) {
// We need this container to trick a generic type. It doesn't matter at runtime anyway.
AtomicReference<T> reference =
(AtomicReference<T>) new AtomicReference<>(
new DeserializationException("Failed to deserialize", headers, data, this.isKey, e));
return reference.get();
}
}
| [
"denisignatenko554@gmail.com"
] | denisignatenko554@gmail.com |
445fc51860bc2040b7c8ce4c0a806b8d4b563a50 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE396_Catch_Generic_Exception/CWE396_Catch_Generic_Exception__Exception_15.java | 106c6dfd216a29d74d969fd04195afbb3316cee9 | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 4,169 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE396_Catch_Generic_Exception__Exception_15.java
Label Definition File: CWE396_Catch_Generic_Exception.label.xml
Template File: point-flaw-15.tmpl.java
*/
/*
* @description
* CWE: 396 An overly broad catch statement may cause errors in program execution if unexpected exceptions are thrown
* Sinks: Exception
* GoodSink: Catch specific exception type (NumberFormatException)
* BadSink : Catch Exception, which is overly generic
* Flow Variant: 15 Control flow: switch(7)
*
* */
package testcases.CWE396_Catch_Generic_Exception;
import testcasesupport.*;
public class CWE396_Catch_Generic_Exception__Exception_15 extends AbstractTestCase
{
public void bad() throws Throwable
{
switch(7)
{
case 7:
{
try
{
Integer.parseInt("Test"); /* Will throw NumberFormatException */
}
catch (Exception e) /* FLAW: Catch Exception, which is overly generic */
{
IO.writeLine("Caught Exception");
throw e; /* Rethrow */
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
{
try
{
Integer.parseInt("Test"); /* Will throw NumberFormatException */
}
catch (NumberFormatException e) /* FIX: Catch NumberFormatException */
{
IO.writeLine("Caught Exception");
throw e; /* Rethrow */
}
}
break;
}
}
/* good1() change the switch to switch(8) */
private void good1() throws Throwable
{
switch(8)
{
case 7:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
{
try
{
Integer.parseInt("Test"); /* Will throw NumberFormatException */
}
catch (Exception e) /* FLAW: Catch Exception, which is overly generic */
{
IO.writeLine("Caught Exception");
throw e; /* Rethrow */
}
}
break;
default:
{
try
{
Integer.parseInt("Test"); /* Will throw NumberFormatException */
}
catch (NumberFormatException e) /* FIX: Catch NumberFormatException */
{
IO.writeLine("Caught Exception");
throw e; /* Rethrow */
}
}
break;
}
}
/* good2() reverses the blocks in the switch */
private void good2() throws Throwable
{
switch(7)
{
case 7:
{
try
{
Integer.parseInt("Test"); /* Will throw NumberFormatException */
}
catch (NumberFormatException e) /* FIX: Catch NumberFormatException */
{
IO.writeLine("Caught Exception");
throw e; /* Rethrow */
}
}
break;
default:
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
{
try
{
Integer.parseInt("Test"); /* Will throw NumberFormatException */
}
catch (Exception e) /* FLAW: Catch Exception, which is overly generic */
{
IO.writeLine("Caught Exception");
throw e; /* Rethrow */
}
}
break;
}
}
public void good() throws Throwable
{
good1();
good2();
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"guillermo.pando@gmail.com"
] | guillermo.pando@gmail.com |
4ecbdfd9b00e4eb7dfc8b9531d12057d28cc1a8c | a83cf28d3adbc706b754a2d9a8e84162351ddc30 | /StrategyDP-Solution1/src/com/nt/comp/SportType.java | 71871c29a38a74e29b03e73bf5430e5e4fae5a27 | [] | no_license | nerdseeker365/NTDP912 | 411cbf12395202d4bf0589fc3b6ac5510181e839 | 9c3b7231d3738b96c4f18480a919da23c7764169 | refs/heads/master | 2022-03-24T06:55:33.059743 | 2020-01-01T05:11:40 | 2020-01-01T05:11:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package com.nt.comp;
public interface SportType {
String SPORT_TYPE_CRICKET="cricket";
String SPORT_TYPE_KABADDI="kabaddi";
String SPORT_TYPE_BATMINDON="batmindon";
String SPORT_TYPE_VOLLEYBAL="volleyball";
}
| [
"karrasankar09@gmail.com"
] | karrasankar09@gmail.com |
373aa32c935dce1c37231c9229732a34d004ab85 | 0404ab851e1f30d167ade8fe17366857b56db76b | /java-2016-01-fall/src/akatkar/exam03/makeupQuestions/Question5.java | d5cd9ca8f35d398038d5a0d9ebe595ea22b1d8b9 | [] | no_license | akatkar/Okan_JavaClass_2015 | be2f153a0e2b6d127f5c162923c868c0f095bba0 | e31e913c889c42a451a55fcfeb19e96a272d56ec | refs/heads/master | 2021-01-10T14:22:46.607914 | 2017-05-08T20:07:09 | 2017-05-08T20:07:09 | 44,233,287 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 338 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package akatkar.exam03.makeupQuestions;
/**
*
* @author akatkar
*/
public class Question5 {
private static final double X = 3.1;
}
| [
"alikatkar@gmail.com"
] | alikatkar@gmail.com |
7980542f57b73013fe6f58320ecb358d7c7452c1 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project13/src/main/java/org/gradle/test/performance13_4/Production13_395.java | de84a226ac8a2894dfc7d29a20757e6bd31f06dd | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 303 | java | package org.gradle.test.performance13_4;
public class Production13_395 extends org.gradle.test.performance8_4.Production8_395 {
private final String property;
public Production13_395() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
7a20eb281b8013061682784d106da7a53886a4fe | 684f50dd1ae58a766ce441d460214a4f7e693101 | /modules/base/base-console-service/src/main/java/com/dimeng/p2p/modules/base/console/service/query/TermQuery.java | a94dd3cdb407c50a30b94c8fc2a0188363b17a66 | [] | no_license | wang-shun/rainiee-core | a0361255e3957dd58f653ae922088219738e0d25 | 80a96b2ed36e3460282e9e21d4f031cfbd198e69 | refs/heads/master | 2020-03-29T16:40:18.372561 | 2018-09-22T10:05:17 | 2018-09-22T10:05:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,057 | java | package com.dimeng.p2p.modules.base.console.service.query;
import java.sql.Timestamp;
import com.dimeng.p2p.common.enums.TermType;
public interface TermQuery {
/**
* 发布者姓名,全模糊匹配.
*
* @return {@link String} 空值无效
*/
public String getPublisherName();
/**
* 创建时间查询,大于等于匹配.
*
* @return {@link Timestamp} 非{@code null}有效
*/
public abstract Timestamp getCreateTimeStart();
/**
* 创建时间查询,小于等于匹配.
*
* @return {@link Timestamp} 非{@code null}有效
*/
public abstract Timestamp getCreateTimeEnd();
/**
* 修改时间查询,大于等于匹配.
*
* @return {@link Timestamp} 非{@code null}有效
*/
public abstract Timestamp getUpdateTimeStart();
/**
* 修改时间查询,小于等于匹配.
*
* @return {@link Timestamp} 非{@code null}有效
*/
public abstract Timestamp getUpdateTimeEnd();
/**
* 类型查询,等于匹配.
*
* @return {@link TermType} 非空值有效
*/
public abstract TermType getType();
}
| [
"humengmeng@rainiee.com"
] | humengmeng@rainiee.com |
cf20d2df34a02ab510724933b845c2cce07d4cca | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/facebook/internal/FetchedAppGateKeepersManager$1.java | db5bf928e3c4e51c2b4cb10a813869e36d6aa905 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 1,847 | java | package com.facebook.internal;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import com.tencent.matrix.trace.core.AppMethodBeat;
import org.json.JSONException;
import org.json.JSONObject;
final class FetchedAppGateKeepersManager$1
implements Runnable
{
FetchedAppGateKeepersManager$1(Context paramContext, String paramString1, String paramString2)
{
}
public final void run()
{
AppMethodBeat.i(72293);
SharedPreferences localSharedPreferences = this.val$context.getSharedPreferences("com.facebook.internal.preferences.APP_GATEKEEPERS", 0);
String str = localSharedPreferences.getString(this.val$gateKeepersKey, null);
if (!Utility.isNullOrEmpty(str));
try
{
JSONObject localJSONObject = new org/json/JSONObject;
localJSONObject.<init>(str);
if (localJSONObject != null)
FetchedAppGateKeepersManager.access$000(this.val$applicationId, localJSONObject);
localJSONObject = FetchedAppGateKeepersManager.access$100(this.val$applicationId);
if (localJSONObject != null)
{
FetchedAppGateKeepersManager.access$000(this.val$applicationId, localJSONObject);
localSharedPreferences.edit().putString(this.val$gateKeepersKey, localJSONObject.toString()).apply();
}
AppMethodBeat.o(72293);
return;
}
catch (JSONException localJSONException)
{
while (true)
{
Utility.logd("FacebookSDK", localJSONException);
Object localObject = null;
}
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar
* Qualified Name: com.facebook.internal.FetchedAppGateKeepersManager.1
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
c6f5daa18838b5e14c4455226371e4be42429eb3 | 47798511441d7b091a394986afd1f72e8f9ff7ab | /src/main/java/com/alipay/api/response/KoubeiAdvertCommissionCascademissionCreateResponse.java | 005b0dcef1d3600e7ec178db275df1d4e800c8f7 | [
"Apache-2.0"
] | permissive | yihukurama/alipay-sdk-java-all | c53d898371032ed5f296b679fd62335511e4a310 | 0bf19c486251505b559863998b41636d53c13d41 | refs/heads/master | 2022-07-01T09:33:14.557065 | 2020-05-07T11:20:51 | 2020-05-07T11:20:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 403 | java | package com.alipay.api.response;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: koubei.advert.commission.cascademission.create response.
*
* @author auto create
* @since 1.0, 2019-01-07 20:51:15
*/
public class KoubeiAdvertCommissionCascademissionCreateResponse extends AlipayResponse {
private static final long serialVersionUID = 3888261167335728257L;
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
facb12c154519b02d111a34da505e38194b5e00e | 1981a7539c604fe479f3f820aae0a527f9964a1c | /app/src/main/java/com/arialyy/simple/download/DownloadDialogFragment.java | 91a091fb848b94a52014b7cf8c429f7b58d38244 | [
"Apache-2.0"
] | permissive | qiangzhouliang/Aria | 6ff78783605f0824738152024b3cc3702b095bc3 | 5f4df90f73ce65a0fed255ab6d152cca52431507 | refs/heads/master | 2020-03-26T08:21:03.833456 | 2018-07-24T13:46:14 | 2018-07-24T07:47:06 | 144,697,459 | 1 | 0 | null | 2018-08-14T09:18:36 | 2018-08-14T09:18:35 | null | UTF-8 | Java | false | false | 3,677 | java | package com.arialyy.simple.download;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.Toast;
import butterknife.OnClick;
import com.arialyy.annotations.Download;
import com.arialyy.aria.core.Aria;
import com.arialyy.aria.core.download.DownloadEntity;
import com.arialyy.aria.core.download.DownloadTask;
import com.arialyy.aria.util.CommonUtil;
import com.arialyy.frame.util.show.T;
import com.arialyy.simple.R;
import com.arialyy.simple.base.BaseDialog;
import com.arialyy.simple.databinding.DialogFragmentDownloadBinding;
/**
* Created by Aria.Lao on 2017/8/8.
*/
@SuppressLint("ValidFragment") public class DownloadDialogFragment
extends BaseDialog<DialogFragmentDownloadBinding> {
private static final String DOWNLOAD_URL =
"http://res3.d.cn/android/new/game/2/78702/fzjh_1499390260312.apk?f=web_1";
protected DownloadDialogFragment(Object obj) {
super(obj);
}
@Override protected void init(Bundle savedInstanceState) {
super.init(savedInstanceState);
Aria.download(getContext()).register();
DownloadEntity entity = Aria.download(getContext()).getDownloadEntity(DOWNLOAD_URL);
if (entity != null) {
getBinding().setFileSize(CommonUtil.formatFileSize(entity.getFileSize()));
getBinding().setProgress((int) (entity.getCurrentProgress() * 100 / entity.getFileSize()));
}
}
@Override protected int setLayoutId() {
return R.layout.dialog_fragment_download;
}
@Override public void onDestroy() {
super.onDestroy();
Aria.download(getContext()).unRegister();
}
@Download.onPre(DOWNLOAD_URL) protected void onPre(DownloadTask task) {
}
@Download.onTaskStart(DOWNLOAD_URL) void taskStart(DownloadTask task) {
getBinding().setFileSize(task.getConvertFileSize());
}
@Download.onTaskRunning(DOWNLOAD_URL) protected void running(DownloadTask task) {
long len = task.getFileSize();
if (len == 0) {
getBinding().setProgress(0);
} else {
getBinding().setProgress(task.getPercent());
}
getBinding().setSpeed(task.getConvertSpeed());
}
@Download.onTaskResume(DOWNLOAD_URL) void taskResume(DownloadTask task) {
}
@Download.onTaskStop(DOWNLOAD_URL) void taskStop(DownloadTask task) {
getBinding().setSpeed("");
}
@Download.onTaskCancel(DOWNLOAD_URL) void taskCancel(DownloadTask task) {
getBinding().setProgress(0);
Toast.makeText(getContext(), "取消下载", Toast.LENGTH_SHORT).show();
getBinding().setSpeed("");
}
@Download.onTaskFail(DOWNLOAD_URL) void taskFail(DownloadTask task) {
Toast.makeText(getContext(), "下载失败", Toast.LENGTH_SHORT).show();
}
@Download.onTaskComplete(DOWNLOAD_URL) void taskComplete(DownloadTask task) {
getBinding().setProgress(100);
Toast.makeText(getContext(), "下载完成", Toast.LENGTH_SHORT).show();
getBinding().setSpeed("");
}
@Download.onNoSupportBreakPoint(DOWNLOAD_URL)
public void onNoSupportBreakPoint(DownloadTask task) {
T.showShort(getContext(), "该下载链接不支持断点");
}
@OnClick({ R.id.start, R.id.stop, R.id.cancel }) public void onClick(View view) {
switch (view.getId()) {
case R.id.start:
Aria.download(getContext())
.load(DOWNLOAD_URL)
.setFilePath(Environment.getExternalStorageDirectory().getPath() + "/放置江湖.apk")
.start();
break;
case R.id.stop:
Aria.download(getContext()).load(DOWNLOAD_URL).stop();
break;
case R.id.cancel:
Aria.download(getContext()).load(DOWNLOAD_URL).cancel();
break;
}
}
}
| [
"511455842@qq.com"
] | 511455842@qq.com |
3dccc6d30fc63d9063323d4576ac45463ba2faca | 24e470b99ffb690318885facf392b732f4b428c0 | /design/src/main/java/parttern/bridge/example7/MessageEmail.java | 12ad328a46027ac67292813fe8e86614b5d4a896 | [] | no_license | siegluo/demo | 3fe247ca450c4d1343944317f077fd20f5242fee | 4a3eeec89bb5da95e94ed4db72f0812ee66d6dd4 | refs/heads/master | 2022-07-13T10:51:03.826126 | 2019-06-20T05:03:45 | 2019-06-20T05:03:45 | 142,255,539 | 76 | 10 | null | 2022-06-21T01:04:19 | 2018-07-25T06:13:10 | Java | GB18030 | Java | false | false | 273 | java | package parttern.bridge.example7;
/**
* 以Email的方式发送消息
*/
public class MessageEmail implements MessageImplementor{
public void send(String message, String toUser) {
System.out.println("使用Email的方式,发送消息'"+message+"'给"+toUser);
}
} | [
"jie.luo@Ctrip.com"
] | jie.luo@Ctrip.com |
63266550e9dcd24e221881b008e0e3d319ff8727 | 04b1803adb6653ecb7cb827c4f4aa616afacf629 | /third_party/android_29_sdk/public/sources/android-29/benchmarks/regression/SSLLoopbackBenchmark.java | f88c793d093fd2cabb7f5023d2b212cc8961dd03 | [
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | permissive | Samsung/Castanets | 240d9338e097b75b3f669604315b06f7cf129d64 | 4896f732fc747dfdcfcbac3d442f2d2d42df264a | refs/heads/castanets_76_dev | 2023-08-31T09:01:04.744346 | 2021-07-30T04:56:25 | 2021-08-11T05:45:21 | 125,484,161 | 58 | 49 | BSD-3-Clause | 2022-10-16T19:31:26 | 2018-03-16T08:07:37 | null | UTF-8 | Java | false | false | 1,272 | java | /*
* Copyright 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package benchmarks.regression;
import javax.net.ssl.SSLSocket;
import libcore.java.security.TestKeyStore;
import libcore.javax.net.ssl.TestSSLContext;
import libcore.javax.net.ssl.TestSSLSocketPair;
public class SSLLoopbackBenchmark {
public void time(int reps) throws Exception {
for (int i = 0; i < reps; ++i) {
TestSSLContext context = TestSSLContext.create(
TestKeyStore.getClient(), TestKeyStore.getServer());
SSLSocket[] sockets = TestSSLSocketPair.connect(context, null, null);
context.close();
sockets[0].close();
sockets[1].close();
}
}
}
| [
"sunny.nam@samsung.com"
] | sunny.nam@samsung.com |
ad03d0b683b85f799e268d406588c6817bd0fba7 | 65ebd9cc9b8ac76522f77c84b70fdc8b2c6d77e6 | /src/main/java/com/github/leetcode/easy/Leetcode572.java | ac522ea549be5ad7db1879b92be7c84c9c9b13b8 | [] | no_license | SlumDunk/leetcode | 30af765c7f5e61317983af43230bafa23362e25a | c242f13e7b3a3ea67cdd70f3d8b216e83bd65829 | refs/heads/master | 2021-08-20T01:58:11.309819 | 2021-07-25T17:07:10 | 2021-07-25T17:07:10 | 121,602,686 | 0 | 0 | null | 2020-11-08T03:34:35 | 2018-02-15T07:38:45 | Java | UTF-8 | Java | false | false | 2,459 | java | package com.github.leetcode.easy;
import com.github.leetcode.vo.TreeNode;
import java.util.Stack;
/**
* Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this node's descendants. The tree s could also be considered as a subtree of itself.
* <p>
* Example 1:
* Given tree s:
* <p>
* 3
* / \
* 4 5
* / \
* 1 2
* Given tree t:
* 4
* / \
* 1 2
* Return true, because t has the same structure and node values with a subtree of s.
* Example 2:
* Given tree s:
* <p>
* 3
* / \
* 4 5
* / \
* 1 2
* /
* 0
* Given tree t:
* 4
* / \
* 1 2
*/
public class Leetcode572 {
public static void main(String[] args) {
TreeNode s = new TreeNode(3);
TreeNode leftNode = new TreeNode(4);
TreeNode leftChildNode = new TreeNode(1);
TreeNode rightChildNode = new TreeNode(2);
TreeNode rlChildNode = new TreeNode(0);
rightChildNode.left = rlChildNode;
leftNode.left = leftChildNode;
leftNode.right = rightChildNode;
TreeNode rightNode = new TreeNode(5);
s.left = leftNode;
s.right = rightNode;
TreeNode t = new TreeNode(4);
TreeNode tLeftNode = new TreeNode(1);
TreeNode tRightNode = new TreeNode(2);
t.left = tLeftNode;
t.right = tRightNode;
Leetcode572 leetcode572 = new Leetcode572();
System.out.println(leetcode572.isSubtree(s, t));
}
public boolean isSubtree(TreeNode s, TreeNode t) {
//递归判断,是s的子树或是s左子树的子树或是s右子树的子树
if (s == null) {
return false;
}
//从当前节点出发找到子树
if (isSame(s, t)) {
return true;
}
//从左子节点出发寻找子树和从右子节点出发寻找子树
return isSubtree(s.left, t) || isSubtree(s.right, t);
}
/**
* 判断两棵树是否一样
*
* @param s
* @param t
* @return
*/
public boolean isSame(TreeNode s, TreeNode t) {
if (s == null && t == null) {
return true;
} else if (s == null || t == null) {
return false;
}
if (s.val != t.val) {
return false;
}
return isSame(s.left, t.left) && isSame(s.right, t.right);
}
}
| [
"1430701240@qq.com"
] | 1430701240@qq.com |
82cdd91863b1c34e83a9c850b1cf99019c7ce885 | 9a2ae525ca69e82a77152eb008dcf11b883b30eb | /vertx-auth-oauth2/src/main/java/io/vertx/ext/auth/oauth2/impl/flow/ClientImpl.java | 9007bf1946bf78c144dab58061fc646affe75124 | [
"Apache-2.0"
] | permissive | flashtony2005/vertx-auth | 372191647c24c7adabab051f12b54b291bc0c7a2 | 6259d240909a6e62c59ddd71605aa34ec8ff6ce7 | refs/heads/master | 2020-12-24T08:01:55.094436 | 2016-11-07T08:16:25 | 2016-11-07T08:16:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,952 | java | /*
* Copyright 2015 Red Hat, Inc.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
*
* The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* The Apache License v2.0 is available at
* http://www.opensource.org/licenses/apache2.0.php
*
* You may elect to redistribute this code under either of these licenses.
*/
package io.vertx.ext.auth.oauth2.impl.flow;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.auth.oauth2.AccessToken;
import io.vertx.ext.auth.oauth2.OAuth2ClientOptions;
import io.vertx.ext.auth.oauth2.impl.AccessTokenImpl;
import io.vertx.ext.auth.oauth2.impl.OAuth2AuthProviderImpl;
import static io.vertx.ext.auth.oauth2.impl.OAuth2API.*;
/**
* @author Paulo Lopes
*/
public class ClientImpl implements OAuth2Flow {
private final OAuth2AuthProviderImpl provider;
public ClientImpl(OAuth2AuthProviderImpl provider) {
this.provider = provider;
}
/**
* Returns the Access Token object.
*
* @param params - scope: A String that represents the application privileges.
* @param handler - The handler returning the results.
*/
@Override
public void getToken(JsonObject params, Handler<AsyncResult<AccessToken>> handler) {
final JsonObject query = params.copy();
query.put("grant_type", "client_credentials");
api(provider, HttpMethod.POST, provider.getConfig().getTokenPath(), query, res -> {
if (res.succeeded()) {
handler.handle(Future.succeededFuture(new AccessTokenImpl(provider, res.result())));
} else {
handler.handle(Future.failedFuture(res.cause()));
}
});
}
}
| [
"paulo@mlopes.net"
] | paulo@mlopes.net |
a0e29913a6935b0f507cb49dda3cba16d6c2ef30 | a4229f7a254dd0987acc13f10a72fb7fdcc37a5d | /src/main/java/com/yibo/datastructure/stack/LinkedListStack.java | 69b96b46b4f0f246efeeccaae5208f294616bb2c | [] | no_license | jjhyb/data-structure | 3221169e76768bfaa19a6821d6fb6c6d115b494c | e4878552898232953bca8d855eda930d5394dfcb | refs/heads/master | 2022-12-25T02:16:19.632811 | 2020-10-04T08:34:34 | 2020-10-04T08:34:34 | 301,078,766 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,171 | java | package com.yibo.datastructure.stack;
import com.yibo.datastructure.linkedlist.LinkedList;
/**
* @Author: huangyibo
* @Date: 2020/9/2023:47
* @Description:
*/
public class LinkedListStack<E> implements Stack<E> {
private LinkedList<E> list;
public LinkedListStack(){
list = new LinkedList();
}
public int getSize() {
return list.getSize();
}
public boolean isEmpty() {
return list.isEmpty();
}
public void push(E e) {
list.addFirst(e);
}
public E pop() {
return list.removeFirst();
}
public E peek() {
return list.getFirst();
}
@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Stack: top ");
stringBuilder.append(list);
return stringBuilder.toString();
}
public static void main(String[] args) {
LinkedListStack<Integer> stack = new LinkedListStack<Integer>();
for (int i = 0; i < 5; i++) {
stack.push(i);
System.out.println(stack);
}
stack.pop();
System.out.println(stack);
}
}
| [
"718649016@qq.com"
] | 718649016@qq.com |
7e0f20ea4aa1b5f96b2fdfcfc866d05069b01b31 | 6463bdbdbc9bfa31c79f6e5629aff878d8ab813c | /src/org/traccar/protocol/M2cProtocolDecoder.java | 67b2accb92b4119ad101493cb49c805d1dd4eb61 | [
"Apache-2.0"
] | permissive | maherkhalil07/traccar | d37334917f2980f72efb59580e753b276d720b42 | 54cbcf9acf0a6f99126562ae5e5dd72e91175b77 | refs/heads/master | 2023-07-08T09:00:35.768371 | 2018-06-14T04:33:40 | 2018-06-14T04:33:40 | 137,306,717 | 1 | 0 | Apache-2.0 | 2023-07-07T21:43:37 | 2018-06-14T04:38:15 | Java | UTF-8 | Java | false | false | 5,095 | java | /*
* Copyright 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.traccar.protocol;
import io.netty.channel.Channel;
import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.Parser;
import org.traccar.helper.PatternBuilder;
import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
import java.net.SocketAddress;
import java.util.LinkedList;
import java.util.List;
import java.util.regex.Pattern;
public class M2cProtocolDecoder extends BaseProtocolDecoder {
public M2cProtocolDecoder(M2cProtocol protocol) {
super(protocol);
}
private static final Pattern PATTERN = new PatternBuilder()
.text("#M2C,")
.expression("[^,]+,") // model
.expression("[^,]+,") // firmware
.number("d+,") // protocol
.number("(d+),") // imei
.number("(d+),") // index
.expression("([LH]),") // archive
.number("d+,") // priority
.number("(d+),") // event
.number("(dd)(dd)(dd),") // date (yymmdd)
.number("(dd)(dd)(dd),") // time (hhmmss)
.number("(-?d+.d+),") // latitude
.number("(-?d+.d+),") // longitude
.number("(-?d+),") // altitude
.number("(d+),") // course
.number("(d+.d+),") // speed
.number("(d+),") // satellites
.number("(d+),") // odometer
.number("(d+),") // input
.number("(d+),") // output
.number("(d+),") // power
.number("(d+),") // battery
.number("(d+),") // adc 1
.number("(d+),") // adc 2
.number("(d+.?d*),") // temperature
.any()
.compile();
private Position decodePosition(Channel channel, SocketAddress remoteAddress, String line) {
Parser parser = new Parser(PATTERN, line);
if (!parser.matches()) {
return null;
}
DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());
if (deviceSession == null) {
return null;
}
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
position.set(Position.KEY_INDEX, parser.nextInt());
if (parser.next().equals("H")) {
position.set(Position.KEY_ARCHIVE, true);
}
position.set(Position.KEY_EVENT, parser.nextInt());
position.setValid(true);
position.setTime(parser.nextDateTime());
position.setLatitude(parser.nextDouble());
position.setLongitude(parser.nextDouble());
position.setAltitude(parser.nextInt());
position.setCourse(parser.nextInt());
position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble()));
position.set(Position.KEY_SATELLITES, parser.nextInt());
position.set(Position.KEY_ODOMETER, parser.nextLong());
position.set(Position.KEY_INPUT, parser.nextInt());
position.set(Position.KEY_OUTPUT, parser.nextInt());
position.set(Position.KEY_POWER, parser.nextInt() * 0.001);
position.set(Position.KEY_BATTERY, parser.nextInt() * 0.001);
position.set(Position.PREFIX_ADC + 1, parser.nextInt());
position.set(Position.PREFIX_ADC + 2, parser.nextInt());
position.set(Position.PREFIX_TEMP + 1, parser.nextDouble());
return position;
}
@Override
protected Object decode(
Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {
String sentence = (String) msg;
sentence = sentence.substring(1); // remove start symbol
List<Position> positions = new LinkedList<>();
for (String line : sentence.split("\r\n")) {
if (!line.isEmpty()) {
Position position = decodePosition(channel, remoteAddress, line);
if (position != null) {
positions.add(position);
}
}
}
return positions;
}
}
| [
"anton.tananaev@gmail.com"
] | anton.tananaev@gmail.com |
5727275040cffdb743b69bb21f1d4a9d851f7a56 | 569d16bdf15c42955206f92c4e4ee238546836e1 | /core-api-spec/core-object-api/src/main/java/com/cyc/session/CycServerAddress.java | c2ad5b2358847bbfae9c8b562e6139681f8d0a41 | [
"Apache-2.0"
] | permissive | JimSow/api-suite | 09c767e4f062f0ac364ed665b462a0b2f309403e | c37ef37b5ce6357758963301aac08e9a5f60444b | refs/heads/master | 2021-01-12T02:36:09.013493 | 2016-01-27T02:35:29 | 2016-01-27T02:35:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,831 | java | /*
* Copyright 2015 Cycorp, 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 writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cyc.session;
/*
* #%L
* File: CycServerAddress.java
* Project: Core API Object Specification
* %%
* Copyright (C) 2013 - 2015 Cycorp, 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 writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import java.io.Serializable;
/**
* Describes the address of a Cyc server. This class encapsulates a Cyc server's host name, base
* port, and offset ports. It is easily serializable via its {@link #toString()} method to a string
* representation as <code>host:port</code>.
*
* @author nwinant
*/
public interface CycServerAddress extends Comparable, Serializable {
/**
* The server's host name
* @return host name, or null if unspecified.
*/
String getHostName();
/**
* The server's port number.
* @return port number, or null if unspecified.
*/
Integer getPort();
/**
* Returns the resolved hostname of this address. If the hostname is a loopback address (e.g.
* 127.0.0.1 or localhost), it will be converted to a fully-qualified domain-name. Otherwise, it
* will return the specified hostname as per {@link #getHostName()}.
*
* <p>Note that this value is <em>not</em> used by {@link #hashCode()} or {@link #equals(Object)}.
* Equality is based off of the explicitly-specified values.
*
* @return <code>String</code> the resolved hostname.
*/
String getResolvedHostName();
/**
* The Cyc server's base port number.
* @return port number, or null if unspecified.
*/
Integer getBasePort();
/**
* The Cyc server's binary (CFASL) communications port number.
* @return port number.
*/
Integer getCfaslPort();
/**
* The Cyc server's SubL HTTP server port number.
* @return port number.
*/
Integer getHttpPort();
/**
* The Cyc server's Servlet HTTP server port number.
* @return port number.
*/
Integer getServletPort();
/**
* Checks whether the CycServerAddress instance contains enough information to be useful
* (i.e., a plausible hostname and base port.)
* @return whether CycServerAddress is plausibly useful.
*/
boolean isDefined();
/**
* Returns a string representation of the server address <em>using the resolved hostname,</em> in
* the format <code>host:port</code>. In other words, this methods behaves like
* {@link #toString()}, but retrieves the hostname via {@link #getResolvedHostName()}.
*
* @return a string representation of the server address, using the resolved hostname.
*/
String toResolvedAddressString();
/**
* Returns a string representation of the server address in the format <code>host:port</code>.
*
* @return a string representation of the server address.
*/
@Override
String toString();
}
| [
"nw@exegetic.net"
] | nw@exegetic.net |
3c14b61603a92831d42d652744e9cdd8b9481a52 | 583f294ceaa05aa216f3ad773bb126af29e76c9c | /page2/src/main/java/net/skhu/model/Pagination.java | 263bd1b4472332f4dc0d093b61407cfa0db88fd8 | [] | no_license | KimJye/spring_practice | da271c485a8c793092b90e703f925dbcd40f11b6 | 4289d3483c3002289bc88eec50b139dda52c4ce2 | refs/heads/master | 2022-12-22T06:30:01.437846 | 2020-01-13T07:36:27 | 2020-01-13T07:36:27 | 134,680,895 | 0 | 0 | null | 2022-12-16T08:57:40 | 2018-05-24T07:52:27 | JavaScript | UTF-8 | Java | false | false | 651 | java | package net.skhu.model;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import lombok.Data;
@Data
public class Pagination {
int bd; //boardId
int pg=1; //현재 페이지
int sz=15; //페이지당 레코드 수
int sb; //searchBy
String st; //searchText
int ob; //orderby
int di=0; //departmentId
int recordCount;
public String getQueryString() {
String url = null;
try {
String temp = (st == null) ? "" : URLEncoder.encode(st, "UTF-8");
url = String.format("bd=%d&pg=%d&sz=%d&ob=%d&sb=%d&st=%s", bd, pg, sz, ob, sb, temp);
}
catch (UnsupportedEncodingException e) { }
return url;
}
}
| [
"eoeogudgud@naver.com"
] | eoeogudgud@naver.com |
17b9c5503e1618e2ad61df75c4f790968e878d84 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module1921_public/tests/unittests/src/java/module1921_public_tests_unittests/a/Foo0.java | 07cb8e13f7762d35da72ab63f7a409a91f5e0cc9 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,271 | java | package module1921_public_tests_unittests.a;
import java.io.*;
import java.rmi.*;
import java.nio.file.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.nio.file.FileStore
* @see java.sql.Array
* @see java.util.logging.Filter
*/
@SuppressWarnings("all")
public abstract class Foo0<E> implements module1921_public_tests_unittests.a.IFoo0<E> {
java.util.zip.Deflater f0 = null;
javax.annotation.processing.Completion f1 = null;
javax.lang.model.AnnotatedConstruct f2 = null;
public E element;
public static Foo0 instance;
public static Foo0 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return null;
}
public String getName() {
return element.toString();
}
public void setName(String string) {
return;
}
public E get() {
return element;
}
public void set(Object element) {
this.element = (E)element;
}
public E call() throws Exception {
return (E)getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
ea455f78d165e0e0f2fa5db82cf99d4a2f9d98a0 | 0735d7bb62b6cfb538985a278b77917685de3526 | /com/askgps/personaltrackercore/ui/leftscreen/LeftScreenFragment.java | d538ad2bc9ee2780bac3bf114298476efa50a790 | [] | no_license | Denoah/personaltrackerround | e18ceaad910f1393f2dd9f21e9055148cda57837 | b38493ccc7efff32c3de8fe61704e767e5ac62b7 | refs/heads/master | 2021-05-20T03:34:17.333532 | 2020-04-02T14:47:31 | 2020-04-02T14:51:01 | 252,166,069 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 4,512 | java | package com.askgps.personaltrackercore.ui.leftscreen;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.ViewModelProvider;
import androidx.lifecycle.ViewModelProviders;
import com.askgps.personaltrackercore.R.id;
import com.askgps.personaltrackercore.R.layout;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import org.koin.android.ext.android.ComponentCallbackExtKt;
import org.koin.core.Koin;
import org.koin.core.qualifier.Qualifier;
import org.koin.core.qualifier.QualifierKt;
import org.koin.core.registry.ScopeRegistry;
import org.koin.core.scope.Scope;
@Metadata(bv={1, 0, 3}, d1={"\0002\n\002\030\002\n\002\030\002\n\002\b\002\n\002\030\002\n\000\n\002\020\002\n\000\n\002\030\002\n\000\n\002\030\002\n\000\n\002\030\002\n\000\n\002\030\002\n\002\b\002\030\000 \0172\0020\001:\001\017B\005?\006\002\020\002J\022\020\005\032\0020\0062\b\020\007\032\004\030\0010\bH\026J&\020\t\032\004\030\0010\n2\006\020\013\032\0020\f2\b\020\r\032\004\030\0010\0162\b\020\007\032\004\030\0010\bH\026R\016\020\003\032\0020\004X?.?\006\002\n\000?\006\020"}, d2={"Lcom/askgps/personaltrackercore/ui/leftscreen/LeftScreenFragment;", "Landroidx/fragment/app/Fragment;", "()V", "viewModel", "Lcom/askgps/personaltrackercore/ui/leftscreen/LeftScreenViewModel;", "onActivityCreated", "", "savedInstanceState", "Landroid/os/Bundle;", "onCreateView", "Landroid/view/View;", "inflater", "Landroid/view/LayoutInflater;", "container", "Landroid/view/ViewGroup;", "Companion", "personaltrackercore_release"}, k=1, mv={1, 1, 16})
public final class LeftScreenFragment
extends Fragment
{
public static final Companion Companion = new Companion(null);
private HashMap _$_findViewCache;
private LeftScreenViewModel viewModel;
public LeftScreenFragment() {}
public void _$_clearFindViewByIdCache()
{
HashMap localHashMap = this._$_findViewCache;
if (localHashMap != null) {
localHashMap.clear();
}
}
public View _$_findCachedViewById(int paramInt)
{
if (this._$_findViewCache == null) {
this._$_findViewCache = new HashMap();
}
View localView1 = (View)this._$_findViewCache.get(Integer.valueOf(paramInt));
View localView2 = localView1;
if (localView1 == null)
{
localView2 = getView();
if (localView2 == null) {
return null;
}
localView2 = localView2.findViewById(paramInt);
this._$_findViewCache.put(Integer.valueOf(paramInt), localView2);
}
return localView2;
}
public void onActivityCreated(Bundle paramBundle)
{
super.onActivityCreated(paramBundle);
paramBundle = ViewModelProviders.of((Fragment)this).get(LeftScreenViewModel.class);
Intrinsics.checkExpressionValueIsNotNull(paramBundle, "ViewModelProviders.of(th…eenViewModel::class.java)");
this.viewModel = ((LeftScreenViewModel)paramBundle);
paramBundle = getChildFragmentManager().beginTransaction();
int i = R.id.leftScreen_frame_container;
Qualifier localQualifier = (Qualifier)QualifierKt.named("mainFragment");
Function0 localFunction0 = (Function0)null;
paramBundle.replace(i, (Fragment)ComponentCallbackExtKt.getKoin(this).get_scopeRegistry().getRootScope().get(Reflection.getOrCreateKotlinClass(Fragment.class), localQualifier, localFunction0)).commit();
}
public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
{
Intrinsics.checkParameterIsNotNull(paramLayoutInflater, "inflater");
return paramLayoutInflater.inflate(R.layout.left_screen_fragment, paramViewGroup, false);
}
@Metadata(bv={1, 0, 3}, d1={"\000\022\n\002\030\002\n\002\020\000\n\002\b\002\n\002\030\002\n\000\b?\003\030\0002\0020\001B\007\b\002?\006\002\020\002J\006\020\003\032\0020\004?\006\005"}, d2={"Lcom/askgps/personaltrackercore/ui/leftscreen/LeftScreenFragment$Companion;", "", "()V", "newInstance", "Lcom/askgps/personaltrackercore/ui/leftscreen/LeftScreenFragment;", "personaltrackercore_release"}, k=1, mv={1, 1, 16})
public static final class Companion
{
private Companion() {}
public final LeftScreenFragment newInstance()
{
return new LeftScreenFragment();
}
}
}
| [
"ivanov.a@i-teco.ru"
] | ivanov.a@i-teco.ru |
41ee668604928220ec076a4360fd8cc985d2e496 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Spring/Spring8878.java | 72a1b1cde836e5e4f1f98ada8292f6025a1a5ed9 | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 400 | java | @Override
public String toString() {
StringBuilder result = getAttributeDescription();
if (this.rollbackRules != null) {
for (RollbackRuleAttribute rule : this.rollbackRules) {
String sign = (rule instanceof NoRollbackRuleAttribute ? PREFIX_COMMIT_RULE : PREFIX_ROLLBACK_RULE);
result.append(',').append(sign).append(rule.getExceptionName());
}
}
return result.toString();
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
cbd527a00023276db161287555156aa9d7387a82 | 2c6779da37c4f480cefb3f9bf69390cbc57650de | /src/amata1219/beta/parkour/course/ConnectionSet.java | a3c61db070af13741f00c4b1dbf72880ec2d355f | [] | no_license | csu-xiao-an/Parkour | d903d8ee03a2922f2499e6655f8d1bcf9b585404 | 1d3792088ce2669079b390ba2525a0496e8a969b | refs/heads/master | 2020-07-27T05:15:55.329979 | 2019-09-16T12:15:52 | 2019-09-16T12:15:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 869 | java | package amata1219.beta.parkour.course;
import java.util.HashMap;
import java.util.UUID;
import java.util.function.Consumer;
import org.bukkit.craftbukkit.v1_13_R2.entity.CraftPlayer;
import org.bukkit.entity.Player;
import net.minecraft.server.v1_13_R2.PlayerConnection;
public class ConnectionSet {
private final HashMap<UUID, PlayerConnection> connections = new HashMap<>();
public boolean isEmpty(){
return connections.isEmpty();
}
public boolean contains(Player player){
return connections.containsKey(player);
}
public void add(Player player){
connections.put(player.getUniqueId(), ((CraftPlayer) player).getHandle().playerConnection);
}
public void remove(Player player){
connections.remove(player.getUniqueId());
}
public void runForTraceurConnections(Consumer<PlayerConnection> action){
connections.values().forEach(action);
}
}
| [
"suzukiamata@gmail.com"
] | suzukiamata@gmail.com |
786e36f04c5cd0cc488634619b5a5bea0fda553c | 7559bead0c8a6ad16f016094ea821a62df31348a | /src/com/vmware/vim25/VspanPortPromiscChangeFault.java | 22a6e14d120b5f5e22fabe28602f9ea9fa55bda1 | [] | no_license | ZhaoxuepengS/VsphereTest | 09ba2af6f0a02d673feb9579daf14e82b7317c36 | 59ddb972ce666534bf58d84322d8547ad3493b6e | refs/heads/master | 2021-07-21T13:03:32.346381 | 2017-11-01T12:30:18 | 2017-11-01T12:30:18 | 109,128,993 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,456 | java |
package com.vmware.vim25;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for VspanPortPromiscChangeFault complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="VspanPortPromiscChangeFault">
* <complexContent>
* <extension base="{urn:vim25}DvsFault">
* <sequence>
* <element name="portKey" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VspanPortPromiscChangeFault", propOrder = {
"portKey"
})
public class VspanPortPromiscChangeFault
extends DvsFault
{
@XmlElement(required = true)
protected String portKey;
/**
* Gets the value of the portKey property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPortKey() {
return portKey;
}
/**
* Sets the value of the portKey property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPortKey(String value) {
this.portKey = value;
}
}
| [
"495149700@qq.com"
] | 495149700@qq.com |
70631a36922207038e681d1606ea75d039eabed4 | b31120cefe3991a960833a21ed54d4e10770bc53 | /modules/org.clang.ast/src/org/clang/ast/ast_type_traits/KindToKindIdOMPSimdDirective.java | 5afc49af0429f5962c643588ae6a39fb5f472ec9 | [] | no_license | JianpingZeng/clank | 94581710bd89caffcdba6ecb502e4fdb0098caaa | bcdf3389cd57185995f9ee9c101a4dfd97145442 | refs/heads/master | 2020-11-30T05:36:06.401287 | 2017-10-26T14:15:27 | 2017-10-26T14:15:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,626 | java | /**
* This file was converted to Java from the original LLVM source file. The original
* source file follows the LLVM Release License, outlined below.
*
* ==============================================================================
* LLVM Release License
* ==============================================================================
* University of Illinois/NCSA
* Open Source License
*
* Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign.
* All rights reserved.
*
* Developed by:
*
* LLVM Team
*
* University of Illinois at Urbana-Champaign
*
* http://llvm.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal with
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is furnished to do
* so, subject to the following conditions:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimers.
*
* * Redistributions in binary form must reproduce the above copyright notice
* this list of conditions and the following disclaimers in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the names of the LLVM Team, University of Illinois at
* Urbana-Champaign, nor the names of its contributors may be used to
* endorse or promote products derived from this Software without specific
* prior written permission.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
* SOFTWARE.
*
* ==============================================================================
* Copyrights and Licenses for Third Party Software Distributed with LLVM:
* ==============================================================================
* The LLVM software contains code written by third parties. Such software will
* have its own individual LICENSE.TXT file in the directory in which it appears.
* This file will describe the copyrights, license, and restrictions which apply
* to that code.
*
* The disclaimer of warranty in the University of Illinois Open Source License
* applies to all code in the LLVM Distribution, and nothing in any of the
* other licenses gives permission to use the names of the LLVM Team or the
* University of Illinois to endorse or promote products derived from this
* Software.
*
* The following pieces of software have additional or alternate copyrights,
* licenses, and/or restrictions:
*
* Program Directory
* ------- ---------
* Autoconf llvm/autoconf
* llvm/projects/ModuleMaker/autoconf
* Google Test llvm/utils/unittest/googletest
* OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex}
* pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT}
* ARM contributions llvm/lib/Target/ARM/LICENSE.TXT
* md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h
*/
package org.clang.ast.ast_type_traits;
import org.clank.support.*;
import static org.clang.ast.ast_type_traits.ASTNodeKind.*;
//<editor-fold defaultstate="collapsed" desc="clang::ast_type_traits::ASTNodeKind::KindToKindId<clang::OMPSimdDirective>">
@Converted(kind = Converted.Kind.AUTO,
source = "${LLVM_SRC}/build/tools/clang/include/clang/AST/StmtNodes.inc", line = 953,
FQN="clang::ast_type_traits::ASTNodeKind::KindToKindId<clang::OMPSimdDirective>", NM="_ZN5clang15ast_type_traits11ASTNodeKind12KindToKindIdINS_16OMPSimdDirectiveEEE",
cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.clang.ast/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/AST/Stmt.cpp -nm=_ZN5clang15ast_type_traits11ASTNodeKind12KindToKindIdINS_16OMPSimdDirectiveEEE")
//</editor-fold>
public class/*struct*/ KindToKindIdOMPSimdDirective {
public static /*const*/ NodeKindId Id = NodeKindId.NKI_OMPSimdDirective;
@Override public String toString() {
return ""; // NOI18N
}
}
| [
"voskresensky.vladimir@gmail.com"
] | voskresensky.vladimir@gmail.com |
fcad1ce637929ac1e8e0123339f2f5b37acc8031 | 9130936997221c74d94de9d4aaff5b136b6c00c8 | /completed-order-service/src/main/java/de/stea1th/completedorderservice/config/SecurityConfig.java | 02b5ab3f70be843e704f452f6a6dfcefe4ab6756 | [] | no_license | stea1th/pizza-online | e7009c494453c35d99725b8ddae94ebff0433bca | 64f6aa9bff0bdc1792e61d39c6481edafc903d7f | refs/heads/master | 2023-01-12T05:21:44.001523 | 2020-07-30T07:44:08 | 2020-07-30T07:44:08 | 234,063,319 | 0 | 2 | null | 2023-01-07T14:30:33 | 2020-01-15T11:15:10 | Java | UTF-8 | Java | false | false | 3,478 | java | package de.stea1th.completedorderservice.config;
import org.keycloak.adapters.springsecurity.authentication.KeycloakAuthenticationProvider;
import org.keycloak.adapters.springsecurity.config.KeycloakWebSecurityConfigurerAdapter;
import org.keycloak.adapters.springsecurity.filter.KeycloakAuthenticationProcessingFilter;
import org.keycloak.adapters.springsecurity.filter.KeycloakPreAuthActionsFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.core.authority.mapping.SimpleAuthorityMapper;
import org.springframework.security.core.session.SessionRegistryImpl;
import org.springframework.security.web.authentication.session.RegisterSessionAuthenticationStrategy;
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
@Configuration
@EnableWebSecurity
public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
/**
* Register Keycloak as the Authentication Provider
*/
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) {
SimpleAuthorityMapper grantedAuthorityMapper = new SimpleAuthorityMapper();
grantedAuthorityMapper.setPrefix("ROLE_");
grantedAuthorityMapper.setConvertToUpperCase(true);
KeycloakAuthenticationProvider keycloakAuthenticationProvider = keycloakAuthenticationProvider();
keycloakAuthenticationProvider.setGrantedAuthoritiesMapper(grantedAuthorityMapper);
auth.authenticationProvider(keycloakAuthenticationProvider);
}
// /**
// * Registers the KeycloakAuthenticationProvider with the authentication
// * manager.
// */
// @Autowired
// public void configureGlobal(AuthenticationManagerBuilder auth) {
// auth.authenticationProvider(keycloakAuthenticationProvider());
// }
@Override
protected void configure(HttpSecurity http) throws Exception {
super.configure(http);
http.authorizeRequests()
.antMatchers("/api/**")
.authenticated();
// .hasAnyRole("pizza_admin", "pizza_member")
// .anyRequest().permitAll();
http.csrf().disable();
}
@Bean
@Override
protected SessionAuthenticationStrategy sessionAuthenticationStrategy() {
return new RegisterSessionAuthenticationStrategy(new SessionRegistryImpl());
}
@Bean
public FilterRegistrationBean keycloakAuthenticationProcessingFilterRegistrationBean(KeycloakAuthenticationProcessingFilter filter) {
FilterRegistrationBean registrationBean = new FilterRegistrationBean(filter);
registrationBean.setEnabled(false);
return registrationBean;
}
@Bean
public FilterRegistrationBean keycloakPreAuthActionsFilterRegistrationBean(KeycloakPreAuthActionsFilter filter) {
FilterRegistrationBean registrationBean = new FilterRegistrationBean(filter);
registrationBean.setEnabled(false);
return registrationBean;
}
}
| [
"stea1th@mail.ru"
] | stea1th@mail.ru |
b1c8ca14d0de331a2fdcf872493c7615391f2db7 | e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3 | /src/chosun/ciis/sp/sal/ds/SP_SAL_2270_ADataSet.java | b3ad69b8d7a1df340f777621e6d70410951edf3c | [] | no_license | nosmoon/misdevteam | 4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60 | 1829d5bd489eb6dd307ca244f0e183a31a1de773 | refs/heads/master | 2020-04-15T15:57:05.480056 | 2019-01-10T01:12:01 | 2019-01-10T01:12:01 | 164,812,547 | 1 | 0 | null | null | null | null | UHC | Java | false | false | 2,679 | java | /***************************************************************************************************
* 파일명 : .java
* 기능 : 독자우대-구독신청
* 작성일자 : 2007-05-22
* 작성자 : 김대섭
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.sp.sal.ds;
import java.sql.*;
import java.util.*;
import somo.framework.db.*;
import somo.framework.util.*;
import chosun.ciis.sp.sal.dm.*;
import chosun.ciis.sp.sal.rec.*;
/**
*
*/
public class SP_SAL_2270_ADataSet extends somo.framework.db.BaseDataSet implements java.io.Serializable{
public String errcode;
public String errmsg;
public SP_SAL_2270_ADataSet(){}
public SP_SAL_2270_ADataSet(String errcode, String errmsg){
this.errcode = errcode;
this.errmsg = errmsg;
}
public void setErrcode(String errcode){
this.errcode = errcode;
}
public void setErrmsg(String errmsg){
this.errmsg = errmsg;
}
public String getErrcode(){
return this.errcode;
}
public String getErrmsg(){
return this.errmsg;
}
public void getValues(CallableStatement cstmt) throws SQLException{
this.errcode = Util.checkString(cstmt.getString(1));
this.errmsg = Util.checkString(cstmt.getString(2));
}
}/*----------------------------------------------------------------------------------------------------
Web Tier에서 DataSet 객체 관련 코드 작성시 사용하십시오.
<%
SP_SAL_2270_ADataSet ds = (SP_SAL_2270_ADataSet)request.getAttribute("ds");
%>
Web Tier에서 Record 객체 관련 코드 작성시 사용하십시오.
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 DataSet 객체의 <%= %> 작성시 사용하십시오.
<%= ds.getErrcode()%>
<%= ds.getErrmsg()%>
----------------------------------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------------------------------
Web Tier에서 Record 객체의 <%= %> 작성시 사용하십시오.
----------------------------------------------------------------------------------------------------*/
/* 작성시간 : Wed Jul 11 16:22:34 KST 2012 */ | [
"DLCOM000@172.16.30.11"
] | DLCOM000@172.16.30.11 |
a9e68df6dee0449f06b234e4c8d9ec5031e211ea | 46167791cbfeebc8d3ddc97112764d7947fffa22 | /spring-boot/src/main/java/com/justexample/repository/Entity1847Repository.java | e5bc184681bb8aff69dd06287e8ddbc76c1043a0 | [] | no_license | kahlai/unrealistictest | 4f668b4822a25b4c1f06c6b543a26506bb1f8870 | fe30034b05f5aacd0ef69523479ae721e234995c | refs/heads/master | 2023-08-25T09:32:16.059555 | 2021-11-09T08:17:22 | 2021-11-09T08:17:22 | 425,726,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 252 | java | package com.justexample.repository;
import java.util.List;
import com.justexample.entity.Entity1847;
import org.springframework.data.jpa.repository.JpaRepository;
public interface Entity1847Repository extends JpaRepository<Entity1847,Long>{
}
| [
"laikahhoe@gmail.com"
] | laikahhoe@gmail.com |
d2145b011cd9aaace0cac0360bdd6c32beb4a09c | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_564b8f7f705b891f11fc7ac568761a3fc94da189/ConcurrentArrayHashMap/9_564b8f7f705b891f11fc7ac568761a3fc94da189_ConcurrentArrayHashMap_s.java | 8f5e19582888833ac350bf387e91461ad06ac970 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,997 | java | package org.cocos2d.utils.collections;
import java.util.ArrayList;
import java.util.HashMap;
import org.cocos2d.utils.pool.OneClassPool;
/**
* This class is temporary replacement of ConcurrentHashMap<K,V> for frequently
* iterating through values. See firstValue, nextValue methods.
* Do not use this outside, this is not optimized.
* Put into HashMap still causes new Entry, but iteration is done without call to values().
*
* Also contains only put, get, remove methods.
* @author genius
*/
public class ConcurrentArrayHashMap<K,V> {
private ArrayList<Entry> array;
private HashMap<K,Integer> map;
OneClassPool<Entry> pool = new OneClassPool<Entry>() {
@Override
protected Entry allocate() {
return new Entry();
}
};
public final class Entry {
K key;
V value;
Entry next;
public V getValue() {
return value;
}
}
public ConcurrentArrayHashMap() {
array = new ArrayList<Entry>();
map = new HashMap<K,Integer>();
}
public synchronized void put(K key, V value) {
Integer pos = map.get(key);
if(pos == null) {
int ind = array.size();
Entry entry = pool.get();
entry.key = key;
entry.value = value;
array.add(entry);
if(ind > 0) {
array.get(ind - 1).next = entry;
}
map.put(key, ind);
} else {
array.get(pos.intValue()).value = value;
}
}
public synchronized V get(K key) {
Integer ind = map.get(key);
if ( ind == null )
return null;
return array.get(ind.intValue()).value;
}
public synchronized V remove(K key) {
Integer ind = map.get(key);
if ( ind == null )
return null;
map.remove(key);
int curInd = ind.intValue();
int lastInd = array.size()-1;
V ret = array.get(curInd).value;
if(curInd != lastInd) {
// swap values
K lastKey = array.get(lastInd).key;
array.get(curInd).value = array.get(lastInd).value;
array.get(curInd).key = lastKey;
map.put(lastKey, ind);
}
// remove last now
if(lastInd != 0)
array.get(lastInd - 1).next = null;
Entry removedEntry = array.remove(lastInd);
pool.free(removedEntry);
return ret;
}
/**
* First value Entry is returned.
*
* Iteration is organized in this manner:
* Iteration is organized in this manner:
* for(ConcurrentArrayHashMap<K, V>.Entry e = targets.firstValue();
* e != null; e = targets.nextValue(e)) {
* V element = e.getValue();
*/
public synchronized Entry firstValue() {
if (array.isEmpty())
return null;
else {
return array.get(0);
}
}
/**
* Next Entry with not null value is returned.
*
* Iteration is organized in this manner:
* for(ConcurrentArrayHashMap<K, V>.Entry e = targets.firstValue();
* e != null; e = targets.nextValue(e)) {
* V element = e.getValue();
*/
public synchronized Entry nextValue(Entry prev) {
return prev.next;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
31d7424a5a43003da1c6b3b699457cd4efdc9653 | b70bac75648dfbb8eb551bed9b3490ff3c5661aa | /free_chat_auth2/src/main/java/com/chat/auth/UcenterAuthApplication.java | 0f8894d324ed77d07e53a9abda112475a808f269 | [] | no_license | ldywork/freechatServer | 8ac92006c684597018ab97442e7f56c9fba78e60 | 8fb0968b5cfbb452afd902d22605c9470225cf18 | refs/heads/master | 2023-02-24T16:25:05.068486 | 2021-01-26T05:35:10 | 2021-01-26T05:35:10 | 305,970,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 939 | java | package com.chat.auth;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@EnableDiscoveryClient
@EnableFeignClients
@SpringBootApplication
public class UcenterAuthApplication {
public static void main(String[] args) {
SpringApplication.run(UcenterAuthApplication.class, args);
}
@Bean
public RestTemplate restTemplate() {
return new RestTemplate(new OkHttp3ClientHttpRequestFactory());
}
}
| [
"ldylife@163.com"
] | ldylife@163.com |
7936c4313fdf7364b607839a26ac1fd302ffc51b | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/webview/ui/tools/widget/q$$ExternalSyntheticLambda8.java | 8d0bdd557efac5f00fd841bb3c06000b5b80d54f | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 526 | java | package com.tencent.mm.plugin.webview.ui.tools.widget;
import com.tencent.mm.am.c;
import com.tencent.mm.ipcinvoker.wx_extension.IPCRunCgi.a;
public final class q$$ExternalSyntheticLambda8
implements IPCRunCgi.a
{
public final void callback(int arg1, int arg2, String arg3, c arg4) {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar
* Qualified Name: com.tencent.mm.plugin.webview.ui.tools.widget.q..ExternalSyntheticLambda8
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
1e3aa75ccaeb6602517d07a4e4b49dea30a29fa9 | 0f8334abf0fdeb7cde1aacb4895ec6ae8c5c1951 | /modules/cms-core/cms-core-service/src/main/java/vn/gov/hoabinh/service/impl/VcmsDiscussionLocalServiceImpl.java | b7c948ce5fa1650cec5beccba800bf1459e6232b | [] | no_license | nguyenvanthuyfpt/hoabinhportal | 5e77f9b150d34eb58c1378e7bf79d67f803d42cb | af43ac917ea31c015459a63038d61924aed0e093 | refs/heads/main | 2023-03-26T01:41:07.541639 | 2021-03-23T06:44:00 | 2021-03-23T06:44:00 | 344,445,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,456 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package vn.gov.hoabinh.service.impl;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.portlet.ActionRequest;
import com.liferay.counter.kernel.service.CounterLocalServiceUtil;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.Validator;
import aQute.bnd.annotation.ProviderType;
import vn.gov.hoabinh.exception.NoSuchVcmsDiscussionException;
import vn.gov.hoabinh.model.VcmsDiscussion;
import vn.gov.hoabinh.service.base.VcmsDiscussionLocalServiceBaseImpl;
/**
* The implementation of the vcms discussion local service.
*
* <p>
* All custom service methods should be put in this class. Whenever methods are
* added, rerun ServiceBuilder to copy their definitions into the
* {@link vn.gov.hoabinh.service.VcmsDiscussionLocalService} interface.
*
* <p>
* This is a local service. Methods of this service will not have security
* checks based on the propagated JAAS credentials because this service can only
* be accessed from within the same VM.
* </p>
*
* @author Brian Wing Shun Chan
* @see VcmsDiscussionLocalServiceBaseImpl
* @see vn.gov.hoabinh.service.VcmsDiscussionLocalServiceUtil
*/
@ProviderType
public class VcmsDiscussionLocalServiceImpl extends VcmsDiscussionLocalServiceBaseImpl {
/*
* NOTE FOR DEVELOPERS:
*
* Never reference this class directly. Always use {@link
* vn.gov.hoabinh.service.VcmsDiscussionLocalServiceUtil} to access the vcms
* discussion local service.
*/
public VcmsDiscussion addDiscussion(String visitorName, String visitorEmail, String visitorPhone,
long groupId, long companyId, String articleId, String title, String content, boolean hasAttachment,
String language) throws PortalException, SystemException, RemoteException {
String discussionId = Long.toString(CounterLocalServiceUtil.increment(VcmsDiscussion.class.getName()));
VcmsDiscussion discussion = vcmsDiscussionPersistence.create(discussionId);
discussion.setVisitorName(visitorName);
discussion.setVisitorEmail(visitorEmail);
discussion.setVisitorPhone(visitorPhone);
discussion.setGroupId(groupId);
discussion.setCompanyId(companyId);
discussion.setArticleId(articleId);
discussion.setTitle(title);
discussion.setContent(content);
discussion.setLanguage(language);
discussion.setApproved(false);
discussion.setApprovedByUser(null);
discussion.setApprovedDate(null);
discussion.setPostedDate(new Date());
discussion.setHasAttachment(hasAttachment);
vcmsDiscussionPersistence.update(discussion);
return discussion;
}
public VcmsDiscussion updateDiscussion(String discussionId, String visitorName, String visitorEmail,
String visitorPhone, long groupId, long companyId, String articleId, String title, String content,
boolean hasAttachment, boolean approved, String language)
throws PortalException, SystemException, RemoteException {
VcmsDiscussion discussion = vcmsDiscussionPersistence.findByPrimaryKey(discussionId);
Date now = new Date();
discussion.setVisitorName(visitorName);
discussion.setVisitorEmail(visitorEmail);
discussion.setVisitorPhone(visitorPhone);
discussion.setGroupId(groupId);
discussion.setCompanyId(companyId);
discussion.setArticleId(articleId);
discussion.setTitle(title);
discussion.setContent(content);
discussion.setPostedDate(now);
discussion.setHasAttachment(hasAttachment);
discussion.setLanguage(language);
vcmsDiscussionPersistence.update(discussion);
return discussion;
}
public void deleteDiscussions(String articleId) throws PortalException, SystemException, RemoteException {
if (Validator.isNull(articleId)) {
return;
}
vcmsDiscussionPersistence.removeByArticle(articleId);
}
public void deleteDiscussions(String articleId, boolean approved)
throws PortalException, SystemException, RemoteException {
if (Validator.isNull(articleId)) {
return;
}
vcmsDiscussionPersistence.removeByA_A(articleId, approved);
}
public VcmsDiscussion getDiscussion(String discussionId) throws PortalException, SystemException, RemoteException {
if (Validator.isNull(discussionId)) {
throw new NoSuchVcmsDiscussionException();
}
return vcmsDiscussionPersistence.findByPrimaryKey(discussionId);
}
public List<VcmsDiscussion> getDiscussions(String articleId)
throws PortalException, SystemException, RemoteException {
if (Validator.isNull(articleId)) {
return new ArrayList();
}
return vcmsDiscussionPersistence.findByArticle(articleId);
}
public List<VcmsDiscussion> getDiscussions(String articleId, boolean approved)
throws PortalException, SystemException, RemoteException {
if (Validator.isNull(articleId)) {
return new ArrayList();
}
return vcmsDiscussionPersistence.findByA_A(articleId, approved);
}
public List<VcmsDiscussion> getDiscussionsByP_L(long groupId, String language)
throws PortalException, SystemException, RemoteException {
return vcmsDiscussionPersistence.findByP_L(groupId, language);
}
public List<VcmsDiscussion> getDiscussionsByP_L_A(long groupId, String language, boolean approved)
throws PortalException, SystemException, RemoteException {
return vcmsDiscussionPersistence.findByP_L_A(groupId, language, approved);
}
public List<VcmsDiscussion> getDiscussionsByA_P_L_A(String articleId, long groupId, String language,
boolean approved) throws PortalException, SystemException, RemoteException {
return vcmsDiscussionPersistence.findByA_P_L_A(articleId, groupId, language, approved);
}
public int countByApproval(long groupId, String language, boolean approved)
throws PortalException, SystemException, RemoteException {
return vcmsDiscussionPersistence.countByP_L_A(groupId, language, approved);
}
} | [
"thuy.nguyenvan@dtt.vn"
] | thuy.nguyenvan@dtt.vn |
cb685c5e1b9b86d7201dad7399d6005bd3c437c4 | 62cc557b43fb928a16f70b01bd83f45429b1103c | /transformation/common/src/main/java/org/jboss/mapper/camel/blueprint/BindyType.java | 452af9200aad628ed7f835540308841e3e85b3ab | [] | no_license | cominvent/fuseide | f40ab291aad7ec7f063659406e019bc4a1b17183 | 6fe7f077743db39a8c7b8e8c0ee1e3b8cac1edaa | refs/heads/master | 2021-01-18T18:48:17.542452 | 2015-03-05T14:00:25 | 2015-03-05T14:04:25 | 31,892,473 | 0 | 1 | null | 2015-03-09T10:38:39 | 2015-03-09T10:38:39 | null | UTF-8 | Java | false | false | 1,541 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.02.13 at 12:09:41 PM EST
//
package org.jboss.mapper.camel.blueprint;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for bindyType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="bindyType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="KeyValue"/>
* <enumeration value="Csv"/>
* <enumeration value="Fixed"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "bindyType")
@XmlEnum
public enum BindyType {
@XmlEnumValue("KeyValue")
KEY_VALUE("KeyValue"),
@XmlEnumValue("Csv")
CSV("Csv"),
@XmlEnumValue("Fixed")
FIXED("Fixed");
private final String value;
BindyType(String v) {
value = v;
}
public String value() {
return value;
}
public static BindyType fromValue(String v) {
for (BindyType c: BindyType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"kbabo@redhat.com"
] | kbabo@redhat.com |
6204444dddca90a2e25f8f796b575e66aed2afe1 | a4b111fcca1be07af77a34f4f233c626036afc42 | /bSSYNews/src/main/java/com/beisheng/synews/activity/MoreWebViewActivity.java | e66f30d9aea5e9bcfc562a2ea2bf264978bdea38 | [] | no_license | wodewzl/wzllibrary | 340bf08a13f0dab26c0653948c53d032ee955b92 | be7c4d81a5108dd9123e84eeeebecf30e2f8d607 | refs/heads/master | 2021-06-30T00:11:32.667131 | 2017-09-19T06:07:59 | 2017-09-19T06:07:59 | 104,013,642 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,193 | java | package com.beisheng.synews.activity;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.GeolocationPermissions;
import android.webkit.JavascriptInterface;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
import com.beisheng.base.activity.BaseActivity;
import com.beisheng.synews.application.AppApplication;
import com.beisheng.synews.utils.LogUtil;
import com.beisheng.synews.utils.ShareUtil;
import com.im.zhsy.R;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import java.util.HashMap;
import java.util.Map;
/**
* created:gaoyao on 2016/11/26 15:22
*/
public class MoreWebViewActivity extends BaseActivity {
private WebView webview;
private String url;
private Map<String, String> headers;
private ProgressBar progressbar;
@Override
public void baseSetContentView() {
View.inflate(this, R.layout.webview_activity, mBaseContentLayout);
}
@Override
public boolean getDataResult() {
return true;
}
@Override
public void initView() {
webview = (WebView) this.findViewById(R.id.webview);
url = getIntent().getStringExtra("url");
LogUtil.e("MoreWebViewActivity",url);
headers = new HashMap<String, String>();
progressbar = new ProgressBar(this, null, android.R.attr.progressBarStyleHorizontal);
progressbar.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FILL_PARENT, 5));
Drawable drawable = this.getResources().getDrawable(R.drawable.webview_progress);
progressbar.setProgressDrawable(drawable);
webview.addView(progressbar);
//webview 保持header
if(AppApplication.getInstance().getUserInfoVO()!=null){
headers.put("TOKENID", AppApplication.getInstance().getUserInfoVO().getUid());
headers.put("TOKEN", AppApplication.getInstance().getUserInfoVO().getToken());
headers.put("TOKENTIME", AppApplication.getInstance().getUserInfoVO().getTime());
headers.put("TOKENOS", AppApplication.getInstance().getUserInfoVO().getDevice());
}else{
headers.put("TOKENID", AppApplication.getInstance().getUid());
headers.put("TOKEN", "");
headers.put("TOKENTIME", "");
headers.put("TOKENOS","10yan.android");
}
load(url,headers);
}
@Override
public void bindViewsListener() {
mBaseHeadLayout.setVisibility(View.GONE);
}
// 监听 所有点击的链接,如果拦截到我们需要的,就跳转到相对应的页面。
// 防止调用系统自带的浏览器显示内容
private class MyWebViewClient extends WebViewClient {
private Intent intent;
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
LogUtil.e("shouldOverrideUrlLoading",url);
view.loadUrl(url,headers);
if (url != null && url.contains("referer=close")) {
destroyWebView(webview);
finish();
return true;
}else if(url != null && url.contains("referer=back")){
webview.goBack();
return true;
}else if(url != null && url.contains("referer=_blank")){
intent = new Intent(MoreWebViewActivity.this, MoreWebViewActivity.class);
intent.putExtra("url",url);
startActivity(intent);
webview.stopLoading();
return true;
}else if(url != null && url.contains("referer=_share")){
ShareUtil.share(MoreWebViewActivity.this, share_image,share_title, share_description, share_url);
}else if(url != null && url.contains("referer=user_login")){
startActivity(new Intent(MoreWebViewActivity.this, LoginActivity.class));
return true;
}else if(url != null && url.contains("referer=user_register")){
startActivity( new Intent(MoreWebViewActivity.this, RegisteredActivtiy.class));
return true;
}else if (url.startsWith("tel:")) {
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
return super.shouldOverrideUrlLoading(view, url);
}
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
view.loadUrl("javascript:window.local_obj.showSource('<html>'+" +
"document.getElementsByTagName('html')[0].innerHTML+'</html>');");
}
}
final class InJavaScriptLocalObj {
@JavascriptInterface
public void showSource(String html) {
LogUtil.d("HTML", html);
refreshHtmlContent(html);
}
}
private String share_title;
private String share_image;
private String share_description;
private String share_url;
private void refreshHtmlContent(final String html){
LogUtil.d("网页内容",html);
//解析html字符串为对象
Document document = Jsoup.parse(html);
//通过ID获取
share_title = document.getElementById("share_title").text();
share_image = document.getElementById("share_image").text();
share_description = document.getElementById("share_description").text();
share_url = document.getElementById("share_url").text();
}
private void load(String Url,Map<String, String> additionalHttpHeaders) {
webview.getSettings().setJavaScriptEnabled(true);
// 防止调用系统自带的浏览器显示内容
webview.addJavascriptInterface(new InJavaScriptLocalObj(), "local_obj");
webview.setWebViewClient(new MyWebViewClient());
webview.setWebChromeClient(new WebChromeClient() {
@Override
public void onProgressChanged(WebView view, int newProgress) {
if (newProgress == 100) {
progressbar.setVisibility(View.INVISIBLE);
} else {
if (View.INVISIBLE == progressbar.getVisibility()) {
progressbar.setVisibility(View.VISIBLE);
}
progressbar.setProgress(newProgress);
}
super.onProgressChanged(view, newProgress);
}
@Override
public void onGeolocationPermissionsShowPrompt(String origin,
GeolocationPermissions.Callback callback) {
callback.invoke(origin, true, false);
super.onGeolocationPermissionsShowPrompt(origin, callback);
}
});
webview.loadUrl(Url,additionalHttpHeaders);
}
public void destroyWebView(WebView webView) {
if (webView != null) {
webView.clearHistory();
webView.clearCache(true);
webView.loadUrl("about:blank");
webView.freeMemory();
webView.pauseTimers();
}
}
@Override
public void onBackPressed() {
if (getIntent() != null) {
super.onBackPressed();
} else {
if (webview.canGoBack()) {
webview.goBack(); // goBack()表示返回WebView的上一页面
} else {
super.onBackPressed();
}
}
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && webview.canGoBack()) {
webview.goBack(); // goBack()表示返回WebView的上一页面
return true;
}else if ((keyCode == KeyEvent.KEYCODE_BACK)) {
finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
}
| [
"273415345@qq.com"
] | 273415345@qq.com |
f9c9aae17d731eb7a881cdaa96837547e8b34043 | 70375ad64773d74e8882e45b2f7351b7739fa629 | /src/test/java/org/apache/ibatis/submitted/nonexistentvariables/NonExistentVariablesTest.java | e05ca47370371ab389c27e462e4ffb640ceb7356 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | yangfancoming/mybatis | 104e64e3f1659ebe1228413f16c4a373e8bedd1c | 7cd9c6093a608a0e0da32155e75d1fddd090c8d5 | refs/heads/master | 2022-09-22T21:09:10.430995 | 2021-05-30T10:37:34 | 2021-05-30T10:37:34 | 195,225,348 | 0 | 0 | Apache-2.0 | 2022-09-08T01:01:18 | 2019-07-04T11:00:52 | Java | UTF-8 | Java | false | false | 1,310 | java |
package org.apache.ibatis.submitted.nonexistentvariables;
import org.apache.ibatis.BaseDataTest;
import org.apache.ibatis.exceptions.PersistenceException;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import java.io.Reader;
class NonExistentVariablesTest {
protected static SqlSessionFactory sqlSessionFactory;
@BeforeAll
static void setUp() throws Exception {
try (Reader reader = Resources.getResourceAsReader("org/apache/ibatis/submitted/nonexistentvariables/mybatis-config.xml")) {
sqlSessionFactory = new SqlSessionFactoryBuilder().build(reader);
}
BaseDataTest.runScript(sqlSessionFactory.getConfiguration().getEnvironment().getDataSource(),"org/apache/ibatis/submitted/nonexistentvariables/CreateDB.sql");
}
@Test
void testWrongParameter() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
Mapper mapper = sqlSession.getMapper(Mapper.class);
mapper.count(1, "John");
Assertions.assertThrows(PersistenceException.class, () -> mapper.count(1, "John"));
}
}
}
| [
"34465021+jwfl724168@users.noreply.github.com"
] | 34465021+jwfl724168@users.noreply.github.com |
5db31c9c0446235e9c5327c0f608bb11b7db4910 | d176f1b5e2df4a8a5366901b2c263f97356ff745 | /nepxion-coroutine/coroutine-registry-zookeeper/src/main/java/com/nepxion/coroutine/registry/zookeeper/ZookeeperCategoryListener.java | c76af397ebf2bfa71ec08291f427286e9ff57c66 | [
"Apache-2.0"
] | permissive | PlumpMath/Coroutine-58 | 2a0427a769a42f26cf1d899a13ddd2101c506a4f | 3422f491bd1d885e6e1337e0deb7b9b30dd21b2c | refs/heads/master | 2021-01-20T09:55:01.706689 | 2017-03-20T13:09:00 | 2017-03-20T13:09:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,264 | java | package com.nepxion.coroutine.registry.zookeeper;
/**
* <p>Title: Nepxion Coroutine</p>
* <p>Description: Nepxion Coroutine For Distribution</p>
* <p>Copyright: Copyright (c) 2016</p>
* <p>Company: Nepxion</p>
* @author Neptune
* @email 1394997@qq.com
* @version 1.0
*/
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.nepxion.coroutine.common.constant.CoroutineConstants;
import com.nepxion.coroutine.event.RuleAddedEvent;
import com.nepxion.coroutine.event.RuleEvent;
import com.nepxion.coroutine.event.RuleReconnectedEvent;
import com.nepxion.coroutine.event.RuleRemovedEvent;
import com.nepxion.coroutine.event.RuleUpdatedEvent;
import com.nepxion.coroutine.event.eventbus.EventControllerFactory;
import com.nepxion.coroutine.event.eventbus.EventControllerType;
import com.nepxion.coroutine.registry.zookeeper.common.ZookeeperException;
import com.nepxion.coroutine.registry.zookeeper.common.ZookeeperInvoker;
import com.nepxion.coroutine.registry.zookeeper.common.listener.ZookeeperPathChildrenCacheListener;
public class ZookeeperCategoryListener extends ZookeeperPathChildrenCacheListener {
private static final Logger LOG = LoggerFactory.getLogger(ZookeeperCategoryListener.class);
private ZookeeperInvoker invoker;
public ZookeeperCategoryListener(CuratorFramework client, ZookeeperInvoker invoker, String path) throws Exception {
super(client, path);
this.invoker = invoker;
}
@Override
public void initialized(PathChildrenCacheEvent event) throws Exception {
}
@Override
public void childAdded(PathChildrenCacheEvent event) throws Exception {
String childPath = event.getData().getPath();
String categoryName = getCategoryName();
String ruleName = getRuleName(childPath);
String ruleContent = getRuleContent(childPath);
RuleAddedEvent ruleEvent = new RuleAddedEvent(categoryName, ruleName, ruleContent);
EventControllerFactory.getController(RuleEvent.getEventName(), EventControllerType.ASYNC).post(ruleEvent);
LOG.info("Rule added : category={}, rule={}", categoryName, ruleName);
}
@Override
public void childUpdated(PathChildrenCacheEvent event) throws Exception {
String childPath = event.getData().getPath();
String categoryName = getCategoryName();
String ruleName = getRuleName(childPath);
String ruleContent = getRuleContent(childPath);
RuleUpdatedEvent ruleEvent = new RuleUpdatedEvent(categoryName, ruleName, ruleContent);
EventControllerFactory.getController(RuleEvent.getEventName(), EventControllerType.ASYNC).post(ruleEvent);
LOG.info("Rule updated : category={}, rule={}", categoryName, ruleName);
}
@Override
public void childRemoved(PathChildrenCacheEvent event) throws Exception {
String childPath = event.getData().getPath();
String categoryName = getCategoryName();
String ruleName = getRuleName(childPath);
RuleRemovedEvent ruleEvent = new RuleRemovedEvent(categoryName, ruleName);
EventControllerFactory.getController(RuleEvent.getEventName(), EventControllerType.ASYNC).post(ruleEvent);
LOG.info("Rule removed : category={}, rule={}", categoryName, ruleName);
}
@Override
public void connectionSuspended(PathChildrenCacheEvent event) throws Exception {
}
@Override
public void connectionReconnected(PathChildrenCacheEvent event) throws Exception {
String categoryName = getCategoryName();
Map<String, String> ruleMap = getRuleMap();
RuleReconnectedEvent ruleEvent = new RuleReconnectedEvent(categoryName, ruleMap);
EventControllerFactory.getController(RuleEvent.getEventName(), EventControllerType.ASYNC).post(ruleEvent);
LOG.info("Rule reconnected : category={}", categoryName);
}
@Override
public void connectionLost(PathChildrenCacheEvent event) throws Exception {
}
private String getCategoryName() {
return path.substring(path.lastIndexOf("/") + 1);
}
private String getRuleName(String childPath) {
return childPath.substring(childPath.lastIndexOf("/") + 1);
}
private String getRuleContent(String childPath) throws Exception {
byte[] data = invoker.getData(client, childPath);
if (ArrayUtils.isNotEmpty(data)) {
return new String(data, CoroutineConstants.ENCODING_FORMAT);
} else {
throw new ZookeeperException("Rule content is empty");
}
}
private Map<String, String> getRuleMap() throws Exception {
Map<String, String> ruleMap = new HashMap<String, String>();
List<String> childPathList = invoker.getChildPathList(client, path);
for (String childPath : childPathList) {
String ruleName = getRuleName(childPath);
String ruleContent = getRuleContent(childPath);
ruleMap.put(ruleName, ruleContent);
}
return ruleMap;
}
} | [
"1394997@qq.com"
] | 1394997@qq.com |
fa118679903171a4af327d03bf14ab73e73e91ee | a28b2589ee75ef1a9c2456f29e5ad29d167d125e | /src/main/java/org/hl7/v3/COCTMT230100UVSubject25.java | 64b2f479bffc6ac5c81c545194f49c7f22a1e50d | [] | no_license | tigawa/soap-ssl | ee4ce38ba34335ab395f0fc8a8a5650072be8c11 | ac27ece15bc35efa5653de461db8534395eb52a7 | refs/heads/master | 2021-05-11T20:01:40.194678 | 2018-01-14T12:18:15 | 2018-01-14T12:18:15 | 117,428,279 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,879 | java |
package org.hl7.v3;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>COCT_MT230100UV.Subject25 complex typeのJavaクラス。
*
* <p>次のスキーマ・フラグメントは、このクラス内に含まれる予期されるコンテンツを指定します。
*
* <pre>
* <complexType name="COCT_MT230100UV.Subject25">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <group ref="{urn:hl7-org:v3}InfrastructureRootElements"/>
* <element name="characteristic" type="{urn:hl7-org:v3}COCT_MT230100UV.Characteristic"/>
* </sequence>
* <attGroup ref="{urn:hl7-org:v3}InfrastructureRootAttributes"/>
* <attribute name="nullFlavor" type="{urn:hl7-org:v3}NullFlavor" />
* <attribute name="typeCode" use="required" type="{urn:hl7-org:v3}ParticipationTargetSubject" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "COCT_MT230100UV.Subject25", propOrder = {
"realmCode",
"typeId",
"templateId",
"characteristic"
})
public class COCTMT230100UVSubject25 {
protected List<CS> realmCode;
protected II typeId;
protected List<II> templateId;
@XmlElement(required = true, nillable = true)
protected COCTMT230100UVCharacteristic characteristic;
@XmlAttribute(name = "nullFlavor")
protected List<String> nullFlavor;
@XmlAttribute(name = "typeCode", required = true)
protected ParticipationTargetSubject typeCode;
/**
* Gets the value of the realmCode property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the realmCode property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getRealmCode().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CS }
*
*
*/
public List<CS> getRealmCode() {
if (realmCode == null) {
realmCode = new ArrayList<CS>();
}
return this.realmCode;
}
/**
* typeIdプロパティの値を取得します。
*
* @return
* possible object is
* {@link II }
*
*/
public II getTypeId() {
return typeId;
}
/**
* typeIdプロパティの値を設定します。
*
* @param value
* allowed object is
* {@link II }
*
*/
public void setTypeId(II value) {
this.typeId = value;
}
/**
* Gets the value of the templateId property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the templateId property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getTemplateId().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link II }
*
*
*/
public List<II> getTemplateId() {
if (templateId == null) {
templateId = new ArrayList<II>();
}
return this.templateId;
}
/**
* characteristicプロパティの値を取得します。
*
* @return
* possible object is
* {@link COCTMT230100UVCharacteristic }
*
*/
public COCTMT230100UVCharacteristic getCharacteristic() {
return characteristic;
}
/**
* characteristicプロパティの値を設定します。
*
* @param value
* allowed object is
* {@link COCTMT230100UVCharacteristic }
*
*/
public void setCharacteristic(COCTMT230100UVCharacteristic value) {
this.characteristic = value;
}
/**
* Gets the value of the nullFlavor property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the nullFlavor property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getNullFlavor().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getNullFlavor() {
if (nullFlavor == null) {
nullFlavor = new ArrayList<String>();
}
return this.nullFlavor;
}
/**
* typeCodeプロパティの値を取得します。
*
* @return
* possible object is
* {@link ParticipationTargetSubject }
*
*/
public ParticipationTargetSubject getTypeCode() {
return typeCode;
}
/**
* typeCodeプロパティの値を設定します。
*
* @param value
* allowed object is
* {@link ParticipationTargetSubject }
*
*/
public void setTypeCode(ParticipationTargetSubject value) {
this.typeCode = value;
}
}
| [
"ihciiat@gmail.com"
] | ihciiat@gmail.com |
ddc60e416905f731c4ada9214e24de7eb3bfc65e | d9d6bf45ee70fb26bb775a794ebf497c6ddad59c | /src/main/java/com/design/u054/character/A/Editor.java | 961690f45db2d12006cc6a8bd21778bdb80fbb83 | [] | no_license | jiangsiYang/designModel_geekbang | 60788a9a70cc468a57749a7a8f2a6a2db248e000 | a48b4e9774ea5f705a0a6d88bf61caa2dc839edb | refs/heads/master | 2022-12-26T03:36:36.400697 | 2022-12-11T12:21:28 | 2022-12-11T12:21:28 | 231,164,579 | 45 | 23 | null | 2022-12-16T05:09:19 | 2020-01-01T01:45:18 | Java | UTF-8 | Java | false | false | 373 | java | package com.design.u054.character.A;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
public class Editor {
private List<Character> chars = new ArrayList<>();
public void appendCharacter(char c, Font font, int size, int colorRGB) {
Character character = new Character(c, font, size, colorRGB);
chars.add(character);
}
}
| [
"353098889@qq.com"
] | 353098889@qq.com |
bb1af25570e0a2c461f598e43167d1a1c154f432 | 71975999c9d702a0883ec9038ce3e76325928549 | /src2.4.0/src/main/java/com/qiyukf/basesdk/c/b.java | 1330d7857c05f39fa50a49da8f2801da04a5da71 | [] | no_license | XposedRunner/PhysicalFitnessRunner | dc64179551ccd219979a6f8b9fe0614c29cd61de | cb037e59416d6c290debbed5ed84c956e705e738 | refs/heads/master | 2020-07-15T18:18:23.001280 | 2019-09-02T04:21:34 | 2019-09-02T04:21:34 | 205,620,387 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,832 | java | package com.qiyukf.basesdk.c;
import android.text.TextUtils;
import org.json.JSONArray;
import org.json.JSONObject;
public final class b {
public static String a(JSONArray jSONArray, int i) {
return jSONArray == null ? null : jSONArray.optString(i);
}
public static JSONObject a(String str) {
try {
if (!TextUtils.isEmpty(str)) {
return new JSONObject(str);
}
} catch (Exception unused) {
}
return null;
}
public static void a(JSONArray jSONArray, Object obj) {
try {
jSONArray.put(obj);
} catch (Exception unused) {
}
}
public static void a(JSONObject jSONObject, String str, int i) {
try {
jSONObject.put(str, i);
} catch (Exception unused) {
}
}
public static void a(JSONObject jSONObject, String str, long j) {
try {
jSONObject.put(str, j);
} catch (Exception unused) {
}
}
public static void a(JSONObject jSONObject, String str, Object obj) {
try {
jSONObject.put(str, obj);
} catch (Exception unused) {
}
}
public static void a(JSONObject jSONObject, String str, String str2) {
try {
jSONObject.put(str, str2);
} catch (Exception unused) {
}
}
public static boolean a(JSONObject jSONObject, String str) {
return jSONObject != null && jSONObject.optBoolean(str);
}
public static int b(JSONObject jSONObject, String str) {
return jSONObject == null ? 0 : jSONObject.optInt(str);
}
public static JSONArray b(String str) {
try {
if (!TextUtils.isEmpty(str)) {
return new JSONArray(str);
}
} catch (Exception unused) {
}
return null;
}
public static JSONObject b(JSONArray jSONArray, int i) {
return jSONArray == null ? null : jSONArray.optJSONObject(i);
}
public static long c(JSONObject jSONObject, String str) {
return jSONObject == null ? 0 : jSONObject.optLong(str);
}
public static double d(JSONObject jSONObject, String str) {
return jSONObject == null ? 0.0d : jSONObject.optDouble(str);
}
public static String e(JSONObject jSONObject, String str) {
return jSONObject == null ? null : jSONObject.optString(str, null);
}
public static JSONObject f(JSONObject jSONObject, String str) {
return jSONObject == null ? null : jSONObject.optJSONObject(str);
}
public static JSONArray g(JSONObject jSONObject, String str) {
return jSONObject == null ? null : jSONObject.optJSONArray(str);
}
}
| [
"xr_master@mail.com"
] | xr_master@mail.com |
75274e4de2954b178869fdf0a0a12cde5692ba7e | af0028ad74c89c21c611705c4621f2bfbf988695 | /src/com/yitong/utils/ToastTools.java | 0bbe0e465d4837e89ae18413574a52d19d59652d | [] | no_license | smshen/YtBasicFramework | e1d74569814f77c529995e468048263438f11e55 | afc4bc5ad4ba88d8388c0bf636915ad93cded1d5 | refs/heads/master | 2021-01-21T07:16:37.292406 | 2015-05-19T02:18:08 | 2015-05-19T02:18:08 | 39,550,334 | 0 | 1 | null | 2015-07-23T06:41:39 | 2015-07-23T06:41:39 | null | UTF-8 | Java | false | false | 853 | java | package com.yitong.utils;
import android.content.Context;
import android.widget.Toast;
/**
* <hr/>
*
* @author 刘国山
*/
public abstract class ToastTools {
private ToastTools() throws IllegalAccessException {
throw new IllegalAccessException("工具类无法实例化!");
}
public static void showLong(Context context, String msg) {
Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
}
public static void showShort(Context context, String msg) {
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}
/**
* Toast显示
*/
static Toast toast=null;
public static void showToast(Context ctx,String msg){
if(toast==null){
toast=Toast.makeText(ctx, msg, Toast.LENGTH_LONG);
}else{
toast.setText(msg);
}
toast.show();
}
public static void cancel(){
if(toast != null){
toast.cancel();
}
}
}
| [
"w1037704496@163.com"
] | w1037704496@163.com |
f1de9388f948dfa819ba4be650babb9a1766f84d | a1f88b35222838a52e0b665d0a29c21a0be070c4 | /src/test/tonivade/db/command/bitset/GetBitCommandTest.java | 159711aa660a62c3644f51e8b0599530b125f72c | [
"MIT"
] | permissive | yourcaptain/tinydb | 2c053e6ede6f6e8c950016ae3c8aa2042a977ccf | b7fda73b668380eaaa38136af2f9c11d06538a8a | refs/heads/master | 2021-01-10T18:52:33.957124 | 2016-07-15T08:45:37 | 2016-07-15T08:45:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | java | /*
* Copyright (c) 2016, Antonio Gabriel Muñoz Conejo <antoniogmc at gmail dot com>
* Distributed under the terms of the MIT License
*/
package tonivade.db.command.bitset;
import org.junit.Rule;
import org.junit.Test;
import tonivade.db.command.CommandRule;
import tonivade.db.command.CommandUnderTest;
import tonivade.db.data.DatabaseValue;
@CommandUnderTest(GetBitCommand.class)
public class GetBitCommandTest {
@Rule
public final CommandRule rule = new CommandRule(this);
@Test
public void testExecuteOne() throws Exception {
rule.withData("test", DatabaseValue.bitset(10))
.withParams("test", "10")
.execute()
.verify().addInt(true);
}
@Test
public void testExecuteZero() throws Exception {
rule.withData("test", DatabaseValue.bitset())
.withParams("test", "10")
.execute()
.verify().addInt(false);
}
@Test
public void testExecuteFormat() throws Exception {
rule.withData("test", DatabaseValue.bitset())
.withParams("test", "a")
.execute()
.verify().addError("bit offset is not an integer");
}
}
| [
"antoniogmc@gmail.com"
] | antoniogmc@gmail.com |
2b5b1683f0033bb1f6d38fa91d7f2cbb23c8b9e3 | d1ea5077c83cb2e93fe69e3d19a2e26efe894a0e | /src/main/java/com/rograndec/feijiayun/chain/business/report/quality/user/controller/TrainRecordReportController.java | 567e326363384d09a1d08a788afcf0da567d7669 | [] | no_license | Catfeeds/rog-backend | e89da5a3bf184e4636169e7492a97dfd0deef2a1 | 109670cfec6cbe326b751e93e49811f07045e531 | refs/heads/master | 2020-04-05T17:36:50.097728 | 2018-10-22T16:23:55 | 2018-10-22T16:23:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,421 | java | package com.rograndec.feijiayun.chain.business.report.quality.user.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import springfox.documentation.annotations.ApiIgnore;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.rograndec.feijiayun.chain.business.report.quality.user.service.TrainPlanReportService;
import com.rograndec.feijiayun.chain.business.report.quality.user.vo.ResponseTrainPlanDetailVO;
import com.rograndec.feijiayun.chain.common.Page;
import com.rograndec.feijiayun.chain.common.Result;
import com.rograndec.feijiayun.chain.common.SysCode;
import com.rograndec.feijiayun.chain.common.vo.UserVO;
/**
*
* @author lizhongyi
*
*/
@Api(value = "report_quality_user_trainRecord",description = "报表-质量管理-人员与培训-培训记录")
@RestController
@RequestMapping("report/quality/user/trainRecord")
@Validated
public class TrainRecordReportController {
private static final Log logger = LogFactory.getLog(TrainPlanReportController.class);
@Autowired
TrainPlanReportService trainPlanReportService;
@ApiOperation(value = "查询培训记录明细列表", notes = "根据培训记录ID查询培训记录明细列表 | 开发者 张东东 | 已联调")
@RequestMapping(value="/getTrainRecordReportDtlList", method=RequestMethod.GET)
public Result<List<ResponseTrainPlanDetailVO>> getTrainRecordReportDtlList(HttpSession session,@ApiIgnore UserVO userVO,
/* @ApiParam(value = "页码", required = true) @RequestParam Integer pageNo,
@ApiParam(value = "每页显示的记录数", required = true) @RequestParam Integer pageSize,*/
@ApiParam(value = "培训记录id", required = true) @RequestParam Long id){
Result<List<ResponseTrainPlanDetailVO>> result = new Result<>();
try{
/*UserVO user=(UserVO) session.getAttribute("user");*/
//Page<List<ResponseTrainPlanDetailVO>> page = new Page<>(pageNo, pageSize);
//page.setTotalRecord(trainPlanReportService.getTrainRecordReportDtlListTotalNum(id, user));
List<ResponseTrainPlanDetailVO> list=trainPlanReportService.getTrainRecordReportDtlList(id,null,null,userVO);
//page.setResult(list);
result.setBizCodeSuccessInfo(SysCode.SUCCESS,list);
return result;
}catch(Exception e){
logger.error("查询培训记录明细列表异常:" + e.getMessage(), e);
result.setBizCodeFallInfo(SysCode.FAIL);
return result;
}
}
@ApiOperation(value = "按照模版将培训记录明细导出至Excel", notes = "按照模版将培训记录明细导出至Excel | 开发者 张东东 | 已联调")
@ApiImplicitParam(name = "id", value = "培训记录id", required = true, paramType = "path")
@RequestMapping(value="/exportPlanRecordDetlExcel/{id}", method=RequestMethod.GET)
public void exportPlanRecordDetlExcel( HttpServletResponse response,@ApiIgnore UserVO userVO,HttpSession session,@PathVariable Long id){
OutputStream output=null;
try{
/* UserVO user=(UserVO) session.getAttribute("user");*/
output=response.getOutputStream();
//这段代码一定要放在流关闭之前,否会下载的文件会变成zip格式
String name="培训记录";
response.setContentType("application/octet-stream;charset=utf-8");
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(name, "UTF-8") + ".xlsx");
trainPlanReportService.exportPlanRecordDetlExcel(userVO,output,id);
}catch(Exception e){
logger.error("按照模版将培训记录明细导出至Excel异常:" + e.getMessage(), e);
}
}
}
| [
"ruifeng.jia@rograndec.com"
] | ruifeng.jia@rograndec.com |
cea559374c31da778da630c48693c465f46ba980 | 5245085c230929cdb91db049672f8f276646560c | /mula-base/src/main/java/org/mula/finance/core/ui/screens/habits/show/ShowHabitMenuBehavior.java | 1830db7aa737fea90077a1f0307ae7609769ddfe | [] | no_license | katrinaannhadi/MULAFinanceApp | 9e7371778d2fe2fbcc61e94cd6d3832409cd6115 | 3130dbd1dfc7438268621cf0320c0856e836e00e | refs/heads/master | 2022-04-25T04:50:36.130679 | 2020-04-30T03:51:17 | 2020-04-30T03:51:17 | 258,404,445 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,573 | java | /* Mula */
package org.mula.finance.core.ui.screens.habits.show;
import androidx.annotation.*;
import org.mula.finance.core.commands.CommandRunner;
import org.mula.finance.core.commands.DeleteHabitsCommand;
import org.mula.finance.core.models.Habit;
import org.mula.finance.core.models.HabitList;
import org.mula.finance.core.models.Repetition;
import org.mula.finance.core.models.Timestamp;
import org.mula.finance.core.tasks.ExportCSVTask;
import org.mula.finance.core.tasks.TaskRunner;
import org.mula.finance.core.ui.callbacks.OnConfirmedCallback;
import org.mula.finance.core.utils.DateUtils;
import java.io.*;
import java.util.*;
import javax.inject.*;
import static java.lang.Math.*;
public class ShowHabitMenuBehavior
{
private HabitList habitList;
@NonNull
private final Habit habit;
@NonNull
private final TaskRunner taskRunner;
@NonNull
private Screen screen;
@NonNull
private System system;
@NonNull
private CommandRunner commandRunner;
@Inject
public ShowHabitMenuBehavior(@NonNull HabitList habitList,
@NonNull Habit habit,
@NonNull TaskRunner taskRunner,
@NonNull Screen screen,
@NonNull System system,
@NonNull CommandRunner commandRunner)
{
this.habitList = habitList;
this.habit = habit;
this.taskRunner = taskRunner;
this.screen = screen;
this.system = system;
this.commandRunner = commandRunner;
}
public void onEditHabit()
{
screen.showEditHabitScreen(habit);
}
public void onExportCSV()
{
List<Habit> selected = Collections.singletonList(habit);
File outputDir = system.getCSVOutputDir();
taskRunner.execute(
new ExportCSVTask(habitList, selected, outputDir, filename ->
{
if (filename != null) screen.showSendFileScreen(filename);
else screen.showMessage(Message.COULD_NOT_EXPORT);
}));
}
public void onDeleteHabit()
{
List<Habit> selected = Collections.singletonList(habit);
screen.showDeleteConfirmationScreen(() -> {
commandRunner.execute(new DeleteHabitsCommand(habitList, selected),
null);
screen.close();
});
}
public void onRandomize()
{
Random random = new Random();
habit.getRepetitions().removeAll();
double strength = 50;
for (int i = 0; i < 365 * 5; i++)
{
if (i % 7 == 0) strength = max(0, min(100, strength + 10 * random.nextGaussian()));
if (random.nextInt(100) > strength) continue;
int value = 1;
if (habit.isNumerical())
value = (int) (1000 + 250 * random.nextGaussian() * strength / 100) * 1000;
habit.getRepetitions().add(new Repetition(DateUtils.getToday().minus(i), value));
}
habit.invalidateNewerThan(Timestamp.ZERO);
}
public enum Message
{
COULD_NOT_EXPORT, HABIT_DELETED
}
public interface Screen
{
void showEditHabitScreen(@NonNull Habit habit);
void showMessage(Message m);
void showSendFileScreen(String filename);
void showDeleteConfirmationScreen(
@NonNull OnConfirmedCallback callback);
void close();
}
public interface System
{
File getCSVOutputDir();
}
}
| [
"katrinaann.abdulhadi@student.unsw.edu.au"
] | katrinaann.abdulhadi@student.unsw.edu.au |
489c75d7b76ea3da597ee0f8b1cef06d8179695a | 91063f5a2280fc70cfb47574edd248c1b8151a60 | /web-framework/src/main/java/org/unidal/web/configuration/ComponentsConfigurator.java | 5ed06310e67b8139b4221b8d508ced5daa84c655 | [] | no_license | qmwu2000/frameworks | 57f7a5fe4daf5b612156a2fb6818f19590ef8174 | 15a0371b34ee252ced134ae3d8418000505f9ac1 | refs/heads/master | 2021-01-09T05:16:44.406835 | 2012-12-13T10:07:01 | 2012-12-13T10:07:01 | 9,001,172 | 3 | 4 | null | null | null | null | UTF-8 | Java | false | false | 3,111 | java | package org.unidal.web.configuration;
import java.util.ArrayList;
import java.util.List;
import com.dianping.cat.message.MessageProducer;
import org.unidal.lookup.configuration.AbstractResourceConfigurator;
import org.unidal.lookup.configuration.Component;
import org.unidal.web.lifecycle.ActionResolver;
import org.unidal.web.lifecycle.DefaultActionResolver;
import org.unidal.web.lifecycle.RequestLifecycle;
import org.unidal.web.mvc.lifecycle.ActionHandlerManager;
import org.unidal.web.mvc.lifecycle.DefaultActionHandlerManager;
import org.unidal.web.mvc.lifecycle.DefaultErrorHandler;
import org.unidal.web.mvc.lifecycle.DefaultInboundActionHandler;
import org.unidal.web.mvc.lifecycle.DefaultOutboundActionHandler;
import org.unidal.web.mvc.lifecycle.DefaultRequestLifecycle;
import org.unidal.web.mvc.lifecycle.DefaultTransitionHandler;
import org.unidal.web.mvc.lifecycle.ErrorHandler;
import org.unidal.web.mvc.lifecycle.InboundActionHandler;
import org.unidal.web.mvc.lifecycle.OutboundActionHandler;
import org.unidal.web.mvc.lifecycle.TransitionHandler;
import org.unidal.web.mvc.model.AnnotationMatrix;
import org.unidal.web.mvc.model.ModelManager;
import org.unidal.web.mvc.model.ModuleRegistry;
import org.unidal.web.mvc.payload.DefaultPayloadProvider;
import org.unidal.web.mvc.payload.MultipartParameterProvider;
import org.unidal.web.mvc.payload.ParameterProvider;
import org.unidal.web.mvc.payload.UrlEncodedParameterProvider;
class ComponentsConfigurator extends AbstractResourceConfigurator {
@Override
public List<Component> defineComponents() {
List<Component> all = new ArrayList<Component>();
all.add(C(AnnotationMatrix.class).is(PER_LOOKUP));
all.add(C(ModelManager.class).req(ModuleRegistry.class, AnnotationMatrix.class));
all.add(C(ActionResolver.class, DefaultActionResolver.class));
all.add(C(InboundActionHandler.class, DefaultInboundActionHandler.class).is(PER_LOOKUP) //
.req(MessageProducer.class));
all.add(C(OutboundActionHandler.class, DefaultOutboundActionHandler.class).is(PER_LOOKUP) //
.req(MessageProducer.class));
all.add(C(TransitionHandler.class, DefaultTransitionHandler.class).is(PER_LOOKUP) //
.req(MessageProducer.class));
all.add(C(ErrorHandler.class, DefaultErrorHandler.class));
all.add(C(DefaultPayloadProvider.class));
all.add(C(ActionHandlerManager.class, DefaultActionHandlerManager.class));
all.add(C(RequestLifecycle.class, "mvc", DefaultRequestLifecycle.class) //
.req(ModelManager.class, ActionHandlerManager.class, MessageProducer.class));
all.add(C(ParameterProvider.class, "application/x-www-form-urlencoded", UrlEncodedParameterProvider.class) //
.is(PER_LOOKUP));
all.add(C(ParameterProvider.class, "multipart/form-data", MultipartParameterProvider.class) //
.is(PER_LOOKUP));
return all;
}
public static void main(String[] args) {
generatePlexusComponentsXmlFile(new ComponentsConfigurator());
}
}
| [
"qmwu2000@gmail.com"
] | qmwu2000@gmail.com |
1fa335ed476d3dec92c93b4d86dbc3a10b05c421 | 169c2cefb1155635df78ea4d68e6178d0affc922 | /src/main/java/com/pfe/expense/repository/DOCFraisRepository.java | 972a9c4c28a670e23a5471438b4d8d597a63bf47 | [] | no_license | mohamedBA/expenses | b099b2c6e65c02a9aa519a335188155b043d2a3a | 4f877d1f8c3e95842241c302580eb7fd5be0ed80 | refs/heads/master | 2021-07-01T08:54:18.509979 | 2018-07-04T20:07:40 | 2018-07-04T20:07:40 | 139,758,679 | 0 | 1 | null | 2020-09-18T10:21:44 | 2018-07-04T19:18:39 | Java | UTF-8 | Java | false | false | 358 | java | package com.pfe.expense.repository;
import com.pfe.expense.domain.DOCFrais;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;
/**
* Spring Data repository for the DOCFrais entity.
*/
@SuppressWarnings("unused")
@Repository
public interface DOCFraisRepository extends JpaRepository<DOCFrais, Long> {
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
9c7f4b686317b7406589edb32f5171e24a621b44 | 3d6c20dc57a8eb1a015c5d2353a515f29525a1d6 | /swingBasic-master/Ch17/TryFlowLayout.java | 228fdce9cdc316d6bf818da1ca84156ae664a668 | [] | no_license | nparvez71/NetbeanSoftware | b9e5c93addc2583790c69f53c650c29665e16721 | 1e18ff07914c4c4530bcfd93693d838bea8f9641 | refs/heads/master | 2020-03-13T19:14:53.285683 | 2018-04-29T04:34:07 | 2018-04-29T04:34:07 | 131,249,843 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,207 | java | import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.Toolkit;
import java.awt.Dimension;
import java.awt.Container;
import java.awt.FlowLayout;
public class TryFlowLayout {
// The window object
static JFrame aWindow = new JFrame("This is a Flow Layout");
public static void main(String[] args) {
Toolkit theKit = aWindow.getToolkit(); // Get the window toolkit
Dimension wndSize = theKit.getScreenSize(); // Get screen size
// Set the position to screen center & size to half screen size
aWindow.setBounds(wndSize.width/4, wndSize.height/4, // Position
wndSize.width/2, wndSize.height/2); // Size
aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
FlowLayout flow = new FlowLayout(); // Create a layout manager
Container content = aWindow.getContentPane(); // Get the content pane
content.setLayout(flow); // Set the container layout mgr
// Now add six button components
for(int i = 1; i <= 6; i++)
content.add(new JButton("Press " + i)); // Add a Button to content pane
aWindow.setVisible(true); // Display the window
}
}
| [
"nparvez92@gmail.com"
] | nparvez92@gmail.com |
a032ab1c79766752acdca387b6783105befd9c4f | af0c4995d4bf5f76a6ca283fc55dfdca4e52ca3a | /program/src/main/java/com/whaley/biz/program/ui/follow/repository/CpProgramRepository.java | 089c66a4a1568d23d91b93202c086a9682cb4d81 | [] | no_license | portal-io/portal-android | da60c4a7d54fb56fbc983c635bb1d2c4d542f78e | 623757fbb4d7979745b4c8ee34cebbf395cbd249 | refs/heads/master | 2020-03-20T07:58:08.196164 | 2019-03-16T02:30:48 | 2019-03-16T02:30:48 | 137,295,692 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 625 | java | package com.whaley.biz.program.ui.follow.repository;
import com.whaley.biz.program.uiview.repository.RecyclerUIViewRepository;
/**
* Author: qxw
* Date:2017/8/16
* Introduction:
*/
public class CpProgramRepository extends RecyclerUIViewRepository {
private String cpCode;
private String mSortOrder;
public String getmSortOrder() {
return mSortOrder;
}
public void setmSortOrder(String mSortOrder) {
this.mSortOrder = mSortOrder;
}
public String getCpCode() {
return cpCode;
}
public void setCpCode(String cpCode) {
this.cpCode = cpCode;
}
}
| [
"lizs@snailvr.com"
] | lizs@snailvr.com |
de3c36dd4f2b1c8715802be8991e2374527f2e94 | f66e2ad3fc0f8c88278c0997b156f5c6c8f77f28 | /Java/Imooc-Socket/Java-Socket/src/main/l8-q1/clink/core/Receiver.java | 6da218cf203381c8bb06b4464fef8cb595bd549e | [
"Apache-2.0"
] | permissive | flyfire/Programming-Notes-Code | 3b51b45f8760309013c3c0cc748311d33951a044 | 4b1bdd74c1ba0c007c504834e4508ec39f01cd94 | refs/heads/master | 2020-05-07T18:00:49.757509 | 2019-04-10T11:15:13 | 2019-04-10T11:15:13 | 180,750,568 | 1 | 0 | Apache-2.0 | 2019-04-11T08:40:38 | 2019-04-11T08:40:38 | null | UTF-8 | Java | false | false | 396 | java | package clink.core;
import java.io.Closeable;
import java.io.IOException;
/**
* 一个数据接收者
*/
public interface Receiver extends Closeable {
/**
* 异步读取数据
*
* @param listener 数据读取事件回调
* @return
* @throws IOException 可能不可读
*/
boolean receiveAsync(IoArgs.IoArgsEventListener listener) throws IOException;
}
| [
"ztiany3@gmail.com"
] | ztiany3@gmail.com |
287f4dc28508c1359ba9cf1234a7cae4b2977a13 | e89d45f9e6831afc054468cc7a6ec675867cd3d7 | /src/main/java/com/microsoft/graph/requests/extensions/DeviceManagementIntentDeviceStateCollectionRequestBuilder.java | c0fe890f8d6b200ae632ba6a0b8793f5f2e6aa23 | [
"MIT"
] | permissive | isabella232/msgraph-beta-sdk-java | 67d3b9251317f04a465042d273fe533ef1ace13e | 7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8 | refs/heads/dev | 2023-03-12T05:44:24.349020 | 2020-11-19T15:51:17 | 2020-11-19T15:51:17 | 318,158,544 | 0 | 0 | MIT | 2021-02-23T20:48:09 | 2020-12-03T10:37:46 | null | UTF-8 | Java | false | false | 2,993 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.extensions;
import com.microsoft.graph.http.IRequestBuilder;
import com.microsoft.graph.core.ClientException;
import com.microsoft.graph.concurrency.ICallback;
import com.microsoft.graph.models.extensions.DeviceManagementIntent;
import com.microsoft.graph.models.extensions.DeviceManagementIntentDeviceState;
import java.util.Arrays;
import java.util.EnumSet;
import com.microsoft.graph.requests.extensions.IDeviceManagementIntentDeviceStateCollectionRequestBuilder;
import com.microsoft.graph.requests.extensions.IDeviceManagementIntentDeviceStateRequestBuilder;
import com.microsoft.graph.requests.extensions.IDeviceManagementIntentDeviceStateCollectionRequest;
import com.microsoft.graph.http.BaseRequestBuilder;
import com.microsoft.graph.core.IBaseClient;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Device Management Intent Device State Collection Request Builder.
*/
public class DeviceManagementIntentDeviceStateCollectionRequestBuilder extends BaseRequestBuilder implements IDeviceManagementIntentDeviceStateCollectionRequestBuilder {
/**
* The request builder for this collection of DeviceManagementIntent
*
* @param requestUrl the request URL
* @param client the service client
* @param requestOptions the options for this request
*/
public DeviceManagementIntentDeviceStateCollectionRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
super(requestUrl, client, requestOptions);
}
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public IDeviceManagementIntentDeviceStateCollectionRequest buildRequest(final com.microsoft.graph.options.Option... requestOptions) {
return buildRequest(getOptions(requestOptions));
}
/**
* Creates the request
*
* @param requestOptions the options for this request
* @return the IUserRequest instance
*/
public IDeviceManagementIntentDeviceStateCollectionRequest buildRequest(final java.util.List<? extends com.microsoft.graph.options.Option> requestOptions) {
return new DeviceManagementIntentDeviceStateCollectionRequest(getRequestUrl(), getClient(), requestOptions);
}
public IDeviceManagementIntentDeviceStateRequestBuilder byId(final String id) {
return new DeviceManagementIntentDeviceStateRequestBuilder(getRequestUrlWithAdditionalSegment(id), getClient(), getOptions());
}
}
| [
"GraphTooling@service.microsoft.com"
] | GraphTooling@service.microsoft.com |
99a63231ee24f374e48188f694fd683bfb2f140c | 8feb0a0d5bd65072f52d13d79204fba7d05f679f | /yass-core/src/main/java/com/core/net/download/DownloadHandler.java | 93f5fb14763857eab63a1838016d076563969dfa | [] | no_license | wxyass/YassExample | cd9333e92058bcc2de5ecc15e8baa1415afc07c5 | 43478057c812574aec28297264631a4b5e835584 | refs/heads/master | 2020-04-08T05:01:55.944248 | 2018-11-25T14:55:19 | 2018-11-25T14:55:19 | 159,042,802 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,510 | java | package com.core.net.download;
import android.os.AsyncTask;
import com.core.net.RestCreator;
import com.core.net.callback.IError;
import com.core.net.callback.IFailure;
import com.core.net.callback.IRequest;
import com.core.net.callback.ISuccess;
import com.core.net.callback.OnDownLoadProgress;
import java.util.WeakHashMap;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
/**
* 下载的帮助类
* Created by yangwenmin on 2017/10/17.
*/
public class DownloadHandler {
private final String URL;// 请求网址
// private static final WeakHashMap<String, Object> PARAMS = RestCreator.getParams();// 请求参数
private static final WeakHashMap<String, Object> PARAMS = new WeakHashMap<>();// 请求参数 // 因为下载不需要参数了
private final IRequest REQUEST;
private final String DOWNLOAD_DIR;// 文件下载路径
private final String EXTENSION;// 后缀名
private final String NAME;// 文件名称
private final ISuccess SUCCESS;
private final IFailure FAILURE;
private final IError ERROR;
private final OnDownLoadProgress ONDOWNLOADPROGRESS;
public DownloadHandler(String url,
IRequest request,
String download_dir,
String extension,
String name,
ISuccess success,
IFailure failure,
IError error,
OnDownLoadProgress ondownloadprogress) {
this.URL = url;
this.REQUEST = request;
this.DOWNLOAD_DIR = download_dir;
this.EXTENSION = extension;
this.NAME = name;
this.SUCCESS = success;
this.FAILURE = failure;
this.ERROR = error;
this.ONDOWNLOADPROGRESS = ondownloadprogress;
}
// 进行下载
public final void handleDownload() {
if (REQUEST != null) {
REQUEST.onRequestStart();
}
RestCreator.getRestService().download(URL, PARAMS)
.enqueue(new Callback<ResponseBody>() {
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
if (response.isSuccessful()) {
final ResponseBody responseBody = response.body();
final SaveFileTask task = new SaveFileTask(REQUEST, SUCCESS,ONDOWNLOADPROGRESS);
task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, DOWNLOAD_DIR, EXTENSION, responseBody, NAME);
// 这里一定要注意,否则文件下载不全
if (task.isCancelled()) {
if (REQUEST != null) {
REQUEST.onRequestEnd();
}
}
} else {
if (ERROR != null) {
ERROR.onError(response.code(), response.message());
}
}
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t) {
if (FAILURE != null) {
FAILURE.onFailure();
}
}
});
}
}
| [
"wxyass@gmail.com"
] | wxyass@gmail.com |
bf43e01a3cd43bd55fde5822add3c8c378049326 | b2f44ba766a44426cd06ebfb922d8b75c1773d63 | /src/com/leetcode/P1053_PreviousPermutationWithOneSwap.java | 4ac3fb76cab5d5d7c0e14fa2ef04082d58161aea | [] | no_license | joy32812/leetcode | a1179ecff91127a6cda83cf70838354b0670970f | 9bd74b9774012df0e2e221eedc63d10f3ba88238 | refs/heads/master | 2023-08-16T14:11:34.232388 | 2023-08-13T11:30:05 | 2023-08-13T11:30:05 | 81,704,645 | 10 | 5 | null | null | null | null | UTF-8 | Java | false | false | 736 | java | package com.leetcode;
public class P1053_PreviousPermutationWithOneSwap {
/**
* similar to Next Permutation
*
* @param A
* @return
*/
public int[] prevPermOpt1(int[] A) {
int j = -1;
for (int i = 0; i + 1 < A.length; i++) {
if (A[i] > A[i + 1]) j = i;
}
if (j == -1) return A;
int now = Integer.MIN_VALUE;
int k = -1;
for (int i = j + 1; i < A.length; i ++) {
if (A[i] < A[j] && A[i] >= now) {
now = A[i];
k = i;
}
}
int tmp = A[j];
A[j] = A[k];
A[k] = tmp;
return A;
}
public static void main(String[] args) {
}
}
| [
"joy32812@qq.com"
] | joy32812@qq.com |
416318eab5db46439569dab7e95cc867080bea2f | d0f7287bcd94d52dafe14f08a1763e71d985012d | /core/src/main/java/org/kasource/commons/jmx/registration/DefaultMBeanServerLookup.java | 673801826b403558b2214db727814fa9b833da67 | [
"Apache-2.0"
] | permissive | wigforss/Ka-Commons-Jmx | 7f4a9ba3fc66cb6d9055772ea48c00c6d4e6037f | f31ceda37ff55746bb43a059919842cb92405b5d | refs/heads/master | 2023-03-15T19:30:33.580286 | 2014-08-18T17:50:01 | 2014-08-18T17:50:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 328 | java | package org.kasource.commons.jmx.registration;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServer;
public class DefaultMBeanServerLookup implements MBeanServerLookup {
@Override
public MBeanServer getMBeanServer() {
return ManagementFactory.getPlatformMBeanServer();
}
}
| [
"rikard.wigforss@gmail.com"
] | rikard.wigforss@gmail.com |
c13c77749ba98523d1b16aa3f02e8aeda5969d16 | d5aa2f7f9f5904656fbdcda9733586694c57d354 | /app/src/main/java/world/best/musicplayer/utils/files/tag/datatype/AbstractIntStringValuePair.java | 9ab9fb0e25f9d07016452b5c412b2327f17edcbe | [] | no_license | ravishankarahirwar/DingDong | 3f3990173bf89c1a95abbeaaee87c55a73e04809 | 78562216c2d58250bcc5698daf967f712d34fa92 | refs/heads/master | 2020-04-12T19:20:04.820201 | 2020-04-07T07:38:11 | 2020-04-07T07:38:11 | 162,706,499 | 0 | 0 | null | 2020-04-07T07:38:12 | 2018-12-21T11:29:59 | Java | UTF-8 | Java | false | false | 992 | java | package world.best.musicplayer.utils.files.tag.datatype;
import java.util.Collections;
import java.util.Map;
/**
* A two way mapping between an Integral Id and a String value
*/
public class AbstractIntStringValuePair extends AbstractValuePair<Integer, String>
{
protected Integer key = null;
/**
* Get Id for Value
* @param value
* @return
*/
public Integer getIdForValue(String value)
{
return valueToId.get(value);
}
/**
* Get value for Id
* @param id
* @return
*/
public String getValueForId(int id)
{
return idToValue.get(id);
}
protected void createMaps()
{
//Create the reverse the map
for (Map.Entry<Integer, String> entry : idToValue.entrySet())
{
valueToId.put(entry.getValue(), entry.getKey());
}
//Value List sort alphabetically
valueList.addAll(idToValue.values());
Collections.sort(valueList);
}
}
| [
"ravishankar.ahirwar@gmail.com"
] | ravishankar.ahirwar@gmail.com |
d79e9df8ee329742e3ae4edbfbac4dbbf61bbb80 | 0eeba5700b22ddaa1c0f370f468857d10161224c | /main/feature/test/boofcv/alg/feature/line/TestHoughTransformLineFootOfNorm.java | de7271e4043ba4a4fb4f5f739d1218bb94f5bb7b | [
"Apache-2.0"
] | permissive | elialshan/BoofCV | 048b8c69ea8a50bc9362e9e729339f788147a56a | 35b50b2ff0a7b0243b613829b60e1f87a1994c9a | refs/heads/master | 2021-01-18T00:02:31.175088 | 2013-12-28T00:30:02 | 2013-12-28T00:30:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,522 | java | /*
* Copyright (c) 2011-2013, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package boofcv.alg.feature.line;
import boofcv.abst.feature.detect.extract.ConfigExtract;
import boofcv.abst.feature.detect.extract.NonMaxSuppression;
import boofcv.alg.feature.detect.line.HoughTransformLineFootOfNorm;
import boofcv.core.image.GeneralizedImageOps;
import boofcv.factory.feature.detect.extract.FactoryFeatureExtractor;
import boofcv.struct.image.*;
import georegression.struct.line.LineParametric2D_F32;
import org.ddogleg.struct.FastQueue;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* @author Peter Abeles
*/
public class TestHoughTransformLineFootOfNorm {
int width = 30;
int height = 40;
/**
* See if it can detect an obvious line in the image
*/
@Test
public void obviousLines() {
obviousLines(ImageFloat32.class);
obviousLines(ImageSInt16.class);
obviousLines(ImageSInt32.class);
}
private <D extends ImageSingleBand> void obviousLines( Class<D> derivType ) {
ImageUInt8 binary = new ImageUInt8(width,height);
D derivX = GeneralizedImageOps.createSingleBand(derivType, width, height);
D derivY = GeneralizedImageOps.createSingleBand(derivType, width, height);
for( int i = 0; i < height; i++ ) {
binary.set(5, i, 1);
GeneralizedImageOps.set(derivX,5,i,20);
}
NonMaxSuppression extractor = FactoryFeatureExtractor.nonmax(new ConfigExtract(4, 2, 0, true));
HoughTransformLineFootOfNorm alg = new HoughTransformLineFootOfNorm(extractor,2);
alg.transform(derivX,derivY,binary);
FastQueue<LineParametric2D_F32> lines = alg.extractLines();
assertEquals(1,lines.size());
LineParametric2D_F32 l = lines.get(0);
assertEquals(l.p.x,5,0.1);
// normalize the line for easier evaluation
l.slope.x /= l.slope.norm();
l.slope.y /= l.slope.norm();
assertEquals(0,Math.abs(l.slope.x),0);
assertEquals(1,Math.abs(l.slope.y), 0.1);
}
}
| [
"peter.abeles@gmail.com"
] | peter.abeles@gmail.com |
a2a4d0e0c7bde81fbeb6bd8876abde1eaad9fdd4 | 947fc9eef832e937f09f04f1abd82819cd4f97d3 | /src/apk/e/b/i/b.java | d9faa18eb43d0adf1b6e1374ea642db4b4495c1c | [] | no_license | thistehneisen/cifra | 04f4ac1b230289f8262a0b9cf7448a1172d8f979 | d46c6f4764c9d4f64e45c56fa42fddee9b44ff5a | refs/heads/master | 2020-09-22T09:35:57.739040 | 2019-12-01T19:39:59 | 2019-12-01T19:39:59 | 225,136,583 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,796 | java | package e.b.i;
import e.b.d.g.o;
import e.b.n;
import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
/* compiled from: Schedulers */
public final class b {
/* renamed from: a reason: collision with root package name */
static final n f8336a = e.b.g.a.e(new h());
/* renamed from: b reason: collision with root package name */
static final n f8337b = e.b.g.a.b((Callable<n>) new C0093b<n>());
/* renamed from: c reason: collision with root package name */
static final n f8338c = e.b.g.a.c((Callable<n>) new c<n>());
/* renamed from: d reason: collision with root package name */
static final n f8339d = o.b();
/* renamed from: e reason: collision with root package name */
static final n f8340e = e.b.g.a.d(new f());
/* compiled from: Schedulers */
static final class a {
/* renamed from: a reason: collision with root package name */
static final n f8341a = new e.b.d.g.b();
}
/* renamed from: e.b.i.b$b reason: collision with other inner class name */
/* compiled from: Schedulers */
static final class C0093b implements Callable<n> {
C0093b() {
}
public n call() throws Exception {
return a.f8341a;
}
}
/* compiled from: Schedulers */
static final class c implements Callable<n> {
c() {
}
public n call() throws Exception {
return d.f8342a;
}
}
/* compiled from: Schedulers */
static final class d {
/* renamed from: a reason: collision with root package name */
static final n f8342a = new e.b.d.g.e();
}
/* compiled from: Schedulers */
static final class e {
/* renamed from: a reason: collision with root package name */
static final n f8343a = new e.b.d.g.f();
}
/* compiled from: Schedulers */
static final class f implements Callable<n> {
f() {
}
public n call() throws Exception {
return e.f8343a;
}
}
/* compiled from: Schedulers */
static final class g {
/* renamed from: a reason: collision with root package name */
static final n f8344a = new e.b.d.g.n();
}
/* compiled from: Schedulers */
static final class h implements Callable<n> {
h() {
}
public n call() throws Exception {
return g.f8344a;
}
}
public static n a() {
return e.b.g.a.a(f8337b);
}
public static n b() {
return e.b.g.a.b(f8338c);
}
public static n c() {
return e.b.g.a.c(f8336a);
}
public static n d() {
return f8339d;
}
public static n a(Executor executor) {
return new e.b.d.g.d(executor, false);
}
}
| [
"putnins@nils.digital"
] | putnins@nils.digital |
e437f4af5b2754f2eeb35c6b3ba4243baa0555e4 | b0d1dd5611bd6deb4cd5549dc778d7c6cd77477a | /sams/src/com/narendra/sams/web/restws/transportation/vo/RouteBusStopInfoVO.java | cc1baee21fd51c08156e17bb6ae54378e30a6d08 | [] | no_license | kajubaba/kamlesh | a28496e4bb8a277532ed01c9c9e0ced31b27b064 | 3419fd55afe8044660948cd6ed5342ed025b81e8 | refs/heads/master | 2021-07-06T16:22:47.738261 | 2017-10-02T06:59:23 | 2017-10-02T06:59:23 | 105,502,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 629 | java | package com.narendra.sams.web.restws.transportation.vo;
import java.util.List;
public class RouteBusStopInfoVO {
private RouteBusStopVO busStopInfo;
private List<RouteStudentVO> busStopStudents;
public List<RouteStudentVO> getBusStopStudents() {
return this.busStopStudents;
}
public void setBusStopStudents(List<RouteStudentVO> busStopStudents) {
this.busStopStudents = busStopStudents;
}
public RouteBusStopVO getBusStopInfo() {
return this.busStopInfo;
}
public void setBusStopInfo(RouteBusStopVO busStopInfo) {
this.busStopInfo = busStopInfo;
}
}
| [
"34kamlesh@gmail.com"
] | 34kamlesh@gmail.com |
4ef54bbd7a0c3a2618a799894b968da57902f524 | 06d76ab89e6cd8cc7d9281b65e0c92bfa3c32af5 | /mapsdk/src/main/java/com/sfmap/api/mapcore/util/ResponseEntity.java | ecfd1b02b6c494ff63beeed46b35ac37408ddafd | [] | no_license | onlie08/SFLocationDemo | f7042c598fdb1bd4fe5eeba791df6ae6f779d73e | 7c15f13b1d6335a6dbf20b6ee7cce62bd20c1ca9 | refs/heads/master | 2022-12-15T20:09:31.577510 | 2020-08-25T02:38:57 | 2020-08-25T02:38:57 | 217,438,626 | 1 | 0 | null | 2020-09-17T05:55:44 | 2019-10-25T02:54:37 | Java | UTF-8 | Java | false | false | 179 | java | package com.sfmap.api.mapcore.util;
import java.util.List;
import java.util.Map;
public class ResponseEntity
{
public byte[] resBytes;
public Map<String, List<String>> b;
}
| [
"conggong@sfmail.sf-express.com"
] | conggong@sfmail.sf-express.com |
50cc59ec606dd127fd326644d0a525b6ca9513ad | 431d8b2b2dc01d7cb2fd07868549f512bf0fa40e | /src/main/java/io/gs2/log/model/AccessLog.java | 933f93d530e253dda8cfa7314a17fd84883bdbb7 | [
"Apache-2.0",
"JSON"
] | permissive | gs2io/gs2-java-sdk | 3eba923a1effebd69613519ea86b5f2bf6aa4a37 | 0c498bf9a071f022df66c0c5444810fda160cd9f | refs/heads/master | 2023-08-31T22:13:14.378262 | 2023-08-24T04:31:37 | 2023-08-24T04:31:37 | 69,929,364 | 2 | 0 | Apache-2.0 | 2023-04-17T12:13:57 | 2016-10-04T02:47:53 | Java | UTF-8 | Java | false | false | 6,115 | java | /*
* Copyright 2016 Game Server Services, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package io.gs2.log.model;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
import java.io.Serializable;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.JsonNode;
import io.gs2.core.model.IModel;
@SuppressWarnings("serial")
@JsonIgnoreProperties(ignoreUnknown=true)
public class AccessLog implements IModel, Serializable {
private Long timestamp;
private String requestId;
private String service;
private String method;
private String userId;
private String request;
private String result;
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public AccessLog withTimestamp(Long timestamp) {
this.timestamp = timestamp;
return this;
}
public String getRequestId() {
return requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public AccessLog withRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getService() {
return service;
}
public void setService(String service) {
this.service = service;
}
public AccessLog withService(String service) {
this.service = service;
return this;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public AccessLog withMethod(String method) {
this.method = method;
return this;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public AccessLog withUserId(String userId) {
this.userId = userId;
return this;
}
public String getRequest() {
return request;
}
public void setRequest(String request) {
this.request = request;
}
public AccessLog withRequest(String request) {
this.request = request;
return this;
}
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public AccessLog withResult(String result) {
this.result = result;
return this;
}
public static AccessLog fromJson(JsonNode data) {
if (data == null) {
return null;
}
return new AccessLog()
.withTimestamp(data.get("timestamp") == null || data.get("timestamp").isNull() ? null : data.get("timestamp").longValue())
.withRequestId(data.get("requestId") == null || data.get("requestId").isNull() ? null : data.get("requestId").asText())
.withService(data.get("service") == null || data.get("service").isNull() ? null : data.get("service").asText())
.withMethod(data.get("method") == null || data.get("method").isNull() ? null : data.get("method").asText())
.withUserId(data.get("userId") == null || data.get("userId").isNull() ? null : data.get("userId").asText())
.withRequest(data.get("request") == null || data.get("request").isNull() ? null : data.get("request").asText())
.withResult(data.get("result") == null || data.get("result").isNull() ? null : data.get("result").asText());
}
public JsonNode toJson() {
return new ObjectMapper().valueToTree(
new HashMap<String, Object>() {{
put("timestamp", getTimestamp());
put("requestId", getRequestId());
put("service", getService());
put("method", getMethod());
put("userId", getUserId());
put("request", getRequest());
put("result", getResult());
}}
);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((this.timestamp == null) ? 0 : this.timestamp.hashCode());
result = prime * result + ((this.requestId == null) ? 0 : this.requestId.hashCode());
result = prime * result + ((this.service == null) ? 0 : this.service.hashCode());
result = prime * result + ((this.method == null) ? 0 : this.method.hashCode());
result = prime * result + ((this.userId == null) ? 0 : this.userId.hashCode());
result = prime * result + ((this.request == null) ? 0 : this.request.hashCode());
result = prime * result + ((this.result == null) ? 0 : this.result.hashCode());
return result;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null)
return false;
if (getClass() != o.getClass())
return false;
AccessLog other = (AccessLog) o;
if (timestamp == null) {
return other.timestamp == null;
} else if (!timestamp.equals(other.timestamp)) {
return false;
}
if (requestId == null) {
return other.requestId == null;
} else if (!requestId.equals(other.requestId)) {
return false;
}
if (service == null) {
return other.service == null;
} else if (!service.equals(other.service)) {
return false;
}
if (method == null) {
return other.method == null;
} else if (!method.equals(other.method)) {
return false;
}
if (userId == null) {
return other.userId == null;
} else if (!userId.equals(other.userId)) {
return false;
}
if (request == null) {
return other.request == null;
} else if (!request.equals(other.request)) {
return false;
}
if (result == null) {
return other.result == null;
} else if (!result.equals(other.result)) {
return false;
}
return true;
}
} | [
"ci@gs2.io"
] | ci@gs2.io |
775f98959b4a28a601de146c3c501481601d3931 | 502563a9902ec79e6d918a6d300760b585d82cd9 | /caffeine/src/main/java/com/github/benmanes/caffeine/cache/WriteOrderDeque.java | b559900dbed7775b915f9e2d4325bc90e4ed8689 | [
"Apache-2.0"
] | permissive | JunqiangYang/caffeine | a41e21e3bd3219aece3e9a5f47b96d364f5f24dc | 689b72607e9639261c21fb39cfc2072ee3e741d9 | refs/heads/master | 2020-03-16T00:13:16.991296 | 2018-05-01T13:39:07 | 2018-05-02T08:22:10 | 132,410,735 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,870 | java | /*
* Copyright 2014 Ben Manes. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.benmanes.caffeine.cache;
import java.util.Deque;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import com.github.benmanes.caffeine.cache.WriteOrderDeque.WriteOrder;
/**
* A linked deque implementation used to represent a write-order queue.
*
* @author ben.manes@gmail.com (Ben Manes)
* @param <E> the type of elements held in this collection
*/
@NotThreadSafe
final class WriteOrderDeque<E extends WriteOrder<E>> extends AbstractLinkedDeque<E> {
@Override
public boolean contains(Object o) {
return (o instanceof WriteOrder<?>) && contains((WriteOrder<?>) o);
}
// A fast-path containment check
boolean contains(WriteOrder<?> e) {
return (e.getPreviousInWriteOrder() != null)
|| (e.getNextInWriteOrder() != null)
|| (e == first);
}
@Override
@SuppressWarnings("unchecked")
public boolean remove(Object o) {
return (o instanceof WriteOrder<?>) && remove((E) o);
}
// A fast-path removal
public boolean remove(E e) {
if (contains(e)) {
unlink(e);
return true;
}
return false;
}
@Override
public @Nullable E getPrevious(E e) {
return e.getPreviousInWriteOrder();
}
@Override
public void setPrevious(E e, @Nullable E prev) {
e.setPreviousInWriteOrder(prev);
}
@Override
public @Nullable E getNext(E e) {
return e.getNextInWriteOrder();
}
@Override
public void setNext(E e, @Nullable E next) {
e.setNextInWriteOrder(next);
}
/**
* An element that is linked on the {@link Deque}.
*/
interface WriteOrder<T extends WriteOrder<T>> {
/**
* Retrieves the previous element or <tt>null</tt> if either the element is unlinked or the first
* element on the deque.
*/
@Nullable T getPreviousInWriteOrder();
/** Sets the previous element or <tt>null</tt> if there is no link. */
void setPreviousInWriteOrder(@Nullable T prev);
/**
* Retrieves the next element or <tt>null</tt> if either the element is unlinked or the last
* element on the deque.
*/
@Nullable T getNextInWriteOrder();
/** Sets the next element or <tt>null</tt> if there is no link. */
void setNextInWriteOrder(@Nullable T next);
}
}
| [
"ben.manes@gmail.com"
] | ben.manes@gmail.com |
c8f50f905c40f55ec9f0cb354ed9b0d176e6172e | bb2f32df072cd27fa90b0892057e66fec9b569d9 | /Java/Intorduction_to_Java_Programming/Chapter18/src/afterChapterApps/ReverseString.java | 09a96b709c793c1b955064b5eb0ee657c641ff64 | [] | no_license | amerelsayed2020/Learning | 9417777f28b8d5161e6761d98c3e64cd9f998d3a | 689acd3f8de57ce67dc610cae659d88782270668 | refs/heads/master | 2023-04-27T11:34:54.622157 | 2020-07-09T15:40:36 | 2020-07-09T15:40:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package afterChapterApps;
import java.util.Scanner;
/**
* Created by robert on 21.01.16.
*/
public class ReverseString {
public static void main(String[] args) {
System.out.print("Enter a string: ");
Scanner input = new Scanner(System.in);
String string = input.nextLine();
reverseDisplay(string);
}
public static void reverseDisplay(String string) {
if (string.length() == 0) {
System.out.println();
} else {
System.out.print(string.charAt(string.length() - 1));
reverseDisplay(string.substring(0, string.length() - 1));
}
}
}
| [
"r.duriancik@gmail.com"
] | r.duriancik@gmail.com |
3334f459e21f150d3d8f24129670ef387113ff97 | ec9bf57a07b7b06134ec7a21407a11f69cc644f7 | /src/android/support/design/widget/AppBarLayout$Behavior$1.java | efada538bba7a25d50388e319a6f5e9cf64a51e5 | [] | no_license | jzarca01/com.ubercab | f95c12cab7a28f05e8f1d1a9d8a12a5ac7fbf4b1 | e6b454fb0ad547287ae4e71e59d6b9482369647a | refs/heads/master | 2020-06-21T04:37:43.723581 | 2016-07-19T16:30:34 | 2016-07-19T16:30:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 488 | java | package android.support.design.widget;
import cq;
import ct;
final class AppBarLayout$Behavior$1
implements ct
{
AppBarLayout$Behavior$1(AppBarLayout.Behavior paramBehavior, CoordinatorLayout paramCoordinatorLayout, AppBarLayout paramAppBarLayout) {}
public final void a(cq paramcq)
{
c.a_(a, b, paramcq.c());
}
}
/* Location:
* Qualified Name: android.support.design.widget.AppBarLayout.Behavior.1
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.