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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2409c5a013c38b601f1600257e29a547608716fd
|
d55d17769a21ed3d0bfc41c4eaa8f60711144621
|
/design-patterns/src/main/java/relationships/association/Bank.java
|
b3b0630e73e7d8b0c22d783bf471241662872da0
|
[] |
no_license
|
rogers1235/new-project
|
fc42ca0f85c1a606a4196624088230338ddba496
|
b9df64b6f9e2924211fe70b80c8ab923624ec817
|
refs/heads/main
| 2023-08-04T08:28:18.018401
| 2021-09-16T20:22:38
| 2021-09-16T20:22:38
| 407,303,470
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 206
|
java
|
package relationships.association;
public class Bank {
private String name;
Bank(String name) {
this.name = name;
}
public String getBankName() {
return this.name;
}
}
|
[
"craiova_2006@yahoo.it"
] |
craiova_2006@yahoo.it
|
80463a2b5852c4fd7992cf2a52a2a96f382cf4aa
|
a43d4202628ecb52e806d09f0f3dc1f5bab3ef4f
|
/src/main/java/pnc/mesadmin/entity/StorePMInfo.java
|
04a8dfa17e8fae36cb53b55990ec2872edfafe1c
|
[] |
no_license
|
pnc-mes/base
|
b88583929e53670340a704f848e4e9e2027f1334
|
162135b8752b4edc397b218ffd26664929f6920d
|
refs/heads/main
| 2023-01-07T22:06:10.794300
| 2020-10-27T07:47:20
| 2020-10-27T07:47:20
| 307,621,190
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,916
|
java
|
package pnc.mesadmin.entity;
import java.util.Date;
/**
* Created by liufuzhi on 2018/1/22.
*/
public class StorePMInfo {
private int ruid;
private String guid;
private String storeGd;
private String pMorGd;
private String pMType;
private String creator;
private Date createTime;
private String lastModifyMan;
private Date lastModifyTime;
private String remark;
public int getRuid() {
return ruid;
}
public void setRuid(int ruid) {
this.ruid = ruid;
}
public String getGuid() {
return guid;
}
public void setGuid(String guid) {
this.guid = guid;
}
public String getStoreGd() {
return storeGd;
}
public void setStoreGd(String storeGd) {
this.storeGd = storeGd;
}
public String getpMorGd() {
return pMorGd;
}
public void setpMorGd(String pMorGd) {
this.pMorGd = pMorGd;
}
public String getpMType() {
return pMType;
}
public void setpMType(String pMType) {
this.pMType = pMType;
}
public String getCreator() {
return creator;
}
public void setCreator(String creator) {
this.creator = creator;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getLastModifyMan() {
return lastModifyMan;
}
public void setLastModifyMan(String lastModifyMan) {
this.lastModifyMan = lastModifyMan;
}
public Date getLastModifyTime() {
return lastModifyTime;
}
public void setLastModifyTime(Date lastModifyTime) {
this.lastModifyTime = lastModifyTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
|
[
"95887577@qq.com"
] |
95887577@qq.com
|
7922727faa6c257538bc46bc8165985a36113054
|
ba2eef5e3c914673103afb944dd125a9e846b2f6
|
/AL-Game/data/scripts/system/handlers/quest/greater_stigma/_11049TalocsHeartFullofSoul.java
|
30d48471ffb8ed41e9b1574b7f5146aa2502ce8a
|
[] |
no_license
|
makifgokce/Aion-Server-4.6
|
519d1d113f483b3e6532d86659932a266d4da2f8
|
0a6716a7aac1f8fe88780aeed68a676b9524ff15
|
refs/heads/master
| 2022-10-07T11:32:43.716259
| 2020-06-10T20:14:47
| 2020-06-10T20:14:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,974
|
java
|
/**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*/
package quest.greater_stigma;
import com.aionemu.gameserver.model.DialogAction;
import com.aionemu.gameserver.model.gameobjects.Npc;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.questEngine.handlers.QuestHandler;
import com.aionemu.gameserver.questEngine.model.QuestEnv;
import com.aionemu.gameserver.questEngine.model.QuestState;
import com.aionemu.gameserver.questEngine.model.QuestStatus;
import com.aionemu.gameserver.services.QuestService;
/**
* @author Gigi
*/
public class _11049TalocsHeartFullofSoul extends QuestHandler {
private final static int questId = 11049;
public _11049TalocsHeartFullofSoul() {
super(questId);
}
@Override
public void register() {
qe.registerQuestNpc(798909).addOnQuestStart(questId);
qe.registerQuestNpc(798909).addOnTalkEvent(questId);
}
@Override
public boolean onDialogEvent(QuestEnv env) {
final Player player = env.getPlayer();
QuestState qs = player.getQuestStateList().getQuestState(questId);
int targetId = 0;
if (env.getVisibleObject() instanceof Npc) {
targetId = ((Npc) env.getVisibleObject()).getNpcId();
}
if (qs == null || qs.getStatus() == QuestStatus.NONE) {
if (targetId == 798909) {
if (env.getDialog() == DialogAction.QUEST_SELECT) {
return sendQuestDialog(env, 1011);
} else {
return sendQuestStartDialog(env);
}
}
}
if (qs != null && qs.getStatus() == QuestStatus.START) {
switch (targetId) {
case 798909: {
switch (env.getDialog()) {
case QUEST_SELECT: {
if (QuestService.collectItemCheck(env, true)) {
qs.setStatus(QuestStatus.REWARD);
updateQuestStatus(env);
return sendQuestDialog(env, 2375);
} else {
return sendQuestDialog(env, 2716);
}
}
default:
break;
}
}
}
} else if (qs != null && qs.getStatus() == QuestStatus.REWARD) {
if (targetId == 798909) {
if (env.getDialogId() == DialogAction.CHECK_USER_HAS_QUEST_ITEM.id()) {
return sendQuestDialog(env, 5);
} else {
return sendQuestEndDialog(env);
}
}
}
return false;
}
}
|
[
"Falke_34@080676fd-0f56-412f-822c-f8f0d7cea3b7"
] |
Falke_34@080676fd-0f56-412f-822c-f8f0d7cea3b7
|
28c6bf6fb6cbd168abcfb0b5a7a54b2edff5b6cf
|
d9f98dd1828e25bc2e8517e5467169830c5ded60
|
/src/main/java/com/alipay/api/domain/AlipayEcoEduCampusJobtalkCancelModel.java
|
a3cf2608c64b851e1f622a5f9f83dc1980daac14
|
[] |
no_license
|
benhailong/open_kit
|
6c99f3239de6dcd37f594f7927dc8b0e666105dc
|
a45dd2916854ee8000d2fb067b75160b82bc2c04
|
refs/heads/master
| 2021-09-19T18:22:23.628389
| 2018-07-30T08:18:18
| 2018-07-30T08:18:26
| 117,778,328
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,126
|
java
|
package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 宣讲会下架接口
*
* @author auto create
* @since 1.0, 2017-08-03 10:59:08
*/
public class AlipayEcoEduCampusJobtalkCancelModel extends AlipayObject {
private static final long serialVersionUID = 6694951999321436676L;
/**
* 备用字段,json格式
*/
@ApiField("content_var")
private String contentVar;
/**
* 宣讲会来源方id
*/
@ApiField("talk_source_code")
private String talkSourceCode;
/**
* 宣讲会在合作方的ID
*/
@ApiField("talk_source_id")
private String talkSourceId;
public String getContentVar() {
return this.contentVar;
}
public void setContentVar(String contentVar) {
this.contentVar = contentVar;
}
public String getTalkSourceCode() {
return this.talkSourceCode;
}
public void setTalkSourceCode(String talkSourceCode) {
this.talkSourceCode = talkSourceCode;
}
public String getTalkSourceId() {
return this.talkSourceId;
}
public void setTalkSourceId(String talkSourceId) {
this.talkSourceId = talkSourceId;
}
}
|
[
"694201656@qq.com"
] |
694201656@qq.com
|
f762aacf9d804e7325f8da38502ad8ec5af149b8
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/AsyncHttpClient--async-http-client/eb136417465e13f0ba17c2ae8efdb9a45c22a315/before/GrizzlyPostWithQSTest.java
|
f9d6e81ec239387bf71fc00434111bfd25d25376
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,305
|
java
|
/*
* Copyright (c) 2012 Sonatype, Inc. All rights reserved.
*
* This program is licensed to you under the Apache License Version 2.0,
* and you may not use this file except in compliance with the Apache License Version 2.0.
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the Apache License Version 2.0 is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
*/
package com.ning.http.client.async.grizzly;
import com.ning.http.client.AsyncHttpClient;
import com.ning.http.client.AsyncHttpClientConfig;
import com.ning.http.client.async.PostWithQSTest;
import com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider;
public class GrizzlyPostWithQSTest extends PostWithQSTest {
@Override
public AsyncHttpClient getAsyncHttpClient(AsyncHttpClientConfig config) {
if (config == null) {
config = new AsyncHttpClientConfig.Builder().build();
}
return new AsyncHttpClient(new GrizzlyAsyncHttpProvider(config), config);
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
c7ef297fc0d0b0d070fb512637dfe711c837a7ae
|
755c81ea06fe2bc34d2e4a2e4a3a14cc1f9e0fa9
|
/src/main/java/com/universign/universigncs/parralal/web/rest/util/PaginationUtil.java
|
a97c9bce3b024e014ea112c61f3a5a8bfeaae7bc
|
[] |
no_license
|
EricLamore/jhipster-parralal
|
95a16afb244bb37b6ffcdbc1330647d36cdac960
|
14151a19316962053ff053f722a690f9960b0367
|
refs/heads/master
| 2020-04-30T02:02:35.614825
| 2019-03-19T17:03:38
| 2019-03-19T17:03:38
| 176,547,276
| 0
| 0
| null | 2019-03-19T17:03:39
| 2019-03-19T15:47:57
|
Java
|
UTF-8
|
Java
| false
| false
| 1,766
|
java
|
package com.universign.universigncs.parralal.web.rest.util;
import org.springframework.data.domain.Page;
import org.springframework.http.HttpHeaders;
import org.springframework.web.util.UriComponentsBuilder;
/**
* Utility class for handling pagination.
*
* <p>
* Pagination uses the same principles as the <a href="https://developer.github.com/v3/#pagination">GitHub API</a>,
* and follow <a href="http://tools.ietf.org/html/rfc5988">RFC 5988 (Link header)</a>.
*/
public final class PaginationUtil {
private PaginationUtil() {
}
public static <T> HttpHeaders generatePaginationHttpHeaders(Page<T> page, String baseUrl) {
HttpHeaders headers = new HttpHeaders();
headers.add("X-Total-Count", Long.toString(page.getTotalElements()));
String link = "";
if ((page.getNumber() + 1) < page.getTotalPages()) {
link = "<" + generateUri(baseUrl, page.getNumber() + 1, page.getSize()) + ">; rel=\"next\",";
}
// prev link
if ((page.getNumber()) > 0) {
link += "<" + generateUri(baseUrl, page.getNumber() - 1, page.getSize()) + ">; rel=\"prev\",";
}
// last and first link
int lastPage = 0;
if (page.getTotalPages() > 0) {
lastPage = page.getTotalPages() - 1;
}
link += "<" + generateUri(baseUrl, lastPage, page.getSize()) + ">; rel=\"last\",";
link += "<" + generateUri(baseUrl, 0, page.getSize()) + ">; rel=\"first\"";
headers.add(HttpHeaders.LINK, link);
return headers;
}
private static String generateUri(String baseUrl, int page, int size) {
return UriComponentsBuilder.fromUriString(baseUrl).queryParam("page", page).queryParam("size", size).toUriString();
}
}
|
[
"jhipster-bot@jhipster.tech"
] |
jhipster-bot@jhipster.tech
|
fe0d2452811fd1ec2064437b5d4f9b3511e188fb
|
96f8d42c474f8dd42ecc6811b6e555363f168d3e
|
/baike/sources/android/support/multidex/c.java
|
1cfb5f2d3df4d865d4e4726377e6354b5f05175d
|
[] |
no_license
|
aheadlcx/analyzeApk
|
050b261595cecc85790558a02d79739a789ae3a3
|
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
|
refs/heads/master
| 2020-03-10T10:24:49.773318
| 2018-04-13T09:44:45
| 2018-04-13T09:44:45
| 129,332,351
| 6
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,568
|
java
|
package android.support.multidex;
import android.support.v4.media.session.PlaybackStateCompat;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.zip.CRC32;
import java.util.zip.ZipException;
import qsbk.app.core.model.CustomButton;
final class c {
static class a {
long a;
long b;
a() {
}
}
static long a(File file) throws IOException {
RandomAccessFile randomAccessFile = new RandomAccessFile(file, CustomButton.POSITION_RIGHT);
try {
long a = a(randomAccessFile, a(randomAccessFile));
return a;
} finally {
randomAccessFile.close();
}
}
static a a(RandomAccessFile randomAccessFile) throws IOException, ZipException {
long j = 0;
long length = randomAccessFile.length() - 22;
if (length < 0) {
throw new ZipException("File too short to be a zip file: " + randomAccessFile.length());
}
long j2 = length - PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH;
if (j2 >= 0) {
j = j2;
}
int reverseBytes = Integer.reverseBytes(101010256);
j2 = length;
do {
randomAccessFile.seek(j2);
if (randomAccessFile.readInt() == reverseBytes) {
randomAccessFile.skipBytes(2);
randomAccessFile.skipBytes(2);
randomAccessFile.skipBytes(2);
randomAccessFile.skipBytes(2);
a aVar = new a();
aVar.b = ((long) Integer.reverseBytes(randomAccessFile.readInt())) & 4294967295L;
aVar.a = ((long) Integer.reverseBytes(randomAccessFile.readInt())) & 4294967295L;
return aVar;
}
j2--;
} while (j2 >= j);
throw new ZipException("End Of Central Directory signature not found");
}
static long a(RandomAccessFile randomAccessFile, a aVar) throws IOException {
CRC32 crc32 = new CRC32();
long j = aVar.b;
randomAccessFile.seek(aVar.a);
byte[] bArr = new byte[16384];
int read = randomAccessFile.read(bArr, 0, (int) Math.min(PlaybackStateCompat.ACTION_PREPARE, j));
while (read != -1) {
crc32.update(bArr, 0, read);
j -= (long) read;
if (j == 0) {
break;
}
read = randomAccessFile.read(bArr, 0, (int) Math.min(PlaybackStateCompat.ACTION_PREPARE, j));
}
return crc32.getValue();
}
}
|
[
"aheadlcxzhang@gmail.com"
] |
aheadlcxzhang@gmail.com
|
9f5be0b6eb9bd836a82c4c13aec7ea89f90b90f8
|
590ab79666d13a128538adb639c9d4695761bafe
|
/root-model/src/main/java/org/cyk/system/root/model/userinterface/UserInterfaceLayoutType.java
|
7b169d99a0ed62ba1beee12eb58035c82d851798
|
[] |
no_license
|
devlopper/org.cyk.system.root
|
53c1844665cd9caed3429ef19f63bd9c33d42a63
|
b3e0bf2d730555412564f32a1b174835d8a53c89
|
refs/heads/master
| 2021-01-24T12:31:10.691363
| 2018-05-21T21:10:26
| 2018-05-21T21:10:26
| 16,188,519
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 856
|
java
|
package org.cyk.system.root.model.userinterface;
import java.io.Serializable;
import javax.persistence.Entity;
import org.cyk.system.root.model.pattern.tree.AbstractDataTreeType;
import org.cyk.utility.common.annotation.ModelBean;
import org.cyk.utility.common.annotation.ModelBean.CrudStrategy;
import org.cyk.utility.common.annotation.ModelBean.GenderType;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter @Setter @NoArgsConstructor @Entity @ModelBean(genderType=GenderType.MALE,crudStrategy=CrudStrategy.ENUMERATION)
public class UserInterfaceLayoutType extends AbstractDataTreeType implements Serializable {
private static final long serialVersionUID = -6838401709866343401L;
public UserInterfaceLayoutType(UserInterfaceLayoutType parent, String code,String label) {
super(parent, code,label);
}
}
|
[
"kycdev@gmail.com"
] |
kycdev@gmail.com
|
26a755a0789d37d7e2b0ce76ea52a65743067a92
|
04993ec330462593a8d64d3cbda0275053420ace
|
/JHPaymentGatewayPro/src/main/java/com/jh/paymentgateway/util/xs/RSATool.java
|
ef781690c750d75ec5eb26d448907a168da46a78
|
[] |
no_license
|
jsy579579/jh
|
60af71fada0462c45f527943f22c1a9ccd8268fd
|
44858ab7fbf461cd382efe436473d9581d4c067a
|
refs/heads/master
| 2022-05-13T22:28:16.095115
| 2020-04-29T03:20:14
| 2020-04-29T03:20:14
| 259,813,186
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,956
|
java
|
package com.jh.paymentgateway.util.xs;
import javax.crypto.Cipher;
import java.io.*;
import java.security.*;
import java.security.interfaces.RSAPrivateKey;
import java.security.interfaces.RSAPublicKey;
/**
* @Author: Chand
* @Date: 13-12-04
* @Time: 下午2:30
* @Description: RSA加密器
*/
public class RSATool {
/**
* 指定key的大小
*/
private static int KEYSIZE = 1024;
public static final String RSA_ALGORITHM = "RSA";
/**
* 生成密钥对
*/
public static void generateKeyPair (String pubkeyfile, String privatekeyfile) throws NoSuchAlgorithmException, FileNotFoundException, IOException {
/** RSA算法要求有一个可信任的随机数源 */
SecureRandom sr = new SecureRandom();
// KeyPairGenerator类用于生成公钥和私钥对,基于RSA算法生成对象
KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance(RSA_ALGORITHM);
// 初始化密钥对生成器,密钥大小为1024位
keyPairGen.initialize(KEYSIZE, sr);
// 生成一个密钥对,保存在keyPair中
KeyPair keyPair = keyPairGen.generateKeyPair();
// 得到私钥
RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate();
// 得到公钥
RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
// 生成私钥
ObjectOutputStream oos = null;
oos = new ObjectOutputStream(new FileOutputStream(privatekeyfile));
oos.writeObject(privateKey);
oos.flush();
oos.close();
oos = new ObjectOutputStream(new FileOutputStream(pubkeyfile));
oos.writeObject(publicKey);
oos.flush();
oos.close();
}
/**
* 加密
*
* @param source
* @param key
* @return
* @throws Exception
*/
public static byte[] encrypt (byte[] source, Key key) throws Exception {
Cipher cipher = Cipher.getInstance(RSA_ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, key);
byte[] resultBytes = cipher.doFinal(source);
return resultBytes;
}
/**
* 解密
*
* @param source
* @param key
* @return
* @throws Exception
*/
public static byte[] decrypt (byte[] source, Key key) throws Exception {
Cipher cipher = Cipher.getInstance(RSA_ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] resultBytes = cipher.doFinal(source);
return resultBytes;
}
/*public static void main (String[] args) throws Exception {
String pem = "D://dumps//1020160419686875-rsa-private.pem";
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(pem));
RSAPrivateKey prikey = (RSAPrivateKey) ois.readObject();
ois.close();
String key = "!1231231sdaf3ra中文gt23*(&(*^";
byte[] aes = RSATool.encrypt(key.getBytes(), prikey);
}*/
}
|
[
"593380806@qq.com"
] |
593380806@qq.com
|
2b2554b6377bb25de60c4ac0764e4547793bdc4b
|
537989fad6ae0a953682a9aaed5698db71f514db
|
/src/main/java/com/swissquote/battledev2014/shoppinglistgenerator/repository/MenuElasticsearchRepository.java
|
820ffe00e1cc24792003ca32794670a9eeb50d11
|
[
"Apache-2.0"
] |
permissive
|
lgueye/shopping-list-generator
|
47caba0ae5a4643d4d5cbd3ab714817785960451
|
135a830883a2e95cdc5558a96fc7baeb4fbfc6da
|
refs/heads/master
| 2021-01-19T17:47:42.026314
| 2014-07-05T22:20:21
| 2014-07-05T22:20:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 382
|
java
|
package com.swissquote.battledev2014.shoppinglistgenerator.repository;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.swissquote.battledev2014.shoppinglistgenerator.domain.Menu;
public interface MenuElasticsearchRepository extends PagingAndSortingRepository<Menu, String> {
// Marker interface for repositories in spring-data-elasticsearch
}
|
[
"louis.gueye@gmail.com"
] |
louis.gueye@gmail.com
|
374cbca71243289e19048c51f4b5543c9df7dd5a
|
f42763a4ef5565a6e0c2f1172f53896cc3571707
|
/lab/src/lab1/helloworld.java
|
f3e4d3dfe9bc561b54e5088330b0c85a7660901a
|
[] |
no_license
|
phamtuanchip/java-core
|
bf1ff086122d98f93db28b59b71981756a0564cd
|
816653fd4ca9ba149688b63f201ae854943f9def
|
refs/heads/master
| 2020-04-23T16:21:59.102083
| 2015-11-19T05:14:41
| 2015-11-19T05:14:41
| 32,123,447
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 199
|
java
|
package lab1;
public class helloworld {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("This is main from helloworld object!");
}
}
|
[
"phamtuanchip@gmail.com"
] |
phamtuanchip@gmail.com
|
36e0064fcd006452a9a179eaebc0273a87eaf64a
|
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
|
/aiccs-20191015/src/main/java/com/aliyun/aiccs20191015/models/HoldCallResponse.java
|
6dcddc49136317fd809f8bfd0a9ddc06bec48c9f
|
[
"Apache-2.0"
] |
permissive
|
aliyun/alibabacloud-java-sdk
|
83a6036a33c7278bca6f1bafccb0180940d58b0b
|
008923f156adf2e4f4785a0419f60640273854ec
|
refs/heads/master
| 2023-09-01T04:10:33.640756
| 2023-09-01T02:40:45
| 2023-09-01T02:40:45
| 288,968,318
| 40
| 45
| null | 2023-06-13T02:47:13
| 2020-08-20T09:51:08
|
Java
|
UTF-8
|
Java
| false
| false
| 1,299
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.aiccs20191015.models;
import com.aliyun.tea.*;
public class HoldCallResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("statusCode")
@Validation(required = true)
public Integer statusCode;
@NameInMap("body")
@Validation(required = true)
public HoldCallResponseBody body;
public static HoldCallResponse build(java.util.Map<String, ?> map) throws Exception {
HoldCallResponse self = new HoldCallResponse();
return TeaModel.build(map, self);
}
public HoldCallResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public HoldCallResponse setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
return this;
}
public Integer getStatusCode() {
return this.statusCode;
}
public HoldCallResponse setBody(HoldCallResponseBody body) {
this.body = body;
return this;
}
public HoldCallResponseBody getBody() {
return this.body;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
3b9e2fe751bf3f2089ef2c9b82c55f982e377bb8
|
66049b4fe63b5f7cb9687c32b8796f71b1281911
|
/mybatie/mybatis_day03_02many/src/main/java/com/itcast/domain/AccountUser.java
|
75618ea229c3533050bafed4acc463f889ceed28
|
[] |
no_license
|
leiyungit/JavaTestDemo
|
2d25ab31a50d23476701ff0e5d0992e68b20a9a9
|
c4b6a4c176bdbb9d8e608d5c78d67850b0a3d6b0
|
refs/heads/master
| 2023-02-08T08:16:51.797724
| 2020-12-22T12:10:52
| 2020-12-22T12:10:52
| 294,661,067
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 684
|
java
|
package com.itcast.domain;
import java.util.Date;
public class AccountUser extends Account {
private String username;
private String address;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public String toString() {
return super.toString() + " AccountUser{" +
"username='" + username + '\'' +
", address='" + address + '\'' +
'}';
}
}
|
[
"744561873@qq.com"
] |
744561873@qq.com
|
808c5429d7c4bdf28d4c7ecb39fea337897036c5
|
d899f0677f3805f071a62b24634fe78f16881189
|
/osa03-Osa03_03.AirportsAndAircrafts/src/main/java/airports/AirportController.java
|
741b0fc28a80354c0841d0b46a4832fe7b8b9de5
|
[] |
no_license
|
remixtures/web-server-programming-java-2021
|
a0de095cf2499830784ad8286671b0d198848e88
|
f297c51c2c34ce52629494c499c90460afc2af3c
|
refs/heads/master
| 2023-05-27T09:18:55.313181
| 2021-06-04T12:03:06
| 2021-06-04T12:03:06
| 373,673,320
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 926
|
java
|
package airports;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class AirportController {
@Autowired
private AirportRepository airportRepository;
@GetMapping("/airports")
public String list(Model model) {
model.addAttribute("airports", airportRepository.findAll());
return "airports";
}
@PostMapping("/airports")
public String create(@RequestParam String identifier, @RequestParam String name) {
Airport a = new Airport();
a.setIdentifier(identifier);
a.setName(name);
airportRepository.save(a);
return "redirect:/airports";
}
}
|
[
"miguel.a.caetano@gmail.com"
] |
miguel.a.caetano@gmail.com
|
babc1ed65622e6880da044b98fc44f9a414e6ec5
|
56adea945b27ccaf880decadb7f7cb86de450a8d
|
/common-web/ep-common-web/src/main/java/com/elasticpath/sfweb/security/AccessChecker.java
|
9c5c63e9fd473785ce3a738d3175921d39bb127b
|
[] |
no_license
|
ryanlfoster/ep-commerce-engine-68
|
89b56878806ca784eca453d58fb91836782a0987
|
7364bce45d25892e06df2e1c51da84dbdcebce5d
|
refs/heads/master
| 2020-04-16T04:27:40.577543
| 2013-12-10T19:31:52
| 2013-12-10T20:01:08
| 40,164,760
| 1
| 1
| null | 2015-08-04T05:15:25
| 2015-08-04T05:15:25
| null |
UTF-8
|
Java
| false
| false
| 495
|
java
|
/**
* Copyright (c) Elastic Path Software Inc., 2008
*/
package com.elasticpath.sfweb.security;
import javax.servlet.http.HttpServletRequest;
/**
* Define methods for checking access for a store.
*/
public interface AccessChecker {
/**
* Determine whether the store is accessible based on what is provided in the request.
*
* @param request the request coming in from a browser
* @return true if the store is accessible
*/
boolean isAccessible(HttpServletRequest request);
}
|
[
"chris.gomes@pearson.com"
] |
chris.gomes@pearson.com
|
b8f177193a6b9442b9e26f83fa2bb77f81744bac
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/apache--kafka/d0e436c471ba4122ddcc0f7a1624546f97c4a517/after/OffsetAndMetadata.java
|
a2401fc3c441f7f93dc92d76ff6066826211b094
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,776
|
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.kafka.clients.consumer;
import java.io.Serializable;
/**
* The Kafka offset commit API allows users to provide additional metadata (in the form of a string)
* when an offset is committed. This can be useful (for example) to store information about which
* node made the commit, what time the commit was made, etc.
*/
public class OffsetAndMetadata implements Serializable {
private final long offset;
private final String metadata;
/**
* Construct a new OffsetAndMetadata object for committing through {@link KafkaConsumer}.
* @param offset The offset to be committed
* @param metadata Non-null metadata
*/
public OffsetAndMetadata(long offset, String metadata) {
this.offset = offset;
this.metadata = metadata;
}
/**
* Construct a new OffsetAndMetadata object for committing through {@link KafkaConsumer}. The metadata
* associated with the commit will be empty.
* @param offset The offset to be committed
*/
public OffsetAndMetadata(long offset) {
this(offset, "");
}
public long offset() {
return offset;
}
public String metadata() {
return metadata;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OffsetAndMetadata that = (OffsetAndMetadata) o;
if (offset != that.offset) return false;
return metadata == null ? that.metadata == null : metadata.equals(that.metadata);
}
@Override
public int hashCode() {
int result = (int) (offset ^ (offset >>> 32));
result = 31 * result + (metadata != null ? metadata.hashCode() : 0);
return result;
}
@Override
public String toString() {
return "OffsetAndMetadata{" +
"offset=" + offset +
", metadata='" + metadata + '\'' +
'}';
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
c5ea127eece69aef81c3e875c9d14e4bf2d86f23
|
67bbc005c500ecebec6b5e4a8af1463d5078e774
|
/DistributedPattern/src/com/greatfree/testing/memory/LinkRecord.java
|
dacb8a08d589380868d2e0074ebf1a4b17e7040c
|
[] |
no_license
|
Yunvari/Programming-Clouds
|
56324d82d662ca551343af702b7865075d645a04
|
cf5262798e52a64ad455de8637e9130819e815cf
|
refs/heads/master
| 2020-06-14T05:24:09.051845
| 2019-04-02T06:51:33
| 2019-04-02T06:51:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,041
|
java
|
package com.greatfree.testing.memory;
import com.greatfree.util.FreeObject;
/*
* This is the data that is saved in the distributed memory server. It must derive from FreeObject in order to fit the requirements of ResrouceCache. 11/28/2014, Bing Li
*/
// Created: 11/28/2014, Bing Li
public class LinkRecord extends FreeObject
{
private String key;
private String link;
private String text;
private String hubURLKey;
public LinkRecord(String key, String link, String text, String hubURLKey)
{
this.key = key;
this.link = link;
this.text = text;
this.hubURLKey = hubURLKey;
}
/*
* Expose the key. 11/28/2014, Bing Li
*/
public String getKey()
{
return this.key;
}
/*
* Expose the link. 11/28/2014, Bing Li
*/
public String getLink()
{
return this.link;
}
/*
* Expose the text. 11/28/2014, Bing Li
*/
public String getText()
{
return this.text;
}
/*
* Expose the key of the hub URL being crawled. 11/28/2014, Bing Li
*/
public String getHubURLKey()
{
return this.hubURLKey;
}
}
|
[
"bing.li@asu.edu"
] |
bing.li@asu.edu
|
69d0320b38617348d976fc9ced581361818c808e
|
1dce969b036338417ad6c2a670bbd96ef8871845
|
/app/src/main/java/com/students/preparation/matric/students/modules/Students/fragment/AminInboxFragment.java
|
6b3d48be89b1fd8c02c1a8b7049e71f156966461
|
[] |
no_license
|
messyKassaye/exam_preparation
|
bb6589ca6dcc00545870fab1f9f356241833f91f
|
a94231d4e2225267af881d951f09ff8f9f09bb95
|
refs/heads/master
| 2022-11-24T23:18:48.834585
| 2020-07-26T17:35:16
| 2020-07-26T17:35:16
| 275,753,743
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,117
|
java
|
package com.students.preparation.matric.students.modules.Students.fragment;
import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.DefaultItemAnimator;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.preference.PreferenceManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Spinner;
import android.widget.TextView;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.students.preparation.matric.students.Constants;
import com.students.preparation.matric.students.R;
import com.students.preparation.matric.students.adapter.ReferenceBooksAdapter;
import com.students.preparation.matric.students.model.Books;
import java.util.ArrayList;
public class AminInboxFragment extends Fragment {
//firebase variable
private DatabaseReference dbReference;
//Views
private TextView noReferenceBooksFound;
private RecyclerView _recyclerView;
private String logedUserStream;
private Spinner bookType;
private String selectedBooksType;
private ArrayList<Books> referenceBooks = new ArrayList<>();
private ReferenceBooksAdapter adapter;
public AminInboxFragment() {
// Required empty public constructor
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
final View view= inflater.inflate(R.layout.fragment_amin_inbox, container, false);
//initialize views
noReferenceBooksFound = view.findViewById(R.id.notReferenceBooksFound);
adapter = new ReferenceBooksAdapter(getContext(),referenceBooks);
_recyclerView = view.findViewById(R.id.referenceRecyclerView);
_recyclerView.setLayoutManager(new LinearLayoutManager(getContext(),
LinearLayoutManager.VERTICAL,false));
_recyclerView.setItemAnimator(new DefaultItemAnimator());
//populating registered book references
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
logedUserStream = prefs.getString(Constants.LOGGED_IN_USER_STREAM, null);
dbReference = FirebaseDatabase.getInstance().getReference(Constants.DATABASE_PATH_BOOKS);
dbReference.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if (dataSnapshot.exists()){
for (DataSnapshot dataSnapshot1: dataSnapshot.getChildren()){
Books uploadsModel = dataSnapshot1.getValue(Books.class);
if (uploadsModel.getStream().equals(logedUserStream)){
if (uploadsModel.getBookType().equalsIgnoreCase("Admin inbox")){
referenceBooks.add(uploadsModel);
}
}
}
_recyclerView.setAdapter(adapter);
adapter.notifyDataSetChanged();
if (referenceBooks.size()<=0){
noReferenceBooksFound.setText("Admin inbox is not found ):");
noReferenceBooksFound.setVisibility(View.VISIBLE);
}
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
return view;
}
}
|
[
"nurelayinmehammed@gmail.com"
] |
nurelayinmehammed@gmail.com
|
dcaaea8bf8d1ee7023857732dcb7542d98408647
|
ea282cc70de0f867f671a71fc515cc7641d3d3fe
|
/src/xfuzzy/xfvhdl/XfvhdlUniversePoint.java
|
364790979139e1363dcf103aadfc7f3fa2e650dd
|
[
"MIT"
] |
permissive
|
dayse/gesplan
|
aff1cc1e38ec22231099063592648674d77b575d
|
419ee1dcad2fa96550c99032928e9ea30e7da7cd
|
refs/heads/master
| 2021-01-23T07:03:23.606901
| 2014-08-12T14:38:26
| 2014-08-12T14:38:26
| null | 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 4,949
|
java
|
//--------------------------------------------------------------------------------//
// COPYRIGHT NOTICE //
//--------------------------------------------------------------------------------//
// Copyright (c) 2012, Instituto de Microelectronica de Sevilla (IMSE-CNM) //
// //
// 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 IMSE-CNM 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 HOLDERS 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 xfuzzy.xfvhdl;
/**
* Clase que representa un punto discreto en el universo de discurso
* discretizado.
*
* @author Lidia Delgado Carretero.
*
*/
public class XfvhdlUniversePoint {
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
// ATRIBUTOS PRIVADOS DE LA CLASE
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/**Etiqueta.*/
private int etiq;
/**Primer valor.*/
private double val1;
/**Segundo valor.*/
private double val2;
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
// CONSTRUCTOR DE LA CLASE
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/**
* Constructor de XFvhdlUniversePoint.
*/
public XfvhdlUniversePoint(int e1, double v1, double v2) {
etiq = e1;
val1 = v1;
val2 = v2;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
// MÉTO_DOS PÚBLICOS DE LA CLASE
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++//
/**
* Método que devuelve la etiqueta.
* @return Devuelve la etiqueta del punto del universo de discurso.
*/
public int getEtiq() {
return etiq;
}
/**
* Método que devuelve el primer valor del punto.
* @return Primer valor del punto.
*/
public double getVal1() {
return val1;
}
/**
* Método que devuelve el segundo valor del punto.
* @return Segundo valor del punto.
*/
public double getVal2() {
return val2;
}
/**
* Método para establecer la etiqueta del punto.
* @param e1 Nuevo valor de la etiqueta.
*/
public void setEtiq(int e1) {
etiq = e1;
}
/**
* Método para establecer el primer valor del punto.
* @param v1 Nuevo valor1 del punto.
*/
public void setVal1(double v1) {
val1 = v1;
}
/**
* Método para establecer el segundo valor del punto.
* @param v2 Nuevo valor2 del punto.
*/
public void setVal2(double v2) {
val2 = v2;
}
} // Fin de la clase
|
[
"felipe.arruda.pontes@gmail.com"
] |
felipe.arruda.pontes@gmail.com
|
7d2523652a79119a20d5aa7472902d5ee80e29fc
|
fac5d6126ab147e3197448d283f9a675733f3c34
|
/src/main/java/dji/internal/version/component/DJIVersionWM230Component.java
|
854cd82a4fffbd3ae6f716afce687f595b00db55
|
[] |
no_license
|
KnzHz/fpv_live
|
412e1dc8ab511b1a5889c8714352e3a373cdae2f
|
7902f1a4834d581ee6afd0d17d87dc90424d3097
|
refs/heads/master
| 2022-12-18T18:15:39.101486
| 2020-09-24T19:42:03
| 2020-09-24T19:42:03
| 294,176,898
| 0
| 0
| null | 2020-09-09T17:03:58
| 2020-09-09T17:03:57
| null |
UTF-8
|
Java
| false
| false
| 234
|
java
|
package dji.internal.version.component;
public class DJIVersionWM230Component extends DJIVersionDM368Component {
/* access modifiers changed from: protected */
public boolean isCfgNeedVerify() {
return false;
}
}
|
[
"michael@districtrace.com"
] |
michael@districtrace.com
|
fc9849fd5b643a85cdc1640e1a1b5c5f9be7f857
|
cfc60fc1148916c0a1c9b421543e02f8cdf31549
|
/src/testcases/CWE23_Relative_Path_Traversal/CWE23_Relative_Path_Traversal__fromFile_54b.java
|
d8042cbe6619ada051257f336cf55dca7ae322fa
|
[
"LicenseRef-scancode-public-domain"
] |
permissive
|
zhujinhua/GitFun
|
c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2
|
987f72fdccf871ece67f2240eea90e8c1971d183
|
refs/heads/master
| 2021-01-18T05:46:03.351267
| 2012-09-11T16:43:44
| 2012-09-11T16:43:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,120
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__fromFile_54b.java
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-54b.tmpl.java
*/
/*
* @description
* CWE: 23 Relative Path Traversal
* BadSource: fromFile Read data from file (named c:\data.txt)
* GoodSource: A hardcoded string
* Sinks: readFile
* BadSink : no validation
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE23_Relative_Path_Traversal;
import testcasesupport.*;
import java.io.*;
import javax.servlet.http.*;
public class CWE23_Relative_Path_Traversal__fromFile_54b
{
public void bad_sink(String data ) throws Throwable
{
(new CWE23_Relative_Path_Traversal__fromFile_54c()).bad_sink(data );
}
/* goodG2B() - use goodsource and badsink */
public void goodG2B_sink(String data ) throws Throwable
{
(new CWE23_Relative_Path_Traversal__fromFile_54c()).goodG2B_sink(data );
}
}
|
[
"amitf@chackmarx.com"
] |
amitf@chackmarx.com
|
254554d94e05361ed362b6ba7fdd17b5c692856f
|
6dd10e6261b4b85264443b6c160db84548502861
|
/Javachobo/Day15_160118/MessageFormatEx1.java
|
e7671814c63953412d206835a4743afbee95c760
|
[] |
no_license
|
mirikim/JavaSamples
|
a139c23dc64397f8b37448c660b8911dd550ef3c
|
465cb9793a661670df4ed59341c3b9b00682f016
|
refs/heads/master
| 2021-01-10T06:42:52.188095
| 2016-02-14T04:25:12
| 2016-02-14T04:25:12
| 50,391,133
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 372
|
java
|
package Day15_160118;
import java.util.*;
import java.text.*;
public class MessageFormatEx1 {
public static void main(String[] args) {
String msg = "Name : {0} \nTel : {1} \nAge : {2} \nBirthday : {3}.";
Object[] arguments = { "이자바", "02-123-1234", "27", "07-09" };
String result = MessageFormat.format(msg, arguments);
System.out.println(result);
}
}
|
[
"rlaalfl92@nate.com"
] |
rlaalfl92@nate.com
|
24a5821de17a74a39220e46eea02a80083cff3f3
|
1c2bd070e3ef60789a096e21e858d9fcfbad931b
|
/semantictools-context-renderer/src/main/java/org/semantictools/index/api/LinkedDataIndexPrinter.java
|
90a68dd62a484ff4f84710cffaa3dc38c7d00561
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
1EdTech/semantictools
|
ecfc16943366471ad40d7348d4519178f4fa896e
|
11b8c565941a6d4ba038697da9bef9fc8267eb12
|
refs/heads/master
| 2022-12-07T10:32:08.579678
| 2016-12-18T21:07:58
| 2016-12-18T21:07:58
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,480
|
java
|
/*******************************************************************************
* Copyright 2012 Pearson Education
*
* 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.semantictools.index.api;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.semantictools.context.renderer.model.ContextProperties;
import org.semantictools.context.renderer.model.DocumentMetadata;
import org.semantictools.context.renderer.model.GlobalProperties;
import org.semantictools.context.renderer.model.ServiceDocumentation;
import org.semantictools.context.view.DefaultDocumentPrinter;
import org.semantictools.frame.api.LinkManager;
import org.semantictools.index.model.SchemaReference;
import org.semantictools.index.model.ServiceDocumentationList;
/**
* Prints an index to all of the documentation artifacts including ontologies,
* data types, rest services.
*
* @author Greg McFall
*
*/
public class LinkedDataIndexPrinter extends DefaultDocumentPrinter {
private LinkedDataIndex index;
private LinkManager linkManager;
private File indexFile;
public LinkedDataIndexPrinter(File indexFile, LinkedDataIndex index) {
super();
this.indexFile = indexFile;
File pubDir = indexFile.getParentFile();
this.index = index;
linkManager = new LinkManager();
linkManager.setBaseURI(pubDir.toString().replace("\\", "/") + "/");
pubDir.mkdirs();
DocumentMetadata metadata = new GlobalProperties();
metadata.setCss("uml/uml.css");
setMetadata(metadata);
}
public void printIndex() throws IOException {
clear();
beginHTML();
pushIndent();
printOntologies();
printDatatypes();
printServices();
printMediaTypes();
popIndent();
endHTML();
writeFile();
}
private void printMediaTypes() {
List<ContextProperties> list = index.listAllMediaTypes();
Collections.sort(list);
indent();
println("<H2>Media Types</H2>");
indent();
println("<UL>");
pushIndent();
for (ContextProperties context : list) {
String mediaType = context.getMediaType();
String mediaTypeHref = linkManager.relativize(context.getMediaTypeDocFile());
print("<LI>");
printAnchor(mediaTypeHref, mediaType);
println();
}
popIndent();
indent();
println("</UL>");
}
private void printDatatypes() {
List<SchemaReference> list = index.listDatatypes();
indent();
println("<H2>Data Types</H2>");
indent();
println("<UL>");
pushIndent();
for (SchemaReference r : list) {
String label = r.getSchemaLabel();
String href = linkManager.relativize(r.getSchemaDocPath());
indent();
print("<LI>");
printAnchor(href, label);
println();
}
popIndent();
indent();
println("</UL>");
}
private void printOntologies() {
List<SchemaReference> list = index.listOntologies();
Collections.sort(list);
indent();
println("<H2>Ontologies</H2>");
indent();
println("<UL>");
pushIndent();
for (SchemaReference r : list) {
String label = r.getSchemaLabel();
String href = linkManager.relativize(r.getSchemaDocPath());
indent();
print("<LI>");
printAnchor(href, label);
println();
}
popIndent();
indent();
println("</UL>");
}
private void writeFile() throws IOException {
FileWriter writer = new FileWriter(indexFile);
try {
String text = popText();
writer.write(text);
writer.flush();
} finally {
writer.close();
}
}
private void printServices() {
List<ServiceDocumentationList> megaList = index.listServices();
if (megaList.isEmpty()) return;
indent();
println("<H2>REST Services</H2>");
indent();
println("<UL>");
pushIndent();
Collections.sort(megaList, new Comparator<ServiceDocumentationList>() {
@Override
public int compare(ServiceDocumentationList a, ServiceDocumentationList b) {
return a.getRdfTypeLocalName().compareTo(b.getRdfTypeLocalName());
}
});
for (ServiceDocumentationList list : megaList) {
switch (list.size()) {
case 0 :
// Do nothing
break;
case 1:
printServiceDocumentation(list.getRdfTypeLocalName(), list.get(0));
break;
default :
printMultipleServicesForType(list);
break;
}
}
popIndent();
println("</UL>");
}
private void printServiceDocumentation(String rdfTypeLocalName, ServiceDocumentation serviceDocumentation) {
print("<LI> ");
String href = linkManager.relativize(serviceDocumentation.getServiceDocumentationFile());
printAnchor(href, rdfTypeLocalName + " Service");
println();
// pushIndent();
// print("<DIV ");
// printAttr("class", "mediatype");
// println(">");
// pushIndent();
// for (ContextProperties context : serviceDocumentation.listContextProperties()) {
// String mediaType = context.getMediaType();
// String mediaTypeHref = linkManager.relativize(context.getMediaTypeDocFile());
// print("<DIV>");
// printAnchor(mediaTypeHref, mediaType);
// println("</DIV>");
// }
//
// popIndent();
// println("</DIV>");
popIndent();
}
private void printMultipleServicesForType(ServiceDocumentationList list) {
// TODO Auto-generated method stub
}
}
|
[
"gregory.mcfall@gmail.com"
] |
gregory.mcfall@gmail.com
|
666503fcaff20a1f43e9ffe5c6e21980d9366065
|
6648c0627f88fca806047700ae63619cd9c93264
|
/src/main/java/com/app/habilitation/service/TypeEntiteServiceImpl.java
|
6e0a73fcac698047939cf49e145bcf65390c7b62
|
[] |
no_license
|
HeshamOsman/habilitation
|
0b475af3138bc535ec1b61db0d3032286637fb86
|
b1e33f63a818f152c31c2377d1393c181918f488
|
refs/heads/master
| 2022-11-11T17:19:22.343173
| 2020-07-04T18:36:06
| 2020-07-04T18:36:06
| 277,165,499
| 0
| 0
| null | 2020-07-04T18:37:11
| 2020-07-04T18:33:43
|
Java
|
UTF-8
|
Java
| false
| false
| 1,296
|
java
|
package com.app.habilitation.service;
import java.util.List;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.app.habilitation.dao.TypeEntiteDao;
import com.app.habilitation.entity.EntiteEntity;
import com.app.habilitation.entity.TypeEntiteEntity;
@Service
public class TypeEntiteServiceImpl implements TypeEntiteService {
@Autowired
private TypeEntiteDao typeEntiteDao;
public TypeEntiteServiceImpl(TypeEntiteDao theTypeEntiteDao) {
typeEntiteDao=theTypeEntiteDao;
}
@Override
public void save(TypeEntiteEntity theTypeEntite) {
typeEntiteDao.save(theTypeEntite);
}
@Override
public TypeEntiteEntity findbyId(int typeEntiteId) {
Optional<TypeEntiteEntity> result = typeEntiteDao.findById(typeEntiteId);
TypeEntiteEntity theTypeEntite=null;
if(result.isPresent()) {
theTypeEntite =result.get();
}
else {
throw new RuntimeException("Impossible de trouver le type d'entié avec l'id :"+ typeEntiteId);
}
return theTypeEntite;
}
@Override
public void deleteById(int typeEntiteId) {
typeEntiteDao.deleteById(typeEntiteId);
}
@Override
public List<TypeEntiteEntity> findAll() {
return typeEntiteDao.findAll();
}
}
|
[
"hesham.osman28@yahoo.com"
] |
hesham.osman28@yahoo.com
|
c105b9d858d803a4f38e700c53455a89ce9f6d59
|
c94f888541c0c430331110818ed7f3d6b27b788a
|
/baasdt/java/src/main/java/com/antgroup/antchain/openapi/baasdt/models/ConfirmConsumecardBillcreateResponse.java
|
327cf725f64a068fb2b8a00802f456a1456b3976
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
alipay/antchain-openapi-prod-sdk
|
48534eb78878bd708a0c05f2fe280ba9c41d09ad
|
5269b1f55f1fc19cf0584dc3ceea821d3f8f8632
|
refs/heads/master
| 2023-09-03T07:12:04.166131
| 2023-09-01T08:56:15
| 2023-09-01T08:56:15
| 275,521,177
| 9
| 10
|
MIT
| 2021-03-25T02:35:20
| 2020-06-28T06:22:14
|
PHP
|
UTF-8
|
Java
| false
| false
| 1,429
|
java
|
// This file is auto-generated, don't edit it. Thanks.
package com.antgroup.antchain.openapi.baasdt.models;
import com.aliyun.tea.*;
public class ConfirmConsumecardBillcreateResponse extends TeaModel {
// 请求唯一ID,用于链路跟踪和问题排查
@NameInMap("req_msg_id")
public String reqMsgId;
// 结果码,一般OK表示调用成功
@NameInMap("result_code")
public String resultCode;
// 异常信息的文本描述
@NameInMap("result_msg")
public String resultMsg;
public static ConfirmConsumecardBillcreateResponse build(java.util.Map<String, ?> map) throws Exception {
ConfirmConsumecardBillcreateResponse self = new ConfirmConsumecardBillcreateResponse();
return TeaModel.build(map, self);
}
public ConfirmConsumecardBillcreateResponse setReqMsgId(String reqMsgId) {
this.reqMsgId = reqMsgId;
return this;
}
public String getReqMsgId() {
return this.reqMsgId;
}
public ConfirmConsumecardBillcreateResponse setResultCode(String resultCode) {
this.resultCode = resultCode;
return this;
}
public String getResultCode() {
return this.resultCode;
}
public ConfirmConsumecardBillcreateResponse setResultMsg(String resultMsg) {
this.resultMsg = resultMsg;
return this;
}
public String getResultMsg() {
return this.resultMsg;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
a43bbb76481e6fc8975bccb09171f4a25846dc7d
|
26a837b93cf73e6c372830f9a7a316c01081a4ea
|
/extras/spytools/src/main/java/arez/spytools/browser/BrowserSpyUtil.java
|
5ac35d66a5ab4a9c5bbccc8307b0da34e94cb936
|
[
"Apache-2.0"
] |
permissive
|
arez/arez
|
033b27f529b527c747b2a93f3c2c553c41c32acd
|
df68d72a69d3af1123e7d7c424f77b74f13f8052
|
refs/heads/master
| 2023-06-08T00:09:56.319223
| 2023-06-05T02:12:14
| 2023-06-05T02:12:14
| 96,367,327
| 13
| 4
|
Apache-2.0
| 2022-12-10T20:29:35
| 2017-07-05T22:50:24
|
Java
|
UTF-8
|
Java
| false
| false
| 1,633
|
java
|
package arez.spytools.browser;
import arez.Arez;
import arez.ArezContext;
import java.util.HashMap;
import java.util.Map;
/**
* Utility class for interacting with spy capabilities.
*/
public final class BrowserSpyUtil
{
private static final Map<ArezContext, ConsoleSpyEventProcessor> c_processors =
Arez.areSpiesEnabled() ? new HashMap<>() : null;
/**
* Return true if spy event logging is enabled.
*
* @return true if spy event logging is enabled.
*/
public static boolean isSpyEventLoggingEnabled()
{
return Arez.areSpiesEnabled() && c_processors.containsKey( Arez.context() );
}
/**
* Enable console logging of all spy events.
* This is a noop if spies are not enabled or logging has already been enabled.
*/
public static void enableSpyEventLogging()
{
if ( Arez.areSpiesEnabled() && !isSpyEventLoggingEnabled() )
{
final ConsoleSpyEventProcessor handler = new ConsoleSpyEventProcessor();
final ArezContext context = Arez.context();
context.getSpy().addSpyEventHandler( handler );
c_processors.put( context, handler );
}
}
/**
* Disable console logging of all spy events.
* This is a noop if spies are not enabled or logging is not enabled.
*/
public static void disableSpyEventLogging()
{
if ( Arez.areSpiesEnabled() && isSpyEventLoggingEnabled() )
{
final ArezContext context = Arez.context();
final ConsoleSpyEventProcessor handler = c_processors.remove( context );
assert null != handler;
context.getSpy().removeSpyEventHandler( handler );
}
}
private BrowserSpyUtil()
{
}
}
|
[
"peter@realityforge.org"
] |
peter@realityforge.org
|
9c1d6a952616144f4f42bdb74ad52e0bb67a6802
|
20f97e85627032f6036976b8fefe62c40a79aca1
|
/app/tzuyu.core/src/test/java/tzuyu/core/main/AssertionGenerationAllTest.java
|
c69d3fcc9ecea0661b032b4cb75312268e80e4d0
|
[] |
no_license
|
sunjun-group/Ziyuan
|
d0279366ac896042a7a79f7cc0402fd60545cb0b
|
8922ff1f3781139c619790f49d0e79632ab753fa
|
refs/heads/master
| 2020-04-09T06:04:30.796500
| 2018-01-03T08:43:57
| 2018-01-03T08:43:57
| 20,321,407
| 1
| 10
| null | 2016-11-07T07:16:04
| 2014-05-30T07:52:13
|
Java
|
UTF-8
|
Java
| false
| false
| 7,971
|
java
|
/* Copyright (C) 2013 by SUTD (Singapore)
* All rights reserved.
*
* Author: SUTD
* Version: $Revision: 1 $
*/
package tzuyu.core.main;
import java.io.File;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVParser;
import org.apache.commons.csv.CSVRecord;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import icsetlv.variable.VarNameVisitor.VarNameCollectionMode;
import libsvm.svm;
import libsvm.svm_print_interface;
import sav.common.core.SystemVariablesUtils;
import sav.commons.testdata.opensource.TestPackage;
import sav.commons.testdata.opensource.TestPackage.TestDataColumn;
/**
* @author LLT
*
*/
public class AssertionGenerationAllTest extends AbstractTzPackageTest {
protected AssertionGeneration gen;
protected AssertionGenerationParams params;
private static Logger log = LoggerFactory.getLogger(AssertionGenerationAllTest.class);
private String testDataFile = "/Users/HongLongPham/Workspace/Tzuyu/etc/testdata.csv";
@Before
public void setup() {
super.setup();
String jarPath = SystemVariablesUtils.updateSavJunitJarPath(appData);
appData.addClasspath(jarPath);
params = new AssertionGenerationParams();
params.setMachineLearningEnable(true);
params.setRankToExamine(10);
params.setRunMutation(false);
params.setUseSlicer(true);
params.setValueRetrieveLevel(3);
params.setNumberOfTestCases(10);
params.setVarNameCollectionMode(VarNameCollectionMode.FULL_NAME);
svm.svm_set_print_string_function(new svm_print_interface() {
@Override
public void print(String s) {
// TODO Auto-generated method stub
}
});
}
private void setTests(boolean hasTests) {
if (hasTests)
params.setJunitClassNames(junitClassNames);
else
params.setJunitClassNames(new ArrayList<String>());
}
private void setTests(boolean hasTests, int loop) {
if (hasTests) {
String tests = junitClassNames.get(0) + loop;
params.setJunitClassNames(Arrays.asList(tests));
}
else
params.setJunitClassNames(new ArrayList<String>());
}
public void genAssertion(TestPackage testPkg, boolean hasTests,
boolean repeat, int loop) throws Exception {
prepare(testPkg);
params.setTestingClassNames(testingClassNames);
params.setTestingPkgs(testingPackages);
gen = new AssertionGeneration(context);
if (repeat) {
log.info("Loop {}\n", loop);
setTests(hasTests, loop);
} else {
setTests(hasTests);
}
long startTime = System.currentTimeMillis();
gen.genAssertion(params);
long endTime = System.currentTimeMillis();
log.info("Time = {}\n", endTime - startTime);
}
/**
* test part
*/
class Task implements Callable<String> {
private String project;
private String id;
private String method;
private boolean hasTests;
private boolean repeat;
private int loop;
public Task(String project, String id, String method,
boolean hasTests, boolean repeat, int loop) {
this.project = project;
this.id = id;
this.method = method;
this.hasTests = hasTests;
this.repeat = repeat;
this.loop = loop;
}
@Override
public String call() throws Exception {
TestPackage testPkg = TestPackage.getPackage(project, id);
params.setMethodName(method);
genAssertion(testPkg, hasTests, repeat, loop);
return "Finish!";
}
}
private void test(String projectName, int startIndex, int endIndex,
boolean hasTests, boolean repeat) throws Exception {
long startTime = System.currentTimeMillis();
CSVFormat format = CSVFormat.EXCEL.withHeader(TestDataColumn.allColumns());
CSVParser parser = CSVParser.parse(new File(
testDataFile), Charset.forName("UTF-8"), format);
List<CSVRecord> records = parser.getRecords();
for (int i = startIndex; i <= endIndex; i++) {
CSVRecord record = records.get(i);
String project = record.get(0);
String id = record.get(1);
String method = record.get(11);
if (project.equals(projectName)) {
log.info("Project = {}\n", project);
log.info("ID = {}\n", id);
log.info("Method = {}\n", method);
int loop = repeat ? 20 : 1;
for (int j = 1; j <= loop; j++) {
ExecutorService executor = Executors.newSingleThreadExecutor();
Future<String> future = executor.submit(new Task(project, id, method,
hasTests, repeat, j));
try {
future.get(180, TimeUnit.SECONDS);
} catch (TimeoutException e) {
future.cancel(true);
log.info("Timeout!!!\n");
}
executor.shutdownNow();
}
}
}
long endTime = System.currentTimeMillis();
log.info("Total time = {}\n", endTime - startTime);
}
@Test
public void testAlgorithmsAll1() throws Exception {
test("algorithms-master", 4, 35, true, false);
}
@Test
public void testAlgorithmsAll2() throws Exception {
test("algorithms-master", 36, 77, true, false);
}
@Test
public void testAlgorithmsAll2b() throws Exception {
test("algorithms-master", 36, 63, true, false);
}
@Test
public void testAlgorithmsAll2c() throws Exception {
test("algorithms-master", 65, 77, true, false);
}
@Test
public void testAlgorithmsAll3() throws Exception {
test("algorithms-master", 78, 99, true, false);
}
@Test
public void testJodaTimeAll1() throws Exception {
test("joda-time-master", 118, 167, true, false);
}
@Test
public void testJodaTimeAll2() throws Exception {
test("joda-time-master", 168, 217, true, false);
}
@Test
public void testJodaTimeAll3() throws Exception {
test("joda-time-master", 218, 267, true, false);
}
@Test
public void testJodaTimeAll4() throws Exception {
test("joda-time-master", 268, 317, true, false);
}
@Test
public void testJodaTimeAll5() throws Exception {
test("joda-time-master", 318, 353, true, false);
}
@Test
public void testJodaMoneyAll1() throws Exception {
test("joda-money-master", 354, 400, true, false);
}
@Test
public void testJodaMoneyAll2() throws Exception {
test("joda-money-master", 401, 446, true, false);
}
@Test
public void testSVCompAll1() throws Exception {
test("svcomp", 447, 448, true, true);
}
@Test
public void testSVCompAll2() throws Exception {
test("svcomp", 449, 450, true, true);
}
@Test
public void testSVCompAll3() throws Exception {
test("svcomp", 451, 452, true, true);
}
@Test
public void testSVCompAll4() throws Exception {
test("svcomp", 453, 454, true, true);
}
@Test
public void testSVCompAll5() throws Exception {
test("svcomp", 455, 456, true, true);
}
@Test
public void testJavaLibAll() throws Exception {
test("java-library", 457, 509, true, false);
}
@Test
public void testAll() throws Exception {
// testAlgorithmsAll1();
// testAlgorithmsAll2();
// testAlgorithmsAll3();
// testJodaTimeAll1();
// testJodaTimeAll2();
// testJodaTimeAll3();
// testJodaTimeAll4();
// testJodaTimeAll5();
//
// testJodaMoneyAll1();
// testJodaMoneyAll2();
//
testSVCompAll1();
testSVCompAll2();
testSVCompAll3();
testSVCompAll4();
testSVCompAll5();
//
// testJavaLibAll();
// testAlgorithmsAll2b();
// testAlgorithmsAll2c();
}
@Test
public void testSingle() throws Exception {
// test("joda-time-master", 186, 186, true, false);
// test("joda-time-master", 193, 193, true, false);
// test("joda-time-master", 196, 196, true, false);
// test("joda-time-master", 299, 299, true, false);
// test("java-library", 507, 509, true, false);
// test("joda-money-master", 365, 365, true, false);
test("svcomp", 452, 452, true, true);
}
}
|
[
"longph1989@gmail.com"
] |
longph1989@gmail.com
|
6eee5296813017a663714f756164500559fcd675
|
e0d01559725c2de2c7abf1223f44f047a31002e1
|
/javase/src/main/java/com/gaopal/java/c01_advance/juc/c_003/T.java
|
9bff9ff2409f5ac7699bb8db159dbe90def4b30d
|
[] |
no_license
|
warfu/source-code-analysis
|
699f31457809ef93cbd5abb98e6cfd38aafa27b8
|
e02bd99028ae6292f77174df8e6cc1633a3138ba
|
refs/heads/main
| 2023-07-16T16:15:06.024381
| 2021-08-15T12:33:24
| 2021-08-15T12:33:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 399
|
java
|
/**
* synchronized�ؼ��� ��ij���������
*
* @author mashibing
*/
package com.gaopal.java.c01_advance.juc.c_003;
public class T {
private int count = 10;
public synchronized void m() { // ��ͬ���ڷ����Ĵ���ִ��ʱҪsynchronized(this)
count--;
System.out.println(Thread.currentThread().getName() + " count = " + count);
}
}
|
[
"ftd.gaopal@gmail.com"
] |
ftd.gaopal@gmail.com
|
0df0ee66953a3bb6f215a4a235ef27f0c94c5061
|
6c6b156857bc1331ca88e893b2999a11d03d746f
|
/oas-validator-compatibility/src/test/java/org/apache/servicecomb/toolkit/oasv/compatibility/validators/schema/request/SchemaUniqueItemsChangeInRequestValidatorTest.java
|
4356b44c121ef2ca30187fd8641ec732e1843e15
|
[
"MIT",
"Apache-2.0"
] |
permissive
|
NewCapec-Institute/oas-validator
|
da21d08d2c9b405bbaa9d6b15eeab52638040cb2
|
eb073aea2a80ccfe7abecdd34f62e7d2182d7199
|
refs/heads/master
| 2020-08-09T12:46:16.657798
| 2019-10-12T01:43:00
| 2019-10-14T01:19:23
| 214,091,043
| 5
| 5
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,386
|
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.servicecomb.toolkit.oasv.compatibility.validators.schema.request;
import org.apache.servicecomb.toolkit.oasv.diffvalidation.api.OasDiffViolation;
import org.apache.servicecomb.toolkit.oasv.diffvalidation.api.SchemaCompareValidator;
import org.apache.servicecomb.toolkit.oasv.diffvalidation.config.OasDiffValidatorsSkeletonConfiguration;
import org.apache.servicecomb.toolkit.oasv.compatibility.validators.OasCompatibilityTestBase;
import io.swagger.v3.oas.models.OpenAPI;
import org.junit.Test;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ContextConfiguration;
import java.util.List;
import static org.apache.servicecomb.toolkit.oasv.common.OasObjectType.*;
import static org.assertj.core.api.Assertions.assertThat;
@ContextConfiguration(classes = SchemaUniqueItemsChangeInRequestValidatorTest.TestConfiguration.class)
public class SchemaUniqueItemsChangeInRequestValidatorTest extends OasCompatibilityTestBase {
@Test
public void validate() {
OpenAPI leftOpenAPI = loadRelative("petstore-schema-unique-items-in-request-a.yaml");
OpenAPI rightOpenAPI = loadRelative("petstore-schema-unique-items-in-request-b.yaml");
List<OasDiffViolation> violations = oasSpecDiffValidator
.validate(createContext(leftOpenAPI, rightOpenAPI), leftOpenAPI, rightOpenAPI);
assertThat(violations)
.containsExactlyInAnyOrder(
createViolationBoth(
"仅允许true->false的修改",
new Object[] {
"paths", PATHS,
"/pets", PATH_ITEM,
"get", OPERATION,
"parameters[0]", PARAMETER,
"schema", SCHEMA,
"properties.'foo'", SCHEMA,
"uniqueItems", null
}
),
createViolationBoth(
"仅允许true->false的修改",
new Object[] {
"paths", PATHS,
"/pets", PATH_ITEM,
"get", OPERATION,
"requestBody", REQUEST_BODY,
"content.'application/xml'", MEDIA_TYPE,
"schema", SCHEMA,
"properties.'foo'", SCHEMA,
"uniqueItems", null
}
)
);
}
@Configuration
@Import(OasDiffValidatorsSkeletonConfiguration.class)
public static class TestConfiguration {
@Bean
public SchemaCompareValidator schemaUniqueItemsChangeInRequestValidator() {
return new SchemaUniqueItemsChangeInRequestValidator();
}
}
}
|
[
"chanjarster@gmail.com"
] |
chanjarster@gmail.com
|
1a124de7dfe0dab4d0fd586191dd09d24950c3a5
|
c9e0227c3958db89747488328bd2b255e54f008f
|
/solutions/0336. Palindrome Pairs/0336.java
|
d237a99b8927cf14531644d43e990fbfaaef5e48
|
[] |
no_license
|
XkhldY/LeetCode
|
2deba28b7491c36b4f224c3132fb89feea318832
|
94e23db2668615d9fe09e129a96c22ae4e83b9c8
|
refs/heads/main
| 2023-04-03T08:17:30.743071
| 2021-04-14T23:34:03
| 2021-04-14T23:34:03
| 358,136,537
| 1
| 0
| null | 2021-04-15T05:20:21
| 2021-04-15T05:20:21
| null |
UTF-8
|
Java
| false
| false
| 1,200
|
java
|
class Solution {
public List<List<Integer>> palindromePairs(String[] words) {
List<List<Integer>> ans = new ArrayList<>();
Map<String, Integer> map = new HashMap<>(); // {reversed word: its index}
for (int i = 0; i < words.length; ++i)
map.put(new StringBuilder(words[i]).reverse().toString(), i);
for (int i = 0; i < words.length; ++i) {
final String word = words[i];
// special case to prevent duplicate calculation
if (map.containsKey("") && map.get("") != i && isPalindrome(word))
ans.add(Arrays.asList(i, map.get("")));
for (int j = 1; j <= word.length(); ++j) {
final String l = word.substring(0, j);
final String r = word.substring(j);
if (map.containsKey(l) && map.get(l) != i && isPalindrome(r))
ans.add(Arrays.asList(i, map.get(l)));
if (map.containsKey(r) && map.get(r) != i && isPalindrome(l))
ans.add(Arrays.asList(map.get(r), i));
}
}
return ans;
}
private boolean isPalindrome(final String word) {
int l = 0;
int r = word.length() - 1;
while (l < r)
if (word.charAt(l++) != word.charAt(r--))
return false;
return true;
}
}
|
[
"walkccray@gmail.com"
] |
walkccray@gmail.com
|
72ebac5213c4c9c71eefeb552a6b183871f76e4b
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/JetBrains--intellij-community/5a4add8c6b7f3f15b4dcabffe0b600b9bd5a7728/before/Comment.java
|
b9d33911d46e07272f0495f2b3d0033d5d41eff7
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,310
|
java
|
/*
* Copyright 2000-2010 JetBrains s.r.o.
*
* 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.intellij.tasks;
import org.jetbrains.annotations.Nullable;
import java.util.Date;
/**
* @author Dmitry Avdeev
*/
public abstract class Comment {
public static final Comment[] EMPTY_ARRAY = new Comment[0];
public abstract String getText();
@Nullable
public abstract String getAuthor();
@Nullable
public abstract Date getDate();
public void appendTo(StringBuilder builder) {
builder.append("<hr>");
if (getAuthor() != null) {
builder.append("<b>Author:</b> ").append(getAuthor()).append("<br>");
}
if (getDate() != null) {
builder.append("<b>Date:</b> ").append(getDate()).append("<br>");
}
builder.append(getText()).append("<br>");
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
fd6e57967e3c2e6d4cf909029d69d8eaa9d10911
|
8c3d546fa112e65c3efe86e97111037e0548911d
|
/Homeworks/Homework02/Task19.java
|
3698152c8b8ad1898c3fff59b34a7db32348625a
|
[] |
no_license
|
zaki1993/ITTallents
|
c87a0235786fd61286869dfa33223e9647aa1d34
|
633901236fbb581da3e86ba76d7221e83476cef4
|
refs/heads/master
| 2021-01-11T05:11:39.978810
| 2017-08-30T08:12:25
| 2017-08-30T08:12:25
| 81,219,928
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 410
|
java
|
import java.util.Scanner;
public class Task19 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int a;
System.out.println("Please enter a from 10 to 99");
a = input.nextInt();
for(;;){
if(a == 1){
break;
}
if(a % 2 == 0){
System.out.print(a/2 + " ");
a/=2;
}
else{
System.out.print((3*a + 1) + " ");
a = 3*a + 1;
}
}
}
}
|
[
"zaki1993@abv.bg"
] |
zaki1993@abv.bg
|
73581516ee59a8b090ea9aff7279adc8deb3eaaa
|
6668b80969ffbaec0a5de67d524835600bdaf884
|
/app/src/main/java/com/zoptal/chinamoonbuffet/JsonClasses/Json_MenuData_Srch.java
|
bfa24481ea32f8e101398942beba397f3d2d557b
|
[] |
no_license
|
gargpreeti/Chinamoonbuffet
|
553a82cdd71ef3a88cf48d589f9ff7aff9440dd9
|
ed288139b3c0e9c51ccc4e3da2b1305aca860b10
|
refs/heads/master
| 2020-12-03T01:59:11.341629
| 2017-06-30T13:26:46
| 2017-06-30T13:26:46
| 95,890,745
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,214
|
java
|
package com.zoptal.chinamoonbuffet.JsonClasses;
import android.app.ProgressDialog;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import android.widget.GridView;
import com.zoptal.chinamoonbuffet.adapter.CustomListAdapter;
import com.zoptal.chinamoonbuffet.url.RegisterUrl;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class Json_MenuData_Srch extends AsyncTask<String, String, String> {
Context context;
String coderesponse;
ProgressDialog loading;
public static Model_MenuData model_menudata;
// public CustomListAdapter adapter_customlist;
GridView gridView;
public Json_MenuData_Srch(Context context,GridView gridView) {
// TODO Auto-generated constructor stub
this.context = context;
this.gridView=gridView;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
loading = new ProgressDialog(context);
loading.setMessage("loading");
loading.show();
}
@Override
protected String doInBackground(String... params) {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(
RegisterUrl.menu_data);
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("category",params[0]));
nameValuePairs.add(new BasicNameValuePair("search",params[1]));
nameValuePairs.add(new BasicNameValuePair("page_no",params[2]));
nameValuePairs.add(new BasicNameValuePair("no_of_post",params[3]));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
Log.e("paramerts---",""+nameValuePairs);
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
if (entity != null) {
String result1 = EntityUtils.toString(entity);
Log.e("menu data result------",""+result1.trim());
model_menudata = new Model_MenuData();
ArrayList<MenuData> menudata = new ArrayList<MenuData>();
JSONObject main_obj = new JSONObject(result1);
coderesponse=main_obj.getString("code");
JSONArray ary_products =main_obj.getJSONArray("data");
for (int i = 0; i < ary_products.length(); i++) {
JSONObject obj = ary_products.getJSONObject(i);
String id = obj.getString("id");
String title = obj.getString("title");
String category = obj.getString("category");
String category_name = obj.getString("category_name");
String image = obj.getString("image");
String description = obj.getString("description");
String price = obj.getString("price");
String posted = obj.getString("posted");
MenuData f = new MenuData();
f.setId(id);
f.setTitle(title);
f.setCategory(category);
f.setCategoryname(category_name);
f.setImage(image);
f.setDescription(description);
f.setPrice(price);
f.setPosted(posted);
menudata.add(f);
}
model_menudata.setAl_menudata(menudata);
}
} catch (Exception e) {
Log.e("==+result menudata===", "======" + e);
}
return coderesponse;
}
@Override
protected void onPostExecute(String result) {
// TODO Auto-generated method stub
super.onPostExecute(result);
loading.dismiss();
gridView.setAdapter(new CustomListAdapter(context, model_menudata));
// ArrayList<MenuData> menudataArrayList=new ArrayList<>();
// ArrayList<MenuData> menudatalist= adapter_customlist.getCurrentList();
//
// for (int i = 0; i <model_menudata.getAl_menudata().size(); i++) {
// boolean check=true;
// for (int j = 0; j< menudatalist.size() ; j++) {
//
// if (menudatalist.get(j).getId().equalsIgnoreCase(model_menudata.getAl_menudata().get(i).getId()) )
// {
// check=false;
// }
// }
// if(check)
// {
// menudataArrayList.add(model_menudata.getAl_menudata().get(i));
// }
// }
// adapter_customlist.setAddList(menudataArrayList);
//
}
}
|
[
"preeti@zoptal.com"
] |
preeti@zoptal.com
|
79ba5329ce477c4bba33297fdde348cc8cdafa12
|
0e6a786186c7ee50191af2971dbc9fe23d717a20
|
/app/src/main/java/com/kingja/cardpackage/Event/AgentDialogEvent.java
|
38ae1b03fbf15e619675976ef28fbbb4dd1076af
|
[] |
no_license
|
KingJA/RentManager
|
9cfefae120bfa3cbe1657da4a322b30a3ec110cd
|
abbce1227506eb88f7d2b390f11a16c70f640034
|
refs/heads/master
| 2021-01-12T17:18:29.409161
| 2018-07-17T05:23:15
| 2018-07-17T05:23:15
| 71,545,487
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 475
|
java
|
package com.kingja.cardpackage.Event;
/**
* Description:TODO
* Create Time:2016/9/27 9:43
* Author:KingJA
* Email:kingjavip@gmail.com
*/
public class AgentDialogEvent {
private boolean showDialog;
public AgentDialogEvent(boolean showDialog) {
this.showDialog = showDialog;
}
public boolean isShowDialog() {
return showDialog;
}
public void setShowDialog(boolean showDialog) {
this.showDialog = showDialog;
}
}
|
[
"kingjavip@gmail.com"
] |
kingjavip@gmail.com
|
d1654f8f216a9dc86508e14185de5dc875c92f2e
|
5741045375dcbbafcf7288d65a11c44de2e56484
|
/reddit-decompilada/com/instabug/library/p015a/C0598a.java
|
6c622254c7987841fc9b649b411667acf3879a78
|
[] |
no_license
|
miarevalo10/ReporteReddit
|
18dd19bcec46c42ff933bb330ba65280615c281c
|
a0db5538e85e9a081bf268cb1590f0eeb113ed77
|
refs/heads/master
| 2020-03-16T17:42:34.840154
| 2018-05-11T10:16:04
| 2018-05-11T10:16:04
| 132,843,706
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 947
|
java
|
package com.instabug.library.p015a;
import com.instabug.library.C0645b;
import com.instabug.library.C0662e;
import com.instabug.library.Feature;
import com.instabug.library.Feature.State;
import com.instabug.library.internal.video.InternalAutoScreenRecorderHelper;
import java.lang.Thread.UncaughtExceptionHandler;
/* compiled from: InstabugUncaughtExceptionHandler */
public class C0598a implements UncaughtExceptionHandler {
UncaughtExceptionHandler f9396a = Thread.getDefaultUncaughtExceptionHandler();
public void uncaughtException(Thread thread, Throwable th) {
if (InternalAutoScreenRecorderHelper.getInstance().isEnabled()) {
InternalAutoScreenRecorderHelper.getInstance().setCrashOccurred(true);
}
C0662e a = C0662e.m8164a();
if (C0645b.m8104a().m8113b(Feature.INSTABUG) == State.ENABLED) {
a.m8171b();
}
this.f9396a.uncaughtException(thread, th);
}
}
|
[
"mi.arevalo10@uniandes.edu.co"
] |
mi.arevalo10@uniandes.edu.co
|
938104cbf1abadde092d23b12b1ea6eb17ae53d6
|
16e5b7cec70c57a061cd2d29a902a74605da5640
|
/agan-redis-hash/hash/redis-hash-cart/src/main/java/com/agan/redis/controller/CookieCartController.java
|
ebe62804ee7913a633f9c1b1e8b77e5146d99bc6
|
[] |
no_license
|
zhoudy-github/agan-redis
|
071d7c05e104d8ee52e80341795d01530b37c931
|
c13d5db9ba52b86354d802361edfd98e27ca8295
|
refs/heads/master
| 2023-03-22T15:09:32.638387
| 2020-05-07T14:23:35
| 2020-05-07T14:23:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,040
|
java
|
package com.agan.redis.controller;
import com.agan.redis.service.IdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@RestController
@Slf4j
@RequestMapping(value = "/cookiecart")
public class CookieCartController {
@Autowired
private RedisTemplate redisTemplate;
@Autowired
private IdGenerator idGenerator;
@Autowired
private HttpServletRequest request;
@Autowired
private HttpServletResponse response;
public static final String COOKIE_KEY = "cart:cookie:";
/**
* 添加购物车
*/
@PostMapping(value = "/addCart")
public void addCart(CookieCart obj) {
String cartId=this.getCookiesCartId();
String key=COOKIE_KEY+cartId;
Boolean hasKey = redisTemplate.opsForHash().getOperations().hasKey(key);
//存在
if(hasKey){
this.redisTemplate.opsForHash().put(key, obj.getProductId().toString(),obj.getAmount());
}else{
this.redisTemplate.opsForHash().put(key, obj.getProductId().toString(), obj.getAmount());
this.redisTemplate.expire(key,90, TimeUnit.DAYS);
}
}
@PostMapping(value = "/updateCart")
public void updateCart(CookieCart obj) {
String cartId=this.getCookiesCartId();
String key=COOKIE_KEY+cartId;
this.redisTemplate.opsForHash().put(key, obj.getProductId().toString(),obj.getAmount());
}
/**
* 删除购物车
*/
@PostMapping(value = "/delCart")
public void delCart(Long productId) {
String cartId=this.getCookiesCartId();
String key=COOKIE_KEY+cartId;
this.redisTemplate.opsForHash().delete(key, productId.toString());
}
/**
* 查询某个用户的购物车
*/
@PostMapping(value = "/findAll")
public CartPage findAll() {
String cartId=this.getCookiesCartId();
String key=COOKIE_KEY+cartId;
CartPage<CookieCart> cartPage=new CartPage();
//查询该用户购物车的总数
long size=this.redisTemplate.opsForHash().size(key);
cartPage.setCount((int)size);
//查询购物车的所有商品
Map<String,Integer> map= this.redisTemplate.opsForHash().entries(key);
List<CookieCart> cartList=new ArrayList<>();
for (Map.Entry<String,Integer> entry:map.entrySet()){
CookieCart cart=new CookieCart();
cart.setProductId(Long.parseLong(entry.getKey()));
cart.setAmount(entry.getValue());
cartList.add(cart);
}
cartPage.setCartList(cartList);
return cartPage;
}
/**
* 获取cookies
*/
public String getCookiesCartId(){
//第一步:先检查cookies是否有cartid
Cookie[] cookies = request.getCookies();
if(cookies != null){
for(Cookie cookie : cookies){
if(cookie.getName().equals("cartId")){
return cookie.getValue();
}
}
}
//第二步:cookies没有cartid,直接生成全局id,并设置到cookie里面
//生成全局唯一id
long id=this.idGenerator.incrementId();
//设置到cookies
Cookie cookie=new Cookie("cartId",String.valueOf(id));
response.addCookie(cookie);
return id+"";
}
/**
* 合并购物车
* 把cookie中的购物车合并到登录用户的购物车
*/
@PostMapping(value = "/mergeCart")
public void mergeCart(Long userId) {
//第一步:提取未登录用户的cookie的购物车数据
String cartId=this.getCookiesCartId();
String keycookie=COOKIE_KEY+cartId;
Map<String,Integer> map= this.redisTemplate.opsForHash().entries(keycookie);
//第二步:把cookie中得购物车合并到登录用户的购物车
String keyuser = "cart:user:" + userId;
this.redisTemplate.opsForHash().putAll(keyuser,map);
//第三步:删除redis未登录的用户cookies的购物车数据
this.redisTemplate.delete(keycookie);
//第四步:删除未登录用户cookies的cartid
Cookie cookie=new Cookie("cartId",null);
cookie.setMaxAge(0);
response.addCookie(cookie);
}
}
|
[
"pamgogdpyc@163.com"
] |
pamgogdpyc@163.com
|
78153cf572973f6ad1c05a84b8dab861f959ea72
|
57d9528778441ccc4c4cbe37df8a908a9eaf15c5
|
/src/com/book/JPRGerbertShildt/example/patterns/structural/composite/composite4/UnknownCar.java
|
b83a6114f59e775ac48fc42f2c0c923010fe843b
|
[] |
no_license
|
Sergei-JD/bookExample
|
fa7b566a7551f780df2d0fbebe296a8dfa1fe106
|
33a8c573faf2b9c74b9ffdefc159478812ea447a
|
refs/heads/master
| 2023-08-07T10:19:00.428421
| 2021-10-06T19:40:33
| 2021-10-06T19:40:33
| 410,612,439
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 231
|
java
|
package com.book.JPRGerbertShildt.example.patterns.structural.composite.composite4;
public class UnknownCar implements Car {
public void draw(String color) {
System.out.println("UnknownCar color: " + color);
}
}
|
[
"sergshlyazhko@gmail.com"
] |
sergshlyazhko@gmail.com
|
187a2b4e4de76d5843985b229da8070b2b77128b
|
883b7801d828a0994cae7367a7097000f2d2e06a
|
/python/experiments/projects/cloudera-director-sdk/real_error_dataset/1/149/PasswordChange.java
|
eac73bd7d8621bf032e980d3745af56422cb9d24
|
[] |
no_license
|
pombredanne/styler
|
9c423917619912789289fe2f8982d9c0b331654b
|
f3d752d2785c2ab76bacbe5793bd8306ac7961a1
|
refs/heads/master
| 2023-07-08T05:55:18.284539
| 2020-11-06T05:09:47
| 2020-11-06T05:09:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,113
|
java
|
// Licensed to Cloudera, Inc. under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Cloudera, Inc. 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.
// Note: This file is auto generated. Do not edit manually.
package com.cloudera.director.client.v3.model;
public class PasswordChange {
/* New password [redacted on read] */
private String newPassword;
/* Old password [redacted on read] */
private String oldPassword;
public PasswordChange() { }
private PasswordChange(String newPassword, String oldPassword) {
this.newPassword = newPassword;
this.oldPassword = oldPassword;
}
private PasswordChange(PasswordChangeBuilder builder) {
this.newPassword = builder.newPassword;
this.oldPassword = builder.oldPassword;
}
public static PasswordChangeBuilder builder() {
return new PasswordChangeBuilder();
}
public static class PasswordChangeBuilder {
private String newPassword = null;
private String oldPassword = null;
public PasswordChangeBuilder newPassword(String newPassword) {
this.newPassword = newPassword;
return this;
}
public PasswordChangeBuilder oldPassword(String oldPassword) {
this.oldPassword = oldPassword;
return this;
}
public PasswordChange build() {
return new PasswordChange(this);
}
}
public PasswordChangeBuilder toBuilder() {
return builder()
.newPassword(newPassword)
.oldPassword(oldPassword)
;
}
public String getNewPassword() {
return newPassword;
}
public void setNewPassword(String newPassword) {
this.newPassword = newPassword;
}
public String getOldPassword() {
return oldPassword;
}
public void setOldPassword(String oldPassword) {
this.oldPassword = oldPassword;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PasswordChange other = (PasswordChange) o; // NOPMD
return true;
}
@Override
public int hashCode() {
int result = 0;
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
String newLine = System.getProperty("line.separator");
sb.append("class PasswordChange {" + newLine);
sb.append(" newPassword: ").append("REDACTED").append(newLine);
sb.append(" oldPassword: ").append("REDACTED").append(newLine);
sb.append("}" + newLine);
return sb.toString();
}
}
|
[
"fer.madeiral@gmail.com"
] |
fer.madeiral@gmail.com
|
60c55d2fa0b01c2820f6335861ce1548d67aed40
|
ef280dcfca2ca4fa4fb64bc16f98846552da3301
|
/1.JavaSyntax/src/com/javarush/task/task07/task0711/Solution.java
|
07cd2dc1e753f1c838efdfc336d39bc480d37a48
|
[] |
no_license
|
sergeyzhirkov/JavaRushTasks
|
7e785a5224713d64ac0dcffd2abee267ba2d52b7
|
31e1bafe5bab1f384e6c4e7b7f23a99dad8582c5
|
refs/heads/master
| 2023-08-06T23:18:32.031774
| 2021-10-03T11:46:59
| 2021-10-03T11:46:59
| 261,502,947
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 758
|
java
|
package com.javarush.task.task07.task0711;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Scanner;
/*
Удалить и вставить
*/
public class Solution {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
ArrayList<String> arrs = new ArrayList<String >();
for (int i = 0; i < 5; i++) {
arrs.add(sc.nextLine());
}
for (int i = 0; i < 13; i++) {
String s = arrs.get(arrs.size()-1);
arrs.remove(arrs.size()-1);
arrs.add(0,s);
}
arrs.forEach(elem -> System.out.println(elem));
//напишите тут ваш код
}
}
|
[
"zhirkov_55250@mail.ru"
] |
zhirkov_55250@mail.ru
|
e1b25d2f30cfd1df5dcb2a790db86e752fc8fe84
|
f662526b79170f8eeee8a78840dd454b1ea8048c
|
/org/apache/logging/log4j/core/jackson/Log4jStackTraceElementDeserializer.java
|
44c510415f3427463c366937d6b07f30dbd57643
|
[] |
no_license
|
jason920612/Minecraft
|
5d3cd1eb90726efda60a61e8ff9e057059f9a484
|
5bd5fb4dac36e23a2c16576118da15c4890a2dff
|
refs/heads/master
| 2023-01-12T17:04:25.208957
| 2020-11-26T08:51:21
| 2020-11-26T08:51:21
| 316,170,984
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,130
|
java
|
/* */ package org.apache.logging.log4j.core.jackson;
/* */
/* */ import com.fasterxml.jackson.core.JsonParser;
/* */ import com.fasterxml.jackson.core.JsonProcessingException;
/* */ import com.fasterxml.jackson.core.JsonToken;
/* */ import com.fasterxml.jackson.databind.DeserializationContext;
/* */ import com.fasterxml.jackson.databind.JsonMappingException;
/* */ import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer;
/* */ import java.io.IOException;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public final class Log4jStackTraceElementDeserializer
/* */ extends StdScalarDeserializer<StackTraceElement>
/* */ {
/* */ private static final long serialVersionUID = 1L;
/* */
/* */ public Log4jStackTraceElementDeserializer() {
/* 41 */ super(StackTraceElement.class);
/* */ }
/* */
/* */
/* */
/* */ public StackTraceElement deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
/* 47 */ JsonToken t = jp.getCurrentToken();
/* */
/* 49 */ if (t == JsonToken.START_OBJECT) {
/* 50 */ String className = null, methodName = null, fileName = null;
/* 51 */ int lineNumber = -1;
/* */
/* 53 */ while ((t = jp.nextValue()) != JsonToken.END_OBJECT) {
/* 54 */ String propName = jp.getCurrentName();
/* 55 */ if ("class".equals(propName)) {
/* 56 */ className = jp.getText(); continue;
/* 57 */ } if ("file".equals(propName)) {
/* 58 */ fileName = jp.getText(); continue;
/* 59 */ } if ("line".equals(propName)) {
/* 60 */ if (t.isNumeric()) {
/* 61 */ lineNumber = jp.getIntValue();
/* */ continue;
/* */ }
/* */ try {
/* 65 */ lineNumber = Integer.parseInt(jp.getText().trim());
/* 66 */ } catch (NumberFormatException e) {
/* 67 */ throw JsonMappingException.from(jp, "Non-numeric token (" + t + ") for property 'line'", e);
/* */ } continue;
/* */ }
/* 70 */ if ("method".equals(propName)) {
/* 71 */ methodName = jp.getText(); continue;
/* 72 */ } if ("nativeMethod".equals(propName)) {
/* */ continue;
/* */ }
/* 75 */ handleUnknownProperty(jp, ctxt, this._valueClass, propName);
/* */ }
/* */
/* 78 */ return new StackTraceElement(className, methodName, fileName, lineNumber);
/* */ }
/* 80 */ throw ctxt.mappingException(this._valueClass, t);
/* */ }
/* */ }
/* Location: F:\dw\server.jar!\org\apache\logging\log4j\core\jackson\Log4jStackTraceElementDeserializer.class
* Java compiler version: 7 (51.0)
* JD-Core Version: 1.1.3
*/
|
[
"jasonya2206@gmail.com"
] |
jasonya2206@gmail.com
|
96e34e6796c2ef19344f40b51c1ac2aa072e32aa
|
6442956cf461d20ea6f8f0de59252f7ba1557df8
|
/spring-cloud-gray-client/src/main/java/cn/springcloud/gray/request/ThreadLocalRequestStorage.java
|
3239017fbf19f61df93e091e280d9972e3e73d07
|
[
"Apache-2.0"
] |
permissive
|
BamboogFork/spring-cloud-gray
|
a65e389fada59acb7fbb247a517e767102c71c31
|
c60872071d431a702303aa4d759ca0dd35c32029
|
refs/heads/master
| 2023-07-21T06:51:01.260913
| 2021-04-23T02:35:06
| 2021-04-23T02:35:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,224
|
java
|
package cn.springcloud.gray.request;
public class ThreadLocalRequestStorage extends BaseRequestLocalStorage {
private ThreadLocal<GrayRequest> grayRequestThreadLocal = new ThreadLocal<>();
private ThreadLocal<GrayTrackInfo> grayTrackInfoThreadLocal = new ThreadLocal<>();
public ThreadLocalRequestStorage() {
this(new LocalStorageLifeCycle.NoOpLocalStorageLifeCycle());
}
public ThreadLocalRequestStorage(LocalStorageLifeCycle localStorageLifeCycle) {
super(localStorageLifeCycle);
}
@Override
public void setGrayTrackInfo(GrayTrackInfo grayTrackInfo) {
grayTrackInfoThreadLocal.set(grayTrackInfo);
}
@Override
public void removeGrayTrackInfo() {
grayTrackInfoThreadLocal.remove();
}
@Override
public GrayTrackInfo getGrayTrackInfo() {
return grayTrackInfoThreadLocal.get();
}
@Override
public void setGrayRequest(GrayRequest grayRequest) {
grayRequestThreadLocal.set(grayRequest);
}
@Override
public void removeGrayRequest() {
grayRequestThreadLocal.remove();
}
@Override
public GrayRequest getGrayRequest() {
return grayRequestThreadLocal.get();
}
}
|
[
"qlichunyu@163.com"
] |
qlichunyu@163.com
|
2021a0a73a92c873f6becd86638e016c3f97ae64
|
602f6f274fe6d1d0827a324ada0438bc0210bc39
|
/spring-framework/src/main/java/org/springframework/remoting/httpinvoker/HttpInvokerRequestExecutor.java
|
433edd831059e79f17181a3679fa0045c2ddf225
|
[
"Apache-2.0"
] |
permissive
|
1091643978/spring
|
c5db27b126261adf256415a0c56c4e7fbea3546e
|
c832371e96dffe8af4e3dafe9455a409bfefbb1b
|
refs/heads/master
| 2020-08-27T04:26:22.672721
| 2019-10-31T05:31:59
| 2019-10-31T05:31:59
| 217,243,879
| 0
| 0
|
Apache-2.0
| 2019-10-24T07:58:34
| 2019-10-24T07:58:31
| null |
UTF-8
|
Java
| false
| false
| 2,221
|
java
|
/*
* Copyright 2002-2015 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.remoting.httpinvoker;
import java.io.IOException;
import org.springframework.remoting.support.RemoteInvocation;
import org.springframework.remoting.support.RemoteInvocationResult;
/**
* Strategy interface for actual execution of an HTTP invoker request.
* Used by HttpInvokerClientInterceptor and its subclass
* HttpInvokerProxyFactoryBean.
*
* <p>Two implementations are provided out of the box:
* <ul>
* <li><b>{@code SimpleHttpInvokerRequestExecutor}:</b>
* Uses JDK facilities to execute POST requests, without support
* for HTTP authentication or advanced configuration options.
* <li><b>{@code HttpComponentsHttpInvokerRequestExecutor}:</b>
* Uses Apache's Commons HttpClient to execute POST requests,
* allowing to use a preconfigured HttpClient instance
* (potentially with authentication, HTTP connection pooling, etc).
* </ul>
*
* @author Juergen Hoeller
* @since 1.1
* @see HttpInvokerClientInterceptor#setHttpInvokerRequestExecutor
*/
public interface HttpInvokerRequestExecutor {
/**
* Execute a request to send the given remote invocation.
* @param config the HTTP invoker configuration that specifies the
* target service
* @param invocation the RemoteInvocation to execute
* @return the RemoteInvocationResult object
* @throws IOException if thrown by I/O operations
* @throws ClassNotFoundException if thrown during deserialization
* @throws Exception in case of general errors
*/
RemoteInvocationResult executeRequest(HttpInvokerClientConfiguration config, RemoteInvocation invocation)
throws Exception;
}
|
[
"784990655@qq.com"
] |
784990655@qq.com
|
978cb0ebc9ccc57167c15e4eb7327e6e73f43ef7
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/gradle--gradle/274d39e8ec184cdd6e70a856364c48d850ece4e5/before/DefaultFileCollectionSnapshotter.java
|
b1cc16f29e15c3698bce523051c5355d433d3765
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,599
|
java
|
/*
* Copyright 2010 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.gradle.api.internal.changedetection.state;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.gradle.api.file.FileCollection;
import org.gradle.api.file.FileTreeElement;
import org.gradle.api.file.FileVisitDetails;
import org.gradle.api.file.FileVisitor;
import org.gradle.api.internal.cache.StringInterner;
import org.gradle.api.internal.file.FileCollectionInternal;
import org.gradle.api.internal.file.FileCollectionVisitor;
import org.gradle.api.internal.file.FileTreeInternal;
import org.gradle.api.internal.file.collections.DirectoryFileTree;
import org.gradle.api.internal.file.collections.DirectoryFileTreeFactory;
import org.gradle.api.internal.file.collections.SingletonFileTree;
import org.gradle.api.internal.tasks.TaskFilePropertySpec;
import org.gradle.cache.CacheAccess;
import org.gradle.internal.nativeintegration.filesystem.FileSystem;
import org.gradle.internal.serialize.SerializerRegistry;
import java.io.File;
import java.util.List;
import java.util.Map;
import static org.gradle.api.internal.changedetection.state.TaskFilePropertyCompareStrategy.UNORDERED;
public class DefaultFileCollectionSnapshotter implements FileCollectionSnapshotter {
private static final DefaultFileCollectionSnapshot EMPTY_SNAPSHOT = new DefaultFileCollectionSnapshot(ImmutableMap.<String, NormalizedFileSnapshot>of(), UNORDERED);
private final FileSnapshotter snapshotter;
private final StringInterner stringInterner;
private final CacheAccess cacheAccess;
private final FileSystem fileSystem;
private final DirectoryFileTreeFactory directoryFileTreeFactory;
public DefaultFileCollectionSnapshotter(FileSnapshotter snapshotter, TaskArtifactStateCacheAccess cacheAccess, StringInterner stringInterner, FileSystem fileSystem, DirectoryFileTreeFactory directoryFileTreeFactory) {
this.snapshotter = snapshotter;
this.cacheAccess = cacheAccess;
this.stringInterner = stringInterner;
this.fileSystem = fileSystem;
this.directoryFileTreeFactory = directoryFileTreeFactory;
}
@Override
public FileCollectionSnapshot emptySnapshot() {
return EMPTY_SNAPSHOT;
}
public void registerSerializers(SerializerRegistry registry) {
registry.register(DefaultFileCollectionSnapshot.class, new DefaultFileCollectionSnapshot.SerializerImpl(stringInterner));
}
@Override
public FileCollectionSnapshot snapshot(FileCollection input, TaskFilePropertyCompareStrategy compareStrategy, final SnapshotNormalizationStrategy snapshotNormalizationStrategy) {
final List<FileTreeElement> fileTreeElements = Lists.newLinkedList();
final List<FileTreeElement> missingFiles = Lists.newArrayList();
FileCollectionInternal fileCollection = (FileCollectionInternal) input;
FileCollectionVisitorImpl visitor = new FileCollectionVisitorImpl(fileTreeElements, missingFiles);
fileCollection.visitRootElements(visitor);
if (fileTreeElements.isEmpty() && missingFiles.isEmpty()) {
return emptySnapshot();
}
final Map<String, NormalizedFileSnapshot> snapshots = Maps.newLinkedHashMap();
cacheAccess.useCache("Create file snapshot", new Runnable() {
public void run() {
for (FileTreeElement fileDetails : fileTreeElements) {
String absolutePath = getInternedAbsolutePath(fileDetails.getFile());
if (!snapshots.containsKey(absolutePath)) {
IncrementalFileSnapshot snapshot;
if (fileDetails.isDirectory()) {
snapshot = DirSnapshot.getInstance();
} else {
snapshot = new FileHashSnapshot(snapshotter.snapshot(fileDetails).getHash(), fileDetails.getLastModified());
}
NormalizedFileSnapshot normalizedSnapshot = snapshotNormalizationStrategy.getNormalizedSnapshot(fileDetails, snapshot, stringInterner);
if (normalizedSnapshot != null) {
snapshots.put(absolutePath, normalizedSnapshot);
}
}
}
for (FileTreeElement missingFileDetails : missingFiles) {
String absolutePath = getInternedAbsolutePath(missingFileDetails.getFile());
if (!snapshots.containsKey(absolutePath)) {
snapshots.put(absolutePath, snapshotNormalizationStrategy.getNormalizedSnapshot(missingFileDetails, MissingFileSnapshot.getInstance(), stringInterner));
}
}
}
});
return new DefaultFileCollectionSnapshot(snapshots, compareStrategy);
}
@Override
public FileCollectionSnapshot snapshot(TaskFilePropertySpec propertySpec) {
return snapshot(propertySpec.getPropertyFiles(), propertySpec.getCompareStrategy(), propertySpec.getSnapshotNormalizationStrategy());
}
private String getInternedAbsolutePath(File file) {
return stringInterner.intern(file.getAbsolutePath());
}
private class FileCollectionVisitorImpl implements FileCollectionVisitor, FileVisitor {
private final List<FileTreeElement> fileTreeElements;
private final List<FileTreeElement> missingFiles;
FileCollectionVisitorImpl(List<FileTreeElement> fileTreeElements, List<FileTreeElement> missingFiles) {
this.fileTreeElements = fileTreeElements;
this.missingFiles = missingFiles;
}
@Override
public void visitCollection(FileCollectionInternal fileCollection) {
for (File file : fileCollection) {
if (file.isFile()) {
fileTreeElements.add(new SingletonFileTree.SingletonFileVisitDetails(file, fileSystem, false));
} else if (file.isDirectory()) {
// Visit the directory itself, then its contents
fileTreeElements.add(new SingletonFileTree.SingletonFileVisitDetails(file, fileSystem, true));
visitDirectoryTree(directoryFileTreeFactory.create(file));
} else {
missingFiles.add(new MissingFileVisitDetails(file));
}
}
}
@Override
public void visitTree(FileTreeInternal fileTree) {
fileTree.visitTreeOrBackingFile(this);
}
@Override
public void visitDirectoryTree(DirectoryFileTree directoryTree) {
directoryTree.visit(this);
}
@Override
public void visitDir(FileVisitDetails dirDetails) {
fileTreeElements.add(dirDetails);
}
@Override
public void visitFile(FileVisitDetails fileDetails) {
fileTreeElements.add(fileDetails);
}
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
e5e4ab61e99d7c6b767eef881c16b9be8dd1d53a
|
66aadd76eb1fa1612825ec547b681914a2531ce4
|
/core/src/main/java/info/beastsoftware/hookcore/logging/BeastLogger.java
|
be88be0a832f2c9336a3d65ae55e01f72cfa3a18
|
[
"MIT"
] |
permissive
|
daniel097541/BeastFactionsHook
|
bfd4814e92e3b8f748d661d1a469148943618c4b
|
26cab95255e2a1b091fbd3d4214fe5c8a948594a
|
refs/heads/master
| 2020-12-02T20:31:01.808828
| 2020-02-02T10:17:58
| 2020-02-02T10:17:58
| 231,112,281
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 341
|
java
|
package info.beastsoftware.hookcore.logging;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
public interface BeastLogger {
String prefix = "&dBeastFactionsHook &7>> ";
static void info(String message){
Bukkit.getConsoleSender().sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + message));
}
}
|
[
"32720562+daniel097541@users.noreply.github.com"
] |
32720562+daniel097541@users.noreply.github.com
|
ea76df2e07ea539a790cc14365eeb174a65306ef
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-ws/results/XRENDERING-481-2-20-Single_Objective_GGA-WeightedSum/org/xwiki/rendering/internal/macro/toc/TocMacro_ESTest.java
|
230422cff4cba9ed429fb74478e5d84dd25a1aa3
|
[
"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
| 3,947
|
java
|
/*
* This file was automatically generated by EvoSuite
* Tue Mar 31 17:47:10 UTC 2020
*/
package org.xwiki.rendering.internal.macro.toc;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.Map;
import javax.inject.Provider;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.evosuite.runtime.javaee.injection.Injector;
import org.junit.runner.RunWith;
import org.xwiki.component.descriptor.ComponentDescriptor;
import org.xwiki.properties.BeanManager;
import org.xwiki.rendering.block.MacroBlock;
import org.xwiki.rendering.block.MacroMarkerBlock;
import org.xwiki.rendering.block.TableCellBlock;
import org.xwiki.rendering.internal.macro.toc.TocMacro;
import org.xwiki.rendering.macro.AbstractMacro;
import org.xwiki.rendering.macro.toc.TocMacroParameters;
import org.xwiki.rendering.parser.Parser;
import org.xwiki.rendering.renderer.reference.link.LinkLabelGenerator;
import org.xwiki.rendering.transformation.MacroTransformationContext;
import org.xwiki.xml.internal.html.DefaultHTMLCleanerConfiguration;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class TocMacro_ESTest extends TocMacro_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
LinkLabelGenerator linkLabelGenerator0 = mock(LinkLabelGenerator.class, new ViolatedAssumptionAnswer());
Parser parser0 = mock(Parser.class, new ViolatedAssumptionAnswer());
Provider<MacroMarkerBlock> provider0 = (Provider<MacroMarkerBlock>) mock(Provider.class, new ViolatedAssumptionAnswer());
doReturn((Object) null).when(provider0).get();
BeanManager beanManager0 = mock(BeanManager.class, new ViolatedAssumptionAnswer());
ComponentDescriptor<TableCellBlock> componentDescriptor0 = (ComponentDescriptor<TableCellBlock>) mock(ComponentDescriptor.class, new ViolatedAssumptionAnswer());
TocMacroParameters.Scope tocMacroParameters_Scope0 = TocMacroParameters.Scope.LOCAL;
TocMacroParameters tocMacroParameters0 = mock(TocMacroParameters.class, new ViolatedAssumptionAnswer());
doReturn(0).when(tocMacroParameters0).getDepth();
doReturn((String) null, (String) null).when(tocMacroParameters0).getReference();
doReturn((TocMacroParameters.Scope) null, tocMacroParameters_Scope0).when(tocMacroParameters0).getScope();
doReturn(0).when(tocMacroParameters0).getStart();
doReturn(false).when(tocMacroParameters0).isCustomStart();
doReturn(false).when(tocMacroParameters0).isNumbered();
TocMacro tocMacro0 = new TocMacro();
Injector.inject(tocMacro0, (Class<?>) TocMacro.class, "linkLabelGenerator", (Object) linkLabelGenerator0);
Injector.inject(tocMacro0, (Class<?>) TocMacro.class, "plainTextParser", (Object) parser0);
Injector.inject(tocMacro0, (Class<?>) TocMacro.class, "wikiModelProvider", (Object) provider0);
Injector.inject(tocMacro0, (Class<?>) AbstractMacro.class, "beanManager", (Object) beanManager0);
Injector.inject(tocMacro0, (Class<?>) AbstractMacro.class, "componentDescriptor", (Object) componentDescriptor0);
Injector.validateBean(tocMacro0, (Class<?>) TocMacro.class);
MacroTransformationContext macroTransformationContext0 = new MacroTransformationContext();
DefaultHTMLCleanerConfiguration defaultHTMLCleanerConfiguration0 = new DefaultHTMLCleanerConfiguration();
Map<String, String> map0 = defaultHTMLCleanerConfiguration0.getParameters();
MacroBlock macroBlock0 = new MacroBlock("", map0, "Unknown OpenAction ", true);
macroTransformationContext0.setCurrentMacroBlock(macroBlock0);
// Undeclared exception!
tocMacro0.execute(tocMacroParameters0, "SE.;Es@:6v", macroTransformationContext0);
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
1d4e3ff585efd71b18fe53b4fee07418cb745ee4
|
002ea163aaa5527ea82bc2682800bc2ddd4daade
|
/app/src/main/java/com/hayukleung/view/RadarInfiniteLoadingView/RadarInfiniteLoadingViewActivity.java
|
0b476b3196e05b617c45a8bef09488d8f0ffb9c1
|
[] |
no_license
|
qtly/View
|
67b814ba299aea3b85a34b66e7518b7e71a1dd9f
|
b4f78672400ca482c8c26f08063dc846b88ebd9d
|
refs/heads/master
| 2020-05-24T19:13:26.504551
| 2017-07-01T04:13:46
| 2017-07-01T04:13:46
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 617
|
java
|
package com.hayukleung.view.RadarInfiniteLoadingView;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import com.hayukleung.view.R;
/**
* View
* com.hayukleung.view.RadarInfiniteLoadingView
* RadarInfiniteLoadingViewActivity.java
*
* by hayukleung
* at 2016-12-23 16:36
*/
public class RadarInfiniteLoadingViewActivity extends AppCompatActivity {
@Override protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_radar_infinite_loading_view);
}
}
|
[
"hayukleung@gmail.com"
] |
hayukleung@gmail.com
|
e92174c9786bbaa1e76ac78b60c0fe1cdeeff142
|
e308fb3a7c49a9fda6e43cc0c2cf33738eaa912a
|
/lib_ImagePicker/src/main/java/com/lzy/imagepicker/ui/PlayVideoActivity.java
|
946c9a10d486e0b015e6744db9903c2c4463113e
|
[
"Apache-2.0"
] |
permissive
|
allenzhangfan/Lingmou2
|
1d37cbe5484ea15438c73037558343f96ee97223
|
c22d5f1b6ea5e325f1c2b5d8836dcba0ce53e325
|
refs/heads/master
| 2020-04-26T01:58:57.205750
| 2019-01-23T01:40:32
| 2019-01-23T01:40:32
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,326
|
java
|
/*
* Copyright (C) 2016 LingDaNet.Co.Ltd. All Rights Reserved.
*/
package com.lzy.imagepicker.ui;
import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.MediaController;
import android.widget.ProgressBar;
import android.widget.VideoView;
import com.lingdanet.safeguard.common.utils.ToastUtils;
import com.lzy.imagepicker.R;
public class PlayVideoActivity extends Activity
implements View.OnClickListener,
MediaPlayer.OnCompletionListener,
MediaPlayer.OnInfoListener,
MediaPlayer.OnErrorListener {
public static final String TYPE_VIDEO_PATH = "video_path";
public static final String TYPE_AUTO_FINISH = "activity_auto_finish";
private ImageView mBackImg;
private VideoView mVideoView;
private ProgressBar mProBar;
private boolean autoFinish;
// 视频播放到的位置
int mPlayingPos = 0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//不显示程序的标题栏
requestWindowFeature(Window.FEATURE_NO_TITLE);
//不显示系统的标题栏
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.activity_play_video);
mBackImg = (ImageView) findViewById(R.id.back_icon_img);
mVideoView = (VideoView) findViewById(R.id.video_view_vv);
mProBar = (ProgressBar) findViewById(R.id.loading_pb);
initData();
}
private void initData() {
String path = getIntent().getStringExtra(TYPE_VIDEO_PATH);
autoFinish = getIntent().getBooleanExtra(TYPE_AUTO_FINISH, false);
if (!TextUtils.isEmpty(path)) {
Uri uri = Uri.parse(path);
mVideoView.setMediaController(new MediaController(this));
mVideoView.setOnCompletionListener(this);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
mVideoView.setOnInfoListener(this);
}
mVideoView.setOnErrorListener(this);
mVideoView.setVideoURI(uri);
mVideoView.start();
}
mBackImg.setOnClickListener(this);
}
@Override
protected void onPause() {
mPlayingPos = mVideoView.getCurrentPosition(); //先获取再stopPlay(),原因自己看源码
mVideoView.stopPlayback();
super.onPause();
}
@Override
protected void onResume() {
if (mPlayingPos > 0) {
//此处为更好的用户体验,可添加一个progressBar,有些客户端会在这个过程中隐藏底下控制栏,这方法也不错
mVideoView.start();
mVideoView.seekTo(mPlayingPos);
mPlayingPos = 0;
}
super.onResume();
}
@Override
public void onCompletion(MediaPlayer mp) {
ToastUtils.showShort(R.string.media_play_complete);
if (autoFinish) {
finishPage();
}
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.back_icon_img) {
finishPage();
}
}
private void finishPage() {
Intent intent = new Intent();
setResult(RESULT_OK, intent);
finish();
}
@Override
public void onBackPressed() {
finishPage();
}
@Override
public boolean onInfo(MediaPlayer mp, int what, int extra) {
switch (what) {
case MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START:
mProBar.setVisibility(View.GONE);
break;
default:
break;
}
return false;
}
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
ToastUtils.showShort(R.string.media_play_fail);
finishPage();
return true;
}
@Override
protected void onDestroy() {
mVideoView.setOnCompletionListener(null);
mVideoView = null;
super.onDestroy();
}
}
|
[
"yeguoqiang6@outlook.com"
] |
yeguoqiang6@outlook.com
|
e8f41ffcb2193175e63e3b27901a55d7388ea649
|
acc024580ed932a08574c841379176b920c7b4ad
|
/src/com/facebook/buck/cli/MainWithNailgun.java
|
ddb774ac171deb931449ce82c40614d06f29f7da
|
[
"Apache-2.0"
] |
permissive
|
ProfessaA/buck
|
c0182bf7a6a99b7b0f8a5b27c2a1eec4e9aaae48
|
d4e6a3274632c0121e325cb0523f9d6448507efa
|
refs/heads/master
| 2021-01-19T20:54:08.805779
| 2019-04-27T06:48:50
| 2019-04-27T06:48:50
| 88,568,554
| 0
| 0
| null | 2017-04-18T01:42:37
| 2017-04-18T01:42:37
| null |
UTF-8
|
Java
| false
| false
| 4,175
|
java
|
/*
* Copyright 2019-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.cli;
import com.facebook.buck.cli.BuckDaemon.DaemonCommandExecutionScope;
import com.facebook.buck.core.util.log.Logger;
import com.facebook.buck.util.environment.Platform;
import com.facebook.nailgun.NGContext;
import com.google.common.collect.ImmutableMap;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.nio.channels.OverlappingFileLockException;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* The Main entry point for Nailgun calls.
*
* <p>This class maintains the state for statically storing daemon fields
*/
@SuppressWarnings("unused")
public class MainWithNailgun extends AbstractMain {
private static final Logger LOG = Logger.get(MainWithNailgun.class);
@Nullable private static FileLock resourcesFileLock = null;
private static final Platform running_platform = Platform.detect();
private final NGContext ngContext;
public MainWithNailgun(NGContext ngContext) {
super(
ngContext.out,
ngContext.err,
ngContext.in,
getClientEnvironment(ngContext),
running_platform,
Optional.of(ngContext));
this.ngContext = ngContext;
}
/**
* When running as a daemon in the NailGun server, {@link #nailMain(NGContext)} is called instead
* of {@link MainRunner} so that the given context can be used to listen for client disconnections
* and interrupt command processing when they occur.
*/
@SuppressWarnings("unused")
public static void nailMain(NGContext context) {
obtainResourceFileLock();
try (DaemonCommandExecutionScope ignored =
BuckDaemon.getInstance().getDaemonCommandExecutionScope()) {
MainWithNailgun mainWithNailgun = new MainWithNailgun(context);
MainRunner mainRunner = mainWithNailgun.prepareMainRunner();
mainRunner.runMainThenExit(context.getArgs(), System.nanoTime());
}
}
/**
* To prevent 'buck kill' from deleting resources from underneath a 'live' buckd we hold on to the
* FileLock for the entire lifetime of the process. We depend on the fact that on Linux and MacOS
* Java FileLock is implemented using the same mechanism as the Python fcntl.lockf method. Should
* this not be the case we'll simply have a small race between buckd start and `buck kill`.
*/
private static void obtainResourceFileLock() {
if (resourcesFileLock != null) {
return;
}
String resourceLockFilePath = System.getProperties().getProperty("buck.resource_lock_path");
if (resourceLockFilePath == null) {
// Running from ant, no resource lock needed.
return;
}
try {
// R+W+A is equivalent to 'a+' in Python (which is how the lock file is opened in Python)
// because WRITE in Java does not imply truncating the file.
FileChannel fileChannel =
FileChannel.open(
Paths.get(resourceLockFilePath),
StandardOpenOption.READ,
StandardOpenOption.WRITE,
StandardOpenOption.CREATE);
resourcesFileLock = fileChannel.tryLock(0L, Long.MAX_VALUE, true);
} catch (IOException | OverlappingFileLockException e) {
LOG.warn(e, "Error when attempting to acquire resources file lock.");
}
}
@SuppressWarnings({"unchecked", "rawtypes"})
private static ImmutableMap<String, String> getClientEnvironment(NGContext context) {
return ImmutableMap.copyOf((Map) context.getEnv());
}
}
|
[
"facebook-github-bot@users.noreply.github.com"
] |
facebook-github-bot@users.noreply.github.com
|
f0e7ae6e9501fd00ada9c5167ee4536fc506c9bd
|
eb2c22492d4740a3eb455f2a898f6b3bc8235809
|
/jnnsBank/ams-web/src/main/java/com/ideatech/ams/controller/statistics/SaicMonitorController.java
|
1b2ce89c1471e23e6473c70816c6db156155b593
|
[] |
no_license
|
deepexpert-gaohz/sa-d
|
72a2d0cbfe95252d2a62f6247e7732c883049459
|
2d14275071b3d562447d24bd44d3a53f5a96fb71
|
refs/heads/master
| 2023-03-10T08:39:15.544657
| 2021-02-24T02:17:58
| 2021-02-24T02:17:58
| 341,395,351
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,944
|
java
|
package com.ideatech.ams.controller.statistics;
import com.ideatech.ams.account.vo.AccountStatisticsInfoVo;
import com.ideatech.ams.customer.dto.SaicMonitorDto;
import com.ideatech.ams.customer.dto.SaicStateDto;
import com.ideatech.ams.customer.service.SaicMonitorService;
import com.ideatech.common.dto.ResultDto;
import com.ideatech.common.dto.ResultDtoFactory;
import com.ideatech.common.dto.TreeTable;
import com.ideatech.common.excel.util.ExportExcel;
import com.ideatech.common.excel.util.service.IExcelExport;
import com.ideatech.common.msg.TableResultResponse;
import com.ideatech.common.util.BrowserUtil;
import com.ideatech.common.util.DateUtils;
import com.ideatech.common.util.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
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.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.util.Date;
@RestController
@RequestMapping("/saicMonitor")
@Slf4j
public class SaicMonitorController {
@Autowired
private SaicMonitorService saicMonitorService;
@Autowired
private SaicStateDto saicStateDto;
@GetMapping("/info/list")
public TreeTable menuInfoList(Long pid, AccountStatisticsInfoVo accountStatisticsInfoVo){
Long organId = null;
if (pid == null) {
organId = SecurityUtils.getCurrentUser().getOrgId();
}
return saicMonitorService.query(pid, organId);
}
@GetMapping("/page")
public TableResultResponse<SaicMonitorDto> batchList(SaicMonitorDto dto, @PageableDefault(sort = {"lastUpdateDate"}, direction = Sort.Direction.DESC) Pageable pageable) {
TableResultResponse<SaicMonitorDto> tableResultResponse = saicMonitorService.queryPage(dto, pageable);
return tableResultResponse;
}
@RequestMapping(value = "/download", method = RequestMethod.GET)
public void downloadStatisticsPoiResultExcel(SaicMonitorDto dto, HttpServletRequest request, HttpServletResponse response)
throws Exception {
IExcelExport illegalQueryExcel = saicMonitorService.exportSaicMonitorExcel(dto);
response.setHeader("Content-disposition", "attachment; filename="+generateFileName("接口监控记录",request)+".xls");
response.setContentType("application/octet-stream");
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
ExportExcel.export(response.getOutputStream(),"yyyy-MM-dd",illegalQueryExcel);
toClient.flush();
response.getOutputStream().close();
}
/**
* 生成导出文件名
* @param
* @param request
* @return
* @throws UnsupportedEncodingException
*/
private String generateFileName(String fileName1, HttpServletRequest request) throws UnsupportedEncodingException {
StringBuilder fileName = new StringBuilder();
fileName.append(BrowserUtil.generateFileName(fileName1,request))
.append("-").append(DateUtils.DateToStr(new Date(),"yyyy-MM-dd"));
return fileName.toString();
}
/**
* 获取工商接口状态
*/
@GetMapping("/state")
public ResultDto getState(){
if (saicStateDto==null){
return ResultDtoFactory.toNack("获取失败");
}else {
return ResultDtoFactory.toAck("获取成功",saicStateDto);
}
}
}
|
[
"807661486@qq.com"
] |
807661486@qq.com
|
92151430c11d13a53e4a9ede1f104e1f99ea6fed
|
82d29a0874c1edf7e09766ef933202c83cc19212
|
/src/main/java/cn/edu/seu/swordoffer/T56_EntryNodeOfLoop.java
|
0d133e76c84528d5c5199fa603947092f3b80207
|
[
"MIT"
] |
permissive
|
personajian/newer-coder
|
7153c15ebf99ca01cb682b7d3e463c8b93a1060c
|
28289f2075f576209cf968fb2b2c01a2f8ad94cd
|
refs/heads/main
| 2023-04-26T10:54:24.706062
| 2021-05-19T13:07:16
| 2021-05-19T13:07:16
| 335,164,427
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,590
|
java
|
package cn.edu.seu.swordoffer;
/**
* 链表中环的入口
* 算法思想:
* 1. 判断一个链表是否有环:设置快慢指针,慢指针能与快指针相遇,就一定有环。
* 2. 根据有环,再计算出环中的节点数
* 3. 根据环中的结点数,再用两个先后指针计算出环的入口
*
* @Author personajian
*
* @Date 2017/9/3 20:32
*/
public class T56_EntryNodeOfLoop {
public static void main(String[] args) {
ListNode n1=new ListNode(1);
ListNode n2=new ListNode(2);
ListNode n3=new ListNode(3);
ListNode n4=new ListNode(4);
ListNode n5=new ListNode(5);
ListNode n6=new ListNode(6);
n1.next=n2;
n2.next=n3;
n3.next=n4;
n4.next=n5;
n5.next=n6;
n6.next=n3;
ListNode entry= new T56_EntryNodeOfLoop().EntryNodeOfLoop(n1);
}
public ListNode EntryNodeOfLoop(ListNode pHead) {
int numLoop = numLoop(pHead);
ListNode p1 = pHead;
ListNode p2 = pHead;
ListNode entryNode=null;
if (numLoop == 0) {
entryNode=null;
} else {
//p1指针先走numLoop步
while (numLoop > 0) {
p1 = p1.next;
numLoop--;
}
//p1,p2指针再同时向前移动
while (true) {
if (p1 == p2){
entryNode=p1;
break;
}
p1 = p1.next;
p2 = p2.next;
}
}
return entryNode;
}
private int numLoop(ListNode pHead) {
ListNode p = pHead;
ListNode slow = p;
ListNode fast = p;
ListNode temp = null;
int numLoop = 0;
boolean flag = false;
while (slow.next != null && fast.next.next != null) {
slow = slow.next;
fast = fast.next.next;
if (slow == fast) {
flag = true;
temp = slow;
break;
}
}
//若有环,返回计算环中的节点数
if (flag) {
ListNode t = temp;
while (true) {
numLoop++;
t = t.next;
if (temp == t) {
break;
}
}
return numLoop;
} else//若无环,返回0
return 0;
}
private static class ListNode {
int val;
ListNode next = null;
ListNode(int val) {
this.val = val;
}
}
}
|
[
"swordcheng@tencent.com"
] |
swordcheng@tencent.com
|
2ba10ec77633b57ed291b080e7d55ade27c216c4
|
de1e2439c0cbcae1cfe8a9ba83995718fcc750c6
|
/src/main/java/fr/ign/cogit/geoxygene/schemageo/api/hydro/PointDEau.java
|
2ccbf7a0ac590d1d1b4cee8c2db6d218b1ebc3e8
|
[] |
no_license
|
GeOxygene/geoxygene-schemageo
|
6f0498f113dffcd07fe6e7ce2f7788aca0a61e81
|
c31c76f5767b5862ef6dc3858d1be6225477ae1a
|
refs/heads/main
| 2023-05-28T11:55:28.359481
| 2021-06-08T16:11:46
| 2021-06-08T16:11:46
| 375,070,901
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,036
|
java
|
/*
* This file is part of the GeOxygene project source files. GeOxygene aims at
* providing an open framework which implements OGC/ISO specifications for the
* development and deployment of geographic (GIS) applications. It is a open
* source contribution of the COGIT laboratory at the Institut Géographique
* National (the French National Mapping Agency). See:
* http://oxygene-project.sourceforge.net Copyright (C) 2005 Institut
* Géographique National This library is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the License,
* or any later version. This library is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this library (see file
* LICENSE if present); if not, write to the Free Software Foundation, Inc., 59
* Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @author julien Gaffuri 26 juin 2009
*/
package fr.ign.cogit.geoxygene.schemageo.api.hydro;
import fr.ign.cogit.geoxygene.schemageo.api.support.reseau.ElementPonctuelReseau;
/**
* point d'eau, reservoir (?), point d'eau isole, toponyme de surface hydro (?)
*
* @author julien Gaffuri 26 juin 2009
*
*/
public interface PointDEau extends ElementPonctuelReseau {
/**
* @return le nom
*/
public String getNom();
public void setNom(String nom);
/**
* @return l'altitude maximale de l'objet
*/
public double getZMax();
public void setZMax(double zMax);
/**
* @return l'altitude minimale de l'objet
*/
public double getZMin();
public void setZMin(double zMin);
/**
* @return la hauteur de l'objet
*/
public double getHauteur();
public void setHauteur(double hauteur);
}
|
[
"micycle1@hotmail.co.uk"
] |
micycle1@hotmail.co.uk
|
88cb38ca9c6da8fde451d1f3ccb6acb023ab3ba2
|
4312a71c36d8a233de2741f51a2a9d28443cd95b
|
/RawExperiments/Math/Math 3.2 RC4/2/AstorMain-Math 3.2 RC4/src/variant-357/org/apache/commons/math/analysis/solvers/BrentSolver.java
|
98b5cda0d68158d187573fc9721cc2659479b001
|
[] |
no_license
|
SajjadZaidi/AutoRepair
|
5c7aa7a689747c143cafd267db64f1e365de4d98
|
e21eb9384197bae4d9b23af93df73b6e46bb749a
|
refs/heads/master
| 2021-05-07T00:07:06.345617
| 2017-12-02T18:48:14
| 2017-12-02T18:48:14
| 112,858,432
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,780
|
java
|
package org.apache.commons.math.analysis.solvers;
public class BrentSolver extends org.apache.commons.math.analysis.solvers.UnivariateRealSolverImpl {
private static final java.lang.String NON_BRACKETING_MESSAGE = "function values at endpoints do not have different signs. " + "Endpoints: [{0}, {1}], Values: [{2}, {3}]";
private static final long serialVersionUID = 7694577816772532779L;
@java.lang.Deprecated
public BrentSolver(org.apache.commons.math.analysis.UnivariateRealFunction f) {
super(f, 100, 1.0E-6);
}
public BrentSolver() {
super(100, 1.0E-6);
}
@java.lang.Deprecated
public double solve(double min, double max) throws org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.MaxIterationsExceededException {
return solve(f, min, max);
}
@java.lang.Deprecated
public double solve(double min, double max, double initial) throws org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.MaxIterationsExceededException {
return solve(f, min, max, initial);
}
public double solve(final org.apache.commons.math.analysis.UnivariateRealFunction f, final double min, final double max, final double initial) throws org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.MaxIterationsExceededException {
clearResult();
verifySequence(min, initial, max);
double yInitial = f.value(initial);
if ((java.lang.Math.abs(yInitial)) <= (functionValueAccuracy)) {
setResult(initial, 0);
return result;
}
double yMin = f.value(min);
if ((java.lang.Math.abs(yMin)) <= (functionValueAccuracy)) {
setResult(yMin, 0);
return result;
}
if ((java.lang.Math.abs(yInitial)) <= (functionValueAccuracy)) {
setResult(initial, 0);
return result;
}
if ((yInitial * yMin) < 0) {
return solve(f, min, yMin, initial, yInitial, min, yMin);
}
double yMax = f.value(max);
if ((java.lang.Math.abs(yMax)) <= (functionValueAccuracy)) {
setResult(yMax, 0);
return result;
}
if ((yInitial * yMax) < 0) {
return solve(f, initial, yInitial, max, yMax, initial, yInitial);
}
return solve(f, min, yMin, max, yMax, initial, yInitial);
}
public double solve(final org.apache.commons.math.analysis.UnivariateRealFunction f, final double min, final double max) throws org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.MaxIterationsExceededException {
clearResult();
verifyInterval(min, max);
double ret = java.lang.Double.NaN;
double yMin = f.value(min);
double yMax = f.value(max);
double sign = yMin * yMax;
if (sign > 0) {
if ((java.lang.Math.abs(yMin)) <= (functionValueAccuracy)) {
setResult(min, 0);
ret = min;
} else {
if ((java.lang.Math.abs(yMax)) <= (functionValueAccuracy)) {
setResult(max, 0);
ret = max;
} else {
throw org.apache.commons.math.MathRuntimeException.createIllegalArgumentException(org.apache.commons.math.analysis.solvers.BrentSolver.NON_BRACKETING_MESSAGE, min, max, yMin, yMax);
}
}
} else {
if (sign < 0) {
ret = solve(f, min, yMin, max, yMax, min, yMin);
} else {
if (yMin == 0.0) {
ret = min;
} else {
ret = max;
}
}
}
return ret;
}
private double solve(final org.apache.commons.math.analysis.UnivariateRealFunction f, double x0, double y0, double x1, double y1, double x2, double y2) throws org.apache.commons.math.FunctionEvaluationException, org.apache.commons.math.MaxIterationsExceededException {
double delta = x1 - x0;
double oldDelta = delta;
int i = 0;
while (i < (maximalIterationCount)) {
if ((java.lang.Math.abs(y2)) < (java.lang.Math.abs(y1))) {
x0 = x1;
x1 = x2;
x2 = x0;
y0 = y1;
y1 = y2;
y2 = y0;
}
if ((java.lang.Math.abs(y1)) <= (functionValueAccuracy)) {
setResult(x1, i);
return result;
}
double dx = x2 - x1;
double tolerance = java.lang.Math.max(((relativeAccuracy) * (java.lang.Math.abs(x1))), absoluteAccuracy);
if ((java.lang.Math.abs(dx)) <= tolerance) {
setResult(x1, i);
return result;
}
if (((java.lang.Math.abs(oldDelta)) < tolerance) || ((java.lang.Math.abs(y0)) <= (java.lang.Math.abs(y1)))) {
delta = 0.5 * dx;
oldDelta = delta;
} else {
double r3 = y1 / y0;
double p;
double p1;
if (x0 == x2) {
p = dx * r3;
p1 = 1.0 - r3;
} else {
double r1 = y0 / y2;
double r2 = y1 / y2;
p = r3 * (((dx * r1) * (r1 - r2)) - ((x1 - x0) * (r2 - 1.0)));
p1 = ((r1 - 1.0) * (r2 - 1.0)) * (r3 - 1.0);
}
if (p > 0.0) {
p1 = -p1;
} else {
p = -p;
}
if (((2.0 * p) >= (((1.5 * dx) * p1) - (java.lang.Math.abs((tolerance * p1))))) || (p >= (java.lang.Math.abs(((0.5 * oldDelta) * p1))))) {
delta = 0.5 * dx;
oldDelta = delta;
} else {
oldDelta = delta;
delta = p / p1;
}
}
x0 = x1;
y0 = y1;
if ((java.lang.Math.abs(delta)) > tolerance) {
x1 = x1 + delta;
} else {
if (dx > 0.0) {
x1 = x1 + (0.5 * tolerance);
} else {
if (dx <= 0.0) {
x1 = x1 - (0.5 * tolerance);
}
}
}
y1 = f.value(x1);
if ((y1 > 0) == (y2 > 0)) {
x2 = x0;
y2 = y0;
delta = x1 - x0;
oldDelta = delta;
}
i++;
}
throw new org.apache.commons.math.MaxIterationsExceededException(maximalIterationCount);
}
}
|
[
"sajjad.syed@ucalgary.ca"
] |
sajjad.syed@ucalgary.ca
|
652a2c5f553c2bc22e9568379129e1ba040e1876
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/2/2_d747b53d3f7c2dc01e57fb376ae4b127c7dd61f3/DisplayController/2_d747b53d3f7c2dc01e57fb376ae4b127c7dd61f3_DisplayController_t.java
|
7c2efa8c9008d730c74236c9de4ef9be38510070
|
[] |
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,557
|
java
|
package controllers;
import java.util.HashMap;
import java.util.Map;
import models.Display;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ObjectNode;
import play.Logger;
import play.data.Form;
import play.libs.F.Callback;
import play.libs.F.Callback0;
import play.mvc.BodyParser;
import play.mvc.BodyParser.Json;
import play.mvc.Controller;
import play.mvc.Result;
import play.mvc.WebSocket;
public class DisplayController extends Controller {
public static HashMap<String, WebSocket.Out<JsonNode>> activeDisplays = new HashMap<String, WebSocket.Out<JsonNode>>();
public static HashMap<WebSocket.Out<JsonNode>, String> outToID = new HashMap<WebSocket.Out<JsonNode>, String>();
/**
* Prepare the display with the tiles selected during
* the layout creation
* @param displayID
* @return
*/
public static Result setupDisplay(String displayID) {
// if(!activeDisplays.containsKey(displayID)){
Display display = Display.get(new Long(displayID));
String name = display.name;
activeDisplays.put(displayID, null);
return ok(views.html.display.render(displayID,name));
// } else {
// return ok("SORRY, DISPLAY ID " + displayID + " IS ALREADY ACTIVE");
// }
}
@BodyParser.Of(Json.class)
public static Result updateDisplayInformations(){
JsonNode json = request().body().asJson();
if(json == null) {
return badRequest("Expecting Json data");
}
else {
String kind = json.get("kind").asText();
ObjectNode result = play.libs.Json.newObject();
if(kind.equals("linking")){
Long layoutid = new Long(json.get("layoutid").asText());
Long currentSelected =new Long(json.get("currentSelected").asText());
Display.updateLayout(layoutid, currentSelected);
result.put("layoutid", layoutid);
result.put("currentSelected", currentSelected);
return ok(result);
} else if(kind.equals("update")){
Long displayid = json.get("displayid").asLong();
String name = json.get("name").asText();
Float latitude = new Float(json.get("latitude").asText());
Float longitude = new Float(json.get("longitude").asText());
Display clone = (Display) Display.find.byId(displayid)._ebean_createCopy();
clone.name = name;
clone.latitude = latitude;
clone.longitude = longitude;
Display.delete(displayid);
Display.addNew(clone);
result.put("id", clone.id);
result.put("name", clone.name);
result.put("latitude", clone.latitude);
result.put("longitude", clone.longitude);
return ok(result);
}
}
return badRequest();
}
@BodyParser.Of(Json.class)
public static Result removeDisplay(){
JsonNode json = request().body().asJson();
if(json == null) {
return badRequest("Expecting Json data");
}
else {
Long currentSelected =new Long(json.get("currentSelected").asText());
Display.delete(currentSelected);
ObjectNode result = play.libs.Json.newObject();
result.put("removedid", currentSelected);
return ok(result);
}
}
@BodyParser.Of(Json.class)
public static Result newDisplay(){
JsonNode json = request().body().asJson();
if(json == null) {
return badRequest("Expecting Json data");
}
else {
Logger.info(json.toString());
String name = json.get("name").asText();
String latitude = json.get("latitude").asText();
String longitude = json.get("longitude").asText();
Form<Display> filledForm = form(Display.class);
Map<String,String> anyData = new HashMap<String, String>();
anyData.put("name", name);
anyData.put("latitude", latitude);
anyData.put("longitude", longitude);
Logger.info(anyData.toString());
Display display = filledForm.bind(anyData).get();
Display res = Display.addNew(display);
ObjectNode result = play.libs.Json.newObject();
result.put("id", res.id);
result.put("name", name);
result.put("latitude", latitude);
result.put("longitude", longitude);
return ok(result);
}
}
public static WebSocket<JsonNode> webSocket() {
return new WebSocket<JsonNode>() {
@Override
public void onReady(WebSocket.In<JsonNode> in, final WebSocket.Out<JsonNode> out) {
in.onMessage(new Callback<JsonNode>() {
public void invoke(JsonNode event) {
Logger.info(event.toString());
String kind = event.get("kind").asText();
String displayID = event.get("displayID").asText();
if(kind.equals("newScreen")){
activeDisplays.put(displayID, out);
outToID.put(out, displayID);
Logger.info("Display " + displayID + " is now active.");
}
// Mobile wants to get what's on the screen
else if(kind.equals("getRequest")){
Out<JsonNode> displayOut = activeDisplays.get(displayID);
ObjectNode request = play.libs.Json.newObject();
request.put("kind", "actives");
displayOut.write(request);
} else if (kind.equals("actives")){
Logger.info("ACTIVES!!!!!");
}
}
});
// When the socket is closed.
in.onClose(new Callback0() {
public void invoke() {
String displayID = outToID.get(out);
outToID.remove(out);
activeDisplays.remove(displayID);
Logger.info(
"\n ******* MESSAGE RECIEVED *******" +
"\n Display " + displayID + "is now disconnected." +
"\n*********************************"
);
}
});
}
};
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
59241621d745c226042ead7bce5c5f85eadcb99c
|
071a9fa7cfee0d1bf784f6591cd8d07c6b2a2495
|
/corpus/class/sling/470.java
|
6563c57d2a96eaea8ad5147dcf725aa391bec3b3
|
[
"MIT"
] |
permissive
|
masud-technope/ACER-Replication-Package-ASE2017
|
41a7603117f01382e7e16f2f6ae899e6ff3ad6bb
|
cb7318a729eb1403004d451a164c851af2d81f7a
|
refs/heads/master
| 2021-06-21T02:19:43.602864
| 2021-02-13T20:44:09
| 2021-02-13T20:44:09
| 187,748,164
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,082
|
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.sling.commons.testing.osgi;
import java.util.Collections;
import java.util.Dictionary;
import java.util.Hashtable;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
public class MockServiceReference implements ServiceReference {
private static long serviceIdCounter = 0;
private Bundle bundle;
private Dictionary<String, Object> props;
public MockServiceReference(Bundle bundle) {
this.bundle = bundle;
this.props = new Hashtable<String, Object>();
// mockup a service id
props.put(Constants.SERVICE_ID, serviceIdCounter++);
}
public Bundle getBundle() {
return bundle;
}
public void setProperty(String key, Object value) {
props.put(key, value);
}
public Object getProperty(String key) {
return props.get(key);
}
public String[] getPropertyKeys() {
return Collections.list(props.keys()).toArray(new String[props.size()]);
}
public Bundle[] getUsingBundles() {
return null;
}
public boolean isAssignableTo(Bundle bundle, String className) {
return false;
}
public int compareTo(Object reference) {
return 0;
}
}
|
[
"masudcseku@gmail.com"
] |
masudcseku@gmail.com
|
a00dd60ebd4652984edc8b59bdd05d3fcbfd5f03
|
ce0e785348eccfbe071648e1a32ba7b9b74ead60
|
/guoren-market-service/src/main/java/com/gop/config/GoogleAuthConstants.java
|
1c39c932ae1c5008e633a2030fa6ba9fc0a370ad
|
[] |
no_license
|
littleOrange8023/market
|
0c279e8dd92db4dd23e20aeff037e4b2998f9e0e
|
093ce8850624061bb6e51dd064b606c82fccbadd
|
refs/heads/master
| 2020-04-19T11:05:11.191298
| 2019-01-25T07:04:27
| 2019-01-25T07:04:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 167
|
java
|
package com.gop.config;
public class GoogleAuthConstants {
//redis存储google秘钥 key前缀
public static final String PRIX = "GoogleAuthenticator:";
}
|
[
"ydq@yangdongqiongdeMacBook-Air.local"
] |
ydq@yangdongqiongdeMacBook-Air.local
|
580f606da6ffd16458009e23cc6b31c83b1f947b
|
8af1164bac943cef64e41bae312223c3c0e38114
|
/results-java/alibaba--druid/7042c7aff3deda6969a9198d3ce800cab302b45d/after/SQLAggregateExpr.java
|
ee299c28f891409bf7bd9a2ed749be985b42e5d7
|
[] |
no_license
|
fracz/refactor-extractor
|
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
|
dd5e82bfcc376e74a99e18c2bf54c95676914272
|
refs/heads/master
| 2021-01-19T06:50:08.211003
| 2018-11-30T13:00:57
| 2018-11-30T13:00:57
| 87,353,478
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,984
|
java
|
/*
* Copyright 1999-2017 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law 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.alibaba.druid.sql.ast.expr;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.*;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
public class SQLAggregateExpr extends SQLExprImpl implements Serializable {
private static final long serialVersionUID = 1L;
protected String methodName;
protected SQLAggregateOption option;
protected final List<SQLExpr> arguments = new ArrayList<SQLExpr>();
protected SQLKeep keep;
protected SQLOver over;
protected SQLOrderBy withinGroup;
protected boolean ignoreNulls = false;
public SQLAggregateExpr(String methodName){
this.methodName = methodName;
}
public SQLAggregateExpr(String methodName, SQLAggregateOption option){
this.methodName = methodName;
this.option = option;
}
public String getMethodName() {
return this.methodName;
}
public void setMethodName(String methodName) {
this.methodName = methodName;
}
public SQLOrderBy getWithinGroup() {
return withinGroup;
}
public void setWithinGroup(SQLOrderBy withinGroup) {
if (withinGroup != null) {
withinGroup.setParent(this);
}
this.withinGroup = withinGroup;
}
public SQLAggregateOption getOption() {
return this.option;
}
public void setOption(SQLAggregateOption option) {
this.option = option;
}
public List<SQLExpr> getArguments() {
return this.arguments;
}
public void addArgument(SQLExpr argument) {
if (argument != null) {
argument.setParent(this);
}
this.arguments.add(argument);
}
public SQLOver getOver() {
return over;
}
public void setOver(SQLOver over) {
if (over != null) {
over.setParent(this);
}
this.over = over;
}
public SQLKeep getKeep() {
return keep;
}
public void setKeep(SQLKeep keep) {
if (keep != null) {
keep.setParent(this);
}
this.keep = keep;
}
public boolean isIgnoreNulls() {
return this.ignoreNulls;
}
public void setIgnoreNulls(boolean ignoreNulls) {
this.ignoreNulls = ignoreNulls;
}
public String toString() {
return SQLUtils.toSQLString(this);
}
@Override
protected void accept0(SQLASTVisitor visitor) {
if (visitor.visit(this)) {
acceptChild(visitor, this.arguments);
acceptChild(visitor, this.over);
}
visitor.endVisit(this);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((arguments == null) ? 0 : arguments.hashCode());
result = prime * result + ((methodName == null) ? 0 : methodName.hashCode());
result = prime * result + ((option == null) ? 0 : option.hashCode());
result = prime * result + ((over == null) ? 0 : over.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
SQLAggregateExpr other = (SQLAggregateExpr) obj;
if (arguments == null) {
if (other.arguments != null) {
return false;
}
} else if (!arguments.equals(other.arguments)) {
return false;
}
if (methodName == null) {
if (other.methodName != null) {
return false;
}
} else if (!methodName.equals(other.methodName)) {
return false;
}
if (over == null) {
if (other.over != null) {
return false;
}
} else if (!over.equals(other.over)) {
return false;
}
if (option != other.option) {
return false;
}
return true;
}
public SQLAggregateExpr clone() {
SQLAggregateExpr x = new SQLAggregateExpr(methodName);
x.option = option;
for (SQLExpr arg : arguments) {
x.addArgument(arg.clone());
}
if (keep != null) {
x.setKeep(keep.clone());
}
if (over != null) {
x.setOver(over.clone());
}
if (withinGroup != null) {
x.setWithinGroup(withinGroup.clone());
}
x.ignoreNulls = ignoreNulls;
return x;
}
public SQLDataType computeDataType() {
if ("count".equals(methodName)
|| "row_number".equals(methodName)) {
return SQLIntegerExpr.DEFAULT_DATA_TYPE;
}
if (arguments.size() > 0) {
SQLDataType dataType = arguments.get(0).computeDataType();
if (dataType != null) {
return dataType;
}
}
if ("wm_conat".equals(methodName)
|| "group_concat".equals(methodName)) {
return SQLCharExpr.DEFAULT_DATA_TYPE;
}
return null;
}
}
|
[
"fraczwojciech@gmail.com"
] |
fraczwojciech@gmail.com
|
698bd73578cd96c657e24b9cb493b5d08255d2d4
|
4627d514d6664526f58fbe3cac830a54679749cd
|
/results/cling/closure-com.google.javascript.rhino.jstype.JSType-com.google.javascript.rhino.jstype.ProxyObjectType-12/com/google/javascript/rhino/jstype/ProxyObjectType_ESTest.java
|
1f7e7b35b3e6e9d389b88fcec72c7ed31b6d0556
|
[] |
no_license
|
STAMP-project/Cling-application
|
c624175a4aa24bb9b29b53f9b84c42a0f18631bd
|
0ff4d7652b434cbfd9be8d8bb38cfc8d8eaa51b5
|
refs/heads/master
| 2022-07-27T09:30:16.423362
| 2022-07-19T12:01:46
| 2022-07-19T12:01:46
| 254,310,667
| 2
| 2
| null | 2021-07-12T12:29:50
| 2020-04-09T08:11:35
| null |
UTF-8
|
Java
| false
| false
| 2,764
|
java
|
/*
* Tue Mar 03 18:37:14 GMT 2020
*/
package com.google.javascript.rhino.jstype;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import com.google.javascript.rhino.SimpleErrorReporter;
import com.google.javascript.rhino.jstype.JSType;
import com.google.javascript.rhino.jstype.JSTypeRegistry;
import com.google.javascript.rhino.jstype.ProxyObjectType;
import com.google.javascript.rhino.jstype.StaticScope;
import com.google.javascript.rhino.jstype.VoidType;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false, useJEE = true)
public class ProxyObjectType_ESTest extends ProxyObjectType_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
VoidType voidType0 = new VoidType((JSTypeRegistry) null);
JSTypeRegistry jSTypeRegistry0 = mock(JSTypeRegistry.class, new ViolatedAssumptionAnswer());
doReturn((JSType) null).when(jSTypeRegistry0).getNativeType(any(com.google.javascript.rhino.jstype.JSTypeNative.class));
ProxyObjectType proxyObjectType0 = new ProxyObjectType(jSTypeRegistry0, voidType0);
boolean boolean0 = proxyObjectType0.isGlobalThisType();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test1() throws Throwable {
JSTypeRegistry jSTypeRegistry0 = mock(JSTypeRegistry.class, new ViolatedAssumptionAnswer());
doReturn((JSType) null).when(jSTypeRegistry0).getNativeType(any(com.google.javascript.rhino.jstype.JSTypeNative.class));
ProxyObjectType proxyObjectType0 = new ProxyObjectType(jSTypeRegistry0, (JSType) null);
boolean boolean0 = proxyObjectType0.isGlobalThisType();
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test2() throws Throwable {
SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter();
JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false);
JSType jSType0 = jSTypeRegistry0.getType((StaticScope<JSType>) null, "NUMBER_TYPE", "", 1, 51);
boolean boolean0 = jSType0.hasDisplayName();
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test3() throws Throwable {
JSTypeRegistry jSTypeRegistry0 = mock(JSTypeRegistry.class, new ViolatedAssumptionAnswer());
ProxyObjectType proxyObjectType0 = new ProxyObjectType(jSTypeRegistry0, (JSType) null);
boolean boolean0 = proxyObjectType0.hasDisplayName();
assertFalse(boolean0);
}
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
88cc7480bc4131aff4ab449476e9bbd36f954fe5
|
e5f9de773b00f5f02925d146feff7ec8e1217038
|
/src/main/java/org/eel/kitchen/jsonschema/keyword/common/MinimumKeywordValidator.java
|
a3fd52cabfce3cba8d872b0cf6052bb398f12acd
|
[] |
no_license
|
kedar031/json-schema-validator
|
49a70ced60f4d926d0847387af9d29199134958b
|
980f3985ee40e4b596b2824d6bb37171a88a45e1
|
refs/heads/master
| 2021-01-17T22:27:08.266828
| 2013-01-03T22:24:15
| 2013-01-03T22:24:15
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,297
|
java
|
/*
* Copyright (c) 2012, Francis Galiegue <fgaliegue@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Lesser GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Lesser GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.eel.kitchen.jsonschema.keyword.common;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.BooleanNode;
import org.eel.kitchen.jsonschema.keyword.NumericKeywordValidator;
import org.eel.kitchen.jsonschema.report.Message;
import org.eel.kitchen.jsonschema.report.ValidationReport;
import java.math.BigDecimal;
/**
* Validator for the {@code minimum} keyword
*
* <p>This validator pairs with {@code exclusiveMinimum}. The latter has no
* signification by itself without {@code minimum}</p>
*/
public final class MinimumKeywordValidator
extends NumericKeywordValidator
{
private final boolean exclusive;
public MinimumKeywordValidator(final JsonNode schema)
{
super("minimum", schema);
exclusive = schema.path("exclusiveMinimum").asBoolean(false);
}
@Override
protected void validateLong(final ValidationReport report,
final JsonNode instance)
{
final long instanceValue = instance.longValue();
final long longValue = number.longValue();
if (instanceValue > longValue)
return;
final Message.Builder msg = newMsg().addInfo(keyword, number)
.addInfo("found", instance);
if (instanceValue < longValue) {
msg.setMessage("number is lower than the required minimum");
report.addMessage(msg.build());
return;
}
if (!exclusive)
return;
msg.addInfo("exclusiveMinimum", BooleanNode.TRUE).setMessage("number is"
+ " not strictly greater than the required minimum");
report.addMessage(msg.build());
}
@Override
protected void validateDecimal(final ValidationReport report,
final JsonNode instance)
{
final BigDecimal instanceValue = instance.decimalValue();
final BigDecimal decimalValue = number.decimalValue();
final int cmp = instanceValue.compareTo(decimalValue);
if (cmp > 0)
return;
final Message.Builder msg = newMsg().addInfo(keyword, number)
.addInfo("found", instance);
if (cmp < 0) {
msg.setMessage("number is lower than the required minimum");
report.addMessage(msg.build());
return;
}
if (!exclusive)
return;
msg.addInfo("exclusiveMinimum", BooleanNode.TRUE)
.setMessage("number is not strictly greater than the required "
+ "minimum");
report.addMessage(msg.build());
}
}
|
[
"fgaliegue@gmail.com"
] |
fgaliegue@gmail.com
|
5843b46689fc36e2a3a4563ee56fae66a3238940
|
18237bc643deab327a4b49b16b49ed4154f5f99b
|
/ambit2-all/ambit2-smarts/src/main/java/ambit2/smarts/processors/SMARTSPropertiesReader.java
|
fc6c5a59720906d0a4cd8c7aa4ecac5bf1a1a236
|
[] |
no_license
|
ideaconsult/ambit-mirror
|
14ce076cd286ca4f5dc3465ed4105b03967c7cf0
|
21655a99791ef2f538786367f6dc779d3bff0200
|
refs/heads/master
| 2023-08-22T20:26:43.554464
| 2023-07-15T10:35:41
| 2023-07-15T10:35:41
| 133,390,762
| 5
| 3
| null | 2022-05-16T18:53:27
| 2018-05-14T16:28:03
|
Java
|
UTF-8
|
Java
| false
| false
| 1,919
|
java
|
package ambit2.smarts.processors;
import net.idea.modbcum.i.exceptions.AmbitException;
import net.idea.modbcum.p.DefaultAmbitProcessor;
import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.interfaces.IBond;
import ambit2.base.data.Property;
import ambit2.smarts.CMLUtilities;
/**
* Expects properties to accelerate smarts search , expected in CMLUtilities.SMARTSProp
* @author nina
*
*/
public class SMARTSPropertiesReader extends DefaultAmbitProcessor<IAtomContainer, IAtomContainer> {
protected CMLUtilities util = new CMLUtilities();
/**
*
*/
private static final long serialVersionUID = -2900200524126295738L;
public IAtomContainer process(IAtomContainer mol)
throws AmbitException {
Property p = getProperty();
if (mol.getProperty(p) == null) return null;
String[] prop = mol.getProperty(p).toString().split("\n");
String[] atomprops =prop[0].split(",");
for (int i=0; i < atomprops.length;i++)
mol.getAtom(i).setProperty(CMLUtilities.SMARTSProp,atomprops[i]);
if (prop.length == 1) logger.warning("Bond properties missing!");
else {
String[] bondprop =prop[1].split(",");
for (int i=0; i < mol.getAtomCount();i++)
mol.getAtom(i).setFlag(CDKConstants.ISAROMATIC,false);
for (int i=0; i < bondprop.length;i++) {
boolean aromatic = bondprop[i].equals("1")?true:false;
IBond bond = mol.getBond(i);
bond.setFlag(CDKConstants.ISAROMATIC, aromatic);
for (int b=0; b < bond.getAtomCount(); b++)
if (aromatic) bond.getAtom(b).setFlag(CDKConstants.ISAROMATIC, true);
}
}
if (util == null) util = new CMLUtilities();
util.extractSMARTSProperties((IAtomContainer)mol);
return mol;
}
protected Property getProperty() {
return Property.getInstance(CMLUtilities.SMARTSProp, CMLUtilities.SMARTSProp);
}
}
|
[
"jeliazkova.nina@gmail.com"
] |
jeliazkova.nina@gmail.com
|
c2b51f697c2d0cecef19b2721bb8a154120fe794
|
1ba27fc930ba20782e9ef703e0dc7b69391e191b
|
/Src/prjCheckstyle/src2/com/compuware/caqs/pmd/rules/ImportWrapper.java
|
1c1755ca62491354d0bf9ed8cf6ed58c5fccd9a2
|
[] |
no_license
|
LO-RAN/codeQualityPortal
|
b0d81c76968bdcfce659959d0122e398c647b09f
|
a7c26209a616d74910f88ce0d60a6dc148dda272
|
refs/heads/master
| 2023-07-11T18:39:04.819034
| 2022-03-31T15:37:56
| 2022-03-31T15:37:56
| 37,261,337
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 895
|
java
|
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package com.compuware.caqs.pmd.rules;
import com.compuware.caqs.pmd.ast.SimpleNode;
public class ImportWrapper {
private SimpleNode node;
private String name;
private String fullname;
public ImportWrapper(String fullname, String name, SimpleNode node) {
this.fullname = fullname;
this.name = name;
this.node = node;
}
public boolean equals(Object other) {
ImportWrapper i = (ImportWrapper) other;
return i.getName().equals(name);
}
public int hashCode() {
return getName().hashCode();
}
public String getName() {
return name;
}
public String getFullName() {
return fullname;
}
public SimpleNode getNode() {
return node;
}
}
|
[
"laurent.izac@gmail.com"
] |
laurent.izac@gmail.com
|
babac92927139981caa10feffff94bd77f50c775
|
a15e6062d97bd4e18f7cefa4fe4a561443cc7bc8
|
/src/combit/ListLabel24/ShowHelpEventArgs.java
|
5e6fdb74dbb9a2fb1e1b3f4554b4c97751b02121
|
[] |
no_license
|
Javonet-io-user/e66e9f78-68be-483d-977e-48d29182c947
|
017cf3f4110df45e8ba4a657ba3caba7789b5a6e
|
02ec974222f9bb03a938466bd6eb2421bb3e2065
|
refs/heads/master
| 2020-04-15T22:55:05.972920
| 2019-01-10T16:01:59
| 2019-01-10T16:01:59
| 165,089,187
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,349
|
java
|
package combit.ListLabel24;
import Common.Activation;
import static Common.Helper.Convert;
import static Common.Helper.getGetObjectName;
import static Common.Helper.getReturnObjectName;
import static Common.Helper.ConvertToConcreteInterfaceImplementation;
import Common.Helper;
import com.javonet.Javonet;
import com.javonet.JavonetException;
import com.javonet.JavonetFramework;
import com.javonet.api.NObject;
import com.javonet.api.NEnum;
import com.javonet.api.keywords.NRef;
import com.javonet.api.keywords.NOut;
import com.javonet.api.NControlContainer;
import java.util.concurrent.atomic.AtomicReference;
import java.util.Iterator;
import java.lang.*;
import jio.System.*;
import combit.ListLabel24.*;
import jio.System.Windows.Forms.*;
public class ShowHelpEventArgs extends EventArgs {
protected NObject javonetHandle;
/** GetProperty */
public LlHelpType getHelpType() {
try {
Object res = javonetHandle.<NEnum>get("HelpType");
if (res == null) return null;
return LlHelpType.valueOf(((NEnum) res).getValueName());
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return null;
}
}
/** GetProperty */
public java.lang.Integer getContextId() {
try {
java.lang.Integer res = javonetHandle.get("ContextId");
if (res == null) return 0;
return res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return 0;
}
}
/** SetProperty */
public void setIsProcessed(java.lang.Boolean value) {
try {
javonetHandle.set("IsProcessed", value);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
/** GetProperty */
public java.lang.Boolean getIsProcessed() {
try {
java.lang.Boolean res = javonetHandle.get("IsProcessed");
if (res == null) return false;
return res;
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return false;
}
}
/** GetProperty */
public IWin32Window getDesignerWindow() {
try {
Object res = javonetHandle.<NObject>get("DesignerWindow");
if (res == null) return null;
return ConvertToConcreteInterfaceImplementation(res);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
return null;
}
}
public ShowHelpEventArgs(
LlHelpType helpType, java.lang.Integer contextId, IWin32Window designerWindow) {
super((NObject) null);
try {
javonetHandle =
Javonet.New(
"combit.ListLabel24.ShowHelpEventArgs",
NEnum.fromJavaEnum(helpType),
contextId,
designerWindow);
super.setJavonetHandle(javonetHandle);
} catch (JavonetException _javonetException) {
_javonetException.printStackTrace();
}
}
public ShowHelpEventArgs(NObject handle) {
super(handle);
this.javonetHandle = handle;
}
public void setJavonetHandle(NObject handle) {
this.javonetHandle = handle;
}
static {
try {
Activation.initializeJavonet();
} catch (java.lang.Exception e) {
e.printStackTrace();
}
}
}
|
[
"support@javonet.com"
] |
support@javonet.com
|
3f7d519f9b86d8d59fb4a7ccd550935c8284401b
|
02a7d8477ade9e35ebe5fb932d888474df186c5a
|
/main/src/com/smartgwt/client/docs/OfflineGroup.java
|
64d0bd22300e86b374869ba81d76364e60cc2f83
|
[] |
no_license
|
miunsi63/smartgwt
|
39575568ac8d2184d49cbcfb2311999150619c49
|
36f21279de6fb5588ca8cbff6bf015871c65194b
|
refs/heads/master
| 2020-06-14T15:29:31.789639
| 2019-03-25T03:40:15
| 2019-03-25T03:40:15
| 35,267,091
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 914
|
java
|
package com.smartgwt.client.docs;
/**
* The following APIs are all related to OfflineGroup.
* @see com.smartgwt.client.data.DataSource#useOfflineResponse
* @see com.smartgwt.client.util.Offline
* @see com.smartgwt.client.data.DataSource#offlineMessage
* @see com.smartgwt.client.rpc.RPCResponse#STATUS_OFFLINE
* @see com.smartgwt.client.widgets.grid.ListGrid#getOfflineMessageStyle
* @see com.smartgwt.client.data.DataSource#getUseOfflineStorage
* @see com.smartgwt.client.data.DSResponse#getOfflineTimestamp
* @see com.smartgwt.client.data.DSResponse#getFromOfflineCache
* @see com.smartgwt.client.grid.GridRenderer#getShowOfflineMessage
* @see com.smartgwt.client.grid.GridRenderer#getOfflineMessageStyle
* @see com.smartgwt.client.grid.GridRenderer#getOfflineMessage
* @see com.smartgwt.client.widgets.tree.TreeGrid#getOfflineNodeMessage
*/
public interface OfflineGroup {
}
|
[
"smartgwt.dev@97ff703d-2b4d-0410-aac2-33a30ea07567"
] |
smartgwt.dev@97ff703d-2b4d-0410-aac2-33a30ea07567
|
6f000b6281a6652c80fc9411ce7ded50617bf319
|
882e77219bce59ae57cbad7e9606507b34eebfcf
|
/mi2s_10_miui12/src/main/java/de/greenrobot/event/util/ErrorDialogConfig.java
|
dde4f022d8d056493051aec57ed0e02980339691
|
[] |
no_license
|
CrackerCat/XiaomiFramework
|
17a12c1752296fa1a52f61b83ecf165f328f4523
|
0b7952df317dac02ebd1feea7507afb789cef2e3
|
refs/heads/master
| 2022-06-12T03:30:33.285593
| 2020-05-06T11:30:54
| 2020-05-06T11:30:54
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,142
|
java
|
package de.greenrobot.event.util;
import android.content.res.Resources;
import android.util.Log;
import de.greenrobot.event.EventBus;
public class ErrorDialogConfig {
int defaultDialogIconId;
final int defaultErrorMsgId;
Class<?> defaultEventTypeOnDialogClosed;
final int defaultTitleId;
EventBus eventBus;
boolean logExceptions = true;
final ExceptionToResourceMapping mapping;
final Resources resources;
String tagForLoggingExceptions;
public ErrorDialogConfig(Resources resources2, int defaultTitleId2, int defaultMsgId) {
this.resources = resources2;
this.defaultTitleId = defaultTitleId2;
this.defaultErrorMsgId = defaultMsgId;
this.mapping = new ExceptionToResourceMapping();
}
public ErrorDialogConfig addMapping(Class<? extends Throwable> clazz, int msgId) {
this.mapping.addMapping(clazz, msgId);
return this;
}
public int getMessageIdForThrowable(Throwable throwable) {
Integer resId = this.mapping.mapThrowable(throwable);
if (resId != null) {
return resId.intValue();
}
String str = EventBus.TAG;
Log.d(str, "No specific message ressource ID found for " + throwable);
return this.defaultErrorMsgId;
}
public void setDefaultDialogIconId(int defaultDialogIconId2) {
this.defaultDialogIconId = defaultDialogIconId2;
}
public void setDefaultEventTypeOnDialogClosed(Class<?> defaultEventTypeOnDialogClosed2) {
this.defaultEventTypeOnDialogClosed = defaultEventTypeOnDialogClosed2;
}
public void disableExceptionLogging() {
this.logExceptions = false;
}
public void setTagForLoggingExceptions(String tagForLoggingExceptions2) {
this.tagForLoggingExceptions = tagForLoggingExceptions2;
}
public void setEventBus(EventBus eventBus2) {
this.eventBus = eventBus2;
}
/* access modifiers changed from: package-private */
public EventBus getEventBus() {
EventBus eventBus2 = this.eventBus;
return eventBus2 != null ? eventBus2 : EventBus.getDefault();
}
}
|
[
"sanbo.xyz@gmail.com"
] |
sanbo.xyz@gmail.com
|
114aa47ba6e6e0a0c63aa5cd1a43c1d21aa1191b
|
572071ee133309caf78e076b669f9b33a868d60c
|
/org.activebpel.rt.bpel/src/org/activebpel/rt/bpel/impl/storage/AeReplySerializer.java
|
0a3b962cde085bd28f1955a96afdee8883d486b3
|
[] |
no_license
|
deib-polimi/DyBPEL
|
3809bb3f9f453750db52bc1ce1ffd5af412a2c8b
|
7043cec7032858cfd889c9022e935c946e130a6e
|
refs/heads/master
| 2021-01-20T12:21:50.392988
| 2014-12-18T15:07:24
| 2014-12-18T15:07:24
| 28,188,077
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,296
|
java
|
// $Header: /gestionale/org.activebpel.rt.bpel/src/org/activebpel/rt/bpel/impl/storage/AeReplySerializer.java,v 1.1 2009/09/23 13:09:21 zampognaro Exp $
/////////////////////////////////////////////////////////////////////////////
// PROPRIETARY RIGHTS STATEMENT
// The contents of this file represent confidential information that is the
// proprietary property of Active Endpoints, Inc. Viewing or use of
// this information is prohibited without the express written consent of
// Active Endpoints, Inc. Removal of this PROPRIETARY RIGHTS STATEMENT
// is strictly forbidden. Copyright (c) 2002-2005 All rights reserved.
/////////////////////////////////////////////////////////////////////////////
package org.activebpel.rt.bpel.impl.storage;
import org.activebpel.rt.bpel.AeBusinessProcessException;
import org.activebpel.rt.bpel.AeMessages;
import org.activebpel.rt.bpel.impl.IAeImplStateNames;
import org.activebpel.rt.bpel.impl.fastdom.AeFastDocument;
import org.activebpel.rt.bpel.impl.fastdom.AeFastElement;
import org.activebpel.rt.bpel.impl.queue.AeReply;
/**
* Serializes a reply to an instance of {@link
* org.activebpel.rt.bpel.impl.fastdom.AeFastElement} or {@link
* org.activebpel.rt.bpel.impl.fastdom.AeFastDocument}.
*/
public class AeReplySerializer implements IAeImplStateNames
{
/** The reply to serialize. */
private AeReply mReply;
/** The resulting serialization. */
private AeFastElement mReplyElement;
/**
* Serializes the specified reply to an instance of {@link
* org.activebpel.rt.bpel.impl.fastdom.AeFastElement}.
*
* @param aReply
*/
protected AeFastElement createReplyElement(AeReply aReply) throws AeBusinessProcessException
{
AeFastElement replyElement = new AeFastElement(STATE_REPLY);
replyElement.setAttribute(STATE_PID , String.valueOf(aReply.getProcessId()));
replyElement.setAttribute(STATE_REPLY_ID , String.valueOf(aReply.getReplyId()) );
return replyElement;
}
/**
* Returns the reply to serialize.
*/
protected AeReply getReply()
{
return mReply;
}
/**
* Returns an instance of {@link
* org.activebpel.rt.bpel.impl.fastdom.AeFastDocument} representing the
* reply.
*/
public AeFastDocument getReplyDocument() throws AeBusinessProcessException
{
return new AeFastDocument(getReplyElement());
}
/**
* Returns an instance of {@link
* org.activebpel.rt.bpel.impl.fastdom.AeFastElement} representing the reply.
*/
public AeFastElement getReplyElement() throws AeBusinessProcessException
{
if (mReplyElement == null)
{
if (getReply() == null)
{
throw new IllegalStateException(AeMessages.getString("AeReplySerializer.ERROR_0")); //$NON-NLS-1$
}
mReplyElement = createReplyElement(getReply());
}
return mReplyElement;
}
/**
* Resets all output variables.
*/
protected void reset()
{
mReplyElement = null;
}
/**
* Sets the reply to serialize.
*
* @param aReply
*/
public void setReply(AeReply aReply)
{
reset();
mReply = aReply;
}
}
|
[
"giovanniquattrocchi@MacBook-Pro-di-Giovanni.local"
] |
giovanniquattrocchi@MacBook-Pro-di-Giovanni.local
|
44788d95d2c7fa16602f19813bb3244dbb0ed2fd
|
3b22a684e1540d58d07bc6a12ab09584884c273d
|
/hybris/bin/ext-content/cmsfacades/src/de/hybris/platform/cmsfacades/navigations/populator/model/NavigationEntryModelToDataPopulator.java
|
52e3dd672f4be20dbda484b09402a7b4b5325646
|
[] |
no_license
|
ScottGledhill/HYB
|
955221b824b8f0d1b0e584d3f80c2e48bc0c19d9
|
0c91735fe889bc47878c851445220dbcae7ca281
|
refs/heads/master
| 2021-07-25T20:00:36.924559
| 2017-10-27T14:17:02
| 2017-10-27T14:17:02
| 108,548,668
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,412
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package de.hybris.platform.cmsfacades.navigations.populator.model;
import de.hybris.platform.cms2.model.navigation.CMSNavigationEntryModel;
import de.hybris.platform.cmsfacades.navigations.service.NavigationEntryConverterRegistry;
import de.hybris.platform.cmsfacades.navigations.service.NavigationEntryItemModelConverter;
import de.hybris.platform.cmswebservices.data.NavigationEntryData;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
import java.util.Objects;
import org.springframework.beans.factory.annotation.Required;
/**
* This populator will populate the {@link NavigationEntryData}'s base attributes with attributes from
* {@link CMSNavigationNodeModel}.
*/
public class NavigationEntryModelToDataPopulator implements Populator<CMSNavigationEntryModel, NavigationEntryData>
{
private NavigationEntryConverterRegistry navigationEntryConverterRegistry;
@Override
public void populate(final CMSNavigationEntryModel source, final NavigationEntryData target) throws ConversionException
{
if (!Objects.isNull(source.getItem()))
{
final NavigationEntryItemModelConverter navigationEntryItemModelConverter = getNavigationEntryConverterRegistry()
.getNavigationEntryItemModelConverter(source.getItem().getItemtype())
.orElseThrow(() -> new ConversionException("Converter does not exist for the item:" + source.getItem()));
target.setItemSuperType(navigationEntryItemModelConverter.getItemType());
target.setItemId(navigationEntryItemModelConverter.getUniqueIdentifierConverter().apply(source.getItem()));
target.setItemType(source.getItem().getItemtype());
}
}
protected NavigationEntryConverterRegistry getNavigationEntryConverterRegistry()
{
return navigationEntryConverterRegistry;
}
@Required
public void setNavigationEntryConverterRegistry(final NavigationEntryConverterRegistry navigationEntryConverterRegistry)
{
this.navigationEntryConverterRegistry = navigationEntryConverterRegistry;
}
}
|
[
"ScottGledhill@hotmail.co.uk"
] |
ScottGledhill@hotmail.co.uk
|
f0bf5d04047c4401d54f3887da3ecb8a99bfe380
|
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
|
/Method_Scraping/xml_scraping/NicadOutputFile_t1_flink_new2/Nicad_t1_flink_new26700.java
|
84b6378b42c33b7d52af6d11f4cc70d7e8f2ee7d
|
[] |
no_license
|
ryosuke-ku/TestCodeSeacherPlus
|
cfd03a2858b67a05ecf17194213b7c02c5f2caff
|
d002a52251f5461598c7af73925b85a05cea85c6
|
refs/heads/master
| 2020-05-24T01:25:27.000821
| 2019-08-17T06:23:42
| 2019-08-17T06:23:42
| 187,005,399
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 482
|
java
|
// clone pairs:26094:90%
// 40061:flink/flink-runtime/src/main/java/org/apache/flink/runtime/messages/webmonitor/JobIdsWithStatusOverview.java
public class Nicad_t1_flink_new26700
{
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
JobIdWithStatus that = (JobIdWithStatus) o;
return Objects.equals(jobId, that.jobId) &&
jobStatus == that.jobStatus;
}
}
|
[
"naist1020@gmail.com"
] |
naist1020@gmail.com
|
b8bf5aaf4b81f21a3c6a50d23f586e281a460516
|
6d9e10858f477844e536cbcf7323c2dec65ed186
|
/app/src/main/java/james/monochrome/activities/AppCompatPreferenceActivity.java
|
8ba1d3dc4ff24faf4836d71544d136544f4512b8
|
[
"Apache-2.0"
] |
permissive
|
TheAndroidMaster/Monochrome
|
3baa68281b2f2fad9dc94560357da8df1b6a69f1
|
70b405c28d06d6e12da92d5d438b6831c26fbd4c
|
refs/heads/master
| 2021-01-12T15:03:48.633350
| 2018-08-19T00:21:15
| 2018-08-19T00:21:15
| 71,674,503
| 11
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,863
|
java
|
package james.monochrome.activities;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
private AppCompatDelegate mDelegate;
@Override
protected void onCreate(Bundle savedInstanceState) {
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
super.onCreate(savedInstanceState);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
getDelegate().onPostCreate(savedInstanceState);
}
public ActionBar getSupportActionBar() {
return getDelegate().getSupportActionBar();
}
public void setSupportActionBar(@Nullable Toolbar toolbar) {
getDelegate().setSupportActionBar(toolbar);
}
@Override
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
getDelegate().setContentView(layoutResID);
}
@Override
public void setContentView(View view) {
getDelegate().setContentView(view);
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().setContentView(view, params);
}
@Override
public void addContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().addContentView(view, params);
}
@Override
protected void onPostResume() {
super.onPostResume();
getDelegate().onPostResume();
}
@Override
protected void onTitleChanged(CharSequence title, int color) {
super.onTitleChanged(title, color);
getDelegate().setTitle(title);
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
getDelegate().onConfigurationChanged(newConfig);
}
@Override
protected void onStop() {
super.onStop();
getDelegate().onStop();
}
@Override
protected void onDestroy() {
super.onDestroy();
getDelegate().onDestroy();
}
public void invalidateOptionsMenu() {
getDelegate().invalidateOptionsMenu();
}
private AppCompatDelegate getDelegate() {
if (mDelegate == null) {
mDelegate = AppCompatDelegate.create(this, null);
}
return mDelegate;
}
}
|
[
"18jafenn90@gmail.com"
] |
18jafenn90@gmail.com
|
1a92f925dfc585e5e75ba2e69e59dddbb826071c
|
b4a557174523100183a96ad42cfb7b2a87e6428e
|
/library/src/main/java/com/bon/viewanimation/easing/quad/QuadEaseInOut.java
|
73c24eecc4b48e96333000cb7cb25689ad8c0973
|
[] |
no_license
|
atuyen/mcbook_android_test
|
fe9b35ddb02f41933e352188b7ed012b378e550b
|
befa1156b1474ace15e7f08f2821b44f3ac02296
|
refs/heads/master
| 2022-09-09T07:26:23.877307
| 2020-06-03T08:27:43
| 2020-06-03T08:27:43
| 269,031,867
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,653
|
java
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 daimajia
*
* 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.bon.viewanimation.easing.quad;
import com.bon.viewanimation.easing.BaseEasingMethod;
public class QuadEaseInOut extends BaseEasingMethod {
public QuadEaseInOut(float duration) {
super(duration);
}
@Override
public Float calculate(float time, float start, float end, float duration) {
if ((time /= duration / 2) < 1) return end / 2 * time * time + start;
return -end / 2 * ((--time) * (time - 2) - 1) + start;
}
}
|
[
"tuyen.nguyen@sea-solutions.com"
] |
tuyen.nguyen@sea-solutions.com
|
a172d8f1e9c3a33e53f77fd2f3d38e0793167606
|
9d32980f5989cd4c55cea498af5d6a413e08b7a2
|
/A1_7_1_1/src/main/java/android/drm/DrmConvertedStatus.java
|
f88ba0ac95a3bb46b559b2fa529c972c94a593d2
|
[] |
no_license
|
liuhaosource/OppoFramework
|
e7cc3bcd16958f809eec624b9921043cde30c831
|
ebe39acabf5eae49f5f991c5ce677d62b683f1b6
|
refs/heads/master
| 2023-06-03T23:06:17.572407
| 2020-11-30T08:40:07
| 2020-11-30T08:40:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,783
|
java
|
package android.drm;
/* JADX ERROR: NullPointerException in pass: ExtractFieldInit
java.lang.NullPointerException
at jadx.core.utils.BlockUtils.isAllBlocksEmpty(BlockUtils.java:546)
at jadx.core.dex.visitors.ExtractFieldInit.getConstructorsList(ExtractFieldInit.java:221)
at jadx.core.dex.visitors.ExtractFieldInit.moveCommonFieldsInit(ExtractFieldInit.java:121)
at jadx.core.dex.visitors.ExtractFieldInit.visit(ExtractFieldInit.java:46)
at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:12)
at jadx.core.ProcessClass.process(ProcessClass.java:32)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)
*/
public class DrmConvertedStatus {
public static final int STATUS_ERROR = 3;
public static final int STATUS_INPUTDATA_ERROR = 2;
public static final int STATUS_OK = 1;
public final byte[] convertedData;
public final int offset;
public final int statusCode;
/* JADX ERROR: Method load error
jadx.core.utils.exceptions.DecodeException: Load method exception: bogus opcode: 00e9 in method: android.drm.DrmConvertedStatus.<init>(int, byte[], int):void, dex:
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:118)
at jadx.core.dex.nodes.ClassNode.load(ClassNode.java:248)
at jadx.core.ProcessClass.process(ProcessClass.java:29)
at jadx.api.JadxDecompiler.processClass(JadxDecompiler.java:292)
at jadx.api.JavaClass.decompile(JavaClass.java:62)
at jadx.api.JadxDecompiler.lambda$appendSourcesSave$0(JadxDecompiler.java:200)
Caused by: java.lang.IllegalArgumentException: bogus opcode: 00e9
at com.android.dx.io.OpcodeInfo.get(OpcodeInfo.java:1227)
at com.android.dx.io.OpcodeInfo.getName(OpcodeInfo.java:1234)
at jadx.core.dex.instructions.InsnDecoder.decode(InsnDecoder.java:581)
at jadx.core.dex.instructions.InsnDecoder.process(InsnDecoder.java:74)
at jadx.core.dex.nodes.MethodNode.load(MethodNode.java:104)
... 5 more
*/
public DrmConvertedStatus(int r1, byte[] r2, int r3) {
/*
// Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: android.drm.DrmConvertedStatus.<init>(int, byte[], int):void, dex:
*/
throw new UnsupportedOperationException("Method not decompiled: android.drm.DrmConvertedStatus.<init>(int, byte[], int):void");
}
private boolean isValidStatusCode(int statusCode) {
if (statusCode == 1 || statusCode == 2 || statusCode == 3) {
return true;
}
return false;
}
}
|
[
"dstmath@163.com"
] |
dstmath@163.com
|
944492e7cfb252add3aaa151e97ef89ae7cf0d4f
|
b863479f00471986561c57291edb483fc5f4532c
|
/src/main/java/nom/bdezonia/zorbage/algorithm/Multiply.java
|
296ff5c7a416abc837f5677a47723d545ef44bcd
|
[] |
permissive
|
bdezonia/zorbage
|
6da6cbdc8f9fcb6cde89d39aca9687e2eee08c9b
|
651625e60b7d6ca9273ffc1a282b6a8af5c2d925
|
refs/heads/master
| 2023-09-01T08:32:59.157936
| 2023-08-08T00:57:18
| 2023-08-08T00:57:18
| 74,696,586
| 11
| 0
|
BSD-2-Clause
| 2020-11-09T03:01:42
| 2016-11-24T18:24:55
|
Java
|
UTF-8
|
Java
| false
| false
| 4,992
|
java
|
/*
* Zorbage: an algebraic data hierarchy for use in numeric processing.
*
* Copyright (c) 2016-2022 Barry DeZonia 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 <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 <COPYRIGHT HOLDER> 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 nom.bdezonia.zorbage.algorithm;
import nom.bdezonia.zorbage.algebra.Addition;
import nom.bdezonia.zorbage.algebra.Algebra;
import nom.bdezonia.zorbage.algebra.Bounded;
import nom.bdezonia.zorbage.algebra.EvenOdd;
import nom.bdezonia.zorbage.algebra.Ordered;
import nom.bdezonia.zorbage.algebra.ScaleByOneHalf;
import nom.bdezonia.zorbage.algebra.Unity;
// Adapted from an algorithm as published by Stepanov and Rose 2015.
// I believe it is a Russian Peasant approach.
/**
*
* @author Barry DeZonia
*
*/
public class Multiply {
// do not instantiate
private Multiply() { }
/**
* Multiply is an algorithm for multiplying many kinds of types.
* In this code z = x * y.
*
* @param algebra
* @param x
* @param y
* @param z
*/
public static <T extends Algebra<T,U> & Addition<U> & Unity<U> & Ordered<U> & EvenOdd<U> &
ScaleByOneHalf<U> & Bounded<U>,
U>
void compute(T algebra, U x, U y, U z)
{
// optimize zero calculations away
U zero = algebra.construct();
if (algebra.isZero().call(x) || algebra.isZero().call(y)) {
algebra.assign().call(zero, z);
return;
}
// This part of the code kind of assumes that the passed in type is a
// modular integer
U min = algebra.construct();
algebra.minBound().call(min);
if (algebra.isEqual().call(x, min)) {
if (algebra.isOdd().call(y))
algebra.assign().call(min, z);
else
algebra.assign().call(zero, z);
return;
}
if (algebra.isEqual().call(y, min)) {
if (algebra.isOdd().call(x))
algebra.assign().call(min, z);
else
algebra.assign().call(zero, z);
return;
}
// make sure inputs are positive. this code only applies to signed types.
// unsigned types just pass through.
boolean xNeg;
boolean yNeg;
U xPos = algebra.construct();
U yPos = algebra.construct();
if (algebra.isLess().call(x, zero)) {
xNeg = true;
algebra.negate().call(x, xPos);
}
else {
xNeg = false;
algebra.assign().call(x, xPos);
}
if (algebra.isLess().call(y, zero)) {
yNeg = true;
algebra.negate().call(y, yPos);
}
else {
yNeg = false;
algebra.assign().call(y, yPos);
}
// swap terms so that fastest form of input is used
if (algebra.isGreater().call(xPos, yPos)) {
Swap.compute(algebra, xPos, yPos);
}
// 1st Stepanov algorithm inline
U one = algebra.construct();
algebra.unity().call(one);
while (!algebra.isOdd().call(xPos)) {
algebra.add().call(yPos, yPos, yPos);
algebra.scaleByOneHalf().call(1, xPos, xPos);
}
if (algebra.isEqual().call(one, xPos)) {
algebra.assign().call(yPos, z);
if (xNeg != yNeg) {
// flip the result's sign once
algebra.subtract().call(zero, z, z);
}
return;
}
// 2nd Stepanov algorithm inline
U r = algebra.construct(yPos);
U n = algebra.construct(xPos);
algebra.subtract().call(n, one, n);
algebra.scaleByOneHalf().call(1, n, n);
U a = algebra.construct(yPos);
algebra.add().call(a, a, a);
while (true) {
if (algebra.isOdd().call(n)) {
algebra.add().call(r, a, r);
if (algebra.isEqual().call(one, n)) {
algebra.assign().call(r, z);
if (xNeg != yNeg) {
// flip the result's sign once
algebra.subtract().call(zero, z, z);
}
return;
}
}
algebra.scaleByOneHalf().call(1, n, n);
algebra.add().call(a, a, a);
}
}
}
|
[
"bdezonia@gmail.com"
] |
bdezonia@gmail.com
|
b51ed54b34353b72bfdcbb36591d9ed8b8cfa4f4
|
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
|
/tags/2007-04-09/seasar2-2.4.12/s2-framework/src/main/java/org/seasar/framework/util/ArrayIterator.java
|
061ccc44f100db5e18403dada1c6a37a5690eeae
|
[
"Apache-2.0"
] |
permissive
|
svn2github/s2container
|
54ca27cf0c1200a93e1cb88884eb8226a9be677d
|
625adc6c4e1396654a7297d00ec206c077a78696
|
refs/heads/master
| 2020-06-04T17:15:02.140847
| 2013-08-09T09:38:15
| 2013-08-09T09:38:15
| 10,850,644
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,417
|
java
|
/*
* Copyright 2004-2007 the Seasar Foundation and the Others.
*
* 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.seasar.framework.util;
import java.util.Iterator;
import java.util.NoSuchElementException;
/**
* @author shot
*/
public class ArrayIterator implements Iterator {
private Object[] items_;
private int index_ = 0;
public ArrayIterator(Object items[]) {
items_ = items;
}
public boolean hasNext() {
return index_ < items_.length;
}
public Object next() {
try {
Object o = items_[index_];
index_++;
return o;
} catch (IndexOutOfBoundsException e) {
throw new NoSuchElementException("index=" + index_);
}
}
public void remove() {
throw new UnsupportedOperationException("remove");
}
}
|
[
"koichik@319488c0-e101-0410-93bc-b5e51f62721a"
] |
koichik@319488c0-e101-0410-93bc-b5e51f62721a
|
703b1b674ff09ab7b23c93566d23c83c850815e2
|
963599f6f1f376ba94cbb504e8b324bcce5de7a3
|
/sources/com/drew/metadata/mov/media/QuickTimeTextDirectory.java
|
f65a92117b509517cb62f75277e438a7a53538f5
|
[] |
no_license
|
NikiHard/cuddly-pancake
|
563718cb73fdc4b7b12c6233d9bf44f381dd6759
|
3a5aa80d25d12da08fd621dc3a15fbd536d0b3d4
|
refs/heads/main
| 2023-04-09T06:58:04.403056
| 2021-04-20T00:45:08
| 2021-04-20T00:45:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,323
|
java
|
package com.drew.metadata.mov.media;
import com.drew.metadata.mov.QuickTimeDirectory;
import java.util.HashMap;
public class QuickTimeTextDirectory extends QuickTimeDirectory {
public static final int TAG_ANTI_ALIAS = 9;
public static final int TAG_AUTO_SCALE = 1;
public static final int TAG_BACKGROUND_COLOR = 12;
public static final int TAG_CONTINUOUS_SCROLL = 7;
public static final int TAG_DEFAULT_TEXT_BOX = 13;
public static final int TAG_DROP_SHADOW = 8;
public static final int TAG_FONT_FACE = 15;
public static final int TAG_FONT_NUMBER = 14;
public static final int TAG_FOREGROUND_COLOR = 16;
public static final int TAG_HORIZONTAL_SCROLL = 5;
public static final int TAG_JUSTIFICATION = 11;
public static final int TAG_KEY_TEXT = 10;
public static final int TAG_MOVIE_BACKGROUND_COLOR = 2;
public static final int TAG_NAME = 17;
public static final int TAG_REVERSE_SCROLL = 6;
public static final int TAG_SCROLL_IN = 3;
public static final int TAG_SCROLL_OUT = 4;
protected static final HashMap<Integer, String> _tagNameMap = new HashMap<>();
public String getName() {
return "QuickTime Text";
}
public QuickTimeTextDirectory() {
setDescriptor(new QuickTimeTextDescriptor(this));
}
static {
QuickTimeMediaDirectory.addQuickTimeMediaTags(_tagNameMap);
_tagNameMap.put(1, "Auto Scale");
_tagNameMap.put(2, "Use Background Color");
_tagNameMap.put(3, "Scroll In");
_tagNameMap.put(4, "Scroll Out");
_tagNameMap.put(5, "Scroll Orientation");
_tagNameMap.put(6, "Scroll Direction");
_tagNameMap.put(7, "Continuous Scroll");
_tagNameMap.put(8, "Drop Shadow");
_tagNameMap.put(9, "Anti-aliasing");
_tagNameMap.put(10, "Display Text Background Color");
_tagNameMap.put(11, "Alignment");
_tagNameMap.put(12, "Background Color");
_tagNameMap.put(13, "Default Text Box");
_tagNameMap.put(14, "Font Number");
_tagNameMap.put(15, "Font Face");
_tagNameMap.put(16, "Foreground Color");
_tagNameMap.put(17, "Font Name");
}
/* access modifiers changed from: protected */
public HashMap<Integer, String> getTagNameMap() {
return _tagNameMap;
}
}
|
[
"a.amirovv@mail.ru"
] |
a.amirovv@mail.ru
|
13756c50abb7a135b855e814a9ae837f05b9f3db
|
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
|
/aliyun-java-sdk-cloudauth-console/src/main/java/com/aliyuncs/cloudauth_console/model/v20190219/DeleteUserInfoResponse.java
|
72c6b880c4ed8b868220b170b1aca480ed44d06b
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-java-sdk
|
a263fa08e261f12d45586d1b3ad8a6609bba0e91
|
e19239808ad2298d32dda77db29a6d809e4f7add
|
refs/heads/master
| 2023-09-03T12:28:09.765286
| 2023-09-01T09:03:00
| 2023-09-01T09:03:00
| 39,555,898
| 1,542
| 1,317
|
NOASSERTION
| 2023-09-14T07:27:05
| 2015-07-23T08:41:13
|
Java
|
UTF-8
|
Java
| false
| false
| 1,490
|
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.cloudauth_console.model.v20190219;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.cloudauth_console.transform.v20190219.DeleteUserInfoResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class DeleteUserInfoResponse extends AcsResponse {
private String requestId;
private Boolean success;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public Boolean getSuccess() {
return this.success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
@Override
public DeleteUserInfoResponse getInstance(UnmarshallerContext context) {
return DeleteUserInfoResponseUnmarshaller.unmarshall(this, context);
}
@Override
public boolean checkShowJsonItemName() {
return false;
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
717c9cba033e0376b621ef39d9ea9b72b716e46a
|
3a0b510e6071ee0b3cfdcdbe612ba35b2327f5af
|
/app/src/main/java/com/moon/gagandeep/notes/data/ItemContract.java
|
d3af4a22af748724e6d2da4729bc93cab4ecffd6
|
[] |
no_license
|
Gagandeep39/Notes
|
d57baa2cc46c3db35cdc53e3eb280445bb889866
|
890d1ced916d055f85a2d17f306dc18a9a6571d2
|
refs/heads/master
| 2021-08-14T18:29:38.860124
| 2017-11-16T05:50:46
| 2017-11-16T13:34:16
| 109,532,885
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,125
|
java
|
package com.moon.gagandeep.notes.data;
import android.net.Uri;
import android.provider.BaseColumns;
/**
* Created by gagandeep on 5/11/17.
*/
public class ItemContract {
public static final String CONTENT_AUTHORITY = "com.moon.gagandeep.notes"; //make sure you don't write .data here while copying the import statement
public static final Uri BASE_URI = Uri.parse("content://" + CONTENT_AUTHORITY);
public static final String ITEM_PATH = "items";
public static final class ItemEntry implements BaseColumns {
public static final Uri CONTENT_URI = Uri.withAppendedPath(BASE_URI, ITEM_PATH);
public static final String TABLE_NAME = "items";
public static final String _ID = BaseColumns._ID;
public static final String ITEM_NAME = "name";
public static final String ITEM_DESCRIPTION = "description";
public static final String ITEM_IMAGE_URI = "imagestring";
public static final String ITEM_MONTH = "monthstring";
public static final String ITEM_DATE = "datestring";
// public static final String ITEM_IMAGE_BLOB = "imageblob";
}
}
|
[
"singh.gagandeep3911@gmail.com"
] |
singh.gagandeep3911@gmail.com
|
ac618cd65642134e524f6d5e67be87917dc5773b
|
e072f5f5fcb0431da70e52323a421a27d7318fc5
|
/live/src/main/java/org/dbpedia/extraction/live/util/iterators/DuplicateOAIRecordRemoverIterator.java
|
f1f7ffabe4d6a017fec652be8017178aa87e7e48
|
[] |
no_license
|
SpazioDati/dbpedia
|
1588861d2d1d7046d16209a1ad1b80cf8999dc92
|
a5ed40d377a267df0f6110c02d2b9857d4fc1a6c
|
refs/heads/master
| 2021-01-15T17:20:47.084027
| 2012-06-06T02:06:34
| 2012-06-06T02:06:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,433
|
java
|
package org.dbpedia.extraction.live.util.iterators;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.apache.log4j.Logger;
import org.dbpedia.extraction.live.util.DBPediaXPathUtil;
import org.dbpedia.extraction.live.util.XPathUtil;
import org.w3c.dom.Document;
/**
* Skips successive (concerning timestamp) duplicate identifiers. In this
* example the second '123' item will be skipped. Fri Jan 02 14:50:11 CET 2009:
* oai:en.wikipedia.org:enwiki:123 Fri Jan 02 14:50:11 CET 2009:
* oai:en.wikipedia.org:enwiki:456 Fri Jan 02 14:50:11 CET 2009:
* oai:en.wikipedia.org:enwiki:123
*
* @author raven
*
*/
public class DuplicateOAIRecordRemoverIterator
extends PrefetchIterator<Document>
{
private Logger logger = Logger
.getLogger(DuplicateOAIRecordRemoverIterator.class);
private Iterator<Document> iterator;
private Date currentTimestamp = new Date(0L);
private Set<String> currentIdentifiers = new HashSet<String>();
private DateFormat dateFormat = new SimpleDateFormat(
"yyyy-mm-dd'T'HH:mm:ss'Z'");
public DuplicateOAIRecordRemoverIterator(Iterator<Document> iterator)
{
this.iterator = iterator;
}
private String getIdentifier(Document document)
{
return XPathUtil.evalToString(document, DBPediaXPathUtil
.getOAIIdentifierExpr());
}
private Date getTimestamp(Document document)
throws Exception
{
String str = XPathUtil.evalToString(document, DBPediaXPathUtil
.getTimestampExpr());
return dateFormat.parse(str);
}
@Override
protected Iterator<Document> prefetch()
throws Exception
{
while (iterator.hasNext()) {
Document document = iterator.next();
String identifier = getIdentifier(document);
Date timestamp = getTimestamp(document);
if (timestamp.after(currentTimestamp)) {
currentTimestamp = timestamp;
currentIdentifiers.clear();
}
if (currentIdentifiers.contains(identifier)) {
logger.debug("Skipping duplicate: " + timestamp + ": "
+ identifier);
continue;
}
// logger.info("Accepted: " + timestamp + ": " + identifier);
// logger.info("Identifiers in set: " + currentIdentifiers.size());
currentIdentifiers.add(identifier);
return Collections.singleton(document).iterator();
}
return null;
}
}
|
[
"devnull@localhost"
] |
devnull@localhost
|
aa77900bb8c24e4074d55cbc2e0b3134c761d873
|
8727b1cbb8ca63d30340e8482277307267635d81
|
/PolarServer/src/com/game/data/container/Q_horse_additionContainer.java
|
7f173c29ccbb5bc525a98e492247686104e36bfe
|
[] |
no_license
|
taohyson/Polar
|
50026903ded017586eac21a7905b0f1c6b160032
|
b0617f973fd3866bed62da14f63309eee56f6007
|
refs/heads/master
| 2021-05-08T12:22:18.884688
| 2015-12-11T01:44:18
| 2015-12-11T01:44:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,333
|
java
|
package com.game.data.container;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import com.game.data.bean.Q_horse_additionBean;
import com.game.data.dao.Q_horse_additionDao;
import com.game.utils.Symbol;
/**
* @author ExcelUtil Auto Maker
*
* @version 1.0.0
*
* Q_horse_addition数据容器
*/
public class Q_horse_additionContainer {
private List<Q_horse_additionBean> list;
private HashMap<String, Q_horse_additionBean> map = new HashMap<String, Q_horse_additionBean>();
private Q_horse_additionDao dao = new Q_horse_additionDao();
public void load(){
list = dao.select();
Iterator<Q_horse_additionBean> iter = list.iterator();
while (iter.hasNext()) {
Q_horse_additionBean bean = (Q_horse_additionBean) iter
.next();
map.put(bean.getQ_id(), bean);
}
}
public List<Q_horse_additionBean> getList(){
return list;
}
public HashMap<String, Q_horse_additionBean> getMap(){
return map;
}
public Q_horse_additionBean getQ_horse_additionBeanByCurLayer(int curLayer) {
for(String key : this.map.keySet()) {
if(key == null) {
continue;
}
String[] keyArr = key.split(Symbol.XIAHUAXIAN_REG);
if(keyArr.length !=2 || Integer.valueOf(keyArr[1]) != curLayer) {
continue;
}
return this.map.get(key);
}
return null;
}
}
|
[
"zhuyuanbiao@ZHUYUANBIAO.rd.com"
] |
zhuyuanbiao@ZHUYUANBIAO.rd.com
|
7acf6608cd902d30b761e0958c10b961d9384312
|
a938c8162313da137e94d6a9d223d1ec8db5a5ca
|
/NicadOutputFile_maven/Clone Pairs 38/Nicad_maven75.java
|
a444b5dc2e8c8dfc69fd00acd5a21ccd242a771d
|
[] |
no_license
|
ryosuke-ku/Nicad_ScrapinG
|
a94a61574dc17585047624b827639196b23b8e21
|
62200621eb293d7a8953ef6e18a7e0f2019ecc48
|
refs/heads/master
| 2020-06-29T22:03:44.189953
| 2019-08-05T13:17:57
| 2019-08-05T13:17:57
| 200,636,057
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,115
|
java
|
//87:maven/maven-model/src/main/java/org/apache/maven/model/merge/ModelMerger.java
//None
public class Nicad_maven75
{
protected void mergeBuild_Extensions( Build target, Build source, boolean sourceDominant,
Map<Object, Object> context )
{
List<Extension> src = source.getExtensions();
if ( !src.isEmpty() )
{
List<Extension> tgt = target.getExtensions();
Map<Object, Extension> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 );
for ( Extension element : tgt )
{
Object key = getExtensionKey( element );
merged.put( key, element );
}
for ( Extension element : src )
{
Object key = getExtensionKey( element );
if ( sourceDominant || !merged.containsKey( key ) )
{
merged.put( key, element );
}
}
target.setExtensions( new ArrayList<>( merged.values() ) );
}
}
|
[
"naist1020@gmail.com"
] |
naist1020@gmail.com
|
c930ae2c1695eeb68e9dbec1b7ddc58544b18293
|
04b1803adb6653ecb7cb827c4f4aa616afacf629
|
/chrome/android/java/src/org/chromium/chrome/browser/payments/PackageManagerDelegate.java
|
8f45386556e803508af884cba740300b2d6a5847
|
[
"BSD-3-Clause"
] |
permissive
|
Samsung/Castanets
|
240d9338e097b75b3f669604315b06f7cf129d64
|
4896f732fc747dfdcfcbac3d442f2d2d42df264a
|
refs/heads/castanets_76_dev
| 2023-08-31T09:01:04.744346
| 2021-07-30T04:56:25
| 2021-08-11T05:45:21
| 125,484,161
| 58
| 49
|
BSD-3-Clause
| 2022-10-16T19:31:26
| 2018-03-16T08:07:37
| null |
UTF-8
|
Java
| false
| false
| 5,351
|
java
|
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.payments;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.StrictMode;
import android.os.StrictMode.ThreadPolicy;
import android.support.annotation.Nullable;
import org.chromium.base.ContextUtils;
import java.util.List;
/** Abstraction of Android's package manager to enable testing. */
public class PackageManagerDelegate {
/**
* Retrieves package information of an installed application.
*
* @param packageName The package name of an installed application.
* @return The package information of the installed application.
*/
@SuppressLint("PackageManagerGetSignatures")
public PackageInfo getPackageInfoWithSignatures(String packageName) {
try {
return ContextUtils.getApplicationContext().getPackageManager().getPackageInfo(
packageName, PackageManager.GET_SIGNATURES);
} catch (NameNotFoundException e) {
return null;
}
}
/**
* Retrieves the single activity that matches the given intent, or null if none found.
* @param intent The intent to query.
* @return The matching activity.
*/
public ResolveInfo resolveActivity(Intent intent) {
ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
return ContextUtils.getApplicationContext().getPackageManager().resolveActivity(
intent, 0);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
}
/**
* Retrieves the list of activities that can respond to the given intent.
* @param intent The intent to query.
* @return The list of activities that can respond to the intent.
*/
public List<ResolveInfo> getActivitiesThatCanRespondToIntent(Intent intent) {
ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
return ContextUtils.getApplicationContext().getPackageManager().queryIntentActivities(
intent, 0);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
}
/**
* Retrieves the list of activities that can respond to the given intent. And returns the
* activites' meta data in ResolveInfo.
*
* @param intent The intent to query.
* @return The list of activities that can respond to the intent.
*/
public List<ResolveInfo> getActivitiesThatCanRespondToIntentWithMetaData(Intent intent) {
ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
return ContextUtils.getApplicationContext().getPackageManager().queryIntentActivities(
intent, PackageManager.GET_META_DATA);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
}
/**
* Retrieves the list of services that can respond to the given intent.
* @param intent The intent to query.
* @return The list of services that can respond to the intent.
*/
public List<ResolveInfo> getServicesThatCanRespondToIntent(Intent intent) {
ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads();
try {
return ContextUtils.getApplicationContext().getPackageManager().queryIntentServices(
intent, 0);
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
}
/**
* Retrieves the label of the app.
* @param resolveInfo The identifying information for an app.
* @return The label for this app.
*/
public CharSequence getAppLabel(ResolveInfo resolveInfo) {
return resolveInfo.loadLabel(ContextUtils.getApplicationContext().getPackageManager());
}
/**
* Retrieves the icon of the app.
* @param resolveInfo The identifying information for an app.
* @return The icon for this app.
*/
public Drawable getAppIcon(ResolveInfo resolveInfo) {
return resolveInfo.loadIcon(ContextUtils.getApplicationContext().getPackageManager());
}
/**
* Gets the string array resource of the given application.
*
* @param applicationInfo The application info.
* @param resourceId The identifier of the string array resource.
* @return The string array resource, or null if not found.
*/
@Nullable
public String[] getStringArrayResourceForApplication(
ApplicationInfo applicationInfo, int resourceId) {
Resources resources;
try {
resources = ContextUtils.getApplicationContext()
.getPackageManager()
.getResourcesForApplication(applicationInfo);
} catch (NameNotFoundException e) {
return null;
}
return resources == null ? null : resources.getStringArray(resourceId);
}
}
|
[
"sunny.nam@samsung.com"
] |
sunny.nam@samsung.com
|
c3797656a05624da7c2002c58080466671d7b89e
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/17/17_831a4b15c081af7be43c331dded8f20c880145b9/TvGids/17_831a4b15c081af7be43c331dded8f20c880145b9_TvGids_t.java
|
741e818a6ab5f6ba2b16ef8e1aed95bdb87e516c
|
[] |
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,944
|
java
|
package org.vanbest.xmltv;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import net.sf.ezmorph.MorpherRegistry;
import net.sf.ezmorph.ObjectMorpher;
import net.sf.ezmorph.object.DateMorpher;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import net.sf.json.util.JSONUtils;
public class TvGids {
static String channels_url="http://www.tvgids.nl/json/lists/channels.php";
static String programme_base_url="http://www.tvgids.nl/json/lists/programs.php";
static String detail_base_url = "http://www.tvgids.nl/json/lists/program.php";
ProgrammeCache cache;
static boolean initialised = false;
public TvGids(File cacheFile) {
cache = new ProgrammeCache(cacheFile);
if ( ! initialised ) {
init();
initialised = true;
}
}
public static void init() {
String[] formats = {"yyyy-MM-dd HH:mm:ss"};
MorpherRegistry registry = JSONUtils.getMorpherRegistry();
registry.registerMorpher( new DateMorpher(formats, new Locale("nl")));
registry.registerMorpher( new ObjectMorpher() {
public Object morph(Object value) {
String s = (String) value;
return org.apache.commons.lang.StringEscapeUtils.unescapeHtml(s);
}
public Class morphsTo() {
return String.class;
}
public boolean supports(Class clazz) {
return clazz == String.class;
}
}, true);
}
public void close() throws FileNotFoundException, IOException {
cache.close();
}
static public List<Channel> getChannels() {
List<Channel> result = new ArrayList<Channel>(10);
URL url = null;
try {
url = new URL(channels_url);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
StringBuffer json = new StringBuffer();
try {
BufferedReader reader = new BufferedReader( new InputStreamReader( url.openStream()));
String s;
while ((s = reader.readLine()) != null) json.append(s);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
JSONArray jsonArray = JSONArray.fromObject( json.toString() );
// System.out.println( jsonArray );
for( int i=0; i<jsonArray.size(); i++ ) {
JSONObject zender = jsonArray.getJSONObject(i);
//System.out.println( "id: " + zender.getString("id"));
//System.out.println( "name: " + zender.getString("name"));
Channel c = new Channel(zender.getInt("id"), zender.getString("name"), zender.getString("name_short"));
c.setIconUrl("http://tvgidsassets.nl/img/channels/53x27/" + c.id + ".png");
c.fixup();
result.add(c);
}
return result;
}
public static URL programmeUrl(List<Channel> channels, int day) throws Exception {
StringBuilder s = new StringBuilder(programme_base_url);
if (channels.size() < 1) {
throw new Exception("should have at least one channel");
}
s.append("?channels=");
boolean first = true;
for(Channel i: channels) {
if (first) {
s.append(i.id);
first = false;
} else {
s.append(","+i.id);
}
}
s.append("&day=");
s.append(day);
return new URL(s.toString());
}
public static URL detailUrl(String id) throws Exception {
StringBuilder s = new StringBuilder(detail_base_url);
s.append("?id=");
s.append(id);
return new URL(s.toString());
}
public Set<Programme> getProgrammes(List<Channel> channels, int day, boolean fetchDetails) throws Exception {
Set<Programme> result = new HashSet<Programme>();
URL url = programmeUrl(channels, day);
JSONObject jsonObject = fetchJSON(url);
//System.out.println( jsonObject );
for( Channel c: channels) {
JSON ps = (JSON) jsonObject.get(""+c.id);
//System.out.println( ps );
if ( ps.isArray() ) {
JSONArray programs = (JSONArray) ps;
for( int i=0; i<programs.size(); i++ ) {
JSONObject programme = programs.getJSONObject(i);
Programme p = (Programme) JSONObject.toBean(programme, Programme.class);
p.fixup();
if (fetchDetails) {
p.details = cache.getDetails(p.db_id);
if ( p.details == null ) {
p.details = getDetails(p.db_id);
p.details.fixup(p);
cache.add(p.db_id, p.details);
}
}
p.channel = c;
result.add( p );
}
} else {
JSONObject programs = (JSONObject) ps;
for( Object o: programs.keySet() ) {
JSONObject programme = programs.getJSONObject(o.toString());
Programme p = (Programme) JSONObject.toBean(programme, Programme.class);
if (fetchDetails) {
try {
p.details = getDetails(p.db_id);
} catch (Exception e) {
e.printStackTrace();
continue;
}
}
p.channel = c;
result.add( p );
}
}
}
return result;
}
private JSONObject fetchJSON(URL url) throws Exception {
Thread.sleep(100);
StringBuffer json = new StringBuffer();
try {
BufferedReader reader = new BufferedReader( new InputStreamReader( url.openStream()));
String s;
while ((s = reader.readLine()) != null) json.append(s);
} catch (IOException e) {
throw new Exception("Error getting program data from url " + url, e);
}
return JSONObject.fromObject( json.toString() );
}
private ProgrammeDetails getDetails(String db_id) throws Exception {
URL url = detailUrl(db_id);
JSONObject json = fetchJSON(url);
//System.out.println( json );
return (ProgrammeDetails) JSONObject.toBean(json, ProgrammeDetails.class);
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
6c35c0b48528846513fd0a2a00e4a9a000af7586
|
f2860ea2bde31d471f7ae6c80a386671c980438a
|
/oxygen-core/src/main/java/vip/justlive/oxygen/core/net/aio/core/ChannelContext.java
|
3778478c88e71350748978952a04c0e25cf1f141
|
[
"Apache-2.0"
] |
permissive
|
luchao0111/oxygen
|
8f6b397d4effb10078256dd97420e407c30ada20
|
db4044cd2b3e94345ba6f4badb84288f1f6809c1
|
refs/heads/master
| 2020-11-30T15:39:01.289895
| 2019-12-27T03:42:36
| 2019-12-27T03:42:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,814
|
java
|
/*
* Copyright (C) 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 vip.justlive.oxygen.core.net.aio.core;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.AsynchronousSocketChannel;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import vip.justlive.oxygen.core.util.SnowflakeIdWorker;
/**
* channel上下文
*
* @author wubo
*/
@Getter
@Setter
@Accessors(chain = true)
public class ChannelContext {
private final long id;
private final boolean server;
private final GroupContext groupContext;
private final ReadWorker readWorker;
private final ReadHandler readHandler;
private final WriteWorker writeWorker;
private final WriteHandler writeHandler;
private final Map<String, Object> attrs = new ConcurrentHashMap<>(4);
private AsynchronousSocketChannel channel;
private InetSocketAddress address;
private volatile boolean closed;
private CompletableFuture<Void> future;
// stat
private long createAt = System.currentTimeMillis();
private long lastReceivedAt = -1;
private long lastSentAt = -1;
private int retryAttempts = 0;
public ChannelContext(GroupContext groupContext, AsynchronousSocketChannel channel) {
this(groupContext, channel, true);
}
public ChannelContext(GroupContext groupContext, AsynchronousSocketChannel channel,
boolean server) {
this(SnowflakeIdWorker.defaultNextId(), groupContext, channel, server);
}
public ChannelContext(long id, GroupContext groupContext, AsynchronousSocketChannel channel,
boolean server) {
this.id = id;
this.server = server;
this.groupContext = groupContext;
this.readWorker = new ReadWorker(this);
this.readHandler = new ReadHandler(this);
this.writeWorker = new WriteWorker(this);
this.writeHandler = new WriteHandler(this);
setChannel(channel);
}
public void setChannel(AsynchronousSocketChannel channel) {
this.channel = channel;
try {
if (isServer()) {
this.address = (InetSocketAddress) channel.getRemoteAddress();
} else {
this.address = (InetSocketAddress) channel.getLocalAddress();
}
} catch (IOException ignore) {
//ignore
}
this.future = new CompletableFuture<>();
}
/**
* 写数据
*
* @param data 数据
*/
public void write(Object data) {
if (closed) {
return;
}
writeWorker.add(data);
writeWorker.execute();
}
void read(ByteBuffer buffer) {
if (closed) {
return;
}
ByteBuffer ret = ByteBuffer.allocate(buffer.limit() - buffer.position());
ret.put(buffer);
ret.flip();
readWorker.add(ret);
readWorker.execute();
}
/**
* 启动
*/
public synchronized void start() {
closed = false;
readWorker.start();
writeWorker.start();
retryAttempts = 0;
groupContext.bind(this);
}
/**
* 关闭
*/
public synchronized void close() {
if (closed) {
return;
}
closed = true;
groupContext.unbind(this);
try {
if (groupContext.getAioListener() != null) {
groupContext.getAioListener().onClosed(this);
}
} finally {
readWorker.stop();
writeWorker.stop();
Utils.close(channel);
readWorker.queue.clear();
writeWorker.queue.clear();
clearAttrs();
}
}
/**
* 添加属性
*
* @param key 键
* @param value 值
*/
public void addAttr(String key, Object value) {
attrs.put(key, value);
}
/**
* 删除属性
*
* @param key 键
*/
public void removeAttr(String key) {
attrs.remove(key);
}
/**
* 清空属性
*/
public void clearAttrs() {
attrs.clear();
}
@Override
public int hashCode() {
return Long.hashCode(id);
}
@Override
public boolean equals(Object obj) {
if (obj instanceof ChannelContext) {
ChannelContext other = (ChannelContext) obj;
return id == other.id && channel == other.channel;
}
return false;
}
@Override
public String toString() {
return String.format("[%s:%s]", id, address);
}
}
|
[
"qq11419041@163.com"
] |
qq11419041@163.com
|
0d35d041db0d826ecd3c0fadb2af16f30c02a65f
|
f00328d9009784fb6e38091c286119c3aaf2710b
|
/app/src/main/java/com/smg/variety/bean/LiveVideoInfo.java
|
3d6f6fbd05e9525d2a6b2e44353921fab34f7068
|
[] |
no_license
|
Meikostar/VarietyMall
|
449b934d0c64b3156391bb19096e2ba6fbd90031
|
b49202dec4d32f7983c640d933ec08991990d8f2
|
refs/heads/master
| 2022-07-31T06:32:25.629162
| 2020-05-25T08:36:25
| 2020-05-25T08:36:25
| 259,245,644
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 516
|
java
|
package com.smg.variety.bean;
/**
* Created by winder on 2019/7/13.
*/
public class LiveVideoInfo {
//开播推流
private String id;
String rtmp_publish_url;
PersonalInfoDto user;
public RoomInfo room;
public RoomInfo apply;
public String getRtmp_publish_url() {
return rtmp_publish_url;
}
public PersonalInfoDto getUser() {
return user;
}
public RoomInfo getRoom() {
return room;
}
public String getId() {
return id;
}
}
|
[
"18166036747@163.com"
] |
18166036747@163.com
|
a2d8474e829eb0efb7f336ccc94e0c5fbdb57407
|
4446e7dd3798116d2a99fcd60c05c14ce413f9f7
|
/dc-platform/dc-risk/product/src/main/java/com/opengamma/strata/product/swap/KnownAmountRateComputation.java
|
bb32dc20e6f55bb1e1f445eca1edbb24800561bf
|
[
"Apache-2.0"
] |
permissive
|
jmptrader/daocheng
|
c69739650d5be61facf792272c41b6bd04f23935
|
2fff5774b054c69cdd8b79c5e45a84b5ade65338
|
refs/heads/master
| 2021-01-12T14:17:28.734470
| 2016-08-28T07:25:03
| 2016-08-28T07:25:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,354
|
java
|
/**
* Copyright (C) 2016 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.product.swap;
import java.io.Serializable;
import java.util.Set;
import org.joda.beans.BeanDefinition;
import org.joda.beans.ImmutableBean;
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.MetaBean;
import org.joda.beans.Property;
import org.joda.beans.PropertyDefinition;
import org.joda.beans.impl.light.LightMetaBean;
import com.google.common.collect.ImmutableSet;
import com.opengamma.strata.basics.currency.CurrencyAmount;
import com.opengamma.strata.basics.index.Index;
import com.opengamma.strata.product.rate.RateComputation;
/**
* Defines a known amount of interest as a rate computation.
* <p>
* This is a special computation that represents a known amount instead of a rate.
* It is used to pass the known amount through the standard rate computation process.
* This computation is converted to a {@link KnownAmountNotionalSwapPaymentPeriod} for pricing.
*/
@BeanDefinition(style = "light")
final class KnownAmountRateComputation
implements RateComputation, ImmutableBean, Serializable {
// package scoped, as this is not intended for general use
// it exists to allow known amount stubs to be handled by RateAccrualPeriod
// PaymentSchedule resolves it to KnownAmountNotionalPaymentPeriod, not RatePaymentPeriod
/**
* The known amount.
*/
@PropertyDefinition
private final CurrencyAmount amount;
//-------------------------------------------------------------------------
/**
* Creates an instance.
*
* @param amount the known amount
* @return the known amount
*/
public static KnownAmountRateComputation of(CurrencyAmount amount) {
return new KnownAmountRateComputation(amount);
}
//-------------------------------------------------------------------------
@Override
public void collectIndices(ImmutableSet.Builder<Index> builder) {
// no indices to add
}
//------------------------- AUTOGENERATED START -------------------------
///CLOVER:OFF
/**
* The meta-bean for {@code KnownAmountRateComputation}.
*/
private static MetaBean META_BEAN = LightMetaBean.of(KnownAmountRateComputation.class);
/**
* The meta-bean for {@code KnownAmountRateComputation}.
* @return the meta-bean, not null
*/
public static MetaBean meta() {
return META_BEAN;
}
static {
JodaBeanUtils.registerMetaBean(META_BEAN);
}
/**
* The serialization version id.
*/
private static final long serialVersionUID = 1L;
private KnownAmountRateComputation(
CurrencyAmount amount) {
this.amount = amount;
}
@Override
public MetaBean metaBean() {
return META_BEAN;
}
@Override
public <R> Property<R> property(String propertyName) {
return metaBean().<R>metaProperty(propertyName).createProperty(this);
}
@Override
public Set<String> propertyNames() {
return metaBean().metaPropertyMap().keySet();
}
//-----------------------------------------------------------------------
/**
* Gets the known amount.
* @return the value of the property
*/
public CurrencyAmount getAmount() {
return amount;
}
//-----------------------------------------------------------------------
@Override
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj != null && obj.getClass() == this.getClass()) {
KnownAmountRateComputation other = (KnownAmountRateComputation) obj;
return JodaBeanUtils.equal(amount, other.amount);
}
return false;
}
@Override
public int hashCode() {
int hash = getClass().hashCode();
hash = hash * 31 + JodaBeanUtils.hashCode(amount);
return hash;
}
@Override
public String toString() {
StringBuilder buf = new StringBuilder(64);
buf.append("KnownAmountRateComputation{");
buf.append("amount").append('=').append(JodaBeanUtils.toString(amount));
buf.append('}');
return buf.toString();
}
///CLOVER:ON
//-------------------------- AUTOGENERATED END --------------------------
}
|
[
"tjcuwang@yahoo.com"
] |
tjcuwang@yahoo.com
|
cca32403269c14276c1b3e373a7b258b4d4b6d64
|
03af388a5261564285b1e4ddcfcefd4753f5e732
|
/src/main/java/org/ontologyengineering/conceptdiagrams/web/client/handler/SaveDiagramServiceAsync.java
|
8d64fde67d6f614df6280c219ee2aac16e0eefea
|
[
"BSD-2-Clause"
] |
permissive
|
MichaelJCompton/ConceptDiagrams
|
e3eddd5022e09340cb6cc729e2553b2ad6daeae0
|
d75d846832c7e5870dd7cd476f69efb5a65a3e90
|
refs/heads/master
| 2020-12-14T09:41:05.956992
| 2016-10-13T12:33:54
| 2016-10-13T12:33:54
| 41,771,345
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 756
|
java
|
package org.ontologyengineering.conceptdiagrams.web.client.handler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.ontologyengineering.conceptdiagrams.web.shared.ClientContext;
import org.ontologyengineering.conceptdiagrams.web.shared.commands.Command;
import org.ontologyengineering.conceptdiagrams.web.shared.concretesyntax.DiagramSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
/**
* Author: Michael Compton<br>
* Date: August 2016<br>
* See license information in base directory.
*/
public interface SaveDiagramServiceAsync {
void saveCommandHistory(HashSet<ArrayList<Command>> histories, HashMap<String, DiagramSet> diagrams, ClientContext context, AsyncCallback<String> callback);
}
|
[
"username@users.noreply.github.com"
] |
username@users.noreply.github.com
|
e64d3ddb6e01c10713bd32f10b9d3481d4afe55d
|
14970ee11e71b839ba2c86e1ce65e344de28325c
|
/plugins/org.eclipse.bpel.ui.noEmbeddedEditors/src/org/eclipse/bpel/ui/commands/AddFromPartCommand.java
|
6c91dd2242cde055da4ad52dcf8dc275867a36cc
|
[
"EPL-1.0",
"Apache-2.0"
] |
permissive
|
wso2/devstudio-tooling-bps
|
e300529639e22fd430612601d7d76b9a9bd56dd0
|
5a5d080d94bb30ac6a5fb404c2a6b989653cc78d
|
refs/heads/master
| 2023-06-28T18:29:45.578389
| 2021-01-04T06:46:48
| 2021-01-04T06:46:48
| 53,044,989
| 34
| 19
|
Apache-2.0
| 2021-01-04T06:46:49
| 2016-03-03T11:23:24
|
Java
|
UTF-8
|
Java
| false
| false
| 2,916
|
java
|
/*******************************************************************************
* Copyright (c) 2007, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.bpel.ui.commands;
import java.util.List;
import org.eclipse.bpel.model.BPELFactory;
import org.eclipse.bpel.model.FromPart;
import org.eclipse.bpel.model.FromParts;
import org.eclipse.bpel.model.Variable;
import org.eclipse.bpel.ui.commands.util.AutoUndoCommand;
import org.eclipse.bpel.ui.util.ModelHelper;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.wst.wsdl.Part;
/**
* This command modifies the FromParts of an Invoke / Receive / OnEvent / OnMessage. It handles the
* following scenarios:
*
* (1) If the FromParts element of the target object doesn't contains a FromPart for the given Part
* - create a new FromPart - set the given Part to the FromPart
* - set the given variable to the FromPart's toVariable
* - add the new FromPart to the FromParts (FromParts will be created if necessary)
*
* (2) If the FromParts element of the target object already contains a FromPart for the given Part
* - set the toVariable of the existing FromPart to the given variable
*
* @author Michael Illiger
*/
public class AddFromPartCommand extends AutoUndoCommand {
private Variable variable;
private Part part;
private EObject target;
public AddFromPartCommand(EObject target, Variable variable, Part part) {
super("Set fromPart", target);
this.variable = variable;
this.part = part;
this.target = target;
}
private List<FromPart> getList() {
FromParts fromParts = ModelHelper.getFromParts(target);
return (fromParts == null) ? null : fromParts.getChildren();
}
private void createList() {
ModelHelper.setFromParts(target, BPELFactory.eINSTANCE.createFromParts());
}
private void deleteList() {
ModelHelper.setFromParts(target, null);
}
@Override
public void doExecute() {
if (this.part == null)
throw new IllegalStateException();
List<FromPart> list = getList();
if (list == null || list.isEmpty()) {
createList();
list = getList();
}
for (FromPart fromPart : list) {
if (this.part.equals(fromPart.getPart())) {
// we already have a fromPart for the given part -> just replace the variable
fromPart.setToVariable(variable);
return;
}
}
// if we get here we need a new fromPart
FromPart fromPart = BPELFactory.eINSTANCE.createFromPart();
fromPart.setPart(part);
fromPart.setToVariable(variable);
list.add(fromPart);
}
}
|
[
"mail.hasitha27@gmail.com"
] |
mail.hasitha27@gmail.com
|
caecc75df1fb90f3403e76e0c1079f5c6e148a1e
|
f8fd4f956b1e767a082d2606c74cd639647d2bde
|
/sem13_cts/src/ro/ase/cts/mocks/StudentDummy.java
|
69dc39585cfd4a9d04c854d8cae73ccbf44a5f31
|
[] |
no_license
|
ruxicirstea/cts_seminare
|
dff77a1ac8475682bbabcce6e5b479ab553bae2c
|
f5702b4f3df58dc8e93790a3e89ed382d0c66470
|
refs/heads/master
| 2023-05-12T03:56:12.179621
| 2021-06-05T12:05:07
| 2021-06-05T12:05:07
| 342,843,062
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 639
|
java
|
package ro.ase.cts.mocks;
import ro.ase.cts.classes.IStudent;
import java.util.List;
public class StudentDummy implements IStudent {
@Override
public String getNume() {
return null;
}
@Override
public void setNume(String nume) {
}
@Override
public List<Integer> getNote() {
return null;
}
@Override
public void adaugaNota(int nota) {
}
@Override
public float calculeazaMedie() {
return 0;
}
@Override
public int getNota(int index) {
return 0;
}
@Override
public boolean areRestante() {
return false;
}
}
|
[
"you@example.com"
] |
you@example.com
|
782898f7be4a7a57e9757d2cb67ee80851513141
|
94862d372c2c6813ecd3edda5a43e4a64f17e367
|
/src/main/java/com/alvin/mock/bean/ActionBean.java
|
962a43dc39220c6f53ee6ff8c5fbdbbf853139fa
|
[] |
no_license
|
alvin198761/code
|
eac8a059742f1c206ce3ff5e622e6c613bb20b62
|
035c0a791d4d7fa8aae5b5536674d62a2726edd5
|
refs/heads/master
| 2020-03-28T22:28:44.860262
| 2019-01-08T10:02:30
| 2019-01-08T10:02:30
| 149,235,751
| 2
| 0
| null | 2018-09-18T05:53:35
| 2018-09-18T05:53:35
| null |
UTF-8
|
Java
| false
| false
| 309
|
java
|
package com.alvin.mock.bean;
import lombok.Data;
import java.util.List;
@Data
public class ActionBean {
private String date; //生成时间
private String author;//作者
private String note;//说明
private String actionName; //action 说明
private List<ActionMethodBean> methods; //方法列表
}
|
[
"alvin198761@163.com"
] |
alvin198761@163.com
|
8b0f56069d84d93593564e6154e70d12eb98f945
|
dea92fc41db6a97d8cb32b266c399edd3a61989f
|
/source/org.strategoxt.imp.editors.stratego/editor/java/trans/innermost_scope_$Declare$Cookie_1_0.java
|
7aed5778da552c96ecc49980628f6b78276380d2
|
[] |
no_license
|
adilakhter/spoofaxlang
|
19170765e690477a79069e05fd473f521d1d1ddc
|
27515280879cc108a3cf2108df00760b6d39e15e
|
refs/heads/master
| 2020-03-17T01:15:18.833754
| 2015-01-22T07:12:05
| 2015-01-22T07:12:05
| 133,145,594
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,310
|
java
|
package trans;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.stratego_sglr.*;
import org.strategoxt.stratego_gpp.*;
import org.strategoxt.stratego_xtc.*;
import org.strategoxt.stratego_aterm.*;
import org.strategoxt.strc.*;
import org.strategoxt.java_front.*;
import org.strategoxt.imp.editors.stratego.strategies.*;
import org.strategoxt.lang.*;
import org.spoofax.interpreter.terms.*;
import static org.strategoxt.lang.Term.*;
import org.spoofax.interpreter.library.AbstractPrimitive;
import java.util.ArrayList;
import java.lang.ref.WeakReference;
@SuppressWarnings("all") public class innermost_scope_$Declare$Cookie_1_0 extends Strategy
{
public static innermost_scope_$Declare$Cookie_1_0 instance = new innermost_scope_$Declare$Cookie_1_0();
@Override public IStrategoTerm invoke(Context context, IStrategoTerm term, Strategy n_4314)
{
context.push("innermost_scope_DeclareCookie_1_0");
Fail22133:
{
IStrategoTerm p_4314 = null;
p_4314 = term;
term = dr_get_first_scope_label_1_1.instance.invoke(context, p_4314, n_4314, trans.const4358);
if(term == null)
break Fail22133;
context.popOnSuccess();
if(true)
return term;
}
context.popOnFailure();
return null;
}
}
|
[
"md.adilakhter@gmail.com"
] |
md.adilakhter@gmail.com
|
4724c8c5a4c872bd13dcf4dad1bcfdca5b4eb9c2
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/21/21_04c4e97c3d093d3fbd4e116caf635227f0b0a0f4/Monster/21_04c4e97c3d093d3fbd4e116caf635227f0b0a0f4_Monster_t.java
|
1ed37373784c43aec1260498c9059ebee6c8aaa2
|
[] |
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,823
|
java
|
package uk.ac.aber.dcs.cs221.monstermash.data;
import java.util.ArrayList;
import java.util.Date;
import uk.ac.aber.dcs.cs221.monstermash.util.Name;
/**
*
* @author Jacob Smith, jas32
*
*/
public class Monster {
public static final int MAX_NUM_CHILDREN = 10;
private static volatile long nextPrimaryKey = 1;
private volatile long primaryKey;
private volatile UserAccount owner;
private volatile String name;
public enum Gender { MALE, FEMALE };
private volatile Gender gender;
private volatile Date dateOfBirth;
protected volatile double ageRate;
protected volatile int strengthCoefficient;
protected volatile int evadeCoefficient;
protected volatile int toughnessCoefficient;
protected volatile double fertility;
protected volatile int injuryChance;
protected static Name nameGen;
private volatile int injuries;
/**
* Public constructor.
*
* Assigns the next available primary key and initialises the date of
* birth field to this instant.
*/
public Monster() {
synchronized (getClass() ) {
primaryKey = nextPrimaryKey++;
if (nameGen == null) { nameGen = new Name(); }
}
dateOfBirth = new Date();
injuries = 0;
}
/**
*
* @return This monster's primary key.
*/
public long getUID() { return primaryKey; }
/**
*
* @param owner The monster's owner.
* @return This monster object.
*/
public synchronized Monster setOwner(UserAccount owner) { this.owner = owner; return this; }
/**
*
* @return The monster's owner.
*/
public UserAccount getOwner() { return owner; }
/**
* Customise a monster with a name.
* @param name The monster's new name.
* @return The monster object.
*/
public synchronized Monster setName(String name) { this.name = name; return this; }
/**
*
* @return The monster's name.
*/
public String getName() { return name; }
/**
* Sets the monster's gender and immediately gives the monster a random
* gender appropriate name. @see Gender.
* @param gender The monster's gender.
* @return This monster object.
*/
public synchronized Monster setGender(Gender gender) {
this.gender = gender;
this.setName((this.isMale() ) ? nameGen.male(new java.util.Random() ): nameGen.female(new java.util.Random() ) );
return this; }
/**
*
* @return True iff this monster is male.
*/
public boolean isMale() { return (gender == Gender.MALE); }
/**
*
* @return The monster's age in seconds.
*/
public long getAge() { return dateOfBirth.getTime(); }
/**
*
* @return The monster's health, less than 1. If less than 0 this indicates the monster should be reaped.
*/
public double getHealth() {
return 2 - Math.exp(ageRate * getAge() ); //$2-e^{\lambda t}$
}
/**
*
* @return The monster's strength score.
*/
public int getStrength() {
return (int) (strengthCoefficient*(Math.exp(ageRate * getAge() ) - 1 ) * getHealth());
}
/**
*
* @return The monster's chance at evading an incoming blow.
*/
public int getEvade() {
return (int) (evadeCoefficient*(Math.exp(ageRate * getAge() ) - 1) * getHealth() );
}
/**
*
* @return The monster's toughness score.
*/
public int getToughness() {
return (int) (toughnessCoefficient*(Math.exp(ageRate * getAge() ) - 1) * getHealth() );
}
/**
* Mutation function implemented using a binomial distribution with number of trials, n=93 and p=1/2.
* @param The PRNG state object.
* @return A random number with a binomial distribution on the interval (0,1)
*/
protected static double mutation(java.util.Random rand) {
final int ITERATIONS = 3;
final int WORDLENGTH = 31;
int count = 0;
for (int i = 0; i < ITERATIONS; ++i) {
int stream = rand.nextInt();
for (int mask = 1; mask >0; mask *= 2) {
count += (stream & mask)!=0 ? 1: 0;
}
}
return (double)(count) / (WORDLENGTH*ITERATIONS);
}
/**
* Generates a new Monster populated with random attributes.
* @return A new 'starter' Monster.
*/
public static Monster generateRandom() {
Monster monster = new Monster();
java.util.Random rand = new java.util.Random();
monster.setGender((rand.nextBoolean() ) ? Gender.MALE: Gender.FEMALE);
monster.ageRate = mutation(rand) * 1e-6f;
monster.strengthCoefficient = (int) (mutation(rand) * 50);
monster.toughnessCoefficient = (int) (mutation(rand) * 50);
monster.evadeCoefficient = (int) (mutation(rand) * 50);
monster.fertility = Math.abs(rand.nextDouble() );
monster.injuryChance = (int) (mutation(rand) * 20);
return monster;
}
/**
* Utility function for genetic crossover.
* @param rand The PRNG state object.
* @param a The first parent's gene.
* @param b The second parent's gene.
* @return One of the two genes, each with a 50/50 chance.
*/
protected static double crossover (java.util.Random rand, double a, double b) {
return (rand.nextBoolean() ) ? a: b;
}
/**
* Breeds two monsters together to produce a list of children. The children automatically belong
* to the mother's owner.
* @param father The father with which to breed.
* @return A list of the new children produced.
*/
public ArrayList<Monster> breed (Monster father) {
java.util.Random rand = new java.util.Random();
int numChildren = (int) (Math.sqrt(this.fertility * father.fertility) * MAX_NUM_CHILDREN);
ArrayList<Monster> returnedChildren = new ArrayList<Monster>(numChildren);
while (returnedChildren.size() < numChildren) {
Monster monster = new Monster();
monster.setGender((rand.nextBoolean()) ? Gender.MALE: Gender.FEMALE);
monster.setOwner(this.getOwner() );
monster.ageRate = crossover(rand, this.ageRate, father.ageRate);
monster.ageRate *= mutation(rand) + 0.5;
monster.strengthCoefficient = (int) crossover(rand, this.strengthCoefficient, father.strengthCoefficient);
monster.strengthCoefficient *= mutation(rand) + 0.5;
monster.evadeCoefficient = (int) crossover(rand, this.evadeCoefficient, father.evadeCoefficient);
monster.evadeCoefficient *= mutation(rand) + 0.5;
monster.toughnessCoefficient = (int) crossover(rand, this.toughnessCoefficient, father.toughnessCoefficient);
monster.toughnessCoefficient *= mutation(rand) + 0.5;
monster.fertility = crossover(rand, this.fertility, father.fertility);
monster.fertility *= mutation(rand) + 0.5;
monster.injuryChance = (int) crossover(rand, this.injuryChance, father.injuryChance);
monster.injuryChance *= mutation(rand) + 0.5;
returnedChildren.add(monster);
}
return returnedChildren;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
2225cf15ef4e2c71a851700ab2d9449a5c7640e3
|
434a45b826a2b46dc64ad1562c8236224c6b1884
|
/Primero/workspace/Herencia/src/ejercicio04/Main.java
|
f1d849ebfb780dfde3b660c9a5ea931a6bc14314
|
[] |
no_license
|
SoulApps/CrossPlatformLearning
|
66c42b1cb09d69e97c3a1668502b0dd9cc139625
|
c80d0893621e85b426f0e17410f69e5f825dfa12
|
refs/heads/master
| 2021-04-27T06:05:36.794382
| 2017-12-06T18:17:26
| 2017-12-06T18:17:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 332
|
java
|
package ejercicio04;
/**
* Created by Alejandro on 04/02/2016.
*/
public class Main {
public static void main(String[] args) {
Empleado empleado = new Empleado("Empleado");
Encargado encargado = new Encargado("Encargado");
System.out.println(empleado);
System.out.println(encargado);
}
}
|
[
"alejandrosanchezgalvin@gmail.com"
] |
alejandrosanchezgalvin@gmail.com
|
2165071b7fd499726d406d030eab9c2863b96fb1
|
2613c9c2bde0cb3230a11bb04dfe863a612fccbc
|
/org.tolven.us.states/ejb/source/org/tolven/us/states/bean/DemographicsBean.java
|
8a3e2df89881a8e87fed9e87b4cce70adf82fdc5
|
[] |
no_license
|
kedar-s/bugtest
|
1d38a8f73419cc8f60ff41553321ca9942ba09b0
|
36e3556973b7320f1f2fcf5ef48af733bcb537c1
|
refs/heads/main
| 2023-08-22T09:51:25.918449
| 2021-10-14T16:09:29
| 2021-10-14T16:09:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,421
|
java
|
package org.tolven.us.states.bean;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.tolven.us.states.DemographicsLocal;
import org.tolven.us.states.entity.StateNames;
@Stateless
@Local(DemographicsLocal.class)
public class DemographicsBean implements DemographicsLocal{
@PersistenceContext
private EntityManager em;
/**
* Method to check whether state name exists.
* @param mdRefill
* @return
*/
private boolean checkForStateName(String stateCode){
String qs = null;
Query query = null;
qs = String.format(Locale.US, "SELECT sn FROM StateNames sn WHERE sn.stateCode = :code");
query = em.createQuery( qs );
query.setParameter( "code", stateCode);
if(query.getResultList() != null && query.getResultList().size() > 0){
return true;
}
return false;
}
/**
* Method to load state names into StateNames table in Surescripts schema.
* @param stateCode
* @param name
*/
public boolean createStateNames(String stateCode, String name) {
if (!checkForStateName(stateCode)) {
StateNames stateName = new StateNames();
stateName.setStateCode(stateCode);
stateName.setStateName(name);
persistStateName(stateName);
return true;
}
return false;
}
public void persistStateName( StateNames stateName ) {
em.persist(stateName);
}
/**
* Method to retrieve all the states in USA with their codes
* @return
*/
@SuppressWarnings("unchecked")
public Map<String, String> retrieveAllStates(){
Map<String, String> usaStates = null;
String qs = null;
Query query = null;
qs = String.format(Locale.US, "SELECT st FROM StateNames st ORDER BY st.stateName");
query = em.createQuery( qs );
if(null != query.getResultList()){
usaStates = new TreeMap<String, String>();
ArrayList<StateNames> stateDetailsList = (ArrayList<StateNames>)query.getResultList();
for(StateNames states : stateDetailsList){
usaStates.put(states.getStateCode(),states.getStateName());
}
}
return usaStates;
}
}
|
[
"kedarsambhus@outlook.com"
] |
kedarsambhus@outlook.com
|
eb7b0861e5ba88b1ed0f3c2ef056ad9680856aff
|
8a6dd3d81b1cfa0ad75860f5cfcb4ee14f722e2a
|
/seera-yancheng-core/src/main/java/com/sunesoft/seera/yc/core/tourist/domain/ITouristRepository.java
|
ec99a07296ada28804871aaa14c50bfcae0d20a5
|
[] |
no_license
|
heySeattleW/yancheng
|
e6c9e3b769d16c467262706b7fdd3a9698c4f14e
|
4bf9c3014a3e4cea19a9da048054e025d3c809a1
|
refs/heads/master
| 2020-04-27T06:44:27.531428
| 2017-04-26T10:41:34
| 2017-04-26T10:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,342
|
java
|
package com.sunesoft.seera.yc.core.tourist.domain;
import com.sunesoft.seera.fr.ddd.infrastructure.IRepository;
import com.sunesoft.seera.fr.results.PagedResult;
import com.sunesoft.seera.fr.results.UniqueResult;
import com.sunesoft.seera.yc.core.tourist.application.dtos.TouristSimpleDto;
import com.sunesoft.seera.yc.core.tourist.domain.criteria.TouristCriteria;
import java.util.List;
/**
* Created by zhaowy on 2016/7/11.
*/
public interface ITouristRepository extends IRepository<Tourist,Long> {
/**
* 校验游客Token与密码匹配
* @param openId userName|wxName|mobilePhone|email
* @return
*/
public Tourist checkOpenId(String openId);
/**
* wxoauth
* @param token
* @param pwd
* @return
*/
public UniqueResult<Tourist> login(String token, String pwd);
/**
* 校验游客Token存在性
*
* @param token userName|wxName|mobilePhone|email
* @return
*/
public Tourist check(String token);
/**
* 查询游客信息
*
* @param criteria
* @return 游客信息集合
*/
public PagedResult<Tourist> findTourists(TouristCriteria criteria);
/**
* 根据电话获取游客列表
* @param phones
* @return
*/
public List<Tourist> findTouristsByPhone(List<String> phones);
}
|
[
"1366812446@qq.com"
] |
1366812446@qq.com
|
438ae88623432833ff647f019ea73c595d28ce61
|
53d677a55e4ece8883526738f1c9d00fa6560ff7
|
/com/google/android/gms/internal/gcm/zzd.java
|
5f55738bfb07d91c159cb18f5c02b790f5b67fb9
|
[] |
no_license
|
0jinxing/wechat-apk-source
|
544c2d79bfc10261eb36389c1edfdf553d8f312a
|
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
|
refs/heads/master
| 2020-06-07T20:06:03.580028
| 2019-06-21T09:17:26
| 2019-06-21T09:17:26
| 193,069,132
| 9
| 4
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,664
|
java
|
package com.google.android.gms.internal.gcm;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import com.tencent.matrix.trace.core.AppMethodBeat;
public class zzd
implements IInterface
{
private final IBinder zzd;
private final String zze;
protected zzd(IBinder paramIBinder, String paramString)
{
this.zzd = paramIBinder;
this.zze = paramString;
}
public IBinder asBinder()
{
return this.zzd;
}
protected final Parcel obtainAndWriteInterfaceToken()
{
AppMethodBeat.i(57618);
Parcel localParcel = Parcel.obtain();
localParcel.writeInterfaceToken(this.zze);
AppMethodBeat.o(57618);
return localParcel;
}
protected final void transactAndReadExceptionReturnVoid(int paramInt, Parcel paramParcel)
{
AppMethodBeat.i(57619);
Parcel localParcel = Parcel.obtain();
try
{
this.zzd.transact(2, paramParcel, localParcel, 0);
localParcel.readException();
return;
}
finally
{
paramParcel.recycle();
localParcel.recycle();
AppMethodBeat.o(57619);
}
}
protected final void transactOneway(int paramInt, Parcel paramParcel)
{
AppMethodBeat.i(57620);
try
{
this.zzd.transact(1, paramParcel, null, 1);
return;
}
finally
{
paramParcel.recycle();
AppMethodBeat.o(57620);
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes8-dex2jar.jar
* Qualified Name: com.google.android.gms.internal.gcm.zzd
* JD-Core Version: 0.6.2
*/
|
[
"172601673@qq.com"
] |
172601673@qq.com
|
34ba4f440ad20f663d9710c69552b83ede6beed1
|
bd2139703c556050403c10857bde66f688cd9ee6
|
/skara/265/webrev.00/bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckWorkItem.java
|
ed6ae8e4db54684b541d2e38540d5091c6ba6135
|
[] |
no_license
|
isabella232/cr-archive
|
d03427e6fbc708403dd5882d36371e1b660ec1ac
|
8a3c9ddcfacb32d1a65d7ca084921478362ec2d1
|
refs/heads/master
| 2023-02-01T17:33:44.383410
| 2020-12-17T13:47:48
| 2020-12-17T13:47:48
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,996
|
java
|
/*
* Copyright (c) 2019, 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.
*
* 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 org.openjdk.skara.bots.pr;
import org.openjdk.skara.forge.*;
import org.openjdk.skara.host.*;
import org.openjdk.skara.issuetracker.*;
import org.openjdk.skara.vcs.Hash;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.security.*;
import java.time.*;
import java.util.*;
import java.util.function.Consumer;
import java.util.logging.Logger;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
class CheckWorkItem extends PullRequestWorkItem {
private final HostedRepository censusRepo;
private final String censusRef;
private final Map<String, String> blockingLabels;
private final IssueProject issueProject;
private final Pattern metadataComments = Pattern.compile("<!-- (?:(add|remove) contributor)|(?:summary: ')|(?:solves: ')");
private final Logger log = Logger.getLogger("org.openjdk.skara.bots.pr");
CheckWorkItem(PullRequest pr, HostedRepository censusRepo, String censusRef, Map<String, String> blockingLabels,
Consumer<RuntimeException> errorHandler, IssueProject issueProject) {
super(pr, errorHandler);
this.censusRepo = censusRepo;
this.censusRef = censusRef;
this.blockingLabels = blockingLabels;
this.issueProject = issueProject;
}
private String encodeReviewer(HostUser reviewer, CensusInstance censusInstance) {
var census = censusInstance.census();
var project = censusInstance.project();
var namespace = censusInstance.namespace();
var contributor = namespace.get(reviewer.id());
if (contributor == null) {
return "unknown-" + reviewer.id();
} else {
var censusVersion = census.version().format();
var userName = contributor.username();
return contributor.username() + project.isLead(userName, censusVersion) +
project.isReviewer(userName, censusVersion) + project.isCommitter(userName, censusVersion) +
project.isAuthor(userName, censusVersion);
}
}
String getMetadata(String title, String body, List<Comment> comments, List<Review> reviews, Set<String> labels,
CensusInstance censusInstance, Hash target) {
try {
var approverString = reviews.stream()
.filter(review -> review.verdict() == Review.Verdict.APPROVED)
.map(review -> encodeReviewer(review.reviewer(), censusInstance) + review.hash().hex())
.sorted()
.collect(Collectors.joining());
var commentString = comments.stream()
.filter(comment -> comment.author().id().equals(pr.repository().forge().currentUser().id()))
.flatMap(comment -> comment.body().lines())
.filter(line -> metadataComments.matcher(line).find())
.collect(Collectors.joining());
var labelString = labels.stream()
.sorted()
.collect(Collectors.joining());
var digest = MessageDigest.getInstance("SHA-256");
digest.update(title.getBytes(StandardCharsets.UTF_8));
digest.update(body.getBytes(StandardCharsets.UTF_8));
digest.update(approverString.getBytes(StandardCharsets.UTF_8));
digest.update(commentString.getBytes(StandardCharsets.UTF_8));
digest.update(labelString.getBytes(StandardCharsets.UTF_8));
digest.update(target.hex().getBytes(StandardCharsets.UTF_8));
return Base64.getUrlEncoder().encodeToString(digest.digest());
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("Cannot find SHA-256");
}
}
private boolean currentCheckValid(CensusInstance censusInstance, List<Comment> comments, List<Review> reviews, Set<String> labels) {
var hash = pr.headHash();
var targetHash = pr.targetHash();
var metadata = getMetadata(pr.title(), pr.body(), comments, reviews, labels, censusInstance, targetHash);
var currentChecks = pr.checks(hash);
if (currentChecks.containsKey("jcheck")) {
var check = currentChecks.get("jcheck");
// Check if the currently running check seems stale - perhaps the checker failed to complete
if (check.completedAt().isEmpty()) {
var runningTime = Duration.between(check.startedAt().toInstant(), Instant.now());
if (runningTime.toMinutes() > 10) {
log.warning("Previous jcheck running for more than 10 minutes - checking again");
} else {
log.finer("Jcheck in progress for " + runningTime.toMinutes() + " minutes, not starting another one");
return true;
}
} else {
if (check.metadata().isPresent() && check.metadata().get().equals(metadata)) {
log.finer("No activity since last check, not checking again");
return true;
} else {
log.info("PR updated after last check, checking again");
if (check.metadata().isPresent() && (!check.metadata().get().equals(metadata))) {
log.fine("Previous metadata: " + check.metadata().get() + " - current: " + metadata);
}
}
}
}
return false;
}
@Override
public String toString() {
return "CheckWorkItem@" + pr.repository().name() + "#" + pr.id();
}
@Override
public void run(Path scratchPath) {
// First determine if the current state of the PR has already been checked
var census = CensusInstance.create(censusRepo, censusRef, scratchPath.resolve("census"), pr);
var comments = pr.comments();
var allReviews = pr.reviews();
var labels = new HashSet<>(pr.labels());
// Filter out the active reviews
var activeReviews = PullRequestInstance.filterActiveReviews(allReviews);
if (!currentCheckValid(census, comments, activeReviews, labels)) {
if (labels.contains("integrated")) {
log.info("Skipping check of integrated PR");
return;
}
try {
var prInstance = new PullRequestInstance(scratchPath.resolve("pr"), pr);
CheckRun.execute(this, pr, prInstance, comments, allReviews, activeReviews, labels, census,
blockingLabels, issueProject);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
}
}
}
|
[
"duke@openjdk.java.net"
] |
duke@openjdk.java.net
|
6098da62c4adb1b02dfc03e60896f12ba16eaaed
|
95e2e2ad7a162b01748d8c98baee0c744df5dc05
|
/newpmbe.process.diagram/src/newpmbe/process/diagram/edit/parts/EMPDataFlow15EditPart.java
|
17e841c63bbe3cc8869e430ae153913dda51c219
|
[] |
no_license
|
liubc-1706/POMES
|
3d0f40c2313a32ceaab1c42c4f26654d06fb40b3
|
37211aa90c54d684b5ff12c7b6464c40038a1b22
|
refs/heads/master
| 2021-09-04T20:46:28.636728
| 2018-01-22T08:34:03
| 2018-01-22T08:34:03
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,538
|
java
|
package newpmbe.process.diagram.edit.parts;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.notation.View;
import newpmbe.process.diagram.edit.policies.EMPDataFlow15ItemSemanticEditPolicy;
import org.eclipse.draw2d.Connection;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionNodeEditPart;
/**
* @generated
*/
public class EMPDataFlow15EditPart extends ConnectionNodeEditPart {
/**
* @generated
*/
public static final int VISUAL_ID = 4034;
/**
* @generated
*/
public EMPDataFlow15EditPart(View view) {
super(view);
}
/**
* @generated
*/
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
new EMPDataFlow15ItemSemanticEditPolicy());
}
/**
* Creates figure for this edit part.
*
* Body of this method does not depend on settings in generation model
* so you may safely remove <i>generated</i> tag and modify it.
*
* @generated
*/
protected Connection createConnectionFigure() {
return new DataFlow();
}
/**
* @generated
*/
public class DataFlow extends
org.eclipse.gmf.runtime.draw2d.ui.figures.PolylineConnectionEx {
/**
* @generated
*/
public DataFlow() {
this.setFill(true);
this.setFillXOR(false);
this.setOutline(true);
this.setOutlineXOR(false);
this.setLineWidth(1);
this.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID);
this.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
this.setBackgroundColor(org.eclipse.draw2d.ColorConstants.black);
setTargetDecoration(createTargetDecoration());
}
/**
* @generated
*/
private org.eclipse.draw2d.RotatableDecoration createTargetDecoration() {
org.eclipse.draw2d.PolylineDecoration df = new org.eclipse.draw2d.PolylineDecoration();
df.setFill(true);
df.setFillXOR(true);
df.setOutline(true);
df.setOutlineXOR(true);
df.setLineWidth(2);
df.setLineStyle(org.eclipse.draw2d.Graphics.LINE_SOLID);
org.eclipse.draw2d.geometry.PointList pl = new org.eclipse.draw2d.geometry.PointList();
pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(1));
pl.addPoint(getMapMode().DPtoLP(0), getMapMode().DPtoLP(0));
pl.addPoint(getMapMode().DPtoLP(-1), getMapMode().DPtoLP(-1));
df.setTemplate(pl);
df.setScale(getMapMode().DPtoLP(7), getMapMode().DPtoLP(3));
return df;
}
}
}
|
[
"2397031600@qq.com"
] |
2397031600@qq.com
|
904716e39871bb6dfa87439d2a8aac30091e7d38
|
411e9b935c3138660ff8fe91efb57aac922ecc90
|
/hapi-fhir-structures-dstu3/src/main/java/org/hl7/fhir/dstu3/model/codesystems/QuestionnaireItemControlEnumFactory.java
|
a007defd36035a71ebc738f55b64cedad15df7f7
|
[
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] |
permissive
|
pobedite/hapi-fhir
|
6591f9004f4bd6b59491026d4db6440e20223072
|
223df60c1d0ad5683b62a801bebf3b3a793e5335
|
refs/heads/master
| 2020-06-09T12:59:04.666298
| 2016-12-08T15:50:42
| 2016-12-08T15:50:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,851
|
java
|
package org.hl7.fhir.dstu3.model.codesystems;
/*
Copyright (c) 2011+, HL7, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of HL7 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.
*/
// Generated on Sat, Nov 5, 2016 08:41-0400 for FHIR v1.7.0
import org.hl7.fhir.dstu3.model.EnumFactory;
public class QuestionnaireItemControlEnumFactory implements EnumFactory<QuestionnaireItemControl> {
public QuestionnaireItemControl fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
return null;
if ("group".equals(codeString))
return QuestionnaireItemControl.GROUP;
if ("list".equals(codeString))
return QuestionnaireItemControl.LIST;
if ("table".equals(codeString))
return QuestionnaireItemControl.TABLE;
if ("header".equals(codeString))
return QuestionnaireItemControl.HEADER;
if ("footer".equals(codeString))
return QuestionnaireItemControl.FOOTER;
if ("text".equals(codeString))
return QuestionnaireItemControl.TEXT;
if ("inline".equals(codeString))
return QuestionnaireItemControl.INLINE;
if ("prompt".equals(codeString))
return QuestionnaireItemControl.PROMPT;
if ("unit".equals(codeString))
return QuestionnaireItemControl.UNIT;
if ("lower".equals(codeString))
return QuestionnaireItemControl.LOWER;
if ("upper".equals(codeString))
return QuestionnaireItemControl.UPPER;
if ("flyover".equals(codeString))
return QuestionnaireItemControl.FLYOVER;
if ("help".equals(codeString))
return QuestionnaireItemControl.HELP;
if ("question".equals(codeString))
return QuestionnaireItemControl.QUESTION;
if ("autocomplete".equals(codeString))
return QuestionnaireItemControl.AUTOCOMPLETE;
if ("drop-down".equals(codeString))
return QuestionnaireItemControl.DROPDOWN;
if ("check-box".equals(codeString))
return QuestionnaireItemControl.CHECKBOX;
if ("lookup".equals(codeString))
return QuestionnaireItemControl.LOOKUP;
if ("radio-button".equals(codeString))
return QuestionnaireItemControl.RADIOBUTTON;
if ("slider".equals(codeString))
return QuestionnaireItemControl.SLIDER;
if ("spinner".equals(codeString))
return QuestionnaireItemControl.SPINNER;
if ("text-box".equals(codeString))
return QuestionnaireItemControl.TEXTBOX;
throw new IllegalArgumentException("Unknown QuestionnaireItemControl code '"+codeString+"'");
}
public String toCode(QuestionnaireItemControl code) {
if (code == QuestionnaireItemControl.GROUP)
return "group";
if (code == QuestionnaireItemControl.LIST)
return "list";
if (code == QuestionnaireItemControl.TABLE)
return "table";
if (code == QuestionnaireItemControl.HEADER)
return "header";
if (code == QuestionnaireItemControl.FOOTER)
return "footer";
if (code == QuestionnaireItemControl.TEXT)
return "text";
if (code == QuestionnaireItemControl.INLINE)
return "inline";
if (code == QuestionnaireItemControl.PROMPT)
return "prompt";
if (code == QuestionnaireItemControl.UNIT)
return "unit";
if (code == QuestionnaireItemControl.LOWER)
return "lower";
if (code == QuestionnaireItemControl.UPPER)
return "upper";
if (code == QuestionnaireItemControl.FLYOVER)
return "flyover";
if (code == QuestionnaireItemControl.HELP)
return "help";
if (code == QuestionnaireItemControl.QUESTION)
return "question";
if (code == QuestionnaireItemControl.AUTOCOMPLETE)
return "autocomplete";
if (code == QuestionnaireItemControl.DROPDOWN)
return "drop-down";
if (code == QuestionnaireItemControl.CHECKBOX)
return "check-box";
if (code == QuestionnaireItemControl.LOOKUP)
return "lookup";
if (code == QuestionnaireItemControl.RADIOBUTTON)
return "radio-button";
if (code == QuestionnaireItemControl.SLIDER)
return "slider";
if (code == QuestionnaireItemControl.SPINNER)
return "spinner";
if (code == QuestionnaireItemControl.TEXTBOX)
return "text-box";
return "?";
}
public String toSystem(QuestionnaireItemControl code) {
return code.getSystem();
}
}
|
[
"jamesagnew@gmail.com"
] |
jamesagnew@gmail.com
|
347865a5e8181884e327889c0d7a9929310fd160
|
180e78725121de49801e34de358c32cf7148b0a2
|
/dataset/protocol1/jdbi/validation/573/SqlObject.java
|
474df29f3ebc43c30d2ffd266cb39fd583b6d36c
|
[] |
no_license
|
ASSERT-KTH/synthetic-checkstyle-error-dataset
|
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
|
40c057e1669584bfc6fecf789b5b2854660222f3
|
refs/heads/master
| 2023-03-18T12:50:55.410343
| 2019-01-25T09:54:39
| 2019-01-25T09:54:39
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,273
|
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 org.jdbi.v3.sqlobject;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.HandleCallback;
import org.jdbi.v3.core.HandleConsumer;
/**
* SqlObject base interface. All synthesized implementations implement
* this interface, even if the declaration doesn't extend {@code SqlObject}.
*
* Custom mixins may be written as subinterfaces of this class with default methods.
*/
public interface SqlObject {
/**
* @return the handle open in the current sql object context.
*/
Handle getHandle();
/**
* A convenience function which manages the lifecycle of the handle associated to this sql object,
* and yields it to a callback for use by clients.
*
* @param callback A callback which will receive the handle associated to this sql object
* @param <R> type returned by the callback
* @param <X> exception type thrown by the callback, if any.
*
* @return the value returned by callback
*
* @throws X any exception thrown by the callback
*/
default <R, X extends Exception> R withHandle(HandleCallback<R, X> callback) throws
X {
return callback.withHandle(getHandle());
}
/**
* A convenience function which manages the lifecycle of the handle associated to this sql object,
* and yields it to a consumer for use by clients.
*
* @param consumer A consumer which will receive the handle associated to this sql object
* @param <X> exception type thrown by the callback, if any.
*
* @throws X any exception thrown by the callback
*/
default <X extends Exception> void useHandle(HandleConsumer<X> consumer) throws X {
consumer.useHandle(getHandle());
}
}
|
[
"bloriot97@gmail.com"
] |
bloriot97@gmail.com
|
d89936fc5034dcf95a1da142fc1fc93f02f58ef0
|
4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849
|
/aliyun-java-sdk-hdr/src/main/java/com/aliyuncs/hdr/model/v20170925/DescribeVSwitchesResponse.java
|
fff150ed1d6391ef41a96816fbf0a44db9817e22
|
[
"Apache-2.0"
] |
permissive
|
aliyun/aliyun-openapi-java-sdk
|
a263fa08e261f12d45586d1b3ad8a6609bba0e91
|
e19239808ad2298d32dda77db29a6d809e4f7add
|
refs/heads/master
| 2023-09-03T12:28:09.765286
| 2023-09-01T09:03:00
| 2023-09-01T09:03:00
| 39,555,898
| 1,542
| 1,317
|
NOASSERTION
| 2023-09-14T07:27:05
| 2015-07-23T08:41:13
|
Java
|
UTF-8
|
Java
| false
| false
| 3,274
|
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.hdr.model.v20170925;
import java.util.List;
import com.aliyuncs.AcsResponse;
import com.aliyuncs.hdr.transform.v20170925.DescribeVSwitchesResponseUnmarshaller;
import com.aliyuncs.transform.UnmarshallerContext;
/**
* @author auto create
* @version
*/
public class DescribeVSwitchesResponse extends AcsResponse {
private String requestId;
private Boolean success;
private String code;
private String message;
private Integer totalCount;
private Integer pageNumber;
private Integer pageSize;
private List<VSwitch> vSwitches;
public String getRequestId() {
return this.requestId;
}
public void setRequestId(String requestId) {
this.requestId = requestId;
}
public Boolean getSuccess() {
return this.success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public String getCode() {
return this.code;
}
public void setCode(String code) {
this.code = code;
}
public String getMessage() {
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
public Integer getTotalCount() {
return this.totalCount;
}
public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}
public Integer getPageNumber() {
return this.pageNumber;
}
public void setPageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
}
public Integer getPageSize() {
return this.pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public List<VSwitch> getVSwitches() {
return this.vSwitches;
}
public void setVSwitches(List<VSwitch> vSwitches) {
this.vSwitches = vSwitches;
}
public static class VSwitch {
private String id;
private String name;
private Boolean isDefault;
private String availableSelectionInfo;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public Boolean getIsDefault() {
return this.isDefault;
}
public void setIsDefault(Boolean isDefault) {
this.isDefault = isDefault;
}
public String getAvailableSelectionInfo() {
return this.availableSelectionInfo;
}
public void setAvailableSelectionInfo(String availableSelectionInfo) {
this.availableSelectionInfo = availableSelectionInfo;
}
}
@Override
public DescribeVSwitchesResponse getInstance(UnmarshallerContext context) {
return DescribeVSwitchesResponseUnmarshaller.unmarshall(this, context);
}
}
|
[
"sdk-team@alibabacloud.com"
] |
sdk-team@alibabacloud.com
|
82644742649ef6ec2ade99dc8a03aa0678037511
|
1c58f17842bc51ded2a2c4e6ccba936915b042ac
|
/Problems/Floor-space of the room/src/Main.java
|
d745325a19711d2f6e1135bf1d02761abeb5e336
|
[] |
no_license
|
forfireonly/Flashcards
|
350ac32936c282a8f677fdc1e92ed78b8cf7a5c6
|
852e6baa3d6a3a3bf6ab7cbc123e1cccbe7428c9
|
refs/heads/master
| 2022-06-10T20:15:17.192771
| 2020-05-04T02:21:56
| 2020-05-04T02:21:56
| 261,062,575
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,260
|
java
|
import java.util.Scanner;
class Main {
static final double PI = 3.14;
static void calculateShape(double a, double b, double c) {
double p = (a + b + c) / 2;
System.out.println(Math.sqrt(p * (p - a) *(p - b) * (p - c)));
}
static void calculateShape(double a, double b) {
System.out.println(a * b);
}
static void calculateShape(double r) {
System.out.println(PI * r * r);
}
public static void main(String[] args) {
// put your code here
Scanner scn = new Scanner(System.in);
String shape = scn.nextLine();
switch (shape) {
case ("triangle"):
double a = scn.nextFloat();
double b = scn.nextFloat();
double c = scn.nextFloat();
calculateShape(a, b, c);
break;
case ("rectangle"):
double a1 = scn.nextFloat();
double b1 = scn.nextFloat();
calculateShape(a1, b1);
break;
case ("circle"):
double r = scn.nextFloat();
calculateShape(r);
break;
default:
System.out.println("No such shape");
}
}
}
|
[
"workwithpurpose@yahoo.com"
] |
workwithpurpose@yahoo.com
|
70ad3de032563348cf6961da3dd127bd565c5e57
|
d6f31f187ef61d947dfe3ccf9b1a83a02323973a
|
/src/main/java/com/sunfy/yy/AipOcr/BaiduFace.java
|
dfa4d82a42e5d43dc5b4b784706d65cb1cd0ab39
|
[] |
no_license
|
sunfeiyang/yy
|
b4f34c8c913e56021f31e254bcc6553b40ac56af
|
11618372c58850bd85d03ffd5d2f39323796378c
|
refs/heads/master
| 2020-04-09T16:42:29.702479
| 2019-02-11T09:12:48
| 2019-02-11T09:12:48
| 160,460,457
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,655
|
java
|
package com.sunfy.yy.AipOcr;
import com.baidu.aip.face.AipFace;
import com.baidu.aip.face.MatchRequest;
import com.sunfy.yy.common.utils.UtilsGetImageBase64;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
public class BaiduFace {
//设置APPID/AK/SK
public static final String APP_ID = "15275660";
public static final String API_KEY = "r1O1fbh1Rt0BXMKj2DlnjcqV";
public static final String SECRET_KEY = "fzu2eeys5bsXMGkeQQQW8agZGRTDC1wl";
public static void main(String[] args) {
// 初始化一个AipFace
AipFace client = new AipFace(APP_ID, API_KEY, SECRET_KEY);
// 可选:设置网络连接参数
client.setConnectionTimeoutInMillis(2000);
client.setSocketTimeoutInMillis(60000);
// 可选:设置代理服务器地址, http和socket二选一,或者均不设置
// client.setHttpProxy("proxy_host", proxy_port); // 设置http代理
// client.setSocketProxy("proxy_host", proxy_port); // 设置socket代理
// 可选:设置log4j日志输出格式,若不设置,则使用默认配置
// 也可以直接通过jvm启动参数设置此环境变量
System.setProperty("aip.log4j.conf", "path/to/your/log4j.properties");
// 调用接口
String pathUrl = "E:/face3.jpg";
String path = UtilsGetImageBase64.GetImageStr(pathUrl);
String imageType = "BASE64";
// JSONObject res = client.detect(path,imageType, new HashMap<String, String>());
// System.out.println(res.toString(2));
// 传入可选参数调用接口
HashMap<String, String> options = new HashMap<String, String>();
options.put("face_field", "age");
options.put("max_face_num", "2");
options.put("face_type", "LIVE");
// 人脸检测
JSONObject res1 = client.detect(path, imageType, options);
// System.out.println(res1.toString(2));
//人脸对比
String image1 = "E:/face6.png";
String image2 = "E:/face2.jpg";
String path1 = UtilsGetImageBase64.GetImageStr(image1);
String path2 = UtilsGetImageBase64.GetImageStr(image2);
// image1/image2也可以为url或facetoken, 相应的imageType参数需要与之对应。
MatchRequest req1 = new MatchRequest(path1, "BASE64");
MatchRequest req2 = new MatchRequest(path2, "BASE64");
ArrayList<MatchRequest> requests = new ArrayList<MatchRequest>();
requests.add(req1);
requests.add(req2);
JSONObject res = client.match(requests);
System.out.println(res.toString(2));
}
}
|
[
"sfy5941@163.com"
] |
sfy5941@163.com
|
0b160f8888834ace5927acbbec34fda61542e77a
|
a9de22590675be8ee38163127a2c24a20c248a0b
|
/src/com/iremote/device/operate/zwavedevice/PlasmaDryerOperationTranslator.java
|
6f0ff977f4cbe0ea265543c18f11b8e8bb06ce40
|
[] |
no_license
|
jessicaallen777/iremote2
|
0943622300286f8d16e9bb4dca349613ffc23bb1
|
b27aa81785fc8bf5467a1ffcacd49a04e41f6966
|
refs/heads/master
| 2023-03-16T03:20:00.746888
| 2019-12-12T04:02:30
| 2019-12-12T04:02:30
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,954
|
java
|
package com.iremote.device.operate.zwavedevice;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.iremote.common.IRemoteConstantDefine;
import com.iremote.common.commandclass.CommandUtil;
import com.iremote.device.operate.OperationTranslatorBase;
import com.iremote.infraredtrans.tlv.CommandTlv;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
public class PlasmaDryerOperationTranslator extends OperationTranslatorBase {
@Override
public String getDeviceStatus() {
if ( StringUtils.isNoneBlank(this.devicestatus))
return this.devicestatus;
if ( this.status != null && this.status == IRemoteConstantDefine.DEVICE_STATUS_PLASMA_DRYER_ON)
this.devicestatus = IRemoteConstantDefine.DEVICE_OPERATION_OPEN;
else if ( this.status != null && this.status == IRemoteConstantDefine.DEVICE_STATUS_PLASMA_DRYER_OFF)
this.devicestatus = IRemoteConstantDefine.DEVICE_OPERATION_CLOSE;
return devicestatus;
}
@Override
public String getCommandjson() {
if ( StringUtils.isNotBlank(this.commandjson))
return this.commandjson;
return null;
}
@Override
public Integer getValue() {
if ( this.status != null )
return this.status;
if ( StringUtils.isNotBlank(this.devicestatus))
{
if ( IRemoteConstantDefine.DEVICE_OPERATION_OPEN.equals(this.devicestatus) )
this.status = IRemoteConstantDefine.DEVICE_STATUS_PLASMA_DRYER_ON ;
else if ( IRemoteConstantDefine.DEVICE_OPERATION_CLOSE.equals(this.devicestatus) )
this.status = IRemoteConstantDefine.DEVICE_STATUS_PLASMA_DRYER_OFF ;
}
return this.status;
}
@Override
public List<CommandTlv> getCommandTlv() {
if (this.commandtlvlst != null) {
return this.commandtlvlst;
}
commandtlvlst = new ArrayList<>();
if (this.zwavedevice != null && StringUtils.isNotBlank(this.commandjson)) {
JSONArray jsonArray = super.parseJSONArray(commandjson);
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
if (jsonObject.containsKey(IRemoteConstantDefine.POWER)) {
CommandTlv ct = CommandUtil.createPlasmaDryerPowerCommand(super.zwavedevice.getNuid(), jsonObject.getByteValue(IRemoteConstantDefine.POWER));
commandtlvlst.add(ct);
}
CommandTlv ct = CommandUtil.createPlasmaDryerModeCommand(super.zwavedevice.getNuid(), jsonObject.getInteger(IRemoteConstantDefine.MODE),
jsonObject.getInteger(IRemoteConstantDefine.DURATION), super.zwavedevice.getStatuses());
commandtlvlst.add(ct);
}
}
return commandtlvlst;
}
}
|
[
"stevenbluesky@163.com"
] |
stevenbluesky@163.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.