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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
596fab6c11ac61071ab5e8ba468163d805f8b0b6 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /resourcemanager-20200331/src/main/java/com/aliyun/resourcemanager20200331/models/MoveAccountResponseBody.java | 0cf1340d2439dfecb3ed2eb1d324b7d2d9c3f1dd | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 722 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.resourcemanager20200331.models;
import com.aliyun.tea.*;
public class MoveAccountResponseBody extends TeaModel {
/**
* <p>The ID of the request.</p>
*/
@NameInMap("RequestId")
public String requestId;
public static MoveAccountResponseBody build(java.util.Map<String, ?> map) throws Exception {
MoveAccountResponseBody self = new MoveAccountResponseBody();
return TeaModel.build(map, self);
}
public MoveAccountResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
}
| [
"[email protected]"
] | |
75eee54624740b4fe37d7c97316a7fc9bc534d9e | 61fd833d2676ec21386f1b3b2634bbecfe574935 | /ccl-codegen/src/main/java/com/ccl/rain/codegen/AbstractModelUpdateRepository.java | 03a03e9f8a1a5de9cd77d64108d646ef1d11bbd9 | [] | no_license | freedom541/raindrop | 7bff92421642a9a33671f0c295a0bec669ac099e | 1131a4ae0a845b67e3feccc6a227eb6594e02340 | refs/heads/master | 2021-07-11T01:37:48.579479 | 2017-09-30T02:44:47 | 2017-09-30T02:44:47 | 101,834,248 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,155 | java | package com.ccl.rain.codegen;
import org.springframework.context.ApplicationContext;
import javax.inject.Inject;
import javax.sql.DataSource;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* @author ccl
* @date 2017/8/29.
*/
public abstract class AbstractModelUpdateRepository<Entity extends IdEntity<ID>, ID extends Serializable, Model extends DataModel<Entity, ID>>
extends AbstractDataQueryAndBatchUpdateRepository<Entity, ID> implements ModelUpdateRepository<Model, Entity, ID> {
protected Class<Model> modelClass;
protected BeanDesc modelBeanDesc;
@Inject
protected ApplicationContext ctx;
public AbstractModelUpdateRepository(DataSource dataSource) {
super(dataSource);
initType(this.getClass());
}
public AbstractModelUpdateRepository(QueryDslConfig queryDslConfig) {
super(queryDslConfig);
initType(this.getClass());
}
private void initType(Class<?> cls) {
Type superType = cls.getGenericSuperclass();
if (superType instanceof ParameterizedType) {
ParameterizedType ptype = (ParameterizedType) superType;
Type cmpType = ptype.getActualTypeArguments()[2];
this.modelClass = (Class<Model>) cmpType;
}
BeanConvertUtils.registerModelType(modelClass);
modelBeanDesc = BeanConvertUtils.getModelBeanDesc(modelClass);
}
@Override
public Model createModel(Model model) {
Entity entity = BeanConvertUtils.convertModelToEntity(model, entityClass);
create(entity);
return BeanConvertUtils.convertEntityToModel(entity, modelClass);
}
@Override
public void createModels(@NotNull @Valid Collection<Model> models) {
List<Entity> entities = new ArrayList<>();
for (Model model : models) {
entities.add(BeanConvertUtils.convertModelToEntity(model, entityClass));
}
create(entities);
}
@Override
public Model updateModel(Model model) {
Entity entity = BeanConvertUtils.convertModelToEntity(model, entityClass);
update(entity);
return BeanConvertUtils.convertEntityToModel(entity, modelClass);
}
@Override
public void updateModels(@NotNull @Valid Collection<Model> models) {
List<Entity> entities = new ArrayList<>();
for (Model model : models) {
entities.add(BeanConvertUtils.convertModelToEntity(model, entityClass));
}
update(entities);
}
@Override
public Model updateModelWithNotNull(Model model) {
Entity entity = BeanConvertUtils.convertModelToEntity(model, entityClass);
updateWithNotNull(entity);
return BeanConvertUtils.convertEntityToModel(entity, modelClass);
}
@Override
public void deleteModel(ID id) {
deleteById(id);
}
@Override
public void deleteModels(Collection<ID> ids) {
deleteByIds(ids);
}
}
| [
"[email protected]"
] | |
447a64d6327e81f3ce01286eb77ba3f757547c4b | 5e8cc24f34f603bf114324833282d6ea054a88eb | /src/main/java/com/softwareverde/bitcoin/secp256k1/Secp256k1.java | 558dc4fa5ccc19bc25ef00735bfecb3a8cce806f | [
"MIT"
] | permissive | ParadoxBusinessGroup/bitcoin-verde | 9158d47e11a6f8d53251762f0ee975964cbb919e | 5d1e51cf40d536b7fc7bebe71b2ed1d26ae40bcc | refs/heads/master | 2020-05-27T07:25:52.223036 | 2019-05-15T13:52:40 | 2019-05-15T13:53:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,034 | java | package com.softwareverde.bitcoin.secp256k1;
import com.softwareverde.bitcoin.jni.NativeSecp256k1;
import com.softwareverde.bitcoin.secp256k1.key.PublicKey;
import com.softwareverde.bitcoin.secp256k1.signature.Secp256k1Signature;
import com.softwareverde.bitcoin.secp256k1.signature.Signature;
import com.softwareverde.constable.bytearray.ByteArray;
import com.softwareverde.constable.bytearray.MutableByteArray;
import com.softwareverde.io.Logger;
import org.bouncycastle.crypto.params.ECDomainParameters;
import org.bouncycastle.crypto.params.ECPrivateKeyParameters;
import org.bouncycastle.crypto.params.ECPublicKeyParameters;
import org.bouncycastle.crypto.signers.ECDSASigner;
import org.bouncycastle.jce.ECNamedCurveTable;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.jce.spec.ECNamedCurveParameterSpec;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;
import java.math.BigInteger;
import java.security.Security;
public class Secp256k1 {
protected static final ECCurve CURVE;
protected static final ECPoint CURVE_POINT_G;
public static final ECDomainParameters CURVE_DOMAIN;
static {
Security.addProvider(new BouncyCastleProvider());
final ECNamedCurveParameterSpec curveParameterSpec = ECNamedCurveTable.getParameterSpec("secp256k1");
CURVE_POINT_G = curveParameterSpec.getG();
CURVE = curveParameterSpec.getCurve();
CURVE_DOMAIN = new ECDomainParameters(CURVE, CURVE_POINT_G, curveParameterSpec.getN());
}
public static byte[] getPublicKeyPoint(final byte[] privateKeyBytes) {
final ECPoint pointQ = Secp256k1.CURVE_POINT_G.multiply(new BigInteger(1, privateKeyBytes));
return pointQ.getEncoded();
}
public static ByteArray getPublicKeyPoint(final ByteArray privateKey) {
final ECPoint pointQ = Secp256k1.CURVE_POINT_G.multiply(new BigInteger(1, privateKey.getBytes()));
return MutableByteArray.wrap(pointQ.getEncoded());
}
protected static Boolean _verifySignatureViaBouncyCastle(final Signature signature, final PublicKey publicKey, final byte[] message) {
final ECPublicKeyParameters publicKeyParameters;
{
final ECPoint publicKeyPoint = Secp256k1.CURVE.decodePoint(publicKey.getBytes());
publicKeyParameters = new ECPublicKeyParameters(publicKeyPoint, Secp256k1.CURVE_DOMAIN);
}
final ECDSASigner signer = new ECDSASigner();
signer.init(false, publicKeyParameters);
try {
return signer.verifySignature(message, new BigInteger(1, signature.getR().getBytes()), new BigInteger(1, signature.getS().getBytes()));
}
catch (final Exception exception) {
// NOTE: Bouncy Castle contains/contained a bug that would crash during certain specially-crafted malicious signatures.
// Instead of crashing, the signature is instead just marked as invalid.
Logger.log(exception);
return false;
}
}
protected static Boolean _verifySignatureViaJni(final Signature signature, final PublicKey publicKey, final byte[] message) {
try {
return NativeSecp256k1.verify(message, signature.asCanonical().encode().getBytes(), publicKey.getBytes());
}
catch (Exception e) {
Logger.log(e);
return false;
}
}
public static Boolean verifySignature(final Signature signature, final PublicKey publicKey, final byte[] message) {
if (NativeSecp256k1.isEnabled()) {
return _verifySignatureViaJni(signature, publicKey, message);
}
// Fallback to BouncyCastle if the libsecp256k1 failed to load for this architecture...
return _verifySignatureViaBouncyCastle(signature, publicKey, message);
}
public static Signature sign(final byte[] privateKey, final byte[] message) {
final ECPrivateKeyParameters privateKeyParameters;
{
final BigInteger privateKeyBigInteger = new BigInteger(1, privateKey);
privateKeyParameters = new ECPrivateKeyParameters(privateKeyBigInteger, Secp256k1.CURVE_DOMAIN);
}
final ECDSASigner signer = new ECDSASigner();
signer.init(true, privateKeyParameters);
final BigInteger r;
final BigInteger s;
{
final BigInteger[] signatureIntegers = signer.generateSignature(message);
r = signatureIntegers[0];
s = signatureIntegers[1];
}
final byte[] rBytes = r.toByteArray();
final byte[] sBytes;
{ // BIP-62: Reducing Transaction Malleability: https://github.com/bitcoin/bips/blob/master/bip-0062.mediawiki#Low_S_values_in_signatures
// Since S may be positive or negative mod N, there are two valid signatures to a message.
// In order to help eliminate transaction malleability, by convention, the S value will always be
// transformed to be the lower of its two possible values.
// For instance, assume N is 10, and S is 8. Another valid value for S could be 2 (i.e. -8 mod 10 == 2).
// The lower S can be calculated by taking N and subtracting S (i.e. 10 - 8 = 2).
final BigInteger n = CURVE_DOMAIN.getN();
if (s.compareTo(n.shiftRight(1)) <= 0) {
sBytes = s.toByteArray();
}
else {
sBytes = n.subtract(s).toByteArray();
}
}
return new Secp256k1Signature(rBytes, sBytes);
}
public static byte[] decompressPoint(byte[] encodedPublicKeyPoint) {
final ECPoint decodedPoint = CURVE.decodePoint(encodedPublicKeyPoint);
final BigInteger x = decodedPoint.getX().toBigInteger();
final BigInteger y = decodedPoint.getY().toBigInteger();
final ECPoint decompressedPoint = CURVE.createPoint(x, y, false);
return decompressedPoint.getEncoded();
}
protected Secp256k1() { }
}
| [
"[email protected]"
] | |
e5487d2ee2105e74dc1a923dc54ce41b93b2c288 | e465358040c4de9d5dc9a3e1e08fa4eb27547810 | /hyracks/hyracks/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/client/IHyracksClientInterface.java | 737152bb3b5d1bef25ed9f7846cf67eb91332184 | [] | no_license | zhaosheng-zhang/cdnc | 84ff7511b57c260e070fc0f3f1d941f39101116e | bc436a948ab1a7eb5df9857916592c7e7b39798c | refs/heads/master | 2016-08-04T18:43:31.480569 | 2013-10-15T17:29:04 | 2013-10-15T17:29:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,937 | java | /*
* Copyright 2009-2013 by The Regents of the University of California
* 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 from
*
* 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 edu.uci.ics.hyracks.api.client;
import java.net.URL;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import edu.uci.ics.hyracks.api.comm.NetworkAddress;
import edu.uci.ics.hyracks.api.deployment.DeploymentId;
import edu.uci.ics.hyracks.api.job.JobFlag;
import edu.uci.ics.hyracks.api.job.JobId;
import edu.uci.ics.hyracks.api.job.JobStatus;
import edu.uci.ics.hyracks.api.topology.ClusterTopology;
public interface IHyracksClientInterface {
public ClusterControllerInfo getClusterControllerInfo() throws Exception;
public JobStatus getJobStatus(JobId jobId) throws Exception;
public JobId startJob(byte[] acggfBytes, EnumSet<JobFlag> jobFlags) throws Exception;
public NetworkAddress getDatasetDirectoryServiceInfo() throws Exception;
public void waitForCompletion(JobId jobId) throws Exception;
public Map<String, NodeControllerInfo> getNodeControllersInfo() throws Exception;
public ClusterTopology getClusterTopology() throws Exception;
public void deployBinary(List<URL> binaryURLs, DeploymentId deploymentId) throws Exception;
public void unDeployBinary(DeploymentId deploymentId) throws Exception;
public JobId startJob(DeploymentId deploymentId, byte[] acggfBytes, EnumSet<JobFlag> jobFlags) throws Exception;
} | [
"[email protected]"
] | |
173a96a4c56992476dab3841bcbe533bdaac0443 | 452e7ffd787957f401e13dc53425a5f4ad752092 | /静安区社区就业服务e本通(可以运行)/ZBETuch_new/src/com/fc/main/dao/WorkToDateDao.java | b2b65b66672212a30a7a22b710bf159bab0aeeba | [] | no_license | 2381447237/gongsiCode | 5807ee03f314dbc2a58e19a144b83387141dfa7d | 17bf3fb0127462bccb972e6fac590dc16e0b5aeb | refs/heads/master | 2020-03-12T19:28:44.886880 | 2018-04-24T02:40:28 | 2018-04-24T02:40:28 | 130,785,146 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,215 | java | package com.fc.main.dao;
import java.io.IOException;
import java.util.Map;
import org.apache.http.client.ClientProtocolException;
import com.fc.main.tools.HttpUtil;
public class WorkToDateDao {
/**
* 上传工作日志
*
* @param data
* @return
*/
public String setWorkDate(String filePath, Map<String, String> data) {
String url = "/Json/Set_WorkToDate.aspx";
try {
String valueString = HttpUtil.upLoadImage(url, filePath, data);
System.out.println("value"+valueString);
return valueString;
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "";
}
/**
* 得到工作日志列表
*
* @param data
* @return
*/
public String getWorkDateList(Map<String, String> data) {
String url = "/Json/Get_WorkToDate.aspx";
// String url =
// "/Json/Get_WorkToDate.aspx?page="+data.get("page")+"&rows="+data.get("rows");
try {
String valueStr = HttpUtil.postRequest(url, data);
// String valueStr = HttpUtil.getRequest(url);
return valueStr;
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "";
}
/**
* 得到工作日志图片
*
* @param id
* @return
*/
public byte[] getWorkToDateImage(int id) {
String url = "/Json/Get_WorkToDate_Pic.aspx?id=" + id;
try {
return HttpUtil.getImage(url);
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public String getLoginInfo(Map<String, String> data) {
String url = "/Json/Get_Staff_Login.aspx";
try {
String valueString = HttpUtil.postRequest(url, data);
return valueString;
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "";
}
public String getLoginInfosString(Map<String, String> data) {
String url = "/Json/Get_Staff_Log.aspx";
try {
String valueString = HttpUtil.postRequest(url, data);
return valueString;
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return "";
}
}
| [
"[email protected]"
] | |
a63ea0ce8ed5303f478d612be96aa7f896489efe | 0f68c0f88c5cbccd421449ea960db31a798ebf38 | /src/main/java/cn/com/hh/service/biz/impl/ContractMemberProfitLossBizServiceImpl.java | a6f7216e12679596c9a7d9a415fddc487ce0e0a3 | [] | no_license | leimu222/exchange | 0e5c72658f5986d99dc96a6e860444e2624e90e2 | e22bfc530a230ba23088a36b6d86a9a380d7a8ef | refs/heads/master | 2023-01-31T16:19:37.498040 | 2020-12-08T10:30:46 | 2020-12-08T10:30:46 | 319,348,177 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,486 | java | package com.common.api.service.impl;
import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import com.common.api.dao.ContractMemberProfitLossMapper;
import com.common.api.model.ContractMemberProfitLoss;
import com.common.api.service.IContractMemberProfitLossService;
/**
* @author Gavin Lee
* @version 1.0
* @date 2020-12-08 18:16:03
* Description: [contractBiz服务实现]
*/
@Service
public class ContractMemberProfitLossBizServiceImpl extends CommonService implements IContractMemberProfitLossBizService {
@Autowired
private IContractMemberProfitLossService contractMemberProfitLossService;
/**
* 查询contract
*
* @param id contractID
* @return contract
*/
@Override
public ContractMemberProfitLoss selectContractMemberProfitLossById(Long id) {
return contractMemberProfitLossService.selectContractMemberProfitLossById(id);
}
/**
* 查询contract列表
*
* @param contractMemberProfitLoss contract
* @return contract
*/
@Override
public List<ContractMemberProfitLoss> selectContractMemberProfitLossList(ContractMemberProfitLoss contractMemberProfitLoss) {
return contractMemberProfitLossService.selectContractMemberProfitLossList(contractMemberProfitLoss);
}
/**
* 新增contract
*
* @param contractMemberProfitLoss contract
* @return 结果
*/
@Override
public int insertContractMemberProfitLoss(ContractMemberProfitLoss contractMemberProfitLoss) {
return contractMemberProfitLossService.insertContractMemberProfitLoss(contractMemberProfitLoss);
}
/**
* 修改contract
*
* @param contractMemberProfitLoss contract
* @return 结果
*/
@Override
public int updateContractMemberProfitLoss(ContractMemberProfitLoss contractMemberProfitLoss) {
return contractMemberProfitLossService.updateContractMemberProfitLoss(contractMemberProfitLoss);
}
/**
* 批量删除contract
*
* @param ids 需要删除的contractID
* @return 结果
*/
@Override
public int deleteContractMemberProfitLossByIds(Long[] ids) {
return contractMemberProfitLossService.deleteContractMemberProfitLossByIds(ids);
}
/**
* 删除contract信息
*
* @param id contractID
* @return 结果
*/
@Override
public int deleteContractMemberProfitLossById(Long id) {
return contractMemberProfitLossService.deleteContractMemberProfitLossById(id);
}
}
| [
"[email protected]"
] | |
4179bfd9a89119f5ffd2c89f93a905ccbaf1f2a3 | 3feddaf8e0cad4c98a917997a90262fb3779931b | /thunder/thunder-bean/src/main/java/club/zhcs/thunder/bean/apm/package-info.java | d15c580ced9d3f19e4bd28d191b7dcfa053407cf | [
"Apache-2.0"
] | permissive | fanqun/NUTZ-ONEKEY | 84ff603c850ddd602648a546a2b202e910a33966 | 273b6bad3a77168705c141e360d346c0c6a51c5c | refs/heads/master | 2020-04-05T22:47:05.540902 | 2016-10-30T02:32:17 | 2016-10-30T02:32:17 | 61,939,203 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 230 | java | /**
*
* @author Kerbores([email protected])
*
* @project thunder-bean
*
* @file package-info.java
*
* @description //TODO
*
* @time 2016年3月8日 上午10:51:26
*
*/
package club.zhcs.thunder.bean.apm; | [
"[email protected]"
] | |
26dc1308a152501462913e0e41c5dee1ab2fb85c | 1ed626a8b0bb99860e759ac613da0f57b59fcf45 | /plugins/android/eeui/src/main/java/app/eeui/framework/extend/integration/glide/util/ViewPreloadSizeProvider.java | 6135c42b9b9df11b1764ca83c33414ad98a214de | [
"MIT"
] | permissive | iquejay/eeui-template | c407eae90aab67d9edb482395dc1fe28ebc9efc8 | c819666efcdc85e57e6f59b74bd15becf9b64c21 | refs/heads/master | 2020-09-08T10:23:04.819923 | 2019-11-13T15:35:32 | 2019-11-13T15:35:32 | 221,107,208 | 0 | 0 | MIT | 2020-06-25T16:19:27 | 2019-11-12T01:55:03 | C++ | UTF-8 | Java | false | false | 3,126 | java | package app.eeui.framework.extend.integration.glide.util;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;
import app.eeui.framework.extend.integration.glide.ListPreloader;
import app.eeui.framework.extend.integration.glide.request.target.SizeReadyCallback;
import app.eeui.framework.extend.integration.glide.request.target.ViewTarget;
import app.eeui.framework.extend.integration.glide.request.transition.Transition;
import java.util.Arrays;
/**
* A {@link app.eeui.framework.extend.integration.glide.ListPreloader.PreloadSizeProvider} that will extract the preload size
* from a given {@link android.view.View}.
*
* @param <T> The type of the model the size should be provided for.
*/
public class ViewPreloadSizeProvider<T> implements ListPreloader.PreloadSizeProvider<T>,
SizeReadyCallback {
private int[] size;
// We need to keep a strong reference to the Target so that it isn't garbage collected due to a
// weak reference
// while we're waiting to get its size.
@SuppressWarnings("unused")
private SizeViewTarget viewTarget;
/**
* Constructor that does nothing by default and requires users to call {@link
* #setView(android.view.View)} when a View is available to registerComponents the dimensions
* returned by this class.
*/
public ViewPreloadSizeProvider() {
// This constructor is intentionally empty. Nothing special is needed here.
}
/**
* Constructor that will extract the preload size from a given {@link android.view.View}.
*
* @param view A not null View the size will be extracted from async using an {@link
* android.view.ViewTreeObserver .OnPreDrawListener}
*/
// Public API.
@SuppressWarnings("WeakerAccess")
public ViewPreloadSizeProvider(@NonNull View view) {
viewTarget = new SizeViewTarget(view, this);
}
@Nullable
@Override
public int[] getPreloadSize(@NonNull T item, int adapterPosition, int itemPosition) {
if (size == null) {
return null;
} else {
return Arrays.copyOf(size, size.length);
}
}
@Override
public void onSizeReady(int width, int height) {
size = new int[]{width, height};
viewTarget = null;
}
/**
* Sets the {@link android.view.View} the size will be extracted.
*
* <p> Note - only the first call to this method will be obeyed, subsequent requests will be
* ignored. </p>
*
* @param view A not null View the size will be extracted async with an {@link
* android.view.ViewTreeObserver .OnPreDrawListener}
*/
public void setView(@NonNull View view) {
if (size != null || viewTarget != null) {
return;
}
viewTarget = new SizeViewTarget(view, this);
}
private static final class SizeViewTarget extends ViewTarget<View, Object> {
SizeViewTarget(@NonNull View view, @NonNull SizeReadyCallback callback) {
super(view);
getSize(callback);
}
@Override
public void onResourceReady(@NonNull Object resource,
@Nullable Transition<? super Object> transition) {
// Do nothing
}
}
}
| [
"[email protected]"
] | |
067e0e2172c22cefcef44a7476d0303fd3b917d7 | d214b58e54c97019dc562f0b9786fed163baa219 | /src/main/java/com/gxwzu/core/util/page/PageUtil.java | fba8f05a2b8b4a827849771098cf83bc33dcc87e | [] | no_license | hhufu/gdm | 9a97d4dd2b365ed75c87cbbe9817b714b562681b | cca682b9f9e633140529006c8f3a5c3436a59dc5 | refs/heads/master | 2022-11-11T08:22:15.946609 | 2020-05-01T13:01:52 | 2020-05-01T13:01:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,208 | java | package com.gxwzu.core.util.page;
/**
* @author 梧州学院 软件研发中心
* @version 1.0 <br>
* Copyright (C), 2009, 梧州学院 软件研发中心 <br>
* This program is protected by copyright laws. <br>
* Program Name: 分页功能集合 <br>
* 作用:分页中的某一些功能进行封装 <br>
* Date: 2009/07/25
*/
public class PageUtil {
/**
* 对分页中底部的导航条
*
* @param pageBean
* 分页对象
* @return 底部导航菜单
*/
public static String pageFooter(PageBean pageBean, String url,
String parameter, String pagename) {
String firstPage = "";// 第一页
String jumpPage = "";//跳转页面下拉框
String lastPage = "";// 最后一页
String footer = "";// 底部导航菜单
// 如果现在是第一页,则第一页和上一页为没有连接的字符
if (pageBean.getCurrentPage() == 1) {
firstPage = " 第一页 上一页 ";
} else {
firstPage = " <a href=\"" + url + pagename + "=1&" + parameter + "\">第一页</a> "
+ "<a href=\"" + url + pagename + "="+ (pageBean.getCurrentPage() - 1) + "&" + parameter + "\">" + "上一页</a> ";
}
jumpPage += "<select name=" +pagename+ ">";
for(int i=1;i<=pageBean.getTotalPage();i++){
jumpPage += "<option value="+i+">第"+i+"页</option>";
}
jumpPage += "</select>";
jumpPage += "<input type=\"button\" value=\"跳转\" onClick=\"jump_submit('" + pagename + "','" + url+parameter + "')\">";
if (pageBean.getCurrentPage() < pageBean.getTotalPage()) {
lastPage = "<a href=\"" + url + pagename + "=" + (pageBean.getCurrentPage() + 1) + "&" + parameter + "\">" + "<下一页 /a> "
+ "<a href=\"" + url + pagename + "=" + pageBean.getTotalPage() + "&" + parameter + "\">最后一页</a> ";
} else {
lastPage = " 下一页 最后一页 ";
}
footer = "共 " + pageBean.getAllRow() + " 记录 共 "
+ pageBean.getTotalPage() + " 页";
footer = footer + " 当前 " + pageBean.getCurrentPage() + " 页";
footer = "<form id=\"" + pagename + "\" action=\"" + url + "\" method=\"post\">"+ footer + firstPage + jumpPage + lastPage + "</form>";
return footer;
}
}
| [
"[email protected]"
] | |
5061597aa0b3484565240adb16e6e3371427e901 | 8d9293642d3c12f81cc5f930e0147a9d65bd6efb | /src/main/java/net/minecraft/util/datafix/fixes/EntityRavagerRenameFix.java | d209a42df0a4e3d0e447020599dec71180a1f2fa | [] | no_license | NicholasBlackburn1/Blackburn-1.17 | 7c086591ac77cf433af248435026cf9275223daa | fd960b995b33df75ce61865ba119274d9b0e4704 | refs/heads/main | 2022-07-28T03:27:14.736924 | 2021-09-23T15:55:53 | 2021-09-23T15:55:53 | 399,960,376 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 718 | java | package net.minecraft.util.datafix.fixes;
import com.google.common.collect.ImmutableMap;
import com.mojang.datafixers.schemas.Schema;
import java.util.Map;
import java.util.Objects;
public class EntityRavagerRenameFix extends SimplestEntityRenameFix {
public static final Map<String, String> RENAMED_IDS = ImmutableMap.<String, String>builder().put("minecraft:illager_beast_spawn_egg", "minecraft:ravager_spawn_egg").build();
public EntityRavagerRenameFix(Schema p_15594_, boolean p_15595_) {
super("EntityRavagerRenameFix", p_15594_, p_15595_);
}
protected String rename(String p_15597_) {
return Objects.equals("minecraft:illager_beast", p_15597_) ? "minecraft:ravager" : p_15597_;
}
} | [
"[email protected]"
] | |
a83cf1b77ade4a421eeeb6658aeeaa458a30c57d | b729e366a23b2d462c1be1360033fdfe16bfaa33 | /src/main/java/cm/bdlz/functional/SumOfThreeIntAddZero.java | 00c2fd6c350d30b388a6d77fecdcf9d16a863cbd | [] | no_license | Ramakrishnavelisetti31/Functiobal-Problems-Day5 | ad6077f8e689a33591b6e459e8626fcbe07b4982 | 0b1217c3802330059fbd2f7cd05ed8884dd0ffa3 | refs/heads/master | 2023-08-07T12:27:17.679736 | 2021-10-08T16:05:38 | 2021-10-08T16:05:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,071 | java | package cm.bdlz.functional;
import java.util.Scanner;
public class SumOfThreeIntAddZero {
public static void main(String[] args) {
Scanner arr=new Scanner(System.in);
System.out.println("Enter the no of integer to include in array:");
int len=arr.nextInt();
arr.close();
System.out.println("Enter the value for array:");
int[] ar = new int[len];
for(int i=0;i<len;i++)
{
ar[i]=arr.nextInt();
}
int count=0;
for(int i=0;i<len-2;i++) {
for (int j = i + 1; j < len - 1; j++)
{
for(int k=j+1;k<len;k++)
{
if(ar[i] + ar[j] + ar[k] == 0)
{
System.out.println("("+ar[i]+" , "+ar[j]+" , "+ar[k]+")");
count++;
}
}
}
}
System.out.println("These are the distinct triplets equal to zero");
System.out.println("There are "+count+" distinct triplets");
}
}
| [
"[email protected]"
] | |
9b796ca6a538cdb80ce39d886f20b3e4db7195a8 | 723cf379d4f5003337100548db3121081fe08504 | /javax/swing/plaf/basic/BasicColorChooserUI.java | 95798e1d5794ddd227cf2704e7d51ff0640d47e1 | [] | no_license | zxlooong/jdk13120 | 719b53375da0a5a49cf74efb42345653ccd1e9c1 | f8bcd92167a3bf8dd9b1a77009d96d0f5653b825 | refs/heads/master | 2016-09-06T18:11:53.353084 | 2013-12-06T16:09:41 | 2013-12-06T16:09:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,305 | java | /*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.swing.plaf.basic;
import javax.swing.*;
import javax.swing.colorchooser.*;
import javax.swing.event.*;
import javax.swing.border.*;
import javax.swing.plaf.*;
import java.util.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
/**
* Provides the basic look and feel for a JColorChooser.
* <p>
* @version 1.26 02/06/02
* @author Tom Santos
* @author Steve Wilson
*/
public class BasicColorChooserUI extends ColorChooserUI
{
JColorChooser chooser;
JTabbedPane tabbedPane;
JPanel singlePanel;
JPanel previewPanelHolder;
JComponent previewPanel;
boolean isMultiPanel = false;
protected AbstractColorChooserPanel[] defaultChoosers;
protected ChangeListener previewListener;
protected PropertyChangeListener propertyChangeListener;
public static ComponentUI createUI(JComponent c) {
return new BasicColorChooserUI();
}
protected AbstractColorChooserPanel[] createDefaultChoosers() {
AbstractColorChooserPanel[] panels = ColorChooserComponentFactory.getDefaultChooserPanels();
return panels;
}
protected void uninstallDefaultChoosers() {
for( int i = 0 ; i < defaultChoosers.length; i++) {
chooser.removeChooserPanel( defaultChoosers[i] );
}
}
public void installUI( JComponent c ) {
chooser = (JColorChooser)c;
super.installUI( c );
installDefaults();
installListeners();
tabbedPane = new JTabbedPane();
singlePanel = new JPanel(new CenterLayout());
chooser.setLayout( new BorderLayout() );
defaultChoosers = createDefaultChoosers();
chooser.setChooserPanels(defaultChoosers);
installPreviewPanel();
}
public void uninstallUI( JComponent c ) {
uninstallListeners();
uninstallDefaultChoosers();
uninstallDefaults();
defaultChoosers = null;
chooser = null;
tabbedPane = null;
}
protected void installPreviewPanel() {
previewPanelHolder = new JPanel(new CenterLayout());
String previewString = UIManager.getString("ColorChooser.previewText");
previewPanelHolder.setBorder(new TitledBorder(previewString));
previewPanel = chooser.getPreviewPanel();
if (previewPanel == null || previewPanel instanceof UIResource) {
previewPanel = ColorChooserComponentFactory.getPreviewPanel(); // get from table?
}
previewPanel.setForeground(chooser.getColor());
previewPanelHolder.add(previewPanel);
chooser.add(previewPanelHolder, BorderLayout.SOUTH);
}
protected void installDefaults() {
LookAndFeel.installColorsAndFont(chooser, "ColorChooser.background",
"ColorChooser.foreground",
"ColorChooser.font");
}
protected void uninstallDefaults() {
}
protected void installListeners() {
propertyChangeListener = createPropertyChangeListener();
chooser.addPropertyChangeListener( propertyChangeListener );
previewListener = new PreviewListener();
chooser.getSelectionModel().addChangeListener(previewListener);
}
protected PropertyChangeListener createPropertyChangeListener() {
return new PropertyHandler();
}
protected void uninstallListeners() {
chooser.removePropertyChangeListener( propertyChangeListener );
chooser.getSelectionModel().removeChangeListener(previewListener);
}
class PreviewListener implements ChangeListener {
public void stateChanged( ChangeEvent e ) {
ColorSelectionModel model = (ColorSelectionModel)e.getSource();
if (previewPanel != null) {
previewPanel.setForeground(model.getSelectedColor());
previewPanel.repaint();
}
}
}
/**
* This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of <Foo>.
*/
public class PropertyHandler implements PropertyChangeListener {
public void propertyChange(PropertyChangeEvent e) {
if ( e.getPropertyName().equals( JColorChooser.CHOOSER_PANELS_PROPERTY ) ) {
AbstractColorChooserPanel[] oldPanels = (AbstractColorChooserPanel[]) e.getOldValue();
AbstractColorChooserPanel[] newPanels = (AbstractColorChooserPanel[]) e.getNewValue();
for (int i = 0; i < oldPanels.length; i++) { // remove old panels
Container wrapper = oldPanels[i].getParent();
if (wrapper != null) {
Container parent = wrapper.getParent();
if (parent != null)
parent.remove(wrapper); // remove from hierarchy
oldPanels[i].uninstallChooserPanel(chooser); // uninstall
}
}
int numNewPanels = newPanels.length;
if (numNewPanels == 0) { // removed all panels and added none
chooser.remove(tabbedPane);
return;
}
else if (numNewPanels == 1) { // one panel case
chooser.remove(tabbedPane);
JPanel centerWrapper = new JPanel( new CenterLayout() );
centerWrapper.add(newPanels[0]);
singlePanel.add(centerWrapper, BorderLayout.CENTER);
chooser.add(singlePanel);
}
else { // multi-panel case
if ( oldPanels.length < 2 ) {// moving from single to multiple
chooser.remove(singlePanel);
tabbedPane = new JTabbedPane();
chooser.add(tabbedPane, BorderLayout.CENTER);
}
for (int i = 0; i < newPanels.length; i++) {
JPanel centerWrapper = new JPanel( new CenterLayout() );
centerWrapper.add(newPanels[i]);
tabbedPane.addTab(newPanels[i].getDisplayName(), centerWrapper);
}
}
for (int i = 0; i < newPanels.length; i++) {
newPanels[i].installChooserPanel(chooser);
}
}
if ( e.getPropertyName().equals( JColorChooser.PREVIEW_PANEL_PROPERTY ) ) {
JComponent oldPanel = (JComponent) e.getOldValue();
JComponent newPanel = (JComponent) e.getNewValue();
if (oldPanel != null) { // fix for 4166059
chooser.remove(oldPanel);
}
chooser.add(newPanel, BorderLayout.SOUTH);
}
}
}
}
| [
"[email protected]"
] | |
100f910f73b19454d29a05f075aa7706c40b32ef | 2db9fec3e649dfed8ae3c955f9502953f4eeebc6 | /sgrain-spring-boot-cloud/src/main/java/com/sgrain/boot/cloud/config/SmallGrainConsulPropertySource.java | e24944a682a61104fbd3e7d9a58dd86ba2e1460d | [] | no_license | anjiabin/spring-parent | 0c8e0d313ce53f962ac976e4547631dc05fa095f | 30a0fe5e6259f1c50d64dab3240cf7fb43b31fff | refs/heads/master | 2023-01-19T04:36:50.749878 | 2020-11-20T03:07:56 | 2020-11-20T03:07:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,161 | java | package com.sgrain.boot.cloud.config;
import com.ecwid.consul.v1.ConsulClient;
import com.ecwid.consul.v1.QueryParams;
import com.ecwid.consul.v1.Response;
import com.ecwid.consul.v1.kv.model.GetValue;
import com.sgrain.boot.common.utils.constant.CharsetUtils;
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
import org.springframework.cloud.consul.config.ConsulConfigProperties;
import org.springframework.core.env.EnumerablePropertySource;
import org.springframework.core.io.ByteArrayResource;
import org.springframework.util.StringUtils;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.*;
import static org.springframework.cloud.consul.config.ConsulConfigProperties.Format.PROPERTIES;
import static org.springframework.cloud.consul.config.ConsulConfigProperties.Format.YAML;
import static org.springframework.util.Base64Utils.decodeFromString;
/**
* @author Spencer Gibb
*/
public class SmallGrainConsulPropertySource extends EnumerablePropertySource<ConsulClient> {
private final Map<String, Object> properties = new LinkedHashMap<>();
private String context;
private ConsulConfigProperties configProperties;
private Long initialIndex;
public SmallGrainConsulPropertySource(String context, ConsulClient source,
ConsulConfigProperties configProperties) {
super(context, source);
this.context = context;
this.configProperties = configProperties;
}
public void init() {
if (!this.context.endsWith("/")) {
this.context = this.context + "/";
}
Response<List<GetValue>> response = this.source.getKVValues(this.context,
this.configProperties.getAclToken(), QueryParams.DEFAULT);
this.initialIndex = response.getConsulIndex();
final List<GetValue> values = response.getValue();
ConsulConfigProperties.Format format = this.configProperties.getFormat();
switch (format) {
case KEY_VALUE:
parsePropertiesInKeyValueFormat(values);
break;
case PROPERTIES:
case YAML:
parsePropertiesWithNonKeyValueFormat(values, format);
}
}
public Long getInitialIndex() {
return this.initialIndex;
}
/**
* Parses the properties in key value style i.e., values are expected to be either a
* sub key or a constant.
* @param values values to parse
*/
protected void parsePropertiesInKeyValueFormat(List<GetValue> values) {
if (values == null) {
return;
}
for (GetValue getValue : values) {
String key = getValue.getKey();
if (!StringUtils.endsWithIgnoreCase(key, "/")) {
key = key.replace(this.context, "").replace('/', '.');
String value = getValue.getDecodedValue();
this.properties.put(key, value);
}
}
}
/**
* Parses the properties using the format which is not a key value style i.e., either
* java properties style or YAML style.
* @param values values to parse
* @param format format in which the values should be parsed
*/
protected void parsePropertiesWithNonKeyValueFormat(List<GetValue> values,
ConsulConfigProperties.Format format) {
if (values == null) {
return;
}
for (GetValue getValue : values) {
String key = getValue.getKey().replace(this.context, "");
if (this.configProperties.getDataKey().equals(key)) {
parseValue(getValue, format);
}
}
}
protected void parseValue(GetValue getValue, ConsulConfigProperties.Format format) {
String value = getValue.getDecodedValue();
if (value == null) {
return;
}
Properties props = generateProperties(value, format);
for (Map.Entry entry : props.entrySet()) {
this.properties.put(entry.getKey().toString(), entry.getValue());
}
}
protected Properties generateProperties(String value,
ConsulConfigProperties.Format format) {
final Properties props = new Properties();
if (format == PROPERTIES) {
try {
// Must use the ISO-8859-1 encoding because Properties.load(stream)
// expects it.
props.load(new InputStreamReader(new ByteArrayInputStream(value.getBytes(Charset.forName(CharsetUtils.UTF_8)))));
}
catch (IOException e) {
throw new IllegalArgumentException(
value + " can't be encoded using ISO-8859-1");
}
return props;
}
else if (format == YAML) {
final YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
yaml.setResources(
new ByteArrayResource(value.getBytes(Charset.forName("UTF-8"))));
return yaml.getObject();
}
return props;
}
/**
* @deprecated As of 1.1.0 use {@link GetValue#getDecodedValue()}.
* @param value encoded value
* @return the decoded string
*/
@Deprecated
public String getDecoded(String value) {
if (value == null) {
return null;
}
return new String(decodeFromString(value));
}
protected Map<String, Object> getProperties() {
return this.properties;
}
protected ConsulConfigProperties getConfigProperties() {
return this.configProperties;
}
protected String getContext() {
return this.context;
}
@Override
public Object getProperty(String name) {
return this.properties.get(name);
}
@Override
public String[] getPropertyNames() {
Set<String> strings = this.properties.keySet();
return strings.toArray(new String[strings.size()]);
}
}
| [
"[email protected]"
] | |
74789d334667e8447a0367f0a8e1ab700becdf20 | 0a6773e906928f83969cf609a49e55bb472f4e21 | /web/personal/src/main/java/com/netfinworks/site/web/common/util/LogUtil.java | 8b8a6837eb4fa455ec6e3d8470d2aba06f92e925 | [] | no_license | tasfe/site-platform-root | ec078effb6509e5d2d2b2cd9722f986dd0d939dd | c366916d96289beb624b633283880b8bb94452b4 | refs/heads/master | 2021-01-15T08:19:19.176225 | 2017-02-28T05:37:11 | 2017-02-28T05:37:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package com.netfinworks.site.web.common.util;
import java.text.MessageFormat;
import com.netfinworks.common.domain.OperationEnvironment;
import com.netfinworks.site.domain.domain.member.BaseMember;
public class LogUtil {
/**
*
* @param type 操作类型
* @param member 会员信息
* @param env
* @return
*/
public static String appLog(String type,BaseMember member,OperationEnvironment env) {
String context="操作类型-{0},用户ID-{1},账号-{2},名称-{3},操作员-{4},IP-{5},MAC-{6}";
return MessageFormat.format(context,type,member.getMemberId(),member.getLoginName(),member.getMemberName(),"",env.getClientIp(),env.getClientMac());
}
}
| [
"[email protected]"
] | |
544821b977b9ad05fff815a2752f0eac1d0a8a17 | bee4de4cdda2739e0c62f15168b52d089dcee2a0 | /src/main/java/com/sop4j/base/joda/time/field/BaseDurationField.java | c3de36bf0ae3c9a760141ff383df2efb4280f836 | [
"Apache-2.0"
] | permissive | wspeirs/sop4j-base | 5be82eafa27bbdb42a039d7642d5efb363de56d0 | 3640cdd20c5227bafc565c1155de2ff756dca9da | refs/heads/master | 2021-01-19T11:29:34.918100 | 2013-11-27T22:15:26 | 2013-11-27T22:15:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,598 | java | /*
* Copyright 2001-2009 Stephen Colebourne
*
* 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.sop4j.base.joda.time.field;
import java.io.Serializable;
import com.sop4j.base.joda.time.DurationField;
import com.sop4j.base.joda.time.DurationFieldType;
/**
* BaseDurationField provides the common behaviour for DurationField
* implementations.
* <p>
* This class should generally not be used directly by API users. The
* DurationField class should be used when different kinds of DurationField
* objects are to be referenced.
* <p>
* BaseDurationField is thread-safe and immutable, and its subclasses must
* be as well.
*
* @author Brian S O'Neill
* @see DecoratedDurationField
* @since 1.0
*/
public abstract class BaseDurationField extends DurationField implements Serializable {
/** Serialization lock. */
private static final long serialVersionUID = -2554245107589433218L;
/** A desriptive name for the field. */
private final DurationFieldType iType;
protected BaseDurationField(DurationFieldType type) {
super();
if (type == null) {
throw new IllegalArgumentException("The type must not be null");
}
iType = type;
}
public final DurationFieldType getType() {
return iType;
}
public final String getName() {
return iType.getName();
}
/**
* @return true always
*/
public final boolean isSupported() {
return true;
}
//------------------------------------------------------------------------
/**
* Get the value of this field from the milliseconds, which is approximate
* if this field is imprecise.
*
* @param duration the milliseconds to query, which may be negative
* @return the value of the field, in the units of the field, which may be
* negative
*/
public int getValue(long duration) {
return FieldUtils.safeToInt(getValueAsLong(duration));
}
/**
* Get the value of this field from the milliseconds, which is approximate
* if this field is imprecise.
*
* @param duration the milliseconds to query, which may be negative
* @return the value of the field, in the units of the field, which may be
* negative
*/
public long getValueAsLong(long duration) {
return duration / getUnitMillis();
}
/**
* Get the value of this field from the milliseconds relative to an
* instant.
*
* <p>If the milliseconds is positive, then the instant is treated as a
* "start instant". If negative, the instant is treated as an "end
* instant".
*
* <p>The default implementation returns
* <code>Utils.safeToInt(getAsLong(millisDuration, instant))</code>.
*
* @param duration the milliseconds to query, which may be negative
* @param instant the start instant to calculate relative to
* @return the value of the field, in the units of the field, which may be
* negative
*/
public int getValue(long duration, long instant) {
return FieldUtils.safeToInt(getValueAsLong(duration, instant));
}
/**
* Get the millisecond duration of this field from its value, which is
* approximate if this field is imprecise.
*
* @param value the value of the field, which may be negative
* @return the milliseconds that the field represents, which may be
* negative
*/
public long getMillis(int value) {
return value * getUnitMillis(); // safe
}
/**
* Get the millisecond duration of this field from its value, which is
* approximate if this field is imprecise.
*
* @param value the value of the field, which may be negative
* @return the milliseconds that the field represents, which may be
* negative
*/
public long getMillis(long value) {
return FieldUtils.safeMultiply(value, getUnitMillis());
}
// Calculation API
//------------------------------------------------------------------------
public int getDifference(long minuendInstant, long subtrahendInstant) {
return FieldUtils.safeToInt(getDifferenceAsLong(minuendInstant, subtrahendInstant));
}
//------------------------------------------------------------------------
public int compareTo(DurationField otherField) {
long otherMillis = otherField.getUnitMillis();
long thisMillis = getUnitMillis();
// cannot do (thisMillis - otherMillis) as can overflow
if (thisMillis == otherMillis) {
return 0;
}
if (thisMillis < otherMillis) {
return -1;
} else {
return 1;
}
}
/**
* Get a suitable debug string.
*
* @return debug string
*/
public String toString() {
return "DurationField[" + getName() + ']';
}
}
| [
"[email protected]"
] | |
b8f0e42302865947098e59e85506cc468095b60e | 37b8971ced4328f2fe241dc7491555aff1c8d605 | /code/ThreadDemos/src/main/java/ttl/advjava/refplus/ArrayVisibility.java | 7ad897b15bc20ea3eff385b74acfc664bf6fd1a7 | [] | no_license | yifangd/AdvJava | b4152fbc2e6aa14b0bf31e3e11902394ba81dc63 | caf7262b4938bd34ce0c0473c3c5e37c8698d3f5 | refs/heads/master | 2020-08-29T16:07:51.528513 | 2019-10-28T15:18:26 | 2019-10-28T15:18:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 922 | java | package ttl.advjava.refplus;
import ttl.advjava.mytry.TryWrap;
/**
* @author whynot
*/
public class ArrayVisibility {
private int var;
private int arr[] = new int[10];
public class Worker1 extends Thread {
@Override
public void run() {
while(arr[2] != 10) {
}
System.out.println("var is " + var);
}
}
public class Worker2 extends Thread {
@Override
public void run() {
var = 100;
arr[2] = 10;
}
}
public static void main(String[] args) {
new ArrayVisibility().go();
}
public void go() {
Worker1 w1 = new Worker1();
Worker2 w2 = new Worker2();
w1.start();
w2.start();
TryWrap<?> tw1 = TryWrap.of(() -> w2.join());
TryWrap<?> tw2 = TryWrap.of(() -> w2.join());
System.out.println("All Done");
}
}
| [
"[email protected]"
] | |
c67f7c494d79c3e15c42846e0e63ac944d0cdcd8 | 9adc5db0f6acf2153de43e53f70db78a45ca246e | /src/main/java/shift/sextiarysector3/recipe/RecipesForestry.java | 2299a631c80680bfc19bdeada8076524a28e2b70 | [] | no_license | shift02/SextiarySector3 | 9b7ed8bb62af6ef9c6c859ee911536e90e0b140a | f9a4c8e29cb86fec2995e13bc9364eac65a5d154 | refs/heads/master | 2020-04-12T10:09:37.444869 | 2017-12-15T14:21:22 | 2017-12-15T14:21:22 | 65,876,744 | 8 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,338 | java | package shift.sextiarysector3.recipe;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import shift.sextiarysector3.SSBlocks;
import shift.sextiarysector3.SSItems;
public class RecipesForestry {
public static void addRecipes(CraftingManager p_77608_1_) {
//スパイル
p_77608_1_.getRecipeList().add(new ShapedOreRecipe(new ItemStack(SSBlocks.spile, 1),
new Object[] {
"xxx",
'x', "ingotIron"
}));
//木の枝
p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Items.STICK, 4),
new Object[] {
SSItems.treeBranch
}));
//木材
p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Blocks.PLANKS, 4, 2),
new Object[] {
SSBlocks.rubberLog
}));
p_77608_1_.getRecipeList().add(new ShapelessOreRecipe(new ItemStack(Blocks.PLANKS, 4, 2),
new Object[] {
SSBlocks.mapleLog
}));
}
}
| [
"[email protected]"
] | |
3ec7a77da4860b4c0a89502c6248fc3001a08970 | 1309a8d1fa3655d8e9d3c4923b0af3d74b88aaf1 | /liz-design-pattern/src/main/java/com/liz/designPattern/behavior11/ChainOfResponsibility/古代妇女的三从四德/Son.java | b8fc1bf187103149572cd7f77c585508cdefb01b | [] | no_license | lizhou828/liz-incubator | a00b119aa13115d4f73d55022f9e26ae82fddbd8 | 2f01a77248b8bbc94588d948fcb7b3eb5985461d | refs/heads/master | 2022-12-08T07:49:46.291259 | 2020-07-23T08:43:10 | 2020-07-23T08:43:10 | 66,536,421 | 0 | 0 | null | 2022-11-16T05:55:36 | 2016-08-25T07:41:34 | JavaScript | UTF-8 | Java | false | false | 591 | java | package com.liz.designPattern.behavior11.ChainOfResponsibility.古代妇女的三从四德;
/**
* Created by Frank on 2016/12/12.
*/
public class Son extends Handler {
/**
* 儿子值处理母亲的请求
*/
public Son() {
super(Handler.SON_LEVEL_REQUEST);
}
/**
* 儿子的答复
* @param iWomen
*/
@Override
protected void response(IWomen iWomen) {
System.out.println("----母亲向儿子请示----");
System.out.println(iWomen.toString());
System.out.println("儿子的答复是:同意 \n");
}
}
| [
"[email protected]"
] | |
99a3acd39665b8c0ee17335b9f727070be98e66a | 0ef5cb767be1879208f9cd56ce2163073982df08 | /alogic-report/src/main/java/com/alogic/cube/mdr/Summarable.java | 6cb9ed4b28df65e2fc2c2ac683f2a86bf50e0d82 | [] | no_license | wangscript007/alogic | b3518a3e8c83578d8ba7e6654dbab5f3eb86b189 | dfa0287d9e756f7a398244f61e99ad6d948d07ad | refs/heads/master | 2022-04-05T17:34:37.054094 | 2018-09-30T03:31:30 | 2018-09-30T03:31:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 290 | java | package com.alogic.cube.mdr;
import com.anysoft.util.Properties;
/**
* 可累加
* @author yyduan
* @since 1.6.11.35
*/
public interface Summarable {
/**
* 收集数据,进行加法计算
* @param provider 数据提供者
*/
public void sum(final Properties provider);
}
| [
"[email protected]"
] | |
57772c43da0809ab3b9293813241b1675e67a4a8 | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.ocms-OCMS/sources/com/facebook/inject/ProviderMethod.java | 6c89ae7e47a24d64b00269e4004e5b7d4ece360a | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 370 | java | package com.facebook.inject;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS)
public @interface ProviderMethod {
boolean asDefault() default false;
String sysTraceTag() default "";
}
| [
"[email protected]"
] | |
327b5b794606ea264715743cc891d94a8811ab59 | 9923e30eb99716bfc179ba2bb789dcddc28f45e6 | /openapi-generator/jaxrs-spec/src/gen/java/org/openapitools/model/AssetReeferResponseReeferStatsSetPoint.java | f2aba5ca1ec1783aef4e38621d7fdf8fe8b1eeee | [] | no_license | silverspace/samsara-sdks | cefcd61458ed3c3753ac5e6bf767229dd8df9485 | c054b91e488ab4266f3b3874e9b8e1c9e2d4d5fa | refs/heads/master | 2020-04-25T13:16:59.137551 | 2019-03-01T05:49:05 | 2019-03-01T05:49:05 | 172,804,041 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,781 | java | package org.openapitools.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.*;
import javax.validation.Valid;
import io.swagger.annotations.*;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
public class AssetReeferResponseReeferStatsSetPoint {
private @Valid Long tempInMilliC;
private @Valid Long changedAtMs;
/**
* Set point temperature in millidegree Celsius.
**/
public AssetReeferResponseReeferStatsSetPoint tempInMilliC(Long tempInMilliC) {
this.tempInMilliC = tempInMilliC;
return this;
}
@ApiModelProperty(example = "31110", value = "Set point temperature in millidegree Celsius.")
@JsonProperty("tempInMilliC")
public Long getTempInMilliC() {
return tempInMilliC;
}
public void setTempInMilliC(Long tempInMilliC) {
this.tempInMilliC = tempInMilliC;
}
/**
* Timestamp in Unix milliseconds since epoch.
**/
public AssetReeferResponseReeferStatsSetPoint changedAtMs(Long changedAtMs) {
this.changedAtMs = changedAtMs;
return this;
}
@ApiModelProperty(example = "1453449599999", value = "Timestamp in Unix milliseconds since epoch.")
@JsonProperty("changedAtMs")
public Long getChangedAtMs() {
return changedAtMs;
}
public void setChangedAtMs(Long changedAtMs) {
this.changedAtMs = changedAtMs;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AssetReeferResponseReeferStatsSetPoint assetReeferResponseReeferStatsSetPoint = (AssetReeferResponseReeferStatsSetPoint) o;
return Objects.equals(tempInMilliC, assetReeferResponseReeferStatsSetPoint.tempInMilliC) &&
Objects.equals(changedAtMs, assetReeferResponseReeferStatsSetPoint.changedAtMs);
}
@Override
public int hashCode() {
return Objects.hash(tempInMilliC, changedAtMs);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AssetReeferResponseReeferStatsSetPoint {\n");
sb.append(" tempInMilliC: ").append(toIndentedString(tempInMilliC)).append("\n");
sb.append(" changedAtMs: ").append(toIndentedString(changedAtMs)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"[email protected]"
] | |
fd104991dae9460ecf237c4c44ca5af8d8ab3719 | ffe0ea2a467e12ce661497150692faa9758225f7 | /VRShow/app/src/main/java/com/xunixianshi/vrshow/obj/LeaveMessageResult.java | a73ed1bf9b98ff92b61ab45f583bb09df8d515d6 | [] | no_license | changjigang52084/Mark-s-Project | cc1be3e3e4d2b5d0d7d48b8decbdb0c054b742b7 | 8e82a8c3b1d75d00a70cf54838f3a91411ff1d16 | refs/heads/master | 2022-12-31T01:21:42.822825 | 2020-10-13T10:24:58 | 2020-10-13T10:24:58 | 303,652,140 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 728 | java | package com.xunixianshi.vrshow.obj;
import java.util.ArrayList;
/**
* Created by markIron on 2016/9/26.
*/
public class LeaveMessageResult extends HttpObj {
private int total;
private int pageSize;
private ArrayList<LeaveMessageResultList> list;
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public ArrayList<LeaveMessageResultList> getList() {
return list;
}
public void setList(ArrayList<LeaveMessageResultList> list) {
this.list = list;
}
}
| [
"[email protected]"
] | |
b4637b6b3a65b2212792b6a628fb172ac690acad | 3822efd9117b0c107f59add27bd843439898d481 | /src/main/java/com/gmail/mosoft521/jcpcmf/ch10/p154ConcurrentLinkedDeque/myservice/MyService.java | b07e398d3613008a011a864fc67fbb308607e9dd | [] | no_license | mosoft521/JCPCMF | 27e06778982703ec272db8e4188a2ff38ee74682 | 5d3493a08049c0771961eb6619f3bf556658d567 | refs/heads/master | 2020-06-15T14:17:57.028105 | 2017-08-23T01:03:33 | 2017-08-23T01:03:33 | 75,286,460 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 365 | java | package com.gmail.mosoft521.jcpcmf.ch10.p154ConcurrentLinkedDeque.myservice;
import java.util.concurrent.ConcurrentLinkedDeque;
public class MyService {
public ConcurrentLinkedDeque queue = new ConcurrentLinkedDeque();
public MyService() {
for (int i = 0; i < 10000; i++) {
queue.add("string" + (i + 1));
}
}
} | [
"[email protected]"
] | |
8fd540222995ee087217b39e82546b73a5117a37 | 41589b12242fd642cb7bde960a8a4ca7a61dad66 | /teams/fibbyBot10/Constants.java | 3bc387084c78c8af9a2c162d160986efdf22ebb2 | [] | no_license | Cixelyn/bcode2011 | 8e51e467b67b9ce3d9cf1160d9bd0e9f20114f96 | eccb2c011565c46db942b3f38eb3098b414c154c | refs/heads/master | 2022-11-05T12:52:17.671674 | 2011-01-27T04:49:12 | 2011-01-27T04:49:12 | 275,731,519 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,063 | java | package fibbyBot10;
/**
* Constants, tweak me!
* @author Max (and maybe a little JVen)
*
*/
public class Constants
{
//Debug Flags
public static final boolean DEBUG = true;
public static final boolean DEBUG_BYTECODE_OVERFLOW = false;
//Justin's Go Here
public static final int MINE_AFFINITY = 50; // how long SCV should chase a mine before giving up
public static final int RESERVE = 2; // desired minimum flux after building
public static final int MAX_FLYERS = 10; // the maximum number of flyers the armory should make
public static final int FACTORY_TIME = 500; // minimum time factory can be built (may not be built immediately)
public static final int HANBANG_TIME = 1000; // when tanks should be spawned
public static final int DEBRIS_TIME = 2000; // when tanks should start killing debris
public static final int TANKS_PER_EXPO = 6; // how many tanks to make per expo
//Max's Go here
public static final int RUN_AWAY_TIME = 5;
//Cory's Go here
} | [
"[email protected]"
] | |
2c251112eab7a1fc1c14ad4f45f4c2c7bbd3cd22 | bbc42646d24002abb5db8265415b1442efdd129c | /Java/JavaPatternsAndOther/DDD/domain/src/main/java/dev/gaudnik/domain/DomainOrderService.java | 462dd3fd5af8e2bfb403726dedc3f46f24e722a0 | [] | no_license | wojciechGaudnik/Learning | 223a162ddddc59aa4cfe49471ce08ba25587cf1b | dfffd4ddd453edf7667fe94b0fb4367235579424 | refs/heads/master | 2023-03-09T02:21:47.975665 | 2023-01-22T16:09:51 | 2023-01-22T16:09:51 | 201,742,343 | 0 | 0 | null | 2023-03-01T05:35:15 | 2019-08-11T09:10:46 | C | UTF-8 | Java | false | false | 1,016 | java | package dev.gaudnik.domain;
import java.util.UUID;
public class DomainOrderService implements OrderService {
private final OrderRepository orderRepository;
public DomainOrderService(OrderRepository orderRepository) {
this.orderRepository = orderRepository;
}
@Override
public UUID createOrder(Product product) {
Order order = new Order(UUID.randomUUID(), product);
orderRepository.save(order);
return order.getId();
}
@Override
public void addProduct(UUID id, Product product) {
Order order = getOrder(id);
order.addOrder(product);
orderRepository.save(order);
}
@Override
public void completeOrder(UUID id) {
Order order = getOrder(id);
order.complete();
orderRepository.save(order);
}
@Override
public void deleteProduct(UUID id, UUID productId) {
Order order = getOrder(id);
order.removeOrder(productId);
orderRepository.save(order);
}
private Order getOrder(UUID id) {
return orderRepository
.findById(id)
.orElseThrow(RuntimeException::new);
}
}
| [
"[email protected]"
] | |
f788ca5d52bb6ee26666038f826f08a089a28e3e | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.minihd.qq/assets/exlibs.2.jar/classes.jar/hei.java | 05aeb9a5b0aa9f821d45fed2a6bd72c2cbfc35a1 | [] | 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 | 492 | java | import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
class hei
implements DialogInterface.OnClickListener
{
hei(heg paramheg) {}
public void onClick(DialogInterface paramDialogInterface, int paramInt)
{
paramDialogInterface.dismiss();
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.2.jar\classes.jar
* Qualified Name: hei
* JD-Core Version: 0.7.0.1
*/ | [
"[email protected]"
] | |
2da5301acd8f1f8fa120a6961c8ec7e9898d43fa | 0f85ee2594b477d3ad002d75f0d8618730042f38 | /cloud-service/src/main/java/com/diyiliu/service/ServiceHi.java | 352eb5f964abcbe19ecaeb679069156f5c5f4663 | [] | no_license | diyiliu/spring-cloud | 10ed502fd52ef13eb79fc45f93a9b8120da20b3a | 0ca10f4ba9313e1a327d91c3751ac2c5a399a523 | refs/heads/master | 2020-03-21T12:38:37.244941 | 2018-06-25T08:16:24 | 2018-06-25T08:16:24 | 138,564,105 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 555 | java | package com.diyiliu.service;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
* Description: ServiceHi
* Author: DIYILIU
* Update: 2018-06-20 09:57
*/
@FeignClient("service-hi")
public interface ServiceHi {
@RequestMapping(value = "/hi", method = RequestMethod.GET)
String sayHiFromClientOne(@RequestParam(value = "name") String name);
}
| [
"[email protected]"
] | |
97eab903ea793b9a3c8b0161fa416f22468c5e80 | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/99/984.java | 696de84494de0faf52edfda9c771ac350d6ad8ee | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
int n;
int i;
int a = 0;
int b = 0;
int c = 0;
int d = 0;
int k;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
for (i = 0;i < n;i++)
{
String tempVar2 = ConsoleInput.scanfRead();
if (tempVar2 != null)
{
k = Integer.parseInt(tempVar2);
}
if (k < 19)
{
a++;
}
else if (k < 36)
{
b++;
}
else if (k < 61)
{
c++;
}
else
{
d++;
}
}
System.out.printf("1-18: %.2lf",100.0 * a / n);
System.out.print("%%\n");
System.out.printf("19-35: %.2lf",100.0 * b / n);
System.out.print("%%\n");
System.out.printf("36-60: %.2lf",100.0 * c / n);
System.out.print("%%\n");
System.out.printf("60??: %.2lf",100.0 * d / n);
System.out.print("%%");
return 0;
}
}
| [
"[email protected]"
] | |
1777f97fa5ccfb5c15e8a3b01c19a8e78555c304 | 3c9697ca6d9bfb9be2238248cdb27771ab34744c | /src/com/hua/widget/viewimage/Animations/TransformerAdapter.java | 070a1e9285ba13cdfc36ae92752cb01628c2bbda | [] | no_license | tianshiaimili/MyAppDemo | a2baf211032456aa7f3df72689c9e95b842605dd | 790c3755198122812bcca7c11a6b0a5c419a2af9 | refs/heads/master | 2021-01-23T11:49:41.717956 | 2015-01-15T09:34:21 | 2015-01-15T09:37:16 | 28,653,338 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,071 | java |
package com.hua.widget.viewimage.Animations;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.hua.activity.R;
/**
* Created by daimajia on 14-5-29.
*/
public class TransformerAdapter extends BaseAdapter {
private final Context mContext;
public TransformerAdapter(Context context) {
mContext = context;
}
@Override
public int getCount() {
return SliderLayout.Transformer.values().length;
}
@Override
public Object getItem(int position) {
return SliderLayout.Transformer.values()[position].toString();
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView t = (TextView) LayoutInflater.from(mContext).inflate(R.layout.item, null);
t.setText(getItem(position).toString());
return t;
}
}
| [
"huyue52099"
] | huyue52099 |
815411173863d903cb786c280be497e1aecfcc47 | f65b2cdc1970308ab26a7cf36da52f470cb5238a | /app/src/main/java/com/homepaas/sls/ui/widget/ExpandedGridView.java | 0cb388449708e7e1c518758d957a57c399c2a9a5 | [] | no_license | Miotlink/MAndroidClient | 5cac8a0eeff2289eb676a4ddd51a90926a6ff7ad | 83cbd50c38662a7a3662221b52d6b71f157d9740 | refs/heads/master | 2020-04-18T11:24:18.926374 | 2019-01-25T06:44:13 | 2019-01-25T06:44:13 | 167,498,578 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 825 | java | package com.homepaas.sls.ui.widget;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;
/**
* Created by Administrator on 2016/3/12.
*/
public class ExpandedGridView extends GridView {
public ExpandedGridView(Context context) {
super(context);
}
public ExpandedGridView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ExpandedGridView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int expandSpec = MeasureSpec.makeMeasureSpec(
Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
super.onMeasure(widthMeasureSpec, expandSpec);
}
}
| [
"[email protected]"
] | |
5b43994a3584cb57f740b8e04ec29ba73d8fc092 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/35/35_306019e1379fcfa5506f4e2eaf20c44d944591f9/REnvIndexChecker/35_306019e1379fcfa5506f4e2eaf20c44d944591f9_REnvIndexChecker_s.java | ce2a0c99e10c860279cf119d2810ee538b692d3f | [] | 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 | 5,870 | java | /*******************************************************************************
* Copyright (c) 2010-2012 WalWare/StatET-Project (www.walware.de/goto/statet).
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Stephan Wahlbrink - initial API and implementation
*******************************************************************************/
package de.walware.statet.r.internal.core.rhelp;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.SimpleFSDirectory;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import de.walware.statet.r.core.RCore;
import de.walware.statet.r.core.renv.IREnvConfiguration;
import de.walware.statet.r.core.rhelp.IREnvHelp;
import de.walware.statet.r.core.rhelp.IRPackageHelp;
import de.walware.statet.r.internal.core.RCorePlugin;
public class REnvIndexChecker {
private final IREnvConfiguration fREnvConfig;
private final Set<String> fCheckedNames = new HashSet<String>(64);
private int fNewPkg;
private int fChangedPkg;
private int fNewChange = -1;
private Map<String, String> fFoundCurrent = new HashMap<String, String>();
private Map<String, String> fFoundPrevious = new HashMap<String, String>();
private Directory fIndexDirectory;
private IREnvHelp fREnvHelp;
private boolean fREnvHelpLock;
private boolean fInPackageCheck;
public REnvIndexChecker(final IREnvConfiguration rEnvConfig) {
if (rEnvConfig == null) {
throw new NullPointerException("rEnvConfig"); //$NON-NLS-1$
}
fREnvConfig = rEnvConfig;
final File directory = SaveUtil.getIndexDirectory(rEnvConfig);
if (directory != null) {
try {
// directory writable?
if (!isWritable(directory)) {
if (REnvIndexWriter.DEBUG) {
RCorePlugin.log(new Status(IStatus.INFO, RCore.PLUGIN_ID, -1,
NLS.bind("The index directory ''{0}'' is not writable.", directory.toString()), //$NON-NLS-1$
null));
}
return;
}
// Lucene directory
fIndexDirectory = new SimpleFSDirectory(directory);
}
catch (final IOException e) {
RCorePlugin.log(new Status(IStatus.INFO, RCore.PLUGIN_ID, -1,
NLS.bind("The index directory ''{0}'' is not accessible.", directory.toString()), //$NON-NLS-1$
e));
}
}
}
private boolean isWritable(final File directory) throws IOException {
if (!directory.exists()) {
if (!directory.mkdirs()) {
return false;
}
}
final File file = new File(directory, "test"+System.nanoTime()); //$NON-NLS-1$
if (!file.createNewFile() || !file.delete()) {
return false;
}
return true;
}
public boolean preCheck() {
fNewChange = (fNewChange < 0) ? 1 : 0;
if (fREnvConfig == null || fIndexDirectory == null) {
return false;
}
final IREnvHelp envHelp = RCore.getRHelpManager().getHelp(fREnvConfig.getReference());
if ((envHelp != null) ? (fREnvHelp == null) : fREnvHelp != null) {
fNewChange = 1;
}
fREnvHelp = envHelp;
fREnvHelpLock = (fREnvHelp != null);
try {
if (!fREnvConfig.equals(fREnvConfig.getReference().getConfig())
|| IndexWriter.isLocked(fIndexDirectory)) {
finalCheck();
return false;
}
}
catch (final IOException e) {
}
return true;
}
public void beginPackageCheck() {
fInPackageCheck = true;
final Map<String, String> tmp = fFoundCurrent;
fFoundCurrent = fFoundPrevious;
fFoundPrevious = tmp;
fNewPkg = 0;
fChangedPkg = 0;
fNewChange = 0;
fCheckedNames.clear();
}
public void checkPackage(final String pkgName, final String pkgVersion) {
if (pkgName != null && fCheckedNames.add(pkgName)) {
final IRPackageHelp packageHelp = fREnvHelp.getRPackage(pkgName);
if (packageHelp == null) {
fNewPkg++;
fFoundCurrent.put(pkgName, pkgVersion);
if (fNewChange == 0 && !pkgVersion.equals(fFoundPrevious.get(pkgName))) {
fNewChange = 1;
}
}
else if (!packageHelp.getVersion().equals(pkgVersion)) {
fChangedPkg++;
fFoundCurrent.put(pkgName, pkgVersion);
if (fNewChange == 0 && !pkgVersion.equals(fFoundPrevious.get(pkgName))) {
fNewChange = 1;
}
}
}
}
public Set<String> getCheckedPackages() {
return fCheckedNames;
}
public void endPackageCheck() {
fInPackageCheck = false;
fFoundPrevious.clear();
}
public void cancelCheck() {
if (fInPackageCheck) {
final Map<String, String> tmp = fFoundCurrent;
fFoundCurrent = fFoundPrevious;
fFoundPrevious = tmp;
}
fFoundPrevious.clear();
if (fREnvHelp != null) {
fREnvHelp.unlock();
}
}
public void finalCheck() {
if (fREnvHelpLock) {
fREnvHelpLock = false;
fREnvHelp.unlock();
}
}
public boolean hasNewChanges() {
return (fNewChange > 0);
}
public boolean needsComplete() {
return (fREnvHelp == null);
}
public boolean hasPackageChanges() {
return (fNewPkg > 0 || fChangedPkg > 0);
}
public int getNewPackageCount() {
return fNewPkg;
}
public int getChangedPackageCount() {
return fChangedPkg;
}
}
| [
"[email protected]"
] | |
714e009e86c5078c074ca55edf1cd9602a88d17c | 1e9ffb0437d19ec0fcd5d7019c06756e28266c32 | /app/src/main/java/com/yunsen/enjoy/activity/mine/adapter/OrderNumberAdapter.java | 485832c7659ebd354ff04f01a4a5343d999c65dd | [] | no_license | zyjy33/chiDing | e9266d4d477002e1bf3e7eafb8ed254f05578656 | d49a5cc9486ef490a2cd852f68f0bb1d1dcbd2df | refs/heads/master | 2020-03-24T17:06:13.594579 | 2018-09-14T04:53:55 | 2018-09-14T04:53:55 | 142,849,110 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,192 | java | package com.yunsen.enjoy.activity.mine.adapter;
import android.content.Context;
import com.yunsen.enjoy.R;
import com.yunsen.enjoy.model.ListOrderCountBean;
import com.yunsen.enjoy.widget.recyclerview.CommonAdapter;
import com.yunsen.enjoy.widget.recyclerview.base.ViewHolder;
import java.util.List;
/**
* Created by Administrator on 2018/7/6.
*/
public class OrderNumberAdapter extends CommonAdapter<ListOrderCountBean> {
public OrderNumberAdapter(Context context, int layoutId, List<ListOrderCountBean> datas) {
super(context, layoutId, datas);
}
@Override
protected void convert(ViewHolder holder, ListOrderCountBean listOrderCountBean, int position) {
holder.setText(R.id.order_item_time, listOrderCountBean.getAdd_time());
holder.setText(R.id.order_item_type, listOrderCountBean.getDatatype());
holder.setText(R.id.order_item_name, listOrderCountBean.getNick_name());
holder.setText(R.id.order_item_id, listOrderCountBean.getUser_code());
holder.setText(R.id.order_item_money, "" +listOrderCountBean.getReal_amount());
holder.setText(R.id.order_item_income, "" + listOrderCountBean.getPaycount());
}
}
| [
"[email protected]"
] | |
85c8779725d99cb1d72f5949d313a32d02d3d114 | c292d9d00f9a2d23d7d54ab4ea6febb788cd5df6 | /src/main/java/org/omg/PortableInterceptor/IORInterceptor.java | e8f3f01522e9dba388315cd49342abcde51dca28 | [] | no_license | yangsongbai/jdk-source-read | cf4126318f4a1f93a6150b07599ffe77a20fa6e3 | 851e0895be24d2724c12174ed0f60bc483258cae | refs/heads/master | 2020-07-16T07:04:20.841964 | 2019-09-02T02:52:12 | 2019-09-02T02:52:12 | 205,744,217 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,022 | java | package org.omg.PortableInterceptor;
/**
* org/omg/PortableInterceptor/IORInterceptor.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u201/12322/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
* Saturday, December 15, 2018 6:38:38 PM PST
*/
/**
* Interceptor used to establish tagged components in the profiles within
* an IOR.
* <p>
* In some cases, a portable ORB service implementation may need to add
* information describing the server's or object's ORB service related
* capabilities to object references in order to enable the ORB service
* implementation in the client to function properly.
* <p>
* This is supported through the <code>IORInterceptor</code> and
* <code>IORInfo</code> interfaces.
*
* @see IORInfo
*/
public interface IORInterceptor extends IORInterceptorOperations, Interceptor, org.omg.CORBA.portable.IDLEntity
{
} // interface IORInterceptor
| [
"“[email protected]"
] | |
d70e304037943a52e8b914409ac9caffbe40fc58 | e3974b1ba6a8cfbbf337cdd82bc4797fddbd3866 | /src/main/java/lk/wisdom_institute/util/service/OperatorService.java | 2192a8791acc61d33384637dcfb5bc811efd1161 | [] | no_license | jlenagala/wisdom-institute | 5a7da80a99d39fda9d247630a9fa0b61ce52c103 | 4a1f591288a17bed04f5e1489b266ef2022d60fe | refs/heads/master | 2023-04-10T22:47:08.006585 | 2021-04-22T21:58:57 | 2021-04-22T21:58:57 | 312,890,562 | 0 | 0 | null | 2021-04-22T20:30:06 | 2020-11-14T19:49:31 | HTML | UTF-8 | Java | false | false | 965 | java | package lk.wisdom_institute.util.service;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
@Service
public class OperatorService {
public BigDecimal multiply(BigDecimal operand1, BigDecimal operand2) {
return operand1.multiply(operand2).setScale(2, RoundingMode.CEILING);
}
public BigDecimal divide(BigDecimal dividend, BigDecimal divisor) {
return dividend.divide(divisor, 2, RoundingMode.CEILING);
}
public BigDecimal addition(BigDecimal operand1, BigDecimal operand2) {
return operand1.add(operand2).setScale(2, RoundingMode.CEILING);
}
public BigDecimal subtraction(BigDecimal operand1, BigDecimal operand2) {
return operand1.subtract(operand2).setScale(2, RoundingMode.CEILING);
}
public BigDecimal pow(BigDecimal operand1, int operand2) {
return operand1.pow(operand2).setScale(2, RoundingMode.CEILING);
}
}
| [
"[email protected]"
] | |
68b4678cecf8245e1b3a2dbd8fd25a543dc1a091 | 8166f4002dfe0e55a89b6921a7ada4833a1ad8d8 | /tests-arquillian/src/test/java/org/jboss/weld/tests/beanDeployment/managed/multiple/BootstrapTest.java | 292230d1e64a07cc2e4f6ab3b8d8239a79896cc5 | [] | no_license | pmuir/weld-core | 6feb58e69929bb563c730f23c2474ea680c07b3a | c0dbc9243a9ce8b2193b25d9ef95c1337ac8ecb0 | refs/heads/master | 2021-01-20T23:48:05.795604 | 2011-05-02T19:03:41 | 2011-05-02T19:03:41 | 836,247 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,587 | java | /*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* 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.jboss.weld.tests.beanDeployment.managed.multiple;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.enterprise.inject.spi.Bean;
import javax.inject.Inject;
import org.jboss.arquillian.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.BeanArchive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.weld.bean.ManagedBean;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.manager.BeanManagerImpl;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(Arquillian.class)
public class BootstrapTest
{
@Deployment
public static Archive<?> deploy()
{
return ShrinkWrap.create(BeanArchive.class)
.addPackage(BootstrapTest.class.getPackage());
}
@Inject
private BeanManagerImpl beanManager;
@Test
public void testMultipleSimpleBean()
{
List<Bean<?>> beans = beanManager.getBeans();
Map<Class<?>, Bean<?>> classes = new HashMap<Class<?>, Bean<?>>();
for (Bean<?> bean : beans)
{
if (bean instanceof RIBean)
{
classes.put(((RIBean<?>) bean).getType(), bean);
}
}
Assert.assertTrue(classes.containsKey(Tuna.class));
Assert.assertTrue(classes.containsKey(Salmon.class));
Assert.assertTrue(classes.containsKey(SeaBass.class));
Assert.assertTrue(classes.containsKey(Sole.class));
Assert.assertTrue(classes.get(Tuna.class) instanceof ManagedBean);
Assert.assertTrue(classes.get(Salmon.class) instanceof ManagedBean);
Assert.assertTrue(classes.get(SeaBass.class) instanceof ManagedBean);
Assert.assertTrue(classes.get(Sole.class) instanceof ManagedBean);
}
}
| [
"[email protected]"
] | |
15f5eefcfd926ecd9604070afa0050c47eb15b7b | 674b10a0a3e2628e177f676d297799e585fe0eb6 | /src/main/java/androidx/coordinatorlayout/R$drawable.java | f15854eda970480189386ffac30fc4f1fcc486a1 | [] | no_license | Rune-Status/open-osrs-osrs-android | 091792f375f1ea118da4ad341c07cb73f76b3e03 | 551b86ab331af94f66fe0dcb3adc8242bf3f472f | refs/heads/master | 2020-08-08T03:32:10.802605 | 2019-10-08T15:50:18 | 2019-10-08T15:50:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package androidx.coordinatorlayout;
public final class R$drawable {
public static final int notification_action_background = 0x7F07007F;
public static final int notification_bg = 0x7F070080;
public static final int notification_bg_low = 0x7F070081;
public static final int notification_bg_low_normal = 0x7F070082;
public static final int notification_bg_low_pressed = 0x7F070083;
public static final int notification_bg_normal = 0x7F070084;
public static final int notification_bg_normal_pressed = 0x7F070085;
public static final int notification_icon_background = 0x7F070086;
public static final int notification_template_icon_bg = 0x7F070087;
public static final int notification_template_icon_low_bg = 0x7F070088;
public static final int notification_tile_bg = 0x7F070089;
public static final int notify_panel_notification_icon_bg = 0x7F07008A;
R$drawable() {
super();
}
}
| [
"[email protected]"
] | |
ea28f988534fff12476ca0586f8ca99803e00a9e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/24/24_adcf87af88c74495cd83206b3e3548d347c1910e/JdbcTransactionManagerTest/24_adcf87af88c74495cd83206b3e3548d347c1910e_JdbcTransactionManagerTest_s.java | 407b3adf82a1c22985317e8c3cfc0954849d82f9 | [] | 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,512 | java | package com.j256.ormlite.misc;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.fail;
import java.sql.SQLException;
import java.util.concurrent.Callable;
import org.junit.Before;
import org.junit.Test;
import com.j256.ormlite.BaseOrmLiteJdbcTest;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.jdbc.JdbcPooledConnectionSource;
public class JdbcTransactionManagerTest extends BaseOrmLiteJdbcTest {
@Override
@Before
public void before() throws Exception {
if (databaseType != null) {
return;
}
super.before();
if (connectionSource != null) {
connectionSource = new JdbcPooledConnectionSource(databaseUrl, userName, password, databaseType);
}
}
@Test
public void testDaoTransactionManagerCommitted() throws Exception {
if (connectionSource == null) {
return;
}
TransactionManager mgr = new TransactionManager(connectionSource);
testTransactionManager(mgr, null);
}
@Test
public void testRollBack() throws Exception {
if (connectionSource == null) {
return;
}
TransactionManager mgr = new TransactionManager(connectionSource);
testTransactionManager(mgr, new RuntimeException("What!! I protest!!"));
}
@Test
public void testSpringWiredRollBack() throws Exception {
if (connectionSource == null) {
return;
}
TransactionManager mgr = new TransactionManager();
mgr.setConnectionSource(connectionSource);
mgr.initialize();
testTransactionManager(mgr, new RuntimeException("What!! I protest!!"));
}
@Test
public void testNonRuntimeExceptionWiredRollBack() throws Exception {
if (connectionSource == null) {
return;
}
TransactionManager mgr = new TransactionManager();
mgr.setConnectionSource(connectionSource);
mgr.initialize();
testTransactionManager(mgr, new Exception("What!! I protest via an Exception!!"));
}
private void testTransactionManager(TransactionManager mgr, final Exception exception) throws Exception {
final Dao<Foo, Integer> fooDao = createDao(Foo.class, true);
final Foo foo1 = new Foo();
String stuff = "stuff";
foo1.stuff = stuff;
assertEquals(1, fooDao.create(foo1));
try {
final int val = 13431231;
int returned = mgr.callInTransaction(new Callable<Integer>() {
public Integer call() throws Exception {
// we delete it inside a transaction
assertEquals(1, fooDao.delete(foo1));
// we can't find it
assertNull(fooDao.queryForId(foo1.id));
if (exception != null) {
// but then we throw an exception which rolls back the transaction
throw exception;
} else {
return val;
}
}
});
if (exception == null) {
assertEquals(val, returned);
} else {
fail("Should have thrown");
}
} catch (SQLException e) {
if (exception == null) {
throw e;
} else {
// expected
}
}
if (exception == null) {
// still doesn't find it after we delete it
assertNull(fooDao.queryForId(foo1.id));
} else {
// still finds it after we delete it
Foo foo2 = fooDao.queryForId(foo1.id);
assertNotNull(foo2);
assertEquals(stuff, foo2.stuff);
}
}
public static class Foo {
@DatabaseField(generatedId = true)
int id;
@DatabaseField
String stuff;
Foo() {
// for ormlite
}
}
}
| [
"[email protected]"
] | |
f2ae5b32764262e2170e3633ac4978ce958eedf5 | 6c418276e914d350b49ecf2c0890a19c8904e589 | /app/src/main/java/com/tag/app/tagnearemployee/qrcode/QrCodePresenter.java | 9ceec38b66031486f2bbbc6cd22f72b628b33af4 | [] | no_license | sanjujagadish/java | 21647f306fd22f384737173f0d2250f46d31f1a3 | e65a460182061cb48755c2880a3d954931134743 | refs/heads/master | 2020-12-10T07:42:29.901803 | 2020-01-13T14:16:12 | 2020-01-13T14:16:12 | 233,537,008 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,029 | java | package com.tag.app.tagnearemployee.qrcode;
import com.tag.app.tagnearemployee.base.ModelCallback;
import com.tag.app.tagnearemployee.pojomodels.QrCodeResponse;
public class QrCodePresenter implements QrCodeContract.Presenter
{
private final QrCodeModel qrCodeModel;
private QrCodeContract.View view;
public QrCodePresenter(QrCodeModel qrCodeModel) {
this.qrCodeModel=qrCodeModel; }
@Override
public void setView(Object view)
{ this.view= (QrCodeContract.View) view; }
@Override
public void clearView()
{ qrCodeModel.destroy(); }
@Override
public void qrcodeverify(String authorization,String qrCode) {
qrCodeModel.qrcodevalid( authorization, qrCode, new ModelCallback() {
@Override
public void onSuccess(Object object) {
view.qrcoderesponse( (QrCodeResponse) object );
}
@Override
public void onFailure(Throwable throwable) {
view.onFailure( throwable );
}
} );
}
}
| [
"[email protected]"
] | |
4666a7d4d6c071e95172da5e633ac3a24fd68564 | dddbc98625203127ffc5190b25a013334b7ec690 | /dependencies/org.eclipse.net4j.util/src/org/eclipse/net4j/util/container/IContainerEvent.java | 81c10d8e2c4f87ad3d892386351702050e51458c | [
"EPL-1.0",
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | IHTSDO/snow-owl | 55fdcd5966fba335d5226c52002405334c17d0db | 90c17b806956ad15cdc66649aa4e193bad21ff46 | refs/heads/master | 2021-01-19T06:25:04.680073 | 2019-08-09T09:26:27 | 2019-08-09T09:26:27 | 32,463,362 | 12 | 1 | Apache-2.0 | 2019-05-23T08:55:43 | 2015-03-18T14:22:29 | Java | UTF-8 | Java | false | false | 1,329 | java | /*
* Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.util.container;
import org.eclipse.net4j.util.container.IContainerDelta.Kind;
import org.eclipse.net4j.util.event.IEvent;
/**
* An {@link IEvent event} fired from a {@link IContainer container} when its elements have changed.
*
* @author Eike Stepper
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
* @apiviz.composedOf {@link IContainerDelta} - - deltas
*/
public interface IContainerEvent<E> extends IEvent
{
/**
* @since 3.0
*/
public IContainer<E> getSource();
public boolean isEmpty();
public IContainerDelta<E>[] getDeltas();
public IContainerDelta<E> getDelta() throws IllegalStateException;
public E getDeltaElement() throws IllegalStateException;
public Kind getDeltaKind() throws IllegalStateException;
public void accept(IContainerEventVisitor<E> visitor);
}
| [
"[email protected]"
] | |
7819f45f29bd3bb774008e230825b766c25fc36d | 18b20a45faa4cf43242077e9554c0d7d42667fc2 | /HelicoBacterMod/build/tmp/expandedArchives/forge-1.14.4-28.1.0_mapped_snapshot_20190719-1.14.3-sources.jar_db075387fe30fb93ccdc311746149f9d/net/minecraftforge/fml/common/network/ByteBufUtils.java | 99273bff022cc3986c1238d3accf55e0550620ec | [] | no_license | qrhlhplhp/HelicoBacterMod | 2cbe1f0c055fd5fdf97dad484393bf8be32204ae | 0452eb9610cd70f942162d5b23141b6bf524b285 | refs/heads/master | 2022-07-28T16:06:03.183484 | 2021-03-20T11:01:38 | 2021-03-20T11:01:38 | 347,618,857 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,398 | java | /*
* Minecraft Forge
* Copyright (c) 2016-2019.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.minecraftforge.fml.common.network;
import io.netty.buffer.ByteBuf;
/**
* Utilities for interacting with {@link ByteBuf}.
* @author cpw
*
*/
public class ByteBufUtils {
public static String getContentDump(ByteBuf buffer)
{
int currentLength = buffer.readableBytes();
StringBuffer returnString = new StringBuffer((currentLength * 3) + // The
// hex
(currentLength) + // The ascii
(currentLength / 4) + // The tabs/\n's
30); // The text
// returnString.append("Buffer contents:\n");
int i, j; // Loop variables
for (i = 0; i < currentLength; i++)
{
if ((i != 0) && (i % 16 == 0))
{
// If it's a multiple of 16 and i isn't null, show the ascii
returnString.append('\t');
for (j = i - 16; j < i; j++)
{
if (buffer.getByte(j) < 0x20 || buffer.getByte(j) > 0x7F)
returnString.append('.');
else
returnString.append((char) buffer.getByte(j));
}
// Add a linefeed after the string
returnString.append("\n");
}
returnString.append(Integer.toString((buffer.getByte(i) & 0xF0) >> 4, 16) + Integer.toString((buffer.getByte(i) & 0x0F) >> 0, 16));
returnString.append(' ');
}
// Add padding spaces if it's not a multiple of 16
if (i != 0 && i % 16 != 0)
{
for (j = 0; j < ((16 - (i % 16)) * 3); j++)
{
returnString.append(' ');
}
}
// Add the tab for alignment
returnString.append('\t');
// Add final characters at right, after padding
// If it was at the end of a line, print out the full line
if (i > 0 && (i % 16) == 0)
{
j = i - 16;
} else
{
j = (i - (i % 16));
}
for (; i >= 0 && j < i; j++)
{
if (buffer.getByte(j) < 0x20 || buffer.getByte(j) > 0x7F)
returnString.append('.');
else
returnString.append((char) buffer.getByte(j));
}
// Finally, tidy it all up with a newline
returnString.append('\n');
returnString.append("Length: " + currentLength);
return returnString.toString();
}
}
| [
"[email protected]"
] | |
d60b27aa4d09a58b362f1f988ce2ba030f718f55 | 402cd8792078cba816c81e0306953a924e073828 | /psd-dubbo-common/src/main/java/com/scut/psd/common/constant/CollectionConst.java | d3582efdafed44bddb881f1cb892377ff8d7ca55 | [] | no_license | SkyScraperTwc/Psd-distributed | 8f183b95387593a63b0cf966f15be26c6e786d81 | d3d96438a2e96a0ba5eb720aedc374672b1de632 | refs/heads/master | 2020-03-10T17:30:12.271339 | 2018-04-14T09:23:14 | 2018-04-14T09:23:14 | 129,501,768 | 8 | 4 | null | null | null | null | UTF-8 | Java | false | false | 224 | java | package com.scut.psd.common.constant;
/**
* mongodb数据库集合名称
*/
public class CollectionConst {
public static final String USER = "user";
public static final String CALCULATEDATA = "calculatedata";
}
| [
"[email protected]"
] | |
67ebfb59b89f959ccce77ff8f909c1fc738f9850 | 38c4451ab626dcdc101a11b18e248d33fd8a52e0 | /tokens/apache-cassandra-1.2.0/src/java/org/apache/cassandra/db/compaction/AbstractCompactionIterable.java | f63a627d327bdab797b5fbde6f7ebec50db3dc5b | [] | no_license | habeascorpus/habeascorpus-data | 47da7c08d0f357938c502bae030d5fb8f44f5e01 | 536d55729f3110aee058ad009bcba3e063b39450 | refs/heads/master | 2020-06-04T10:17:20.102451 | 2013-02-19T15:19:21 | 2013-02-19T15:19:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,090 | java | package TokenNamepackage
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
cassandra TokenNameIdentifier
. TokenNameDOT
db TokenNameIdentifier
. TokenNameDOT
compaction TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
java TokenNameIdentifier
. TokenNameDOT
util TokenNameIdentifier
. TokenNameDOT
List TokenNameIdentifier
; TokenNameSEMICOLON
import TokenNameimport
org TokenNameIdentifier
. TokenNameDOT
apache TokenNameIdentifier
. TokenNameDOT
cassandra TokenNameIdentifier
. TokenNameDOT
utils TokenNameIdentifier
. TokenNameDOT
CloseableIterator TokenNameIdentifier
; TokenNameSEMICOLON
public TokenNamepublic
abstract TokenNameabstract
class TokenNameclass
AbstractCompactionIterable TokenNameIdentifier
extends TokenNameextends
CompactionInfo TokenNameIdentifier
. TokenNameDOT
Holder TokenNameIdentifier
implements TokenNameimplements
Iterable TokenNameIdentifier
< TokenNameLESS
AbstractCompactedRow TokenNameIdentifier
> TokenNameGREATER
{ TokenNameLBRACE
protected TokenNameprotected
final TokenNamefinal
OperationType TokenNameIdentifier
type TokenNameIdentifier
; TokenNameSEMICOLON
protected TokenNameprotected
final TokenNamefinal
CompactionController TokenNameIdentifier
controller TokenNameIdentifier
; TokenNameSEMICOLON
protected TokenNameprotected
final TokenNamefinal
long TokenNamelong
totalBytes TokenNameIdentifier
; TokenNameSEMICOLON
protected TokenNameprotected
volatile TokenNamevolatile
long TokenNamelong
bytesRead TokenNameIdentifier
; TokenNameSEMICOLON
protected TokenNameprotected
final TokenNamefinal
List TokenNameIdentifier
< TokenNameLESS
ICompactionScanner TokenNameIdentifier
> TokenNameGREATER
scanners TokenNameIdentifier
; TokenNameSEMICOLON
public TokenNamepublic
AbstractCompactionIterable TokenNameIdentifier
( TokenNameLPAREN
CompactionController TokenNameIdentifier
controller TokenNameIdentifier
, TokenNameCOMMA
OperationType TokenNameIdentifier
type TokenNameIdentifier
, TokenNameCOMMA
List TokenNameIdentifier
< TokenNameLESS
ICompactionScanner TokenNameIdentifier
> TokenNameGREATER
scanners TokenNameIdentifier
) TokenNameRPAREN
{ TokenNameLBRACE
this TokenNamethis
. TokenNameDOT
controller TokenNameIdentifier
= TokenNameEQUAL
controller TokenNameIdentifier
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
type TokenNameIdentifier
= TokenNameEQUAL
type TokenNameIdentifier
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
scanners TokenNameIdentifier
= TokenNameEQUAL
scanners TokenNameIdentifier
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
bytesRead TokenNameIdentifier
= TokenNameEQUAL
0 TokenNameIntegerLiteral
; TokenNameSEMICOLON
long TokenNamelong
bytes TokenNameIdentifier
= TokenNameEQUAL
0 TokenNameIntegerLiteral
; TokenNameSEMICOLON
for TokenNamefor
( TokenNameLPAREN
ICompactionScanner TokenNameIdentifier
scanner TokenNameIdentifier
: TokenNameCOLON
scanners TokenNameIdentifier
) TokenNameRPAREN
bytes TokenNameIdentifier
+= TokenNamePLUS_EQUAL
scanner TokenNameIdentifier
. TokenNameDOT
getLengthInBytes TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
this TokenNamethis
. TokenNameDOT
totalBytes TokenNameIdentifier
= TokenNameEQUAL
bytes TokenNameIdentifier
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
CompactionInfo TokenNameIdentifier
getCompactionInfo TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
{ TokenNameLBRACE
return TokenNamereturn
new TokenNamenew
CompactionInfo TokenNameIdentifier
( TokenNameLPAREN
controller TokenNameIdentifier
. TokenNameDOT
cfs TokenNameIdentifier
. TokenNameDOT
metadata TokenNameIdentifier
, TokenNameCOMMA
type TokenNameIdentifier
, TokenNameCOMMA
bytesRead TokenNameIdentifier
, TokenNameCOMMA
totalBytes TokenNameIdentifier
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
public TokenNamepublic
abstract TokenNameabstract
CloseableIterator TokenNameIdentifier
< TokenNameLESS
AbstractCompactedRow TokenNameIdentifier
> TokenNameGREATER
iterator TokenNameIdentifier
( TokenNameLPAREN
) TokenNameRPAREN
; TokenNameSEMICOLON
} TokenNameRBRACE
| [
"[email protected]"
] | |
98ea26b1056b3ff2d6ee5e634ec7306182f0919e | cd0bc39775fdbe9b1ef808feaef0450fc58635d6 | /MundoCore-EventScope/src/us/tlatoani/mundocore/event_scope/MundoEventScope.java | d78ac5ddc740656f9613b421fc0cc83fb948c8a0 | [
"MIT"
] | permissive | TlatoaniHJ/MundoCore | 7e9611cf5e0a3bedc841e54ec0fd2bf2c8776e57 | fc54755c737cd394f970d9e26b1763fccf8ce9d2 | refs/heads/master | 2023-04-16T08:43:13.585021 | 2021-04-13T18:31:34 | 2021-04-13T18:31:34 | 357,653,100 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 688 | java | package us.tlatoani.mundocore.event_scope;
import ch.njol.skript.config.Config;
import ch.njol.skript.lang.SelfRegisteringSkriptEvent;
import ch.njol.skript.lang.Trigger;
/**
* Created by Tlatoani on 8/11/17.
*/
public abstract class MundoEventScope extends SelfRegisteringSkriptEvent {
private boolean afterInitRun = false;
@Override
public void register(Trigger trigger) {
if (!afterInitRun) {
afterInit();
afterInitRun = true;
}
}
public void afterParse(Config config) {
if (!afterInitRun) {
afterInit();
afterInitRun = true;
}
}
protected abstract void afterInit();
}
| [
"[email protected]"
] | |
868e4f113e85923a14ebe7630815822f385a4021 | 90da1e8991558e773df0e31f4aad06e830e128fb | /src/main/java/com/fisc/decltca/config/LoggingConfiguration.java | 0a091efb842e8930db447f26abda9cfcccd54097 | [] | no_license | sandalothier/jhipster-decltca | 695ba8d3d8350b37e58855be02c7fea712c79bd1 | 241820a40af3391c7b591a83f9b4ee8261271dc4 | refs/heads/master | 2022-12-23T17:26:38.196664 | 2019-12-19T13:15:51 | 2019-12-19T13:15:51 | 229,057,975 | 0 | 0 | null | 2022-12-16T06:28:37 | 2019-12-19T13:15:43 | Java | UTF-8 | Java | false | false | 2,394 | java | package com.fisc.decltca.config;
import ch.qos.logback.classic.LoggerContext;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.jhipster.config.JHipsterProperties;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.info.BuildProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
import static io.github.jhipster.config.logging.LoggingUtils.*;
/*
* Configures the console and Logstash log appenders from the app properties
*/
@Configuration
@RefreshScope
public class LoggingConfiguration {
public LoggingConfiguration(@Value("${spring.application.name}") String appName,
@Value("${server.port}") String serverPort,
JHipsterProperties jHipsterProperties,
ObjectProvider<BuildProperties> buildProperties,
ObjectMapper mapper) throws JsonProcessingException {
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
Map<String, String> map = new HashMap<>();
map.put("app_name", appName);
map.put("app_port", serverPort);
buildProperties.ifAvailable(it -> map.put("version", it.getVersion()));
String customFields = mapper.writeValueAsString(map);
JHipsterProperties.Logging loggingProperties = jHipsterProperties.getLogging();
JHipsterProperties.Logging.Logstash logstashProperties = loggingProperties.getLogstash();
if (loggingProperties.isUseJsonFormat()) {
addJsonConsoleAppender(context, customFields);
}
if (logstashProperties.isEnabled()) {
addLogstashTcpSocketAppender(context, customFields, logstashProperties);
}
if (loggingProperties.isUseJsonFormat() || logstashProperties.isEnabled()) {
addContextListener(context, customFields, loggingProperties);
}
if (jHipsterProperties.getMetrics().getLogs().isEnabled()) {
setMetricsMarkerLogbackFilter(context, loggingProperties.isUseJsonFormat());
}
}
}
| [
"[email protected]"
] | |
a7b385bc424b2880376eee061711236d8fbdcc55 | 39f3fc2f9e9fbeb472fdaf99fdce237fb1586f72 | /admin-console/src/main/java/com/ibeetl/admin/console/service/FunctionConsoleService.java | ee8a8be280b795fd4fffc35c30d5896066417426 | [
"BSD-3-Clause"
] | permissive | ThreshE/SpringBoot-beetl-layui | 7de3d90c700adb7c6a997aa959a21ac9df76def5 | dce406636c17c74bd4dbe17b71d905574d9f1546 | refs/heads/master | 2023-02-02T07:41:38.688329 | 2020-12-28T06:01:13 | 2020-12-28T06:01:13 | 320,976,745 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,241 | java | package com.ibeetl.admin.console.service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ibeetl.admin.console.dao.FunctionConsoleDao;
import com.ibeetl.admin.console.dao.RoleFunctionConsoleDao;
import com.ibeetl.admin.console.web.dto.RoleDataAccessFunction;
import com.ibeetl.admin.core.dao.CoreMenuDao;
import com.ibeetl.admin.core.dao.CoreRoleMenuDao;
import com.ibeetl.admin.core.entity.CoreFunction;
import com.ibeetl.admin.core.entity.CoreMenu;
import com.ibeetl.admin.core.entity.CoreRoleFunction;
import com.ibeetl.admin.core.entity.CoreRoleMenu;
import com.ibeetl.admin.core.rbac.tree.FunctionItem;
import com.ibeetl.admin.core.service.CoreBaseService;
import com.ibeetl.admin.core.service.CorePlatformService;
import com.ibeetl.admin.core.util.PlatformException;
/**
* @author lijiazhi
*
*/
@Service
@Transactional
public class FunctionConsoleService extends CoreBaseService<CoreFunction> {
@Autowired
FunctionConsoleDao functionDao;
@Autowired
CoreMenuDao menuDao;
@Autowired
RoleFunctionConsoleDao roleFunctionConsoleDao;
@Autowired
CoreRoleMenuDao sysRoleMenuDao;
@Autowired
CorePlatformService platformService;
public void queryByCondtion(PageQuery<CoreFunction> query) {
functionDao.queryByCondtion(query);
List<CoreFunction> list = query.getList();
this.queryListAfter(list);
//處理父功能名稱顯示
FunctionItem root = platformService.buildFunction();
for(CoreFunction function:list) {
Long parentId = function.getParentId();
String name = "";
if(parentId != 0) {
FunctionItem item = root.findChild(parentId);
name = item!=null?item.getName():"";
}
function.set("parentFunctionText", name);
}
}
public Long saveFunction(CoreFunction function){
functionDao.insert(function,true);
platformService.clearFunctionCache();
return function.getId();
}
/** 刪除功能點,跟菜單有關聯的無法刪除,刪除功能點導緻所有緩存都需要更新
* @param functionId
* @return
*/
public void deleteFunction(Long functionId){
deleteFunctionId(functionId);
platformService.clearFunctionCache();
}
public void batchDeleteFunction(List<Long> functionIds){
for(Long id:functionIds){
deleteFunctionId(id);
}
platformService.clearFunctionCache();
}
public void updateFunction(CoreFunction function){
functionDao.updateById(function);
platformService.clearFunctionCache();
}
public CoreFunction getFunction(Long functionId){
return functionDao.unique(functionId);
}
public CoreFunction getFunction(String code){
CoreFunction query = new CoreFunction();
query.setCode(code);
CoreFunction db = functionDao.templateOne(query);
return db;
}
/**
* 得到角色對應的所有功能點
* @param roleId
* @return
*/
public List<Long> getFunctionByRole(Long roleId){
return this.roleFunctionConsoleDao.getFunctionIdByRole(roleId);
}
/**
* 得到角色對應的所有數據權限功能點
* @param roleId
* @return
*/
public List<RoleDataAccessFunction> getQueryFunctionByRole(Long roleId){
return this.roleFunctionConsoleDao.getQueryFunctionAndRoleData(roleId);
}
/**
* 更新角色對應的功能點所有,
* @param roleId
* @param data,必須包含id,和 dataAcerssType,採用模闆更新
*/
public void updateFunctionAccessByRole(List<RoleDataAccessFunction> data ){
for(RoleDataAccessFunction fun:data){
Long roleId = fun.getRoleId();
Long functionId = fun.getId();
int accessType= fun.getDataAccessType();
CoreRoleFunction template = new CoreRoleFunction();
template.setRoleId(roleId);
template.setFunctionId(functionId);
CoreRoleFunction ret = roleFunctionConsoleDao.templateOne(template);
if(ret!=null) {
ret.setDataAccessType(accessType);
roleFunctionConsoleDao.updateById(ret);
}else {
template.setDataAccessType(accessType);
template.setCreateTime(new Date());
roleFunctionConsoleDao.insert(template);
}
}
platformService.clearFunctionCache();
}
/** 給角色賦予功能同時,根據賦予的功能權限,更新能訪問的菜單
* @param adds
* @param updates
* @param dels
* @return 返回增加的項的id,用於前端
*/
public void updateSysRoleFunction(Long roleId,List<Long> adds,List<Long> dels){
for(Long del:dels){
//獲得功能關聯的菜單
CoreRoleFunction temp = new CoreRoleFunction();
temp.setRoleId(roleId);
temp.setFunctionId(del);
CoreRoleFunction roleFunction = roleFunctionConsoleDao.templateOne(temp);
if(roleFunction==null){
throw new PlatformException("已經被刪除了RoleId="+roleId+" functionId="+del);
}
CoreMenu menu = queryFunctionMenu(roleFunction.getFunctionId());
roleFunctionConsoleDao.deleteById(roleFunction.getId());
if(menu!=null){
//同時,需要刪除與此功能關聯的菜單
CoreRoleMenu sysRoleMenu = querySysRoleMenu(roleFunction.getRoleId(),menu.getId());
if(sysRoleMenu!=null){
sysRoleMenuDao.deleteById(sysRoleMenu.getId());
}
}
}
for(Long add:adds){
CoreRoleFunction function = new CoreRoleFunction();
function.setCreateTime(new Date());
function.setRoleId(roleId);
function.setFunctionId(add);
this.sqlManager.insert(function);
CoreMenu menu = queryFunctionMenu(add);
if(menu!=null){
//同時,需要增加菜單
CoreRoleMenu roleMenu = new CoreRoleMenu();
roleMenu.setMenuId(menu.getId());
roleMenu.setRoleId(roleId);
sysRoleMenuDao.insert(roleMenu);
}
}
//清楚緩存
platformService.clearFunctionCache();
}
private CoreMenu queryFunctionMenu(Long functionId){
CoreMenu query = new CoreMenu();
query.setFunctionId(functionId);
List<CoreMenu> menus = menuDao.template(query);
return menus.isEmpty()?null:menus.get(0);
}
private CoreRoleMenu querySysRoleMenu(Long roleId,Long menuId){
CoreRoleMenu query= new CoreRoleMenu();
query.setMenuId(menuId);
query.setRoleId(roleId);
List<CoreRoleMenu> menus = sysRoleMenuDao.template(query);
return menus.isEmpty()?null:menus.get(0);
}
/**
* 刪除某一個功能點及其子功能,對應的role-function 需要刪除,菜單對應的function需要設定成空
* @param functionId
*/
private void deleteFunctionId(Long functionId){
FunctionItem root = platformService.buildFunction();
FunctionItem fun = root.findChild(functionId);
List<FunctionItem> all = fun.findAllItem();
//也刪除自身
all.add(fun);
realDeleteFunction(all);
}
private void realDeleteFunction(List<FunctionItem> all){
List<Long> ids = new ArrayList<>(all.size());
for(FunctionItem item:all){
ids.add(item.getId());
this.functionDao.deleteById(item.getId());
}
//刪除角色和功能的關係
this.roleFunctionConsoleDao.deleteRoleFunction(ids);
//設定菜單對應的功能項為空
menuDao.clearMenuFunction(ids);
}
}
| [
"[email protected]"
] | |
5c8caf612d86d62f90f2be9aac512b995e571231 | a5ccd4da788256fb903cc1e93cc30211caf87035 | /src/main/java/balking/SaverThread.java | d47822561890b4817e1fccbcce554619b4916d72 | [] | no_license | emag-notes/hyuki-dp-multi-thread | dfc6bd5012a0ccc43b1b39c2cdbfb5d95ee0a23f | d5c507fc3237e54dc4e42d1bbf51fcd0311ad56f | refs/heads/master | 2021-01-15T08:15:05.069102 | 2015-10-25T09:24:47 | 2015-10-25T09:24:47 | 44,006,835 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 505 | java | package balking;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
/**
* @author Yoshimasa Tanabe
*/
public class SaverThread extends Thread {
private final Data data;
public SaverThread(String name, Data data) {
super(name);
this.data = data;
}
@Override
public void run() {
try {
while (true) {
data.save();
TimeUnit.SECONDS.sleep(1);
}
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
bc7fb3abb975a79c25d66bcc1ae2f3c76613c900 | 9623f83defac3911b4780bc408634c078da73387 | /powercraft_145/src/common/net/minecraft/src/PlayerSelector.java | a34b46d186777a41e075d2c3bfb904e2ff3ab3f4 | [] | no_license | BlearStudio/powercraft-legacy | 42b839393223494748e8b5d05acdaf59f18bd6c6 | 014e9d4d71bd99823cf63d4fbdb65c1b83fde1f8 | refs/heads/master | 2021-01-21T21:18:55.774908 | 2015-04-06T20:45:25 | 2015-04-06T20:45:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,584 | java | package net.minecraft.src;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.minecraft.server.MinecraftServer;
public class PlayerSelector
{
private static final Pattern field_82389_a = Pattern.compile("^@([parf])(?:\\[([\\w=,-]*)\\])?$");
private static final Pattern field_82387_b = Pattern.compile("\\G(-?\\w*)(?:$|,)");
private static final Pattern field_82388_c = Pattern.compile("\\G(\\w{1,2})=(-?\\w+)(?:$|,)");
public static EntityPlayerMP func_82386_a(ICommandSender par0ICommandSender, String par1Str)
{
EntityPlayerMP[] var2 = func_82380_c(par0ICommandSender, par1Str);
return var2 != null && var2.length == 1 ? var2[0] : null;
}
public static String func_82385_b(ICommandSender par0ICommandSender, String par1Str)
{
EntityPlayerMP[] var2 = func_82380_c(par0ICommandSender, par1Str);
if (var2 != null && var2.length != 0)
{
String[] var3 = new String[var2.length];
for (int var4 = 0; var4 < var3.length; ++var4)
{
var3[var4] = var2[var4].getEntityName();
}
return CommandBase.joinNiceString(var3);
}
else
{
return null;
}
}
public static EntityPlayerMP[] func_82380_c(ICommandSender par0ICommandSender, String par1Str)
{
Matcher var2 = field_82389_a.matcher(par1Str);
if (var2.matches())
{
Map var3 = func_82381_h(var2.group(2));
String var4 = var2.group(1);
int var5 = func_82384_c(var4);
int var6 = func_82379_d(var4);
int var7 = func_82375_f(var4);
int var8 = func_82376_e(var4);
int var9 = func_82382_g(var4);
int var10 = EnumGameType.NOT_SET.getID();
ChunkCoordinates var11 = par0ICommandSender.getPlayerCoordinates();
if (var3.containsKey("rm"))
{
var5 = MathHelper.parseIntWithDefault((String)var3.get("rm"), var5);
}
if (var3.containsKey("r"))
{
var6 = MathHelper.parseIntWithDefault((String)var3.get("r"), var6);
}
if (var3.containsKey("lm"))
{
var7 = MathHelper.parseIntWithDefault((String)var3.get("lm"), var7);
}
if (var3.containsKey("l"))
{
var8 = MathHelper.parseIntWithDefault((String)var3.get("l"), var8);
}
if (var3.containsKey("x"))
{
var11.posX = MathHelper.parseIntWithDefault((String)var3.get("x"), var11.posX);
}
if (var3.containsKey("y"))
{
var11.posY = MathHelper.parseIntWithDefault((String)var3.get("y"), var11.posY);
}
if (var3.containsKey("z"))
{
var11.posZ = MathHelper.parseIntWithDefault((String)var3.get("z"), var11.posZ);
}
if (var3.containsKey("m"))
{
var10 = MathHelper.parseIntWithDefault((String)var3.get("m"), var10);
}
if (var3.containsKey("c"))
{
var9 = MathHelper.parseIntWithDefault((String)var3.get("c"), var9);
}
List var12;
if (!var4.equals("p") && !var4.equals("a"))
{
if (!var4.equals("r"))
{
return null;
}
else
{
var12 = MinecraftServer.getServer().getConfigurationManager().findPlayers(var11, var5, var6, 0, var10, var7, var8);
Collections.shuffle(var12);
var12 = var12.subList(0, Math.min(var9, var12.size()));
return var12 != null && !var12.isEmpty() ? (EntityPlayerMP[])var12.toArray(new EntityPlayerMP[0]) : new EntityPlayerMP[0];
}
}
else
{
var12 = MinecraftServer.getServer().getConfigurationManager().findPlayers(var11, var5, var6, var9, var10, var7, var8);
return var12 != null && !var12.isEmpty() ? (EntityPlayerMP[])var12.toArray(new EntityPlayerMP[0]) : new EntityPlayerMP[0];
}
}
else
{
return null;
}
}
public static boolean func_82377_a(String par0Str)
{
Matcher var1 = field_82389_a.matcher(par0Str);
if (var1.matches())
{
Map var2 = func_82381_h(var1.group(2));
String var3 = var1.group(1);
int var4 = func_82382_g(var3);
if (var2.containsKey("c"))
{
var4 = MathHelper.parseIntWithDefault((String)var2.get("c"), var4);
}
return var4 != 1;
}
else
{
return false;
}
}
public static boolean func_82383_a(String par0Str, String par1Str)
{
Matcher var2 = field_82389_a.matcher(par0Str);
if (!var2.matches())
{
return false;
}
else
{
String var3 = var2.group(1);
return par1Str == null || par1Str.equals(var3);
}
}
public static boolean func_82378_b(String par0Str)
{
return func_82383_a(par0Str, (String)null);
}
private static final int func_82384_c(String par0Str)
{
return 0;
}
private static final int func_82379_d(String par0Str)
{
return 0;
}
private static final int func_82376_e(String par0Str)
{
return Integer.MAX_VALUE;
}
private static final int func_82375_f(String par0Str)
{
return 0;
}
private static final int func_82382_g(String par0Str)
{
return par0Str.equals("a") ? 0 : 1;
}
private static Map func_82381_h(String par0Str)
{
HashMap var1 = new HashMap();
if (par0Str == null)
{
return var1;
}
else
{
Matcher var2 = field_82387_b.matcher(par0Str);
int var3 = 0;
int var4;
for (var4 = -1; var2.find(); var4 = var2.end())
{
String var5 = null;
switch (var3++)
{
case 0:
var5 = "x";
break;
case 1:
var5 = "y";
break;
case 2:
var5 = "z";
break;
case 3:
var5 = "r";
}
if (var5 != null && var2.group(1).length() > 0)
{
var1.put(var5, var2.group(1));
}
}
if (var4 < par0Str.length())
{
var2 = field_82388_c.matcher(var4 == -1 ? par0Str : par0Str.substring(var4));
while (var2.find())
{
var1.put(var2.group(1), var2.group(2));
}
}
return var1;
}
}
}
| [
"[email protected]@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c"
] | [email protected]@ed9f5d1b-00bb-0f29-faab-e8ebad1a710c |
a32ae7df0a1bffe43e26eae8792a98d0dbdd4d3c | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_38291.java | 43545472d1d753482926c2f6034c9bd368f5f367 | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 203 | java | @Override public void process(final StringBuilder out){
separateByCommaOrSpace(out);
out.append(ded.getTableNameForQuery());
if (tableAlias != null) {
out.append(' ').append(tableAlias);
}
}
| [
"[email protected]"
] | |
81f42b6bc3d6f6a4c951e216fa24f770fed6e37a | d433e93db30bb44874ef97215e7d5bc3da6eec10 | /Java_016_Applications/src/com/callor/app/FileWriter_01.java | 35038e71c39f49b29df6cda477547982b42c12bb | [] | no_license | num5268/Biz_403_2021_03_Java | 9cf9ea067f52c0a1e79b17af108da8a2397a7aa7 | f63b3f0db0565f018fe145523e9cf866cc1d366f | refs/heads/master | 2023-04-13T12:19:06.121263 | 2021-04-27T07:30:31 | 2021-04-27T07:30:31 | 348,207,331 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,869 | java | package com.callor.app;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
public class FileWriter_01 {
public static void main(String[] args) {
/*
* eClipse를 사용하여 프로젝트를 만들었을때
* Project의 소스코드가 저장되는 곳은
* Project/src 폴더 이후에 패키지 이름으로 만들어진다
* 새로운 파일을 만들기 위해서
* src.pakage-name 폴더를 지정하는데
* 타이핑을 직접하다보면 오타가 발생할수 있기 때문에
* Copy Qulalified..를 사용하여 임의 파일을 가져오고
* 필요한 파일로 이름을 변경하여 사용한다.
*/
String fileName = "src/com/callor/app/data.txt";
Random rnd = new Random();
int num1 = rnd.nextInt(100);
int num2 = rnd.nextInt(100);
// 2개의 난수로 4칙연산을 수행
// 뺄셈과 나눗셈은 반드시 큰수 - 작은수, 큰수 / 작은수
if(num1 < num2) {
int temp = num1;
num1 += num2;
num2 += temp;
}
int sum = num1 + num2;
int minus = num1 - num2;
int times = num1 * num2;
int div = num1 / num2;
// file과 관련된 클래스를 사용할때는
// 객체선언과 생성문을 분리하여 작성한다.
// FileWriter, PrintWriter를 객체로 선언
FileWriter fileWriter = null;
PrintWriter out = null;
// 객체 생성
// FileWriter 클래스를 객체로 생성할때
// 만들(작성할, 새로생성할) 파일이름(경로포함)을
// 생성자 매개변수로 전달해 주어야 한다.
try {
// FileWriter 클래스의 객체만으로도
// 파일에 기록할수 있지만
// 상당히 복잡하고, 불편한 코드를 만들어야 한다
// PrintWriter 클래스의 객체를
// FileWriter 클래스의 객체와 연결하여
// System.out 의 print 관련 method와 똑같은 방법으로
// 파일에 Text들을 저장한다
// OS와 <-> FileWriter <-> PrintWriter가 서로 연결되어
// 데이터를 파일에 기록한다.
fileWriter = new FileWriter(fileName);
out = new PrintWriter(fileWriter);
out.println("=".repeat(50));
out.printf("%d + %d = %d\n",num1,num2,num1+num2);
out.printf("%d - %d = %d\n",num1,num2,num1-num2);
out.printf("%d * %d = %d\n",num1,num2,num1*num2);
out.printf("%d / %d = %d\n",num1,num2,num1/num2);
out.println("-".repeat(50));
out.flush();
out.close();
// PrintWriter를 닫으면 FileWriter도 같이 닫히기 때문에
// 일부러 close하지 않아도 무방하다
fileWriter.close();
System.out.println("작업완료");
} catch (IOException e) {
// TODO Auto-generated catch block
// e.printStackTrace();
System.out.println(fileName + "파일을 생성할 수 없음");
}
}
}
| [
"[email protected]"
] | |
d7b63e91f403eac0ebe65959599e0798aca7938f | 4a015f5a9b655f027a4d4e04fdc926bb893d093d | /course-info-service/src/main/java/mk/ukim/finki/courseinfo/config/WebConfigurer.java | 339e545623ebc6cb976067f250df9dbc69b1e8fa | [
"MIT"
] | permissive | kirkovg/university-microservices | cd1bfe8f92dba3b422c56903b972a2aa9f0b45c7 | 2c8db22c3337014e3a8aa5de3e6a1a32d35c9ba0 | refs/heads/master | 2021-12-26T13:05:05.598702 | 2018-09-11T18:53:35 | 2018-09-11T18:53:35 | 147,234,534 | 0 | 0 | MIT | 2021-08-12T22:16:40 | 2018-09-03T17:25:19 | Java | UTF-8 | Java | false | false | 5,807 | java | package mk.ukim.finki.courseinfo.config;
import io.github.jhipster.config.JHipsterConstants;
import io.github.jhipster.config.JHipsterProperties;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.servlet.InstrumentedFilter;
import com.codahale.metrics.servlets.MetricsServlet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import io.undertow.UndertowOptions;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.boot.web.server.*;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.http.MediaType;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import java.nio.charset.StandardCharsets;
import java.util.*;
import javax.servlet.*;
/**
* Configuration of web application with Servlet 3.0 APIs.
*/
@Configuration
public class WebConfigurer implements ServletContextInitializer, WebServerFactoryCustomizer<WebServerFactory> {
private final Logger log = LoggerFactory.getLogger(WebConfigurer.class);
private final Environment env;
private final JHipsterProperties jHipsterProperties;
private MetricRegistry metricRegistry;
public WebConfigurer(Environment env, JHipsterProperties jHipsterProperties) {
this.env = env;
this.jHipsterProperties = jHipsterProperties;
}
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
if (env.getActiveProfiles().length != 0) {
log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles());
}
EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.ASYNC);
initMetrics(servletContext, disps);
log.info("Web application fully configured");
}
/**
* Customize the Servlet engine: Mime types, the document root, the cache.
*/
@Override
public void customize(WebServerFactory server) {
setMimeMappings(server);
/*
* Enable HTTP/2 for Undertow - https://twitter.com/ankinson/status/829256167700492288
* HTTP/2 requires HTTPS, so HTTP requests will fallback to HTTP/1.1.
* See the JHipsterProperties class and your application-*.yml configuration files
* for more information.
*/
if (jHipsterProperties.getHttp().getVersion().equals(JHipsterProperties.Http.Version.V_2_0) &&
server instanceof UndertowServletWebServerFactory) {
((UndertowServletWebServerFactory) server)
.addBuilderCustomizers(builder ->
builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true));
}
}
private void setMimeMappings(WebServerFactory server) {
if (server instanceof ConfigurableServletWebServerFactory) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
// IE issue, see https://github.com/jhipster/generator-jhipster/pull/711
mappings.add("html", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
// CloudFoundry issue, see https://github.com/cloudfoundry/gorouter/issues/64
mappings.add("json", MediaType.TEXT_HTML_VALUE + ";charset=" + StandardCharsets.UTF_8.name().toLowerCase());
ConfigurableServletWebServerFactory servletWebServer = (ConfigurableServletWebServerFactory) server;
servletWebServer.setMimeMappings(mappings);
}
}
/**
* Initializes Metrics.
*/
private void initMetrics(ServletContext servletContext, EnumSet<DispatcherType> disps) {
log.debug("Initializing Metrics registries");
servletContext.setAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE,
metricRegistry);
servletContext.setAttribute(MetricsServlet.METRICS_REGISTRY,
metricRegistry);
log.debug("Registering Metrics Filter");
FilterRegistration.Dynamic metricsFilter = servletContext.addFilter("webappMetricsFilter",
new InstrumentedFilter());
metricsFilter.addMappingForUrlPatterns(disps, true, "/*");
metricsFilter.setAsyncSupported(true);
log.debug("Registering Metrics Servlet");
ServletRegistration.Dynamic metricsAdminServlet =
servletContext.addServlet("metricsServlet", new MetricsServlet());
metricsAdminServlet.addMapping("/management/metrics/*");
metricsAdminServlet.setAsyncSupported(true);
metricsAdminServlet.setLoadOnStartup(2);
}
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = jHipsterProperties.getCors();
if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) {
log.debug("Registering CORS filter");
source.registerCorsConfiguration("/api/**", config);
source.registerCorsConfiguration("/management/**", config);
source.registerCorsConfiguration("/v2/api-docs", config);
}
return new CorsFilter(source);
}
@Autowired(required = false)
public void setMetricRegistry(MetricRegistry metricRegistry) {
this.metricRegistry = metricRegistry;
}
}
| [
"[email protected]"
] | |
9998a90fda0325d50c4eeb959d3bf73b7aad6f9b | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/CodeJamData/11/02/7.java | 404bce9b29c68a35c81a6e7e438428aee9c8211c | [] | no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | Java | false | false | 2,858 | java | import java.io.*;
public class B {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int cases, combine_count, oppose_count, invoke_count;
String[] input, combine, oppose;
String invoke;
StringBuilder result;
cases = Integer.parseInt(in.readLine());
for (int c=1; c<=cases; c++) {
input = in.readLine().split(" ");
combine_count = Integer.parseInt(input[0]);
combine = new String[combine_count];
for (int i=0; i<combine_count; i++)
combine[i] = input[i+1];
oppose_count = Integer.parseInt(input[combine_count+1]);
oppose = new String[oppose_count];
for (int i=0; i<oppose_count; i++)
oppose[i] = input[i+combine_count+2];
invoke_count = Integer.parseInt(input[combine_count+oppose_count+2]);
invoke = input[combine_count+oppose_count+3];
result = new StringBuilder();
invokeloop:
for (int i=0; i<invoke_count; i++) {
char invoked = invoke.charAt(i);
if (result.length() == 0) {
result.append(invoked);
} else {
char last = result.charAt(result.length() - 1);
for (String combination : combine)
{
if (combination.charAt(0) == invoked && combination.charAt(1) == last || combination.charAt(0) == last && combination.charAt(1) == invoked)
{
result.setCharAt(result.length() - 1, combination.charAt(2));
continue invokeloop;
}
}
for (int j=0; j<result.length(); j++)
{
char earlier = result.charAt(j);
for (String opposition : oppose)
{
if (opposition.charAt(0) == invoked && opposition.charAt(1) == earlier || opposition.charAt(0) == earlier && opposition.charAt(1) == invoked)
{
result.delete(0, result.length());
continue invokeloop;
}
}
}
result.append(invoked);
}
}
System.out.print("Case #" + c + ": [");
for (int i=0; i<result.length(); i++)
{
if (i != 0)
System.out.print(", ");
System.out.print(result.charAt(i));
}
System.out.println("]");
}
}
}
| [
"[email protected]"
] | |
8f1a260e61ecb8232c1dcf58d22b7cfa1d3d17ec | 51cf893b29e0025e86efc571a0b20fbbec43f744 | /LuBanOne/app/src/main/java/com/example/administrator/lubanone/widgets/MultiImageView.java | a2a42400d1abebc08174e5905e492b5576d547f4 | [] | no_license | quyang-xianzaishi/mylib | 1dfc3c141347a8eee5ad831efab5e18fb9d9f726 | 4cabe396090d820a58e6917f16e57a69cc6485b9 | refs/heads/master | 2018-09-29T16:19:05.253246 | 2018-07-15T15:52:46 | 2018-07-15T15:52:46 | 111,664,822 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,115 | java | package com.example.administrator.lubanone.widgets;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import android.widget.LinearLayout;
import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.example.administrator.lubanone.R;
import com.example.administrator.lubanone.bean.message.PhotoInfo;
import com.example.administrator.lubanone.utils.DensityUtil;
import java.util.List;
/**
* @ClassName MultiImageView.java
* @author shoyu
* @version
* @Description: 显示1~N张图片的View
*/
public class MultiImageView extends LinearLayout {
public static int MAX_WIDTH = 0;
// 照片的Url列表
private List<PhotoInfo> imagesList;
/** 长度 单位为Pixel **/
private int pxOneMaxWandH; // 单张图最大允许宽高
private int pxMoreWandH = 0;// 多张图的宽高
private int pxImagePadding = DensityUtil.dip2px(getContext(), 3);// 图片间的间距
private int MAX_PER_ROW_COUNT = 3;// 每行显示最大数
private LayoutParams onePicPara;
private LayoutParams morePara, moreParaColumnFirst;
private LayoutParams rowPara;
private OnItemClickListener mOnItemClickListener;
public void setOnItemClickListener(OnItemClickListener onItemClickListener){
mOnItemClickListener = onItemClickListener;
}
public MultiImageView(Context context) {
super(context);
}
public MultiImageView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public void setList(List<PhotoInfo> lists) throws IllegalArgumentException{
if(lists==null){
throw new IllegalArgumentException("imageList is null...");
}
imagesList = lists;
if(MAX_WIDTH > 0){
pxMoreWandH = (MAX_WIDTH - pxImagePadding*2 )/3; //解决右侧图片和内容对不齐问题
pxOneMaxWandH = MAX_WIDTH * 2 / 3;
initImageLayoutParams();
}
initView();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if(MAX_WIDTH == 0){
int width = measureWidth(widthMeasureSpec);
if(width>0){
MAX_WIDTH = width;
if(imagesList!=null && imagesList.size()>0){
setList(imagesList);
}
}
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
/**
* Determines the width of this view
*
* @param measureSpec
* A measureSpec packed into an int
* @return The width of the view, honoring constraints from measureSpec
*/
private int measureWidth(int measureSpec) {
int result = 0;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
// We were told how big to be
result = specSize;
} else {
// Measure the text
// result = (int) mTextPaint.measureText(mText) + getPaddingLeft()
// + getPaddingRight();
if (specMode == MeasureSpec.AT_MOST) {
// Respect AT_MOST value if that was what is called for by
// measureSpec
result = Math.min(result, specSize);
}
}
return result;
}
private void initImageLayoutParams() {
int wrap = LayoutParams.WRAP_CONTENT;
int match = LayoutParams.MATCH_PARENT;
onePicPara = new LayoutParams(wrap, wrap);
moreParaColumnFirst = new LayoutParams(pxMoreWandH, pxMoreWandH);
morePara = new LayoutParams(pxMoreWandH, pxMoreWandH);
morePara.setMargins(pxImagePadding, 0, 0, 0);
rowPara = new LayoutParams(match, wrap);
}
// 根据imageView的数量初始化不同的View布局,还要为每一个View作点击效果
private void initView() {
this.setOrientation(VERTICAL);
this.removeAllViews();
if(MAX_WIDTH == 0){
//为了触发onMeasure()来测量MultiImageView的最大宽度,MultiImageView的宽设置为match_parent
addView(new View(getContext()));
return;
}
if (imagesList == null || imagesList.size() == 0) {
return;
}
if (imagesList.size() == 1) {
addView(createImageView(0, false));
} else {
int allCount = imagesList.size();
if(allCount == 4){
MAX_PER_ROW_COUNT = 2;
}else{
MAX_PER_ROW_COUNT = 3;
}
int rowCount = allCount / MAX_PER_ROW_COUNT
+ (allCount % MAX_PER_ROW_COUNT > 0 ? 1 : 0);// 行数
for (int rowCursor = 0; rowCursor < rowCount; rowCursor++) {
LinearLayout rowLayout = new LinearLayout(getContext());
rowLayout.setOrientation(LinearLayout.HORIZONTAL);
rowLayout.setLayoutParams(rowPara);
if (rowCursor != 0) {
rowLayout.setPadding(0, pxImagePadding, 0, 0);
}
int columnCount = allCount % MAX_PER_ROW_COUNT == 0 ? MAX_PER_ROW_COUNT
: allCount % MAX_PER_ROW_COUNT;//每行的列数
if (rowCursor != rowCount - 1) {
columnCount = MAX_PER_ROW_COUNT;
}
addView(rowLayout);
int rowOffset = rowCursor * MAX_PER_ROW_COUNT;// 行偏移
for (int columnCursor = 0; columnCursor < columnCount; columnCursor++) {
int position = columnCursor + rowOffset;
rowLayout.addView(createImageView(position, true));
}
}
}
}
private ImageView createImageView(int position, final boolean isMultiImage) {
PhotoInfo photoInfo = imagesList.get(position);
ImageView imageView = new ColorFilterImageView(getContext());
if(isMultiImage){
imageView.setScaleType(ScaleType.CENTER_CROP);
imageView.setLayoutParams(position % MAX_PER_ROW_COUNT == 0 ?moreParaColumnFirst : morePara);
}else {
imageView.setAdjustViewBounds(true);
imageView.setScaleType(ScaleType.CENTER_INSIDE);
//imageView.setMaxHeight(pxOneMaxWandH);
int expectW = photoInfo.w;
int expectH = photoInfo.h;
if(expectW == 0 || expectH == 0){
imageView.setLayoutParams(onePicPara);
}else{
int actualW = 0;
int actualH = 0;
float scale = ((float) expectH)/((float) expectW);
if(expectW > pxOneMaxWandH){
actualW = pxOneMaxWandH;
actualH = (int)(actualW * scale);
} else if(expectW < pxMoreWandH){
actualW = pxMoreWandH;
actualH = (int)(actualW * scale);
}else{
actualW = expectW;
actualH = expectH;
}
imageView.setLayoutParams(new LayoutParams(actualW, actualH));
}
}
imageView.setId(photoInfo.url.hashCode());
imageView.setOnClickListener(new ImageOnClickListener(position));
imageView.setBackgroundColor(getResources().getColor(R.color.im_font_color_text_hint));
Glide.with(getContext()).load(photoInfo.url).diskCacheStrategy(DiskCacheStrategy.ALL).into(imageView);
return imageView;
}
private class ImageOnClickListener implements OnClickListener{
private int position;
public ImageOnClickListener(int position){
this.position = position;
}
@Override
public void onClick(View view) {
if(mOnItemClickListener != null){
mOnItemClickListener.onItemClick(view, position);
}
}
}
public interface OnItemClickListener{
public void onItemClick(View view, int position);
}
} | [
"[email protected]"
] | |
a7d686a9bea9d50ce839b1e3b00e4af0dc7db9ff | fb079e82c42cea89a3faea928d4caf0df4954b05 | /Физкультура/ВДНХ/VelnessBMSTU_v1.2b_apkpure.com_source_from_JADX/com/google/api/services/sheets/v4/model/PivotTable.java | d81257569252dd0140d526a3499c4dfcf8f3f023 | [] | no_license | Belousov-EA/university | 33c80c701871379b6ef9aa3da8f731ccf698d242 | 6ec7303ca964081c52f259051833a045f0c91a39 | refs/heads/master | 2022-01-21T17:46:30.732221 | 2022-01-10T20:27:15 | 2022-01-10T20:27:15 | 123,337,018 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,100 | java | package com.google.api.services.sheets.v4.model;
import com.google.api.client.json.GenericJson;
import com.google.api.client.util.Data;
import com.google.api.client.util.Key;
import java.util.List;
import java.util.Map;
public final class PivotTable extends GenericJson {
@Key
private List<PivotGroup> columns;
@Key
private Map<String, PivotFilterCriteria> criteria;
@Key
private List<PivotGroup> rows;
@Key
private GridRange source;
@Key
private String valueLayout;
@Key
private List<PivotValue> values;
static {
Data.nullOf(PivotGroup.class);
Data.nullOf(PivotFilterCriteria.class);
Data.nullOf(PivotGroup.class);
Data.nullOf(PivotValue.class);
}
public List<PivotGroup> getColumns() {
return this.columns;
}
public PivotTable setColumns(List<PivotGroup> list) {
this.columns = list;
return this;
}
public Map<String, PivotFilterCriteria> getCriteria() {
return this.criteria;
}
public PivotTable setCriteria(Map<String, PivotFilterCriteria> map) {
this.criteria = map;
return this;
}
public List<PivotGroup> getRows() {
return this.rows;
}
public PivotTable setRows(List<PivotGroup> list) {
this.rows = list;
return this;
}
public GridRange getSource() {
return this.source;
}
public PivotTable setSource(GridRange gridRange) {
this.source = gridRange;
return this;
}
public String getValueLayout() {
return this.valueLayout;
}
public PivotTable setValueLayout(String str) {
this.valueLayout = str;
return this;
}
public List<PivotValue> getValues() {
return this.values;
}
public PivotTable setValues(List<PivotValue> list) {
this.values = list;
return this;
}
public PivotTable set(String str, Object obj) {
return (PivotTable) super.set(str, obj);
}
public PivotTable clone() {
return (PivotTable) super.clone();
}
}
| [
"[email protected]"
] | |
e189b167c69630468547ef8d6c7cd7c42a170821 | 2fd9d77d529e9b90fd077d0aa5ed2889525129e3 | /DecompiledViberSrc/app/src/main/java/com/google/android/gms/internal/ads/zzva.java | f9b30d37c11c71757e39d4be9441aa2605aa794a | [] | no_license | cga2351/code | 703f5d49dc3be45eafc4521e931f8d9d270e8a92 | 4e35fb567d359c252c2feca1e21b3a2a386f2bdb | refs/heads/master | 2021-07-08T15:11:06.299852 | 2021-05-06T13:22:21 | 2021-05-06T13:22:21 | 60,314,071 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 364 | java | package com.google.android.gms.internal.ads;
import java.util.Comparator;
final class zzva
implements Comparator<zzvg>
{
zzva(zzuz paramzzuz)
{
}
}
/* Location: E:\Study\Tools\apktool2_2\dex2jar-0.0.9.15\classes_viber_2_dex2jar.jar
* Qualified Name: com.google.android.gms.internal.ads.zzva
* JD-Core Version: 0.6.2
*/ | [
"[email protected]"
] | |
928aec12a1b90fbeaecabe865425b708aec17b1c | 1c1eb038bd3407a0da8a8ce34f17f384dda367f3 | /Migrated/CrackCode/src/solvedTopcoder/RectangleGroups.java | e2ff028fd9de7c78f4b4f5f2e504b29d669030fa | [] | no_license | afaly/CrackCode | ae6e7fcd82a250a1332d55e0a7b0040f63f66b55 | 3a6cda4e7d9252e496956c88de6e27c3a6bc9dd7 | refs/heads/master | 2021-01-10T14:04:24.452808 | 2016-01-04T07:12:58 | 2016-01-04T07:12:58 | 45,332,601 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 770 | java | package solvedTopcoder;
import java.util.Arrays;
public class RectangleGroups {
public String maximalIndexed(String[] rectangles) {
Arrays.sort(rectangles);
String maxName = null;
int maxIndex = -1;
int index = -1;
for (int i = 0; i <= rectangles.length; i++) {
int area = -1;
if (i < rectangles.length) {
String fields[] = rectangles[i].split(" ");
area = Integer.parseInt(fields[1])
* Integer.parseInt(fields[2]);
}
if (i < rectangles.length && i > 0
&& rectangles[i].charAt(0) == rectangles[i - 1].charAt(0)) {
index += area;
} else {
if (i > 0 && index > maxIndex) {
maxIndex = index;
maxName = rectangles[i - 1].charAt(0) + "";
}
index = area;
}
}
return maxName + " " + maxIndex;
}
}
| [
"[email protected]"
] | |
6c5347b4e7957e2cb00e4f44d0a04a7b43025f3f | 60c7d8b2e8ae1d547f6cfc52b81d2eade1faf31d | /reportProject/st-js-stjs-3.3.0/generator/src/test/java/org/stjs/generator/writer/names/Names5.java | 5639fe5ce16611675e7dea4e0b20c48cbcfc744c | [
"Apache-2.0"
] | permissive | dovanduy/Riddle_artifact | 851725d9ac1b73b43b82b06ff678312519e88941 | 5371ee83161f750892d4f7720f50043e89b56c87 | refs/heads/master | 2021-05-18T10:00:54.221815 | 2019-01-27T10:10:01 | 2019-01-27T10:10:01 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package org.stjs.generator.writer.names;
public class Names5 {
private int field = 1;
public int method(Names5 THIS) {
return THIS.field;
}
}
| [
"[email protected]"
] | |
829ad36c98f5852a7731d2ab7b7f1cf02611e8a3 | bbe34278f3ed99948588984c431e38a27ad34608 | /sources/de/danoeh/antennapod/core/storage/EpisodeCleanupAlgorithm.java | 893c6fee0b334321ac18098bd1f35aa0c0a7447f | [] | no_license | sapardo10/parcial-pruebas | 7af500f80699697ab9b9291388541c794c281957 | 938a0ceddfc8e0e967a1c7264e08cd9d1fe192f0 | refs/heads/master | 2020-04-28T02:07:08.766181 | 2019-03-10T21:51:36 | 2019-03-10T21:51:36 | 174,885,553 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,226 | java | package de.danoeh.antennapod.core.storage;
import android.content.Context;
import de.danoeh.antennapod.core.preferences.UserPreferences;
public abstract class EpisodeCleanupAlgorithm {
protected abstract int getDefaultCleanupParameter();
public abstract int getReclaimableItems();
protected abstract int performCleanup(Context context, int i);
public int performCleanup(Context context) {
return performCleanup(context, getDefaultCleanupParameter());
}
public int makeRoomForEpisodes(Context context, int amountOfRoomNeeded) {
return performCleanup(context, getNumEpisodesToCleanup(amountOfRoomNeeded));
}
int getNumEpisodesToCleanup(int amountOfRoomNeeded) {
if (amountOfRoomNeeded >= 0) {
if (UserPreferences.getEpisodeCacheSize() != UserPreferences.getEpisodeCacheSizeUnlimited()) {
int downloadedEpisodes = DBReader.getNumberOfDownloadedEpisodes();
if (downloadedEpisodes + amountOfRoomNeeded >= UserPreferences.getEpisodeCacheSize()) {
return (downloadedEpisodes + amountOfRoomNeeded) - UserPreferences.getEpisodeCacheSize();
}
}
}
return 0;
}
}
| [
"[email protected]"
] | |
764288e0057173b9facdc1f156ebd0745a82e712 | 5d886e65dc224924f9d5ef4e8ec2af612529ab93 | /sources/kotlin/sequences/SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1.java | fcf2b391e531978f5a286afc42832c06143d87bb | [] | no_license | itz63c/SystemUIGoogle | 99a7e4452a8ff88529d9304504b33954116af9ac | f318b6027fab5deb6a92e255ea9b26f16e35a16b | refs/heads/master | 2022-05-27T16:12:36.178648 | 2020-04-30T04:21:56 | 2020-04-30T04:21:56 | 260,112,526 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 474 | java | package kotlin.sequences;
import java.util.Iterator;
/* compiled from: Sequences.kt */
public final class SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1 implements Sequence<T> {
final /* synthetic */ Iterator $this_asSequence$inlined;
public SequencesKt__SequencesKt$asSequence$$inlined$Sequence$1(Iterator it) {
this.$this_asSequence$inlined = it;
}
public Iterator<T> iterator() {
return this.$this_asSequence$inlined;
}
}
| [
"[email protected]"
] | |
509b38ac5af43854730bc0d2b7887253fe6f9221 | 458fe3e3b5e6fb37a7ff9938c09eeec4472cf70c | /p022_jincheng_baohuo/src/main/java/com/example/p022_jincheng_baohuo/MainActivity.java | a30e1602c981dea16429753afa1d15b9936d4de2 | [] | no_license | imgt/myapplication2018 | 5cbebc825094927514ae56f2970452221eed5f72 | 4599093c12a7850499118589d362ed74539b2363 | refs/heads/master | 2020-04-10T16:18:11.701456 | 2018-08-08T02:24:50 | 2018-08-08T02:24:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 942 | java | package com.example.p022_jincheng_baohuo;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import com.example.p022_jincheng_baohuo.demo1.MainActivity1;
import com.example.p022_jincheng_baohuo.demo2.MainActivity2;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void DEMO1(View view) {
startActivity(new Intent(MainActivity.this, MainActivity1.class));
}
public void DEMO2(View view) {
startActivity(new Intent(MainActivity.this, MainActivity2.class));
}
@Override
public void onBackPressed() {
super.onBackPressed();
// android.os.Process.killProcess(android.os.Process.myPid());
// System.exit(0);
}
}
| [
"[email protected]"
] | |
6bcb08d5c499bd8a100020874605b39f3ab3a968 | dd3512eebf95368c377960a609fcb09ef17ca6d9 | /CN1AppleSignInDemo/native/internal_tmp/com/codename1/auth/apple/WebViewBrowserWindow.java | 4053a5e87495ce86e69bfd6251fec525b67f0d56 | [] | no_license | shannah/cn1-applesignin | e8bfed3109e1c960286d97d48b5489a66ee15653 | 52af35d27dcd26136dc645880badab240742bf85 | refs/heads/master | 2021-07-03T17:29:29.605751 | 2021-04-29T19:46:01 | 2021-04-29T19:46:01 | 233,143,319 | 0 | 1 | null | 2021-04-29T19:29:20 | 2020-01-10T22:50:33 | HTML | UTF-8 | Java | false | false | 2,185 | java | package com.codename1.auth.apple;
import ca.weblite.webview.WebViewCLIClient;
import ca.weblite.webview.WebViewClient;
import com.codename1.impl.javase.*;
import com.codename1.io.Log;
import com.codename1.ui.BrowserWindow;
import com.codename1.ui.events.ActionEvent;
/**
* A wrapper for the native webview window. This will use the native browser window
* of the platform (WebKit on MacOS and Linux, and either EDGE Chromium, or EDGE on Windows).
* Uses https://github.com/shannah/webviewjar
* @author shannah
*/
public class WebViewBrowserWindow extends AbstractBrowserWindowSE {
WebViewCLIClient webview;
WebViewCLIClient.Builder builder;
private boolean closed;
public WebViewBrowserWindow(String startURL) {
System.out.println("Creating new browser window for "+startURL);
builder = (WebViewCLIClient.Builder)new WebViewCLIClient.Builder().url(startURL);
}
public void show() {
if (webview == null) {
webview = builder.build();
webview.addLoadListener(new WebViewClient.WebEventListener<WebViewClient.OnLoadWebEvent>() {
@Override
public void handleEvent(WebViewClient.OnLoadWebEvent evt) {
fireLoadEvent(new ActionEvent(evt.getURL()));
}
});
}
}
public void setSize(final int width, final int height) {
builder.size(width, height);
}
public void setTitle(final String title) {
builder.title(title);
}
public void hide() {
if (!closed) {
closed = true;
if (webview != null) {
try {
webview.close();
} catch (Exception ex) {
Log.e(ex);
}
}
}
}
public void cleanup() {
hide();
}
public void eval(BrowserWindow.EvalRequest req) {
if (webview != null) {
webview.eval(req.getJS()).thenAccept(str->{
if (!req.isDone()) {
req.complete(str);
}
});
}
}
}
| [
"[email protected]"
] | |
830b12b39a996528ee1ab2c32a2bdf490f1d6335 | 8870fa16fe6f0fe3e791c1463c5ee83c46f86839 | /mmoarpg/mmoarpg-game/src/main/java/com/wanniu/game/recent/RecentChatCenter.java | 15f0efcde2f9a440ce66129e75e8b443cf038315 | [] | no_license | daxingyou/yxj | 94535532ea4722493ac0342c18d575e764da9fbb | 91fb9a5f8da9e5e772e04b3102fe68fe0db5e280 | refs/heads/master | 2022-01-08T10:22:48.477835 | 2018-04-11T03:18:37 | 2018-04-11T03:18:37 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,040 | java | package com.wanniu.game.recent;
import java.util.HashMap;
import java.util.Map;
import com.wanniu.game.common.ConstsTR;
import com.wanniu.game.poes.RecentChatPO;
import com.wanniu.redis.PlayerPOManager;
/**
* 最近联系人管理中心
*
* @author jjr
*
*/
public class RecentChatCenter {
private static RecentChatCenter instance;
private Map<String, RecentChatMgr> recentChatMgrs; // 所有好友数据
private RecentChatCenter() {
recentChatMgrs = new HashMap<String, RecentChatMgr>();
}
public static RecentChatCenter getInstance() {
if (null == instance) {
instance = new RecentChatCenter();
}
return instance;
}
public RecentChatMgr getRecentChatMgr(String playerId) {
if (recentChatMgrs.containsKey(playerId)) {
return recentChatMgrs.get(playerId);
}
RecentChatPO po = PlayerPOManager.findPO(ConstsTR.playerRecentChatTR, playerId, RecentChatPO.class);
RecentChatMgr recentChatMgr = new RecentChatMgr(playerId, po);
recentChatMgrs.put(playerId, recentChatMgr);
return recentChatMgr;
}
}
| [
"[email protected]"
] | |
f26e761be8d987259bcbb49630f7e9b9ca1769ce | 3634f5e03035d1f3f583c776b5555ceb24b8c331 | /sparkmall-commons/src/main/java/com/tingyu/sparkmall/commons/utils/Query.java | 336b0c6d444d27c9883033f9e0b59d951efd7f5f | [] | no_license | Essionshy/sparkmall | 591a0a5f48010e880ebf7bcb58b01d920317f4bb | 5208897ebe6c8223fd5c337c61e5acaa3503839f | refs/heads/master | 2023-04-23T22:22:59.854714 | 2020-12-15T05:42:02 | 2020-12-15T05:42:02 | 263,085,093 | 0 | 0 | null | 2020-07-01T19:16:28 | 2020-05-11T15:38:40 | JavaScript | UTF-8 | Java | false | false | 2,259 | java | /**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有,侵权必究!
*/
package com.tingyu.sparkmall.commons.utils;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tingyu.sparkmall.commons.filter.SQLFilter;
import org.apache.commons.lang.StringUtils;
import java.util.Map;
/**
* 查询参数
*
* @author Mark [email protected]
*/
public class Query<T> {
public IPage<T> getPage(Map<String, Object> params) {
return this.getPage(params, null, false);
}
public IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) {
//分页参数
long curPage = 1;
long limit = 10;
if (params.get(Constant.PAGE) != null) {
curPage = Long.parseLong((String) params.get(Constant.PAGE));
}
if (params.get(Constant.LIMIT) != null) {
limit = Long.parseLong((String) params.get(Constant.LIMIT));
}
//分页对象
Page<T> page = new Page<>(curPage, limit);
//分页参数
params.put(Constant.PAGE, page);
//排序字段
//防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险)
String orderField = SQLFilter.sqlInject((String) params.get(Constant.ORDER_FIELD));
String order = (String) params.get(Constant.ORDER);
//前端字段排序
if (StringUtils.isNotEmpty(orderField) && StringUtils.isNotEmpty(order)) {
if (Constant.ASC.equalsIgnoreCase(order)) {
return page.addOrder(OrderItem.asc(orderField));
} else {
return page.addOrder(OrderItem.desc(orderField));
}
}
//没有排序字段,则不排序
if (StringUtils.isBlank(defaultOrderField)) {
return page;
}
//默认排序
if (isAsc) {
page.addOrder(OrderItem.asc(defaultOrderField));
} else {
page.addOrder(OrderItem.desc(defaultOrderField));
}
return page;
}
}
| [
"[email protected]"
] | |
c69df00a4e851a9c02fefb88485ade72908aaf56 | ad33b778118be4a59d6a7b17e135376a08247a53 | /Android/doraemonkit/src/main/java/com/didichuxing/doraemonkit/kit/alignruler/AlignRulerMarkerDokitView.java | c748f72451242215108df8d4b913a682a8eb7933 | [
"Apache-2.0"
] | permissive | KnightGuard/DoraemonKit | 50b96e4db68344b3085e39c601c8cb70a705440f | a1107c585b2f32d764c5a74735cd0135d56b4dd1 | refs/heads/master | 2021-03-26T13:26:41.418193 | 2020-03-16T06:52:24 | 2020-03-16T06:52:24 | 247,708,079 | 1 | 1 | Apache-2.0 | 2020-03-16T13:22:48 | 2020-03-16T13:22:47 | null | UTF-8 | Java | false | false | 4,033 | java | package com.didichuxing.doraemonkit.kit.alignruler;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.FrameLayout;
import com.didichuxing.doraemonkit.DoraemonKit;
import com.didichuxing.doraemonkit.R;
import com.didichuxing.doraemonkit.ui.base.AbsDokitView;
import com.didichuxing.doraemonkit.ui.base.DokitViewLayoutParams;
import com.didichuxing.doraemonkit.util.UIUtils;
import java.util.ArrayList;
import java.util.List;
/**
* Created by jintai on 2019/09/26.
*/
public class AlignRulerMarkerDokitView extends AbsDokitView {
private List<OnAlignRulerMarkerPositionChangeListener> mPositionChangeListeners = new ArrayList<>();
@Override
public View onCreateView(Context context, FrameLayout view) {
return LayoutInflater.from(context).inflate(R.layout.dk_float_align_ruler_marker, null);
}
@Override
public void onViewCreated(FrameLayout view) {
}
@Override
public void initDokitViewLayoutParams(DokitViewLayoutParams params) {
params.height = DokitViewLayoutParams.WRAP_CONTENT;
params.width = DokitViewLayoutParams.WRAP_CONTENT;
params.x = UIUtils.getWidthPixels() / 2;
params.y = UIUtils.getHeightPixels() / 2;
}
@Override
public void onCreate(Context context) {
}
@Override
public void onDestroy() {
super.onDestroy();
removePositionChangeListeners();
}
@Override
public void onMove(int x, int y, int dx, int dy) {
super.onMove(x, y, dx, dy);
for (OnAlignRulerMarkerPositionChangeListener listener : mPositionChangeListeners) {
if (isNormalMode()) {
listener.onPositionChanged(getNormalLayoutParams().leftMargin + getRootView().getWidth() / 2, getNormalLayoutParams().topMargin + getRootView().getHeight() / 2);
} else {
listener.onPositionChanged(getSystemLayoutParams().x + getRootView().getWidth() / 2, getSystemLayoutParams().y + getRootView().getHeight() / 2);
}
}
}
@Override
public void updateViewLayout(String tag, boolean isActivityResume) {
super.updateViewLayout(tag, isActivityResume);
//更新标尺的位置信息
for (OnAlignRulerMarkerPositionChangeListener listener : mPositionChangeListeners) {
if (isNormalMode()) {
listener.onPositionChanged(getNormalLayoutParams().leftMargin + getRootView().getWidth() / 2, getNormalLayoutParams().topMargin + getRootView().getHeight() / 2);
} else {
listener.onPositionChanged(getSystemLayoutParams().x + getRootView().getWidth() / 2, getSystemLayoutParams().y + getRootView().getHeight() / 2);
}
}
}
public interface OnAlignRulerMarkerPositionChangeListener {
void onPositionChanged(int x, int y);
}
public void addPositionChangeListener(OnAlignRulerMarkerPositionChangeListener positionChangeListener) {
mPositionChangeListeners.add(positionChangeListener);
//更新标尺的位置信息
for (OnAlignRulerMarkerPositionChangeListener listener : mPositionChangeListeners) {
if (isNormalMode()) {
listener.onPositionChanged(getNormalLayoutParams().leftMargin + getRootView().getWidth() / 2, getNormalLayoutParams().topMargin + getRootView().getHeight() / 2);
} else {
listener.onPositionChanged(getSystemLayoutParams().x + getRootView().getWidth() / 2, getSystemLayoutParams().y + getRootView().getHeight() / 2);
}
}
}
public void removePositionChangeListener(OnAlignRulerMarkerPositionChangeListener positionChangeListener) {
mPositionChangeListeners.remove(positionChangeListener);
}
private void removePositionChangeListeners() {
mPositionChangeListeners.clear();
}
@Override
public boolean restrictBorderline() {
return false;
}
}
| [
"[email protected]"
] | |
2ec2871c9374b372eb8c241aa3766c9305b50c00 | 8be3aa9490194dd71f318ff61dee0ff7a0ceeb0c | /AutoFramework/src/test/java/com/cucumber/steps/AutoCucumberSteps.java | 8aecd1cd53c1a84179e8d6610c4f75a403a2c624 | [] | no_license | vchavda/sandbox | 4f5e91f8e7214313a5a728101193c4136e35b64a | 5e5d69f41d065a2171a56b7975bd31e71e89e0a0 | refs/heads/master | 2020-05-24T17:35:37.493010 | 2019-05-18T18:16:16 | 2019-05-18T18:16:16 | 187,389,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 231 | java | package com.cucumber.steps;
import cucumber.api.java.en.When;
public class AutoCucumberSteps {
@When("^user makes an API call then they get a valid status code back$")
public void verifyValid_APICall()
{
assert(true);
}
}
| [
"="
] | = |
3bff64ad115377a69ba2e8f4672f1c57418a03eb | f72debfddd0bfce0b7e94bcb912c3269b710ee46 | /spring_web_mvc/java-servlet-demo/src/main/java/me/yjs/WebApplication.java | 6432536aab1499926dcbc7f8cec309679e5d8926 | [] | no_license | yjs2952/inflearn_study | c2d965cbcbd8ddd6ee1fdfe33934072b0b253ab4 | cad959441af8dfea41fbdf1adcbc7576d59f3b2d | refs/heads/master | 2022-12-21T20:52:21.639859 | 2020-02-18T15:52:38 | 2020-02-18T15:52:38 | 175,658,593 | 0 | 0 | null | 2022-12-15T23:47:41 | 2019-03-14T16:21:54 | Java | UTF-8 | Java | false | false | 993 | java | package me.yjs;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.springframework.web.servlet.DispatcherServlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
public class WebApplication implements WebApplicationInitializer {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
AnnotationConfigWebApplicationContext ac = new AnnotationConfigWebApplicationContext();
// ac.setServletContext(servletContext); // servletContext를 참조하기 때문에 반드시 설정해야 한다.
ac.register(WebConfig.class);
ac.refresh();
DispatcherServlet dispatcherServlet = new DispatcherServlet(ac);
ServletRegistration.Dynamic app = servletContext.addServlet("app", dispatcherServlet);
app.addMapping("/app/*");
}
}
| [
"[email protected]"
] | |
deb27cc3d00638c253f66e81963ff38dd744baae | ef6fead2bf1aaedbef0707b5ad900c1bfe52e0eb | /SLIB/src/main/java/com/sp/lib/activity/STestActivity.java | 2aa7c03054d6be598d0a35a08d8dab261ab3707f | [] | no_license | summerEnd/Svmuu | 431f404a90c7d3b53162952b28d4012ef6a3a2f2 | e9ec97bcbcafa52175c4490dd7be7f751334ff7e | refs/heads/master | 2021-01-23T08:57:01.926816 | 2015-07-15T10:16:06 | 2015-07-15T10:16:06 | 33,851,430 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,474 | java | package com.sp.lib.activity;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.sp.lib.widget.material.MaterialLayout;
import java.util.ArrayList;
import java.util.List;
public abstract class STestActivity extends ListActivity {
private List<Class<? extends Activity>> activities = new ArrayList<Class<? extends Activity>>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addTest(activities);
setListAdapter(new MyAdapter());
}
/**
* add your test Here
*
* @param activities
*/
protected abstract void addTest(List<Class<? extends Activity>> activities);
private class MyAdapter extends BaseAdapter implements View.OnClickListener{
@Override
public int getCount() {
return activities.size();
}
@Override
public Object getItem(int position) {
return activities.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
MaterialLayout layout;
if (convertView == null) {
layout = new MaterialLayout(STestActivity.this);
layout.setMaterialBackground(Color.WHITE);
layout.setMaterialWave(Color.LTGRAY);
TextView textView = new TextView(STestActivity.this);
textView.setTextColor(Color.BLACK);
textView.setTextSize(17);
textView.setPadding(10,15,10,15);
layout.addView(textView);
layout.setOnClickListener(this);
} else {
layout = (MaterialLayout) convertView;
}
((TextView) layout.getChildAt(1)).setText(activities.get(position).getSimpleName());
layout.setTag(position);
return layout;
}
@Override
public void onClick(View v) {
int position= (int) v.getTag();
startActivity(new Intent(STestActivity.this, activities.get(position)));
}
}
}
| [
"[email protected]"
] | |
4cad03d8455227d80d1e302132fbcf367473bd3f | 3fcd99f033ac157da4d9be74d89ec8ec685e7491 | /hoauapp_si/src/main/java/com/hoau/hoauapp/si/newoms/ResetPwdResponse.java | e0a377fe38dff8c747cf6e472fe4e8cf1e89b23a | [] | no_license | mcqingxian/hoauapp | 2fa3741bb0107e4bbb69d20a54a52228c8b51773 | 6fd5cc8063229afd0e207040d8fb61ea96f2a935 | refs/heads/master | 2021-01-02T22:36:01.642768 | 2017-08-04T14:38:21 | 2017-08-04T14:38:21 | 99,350,012 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,537 | java |
package com.hoau.hoauapp.si.newoms;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>anonymous complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="out" type="{http://model.mobile.interfaces.sinotrans.com}ResetPwdResModel"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"out"
})
@XmlRootElement(name = "resetPwdResponse")
public class ResetPwdResponse {
@XmlElement(required = true, nillable = true)
protected ResetPwdResModel out;
/**
* 获取out属性的值。
*
* @return
* possible object is
* {@link ResetPwdResModel }
*
*/
public ResetPwdResModel getOut() {
return out;
}
/**
* 设置out属性的值。
*
* @param value
* allowed object is
* {@link ResetPwdResModel }
*
*/
public void setOut(ResetPwdResModel value) {
this.out = value;
}
}
| [
"[email protected]"
] | |
3c79817d2646a5cfc3cf171b93a7228490086b4a | 8b96417ea286f9b2d3ec7d448e1a31c0ba8d57cb | /metaobj/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/shared/control/servlet/SakaiComponentDispatchServlet.java | 4b3f084111de1f4f36b286260d3286b57b76a0f6 | [
"ECL-2.0"
] | permissive | deemsys/Deemsys_Learnguild | d5b11c5d1ad514888f14369b9947582836749883 | 606efcb2cdc2bc6093f914f78befc65ab79d32be | refs/heads/master | 2021-01-15T16:16:12.036004 | 2013-08-13T12:13:45 | 2013-08-13T12:13:45 | 12,083,202 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,227 | java | /**********************************************************************************
* $URL: https://source.sakaiproject.org/svn/metaobj/tags/sakai-2.9.2/metaobj-util/tool-lib/src/java/org/sakaiproject/metaobj/shared/control/servlet/SakaiComponentDispatchServlet.java $
* $Id: SakaiComponentDispatchServlet.java 73944 2010-02-21 11:37:41Z [email protected] $
***********************************************************************************
*
* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009 The Sakai Foundation
*
* Licensed under the Educational Community 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.osedu.org/licenses/ECL-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.sakaiproject.metaobj.shared.control.servlet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.sakaiproject.component.cover.ComponentManager;
import org.sakaiproject.metaobj.shared.model.Agent;
import org.sakaiproject.metaobj.shared.model.Artifact;
import org.sakaiproject.metaobj.shared.model.Id;
import org.sakaiproject.metaobj.shared.model.IdImpl;
import org.sakaiproject.metaobj.shared.model.OspException;
import org.sakaiproject.tool.api.Session;
import org.sakaiproject.tool.api.ToolSession;
import org.sakaiproject.tool.cover.SessionManager;
import org.springframework.web.servlet.DispatcherServlet;
public class SakaiComponentDispatchServlet extends DispatcherServlet {
private class SimpleAgent2 implements Agent {
String uid = "";
String eid = "";
SimpleAgent2(String eid, String uid) {
this.eid = eid;
this.uid = uid;
}
public Id getId() {
return new IdImpl(uid, null);
}
public Id getEid() {
return new IdImpl(eid, null);
}
public Artifact getProfile() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public Object getProperty(String key) {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public String getDisplayName() {
return this.uid;
}
public boolean isInRole(String role) {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
public boolean isInitialized() {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
public String getRole() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public List getWorksiteRoles(String worksiteId) {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public List getWorksiteRoles() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public boolean isRole() {
return false;
}
public String getName() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public String getPassword() {
return null; // not implemented
}
}
protected final transient Log logger = LogFactory.getLog(getClass());
public static final String TOOL_STATE_VIEW_KEY = "osp.tool.state.view";
public static final String TOOL_STATE_VIEW_REQUEST_PARAMS_KEY = "osp.tool.state.request.params";
/**
* Obtain and use the handler for this method.
* The handler will be obtained by applying the servlet's HandlerMappings in order.
* The HandlerAdapter will be obtained by querying the servlet's
* installed HandlerAdapters to find the first that supports the handler class.
* Both doGet() and doPost() are handled by this method.
* It's up to HandlerAdapters to decide which methods are acceptable.
*/
protected void doService(HttpServletRequest req, HttpServletResponse resp) throws Exception {
// This class has been removed from all places where it was used and replaced by the Spring
// dispatcher from which it inherits. Delegate to super for now in case this ever gets called.
// There is one place that depends on the tool constants above, in CommentListGenerator.
// These constants should be relocated and this class purged.
super.doService(req, resp);
}
/**
* Called by the servlet container to indicate to a servlet that the
* servlet is being placed into service. See {@link javax.servlet.Servlet#init}.
* <p/>
* <p>This implementation stores the {@link javax.servlet.ServletConfig}
* object it receives from the servlet container for later use.
* When overriding this form of the method, call
* <code>super.init(config)</code>.
*
* @param config the <code>ServletConfig</code> object
* that contains configutation
* information for this servlet
* @throws javax.servlet.ServletException if an exception occurs that
* interrupts the servlet's normal
* operation
* @see javax.servlet.UnavailableException
*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
protected RequestSetupFilter getFilter() {
return (RequestSetupFilter) ComponentManager.getInstance().get(RequestSetupFilter.class.getName());
}
}
| [
"[email protected]"
] | |
b91f3d04f9e32761b2f54e4bef886e9b77f07c02 | f680094f6d14de8d3f57bd25013729f2d5578592 | /src/org/encog/ml/data/MLDataSet.java | 8be61937fc63d7baa3e0cf2e8b6034ffc8d94cf2 | [] | no_license | bernardobreder/demo-neural-network | 82dc070f04eb8995ece040274a9c04e06c5cb153 | adf4485064bc4c1cf9dbad2f54242e31e23bdcd2 | refs/heads/master | 2022-04-07T06:19:31.087748 | 2020-02-10T11:58:47 | 2020-02-10T11:58:47 | 104,338,038 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,476 | java | /*
* Encog(tm) Core v3.3 - Java Version
* http://www.heatonresearch.com/encog/
* https://github.com/encog/encog-java-core
* Copyright 2008-2014 Heaton Research, 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.
*
* For more information on Heaton Research copyrights, licenses
* and trademarks visit:
* http://www.heatonresearch.com/copyright
*/
package org.encog.ml.data;
/**
* An interface designed to abstract classes that store machine learning data.
* This interface is designed to provide EngineDataSet objects. These can be
* used to train machine learning methods using both supervised and unsupervised
* training.
*
* Some implementations of this interface are memory based. That is they store
* the entire contents of the dataset in memory.
*
* Other implementations of this interface are not memory based. These
* implementations read in data as it is needed. This allows very large datasets
* to be used. Typically the add methods are not supported on non-memory based
* datasets.
*
* @author jheaton
*/
public interface MLDataSet extends Iterable<MLDataPair> {
/**
* @return The size of the ideal data.
*/
int getIdealSize();
/**
* @return The size of the input data.
*/
int getInputSize();
/**
* @return True if this is a supervised training set.
*/
boolean isSupervised();
/**
* Determine the total number of records in the set.
*
* @return The total number of records in the set.
*/
long getRecordCount();
/**
* Read an individual record, specified by index, in random order.
*
* @param index
* The index to read.
* @param pair
* The pair that the record will be copied into.
*/
void getRecord(long index, MLDataPair pair);
/**
* Opens an additional instance of this dataset.
*
* @return The new instance.
*/
MLDataSet openAdditional();
/**
* Add a object to the dataset. This is used with unsupervised training, as
* no ideal output is provided. Note: not all implemenations support the add
* methods.
*
* @param data1
* The data item to be added.
*/
void add(MLData data1);
/**
* Add a set of input and ideal data to the dataset. This is used with
* supervised training, as ideal output is provided. Note: not all
* implementations support the add methods.
*
* @param inputData
* Input data.
* @param idealData
* Ideal data.
*/
void add(MLData inputData, MLData idealData);
/**
* Add a an object to the dataset. This is used with unsupervised training,
* as no ideal output is provided. Note: not all implementations support the
* add methods.
*
* @param inputData
* A MLDataPair object that contains both input and ideal data.
*/
void add(MLDataPair inputData);
/**
* Close this datasource and release any resources obtained by it, including
* any iterators created.
*/
void close();
int size();
MLDataPair get(int index);
}
| [
"[email protected]"
] | |
73bc293a0ebf5cc2d28379586c85127e9ce18fd9 | 40cd4da5514eb920e6a6889e82590e48720c3d38 | /desktop/applis/apps/apps_util/expressionlanguageutil/src/main/java/code/expressionlanguage/guicompos/stds/FctCompoBorTitle.java | 9d82f761840c6f2a9573bdc343374ad0a1c95d8e | [] | no_license | Cardman/projects | 02704237e81868f8cb614abb37468cebb4ef4b31 | 23a9477dd736795c3af10bccccb3cdfa10c8123c | refs/heads/master | 2023-08-17T11:27:41.999350 | 2023-08-15T07:09:28 | 2023-08-15T07:09:28 | 34,724,613 | 4 | 0 | null | 2020-10-13T08:08:38 | 2015-04-28T10:39:03 | Java | UTF-8 | Java | false | false | 952 | java | package code.expressionlanguage.guicompos.stds;
import code.expressionlanguage.AbstractExiting;
import code.expressionlanguage.ContextEl;
import code.expressionlanguage.exec.ArgumentWrapper;
import code.expressionlanguage.exec.StackCall;
import code.expressionlanguage.exec.util.ArgumentListCall;
import code.expressionlanguage.guicompos.CustComponentStruct;
import code.expressionlanguage.stds.StdCaller;
import code.expressionlanguage.structs.NullStruct;
import code.expressionlanguage.structs.Struct;
public final class FctCompoBorTitle implements StdCaller {
@Override
public ArgumentWrapper call(AbstractExiting _exit, ContextEl _cont, Struct _instance, ArgumentListCall _firstArgs, StackCall _stackCall) {
CustComponentStruct inst_ = (CustComponentStruct)_instance;
inst_.setTitledBorder(_firstArgs.getArgumentWrappers().get(0).getValue().getStruct());
return new ArgumentWrapper(NullStruct.NULL_VALUE);
}
}
| [
"[email protected]"
] | |
150127a9b0b9e2e48bf03812c320cb726e97e765 | 28c84be60c5eb64a8bea2b3b58817fb5a0811611 | /android/app/src/main/java/com/mobile_31_july_dev_8340/MainActivity.java | 68089620d3cd09e968c1f426d1035d4280a709bd | [] | no_license | crowdbotics-apps/mobile-31-july-dev-8340 | 5b114a40df4f8061590b49d51bb244e1afddbc45 | 4f3bd03a29f17c5feacdd64f64e1bdcb34824ae9 | refs/heads/master | 2022-11-27T13:40:11.412098 | 2020-07-31T08:25:53 | 2020-07-31T08:25:53 | 283,946,765 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 391 | java | package com.mobile_31_july_dev_8340;
import com.facebook.react.ReactActivity;
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "mobile_31_july_dev_8340";
}
}
| [
"[email protected]"
] | |
22950d5b5aef9e5c6e71ff88eafced07ad220fb6 | 038ee6b20cae51169a2ed4ed64a7b8e99b5cbaad | /schemaOrgGson/src/org/kyojo/schemaorg/m3n4/gson/core/container/IsAccessibleForFreeDeserializer.java | 8a177c3b10f58407ecb60ce7809f1994af1c5d59 | [
"Apache-2.0"
] | permissive | nagaikenshin/schemaOrg | 3dec1626781913930da5585884e3484e0b525aea | 4c9d6d098a2741c2dc2a814f1c708ee55c36e9a8 | refs/heads/master | 2021-06-25T04:52:49.995840 | 2019-05-12T06:22:37 | 2019-05-12T06:22:37 | 134,319,974 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,127 | java | package org.kyojo.schemaorg.m3n4.gson.core.container;
import java.lang.reflect.Field;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
import org.kyojo.gson.JsonDeserializationContext;
import org.kyojo.gson.JsonDeserializer;
import org.kyojo.gson.JsonElement;
import org.kyojo.gson.JsonParseException;
import org.kyojo.schemaorg.m3n4.core.impl.IS_ACCESSIBLE_FOR_FREE;
import org.kyojo.schemaorg.m3n4.core.Container.IsAccessibleForFree;
import org.kyojo.schemaorg.m3n4.gson.DeserializerTemplate;
public class IsAccessibleForFreeDeserializer implements JsonDeserializer<IsAccessibleForFree> {
public static Map<String, Field> fldMap = new HashMap<>();
@Override
public IsAccessibleForFree deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context)
throws JsonParseException {
if(jsonElement.isJsonPrimitive()) {
return new IS_ACCESSIBLE_FOR_FREE(jsonElement.getAsBoolean());
}
return DeserializerTemplate.deserializeSub(jsonElement, type, context,
new IS_ACCESSIBLE_FOR_FREE(), IsAccessibleForFree.class, IS_ACCESSIBLE_FOR_FREE.class, fldMap);
}
}
| [
"[email protected]"
] | |
854ebcc14b5dfaa5f40fd993d1ee676ba7b72911 | 86215bd7ab2457497727be0193d3960feec3b524 | /demo-fpml/src/main/generated-source/org/fpml/reporting/Portfolio.java | 97ad00d4f19aeb4d7f14d244d204c6bff1a8d210 | [] | no_license | prasobhpk/stephennimmo-templates | 4770d5619488fe39ffa289b6ede36578c29d6c4d | ce2b04c09b6352311df65ad8643f682452f9d6a7 | refs/heads/master | 2016-09-11T13:47:44.366025 | 2013-08-21T18:29:55 | 2013-08-21T18:29:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,230 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-833
// 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: 2011.06.01 at 08:58:10 AM CDT
//
package org.fpml.reporting;
import java.io.Serializable;
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.XmlID;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* A type representing an arbitary grouping of trade references.
*
* <p>Java class for Portfolio complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="Portfolio">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="partyPortfolioName" type="{http://www.fpml.org/FpML-5/reporting}PartyPortfolioName" minOccurs="0"/>
* <element name="tradeId" type="{http://www.fpml.org/FpML-5/reporting}TradeId" maxOccurs="unbounded" minOccurs="0"/>
* <element name="portfolio" type="{http://www.fpml.org/FpML-5/reporting}Portfolio" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Portfolio", propOrder = {
"partyPortfolioName",
"tradeId",
"portfolio"
})
@XmlSeeAlso({
QueryPortfolio.class
})
public class Portfolio implements Serializable
{
private final static long serialVersionUID = 1L;
protected PartyPortfolioName partyPortfolioName;
protected List<TradeId> tradeId;
protected List<Portfolio> portfolio;
@XmlAttribute
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
/**
* Gets the value of the partyPortfolioName property.
*
* @return
* possible object is
* {@link PartyPortfolioName }
*
*/
public PartyPortfolioName getPartyPortfolioName() {
return partyPortfolioName;
}
/**
* Sets the value of the partyPortfolioName property.
*
* @param value
* allowed object is
* {@link PartyPortfolioName }
*
*/
public void setPartyPortfolioName(PartyPortfolioName value) {
this.partyPortfolioName = value;
}
/**
* Gets the value of the tradeId 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 tradeId property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getTradeId().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link TradeId }
*
*
*/
public List<TradeId> getTradeId() {
if (tradeId == null) {
tradeId = new ArrayList<TradeId>();
}
return this.tradeId;
}
/**
* Gets the value of the portfolio 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 portfolio property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getPortfolio().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Portfolio }
*
*
*/
public List<Portfolio> getPortfolio() {
if (portfolio == null) {
portfolio = new ArrayList<Portfolio>();
}
return this.portfolio;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
}
| [
"[email protected]@ea902603-27ce-0092-70ca-3da810587992"
] | [email protected]@ea902603-27ce-0092-70ca-3da810587992 |
ff6a34bf67ecb2f890cb5f4e9947ae2582a18500 | dd90264bbfb79700d1d32effc207b555c29f3bcf | /wuai/trunks/commons/src/main/java/com/wuai/company/entity/Response/RechargeOrdersResponse.java | f00189c318719cf66f785f785042a930841a7797 | [] | no_license | tomzhang/other_workplace | 8cead3feda7e9f067412da8252d83da56a000b51 | 9b5beaf4ed3586e6037bd84968c6a407a8635e16 | refs/heads/master | 2020-04-22T22:18:23.913665 | 2019-01-26T03:36:19 | 2019-01-26T03:36:19 | 170,703,419 | 1 | 0 | null | 2019-02-14T14:23:21 | 2019-02-14T14:23:20 | null | UTF-8 | Java | false | false | 369 | java | package com.wuai.company.entity.Response;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.sql.rowset.serial.SerialArray;
import java.io.Serializable;
/**
* Created by hyf on 2018/1/12.
*/
@Getter
@Setter
@ToString
public class RechargeOrdersResponse implements Serializable {
private String uuid;
private Integer userId;
}
| [
"Pj879227577"
] | Pj879227577 |
7ac6b92a66127834c38dc408587db2ebaed08c76 | 4da758f179d940accfb3304b2d8fe8928ece1d8a | /javasea-volcano/javasea-volcano-common/src/main/java/com/zhirui/lmwy/common/persistence/model/result/ResultMsg.java | 87eac68ed83fda82d6e5c2386cf46bdfa2f50281 | [] | no_license | fredwang0412/java-sea | e15bdd01b91b05d7af69a777e0925d36bccccbf0 | 0380c42be481b4be4f7f38e44f525255cc3a5631 | refs/heads/master | 2023-09-04T14:42:53.828319 | 2021-11-17T02:19:30 | 2021-11-17T02:19:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 743 | java | package com.zhirui.lmwy.common.persistence.model.result;
import io.swagger.annotations.ApiModel;
import java.io.Serializable;
@ApiModel("返回信息")
public interface ResultMsg extends Serializable {
String QUERY_SUCCESS = "查询成功!";
String QUERY_FAIL = "查询失败!";
String INSERT_SUCCESS = "新增成功!";
String INSERT_FAIL = "新增失败!";
String UPDATE_SUCCESS = "更新成功!";
String UPDATE_FAIL = "更新失败!";
String DELETE_SUCCESS = "删除成功!";
String DELETE_FAIL = "删除失败!";
String CATCHEXCEPTION = "捕获到异常!";
String INCONFORMITY = "参数不符合要求!";
String SERVICE_ERROR = "服务异常,请与管理员联系!";
}
| [
"[email protected]"
] | |
cd89a1b3a1ff9aafcb44772674bdc152b367f1b8 | 9d6089379238e00c0a5fb2949c1a6e7c19b50958 | /bin/platform/bootstrap/gensrc/de/hybris/platform/advancedsavedquery/enums/AdvancedQueryComparatorEnum.java | 1eb0c9ea1a321ea742984840e7b6c064a1e574d0 | [] | no_license | ChintalaVenkat/learning_hybris | 55ce582b4796a843511d0ea83f4859afea52bd88 | 6d29f59578512f9fa44a3954dc67d0f0a5216f9b | refs/heads/master | 2021-06-18T17:47:12.173132 | 2021-03-26T11:00:09 | 2021-03-26T11:00:09 | 193,689,090 | 0 | 0 | null | 2019-06-25T10:46:40 | 2019-06-25T10:46:39 | null | UTF-8 | Java | false | false | 2,343 | java | /*
*
* [y] hybris Platform
*
* Copyright (c) 2000-2011 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*/
package de.hybris.platform.advancedsavedquery.enums;
import de.hybris.platform.core.HybrisEnumValue;
/**
* Generated enum AdvancedQueryComparatorEnum declared at extension advancedsavedquery.
*/
@SuppressWarnings("PMD")
public enum AdvancedQueryComparatorEnum implements HybrisEnumValue
{
/**
* Generated enum value for AdvancedQueryComparatorEnum.equals declared at extension advancedsavedquery.
*/
EQUALS("equals"),
/**
* Generated enum value for AdvancedQueryComparatorEnum.contains declared at extension advancedsavedquery.
*/
CONTAINS("contains"),
/**
* Generated enum value for AdvancedQueryComparatorEnum.gt declared at extension advancedsavedquery.
*/
GT("gt"),
/**
* Generated enum value for AdvancedQueryComparatorEnum.gtandequals declared at extension advancedsavedquery.
*/
GTANDEQUALS("gtandequals"),
/**
* Generated enum value for AdvancedQueryComparatorEnum.lt declared at extension advancedsavedquery.
*/
LT("lt"),
/**
* Generated enum value for AdvancedQueryComparatorEnum.ltandequals declared at extension advancedsavedquery.
*/
LTANDEQUALS("ltandequals"),
/**
* Generated enum value for AdvancedQueryComparatorEnum.startwidth declared at extension advancedsavedquery.
*/
STARTWIDTH("startwidth");
/**<i>Generated model type code constant.</i>*/
public final static String _TYPECODE = "AdvancedQueryComparatorEnum";
/** The code of this enum.*/
private final String code;
/**
* Creates a new enum value for this enum type.
*
* @param code the enum value code
*/
private AdvancedQueryComparatorEnum(final String code)
{
this.code = code.intern();
}
/**
* Gets the code of this enum value.
*
* @return code of value
*/
@Override
public String getCode()
{
return this.code;
}
/**
* Gets the type this enum value belongs to.
*
* @return code of type
*/
@Override
public String getType()
{
return getClass().getSimpleName();
}
}
| [
"[email protected]"
] | |
23a2965559749e0221ae977f2e1d6f9b9923002b | cbcca7b7a8d263f6ac7ffd687fd6d5c4fb365148 | /scf-server/src/test/java/com/github/leeyazhou/scf/server/deploy/bytecode/TestClass.java | 01d61128373c2f0ccba9d7d89cc193536022aefc | [
"Apache-2.0"
] | permissive | bytesgo/iscoder-rpc | 53dde53844491aafc3953c9777845c53d627d8ff | be4ff3fea3344663ebffa52a252f1e8b85ac876d | refs/heads/master | 2023-07-21T14:43:43.235147 | 2023-07-18T01:55:46 | 2023-07-18T01:55:46 | 94,415,117 | 0 | 0 | Apache-2.0 | 2023-07-18T01:55:48 | 2017-06-15T07:59:20 | Java | UTF-8 | Java | false | false | 577 | java | package com.github.leeyazhou.scf.server.deploy.bytecode;
import java.util.List;
public class TestClass {
public List<String> getList(List<String> list) {
return null;
}
public List<TestEntity> getListEntity(List<TestEntity> list) {
return null;
}
public List<TestEntity> getListEntity(int a, String b) {
return null;
}
public List<TestEntity> getListEntity(String a, String b) {
return null;
}
public TestEntity getListEntity(String b, int a) {
return null;
}
public TestEntity getListEntity(String a) {
return null;
}
}
| [
"[email protected]"
] | |
7cc7e900b73f504f37fc21f838c50e94273ed0ed | 66e2f35b7b56865552616cf400e3a8f5928d12a2 | /src/main/java/com/alipay/api/response/AlipayMarketingToolFengdieTemplateQueryResponse.java | 5ee490e76d365611fbab327dc68511de140828c8 | [
"Apache-2.0"
] | permissive | xiafaqi/alipay-sdk-java-all | 18dc797400847c7ae9901566e910527f5495e497 | 606cdb8014faa3e9125de7f50cbb81b2db6ee6cc | refs/heads/master | 2022-11-25T08:43:11.997961 | 2020-07-23T02:58:22 | 2020-07-23T02:58:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 896 | java | package com.alipay.api.response;
import java.util.List;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
import com.alipay.api.domain.FengdieTemplate;
import com.alipay.api.AlipayResponse;
/**
* ALIPAY API: alipay.marketing.tool.fengdie.template.query response.
*
* @author auto create
* @since 1.0, 2019-05-22 14:29:19
*/
public class AlipayMarketingToolFengdieTemplateQueryResponse extends AlipayResponse {
private static final long serialVersionUID = 6111555665993337712L;
/**
* 开发者开发上传的H5模板列表
*/
@ApiListField("template")
@ApiField("fengdie_template")
private List<FengdieTemplate> template;
public void setTemplate(List<FengdieTemplate> template) {
this.template = template;
}
public List<FengdieTemplate> getTemplate( ) {
return this.template;
}
}
| [
"[email protected]"
] | |
2301cc950847a26f0817d7ad36449232b7db0ee1 | 8fa221482da055f4c8105b590617a27595826cc3 | /sources/com/amazon/device/iap/internal/C0185a.java | 6d41df31ba9927032bf936752d8dc703cb086d2b | [] | no_license | TehVenomm/sauceCodeProject | 4ed2f12393e67508986aded101fa2db772bd5c6b | 0b4e49a98d14b99e7d144a20e4c9ead408694d78 | refs/heads/master | 2023-03-15T16:36:41.544529 | 2018-10-08T03:44:58 | 2018-10-08T03:44:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 361 | java | package com.amazon.device.iap.internal;
/* renamed from: com.amazon.device.iap.internal.a */
public interface C0185a {
/* renamed from: a */
void mo1176a(String str, String str2);
/* renamed from: a */
boolean mo1177a();
/* renamed from: b */
void mo1178b(String str, String str2);
/* renamed from: b */
boolean mo1179b();
}
| [
"[email protected]"
] | |
d746f4d0b345a2eca5a86c107f384248d7c9d3d1 | 86fa67369e29c0086601fad2d5502322f539a321 | /runtime/doovos/sites/sousse/sys/tmp/jjit/src/jjit/local/jnt/Bench/Applet/init__V_44AFC1AA/init_071.java | 5819700fdbe3261185de123cccff75b059ac26cd | [] | no_license | thevpc/doovos | 05a4ce98825bf3dbbdc7972c43cd15fc18afdabb | 1ae822549a3a546381dbf3b722814e0be1002b11 | refs/heads/master | 2021-01-12T14:56:52.283641 | 2020-08-22T12:37:40 | 2020-08-22T12:37:40 | 72,081,680 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,198 | java | package jjit.local.jnt.Bench.Applet.init__V_44AFC1AA;
import org.doovos.kernel.api.jvm.interpreter.*;
import org.doovos.kernel.api.jvm.interpreter.KFrame;
import org.doovos.kernel.api.jvm.reflect.KClass;
import org.doovos.kernel.api.jvm.reflect.KClassRepository;
import org.doovos.kernel.api.jvm.reflect.KField;
import org.doovos.kernel.api.memory.*;
import org.doovos.kernel.api.memory.KMemoryManager;
import org.doovos.kernel.api.memory.KRegister;
import org.doovos.kernel.api.process.KLocalThread;
import org.doovos.kernel.api.process.KProcess;
import org.doovos.kernel.vanilla.jvm.interpreter.jjit.instr.*;
import org.doovos.kernel.vanilla.jvm.interpreter.jjit.instr.JJITInstruction;
/**
* jnt.Bench.Applet
* init()V
* [count=4] [191] ALOAD(0) [192] GETFIELD(jnt.Bench.Applet,table,Ljava/awt/List;) [193] ALOAD(7) [194] INVOKEVIRTUAL(java.awt.Component,setBackground(Ljava/awt/Color;)V)
*/
public final class init_071 extends JJITAbstractInstruction implements Cloneable{
private KField c_table = null;
private KClassRepository c_repo;
private KClass c_CApplet = null;
private KMemoryManager c_memman;
public JJITInstruction run(KFrame frame) throws Exception {
// **REMOVED Unused Var** KRegister s0;
// **REMOVED Unused Var** KRegister s1;
// **REMOVED Unused Var** KReference s0_ref;
KRegister[] regs = null;
KLocalThread thread = frame.getThread();
KReference ref;
// **REMOVED Unused Var** KFrame nextFrame = null;
// this_ref 0 ; r=1/w=0 : NotCached
// local_7 7 ; r=1/w=0 : NotCached
// *********[191] ALOAD(0)
// **REMOVED Substitution** s0 = frame.getLocal(0);
// *********[192] GETFIELD(jnt.Bench.Applet,table,Ljava/awt/List;)
// **REMOVED Substitution** s0_ref = c_table.getInstanceRef(((KReference)frame.getLocal(0)));
// *********[193] ALOAD(7)
// **REMOVED Substitution** s1 = frame.getLocal(7);
// *********[194] INVOKEVIRTUAL(java.awt.Component,setBackground(Ljava/awt/Color;)V)
regs = new KRegister[2];
regs[1] = frame.getLocal(7);
ref = c_table.getInstanceRef(((KReference)frame.getLocal(0)));
regs[0] = ref;
frame.setProgramCounter(71);
// **REMOVED Substitution** nextFrame = thread.pushFrame(c_memman.getKClass(ref).getVirtualMethodBySignature("setBackground(Ljava/awt/Color;)V"),regs);
return ((JJITInstruction)thread.pushFrame(c_memman.getKClass(ref).getVirtualMethodBySignature("setBackground(Ljava/awt/Color;)V"),regs).getCurrentInstruction());
}
public void init(int index,JJITInstruction[] instructions,KRegister[] constants,KProcess process) throws Exception {
// *********[191] ALOAD(0)
// *********[192] GETFIELD(jnt.Bench.Applet,table,Ljava/awt/List;)
c_repo = process.getClassRepository();
c_CApplet = c_repo.getClassByName("jnt.Bench.Applet");
c_table = c_CApplet.getField("table",true);
// *********[193] ALOAD(7)
// *********[194] INVOKEVIRTUAL(java.awt.Component,setBackground(Ljava/awt/Color;)V)
c_memman = process.getMemoryManager();
}
}
| [
"[email protected]"
] | |
12ce23a8f93295f7427c63ca7c9f04627f11d8ea | 4b0d06526173850f1189a5a4f2fa3ea25697dac7 | /src/com/xu/dp/Backpack_01.java | 82d0825b8569f02b876ac66e663acabead8324ee | [
"Apache-2.0"
] | permissive | XuDeveloper/AlgorthimLearning | f787ab3263e2ef769ca61715cb156c23c58623f4 | dc0223dcf78c652edf0bbc709ada874f0d18ba79 | refs/heads/master | 2020-03-24T01:05:33.552434 | 2019-10-20T02:56:57 | 2019-10-20T02:56:57 | 142,321,841 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,139 | java | package com.xu.dp;
import java.util.Arrays;
/**
* 01背包问题
*/
public class Backpack_01 {
/**
*
* @param n 物品总数
* @param c 总容量
* @param w 每件物品的容量
* @param v 每件物品的价值
* @return 最大价值
*/
public int getBest(int n, int c, int[] w, int[] v) {
// 动态规划
if (n == 0) {
return 0;
}
int[][] dp = new int[n][c + 1];
for (int i = 0; i < c + 1; i++) {
if (w[0] <= i) {
dp[0][i] = v[0];
} else {
dp[0][i] = 0;
}
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < c + 1; j++) {
if (w[i] > j) {
dp[i][j] = dp[i - 1][j];
} else {
dp[i][j] = Math.max(dp[i][j], dp[i - 1][j - w[i]] + v[i]);
}
}
}
return dp[n - 1][c];
}
private int[][] memo;
public int backpack01(int n, int c, int[] w, int[] v) {
// 记忆化搜索
memo = new int[n][c + 1];
for (int i = 0; i < n; i++) {
for (int j = 0; j < c + 1; j++) {
memo[i][j] = -1;
}
}
return bestValue(n, c, w, v, n - 1);
}
public int bestValue(int n, int c, int[] w, int[] v, int index) {
if (index < 0 || c <= 0) {
return 0;
}
if (memo[index][c] != -1) {
return memo[index][c];
}
int res = bestValue(n, c, w, v, index - 1);
if (w[index] <= c) {
res = Math.max(res, v[index] + bestValue(n, c - w[index], w, v, index - 1));
}
memo[index][c] = res;
return res;
}
public int backpack01_improve1(int n, int c, int[] w, int[] v) {
// 空间复杂度优化1:由多行变成两行
if (n == 0) {
return 0;
}
int[][] dp = new int[2][c + 1];
for (int i = 0; i < c + 1; i++) {
if (w[0] <= i) {
dp[0][i] = v[0];
} else {
dp[0][i] = 0;
}
}
for (int i = 1; i < n; i++) {
for (int j = 0; j < c + 1; j++) {
if (w[i] > j) {
dp[i % 2][j] = dp[(i - 1) % 2][j];
} else {
dp[i % 2][j] = Math.max(dp[i % 2][j], dp[(i - 1) % 2][j - w[i]] + v[i]);
}
}
}
return dp[(n - 1) % 2][c];
}
public int backpack01_improve2(int n, int c, int[] w, int[] v) {
// 空间复杂度优化2:由多行变成一行
if (n == 0) {
return 0;
}
int[] dp = new int[c + 1];
for (int i = 0; i < c + 1; i++) {
if (w[0] <= i) {
dp[i] = v[0];
} else {
dp[i] = 0;
}
}
for (int i = 1; i < n; i++) {
for (int j = c; j >= w[i]; j--) {
dp[j] = Math.max(dp[j], v[i] + dp[j - w[i]]);
}
}
return dp[c];
}
}
| [
"[email protected]"
] | |
26f9453208f74c9c9341798e43a6f9da9a88fef9 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_262/Testnull_26120.java | ace319bb1105830238dbcf35e119e05ba88bd45c | [] | 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 | 308 | java | package org.gradle.test.performancenull_262;
import static org.junit.Assert.*;
public class Testnull_26120 {
private final Productionnull_26120 production = new Productionnull_26120("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"[email protected]"
] | |
91554811c7354c9754c43f7e021b58173d5440fe | ab950cdc8e59165e341c838053c4811caf30eec8 | /jOOQ/src/main/java/org/jooq/Typed.java | c07dd62038d749da5becdef5bd7eaad891601dc0 | [
"Apache-2.0"
] | permissive | cdalexndr/jOOQ | 12e408df7d9ce9393f506120d5d69a8154f4419c | b91e9235b30d07db4091583e30e21198f5d919c7 | refs/heads/main | 2023-08-12T12:57:52.911066 | 2021-09-29T15:59:01 | 2021-09-29T15:59:01 | 411,799,887 | 0 | 0 | NOASSERTION | 2021-09-29T19:12:38 | 2021-09-29T19:12:37 | null | UTF-8 | Java | false | false | 2,194 | java | /*
* 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.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;
import org.jooq.impl.QOM.MTyped;
import org.jetbrains.annotations.NotNull;
/**
* A marker interface for all query parts that have a {@link DataType}.
* <p>
* While there is no requirement for implementations to also implement
* {@link Named}, a lot of implementations do.
*
* @author Lukas Eder
*/
public interface Typed<T> extends QueryPart, MTyped<T> {
/**
* The object's underlying {@link Converter}.
* <p>
* By default, all typed objects reference an identity-converter
* <code>Converter<T, T></code>. If an implementation is generated,
* custom data types may be obtained by a custom {@link Converter} placed on
* the generated object.
*/
@NotNull
Converter<?, T> getConverter();
/**
* The object's underlying {@link Binding}.
*/
@NotNull
Binding<?, T> getBinding();
/**
* The Java type of the object.
*/
@NotNull
Class<T> getType();
/**
* The type of this object (might not be dialect-specific).
*/
@NotNull
DataType<T> getDataType();
/**
* The dialect-specific type of this object.
*/
@NotNull
DataType<T> getDataType(Configuration configuration);
}
| [
"[email protected]"
] | |
220f0460c795c9813a21fd2f958384d1667584ea | 74f11390228d709f49473aaf670fc7fa29daea8f | /src/test/java/com/agpulse/demoironbankstarter/DemoIronBankStarterApplicationTests.java | d2f9bfa181e99b9c43870fb489de6391e6bfeb78 | [] | no_license | mmalyutin/demo-iron-bank-starter-agpule | b61633db413e8fd0b1a1ccaf5434e4d3daacd44f | ef7cb8be6ce09fe3f2ed8165a6885627432af6fe | refs/heads/master | 2022-04-03T05:38:59.446129 | 2020-02-02T08:22:09 | 2020-02-02T08:22:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 245 | java | package com.agpulse.demoironbankstarter;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class DemoIronBankStarterApplicationTests {
@Test
void contextLoads() {
}
}
| [
"kit2009"
] | kit2009 |
972296f975997267a49e4f85f5d4656d84fe1314 | 0830718cc03004986dd9189ca8b91a8da419256a | /src/JavaStudy/Jan_29/YSH/Book.java | 14dc25922c95381760ec6155896073074e1ff728 | [] | no_license | Brilliant-Kwon/JavaEx | 3f46dba3ca81df38b2872da68c36de348c69f704 | fdc76d9b15e76b2d719b3c7e2be2d5fa7a38d656 | refs/heads/master | 2020-04-17T02:27:32.978565 | 2019-03-14T00:41:24 | 2019-03-14T00:41:24 | 166,135,514 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 912 | java | package JavaStudy.Jan_29.YSH;
public class Book extends Product{
private int isbn;
private String writer;
private String bookName;
public Book(int sik, String info, String producer, int price,int isbn,String writer,String bookName) {
super(sik, info, producer, price);
this.isbn=isbn;
this.writer=writer;
this.bookName=bookName;
}
public int getIsbn() {
return isbn;
}
public String getWriter() {
return writer;
}
public String getBookName() {
return bookName;
}
public void setIsbn(int isbn) {
this.isbn = isbn;
}
public void setWriter(String writer) {
this.writer = writer;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
@Override
public void showInfo() {
// TODO Auto-generated method stub
super.showInfo();
System.out.println("isbn>>"+isbn);
System.out.println("작가>>"+writer);
System.out.println("책이름>>"+bookName);
}
}
| [
"[email protected]"
] | |
36c873b111a8b22aeba7715385c16484d4fbb6f5 | 975945cf2c76b20d5d4448b89f7057e33d1a9ebc | /business/src/main/java/com/shareshenghuo/app/shop/OrderManageActivity.java | 75cf8217019744306ad08080787445d2b347c533 | [] | no_license | gy121681/Share | aa64f67746f88d55e884e5ae48b3789422175f8f | 031286dc1d2ce4ebe7fe2665ebd525d1946ad163 | refs/heads/master | 2021-01-15T12:02:34.908825 | 2017-08-08T03:01:07 | 2017-08-08T03:01:07 | 99,643,530 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,773 | java | package com.shareshenghuo.app.shop;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import com.shareshenghuo.app.shop.R;
import com.shareshenghuo.app.shop.fragment.OrderListFragment;
import com.shareshenghuo.app.shop.widget.MyTabView;
public class OrderManageActivity extends BaseTopActivity implements OnClickListener {
private TextView tvTitle;
private MyTabView tabView;
private List<Fragment> fragments;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order_manage);
initView();
}
public void initView() {
tvTitle = getView(R.id.tvTopTitle);
tabView = (MyTabView) findViewById(R.id.tabOrderManage);
List<Map<String,Integer>> titles = new ArrayList<Map<String,Integer>>();
Map<String,Integer> map = new HashMap<String, Integer>();
map.put("全部", null);
titles.add(map);
map = new HashMap<String, Integer>();
map.put("待接单", null);
titles.add(map);
map = new HashMap<String, Integer>();
map.put("进行中", null);
titles.add(map);
map = new HashMap<String, Integer>();
map.put("已结束", null);
titles.add(map);
fragments = new ArrayList<Fragment>();
fragments.add(new OrderListFragment());
fragments.add(new OrderListFragment());
fragments.add(new OrderListFragment());
fragments.add(new OrderListFragment());
for(int i=0; i<4; i++)
((OrderListFragment) fragments.get(i)).status = i;
tabView.createView(titles, fragments, getSupportFragmentManager());
tvTitle.setOnClickListener(this);
getView(R.id.llTopBack).setOnClickListener(this);
getView(R.id.llTopSearch).setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch(v.getId()) {
case R.id.llTopBack:
finish();
break;
case R.id.llTopSearch:
startActivity(new Intent(this, SearchOrderActivity.class));
break;
case R.id.tvTopTitle:
showOrderTypeDlg();
break;
}
}
private String[] items = {"全部订单", "外卖订单", "到店消费"};
public void showOrderTypeDlg() {
new AlertDialog.Builder(this).setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface arg0, int which) {
tvTitle.setText(items[which]);
for(int i=0; i<4; i++) {
OrderListFragment f = (OrderListFragment) fragments.get(i);
f.order_type = which;
f.onPullDownToRefresh(null);
}
}
})
.show();
}
}
| [
"[email protected]"
] | |
59d8671e3baeca9264619197fba2ce3a852081bf | 4fc2858a02172926fd24459305ce481cdd324a40 | /algorithm-leetcode-master/src/Problem_0826_安排工作以达到最大收益.java | 7a2eaf59ac4890a481adb4a30787b5a5480f92d2 | [] | no_license | qqxqqbot/algorithmzuo | ecb3fd4505862d3d6e8bfd8955778a7152c77960 | ef76cb207cc490d0aa34590ab57821c0b6063c90 | refs/heads/master | 2023-05-08T09:42:17.244171 | 2021-06-06T11:06:26 | 2021-06-06T11:06:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,512 | java |
import java.util.Arrays;
import java.util.Comparator;
/**
* @author cuilihuan
* @data 2021/5/10 17:15
*/
public class Problem_0826_安排工作以达到最大收益 {
public static void main(String[] args) {
System.out.println(new Problem_0826_安排工作以达到最大收益().maxProfitAssignment(new int[]{2, 4, 6, 8, 10}, new int[]{10, 20, 30, 40, 50}, new int[]{4, 5, 6, 7}));
}
class Info {
int difficutlty;
int profit;
public Info(int difficutlty, int profit) {
this.difficutlty = difficutlty;
this.profit = profit;
}
}
public int maxProfitAssignment(int[] difficulty, int[] profit, int[] worker) {
if (worker == null || worker.length == 0)
return 0;
Info[] info = new Info[difficulty.length];
for (int i = 0; i < difficulty.length; i++) {
info[i] = new Info(difficulty[i], profit[i]);
}
Arrays.sort(info, new Comparator<Info>() {
@Override
public int compare(Info o1, Info o2) {
return o1.difficutlty - o2.difficutlty;
}
});
Arrays.sort(worker);
int ans = 0;
int i = 0;
int curMax = 0;
for(Integer work : worker){
while (i < info.length && work >= info[i].difficutlty ){
curMax = Math.max(curMax, info[i].profit);
i++;
}
ans += curMax;
}
return ans;
}
}
| [
"[email protected]"
] | |
23438b22cc1e9847c35626d98571b35bf3651b0e | d4627ad44a9ac9dfb444bd5d9631b25abe49c37e | /net/divinerpg/item/twilight/ItemVamacheron.java | 32fb5fd31d11c326e54ac2d106900596c373a0ec | [] | no_license | Scrik/Divine-RPG | 0c357acf374f0ca7fab1f662b8f305ff0e587a2f | f546f1d60a2514947209b9eacdfda36a3990d994 | refs/heads/master | 2021-01-15T11:14:03.426172 | 2014-02-19T20:27:30 | 2014-02-19T20:27:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,392 | java | package net.divinerpg.item.twilight;
import net.divinerpg.DivineRPG;
import net.divinerpg.helper.base.ItemDivineRPG;
import net.divinerpg.twilight.mobs.EntityVamacheron;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemVamacheron extends ItemDivineRPG
{
private World worldObj;
public ItemVamacheron(int var1)
{
super(var1);
this.maxStackSize = 1;
setCreativeTab(DivineRPG.Spawn);
}
/**
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
*/
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
int var4 = 0;
if (!par3World.isRemote)
{
while (var4 < 1)//1 gets the amount of mobs to spawn at once
{
EntityVamacheron var5 = new EntityVamacheron(par3World);
var5.setPosition(par4, par5+1, par6);
par3World.spawnEntityInWorld(var5);
++var4;
}
}
--par1ItemStack.stackSize;
return true;
}
} | [
"[email protected]"
] | |
fde678602c90cf89174b89bbce66c50475bc4766 | cf729a7079373dc301d83d6b15e2451c1f105a77 | /adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201506/cm/CampaignAdExtensionApprovalStatus.java | f112f7ddfdeaa58d4f4c0f15a3c788ec659272d4 | [] | no_license | cvsogor/Google-AdWords | 044a5627835b92c6535f807ea1eba60c398e5c38 | fe7bfa2ff3104c77757a13b93c1a22f46e98337a | refs/heads/master | 2023-03-23T05:49:33.827251 | 2021-03-17T14:35:13 | 2021-03-17T14:35:13 | 348,719,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,235 | java |
package com.google.api.ads.adwords.jaxws.v201506.cm;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for CampaignAdExtension.ApprovalStatus.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="CampaignAdExtension.ApprovalStatus">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="APPROVED"/>
* <enumeration value="UNCHECKED"/>
* <enumeration value="DISAPPROVED"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "CampaignAdExtension.ApprovalStatus")
@XmlEnum
public enum CampaignAdExtensionApprovalStatus {
/**
*
* Approved.
*
*
*/
APPROVED,
/**
*
* Unchecked.
*
*
*/
UNCHECKED,
/**
*
* Disapproved.
*
*
*/
DISAPPROVED;
public String value() {
return name();
}
public static CampaignAdExtensionApprovalStatus fromValue(String v) {
return valueOf(v);
}
}
| [
"[email protected]"
] | |
6f973a0ea349d1b39bbb4c4ba5a4da322bf82503 | bec686b9c0c0d95c99095097a5e604c5ef01828b | /jdo/enhancer/src/test/java/org/datanucleus/enhancer/jdo/TestA20_7_1.java | 0041e705363f40120ee74b8e352381ee363a8ae4 | [
"Apache-2.0"
] | permissive | datanucleus/tests | d6bcbcf2df68841c1a27625a5509b87fa9ccfc9e | b47ac565c5988aba5c16389fb2870aafe9142522 | refs/heads/master | 2023-09-02T11:24:56.386187 | 2023-08-16T12:30:38 | 2023-08-16T12:30:38 | 14,927,016 | 10 | 18 | Apache-2.0 | 2023-09-13T14:01:00 | 2013-12-04T15:10:03 | Java | UTF-8 | Java | false | false | 852 | java | package org.datanucleus.enhancer.jdo;
/**
*/
public class TestA20_7_1 extends JDOTestBase
{
@SuppressWarnings("unchecked")
public void testHasWriteObjectMethod()
{
try
{
Class classes[] = getEnhancedClassesFromFile("org/datanucleus/enhancer/samples/A20_7_1.jdo");
Class targetClass = findClass(classes, "org.datanucleus.enhancer.samples.CloneableClass");
Object o1 = targetClass.getDeclaredConstructor().newInstance();
Object o2 = targetClass.getMethod("clone", new Class[0]).invoke(o1, new Object[0]);
if (o1 == o2)
{
fail();
}
}
catch (Throwable e)
{
e.printStackTrace();
fail(e.getClass().getName() + ": " + e.getMessage());
}
}
} | [
"[email protected]"
] | |
0f1287e9708d4668743c0c51d64e10b055f627e2 | 377405a1eafa3aa5252c48527158a69ee177752f | /src/org/apache/http/impl/auth/SpnegoTokenGenerator.java | e1c66b823b5e652b0ee1870f54c7050bb6349158 | [] | no_license | apptology/AltFuelFinder | 39c15448857b6472ee72c607649ae4de949beb0a | 5851be78af47d1d6fcf07f9a4ad7f9a5c4675197 | refs/heads/master | 2016-08-12T04:00:46.440301 | 2015-10-25T18:25:16 | 2015-10-25T18:25:16 | 44,921,258 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 377 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package org.apache.http.impl.auth;
import java.io.IOException;
public interface SpnegoTokenGenerator
{
public abstract byte[] generateSpnegoDERObject(byte abyte0[])
throws IOException;
}
| [
"[email protected]"
] | |
c8ec8513bf60e918058a6f57ae23c0360e026864 | f405015899c77fc7ffcc1fac262fbf0b6d396842 | /sec2-keyserver/sec2-frontend/src/main/java/org/sec2/frontend/processors/BackendJob.java | 98d9aa273c7f7b5e446de0aa38de89a89ef46c5f | [] | no_license | OniXinO/Sec2 | a10ac99dd3fbd563288b8d21806afd949aea4f76 | d0a4ed1ac97673239a8615a7ddac1d0fc0a1e988 | refs/heads/master | 2022-05-01T18:43:42.532093 | 2016-01-18T19:28:20 | 2016-01-18T19:28:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,246 | java | /*
* Copyright 2012 Ruhr-University Bochum, Chair for Network and Data Security
*
* This source code is part of the "Sec2" project and as this remains property
* of the project partners. Content and concepts have to be treated as
* CONFIDENTIAL. Publication or partly disclosure without explicit
* written permission is prohibited.
* For details on "Sec2" and its contributors visit
*
* http://nds.rub.de/research/projects/sec2/
*/
package org.sec2.frontend.processors;
import org.sec2.saml.xml.Sec2RequestMessage;
/**
* A container that encapsulates a Sec2RequestMessage,
* the corresponding client's ID and the request's ID.
*
* @author Dennis Felsch - [email protected]
* @version 0.1
*
* March 12, 2012
*/
public final class BackendJob {
/**
* The request of the client.
*/
private Sec2RequestMessage sec2Object;
/**
* The client's ID.
*/
private String clientID;
/**
* The request's ID.
*/
private String requestID;
/**
* Constructor.
*
* @param pSec2Object The request of the client
* @param pClientID The client's ID
* @param pRequestID The request's ID
*/
public BackendJob(final Sec2RequestMessage pSec2Object,
final String pClientID, final String pRequestID) {
if (pSec2Object == null) {
throw new IllegalArgumentException(
"Parameter pSec2Object must not be null");
}
if (pClientID == null) {
throw new IllegalArgumentException(
"Parameter pClientID must not be null");
}
if (pRequestID == null) {
throw new IllegalArgumentException(
"Parameter pRequestID must not be null");
}
this.sec2Object = pSec2Object;
this.clientID = pClientID;
this.requestID = pRequestID;
}
/**
* @return the sec2Object
*/
public Sec2RequestMessage getSec2Object() {
return sec2Object;
}
/**
* @return the clientID
*/
public String getClientID() {
return clientID;
}
/**
* @return the requestID
*/
public String getRequestID() {
return requestID;
}
}
| [
"developer@developer-VirtualBox"
] | developer@developer-VirtualBox |
acaabc2d6b77e2bf97d7ce842ff4f0b41d1ceffb | 9fd2d6acbb8313817f56717063c6ece3cef98f2c | /com/google/android/gms/internal/ei.java | 8c431cc65870a38ed803b0d58e1cafaaae830c00 | [] | no_license | mathysaru/realestate | 2d977f1a400ec8b30bc24c3f2f49f105ef61fafd | 6bc640ff4774c690407bc37121886628be822458 | refs/heads/master | 2023-07-26T17:06:18.588404 | 2021-09-04T15:24:57 | 2021-09-04T15:24:57 | 403,090,679 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,483 | java | package com.google.android.gms.internal;
import android.text.TextUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public final class ei
{
private static final Pattern lT = Pattern.compile("\\\\.");
private static final Pattern lU = Pattern.compile("[\\\\\"/\b\f\n\r\t]");
public static String I(String paramString)
{
Matcher localMatcher;
Object localObject1;
if (!TextUtils.isEmpty(paramString))
{
localMatcher = lU.matcher(paramString);
localObject1 = null;
while (localMatcher.find())
{
Object localObject2 = localObject1;
if (localObject1 == null) {
localObject2 = new StringBuffer();
}
switch (localMatcher.group().charAt(0))
{
default:
localObject1 = localObject2;
break;
case '\b':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\b");
localObject1 = localObject2;
break;
case '"':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\\\\"");
localObject1 = localObject2;
break;
case '\\':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\\\\\");
localObject1 = localObject2;
break;
case '/':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\/");
localObject1 = localObject2;
break;
case '\f':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\f");
localObject1 = localObject2;
break;
case '\n':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\n");
localObject1 = localObject2;
break;
case '\r':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\r");
localObject1 = localObject2;
break;
case '\t':
localMatcher.appendReplacement((StringBuffer)localObject2, "\\\\t");
localObject1 = localObject2;
}
}
if (localObject1 != null) {}
}
else
{
return paramString;
}
localMatcher.appendTail((StringBuffer)localObject1);
return ((StringBuffer)localObject1).toString();
}
}
/* Location: C:\Users\shivane\Decompilation\dex2jar-2.0\classes-dex2jar.jar!\com\google\android\gms\internal\ei.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"[email protected]"
] | |
109bcbd9bcd20ec400d15ea4b77e2052bc0695be | 7260adb2b3ca95713fb9c6f5ccc0d8db438c0ae1 | /backend/src/main/java/com/auth0/flickr2/web/rest/errors/package-info.java | fb2c90f35c220258938821c0603747cad0d9dbd5 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | riyaz-programmer/mobile-jhipster | 7550292f1411923ae00e738551a014ff8f06b3c4 | 005838f7f82a0dd5059e811d38f08fc7bfba70d3 | refs/heads/main | 2023-08-25T19:49:46.601726 | 2021-11-10T18:16:34 | 2021-11-10T18:16:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 192 | java | /**
* Specific errors used with Zalando's "problem-spring-web" library.
*
* More information on https://github.com/zalando/problem-spring-web
*/
package com.auth0.flickr2.web.rest.errors;
| [
"[email protected]"
] | |
9d8f7243ff666b8f858a4fe4f7b2889afffb770b | 0429ec7192a11756b3f6b74cb49dc1ba7c548f60 | /src/main/java/com/linkage/litms/netcutover/Object97orginal.java | 3568c9f3f984c6791d07a6bfe0474218dc7bbbca | [] | no_license | lichao20000/WEB | 5c7730779280822619782825aae58506e8ba5237 | 5d2964387d66b9a00a54b90c09332e2792af6dae | refs/heads/master | 2023-06-26T16:43:02.294375 | 2021-07-29T08:04:46 | 2021-07-29T08:04:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,023 | java | /**
* @(#)Object97orginal.java 2006-1-19
*
* Copyright 2005 联创科技.版权所有
*/
package com.linkage.litms.netcutover;
import java.util.List;
/**
*
* @author yanhj
* @version 1.00
* @since Liposs 2.1
*/
public class Object97orginal {
/**采集点ID*/
public List gather_id;
/**工单唯一编号*/
public String work97id = "";
/**属地标识*/
public String work97areaid = "";
/**业务唯一标识*/
public String productid = "";
/**发送时间*/
public String sendtime = "";
/**
* Constrator
*
*/
public Object97orginal() {
}
/**
* 采集点ID
* @return Returns the gather_id.
*/
public List getGather_id() {
return gather_id;
}
/**
* 采集点ID
* @param gather_id The gather_id to set.
*/
public void setGather_id(List gather_id) {
this.gather_id = gather_id;
}
/**
* 业务唯一标识
* @return Returns the productid.
*/
public String getProductid() {
return productid;
}
/**
* 业务唯一标识
* @param productid The productid to set.
*/
public void setProductid(String productid) {
this.productid = productid;
}
/**
* 发送时间
* @return Returns the sendtime.
*/
public String getSendtime() {
return sendtime;
}
/**
* 发送时间
* @param sendtime The sendtime to set.
*/
public void setSendtime(String sendtime) {
this.sendtime = sendtime;
}
/**
* 属地标识
* @return Returns the work97areaid.
*/
public String getWork97areaid() {
return work97areaid;
}
/**
* 属地标识
* @param work97areaid The work97areaid to set.
*/
public void setWork97areaid(String work97areaid) {
this.work97areaid = work97areaid;
}
/**
* 工单唯一编号
* @return Returns the work97id.
*/
public String getWork97id() {
return work97id;
}
/**
* 工单唯一编号
* @param work97id The work97id to set.
*/
public void setWork97id(String work97id) {
this.work97id = work97id;
}
/**
* @param args
*/
// public static void main(String[] args) {
//
// }
}
| [
"di4zhibiao.126.com"
] | di4zhibiao.126.com |
db0d39d16e0f77761faa1867338a01f8abded5d8 | a424c06ad1d6eab7ef49f1a60a041b6ee36aae80 | /src/main/java/org/tamacat/di/define/BeanConstructorParam.java | b8ab9f12f5a4c816fc279588904ddc5c3f028b11 | [
"Apache-2.0"
] | permissive | tamacat/tamacat-core | 06e783443a041b5f83d7e4268757775c079fbbbe | 212274e51b89cba9de87834531fbe58af292da48 | refs/heads/master | 2023-08-20T23:02:49.771993 | 2023-08-15T15:43:46 | 2023-08-15T15:43:46 | 231,699,334 | 0 | 0 | Apache-2.0 | 2023-04-12T17:42:07 | 2020-01-04T02:50:19 | Java | UTF-8 | Java | false | false | 1,255 | java | /*
* Copyright (c) 2007 tamacat.org
* All rights reserved.
*/
package org.tamacat.di.define;
/**
* Bean of parameter for constrctor.
*/
public class BeanConstructorParam implements Cloneable {
private String refId;
private String type;
private String value;
/**
* Return an id of reference.
*
* @return
*/
public String getRefId() {
return refId;
}
/**
* Set a id of reference.
*
* @param refId
*/
public void setRefId(String refId) {
this.refId = refId;
}
/**
* Return whether this bean use the reference.
*/
public boolean isRef() {
return refId != null;
}
/**
* Return a String of class name.
*
* @return
*/
public String getType() {
return type;
}
/**
* Set the String of class name.
*
* @param type
*/
public void setType(String type) {
this.type = type;
}
/**
* Return a value.
*
* @return
*/
public String getValue() {
return value;
}
/**
* Set the value.
*
* @param value
*/
public void setValue(String value) {
this.value = value;
}
@Override
public BeanConstructorParam clone() {
try {
return (BeanConstructorParam) super.clone();
} catch (CloneNotSupportedException e) {
throw new InternalError(e.getMessage());
}
}
}
| [
"[email protected]"
] | |
9e8651008896428b36fe97179b123e36f2187444 | 823d924693d4bbc05dace2da48b9f3e222fc0483 | /app/src/main/java/masterung/androidthai/in/th/learnrecycleview/utility/MyAdapter.java | ccdcf8e5e16631f9238ce515dd2519474e08e48c | [] | no_license | masterUNG/LearnRecycleView | be3801c35f5f79f46c57b13b9d45e3cd6cd2bd26 | 56422ae0eac9cab0507032bf606f1162656198a4 | refs/heads/master | 2021-05-01T16:43:00.611860 | 2018-02-12T14:42:30 | 2018-02-12T14:42:30 | 121,051,688 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,584 | java | package masterung.androidthai.in.th.learnrecycleview.utility;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import masterung.androidthai.in.th.learnrecycleview.R;
/**
* Created by masterung on 11/2/2018 AD.
*/
public class MyAdapter extends BaseAdapter{
private Context context;
private String[] titleStrings;
private int[] iconInts;
public MyAdapter(Context context,
String[] titleStrings,
int[] iconInts) {
this.context = context;
this.titleStrings = titleStrings;
this.iconInts = iconInts;
}
@Override
public int getCount() {
return titleStrings.length;
}
@Override
public Object getItem(int position) {
return null;
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater layoutInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = layoutInflater.inflate(R.layout.listview_layout, parent, false);
TextView textView = view.findViewById(R.id.textViewFood);
textView.setText(titleStrings[position]);
ImageView imageView = view.findViewById(R.id.imageViewFood);
imageView.setImageResource(iconInts[position]);
return view;
}
}
| [
"[email protected]"
] | |
c3302267cfdd34b877404c0c75465a40a6ad2873 | 065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be | /checkstyle_cluster/7315/tar_219.java | 7fb769148df5ce9a5ba46e023a97c590f898197f | [] | no_license | martinezmatias/GenPat-data-C3 | 63cfe27efee2946831139747e6c20cf952f1d6f6 | b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4 | refs/heads/master | 2022-04-25T17:59:03.905613 | 2020-04-15T14:41:34 | 2020-04-15T14:41:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,939 | java | package com.puppycrawl.tools.checkstyle.checks.whitespace;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import org.junit.Test;
public class TypecastParenPadCheckTest
extends BaseCheckTestSupport
{
@Test
public void testDefault()
throws Exception
{
final DefaultConfiguration checkConfig =
createCheckConfig(TypecastParenPadCheck.class);
final String[] expected = {
"89:14: '(' is followed by whitespace.",
"89:21: ')' is preceded with whitespace.",
};
verify(checkConfig, getPath("InputWhitespace.java"), expected);
}
@Test
public void testSpace()
throws Exception
{
final DefaultConfiguration checkConfig =
createCheckConfig(TypecastParenPadCheck.class);
checkConfig.addAttribute("option", PadOption.SPACE.toString());
final String[] expected = {
"87:21: '(' is not followed by whitespace.",
"87:27: ')' is not preceded with whitespace.",
"88:14: '(' is not followed by whitespace.",
"88:20: ')' is not preceded with whitespace.",
"90:14: '(' is not followed by whitespace.",
"90:20: ')' is not preceded with whitespace.",
"241:18: '(' is not followed by whitespace.",
"241:21: ')' is not preceded with whitespace.",
};
verify(checkConfig, getPath("InputWhitespace.java"), expected);
}
@Test
public void test1322879() throws Exception
{
final DefaultConfiguration checkConfig =
createCheckConfig(TypecastParenPadCheck.class);
checkConfig.addAttribute("option", PadOption.SPACE.toString());
final String[] expected = {
};
verify(checkConfig, getPath("whitespace/InputWhitespaceAround.java"),
expected);
}
}
| [
"[email protected]"
] | |
c51ad18f1f36a38392a9131f8138faf5923134df | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/7/7_8208cca974cd06d6500c7abd7389c419afb68bce/ListSorterUITest/7_8208cca974cd06d6500c7abd7389c419afb68bce_ListSorterUITest_t.java | df3775c5b7a1e87d924b60103266c68bda873c9c | [] | 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,487 | java | /*
* Copyright (C) 2013 salesforce.com, 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 org.auraframework.components.ui.listSorter;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import org.auraframework.test.*;
import org.auraframework.test.WebDriverTestCase.TargetBrowsers;
import org.auraframework.test.WebDriverUtil.BrowserType;
import org.openqa.selenium.*;
/**
* UI automation for ui:ListSorter.
* @userStory a07B0000000USVf
*/
@TargetBrowsers({BrowserType.GOOGLECHROME, BrowserType.FIREFOX, BrowserType.IE7})
public class ListSorterUITest extends WebDriverTestCase{
public static final String APP = "/uitest/listSorter_Test.cmp";
private final String ACTIVE_ELEMENT = "return $A.test.getActiveElement()";
public ListSorterUITest(String name) {
super(name);
}
/**
* Tab out should not close the sorter dialog
* The focus should remain in the Sorter Menu
* Test case for W-1985435
* @throws MalformedURLException
* @throws URISyntaxException
*/
public void testTabOutOfListSorter() throws MalformedURLException, URISyntaxException {
verifyTabOutAndEscBehaviour(Keys.TAB, true);
}
/**
* Verify pressing ESC while listSorter is opened should close the list sorter
* @throws MalformedURLException
* @throws URISyntaxException
*/
public void testEscOfListSorter() throws MalformedURLException, URISyntaxException {
verifyTabOutAndEscBehaviour(Keys.ESCAPE, false);
}
/**
* If isOpen: true then listSorter should be open after pressing tab,
* isopen: false, list sorter should be closed after pressing tab
* @param key
* @param isOpen
* @throws URISyntaxException
* @throws MalformedURLException
*/
private void verifyTabOutAndEscBehaviour(Keys keysToSend, boolean isOpen) throws MalformedURLException, URISyntaxException {
open(APP);
String trigger = "defaultListSorterTrigger";
String sorter = "defaultListSorter";
WebDriver driver = this.getDriver();
WebElement listTrigger = driver.findElement(By.className(trigger));
WebElement listSorter = driver.findElement(By.className(sorter));
//List Sorter dialog should be closed
assertFalse("list Sorter Dialog should not be visible", listSorter.getAttribute("class").contains("open"));
//click on Trigger
listTrigger.click();
//check menu list is visible after the click
assertTrue("list Sorter Dialog should be visible", listSorter.getAttribute("class").contains("open"));
WebElement activeElement = (WebElement) auraUITestingUtil.getEval(ACTIVE_ELEMENT);
activeElement.sendKeys(keysToSend);
if(isOpen){
assertTrue("list Sorter Dialog should still be visible after pressing tab", listSorter.getAttribute("class").contains("open"));
}
else{
assertFalse("list Sorter Dialog should not be visible after pressing ESC", listSorter.getAttribute("class").contains("open"));
}
}
}
| [
"[email protected]"
] | |
53d977efcb6c02bd697cf81c898cf5ec5b83c61d | e0282213c96a4421a40ca07444ce79f841181d6f | /src/inheritance/ShapeApp.java | 00ae7b9825ffbfe747da97c7423694b1d673aecb | [] | no_license | shah-smit/JavaTutorial | 59d74532f891fc219c3934611563968e6721948a | cc20a7f4bb4b25d13b6c14314f2af76692092db0 | refs/heads/master | 2021-01-18T16:47:36.560058 | 2018-10-21T04:33:02 | 2018-10-21T04:33:02 | 78,260,548 | 0 | 1 | null | 2018-10-01T08:43:38 | 2017-01-07T05:27:46 | Java | UTF-8 | Java | false | false | 992 | java | package inheritance;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.util.Random;
import goo.Goo;
public class ShapeApp extends Goo {
private Shape shape;
private Random random;
private boolean fill = true;
public ShapeApp(int w, int h, boolean tryFSE) {
super(w, h, tryFSE);
setRandom(new Random(2001));
}
public void init(int n) {
}
public void draw(Graphics g) {
if (!fill)
getShape().draw(g);
else
getShape().fill(g);
}
public void mouseClicked(MouseEvent e) {
init(shape.getNVertices());
repaint();
}
public void keyPressed(KeyEvent e) {
char key = e.getKeyChar();
if (key == 'f')
fill = true;
else if (key == 'd')
fill = false;
repaint();
}
public void setRandom(Random random) {
this.random = random;
}
public Random getRandom() {
return random;
}
public void setShape(Shape shape) {
this.shape = shape;
}
public Shape getShape() {
return shape;
}
} | [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.