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
a614b818bc00f29d8fd0a97857ce032a085a55c0
82eba08b9a7ee1bd1a5f83c3176bf3c0826a3a32
/ZmailSoap/src/wsdl-test/generated/zcsclient/admin/testGetDevicesCountSinceLastUsedResponse.java
ce28e1a2f0c853cf8fb29512b408855a15f99fbe
[ "MIT" ]
permissive
keramist/zmailserver
d01187fb6086bf3784fe180bea2e1c0854c83f3f
762642b77c8f559a57e93c9f89b1473d6858c159
refs/heads/master
2021-01-21T05:56:25.642425
2013-10-21T11:27:05
2013-10-22T12:48:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,863
java
/* * ***** BEGIN LICENSE BLOCK ***** * * Zimbra Collaboration Suite Server * Copyright (C) 2011, 2012 VMware, Inc. * * The contents of this file are subject to the Zimbra Public License * Version 1.3 ("License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.zimbra.com/license. * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. * * ***** END LICENSE BLOCK ***** */ package generated.zcsclient.admin; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for getDevicesCountSinceLastUsedResponse complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="getDevicesCountSinceLastUsedResponse"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;/sequence> * &lt;attribute name="count" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "getDevicesCountSinceLastUsedResponse") public class testGetDevicesCountSinceLastUsedResponse { @XmlAttribute(name = "count", required = true) protected int count; /** * Gets the value of the count property. * */ public int getCount() { return count; } /** * Sets the value of the count property. * */ public void setCount(int value) { this.count = value; } }
[ "bourgerie.quentin@gmail.com" ]
bourgerie.quentin@gmail.com
7a225ebc2b76539a0fa1ceca7a7c0ca09e296c9e
ebfff291a6ee38646c4d4e176f5f2eddf390ace4
/orange-demo-multi/orange-demo-multi-service/common/common-redis/src/main/java/com/orange/demo/common/redis/cache/RedissonCacheConfig.java
f7aa2c05d01c9014409c9f521c7430bd245313ba
[ "Apache-2.0" ]
permissive
jiazhizhong/orange-admin
a9d6b5b97cbea72e8fcb55c081b7dc6a523847df
bbe737d540fb670fd4ed5514f7faed4f076ef3d4
refs/heads/master
2023-08-21T11:31:22.188591
2021-10-30T06:06:40
2021-10-30T06:06:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,697
java
package com.orange.demo.common.redis.cache; import com.google.common.collect.Maps; import org.redisson.api.RedissonClient; import org.redisson.spring.cache.CacheConfig; import org.redisson.spring.cache.RedissonSpringCacheManager; import org.springframework.cache.CacheManager; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import java.util.Map; /** * 使用Redisson作为Redis的分布式缓存库。 * * @author Jerry * @date 2020-08-08 */ @Configuration @EnableCaching public class RedissonCacheConfig { private static final int DEFAULT_TTL = 3600000; /** * 定义cache名称、超时时长(毫秒)。 */ public enum CacheEnum { /** * session下上传文件名的缓存(时间是24小时)。 */ UPLOAD_FILENAME_CACHE(86400000), /** * 缺省全局缓存(时间是24小时)。 */ GLOBAL_CACHE(86400000); /** * 缓存的时长(单位:毫秒) */ private int ttl = DEFAULT_TTL; CacheEnum() { } CacheEnum(int ttl) { this.ttl = ttl; } public int getTtl() { return ttl; } } /** * 初始化缓存配置。 */ @Bean CacheManager cacheManager(RedissonClient redissonClient) { Map<String, CacheConfig> config = Maps.newHashMap(); for (CacheEnum c : CacheEnum.values()) { config.put(c.name(), new CacheConfig(c.getTtl(), 0)); } return new RedissonSpringCacheManager(redissonClient, config); } }
[ "707344974@qq.com" ]
707344974@qq.com
10c37d024db3f95545f98825d7ad03148b4790f9
1790f987d310b7ddb897a4cbad5b812828efbf02
/my_library/src/main/java/com/ist/cadillacpaltform/SDK/util/oss/STSGetter.java
0576b5dfb0cde0d3250b4804f372cc15b2e9d90b
[]
no_license
sunshaochi/Cadillacsecond4.0
d65f168e98ff72c8cfaf8b5e4d6073d839ddf161
d34d453ae7a6b8abbf903763c7a9804ae0e02e64
refs/heads/master
2020-03-17T16:59:24.568009
2018-05-17T06:45:32
2018-05-17T06:45:32
133,769,802
0
0
null
null
null
null
UTF-8
Java
false
false
2,037
java
package com.ist.cadillacpaltform.SDK.util.oss; import android.util.Log; import com.alibaba.sdk.android.oss.common.auth.OSSFederationCredentialProvider; import com.alibaba.sdk.android.oss.common.auth.OSSFederationToken; import com.ist.cadillacpaltform.SDK.network.PosmApi; import org.json.JSONException; import org.json.JSONObject; import java.io.IOException; import okhttp3.OkHttpClient; import okhttp3.Request; import okhttp3.Response; /** * Created by Administrator on 2015/12/9 0009. * 重载OSSFederationCredentialProvider生成自己的获取STS的功能 */ public class STSGetter extends OSSFederationCredentialProvider { private String stsServer = PosmApi.BASEURL + "file/mobilpolicy"; public STSGetter() { } public STSGetter(String stsServer) { //this.stsServer = stsServer; } public OSSFederationToken getFederationToken() { String stsJson; OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder().url(stsServer).build(); try { Response response = client.newCall(request).execute(); if (response.isSuccessful()) { stsJson = response.body().string(); } else { throw new IOException("Unexpected code " + response); } } catch (IOException e) { e.printStackTrace(); Log.e("GetSTSTokenFail", e.toString()); return null; } try { JSONObject jsonObjs = new JSONObject(stsJson); String ak = jsonObjs.getString("AccessKeyId"); String sk = jsonObjs.getString("AccessKeySecret"); String token = jsonObjs.getString("SecurityToken"); String expiration = jsonObjs.getString("Expiration"); return new OSSFederationToken(ak, sk, token, expiration); } catch (JSONException e) { Log.e("GetSTSTokenFail", e.toString()); e.printStackTrace(); return null; } } }
[ "673132032@qq.com" ]
673132032@qq.com
12fdb33c6915169a6cce7485319232040d3cc642
bb07201c25c20a393b12f2fd2b71b5a0b0ed4caa
/AGACEApp/FIS-PortalEmpleadoPropuestas/src/main/java/mx/gob/sat/siat/feagace/vista/helper/asignadas/ConsultarPropuestasAsignadasParamHelper.java
c8ddbe4180a4401845f41fe6b1afde91dd84f1df
[]
no_license
xtaticzero/AGACEApp
cff6187bfd3656519ba4429af39545e6ba236589
9c29cd6c2d559827aed99edf02121e626db46ccb
refs/heads/master
2020-07-19T18:35:14.882685
2018-03-19T23:49:51
2018-03-19T23:49:51
73,757,634
0
0
null
null
null
null
UTF-8
Java
false
false
4,134
java
package mx.gob.sat.siat.feagace.vista.helper.asignadas; import java.io.Serializable; import java.math.BigDecimal; import mx.gob.sat.siat.feagace.modelo.dto.propuestas.DocumentoOrdenModel; import mx.gob.sat.siat.feagace.modelo.dto.propuestas.FecetPropCancelada; import mx.gob.sat.siat.feagace.modelo.dto.propuestas.FecetRechazoPropuesta; import mx.gob.sat.siat.feagace.modelo.dto.propuestas.FecetRetroalimentacion; import mx.gob.sat.siat.feagace.modelo.dto.propuestas.FecetTransferencia; public class ConsultarPropuestasAsignadasParamHelper implements Serializable { private static final long serialVersionUID = 9043140088402755858L; private BigDecimal estatusPropuesta1; private BigDecimal estatusPropuesta2; private BigDecimal accionPropuesta; private DocumentoOrdenModel docOficioSeleccionado; private DocumentoOrdenModel docOrdenSeleccionado; private DocumentoOrdenModel docPapelSeleccionado; private FecetRechazoPropuesta docRechazoSeleccionado; private FecetRetroalimentacion docRetroSeleccionado; private FecetTransferencia docTransSeleccionado; private FecetPropCancelada docCancelacionSeleccionado; public ConsultarPropuestasAsignadasParamHelper() { this.docOficioSeleccionado = new DocumentoOrdenModel(); this.docOrdenSeleccionado = new DocumentoOrdenModel(); this.docPapelSeleccionado = new DocumentoOrdenModel(); this.docRechazoSeleccionado = new FecetRechazoPropuesta(); this.docRetroSeleccionado = new FecetRetroalimentacion(); this.docTransSeleccionado = new FecetTransferencia(); this.docCancelacionSeleccionado = new FecetPropCancelada(); } public BigDecimal getEstatusPropuesta1() { return estatusPropuesta1; } public void setEstatusPropuesta1(BigDecimal estatusPropuesta1) { this.estatusPropuesta1 = estatusPropuesta1; } public BigDecimal getEstatusPropuesta2() { return estatusPropuesta2; } public void setEstatusPropuesta2(BigDecimal estatusPropuesta2) { this.estatusPropuesta2 = estatusPropuesta2; } public BigDecimal getAccionPropuesta() { return accionPropuesta; } public void setAccionPropuesta(BigDecimal accionPropuesta) { this.accionPropuesta = accionPropuesta; } public DocumentoOrdenModel getDocOficioSeleccionado() { return docOficioSeleccionado; } public void setDocOficioSeleccionado(DocumentoOrdenModel docOficioSeleccionado) { this.docOficioSeleccionado = docOficioSeleccionado; } public DocumentoOrdenModel getDocOrdenSeleccionado() { return docOrdenSeleccionado; } public void setDocOrdenSeleccionado(DocumentoOrdenModel docOrdenSeleccionado) { this.docOrdenSeleccionado = docOrdenSeleccionado; } public DocumentoOrdenModel getDocPapelSeleccionado() { return docPapelSeleccionado; } public void setDocPapelSeleccionado(DocumentoOrdenModel docPapelSeleccionado) { this.docPapelSeleccionado = docPapelSeleccionado; } public FecetRechazoPropuesta getDocRechazoSeleccionado() { return docRechazoSeleccionado; } public void setDocRechazoSeleccionado(FecetRechazoPropuesta docRechazoSeleccionado) { this.docRechazoSeleccionado = docRechazoSeleccionado; } public FecetRetroalimentacion getDocRetroSeleccionado() { return docRetroSeleccionado; } public void setDocRetroSeleccionado(FecetRetroalimentacion docRetroSeleccionado) { this.docRetroSeleccionado = docRetroSeleccionado; } public FecetTransferencia getDocTransSeleccionado() { return docTransSeleccionado; } public void setDocTransSeleccionado(FecetTransferencia docTransSeleccionado) { this.docTransSeleccionado = docTransSeleccionado; } public FecetPropCancelada getDocCancelacionSeleccionado() { return docCancelacionSeleccionado; } public void setDocCancelacionSeleccionado(FecetPropCancelada docCancelacionSeleccionado) { this.docCancelacionSeleccionado = docCancelacionSeleccionado; } }
[ "emmanuel.estrada@stksat.com" ]
emmanuel.estrada@stksat.com
44b881910447460599724460b0c94cd37b958ebe
8b5cdda28454b0aab451a4b3216a58ca87517c41
/AL-Game/src/com/aionemu/gameserver/skillengine/effect/StatupEffect.java
68a1fcf4922dfa3d3503171bc5f7648476c4b9d4
[]
no_license
flroexus/aelp
ac36cd96963bd12847e37118531b68953f9e8440
4f6cca6b462419accf53b58c454be0cf6abe39c0
refs/heads/master
2023-05-28T18:36:47.919387
2020-09-05T07:27:49
2020-09-05T07:27:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
338
java
package com.aionemu.gameserver.skillengine.effect; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * @author ATracer */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "StatupEffect") public class StatupEffect extends BufEffect { }
[ "luiz.philip@amedigital.com" ]
luiz.philip@amedigital.com
bfd89d7c190468bb1d5fe055c56d1f791feea231
939bc9b579671de84fb6b5bd047db57b3d186aca
/java.xml/com/sun/org/apache/xalan/internal/xsltc/runtime/Operators.java
2ff04c9d9e54582082bbc0314560033dac7955a2
[]
no_license
lc274534565/jdk11-rm
509702ceacfe54deca4f688b389d836eb5021a17
1658e7d9e173f34313d2e5766f4f7feef67736e8
refs/heads/main
2023-01-24T07:11:16.084577
2020-11-16T14:21:37
2020-11-16T14:21:37
313,315,578
1
1
null
null
null
null
UTF-8
Java
false
false
1,836
java
/* * Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use 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.sun.org.apache.xalan.internal.xsltc.runtime; /** * @author Jacek Ambroziak * @author Santiago Pericas-Geertsen */ public final class Operators { public static final int EQ = 0; public static final int NE = 1; public static final int GT = 2; public static final int LT = 3; public static final int GE = 4; public static final int LE = 5; private static final String[] names = { "=", "!=", ">", "<", ">=", "<=" }; public static final String getOpNames(int operator) { return names[operator]; } // Swap operator array private static final int[] swapOpArray = { EQ, // EQ NE, // NE LT, // GT GT, // LT LE, // GE GE // LE }; public static final int swapOp(int operator) { return swapOpArray[operator]; } }
[ "274534565@qq.com" ]
274534565@qq.com
afaa5ee8bbce8876f1fc496039c3051eca66a9a1
d49bbeedf8073d0b4fc23672d24b484d8988024e
/BouncyCastle/core/src/main/java/com/distrimind/bouncycastle/asn1/cmp/PKIHeaderBuilder.java
5d33292515d0e8bb6e0e76b6a0378428f77053ba
[ "MIT", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
sqf-ice/BouncyCastle
a6b34bd56fa7e5545e19dd8a1174d614b625a1e8
02bec112a39175ebe19dd22236d2b4d6558dfa8c
refs/heads/master
2022-11-17T08:52:07.224092
2020-07-14T23:21:12
2020-07-14T23:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,546
java
package com.distrimind.bouncycastle.asn1.cmp; import com.distrimind.bouncycastle.asn1.x509.AlgorithmIdentifier; import com.distrimind.bouncycastle.asn1.x509.GeneralName; import com.distrimind.bouncycastle.asn1.ASN1Encodable; import com.distrimind.bouncycastle.asn1.ASN1EncodableVector; import com.distrimind.bouncycastle.asn1.ASN1GeneralizedTime; import com.distrimind.bouncycastle.asn1.ASN1Integer; import com.distrimind.bouncycastle.asn1.ASN1OctetString; import com.distrimind.bouncycastle.asn1.ASN1Sequence; import com.distrimind.bouncycastle.asn1.DEROctetString; import com.distrimind.bouncycastle.asn1.DERSequence; import com.distrimind.bouncycastle.asn1.DERTaggedObject; public class PKIHeaderBuilder { private ASN1Integer pvno; private GeneralName sender; private GeneralName recipient; private ASN1GeneralizedTime messageTime; private AlgorithmIdentifier protectionAlg; private ASN1OctetString senderKID; // KeyIdentifier private ASN1OctetString recipKID; // KeyIdentifier private ASN1OctetString transactionID; private ASN1OctetString senderNonce; private ASN1OctetString recipNonce; private PKIFreeText freeText; private ASN1Sequence generalInfo; public PKIHeaderBuilder( int pvno, GeneralName sender, GeneralName recipient) { this(new ASN1Integer(pvno), sender, recipient); } private PKIHeaderBuilder( ASN1Integer pvno, GeneralName sender, GeneralName recipient) { this.pvno = pvno; this.sender = sender; this.recipient = recipient; } public PKIHeaderBuilder setMessageTime(ASN1GeneralizedTime time) { messageTime = time; return this; } public PKIHeaderBuilder setProtectionAlg(AlgorithmIdentifier aid) { protectionAlg = aid; return this; } public PKIHeaderBuilder setSenderKID(byte[] kid) { return setSenderKID(kid == null ? null : new DEROctetString(kid)); } public PKIHeaderBuilder setSenderKID(ASN1OctetString kid) { senderKID = kid; return this; } public PKIHeaderBuilder setRecipKID(byte[] kid) { return setRecipKID(kid == null ? null : new DEROctetString(kid)); } public PKIHeaderBuilder setRecipKID(ASN1OctetString kid) { recipKID = kid; return this; } public PKIHeaderBuilder setTransactionID(byte[] tid) { return setTransactionID(tid == null ? null : new DEROctetString(tid)); } public PKIHeaderBuilder setTransactionID(ASN1OctetString tid) { transactionID = tid; return this; } public PKIHeaderBuilder setSenderNonce(byte[] nonce) { return setSenderNonce(nonce == null ? null : new DEROctetString(nonce)); } public PKIHeaderBuilder setSenderNonce(ASN1OctetString nonce) { senderNonce = nonce; return this; } public PKIHeaderBuilder setRecipNonce(byte[] nonce) { return setRecipNonce(nonce == null ? null : new DEROctetString(nonce)); } public PKIHeaderBuilder setRecipNonce(ASN1OctetString nonce) { recipNonce = nonce; return this; } public PKIHeaderBuilder setFreeText(PKIFreeText text) { freeText = text; return this; } public PKIHeaderBuilder setGeneralInfo(InfoTypeAndValue genInfo) { return setGeneralInfo(makeGeneralInfoSeq(genInfo)); } public PKIHeaderBuilder setGeneralInfo(InfoTypeAndValue[] genInfos) { return setGeneralInfo(makeGeneralInfoSeq(genInfos)); } public PKIHeaderBuilder setGeneralInfo(ASN1Sequence seqOfInfoTypeAndValue) { generalInfo = seqOfInfoTypeAndValue; return this; } private static ASN1Sequence makeGeneralInfoSeq( InfoTypeAndValue generalInfo) { return new DERSequence(generalInfo); } private static ASN1Sequence makeGeneralInfoSeq( InfoTypeAndValue[] generalInfos) { ASN1Sequence genInfoSeq = null; if (generalInfos != null) { genInfoSeq = new DERSequence(generalInfos); } return genInfoSeq; } /** * <pre> * PKIHeader ::= SEQUENCE { * pvno INTEGER { cmp1999(1), cmp2000(2) }, * sender GeneralName, * -- identifies the sender * recipient GeneralName, * -- identifies the intended recipient * messageTime [0] GeneralizedTime OPTIONAL, * -- time of production of this message (used when sender * -- believes that the transport will be "suitable"; i.e., * -- that the time will still be meaningful upon receipt) * protectionAlg [1] AlgorithmIdentifier OPTIONAL, * -- algorithm used for calculation of protection bits * senderKID [2] KeyIdentifier OPTIONAL, * recipKID [3] KeyIdentifier OPTIONAL, * -- to identify specific keys used for protection * transactionID [4] OCTET STRING OPTIONAL, * -- identifies the transaction; i.e., this will be the same in * -- corresponding request, response, certConf, and PKIConf * -- messages * senderNonce [5] OCTET STRING OPTIONAL, * recipNonce [6] OCTET STRING OPTIONAL, * -- nonces used to provide replay protection, senderNonce * -- is inserted by the creator of this message; recipNonce * -- is a nonce previously inserted in a related message by * -- the intended recipient of this message * freeText [7] PKIFreeText OPTIONAL, * -- this may be used to indicate context-specific instructions * -- (this field is intended for human consumption) * generalInfo [8] SEQUENCE SIZE (1..MAX) OF * InfoTypeAndValue OPTIONAL * -- this may be used to convey context-specific information * -- (this field not primarily intended for human consumption) * } * </pre> * @return a basic ASN.1 object representation. */ public PKIHeader build() { ASN1EncodableVector v = new ASN1EncodableVector(12); v.add(pvno); v.add(sender); v.add(recipient); addOptional(v, 0, messageTime); addOptional(v, 1, protectionAlg); addOptional(v, 2, senderKID); addOptional(v, 3, recipKID); addOptional(v, 4, transactionID); addOptional(v, 5, senderNonce); addOptional(v, 6, recipNonce); addOptional(v, 7, freeText); addOptional(v, 8, generalInfo); messageTime = null; protectionAlg = null; senderKID = null; recipKID = null; transactionID = null; senderNonce = null; recipNonce = null; freeText = null; generalInfo = null; return PKIHeader.getInstance(new DERSequence(v)); } private void addOptional(ASN1EncodableVector v, int tagNo, ASN1Encodable obj) { if (obj != null) { v.add(new DERTaggedObject(true, tagNo, obj)); } } }
[ "jason.mahdjoub@distri-mind.fr" ]
jason.mahdjoub@distri-mind.fr
4a021a93ecc54acfe5dae1606eb37f5d4431db1a
37fdc74bbf8220b4efa3a209a0398dde51f1d57b
/src/main/java/cn/com/rebirth/search/core/index/query/IdsQueryParser.java
4de9c850fe52c63ec1b5435a6005d70f9d186d73
[]
no_license
dowsam/rebirth-search-core
4c39e7f1b30c78e4dd97380b82af235c72161ee4
ab615cd8e74f318c20137c0f0dd7d740cd0a6bec
refs/heads/master
2016-09-09T18:35:33.145132
2012-09-05T05:58:55
2012-09-05T05:58:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,617
java
/* * Copyright (c) 2005-2012 www.china-cti.com All rights reserved * Info:rebirth-search-core IdsQueryParser.java 2012-7-6 14:29:49 l.xue.nong$$ */ package cn.com.rebirth.search.core.index.query; import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.Query; import cn.com.rebirth.commons.xcontent.XContentParser; import cn.com.rebirth.core.inject.Inject; import cn.com.rebirth.search.core.index.search.UidFilter; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; /** * The Class IdsQueryParser. * * @author l.xue.nong */ public class IdsQueryParser implements QueryParser { /** The Constant NAME. */ public static final String NAME = "ids"; /** * Instantiates a new ids query parser. */ @Inject public IdsQueryParser() { } /* (non-Javadoc) * @see cn.com.rebirth.search.core.index.query.QueryParser#names() */ @Override public String[] names() { return new String[] { NAME }; } /* (non-Javadoc) * @see cn.com.rebirth.search.core.index.query.QueryParser#parse(cn.com.rebirth.search.core.index.query.QueryParseContext) */ @Override public Query parse(QueryParseContext parseContext) throws IOException, QueryParsingException { XContentParser parser = parseContext.parser(); List<String> ids = new ArrayList<String>(); Collection<String> types = null; String currentFieldName = null; float boost = 1.0f; XContentParser.Token token; while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { currentFieldName = parser.currentName(); } else if (token == XContentParser.Token.START_ARRAY) { if ("values".equals(currentFieldName)) { while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { String value = parser.textOrNull(); if (value == null) { throw new QueryParsingException(parseContext.index(), "No value specified for term filter"); } ids.add(value); } } else if ("types".equals(currentFieldName) || "type".equals(currentFieldName)) { types = new ArrayList<String>(); while ((token = parser.nextToken()) != XContentParser.Token.END_ARRAY) { String value = parser.textOrNull(); if (value == null) { throw new QueryParsingException(parseContext.index(), "No type specified for term filter"); } types.add(value); } } else { throw new QueryParsingException(parseContext.index(), "[ids] query does not support [" + currentFieldName + "]"); } } else if (token.isValue()) { if ("type".equals(currentFieldName) || "_type".equals(currentFieldName)) { types = ImmutableList.of(parser.text()); } else if ("boost".equals(currentFieldName)) { boost = parser.floatValue(); } else { throw new QueryParsingException(parseContext.index(), "[ids] query does not support [" + currentFieldName + "]"); } } } if (ids.size() == 0) { throw new QueryParsingException(parseContext.index(), "[ids] query, no ids values provided"); } if (types == null || types.isEmpty()) { types = parseContext.queryTypes(); } else if (types.size() == 1 && Iterables.getFirst(types, null).equals("_all")) { types = parseContext.mapperService().types(); } UidFilter filter = new UidFilter(types, ids, parseContext.indexCache().bloomCache()); ConstantScoreQuery query = new ConstantScoreQuery(filter); query.setBoost(boost); return query; } }
[ "l.xue.nong@gmail.com" ]
l.xue.nong@gmail.com
a01346c752189e937ab4005f98406cf9be385568
ad9d57a23e4029428b511c34ee505338fe9ebee4
/src/main/java/org/spongepowered/asm/mixin/injection/ModifyVariable.java
cd7e44e44f5ded35d25255d8af942265400cee8e
[]
no_license
yunusborazan/Notorious-0.6
550435b5f4dfd3c4b8e79b0c7dd7c0e7c4a35c0c
8cc051b75986cae29fe540c2b021a34102df8842
refs/heads/main
2023-07-29T05:01:50.544957
2021-09-08T21:11:21
2021-09-08T21:11:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
919
java
package org.spongepowered.asm.mixin.injection; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Slice; @Target(value={ElementType.METHOD}) @Retention(value=RetentionPolicy.RUNTIME) public @interface ModifyVariable { public String[] method(); public Slice slice() default @Slice; public At at(); public boolean print() default false; public int ordinal() default -1; public int index() default -1; public String[] name() default {}; public boolean argsOnly() default false; public boolean remap() default true; public int require() default -1; public int expect() default 1; public int allow() default -1; public String constraints() default ""; }
[ "jhonsberger12@gmail.com" ]
jhonsberger12@gmail.com
1861366c5e317488fec1a54a0f6178b5d3850bd8
07395e5505c3018578bc05de5bd9db1cc1f965c7
/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/indicator/GetIndicatorListAction.java
303131a1fdb710ad5f5a76f9d55840ffa815b331
[ "BSD-3-Clause" ]
permissive
darken1/dhis2darken
ae26aec266410eda426254a595eed597a2312f50
849ee5385505339c1d075f568a4a41d4293162f7
refs/heads/master
2020-12-25T01:27:16.872079
2014-06-26T20:11:08
2014-06-26T20:11:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,632
java
package org.hisp.dhis.dd.action.indicator; /* * Copyright (c) 2004-2014, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * Neither the name of the HISP project nor the names of its contributors may * be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ import static org.apache.commons.lang.StringUtils.isNotBlank; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator; import org.hisp.dhis.datadictionary.DataDictionary; import org.hisp.dhis.indicator.Indicator; import org.hisp.dhis.indicator.IndicatorService; import org.hisp.dhis.paging.ActionPagingSupport; /** * @author Torgeir Lorange Ostby */ public class GetIndicatorListAction extends ActionPagingSupport<Indicator> { // ------------------------------------------------------------------------- // Dependencies // ------------------------------------------------------------------------- private IndicatorService indicatorService; public void setIndicatorService( IndicatorService indicatorService ) { this.indicatorService = indicatorService; } // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- private List<Indicator> indicators; public List<Indicator> getIndicators() { return indicators; } private List<DataDictionary> dataDictionaries; public List<DataDictionary> getDataDictionaries() { return dataDictionaries; } // ------------------------------------------------------------------------- // Input & Output // ------------------------------------------------------------------------- private Integer dataDictionaryId; public Integer getDataDictionaryId() { return dataDictionaryId; } public void setDataDictionaryId( Integer dataDictionaryId ) { this.dataDictionaryId = dataDictionaryId; } private String key; public String getKey() { return key; } public void setKey( String key ) { this.key = key; } // ------------------------------------------------------------------------- // Action implemantation // ------------------------------------------------------------------------- public String execute() { if ( isNotBlank( key ) ) // Filter on key only if set { this.paging = createPaging( indicatorService.getIndicatorCountByName( key ) ); indicators = new ArrayList<Indicator>( indicatorService.getIndicatorsBetweenByName( key, paging.getStartPos(), paging.getPageSize() ) ); } else { this.paging = createPaging( indicatorService.getIndicatorCount() ); indicators = new ArrayList<Indicator>( indicatorService.getIndicatorsBetween( paging.getStartPos(), paging.getPageSize() ) ); } Collections.sort( indicators, new IdentifiableObjectNameComparator() ); return SUCCESS; } }
[ "sunbiz@gmail.com" ]
sunbiz@gmail.com
ecb5f141563822fde5e9cf6673fa49b678c408e5
c90aa81006d69e0f5f74804654a5f3a2204dffc3
/Attendance/src/cn/bdqn/dao/impl/UserDaoImpl.java
0742d529e375fe460342123c19b68c97f1540769
[]
no_license
ili-z/Att
65979529fa274311531a55357ef90b3188b61d8f
7ecc17b5a381f61026bb7f84561088445dbf041e
refs/heads/master
2023-04-18T15:14:06.291531
2021-04-30T03:50:13
2021-04-30T03:50:13
362,663,219
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,504
java
package cn.bdqn.dao.impl; import java.sql.Connection; import java.sql.ResultSet; import java.util.List; import org.apache.log4j.Logger; import cn.bdqn.dao.BaseDao; import cn.bdqn.dao.UserDao; import cn.bdqn.entity.User; import cn.bdqn.util.DataBaseUtil; public class UserDaoImpl extends BaseDao implements UserDao{ public UserDaoImpl(Connection conn) { super(conn); // TODO Auto-generated constructor stub } public static Logger logger = Logger.getLogger(BaseDao.class.getName()); ResultSet set = null; // 怬 id name sex roleid address classid pwd userCode phone email @Override public User Login(String name,String pwd) { String sql = "select id from `user` where userCode = ? and pwd = ?"; Object[] pstms = {name,pwd}; User user = null; int num = 0; try { set = super.excuteQuery(sql, pstms); if(set != null) { while (set.next()) { user = new User(); user.setId(set.getInt("id")); user.setName(set.getString("name")); user.setSex(set.getInt("sex")); user.setRoleid(set.getInt("roleid")); user.setAddress(set.getString("address")); user.setClassid(set.getInt("classid")); user.setPwd(set.getString("pwd")); user.setUserCode(set.getString("userCode")); user.setPhone(set.getString("phone")); user.setEmail(set.getString("email")); } } } catch (Exception e) { logger.error(e.getMessage()); } finally { DataBaseUtil.closeAll(set, null, null); } return user; } }
[ "goodMorning_pro@at.bdqn.com" ]
goodMorning_pro@at.bdqn.com
8f3382d2bd1af67d6cefa340e51486334efdc17c
a744882fb7cf18944bd6719408e5a9f2f0d6c0dd
/sourcecode7/src/java/security/PublicKey.java
eead81e07fe237705248e6b652953d55cfd4a418
[ "Apache-2.0" ]
permissive
hanekawasann/learn
a39b8d17fd50fa8438baaa5b41fdbe8bd299ab33
eef678f1b8e14b7aab966e79a8b5a777cfc7ab14
refs/heads/master
2022-09-13T02:18:07.127489
2020-04-26T07:58:35
2020-04-26T07:58:35
176,686,231
0
0
Apache-2.0
2022-09-01T23:21:38
2019-03-20T08:16:05
Java
UTF-8
Java
false
false
2,046
java
/* * Copyright (c) 1996, 2001, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.security; /** * <p>A public key. This interface contains no methods or constants. * It merely serves to group (and provide type safety for) all public key * interfaces. * <p> * Note: The specialized public key interfaces extend this interface. * See, for example, the DSAPublicKey interface in * <code>java.security.interfaces</code>. * * @see Key * @see PrivateKey * @see Certificate * @see Signature#initVerify * @see java.security.interfaces.DSAPublicKey * @see java.security.interfaces.RSAPublicKey */ public interface PublicKey extends Key { // Declare serialVersionUID to be compatible with JDK1.1 /** * The class fingerprint that is set to indicate serialization * compatibility with a previous version of the class. */ long serialVersionUID = 7187392471159151072L; }
[ "763803382@qq.com" ]
763803382@qq.com
e08edcbc8283e4dd1b7ca40a69f092b2451fb444
0ea271177f5c42920ac53cd7f01f053dba5c14e4
/5.4.2/sources/com/google/android/gms/wearable/internal/zzey.java
45d9febcc92d7a506648ff4626b02c24e7bb1af0
[]
no_license
alireza-ebrahimi/telegram-talaeii
367a81a77f9bc447e729b2ca339f9512a4c2860e
68a67e6f104ab8a0888e63c605e8bbad12c4a20e
refs/heads/master
2020-03-21T13:44:29.008002
2018-12-09T10:30:29
2018-12-09T10:30:29
138,622,926
12
1
null
null
null
null
UTF-8
Java
false
false
523
java
package com.google.android.gms.wearable.internal; import com.google.android.gms.common.api.Status; import com.google.android.gms.wearable.MessageApi.SendMessageResult; public final class zzey implements SendMessageResult { private final int zzeh; private final Status zzp; public zzey(Status status, int i) { this.zzp = status; this.zzeh = i; } public final int getRequestId() { return this.zzeh; } public final Status getStatus() { return this.zzp; } }
[ "alireza.ebrahimi2006@gmail.com" ]
alireza.ebrahimi2006@gmail.com
2e744fc9d519cfbdce4814accbed13f34ab1c10b
13c68c3dc922acfb8171ab7418451156ab8ea0c5
/app/build/generated/source/apt/debug/com/yuntongxun/ecdemo/ui/phonemodel/ModifyPwdUI_ViewBinding.java
03c49b474c87a3a3bfffea610d9e2d69c549702b
[]
no_license
sceneren/yuntx_sdk_new_ui
d94ca530759c7682b20a72c7e612ec9a6cdb70ea
9e6ffcd03ab022e0bc680d5e95057886a3a79b6c
refs/heads/master
2020-06-10T08:19:13.122557
2019-06-25T02:46:02
2019-06-25T02:46:02
193,621,948
0
1
null
null
null
null
UTF-8
Java
false
false
968
java
// Generated code from Butter Knife. Do not modify! package com.yuntongxun.ecdemo.ui.phonemodel; import android.support.annotation.CallSuper; import android.support.annotation.UiThread; import android.view.View; import butterknife.Unbinder; import butterknife.internal.Utils; import com.yuntongxun.ecdemo.R; import com.yuntongxun.ecdemo.common.view.TitleBar; import java.lang.IllegalStateException; import java.lang.Override; public class ModifyPwdUI_ViewBinding<T extends ModifyPwdUI> implements Unbinder { protected T target; @UiThread public ModifyPwdUI_ViewBinding(T target, View source) { this.target = target; target.titleBar = Utils.findRequiredViewAsType(source, R.id.ll_top, "field 'titleBar'", TitleBar.class); } @Override @CallSuper public void unbind() { T target = this.target; if (target == null) throw new IllegalStateException("Bindings already cleared."); target.titleBar = null; this.target = null; } }
[ "renjunjia1@163.com" ]
renjunjia1@163.com
5602b050994b461a5ec6186db6691fce5caac864
9fc6f1d415c8cb341e848863af535dae5b22a48b
/Eclipse_Workspace_Hibernate/factory_pattern/src/org/factory_pattern/SmallCar.java
00f5ffb25342336b3b892aa3beb2c7f7cc1a93b6
[]
no_license
MahanteshAmbali/eclipse_workspaces
f7a063f7dd8c247d610f78f0105f9f632348b187
1f6d3a7eb0264b500877a718011bf6b842161fa1
refs/heads/master
2020-04-17T04:50:33.167337
2019-01-17T15:53:13
2019-01-17T15:53:13
166,226,211
0
0
null
null
null
null
UTF-8
Java
false
false
284
java
package org.factory_pattern; public class SmallCar extends Car{ public SmallCar() { // TODO Auto-generated constructor stub super(CarType.SMALL); } @Override public void constructCar() { // TODO Auto-generated method stub System.out.println("Building SmallCar"); } }
[ "mahantesh378@gmail.com" ]
mahantesh378@gmail.com
55cea2cfe6f06c1a1f1c1ebe57981b6b1a3a9195
6baba3628c802eb60f3029685a6c1f56f8bf7266
/src/main/java/ua/com/alevel/network/persistence/listener/AgeByBirthDayGenerationListener.java
7333ec2f23e9c30985edd95e3aa5acca33cfa242
[]
no_license
Iegor-Funtusov/network
733b4ac4dbd8d71f07defc28aa08e10a115bdabd
894ad4ca305801c965c03079b7db2383cc50f4a3
refs/heads/master
2023-02-02T21:39:18.369252
2020-12-25T19:20:50
2020-12-25T19:20:50
324,420,125
0
0
null
null
null
null
UTF-8
Java
false
false
747
java
package ua.com.alevel.network.persistence.listener; import org.joda.time.LocalDate; import org.joda.time.Years; import ua.com.alevel.network.persistence.entity.user.Personal; import javax.persistence.PostLoad; import javax.persistence.PostPersist; import javax.persistence.PostUpdate; /** * @author Iehor Funtusov, created 24/12/2020 - 9:40 AM */ public class AgeByBirthDayGenerationListener { @PostLoad @PostPersist @PostUpdate public void generateAgeByBirthDay(Personal user) { if (user.getBirthDay() == null) { user.setAge(null); return; } Years years = Years.yearsBetween(new LocalDate(user.getBirthDay()), new LocalDate()); user.setAge(years.getYears()); } }
[ "funtushan@gmail.com" ]
funtushan@gmail.com
8e493d55d44c905e917a9ad6d46c1190a15aa23f
9725f230d1330703a963fba3ba6f369a10887526
/aliyun-java-sdk-drds/src/main/java/com/aliyuncs/drds/model/v20190123/RollbackHiStoreInstanceResponse.java
7dd46ab0c3f769a991abf1873a92b95a01b453c6
[ "Apache-2.0" ]
permissive
czy95czy/aliyun-openapi-java-sdk
21e74b8f23cced2f65fb3a1f34648c7bf01e3c48
5410bde6a54fe40a471b43e50696f991f5df25aa
refs/heads/master
2020-07-13T02:18:08.645626
2019-08-29T03:16:37
2019-08-29T03:16:37
204,966,560
0
0
NOASSERTION
2019-08-28T23:38:50
2019-08-28T15:38:50
null
UTF-8
Java
false
false
1,501
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. */ package com.aliyuncs.drds.model.v20190123; import com.aliyuncs.AcsResponse; import com.aliyuncs.drds.transform.v20190123.RollbackHiStoreInstanceResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class RollbackHiStoreInstanceResponse extends AcsResponse { private String requestId; private String data; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public String getData() { return this.data; } public void setData(String data) { this.data = data; } @Override public RollbackHiStoreInstanceResponse getInstance(UnmarshallerContext context) { return RollbackHiStoreInstanceResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
f0d4a507e56ec8ec98ad86e1e73181d5a60f8161
9aaae7e1457eca72335aebf30a5a68adf517031b
/demo-design/src/main/java/club/tulane/design/singleton/IdGeneratorForLazy.java
70bca0e9423e95c36e98c26645e88d6e786787f3
[]
no_license
Tureen/demo-list
d1a018f648a32d85e73a46975fbb80e3959c2bb4
7b5e7c0835c876d83999c9946645ca574e92e97d
refs/heads/master
2022-06-29T19:49:11.934281
2020-03-26T01:14:23
2020-03-26T01:14:23
229,507,973
0
0
null
2022-06-17T03:02:28
2019-12-22T02:23:18
Java
UTF-8
Java
false
false
559
java
package club.tulane.design.singleton; import java.util.concurrent.atomic.AtomicLong; /** * 多线程安全单例 * 懒汉 */ public class IdGeneratorForLazy { private AtomicLong id = new AtomicLong(0); private static IdGeneratorForLazy instance; private IdGeneratorForLazy() { } public static synchronized IdGeneratorForLazy getInstance(){ if(instance == null){ instance = new IdGeneratorForLazy(); } return instance; } public long getId(){ return id.incrementAndGet(); } }
[ "469568595@qq.com" ]
469568595@qq.com
a37536a08a4c20b716660f8daed686039382ea19
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE15_External_Control_of_System_or_Configuration_Setting/CWE15_External_Control_of_System_or_Configuration_Setting__PropertiesFile_66b.java
383e116405f9acd7993a87090fe93bb1fc958a1d
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
3,029
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE15_External_Control_of_System_or_Configuration_Setting__PropertiesFile_66b.java Label Definition File: CWE15_External_Control_of_System_or_Configuration_Setting.label.xml Template File: sources-sink-66b.tmpl.java */ /* * @description * CWE: 15 External Control of System or Configuration Setting * BadSource: PropertiesFile Read data from a .properties file (in property named data) * GoodSource: A hardcoded string * Sinks: * BadSink : Set the catalog name with the value of data * Flow Variant: 66 Data flow: data passed in an array from one method to another in different source files in the same package * * */ package testcases.CWE15_External_Control_of_System_or_Configuration_Setting; import testcasesupport.*; import javax.servlet.http.*; import java.sql.*; import java.util.logging.Level; public class CWE15_External_Control_of_System_or_Configuration_Setting__PropertiesFile_66b { public void badSink(String dataArray[] ) throws Throwable { String data = dataArray[2]; Connection dbConnection = null; try { dbConnection = IO.getDBConnection(); /* POTENTIAL FLAW: Set the catalog name with the value of data * allowing a nonexistent catalog name or unauthorized access to a portion of the DB */ dbConnection.setCatalog(data); } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(String dataArray[] ) throws Throwable { String data = dataArray[2]; Connection dbConnection = null; try { dbConnection = IO.getDBConnection(); /* POTENTIAL FLAW: Set the catalog name with the value of data * allowing a nonexistent catalog name or unauthorized access to a portion of the DB */ dbConnection.setCatalog(data); } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
356d37bd8bff159f3497528d2bd8d18df90aff5f
3557f5c68156ad04ee7a5c51ba7948eea64a7ee7
/TVApp/src/main/java/org/suirui/huijian/tv/widget/WarningDialog.java
915a37a23fb8c0585c9a5764a95c1dfe1bc96d35
[]
no_license
joy-cui/VideoMeetingProject
98dcc900da92173b64362013a5b44bbe49254c46
2672951d38f81b04960cc782417d55fb2907fcdf
refs/heads/master
2020-03-25T01:27:21.996554
2018-08-02T04:12:35
2018-08-02T04:12:35
143,238,886
1
0
null
null
null
null
UTF-8
Java
false
false
1,343
java
package org.suirui.huijian.tv.widget; import org.suirui.huijian.tv.R; import android.content.Context; import android.view.View; import android.widget.TextView; public class WarningDialog extends ConfirmCommonDialog { private Context mContext; public WarningDialog(Context context) { super(context, ConfirmCommonDialog.TYPE_WARNING_TIPS); mContext = context; init(); } public WarningDialog(Context context, int theme) { super(context, theme, ConfirmCommonDialog.TYPE_WARNING_TIPS); mContext = context; init(); } private void init() { findViews(); } private void findViews() { setContentView(R.layout.m_confirm_layout); setButton1Visible(false); setButton2Focused(); setButton2(new View.OnClickListener() { @Override public void onClick(View v) { dismissDialog(); } }); } private void dismissDialog() { dismiss(); } public void setWarningMsg(int msgId) { TextView tipView = (TextView) findViewById(R.id.content); tipView.setText(mContext.getString(msgId)); } public void setWarningMsg(String msg) { TextView tipView = (TextView) findViewById(R.id.content); tipView.setText(msg); } }
[ "cui.li@suirui.com" ]
cui.li@suirui.com
ed47bd7558f224574f59bfb39ee2b727c1d731d0
fa93c9be2923e697fb8a2066f8fb65c7718cdec7
/sources/com/avito/android/search/subscriptions/sync/SearchSubscriptionSyncRunner.java
a5e7dd02b4bb9c033a5a5b94ca79c6679ae633f1
[]
no_license
Auch-Auch/avito_source
b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b
76fdcc5b7e036c57ecc193e790b0582481768cdc
refs/heads/master
2023-05-06T01:32:43.014668
2021-05-25T10:19:22
2021-05-25T10:19:22
370,650,685
0
0
null
null
null
null
UTF-8
Java
false
false
953
java
package com.avito.android.search.subscriptions.sync; import android.content.Context; import kotlin.Metadata; import org.jetbrains.annotations.NotNull; @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0004\bf\u0018\u00002\u00020\u0001J\u0017\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H&¢\u0006\u0004\b\u0005\u0010\u0006J\u0017\u0010\u0007\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H&¢\u0006\u0004\b\u0007\u0010\u0006¨\u0006\b"}, d2 = {"Lcom/avito/android/search/subscriptions/sync/SearchSubscriptionSyncRunner;", "", "Landroid/content/Context;", "context", "", "requestUpdate", "(Landroid/content/Context;)V", "startUpdate", "core_release"}, k = 1, mv = {1, 4, 2}) public interface SearchSubscriptionSyncRunner { void requestUpdate(@NotNull Context context); void startUpdate(@NotNull Context context); }
[ "auchhunter@gmail.com" ]
auchhunter@gmail.com
a8086a1d85408e618b0c5ef69457e3c532d7863a
d664922140376541680caeff79873f21f64eb5aa
/branches/results-pus/GAP/src/net/sf/gap/constants/EntityTypes.java
abb4602d0cfb92713f2cdcef800abc9343f37f7a
[]
no_license
gnovelli/gap
7d4b6e2eb7e1c0e62e86d26147c5de9c558d62f7
fd1cac76504d10eb96294a768833a9bdb102e66f
refs/heads/master
2021-01-10T20:11:00.977571
2012-02-23T20:19:44
2012-02-23T20:19:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,284
java
/* **************************************************************************************** * Copyright © Giovanni Novelli * All Rights Reserved. **************************************************************************************** * * Title: GAP Simulator * Description: GAP (Grid Agents Platform) Toolkit for Modeling and Simulation * of Mobile Agents on Grids * License: GPL - http://www.gnu.org/copyleft/gpl.html * * EntityTypes.java * * Created on 19 August 2006, 12.00 by Giovanni Novelli * **************************************************************************************** * * $Revision: 275 $ * $Id: EntityTypes.java 275 2008-01-27 10:39:07Z gnovelli $ * $HeadURL: https://gap.svn.sourceforge.net/svnroot/gap/branches/results-pus/GAP/src/net/sf/gap/constants/EntityTypes.java $ * ***************************************************************************************** */ package net.sf.gap.constants; /** * * @author Giovanni Novelli */ public abstract class EntityTypes { private static EntityTypes instance = null; /** * Creates a new instance of EntityTypes */ public EntityTypes() { } public static final int ENTITYBASE = 200; /* * @TODO Somewhere in the code NOBODY tag is used as value 0, fix it * */ public static final int NOBODY = 0; public static final int AGENT_ZOMBIE = 1 + ENTITYBASE; public static final int USER = 2 + ENTITYBASE; public static final String toString(int entityType) { if (getInstance() != null) { return getInstance().intToString(entityType); } else { return "EntityTypes instance wasn't initilialised"; } } protected String intToString(int entityType) { switch (entityType) { case EntityTypes.NOBODY: return "NOBODY"; case EntityTypes.AGENT_ZOMBIE: return "AGENT_ZOMBIE"; case EntityTypes.USER: return "USER"; default: return getInstance().otherTypes(entityType); } } protected abstract String otherTypes(int entityType); public static final EntityTypes getInstance() { return instance; } public static final void setInstance(EntityTypes instance) { EntityTypes.instance = instance; } }
[ "giovanni.novelli@gmail.com" ]
giovanni.novelli@gmail.com
12bcee73f4120b220106407b9f057d34603ce183
300f9a5476d80533b4cec1081a621d156cb934b2
/mmm-util/mmm-util-core/src/main/java/net/sf/mmm/util/lang/api/EnumType.java
08461c7673c5235ce29cc4a3821ab9acf9870ca2
[ "Apache-2.0" ]
permissive
cbonami/mmm
931157236175aa749280e71851fda1d8f5a4c5dc
cd69e59a9696ff44e87678ab1cc879d20d7188f7
refs/heads/master
2021-01-20T17:12:37.355366
2014-01-29T22:27:15
2014-01-29T22:27:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,629
java
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 * http://www.apache.org/licenses/LICENSE-2.0 */ package net.sf.mmm.util.lang.api; /** * This is the interface for a particular <em>enumeration</em>. An enumeration has a finite set of * characteristics. This can be a java {@link Enum} but also something more complex such as a dynamic * enumeration that is configured via a database. For this reason it is called {@link EnumType} rather than * <code>EnumDatatype</code>. However, for convenience and simplicity it extends {@link Datatype}. For being * less invasive, also standard java {@link Enum}s are supported by {@link EnumDefinition}. Therefore it is * recommended but NOT technically required to implement this interface for your custom {@link Enum}s that * shall be supported by {@link EnumProvider}. If you have an {@link Enum} with a * {@link EnumTypeWithCategory#getCategory() category} you will need to implement {@link EnumTypeWithCategory} * for according support.<br/> * <b>NOTE:</b><br/> * It is strongly recommended to use a {@link Datatype} or at least a transfer-object to represent the * enumeration instances. Using an {@link javax.persistence.Entity} as {@link EnumType} should be avoided. * * @param <V> is the generic type of the {@link #getValue() value}. This may be a simple datatype such as * {@link String} or {@link Long} or this type itself implementing {@link EnumType}. * * @author Joerg Hohwiller (hohwille at users.sourceforge.net) * @since 3.0.0 */ public interface EnumType<V> extends SimpleDatatype<V> { // nothing to add... }
[ "joerg@j-hohwiller.de" ]
joerg@j-hohwiller.de
acabfb370a2b2c0cbf160dd3aaa65e5987be4836
a52b1d91a5a2984591df9b2f03b1014c263ee8ab
/net/minecraft/world/storage/IThreadedFileIO.java
e2b50fc281a3c70659d1b2e1a7f7f386ad7a46c6
[]
no_license
MelonsYum/leap-client
5c200d0b39e0ca1f2071f9264f913f9e6977d4b4
c6611d4b9600311e1eb10f87a949419e34749373
refs/heads/main
2023-08-04T17:40:13.797831
2021-09-17T00:18:38
2021-09-17T00:18:38
411,085,054
3
3
null
2021-09-28T00:33:06
2021-09-28T00:33:05
null
UTF-8
Java
false
false
290
java
package net.minecraft.world.storage; public interface IThreadedFileIO { boolean writeNextIO(); } /* Location: C:\Users\wyatt\Downloads\Leap-Client.jar!\net\minecraft\world\storage\IThreadedFileIO.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "90357372+danny-125@users.noreply.github.com" ]
90357372+danny-125@users.noreply.github.com
bbf5ff7473c90679a0aa7b1eaa51db4d913cc6e8
e0a46a25bdfe332cd162e80b9a256e4e930b8f8e
/hsweb-system/hsweb-system-dynamic-form/hsweb-system-dynamic-form-local/src/main/java/org/hswebframework/web/service/form/simple/validator/jsr303/RangeStrategy.java
87d2ff4f2d200b05e428f7a92b454727cc024162
[ "Apache-2.0" ]
permissive
saminfante/hsweb-framework
baa93ec7d5eec78f3f224adba8820e190e38c641
9075e75bdc8b3e6215dce27de3dc0cbf37deec8c
refs/heads/master
2023-04-06T09:26:59.788489
2019-11-06T02:40:12
2019-11-06T02:40:12
182,584,976
1
0
Apache-2.0
2023-04-04T00:57:36
2019-04-21T21:39:23
Java
UTF-8
Java
false
false
642
java
package org.hswebframework.web.service.form.simple.validator.jsr303; import lombok.extern.slf4j.Slf4j; import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Range; import org.springframework.stereotype.Component; /** * @author zhouhao * @since 3.0.0-RC */ @Component @Slf4j public class RangeStrategy extends AbstractStrategy { public RangeStrategy() { addPropertyMapping(PropertyMapping.of("min", int.class)); addPropertyMapping(PropertyMapping.of("max", int.class)); } @Override protected Class<Range> getAnnotationType() { return Range.class; } }
[ "zh.sqy@qq.com" ]
zh.sqy@qq.com
2defe6ea083a64977ba895ac4a95702a62d23227
a8c5b7b04eace88b19b5a41a45f1fb030df393e3
/examples/examples-simulated/src/main/java/com/opengamma/examples/simulated/volatility/surface/ExampleCallPutVolatilitySurfaceInstrumentProvider.java
b3d163a49d8d26ddca5875c1d9252423a87c3d26
[ "Apache-2.0" ]
permissive
McLeodMoores/starling
3f6cfe89cacfd4332bad4861f6c5d4648046519c
7ae0689e06704f78fd9497f8ddb57ee82974a9c8
refs/heads/master
2022-12-04T14:02:00.480211
2020-04-28T17:22:44
2020-04-28T17:22:44
46,577,620
4
4
Apache-2.0
2022-11-24T07:26:39
2015-11-20T17:48:10
Java
UTF-8
Java
false
false
6,875
java
/** * Copyright (C) 2014 - Present McLeod Moores Software Limited. All rights reserved. */ package com.opengamma.examples.simulated.volatility.surface; import java.util.HashMap; import java.util.Objects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.threeten.bp.DayOfWeek; import org.threeten.bp.LocalDate; import org.threeten.bp.format.DateTimeFormatter; import com.opengamma.OpenGammaRuntimeException; import com.opengamma.analytics.financial.schedule.NoHolidayCalendar; import com.opengamma.core.id.ExternalSchemes; import com.opengamma.financial.analytics.ircurve.NextExpiryAdjuster; import com.opengamma.financial.analytics.model.FutureOptionExpiries; import com.opengamma.financial.analytics.volatility.surface.CallPutSurfaceInstrumentProvider; import com.opengamma.financial.convention.calendar.Calendar; import com.opengamma.financial.convention.expirycalc.ExchangeTradedInstrumentExpiryCalculator; import com.opengamma.id.ExternalId; import com.opengamma.util.ArgumentChecker; /** * Generates tickers for a volatility surface relevant for a particular calculation date. The tickers are time-dependent and use the nth option expiry (e.g. the * second monthly option expiry from 1/1/2014, which would be 21/2/2014 if the third Friday rule was in effect). The surface uses both puts and calls, and there * is a value set for the strike at which to switch between put and call quotes. * <p> * This instrument provider is intended to be used with OpenGamma integration functions. */ public class ExampleCallPutVolatilitySurfaceInstrumentProvider implements CallPutSurfaceInstrumentProvider<Number, Double> { /** The logger */ private static final Logger LOGGER = LoggerFactory.getLogger(ExampleCallPutVolatilitySurfaceInstrumentProvider.class); /** The date-time formatter */ private static final DateTimeFormatter FORMAT = DateTimeFormatter.ofPattern("MM/dd/yy"); /** The expiry rules */ private static final HashMap<String, ExchangeTradedInstrumentExpiryCalculator> EXPIRY_RULES; /** An empty holiday calendar */ private static final Calendar NO_HOLIDAYS = new NoHolidayCalendar(); static { EXPIRY_RULES = new HashMap<>(); EXPIRY_RULES.put("AAPL", FutureOptionExpiries.of(new NextExpiryAdjuster(3, DayOfWeek.FRIDAY, 1))); EXPIRY_RULES.put("DEFAULT", FutureOptionExpiries.of(new NextExpiryAdjuster(3, DayOfWeek.FRIDAY, 1))); } /** The ticker prefix */ private final String _optionPrefix; /** The data field name */ private final String _dataFieldName; /** The value above which to use calls */ private final Double _useCallAboveStrike; /** * @param optionPrefix * the prefix to the resulting code (e.g. DJX), not null * @param dataFieldName * the name of the data field, not null. * @param useCallAboveStrike * the strike above which to use calls rather than puts, not null */ public ExampleCallPutVolatilitySurfaceInstrumentProvider(final String optionPrefix, final String dataFieldName, final Double useCallAboveStrike) { ArgumentChecker.notNull(optionPrefix, "option prefix"); ArgumentChecker.notNull(dataFieldName, "data field name"); ArgumentChecker.notNull(useCallAboveStrike, "use call above this strike"); _optionPrefix = optionPrefix; _dataFieldName = dataFieldName; _useCallAboveStrike = useCallAboveStrike; } /** * Provides an ExternalID for an {@link ExternalSchemes#OG_SYNTHETIC_TICKER}, given a reference date and an integer offset, the n'th subsequent option * <p> * The format is prefix + date(MM/dd/yy) + callPutFlag + strike * <p> * e.g. AAA 12/21/13 C100. * <p> * * @param expiryNumber * nth expiry following curve date, not null * @param strike * option's strike, expressed as price, e.g. 98.750, not null * @param surfaceDate * date of curve validity; valuation date, not null * @return the id of the Bloomberg ticker */ @Override public ExternalId getInstrument(final Number expiryNumber, final Double strike, final LocalDate surfaceDate) { ArgumentChecker.notNull(expiryNumber, "expiryNumber"); ArgumentChecker.notNull(strike, "strike"); ArgumentChecker.notNull(surfaceDate, "surfaceDate"); final StringBuffer ticker = new StringBuffer(_optionPrefix); ticker.append(" "); final ExchangeTradedInstrumentExpiryCalculator expiryRule = getExpiryRuleCalculator(); final LocalDate expiry = expiryRule.getExpiryDate(expiryNumber.intValue(), surfaceDate, NO_HOLIDAYS); ticker.append(FORMAT.format(expiry)); ticker.append(" "); ticker.append(strike > useCallAboveStrike() ? "C" : "P"); ticker.append(strike); return ExternalId.of(ExternalSchemes.OG_SYNTHETIC_TICKER, ticker.toString()); } @Override public ExternalId getInstrument(final Number xAxis, final Double yAxis) { throw new OpenGammaRuntimeException("Need a surface date to create an option surface"); } /** * Gets the expiryRules. * * @return the expiryRules */ public static HashMap<String, ExchangeTradedInstrumentExpiryCalculator> getExpiryRules() { return EXPIRY_RULES; } @Override public ExchangeTradedInstrumentExpiryCalculator getExpiryRuleCalculator() { final String prefix = _optionPrefix; ExchangeTradedInstrumentExpiryCalculator expiryRule = EXPIRY_RULES.get(prefix); if (expiryRule == null) { LOGGER.info("No expiry rule has been setup for " + prefix + ". Using Default of 3rd Friday."); expiryRule = EXPIRY_RULES.get("DEFAULT"); } return expiryRule; } /** * Gets the option prefix. * * @return The option prefix */ public String getOptionPrefix() { return _optionPrefix; } @Override public String getDataFieldName() { return _dataFieldName; } @Override public Double useCallAboveStrike() { return _useCallAboveStrike; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + _dataFieldName.hashCode(); result = prime * result + _optionPrefix.hashCode(); result = prime * result + _useCallAboveStrike.hashCode(); return result; } @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (!(obj instanceof ExampleCallPutVolatilitySurfaceInstrumentProvider)) { return false; } final ExampleCallPutVolatilitySurfaceInstrumentProvider other = (ExampleCallPutVolatilitySurfaceInstrumentProvider) obj; if (Double.compare(_useCallAboveStrike.doubleValue(), other._useCallAboveStrike.doubleValue()) != 0) { return false; } if (!Objects.equals(_optionPrefix, other._optionPrefix)) { return false; } if (!Objects.equals(_dataFieldName, other._dataFieldName)) { return false; } return true; } }
[ "em.mcleod@gmail.com" ]
em.mcleod@gmail.com
a6d0d29fcae9ace2962e08e58fa04928d74af66c
8c49003ae8e7b5662a9ee3c79abdb908463bef41
/service-user/src/main/java/com/java110/user/dao/impl/RentingPoolAttrServiceDaoImpl.java
e329f57f63871c6f144817356011e64c5315c258
[ "Apache-2.0" ]
permissive
java110/MicroCommunity
1cae5db3f185207fdabe670eedf89cdc5c413676
fbcdd1974f247b020114d3c9b3f649f9e48d3182
refs/heads/master
2023-08-05T13:44:19.646780
2023-01-09T10:09:54
2023-01-09T10:09:54
129,351,237
820
381
Apache-2.0
2023-02-22T07:05:27
2018-04-13T05:15:52
Java
UTF-8
Java
false
false
3,297
java
package com.java110.user.dao.impl; import com.alibaba.fastjson.JSONObject; import com.java110.utils.constant.ResponseConstant; import com.java110.utils.exception.DAOException; import com.java110.utils.util.DateUtil; import com.java110.core.base.dao.BaseServiceDao; import com.java110.user.dao.IRentingPoolAttrServiceDao; import org.slf4j.Logger; import com.java110.core.log.LoggerFactory; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.List; import java.util.Map; /** * 出租房屋属性服务 与数据库交互 * Created by wuxw on 2017/4/5. */ @Service("rentingPoolAttrServiceDaoImpl") //@Transactional public class RentingPoolAttrServiceDaoImpl extends BaseServiceDao implements IRentingPoolAttrServiceDao { private static Logger logger = LoggerFactory.getLogger(RentingPoolAttrServiceDaoImpl.class); /** * 保存出租房屋属性信息 到 instance * @param info bId 信息 * @throws DAOException DAO异常 */ @Override public void saveRentingPoolAttrInfo(Map info) throws DAOException { logger.debug("保存出租房屋属性信息Instance 入参 info : {}",info); int saveFlag = sqlSessionTemplate.insert("rentingPoolAttrServiceDaoImpl.saveRentingPoolAttrInfo",info); if(saveFlag < 1){ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存出租房屋属性信息Instance数据失败:"+ JSONObject.toJSONString(info)); } } /** * 查询出租房屋属性信息(instance) * @param info bId 信息 * @return List<Map> * @throws DAOException DAO异常 */ @Override public List<Map> getRentingPoolAttrInfo(Map info) throws DAOException { logger.debug("查询出租房屋属性信息 入参 info : {}",info); List<Map> businessRentingPoolAttrInfos = sqlSessionTemplate.selectList("rentingPoolAttrServiceDaoImpl.getRentingPoolAttrInfo",info); return businessRentingPoolAttrInfos; } /** * 修改出租房屋属性信息 * @param info 修改信息 * @throws DAOException DAO异常 */ @Override public void updateRentingPoolAttrInfo(Map info) throws DAOException { logger.debug("修改出租房屋属性信息Instance 入参 info : {}",info); int saveFlag = sqlSessionTemplate.update("rentingPoolAttrServiceDaoImpl.updateRentingPoolAttrInfo",info); if(saveFlag < 1){ throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改出租房屋属性信息Instance数据失败:"+ JSONObject.toJSONString(info)); } } /** * 查询出租房屋属性数量 * @param info 出租房屋属性信息 * @return 出租房屋属性数量 */ @Override public int queryRentingPoolAttrsCount(Map info) { logger.debug("查询出租房屋属性数据 入参 info : {}",info); List<Map> businessRentingPoolAttrInfos = sqlSessionTemplate.selectList("rentingPoolAttrServiceDaoImpl.queryRentingPoolAttrsCount", info); if (businessRentingPoolAttrInfos.size() < 1) { return 0; } return Integer.parseInt(businessRentingPoolAttrInfos.get(0).get("count").toString()); } }
[ "928255095@qq.com" ]
928255095@qq.com
4ccb06e0f06e29d4634a3b2172c70945d7757392
258de8e8d556901959831bbdc3878af2d8933997
/utopia-service/utopia-wechat/utopia-wechat-impl/src/main/java/com/voxlearning/utopia/service/wechat/impl/support/WechatNoticeTemplateIds.java
29dc7b3e328d86698901ad5738678397bb088338
[]
no_license
Explorer1092/vox
d40168b44ccd523748647742ec376fdc2b22160f
701160b0417e5a3f1b942269b0e7e2fd768f4b8e
refs/heads/master
2020-05-14T20:13:02.531549
2019-04-17T06:54:06
2019-04-17T06:54:06
181,923,482
0
4
null
2019-04-17T15:53:25
2019-04-17T15:53:25
null
UTF-8
Java
false
false
1,319
java
package com.voxlearning.utopia.service.wechat.impl.support; /** * Wechat notice template id constants. * * @author Xiaohai Zhang * @since Jan 19, 2015 */ abstract public class WechatNoticeTemplateIds { public static final String templateId1 = "g033oxgX21GjodgrERrZMtoyjRvCDD7RaLuSWBjYzKY"; //消息通知模板ID public static final String templateId2 = "_St49j3hawFF2Us_w0-2UYoxKV-UVMv1GJNSPnIgCww"; //布置作业通知模板 public static final String templateId3 = "Qugb2m_mJcM4ufqO8z7eYL3LtGKC759ZYxrA_wOnz6Q"; //作业提醒通知模板 public static final String templateId4 = "B02vCTQP8hizIOCJGOfy3msN85RTbX37hwAAUWpitxo"; //未支付订单提醒通知模板 public static final String templateId5 = "HZiXb6sWVaXYTSbrdex0OXkz27NlQ8nRYVbvu_Xaa_A"; //阿分题学习报告通知模板 public static final String templateId6 = "nIloxqvD42MtmwPiTfX8YPayb8EWydZLU6fNRDalZPU"; //作业提醒通知模板ID - HomeworkExpireRemindNotice public static final String templateId7 = "fR0CQfE8W-n9Gk9VoQiJczHHNZgFoSEWMqViILyrk2g"; //公告通知提醒,用于家长微信运营类消息 public static final String templateId8 = "3G_zReRgk2qX7o2GlbzlaG_uOUgOuuqMUM7wjfzWTqI"; //系统通知提醒,用于老师微信运营类消息 }
[ "wangahai@300.cn" ]
wangahai@300.cn
7cbe7ccddcb25740d21e0d1d70e52413a3e7778a
5efc61cf2e85660d4c809662e34acefe27e57338
/jasperreports-5.6.0/src/net/sf/jasperreports/export/SimpleXlsReportConfiguration.java
3700cec98476fa0d20810de7501a56699ce6e024
[ "Apache-2.0", "LGPL-3.0-only" ]
permissive
ferrinsp/kbellfireapp
b2924c0a18fcf93dd6dc33168bddf8840f811326
751cc81026f27913e31f5b1f14673ac33cbf2df1
refs/heads/master
2022-12-22T10:01:39.525208
2019-06-22T15:33:58
2019-06-22T15:33:58
135,739,120
0
1
Apache-2.0
2022-12-15T23:23:53
2018-06-01T16:14:53
Java
UTF-8
Java
false
false
1,270
java
/* * JasperReports - Free Java Reporting Library. * Copyright (C) 2001 - 2013 Jaspersoft Corporation. All rights reserved. * http://www.jaspersoft.com * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program is part of JasperReports. * * JasperReports is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * JasperReports 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 JasperReports. If not, see <http://www.gnu.org/licenses/>. */ package net.sf.jasperreports.export; /** * @author Teodor Danciu (teodord@users.sourceforge.net) * @version $Id: SimpleXlsExporterConfiguration.java 6718 2013-11-11 09:32:19Z teodord $ */ public class SimpleXlsReportConfiguration extends AbstractXlsReportConfiguration { }
[ "ferrinsp@gmail.com" ]
ferrinsp@gmail.com
8ab63f8b3d5074be952cf5bcced7ba3aad561eda
9b182545728df353961b594fb0ff4fbeac245735
/src/java/bean/Compte.java
dcf511ef96354d803e36539f1e1c754674453545
[]
no_license
zinebelyasmi/test
3325900dbb401ee1d0a23e1d12d632480d10eb73
5191ecae18d681e15496dc5716ad3a55273f3a15
refs/heads/master
2021-04-25T06:30:52.966969
2018-02-20T17:17:40
2018-02-20T17:17:40
122,229,516
0
0
null
null
null
null
UTF-8
Java
false
false
2,031
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package bean; import java.io.Serializable; import java.util.List; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; /** * * @author lenovo */ @Entity public class Compte implements Serializable { private static final long serialVersionUID = 1L; @Id private String id; private Double solde; @OneToMany(mappedBy = "compte") private List<Operation> operations; public Compte() { } public Compte(String id) { this.id = id; } public List<Operation> getOperations() { return operations; } public void setOperations(List<Operation> operations) { this.operations = operations; } public Double getSolde() { return solde; } public void setSolde(Double solde) { this.solde = solde; } public String getId() { return id; } public void setId(String id) { this.id = id; } @Override public int hashCode() { int hash = 0; hash += (id != null ? id.hashCode() : 0); return hash; } @Override public boolean equals(Object object) { // TODO: Warning - this method won't work in the case the id fields are not set if (!(object instanceof Compte)) { return false; } Compte other = (Compte) object; if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { return false; } return true; } @Override public String toString() { return "bean.Compte[ id=" + id + " ]"; } }
[ "lenovo@lenovo-PC" ]
lenovo@lenovo-PC
b289b6c89b608eb575d76ff3c431e270d6f3fa7f
325f80997db7dcd2616009ec67bc96979fd81ed7
/SWEA/src/Baekjoon/DDU_총잡이.java
b5ee209d2c00bee5de9480dd090ce0df76c8bade
[]
no_license
Minnaldo/JAVA
798e109f1f702b767f120faf82d10930a11f9b23
fac484e2489af2326c9336f30f9a0021318b9841
refs/heads/master
2020-06-23T09:13:41.489349
2020-02-07T02:37:12
2020-02-07T02:37:12
198,576,347
0
0
null
null
null
null
UTF-8
Java
false
false
2,089
java
package Baekjoon; import java.util.Scanner; public class DDU_총잡이 { static int T; static char[][] arr; static int N; static int M; static Scanner sc = new Scanner(System.in); static int[] dx = { -1, 1, 0, 0 }; static int[] dy = { 0, 0, -1, 1 }; static boolean inArr(int x, int y) { return x >= 0 && x < N && y >= 0 && y < M; } public static void main(String[] args) { // TODO Auto-generated method stub T = sc.nextInt(); for (int tc = 1; tc <= T; tc++) { N = sc.nextInt(); M = sc.nextInt(); arr = new char[N][M]; for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { arr[i][j] = sc.next().charAt(0); } } int resul = 0; for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { if (arr[i][j] == 'G') { resul += shoot(i, j); //System.out.println(i+" "+j+"*********"); //System.out.println("resul " + resul); } } } System.out.println("#" + tc + " " + resul); } // tc } static int shoot(int x, int y) { int sum = 0; int nx = x; int ny = y; for (int i = 0; i < 4; i++) { int dirX = dx[i]; int dirY = dy[i]; nx=x+dirX; ny=y+dirY; //System.out.println(nx + " " + ny); while (inArr(nx, ny) && (arr[nx][ny] != 'W')) { if (arr[nx][ny] == 'G') { break; } if (arr[nx][ny] == 'T') { //System.out.println(nx+"와"+ny+"에서 팡!!!!!"); arr[nx][ny]='A'; sum++; break; } nx += dirX; ny += dirY; } } //System.out.println(sum+" 썸입니다!"); return sum; } }
[ "minnaldo6602@gmail.com" ]
minnaldo6602@gmail.com
a3aa55655eb0303558d3393a01fd2ba3bf14229c
893fd55d55e65354c563c69d3c3f3d28a72b3a6b
/OpenADRServerVTN20b/src/main/java/com/avob/openadr/server/oadr20b/vtn/Oadr20bX509AuthenticatedUserDetailsService.java
227e2cbdf665fd1a42b709a4880e1367b3fce0d1
[ "Apache-2.0" ]
permissive
avob/OpenADR
62a63e08d13e792d8c7ff0b186641b74b49d5b6f
7608f780509e5669bbf5bd311c8cb3206cebf7ac
refs/heads/master
2022-09-18T21:56:32.315131
2021-09-06T06:22:02
2021-09-06T06:22:02
169,761,438
45
18
Apache-2.0
2022-02-16T01:15:15
2019-02-08T16:07:39
Java
UTF-8
Java
false
false
1,517
java
package com.avob.openadr.server.oadr20b.vtn; import java.security.cert.X509Certificate; import javax.annotation.Resource; import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken; import org.springframework.stereotype.Service; import com.avob.openadr.security.OadrFingerprintSecurity; import com.avob.openadr.security.exception.OadrSecurityException; import com.avob.openadr.server.common.vtn.security.OadrSecurityRoleService; /** * x509 oadr fingerprint mechanism demonstration * * this fingerprint should be check against some sort of database * * @author bertrand * */ @Service public class Oadr20bX509AuthenticatedUserDetailsService implements AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken> { @Resource private OadrSecurityRoleService oadrSecurityRoleService; @Override public UserDetails loadUserDetails(PreAuthenticatedAuthenticationToken token) { X509Certificate certificate = (X509Certificate) token.getCredentials(); String fingerprint = ""; try { fingerprint = OadrFingerprintSecurity.getOadr20bFingerprint(certificate); } catch (OadrSecurityException e) { throw new UsernameNotFoundException("", e); } return oadrSecurityRoleService.grantX509Role(fingerprint); } }
[ "zanni.bertrand@gmail.com" ]
zanni.bertrand@gmail.com
c21fe444d72c39ec8df30c565fbc2cce5626eb6f
6a95484a8989e92db07325c7acd77868cb0ac3bc
/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201406/ch/CustomerSyncServiceInterface.java
2e3407c2791e826c40fc558f42e817d4fad2212c
[ "Apache-2.0" ]
permissive
popovsh6/googleads-java-lib
776687dd86db0ce785b9d56555fe83571db9570a
d3cabb6fb0621c2920e3725a95622ea934117daf
refs/heads/master
2020-04-05T23:21:57.987610
2015-03-12T19:59:29
2015-03-12T19:59:29
33,672,406
1
0
null
2015-04-09T14:06:00
2015-04-09T14:06:00
null
UTF-8
Java
false
false
1,111
java
/** * CustomerSyncServiceInterface.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter. */ package com.google.api.ads.adwords.axis.v201406.ch; public interface CustomerSyncServiceInterface extends java.rmi.Remote { /** * Returns information about changed entities inside a customer's * account. * * * @param selector Specifies the filter for selecting changehistory events * for a customer. * * @return A Customer->Campaign->AdGroup hierarchy containing information * about the objects * changed at each level. All Campaigns that are requested in * the selector will be returned, * regardless of whether or not they have changed, but unchanged * AdGroups will be ignored. */ public com.google.api.ads.adwords.axis.v201406.ch.CustomerChangeData get(com.google.api.ads.adwords.axis.v201406.ch.CustomerSyncSelector selector) throws java.rmi.RemoteException, com.google.api.ads.adwords.axis.v201406.cm.ApiException; }
[ "jradcliff@google.com" ]
jradcliff@google.com
2e7802236e4ec7ba572cb78c300008231ead2f55
36073e09d6a12a275cc85901317159e7fffa909e
/droolsjbpm_drools/modifiedFiles/12/old/AttributeDescr.java
a76899d8c7dd3af56aa81a4cc4f48e8305147a2f
[]
no_license
monperrus/bug-fixes-saner16
a867810451ddf45e2aaea7734d6d0c25db12904f
9ce6e057763db3ed048561e954f7aedec43d4f1a
refs/heads/master
2020-03-28T16:00:18.017068
2018-11-14T13:48:57
2018-11-14T13:48:57
148,648,848
3
0
null
null
null
null
UTF-8
Java
false
false
2,105
java
/* * Copyright 2005 JBoss 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.drools.compiler.lang.descr; public class AttributeDescr extends BaseDescr { public static enum Type { STRING, NUMBER, DATE, BOOLEAN, LIST, EXPRESSION } private static final long serialVersionUID = 510l; private String name; private String value; private Type type; // default constructor for serialization public AttributeDescr() {} public AttributeDescr(final String name) { this(name, null, Type.EXPRESSION ); } public AttributeDescr(final String name, final String value) { this( name, value, Type.EXPRESSION ); } public AttributeDescr(final String name, final String value, final Type type ) { this.name = name; this.value = value; this.type = type; } public String getName() { return this.name; } public String getValue() { return this.value; } public void setValue( final String value ) { this.value = value; } public void setType( Type type ) { this.type = type; } public Type getType() { return this.type; } public String getValueString() { if( type == Type.STRING || type == Type.DATE ) { // needs escaping return "\""+this.value+"\""; } return this.value; } }
[ "martin.monperrus@gnieh.org" ]
martin.monperrus@gnieh.org
1d670681fbd1e53e442ff2ac193ecb1f5a8c9ad8
8bc54d94c6904e7d2144cdcd5f1a097451a79a5a
/service-common/src/main/java/com/cloud/common/auth/UserInfo.java
7ca84737c1d5f35e7121c15712add938a9d0a9f8
[]
no_license
zhuwj921/spring-cloud-framework
565597825e3e55d645d991b7e14b0cf8ed0c162f
df82fbb74195571c3878cd03dcebb830c94cef35
refs/heads/master
2022-07-25T01:57:39.044341
2022-07-23T15:44:17
2022-07-23T15:44:17
118,253,375
76
54
null
2020-12-06T14:50:50
2018-01-20T15:09:00
Java
UTF-8
Java
false
false
1,370
java
package com.cloud.common.auth; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer; import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; import java.util.Set; /** * @author zhuwj * @desc 用户信息 */ @Data public class UserInfo implements Serializable { /** * 用户id */ private Long userId; /** * 用户名 */ private String username; /** * 昵称 */ private String nickName; /** * 电话号码 */ private String phone; /** * 邮箱 */ private String email; /** * 性别 */ private Integer gender; /** * 最后登入时间 */ @JsonFormat(shape =JsonFormat.Shape.STRING,pattern ="yyyy-MM-dd HH:mm:ss",timezone ="GMT+8") @JsonDeserialize(using = LocalDateTimeDeserializer.class) @JsonSerialize(using = LocalDateTimeSerializer.class) private LocalDateTime lastLoginTime; /** * 角色列表 */ private Set<String> roles; /** * 资源列表 */ private Set<String> resources; }
[ "774623096@qq.com" ]
774623096@qq.com
f314077a75c8a58513ccc2d3a27cdf0b4f2a8ecb
8a8254c83cc2ec2c401f9820f78892cf5ff41384
/instrumented-nappa-tfpr/materialistic/app/src/main/java/nappatfpr/io/github/hidroh/materialistic/AdBlocker.java
37bc0b2e3786797cd16e9df39cd1d1566782436a
[ "Apache-2.0" ]
permissive
VU-Thesis-2019-2020-Wesley-Shann/subjects
46884bc6f0f9621be2ab3c4b05629e3f6d3364a0
14a6d6bb9740232e99e7c20f0ba4ddde3e54ad88
refs/heads/master
2022-12-03T05:52:23.309727
2020-08-19T12:18:54
2020-08-19T12:18:54
261,718,101
0
0
null
2020-07-11T12:19:07
2020-05-06T09:54:05
Java
UTF-8
Java
false
false
2,812
java
/* * Copyright (c) 2016 Ha Duy Trung * * 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 nappatfpr.io.github.hidroh.materialistic; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import androidx.annotation.WorkerThread; import android.text.TextUtils; import android.webkit.WebResourceResponse; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashSet; import java.util.Set; import okhttp3.HttpUrl; import okio.BufferedSource; import okio.Okio; import rx.Observable; import rx.Scheduler; public class AdBlocker { private static final String AD_HOSTS_FILE = "pgl.yoyo.org.txt"; private static final Set<String> AD_HOSTS = new HashSet<>(); public static void init(Context context, Scheduler scheduler) { Observable.fromCallable(() -> loadFromAssets(context)) .onErrorReturn(throwable -> null) .subscribeOn(scheduler) .subscribe(); } public static boolean isAd(String url) { HttpUrl httpUrl = HttpUrl.parse(url); return isAdHost(httpUrl != null ? httpUrl.host() : ""); } @TargetApi(Build.VERSION_CODES.HONEYCOMB) public static WebResourceResponse createEmptyResource() { return new WebResourceResponse("text/plain", "utf-8", new ByteArrayInputStream("".getBytes())); } @WorkerThread private static Void loadFromAssets(Context context) throws IOException { InputStream stream = context.getAssets().open(AD_HOSTS_FILE); BufferedSource buffer = Okio.buffer(Okio.source(stream)); String line; while ((line = buffer.readUtf8Line()) != null) { AD_HOSTS.add(line); } buffer.close(); stream.close(); return null; } /** * Recursively walking up sub domain chain until we exhaust or find a match, * effectively doing a longest substring matching here */ private static boolean isAdHost(String host) { if (TextUtils.isEmpty(host)) { return false; } int index = host.indexOf("."); return index >= 0 && (AD_HOSTS.contains(host) || index + 1 < host.length() && isAdHost(host.substring(index + 1))); } }
[ "sshann95@outlook.com" ]
sshann95@outlook.com
67a38bb98515b175b0a87518d163cdaa916093c8
c34c16c923802c7bd63ba7666da7406ea179c8db
/百联-android-20210807/az/skWeiChatBaidu/src/main/java/com/ydd/zhichat/view/SharePopupWindow.java
988c63741f600e6f389b62a53392d9831a144a20
[]
no_license
xeon-ye/bailian
36f322b40a4bc3a9f4cc6ad76e95efe3216258ed
ec84ac59617015a5b7529845f551d4fa136eef4e
refs/heads/main
2023-06-29T06:12:53.074219
2021-08-07T11:56:38
2021-08-07T11:56:38
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,555
java
package com.ydd.zhichat.view; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.WindowManager; import android.widget.LinearLayout; import android.widget.PopupWindow; import com.ydd.zhichat.MyApplication; import com.ydd.zhichat.R; import com.ydd.zhichat.helper.ShareSdkHelper; import com.ydd.zhichat.ui.base.BaseActivity; public class SharePopupWindow extends PopupWindow implements OnClickListener { private BaseActivity mContent; public SharePopupWindow(BaseActivity context) { this.mContent = context; initView(); } private void initView() { LayoutInflater inflater = (LayoutInflater) mContent.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View mMenuView = inflater.inflate(R.layout.view_share, null); setContentView(mMenuView); setWidth(LinearLayout.LayoutParams.MATCH_PARENT); setHeight(LinearLayout.LayoutParams.WRAP_CONTENT); setFocusable(true); setAnimationStyle(R.style.Buttom_Popwindow); // 因为某些机型是虚拟按键的,所以要加上以下设置防止挡住按键. setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); mMenuView.findViewById(R.id.platformshare_wechat).setOnClickListener(this); mMenuView.findViewById(R.id.platformshare_moment).setOnClickListener(this); mMenuView.findViewById(R.id.cancel).setOnClickListener(this); } @Override public void onClick(View v) { dismiss(); switch (v.getId()) { case R.id.platformshare_wechat: ShareSdkHelper.shareWechat(mContent, MyApplication.getContext().getString(R.string.app_name) + mContent.getString(R.string.suffix_share_content), MyApplication.getContext().getString(R.string.app_name) + mContent.getString(R.string.suffix_share_content), mContent.coreManager.getConfig().website); break; case R.id.platformshare_moment: ShareSdkHelper.shareWechatMoments(mContent, MyApplication.getContext().getString(R.string.app_name) + mContent.getString(R.string.suffix_share_content), MyApplication.getContext().getString(R.string.app_name) + mContent.getString(R.string.suffix_share_content), mContent.coreManager.getConfig().website); break; case R.id.cancel: break; } } }
[ "xiexun6943@gmail.com" ]
xiexun6943@gmail.com
1d313e74ac81b3c796651f0e5e1b39be30749850
6862a9c1492b1eecee75a2231534cf22b37a1e03
/Practice04/src/com/javaex/problem04/SoundApp.java
9c42e6a263a556941ff52a750e1c3eff2bfa6f65
[]
no_license
lutae2000/Java_practice04
b5d3853f95a04b135ad6ed523129e61368d24ab5
e1c4999d9213004dd1bbd59a9de5102eb04196b9
refs/heads/master
2020-03-19T13:02:31.644375
2018-06-08T03:59:21
2018-06-08T03:59:21
136,556,988
0
0
null
null
null
null
UTF-8
Java
false
false
352
java
package com.javaex.problem04; public class SoundApp { public static void main(String[] args) { printSound( new Cat() ); printSound( new Dog() ); printSound( new Sparrow() ); printSound( new Duck() ); } public static void printSound( Soundable soundable ) { soundable. } }
[ "BIT-USER@BIT" ]
BIT-USER@BIT
b7a707455d43b4a69a9fbcc9af6f5832f63dc360
63b9289fe4395b599545de10de7f1b46d3c367d3
/ch4/src/ch4/ArrayTest12.java
a3e32bb7600c2c5d4e8f92a34c9c329758932fb8
[]
no_license
glglgl45/javasource
7d83499a3e22cb0b5ce1651ff9a0f01e32650980
b89a599db48ddd098a7951ae7ad2d83450ebcecf
refs/heads/master
2022-06-20T10:55:14.829371
2020-05-08T08:18:43
2020-05-08T08:18:43
261,990,856
0
0
null
null
null
null
UTF-8
Java
false
false
390
java
package ch4; public class ArrayTest12 { public static void main(String[] args) { int oldArray[] = {10,20,30}; int newArray[] = new int[4]; // for (int i = 0 ; i < oldArray.length ; i++) { // newArray[i] = oldArray[i]; // } // 배열copy System.arraycopy(oldArray, 0, newArray, 0, oldArray.length); for (int i : newArray) { System.out.print(i + " "); } } }
[ "glglgl47@naver.com" ]
glglgl47@naver.com
f9d0f2f2651d39f07df8de08bf812dffeb6e82e7
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE789_Uncontrolled_Mem_Alloc/s03/CWE789_Uncontrolled_Mem_Alloc__random_ArrayList_68a.java
68c409204e42cccef71df84e42570c3fb913bf07
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
2,015
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE789_Uncontrolled_Mem_Alloc__random_ArrayList_68a.java Label Definition File: CWE789_Uncontrolled_Mem_Alloc.int.label.xml Template File: sources-sink-68a.tmpl.java */ /* * @description * CWE: 789 Uncontrolled Memory Allocation * BadSource: random Set data to a random value * GoodSource: A hardcoded non-zero, non-min, non-max, even number * BadSink: ArrayList Create an ArrayList using data as the initial size * Flow Variant: 68 Data flow: data passed as a member variable in the "a" class, which is used by a method in another class in the same package * * */ package testcases.CWE789_Uncontrolled_Mem_Alloc.s03; import testcasesupport.*; import javax.servlet.http.*; import java.security.SecureRandom; public class CWE789_Uncontrolled_Mem_Alloc__random_ArrayList_68a extends AbstractTestCase { public static int data; public void bad() throws Throwable { /* POTENTIAL FLAW: Set data to a random value */ data = (new SecureRandom()).nextInt(); (new CWE789_Uncontrolled_Mem_Alloc__random_ArrayList_68b()).badSink(); } public void good() throws Throwable { goodG2B(); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { /* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */ data = 2; (new CWE789_Uncontrolled_Mem_Alloc__random_ArrayList_68b()).goodG2BSink(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "you@example.com" ]
you@example.com
43cfb7ee50840259290d4cf5adec84e4239bd1ac
a7b868c8c81984dbcb17c1acc09c0f0ab8e36c59
/src/main/java/com/alipay/api/domain/BankRepayData.java
3d8f84bf00635fb7fdaf34c5bd1d36c649612c1d
[ "Apache-2.0" ]
permissive
1755616537/alipay-sdk-java-all
a7ebd46213f22b866fa3ab20c738335fc42c4043
3ff52e7212c762f030302493aadf859a78e3ebf7
refs/heads/master
2023-02-26T01:46:16.159565
2021-02-02T01:54:36
2021-02-02T01:54:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,143
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 银行追款场景数据 * * @author auto create * @since 1.0, 2019-11-12 19:52:42 */ public class BankRepayData extends AlipayObject { private static final long serialVersionUID = 4544333951558687148L; /** * 原清算交易中支付宝文件流水传的senderClrgTrcno发行方清算流水号; 追款关联的原银行清算流水号,二选一传入即可 */ @ApiField("original_out_trade_no") private String originalOutTradeNo; /** * 原清算交易中支付宝文件流水传的etcClrgTrcnoETC清算流水号 */ @ApiField("original_trade_no") private String originalTradeNo; public String getOriginalOutTradeNo() { return this.originalOutTradeNo; } public void setOriginalOutTradeNo(String originalOutTradeNo) { this.originalOutTradeNo = originalOutTradeNo; } public String getOriginalTradeNo() { return this.originalTradeNo; } public void setOriginalTradeNo(String originalTradeNo) { this.originalTradeNo = originalTradeNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
543fab12a721de4fa3d76285264782738cb8b1df
8c71554142287c3cc8f2d021c1797908b40caf44
/src/test/java/com/apiintegration/web/rest/errors/ExceptionTranslatorTestController.java
7f5e204c9c13565e01386a92c1df55ba4d023857
[]
no_license
HeshamOsman/keycloak-integration
81e650e2b9f94e234c5c277c4d1f36f3d428192c
b9090a9c61d2e2bc764c61e0bf8902201a035409
refs/heads/master
2022-12-23T11:08:32.993256
2019-12-16T15:18:32
2019-12-16T15:18:32
228,415,590
0
1
null
2022-12-16T05:03:41
2019-12-16T15:19:41
Java
UTF-8
Java
false
false
2,081
java
package com.apiintegration.web.rest.errors; import org.springframework.dao.ConcurrencyFailureException; import org.springframework.http.HttpStatus; import org.springframework.security.access.AccessDeniedException; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import javax.validation.constraints.NotNull; @RestController public class ExceptionTranslatorTestController { @GetMapping("/test/concurrency-failure") public void concurrencyFailure() { throw new ConcurrencyFailureException("test concurrency failure"); } @PostMapping("/test/method-argument") public void methodArgument(@Valid @RequestBody TestDTO testDTO) { } @GetMapping("/test/missing-servlet-request-part") public void missingServletRequestPartException(@RequestPart String part) { } @GetMapping("/test/missing-servlet-request-parameter") public void missingServletRequestParameterException(@RequestParam String param) { } @GetMapping("/test/access-denied") public void accessdenied() { throw new AccessDeniedException("test access denied!"); } @GetMapping("/test/unauthorized") public void unauthorized() { throw new BadCredentialsException("test authentication failed!"); } @GetMapping("/test/response-status") public void exceptionWithResponseStatus() { throw new TestResponseStatusException(); } @GetMapping("/test/internal-server-error") public void internalServerError() { throw new RuntimeException(); } public static class TestDTO { @NotNull private String test; public String getTest() { return test; } public void setTest(String test) { this.test = test; } } @ResponseStatus(value = HttpStatus.BAD_REQUEST, reason = "test response status") @SuppressWarnings("serial") public static class TestResponseStatusException extends RuntimeException { } }
[ "hesham.osman28@yahoo.com" ]
hesham.osman28@yahoo.com
a1766a520a2fe9d8900979c24e7a43fbd1443aaf
9783bff458cd06246409b3b5dc34547dc34e7dd9
/src/main/java/paulevs/betternether/structures/StructureCaves.java
5f3c06ef56d808039913a2ef7c103f0c6155229d
[]
no_license
saltyseadoggo/BetterNether
90d0cdfa77e4fbb3eaaedba8ab3b7cdbede829eb
9feea635c2ac4b75f3e981b24178dc6389035898
refs/heads/master
2023-03-12T16:02:29.223687
2021-03-04T20:52:14
2021-03-04T20:52:14
306,501,557
0
0
null
2020-10-23T01:44:08
2020-10-23T01:44:08
null
UTF-8
Java
false
false
3,288
java
package paulevs.betternether.structures; import java.util.Random; import net.minecraft.block.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos.Mutable; import net.minecraft.world.ServerWorldAccess; import paulevs.betternether.BlocksHelper; import paulevs.betternether.noise.OpenSimplexNoise; public class StructureCaves implements IStructure { private static final boolean[][][] MASK = new boolean[16][24][16]; private static final Mutable B_POS = new Mutable(); private static int offset = 12; private OpenSimplexNoise heightNoise; private OpenSimplexNoise rigidNoise; private OpenSimplexNoise distortX; private OpenSimplexNoise distortY; public StructureCaves(long seed) { Random random = new Random(seed); heightNoise = new OpenSimplexNoise(random.nextLong()); rigidNoise = new OpenSimplexNoise(random.nextLong()); distortX = new OpenSimplexNoise(random.nextLong()); distortY = new OpenSimplexNoise(random.nextLong()); } @Override public void generate(ServerWorldAccess world, BlockPos pos, Random random) { boolean isVoid = true; offset = (int) (getHeight(pos.getX() + 8, pos.getZ() + 8) - 12); for (int x = 0; x < 16; x++) { int wx = pos.getX() + x; for (int z = 0; z < 16; z++) { int wz = pos.getZ() + z; double height = getHeight(wx, wz); double rigid = getRigid(wx, wz); for (int y = 0; y < 24; y++) { int wy = offset + y; double hRigid = Math.abs(wy - height); double sdf = -opSmoothUnion(-hRigid / 30, -rigid, 0.15); if (sdf < 0.15) { MASK[x][y][z] = true; isVoid = false; } else MASK[x][y][z] = false; } } } if (isVoid) return; for (int x = 0; x < 16; x++) { int wx = pos.getX() + x; for (int z = 0; z < 16; z++) { int wz = pos.getZ() + z; for (int y = 23; y >= 0; y--) { int wy = offset + y; B_POS.set(wx, wy, wz); if (MASK[x][y][z] && BlocksHelper.isNetherGroundMagma(world.getBlockState(B_POS))) { /* * if (world.getBlockState(B_POS.up()).getBlock() == * Blocks.NETHER_WART_BLOCK) * BlocksHelper.setWithoutUpdate(world, B_POS, * Blocks.NETHER_WART_BLOCK.getDefaultState()); else */ BlocksHelper.setWithoutUpdate(world, B_POS, Blocks.AIR.getDefaultState()); } } } } } private double getHeight(int x, int z) { return heightNoise.eval(x * 0.01, z * 0.01) * 32 + 64; } private double getRigid(int x, int z) { return Math.abs(rigidNoise.eval( x * 0.02 + distortX.eval(x * 0.05, z * 0.05) * 0.2, z * 0.02 + distortY.eval(x * 0.05, z * 0.05) * 0.2)) * 0.6; // return Math.abs(rigidNoise.eval(x * 0.02, z * 0.02)); } private double mix(double dist1, double dist2, double blend) { return dist1 * (1 - blend) + dist2 * blend; } private double opSmoothUnion(double dist1, double dist2, double blend) { double h = 0.5 + 0.5 * (dist2 - dist1) / blend; h = h > 1 ? 1 : h < 0 ? 0 : h; return mix(dist2, dist1, h) - blend * h * (1 - h); } public boolean isInCave(int x, int y, int z) { int y2 = y - offset; if (y2 >= 0 && y < 24) return MASK[x][y2][z]; else return false; } }
[ "paulevs@yandex.ru" ]
paulevs@yandex.ru
32d0e5805985827db139082429b4d73869e43985
98128747eb1f8bf766bfe79183fce6a3d90a4277
/a0015_java_design_pattern/aa0015_30_double-dispatch/src/main/java/org/saxing/doubledispatch/Rectangle.java
d1693355669be3a19d5908091f8e1b45a8505b6c
[]
no_license
saxingz/java-example
6887526bed258aecf228b60cf23f5a00bdb6d23b
c914137a429dcd97500f5bd66017f43b7dd480b3
refs/heads/master
2023-06-26T05:22:05.329598
2022-06-29T14:26:46
2022-06-29T14:26:46
57,117,717
5
1
null
2023-06-14T22:33:27
2016-04-26T10:00:09
Java
UTF-8
Java
false
false
957
java
package org.saxing.doubledispatch; /** * ractangle * * @author saxing 2018/12/16 17:27 */ public class Rectangle { private int left; private int top; private int right; private int bottom; public Rectangle(int left, int top, int right, int bottom) { this.left = left; this.top = top; this.right = right; this.bottom = bottom; } public int getLeft() { return left; } public int getTop() { return top; } public int getRight() { return right; } public int getBottom() { return bottom; } boolean intersectsWith(Rectangle r){ return !(r.getLeft() > getRight() || r.getRight() < getLeft() || r.getTop() > getBottom() || r .getBottom() < getTop()); } @Override public String toString() { return String.format("[%d,%d,%d,%d]", getLeft(), getTop(), getRight(), getBottom()); } }
[ "saxlh@foxmail.com" ]
saxlh@foxmail.com
9985ff34ebcbea147e204de9d1b5d36fe325e168
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-ws/results/MOCKITO-21b-2-3-Single_Objective_GGA-WeightedSum/org/mockito/internal/creation/instance/ConstructorInstantiator_ESTest.java
7207f21678102d3b666126b1349c32e1e1d980ac
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
962
java
/* * This file was automatically generated by EvoSuite * Tue Mar 31 13:02:17 UTC 2020 */ package org.mockito.internal.creation.instance; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; import org.mockito.internal.creation.instance.ConstructorInstantiator; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class ConstructorInstantiator_ESTest extends ConstructorInstantiator_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { Object object0 = new Object(); ConstructorInstantiator constructorInstantiator0 = new ConstructorInstantiator(object0); Class<Object> class0 = Object.class; // Undeclared exception! constructorInstantiator0.newInstance((Class<?>) class0); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
775143b92de97819ffd8aafbdc28c7ed700f226e
1b793ed6f4f2d8aa4ca0013895aacf7faf5ad384
/cas-server-core-services/src/main/java/org/jasig/cas/services/RegisteredServicePublicKeyImpl.java
91d80e16b6eb496b8ce4372f6103f16f94d91937
[ "Apache-2.0" ]
permissive
zion64/cas
038389b073ca44a3474aa2fad8545fda1fb1790c
d849c656e78778f7132bf1296216a7617a44714c
refs/heads/master
2021-01-18T20:21:53.619394
2015-12-13T02:28:08
2015-12-13T02:28:08
20,243,774
1
0
null
null
null
null
UTF-8
Java
false
false
3,900
java
package org.jasig.cas.services; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.jasig.cas.util.PublicKeyFactoryBean; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.FileSystemResource; import java.io.Serializable; import java.security.PublicKey; /** * Represents a public key for a CAS registered service. * @author Misagh Moayyed * @since 4.1 */ public final class RegisteredServicePublicKeyImpl implements Serializable, RegisteredServicePublicKey { private static final long serialVersionUID = -8497658523695695863L; private final Logger logger = LoggerFactory.getLogger(this.getClass()); private String location; private String algorithm; private Class<PublicKeyFactoryBean> publicKeyFactoryBeanClass = PublicKeyFactoryBean.class; /** * Instantiates a new Registered service public key impl. * Required for proper serialization. */ private RegisteredServicePublicKeyImpl() {} /** * Instantiates a new Registered service public key impl. * * @param location the location * @param algorithm the algorithm */ public RegisteredServicePublicKeyImpl(final String location, final String algorithm) { this.location = location; this.algorithm = algorithm; } public void setLocation(final String location) { this.location = location; } public void setAlgorithm(final String algorithm) { this.algorithm = algorithm; } @Override public String getLocation() { return this.location; } @Override public String getAlgorithm() { return this.algorithm; } /** * Sets public key factory bean class. * * @param publicKeyFactoryBeanClass the public key factory bean class */ public void setPublicKeyFactoryBeanClass(final Class<PublicKeyFactoryBean> publicKeyFactoryBeanClass) { this.publicKeyFactoryBeanClass = publicKeyFactoryBeanClass; } @Override public PublicKey createInstance() throws Exception { try { final PublicKeyFactoryBean factory = publicKeyFactoryBeanClass.newInstance(); if (this.location.startsWith("classpath:")) { factory.setLocation(new ClassPathResource(StringUtils.removeStart(this.location, "classpath:"))); } else { factory.setLocation(new FileSystemResource(this.location)); } factory.setAlgorithm(this.algorithm); factory.setSingleton(false); return factory.getObject(); } catch (final Exception e) { logger.warn(e.getMessage(), e); throw new RuntimeException(e); } } @Override public String toString() { return new ToStringBuilder(this) .append("location", this.location) .append("algorithm", this.algorithm) .toString(); } @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (obj.getClass() != getClass()) { return false; } final RegisteredServicePublicKeyImpl rhs = (RegisteredServicePublicKeyImpl) obj; return new EqualsBuilder() .append(this.location, rhs.location) .append(this.algorithm, rhs.algorithm) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder() .append(location) .append(algorithm) .toHashCode(); } }
[ "mmoayyed@unicon.net" ]
mmoayyed@unicon.net
1258ab1a74f8cfc413a09313562bf7a74270abc9
7fabca34bfa5c25cf4aa313a4a8276b194ea6855
/klum-ast-jackson/src/main/java/com/blackbuild/klum/ast/jackson/KlumValueInstantiator.java
7ff9a9462de8211e278f35c825f70b52105e9b65
[ "MIT" ]
permissive
klum-dsl/klum-ast
073620c04c8cac3d7b7a188aae9ffd94725f29c3
2b2a3716088df97a02fd4a823b753e0089d5ceec
refs/heads/master
2023-09-01T00:47:02.367181
2023-08-22T08:49:03
2023-08-22T08:49:03
40,505,913
8
0
MIT
2023-08-22T08:49:05
2015-08-10T20:59:21
Java
UTF-8
Java
false
false
3,004
java
/* * The MIT License (MIT) * * Copyright (c) 2015-2023 Stephan Pauxberger * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package com.blackbuild.klum.ast.jackson; import com.blackbuild.klum.ast.util.DslHelper; import com.blackbuild.klum.ast.util.FactoryHelper; import com.fasterxml.jackson.databind.DeserializationConfig; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.PropertyName; import com.fasterxml.jackson.databind.deser.CreatorProperty; import com.fasterxml.jackson.databind.deser.SettableBeanProperty; import com.fasterxml.jackson.databind.deser.ValueInstantiator; import com.fasterxml.jackson.databind.introspect.BasicBeanDescription; import java.io.IOException; import java.lang.reflect.Field; import java.util.Optional; public class KlumValueInstantiator extends ValueInstantiator.Base { KlumValueInstantiator(BasicBeanDescription beanDesc) { super(beanDesc.getType()); } @Override public boolean canCreateFromObjectWith() { return true; } @Override public SettableBeanProperty[] getFromObjectArguments(DeserializationConfig config) { Optional<Field> field = DslHelper.getKeyField(getValueClass()); if (!field.isPresent()) throw new IllegalStateException("KlumValueInstantiator is only valid for keyed objects."); CreatorProperty prop = CreatorProperty.construct( new PropertyName(field.get().getName()), config.getTypeFactory().constructType(field.get().getType()), null, null, null, null, 0, null, null ); return new SettableBeanProperty[] {prop}; } @Override public Object createFromObjectWith(DeserializationContext ctxt, Object[] args) throws IOException { return FactoryHelper.createAsStub(getValueClass(), (String) args[0]); } }
[ "stephan@blackbuild.com" ]
stephan@blackbuild.com
99b65be4d192b6db160dc69f8239689290ed6335
98bd09233229554d0824b89feff9448d58b6f3c4
/hs-exchanger/src/main/java/com/huashi/exchanger/template/handler/ResponseTemplateHandler.java
6125da03c350e0bcc7061ebd7769adcf4409a6c7
[]
no_license
arraycto/hspaas
6cb308c76a4e77bd06106c686f98d20fba685505
29c2ecf904f3fcc7b2965edb5b74a11908a25c49
refs/heads/master
2020-12-10T14:18:40.245824
2019-07-05T08:45:47
2019-07-05T08:45:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,127
java
package com.huashi.exchanger.template.handler; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; import com.huashi.exchanger.constant.ExchangerConstant; import com.huashi.exchanger.domain.ProviderSendResponse; import com.huashi.exchanger.exception.DataEmptyException; import com.huashi.exchanger.exception.DataParseException; import com.huashi.exchanger.template.vo.TPosition; /** * * TODO 调用接口响应解析器 * * @author zhengying * @version V1.0 * @date 2016年9月28日 下午5:06:53 */ public class ResponseTemplateHandler { /** * * TODO 解析 * @param result * 返回结果 * @param format * 结果模板 * @param position * 模板值定位 * @return */ public static List<ProviderSendResponse> parse(String result, String format, String position, String successCode) { // 暂定写死 List<ProviderSendResponse> list = new ArrayList<>(); ProviderSendResponse response = null; List<Map<String, Object>> array = JSON.parseObject(result, new TypeReference<List<Map<String, Object>>>(){}); if(array == null || array.size() == 0) { return null; } for(Map<String, Object> ojb : array) { response = new ProviderSendResponse(); response.setMobile(ojb.get("Mobile").toString()); response.setStatusCode(ojb.get("Rspcode") == null ? null : ojb.get("Rspcode").toString()); response.setSid(ojb.get("Msg_Id").toString()); response.setSuccess(ResponseTemplateHandler.isSuccess(response.getStatusCode(), successCode)); list.add(response); } return list; // validate(result, format, position); // // return parseResult(result, format, position, successCode); } /** * * TODO 校验 * @param result * @param format * @param position */ static void validate(String result, String format, String position) { if (StringUtils.isEmpty(result)) { throw new DataEmptyException("结果数据为空"); } if (StringUtils.isEmpty(format)) { throw new DataEmptyException("格式化模板数据为空"); } if (StringUtils.isEmpty(position)) { throw new DataEmptyException("格式化模板定位数据为空"); } } static List<ProviderSendResponse> parseResult(String result, String format, String position, String successCode) { try { TPosition tpositon = getPosition(position); // 手机号码定位 Integer mobilePosition = tpositon.getPosition(TPosition.MOBILE_NODE_NAME); // 状态码定位 Integer statusCodePosition = tpositon.getPosition(TPosition.STATUS_CODE_NODE_NAME); // 任务ID定位 Integer sidPosition = tpositon.getPosition(TPosition.SID_NODE_NAME); List<ProviderSendResponse> list = new ArrayList<>(); ProviderSendResponse response = null; Pattern pattern = Pattern.compile(format); Matcher matcher = pattern.matcher(result); while (matcher.find()) { response = new ProviderSendResponse(); response.setMobile(mobilePosition == null ? null : getRespVal(matcher.group(mobilePosition.intValue())) ); response.setStatusCode(statusCodePosition == null ? null : getRespVal(matcher.group(statusCodePosition.intValue()))); response.setSid(sidPosition == null ? null : getRespVal(matcher.group(sidPosition.intValue()))); response.setSuccess(isSuccess(response.getStatusCode(), successCode)); list.add(response); } return list; } catch (Exception e) { throw new DataParseException(e); } } private static TPosition getPosition(String position) { try { TPosition tposition = JSON.parseObject(position, TPosition.class); if (MapUtils.isEmpty(tposition)) { throw new DataEmptyException(position); } return tposition; } catch (Exception e) { throw new DataParseException(e); } } /** * * TODO 获取返回值信息 * @param o * @return */ private static String getRespVal(String o) { if(StringUtils.isEmpty(o)) { return null; } return o.replaceAll("\"",""); } /** * * TODO 判断状态码是否成功 * * @param statusCode * @param temlateSuccessCode * 模板成功状态码 * @return */ public static boolean isSuccess(String statusCode, String temlateSuccessCode) { if(StringUtils.isEmpty(statusCode)) { return false; } if(StringUtils.isNotEmpty(temlateSuccessCode)) { return temlateSuccessCode.equalsIgnoreCase(statusCode); } // 如果没有配置模板状态码,则解析常量中所有成功状态码是否包含(后期改至REDIS) List<String> list = Arrays.asList(ExchangerConstant.SUCCESS_CODE_ARRAY); return list.contains(statusCode.trim().toLowerCase()); } public static void main(String[] args) { String result = "[{\"Rspcode\":0,\"Msg_Id\":\"28244007242246\",\"Mobile\":\"18368031231\"}]"; String format = "(\"Rspcode\":)(.*?)(,)(\"Msg_Id\":\")(.*?)(\",)(\"Mobile\":\")(.*?)(\")"; String position = "{\"mobile\":\"8\",\"statusCode\":\"2\",\"sid\":\"5\"}"; String successCode = "0"; List<ProviderSendResponse> list = parse(result, format, position, successCode); for(ProviderSendResponse p : list) { System.out.println(p.getMobile()); System.out.println(p.getMobile()); } // String str1 = "<?xml version='1.0' encoding='utf-8' ?><returnsms><statusbox><mobile>15821917717</mobile>" // + "<taskid>1212</taskid><status>10</status><receivetime>2011-12-02 22:12:11</receivetime>" // + "<errorcode>MK:0011</errorcode></statusbox><statusbox><mobile>15821917717</mobile>" // + "<taskid>1212</taskid><status>20</status><receivetime>2011-12-02 22:12:11</receivetime>" // + "<errorcode>DELIVRD</errorcode></statusbox></returnsms>"; // // String regex1 = "(<mobile>)(.*?)(</mobile>)(<taskid>)(.*?)(</taskid>)(<status>)(.*?)(</status>)"; // Pattern pattern = Pattern.compile(regex1); // Matcher matcher = pattern.matcher(str1); // while (matcher.find()) { // System.out.println("手机号:" + matcher.group(2)); // System.out.println("任务ID:" + matcher.group(5)); // System.out.println("响应状态:" + matcher.group(8)); // System.out.println("---------------------"); // } //// String str2 = "{\"Rets\": [\"{\"Rspcode\":0,\"Msg_Id\":\"114445276129660989\",\"Mobile\":\"18600000000\"},{\"Rspcode\":0,\"Msg_Id\":\"114445276129660991\",\"Mobile\":\"13910101010\"}]}"; // String str2 = "[{\"Rspcode\":0,\"Msg_Id\":\"27513552514463\",\"Mobile\":\"18368031231\"}]"; // //// String str2 = "[{\"Rspcode\":0,\"Msg_Id\":\"114445276129660989\",\"Mobile\":\"18600000000\"}]"; // System.out.println(str2); // String regex2 = "(\"Rspcode\":)(.*?)(,)(\"Msg_Id\":\")(.*?)(\",)(\"Mobile\":\")(.*?)(\")"; // // Pattern pattern2 = Pattern.compile(regex2); // Matcher matcher2 = pattern2.matcher(str2); // System.out.println(matcher2.groupCount()); // while (matcher2.find()) { // System.out.println("手机号:" + matcher2.group(2)); // System.out.println("任务ID:" + matcher2.group(5)); // System.out.println("响应状态:" + matcher2.group(8)); // System.out.println("---------------------"); // } // String str3 = "{\"Rets\":[{\"Rspcode\":1,\"Msg_Id\":\"\",\"Mobile\":\"\",\"Fee\":0}]}"; // System.out.println(str3); // String regex3 = "(\"Rspcode\":)(.*?)(,)(\"Msg_Id\":\")(.*?)(\",)(\"Mobile\":\")(.*?)(\")"; // Pattern pattern3 = Pattern.compile(regex3); // Matcher matcher3 = pattern3.matcher(str3); // System.out.println(matcher3.groupCount()); // while (matcher3.find()) { // System.out.println("手机号:" + matcher3.group(2)); // System.out.println("任务ID:" + matcher3.group(5)); // System.out.println("响应状态:" + matcher3.group(8)); // System.out.println("---------------------"); // } } }
[ "ying1_zheng@bestsign.cn" ]
ying1_zheng@bestsign.cn
b37fa0f8450b1068b555ab0df44f9e1c40db3b93
651cfec1a9b96587206afcf65746e32040d51611
/JavaIoProgramming/src/ch18/exam23/ObjectInputExample.java
824a31bb6ba6166ea6c979cc26e3bc89f73ca05c
[]
no_license
Jdongju/TestRepository
143967fc13e70cf3e69dc0ba31ddc4577fb1f664
f659ba3b39d044b7addbc7ac3ea258ed9ab528e2
refs/heads/master
2021-01-20T00:47:25.514692
2017-07-20T01:17:49
2017-07-20T01:17:49
89,189,022
0
0
null
null
null
null
UTF-8
Java
false
false
737
java
package ch18.exam23; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.ObjectInputStream; public class ObjectInputExample { public static void main(String[] args) throws FileNotFoundException, IOException, IOException, ClassNotFoundException { FileInputStream fis = new FileInputStream("src/ch18/exam23/Object.dat"); ObjectInputStream ois = new ObjectInputStream(fis); VVIP vvip = (VVIP) ois.readObject(); System.out.println(vvip.getMemberShipNo()); System.out.println(vvip.getName()); System.out.println(vvip.getAge()); System.out.println(vvip.getGrade()); ois.close(); fis.close(); } }
[ "dj9110@naver.com" ]
dj9110@naver.com
5752354830d4a8d89c0da187bc0590660893bf52
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project498/src/main/java/org/gradle/test/performance/largejavamultiproject/project498/p2491/Production49829.java
b02cf917d29c0dac4f4e43abf045ff434de853de
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,971
java
package org.gradle.test.performance.largejavamultiproject.project498.p2491; public class Production49829 { private Production49826 property0; public Production49826 getProperty0() { return property0; } public void setProperty0(Production49826 value) { property0 = value; } private Production49827 property1; public Production49827 getProperty1() { return property1; } public void setProperty1(Production49827 value) { property1 = value; } private Production49828 property2; public Production49828 getProperty2() { return property2; } public void setProperty2(Production49828 value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
3071b898bfe9bd6f0627030ff97e2d27813f0b8e
1767f84d95d227b3256957b93c619478f9576938
/module_base/src/main/java/com/leifeng/base/net/BaseSchedulers.java
7510144520174011bb47b022b720bcc23ae27aae
[]
no_license
leifeng1991/liufeng_module
fbd45b78bf2fd661c97a6bb00a4891adb79fc756
38bb5c4d6685d0f1a9c5d27a05cd6316f8c6eef0
refs/heads/master
2020-05-08T22:39:59.593736
2019-05-11T03:07:49
2019-05-11T03:07:49
180,969,963
0
0
null
null
null
null
UTF-8
Java
false
false
619
java
package com.leifeng.base.net; import io.reactivex.Observable; import io.reactivex.ObservableSource; import io.reactivex.ObservableTransformer; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; public class BaseSchedulers { public static <T> ObservableTransformer<T, T> compose() { return new ObservableTransformer<T, T>() { @Override public ObservableSource<T> apply(Observable<T> upstream) { return upstream.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()); } }; } }
[ "15036833790@163.com" ]
15036833790@163.com
55a85865138ebe3730f1a8d23536e4fc298138aa
c61b7330a6e6aaf25b1129a992190a83360404d1
/workspace_apidemo/AndExam4_1/src/andexam/ver4_1/c07_output/LinearGrad.java
8c12daa4817c570a1f098e119fc6994e92584e85
[]
no_license
mech12/dialogplayer
2e2335653243e4971d82c6560cae3b4fe7df7c28
102d163146daefa75a6a23b1fd36b2a04bf8f708
refs/heads/master
2016-09-05T09:29:08.505656
2015-03-13T10:29:51
2015-03-13T10:29:51
29,862,768
0
0
null
null
null
null
UTF-8
Java
false
false
1,970
java
package andexam.ver4_1.c07_output; import android.app.*; import android.content.*; import android.graphics.*; import android.graphics.Shader.TileMode; import android.os.*; import android.view.*; public class LinearGrad extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new MyView(this)); } class MyView extends View { public MyView(Context context) { super(context); } public void onDraw(Canvas canvas) { Paint Pnt = new Paint(); Pnt.setAntiAlias(true); int[] colors = { Color.RED, Color.GREEN, Color.BLUE, Color.YELLOW, Color.WHITE }; float[] pos = { 0.0f, 0.1f, 0.6f, 0.9f, 1.0f }; // 수평 Pnt.setShader(new LinearGradient(0,0,100,0, Color.BLUE, Color.WHITE, TileMode.CLAMP)); canvas.drawRect(0,0,100,100,Pnt); // 우하향 Pnt.setShader(new LinearGradient(110,0,210,100, Color.BLUE, Color.WHITE, TileMode.CLAMP)); canvas.drawRect(110,0,210,100,Pnt); // 우상향 Pnt.setShader(new LinearGradient(220,100,320,0, Color.BLUE, Color.WHITE, TileMode.CLAMP)); canvas.drawRect(220,0,320,100,Pnt); // 가장자리 반복 Pnt.setShader(new LinearGradient(0,0,100,0, Color.BLUE, Color.WHITE, TileMode.CLAMP)); canvas.drawRect(0,110,320,150,Pnt); // 무늬 반복 Pnt.setShader(new LinearGradient(0,0,100,0, Color.BLUE, Color.WHITE, TileMode.REPEAT)); canvas.drawRect(0,160,320,200,Pnt); // 무늬 반사 반복 Pnt.setShader(new LinearGradient(0,0,100,0, Color.BLUE, Color.WHITE, TileMode.MIRROR)); canvas.drawRect(0,210,320,250,Pnt); // 여러 가지 색상 균등 배치 Pnt.setShader(new LinearGradient(0,0,320,0, colors, null, TileMode.CLAMP)); canvas.drawRect(0,260,320,300,Pnt); // 여러 가지 색상 임의 배치 Pnt.setShader(new LinearGradient(0,0,320,0, colors, pos, TileMode.CLAMP)); canvas.drawRect(0,310,320,350,Pnt); } } }
[ "icandoit@blueark.com" ]
icandoit@blueark.com
801e6ef6a22162024e9e77eacd8b269026b20820
a4a2f08face8d49aadc16b713177ba4f793faedc
/flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStorageInstance.java
37754e02f1e2ca41a4560f49483c38b300ce2456
[ "BSD-3-Clause", "MIT", "OFL-1.1", "ISC", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
wyfsxs/blink
046d64afe81a72d4d662872c007251d94eb68161
aef25890f815d3fce61acb3d1afeef4276ce64bc
refs/heads/master
2021-05-16T19:05:23.036540
2020-03-27T03:42:35
2020-03-27T03:42:35
250,431,969
0
1
Apache-2.0
2020-03-27T03:48:25
2020-03-27T03:34:26
Java
UTF-8
Java
false
false
4,296
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.contrib.streaming.state; import org.apache.flink.runtime.state.BatchPutWrapper; import org.apache.flink.runtime.state.StateAccessException; import org.apache.flink.runtime.state.StorageInstance; import org.apache.flink.util.IOUtils; import org.apache.flink.util.Preconditions; import org.rocksdb.Checkpoint; import org.rocksdb.ColumnFamilyHandle; import org.rocksdb.RocksDB; import org.rocksdb.RocksDBException; import org.rocksdb.RocksIterator; import org.rocksdb.WriteOptions; import java.util.Map; /** * An implementation of {@link StorageInstance} which used {@code RocksDB} to store data. */ public class RocksDBStorageInstance implements StorageInstance, AutoCloseable { static final String SST_FILE_SUFFIX = ".sst"; /** * Our RocksDB database, this is used to store state. * The different k/v states that we have will have their own RocksDB instance and columnFamilyHandle. */ private final RocksDB db; private final ColumnFamilyHandle columnFamilyHandle; /** The write options to use in the states. We disable write ahead logging. */ private final WriteOptions writeOptions; /** * Create a RocksDBStorageInstance with the given {@link RocksDB} and {@link ColumnFamilyHandle} instance. * @param db The RocksDB instance the storage used. * @param columnFamilyHandle The ColumnFamilyHandle the storage used. */ public RocksDBStorageInstance( final RocksDB db, final ColumnFamilyHandle columnFamilyHandle, WriteOptions writeOptions) { this.db = Preconditions.checkNotNull(db); this.columnFamilyHandle = Preconditions.checkNotNull(columnFamilyHandle); this.writeOptions = Preconditions.checkNotNull(writeOptions); } public ColumnFamilyHandle getColumnFamilyHandle() { return this.columnFamilyHandle; } RocksDB getDb() { return db; } byte[] get(byte[] keyBytes) { try { return db.get(columnFamilyHandle, keyBytes); } catch (RocksDBException e) { throw new StateAccessException(e); } } void put(byte[] keyBytes, byte[] valueBytes) { try { db.put(columnFamilyHandle, writeOptions, keyBytes, valueBytes); } catch (RocksDBException e) { throw new StateAccessException(e); } } void multiPut(Map<byte[], byte[]> keyValueBytesMap) { try (RocksDBWriteBatchWrapper writeBatchWrapper = new RocksDBWriteBatchWrapper(db, writeOptions)) { for (Map.Entry<byte[], byte[]> entry : keyValueBytesMap.entrySet()) { writeBatchWrapper.put(columnFamilyHandle, entry.getKey(), entry.getValue()); } } catch (RocksDBException e) { throw new StateAccessException(e); } } void delete(byte[] keyBytes) { try { db.delete(columnFamilyHandle, writeOptions, keyBytes); } catch (RocksDBException e) { throw new StateAccessException(e); } } void merge(byte[] keyBytes, byte[] partialValueBytes) { try { db.merge(columnFamilyHandle, writeOptions, keyBytes, partialValueBytes); } catch (RocksDBException e) { throw new StateAccessException(e); } } RocksIterator iterator() { return db.newIterator(columnFamilyHandle); } void snapshot(String localCheckpointPath) throws RocksDBException { Checkpoint checkpoint = Checkpoint.create(db); checkpoint.createCheckpoint(localCheckpointPath); } @Override public void close() { IOUtils.closeQuietly(columnFamilyHandle); } @Override public BatchPutWrapper getBatchPutWrapper() { return new RocksDBBatchPutWrapper( new RocksDBWriteBatchWrapper(db, writeOptions), columnFamilyHandle); } }
[ "yafei.wang@transwarp.io" ]
yafei.wang@transwarp.io
e98d14bf3d5fefd1301ab7206a22bfb528a501e5
3ee3d7d109b0821b3961b3e501987375b2024067
/src/easy/LCP22.java
dbd42582d6eca0bc41cfc287e58d76c535eede55
[]
no_license
mahuatang/leetCodeTest
bee6cc9f5d824d9756872577f778575899fd20d1
6fcc9cfdf36dd7e93793193be68e98537c62a21f
refs/heads/master
2021-07-06T05:48:01.659968
2020-12-01T12:10:54
2020-12-01T12:10:54
205,353,897
0
0
null
null
null
null
UTF-8
Java
false
false
1,682
java
package easy; import java.util.ArrayList; import java.util.List; public class LCP22 { public static void main(String[] args) { int a = paintingPlan(1, 1); //System.out.println(); //System.out.println(getwokao(3, 9)); } public static int paintingPlan(int n, int k) { if (k == 0) { return 1; } if (n > k) { return 0; } if (n == k) { if (k == 1) { return 1; } return n * 2; } if (n * n == k) { return 1; } List<int[]> list = new ArrayList<>(); for (int i = 1; i <= k / n; i++) { for (int j = 0; i < n && j <= k / (n - i); j++) { if (i * n + j * (n - i) == k) { int[] arr = new int[2]; arr[0] = i; arr[1] = j; list.add(arr); } } } if (n == k) { return 1; } int result = 0; for (int[] a : list) { int x = a[0]; int y = a[1]; if (x == 0) { result += getwokao(y, n) * 2; } else if (y == 0) { result += getwokao(x, n) * 2; } else { result += getwokao(x, n) * getwokao(y, n); } } return result; } public static int getwokao(int x, int y) { int result = 1; int result2 = 1; while(x > 0) { result *= y; result2 *= x; y--; x--; } return result / result2; } }
[ "1" ]
1
fbe0c08cc7e384364c04ebde5681e861c327c79e
39f0eb5b00e571fbbf685d2726320ddb0d89cd89
/src/main/java/org/deeplearning4j/streaming/pipeline/kafka/BaseKafkaPipeline.java
f09d5885a48f22a00cdfb50506f0d6d41311d0dd
[]
no_license
smarthi/dl4j-streaming
d355cef4db29b123b7187de67e25de3caafb143f
3febcf3652826ed1d73357ceef0a3394d4173987
refs/heads/master
2021-01-16T21:37:27.483336
2016-07-28T03:11:55
2016-07-28T03:11:55
61,096,856
2
0
null
2016-06-14T06:16:58
2016-06-14T06:16:57
null
UTF-8
Java
false
false
4,248
java
package org.deeplearning4j.streaming.pipeline.kafka; import lombok.AllArgsConstructor; import lombok.Data; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.component.kafka.KafkaConstants; import org.apache.camel.impl.DefaultCamelContext; import org.apache.commons.net.util.Base64; import org.canova.api.writable.Writable; import org.deeplearning4j.streaming.conversion.dataset.RecordToDataSet; import org.deeplearning4j.streaming.conversion.ndarray.RecordToNDArray; import org.deeplearning4j.streaming.routes.CamelKafkaRouteBuilder; import org.deeplearning4j.streaming.serde.RecordSerializer; import java.util.Collection; import java.util.Random; import java.util.UUID; /** * A base kafka pieline that handles * connecting to kafka and consuming from a stream. * * @author Adam Gibson */ @Data @AllArgsConstructor public abstract class BaseKafkaPipeline<E,RECORD_CONVERTER_FUNCTION> { protected String kafkaTopic; protected String inputUri; protected String inputFormat; protected String kafkaBroker; protected String zkHost; protected CamelContext camelContext; protected String hadoopHome; protected String dataType; protected String sparkAppName = "canova"; protected int kafkaPartitions = 1; protected RECORD_CONVERTER_FUNCTION recordToDataSetFunction; protected int numLabels; protected E dataset; /** * Initialize the pipeline * setting up camel routes, * kafka,canova,and the * spark streaming DAG. * @throws Exception */ public void init() throws Exception { if (camelContext == null) camelContext = new DefaultCamelContext(); camelContext.addRoutes(new CamelKafkaRouteBuilder.Builder(). camelContext(camelContext) .inputFormat(inputFormat). topicName(kafkaTopic).camelContext(camelContext) .dataTypeUnMarshal(dataType) .inputUri(inputUri). kafkaBrokerList(kafkaBroker).processor(new Processor() { @Override public void process(Exchange exchange) throws Exception { Collection<Collection<Writable>> record = (Collection<Collection<Writable>>) exchange.getIn().getBody(); exchange.getIn().setHeader(KafkaConstants.KEY, UUID.randomUUID().toString()); exchange.getIn().setHeader(KafkaConstants.PARTITION_KEY, new Random().nextInt(kafkaPartitions)); byte[] bytes = new RecordSerializer().serialize(kafkaTopic, record); String base64 = Base64.encodeBase64String(bytes); exchange.getIn().setBody(base64, String.class); } }).build()); if(hadoopHome == null) hadoopHome = System.getProperty("java.io.tmpdir"); System.setProperty("hadoop.home.dir", hadoopHome); initComponents(); } /** * Start the camel context * used for etl * @throws Exception */ public void startCamel() throws Exception { camelContext.start(); } /** * Stop the camel context * used for etl * @throws Exception */ public void stopCamel() throws Exception { camelContext.stop(); } /** * Initialize implementation specific components */ public abstract void initComponents(); /** * Create the streaming result * @return the stream */ public abstract E createStream(); /** * Starts the streaming consumption */ public void startStreamingConsumption() { startStreamingConsumption(-1); } /** * Starts the streaming consumption * @param timeout how long to run consumption for (-1 for infinite) */ public abstract void startStreamingConsumption(long timeout); /** * Run the pipeline * @throws Exception */ public E run() throws Exception { // Start the computation startCamel(); dataset = createStream(); stopCamel(); return dataset; } }
[ "adam@skymind.io" ]
adam@skymind.io
a533921408f76f9b846c3558eed5b0a71e9c3aa6
5ecd15baa833422572480fad3946e0e16a389000
/framework/MCS-Open/subsystems/runtime/main/api/java/com/volantis/mcs/protocols/wml/WBSAXDissectionElementProcessor.java
8a4fefedf870d36de7bb0eb8e2a2c2087d7ff1de
[]
no_license
jabley/volmobserverce
4c5db36ef72c3bb7ef20fb81855e18e9b53823b9
6d760f27ac5917533eca6708f389ed9347c7016d
refs/heads/master
2021-01-01T05:31:21.902535
2009-02-04T02:29:06
2009-02-04T02:29:06
38,675,289
0
1
null
null
null
null
UTF-8
Java
false
false
3,847
java
/* This file is part of Volantis Mobility Server. Volantis Mobility Server is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Volantis Mobility Server is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Volantis Mobility Server.  If not, see <http://www.gnu.org/licenses/>. */ /* ---------------------------------------------------------------------------- * (c) Volantis Systems Ltd 2003. * ---------------------------------------------------------------------------- */ package com.volantis.mcs.protocols.wml; import com.volantis.mcs.dissection.dom.ElementType; import com.volantis.mcs.dom.Element; import com.volantis.mcs.dom.NodeAnnotation; import com.volantis.mcs.dom2wbsax.WBSAXElementProcessor; import com.volantis.mcs.dom2wbsax.WBSAXProcessorContext; import com.volantis.mcs.localization.LocalizationFactory; import com.volantis.mcs.wbdom.dissection.SpecialOpaqueElementStart; import com.volantis.mcs.wbsax.WBSAXException; import com.volantis.synergetics.log.LogDispatcher; /** * Element Processor which handles the special Dissection elements which * are present in the MCSDOM. * <p/> * It translates these from normal MCSDOM elements with strange names and a * dissection annotation in their <code>object</code> property, into WBDOM * elements with <code>OpaqueElementStarts</code> which contain the * dissection annotation. */ public class WBSAXDissectionElementProcessor extends WBSAXElementProcessor { /** * Used for logging */ private static final LogDispatcher logger = LocalizationFactory.createLogger( WBSAXDissectionElementProcessor.class); private final ElementType type; public WBSAXDissectionElementProcessor( WBSAXProcessorContext context, ElementType type) { super(context); this.type = type; } public void elementStart(Element element, boolean content) throws WBSAXException { if (logger.isDebugEnabled()) { logger.debug("Adding dissection element " + element.getName()); } NodeAnnotation attrs = (NodeAnnotation) element.getAnnotation(); SpecialOpaqueElementStart opaqueElementStart = new SpecialOpaqueElementStart(type, attrs); context.getContentHandler().startElement(opaqueElementStart, content); } } /* =========================================================================== Change History =========================================================================== $Log$ 18-Aug-05 9007/1 pduffin VBM:2005071209 Committing massive changes to the product to improve styling, specifically for layouts 05-May-05 8005/1 pduffin VBM:2005050404 Separated DOM from within runtime into its own subsystem, move concrete DOM objects out of API, replaced with interfaces and factories, removed pooling 11-Mar-05 7357/2 pcameron VBM:2005030906 Fixed node annotation for dissection 08-Dec-04 6416/3 ianw VBM:2004120703 New Build 08-Dec-04 6416/1 ianw VBM:2004120703 New Build 29-Nov-04 6232/5 doug VBM:2004111702 Refactored Logging framework 19-Feb-04 2789/3 tony VBM:2004012601 refactored localised logging to synergetics 12-Feb-04 2789/1 tony VBM:2004012601 Localised logging (and exceptions) 02-Oct-03 1469/4 geoff VBM:2003091701 Emulate Openwave-Style menus for non Openwave WML 1.2 protocols =========================================================================== */
[ "iwilloug@b642a0b7-b348-0410-9912-e4a34d632523" ]
iwilloug@b642a0b7-b348-0410-9912-e4a34d632523
091bfc4f0fecda47c288aa1da431670c34fb97b0
ec8e41bef30b8bfd7c11521f1ec6d95ba38761ff
/src/main/java/com/google/location/suplclient/asn1/supl2/lpp_ver12/GNSS_NavModelSatelliteList.java
f0f9d989dfb711781d1b298bc5500ec16ebc5682
[ "Apache-2.0" ]
permissive
coleHafner/supl-client-1
15b33ff32ddca3e2063a3b08c824e6d013877d6a
27f86068f89fbc04c64e90e3e1bc886e34cafca5
refs/heads/master
2020-08-10T03:44:23.565708
2019-10-11T21:38:40
2019-10-11T21:38:40
214,248,260
3
1
Apache-2.0
2019-10-10T17:45:58
2019-10-10T17:45:58
null
UTF-8
Java
false
false
3,672
java
// Copyright 2018 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in 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.google.location.suplclient.asn1.supl2.lpp_ver12; // Copyright 2008 Google Inc. All Rights Reserved. /* * This class is AUTOMATICALLY GENERATED. Do NOT EDIT. */ // // import com.google.location.suplclient.asn1.base.Asn1SequenceOf; import com.google.location.suplclient.asn1.base.Asn1Tag; import com.google.location.suplclient.asn1.base.BitStream; import com.google.location.suplclient.asn1.base.BitStreamReader; import com.google.common.collect.ImmutableList; import java.util.Collection; import javax.annotation.Nullable; /** * */ public class GNSS_NavModelSatelliteList extends Asn1SequenceOf<GNSS_NavModelSatelliteElement> { // private static final Asn1Tag TAG_GNSS_NavModelSatelliteList = Asn1Tag.fromClassAndNumber(-1, -1); public GNSS_NavModelSatelliteList() { super(); setMinSize(1); setMaxSize(64); } @Override @Nullable protected Asn1Tag getTag() { return TAG_GNSS_NavModelSatelliteList; } @Override protected boolean isTagImplicit() { return true; } public static Collection<Asn1Tag> getPossibleFirstTags() { if (TAG_GNSS_NavModelSatelliteList != null) { return ImmutableList.of(TAG_GNSS_NavModelSatelliteList); } else { return Asn1SequenceOf.getPossibleFirstTags(); } } /** * Creates a new GNSS_NavModelSatelliteList from encoded stream. */ public static GNSS_NavModelSatelliteList fromPerUnaligned(byte[] encodedBytes) { GNSS_NavModelSatelliteList result = new GNSS_NavModelSatelliteList(); result.decodePerUnaligned(new BitStreamReader(encodedBytes)); return result; } /** * Creates a new GNSS_NavModelSatelliteList from encoded stream. */ public static GNSS_NavModelSatelliteList fromPerAligned(byte[] encodedBytes) { GNSS_NavModelSatelliteList result = new GNSS_NavModelSatelliteList(); result.decodePerAligned(new BitStreamReader(encodedBytes)); return result; } @Override public GNSS_NavModelSatelliteElement createAndAddValue() { GNSS_NavModelSatelliteElement value = new GNSS_NavModelSatelliteElement(); add(value); return value; } @Override public Iterable<BitStream> encodePerUnaligned() { return super.encodePerUnaligned(); } @Override public Iterable<BitStream> encodePerAligned() { return super.encodePerAligned(); } @Override public void decodePerUnaligned(BitStreamReader reader) { super.decodePerUnaligned(reader); } @Override public void decodePerAligned(BitStreamReader reader) { super.decodePerAligned(reader); } @Override public String toString() { return toIndentedString(""); } public String toIndentedString(String indent) { StringBuilder builder = new StringBuilder(); builder.append("GNSS_NavModelSatelliteList = [\n"); final String internalIndent = indent + " "; for (GNSS_NavModelSatelliteElement value : getValues()) { builder.append(internalIndent) .append(value.toIndentedString(internalIndent)); } builder.append(indent).append("];\n"); return builder.toString(); } }
[ "tccyp@google.com" ]
tccyp@google.com
145b719df5f4770d1e29a1d3f95474da68698ad3
ef8ded94075aa86a3d032ca012b8c08b821d1837
/hexa.core/src/main/java/fr/lteconsulting/hexa/client/form/marshalls/CallbackIntegerMarshall.java
a90d1d725a255647f8c984383bafe2cbb7dde240
[ "MIT" ]
permissive
tool-recommender-bot/hexa.tools
d25a37491aecc7e5af7974431f77c3678b0e36a8
604c804901b1bb13fe10b3823cc4a639f8993363
refs/heads/master
2020-04-18T21:45:49.131803
2017-05-21T07:40:25
2017-05-21T07:40:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
852
java
package fr.lteconsulting.hexa.client.form.marshalls; import java.util.HashMap; import fr.lteconsulting.hexa.client.form.FormManager; import fr.lteconsulting.hexa.client.interfaces.IAsyncCallback; import com.google.gwt.json.client.JSONString; import com.google.gwt.json.client.JSONValue; import com.google.gwt.user.client.DOM; public class CallbackIntegerMarshall implements FormManager.Marshall<IAsyncCallback<Integer>> { String prefix = DOM.createUniqueId(); HashMap<String, IAsyncCallback<Integer>> map = new HashMap<String, IAsyncCallback<Integer>>(); public JSONValue get( IAsyncCallback<Integer> object ) { String key = prefix + "_" + DOM.createUniqueId(); map.put( key, object ); return new JSONString( key ); } public IAsyncCallback<Integer> get( JSONValue value ) { return map.get( value.isString().stringValue() ); } }
[ "ltearno@gmail.com" ]
ltearno@gmail.com
8b35959e2c3db9db5a85067703339d0db039f88c
08506438512693067b840247fa2c9a501765f39d
/Product/Production/Adapters/General/CONNECTDirectConfig/src/main/java/gov/hhs/fha/nhinc/directconfig/service/jaxws/DisassociateTrustBundleFromDomain.java
7034b18a3efa079f9a7edab189a6cb5262fd5f8c
[]
no_license
AurionProject/Aurion
2f577514de39e91e1453c64caa3184471de891fa
b99e87e6394ecdde8a4197b755774062bf9ef890
refs/heads/master
2020-12-24T07:42:11.956869
2017-09-27T22:08:31
2017-09-27T22:08:31
49,459,710
1
0
null
2017-03-07T23:24:56
2016-01-11T22:55:12
Java
UTF-8
Java
false
false
4,652
java
/* * Copyright (c) 2009-2014, United States Government, as represented by the Secretary of Health and Human Services. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above * copyright notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of the United States Government nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE UNITED STATES GOVERNMENT BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* Copyright (c) 2010, NHIN Direct Project All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the The NHIN Direct Project (nhindirect.org) nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package gov.hhs.fha.nhinc.directconfig.service.jaxws; 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; @XmlRootElement(name = "disassociateTrustBundleFromDomain", namespace = "http://nhind.org/config") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "disassociateTrustBundleFromDomain", namespace = "http://nhind.org/config", propOrder = { "domainId", "trustBundleId" }) public class DisassociateTrustBundleFromDomain { @XmlElement(name = "domainId", namespace = "") private long domainId; @XmlElement(name = "trustBundleId", namespace = "") private long trustBundleId; /** * * @return * returns long */ public long getDomainId() { return this.domainId; } /** * * @param domainId * the value for the domainId property */ public void setDomainId(long domainId) { this.domainId = domainId; } /** * * @return * returns long */ public long getTrustBundleId() { return this.trustBundleId; } /** * * @param trustBundleId * the value for the trustBundleId property */ public void setTrustBundleId(long trustBundleId) { this.trustBundleId = trustBundleId; } }
[ "neilkwebb@hotmail.com" ]
neilkwebb@hotmail.com
b644ac9dec4ae574a2638c9539802eae740f0bfb
22e538e3fb95f3e994dd5f9390b7340257fdb917
/src/main/java/com/example/arcfaceserver/product/facetool/FaceUtilFactory.java
021cc3525979e2992ebcc16fdf4a76a8ac63e73a
[]
no_license
kendankendan/Web_FaceSearchServer
ffa245555f4180197969f24c8ede7bd3c67cdbc3
22c13a49dbd6d7f967a39e1077859ebd09e67fb2
refs/heads/master
2022-11-11T18:35:18.262667
2019-08-26T11:13:44
2019-08-26T11:13:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,890
java
package com.example.arcfaceserver.product.facetool; import com.example.arcfaceserver.product.beans.Vender; import java.util.HashMap; /** * 人脸识别工具类产生工厂 */ public class FaceUtilFactory { /** * 保存每个厂家的示例 享元模式 */ private static HashMap<String, IFaceUtil> faceUtilHashMap = new HashMap<>(); /** * 产生对应厂商的工具实例 * * @param vender * @return */ public static IFaceUtil getFaceUtil(String vender) { // 从内存中获取 if (faceUtilHashMap.get(vender) != null) { return faceUtilHashMap.get(vender); } // 创建 IFaceUtil faceUtil = null; if (vender.equals(Vender.ARCSOFT)) { faceUtil = new ArcFaceUtil(); faceUtilHashMap.put(vender, faceUtil); } else if (vender.equals(Vender.BAIDU)) { faceUtil = getDefault(); faceUtilHashMap.put(vender, faceUtil); } else if (vender.equals(Vender.ALIBABA)) { faceUtil = getDefault(); faceUtilHashMap.put(vender, faceUtil); } else if (vender.equals(Vender.TENCENT)) { faceUtil = getDefault(); faceUtilHashMap.put(vender, faceUtil); } else if (vender.equals(Vender.MEGVII)) { faceUtil = getDefault(); faceUtilHashMap.put(vender, faceUtil); }else if (vender.equals(Vender.SENSETIME)) { faceUtil = getDefault(); faceUtilHashMap.put(vender, faceUtil); } else { // 未知厂商 默认先使用虹软 且不保存到内存 faceUtil = new ArcFaceUtil(); } return faceUtil; } /** * 在没有厂商的情况下默认返回 * * @return */ private static IFaceUtil getDefault() { return new ArcFaceUtil(); } }
[ "1501295534@qq.com" ]
1501295534@qq.com
81572db6ba2814423e97df34763188a8357ea4b6
bd2cefa52d33d6fb2afb78d14c45b2355be5e52c
/talaktome/src/test/java/com/talktomem/domain/ATest.java
b99b1711131f3b67ad61f06d9bbbc35b4dafbae1
[]
no_license
samstomedia/talktomeet
584399e6338d39123c9df9a91d8811705ce82a71
29f56aecd9e8d14f73c2e7a0ea27106a0c58329c
refs/heads/main
2023-04-14T17:37:55.381504
2021-04-18T17:59:25
2021-04-18T17:59:25
359,192,911
0
0
null
2021-04-18T17:59:26
2021-04-18T16:13:17
Java
UTF-8
Java
false
false
552
java
package com.talktomem.domain; import static org.assertj.core.api.Assertions.assertThat; import com.talktomem.web.rest.TestUtil; import org.junit.jupiter.api.Test; class ATest { @Test void equalsVerifier() throws Exception { TestUtil.equalsVerifier(A.class); A a1 = new A(); a1.setId(1L); A a2 = new A(); a2.setId(a1.getId()); assertThat(a1).isEqualTo(a2); a2.setId(2L); assertThat(a1).isNotEqualTo(a2); a1.setId(null); assertThat(a1).isNotEqualTo(a2); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
fb9962b6aa6c4a3bb593c312025d75dd6d63b9f7
a888206a0f6d1350288fd80d61d38ffbd0477dfd
/spring-mvc-basics/src/main/java/com/app/web/ProductsController.java
b61e8196a20b05f20108207f2767a474f920940b
[]
no_license
hemanthsavasere/amdocs-spring
01e0748f529ac92fc43b7566bbd225da735c6c2d
fa3b3f5654a308a72f927b5838aa76f03d629337
refs/heads/master
2020-07-03T13:03:52.296718
2018-11-16T12:53:05
2018-11-16T12:53:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,613
java
package com.app.web; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; @Controller public class ProductsController { // // @RequestMapping( // value = "/products", // method = RequestMethod.GET, // headers = { "my-header=my" }, // params= {"!limit"}) @GetMapping( value = "/products", headers = { "my-header=my" }, params= {"!limit"} ) public @ResponseBody String getAllv1() { return "url:/products, method:GET - ProductsController::getAllv1"; } @RequestMapping( value = "/products", method = RequestMethod.GET, params= {"limit"}) public @ResponseBody String getAllv2() { return "url:/products, method:GET - ProductsController::getAllv2"; } @RequestMapping(value = "/products", method = RequestMethod.GET, headers = { "my-header=yours" }) public @ResponseBody String getAllV3() { return "url:/products, method:GET - ProductsController::getAllv3"; } @RequestMapping(value = "/products", method = RequestMethod.GET,produces= {"application/xml"}) public @ResponseBody String getXML() { return "url:/products, method:GET - ProductsController::getXML response payload"; } @RequestMapping(value = "/products", method = RequestMethod.POST,consumes= {"application/json"}) public @ResponseBody String save() { return "url:/products, method:POST - ProductsController::save with JSON request payload"; } }
[ "nagabhushanamn@gmail.com" ]
nagabhushanamn@gmail.com
64c20d2b2627c1c2be8e521516ffd433eb532d72
6ed05610a0fc7a86afe52267fc2570abc272dd4a
/openapi-parser/src/main/java/org/wapache/openapi/v3/parser/core/models/ParseOptions.java
f15fcf118f22833c3edf3d9f40647c9fafc03646
[ "Apache-2.0" ]
permissive
Zjd12138/wapadoc
f2226fc93bbcac98d59812c3a404121c31dcb0d9
ae258cd5d719ce3d5e0a45210bfae7182c229940
refs/heads/master
2023-03-01T13:57:51.909077
2021-02-07T04:05:03
2021-02-07T04:05:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,660
java
package org.wapache.openapi.v3.parser.core.models; public class ParseOptions { private boolean resolve; private boolean resolveCombinators = true; private boolean resolveFully; private boolean flatten; private boolean flattenComposedSchemas; private boolean camelCaseFlattenNaming; private boolean skipMatches; public boolean isResolve() { return resolve; } public void setResolve(boolean resolve) { this.resolve = resolve; } public boolean isResolveCombinators() { return resolveCombinators; } public void setResolveCombinators(boolean resolveCombinators) { this.resolveCombinators = resolveCombinators; } public boolean isResolveFully() { return resolveFully; } public void setResolveFully(boolean resolveFully) { this.resolveFully = resolveFully; } public boolean isFlatten() { return flatten; } public void setFlatten(boolean flatten) { this.flatten = flatten; } public boolean isSkipMatches() { return skipMatches; } public void setSkipMatches(boolean skipMatches) { this.skipMatches = skipMatches; } public boolean isFlattenComposedSchemas() { return flattenComposedSchemas; } public void setFlattenComposedSchemas(boolean flattenComposedSchemas) { this.flattenComposedSchemas = flattenComposedSchemas; } public boolean isCamelCaseFlattenNaming() { return camelCaseFlattenNaming; } public void setCamelCaseFlattenNaming(boolean camelCaseFlattenNaming) { this.camelCaseFlattenNaming = camelCaseFlattenNaming; } }
[ "ykuang@wapache.org" ]
ykuang@wapache.org
ed1e2f21bda9b82a89eabe89fb1060703a08869e
32363f69e1af64121a8548b61a583f49722ea391
/observer-java/src/br/com/fiap/aop/impl/HexObserver.java
80648471b0d84643effd11089ab0a73e6734a1f7
[]
no_license
BGCX067/faculdade-fiap-pos-svn-to-git
ae79934e72e4ddccd682f2f84e969db87c52ca5d
9753778b4ada2560ee110bd64e7f9363c54aa4d1
refs/heads/master
2016-09-01T08:56:36.706564
2015-12-28T14:11:28
2015-12-28T14:11:28
48,871,352
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package br.com.fiap.aop.impl; import br.com.fiap.aop.Observer; import br.com.fiap.aop.Subject; public class HexObserver extends Observer { public HexObserver(Subject s) { subj = s; subj.attach(this); } @Override public void update() { System.out.println(String.format("Número Hexadecimal: %s", Integer.toHexString(subj.getState()))); } }
[ "you@example.com" ]
you@example.com
93fde27ef6b233ca7800d0c2262d1d9519764a92
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/34/34_c16704f8241a3d55850f02fc26f81f4f2aad9a5f/I18nContentPlugin/34_c16704f8241a3d55850f02fc26f81f4f2aad9a5f_I18nContentPlugin_s.java
20f74c4c7b98c049ec07d65a08cbedb98036d286
[]
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,611
java
package org.bladerunnerjs.plugin.plugins.bundlers.i18n; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import org.bladerunnerjs.model.Asset; import org.bladerunnerjs.model.BRJS; import org.bladerunnerjs.model.BundleSet; import org.bladerunnerjs.model.ParsedContentPath; import org.bladerunnerjs.model.exception.request.BundlerProcessingException; import org.bladerunnerjs.plugin.base.AbstractContentPlugin; import org.bladerunnerjs.utility.ContentPathParser; import org.bladerunnerjs.utility.ContentPathParserBuilder; public class I18nContentPlugin extends AbstractContentPlugin { private static final String LANGUAGE_BUNDLE = "language-bundle"; private static final String LANGUAGE_AND_LOCATION_BUNDLE = "language-and-location-bundle"; private static final String LANGUAGE_PROPERTY_NAME = "language"; private static final String LOCATION_PROPERTY_NAME = "location"; private static final String NEWLINE = "\n"; private static final String QUOTE = "\""; private ContentPathParser contentPathParser; { ContentPathParserBuilder contentPathParserBuilder = new ContentPathParserBuilder(); contentPathParserBuilder .accepts("i18n/<language>.json").as(LANGUAGE_BUNDLE) .and("i18n/<language>_<location>.json").as(LANGUAGE_AND_LOCATION_BUNDLE) .where(LANGUAGE_PROPERTY_NAME).hasForm("[a-z]{2}") .and(LOCATION_PROPERTY_NAME).hasForm("[A-Z]{2}"); contentPathParser = contentPathParserBuilder.build(); } @Override public void setBRJS(BRJS brjs) { } @Override public void close() { } @Override public String getRequestPrefix() { return "i18n"; } @Override public String getGroupName() { return null; } @Override public ContentPathParser getContentPathParser() { return contentPathParser; } @Override public void writeContent(ParsedContentPath contentPath, BundleSet bundleSet, OutputStream os) throws BundlerProcessingException { if (contentPath.formName.equals(LANGUAGE_BUNDLE)) { generateBundleForLocale(bundleSet, os, contentPath.properties.get(LANGUAGE_PROPERTY_NAME), ""); } else if (contentPath.formName.equals(LANGUAGE_AND_LOCATION_BUNDLE)) { generateBundleForLocale(bundleSet, os, contentPath.properties.get(LANGUAGE_PROPERTY_NAME), contentPath.properties.get(LOCATION_PROPERTY_NAME)); } else { throw new BundlerProcessingException("unknown request form '" + contentPath.formName + "'."); } } @Override public List<String> getValidDevContentPaths(BundleSet bundleSet, String... locales) throws BundlerProcessingException { for (String locale : locales) { } return Arrays.asList(); } @Override public List<String> getValidProdContentPaths(BundleSet bundleSet, String... locales) throws BundlerProcessingException { return getValidDevContentPaths(bundleSet, locales); } private void generateBundleForLocale(BundleSet bundleSet, OutputStream os, String language, String location) throws BundlerProcessingException { Map<String,String> propertiesMap = new HashMap<String,String>(); for (Asset asset : getOrderedI18nAssetFiles(bundleSet)) { addI18nProperties(propertiesMap, language, location, (I18nAssetFile) asset); } writePropertiesMapToOutput(propertiesMap, os); } private void addI18nProperties(Map<String,String> propertiesMap, String language, String location, I18nAssetFile i18nFile) throws BundlerProcessingException { if ( i18nFile.getLocaleLanguage().equals(language) && (i18nFile.getLocaleLocation().equals("") || i18nFile.getLocaleLocation().equals(location)) ) { try { propertiesMap.putAll( i18nFile.getLocaleProperties() ); } catch (IOException ex) { throw new BundlerProcessingException(ex, "Error getting locale properties from file"); } } } private void writePropertiesMapToOutput(Map<String, String> propertiesMap, OutputStream os) { PrintWriter writer = new PrintWriter(os); StringBuilder output = new StringBuilder(); output.append("{"+NEWLINE); for (String key : propertiesMap.keySet()) { String value = propertiesMap.get(key); output.append(QUOTE+key+QUOTE+":"+QUOTE+value+QUOTE+","+NEWLINE); } if (propertiesMap.size() > 0) { output.deleteCharAt( output.length() - 2 ); /* delete the last comma */ } output.append("};"); writer.write(output.toString()); writer.flush(); } private List<I18nAssetFile> getOrderedI18nAssetFiles(BundleSet bundleSet) { List<I18nAssetFile> languageOnlyAssets = new ArrayList<I18nAssetFile>(); List<I18nAssetFile> languageAndLocationAssets = new ArrayList<I18nAssetFile>(); for (Asset asset : bundleSet.getResourceFiles("properties")) { if (asset instanceof I18nAssetFile) { I18nAssetFile i18nAsset = (I18nAssetFile) asset; if (i18nAsset.getLocaleLanguage().length() > 0 && i18nAsset.getLocaleLocation().length() > 0) { languageAndLocationAssets.add(i18nAsset); } else if (i18nAsset.getLocaleLanguage().length() > 0) { languageOnlyAssets.add(i18nAsset); } } } List<I18nAssetFile> orderedI18nAssets = new LinkedList<I18nAssetFile>(); orderedI18nAssets.addAll(languageOnlyAssets); orderedI18nAssets.addAll(languageAndLocationAssets); return orderedI18nAssets; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9e60f3d2e33ad5d93def5cf530936036d54eba4a
fde6554ca633848334099d6a3fdc9788dc192ffa
/app/src/main/java/net/suntrans/zhanshi/activity/EnergyAnalysisActivity.java
ff4b71b81f37d083a3d083067229cfa7642f7079
[]
no_license
luping1994/Zhanshi
3dff041977e02a3f00a78650630f446a30ecbcbd
19b19eeb27c0ab883d4f5198952778297f81342e
refs/heads/master
2021-01-15T19:14:34.900137
2017-08-15T14:12:14
2017-08-15T14:12:14
99,814,948
0
0
null
null
null
null
UTF-8
Java
false
false
1,211
java
package net.suntrans.zhanshi.activity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.view.MenuItem; import net.suntrans.zhanshi.R; import net.suntrans.zhanshi.fragment.EnergyAnalysisFragment; import static net.suntrans.zhanshi.R.id.toolbar; /** * Created by Looney on 2017/7/26. */ public class EnergyAnalysisActivity extends BasedActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_fenxi); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar.setTitle("能耗分析"); setSupportActionBar(toolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } EnergyAnalysisFragment fragment = new EnergyAnalysisFragment(); getSupportFragmentManager().beginTransaction().replace(R.id.content,fragment).commit(); } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { finish(); } return super.onOptionsItemSelected(item); } }
[ "250384247@qq.com" ]
250384247@qq.com
5e5f1decfeb66633bff3d9d83eafd58f3747baa1
32eb433b3ef4ad11c3ccdad7f7566671d0f31604
/API-Banco-Digital-Zup/io.github.monthalcantara.repository/src/main/java/io/github/monthalcantara/repository/adapter/ClientePersistence.java
a154b7fa023371bb285463836261523e459c145d
[]
no_license
wfcosta/Repo-Estudo-POC-Treino
4bcfd69924c2ac92a87f3ae8d75f9a3b2f38289d
7e75e8e00f75e2bda3d7996fe4f38c1e835fed88
refs/heads/master
2023-05-27T13:59:50.419440
2021-06-15T09:21:34
2021-06-15T09:21:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package io.github.monthalcantara.repository.adapter; import org.springframework.stereotype.Repository; @Repository interface ClientePersistenceImpl { }
[ "montival_junior@yahoo.com.br" ]
montival_junior@yahoo.com.br
32cdc99edd6dc9bac19814828d209942dd4cb10e
2efce0a208bbf13942e9e8205da44ecfc4055e58
/Lab/设计模式/Lab-3/SingletonPattern/src/cn/csu/beans/Singleton.java
ffa066c7b28eedb485e088796d425b5f5d14c156
[]
no_license
ZanderYan-cloud/MyProject
8226c7f64469eb98df64b3c5e05c5e96601ad71d
11a451ae3f7bbe03e7ac710fe7c7eee2d1881fe7
refs/heads/master
2021-09-15T11:41:33.401772
2018-05-31T12:59:29
2018-05-31T12:59:29
104,723,868
1
0
null
null
null
null
UTF-8
Java
false
false
374
java
package cn.csu.beans; import java.io.Serializable; public class Singleton implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private static class InstanceHolder { private static Singleton instance = new Singleton(); } private Singleton() { } public static Singleton getInstance() { return InstanceHolder.instance; } }
[ "913010012@qq.com" ]
913010012@qq.com
315f524f9df0edffbed81eb131a8631deb193064
5a637cb8d14e58f0ee1ba640acddd0380df1d907
/src/ciknow/zk/survey/response/ContactChooserItem.java
b2c01575ed70584c345dc3929c6ed7fda926fd9d
[]
no_license
albedium/ciknow
b20e46c925d54c54e176b0df65e1a5a96385066b
57e401eb5ffa24181c7cb72e59fc0e7319cfc104
refs/heads/master
2021-01-21T01:17:55.683578
2012-09-26T18:27:03
2012-09-26T18:27:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,937
java
package ciknow.zk.survey.response; import ciknow.domain.Field; import ciknow.domain.Node; import ciknow.domain.Question; import ciknow.util.Constants; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * * @author gyao */ public class ContactChooserItem { public static final String IMAGE_KEY = "photo"; private static Log logger = LogFactory.getLog(ContactChooserItem.class); private Node contact; private boolean showImage; private LinkedHashMap<String, String> map; private boolean selected; public ContactChooserItem(Node contact, boolean showImage, LinkedHashMap<String, String> columns, Map<String, Question> questionMap) { this.contact = contact; this.showImage = showImage; map = new LinkedHashMap<String, String>(); if (showImage) { map.put(IMAGE_KEY, "images/photos/" + contact.getUsername() + ".jpg"); } // minimum display contact label map.put("label", contact.getLabel()); // custom columns for (String name : columns.keySet()) { if (name.equals("label")) { continue; } String value = null; if (name.equals("organization")) { value = contact.getOrganization(); } else if (name.equals("department")) { value = contact.getDepartment(); } else if (name.equals("unit")) { value = contact.getUnit(); } else if (name.equals("type")) { value = contact.getType(); } else if (name.equals("lastName")) { value = contact.getLastName(); } else if (name.equals("firstName")) { value = contact.getFirstName(); } else if (name.equals("city")) { value = contact.getCity(); } else if (name.equals("state")) { value = contact.getState(); } else if (name.equals("country")) { value = contact.getCountry(); } else if (name.equals("zipcode")) { value = contact.getZipcode(); } else if (name.startsWith("Q" + Constants.SEPERATOR)) { // choice (single) or multipleChoice question String shortName = name.substring(2); Question question = questionMap.get(shortName); for (Field field : question.getFields()) { String key = question.makeFieldKey(field); value = contact.getAttribute(key); if (value != null) { if (value.equals("1")) { value = field.getLabel(); } else { // this is for "Other" popup } break; } } if (value == null) { value = ""; // if no selection, set it as blank } } else { value = ""; logger.warn("Attribute '" + name + "' is not available."); } map.put(name, value); } } public Set<String> getColumns() { return map.keySet(); } public String getValue(String column) { return map.get(column); } public Node getContact() { return contact; } public boolean isShowImage() { return showImage; } public String getImageSource() { return getValue(IMAGE_KEY); } public boolean isSelected() { return selected; } public void setSelected(boolean selected) { this.selected = selected; } }
[ "yao.gyao@gmail.com" ]
yao.gyao@gmail.com
5a8f755f7462a383f7be608ff60bedd1aecd560e
cdc9a334996b0c933269b7aa8b39357c97176ca5
/java/service-buc/src/main/java/com/suneee/core/valid/ValidEnum.java
62c9ecbeb7f7f7fa5c2624d3dd40e8c23bf948f7
[]
no_license
lmr1109665009/oa
857c2729398f08f2094f47824f383cfa4d808ae6
21cf4bac10ab72520a1f0dfdd965b9378081823c
refs/heads/master
2020-05-16T10:39:51.316044
2019-04-23T10:13:26
2019-04-23T10:13:26
182,986,352
2
3
null
null
null
null
UTF-8
Java
false
false
993
java
package com.suneee.core.valid; /** * 验证枚举类。 * @author hotent * */ public enum ValidEnum { /** * 必填 */ required, /** * 最小长度 */ minlength, /** * 最大长度 */ maxlength, /** * 合法的数字(负数,小数) */ number, /** * 整数 */ digits, /** * 日期格式 */ date, /** * 信用卡 */ creditcard, /** * 电子邮件 */ email, /** * 网址 */ url, /** * 相等 */ equalTo, /** * 值的范围 */ range, /** * 长度范围 */ rangelength, /** * 最大值 */ max, /** * 最小值 */ min, /** * 正则表达式 */ regex, /** * 手机号码 */ mobile, /** * 电话号码 */ phone, /** * 邮政编码 */ zip, /** * qq号码 */ qq, /** * Ip地址 */ ip, /** * 中文 */ chinese, /** * 数字和字母 */ chrnum, /** * 验证开始结束时间 */ compStartEndTime, /** * 一组数字和上线 */ digitsSum }
[ "lmr1109665009@163.com" ]
lmr1109665009@163.com
96b9e1605ca9752743a6fe35a948bae0bbe931a8
08ecc4ce340148bf910332a007a7231f85f21b55
/load_local_image/android/app/src/main/java/github/nisrulz/loadlocalimage/MainActivity.java
7cfb25b39b02b16844b71f062d3783da6037fd81
[ "Apache-2.0" ]
permissive
wesleysfavarin/flutter-examples
6c408794f0abd2d84c28f2e31aa65a10f83ab1ed
d63c1f5636ab095d09552b2ec4d79b8dfae66325
refs/heads/master
2020-04-16T14:14:12.212961
2019-09-22T13:54:29
2019-09-22T13:54:29
165,659,808
4
0
Apache-2.0
2019-01-14T12:43:40
2019-01-14T12:43:40
null
UTF-8
Java
false
false
375
java
package github.nisrulz.loadlocalimage; import android.os.Bundle; import io.flutter.app.FlutterActivity; import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GeneratedPluginRegistrant.registerWith(this); } }
[ "nisrulz@gmail.com" ]
nisrulz@gmail.com
572455a863fdf1e8ae0e61b6b48683b2d513324f
fd5b4b1f1b5c58c14e81e77a394874301633700f
/week-8/rest-demo/src/main/java/com/tts/restdemo/controller/SimpleController.java
1238bbfce6f7d2ea9d800d80c11c154e1a0ac838
[ "MIT" ]
permissive
juliansarza/08-30-21-adv-java
a99454472f81b30cc9df2eefc571cdaefa7a3c4c
ec25a6583f92a8672c2fda541c9f03cbb0263298
refs/heads/main
2023-09-04T08:01:59.137717
2021-11-01T14:50:41
2021-11-01T14:50:41
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,145
java
package com.tts.restdemo.controller; import com.tts.restdemo.model.Greeting; import com.tts.restdemo.service.SimpleService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; import java.util.HashMap; import java.util.concurrent.atomic.AtomicLong; @RestController public class SimpleController { @Autowired SimpleService simpleService; private static final String template = "Hello, %s!"; private final AtomicLong counter = new AtomicLong(); @GetMapping("/greeting") public Greeting greeting( @RequestParam(value="name", defaultValue="World") String name) { return new Greeting( counter.incrementAndGet(), String.format(template, name)); } @GetMapping("/hello") public ResponseEntity<String> hello() { return new ResponseEntity<>("Hello World!", HttpStatus.NOT_FOUND); } @GetMapping("/teapot") public ResponseEntity<String> teapot() { return new ResponseEntity<>("Hello, I am a teapot", HttpStatus.I_AM_A_TEAPOT); } @GetMapping("/age") ResponseEntity<String> age(@RequestParam("yearOfBirth") int yearOfBirth) { if (simpleService.isInFuture(yearOfBirth)) { return new ResponseEntity<>( "Year of birth cannot be in the future", HttpStatus.BAD_REQUEST ); } return new ResponseEntity<>( "Your age is " + simpleService.calculateAge(yearOfBirth), HttpStatus.OK); } // TODO: implement a service for this business logic // private boolean isInFuture(int yearOfBirth) { // return yearOfBirth > 2021; // } // // private int calculateAge(int yearOfBirth) { // return 2021 - yearOfBirth; // } }
[ "lionel.beato@gmail.com" ]
lionel.beato@gmail.com
756b886b42e9b2a9886a5813eea963c53aaca217
144cbb5eb0ccbc29dbc6d2f3d4a68ba2ba8cbf0f
/leetcode/src/solutions/naming_a_company.java
5d7ada23efb77d0e244700230c0b977de88cd32f
[]
no_license
kwojcicki/coding_questions
3349359e16204b77a3504e8a84a84bb4353f889b
524487bca6751ddc74084281580a7f64934f96da
refs/heads/master
2023-09-01T15:45:31.446929
2023-08-22T04:19:11
2023-08-22T04:19:11
146,682,896
2
0
null
null
null
null
UTF-8
Java
false
false
881
java
package solutions; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; public class naming_a_company { public long distinctNames(String[] ideas) { long ret = 0; Map<Character, Set<String>> c = new HashMap<>(); for(String idea: ideas) { c.computeIfAbsent(idea.charAt(0), (k) -> new HashSet<>()) .add(idea.substring(1)); } for(char k1: c.keySet()) { for(char k2: c.keySet()) { if(k1 == k2) continue; Set<String> left = c.get(k1); Set<String> right = c.get(k2); long k1Count = left.stream().filter(i -> !right.contains(i)).count(); long k2Count = right.stream().filter(i -> !left.contains(i)).count(); ret += k1Count * k2Count; } } return ret; } }
[ "kwojcicki@sympatico.ca" ]
kwojcicki@sympatico.ca
c6dc88c7656bf68b45d26bcf861ed1ead321c86b
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module502/src/main/java/module502packageJava0/Foo947.java
74b903ffc9c4b3657cdf2e4939630c10057ab5fe
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
820
java
package module502packageJava0; import java.lang.Integer; public class Foo947 { Integer int0; Integer int1; Integer int2; public void foo0() { new module502packageJava0.Foo946().foo15(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } public void foo6() { foo5(); } public void foo7() { foo6(); } public void foo8() { foo7(); } public void foo9() { foo8(); } public void foo10() { foo9(); } public void foo11() { foo10(); } public void foo12() { foo11(); } public void foo13() { foo12(); } public void foo14() { foo13(); } public void foo15() { foo14(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
07671e16e0478f8827342abf3069d0d18c19123a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_b291f514b748e32d4936295d53d7ad1b5f02fcbf/InteriorNodeCursor/2_b291f514b748e32d4936295d53d7ad1b5f02fcbf_InteriorNodeCursor_t.java
fe41d0dd7eb9f9d25239e1a4c97593e4cd01a9dc
[]
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
6,951
java
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: BTree.java * * Copyright (c) 2009 Sun Microsystems and Static Free Software * * Electric(tm) is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Electric(tm) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Electric(tm); see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, Mass 02111-1307, USA. */ package com.sun.electric.tool.btree; import java.io.*; import java.util.*; import com.sun.electric.tool.btree.unboxed.*; /** * Page format: * * int: pageid of parent (root points to self) * int: number of buckets * * int: pageid of first bucket * S: summary of first bucket * repeat * int: number of values in (N-1)^th bucket * key: least key in N^th bucket * int: pageid of N^th bucket * S: summary of N^th bucket * * The arrangement above was chosen to deliberately avoid tracking * the number of values in the last bucket. This ensures that we * can append new values to the last bucket of the rightmost leaf * without touching any interior nodes (unless we're forced to * split, of course, but if the pages are large enough that doesn't * happen very often). This maintains the O(1)-unless-we-split * fastpath for appends while still keeping enough interior data to * perform ordinal queries. * * Note that we still need to keep the summary for the last bucket, * because we don't know as much about its semantics. This is just * one of the reasons why "number of values below here" is computed * separately rather than being part of the summary monoid. */ class InteriorNodeCursor <K extends Serializable & Comparable, V extends Serializable, S extends Serializable> extends NodeCursor<K,V,S> { private final int INTERIOR_HEADER_SIZE; private final int INTERIOR_ENTRY_SIZE; private final int INTERIOR_MAX_BUCKETS; private final int SIZEOF_SUMMARY; private int numbuckets; // just a cache public InteriorNodeCursor(BTree<K,V,S> bt) { super(bt); this.SIZEOF_SUMMARY = bt.monoid==null ? 0 : bt.monoid.getSize(); this.INTERIOR_HEADER_SIZE = 2*SIZEOF_INT; this.INTERIOR_ENTRY_SIZE = bt.uk.getSize() + SIZEOF_SUMMARY + SIZEOF_INT + SIZEOF_INT; this.INTERIOR_MAX_BUCKETS = ((ps.getPageSize()-INTERIOR_HEADER_SIZE-SIZEOF_INT-this.SIZEOF_SUMMARY) / INTERIOR_ENTRY_SIZE); } /** * Creates a new bucket for a child at index "idx" by shifting over * the child previously in that bucket (if any) and all after it. * Returns the offset in the buffer at which to write the least * key beneath the new child. */ public int insertNewBucketAt(int idx) { assert !isFull(); assert idx!=0; System.arraycopy(buf, INTERIOR_HEADER_SIZE + (idx-1)*INTERIOR_ENTRY_SIZE, buf, INTERIOR_HEADER_SIZE + idx*INTERIOR_ENTRY_SIZE, endOfBuf() - (INTERIOR_HEADER_SIZE + (idx-1)*INTERIOR_ENTRY_SIZE)); setNumBuckets(getNumBuckets()+1); return INTERIOR_HEADER_SIZE + idx*INTERIOR_ENTRY_SIZE - bt.uk.getSize(); } public static boolean isInteriorNode(byte[] buf) { return UnboxedInt.instance.deserializeInt(buf, 1*SIZEOF_INT)!=0; } public int getMaxBuckets() { return INTERIOR_MAX_BUCKETS; } public void initBuf(int pageid, byte[] buf) { super.setBuf(pageid, buf); } public int getParentPageId() { return bt.ui.deserializeInt(buf, 0*SIZEOF_INT); } public void setParentPageId(int pageid) { bt.ui.serializeInt(pageid, buf, 0*SIZEOF_INT); } public int getNumBuckets() { return numbuckets; } public void setNumBuckets(int num) { bt.ui.serializeInt(numbuckets = num, buf, 1*SIZEOF_INT); } public void setBuf(int pageid, byte[] buf) { assert pageid==-1 || isInteriorNode(buf); super.setBuf(pageid, buf); numbuckets = bt.ui.deserializeInt(buf, 1*SIZEOF_INT); } /** Initialize a new root node. */ public void initRoot(byte[] buf) { bt.rootpage = ps.createPage(); super.setBuf(bt.rootpage, buf); setParentPageId(bt.rootpage); setNumBuckets(1); } public boolean isFull() { return getNumBuckets() == getMaxBuckets(); } public boolean isLeafNode() { return false; } protected int endOfBuf() { return INTERIOR_HEADER_SIZE + getNumBuckets()*INTERIOR_ENTRY_SIZE - SIZEOF_SUMMARY - SIZEOF_INT; } public int getBucketPageId(int idx) { return bt.ui.deserializeInt(buf, INTERIOR_HEADER_SIZE+INTERIOR_ENTRY_SIZE*idx); } public void setBucketPageId(int idx, int pageid) { bt.ui.serializeInt(pageid, buf, INTERIOR_HEADER_SIZE+INTERIOR_ENTRY_SIZE*idx); } public int getNumValsBelowBucket(int idx) { assert idx>=0 && idx<getNumBuckets()-1; return bt.ui.deserializeInt(buf, INTERIOR_HEADER_SIZE+SIZEOF_INT+SIZEOF_SUMMARY+INTERIOR_ENTRY_SIZE*idx); } public void setNumValsBelowBucket(int idx, int num) { if (num==getNumBuckets()-1) return; assert idx>=0 && idx<getNumBuckets()-1; bt.ui.serializeInt(num, buf, INTERIOR_HEADER_SIZE+SIZEOF_INT+SIZEOF_SUMMARY+INTERIOR_ENTRY_SIZE*idx); } public int compare(byte[] key, int key_ofs, int keynum) { if (keynum<=0) return 1; if (keynum>=getNumBuckets()) return -1; return bt.uk.compare(key, key_ofs, buf, INTERIOR_HEADER_SIZE + keynum*INTERIOR_ENTRY_SIZE - bt.uk.getSize()); } protected void scoot(byte[] oldbuf, int endOfBuf) { int len = INTERIOR_HEADER_SIZE + INTERIOR_ENTRY_SIZE*(getMaxBuckets()/2); System.arraycopy(oldbuf, len, buf, INTERIOR_HEADER_SIZE, endOfBuf - len); } public void getKey(int keynum, byte[] key, int key_ofs) { System.arraycopy(buf, INTERIOR_HEADER_SIZE + keynum*INTERIOR_ENTRY_SIZE - bt.uk.getSize(), key, key_ofs, bt.uk.getSize()); } public int numValuesBelowBucket(int bucket) { if (bucket==0) return 0; if (bucket>=getNumBuckets()) return 0; throw new RuntimeException("not implemented"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b64ae3b63c28e78a971dc9c7254fe45f893bc663
1db07f5643b062a6f4642428aa5caf307b07f3f3
/neo4j-spring/neo4j-spring-data/src/main/java/org/jackzeng/neo4j/data/constant/SingleFieldEnum.java
5c33eade3a2a9dd83d4b2f79720b9f028b57355e
[]
no_license
tracyzhu2014/JavaHub
b6d6c4e95bd1e6ca3849d989e9cd2c1aa53416fb
4b66e2a6ee9f8d3bb433490f259d534ccce67a97
refs/heads/master
2023-05-07T22:23:03.545452
2020-12-18T01:57:44
2020-12-18T01:57:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
154
java
package org.jackzeng.neo4j.data.constant; /** * @author xijin.zeng created on 2018/5/10 */ public enum SingleFieldEnum { ONE, TWO, THREE }
[ "zengxijin@qq.com" ]
zengxijin@qq.com
0306c0ea828c6f87a66ba4a7b4d5afdb516b74aa
d4acae559f4bad3217cadb7ddefcde2bc8fba472
/src/main/java/io/extoken/web/rest/vm/LoggerVM.java
4567f1b17e4d80b9688015d355cfd0730d485018
[]
no_license
quanhm82/extoken
df1887136ec1e5cc08587cfeced08cdcab3807a6
b292b6db88f66db6e1aaa9919f110485cfe4965a
refs/heads/master
2021-08-27T22:27:00.909121
2017-12-10T15:12:56
2017-12-10T15:12:56
113,759,862
0
0
null
null
null
null
UTF-8
Java
false
false
878
java
package io.extoken.web.rest.vm; import ch.qos.logback.classic.Logger; /** * View Model object for storing a Logback logger. */ public class LoggerVM { private String name; private String level; public LoggerVM(Logger logger) { this.name = logger.getName(); this.level = logger.getEffectiveLevel().toString(); } public LoggerVM() { // Empty public constructor used by Jackson. } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLevel() { return level; } public void setLevel(String level) { this.level = level; } @Override public String toString() { return "LoggerVM{" + "name='" + name + '\'' + ", level='" + level + '\'' + '}'; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
567cd8224b87b1b330c20d5c167e80f8d8d8d11a
dde9583c185f3a1574045e15989503f5edb1ac7e
/src/main/java/com/eugene/javacore/practic3/templateMethod/Shop.java
05abb15d6edffa140bddf5802bc8257370ee5eb6
[]
no_license
Darkger/ChaptersShildt
06c355af3ca308b7c7aa21c61383d761e10af8b1
4ab413c301b7e577269ea3fcd4ec5ea8aec016f6
refs/heads/master
2023-01-03T21:06:38.828058
2020-10-26T02:50:55
2020-10-26T02:50:55
288,323,754
0
0
null
null
null
null
UTF-8
Java
false
false
247
java
package com.eugene.javacore.practic3.templateMethod; public abstract class Shop { public void showcase(){ System.out.println("Showcase:"); product(); System.out.println(); } public abstract void product(); }
[ "borninger@yandex.ru" ]
borninger@yandex.ru
87691c61b54e29a9dd0b55737b3d212198f3abb4
013e83b707fe5cd48f58af61e392e3820d370c36
/spring-jdbc/src/main/java/org/springframework/jdbc/SQLWarningException.java
516fdfd2af2ae3144bcec9847f72cad6f6b694a5
[]
no_license
yuexiaoguang/spring4
8376f551fefd33206adc3e04bc58d6d32a825c37
95ea25bbf46ee7bad48307e41dcd027f1a0c67ae
refs/heads/master
2020-05-27T20:27:54.768860
2019-09-02T03:39:57
2019-09-02T03:39:57
188,770,867
0
1
null
null
null
null
UTF-8
Java
false
false
807
java
package org.springframework.jdbc; import java.sql.SQLWarning; import org.springframework.dao.UncategorizedDataAccessException; /** * 当不忽略{@link java.sql.SQLWarning SQLWarnings}时抛出异常. * * <p>如果报告了SQLWarning, 则操作已完成, 因此如果我们在查看警告时不满意, 则需要明确回滚. * 我们可能会选择忽略 (并记录)警告, 或者将其包装并以此SQLWarningException的形式抛出. */ @SuppressWarnings("serial") public class SQLWarningException extends UncategorizedDataAccessException { /** * @param msg 详细信息 * @param ex JDBC警告 */ public SQLWarningException(String msg, SQLWarning ex) { super(msg, ex); } /** * 返回底层SQLWarning. */ public SQLWarning SQLWarning() { return (SQLWarning) getCause(); } }
[ "yuexiaoguang@vortexinfo.cn" ]
yuexiaoguang@vortexinfo.cn
5140b028a013c80064405ddc2da534a4234f4754
f577c99267dffb5591b7e933b57ecf94b8755724
/src/main/java/org/drip/validation/hypothesis/SignificanceTestOutcome.java
a3c869c99b1a486dd2a3e502bed22f9fc073ece7
[ "Apache-2.0" ]
permissive
MacroFinanceHub/DROP
18d59cf9fedbaf335e0feb890bcfbfe344c5dfa1
faa3d6469962d1420aef13863334104056d6047b
refs/heads/master
2023-03-17T07:06:26.438651
2021-03-14T04:59:56
2021-03-14T04:59:56
null
0
0
null
null
null
null
WINDOWS-1258
Java
false
false
6,902
java
package org.drip.validation.hypothesis; /* * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /*! * Copyright (C) 2020 Lakshmi Krishnamurthy * Copyright (C) 2019 Lakshmi Krishnamurthy * * This file is part of DROP, an open-source library targeting analytics/risk, transaction cost analytics, * asset liability management analytics, capital, exposure, and margin analytics, valuation adjustment * analytics, and portfolio construction analytics within and across fixed income, credit, commodity, * equity, FX, and structured products. It also includes auxiliary libraries for algorithm support, * numerical analysis, numerical optimization, spline builder, model validation, statistical learning, * and computational support. * * https://lakshmidrip.github.io/DROP/ * * DROP is composed of three modules: * * - DROP Product Core - https://lakshmidrip.github.io/DROP-Product-Core/ * - DROP Portfolio Core - https://lakshmidrip.github.io/DROP-Portfolio-Core/ * - DROP Computational Core - https://lakshmidrip.github.io/DROP-Computational-Core/ * * DROP Product Core implements libraries for the following: * - Fixed Income Analytics * - Loan Analytics * - Transaction Cost Analytics * * DROP Portfolio Core implements libraries for the following: * - Asset Allocation Analytics * - Asset Liability Management Analytics * - Capital Estimation Analytics * - Exposure Analytics * - Margin Analytics * - XVA Analytics * * DROP Computational Core implements libraries for the following: * - Algorithm Support * - Computation Support * - Function Analysis * - Model Validation * - Numerical Analysis * - Numerical Optimizer * - Spline Builder * - Statistical Learning * * Documentation for DROP is Spread Over: * * - Main => https://lakshmidrip.github.io/DROP/ * - Wiki => https://github.com/lakshmiDRIP/DROP/wiki * - GitHub => https://github.com/lakshmiDRIP/DROP * - Repo Layout Taxonomy => https://github.com/lakshmiDRIP/DROP/blob/master/Taxonomy.md * - Javadoc => https://lakshmidrip.github.io/DROP/Javadoc/index.html * - Technical Specifications => https://github.com/lakshmiDRIP/DROP/tree/master/Docs/Internal * - Release Versions => https://lakshmidrip.github.io/DROP/version.html * - Community Credits => https://lakshmidrip.github.io/DROP/credits.html * - Issues Catalog => https://github.com/lakshmiDRIP/DROP/issues * - JUnit => https://lakshmidrip.github.io/DROP/junit/index.html * - Jacoco => https://lakshmidrip.github.io/DROP/jacoco/index.html * * 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. */ /** * <i>SignificanceTestOutcome</i> contains the Results of the Significant Test of the Statistical Hypothesis. * * <br><br> * <ul> * <li> * Bhattacharya, B., and D. Habtzghi (2002): Median of the p-value under the Alternate Hypothesis * American Statistician 56 (3) 202-206 * </li> * <li> * Head, M. L., L. Holman, R, Lanfear, A. T. Kahn, and M. D. Jennions (2015): The Extent and * Consequences of p-Hacking in Science PLoS Biology 13 (3) e1002106 * </li> * <li> * Wasserstein, R. L., and N. A. Lazar (2016): The ASA’s Statement on p-values: Context, Process, * and Purpose American Statistician 70 (2) 129-133 * </li> * <li> * Wetzels, R., D. Matzke, M. D. Lee, J. N. Rouder, G, J, Iverson, and E. J. Wagenmakers (2011): * Statistical Evidence in Experimental Psychology: An Empirical Comparison using 855 t-Tests * Perspectives in Psychological Science 6 (3) 291-298 * </li> * <li> * Wikipedia (2019): p-value https://en.wikipedia.org/wiki/P-value * </li> * </ul> * * <br><br> * <ul> * <li><b>Module </b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ComputationalCore.md">Computational Core Module</a></li> * <li><b>Library</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/ModelValidationAnalyticsLibrary.md">Model Validation Analytics Library</a></li> * <li><b>Project</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/validation/README.md">Risk Factor and Hypothesis Validation, Evidence Processing, and Model Testing</a></li> * <li><b>Package</b> = <a href = "https://github.com/lakshmiDRIP/DROP/tree/master/src/main/java/org/drip/validation/hypothesis/README.md">Statistical Hypothesis Validation Test Suite</a></li> * </ul> * <br><br> * * @author Lakshmi Krishnamurthy */ public class SignificanceTestOutcome { private boolean _pass = false; private double _testStatistic = java.lang.Double.NaN; private double _leftTailPValue = java.lang.Double.NaN; private double _rightTailPValue = java.lang.Double.NaN; /** * SignificanceTestOutcome Constructor * * @param testStatistic Test Statistic * @param leftTailPValue Left Tail p-value * @param rightTailPValue Right Tail p-value * @param pass TRUE - Test successfully Passed * * @throws java.lang.Exception Thrown if the Inputs are Invalid */ public SignificanceTestOutcome ( final double testStatistic, final double leftTailPValue, final double rightTailPValue, final boolean pass) throws java.lang.Exception { if (!org.drip.numerical.common.NumberUtil.IsValid (_testStatistic = testStatistic) || !org.drip.numerical.common.NumberUtil.IsValid (_leftTailPValue = leftTailPValue) || !org.drip.numerical.common.NumberUtil.IsValid (_rightTailPValue = rightTailPValue)) { throw new java.lang.Exception ("SignificanceTestOutcome Constructor => Invalid Inputs"); } _pass = pass; } /** * Retrieve the Test Statistic * * @return The Test Statistic */ public double testStatistic() { return _testStatistic; } /** * Retrieve the Left Tail p-Value * * @return The Left Tail p-Value */ public double leftTailPValue() { return _leftTailPValue; } /** * Retrieve the Right Tail p-Value * * @return The Right Tail p-Value */ public double rightTailPValue() { return _rightTailPValue; } /** * Indicate of the Test has been successfully Passed * * @return TRUE - Test has been successfully Passed */ public boolean pass() { return _pass; } }
[ "lakshmimv7977@gmail.com" ]
lakshmimv7977@gmail.com
40324a1a5d1b82c63bbc75a5e69ea1854c105530
68a19507f18acff18aa4fa67d6611f5b8ac8913c
/hsl/hsl-pojo/src/main/java/hsl/pojo/command/line/CreateLineCommand.java
6589ca07a553b369a37e60d26230a39d2bcd7f21
[]
no_license
ksksks2222/pl-workspace
cf0d0be2dfeaa62c0d4d5437f85401f60be0eadd
6146e3e3c2384c91cac459d25b27ffeb4f970dcd
refs/heads/master
2021-09-13T08:59:17.177105
2018-04-27T09:46:42
2018-04-27T09:46:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,931
java
package hsl.pojo.command.line; import hg.common.component.BaseCommand; import hsl.pojo.dto.line.DateSalePriceDTO; import hsl.pojo.dto.line.LineBaseInfoDTO; import hsl.pojo.dto.line.LinePayInfoDTO; import hsl.pojo.dto.line.LinePictureFolderDTO; import hsl.pojo.dto.line.LineRouteInfoDTO; import java.util.List; /** * @类功能说明:新增线路command * @类修改者: * @修改日期:2015年1月30日上午9:26:10 * @修改说明: * @公司名称:浙江汇购科技有限公司 * @作者:chenxy * @创建时间:2015年1月30日上午9:26:10 * */ @SuppressWarnings("serial") public class CreateLineCommand extends BaseCommand{ /** * 基本信息 */ private LineBaseInfoDTO baseInfo; /** * 支付信息 */ private LinePayInfoDTO payInfo; /** * 路线信息 */ private LineRouteInfoDTO routeInfo; /** * 图片文件夹,列表 */ private List<LinePictureFolderDTO> folderList; /** * 价格日历,每日价格列表 */ private List<DateSalePriceDTO> dateSalePrice; public LineBaseInfoDTO getBaseInfo() { return baseInfo; } public void setBaseInfo(LineBaseInfoDTO baseInfo) { this.baseInfo = baseInfo; } public LinePayInfoDTO getPayInfo() { return payInfo; } public void setPayInfo(LinePayInfoDTO payInfo) { this.payInfo = payInfo; } public LineRouteInfoDTO getRouteInfo() { return routeInfo; } public void setRouteInfo(LineRouteInfoDTO routeInfo) { this.routeInfo = routeInfo; } public List<LinePictureFolderDTO> getFolderList() { return folderList; } public void setFolderList(List<LinePictureFolderDTO> folderList) { this.folderList = folderList; } public List<DateSalePriceDTO> getDateSalePrice() { return dateSalePrice; } public void setDateSalePrice(List<DateSalePriceDTO> dateSalePrice) { this.dateSalePrice = dateSalePrice; } }
[ "cangsong6908@gmail.com" ]
cangsong6908@gmail.com
71bd642c759d924549636ef310356119ce712978
538414f61a305cf84e00cbd0f2c154e4fa99ccb7
/src/org/openbravo/erpCommon/ad_callouts/SL_Production_Product.java
8b72fe8938d77613cf15342cbab1dd62b2df453d
[]
no_license
q3neeko/openz
4024d007ef2f1094faad8a8c17db8147e689d0f3
050ae0ba7b54ba9276a2fa85ecf5b2ec33954859
refs/heads/master
2020-03-29T21:44:56.783387
2018-09-26T14:34:00
2018-09-26T14:34:00
150,385,120
0
1
null
null
null
null
UTF-8
Java
false
false
7,961
java
/* ************************************************************************* * The contents of this file are subject to the Openbravo Public License * Version 1.0 (the "License"), being the Mozilla Public License * Version 1.1 with a permitted attribution clause; you may not use this * file except in compliance with the License. You may obtain a copy of * the License at http://www.openbravo.com/legal/license.html * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the * License for the specific language governing rights and limitations * under the License. * The Original Code is Openbravo ERP. * The Initial Developer of the Original Code is Openbravo SL * All portions are Copyright (C) 2001-2009 Openbravo SL * All Rights Reserved. * Contributor(s): ______________________________________. ************************************************************************ */ package org.openbravo.erpCommon.ad_callouts; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.openbravo.base.secureApp.HttpSecureAppServlet; import org.openbravo.base.secureApp.VariablesSecureApp; import org.openbravo.data.FieldProvider; import org.openbravo.erpCommon.utility.ComboTableData; import org.openbravo.erpCommon.utility.Utility; import org.openbravo.utils.FormatUtilities; import org.openbravo.xmlEngine.XmlDocument; public class SL_Production_Product extends HttpSecureAppServlet { private static final long serialVersionUID = 1L; public void init(ServletConfig config) { super.init(config); boolHist = false; } public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { VariablesSecureApp vars = new VariablesSecureApp(request); if (vars.commandIn("DEFAULT")) { String strChanged = vars.getStringParameter("inpLastFieldChanged"); if (log4j.isDebugEnabled()) log4j.debug("CHANGED: " + strChanged); String strProduct = vars.getStringParameter("inpmProductId"); // String strLocator = vars.getStringParameter("inpmLocatorId"); String strPLocator = vars.getStringParameter("inpmProductId_LOC"); String strPAttr = vars.getStringParameter("inpmProductId_ATR"); //String strPQty = vars.getNumericParameter("inpmProductId_PQTY"); String strPQty = ""; //String strPUOM = vars.getStringParameter("inpmProductId_PUOM"); String strPUOM = ""; String strQty = vars.getNumericParameter("inpmProductId_QTY"); String strUOM = vars.getStringParameter("inpmProductId_UOM"); String strTabId = vars.getStringParameter("inpTabId"); try { printPage(response, vars, strChanged, strProduct, strPLocator, strPAttr, strPQty, strPUOM, strQty, strUOM, strTabId); } catch (ServletException ex) { pageErrorCallOut(response); } } else pageError(response); } private void printPage(HttpServletResponse response, VariablesSecureApp vars, String strChanged, String strProduct, String strPLocator, String strPAttr, String strPQty, String strPUOM, String strQty, String strUOM, String strTabId) throws IOException, ServletException { if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet"); XmlDocument xmlDocument = xmlEngine.readXmlTemplate( "org/openbravo/erpCommon/ad_callouts/CallOut").createXmlDocument(); StringBuffer resultado = new StringBuffer(); resultado.append("var calloutName='SL_Production_Product';\n\n"); resultado.append("var respuesta = new Array("); resultado.append("new Array(\"inpcUomId\", \"" + strUOM + "\"),\n"); if (strPLocator.startsWith("\"")) strPLocator = strPLocator.substring(1, strPLocator.length() - 1); resultado.append("new Array(\"inpmLocatorId\", \"" + strPLocator + "\"),\n"); resultado.append("new Array(\"inpmLocatorId_R\", \"" + FormatUtilities.replaceJS(SLProductionProductData.selectLocator(this, strPLocator)) + "\"),\n"); String strHasSecondaryUOM = SLOrderProductData.hasSecondaryUOM(this, strProduct); resultado.append("new Array(\"inphasseconduom\", " + strHasSecondaryUOM + "),\n"); if (strPAttr.startsWith("\"")) strPAttr = strPAttr.substring(1, strPAttr.length() - 1); resultado.append("new Array(\"inpmAttributesetinstanceId\", \"" + strPAttr + "\"),\n"); resultado.append("new Array(\"inpmAttributesetinstanceId_R\", \"" + FormatUtilities.replaceJS(SLInOutLineProductData.attribute(this, strPAttr)) + "\"),\n"); resultado.append("new Array(\"inpmovementqty\", " + (strQty.equals("") ? "\"\"" : strQty) + "),\n"); resultado.append("new Array(\"inpquantityorder\", " + (strPQty.equals("") ? "\"\"" : strPQty) + "),\n"); if (strPUOM.startsWith("\"")) strPUOM = strPUOM.substring(1, strPUOM.length() - 1); resultado.append("new Array(\"inpmProductUomId\", "); if (vars.getLanguage().equals("en_US")) { FieldProvider[] tld = null; try { ComboTableData comboTableData = new ComboTableData(vars, this, "TABLE", "", "M_Product_UOM", "", Utility.getContext(this, vars, "#AccessibleOrgTree", "SLProductionProduct"), Utility.getContext(this, vars, "#User_Client", "SLProductionProduct"), 0); Utility.fillSQLParameters(this, vars, null, comboTableData, "SLProductionProduct", ""); tld = comboTableData.select(false); comboTableData = null; } catch (Exception ex) { throw new ServletException(ex); } if (tld != null && tld.length > 0) { resultado.append("new Array("); for (int i = 0; i < tld.length; i++) { resultado.append("new Array(\"" + tld[i].getField("id") + "\", \"" + FormatUtilities.replaceJS(tld[i].getField("name")) + "\", \"" + ((tld[i].getField("id").equals(strPUOM)) ? "true" : "false") + "\")"); if (i < tld.length - 1) resultado.append(",\n"); } resultado.append("\n)"); } else resultado.append("null"); resultado.append("\n),"); } else { FieldProvider[] tld = null; try { ComboTableData comboTableData = new ComboTableData(vars, this, "TABLE", "", "M_Product_UOM", "", Utility.getContext(this, vars, "#AccessibleOrgTree", "SLProductionProduct"), Utility.getContext(this, vars, "#User_Client", "SLProductionProduct"), 0); Utility.fillSQLParameters(this, vars, null, comboTableData, "SLProductionProduct", ""); tld = comboTableData.select(false); comboTableData = null; } catch (Exception ex) { throw new ServletException(ex); } if (tld != null && tld.length > 0) { resultado.append("new Array("); for (int i = 0; i < tld.length; i++) { resultado.append("new Array(\"" + tld[i].getField("id") + "\", \"" + FormatUtilities.replaceJS(tld[i].getField("name")) + "\", \"" + ((tld[i].getField("id").equals(strPUOM)) ? "true" : "false") + "\")"); if (i < tld.length - 1) resultado.append(",\n"); } resultado.append("\n)"); } else resultado.append("null"); resultado.append("\n),"); } resultado.append("new Array(\"EXECUTE\", \"displayLogic();\")\n"); resultado.append(");"); xmlDocument.setParameter("array", resultado.toString()); xmlDocument.setParameter("frameName", "appFrame"); response.setContentType("text/html; charset=UTF-8"); PrintWriter out = response.getWriter(); out.println(xmlDocument.print()); out.close(); } }
[ "neeko@gmx.de" ]
neeko@gmx.de
32b2cb18e0aa608fa287b6aa49ad37ecdfc58499
620c75f522d8650e87bf64b878ca0a7367623dda
/org.jebtk.modern/src/main/java/org/jebtk/modern/layers/LayerEventListeners.java
0601a90210f11eda2d68605d8b961e652dcc588b
[]
no_license
antonybholmes/jebtk-modern
539750965fcd0bcc9ee5ec3c371271c4dd2d4c08
04dcf905082052dd57890a056e647548e1222dff
refs/heads/master
2021-08-02T18:05:05.895223
2021-07-24T21:59:26
2021-07-24T21:59:26
100,538,521
0
0
null
null
null
null
UTF-8
Java
false
false
3,390
java
/** * Copyright (C) 2016, Antony Holmes * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of copyright holder nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package org.jebtk.modern.layers; import org.jebtk.core.event.ChangeEvent; import org.jebtk.core.event.EventProducer; /** * The basis for model controls in a model view controller setup. * * @author Antony Holmes */ public class LayerEventListeners extends EventProducer<LayerEventListener> implements LayerEventProducer { /** * The constant serialVersionUID. */ private static final long serialVersionUID = 1L; /* * (non-Javadoc) * * @see * org.abh.lib.ui.modern.layers.LayerEventProducer#addLayerListener(org.abh. * lib. ui.modern.layers.LayerEventListener) */ public void addLayerListener(LayerEventListener l) { mListeners.add(l); } /* * (non-Javadoc) * * @see org.abh.lib.ui.modern.layers.LayerEventProducer#removeLayerListener(org. * abh. lib.ui.modern.layers.LayerEventListener) */ public void removeLayerListener(LayerEventListener l) { mListeners.remove(l); } /** * Fire layer changed. */ public void fireLayerChanged() { fireLayerChanged(new ChangeEvent(this, LAYER_CHANGED)); } /** * Fire layer updated. */ public void fireLayerUpdated() { fireLayerUpdated(new ChangeEvent(this, LAYER_CHANGED)); } /* * (non-Javadoc) * * @see * org.abh.lib.ui.modern.layers.LayerEventProducer#fireLayerChanged(org.abh. * lib. event.ChangeEvent) */ public void fireLayerChanged(ChangeEvent e) { for (LayerEventListener l : mListeners) { l.layerChanged(e); } } /** * Fire layer updated. * * @param e the e */ public void fireLayerUpdated(ChangeEvent e) { for (LayerEventListener l : mListeners) { l.layerUpdated(e); } } }
[ "antony.b.holmes@gmail.com" ]
antony.b.holmes@gmail.com
b7a9ee2dc72cbe34ec7dac459c83d52e3d179fde
4e643854a9e29ff706536170e8c4ac626eab8d95
/src/main/java/be/Balor/Tools/Threads/CheckingBlockTask.java
b2491ff17226726cf8694387bd6ed66cbaad217b
[]
no_license
Belphemur/AdminCmd
4fddbd3b43ac84486b691be8202c521bb4cea81a
8e5c0e3af7c226a510e635aea84d1a0136fefd80
refs/heads/master
2021-01-13T02:06:48.308382
2014-05-30T20:11:17
2014-05-30T20:11:17
1,555,007
5
8
null
2014-05-30T20:09:14
2011-04-01T10:08:40
Java
UTF-8
Java
false
false
2,528
java
/************************************************************************ * This file is part of AdminCmd. * * AdminCmd is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * AdminCmd is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with AdminCmd. If not, see <http://www.gnu.org/licenses/>. ************************************************************************/ package be.Balor.Tools.Threads; import java.util.List; import java.util.concurrent.Semaphore; import org.bukkit.Material; import org.bukkit.block.Block; import be.Balor.Tools.SimplifiedLocation; /** * @author Balor (aka Antoine Aflalo) * */ public class CheckingBlockTask implements Runnable { private final Semaphore sema; private final List<SimplifiedLocation> okBlocks; private final Block block; private final int radius, limitY, limitX, limitZ; private final List<Material> mat; /** * @param sema * @param okBlocks * @param block * @param radius * @param limitY * @param limitX * @param limitZ * @param mat */ public CheckingBlockTask(final Semaphore sema, final List<SimplifiedLocation> okBlocks, final Block block, final int radius, final int limitY, final int limitX, final int limitZ, final List<Material> mat) { super(); this.sema = sema; this.okBlocks = okBlocks; this.block = block; this.radius = radius; this.limitY = limitY; this.limitX = limitX; this.limitZ = limitZ; this.mat = mat; } /* * (non-Javadoc) * * @see java.lang.Runnable#run() */ @Override public void run() { try { for (int y = block.getY() - radius; y <= limitY; y++) { for (int x = block.getX() - radius; x <= limitX; x++) { for (int z = block.getZ() - radius; z <= limitZ; z++) { if (!mat.contains(Material.getMaterial(block.getWorld() .getBlockTypeIdAt(x, y, z)))) { continue; } okBlocks.add(new SimplifiedLocation(block.getWorld(), x, y, z)); } } } } finally { sema.release(); } } }
[ "antoineaf@gmail.com" ]
antoineaf@gmail.com
46a28d7402fe4c61d7a1b83e1ab69151499d3571
19a8feef92bc49add7e21889a90ac0084052e65e
/dwbidiretor/dwbidiretor/src/main/java/br/com/dwbidiretor/classe/painel/Cliente_Ano.java
fac260c85695ea1e46f5624d95d82d40eaecff5e
[]
no_license
diegowvalerio/dw-bi
f71795a9cf836e35e5312d4ef77e6d3cc392bdc1
9407dda42b89625b34c725b20c8d98b27bbd1dce
refs/heads/master
2022-12-03T23:43:00.480504
2022-10-28T13:26:34
2022-10-28T13:26:34
180,370,668
0
0
null
2022-11-24T08:17:16
2019-04-09T13:15:57
JavaScript
UTF-8
Java
false
false
586
java
package br.com.dwbidiretor.classe.painel; import java.io.Serializable; import java.lang.String; import java.math.BigDecimal; import java.util.Date; public class Cliente_Ano implements Serializable { private static final long serialVersionUID = 1L; public BigDecimal clientes; public String ano; public Cliente_Ano() { super(); } public BigDecimal getClientes() { return clientes; } public void setClientes(BigDecimal clientes) { this.clientes = clientes; } public String getAno() { return ano; } public void setAno(String ano) { this.ano = ano; } }
[ "33626159+diegowvalerio@users.noreply.github.com" ]
33626159+diegowvalerio@users.noreply.github.com
81b733b384cce7cc73a5d750b3a110fab43e89d6
596c7846eabd6e8ebb83eab6b83d6cd0801f5124
/spring-cache/springboot2-cache-redis-cluster-jedis/src/main/java/com/github/bjlhx15/springcache/boot2/redis/pool/dao/UserDao.java
69dae134f16350edf2671c51d9319762d4cac0d8
[]
no_license
zzw0598/common
c219c53202cdb5e74a7c76d18f90e18eca983752
76abfb43c93da4090bbb8861d27bbcb990735b80
refs/heads/master
2023-03-10T02:30:44.310940
2021-02-19T07:59:16
2021-02-19T07:59:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
365
java
package com.github.bjlhx15.springcache.boot2.redis.pool.dao; import com.github.bjlhx15.springcache.boot2.redis.pool.entity.User; import org.springframework.stereotype.Repository; import java.util.Date; import java.util.Random; @Repository public class UserDao { public User queryUser() { return new User("zhangsan", new Random().nextInt(50),new Date()); } }
[ "lihongxu6@jd.com" ]
lihongxu6@jd.com
e1e1a376f1e05ef5015d0cc32b4f1e53f23d4f39
81cda372f9cc121da44014cea261cc638cc3ed1c
/src/game/gui/ReadyButton.java
51f76df92723843e3192f00a138a12d178600e2f
[]
no_license
aeris170/Admiral-is-on-Board
0bd3f3ff9bee15819c59291fe175f9fe1c52e0a1
aeecddfcb35bc0d5fc19e5f8e57df10ba6d208a3
refs/heads/master
2021-07-19T04:45:54.339698
2020-04-27T00:40:25
2020-04-27T00:40:25
141,910,724
3
0
null
2020-04-27T00:40:27
2018-07-22T16:07:56
Java
UTF-8
Java
false
false
1,986
java
package game.gui; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.RenderingHints; import game.Game; import game.player.Player; public final class ReadyButton extends CustomButton { private static final long serialVersionUID = 8679953310338283374L; private boolean ready; public ReadyButton(final Point location, final Dimension size) { super(); super.setLocation(location); super.setSize(size); addActionListener(e -> { final Game game = Game.get(); final Player player = Player.Player1; final Player enemy = Player.Player2; if (player.hasPlacedAllShips()) { player.markReady(); if (game.getServerGUI() != null) { game.getServerGUI().getAutoClient().getClient().sendBoolean(true); } else if (game.getClientGUI() != null) { game.getClientGUI().getClient().sendBoolean(true); } ready = true; if (player.isReady() && enemy.isReady()) { game.purgeReadyButton(); game.setGameState(Game.PLAYER_TURN); } } }); ready = false; } @Override public void paintComponent(final Graphics g) { final Graphics2D g2d = (Graphics2D) g; g2d.clearRect(0, 0, getWidth(), getHeight()); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2d.setStroke(GUIUtils.STROKE_3); g2d.setColor(GUIUtils.LIGHTER_RED); if (getModel().isRollover()) { g2d.setColor(GUIUtils.LIGHT_RED); } if (getModel().isPressed()) { if (ready) { g2d.setColor(GUIUtils.GREEN); } else { g2d.setColor(GUIUtils.RED); } } if (ready) { g2d.setColor(GUIUtils.GREEN); } g2d.fillRect(0, 0, getWidth(), getHeight()); g2d.setColor(GUIUtils.WHITE); g2d.setFont(GUIUtils.GEORGIA_BOLD_30); g2d.drawString("READY", 17, 50); } }
[ "aeris170@users.noreply.github.com" ]
aeris170@users.noreply.github.com
8c9e415d6e08ab2911cb3a5f5bb8b7e1b17e378c
c4f3762eca581ed3cd6d822f2358825ea8f46ba1
/library/ui/src/main/java/com/uiza/player/ext/ima/SinglePeriodAdTimeline.java
f85413b6bd40283a08f4d4d8bd52d898be1d2211
[ "Apache-2.0" ]
permissive
uizaio/deprecated-uiza-sdk-player-android
dbe22bdd309eeff5b5093023920e91e00d8538d3
0a1951af24fc33ebe849159cfce6958ff46f5567
refs/heads/master
2020-03-07T21:36:43.202220
2018-04-27T02:33:16
2018-04-27T02:33:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,159
java
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.uiza.player.ext.ima; import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.Timeline; import com.google.android.exoplayer2.util.Assertions; /** * A {@link Timeline} for sources that have ads. */ /* package */ final class SinglePeriodAdTimeline extends Timeline { private final Timeline contentTimeline; private final long[] adGroupTimesUs; private final int[] adCounts; private final int[] adsLoadedCounts; private final int[] adsPlayedCounts; private final long[][] adDurationsUs; private final long adResumePositionUs; /** * Creates a new timeline with a single period containing the specified ads. * * @param contentTimeline The timeline of the content alongside which ads will be played. It must * have one window and one period. * @param adGroupTimesUs The times of ad groups relative to the start of the period, in * microseconds. A final element with the value {@link C#TIME_END_OF_SOURCE} indicates that * the period has a postroll ad. * @param adCounts The number of ads in each ad group. An element may be {@link C#LENGTH_UNSET} * if the number of ads is not yet known. * @param adsLoadedCounts The number of ads loaded so far in each ad group. * @param adsPlayedCounts The number of ads played so far in each ad group. * @param adDurationsUs The duration of each ad in each ad group, in microseconds. An element * may be {@link C#TIME_UNSET} if the duration is not yet known. * @param adResumePositionUs The position offset in the earliest unplayed ad at which to begin * playback, in microseconds. */ public SinglePeriodAdTimeline(Timeline contentTimeline, long[] adGroupTimesUs, int[] adCounts, int[] adsLoadedCounts, int[] adsPlayedCounts, long[][] adDurationsUs, long adResumePositionUs) { Assertions.checkState(contentTimeline.getPeriodCount() == 1); Assertions.checkState(contentTimeline.getWindowCount() == 1); this.contentTimeline = contentTimeline; this.adGroupTimesUs = adGroupTimesUs; this.adCounts = adCounts; this.adsLoadedCounts = adsLoadedCounts; this.adsPlayedCounts = adsPlayedCounts; this.adDurationsUs = adDurationsUs; this.adResumePositionUs = adResumePositionUs; } @Override public int getWindowCount() { return 1; } @Override public Window getWindow(int windowIndex, Window window, boolean setIds, long defaultPositionProjectionUs) { return contentTimeline.getWindow(windowIndex, window, setIds, defaultPositionProjectionUs); } @Override public int getPeriodCount() { return 1; } @Override public Period getPeriod(int periodIndex, Period period, boolean setIds) { contentTimeline.getPeriod(periodIndex, period, setIds); period.set(period.id, period.uid, period.windowIndex, period.durationUs, period.getPositionInWindowUs(), adGroupTimesUs, adCounts, adsLoadedCounts, adsPlayedCounts, adDurationsUs, adResumePositionUs); return period; } @Override public int getIndexOfPeriod(Object uid) { return contentTimeline.getIndexOfPeriod(uid); } }
[ "loitp@pateco.vn" ]
loitp@pateco.vn
6635ed32040d356c433c11b1c2a2176316c5ce08
e0df638646bbb7891c5ff5ff996f8d3f4d08d0cb
/modules/base/base-service/base-service-impl/src/main/java/grape/base/service/userrolerel/mapper/UserRoleRelMapper.java
af10a3c4fa8798143c8347f7ae057f12ba4807fc
[]
no_license
feihua666/grape
479f758600da13e7b43b2d60744c304ed72f71a4
22bd2eebd4952022dde72ea8ff9e85d6b1d79595
refs/heads/master
2023-01-22T13:00:02.901359
2020-01-02T05:01:22
2020-01-02T05:01:22
197,750,420
0
0
null
2023-01-04T08:23:17
2019-07-19T10:05:42
TSQL
UTF-8
Java
false
false
347
java
package grape.base.service.userrolerel.mapper; import grape.base.service.userrolerel.po.UserRoleRel; import grape.common.service.common.IBaseMapper; /** * <p> * 角色菜单功能关系表,多对多 Mapper 接口 * </p> * * @author yangwei * @since 2019-09-27 */ public interface UserRoleRelMapper extends IBaseMapper<UserRoleRel> { }
[ "feihua666@sina.com" ]
feihua666@sina.com
a4a19ab52b276bc43def0b3ad26e3396d0cd3aa0
6ac1f64c7ad8c2cf9935f90ac9dc3d941d5764f8
/app/src/main/java/com/cinderellavip/bean/local/GoodsDetialBanner.java
c8acbb7c3c31181882c31112d11fd0cf659baebb
[]
no_license
sengeiou/cinderell
e8595b1c3b3afa0735017c556e575f7a2a00298c
095b9a07ba2f472af5c0665db35bd4d57ff36402
refs/heads/master
2023-03-13T10:29:45.266563
2021-03-02T01:06:21
2021-03-02T01:06:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
614
java
package com.cinderellavip.bean.local; public class GoodsDetialBanner { /** * 是视频的话 logo视频地址 * * pic 缩率图 * * 图片的话 * logo代表地址 */ public String pic; public boolean isVideo; //是否是视频 public String video; //是否是视频 public GoodsDetialBanner( String pic, boolean isVideo) { this.pic = pic; this.isVideo = isVideo; } public GoodsDetialBanner(String pic, boolean isVideo, String video) { this.pic = pic; this.isVideo = isVideo; this.video = video; } }
[ "835683840@qq.com" ]
835683840@qq.com
958f87eb372a43d332ccb6077cf81e97ab131d8d
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/springframework/data/elasticsearch/core/convert/DateTimeConvertersTests.java
543b26b60de672d84a60548b89cf4485ef9d7152
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,472
java
/** * Copyright 2013-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.data.elasticsearch.core.convert; import DateTimeConverters.JodaDateTimeConverter.INSTANCE; import java.util.Calendar; import java.util.TimeZone; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; import org.joda.time.LocalDateTime; import org.junit.Assert; import org.junit.Test; /** * * * @author Rizwan Idrees * @author Mohsin Husen */ public class DateTimeConvertersTests { @Test public void testJodaDateTimeConverterWithNullValue() { Assert.assertNull(INSTANCE.convert(null)); } @Test public void testJodaDateTimeConverter() { DateTime dateTime = new DateTime(2013, 1, 24, 6, 35, 0, DateTimeZone.UTC); Assert.assertEquals("2013-01-24T06:35:00.000Z", INSTANCE.convert(dateTime)); } @Test public void testJodaLocalDateTimeConverterWithNullValue() { Assert.assertNull(DateTimeConverters.JodaLocalDateTimeConverter.INSTANCE.convert(null)); } @Test public void testJodaLocalDateTimeConverter() { LocalDateTime dateTime = new LocalDateTime(getMillis(), DateTimeZone.UTC); Assert.assertEquals("2013-01-24T06:35:00.000Z", DateTimeConverters.JodaLocalDateTimeConverter.INSTANCE.convert(dateTime)); } @Test public void testJavaDateConverterWithNullValue() { Assert.assertNull(DateTimeConverters.JavaDateConverter.INSTANCE.convert(null)); } @Test public void testJavaDateConverter() { DateTime dateTime = new DateTime(2013, 1, 24, 6, 35, 0, DateTimeZone.UTC); Calendar calendar = Calendar.getInstance(); calendar.setTimeZone(TimeZone.getTimeZone("UTC")); calendar.setTimeInMillis(dateTime.getMillis()); Assert.assertEquals("2013-01-24T06:35:00.000Z", DateTimeConverters.JavaDateConverter.INSTANCE.convert(calendar.getTime())); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
eb89ca1e9d636f134f1e8d120ef70df69b5280f5
f9bc2073bde73cf0a49d46dbff96e37f8befd6c3
/[1.14.4] 2020 SkyBlock Raster Generierung/src/me/crafttale/de/application/game/Window.java
54aa68e7c9cec5ce084f3e43e605a59849c07f81
[]
no_license
IchMagOmasKekse/2020-SkyBlock-Raster-Generierung.Spigot-1.14.4
f2111d0bd0d26e8db5b8dacc1f08684be122e8aa
c9cd02b80f9673915d97c669583f19d4aea49936
refs/heads/master
2023-02-17T14:28:07.850505
2021-01-17T15:22:37
2021-01-17T15:22:37
254,999,906
0
0
null
null
null
null
UTF-8
Java
false
false
568
java
package me.crafttale.de.application.game; import java.awt.Dimension; import javax.swing.JFrame; public class Window { public JFrame frame = null; public Window(int width, int height, String title, SkyBlockAdminTool game) { frame = new JFrame(title); frame.setPreferredSize(new Dimension(width, height)); frame.setMinimumSize(new Dimension(width, height)); frame.add(game); frame.setResizable(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
87ef3753d3082fb838180e33f6a6d15b27a0775d
f9cd17921a0c820e2235f1cd4ee651a59b82189b
/src/net/cbtltd/rest/interhome/Services.java
ff2e9d5d57685ac95a39cc719466ebdcec2543a4
[]
no_license
bookingnet/booking
6042228c12fd15883000f4b6e3ba943015b604ad
0047b1ade78543819bcccdace74e872ffcd99c7a
refs/heads/master
2021-01-10T14:19:29.183022
2015-12-07T21:51:06
2015-12-07T21:51:06
44,936,675
2
1
null
null
null
null
UTF-8
Java
false
false
2,122
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.08.16 at 03:01:08 PM CAT // package net.cbtltd.rest.interhome; 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.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence minOccurs="0"> * &lt;element ref="{}service" maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "service" }) @XmlRootElement(name = "services") public class Services { protected List<Service> service; /** * Gets the value of the service 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 service property. * * <p> * For example, to add a new item, do as follows: * <pre> * getService().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Service } * * */ public List<Service> getService() { if (service == null) { service = new ArrayList<Service>(); } return this.service; } }
[ "bookingnet@mail.ru" ]
bookingnet@mail.ru
ed0d029f621a1a4e56414f2a47def01314bff72d
9b7dec08a72088c1e8ce518ea28e95810561d1f3
/lwh-code-template/src/main/resources/template/service/Service.java
1942b785e889fdda5be041c1ca0da8a8669f7cb0
[]
no_license
LWHTarena/lwh-example
6c9b763bca5a5a1557a14778a13a8cde1ffeb53e
e74096b50e49ea37b913b967cd3272ae13cda632
refs/heads/master
2022-12-21T09:50:27.766898
2021-05-01T08:31:34
2021-05-01T08:31:34
128,957,310
0
0
null
2022-12-16T15:41:55
2018-04-10T15:41:01
Java
UTF-8
Java
false
false
1,813
java
package $ import $; import com.github.pagehelper.PageInfo; import java.util.List; {package_service}; {package_pojo}.${Table}; /**** * @Author:liwh * @Description:${Table}业务层接口 * @Date 2020/07/09 0:18 *****/ public interface $ { Table } Service { /*** * ${Table}多条件分页查询 * @param ${table} * @param page * @param size * @return */ PageInfo<$ { Table }>findPage($ { Table } $ { table },int page, int size); /*** * ${Table}分页查询 * @param page * @param size * @return */ PageInfo<$ { Table }>findPage( int page, int size); /*** * ${Table}多条件搜索方法 * @param ${table} * @return */ List<$ { Table }>findList($ { Table } $ { table }); /*** * 删除${Table} * @param id */ void delete ($ { keyType } id); /*** * 修改${Table}数据 * @param ${table} */ void update ($ { Table } $ { table }); /*** * 新增${Table} * @param ${table} */ void add ($ { Table } $ { table }); /** * 根据ID查询${Table} * @param id * @return */ $ { Table } findById($ { keyType } id); /*** * 查询所有${Table} * @return */ List<$ { Table }>findAll(); }
[ "lwhtarena@163.com" ]
lwhtarena@163.com
95f2913cf3213ca8d6a451f4a307b8ce7d3cd59f
0c28a12d3efa7ef425a8dd8f829b6521e0c8f6f5
/src/results/bugged/Dataset3/7236.txt
6b45a30b4c8fca1d3e329556e79dd7d0d0111531
[ "Apache-2.0" ]
permissive
bsse1017kavi/Dissection-of-CodeRep
8408b80be8104f3642a99ee50deca5b2d9914524
a4b09622e1082e2df9683f549f2e26351a440b1a
refs/heads/master
2022-01-15T11:29:16.391603
2019-07-06T09:25:11
2019-07-06T09:25:11
195,090,051
0
0
null
null
null
null
UTF-8
Java
false
false
2,720
txt
/* * JBoss, Home of Professional Open Source. * Copyright 2011, Red Hat, Inc., and individual contributors * as indicated by the @author tags. See the copyright.txt file in the * distribution for a full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software 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 software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.as.test.integration.management.cli; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import junit.framework.Assert; import org.jboss.as.test.integration.common.HttpRequest; import org.jboss.as.test.integration.management.util.CLIWrapper; import org.junit.AfterClass; import org.junit.BeforeClass; /** * * @author Dominik Pospisil <dpospisi@redhat.com> */ public class AbstractCliTestBase { public final static long WAIT_TIMEOUT = 10000; public final static long WAIT_LINETIMEOUT = 1000; protected static CLIWrapper cli; @BeforeClass public static void before() throws Exception { if (cli == null) cli = new CLIWrapper(true); } @AfterClass public static void after() throws Exception { try { cli.quit(); } finally { cli = null; } } protected final String getBaseURL(URL url) throws MalformedURLException { return new URL(url.getProtocol(), url.getHost(), url.getPort(), "/").toString(); } protected void assertUndeployed(String spec) { try { final long firstTry = System.currentTimeMillis(); HttpRequest.get(spec, 10, TimeUnit.SECONDS); while (System.currentTimeMillis() - firstTry <= 1000) { try { Thread.sleep(500); } catch (InterruptedException e) { break; } finally { HttpRequest.get(spec, 10, TimeUnit.SECONDS); } } Assert.fail(spec + " is still available."); } catch (Exception e) { } } }
[ "bsse1017@iit.du.ac.bd" ]
bsse1017@iit.du.ac.bd
a509aa73e6faef6751da496371e45363b17f38e6
ded9d6e378c056d608c484fa9ff78ec4b5beae4b
/ratpack-session/src/main/java/ratpack/session/internal/DefaultSessionIdGenerator.java
5d21eb99727acfd3b9ae76bda4076d3542904664
[ "Apache-2.0" ]
permissive
bonifaido/ratpack
7a05923c906bf50958695e9075364f903f01ff29
f22e4e00bc169ebbfa51bf40b156a616e507dc75
refs/heads/master
2021-01-21T05:40:14.098636
2015-05-29T00:46:42
2015-05-29T00:46:42
35,612,852
0
0
null
2015-05-14T13:34:54
2015-05-14T13:34:54
null
UTF-8
Java
false
false
982
java
/* * Copyright 2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by 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 ratpack.session.internal; import ratpack.session.SessionIdGenerator; import java.math.BigInteger; import java.security.SecureRandom; public class DefaultSessionIdGenerator implements SessionIdGenerator { private SecureRandom random = new SecureRandom(); public String generateSessionId() { return new BigInteger(130, random).toString(32); } }
[ "ld@ldaley.com" ]
ld@ldaley.com
6d9c280988e1759ff43bf6a7bb719a4374cda694
a006be286d4482aecf4021f62edd8dd9bb600040
/src/main/java/com/alipay/api/response/AlipayOfflineMaterialImageDownloadResponse.java
54299fb21705da80023dccb5f64554efae30743f
[]
no_license
zero-java/alipay-sdk
16e520fbd69974f7a7491919909b24be9278f1b1
aac34d987a424497d8e8b1fd67b19546a6742132
refs/heads/master
2021-07-19T12:34:20.765988
2017-12-13T07:43:24
2017-12-13T07:43:24
96,759,166
0
0
null
2017-07-25T02:02:45
2017-07-10T09:20:13
Java
UTF-8
Java
false
false
836
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.AlipayResponse; /** * ALIPAY API: alipay.offline.material.image.download response. * * @author auto create * @since 1.0, 2017-04-07 16:14:28 */ public class AlipayOfflineMaterialImageDownloadResponse extends AlipayResponse { private static final long serialVersionUID = 3682549723494579413L; /** * 图片地址列表,按入参id顺序返回,如果某个id转化失败,则用空字符占位 */ @ApiListField("image_urls") @ApiField("string") private List<String> imageUrls; public void setImageUrls(List<String> imageUrls) { this.imageUrls = imageUrls; } public List<String> getImageUrls( ) { return this.imageUrls; } }
[ "443683059a" ]
443683059a
91cc0af8b53be182ffc89363c2b0706f62eeda6d
bb2e9ea7f9a1f90d2aab061f5e3dae5373765bca
/src/main/java/ar/com/kfgodel/function/boxed/doubles/BoxedDoubleToLongFunction.java
8d6bddff59463005d001eb4d15b0c81b72248c32
[ "Apache-2.0" ]
permissive
kfgodel/extended-functions
85f9bb056f7e67aa5297b28930a169773ee8b5fb
990b31353a4f9adab2d70ed0b3464706c65fa75c
refs/heads/master
2021-01-01T20:18:51.712928
2019-10-13T02:00:12
2019-10-13T02:00:12
98,808,487
0
0
null
null
null
null
UTF-8
Java
false
false
228
java
package ar.com.kfgodel.function.boxed.doubles; import ar.com.kfgodel.function.objects.ObjectToLongFunction; /** * Date: 29/07/17 - 19:57 */ public interface BoxedDoubleToLongFunction extends ObjectToLongFunction<Double> { }
[ "dario.garcia@10pines.com" ]
dario.garcia@10pines.com
46fb61ab3b628051524dd808bc1cff00ab25ae0f
b9a51deb97fc6a2dffcc7f36f8aa121541fd1608
/src/main/java/org/docx4j/math/CTDPr.java
20b3ab7acc8b8f60d6d0c805c330010d2ee44a6c
[ "Apache-2.0" ]
permissive
vansuca/docx4j
c592ea04e5736edef46a4a3e7ffab84cbc0b206f
72d061bd2606b58b8de7b36d203b58232a552e49
refs/heads/master
2020-12-30T19:23:31.287757
2012-11-28T02:08:47
2012-11-28T02:08:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,239
java
/* * Copyright 2010-2012, Plutext Pty Ltd. * * This file is part of pptx4j, a component of docx4j. docx4j is 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.docx4j.math; import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; import org.jvnet.jaxb2_commons.ppp.Child; /** * <p>Java class for CT_DPr complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CT_DPr"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="begChr" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_Char" minOccurs="0"/> * &lt;element name="sepChr" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_Char" minOccurs="0"/> * &lt;element name="endChr" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_Char" minOccurs="0"/> * &lt;element name="grow" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_OnOff" minOccurs="0"/> * &lt;element name="shp" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_Shp" minOccurs="0"/> * &lt;element name="ctrlPr" type="{http://schemas.openxmlformats.org/officeDocument/2006/math}CT_CtrlPr" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CT_DPr", propOrder = { "begChr", "sepChr", "endChr", "grow", "shp", "ctrlPr" }) public class CTDPr implements Child { protected CTChar begChr; protected CTChar sepChr; protected CTChar endChr; protected CTOnOff grow; protected CTShp shp; protected CTCtrlPr ctrlPr; @XmlTransient private Object parent; /** * Gets the value of the begChr property. * * @return * possible object is * {@link CTChar } * */ public CTChar getBegChr() { return begChr; } /** * Sets the value of the begChr property. * * @param value * allowed object is * {@link CTChar } * */ public void setBegChr(CTChar value) { this.begChr = value; } /** * Gets the value of the sepChr property. * * @return * possible object is * {@link CTChar } * */ public CTChar getSepChr() { return sepChr; } /** * Sets the value of the sepChr property. * * @param value * allowed object is * {@link CTChar } * */ public void setSepChr(CTChar value) { this.sepChr = value; } /** * Gets the value of the endChr property. * * @return * possible object is * {@link CTChar } * */ public CTChar getEndChr() { return endChr; } /** * Sets the value of the endChr property. * * @param value * allowed object is * {@link CTChar } * */ public void setEndChr(CTChar value) { this.endChr = value; } /** * Gets the value of the grow property. * * @return * possible object is * {@link CTOnOff } * */ public CTOnOff getGrow() { return grow; } /** * Sets the value of the grow property. * * @param value * allowed object is * {@link CTOnOff } * */ public void setGrow(CTOnOff value) { this.grow = value; } /** * Gets the value of the shp property. * * @return * possible object is * {@link CTShp } * */ public CTShp getShp() { return shp; } /** * Sets the value of the shp property. * * @param value * allowed object is * {@link CTShp } * */ public void setShp(CTShp value) { this.shp = value; } /** * Gets the value of the ctrlPr property. * * @return * possible object is * {@link CTCtrlPr } * */ public CTCtrlPr getCtrlPr() { return ctrlPr; } /** * Sets the value of the ctrlPr property. * * @param value * allowed object is * {@link CTCtrlPr } * */ public void setCtrlPr(CTCtrlPr value) { this.ctrlPr = value; } /** * Gets the parent object in the object tree representing the unmarshalled xml document. * * @return * The parent object. */ public Object getParent() { return this.parent; } public void setParent(Object parent) { this.parent = parent; } /** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); } }
[ "jason@plutext.org" ]
jason@plutext.org
0fb8913e39a4011fc48f84fbb22199ae88ef5f3e
73267be654cd1fd76cf2cb9ea3a75630d9f58a41
/services/ief/src/main/java/com/huaweicloud/sdk/ief/v1/model/ShowDeviceTemplateRequest.java
9e0337232503ac6b80a1692de3a055001b321ac9
[ "Apache-2.0" ]
permissive
huaweicloud/huaweicloud-sdk-java-v3
51b32a451fac321a0affe2176663fed8a9cd8042
2f8543d0d037b35c2664298ba39a89cc9d8ed9a3
refs/heads/master
2023-08-29T06:50:15.642693
2023-08-24T08:34:48
2023-08-24T08:34:48
262,207,545
91
57
NOASSERTION
2023-09-08T12:24:55
2020-05-08T02:27:00
Java
UTF-8
Java
false
false
2,651
java
package com.huaweicloud.sdk.ief.v1.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Objects; /** * Request Object */ public class ShowDeviceTemplateRequest { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "ief-instance-id") private String iefInstanceId; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value = "device_template_id") private String deviceTemplateId; public ShowDeviceTemplateRequest withIefInstanceId(String iefInstanceId) { this.iefInstanceId = iefInstanceId; return this; } /** * 铂金版实例ID,专业版实例为空值 * @return iefInstanceId */ public String getIefInstanceId() { return iefInstanceId; } public void setIefInstanceId(String iefInstanceId) { this.iefInstanceId = iefInstanceId; } public ShowDeviceTemplateRequest withDeviceTemplateId(String deviceTemplateId) { this.deviceTemplateId = deviceTemplateId; return this; } /** * 设备模板ID * @return deviceTemplateId */ public String getDeviceTemplateId() { return deviceTemplateId; } public void setDeviceTemplateId(String deviceTemplateId) { this.deviceTemplateId = deviceTemplateId; } @Override public boolean equals(java.lang.Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } ShowDeviceTemplateRequest that = (ShowDeviceTemplateRequest) obj; return Objects.equals(this.iefInstanceId, that.iefInstanceId) && Objects.equals(this.deviceTemplateId, that.deviceTemplateId); } @Override public int hashCode() { return Objects.hash(iefInstanceId, deviceTemplateId); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class ShowDeviceTemplateRequest {\n"); sb.append(" iefInstanceId: ").append(toIndentedString(iefInstanceId)).append("\n"); sb.append(" deviceTemplateId: ").append(toIndentedString(deviceTemplateId)).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 "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com