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
adec644d999147518016a6e5ae17623c5b46baf1
d674c1bc232b235cd84396a47d21be7f91ec598e
/common-utils/src/main/java/com/yfq/common/utils/LongUtils.java
b45be5444997120477788d3ca85d77a2c03e24ed
[ "Apache-2.0" ]
permissive
yinfuquan/utils
dd7ed28cb77b7d9123ddf8f1b466df4662e92441
7f5097180bb2a4190c1c989094dd8046b83186d3
refs/heads/master
2020-05-02T14:24:58.858845
2019-03-27T14:35:35
2019-03-27T14:35:35
178,010,173
0
0
null
null
null
null
UTF-8
Java
false
false
1,172
java
package com.yfq.common.utils; import com.yfq.common.exception.DataParseException; import com.yfq.common.exception.ServiceException; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LongUtils { private static Logger logger = LoggerFactory.getLogger(LongUtils.class); public LongUtils() { } public static Long parseLong(Object value, Long defaultValue) { if(value == null || StringUtils.isBlank(value.toString())) { return defaultValue; } if(value instanceof Long) { return (Long)value; } Long returnValue = 0L; if(value.getClass().isAssignableFrom(Number.class)) { returnValue = ((Number)value).longValue(); } try { returnValue = Long.parseLong(value.toString()); } catch(Exception exp) { logger.error("Long类型转换失败, 原值:" + value, exp); throw new DataParseException("类型转换失败"); } return returnValue; } public static Long parseLong(Object value, Long defaultValue, String tips) { try { return parseLong(value, defaultValue); } catch(DataParseException exp) { throw new ServiceException(tips, exp); } } }
[ "1257791382@qq.com" ]
1257791382@qq.com
5a1e8362d87ce21821b870d2313ae42ff72b0ea1
1466c2347c4fd40405d97b8d1b67665c7a49ad47
/aliyun-java-sdk-linkvisual/src/main/java/com/aliyuncs/linkvisual/transform/v20180120/QueryRecordResponseUnmarshaller.java
0d3523b6550973f83bfe3fc73dcbcdce18c7ec70
[ "Apache-2.0" ]
permissive
limfriend/aliyun-openapi-java-sdk
4e0e7d04fe268789f1e0ee7b5507892f83269876
12d004883c6ad54456dbf6eb47c06a6d27b77977
refs/heads/master
2020-11-26T19:19:54.073101
2020-01-08T09:53:13
2020-01-08T09:53:13
229,182,502
0
0
NOASSERTION
2019-12-20T03:24:19
2019-12-20T03:24:18
null
UTF-8
Java
false
false
2,526
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.linkvisual.transform.v20180120; import java.util.ArrayList; import java.util.List; import com.aliyuncs.linkvisual.model.v20180120.QueryRecordResponse; import com.aliyuncs.linkvisual.model.v20180120.QueryRecordResponse.Data; import com.aliyuncs.linkvisual.model.v20180120.QueryRecordResponse.Data.ListItem; import com.aliyuncs.transform.UnmarshallerContext; public class QueryRecordResponseUnmarshaller { public static QueryRecordResponse unmarshall(QueryRecordResponse queryRecordResponse, UnmarshallerContext _ctx) { queryRecordResponse.setRequestId(_ctx.stringValue("QueryRecordResponse.RequestId")); queryRecordResponse.setSuccess(_ctx.booleanValue("QueryRecordResponse.Success")); queryRecordResponse.setErrorMessage(_ctx.stringValue("QueryRecordResponse.ErrorMessage")); queryRecordResponse.setCode(_ctx.stringValue("QueryRecordResponse.Code")); Data data = new Data(); data.setPageSize(_ctx.integerValue("QueryRecordResponse.Data.PageSize")); data.setPage(_ctx.integerValue("QueryRecordResponse.Data.Page")); List<ListItem> list = new ArrayList<ListItem>(); for (int i = 0; i < _ctx.lengthValue("QueryRecordResponse.Data.List.Length"); i++) { ListItem listItem = new ListItem(); listItem.setBeginTime(_ctx.stringValue("QueryRecordResponse.Data.List["+ i +"].BeginTime")); listItem.setEndTime(_ctx.stringValue("QueryRecordResponse.Data.List["+ i +"].EndTime")); listItem.setRecordType(_ctx.integerValue("QueryRecordResponse.Data.List["+ i +"].RecordType")); listItem.setStreamType(_ctx.integerValue("QueryRecordResponse.Data.List["+ i +"].StreamType")); listItem.setFileName(_ctx.stringValue("QueryRecordResponse.Data.List["+ i +"].FileName")); listItem.setFileSize(_ctx.integerValue("QueryRecordResponse.Data.List["+ i +"].FileSize")); list.add(listItem); } data.setList(list); queryRecordResponse.setData(data); return queryRecordResponse; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
e22464f1005b8f831a78114c84f45931346a9d3d
3b6b50f1f3fbb589ac91d4ea70f5d524defce601
/optaplanner-core/src/main/java/org/optaplanner/core/impl/constructionheuristic/decider/ConstructionHeuristicDecider.java
53b8f36e68cf3a6a59a9fd93ad73250b2102587c
[ "Apache-2.0" ]
permissive
chhh/optaplanner
0b1f237a4b61407a990ff322b904ce5e04db6d7e
691797837d142bc14e94e27c7806f7d4a578eedf
refs/heads/master
2020-03-07T04:27:55.999161
2018-03-28T09:57:54
2018-03-28T09:57:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,089
java
/* * Copyright 2015 Red Hat, Inc. and/or its affiliates. * * 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.optaplanner.core.impl.constructionheuristic.decider; import org.optaplanner.core.api.score.Score; import org.optaplanner.core.impl.constructionheuristic.decider.forager.ConstructionHeuristicForager; import org.optaplanner.core.impl.constructionheuristic.placer.Placement; import org.optaplanner.core.impl.constructionheuristic.scope.ConstructionHeuristicMoveScope; import org.optaplanner.core.impl.constructionheuristic.scope.ConstructionHeuristicPhaseScope; import org.optaplanner.core.impl.constructionheuristic.scope.ConstructionHeuristicStepScope; import org.optaplanner.core.impl.heuristic.move.Move; import org.optaplanner.core.impl.score.director.ScoreDirector; import org.optaplanner.core.impl.solver.scope.DefaultSolverScope; import org.optaplanner.core.impl.solver.termination.Termination; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class ConstructionHeuristicDecider { protected final transient Logger logger = LoggerFactory.getLogger(getClass()); protected final String logIndentation; protected final Termination termination; protected final ConstructionHeuristicForager forager; protected boolean assertMoveScoreFromScratch = false; protected boolean assertExpectedUndoMoveScore = false; public ConstructionHeuristicDecider(String logIndentation, Termination termination, ConstructionHeuristicForager forager) { this.logIndentation = logIndentation; this.termination = termination; this.forager = forager; } public ConstructionHeuristicForager getForager() { return forager; } public void setAssertMoveScoreFromScratch(boolean assertMoveScoreFromScratch) { this.assertMoveScoreFromScratch = assertMoveScoreFromScratch; } public void setAssertExpectedUndoMoveScore(boolean assertExpectedUndoMoveScore) { this.assertExpectedUndoMoveScore = assertExpectedUndoMoveScore; } // ************************************************************************ // Worker methods // ************************************************************************ public void solvingStarted(DefaultSolverScope solverScope) { forager.solvingStarted(solverScope); } public void phaseStarted(ConstructionHeuristicPhaseScope phaseScope) { forager.phaseStarted(phaseScope); } public void stepStarted(ConstructionHeuristicStepScope stepScope) { forager.stepStarted(stepScope); } public void stepEnded(ConstructionHeuristicStepScope stepScope) { forager.stepEnded(stepScope); } public void phaseEnded(ConstructionHeuristicPhaseScope phaseScope) { forager.phaseEnded(phaseScope); } public void solvingEnded(DefaultSolverScope solverScope) { forager.solvingEnded(solverScope); } public void decideNextStep(ConstructionHeuristicStepScope stepScope, Placement placement) { int moveIndex = 0; for (Move move : placement) { ConstructionHeuristicMoveScope moveScope = new ConstructionHeuristicMoveScope(stepScope); moveScope.setMoveIndex(moveIndex); moveIndex++; moveScope.setMove(move); // Do not filter out pointless moves, because the original value of the entity(s) is irrelevant. // If the original value is null and the variable is nullable, the move to null must be done too. doMove(moveScope); if (forager.isQuitEarly()) { break; } stepScope.getPhaseScope().getSolverScope().checkYielding(); if (termination.isPhaseTerminated(stepScope.getPhaseScope())) { break; } } stepScope.setSelectedMoveCount((long) moveIndex); ConstructionHeuristicMoveScope pickedMoveScope = forager.pickMove(stepScope); if (pickedMoveScope != null) { Move step = pickedMoveScope.getMove(); stepScope.setStep(step); if (logger.isDebugEnabled()) { stepScope.setStepString(step.toString()); } stepScope.setUndoStep(pickedMoveScope.getUndoMove()); stepScope.setScore(pickedMoveScope.getScore()); } } private void doMove(ConstructionHeuristicMoveScope moveScope) { ScoreDirector scoreDirector = moveScope.getScoreDirector(); Move move = moveScope.getMove(); Move undoMove = move.doMove(scoreDirector); moveScope.setUndoMove(undoMove); processMove(moveScope); undoMove.doMove(scoreDirector); if (assertExpectedUndoMoveScore) { ConstructionHeuristicPhaseScope phaseScope = moveScope.getStepScope().getPhaseScope(); phaseScope.assertExpectedUndoMoveScore(move, undoMove, phaseScope.getLastCompletedStepScope().getScore()); } logger.trace("{} Move index ({}), score ({}), move ({}).", logIndentation, moveScope.getMoveIndex(), moveScope.getScore(), moveScope.getMove()); } private void processMove(ConstructionHeuristicMoveScope moveScope) { Score score = moveScope.getStepScope().getPhaseScope().calculateScore(); if (assertMoveScoreFromScratch) { moveScope.getStepScope().getPhaseScope().assertWorkingScoreFromScratch(score, moveScope.getMove()); } moveScope.setScore(score); forager.addMove(moveScope); } }
[ "gds.geoffrey.de.smet@gmail.com" ]
gds.geoffrey.de.smet@gmail.com
64ce163b4852331bbd804d7ee07230ddcf37c000
5e53cea57be97f773db2567667beb3941488358b
/src/main/java/io/github/vvd/hellobank/web/rest/errors/FieldErrorVM.java
1c60c55f085a13f51c36ccec488f76d47f53d5c3
[]
no_license
BulkSecurityGeneratorProject/HelloBank
00db8e1222c0ad20da948c8e1c3f6fe9982d7c5f
5a131d9dcbccd3e61aae4e9a76e433bb57707dcc
refs/heads/master
2022-12-16T18:55:01.539928
2018-01-08T20:57:02
2018-01-08T20:57:02
296,637,515
0
0
null
null
null
null
UTF-8
Java
false
false
655
java
package io.github.vvd.hellobank.web.rest.errors; import java.io.Serializable; public class FieldErrorVM implements Serializable { private static final long serialVersionUID = 1L; private final String objectName; private final String field; private final String message; public FieldErrorVM(String dto, String field, String message) { this.objectName = dto; this.field = field; this.message = message; } public String getObjectName() { return objectName; } public String getField() { return field; } public String getMessage() { return message; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
84a15e09a53a088f051c2fcbaff1de629b87d7f5
ac7b5056615fe0b29cf811d8e9ed90affd22b354
/Project1/src/com/bit/user/NormalUser.java
4737cfd092640877c40a9f05a204ef27a5d5a7a8
[]
no_license
Yunshuaiwei/JavaBit
d074a3e7dbd635681e34c2782f5e652ca2d13d67
b7fdbd2f5cf9ba094363bb999fc12d682de74d3d
refs/heads/master
2021-08-07T05:33:52.662884
2020-09-24T09:14:25
2020-09-24T09:14:25
217,806,725
0
0
null
null
null
null
UTF-8
Java
false
false
1,021
java
package com.bit.user; import com.bit.operation.*; import com.sun.media.sound.SoftTuning; import java.util.Scanner; /** * @author DELL */ public class NormalUser extends User{ public NormalUser(String name){ this.name=name; this.operations=new IOperation[]{ new ExitOperation(), new FindOperation(), new BorrowOperation(), new ReturnOperation(), new DisplayOperation() }; } @Override public int menu() { System.out.println("欢迎"+this.name+"登录图书管理系统"); System.out.println("1、查找图书"); System.out.println("2、借阅图书"); System.out.println("3、归还图书"); System.out.println("4、显示所有图书"); System.out.println("0、退出系统"); System.out.println("请输入你的选择:"); Scanner scanner=new Scanner(System.in); int choice=scanner.nextInt(); return choice; } }
[ "1779001867@qq.com" ]
1779001867@qq.com
2f645e2571c14f59b84a5727e211af2122a6be27
95c49f466673952b465e19a5ee3ae6eff76bee00
/src/main/java/com/zhihu/android/readlater/p1904b/FloatViewEvent.java
79beadeab4d85d5f62b1e14fd90e9d1a7ad8ce2c
[]
no_license
Phantoms007/zhihuAPK
58889c399ae56b16a9160a5f48b807e02c87797e
dcdbd103436a187f9c8b4be8f71bdf7813b6d201
refs/heads/main
2023-01-24T01:34:18.716323
2020-11-25T17:14:55
2020-11-25T17:14:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
343
java
package com.zhihu.android.readlater.p1904b; import kotlin.Metadata; @Metadata /* renamed from: com.zhihu.android.readlater.b.a */ /* compiled from: FloatViewEvent.kt */ public final class FloatViewEvent { /* renamed from: a */ private final boolean f86953a; public FloatViewEvent(boolean z) { this.f86953a = z; } }
[ "seasonpplp@qq.com" ]
seasonpplp@qq.com
6ac3d51e4ebd1a65bfae6578e265248852295fd7
62e334192393326476756dfa89dce9f0f08570d4
/tk_code/tiku-essay-app/essay-common/src/main/java/com/huatu/tiku/essay/vo/resp/EssayAnswerV2VO.java
f49d1e3c925d6b9af1f74bb27f2e43468a9003ea
[]
no_license
JellyB/code_back
4796d5816ba6ff6f3925fded9d75254536a5ddcf
f5cecf3a9efd6851724a1315813337a0741bd89d
refs/heads/master
2022-07-16T14:19:39.770569
2019-11-22T09:22:12
2019-11-22T09:22:12
223,366,837
1
2
null
2022-06-30T20:21:38
2019-11-22T09:15:50
Java
UTF-8
Java
false
false
649
java
package com.huatu.tiku.essay.vo.resp; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.*; import java.util.Date; /** * Created by x6 on 2017/11/27. */ @Getter @Setter @NoArgsConstructor @JsonInclude(JsonInclude.Include.NON_NULL) public class EssayAnswerV2VO extends EssayAnswerVO { /** * 批改备注,被驳回原因 */ private String correctMemo; /** * 批改模式 1 智能批改 2人工批改 */ private Integer correctMode; /** * 试卷类型 */ private Integer paperType; /** * 点击提示文案 */ private String clickContent; }
[ "jelly_b@126.com" ]
jelly_b@126.com
1fc495bf1c14a69a91a69975894a0172f429d7da
cc34035c779577eb6d48dc5131f51d12eb8d80e5
/learnspring/src/main/java/com/alison/spring/util/JVMThreadUtils.java
a7eaa8654fb9d60f014a71236df83c82f99b6dd7
[ "Apache-2.0" ]
permissive
GavinAlison/advanceJava
2aa541f86a10d5ae263f6c93831f21cea04d90b0
61db2d6a59c624f10471ef004fbbe3fc5490ebb8
refs/heads/master
2023-03-19T03:18:56.774838
2023-03-14T06:58:55
2023-03-14T06:58:55
205,755,765
0
0
Apache-2.0
2019-12-10T08:25:56
2019-09-02T01:38:04
Java
UTF-8
Java
false
false
2,137
java
package com.alison.spring.util; import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; /** * 类描述:JVM 线程信息工具类 * **/ public class JVMThreadUtils { static private ThreadMXBean threadMXBean; static { threadMXBean = ManagementFactory.getThreadMXBean(); } /** * Daemon线程总量 * @return */ static public int getDaemonThreadCount() { return threadMXBean.getDaemonThreadCount(); } /** * 当前线程总量 * @return */ static public int getThreadCount() { return threadMXBean.getThreadCount(); } /** * 获取线程数量峰值(从启动或resetPeakThreadCount()方法重置开始统计) * @return */ static public int getPeakThreadCount() { return threadMXBean.getPeakThreadCount(); } /** * 获取线程数量峰值(从启动或resetPeakThreadCount()方法重置开始统计),并重置 * @return * @Throws java.lang.SecurityException - if a security manager exists and the caller does not have ManagementPermission("control"). */ static public int getAndResetPeakThreadCount() { int count = threadMXBean.getPeakThreadCount(); resetPeakThreadCount(); return count; } /** * 重置线程数量峰值 * * @Throws java.lang.SecurityException - if a security manager exists and the caller does not have ManagementPermission("control"). */ static public void resetPeakThreadCount() { threadMXBean.resetPeakThreadCount(); } /** * 死锁线程总量 * @return * @Throws IllegalStateException 没有权限或JVM不支持的操作 */ static public int getDeadLockedThreadCount() { try { long[] deadLockedThreadIds = threadMXBean.findDeadlockedThreads(); if (deadLockedThreadIds == null) { return 0; } return deadLockedThreadIds.length; } catch (Exception e) { throw new IllegalStateException(e.getMessage(), e); } } }
[ "921757697@qq.com" ]
921757697@qq.com
822a1c51373e40dcf5bf3dc5fdc47021949e1bb1
701edf60dc39e271b737b4abe8e05a9ba45cb571
/leetcode/editor/cn/HasGroupsSizeX.java
1058568cde32cb2e6383bf08ce33001f91decec5
[]
no_license
liuzhugu/algorithms
4e5ac2509d435258e46411d7c173b16501764cb7
8291210aea970d0589c79f20e9eb176000861494
refs/heads/master
2023-03-08T08:00:02.817052
2021-02-25T11:36:07
2021-02-25T11:36:07
115,178,356
1
0
null
null
null
null
UTF-8
Java
false
false
1,863
java
package leetcode.editor.cn; import java.util.*; /** * Created by liuzhugu on 2020/03/27。 * 914. 卡牌分组 * 给定一副牌,每张牌上都写着一个整数。 * 此时,你需要选定一个数字 X,使我们可以将整副牌按下述规则分成 1 组或更多组: * 每组都有 X 张牌。 * 组内所有的牌上都写着相同的整数。 * 仅当你可选的 X >= 2 时返回 true。 */ public class HasGroupsSizeX { public boolean hasGroupsSizeX(int[] deck) { Map<Integer,Integer> map = new HashMap<>(); for (int i : deck) { map.put(i,map.getOrDefault(i,0) + 1); } Set<Integer> tmp = new HashSet<>(); for (int value : map.values()) { tmp.add(value); } List<Integer> size = new ArrayList<>(tmp); int min = Integer.MAX_VALUE; for (int i : size) { if (i < min) { min = i; } } if (min == 1) return false; List<Integer> list = getPrimeMumber(min); for (int i : list) { int j = 0; for (;j < size.size();j ++) { if (size.get(j) % i != 0) { break; } } if (j == size.size()) { return true; } } return false; } public List<Integer> getPrimeMumber(int n) { List<Integer> list = new ArrayList<>(); for (int i = 2; i <= n; i++) { boolean flag = true; if (i != 1) { for (int j = 2; j < i; j++) { if (i % j == 0) { flag = false; break; } } } if (flag) { list.add(i); } } return list; } }
[ "987685625@qq.com" ]
987685625@qq.com
b9f064781f1f662729219d8b5d9c1d63e2fa8a2b
faf825ce4412a786aba44c9ced5f673d446fcd3c
/1.8.9/src/main/java/stevekung/mods/moreplanets/module/planets/nibiru/tileentity/TileEntityJuicerEgg.java
ba855131cf09f84b44047f68039e92ade6aec15a
[]
no_license
AugiteSoul/MorePlanets
87022c06706c3194bde6926039ee7f28acf4983f
dd1941d7d520cb372db41abee67d865bd5125f87
refs/heads/master
2021-08-15T12:23:01.538212
2017-11-16T16:00:34
2017-11-16T16:00:34
111,147,939
0
0
null
2017-11-17T20:32:07
2017-11-17T20:32:06
null
UTF-8
Java
false
false
3,133
java
package stevekung.mods.moreplanets.module.planets.nibiru.tileentity; import java.util.List; import micdoodle8.mods.galacticraft.planets.venus.entities.EntityJuicer; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.util.AxisAlignedBB; import stevekung.mods.moreplanets.module.planets.nibiru.blocks.NibiruBlocks; import stevekung.mods.moreplanets.util.tileentity.TileEntityRenderTickable; public class TileEntityJuicerEgg extends TileEntityRenderTickable { @Override public void update() { super.update(); if (!this.worldObj.isRemote) { double radius = 1.05D; double radiusPlayer = 5.0D; List<Entity> list = this.worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(this.pos.getX() - radius, this.pos.getY() - radius, this.pos.getZ() - radius, this.pos.getX() + radius, this.pos.getY() + radius, this.pos.getZ() + radius)); List<EntityPlayer> playerList = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - radiusPlayer, this.pos.getY() - radiusPlayer, this.pos.getZ() - radiusPlayer, this.pos.getX() + radiusPlayer, this.pos.getY() + radiusPlayer, this.pos.getZ() + radiusPlayer)); if (!list.isEmpty()) { for (Entity entity : list) { if (entity instanceof EntityArrow) { EntityArrow arrow = (EntityArrow) entity; if (arrow.inTile == NibiruBlocks.JUICER_EGG) { arrow.setDead(); this.worldObj.destroyBlock(this.pos, false); if (this.worldObj.rand.nextInt(5) == 0) { EntityJuicer juicer = new EntityJuicer(this.worldObj); juicer.setLocationAndAngles(this.pos.getX() + 0.5D, this.pos.getY() + 1.0D, this.pos.getZ() + 0.5D, 0.0F, 0.0F); this.worldObj.spawnEntityInWorld(juicer); } if (this.worldObj.rand.nextInt(10) == 0) { if (!playerList.isEmpty()) { for (EntityPlayer player : playerList) { EntityJuicer juicer = new EntityJuicer(this.worldObj); juicer.setLocationAndAngles(this.pos.getX() + 0.5D, this.pos.getY() + 1.0D, this.pos.getZ() + 0.5D, 0.0F, 0.0F); this.worldObj.spawnEntityInWorld(juicer); juicer.mountEntity(player); } } } } } } } } } }
[ "mccommander_minecraft@hotmail.com" ]
mccommander_minecraft@hotmail.com
751aa2da5cab66b3d8954de5b0431f83e1357518
8e77ed1d11d3ee6486976bdc6b7c5c1043c4d6df
/src/cn/com/oims/web/intercepts/LoginValidationIntercept.java
bcbcaab12d695e30f76ae981e67953425a29897b
[]
no_license
498473645/OIMS
e553f266629b7baf0e0dc31bd50edcd534c83c21
4477b5882e6478c3cac44c83a2d2539eb98e887a
refs/heads/main
2023-08-07T04:41:21.592563
2021-09-23T03:10:21
2021-09-23T03:10:21
409,429,603
0
0
null
null
null
null
UTF-8
Java
false
false
1,225
java
package cn.com.oims.web.intercepts; import cn.com.oims.service.IUserService; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; public class LoginValidationIntercept extends HandlerInterceptorAdapter { private String notValidURI = "userLogin.htm"; private String validOimsCpature = "/user/showJCPanel.htm"; @Autowired private IUserService userService; public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String requestURI = request.getRequestURI(); HttpSession session = request.getSession(); Object jobnum = session.getAttribute("gonghao"); boolean required = true; if (requestURI.indexOf(this.notValidURI) != -1) required = false; if (requestURI.indexOf(this.validOimsCpature) != -1) required = false; if (required) if (jobnum == null) { response.sendRedirect("../"); return false; } return super.preHandle(request, response, handler); } }
[ "545455716@qq.com" ]
545455716@qq.com
5156d4133e20fd99d8e102411c04198c5c1fc72c
f4a30f2b65d03efc04c6ae937b31f26c36e53a81
/src/org/omg/CORBA/ParameterModeHolder.java
6bfba61b0c841dd12558aae4eedab8b4cc2cdd93
[]
no_license
weipeng001/jdk
b144cda94ba510f29cfc618483fd82a604db4bdf
2ee7f0f2fc421e7bbdc61f551ad364ee31cba74d
refs/heads/master
2023-02-17T21:51:21.513834
2021-01-18T03:30:20
2021-01-18T03:30:20
330,535,639
0
0
null
null
null
null
UTF-8
Java
false
false
1,238
java
package org.omg.CORBA; /** * org/omg/CORBA/ParameterModeHolder.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from c:/re/workspace/8-2-build-windows-i586-cygwin/jdk8u112/7884/corba/src/share/classes/org/omg/PortableInterceptor/CORBAX.idl * Thursday, September 22, 2016 9:04:04 PM PDT */ /** * Enumeration of parameter modes for Parameter. Possible vaues: * <ul> * <li>PARAM_IN - Represents an "in" parameter.</li> * <li>PARAM_OUT - Represents an "out" parameter.</li> * <li>PARAM_INOUT - Represents an "inout" parameter.</li> * </ul> */ public final class ParameterModeHolder implements org.omg.CORBA.portable.Streamable { public org.omg.CORBA.ParameterMode value = null; public ParameterModeHolder () { } public ParameterModeHolder (org.omg.CORBA.ParameterMode initialValue) { value = initialValue; } public void _read (org.omg.CORBA.portable.InputStream i) { value = org.omg.CORBA.ParameterModeHelper.read (i); } public void _write (org.omg.CORBA.portable.OutputStream o) { org.omg.CORBA.ParameterModeHelper.write (o, value); } public org.omg.CORBA.TypeCode _type () { return org.omg.CORBA.ParameterModeHelper.type (); } }
[ "592743134@qq.com" ]
592743134@qq.com
de130f9085648e98563bc496b482bbd8e146d63b
ac82c09fd704b2288cef8342bde6d66f200eeb0d
/projects/OG-Financial/src/test/java/com/opengamma/financial/temptarget/EHCachingTempTargetRepositoryTest.java
770abc35738d110f9857b86628ee4608c6d069e3
[ "Apache-2.0" ]
permissive
cobaltblueocean/OG-Platform
88f1a6a94f76d7f589fb8fbacb3f26502835d7bb
9b78891139503d8c6aecdeadc4d583b23a0cc0f2
refs/heads/master
2021-08-26T00:44:27.315546
2018-02-23T20:12:08
2018-02-23T20:12:08
241,467,299
0
2
Apache-2.0
2021-08-02T17:20:41
2020-02-18T21:05:35
Java
UTF-8
Java
false
false
5,325
java
/** * Copyright (C) 2013 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.financial.temptarget; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertSame; import static org.testng.Assert.assertTrue; import net.sf.ehcache.CacheManager; import org.mockito.Mockito; import org.springframework.context.Lifecycle; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import com.opengamma.core.change.ChangeManager; import com.opengamma.id.UniqueId; import com.opengamma.util.ehcache.EHCacheUtils; import com.opengamma.util.test.TestGroup; /** * Tests the {@link EHCachingTempTargetRepository} class. */ @Test(groups = TestGroup.UNIT) public class EHCachingTempTargetRepositoryTest { private CacheManager _cacheManager; @BeforeClass public void setUpClass() { _cacheManager = EHCacheUtils.createTestCacheManager(EHCachingTempTargetRepository.class); } @AfterClass public void tearDownClass() { EHCacheUtils.shutdownQuiet(_cacheManager); } public void testGet() { final TempTargetRepository underlying = Mockito.mock(TempTargetRepository.class); Mockito.when(underlying.get(UniqueId.of("Foo", "Bar"))).thenReturn(new MockTempTarget("X")); final TempTargetRepository cache = new EHCachingTempTargetRepository(underlying, _cacheManager); final TempTarget result = cache.get(UniqueId.of("Foo", "Bar")); assertEquals(result, new MockTempTarget("X")); assertSame(cache.get(UniqueId.of("Foo", "Bar")), result); Mockito.verify(underlying, Mockito.times(1)).get(UniqueId.of("Foo", "Bar")); Mockito.verifyNoMoreInteractions(underlying); } public void testCacheManager() { final TempTargetRepository underlying = Mockito.mock(TempTargetRepository.class); final ChangeManager changeManager = Mockito.mock(ChangeManager.class); Mockito.when(underlying.changeManager()).thenReturn(changeManager); final TempTargetRepository cache = new EHCachingTempTargetRepository(underlying, _cacheManager); assertSame(cache.changeManager(), changeManager); Mockito.verify(underlying, Mockito.only()).changeManager(); } public void testLocateOrStore() { final TempTargetRepository underlying = Mockito.mock(TempTargetRepository.class); final TempTarget target = new MockTempTarget("X"); Mockito.when(underlying.locateOrStore(target)).thenReturn(UniqueId.of("Foo", "Bar")); final TempTargetRepository cache = new EHCachingTempTargetRepository(underlying, _cacheManager); assertEquals(cache.locateOrStore(target), UniqueId.of("Foo", "Bar")); assertEquals(cache.locateOrStore(target), UniqueId.of("Foo", "Bar")); Mockito.verify(underlying, Mockito.times(1)).locateOrStore(target); Mockito.verifyNoMoreInteractions(underlying); } public void testStartStop_noPassthrough() { final TempTargetRepository underlying = Mockito.mock(TempTargetRepository.class); final EHCachingTempTargetRepository cache = new EHCachingTempTargetRepository(underlying, _cacheManager); assertFalse(cache.isRunning()); cache.start(); assertTrue(cache.isRunning()); cache.stop(); assertFalse(cache.isRunning()); Mockito.verifyZeroInteractions(underlying); } private static class LifecycleTempTargetRepository implements TempTargetRepository, Lifecycle { private final Lifecycle _lifecycle; public LifecycleTempTargetRepository(final Lifecycle lifecycle) { _lifecycle = lifecycle; } // TempTargetRepository @Override public TempTarget get(UniqueId identifier) { throw new UnsupportedOperationException(); } @Override public ChangeManager changeManager() { throw new UnsupportedOperationException(); } @Override public UniqueId locateOrStore(TempTarget target) { throw new UnsupportedOperationException(); } // Lifecycle @Override public void start() { _lifecycle.start(); } @Override public void stop() { _lifecycle.stop(); } @Override public boolean isRunning() { return _lifecycle.isRunning(); } } public void testStartStop_passThrough() { final Lifecycle lifecycle = Mockito.mock(Lifecycle.class); Mockito.when(lifecycle.isRunning()).thenReturn(true); final TempTargetRepository underlying = new LifecycleTempTargetRepository(lifecycle); final EHCachingTempTargetRepository cache = new EHCachingTempTargetRepository(underlying, _cacheManager); Mockito.verify(lifecycle, Mockito.times(0)).start(); Mockito.verify(lifecycle, Mockito.times(0)).stop(); Mockito.verify(lifecycle, Mockito.times(0)).isRunning(); assertFalse(cache.isRunning()); cache.start(); Mockito.verify(lifecycle, Mockito.times(1)).start(); assertTrue(cache.isRunning()); Mockito.verify(lifecycle, Mockito.times(1)).isRunning(); cache.stop(); Mockito.verify(lifecycle, Mockito.times(1)).stop(); assertFalse(cache.isRunning()); Mockito.verify(lifecycle, Mockito.times(1)).start(); Mockito.verify(lifecycle, Mockito.times(1)).isRunning(); Mockito.verify(lifecycle, Mockito.times(1)).stop(); } }
[ "cobaltblue.ocean@gmail.com" ]
cobaltblue.ocean@gmail.com
00e091f604a6d9a6accf4d1dd14a40add787b640
9d371f35b5c15913c823fe1261cfb5b3f51e9409
/Sessional1SectionC/src/pk/ciit/sess1/q8/Demo.java
c319c1175185da2280890574927e66f45e703f85
[]
no_license
sshpk/software-construction-ciit
72abe2530d3df17c5071ebb3904cde2fe2319591
4d79a5d4ebb72c545245808de061282eae18c231
refs/heads/master
2021-06-01T13:26:38.557013
2021-01-15T04:17:11
2021-01-15T04:17:11
42,129,138
1
1
null
2020-10-14T00:33:56
2015-09-08T17:51:00
HTML
UTF-8
Java
false
false
575
java
package pk.ciit.sess1.q8; public class Demo { private static CoffeeFactory coffeeFactory = new CoffeeFactory(); static void takeOrder(int tableNumber, String flavor){ Table table = new Table(tableNumber); ICoffee coffee = coffeeFactory.getCoffeeFlavor(flavor); coffee.serveCoffee(table); } public static void main(String[] args) { takeOrder(1, "Espresso"); takeOrder(2, "Cappuchino"); takeOrder(1, "Espresso"); System.out.println("The number of coffee flavors served: "+coffeeFactory.getTotalCoffeeFlavorsMade()); } }
[ "sajid.shah.de@gmail.com" ]
sajid.shah.de@gmail.com
97dc19d160606b68e9e71bbe688d1c8e7ba79194
acd9b11687fd0b5d536823daf4183a596d4502b2
/java-client/src/main/java/co/elastic/clients/elasticsearch/license/LicenseType.java
e44cd5079b8868198176c8b2e9e11e18d46d2284
[ "Apache-2.0", "LicenseRef-scancode-proprietary-license", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-generic-cla" ]
permissive
szabosteve/elasticsearch-java
75be71df80a4e010abe334a5288b53fa4a2d6d5e
79a1249ae77be2ce9ebd5075c1719f3c8be49013
refs/heads/main
2023-08-24T15:36:51.047105
2021-10-01T14:23:34
2021-10-01T14:23:34
399,091,850
0
0
Apache-2.0
2021-08-23T12:15:19
2021-08-23T12:15:19
null
UTF-8
Java
false
false
1,696
java
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. 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. */ //---------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------- package co.elastic.clients.elasticsearch.license; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.util.StringEnum; @JsonpDeserializable public enum LicenseType implements StringEnum { Missing("missing"), Trial("trial"), Basic("basic"), Standard("standard"), Dev("dev"), Silver("silver"), Gold( "gold"), Platinum("platinum"), Enterprise("enterprise"); private final String jsonValue; LicenseType(String jsonValue) { this.jsonValue = jsonValue; } public String jsonValue() { return this.jsonValue; } public static final StringEnum.Deserializer<LicenseType> _DESERIALIZER = new StringEnum.Deserializer<>( LicenseType.values()); }
[ "sylvain@elastic.co" ]
sylvain@elastic.co
715072d46614592ef1bdacd5a5351b86e2e660bc
4312a71c36d8a233de2741f51a2a9d28443cd95b
/RawExperiments/DB/Math60/AstorMain-math60/src/variant-798/org/apache/commons/math/special/Gamma.java
da8605efcf860380fe6ec7c7331c0b6b292fb948
[]
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,468
java
package org.apache.commons.math.special; public class Gamma { public static final double GAMMA = 0.5772156649015329; private static final double DEFAULT_EPSILON = 1.0E-14; private static final double[] LANCZOS = new double[]{ 0.9999999999999971 , 57.15623566586292 , -59.59796035547549 , 14.136097974741746 , -0.4919138160976202 , 3.399464998481189E-5 , 4.652362892704858E-5 , -9.837447530487956E-5 , 1.580887032249125E-4 , -2.1026444172410488E-4 , 2.1743961811521265E-4 , -1.643181065367639E-4 , 8.441822398385275E-5 , -2.6190838401581408E-5 , 3.6899182659531625E-6 }; private static final double HALF_LOG_2_PI = 0.5 * (org.apache.commons.math.util.FastMath.log((2.0 * (org.apache.commons.math.util.FastMath.PI)))); private static final double C_LIMIT = 49; private static final double S_LIMIT = 1.0E-5; private Gamma() { super(); } public static double logGamma(double x) { double ret; if ((java.lang.Double.isNaN(x)) || (x <= 0.0)) { ret = java.lang.Double.NaN; } else { double g = 607.0 / 128.0; double sum = 0.0; for (int i = (org.apache.commons.math.special.Gamma.LANCZOS.length) - 1 ; i > 0 ; --i) { sum = sum + ((org.apache.commons.math.special.Gamma.LANCZOS[i]) / (x + i)); } sum = sum + (org.apache.commons.math.special.Gamma.LANCZOS[0]); double tmp = (x + g) + 0.5; ret = ((((x + 0.5) * (org.apache.commons.math.util.FastMath.log(tmp))) - tmp) + (org.apache.commons.math.special.Gamma.HALF_LOG_2_PI)) + (org.apache.commons.math.util.FastMath.log((sum / x))); } return ret; } public static double regularizedGammaP(double a, double x) throws org.apache.commons.math.MathException { return org.apache.commons.math.special.Gamma.regularizedGammaP(a, x, org.apache.commons.math.special.Gamma.DEFAULT_EPSILON, java.lang.Integer.MAX_VALUE); } public static double regularizedGammaP(double a, double x, double epsilon, int maxIterations) throws org.apache.commons.math.MathException { double ret; if ((((java.lang.Double.isNaN(a)) || (java.lang.Double.isNaN(x))) || (a <= 0.0)) || (x < 0.0)) { ret = java.lang.Double.NaN; } else { if (x == 0.0) { ret = 0.0; } else { if (x >= (a + 1)) { return 401993047; ret = 1.0 - (org.apache.commons.math.special.Gamma.regularizedGammaQ(a, x, epsilon, maxIterations)); } else { double n = 0.0; double an = 1.0 / a; double sum = an; while ((((org.apache.commons.math.util.FastMath.abs((an / sum))) > epsilon) && (n < maxIterations)) && (sum < (java.lang.Double.POSITIVE_INFINITY))) { n = n + 1.0; an = an * (x / (a + n)); sum = sum + an; } if (n >= maxIterations) { throw new org.apache.commons.math.MaxIterationsExceededException(maxIterations); } else { if (java.lang.Double.isInfinite(sum)) { ret = 1.0; } else { ret = (org.apache.commons.math.util.FastMath.exp((((-x) + (a * (org.apache.commons.math.util.FastMath.log(x)))) - (org.apache.commons.math.special.Gamma.logGamma(a))))) * sum; } } } } } return ret; } public static double regularizedGammaQ(double a, double x) throws org.apache.commons.math.MathException { return org.apache.commons.math.special.Gamma.regularizedGammaQ(a, x, org.apache.commons.math.special.Gamma.DEFAULT_EPSILON, java.lang.Integer.MAX_VALUE); } public static double regularizedGammaQ(final double a, double x, double epsilon, int maxIterations) throws org.apache.commons.math.MathException { double ret; if ((((java.lang.Double.isNaN(a)) || (java.lang.Double.isNaN(x))) || (a <= 0.0)) || (x < 0.0)) { ret = java.lang.Double.NaN; } else { if (x == 0.0) { ret = 1.0; } else { if (x < (a + 1.0)) { ret = 1.0 - (org.apache.commons.math.special.Gamma.regularizedGammaP(a, x, epsilon, maxIterations)); } else { org.apache.commons.math.util.ContinuedFraction cf = new org.apache.commons.math.util.ContinuedFraction() { @java.lang.Override protected double getA(int n, double x) { return (((2.0 * n) + 1.0) - a) + x; } @java.lang.Override protected double getB(int n, double x) { return n * (a - n); } }; ret = 1.0 / (cf.evaluate(x, epsilon, maxIterations)); ret = (org.apache.commons.math.util.FastMath.exp((((-x) + (a * (org.apache.commons.math.util.FastMath.log(x)))) - (org.apache.commons.math.special.Gamma.logGamma(a))))) * ret; } } } return ret; } public static double digamma(double x) { if ((x > 0) && (x <= (org.apache.commons.math.special.Gamma.S_LIMIT))) { return (-(org.apache.commons.math.special.Gamma.GAMMA)) - (1 / x); } if (x >= (org.apache.commons.math.special.Gamma.C_LIMIT)) { double inv = 1 / (x * x); return ((org.apache.commons.math.util.FastMath.log(x)) - (0.5 / x)) - (inv * ((1.0 / 12) + (inv * ((1.0 / 120) - (inv / 252))))); } return (org.apache.commons.math.special.Gamma.digamma((x + 1))) - (1 / x); } public static double trigamma(double x) { if ((x > 0) && (x <= (org.apache.commons.math.special.Gamma.S_LIMIT))) { return 1 / (x * x); } if (x >= (org.apache.commons.math.special.Gamma.C_LIMIT)) { double inv = 1 / (x * x); return ((1 / x) + (inv / 2)) + ((inv / x) * ((1.0 / 6) - (inv * ((1.0 / 30) + (inv / 42))))); } return (org.apache.commons.math.special.Gamma.trigamma((x + 1))) + (1 / (x * x)); } }
[ "sajjad.syed@ucalgary.ca" ]
sajjad.syed@ucalgary.ca
9c0505435d01b41885f52d3c11bd5f207552204d
949bda0e3f200eebff5caaad3716ac5e1efcf939
/Aula5EightPuzzleGame/mujava/result/domain.Grid/traditional_mutants/Grid(int,int)/SDL_2/Grid.java
9962f63138c215acd73e07becd0322a5e539b2a8
[]
no_license
csmaniottojr/ine5448
8a8874e3c7f9509809c7f0dda0c724addbc8045e
8437ec2f883db922e8d7f654e10d636d2f13a8d7
refs/heads/master
2021-01-23T07:55:44.740984
2017-05-21T23:02:00
2017-05-21T23:02:00
86,465,141
0
0
null
2017-05-30T13:15:42
2017-03-28T13:45:03
Java
UTF-8
Java
false
false
1,314
java
// This is a mutant program. // Author : ysma package domain; public class Grid<T> { private java.lang.Object[][] matrix; private int numberOfLines; private int numberOfColumns; public Grid( int numberOfLines, int numberOfColumns ) { if (numberOfLines > 0 && numberOfColumns > 0) { this.numberOfColumns = numberOfColumns; this.matrix = (T[][]) new java.lang.Object[numberOfLines][numberOfColumns]; } } public void put( int line, int column, T element ) { if (line > 0 && line <= numberOfLines && column > 0 && column <= numberOfColumns) { this.matrix[line - 1][column - 1] = element; } } public T get( int linha, int coluna ) { if (linha > 0 && linha <= numberOfLines && coluna > 0 && coluna <= numberOfColumns) { return (T) this.matrix[linha - 1][coluna - 1]; } else { return null; } } public java.lang.String toString() { java.lang.String result = null; for (int i = 0; i < this.numberOfLines; i++) { for (int j = 0; j < this.numberOfColumns; j++) { result = result + "(" + i + "," + j + ")" + ":" + this.matrix[i][j] + " "; } } return result; } }
[ "cesarsjb@yahoo.com.br" ]
cesarsjb@yahoo.com.br
e8a8d9a9d549f2fbba0a974d5099517604d99291
b3124be5e48bd1feeaa5ef357fcbe931a84f8e28
/utils_net/src/main/java/com/pax/spos/utils/net/socket/codec/BytesEncoder.java
1c58bb010ae8da085a106d27774e757186ec1453
[]
no_license
fabletang/sposutils
80fe3d915214b85585d50ea4c4c1bfeca913f36d
65e86e0fd4fc13e23c77bbc3ebc2a0cb072fe5cd
refs/heads/master
2016-09-08T01:44:11.829037
2015-04-20T03:15:32
2015-04-20T03:15:32
23,818,759
0
0
null
null
null
null
UTF-8
Java
false
false
3,022
java
package com.pax.spos.utils.net.socket.codec; import com.pax.spos.utils.ByteStringHex; import com.pax.spos.utils.net.socket.SocketClientUtil; import com.pax.spos.utils.net.socket.model.SocketBytes; import com.pax.spos.utils.net.socket.model.SocketPara; import org.apache.mina.core.buffer.IoBuffer; import org.apache.mina.core.session.IoSession; import org.apache.mina.filter.codec.ProtocolEncoder; import org.apache.mina.filter.codec.ProtocolEncoderOutput; import java.util.logging.Level; import java.util.logging.Logger; /** * Created by fable on 14-9-10. */ public class BytesEncoder implements ProtocolEncoder { // private final static Logger LOGGER = LoggerFactory.getLogger(MReqEncoder.class); public static Logger LOGGER = Logger.getLogger("BytesEncoder"); private boolean isServer; private SocketPara socketPara; public BytesEncoder(boolean isServer,SocketPara socketPara) { this.isServer = isServer; this.socketPara=socketPara; } @Override public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception { LOGGER.setLevel(Level.INFO); SocketBytes socketBytes = (SocketBytes) message; if (socketBytes.getBytesContent() == null) return; byte[] bytesOut; if (socketBytes.isFitSocketPara()) { // SocketPara socketPara = SocketClientUtil.getSocketPara(); if (socketPara == null) return; int bytesContentLen = socketBytes.getBytesContent().length; if (bytesContentLen < 1) return; int headLen; if (isServer) { headLen = socketPara.getHeadLenNum_in(); } else { headLen = socketPara.getHeadLenNum_out(); } int len = headLen + bytesContentLen; if (len < 1) return; bytesOut = new byte[len]; // byte[] lenBytes= ByteStringHex.int2FixBytes(bytesContentLen,headLen); byte[] lenBytes = SocketClientUtil.buildHeadBytes(bytesContentLen, isServer); LOGGER.info("lenBytes=" + ByteStringHex.bytes2HexStr(lenBytes)); if (lenBytes.length < 1) return; System.arraycopy(lenBytes, 0, bytesOut, 0, lenBytes.length); System.arraycopy(socketBytes.getBytesContent(), 0, bytesOut, lenBytes.length, bytesContentLen); } else { int bytesContentLen = socketBytes.getBytesContent().length; if (bytesContentLen < 1) return; bytesOut = socketBytes.getBytesContent(); } IoBuffer buffer = IoBuffer.allocate(bytesOut.length, false); buffer.setAutoExpand(true); buffer.setAutoShrink(true); buffer.put(bytesOut); buffer.flip(); out.write(buffer); // buffer.free(); LOGGER.info("--ByteEnCoder:isServer-" + isServer + " Hex:" + ByteStringHex.bytes2HexStr(bytesOut)); } public void dispose(IoSession session) throws Exception { // nothing to dispose } }
[ "tanghai@paxsz.com" ]
tanghai@paxsz.com
81a46a5db63b04b04e42f8e5b079fb1ff739c2e6
b6ce7d6fd23aa20f6c30bafc0f376583b71d9cc6
/LeetCode/Problem_785_Is_Graph_Bi_Partite.java
3900f107d6f95e82f5a880582d69542e49446f15
[]
no_license
Chiranjivee/ds-algo-practice-cj
d6b62b8c63aea1767ed40cd90870596e80314323
f72f6b0a69e6b03481c2439ef7a72879ad7d925d
refs/heads/develop
2023-02-08T17:37:21.828035
2020-12-30T09:03:06
2020-12-30T09:03:06
142,831,230
10
5
null
2020-12-04T06:12:22
2018-07-30T05:57:43
Java
UTF-8
Java
false
false
812
java
class Solution { public boolean isBipartite(int[][] graph) { int n = graph.length; int[] colors = new int[n]; for (int i = 0; i < n; i++) { //This graph might be a disconnected graph. So check each unvisited node. if (colors[i] == 0 && !validColor(graph, colors, 1, i)) { return false; } } return true; } public boolean validColor(int[][] graph, int[] colors, int color, int node) { if (colors[node] != 0) { return colors[node] == color; } colors[node] = color; for (int next : graph[node]) { if (!validColor(graph, colors, -color, next)) { return false; } } return true; } }
[ "cjthehacker7@gmail.com" ]
cjthehacker7@gmail.com
491028e2aae31c2e5cdbe1f8529506909ec78220
705879dc61c41198fb2c4f4f6328bba190c8a465
/src/main/java/org/virtualbox/IMediumCreateDiffStorageResponse.java
1f23d87f3f6fdfb2ce3e9913c331455687e4e0dc
[]
no_license
abiquo/hypervisor-mock
dcd1d6c8a2fdbc4db01c7a6e9a64edd101e8ed42
e49e4ca84930415eca72ab6c73140a0f2eea4bbe
refs/heads/master
2021-01-19T09:40:57.840712
2013-08-23T08:54:17
2013-08-23T08:54:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,511
java
package org.virtualbox; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="returnval" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "returnval" }) @XmlRootElement(name = "IMedium_createDiffStorageResponse") public class IMediumCreateDiffStorageResponse { @XmlElement(required = true) protected String returnval; /** * Gets the value of the returnval property. * * @return * possible object is * {@link String } * */ public String getReturnval() { return returnval; } /** * Sets the value of the returnval property. * * @param value * allowed object is * {@link String } * */ public void setReturnval(String value) { this.returnval = value; } }
[ "serafin.sedano@abiquo.com" ]
serafin.sedano@abiquo.com
2f0e84a51483c6438bd39b81504d4fe314db58d9
ec98872943c0a6a791668d6dc432ae7937905673
/android/src/com/android/tools/idea/lint/AndroidLintDeprecatedInspection.java
71a9fae7741140b43931587bc163114d00a20577
[]
no_license
zjw-swun/android
cabd8c172346467494af4fba4c17062161570ded
3761afcc07ebbd4f86c1e7469c2c828f8b0eab5f
refs/heads/master
2020-05-15T22:09:43.221694
2019-04-18T21:58:51
2019-04-18T22:01:08
182,518,753
1
0
null
2019-04-21T10:19:22
2019-04-21T10:19:21
null
UTF-8
Java
false
false
1,534
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.tools.idea.lint; import com.android.tools.lint.checks.DeprecationDetector; import com.intellij.psi.PsiElement; import org.jetbrains.android.inspections.lint.AndroidLintInspectionBase; import org.jetbrains.android.inspections.lint.AndroidLintQuickFix; import org.jetbrains.android.inspections.lint.RemoveAttributeQuickFix; import org.jetbrains.android.util.AndroidBundle; import org.jetbrains.annotations.NotNull; public class AndroidLintDeprecatedInspection extends AndroidLintInspectionBase { public AndroidLintDeprecatedInspection() { super(AndroidBundle.message("android.lint.inspections.deprecated"), DeprecationDetector.ISSUE); } @NotNull @Override public AndroidLintQuickFix[] getQuickFixes(@NotNull PsiElement startElement, @NotNull PsiElement endElement, @NotNull String message) { return new AndroidLintQuickFix[]{ new RemoveAttributeQuickFix() }; } }
[ "tnorbye@google.com" ]
tnorbye@google.com
bbcd9505281c8111ae306c6e044a9096feef6a20
778076d45ff43933cc792c9d68c1739799822572
/impl/src/main/java/org/jboss/seam/servlet/ImplicitServletObjectsProducer.java
e60fd40b4fde9dda6826dbb94d85828d9e98a721
[]
no_license
LightGuard/servlet
d8a8e1ebecb8df55d9dcca11ee04fd8296117435
02c851cdea1d129b94983c3817cbd798473db233
refs/heads/master
2020-12-25T11:41:33.140543
2011-03-05T23:43:14
2011-03-05T23:43:14
1,403,304
0
1
null
null
null
null
UTF-8
Java
false
false
2,194
java
/* * JBoss, Home of Professional Open Source * Copyright 2010, Red Hat Middleware LLC, and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jboss.seam.servlet; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.context.RequestScoped; import javax.enterprise.inject.Produces; import javax.inject.Inject; import javax.servlet.ServletContext; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import org.jboss.seam.servlet.event.ImplicitServletObjectsHolder; /** * Produces an application-scoped {@link ServletContext} bean. * A references is obtained from the {@link ImplicitServletObjectsHolder}. * * @author <a href="http://community.jboss.org/people/dan.j.allen">Dan Allen</a> */ public class ImplicitServletObjectsProducer { @Inject private ImplicitServletObjectsHolder holder; @Produces @ApplicationScoped protected ServletContext getServletContext() { return holder.getServletContext(); } @Produces @RequestScoped protected ServletRequestContext getServletRequestContext() { return holder.getServletRequestContext(); } @Produces @RequestScoped protected ServletRequest getServletRequest() { return holder.getServletRequest(); } @Produces @RequestScoped protected ServletResponse getServletResponse() { return holder.getServletResponse(); } @Produces @ServerInfo protected String getServerInfo() { return getServletContext().getServerInfo(); } }
[ "dan.j.allen@gmail.com" ]
dan.j.allen@gmail.com
483100d346b7c674591331283f50edf8e3ea4caa
0b577b923c9e46cf072cd3d54e8af7f084c57f10
/Gloria/WarehouseDomain/src/main/java/com/volvo/gloria/warehouse/util/InitDataWarehouse.java
19d543441c51103148c230183e4c1fc558a5602f
[]
no_license
perlovdinger/gloria1
b0a9ea0e391f78f871b058a07ff8c3219ea7978f
b6a220f3c712a29289fe42be3736796a7b7a4065
refs/heads/master
2020-12-25T21:12:55.874655
2016-09-18T09:11:30
2016-09-18T09:11:30
68,508,862
1
1
null
null
null
null
UTF-8
Java
false
false
2,101
java
/* * Copyright 2009 Volvo Information Technology AB * * Licensed under the Volvo IT Corporate Source License (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://java.volvo.com/licenses/CORPORATE-SOURCE-LICENSE * * 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.volvo.gloria.warehouse.util; import java.io.IOException; import javax.xml.bind.JAXBException; import com.volvo.gloria.util.IOUtil; import com.volvo.gloria.warehouse.b.WarehouseServices; import com.volvo.jvs.runtime.servicesupport.ServiceLocator; /** * Loads initial data for Warehouse entities from XML file. */ public final class InitDataWarehouse { private static final String XML = "xml"; private static final String WAREHOUSE_PATH = "/data/base/Warehouse/"; private InitDataWarehouse() { } public static void initWarehouses(String env,String filePath,boolean rollout) throws JAXBException, IOException { String[] xmlFiles = null; if (filePath == null) { filePath = WAREHOUSE_PATH; } WarehouseServices warehouseService = ServiceLocator.getService(WarehouseServices.class); try { xmlFiles = IOUtil.loadFileContentsFromClasspath(filePath, XML, env); if (xmlFiles.length == 0) { xmlFiles = IOUtil.loadFileContentsFromClasspath(filePath, XML, "initDB/_global"); } } catch (IOException e) { xmlFiles = IOUtil.loadFileContentsFromClasspath(filePath, XML, "initDB/_global"); } //Ugly i know if (rollout) { env = null; } for (String aFileContent : xmlFiles) { warehouseService.createWarehouseData(aFileContent, env); } } }
[ "per.lovdinger@volvo.com" ]
per.lovdinger@volvo.com
e684033434c335799a0bb5ae1b5067c8c771f6d3
3afffe392113b7faf46a7703aec0ca098d8f99e5
/wx-app-boss/src/main/java/com/phone/erp/boss/service/sales/impl/GrossProfitServiceImpl.java
bee35dd22e49ce1f10180904ec07acad97e0d855
[]
no_license
disvenk/wx-app
9d49ea040098f101890723db0d59a081ea128f59
728982c8e76cb9d4fada92084905834f7a38770c
refs/heads/master
2023-08-10T07:39:17.816203
2019-10-22T06:57:27
2019-10-22T06:57:27
216,744,215
0
0
null
2023-07-22T19:27:15
2019-10-22T06:56:39
Java
UTF-8
Java
false
false
5,800
java
package com.phone.erp.boss.service.sales.impl; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.phone.erp.boss.mapper.sales.GrossProfitMapper; import com.phone.erp.boss.service.impl.ReportBaseServiceImpl; import com.phone.erp.boss.service.sales.GrossProfitService; import com.phone.erp.boss.vo.sales.GrossProfitVo; /** * [毛利战报服务实现类] * @author HMJ * @version [版本,2018-7-18] * @see */ @Service @Transactional public class GrossProfitServiceImpl extends ReportBaseServiceImpl<GrossProfitVo, GrossProfitMapper> implements GrossProfitService { @Autowired GrossProfitMapper grossProfitMapper; //Autowired不能缺少,强制将子类的mapper传到ReportBaseMapper中使用 @Autowired public void setBaseMapper(GrossProfitMapper grossProfitMapper){ super.setMapper(grossProfitMapper); } /* @Autowired BossCommonService bossCommonService; *//** * [获取毛利战报主页分页集合] * @author HMJ * @version [版本,2018-7-18] * @throws Exception *//* @Override public Result getGrossProfitData(BossQueryVo queryVo) throws Exception { Result result = new Result(); String descStr = "获取毛利战报主页分页集合"; //第一步验证访问权限和查看成本价权限 bossCommonService.authValidate(queryVo, result); //第二步加工查询参数 Map<String, Object> map = bossCommonService.getParamMap(queryVo); //增加特殊参数进入map,根据特殊查询条件而定 //第三步设置分页参数 PageHelper.startPage(queryVo.getPage(), queryVo.getPageSize()); try { Page<GrossProfitVo> pageInfo = grossProfitMapper.getGrossProfitData(map); GrossProfitVo totalVo = grossProfitMapper.getGrossProfitTotalVo(map); result.put("totalVo", totalVo); result.put("dataList",pageInfo.getResult()); result.put("canSeeAmount",queryVo.getCanSeeAmount()); } catch (Exception e) { return BossReportUtil.getFailingResult(result, descStr); } return BossReportUtil.getSuccessResult(result, descStr); } *//** * [获取毛利战报主页总计行对象] * @author HMJ * @version [版本,2018-7-18] *//* @Override public Result getGrossProfitTotalVo(BossQueryVo queryVo) throws Exception { Result result = new Result(); String descStr = "获取毛利战报主页总计行对象"; //第一步验证访问权限和查看成本价权限 bossCommonService.authValidate(queryVo, result); //第二步加工查询参数 Map<String, Object> map = bossCommonService.getParamMap(queryVo); try { GrossProfitVo totalVo = grossProfitMapper.getGrossProfitTotalVo(map); result.put("totalVo", totalVo); result.put("canSeeAmount",queryVo.getCanSeeAmount()); } catch (Exception e) { return BossReportUtil.getFailingResult(result, descStr); } return BossReportUtil.getSuccessResult(result, descStr); } *//** * [获取毛利战报详情页分页集合] * @author HMJ * @version [版本,2018-7-18] *//* @Override public Result getGrossProfitDetailData(BossQueryVo queryVo, String nodeName, Long nodeId) throws Exception { String descStr = "获取毛利战报详情页分页集合"; Result result = new Result(); //第一步验证访问权限和查看成本价权限 bossCommonService.authValidate(queryVo, result); //第二步加工查询参数 Map<String, Object> map = bossCommonService.getParamMap(queryVo); //根据不同的nodeId和nodeName加工不同的查询参数 String groupField = queryVo.getGroupField(); if ("goodsName".equals(groupField)) { map.put("goodsId", nodeId); } else if ("goodsBrandName".equals(groupField)) { map.put("goodsBrandId", nodeId); } else if ("sectionName".equals(groupField)) { map.put("sectionIds", nodeId); } else if ("salesManName".equals(groupField)) { map.put("salesManId", nodeId); }else{ map.put("goodsClassId", nodeId); } //第三步设置分页参数 PageHelper.startPage(queryVo.getPage(), queryVo.getPageSize()); try { Page<GrossProfitVo> pageInfo = grossProfitMapper.getGrossProfitDetailData(map); result.put("dataList",pageInfo.getResult()); result.put("canSeeAmount",queryVo.getCanSeeAmount()); } catch (Exception e) { return BossReportUtil.getFailingResult(result, descStr); } return BossReportUtil.getSuccessResult(result, descStr); } *//** * [获取毛利战报详情页总计行对象] * @author HMJ * @version [版本,2018-7-18] *//* @Override public Result getGrossProfitDetailTotalVo(BossQueryVo queryVo, String nodeName, Long nodeId) throws Exception { String descStr = "获取毛利战报详情页总计行对象"; Result result = new Result(); //第一步验证访问权限和查看成本价权限 bossCommonService.authValidate(queryVo, result); //第二步加工查询参数 Map<String, Object> map = bossCommonService.getParamMap(queryVo); //根据不同的nodeId和nodeName加工不同的查询参数 String groupField = queryVo.getGroupField(); if ("goodsName".equals(groupField)) { map.put("goodsId", nodeId); } else if ("goodsBrandName".equals(groupField)) { map.put("goodsBrandId", nodeId); } else if ("sectionName".equals(groupField)) { map.put("sectionIds", nodeId); } else if ("salesManName".equals(groupField)) { map.put("salesManId", nodeId); }else{ map.put("goodsClassId", nodeId); } try { GrossProfitVo totalVo = grossProfitMapper.getGrossProfitDetailTotalVo(map); result.put("totalVo", totalVo); result.put("canSeeAmount",queryVo.getCanSeeAmount()); } catch (Exception e) { return BossReportUtil.getFailingResult(result, descStr); } return BossReportUtil.getSuccessResult(result, descStr); } */ }
[ "disvenk@163.com" ]
disvenk@163.com
7b84bfa6ac496e036ae3ebfcd7ffda6c06c2ff52
0c22ce874c2d2d958248591c21adf23f07e0994e
/spring-integration-core/src/main/java/org/springframework/integration/leader/event/AbstractLeaderEvent.java
89b4a3f0dcc238d92fa4a99aee7a1d2ab73bc0ad
[]
no_license
sterlp/spring-integration
5da5b78722c0748ebed19cf48aa8bdb44124b360
c2954881ad59c1fc2926e37a581cb4ed5949d53d
refs/heads/master
2021-01-24T21:19:55.982983
2016-03-17T17:10:05
2016-03-17T17:10:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,129
java
/* * Copyright 2015-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by 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.integration.leader.event; import org.springframework.context.ApplicationEvent; import org.springframework.integration.leader.Context; /** * Base {@link ApplicationEvent} class for leader based events. All custom event * classes should be derived from this class. * * @author Janne Valkealahti * @author Gary Russell * */ @SuppressWarnings("serial") public abstract class AbstractLeaderEvent extends ApplicationEvent { private final Context context; private final String role; /** * Create a new ApplicationEvent. * * @param source the component that published the event (never {@code null}) */ public AbstractLeaderEvent(Object source) { this(source, null, null); } /** * Create a new ApplicationEvent. * * @param source the component that published the event (never {@code null}) * @param context the context associated with this event * @param role the role of the leader */ public AbstractLeaderEvent(Object source, Context context, String role) { super(source); this.context = context; this.role = role; } /** * Get the {@link Context} associated with this event. * * @return the context */ public Context getContext() { return context; } /** * Get the role of the leader. * * @return the role */ public String getRole() { return role; } @Override public String toString() { return getClass().getSimpleName() + " [role=" + role + ", context=" + context + ", source=" + source + "]"; } }
[ "abilan@pivotal.io" ]
abilan@pivotal.io
b674e7967b0ada43818169492ec633559cfe3713
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.bugreporter-OculusBugReporter/sources/sun/misc/FloatConsts.java
8953d741424ee29674efe95bfdb98f870655dbcc
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
878
java
package sun.misc; public class FloatConsts { public static final int EXP_BIAS = 127; public static final int EXP_BIT_MASK = 2139095040; public static final int MAX_EXPONENT = 127; public static final float MAX_VALUE = Float.MAX_VALUE; public static final int MIN_EXPONENT = -126; public static final float MIN_NORMAL = Float.MIN_NORMAL; public static final int MIN_SUB_EXPONENT = -149; public static final float MIN_VALUE = Float.MIN_VALUE; public static final float NEGATIVE_INFINITY = Float.NEGATIVE_INFINITY; public static final float NaN = Float.NaN; public static final float POSITIVE_INFINITY = Float.POSITIVE_INFINITY; public static final int SIGNIFICAND_WIDTH = 24; public static final int SIGNIF_BIT_MASK = 8388607; public static final int SIGN_BIT_MASK = Integer.MIN_VALUE; private FloatConsts() { } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
34e3bd5cac827603be157f4d16b6fd93c37abd26
14b23b02386063c8c161620fe4c750c971958e9c
/p2p-common-util/src/main/java/com/icebreak/p2p/util/AppConstantsUtil.java
d4dcbe9a9c19dd49a4409bda33b4c8e76e2dec6b
[]
no_license
RalphSu/789
d6d60fa0ae6131871d2cd4782c547cc76f1e08f6
1a066f6d0429e8490df03e4e11063533cbcaa217
refs/heads/master
2021-01-24T04:55:32.398049
2016-03-13T09:28:41
2016-03-13T09:28:41
52,210,852
0
0
null
2016-02-21T14:40:36
2016-02-21T14:40:36
null
UTF-8
Java
false
false
5,079
java
package com.icebreak.p2p.util; public class AppConstantsUtil { private static SystemConfig staticConfig; public synchronized static void init(SystemConfig config) { if (staticConfig == null) { staticConfig = config; } } public synchronized static void clear() { staticConfig = null; } public static String getYrdPrefixion() { return staticConfig.getYrdPrefixion(); } public static String getPlatformName() { return staticConfig.getPlatformName(); } public static String getProductName() { return staticConfig.getProductName(); } public static String getOutBizNumber() { return staticConfig.getOutBizNumber(); } /** * ICP备案号 * @return */ public static String getProductICP() { return staticConfig.getProductICP(); } /** * 通用参数 * @return */ public static String getAllCommon(){ return staticConfig.getAllCommon(); } /** * QQ * @return */ public static String getProductQQ(){ return staticConfig.getProductQQ(); } /** * 默认经纪人编号 * @return */ public static String getDeafaultBrokerNO() { return staticConfig.getDeafaultBrokerNO(); } /** * 接收融资请求邮箱地址 * @return */ public static String getLoanRequestMail() { return staticConfig.getLoanRequestMail(); } /** * 上传文件服器路径 * @return */ public static String getYrdUploadFolder() { return staticConfig.getYrdUploadFolder(); } /** * fop 字体库配置文件(userconfig.xml)路径 * @return */ public static String getYrdFopFontFolder() { return staticConfig.getYrdFopFontFolder(); } /** * 图片服务器url * @return */ public static String getImageServerUrl() { return staticConfig.getImageServerUrl(); } /** * 的客服电话座机 * @return */ public static String getCustomerServicePhone() { return staticConfig.getCustomerServicePhone(); } /** * 的客服手机 * @return */ public static String getCustomerServiceMobile() { return staticConfig.getCustomerServiceMobile(); } /** * 客服邮箱 * @return */ public static String getCustomerServiceEmail() { return staticConfig.getCustomerServiceEmail(); } /** * 有转账权限的特殊用户 * @return */ public static String getYrdTransferLimit() { return staticConfig.getYrdTransferLimit(); } /** * host配置 * @return */ public static String getHostUrl() { return staticConfig.getYrdTransferLimit(); } /** * 中间结算账户 * @return */ public static String getExchangeAccount() { return staticConfig.getExchangeAccount(); } /** * 分润账户 * @return */ public static String getProfitSharingAccount() { return staticConfig.getProfitSharingAccount(); } /** * 收费产品编码 * @return */ public static String getTradeBizProductCode() { return staticConfig.getTradeBizProductCode(); } /** * 获取当前应用的url * @return */ public static String getHostHttpUrl() { return staticConfig.getHostHttpUrl(); } /** * 默认经济人账户用户名 * @return */ public static String getDefaultBrokerUserName() { return staticConfig.getDefaultBrokerUserName(); } /** * 提现收费code * @return */ public static String getWithdrawChargeCode() { return staticConfig.getWithdrawChargeCode(); } /** * 网银收费code * @return */ public static String getBankB2CChargeCode() { return staticConfig.getBankB2CChargeCode(); } /** * 公司地址 * @return */ public static String getPlatformAddress() { return staticConfig.getPlatformAddress(); } public static String getYrdCustomerServiceEmail() { return staticConfig.getCustomerServiceEmail(); } /** * 邮件发送服务器配置 * @return */ public static String getMailServer() { return staticConfig.mailServer; } /** * 邮件发送服务器配置 * @return */ public static String getMailServerport() { return staticConfig.mailServerport; } /** * 邮件发送服务器配置 * @return */ public static String getMailUserName() { return staticConfig.mailUsername; } /** * 邮件发送服务器配置 * @return */ public static String getMailPassword() { return staticConfig.mailPassword; } /** * 邮件发送服务器配置 * @return */ public static String getMailNickName() { return staticConfig.mailNickName; } /** * 邮件发送服务器配置 * @return */ public static String getMailSenderName() { return staticConfig.mailSenderName; } /** * 当前p2p行业特性 * @return */ public static String getCurrentIndustry() { return staticConfig.currentIndustry; } public static boolean getBrokerIsNumber() { return StringUtil.equals("Y", staticConfig.brokerIsNumbered); } public static String getTaskTimerIp(){ return staticConfig.getTaskTimerIp(); } /*** * 项目默认缩略图 * @return */ public static String getProjectDefaultThumbnailUrl(){ return staticConfig.getProjectDefaultThumbnailUrl(); } }
[ "windofdusk@gmail.com" ]
windofdusk@gmail.com
676ac4c5a49ea8f0f36ee46d9424038f245cc6f3
177f338c9d9905b2ededbd4abd8aefebd7c105ba
/src/main/java/chapter2/t16_StringAndSyn/Service.java
ab90ac2f740e6c4cf71e8bd4d35b8a38f90f9e00
[]
no_license
1000-7/thread
a1c515e0f93333dbb9a215f2f1a74fabe8663242
2881aacfe7d17991b7b81e71156758171a289510
refs/heads/master
2020-03-29T13:46:59.181264
2019-01-30T09:46:00
2019-01-30T09:46:00
149,981,896
0
0
null
null
null
null
UTF-8
Java
false
false
546
java
package chapter2.t16_StringAndSyn; /** * 因为ThreadB的参数和ThreadA的参数一致,Service对象根本不觉得有另一对象去竞争锁 * 直接就是第一个拿到锁的人一直在用 * 所以一般都不会String作为锁对象 */ public class Service { public static void print(String stringParam) { try { synchronized (stringParam) { while (true) { System.out.println(Thread.currentThread().getName()); Thread.sleep(1000); } } } catch (InterruptedException e) { e.printStackTrace(); } } }
[ "1256656057@qq.com" ]
1256656057@qq.com
1c81bb2c3d880d0233e45b89d46c8706500ca2ab
ca0e9689023cc9998c7f24b9e0532261fd976e0e
/src/com/tencent/mm/n/g$1.java
98a028e8bb7f3b3a252dedb8ec0c00d0972a131f
[]
no_license
honeyflyfish/com.tencent.mm
c7e992f51070f6ac5e9c05e9a2babd7b712cf713
ce6e605ff98164359a7073ab9a62a3f3101b8c34
refs/heads/master
2020-03-28T15:42:52.284117
2016-07-19T16:33:30
2016-07-19T16:33:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
500
java
package com.tencent.mm.n; import com.tencent.mm.sdk.platformtools.v; import com.tencent.mm.t.d; import com.tencent.mm.t.j; final class g$1 implements Runnable { g$1(g paramg) {} public final void run() { v.i("MicroMsg.NetSceneGetFuncMsg", "do retry"); if (bkW.a(bkW.byD, bkW.bkT) == -1) { bkW.bkT.onSceneEnd(3, -1, "doScene failed", bkW); } } } /* Location: * Qualified Name: com.tencent.mm.n.g.1 * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
89b23864f1fde0d9d779b89da0f6e1ae4b5e9a34
74f723bee36229fa9d447e63d99c70d2a62dc193
/roncoo-education-system/roncoo-education-system-common/src/main/java/com/roncoo/education/system/common/interfaces/BossWebsite.java
0b97049f9b9371307b175b26df72ac524ccdacca
[ "MIT" ]
permissive
Arronzheng/roncoo-education
714568d864d5098052c44b34d9c4f730fc551af9
1afb481d4269597e1cebc339a8d257caaad9279a
refs/heads/master
2022-09-13T13:45:22.315597
2020-07-29T01:52:22
2020-07-29T01:52:22
220,367,025
1
0
MIT
2022-09-01T23:15:24
2019-11-08T02:05:26
Java
UTF-8
Java
false
false
1,366
java
package com.roncoo.education.system.common.interfaces; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.roncoo.education.system.common.bean.qo.WebsiteQO; import com.roncoo.education.system.common.bean.vo.WebsiteVO; import com.roncoo.education.util.base.Page; /** * 站点信息 * * */ public interface BossWebsite { @RequestMapping(value = "/boss/system/website/listForPage", method = RequestMethod.POST) Page<WebsiteVO> listForPage(@RequestBody WebsiteQO qo); @RequestMapping(value = "/boss/system/website/save", method = RequestMethod.POST) int save(@RequestBody WebsiteQO qo); @RequestMapping(value = "/boss/system/website/deleteById", method = RequestMethod.DELETE) int deleteById(@RequestBody Long id); @RequestMapping(value = "/boss/system/website/updateById", method = RequestMethod.PUT) int updateById(@RequestBody WebsiteQO qo); @RequestMapping(value = "/boss/system/website/get/{id}", method = RequestMethod.GET) WebsiteVO getById(@PathVariable(value = "id") Long id); /** * 获取站点信息 * * */ @RequestMapping(value = "/boss/system/website/getWebsite", method = RequestMethod.GET) WebsiteVO getWebsite(); }
[ "1175674846@qq.com" ]
1175674846@qq.com
472d13446cedbe9a9ce8ebe44d522c694734b58c
4c1bccea55a705d68291a91e2b179c0fbd54a213
/src/main/java/com/be4tech/sura12/service/mapper/UserMapper.java
8e75252d0698935000d94d99d08c147b92ac4977
[]
no_license
eter98/Sura12
acff712ef170535fc5ae04576c5b29ab2208044f
3d4a678cbf60c35671a902ac3a7d699d1c2984e4
refs/heads/main
2023-07-15T10:49:09.324566
2021-08-30T21:52:28
2021-08-30T21:52:28
401,495,705
0
0
null
null
null
null
UTF-8
Java
false
false
4,638
java
package com.be4tech.sura12.service.mapper; import com.be4tech.sura12.domain.Authority; import com.be4tech.sura12.domain.User; import com.be4tech.sura12.service.dto.AdminUserDTO; import com.be4tech.sura12.service.dto.UserDTO; import java.util.*; import java.util.stream.Collectors; import org.mapstruct.BeanMapping; import org.mapstruct.Mapping; import org.mapstruct.Named; import org.springframework.stereotype.Service; /** * Mapper for the entity {@link User} and its DTO called {@link UserDTO}. * * Normal mappers are generated using MapStruct, this one is hand-coded as MapStruct * support is still in beta, and requires a manual step with an IDE. */ @Service public class UserMapper { public List<UserDTO> usersToUserDTOs(List<User> users) { return users.stream().filter(Objects::nonNull).map(this::userToUserDTO).collect(Collectors.toList()); } public UserDTO userToUserDTO(User user) { return new UserDTO(user); } public List<AdminUserDTO> usersToAdminUserDTOs(List<User> users) { return users.stream().filter(Objects::nonNull).map(this::userToAdminUserDTO).collect(Collectors.toList()); } public AdminUserDTO userToAdminUserDTO(User user) { return new AdminUserDTO(user); } public List<User> userDTOsToUsers(List<AdminUserDTO> userDTOs) { return userDTOs.stream().filter(Objects::nonNull).map(this::userDTOToUser).collect(Collectors.toList()); } public User userDTOToUser(AdminUserDTO userDTO) { if (userDTO == null) { return null; } else { User user = new User(); user.setId(userDTO.getId()); user.setLogin(userDTO.getLogin()); user.setFirstName(userDTO.getFirstName()); user.setLastName(userDTO.getLastName()); user.setEmail(userDTO.getEmail()); user.setImageUrl(userDTO.getImageUrl()); user.setActivated(userDTO.isActivated()); user.setLangKey(userDTO.getLangKey()); Set<Authority> authorities = this.authoritiesFromStrings(userDTO.getAuthorities()); user.setAuthorities(authorities); return user; } } private Set<Authority> authoritiesFromStrings(Set<String> authoritiesAsString) { Set<Authority> authorities = new HashSet<>(); if (authoritiesAsString != null) { authorities = authoritiesAsString .stream() .map( string -> { Authority auth = new Authority(); auth.setName(string); return auth; } ) .collect(Collectors.toSet()); } return authorities; } public User userFromId(Long id) { if (id == null) { return null; } User user = new User(); user.setId(id); return user; } @Named("id") @BeanMapping(ignoreByDefault = true) @Mapping(target = "id", source = "id") public UserDTO toDtoId(User user) { if (user == null) { return null; } UserDTO userDto = new UserDTO(); userDto.setId(user.getId()); return userDto; } @Named("idSet") @BeanMapping(ignoreByDefault = true) @Mapping(target = "id", source = "id") public Set<UserDTO> toDtoIdSet(Set<User> users) { if (users == null) { return Collections.emptySet(); } Set<UserDTO> userSet = new HashSet<>(); for (User userEntity : users) { userSet.add(this.toDtoId(userEntity)); } return userSet; } @Named("login") @BeanMapping(ignoreByDefault = true) @Mapping(target = "id", source = "id") @Mapping(target = "login", source = "login") public UserDTO toDtoLogin(User user) { if (user == null) { return null; } UserDTO userDto = new UserDTO(); userDto.setId(user.getId()); userDto.setLogin(user.getLogin()); return userDto; } @Named("loginSet") @BeanMapping(ignoreByDefault = true) @Mapping(target = "id", source = "id") @Mapping(target = "login", source = "login") public Set<UserDTO> toDtoLoginSet(Set<User> users) { if (users == null) { return Collections.emptySet(); } Set<UserDTO> userSet = new HashSet<>(); for (User userEntity : users) { userSet.add(this.toDtoLogin(userEntity)); } return userSet; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
de4ce6a2eafd40f4643f9f53f6516443ffce87c3
dac87fb3394ef89d6b737e1f4264800023556aac
/scribble-core/src/main/java/org/scribble/ast/NonRoleArg.java
5c047edb663c7badc4f3352ad3628a83e43baa60
[ "Apache-2.0" ]
permissive
objectiser/scribble-java
b0d844234d2b0caf4e0841b6548407257d3167b1
88d2ce8529f01f33630a4208ace0f61776b178a9
refs/heads/master
2021-01-18T10:34:29.266471
2017-06-29T15:23:38
2017-06-29T15:23:38
1,631,075
0
0
null
null
null
null
UTF-8
Java
false
false
1,571
java
/** * Copyright 2008 The Scribble 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.scribble.ast; import org.antlr.runtime.tree.CommonTree; import org.scribble.del.ScribDel; import org.scribble.sesstype.name.Role; public class NonRoleArg extends DoArg<NonRoleArgNode> { public NonRoleArg(CommonTree source, NonRoleArgNode arg) { super(source, arg); } @Override protected ScribNodeBase copy() { return new NonRoleArg(this.source, getVal()); } @Override public NonRoleArg clone(AstFactory af) { NonRoleArgNode arg = (NonRoleArgNode) getVal().clone(af); return af.NonRoleArg(this.source, arg); } @Override public NonRoleArg reconstruct(NonRoleArgNode arg) { ScribDel del = del(); NonRoleArg ai = new NonRoleArg(this.source, arg); ai = (NonRoleArg) ai.del(del); return ai; } @Override public NonRoleArgNode getVal() { return (NonRoleArgNode) super.getVal(); } @Override public NonRoleArg project(AstFactory af, Role self) { return af.NonRoleArg(this.source, getVal()); // arg needs projection? } }
[ "raymond.hu@imperial.ac.uk" ]
raymond.hu@imperial.ac.uk
a2602aa71423cd6c0fbca3822c8a47520d0f4ebd
1c60d4254ef66be013bfaa555969934a5f47c5fd
/TopolevVladimir/src/main/java/by/topolev/contacts/services/ContactServiceImpl.java
ab849710638cc9b06fed0789e9eddde6721aed2e
[]
no_license
Topolev/ContactsDirectory
c6dc03dc5fd6ee64cc78af8dde8602f34d32e0af
4de6025a60fe5e15e06652242604388b4d73894b
refs/heads/master
2020-09-22T05:46:56.610533
2016-10-10T19:25:29
2016-10-10T19:25:29
67,216,082
0
1
null
2016-10-03T07:55:54
2016-09-02T11:09:34
CSS
UTF-8
Java
false
false
2,387
java
package by.topolev.contacts.services; import by.topolev.contacts.dao.ContactDao; import by.topolev.contacts.dao.ContactDaoFactory; import by.topolev.contacts.entity.Contact; import javax.servlet.ServletException; import java.util.Calendar; import java.util.Date; import java.util.List; import java.util.Map; public class ContactServiceImpl implements ContactService{ private ContactDao contactDao = ContactDaoFactory.getContactDao(); @Override public List<Contact> getContactList() { return contactDao.getContactList(); } public int getCountContacts(){ return contactDao.getCountContacts(); } @Override public Contact getContactById(int id) { return contactDao.getContactById(id); } @Override public List<Contact> getContactById(Integer... idList) { return contactDao.getContactById(idList); } @Override public List<Contact> getLimitContactList(int page, int countRow) { return contactDao.getLimitContactList(page*countRow, countRow); } @Override public List<Contact> getLimitContactList(int page, int countRow, String sortField, String sortType){ return contactDao.getLimitContactList(page*countRow, countRow, sortField, sortType); } @Override public List<Contact> getSearchContact(Map<String, String> valueFields) { return contactDao.getSearchContact(valueFields); } @Override public List<Contact> getSearchContact(Map<String, String> valueFields, int page, int countRow) { return contactDao.getSearchContact(valueFields,page*countRow, countRow); } @Override public int getCountSearchContact(Map<String, String> valueFields){ return contactDao.getCountSearchContact(valueFields); } @Override public void deleteContact(Integer... idList) { contactDao.deleteContacts(idList); } @Override public Integer updateContact(Contact contact, boolean lazyLoad) { return contactDao.updateContact(contact, lazyLoad); } @Override public List<Contact> getContactListWhoTodayCelebrateBirthday() { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); int day = calendar.get(Calendar.DATE); int month = calendar.get(Calendar.MONTH) + 1; StringBuilder query = new StringBuilder(); query.append("SELECT * FROM contact WHERE DAY(birthday) = ").append(day).append(" AND MONTH(birthday) = ").append(month); return contactDao.getContactListAccordingQuery(query.toString(), null); } }
[ "i.topolev.vladimir@gmail.com" ]
i.topolev.vladimir@gmail.com
4996875704220ed84a1a1c330627a2107550b144
c4c321beed135313d811fc350322bf38bddfa82c
/property-app/src/main/java/com/joy/property/DataStatistics/StatisticsApi.java
2038db4edd414ac02fc8bc7a20e8b575c1a95c5d
[]
no_license
hupulin/joyProperty
ebf97ef80d28ec03de0df9bb13afdaf02ea540de
a0336ca57b44a997bde6299f2c2e05deea6a1555
refs/heads/master
2021-09-04T11:35:18.404336
2017-12-27T02:00:23
2017-12-27T02:00:23
113,118,715
0
1
null
null
null
null
UTF-8
Java
false
false
424
java
package com.joy.property.DataStatistics; import com.jinyi.ihome.infrastructure.MessageTo; import retrofit.Callback; import retrofit.http.Body; import retrofit.http.POST; /** * Created by Admin on 2015-03-23 */ public interface StatisticsApi { /** * 上传数据统计 */ @POST("/api/v1/user/OwnerLog") void getStatistics(@Body OwnerLogParam param , Callback<MessageTo<OwnerLogTo> > callback ); }
[ "hpl635768909@gmail.com" ]
hpl635768909@gmail.com
c72d959aa125fd7a634299f6b74cf14afae0a1c8
92defe9a6cfb711df61df190bf8804ef82993742
/engine/src/main/java/com/agiletec/aps/system/common/entity/model/attribute/util/NumberAttributeValidationRules.java
a9af7d7bc44e6da96aedef9a91a7020bbdcb4f9c
[]
no_license
DevBrandon/entando-core
e6ffeddd0d76ff5f3694e96834a313764c20a739
4d1f88b372d4b0ef604fdde2aa929eef3de0e6b2
refs/heads/master
2020-12-26T01:13:58.694861
2014-12-01T17:18:43
2014-12-01T17:18:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,432
java
/* * * Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved. * * This file is part of Entando software. * Entando is a free software; * You can redistribute it and/or modify it * under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; version 2. * * See the file License for the specific language governing permissions * and limitations under the License * * * * Copyright 2013 Entando S.r.l. (http://www.entando.com) All rights reserved. * */ package com.agiletec.aps.system.common.entity.model.attribute.util; import java.util.List; import org.jdom.Element; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.agiletec.aps.system.common.entity.model.AttributeFieldError; import com.agiletec.aps.system.common.entity.model.AttributeTracer; import com.agiletec.aps.system.common.entity.model.FieldError; import com.agiletec.aps.system.common.entity.model.attribute.AttributeInterface; import com.agiletec.aps.system.common.entity.model.attribute.NumberAttribute; import com.agiletec.aps.system.services.lang.ILangManager; /** * @author E.Santoboni */ public class NumberAttributeValidationRules extends AbstractAttributeValidationRules { private static final Logger _logger = LoggerFactory.getLogger(NumberAttributeValidationRules.class); @Override protected void fillJDOMConfigElement(Element configElement) { super.fillJDOMConfigElement(configElement); String toStringEqualValue = (this.getValue() != null) ? String.valueOf(this.getValue()) : null; this.insertJDOMConfigElement("value", this.getValueAttribute(), toStringEqualValue, configElement); String toStringStartValue = (this.getRangeStart() != null) ? String.valueOf(this.getRangeStart()) : null; this.insertJDOMConfigElement("rangestart", this.getRangeStartAttribute(), toStringStartValue, configElement); String toStringEndValue = (this.getRangeEnd() != null) ? String.valueOf(this.getRangeEnd()) : null; this.insertJDOMConfigElement("rangeend", this.getRangeEndAttribute(), toStringEndValue, configElement); } @Override protected void extractValidationRules(Element validationElement) { super.extractValidationRules(validationElement); Element valueElement = validationElement.getChild("value"); if (null != valueElement) { this.setValue(this.getIntegerValue(valueElement.getText())); this.setValueAttribute(valueElement.getAttributeValue("attribute")); } Element rangeStartElement = validationElement.getChild("rangestart"); if (null != rangeStartElement) { this.setRangeStart(this.getIntegerValue(rangeStartElement.getText())); this.setRangeStartAttribute(rangeStartElement.getAttributeValue("attribute")); } Element rangeEndElement = validationElement.getChild("rangeend"); if (null != rangeEndElement) { this.setRangeEnd(this.getIntegerValue(rangeEndElement.getText())); this.setRangeEndAttribute(rangeEndElement.getAttributeValue("attribute")); } } private Integer getIntegerValue(String text) { if (null == text || text.trim().length() == 0) { return null; } Integer valueInteger = null; try { valueInteger = Integer.parseInt(text); } catch (NumberFormatException e) { _logger.error("Error in parsing number '{}' for extracting attribute roles", text, e); //ApsSystemUtils.logThrowable(e, this, "getIntegerValue", "Error in parsing number '" + text + "' for extracting attribute roles"); } return valueInteger; } @Override public List<AttributeFieldError> validate(AttributeInterface attribute, AttributeTracer tracer, ILangManager langManager) { List<AttributeFieldError> errors = super.validate(attribute, tracer, langManager); if (this.isEmpty()) { return errors; } try { NumberAttribute numberAttribute = (NumberAttribute) attribute; if (null == numberAttribute.getValue()) { return errors; } Integer attributeValue = numberAttribute.getValue().intValue(); Integer startValue = (this.getRangeStart() != null) ? (Integer) this.getRangeStart() : this.getOtherAttributeValue(attribute, this.getRangeStartAttribute()); if (null != startValue && attributeValue < startValue) { AttributeFieldError error = new AttributeFieldError(attribute, FieldError.LESS_THAN_ALLOWED, tracer); error.setMessage("Number less than " + startValue); errors.add(error); } Integer endValue = (this.getRangeEnd() != null) ? (Integer) this.getRangeEnd() : this.getOtherAttributeValue(attribute, this.getRangeEndAttribute()); if (null != endValue && attributeValue > endValue) { AttributeFieldError error = new AttributeFieldError(attribute, FieldError.GREATER_THAN_ALLOWED, tracer); error.setMessage("Number greater than " + endValue); errors.add(error); } Integer value = (this.getValue() != null) ? (Integer) this.getValue() : this.getOtherAttributeValue(attribute, this.getValueAttribute()); if (null != value && attributeValue != value) { AttributeFieldError error = new AttributeFieldError(attribute, FieldError.INVALID, tracer); error.setMessage("Number not equals than " + value); errors.add(error); } } catch (Throwable t) { //ApsSystemUtils.logThrowable(t, this, "validate"); _logger.error("Error validating number attribute", t); throw new RuntimeException("Error validating number attribute", t); } return errors; } private Integer getOtherAttributeValue(AttributeInterface attribute, String otherAttributeName) { if (null == otherAttributeName) { return null; } AttributeInterface other = (AttributeInterface) attribute.getParentEntity().getAttribute(otherAttributeName); if (null != other && (other instanceof NumberAttribute) && ((NumberAttribute) other).getValue() != null) { return ((NumberAttribute) other).getValue().intValue(); } return null; } }
[ "eugenio.santoboni@gmail.com" ]
eugenio.santoboni@gmail.com
c37588135e6d38ade2659aa876964863272ac9f0
9d971ca2ac3c0e0a6b859bddd0306259c539c6e5
/testng-core-api/src/main/java/org/testng/ITestNGMethod.java
98663322e2def19de3cd5e4f71c4878b8ebe6da1
[ "Apache-2.0" ]
permissive
zferenczik/testng
6817d9472d20265b557c211828988a2f47c36b73
0438740974c4a3d2d4a8884c5c20d8b9398c9d64
refs/heads/master
2022-03-03T20:01:23.337775
2022-02-18T06:52:19
2022-02-18T06:52:19
158,769,589
0
0
Apache-2.0
2018-11-23T02:13:41
2018-11-23T02:13:41
null
UTF-8
Java
false
false
7,381
java
package org.testng; import java.util.List; import java.util.Map; import java.util.concurrent.Callable; import org.testng.annotations.CustomAttribute; import org.testng.internal.ConstructorOrMethod; import org.testng.internal.IParameterInfo; import org.testng.xml.XmlTest; /** * Describes a TestNG annotated method and the instance on which it will be invoked. * * <p>This interface is not meant to be implemented by users. */ public interface ITestNGMethod extends Cloneable { /** * @return The real class on which this method was declared (can be different from * getMethod().getDeclaringClass() if the test method was defined in a superclass). */ Class getRealClass(); ITestClass getTestClass(); /** * Sets the test class having this method. This is not necessarily the declaring class. * * @param cls The test class having this method. */ void setTestClass(ITestClass cls); /** * Returns the method name. This is needed for serialization because methods are not Serializable. * * @return the method name. */ String getMethodName(); Object getInstance(); /** * Needed for serialization. * * @return The hashcode of instances */ long[] getInstanceHashCodes(); /** * @return The groups this method belongs to, possibly added to the groups declared on the class. */ String[] getGroups(); /** * @return The groups this method depends on, possibly added to the groups declared on the class. */ String[] getGroupsDependedUpon(); /** @return If a group was not found. */ String getMissingGroup(); void setMissingGroup(String group); String[] getBeforeGroups(); String[] getAfterGroups(); /** * @return The methods this method depends on, possibly added to the methods declared on the * class. */ String[] getMethodsDependedUpon(); void addMethodDependedUpon(String methodName); /** @return true if this method was annotated with @Test */ boolean isTest(); /** @return true if this method was annotated with @Configuration and beforeTestMethod = true */ boolean isBeforeMethodConfiguration(); /** @return true if this method was annotated with @Configuration and beforeTestMethod = false */ boolean isAfterMethodConfiguration(); /** @return true if this method was annotated with @Configuration and beforeClassMethod = true */ boolean isBeforeClassConfiguration(); /** @return true if this method was annotated with @Configuration and beforeClassMethod = false */ boolean isAfterClassConfiguration(); /** @return true if this method was annotated with @Configuration and beforeSuite = true */ boolean isBeforeSuiteConfiguration(); /** @return true if this method was annotated with @Configuration and afterSuite = true */ boolean isAfterSuiteConfiguration(); /** @return <code>true</code> if this method is a @BeforeTest (@Configuration beforeTest=true) */ boolean isBeforeTestConfiguration(); /** @return <code>true</code> if this method is an @AfterTest (@Configuration afterTest=true) */ boolean isAfterTestConfiguration(); boolean isBeforeGroupsConfiguration(); boolean isAfterGroupsConfiguration(); default boolean hasBeforeGroupsConfiguration() { return false; } default boolean hasAfterGroupsConfiguration() { return false; } /** @return The timeout in milliseconds. */ long getTimeOut(); void setTimeOut(long timeOut); /** @return the number of times this method needs to be invoked. */ int getInvocationCount(); void setInvocationCount(int count); /** @return the success percentage for this method (between 0 and 100). */ int getSuccessPercentage(); /** @return The id of the thread this method was run in. */ String getId(); void setId(String id); long getDate(); void setDate(long date); /** * @param testClass The test class * @return true if this ITestNGMethod can be invoked from within IClass. */ boolean canRunFromClass(IClass testClass); /** @return true if this method is alwaysRun=true */ boolean isAlwaysRun(); /** @return the number of threads to be used when invoking the method on parallel */ int getThreadPoolSize(); void setThreadPoolSize(int threadPoolSize); boolean getEnabled(); String getDescription(); void setDescription(String description); void incrementCurrentInvocationCount(); int getCurrentInvocationCount(); void setParameterInvocationCount(int n); int getParameterInvocationCount(); void setMoreInvocationChecker(Callable<Boolean> moreInvocationChecker); boolean hasMoreInvocation(); ITestNGMethod clone(); IRetryAnalyzer getRetryAnalyzer(ITestResult result); void setRetryAnalyzerClass(Class<? extends IRetryAnalyzer> clazz); Class<? extends IRetryAnalyzer> getRetryAnalyzerClass(); boolean skipFailedInvocations(); void setSkipFailedInvocations(boolean skip); /** @return The time under which all invocationCount methods need to complete by. */ long getInvocationTimeOut(); boolean ignoreMissingDependencies(); void setIgnoreMissingDependencies(boolean ignore); /** * Which invocation numbers of this method should be used (only applicable if it uses a data * provider). If this value is an empty list, use all the values returned from the data provider. * These values are read from the XML file in the <code>&lt;include invocationNumbers="..."&gt; * </code> tag. * * @return The list of invocation numbers */ List<Integer> getInvocationNumbers(); void setInvocationNumbers(List<Integer> numbers); /** * The list of invocation numbers that failed, which is only applicable for methods that have a * data provider. * * @param number The invocation number that failed */ void addFailedInvocationNumber(int number); List<Integer> getFailedInvocationNumbers(); /** * The scheduling priority. Lower priorities get scheduled first. * * @return The priority value */ int getPriority(); void setPriority(int priority); int getInterceptedPriority(); void setInterceptedPriority(int priority); /** @return the XmlTest this method belongs to. */ XmlTest getXmlTest(); ConstructorOrMethod getConstructorOrMethod(); /** * @param test - The {@link XmlTest} object. * @return the parameters found in the include tag, if any */ Map<String, String> findMethodParameters(XmlTest test); /** * getRealClass().getName() + "." + getMethodName() * * @return qualified name for this method */ String getQualifiedName(); default boolean isDataDriven() { return false; } /** * @return - A {@link IParameterInfo} object that represents details about the parameters * associated with the factory method. */ default IParameterInfo getFactoryMethodParamsInfo() { return null; } /** * @return - An array of {@link CustomAttribute} that represents the custom attributes associated * with a test. */ default CustomAttribute[] getAttributes() { return new CustomAttribute[] {}; } /** * @return - An {@link IDataProviderMethod} for a data provider powered test method and <code>null * </code> otherwise. */ default IDataProviderMethod getDataProviderMethod() { return null; } default Class<?>[] getParameterTypes() { return new Class<?>[] {}; } }
[ "krishnan.mahadevan1978@gmail.com" ]
krishnan.mahadevan1978@gmail.com
f19db8c46d1374e8363d0afedc675ce33dfd2587
6c28eca2c33a275fb0008a51b8e5776a82f5904d
/Code/Hierarchy/src/net/unconventionalthinking/hierarchy/Exception_HierarchyCompiler.java
462fcabdb55d865a99d16c53e26874281cca25ff
[]
no_license
UnconventionalThinking/hierarchy
17dc9e224595f13702b9763829e12fbce2c48cfe
de8590a29c19202c01d1a6e62ca92e91aa9fc6ab
refs/heads/master
2021-01-19T21:28:29.793371
2014-12-19T03:16:24
2014-12-19T03:16:24
13,262,291
0
1
null
null
null
null
UTF-8
Java
false
false
1,067
java
/* Copyright 2012, 2013 Unconventional Thinking * * This file is part of Hierarchy. * * Hierarchy 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. * * Hierarchy 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 Hierarchy. * If not, see <http://www.gnu.org/licenses/>. */ package net.unconventionalthinking.hierarchy; /** * * @author peterjoh */ public class Exception_HierarchyCompiler extends Exception { public Exception_HierarchyCompiler(String errorMsg) { super(errorMsg); } public Exception_HierarchyCompiler(String errorMsg, Throwable cause) { super(errorMsg, cause); } }
[ "github@unconventionalthinking.com" ]
github@unconventionalthinking.com
50a547352964fbb9d3d27554234b535ff62590bc
a4fdad03bcb0d5081def1605f9601be98e0b392e
/src/main/java/za/co/enigma/domain/archetypes/DescriptionDomainArchetype.java
8f5e330a5be51241a3ea2a61732eaa4cdd6ef073
[]
no_license
lucksonk/schools
330f764fb026e58578e605bdad9df87b58f5655a
635d84bf93822b9d26f663c7cf58950d02ec08ea
refs/heads/master
2021-01-20T15:19:08.239970
2017-05-09T14:11:28
2017-05-09T14:11:28
90,751,656
0
0
null
null
null
null
UTF-8
Java
false
false
1,807
java
package za.co.enigma.domain.archetypes; import javax.persistence.Column; import javax.persistence.MappedSuperclass; import lombok.EqualsAndHashCode; /** * * @author luckson * * The Description class archetype that models a catalog-entry-like description. * It is a collection of values that apply again and again. * It also provides behavior across the collection of all things that correspond to its description. [Coad99]. * Examples include classes representing product descriptions of all kinds. * The difference between a blue and green is the difference between a film and the DVD's on which the film is recorded. * Description classes are pastel blue in color. Description classes categorize or label other stuff depending on different values, * typically objects of Party, Place, Thing classes but occasionally Moment-Intervals too. * The industries that companies work within are objects of a Description class. * The models of a car in a show room are objects of a Description class. * The titles of books sold by Amazon.com are objects of a Description class. * The labels you use to catalog stuff like this, are always blue! */ @EqualsAndHashCode(callSuper=true) @MappedSuperclass public abstract class DescriptionDomainArchetype extends BaseEntity { private static final long serialVersionUID = -2256019790922847052L; private String name; private String code; private String Note; @Column(name="NAME") public String getName() { return name; } public void setName(String name) { this.name = name; } @Column(name="CODE") public String getCode() { return code; } public void setCode(String code) { this.code = code; } @Column(name="NOTE") public String getNote() { return Note; } public void setNote(String note) { Note = note; } }
[ "lucksonk@discovery.co.za" ]
lucksonk@discovery.co.za
687444606a24f5080a406cfa01acd35cb104452a
fac5d6126ab147e3197448d283f9a675733f3c34
/src/main/java/com/google/android/gms/common/internal/GmsClient.java
a060df2be2de5a476fa676cddd193f2e99e10012
[]
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
5,359
java
package com.google.android.gms.common.internal; import android.accounts.Account; import android.content.Context; import android.os.Handler; import android.os.IInterface; import android.os.Looper; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.google.android.gms.common.Feature; import com.google.android.gms.common.GoogleApiAvailability; import com.google.android.gms.common.annotation.KeepForSdk; import com.google.android.gms.common.api.Api; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.Scope; import com.google.android.gms.common.internal.BaseGmsClient; import com.google.android.gms.common.internal.GmsClientEventManager; import com.google.android.gms.common.util.VisibleForTesting; import java.util.Set; @KeepForSdk public abstract class GmsClient<T extends IInterface> extends BaseGmsClient<T> implements Api.Client, GmsClientEventManager.GmsClientEventState { private final Set<Scope> mScopes; private final ClientSettings zaes; private final Account zax; @KeepForSdk @VisibleForTesting protected GmsClient(Context context, Handler handler, int i, ClientSettings clientSettings) { this(context, handler, GmsClientSupervisor.getInstance(context), GoogleApiAvailability.getInstance(), i, clientSettings, (GoogleApiClient.ConnectionCallbacks) null, (GoogleApiClient.OnConnectionFailedListener) null); } @KeepForSdk protected GmsClient(Context context, Looper looper, int i, ClientSettings clientSettings, GoogleApiClient.ConnectionCallbacks connectionCallbacks, GoogleApiClient.OnConnectionFailedListener onConnectionFailedListener) { this(context, looper, GmsClientSupervisor.getInstance(context), GoogleApiAvailability.getInstance(), i, clientSettings, (GoogleApiClient.ConnectionCallbacks) Preconditions.checkNotNull(connectionCallbacks), (GoogleApiClient.OnConnectionFailedListener) Preconditions.checkNotNull(onConnectionFailedListener)); } @KeepForSdk protected GmsClient(Context context, Looper looper, int i, ClientSettings clientSettings) { this(context, looper, GmsClientSupervisor.getInstance(context), GoogleApiAvailability.getInstance(), i, clientSettings, (GoogleApiClient.ConnectionCallbacks) null, (GoogleApiClient.OnConnectionFailedListener) null); } @VisibleForTesting protected GmsClient(Context context, Looper looper, GmsClientSupervisor gmsClientSupervisor, GoogleApiAvailability googleApiAvailability, int i, ClientSettings clientSettings, GoogleApiClient.ConnectionCallbacks connectionCallbacks, GoogleApiClient.OnConnectionFailedListener onConnectionFailedListener) { super(context, looper, gmsClientSupervisor, googleApiAvailability, i, zaa(connectionCallbacks), zaa(onConnectionFailedListener), clientSettings.getRealClientClassName()); this.zaes = clientSettings; this.zax = clientSettings.getAccount(); this.mScopes = zaa(clientSettings.getAllRequestedScopes()); } @VisibleForTesting protected GmsClient(Context context, Handler handler, GmsClientSupervisor gmsClientSupervisor, GoogleApiAvailability googleApiAvailability, int i, ClientSettings clientSettings, GoogleApiClient.ConnectionCallbacks connectionCallbacks, GoogleApiClient.OnConnectionFailedListener onConnectionFailedListener) { super(context, handler, gmsClientSupervisor, googleApiAvailability, i, zaa(connectionCallbacks), zaa(onConnectionFailedListener)); this.zaes = (ClientSettings) Preconditions.checkNotNull(clientSettings); this.zax = clientSettings.getAccount(); this.mScopes = zaa(clientSettings.getAllRequestedScopes()); } private final Set<Scope> zaa(@NonNull Set<Scope> set) { Set<Scope> validateScopes = validateScopes(set); for (Scope scope : validateScopes) { if (!set.contains(scope)) { throw new IllegalStateException("Expanding scopes is not permitted, use implied scopes instead"); } } return validateScopes; } /* access modifiers changed from: protected */ @KeepForSdk @NonNull public Set<Scope> validateScopes(@NonNull Set<Scope> set) { return set; } public final Account getAccount() { return this.zax; } /* access modifiers changed from: protected */ @KeepForSdk public final ClientSettings getClientSettings() { return this.zaes; } /* access modifiers changed from: protected */ public final Set<Scope> getScopes() { return this.mScopes; } @KeepForSdk public Feature[] getRequiredFeatures() { return new Feature[0]; } @Nullable private static BaseGmsClient.BaseConnectionCallbacks zaa(GoogleApiClient.ConnectionCallbacks connectionCallbacks) { if (connectionCallbacks == null) { return null; } return new zaf(connectionCallbacks); } @Nullable private static BaseGmsClient.BaseOnConnectionFailedListener zaa(GoogleApiClient.OnConnectionFailedListener onConnectionFailedListener) { if (onConnectionFailedListener == null) { return null; } return new zag(onConnectionFailedListener); } public int getMinApkVersion() { return super.getMinApkVersion(); } }
[ "michael@districtrace.com" ]
michael@districtrace.com
b4091556672692277d99751c77891692cf821bd6
cc6679e93340935c22d15984f1a939d15867721b
/src/MidExamsTechnology/seizeTheFire.java
d576e0a983db334cacb5f2f8da6a5f823bb5b8ae
[]
no_license
GerganaL/JavaFundamentals-2020-Softuni
2cd21f31e9cd500e3dedde0f5562e54749e4c70f
8f7cae0ff424b8a44346c1c47a69af455c1ccdc6
refs/heads/master
2023-01-30T18:36:35.274829
2020-12-12T08:03:11
2020-12-12T08:03:11
318,480,327
0
0
null
null
null
null
UTF-8
Java
false
false
1,492
java
package MidExamsTechnology; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; import java.util.stream.Collectors; public class seizeTheFire { public static void main(String[] args) { Scanner scan = new Scanner(System.in); List<String> cells = Arrays.stream(scan.nextLine().split("#")).collect(Collectors.toList()); int water = Integer.parseInt(scan.nextLine()); double effort = 0.0; int totalFire = 0; List<String> output = new ArrayList<>(); output.add(0, "Cells:"); for (String cell : cells) { boolean isValid = false; String[] input = cell.split(" = "); int firePower = Integer.parseInt(input[1]); if (input[0].equals("High") && firePower > 80 && firePower < 126) { isValid = true; } else if (input[0].equals("Medium") && firePower > 50 && firePower < 81) { isValid = true; } else if (input[0].equals("Low") && firePower > 0 && firePower < 51) { isValid = true; } if (isValid && water >= firePower) { water -= firePower; effort += firePower * 0.25; output.add(" - " + firePower); totalFire += firePower; } } output.forEach(System.out::println); System.out.printf("Effort: %.2f%nTotal Fire: %d",effort,totalFire); } }
[ "lulchevagergana@gmail.com" ]
lulchevagergana@gmail.com
9471bbed3179e38bd5fe037654dc77818f5ef73d
329cb0a92db016e4815168e490d43a9e7dd7bbed
/xs-rongly-framework-build/xs-rongly-framework-dependencies/xs-rongly-framework-staters/xs-rongly-framework-stater-jdbc/src/main/java/com/xs/rongly/framework/stater/jdbc/autoConfig/sharingWriteRead/LogJdbcInit.java
09131f6aed99d3729d350527a32496b566315118
[]
no_license
angiely1115/rongly-framework
50bf524637cc3a803d0cd7eff5e6dcd045d5d10b
3e9be9c366dfbd311bdd937ec2013610de8b5a5b
refs/heads/master
2022-12-25T00:22:19.687148
2019-11-13T08:40:14
2019-11-13T08:40:14
160,496,386
1
0
null
2022-12-15T23:23:54
2018-12-05T09:50:19
Java
UTF-8
Java
false
false
2,513
java
package com.xs.rongly.framework.stater.jdbc.autoConfig.sharingWriteRead; import net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanFactoryPostProcessor; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.context.EnvironmentAware; import org.springframework.core.env.ConfigurableEnvironment; import org.springframework.core.env.Environment; /** * @Author: lvrongzhuan * @Description: * @Date: 2018/12/3 15:47 * @Version: 1.0 * modified by: */ public class LogJdbcInit implements BeanFactoryPostProcessor, EnvironmentAware { private ConfigurableEnvironment environment; @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException { this.initLog4Jdbc(); } private void initLog4Jdbc() { for (final String property : PROPERTIES_TO_COPY) { if (this.environment.containsProperty(property)) { System.setProperty(property, this.environment.getProperty(property)); } } System.setProperty("log4jdbc.spylogdelegator.name", this.environment .getProperty("log4jdbc.spylogdelegator.name", Slf4jSpyLogDelegator.class.getName())); } @Override public void setEnvironment(Environment environment) { this.environment = (ConfigurableEnvironment) environment; } /** * 为了打印Sql语言配置 */ private static final String[] PROPERTIES_TO_COPY = { "log4jdbc.log4j2.properties.file", "log4jdbc.debug.stack.prefix", "log4jdbc.sqltiming.warn.threshold", "log4jdbc.sqltiming.error.threshold", "log4jdbc.dump.booleanastruefalse", "log4jdbc.dump.fulldebugstacktrace", "log4jdbc.dump.sql.maxlinelength", "log4jdbc.statement.warn", "log4jdbc.dump.sql.select", "log4jdbc.dump.sql.insert", "log4jdbc.dump.sql.update", "log4jdbc.dump.sql.delete", "log4jdbc.dump.sql.create", "log4jdbc.dump.sql.addsemicolon", "log4jdbc.auto.load.popular.drivers", "log4jdbc.drivers", "log4jdbc.trim.sql", "log4jdbc.trim.sql.extrablanklines", "log4jdbc.suppress.generated.keys.exception", "log4jdbc.log4j2.properties.file", }; }
[ "lvrongzhuan@cnhnkj.com" ]
lvrongzhuan@cnhnkj.com
d35925b17e4a157591df30d80fd748a47791d2cb
83ba1ffe094176c7c6036a9ea47751b031941fc4
/sdks/java/core/src/test/java/com/google/cloud/dataflow/sdk/transforms/windowing/FixedWindowsTest.java
9266b246cb58aaef475dbcbaf8de500fbc6269a5
[ "Apache-2.0" ]
permissive
Sil1991/gcpdf-demo
b7b57f476bb5bce5e80e4c160512a52937036241
88ecd538a30f009b239a1b320ab6ad75f6901ae0
refs/heads/master
2022-11-24T23:36:03.156413
2018-04-10T15:29:49
2018-04-10T15:29:49
128,814,619
1
0
Apache-2.0
2022-11-16T08:29:25
2018-04-09T18:13:21
Java
UTF-8
Java
false
false
4,780
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 com.google.cloud.dataflow.sdk.transforms.windowing; import static com.google.cloud.dataflow.sdk.testing.WindowFnTestUtils.runWindowFn; import static com.google.cloud.dataflow.sdk.testing.WindowFnTestUtils.set; import static org.hamcrest.CoreMatchers.containsString; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import com.google.cloud.dataflow.sdk.testing.WindowFnTestUtils; import org.joda.time.Duration; import org.joda.time.Instant; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Set; /** * Tests for FixedWindows WindowFn. */ @RunWith(JUnit4.class) public class FixedWindowsTest { @Test public void testSimpleFixedWindow() throws Exception { Map<IntervalWindow, Set<String>> expected = new HashMap<>(); expected.put(new IntervalWindow(new Instant(0), new Instant(10)), set(1, 2, 5, 9)); expected.put(new IntervalWindow(new Instant(10), new Instant(20)), set(10, 11)); expected.put(new IntervalWindow(new Instant(100), new Instant(110)), set(100)); assertEquals( expected, runWindowFn( FixedWindows.of(new Duration(10)), Arrays.asList(1L, 2L, 5L, 9L, 10L, 11L, 100L))); } @Test public void testFixedOffsetWindow() throws Exception { Map<IntervalWindow, Set<String>> expected = new HashMap<>(); expected.put(new IntervalWindow(new Instant(-5), new Instant(5)), set(1, 2)); expected.put(new IntervalWindow(new Instant(5), new Instant(15)), set(5, 9, 10, 11)); expected.put(new IntervalWindow(new Instant(95), new Instant(105)), set(100)); assertEquals( expected, runWindowFn( FixedWindows.of(new Duration(10)).withOffset(new Duration(5)), Arrays.asList(1L, 2L, 5L, 9L, 10L, 11L, 100L))); } @Test public void testTimeUnit() throws Exception { Map<IntervalWindow, Set<String>> expected = new HashMap<>(); expected.put(new IntervalWindow(new Instant(-5000), new Instant(5000)), set(1, 2, 1000)); expected.put(new IntervalWindow(new Instant(5000), new Instant(15000)), set(5000, 5001, 10000)); assertEquals( expected, runWindowFn( FixedWindows.of(Duration.standardSeconds(10)).withOffset(Duration.standardSeconds(5)), Arrays.asList(1L, 2L, 1000L, 5000L, 5001L, 10000L))); } void checkConstructionFailure(int size, int offset) { try { FixedWindows.of(Duration.standardSeconds(size)).withOffset(Duration.standardSeconds(offset)); fail("should have failed"); } catch (IllegalArgumentException e) { assertThat(e.toString(), containsString("FixedWindows WindowingStrategies must have 0 <= offset < size")); } } @Test public void testInvalidInput() throws Exception { checkConstructionFailure(-1, 0); checkConstructionFailure(1, 2); checkConstructionFailure(1, -1); } @Test public void testEquality() { assertTrue(FixedWindows.of(new Duration(10)).isCompatible(FixedWindows.of(new Duration(10)))); assertTrue( FixedWindows.of(new Duration(10)).isCompatible( FixedWindows.of(new Duration(10)))); assertTrue( FixedWindows.of(new Duration(10)).isCompatible( FixedWindows.of(new Duration(10)))); assertFalse(FixedWindows.of(new Duration(10)).isCompatible(FixedWindows.of(new Duration(20)))); assertFalse(FixedWindows.of(new Duration(10)).isCompatible( FixedWindows.of(new Duration(20)))); } @Test public void testValidOutputTimes() throws Exception { for (long timestamp : Arrays.asList(200, 800, 700)) { WindowFnTestUtils.validateGetOutputTimestamp( FixedWindows.of(new Duration(500)), timestamp); } } }
[ "jason_l_l@qq.com" ]
jason_l_l@qq.com
213ea69b5baa0d378a686724f7d88e059130cab5
472d7820a5f5d9d5ab2ec150eab0c9bdeb2008c7
/Aries/Sodi/dis/disEnumerations/ReceiverStatefield.java
d592426b95b644323ec6783350da766b2105c537
[]
no_license
slacker247/GPDA
1ad5ebe0bea4528d9a3472d3c34580648ffb670e
fa9006d0877a691f1ddffe88799c844a3e8a669a
refs/heads/master
2022-10-08T07:39:09.786313
2020-06-10T22:22:58
2020-06-10T22:22:58
105,063,261
2
0
null
null
null
null
UTF-8
Java
false
false
4,253
java
/* File: ReceiverStatefield.java CVS Info: $Id$ Compiler: jdk 1.2.2 */ package disEnumerations; import mil.navy.nps.dis.*; import mil.navy.nps.util.*; /** * Receiver State field -- This field shall indicate the state of the receiver, which shall either be idle or active. This field shall be represented by a 16-bit enumeration (see Section 9 in EBV-DOC). *@version 1.1 *@author Ronan Fauglas *@author <a href="mailto:brutzman@nps.navy.mil?subject=dis-java-vrml: disEnumerations.ReceiverStatefield feedback ">Don Brutzman</a> * *<dt><b>References:</b> *<dd> DIS Data Dictionary: <A href="../../../../../../mil/navy/nps/disEnumerations/JdbeHtmlFiles/pdu/fe.htm">Receiver State field</A> (local) * <A href="http://SISO.sc.ist.ucf.edu/dis/dis-dd/pdu/fe.htm">Receiver State field</A> (SISO) *<dd> JDBE:<a href="http://208.145.129.4/jdbe/proj/dis_cd/dis-dd/">DIS Data Dictionary Version 1.0a (DIS-DD)</A> *<dd> Perl script (converting html enumerations to java enumerations) * <A href="../../../../../../mil/navy/nps/disEnumerations/convertJdbeDisEnumerationsToJava.pl"><i>convertJdbeDisEnumerationsToJava.pl</i></A> (local) or * <A href="http://web.3D.org/WorkingGroups/vrtp/mil/navy/nps/disEnumerations/convertJdbeDisEnumerationsToJava.pl"> * <i>http://web.3D.org/WorkingGroups/vrtp/mil/navy/nps/disEnumerations/convertJdbeDisEnumerationsToJava.pl</i></A> *<dd> "Named Constants," <i>The Java Programming Language</i>, Gosling & Arnold. * *<dt><b>Explanation:</b> *<dd>This file has been automatically generated from a local copy of the * <A href="../../../../../../mil/navy/nps/disEnumerations/JdbeHtmlFiles/dis-dd.html">DIS Data Dictionary</A> at * <A href="http://SISO.sc.ist.ucf.edu/dis/dis-dd/">http://SISO.sc.ist.ucf.edu/dis/dis-dd/</A> * html source file by * <A href="../../../../../../mil/navy/nps/disEnumerations/convertJdbeDisEnumerationsToJava.pl">convertJdbeDisEnumerationsToJava.pl</a> (local) or * <A href="http://www.web3D.org/WorkingGroups/vrtp/mil/navy/nps/disEnumerations/convertJdbeDisEnumerationsToJava.pl">http://www.web3D.org/WorkingGroups/vrtp/mil/navy/nps/disEnumerations/convertJdbeDisEnumerationsToJava.pl</a>. * <P> * This is effectively a C-style enumeration. Java doesn't do enumerations * like C, so you have to wrap a class around it. It's a bit more typing, * but pretty simple-minded. * Note that the variables are declared public. The default for access * is package-wide, but these variables might need to be accessed from * outside the package. Since all the variables are final (i.e. constant), nobody can * change anything anyway, so this is no biggie.<p> * To use these enumerations in your Java code, import the package first: * <b><PRE>import mil.navy.nps.disEnumerations.*;</PRE></b> * You access this via something like <b><code>ReceiverStatefield.ONANDRECEIVING</code></b>, i.e. combine * the class name, a period, and a class variable (enumeration) name.<P> * *<dt><b>History:</b> *<dd> 21jan98 /Ronan Fauglas /New *<dd> 30mar99 /Don Brutzman /Revised Javadoc, many more enumeration classes * *<dt><b>Location:</b> *<dd><a href="../../../../../../mil/navy/nps/disEnumerations/ReceiverStatefield.java"><i>ReceiverStatefield.java</i></A> (local) *<dd><a href="http://www.web3D.org/WorkingGroups/vrtp/mil/navy/nps/disEnumerations/ReceiverStatefield.java"> * <i>http://www.web3D.org/WorkingGroups/vrtp/mil/navy/nps/disEnumerations/ReceiverStatefield.java</i></a> * */ public class ReceiverStatefield extends Object { /** *(0) Off */ public static final short OFF = 0; /** *(1) On but not receiving */ public static final short ONBUTNOTRECEIVING = 1; /** *(2) On and receiving */ public static final short ONANDRECEIVING = 2; /** * Returns a string containing the enumeration name which corresponds to an enumeration value, * as in <b><code>ReceiverStatefield.toString (0)</code></b> returns the string "<b><code>OFF</code></b>" */ public static String toString(int idNumber) { switch (idNumber) { case 0: return "Off"; case 1: return "On but not receiving"; case 2: return "On and receiving"; default : return ""; } }//end of toString }//End of class
[ "jeffmac710@gmail.com" ]
jeffmac710@gmail.com
d69bb5f40146e1615cd248dbf2cd57ab36f84e74
edc7a4d3ad6b9eb8c68f1f004ecf6797a1f2bffe
/spring-ws/2-Autowiring/src/main/java/com/cts/employee/Test.java
7de31b3e46cf33c53604450dfa3f8bb0b52c6580
[]
no_license
tracksdata/adm-spring-connect-b1
b07f1095530b0ddc98962c192ccb94b423bc1cc5
fcdfca952d002da680f1f235d3cd0b49f3d3333f
refs/heads/master
2023-03-28T17:47:55.061454
2021-03-31T12:40:06
2021-03-31T12:40:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
790
java
package com.cts.employee; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import com.cts.employee.service.DepartmentServiceImpl; import com.cts.employee.service.EmployeeServiceImpl; import com.cts.product.config.AppConfig; public class Test { public static void main(String[] args) { ApplicationContext ac = new AnnotationConfigApplicationContext(AppConfig.class); EmployeeServiceImpl emp = ac.getBean(EmployeeServiceImpl.class); DepartmentServiceImpl dept = ac.getBean(DepartmentServiceImpl.class); emp.setEmpId(10); emp.setEmpName("Praveen"); emp.setSalary(2837434); dept.setDeptId(1000); dept.setDeptName("HR"); //emp.setDeptService(dept); // DI emp.display(); } }
[ "praveen.somireddy@gmail.com" ]
praveen.somireddy@gmail.com
8d6fe1b26977c7bd4063db1d9272c25419d2204a
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
/ast_results/jonasoreland_runnerup_/app/src/org/runnerup/workout/TriggerSuppression.java
6d347f3bb50e8f795ddd09026a6c28854413ebce
[]
no_license
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
0564143d92f8024ff5fa6b659c2baebf827582b1
refs/heads/master
2020-07-13T13:53:40.297493
2019-01-11T11:51:18
2019-01-11T11:51:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
172
java
// isComment package org.runnerup.workout; public abstract class isClassOrIsInterface { public abstract boolean isMethod(Trigger isParameter, Workout isParameter); }
[ "matheus@melsolucoes.net" ]
matheus@melsolucoes.net
02f8f8b4697cae244fc1f7e2a9e1e77e2cc12565
3dd35c0681b374ce31dbb255b87df077387405ff
/generated/productmodel/DirectGL7ManualPremium389Type.java
e00b54d523dd5906a465c52a7f5eafb6911e7710
[]
no_license
walisashwini/SBTBackup
58b635a358e8992339db8f2cc06978326fed1b99
4d4de43576ec483bc031f3213389f02a92ad7528
refs/heads/master
2023-01-11T09:09:10.205139
2020-11-18T12:11:45
2020-11-18T12:11:45
311,884,817
0
0
null
null
null
null
UTF-8
Java
false
false
609
java
package productmodel; @gw.lang.SimplePropertyProcessing @javax.annotation.Generated(comments = "config/resources/productmodel/policylinepatterns/GL7Line/coveragepatterns/GL7LmtdCovForDesignatedUnmannedAircraftRailroad.xml", date = "", value = "com.guidewire.pc.productmodel.codegen.ProductModelCodegen") public interface DirectGL7ManualPremium389Type extends gw.api.domain.covterm.DirectCovTerm { productmodel.GL7LmtdCovForDesignatedUnmannedAircraftRailroad getCoverage(); productmodel.GL7LmtdCovForDesignatedUnmannedAircraftRailroad getGL7LmtdCovForDesignatedUnmannedAircraftRailroad(); }
[ "ashwini@cruxxtechnologies.com" ]
ashwini@cruxxtechnologies.com
53582b1a4151a606435ed649326c3a1256b2b96c
1813fabebe0f25bfbd30606c07e440c4db06bba9
/src/com/intellij/lang/javascript/psi/JSYieldStatement.java
bdc3990cf5e141b968f2de0966f727384993584b
[ "Apache-2.0" ]
permissive
jseteny/consulo-javascript
66f3eabeb6e37b3ecda1a99d053935ac2273edf9
e53ea8e9dddfc5fa8923b31c28b605b8f3a6cc48
refs/heads/master
2020-07-09T13:15:27.874841
2015-06-10T14:33:00
2015-06-10T14:33:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
851
java
/* * Copyright 2000-2005 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.lang.javascript.psi; import org.jetbrains.annotations.Nullable; /** * User: max * Date: Jan 30, 2005 * Time: 9:27:17 PM */ public interface JSYieldStatement extends JSStatement { @Nullable JSExpression getExpression(); }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
8765c508115aec5c10f0f4493ad0297f66cbc8d1
8e1dbf0ee00312e8f45eb82bf6bad350ae68c0aa
/ezjs_generator/src/main/java/me/ezjs/generator/mybatis/codegen/ibatis2/sqlmap/elements/CountByExampleElementGenerator.java
24316ce74652680ffe4ae0426551e947d0907a18
[]
no_license
piglete/DAST
ed839d69df3d9c5d738574ee1ad9e803929df056
821f06b40a882ed9861c8eedd4fceda935ce5a13
refs/heads/master
2020-05-30T20:35:00.822871
2019-06-03T08:24:24
2019-06-03T08:24:24
188,547,093
0
0
null
null
null
null
UTF-8
Java
false
false
2,480
java
/** * Copyright 2006-2016 the original author or authors. * <p> * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package me.ezjs.generator.mybatis.codegen.ibatis2.sqlmap.elements; import me.ezjs.generator.mybatis.api.dom.xml.Attribute; import me.ezjs.generator.mybatis.api.dom.xml.XmlElement; import me.ezjs.generator.mybatis.api.dom.xml.TextElement; /** * * @author Jeff Butler * */ public class CountByExampleElementGenerator extends AbstractXmlElementGenerator { public CountByExampleElementGenerator() { super(); } @Override public void addElements(XmlElement parentElement) { XmlElement answer = new XmlElement("select"); //$NON-NLS-1$ answer.addAttribute(new Attribute( "id", introspectedTable.getCountByExampleStatementId())); //$NON-NLS-1$ answer.addAttribute(new Attribute( "parameterClass", introspectedTable.getExampleType())); //$NON-NLS-1$ answer.addAttribute(new Attribute("resultClass", "java.lang.Integer")); //$NON-NLS-1$ //$NON-NLS-2$ context.getCommentGenerator().addComment(answer); StringBuilder sb = new StringBuilder(); sb.append("select count(*) from "); //$NON-NLS-1$ sb.append(introspectedTable .getAliasedFullyQualifiedTableNameAtRuntime()); answer.addElement(new TextElement(sb.toString())); XmlElement includeElement = new XmlElement("include"); //$NON-NLS-1$ sb.setLength(0); sb.append(introspectedTable.getIbatis2SqlMapNamespace()); sb.append('.'); sb.append(introspectedTable.getExampleWhereClauseId()); includeElement.addAttribute(new Attribute("refid", //$NON-NLS-1$ sb.toString())); answer.addElement(includeElement); if (context.getPlugins().sqlMapCountByExampleElementGenerated( answer, introspectedTable)) { parentElement.addElement(answer); } } }
[ "1721985139@qq.com" ]
1721985139@qq.com
0c844209fe1517b74097997d66c333333b629ec7
bb302c89db6cd4a4d9ab7571796368c35445c2cd
/libs15/src/main/java/com/course/system/dto/RoleResourceDto.java
6a4b3370e83c69c5ea4d383c70e77aaf410ea5d9
[]
no_license
seasunny1229/SpringCloud
ee008c0114bdeb8f297db54261b324855275991c
5c87263df9c59d895784318aa6126bb0221edf71
refs/heads/master
2023-03-21T03:32:14.584007
2021-03-14T14:48:40
2021-03-14T14:48:40
302,620,471
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package com.course.system.dto; public class RoleResourceDto { /** * id */ private String id; /** * 角色|id */ private String roleId; /** * 资源|id */ private String resourceId; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getRoleId() { return roleId; } public void setRoleId(String roleId) { this.roleId = roleId; } public String getResourceId() { return resourceId; } public void setResourceId(String resourceId) { this.resourceId = resourceId; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append(getClass().getSimpleName()); sb.append(" ["); sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", roleId=").append(roleId); sb.append(", resourceId=").append(resourceId); sb.append("]"); return sb.toString(); } }
[ "sea_sunny1229@163.com" ]
sea_sunny1229@163.com
6951e794e41b0812e13dbdc611b3ee288fcba6a7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_37171916ab90f9b8772b1e22cda9824d0c78e5e1/HeadRules/16_37171916ab90f9b8772b1e22cda9824d0c78e5e1_HeadRules_s.java
41f1ab845c872280a797ccefbf4443e26da24cc8
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,495
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreemnets. 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 opennlp.tools.parser.lang.en; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.Writer; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.Stack; import java.util.StringTokenizer; import opennlp.tools.parser.Constituent; import opennlp.tools.parser.GapLabeler; import opennlp.tools.parser.Parse; import opennlp.tools.parser.chunking.Parser; /** * Class for storing the English head rules associated with parsing. */ public class HeadRules implements opennlp.tools.parser.HeadRules, GapLabeler { private static class HeadRule { public boolean leftToRight; public String[] tags; public HeadRule(boolean l2r, String[] tags) { leftToRight = l2r; this.tags = tags; } } private Map<String, HeadRule> headRules; private Set<String> punctSet; /** * Creates a new set of head rules based on the specified head rules file. * * @param ruleFile the head rules file. * * @throws IOException if the head rules file can not be read. */ public HeadRules(String ruleFile) throws IOException { this(new BufferedReader(new FileReader(ruleFile))); } /** * Creates a new set of head rules based on the specified reader. * * @param rulesReader the head rules reader. * * @throws IOException if the head rules reader can not be read. */ public HeadRules(BufferedReader rulesReader) throws IOException { readHeadRules(rulesReader); punctSet = new HashSet<String>(); punctSet.add("."); punctSet.add(","); punctSet.add("``"); punctSet.add("''"); //punctSet.add(":"); } public Set<String> getPunctuationTags() { return punctSet; } public Parse getHead(Parse[] constituents, String type) { if (constituents[0].getType() == Parser.TOK_NODE) { return null; } HeadRule hr; if (type.equals("NP") || type.equals("NX")) { String[] tags1 = { "NN", "NNP", "NNPS", "NNS", "NX", "JJR", "POS" }; for (int ci = constituents.length - 1; ci >= 0; ci--) { for (int ti = tags1.length - 1; ti >= 0; ti--) { if (constituents[ci].getType().equals(tags1[ti])) { return constituents[ci].getHead(); } } } for (int ci = 0; ci < constituents.length; ci++) { if (constituents[ci].getType().equals("NP")) { return constituents[ci].getHead(); } } String[] tags2 = { "$", "ADJP", "PRN" }; for (int ci = constituents.length - 1; ci >= 0; ci--) { for (int ti = tags2.length - 1; ti >= 0; ti--) { if (constituents[ci].getType().equals(tags2[ti])) { return constituents[ci].getHead(); } } } String[] tags3 = { "JJ", "JJS", "RB", "QP" }; for (int ci = constituents.length - 1; ci >= 0; ci--) { for (int ti = tags3.length - 1; ti >= 0; ti--) { if (constituents[ci].getType().equals(tags3[ti])) { return constituents[ci].getHead(); } } } return constituents[constituents.length - 1].getHead(); } else if ((hr = (HeadRule) headRules.get(type)) != null) { String[] tags = hr.tags; int cl = constituents.length; int tl = tags.length; if (hr.leftToRight) { for (int ti = 0; ti < tl; ti++) { for (int ci = 0; ci < cl; ci++) { if (constituents[ci].getType().equals(tags[ti])) { return constituents[ci].getHead(); } } } return constituents[0].getHead(); } else { for (int ti = 0; ti < tl; ti++) { for (int ci = cl - 1; ci >= 0; ci--) { if (constituents[ci].getType().equals(tags[ti])) { return constituents[ci].getHead(); } } } return constituents[cl - 1].getHead(); } } return constituents[constituents.length - 1].getHead(); } private void readHeadRules(BufferedReader str) throws IOException { String line; headRules = new HashMap<String, HeadRule>(30); while ((line = str.readLine()) != null) { StringTokenizer st = new StringTokenizer(line); String num = st.nextToken(); String type = st.nextToken(); String dir = st.nextToken(); String[] tags = new String[Integer.parseInt(num)]; int ti = 0; while (st.hasMoreTokens()) { tags[ti] = st.nextToken(); ti++; } headRules.put(type, new HeadRule(dir.equals("1"), tags)); } } public void labelGaps(Stack<Constituent> stack) { if (stack.size() > 4) { //Constituent con0 = (Constituent) stack.get(stack.size()-1); Constituent con1 = (Constituent) stack.get(stack.size()-2); Constituent con2 = (Constituent) stack.get(stack.size()-3); Constituent con3 = (Constituent) stack.get(stack.size()-4); Constituent con4 = (Constituent) stack.get(stack.size()-5); //System.err.println("con0="+con0.label+" con1="+con1.label+" con2="+con2.label+" con3="+con3.label+" con4="+con4.label); //subject extraction if (con1.getLabel().equals("NP") && con2.getLabel().equals("S") && con3.getLabel().equals("SBAR")) { con1.setLabel(con1.getLabel()+"-G"); con2.setLabel(con2.getLabel()+"-G"); con3.setLabel(con3.getLabel()+"-G"); } //object extraction else if (con1.getLabel().equals("NP") && con2.getLabel().equals("VP") && con3.getLabel().equals("S") && con4.getLabel().equals("SBAR")) { con1.setLabel(con1.getLabel()+"-G"); con2.setLabel(con2.getLabel()+"-G"); con3.setLabel(con3.getLabel()+"-G"); con4.setLabel(con4.getLabel()+"-G"); } } } public void serialize(Writer writer) throws IOException { for (String type : headRules.keySet()) { HeadRule headRule = headRules.get(type); // write num of tags writer.write(Integer.toString(headRule.tags.length)); writer.write(' '); // write type writer.write(type); writer.write(' '); // write l2r true == 1 if (headRule.leftToRight) writer.write("1"); else writer.write("0"); // write tags for (String tag : headRule.tags) { writer.write(' '); writer.write(tag); } writer.write('\n'); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
563d94cb393a30c7ddff8a84c904b52ce73b28e1
781e2692049e87a4256320c76e82a19be257a05d
/all_data/cs61bl/lab06/cs61bl-ic/ResizableIntSequenceTest.java
bb758dcb2bb039fc6ece04c6ba940a6dcd7e9653
[]
no_license
itsolutionscorp/AutoStyle-Clustering
54bde86fe6dbad35b568b38cfcb14c5ffaab51b0
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
refs/heads/master
2020-12-11T07:27:19.291038
2016-03-16T03:18:00
2016-03-16T03:18:42
59,454,921
4
0
null
2016-05-23T05:40:56
2016-05-23T05:40:56
null
UTF-8
Java
false
false
805
java
import static org.junit.Assert.*; import org.junit.Test; public class ResizableIntSequenceTest { @Test public void testAdd() { ResizableIntSequence R = new ResizableIntSequence(5); for (int _ = 0; _ < 5; _++) { R.add(_); } R.add(10); assertEquals(R.elementAt(5), 10); } @Test public void testInsert() { ResizableIntSequence R = new ResizableIntSequence(5); for (int _ = 0; _ < 6; _++) { R.add(_); } R.insert(10, 2); assertEquals(R.elementAt(2), 10); assertEquals(R.elementAt(6), 5); } @Test public void testIRemove() { ResizableIntSequence R = new ResizableIntSequence(12); for (int _ = 0; _ < 12; _++) { R.add(_); } assertEquals(12, R.myValues.length); for (int _ = 0; _ < 9; _++) { R.remove(0); } assertEquals(6, R.myValues.length); } }
[ "moghadam.joseph@gmail.com" ]
moghadam.joseph@gmail.com
b83be9b85ffc5265729fe79e05302b15563ab073
1930d97ebfc352f45b8c25ef715af406783aabe2
/src/main/java/com/alipay/api/response/ZhimaCustomerCertificationInitializeResponse.java
3e6c210a23970da5bb7d13f4667e830d7b8e74e9
[ "Apache-2.0" ]
permissive
WQmmm/alipay-sdk-java-all
57974d199ee83518523e8d354dcdec0a9ce40a0c
66af9219e5ca802cff963ab86b99aadc59cc09dd
refs/heads/master
2023-06-28T03:54:17.577332
2021-08-02T10:05:10
2021-08-02T10:05:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
702
java
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: zhima.customer.certification.initialize response. * * @author auto create * @since 1.0, 2021-07-14 10:13:49 */ public class ZhimaCustomerCertificationInitializeResponse extends AlipayResponse { private static final long serialVersionUID = 3646398187651382456L; /** * 本次认证的唯一标识,商户需要记录,后续的操作都需要用到 */ @ApiField("biz_no") private String bizNo; public void setBizNo(String bizNo) { this.bizNo = bizNo; } public String getBizNo( ) { return this.bizNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
27f50ed9b6e04034e6128a2007783cef4955e6f8
06f916232e5324913630031407c42eabac624b00
/app/src/main/java/com/chengchikeji_register_verification/RegexValidateUtil.java
c5743704ed5a9c091012b4abf30db392a2d5bef1
[]
no_license
yiwaitaohua/EX_ProjectItem21
5555876b0eeba8cbb65bb17f0f8b78f3f40b00f9
5d051d6b9f4187b1e466ca46fe3141acfed7f58c
refs/heads/master
2021-01-01T05:24:19.593072
2016-05-27T01:51:37
2016-05-27T01:51:37
58,365,154
0
0
null
null
null
null
UTF-8
Java
false
false
1,252
java
package com.chengchikeji_register_verification; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by Administrator on 2016/5/25. * TODO 注册 登入 使用 */ public class RegexValidateUtil { /** * 验证手机号码 * * @param mobiles * @return */ public static boolean checkMobileNumber(String mobileNumber) { boolean flag = false; try { Pattern regex = Pattern .compile("^(((13[0-9])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8})|(0\\d{2}-\\d{8})|(0\\d{3}-\\d{7})$"); Matcher matcher = regex.matcher(mobileNumber); flag = matcher.matches(); } catch (Exception e) { flag = false; } return flag; } /** * 验证合法字符 * * @param email * @return */ public static boolean checkCharacter(String character) { boolean flag = false; try { String check = "[a-zA-Z0-9_]{4,16}"; Pattern regex = Pattern.compile(check); Matcher matcher = regex.matcher(character); flag = matcher.matches(); } catch (Exception e) { flag = false; } return flag; } }
[ "email@example.com" ]
email@example.com
0ba7fe24db744fe67f87b1b01967c8e19326cd37
40665051fadf3fb75e5a8f655362126c1a2a3af6
/ibinti-bugvm/e6287f5d89455b6590a9c8032fcee429d0eaed9e/4898/X9FieldElement.java
3b7b6301b7ce0642a1e1954c70dbeaeb1955f175
[]
no_license
fermadeiral/StyleErrors
6f44379207e8490ba618365c54bdfef554fc4fde
d1a6149d9526eb757cf053bc971dbd92b2bfcdf1
refs/heads/master
2020-07-15T12:55:10.564494
2019-10-24T02:30:45
2019-10-24T02:30:45
205,546,543
2
0
null
null
null
null
UTF-8
Java
false
false
1,885
java
package com.android.org.bouncycastle.asn1.x9; import java.math.BigInteger; import com.android.org.bouncycastle.asn1.ASN1Object; import com.android.org.bouncycastle.asn1.ASN1OctetString; import com.android.org.bouncycastle.asn1.ASN1Primitive; import com.android.org.bouncycastle.asn1.DEROctetString; import com.android.org.bouncycastle.math.ec.ECFieldElement; /** * class for processing an FieldElement as a DER object. */ public class X9FieldElement extends ASN1Object { protected ECFieldElement f; private static X9IntegerConverter converter = new X9IntegerConverter(); public X9FieldElement(ECFieldElement f) { this.f = f; } public X9FieldElement(BigInteger p, ASN1OctetString s) { this(new ECFieldElement.Fp(p, new BigInteger(1, s.getOctets()))); } public X9FieldElement(int m, int k1, int k2, int k3, ASN1OctetString s) { this(new ECFieldElement.F2m(m, k1, k2, k3, new BigInteger(1, s.getOctets()))); } public ECFieldElement getValue() { return f; } /** * Produce an object suitable for an ASN1OutputStream. * <pre> * FieldElement ::= OCTET STRING * </pre> * <p> * <ol> * <li> if <i>q</i> is an odd prime then the field element is * processed as an Integer and converted to an octet string * according to x 9.62 4.3.1.</li> * <li> if <i>q</i> is 2<sup>m</sup> then the bit string * contained in the field element is converted into an octet * string with the same ordering padded at the front if necessary. * </li> * </ol> */ public ASN1Primitive toASN1Primitive() { int byteCount = converter.getByteLength(f); byte[] paddedBigInteger = converter.integerToBytes(f.toBigInteger(), byteCount); return new DEROctetString(paddedBigInteger); } }
[ "fer.madeiral@gmail.com" ]
fer.madeiral@gmail.com
47919862cbddde1289d5fa7460b8e740ef94c28b
6756d0542d29e267644d453f288e94c85508eebf
/src/main/java/sonar/logistics/info/types/ClockInfo.java
ec6800d3aba40c6fa3d2ef9ba8c40bad3d02064b
[ "MIT" ]
permissive
TartaricAcid/Practical-Logistics-2
3e165b995131f64d7fbfbe1a25f91b9f59726f96
e7b9bd87fe513d291e6ffccf8e7e5a6736a6c1f8
refs/heads/1.10.2
2020-03-17T01:46:07.351013
2018-03-10T10:52:01
2018-03-10T10:52:01
133,165,404
1
0
null
2018-05-12T16:53:17
2018-05-12T16:53:16
null
UTF-8
Java
false
false
3,738
java
package sonar.logistics.info.types; import java.util.List; import org.lwjgl.opengl.GL11; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import sonar.core.api.nbt.INBTSyncable; import sonar.core.network.sync.SyncTagType; import sonar.logistics.PL2Constants; import sonar.logistics.api.asm.LogicInfoType; import sonar.logistics.api.info.IComparableInfo; import sonar.logistics.api.info.IInfo; import sonar.logistics.api.info.INameableInfo; import sonar.logistics.api.info.render.IDisplayInfo; import sonar.logistics.api.info.render.InfoContainer; import sonar.logistics.api.networks.INetworkHandler; import sonar.logistics.api.tiles.signaller.ComparableObject; import sonar.logistics.connections.handlers.InfoNetworkHandler; import sonar.logistics.helpers.InfoRenderer; @LogicInfoType(id = ClockInfo.id, modid = PL2Constants.MODID) public class ClockInfo extends BaseInfo<ClockInfo> implements IInfo<ClockInfo>, INBTSyncable, INameableInfo<ClockInfo>, IComparableInfo<ClockInfo> { public static final String id = "clock"; public int compare; public SyncTagType.DOUBLE firstNum = new SyncTagType.DOUBLE(1), secondNum = new SyncTagType.DOUBLE(2); public SyncTagType.STRING clockString = new SyncTagType.STRING(3); { syncList.addParts(firstNum, secondNum, clockString); } public ClockInfo() { } public ClockInfo(double firstNum, double secondNum, String clockString) { this.firstNum.setObject(firstNum); this.secondNum.setObject(secondNum); this.clockString.setObject(clockString); } @Override public String getClientIdentifier() { return "Time"; } @Override public String getClientObject() { if (!isValid()) { return "ERROR"; } return clockString.getObject(); } @Override public String getClientType() { return "time"; } @Override public boolean isIdenticalInfo(ClockInfo info) { return info.firstNum.getObject() == firstNum.getObject() && info.secondNum.getObject() == secondNum.getObject(); } @Override public boolean isMatchingInfo(ClockInfo info) { return true; } @Override public boolean isMatchingType(IInfo info) { return info instanceof ClockInfo; } @Override public boolean isHeader() { return false; } @Override public INetworkHandler getHandler() { return InfoNetworkHandler.INSTANCE; } @Override public boolean isValid() { return firstNum.getObject() != null && firstNum.getObject() != null && clockString.getObject() != null; } @Override public String getID() { return id; } @Override public ClockInfo copy() { return new ClockInfo(firstNum.getObject(), secondNum.getObject(), clockString.getObject()); } @Override public void renderInfo(InfoContainer container, IDisplayInfo displayInfo, double displayWidth, double displayHeight, double displayScale, int infoPos) { GL11.glPushMatrix(); GL11.glPushMatrix(); GlStateManager.disableLighting(); GL11.glTranslated(-1, -+0.0625 * 12, +0.004); Minecraft.getMinecraft().getTextureManager().bindTexture(InfoContainer.getColour(infoPos)); InfoRenderer.renderProgressBar(displayWidth, displayHeight, displayScale, (compare == 1 ? secondNum.getObject() : firstNum.getObject()), (compare == 1 ? firstNum.getObject() : secondNum.getObject())); GlStateManager.enableLighting(); GL11.glTranslated(0, 0, -0.001); GL11.glPopMatrix(); InfoRenderer.renderNormalInfo(container.display.getDisplayType(), displayWidth, displayHeight, displayScale, displayInfo.getFormattedStrings()); GL11.glPopMatrix(); } @Override public List<ComparableObject> getComparableObjects(List<ComparableObject> objects) { objects.add(new ComparableObject(this, "isEmitting", firstNum.getObject()==secondNum.getObject())); return objects; } }
[ "ollielansdell@hotmail.co.uk" ]
ollielansdell@hotmail.co.uk
96ec193511514a7d939d1fbb987ee9c79b210151
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_1002046.java
e627176829ed6dcafac4ee115700e2ad19f2a673
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
593
java
private byte[] gcm(Mode mode,String info,byte[] nonce,byte[] data){ try { Cipher cipher=Cipher.getInstance(ENCRYPTION_ALGORITHM,encryptionProvider); SecretKey derivedKey=deriveKey(cipher.getBlockSize(),info); GCMParameterSpec gcmParameters=new GCMParameterSpec(TAG_BITS,nonce); cipher.init(mode.cipherMode,derivedKey,gcmParameters); return cipher.doFinal(data); } catch ( IllegalBlockSizeException|InvalidAlgorithmParameterException|NoSuchPaddingException|NoSuchAlgorithmException|InvalidKeyException|BadPaddingException e) { throw Throwables.propagate(e); } }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
492c566ca120f884e73b19c9c9eac29391bf75e5
3d242b5e81e75fb82edb27fecd64f0222f50c3f3
/subprojects/griffon-javafx/src/main/java/griffon/javafx/beans/binding/UIThreadAwareLongBinding.java
62b6590b91597070f08496cff5ff7e9d374fc723
[ "Apache-2.0" ]
permissive
pgremo/griffon
d7105330ad5c3969bfa56d84d632a9d5bbcb9f59
4c19a3cc2af3dbb8e489e64f82bde99ff7e773e8
refs/heads/master
2022-12-07T02:42:49.102745
2018-11-06T13:12:10
2018-11-06T13:12:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,304
java
/* * SPDX-License-Identifier: Apache-2.0 * * Copyright 2008-2018 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 griffon.javafx.beans.binding; import javafx.beans.InvalidationListener; import javafx.beans.binding.LongBinding; import javafx.beans.value.ChangeListener; import javax.annotation.Nonnull; /** * @author Andres Almiray * @since 2.13.0 */ class UIThreadAwareLongBinding extends LongBindingDecorator implements UIThreadAware { UIThreadAwareLongBinding(@Nonnull LongBinding delegate) { super(delegate); } @Override public void addListener(ChangeListener<? super Number> listener) { if (listener instanceof UIThreadAware) { getDelegate().addListener(listener); } else { getDelegate().addListener(new UIThreadAwareChangeListener<>(listener)); } } @Override public void removeListener(ChangeListener<? super Number> listener) { if (listener instanceof UIThreadAware) { getDelegate().removeListener(listener); } else { getDelegate().removeListener(new UIThreadAwareChangeListener<>(listener)); } } @Override public void addListener(InvalidationListener listener) { if (listener instanceof UIThreadAware) { getDelegate().addListener(listener); } else { getDelegate().addListener(new UIThreadAwareInvalidationListener(listener)); } } @Override public void removeListener(InvalidationListener listener) { if (listener instanceof UIThreadAware) { getDelegate().removeListener(listener); } else { getDelegate().removeListener(new UIThreadAwareInvalidationListener(listener)); } } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
434b63b18723cae8b3ada7740bc8e98a942fc3aa
e47823f99752ec2da083ac5881f526d4add98d66
/test_data/14_Azureus2.3.0.6/src/org/gudy/azureus2/ui/swt/views/tableitems/mytorrents/DownItem.java
ead36c912db4a93a7731f922ea1eac999f5feaff
[]
no_license
Echtzeitsysteme/hulk-ase-2016
1dee8aca80e2425ab6acab18c8166542dace25cd
fbfb7aee1b9f29355a20e365f03bdf095afe9475
refs/heads/master
2020-12-24T05:31:49.671785
2017-05-04T08:18:32
2017-05-04T08:18:32
56,681,308
2
0
null
null
null
null
UTF-8
Java
false
false
1,982
java
/* * File : DownItem.java * Created : 24 nov. 2003 * By : Olivier * * Copyright (C) 2004 Aelitis SARL, All rights Reserved * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details ( see the LICENSE file ). * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * AELITIS, SARL au capital de 30,000 euros, * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France. */ package org.gudy.azureus2.ui.swt.views.tableitems.mytorrents; import org.gudy.azureus2.core3.util.DisplayFormatters; import org.gudy.azureus2.core3.download.DownloadManager; import org.gudy.azureus2.plugins.ui.tables.*; import org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn; /** bytes downloaded column * * @author Olivier * @author TuxPaper (2004/Apr/17: modified to TableCellAdapter) */ public class DownItem extends CoreTableColumn implements TableCellRefreshListener { /** Default Constructor */ public DownItem() { super("down", ALIGN_TRAIL, POSITION_LAST, 70, TableManager.TABLE_MYTORRENTS_INCOMPLETE); setRefreshInterval(INTERVAL_LIVE); } public void refresh(TableCell cell) { DownloadManager dm = (DownloadManager)cell.getDataSource(); long value = (dm == null) ? 0 : dm.getStats().getTotalGoodDataBytesReceived(); if (!cell.setSortValue(value) && cell.isValid()) return; cell.setText(DisplayFormatters.formatByteCountToKiBEtc(value)); } }
[ "sven.peldszus@stud.tu-darmstadt.de" ]
sven.peldszus@stud.tu-darmstadt.de
34b965fad3742fc8a7dbf4900d27648eec82c7a9
6bdcc2e0e6cddf16b54dfdee29427c91f5bff3fc
/common/doris.client/doris.client/src/main/java/com/alibaba/doris/client/operation/failover/impl/DefaultCallbackHandlerFactory.java
201bd933278d0efb34eaed4c5802a517174b2306
[ "MIT", "LicenseRef-scancode-public-domain-disclaimer", "FSFAP", "Apache-2.0" ]
permissive
Happy-sc/Doris-api
2d15185c99243843ec6a275f58c6b5ea281581cc
51508ef1b8407ee9c7b4d9f87178e2d653a5ffa2
refs/heads/master
2021-01-23T15:58:32.067904
2017-09-07T10:04:48
2017-09-07T10:04:48
102,718,780
0
0
null
null
null
null
UTF-8
Java
false
false
1,335
java
/* Copyright(C) 1999-2010 Alibaba Group Holding Limited All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.alibaba.doris.client.operation.failover.impl; import com.alibaba.doris.client.operation.failover.CallbackHandlerFactory; import com.alibaba.doris.client.operation.failover.LogicCallbackHandler; import com.alibaba.doris.client.operation.failover.PeerCallbackHandler; /** * DefaultCallbackHandlerFactory * @author Kun He (Raymond He), kun.hek@alibaba-inc.com * @since 1.0 2011-4-26 */ public class DefaultCallbackHandlerFactory implements CallbackHandlerFactory { public LogicCallbackHandler getLogicFailoverHandler() { return new LogicFailoverCallbackHandler(); } public PeerCallbackHandler getPeerFailoverHandler() { return new PeerFailoverCallbackHandler(); } }
[ "zhihui.li@intel.com" ]
zhihui.li@intel.com
3094fedd434a7edabc846300cc4817b090931a60
d05ac0e945576eb8e51cb38dcf7350296bacdba1
/jbossws-core/src/org/jboss/ws/metadata/wsse/Target.java
9d168db1c69b124d759b541019a44b8e959cb100
[]
no_license
Arckman/CBPM
9b6a125ea2bebe44749c09cfc37f89fdc15d69b7
10663b40abf151c90d0b20878f8f7f20c8077b30
refs/heads/master
2016-09-06T09:02:15.819806
2014-05-22T02:40:16
2014-05-22T02:40:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,922
java
/* * JBoss, Home of Professional Open Source * Copyright 2005, JBoss Inc., and individual contributors as indicated * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package org.jboss.ws.metadata.wsse; import java.io.Serializable; /** * <code>Target</code> represents the target tag. * * @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a> * @version $Revision: 1757 $ */ public class Target implements Serializable { private static final long serialVersionUID = 5718485529854012480L; private String type; private String value; private boolean contentOnly; public Target(String type) { this.type = type; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } public boolean isContentOnly() { return contentOnly; } public void setContentOnly(boolean contentOnly) { this.contentOnly = contentOnly; } }
[ "fengrj1989@gmail.com" ]
fengrj1989@gmail.com
0d1b5ec5373016e8bff9b5f5e3bab52f23330010
f77fe15958a23676f9d12535a9d0ff49cb125b29
/springboot-http-server-1/src/main/java/cn/puhy/demo/springboot/http/server1/HttpServerApplication.java
ce215bc7e46433d2b720173b4021d98f05bfd1d3
[]
no_license
phycn/demo
1a2160da41b4ad48a8472943655e6d854bb3e76e
166f9caf97a599fd9189ef1153d70be9fc78f16a
refs/heads/master
2022-07-01T23:50:23.414187
2019-06-21T03:12:11
2019-06-21T03:12:11
178,541,140
0
0
null
2022-06-21T01:01:58
2019-03-30T09:57:31
Java
UTF-8
Java
false
false
485
java
package cn.puhy.demo.springboot.http.server1; import com.alibaba.dubbo.spring.boot.annotation.EnableDubboConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * @author PUHY * 2019-03-30 18:12 */ @SpringBootApplication @EnableDubboConfiguration public class HttpServerApplication { public static void main(String[] args) { SpringApplication.run(HttpServerApplication.class); } }
[ "phy253399933@qq.com" ]
phy253399933@qq.com
117d1b2481ca22ad6c74c16d8def844a1dd98eda
3a45600e9bfef1dac23846cd3ebb7ed1e3f6c4e7
/eclipse workspace/OSGi Receita Exporter/src/main/java/com/edpichler/receita/services/impl/GeradorRegistroEntradaMercadoriasEServicosEmitidasPropriaPJ.java
fcc78f93dde3483f717e68a57fba2f5b9822cf1e
[]
no_license
edpichler/osgicofisxporter
184742392e6cb1fefac324d445ea780ca66fe0ca
2ca0de14f4ee23f6206cb90a8bdef7045277163a
refs/heads/master
2020-05-09T13:37:38.377424
2010-12-06T13:48:28
2010-12-06T13:48:28
33,085,335
0
1
null
null
null
null
UTF-8
Java
false
false
3,008
java
package com.edpichler.receita.services.impl; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.util.List; import com.edpichler.receita.interfaces.IRegistroEntradaMercadoriasEServicosEmitidasPropriaPJ; import com.edpichler.receita.interfaces.IRegistroSaidaMercadoriasEServicos; import com.edpichler.receita.services.Constantes; import com.edpichler.receita.services.IGerador; public class GeradorRegistroEntradaMercadoriasEServicosEmitidasPropriaPJ extends GeradorBase implements IGerador { private static String nomeArquivo = "4_10_4_registro_de_entrada_de_mercadorias_servicos_emitidas_pela_propria_PJ.txt"; @SuppressWarnings("unchecked") public void gerarArquivo(List<?> param) throws IOException { File file = criarArquivoTexto(nomeArquivo); BufferedWriter out = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(file), Constantes.ENCODING_RECEITA)); for (IRegistroEntradaMercadoriasEServicosEmitidasPropriaPJ pc : (List<IRegistroEntradaMercadoriasEServicosEmitidasPropriaPJ>) param) { out.write(formatar(pc) + "\n"); } out.flush(); out.close(); } private String formatar(IRegistroEntradaMercadoriasEServicosEmitidasPropriaPJ param) { StringBuilder st = new StringBuilder(); st.append(formatarString(param.getModeloDoDocumento(), 2)); st.append(formatarString(param.getSerieSubserieDocumento(), 5)); st.append(formatarNumero(param.getNumeroDocumento(), 9, 0)); st.append(formatarData(param.getDataEmissaoDocumento())); st.append(formatarNumero(param.getNumeroDoItem(), 3, 0)); st.append(formatarString(param.getCodigoSituacaoTributariaPisPasep(), 2)); st.append(formatarNumero(param.getAliquotaCreditoPisPasep(), 8, 4)); st.append(formatarNumero(param.getBaseCalculoCreditoPisPasep(), 17, 3)); st.append(formatarNumero(param.getValorCreditoPisPasepVinculadoReceitaExportacao(), 17, 2)); st.append(formatarNumero(param.getValorCreditoPisPasepVinculadoReceitaTributadaMercadoInterno(), 17, 2)); st.append(formatarNumero(param.getValorCreditoPisPasepVinculadoReceitaNaoTributadaMercadoInterno(), 17, 2)); st.append(formatarNumero(param.getValorCreditoPisPasep(),17,2)); st.append(formatarString(param.getCodigoSituacaoTributariaCofins(), 2)); st.append(formatarNumero(param.getAliquotaCreditoCofins(), 8, 4)); st.append(formatarNumero(param.getBaseCalculoCreditoCofins(), 17, 3)); st.append(formatarNumero(param.getValorCreditoCofinsVinculadoReceitaExportacao(), 17, 2)); st.append(formatarNumero(param.getValorCreditoCofinsVinculadoReceitaTributadaMercadoInterno(), 17, 2)); st.append(formatarNumero(param.getValorCreditoCofinsVinculadoReceitaNaoTributadaMercadoInterno(), 17, 2)); st.append(formatarNumero(param.getValorCreditoCofins(), 17, 2)); st.append(formatarData(param.getDataApropriacao())); return st.toString(); } }
[ "edpichler@localhost" ]
edpichler@localhost
52e7d59757e1cda21d7d0585ac0e95af93172739
07f2fa83cafb993cc107825223dc8279969950dd
/game_logic_server/src/main/java/com/xgame/logic/server/game/playerattribute/calculation/Counter113.java
272c784833f9b6ff8405b86415e08a45ba8e889b
[]
no_license
hw233/x2-slg-java
3f12a8ed700e88b81057bccc7431237fae2c0ff9
03dcdab55e94ee4450625404f6409b1361794cbf
refs/heads/master
2020-04-27T15:42:10.982703
2018-09-27T08:35:27
2018-09-27T08:35:27
174,456,389
0
1
null
null
null
null
UTF-8
Java
false
false
460
java
package com.xgame.logic.server.game.playerattribute.calculation; import org.springframework.stereotype.Component; import com.xgame.logic.server.game.playerattribute.constant.AttributesEnum; @Component public class Counter113 extends AttributeCounter { @Override public AttributesEnum getSelfAttribute() { return AttributesEnum.LASER_DAMAGE; } @Override public AttributesEnum getRelationAttribute() { return AttributesEnum.LASER_DAMAGE_PER; } }
[ "ityuany@126.com" ]
ityuany@126.com
b385c28afbd5c0a69dbddf6149aa7fae4cf2da4e
b0296d820c0400440232152485a0b3dff3e943be
/GTAS/GT-VAN/AuditTrail/Common/src/com/gridnode/gtas/audit/common/IGTArchiveConstant.java
e5c691708b67560aab7583e6b2c383e34b0a6bfc
[]
no_license
andytanoko/4.2.x_integration
74536c8933a98373b0118eeac66678b72b00aa8e
984842d92abaa797a19bd0f002ec45c9c37da288
refs/heads/master
2021-01-10T13:46:58.824451
2015-09-23T10:41:25
2015-09-23T10:41:25
46,325,977
0
1
null
null
null
null
UTF-8
Java
false
false
1,799
java
/** * This software is the proprietary information of GridNode Pte Ltd. * Use is subjected to license terms. * * Copyright 2001-2006 (C) GridNode Pte Ltd. All Rights Reserved. * * File: IGTArchiveConstant.java * **************************************************************************** * Date Author Changes **************************************************************************** * Feb 23, 2007 Tam Wei Xiang Created */ package com.gridnode.gtas.audit.common; /** * @author Tam Wei Xiang * * @since GT VAN (GT 4.0.3) */ public interface IGTArchiveConstant { public static final String ARCHIVE_NAME = "archiveName"; public static final String ARCHIVE_DESCRIPTION = "archiveDesc"; public static final String IS_ENABLED_ARCHIVED_SEARCHED = "enableArchivedSearch"; public static final String IS_ENABLED_RESTORE = "enableRestore"; public static final String ARCHIVE_ID = "archiveID"; public static final String ARCHIVE_TYPE = "archiveType"; public static final String ARCHIVE_TYPE_PI = "ProcessInstance"; public static final String ARCHIVE_TYPE_DOCUMENT = "Document"; public static final String ARCHIVE_OPERATION = "archiveOp"; public static final String ARCHIVE_OP_ARCHIVE = "archive"; public static final String ARCHIVE_OP_RESTORE = "restore"; public static final String ARCHIVE_STATUS = "archiveStatus"; public static final String ARCHIVE_SUMMARY_FILE = "archiveSummary"; public static final String CUSTOMER_ID = "customerID"; public static final String ARCHIVE_ORPHAN_RECORD = "archiveOrphanRecord"; public static final String ARCHIVE_JOBS_ID = "archiveJobID"; public static final String FROM_START_DATE_TIME = "fromStartDate"; public static final String TO_START_DATE_TIME = "toStartDate"; }
[ "muhamadnazir@gmail.com" ]
muhamadnazir@gmail.com
68a7a6d750c133d1238e2f0aab051d4086baf3a1
eea8956a163123256dcaaabbb2216d87c8c554e8
/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/widgets/cssmenu/CssMenuBuilder.java
5773e0a44ee88be6476815212f344e5216069010
[ "Apache-2.0" ]
permissive
cppc/isis
0f2c59f5e987a97ee4244bed32f704145f165f5f
fe44b4daa70e38fadf29638dc7e2bfcf52fe9b1b
refs/heads/master
2021-01-17T10:44:59.895832
2013-01-03T19:13:01
2013-01-03T19:13:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,837
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.isis.viewer.wicket.ui.components.widgets.cssmenu; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; import com.google.common.collect.Collections2; import org.apache.wicket.Application; import org.apache.isis.applib.filter.Filters; import org.apache.isis.core.metamodel.adapter.ObjectAdapter; import org.apache.isis.core.metamodel.spec.ActionType; import org.apache.isis.core.metamodel.spec.ObjectSpecification; import org.apache.isis.core.metamodel.spec.feature.ObjectAction; import org.apache.isis.core.metamodel.spec.feature.ObjectActionFilters; import org.apache.isis.core.metamodel.spec.feature.ObjectActions; import org.apache.isis.core.progmodel.facets.actions.notcontributed.NotContributedFacet; import org.apache.isis.core.runtime.system.context.IsisContext; import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento; import org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu.CssMenuItem.Builder; import org.apache.isis.viewer.wicket.ui.components.widgets.cssmenu.CssMenuPanel.Style; /** * Used to build a {@link CssMenuItem} hierarchy from a * {@link ObjectAdapterMemento object adapter}'s actions and any contributed * actions from services. */ public class CssMenuBuilder { private final ObjectAdapterMemento adapterMemento; private final List<ObjectAdapter> serviceAdapters; private final List<ObjectAction> actions; private final CssMenuLinkFactory cssMenuLinkFactory; public CssMenuBuilder(final ObjectAdapterMemento adapterMemento, final List<ObjectAdapter> serviceAdapters, final List<ObjectAction> actions, final CssMenuLinkFactory cssMenuLinkFactory) { this.adapterMemento = adapterMemento; this.serviceAdapters = serviceAdapters; this.actions = actions; this.cssMenuLinkFactory = cssMenuLinkFactory; } public CssMenuPanel buildPanel(final String wicketId, final String rootName) { final CssMenuItem findUsing = CssMenuItem.newMenuItem(rootName).build(); addMenuItems(findUsing, actions); final CssMenuPanel cssMenuPanel = new CssMenuPanel(wicketId, Style.SMALL, Collections.singletonList(findUsing)); return cssMenuPanel; } private void addMenuItems(final CssMenuItem parent, final List<ObjectAction> actions) { addMenuItemsForActionsOfType(parent, actions, ActionType.USER); if (isPrototyping()) { addMenuItemsForActionsOfType(parent, actions, ActionType.EXPLORATION); addMenuItemsForActionsOfType(parent, actions, ActionType.PROTOTYPE); } if (isDebugMode()) { addMenuItemsForActionsOfType(parent, actions, ActionType.DEBUG); } } public boolean isPrototyping() { return IsisContext.getDeploymentType().isPrototyping(); } /** * Protected so can be overridden in testing if required. */ protected boolean isDebugMode() { // TODO: need to figure out how to switch into debug mode; // probably call a Debug toggle page, and stuff into // Session.getMetaData() return true; } private void addMenuItemsForActionsOfType(final CssMenuItem parent, final List<ObjectAction> actions, final ActionType type) { final Collection<ObjectAction> filterActionsOfType = Collections2.filter(actions, Filters.asPredicate(ObjectActionFilters.filterOfType(type))); for (final ObjectAction action : filterActionsOfType) { addMenuItem(parent, action); } } private void addMenuItems(final CssMenuItem parent, final ObjectAction[] actions) { addMenuItems(parent, Arrays.asList(actions)); } private void addMenuItem(final CssMenuItem parent, final ObjectAction action) { if (action.getType() == ActionType.SET) { addMenuItemForActionSet(parent, action); } else { addMenuItemForAction(parent, action); } } private void addMenuItemForActionSet(final CssMenuItem parent, final ObjectAction action) { final Builder builder = parent.newSubMenuItem(action.getName()); final List<ObjectAction> actions = action.getActions(); addMenuItems(builder.itemBeingBuilt(), actions); if (builder.itemBeingBuilt().hasSubMenuItems()) { builder.build(); } } private void addMenuItemForAction(final CssMenuItem parent, final ObjectAction contributedAction) { // skip if annotated to not be contributed if (contributedAction.getFacet(NotContributedFacet.class) != null) { return; } final ObjectAdapterMemento serviceAdapterMemento = determineAdapterFor(contributedAction); if(serviceAdapterMemento == null) { return; } final Builder subMenuItemBuilder = parent.newSubMenuItem(serviceAdapterMemento, contributedAction, cssMenuLinkFactory); if (subMenuItemBuilder != null) { // could be null if invisible subMenuItemBuilder.build(); } } /** * It's a bit hokey to have to do this, but the * {@link ObjectSpecification#getServiceActionsReturning(ActionType...) * method we call} on {@link ObjectSpecification}, while nicely traversing * the services for us, unfortunately does not pass us back the service * adapters also. */ private ObjectAdapterMemento determineAdapterFor(final ObjectAction action) { // search through service adapters first final ObjectSpecification onType = action.getOnType(); for (final ObjectAdapter serviceAdapter : getServiceAdapters()) { if (serviceAdapter.getSpecification() == onType) { return ObjectAdapterMemento.createOrNull(serviceAdapter); } } // otherwise, specified adapter return adapterMemento; } protected List<ObjectAdapter> getServiceAdapters() { return serviceAdapters; } }
[ "danhaywood@apache.org" ]
danhaywood@apache.org
a2d63f26bd4e0b4d827cd338eaee4e293b24672c
9e72d2ec74a613a586499360707910e983a14370
/src/org/ace/insurance/report/agent/service/interfaces/IAgentSanctionService.java
cb55008d40f77384656a1cce038101b418f87a9e
[]
no_license
pyaesonehein1141991/FNI-LIFE
30ecefca8b12455c0a90906004f85f32217c5bf4
a40b502147b32193d467c2db7d49e2872f2fcab6
refs/heads/master
2020-08-31T11:20:22.757995
2019-10-30T11:02:47
2019-10-30T11:02:47
218,678,685
0
2
null
null
null
null
UTF-8
Java
false
false
1,139
java
package org.ace.insurance.report.agent.service.interfaces; import java.util.List; import org.ace.insurance.common.WorkFlowDTO; import org.ace.insurance.report.agent.AgentSanctionCriteria; import org.ace.insurance.report.agent.AgentSanctionDTO; import org.ace.insurance.report.agent.AgentSanctionInfo; import org.ace.insurance.system.common.PaymentChannel; import org.ace.insurance.system.common.bank.Bank; import org.ace.java.component.SystemException; public interface IAgentSanctionService { public List<AgentSanctionInfo> findAgents(AgentSanctionCriteria criteria) throws SystemException; public void sanctionAgent(List<AgentSanctionInfo> sanctionInfoList) throws SystemException; public List<AgentSanctionDTO> findAgentSanctionDTO(AgentSanctionCriteria criteria) throws SystemException; public List<AgentSanctionDTO> invoicedAgentSanction(List<AgentSanctionDTO> sanctionList, WorkFlowDTO workFlow, PaymentChannel paymentChannel, Bank bank, String bankAccountNo) throws SystemException; public List<AgentSanctionInfo> findAgentCommissionBySanctionNo(String sanctionNo) throws SystemException; }
[ "ASUS@DESKTOP-37IOB4I" ]
ASUS@DESKTOP-37IOB4I
e61bb3e9f5cb94985eff166b7c479c1bb355878b
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/serge-rider--dbeaver/367b3a6295a50f34e66cecab82a8ab087dc01101/before/CassandraStructValueHandler.java
8c9517e08ad17745f2514a332fbcdbeb3ca4b724
[]
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,841
java
/* * Copyright (C) 2010-2013 Serge Rieder * serge@jkiss.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.jkiss.dbeaver.ext.nosql.cassandra.data; import org.jkiss.dbeaver.model.exec.DBCException; import org.jkiss.dbeaver.model.exec.DBCExecutionContext; import org.jkiss.dbeaver.model.impl.jdbc.data.JDBCStruct; import org.jkiss.dbeaver.model.impl.jdbc.data.JDBCStructValueHandler; import org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCDataType; import org.jkiss.dbeaver.model.struct.DBSDataType; import org.jkiss.dbeaver.model.struct.DBSTypedObject; import java.sql.ResultSetMetaData; import java.sql.Struct; import java.sql.Types; /** * Object type support */ public class CassandraStructValueHandler extends JDBCStructValueHandler { public static final CassandraStructValueHandler INSTANCE = new CassandraStructValueHandler(); @Override public Object getValueFromObject(DBCExecutionContext context, DBSTypedObject type, Object object, boolean copy) throws DBCException { if (object == null) { return new JDBCStruct(context, makeEmptyType(context), null); } else if (object instanceof JDBCStruct) { return copy ? ((JDBCStruct) object).cloneValue(context.getProgressMonitor()) : object; } else if (object instanceof Struct) { // Obtain metadata information from struct ResultSetMetaData metaData = null; try { metaData = (ResultSetMetaData) object.getClass().getMethod("getMetaData").invoke(object); } catch (Throwable e) { // No metadata, use as plain value } return new JDBCStruct(context, makeEmptyType(context), (Struct) object, metaData); } else { throw new DBCException("Unsupported struct type: " + object.getClass().getName()); } } private DBSDataType makeEmptyType(DBCExecutionContext context) { return new JDBCDataType( context.getDataSource().getContainer(), Types.STRUCT, "ROW", "Cassandra struct type", false, false, 0, 0, 0); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
1d44f79f9dad7b1391522c6eedf754e57dda3155
900cc3d78a80407260c663c1c22fd6756fcfe9cf
/src/org/aerogear/android/impl/datamanager/MemoryStorage.java
452e11859ab7a650667dbe9f403490bb342ebac0
[]
no_license
qmx/aerogear-android
5431956e3e39b74f8d4b65d8abc4e968175d9fa6
d03c06e992a6dd54c11d40a8fa5a277738bf2545
refs/heads/master
2020-12-29T03:07:21.727249
2012-10-31T19:21:24
2012-10-31T20:10:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,119
java
/* * JBoss, Home of Professional Open Source * Copyright 2012, Red Hat, Inc., and individual contributors * by the @authors tag. See the copyright.txt in the distribution for a * full listing of individual contributors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.aerogear.android.impl.datamanager; import org.aerogear.android.datamanager.IdGenerator; import org.aerogear.android.datamanager.Store; import java.io.Serializable; import java.util.*; /** * Memory implementation of Store {@link Store}. */ public class MemoryStorage<T> implements Store<T> { private final Map<Serializable, T> data = new HashMap<Serializable, T>(); private final IdGenerator idGenerator; public MemoryStorage(IdGenerator idGenerator) { this.idGenerator = idGenerator; } /** * {@inheritDoc} */ @Override public StoreType getType() { return StoreType.MEMORY; } /** * {@inheritDoc} */ @Override public Collection<T> readAll() { return data.values(); } /** * {@inheritDoc} */ @Override public T read(Serializable id) { return data.get(id); } /** * {@inheritDoc} */ @Override public void save(T item) { Serializable newId = idGenerator.generate(); // TODO Put newId on item data.put(newId, item); } /** * {@inheritDoc} */ @Override public void reset() { data.clear(); } /** * {@inheritDoc} */ @Override public void remove(Serializable id) { data.remove(id); } }
[ "bruno@abstractj.org" ]
bruno@abstractj.org
9fa8abb08d880faacc87f6b53b18e0163521ad5f
15c33eb2ad75385ae16e5d4309f49665b2cce0fa
/Java/lib/iRadar/M整合PHP/src/com/isoft/iradar/model/params/CItemPrototypeGet.java
394a434e1c2f52fe52b33a59eeaeece35af4ac49
[]
no_license
caocaodl/zabbix_with_java
588cb13ebce707bec79611981149582cb6712ed2
41d1e8b5bb417b5010678ffc9dff795e5d218c75
refs/heads/master
2021-01-21T23:16:51.657808
2017-06-26T11:12:51
2017-06-26T11:12:51
95,219,984
4
4
null
null
null
null
UTF-8
Java
false
false
2,812
java
package com.isoft.iradar.model.params; public class CItemPrototypeGet extends CParamGet { private static final long serialVersionUID = 1L; private Long[] groupIds; private Long[] templateIds; private Long[] hostIds; private Long[] itemIds; private Long[] discoveryIds; private Long[] graphIds; private Long[] triggerIds; private Boolean inherited; private Boolean templated; private Boolean monitored; private Object selectHosts; private Object selectApplications; private Object selectTriggers; private Object selectGraphs; private Object selectDiscoveryRule; public Long[] getGroupIds() { return groupIds; } public void setGroupIds(Long... groupIds) { this.groupIds = groupIds; } public Long[] getTemplateIds() { return templateIds; } public void setTemplateIds(Long... templateIds) { this.templateIds = templateIds; } public Long[] getHostIds() { return hostIds; } public void setHostIds(Long... hostIds) { this.hostIds = hostIds; } public Long[] getItemIds() { return itemIds; } public void setItemIds(Long... itemIds) { this.itemIds = itemIds; } public Long[] getDiscoveryIds() { return discoveryIds; } public void setDiscoveryIds(Long... discoveryIds) { this.discoveryIds = discoveryIds; } public Long[] getGraphIds() { return graphIds; } public void setGraphIds(Long... graphIds) { this.graphIds = graphIds; } public Long[] getTriggerIds() { return triggerIds; } public void setTriggerIds(Long... triggerIds) { this.triggerIds = triggerIds; } public Boolean getInherited() { return inherited; } public void setInherited(Boolean inherited) { this.inherited = inherited; } public Boolean getTemplated() { return templated; } public void setTemplated(Boolean templated) { this.templated = templated; } public Boolean getMonitored() { return monitored; } public void setMonitored(Boolean monitored) { this.monitored = monitored; } public Object getSelectHosts() { return selectHosts; } public void setSelectHosts(Object selectHosts) { this.selectHosts = selectHosts; } public Object getSelectApplications() { return selectApplications; } public void setSelectApplications(Object selectApplications) { this.selectApplications = selectApplications; } public Object getSelectTriggers() { return selectTriggers; } public void setSelectTriggers(Object selectTriggers) { this.selectTriggers = selectTriggers; } public Object getSelectGraphs() { return selectGraphs; } public void setSelectGraphs(Object selectGraphs) { this.selectGraphs = selectGraphs; } public Object getSelectDiscoveryRule() { return selectDiscoveryRule; } public void setSelectDiscoveryRule(Object selectDiscoveryRule) { this.selectDiscoveryRule = selectDiscoveryRule; } }
[ "wlx0710@gmail.com" ]
wlx0710@gmail.com
c71a850e840e9e04a03f70f4f8485335c061c73d
47eb5bf54da6c19ca175fc8938ca9b6a2b545dfa
/euicc-tool/src/main/java/com/whty/tool/handler/PukHandler.java
785954cd57ea18d8565d8663499674ad4d0562de
[]
no_license
liszhu/whatever_ty
44ddb837f2de19cb980c28fe06e6634f9d6bd8cb
e02ef9e125cac9103848c776e420edcf0dcaed2f
refs/heads/master
2021-12-13T21:37:06.539805
2017-04-05T01:50:23
2017-04-05T01:50:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,802
java
package com.whty.tool.handler; import static com.whty.tool.util.Util.replaceBlank; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang3.StringUtils; import com.whty.tool.util.Constant; import com.whty.tool.util.Util; /** * 预个人化脚本指令转换-Puk 模块 * @author Administrator * */ public class PukHandler { public static String pukHandler(List<String> lines,int peID) throws Exception{ if(lines == null)return null; List<String>list = new ArrayList<String>(); for (String line : lines) { if(StringUtils.isBlank(line))continue; line = StringUtils.upperCase(replaceBlank(line)); line = StringUtils.remove(line, " "); if (StringUtils.startsWith(line, Constant.PUK_PREFIX)) { dealPukApdus(list, line); } } String resultStr = addHeader(list,peID); System.out.println("the last puk:" + resultStr); return resultStr; } private static void dealPukApdus(List<String> list, String line) { String str = line.substring(10); String keyReference = str.substring(0, 2);//80 String maxNumOfAtte = str.substring(12, 14);//82 String pukValue = str.substring(16);//81 String tagWithKeyRefer = Util.toTLV("80", "00"+keyReference); String tagWithpukValue = Util.toTLV("81", pukValue); String tagWithMaxOfAtt = Util.toTLV("82", maxNumOfAtte); str = Util.toTLV("30", tagWithKeyRefer + tagWithpukValue + tagWithMaxOfAtt); list.add(str); } private static String addHeader(List<String> list,int peId) throws Exception { String packagesString = Util.totalStr(list); String peString = Util.itoa(peId);//16 String peHeader = Util.toTLV("A0", "80008101" + peString); String pinString = Util.toTLV("A1", packagesString); String resultStr = Util.toTLV("A3", peHeader + pinString); return resultStr; } }
[ "652241956@qq.com" ]
652241956@qq.com
160a8e9726df49c091f23d112197aa10c06a7914
7471b1b8fe435f08d707c9d4771f4da4754e3124
/lightadapter/src/main/java/com/zfy/adapter/able/Sectionable.java
f0deb242c8ba08f3b4ac1bb67a2c640a8e8c4a42
[ "Apache-2.0" ]
permissive
huberyHU2018/LightAdapter
8f4563830fcf6cd27dc82ef9a80b55b10e8d7931
f2d0f0a8d0bd313cd2ff0092a7d9b37f944685cd
refs/heads/master
2020-04-12T08:36:13.934623
2018-12-19T01:23:08
2018-12-19T01:23:08
162,389,840
2
0
Apache-2.0
2018-12-19T05:58:51
2018-12-19T05:58:51
null
UTF-8
Java
false
false
354
java
package com.zfy.adapter.able; /** * CreateAt : 2018/11/10 * Describe : * 使用该接口表明该数据是一个 Section 类型的数据, * 当 isSection() 返回 true 时表示该数据是一个 Section * * @see com.zfy.adapter.delegate.impl.SectionDelegate * * @author chendong */ public interface Sectionable { boolean isSection(); }
[ "1101873740@qq.com" ]
1101873740@qq.com
acfb1e6a212b89e9221027ef82f627e69cd4f365
589f0b4b8a0cac2d961966d06e08aaef93de940d
/src/test/java/com/fss/onboard/config/WebConfigurerTest.java
e21f2e3c032c5810b8cffb57c21fcbfcda9345cc
[]
no_license
Narendrac77/merchant-onboard-application
a4214fe7fb3110f219aa296364845bad2c9f7d9a
bcceca8604605c844018e9d086d1aa43f830ee7d
refs/heads/main
2023-03-29T13:08:58.916383
2021-04-09T06:31:42
2021-04-09T06:31:42
356,161,947
0
0
null
null
null
null
UTF-8
Java
false
false
5,944
java
package com.fss.onboard.config; import static org.assertj.core.api.Assertions.assertThatCode; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.options; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import java.util.*; import javax.servlet.*; import org.h2.server.web.WebServlet; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.http.HttpHeaders; import org.springframework.mock.env.MockEnvironment; import org.springframework.mock.web.MockServletContext; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import tech.jhipster.config.JHipsterConstants; import tech.jhipster.config.JHipsterProperties; /** * Unit tests for the {@link WebConfigurer} class. */ class WebConfigurerTest { private WebConfigurer webConfigurer; private MockServletContext servletContext; private MockEnvironment env; private JHipsterProperties props; @BeforeEach public void setup() { servletContext = spy(new MockServletContext()); doReturn(mock(FilterRegistration.Dynamic.class)).when(servletContext).addFilter(anyString(), any(Filter.class)); doReturn(mock(ServletRegistration.Dynamic.class)).when(servletContext).addServlet(anyString(), any(Servlet.class)); env = new MockEnvironment(); props = new JHipsterProperties(); webConfigurer = new WebConfigurer(env, props); } @Test void shouldStartUpProdServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); assertThatCode(() -> webConfigurer.onStartup(servletContext)).doesNotThrowAnyException(); verify(servletContext, never()).addServlet(eq("H2Console"), any(WebServlet.class)); } @Test void shouldStartUpDevServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); assertThatCode(() -> webConfigurer.onStartup(servletContext)).doesNotThrowAnyException(); verify(servletContext).addServlet(eq("H2Console"), any(WebServlet.class)); } @Test void shouldCorsFilterOnApiPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("other.domain.com")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props.getCors().setAllowCredentials(true); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build(); mockMvc .perform( options("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domain.com") .header(HttpHeaders.ACCESS_CONTROL_REQUEST_METHOD, "POST") ) .andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")) .andExpect(header().string(HttpHeaders.VARY, "Origin")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,POST,PUT,DELETE")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_CREDENTIALS, "true")) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_MAX_AGE, "1800")); mockMvc .perform(get("/api/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, "other.domain.com")); } @Test void shouldCorsFilterOnOtherPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("*")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props.getCors().setAllowCredentials(true); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build(); mockMvc .perform(get("/test/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } @Test void shouldCorsFilterDeactivatedForNullAllowedOrigins() throws Exception { props.getCors().setAllowedOrigins(null); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build(); mockMvc .perform(get("/api/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } @Test void shouldCorsFilterDeactivatedForEmptyAllowedOrigins() throws Exception { props.getCors().setAllowedOrigins(new ArrayList<>()); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()).addFilters(webConfigurer.corsFilter()).build(); mockMvc .perform(get("/api/test-cors").header(HttpHeaders.ORIGIN, "other.domain.com")) .andExpect(status().isOk()) .andExpect(header().doesNotExist(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN)); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
bfe455257c8c5658971a33c08022fccc3d7cd5a7
e75cf3fc4e6569583270ac0f3626453c464fe020
/Android/第三方完整APP源码/mogutt/TTAndroidClient/mgandroid-teamtalk/src/com/mogujie/tt/socket/SocketStateManager.java
0d9bca10c512c08897df446d8db002f2c230b2e3
[]
no_license
hailongfeng/zhishiku
c87742e8819c1a234f68f3be48108b244e8a265f
b62bb845a88248855d118bc571634cc94f34efcb
refs/heads/master
2022-12-26T00:00:48.455098
2020-02-26T09:22:05
2020-02-26T09:22:05
133,133,919
1
9
null
2022-12-16T00:35:57
2018-05-12T09:56:41
Java
UTF-8
Java
false
false
600
java
package com.mogujie.tt.socket; public class SocketStateManager { private boolean mbOnline = false; private SocketStateManager() { } private static class SingletonHolder { private static SocketStateManager instance = new SocketStateManager(); } public static SocketStateManager getInstance() { return SingletonHolder.instance; } public void setState(boolean bOnline) { mbOnline = bOnline; // StateManager.getInstance().notifySocketState(bOnline); } public boolean isOnline() { return mbOnline; } }
[ "no_1hailong@yeah.net" ]
no_1hailong@yeah.net
054c2dbebf15af5f3b85ea3f6e413dd77cd514f8
20ecfcaea334a6371edd0c24733b087000ea0106
/src/main/java/com/glaf/chart/gen/ChartProperties.java
202cce79f6e1a5936a1574a5616fe4652c11f741
[ "Apache-2.0" ]
permissive
gitee2008/glaf
a0d312390dac3e44426dc15e23afb9c34bdac0d9
5fa5a7d48f7fc8d2409ee38c2ee070563e8d8dbd
refs/heads/master
2022-12-21T11:11:13.229342
2020-10-20T13:37:16
2020-10-20T13:37:16
97,379,234
2
4
Apache-2.0
2022-12-16T15:51:41
2017-07-16T11:37:04
JavaScript
UTF-8
Java
false
false
5,887
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 com.glaf.chart.gen; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Enumeration; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.lang3.StringUtils; import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.glaf.core.config.SystemProperties; import com.glaf.core.util.IOUtils; import com.glaf.core.util.PropertiesUtils; public class ChartProperties { protected final static String DEFAULT_CONFIG = "/conf/chart.properties"; protected static volatile Properties properties = new Properties(); protected static AtomicBoolean loading = new AtomicBoolean(false); protected static List<ChartType> types = new java.util.concurrent.CopyOnWriteArrayList<ChartType>(); protected static ConcurrentMap<String, ChartType> chartTypes = new ConcurrentHashMap<String, ChartType>(); static { try { reload(); } catch (Exception ex) { } } public static boolean getBoolean(String key) { if (hasObject(key)) { String value = properties.getProperty(key); return Boolean.valueOf(value).booleanValue(); } return false; } public static ChartType getChartType(String type) { return chartTypes.get(type); } public static List<ChartType> getChartTypes() { return types; } public static double getDouble(String key) { if (hasObject(key)) { String value = properties.getProperty(key); return Double.valueOf(value).doubleValue(); } return 0; } public static int getInt(String key) { if (hasObject(key)) { String value = properties.getProperty(key); return Integer.valueOf(value).intValue(); } return 0; } public static long getLong(String key) { if (hasObject(key)) { String value = properties.getProperty(key); return Long.valueOf(value).longValue(); } return 0; } public static Properties getProperties() { Properties p = new Properties(); Enumeration<?> e = properties.keys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); String value = properties.getProperty(key); p.put(key, value); } return p; } public static String getString(String key) { if (hasObject(key)) { String value = properties.getProperty(key); return value; } return ""; } public static boolean hasObject(String key) { if (key == null || properties == null) { return false; } String value = properties.getProperty(key); if (value != null) { return true; } return false; } public static void reload() { if (!loading.get()) { InputStream inputStream = null; try { loading.set(true); String filename = SystemProperties.getConfigRootPath() + DEFAULT_CONFIG; Resource resource = new FileSystemResource(filename); if (resource.exists()) { System.out.println("load chart config:" + resource.getFile().getAbsolutePath()); inputStream = new FileInputStream(resource.getFile() .getAbsolutePath()); properties.clear(); Properties props = PropertiesUtils .loadProperties(inputStream); if (props != null) { Enumeration<?> e = props.keys(); while (e.hasMoreElements()) { String key = (String) e.nextElement(); String value = props.getProperty(key); properties.setProperty(key, value); } } if (properties.keys().hasMoreElements()) { Enumeration<?> e = properties.keys(); while (e.hasMoreElements()) { String name = (String) e.nextElement(); String value = properties.getProperty(name); if (StringUtils.isNotEmpty(value) && (value.length() > 0 && value.charAt(0) == '{') && value.endsWith("}")) { JSONObject jsonObject = JSON.parseObject(value); String className = jsonObject .getString("className"); if (StringUtils.isNotEmpty(className)) { ChartType m = new ChartType(); m.setClassName(className); m.setType(name); m.setTitle(jsonObject.getString("title")); Map<String, String> dataMap = new java.util.HashMap<String, String>(); Set<Entry<String, Object>> entrySet = jsonObject .entrySet(); for (Entry<String, Object> entry : entrySet) { String key = entry.getKey(); Object v = entry.getValue(); if (v != null) { dataMap.put(key, v.toString()); } } m.setDataMap(dataMap); types.add(m); chartTypes.put(name, m); } } } } } } catch (IOException ex) { ex.printStackTrace(); throw new RuntimeException(ex); } finally { loading.set(false); IOUtils.closeStream(inputStream); } } } private ChartProperties() { } }
[ "jior2008@163.com" ]
jior2008@163.com
a08791eee0e4582ced4a0c9b84f91609f6348787
f11913610e93f6a925204d9e9482980db4a809b6
/examples/dk.dtu.imm.se.ecno.examples.vendingmachine.split.part1.edit/src/example/emf/vendingmachine/provider/SafeItemProvider.java
69d02832fcef576ed03a50335aacfd4573e889e7
[]
no_license
ekkart/ECNO
c402cfbebf29b27f15524459058a72c2c3852a80
2cf7eb844ef897ab4a4d56ae72721d4b000bc34c
refs/heads/master
2020-03-06T23:53:07.109577
2020-03-03T19:57:54
2020-03-03T19:57:54
127,144,163
1
0
null
null
null
null
UTF-8
Java
false
false
2,993
java
/** * <copyright> * </copyright> * * $Id$ */ package example.emf.vendingmachine.provider; import java.util.Collection; import java.util.List; import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.IItemPropertySource; import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; import org.eclipse.emf.edit.provider.ITreeItemContentProvider; /** * This is the item provider adapter for a {@link example.emf.vendingmachine.Safe} object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class SafeItemProvider extends VendingMachineComponentItemProvider implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { /** * This constructs an instance from a factory and a notifier. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public SafeItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); } return itemPropertyDescriptors; } /** * This returns Safe.gif. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Safe")); } /** * This returns the label text for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String getText(Object object) { return getString("_UI_Safe_type"); } /** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void notifyChanged(Notification notification) { updateChildren(notification); super.notifyChanged(notification); } /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } }
[ "ekki@dtu.dk" ]
ekki@dtu.dk
43268ced8358e4e9254ae622bf58934228ee8db3
4f8dfcdd6f1494b59684438b8592c6c5c2e63829
/DiffTGen-result/output/patch3-Math-5-CapGen-plausible/Math_5_3-plausible_capgen/target/0/17/evosuite-tests/org/apache/commons/math3/complex/Complex_ESTest_scaffolding.java
69dcc62322bc487d341dc866ff4ab73f790b57e7
[]
no_license
IntHelloWorld/Ddifferent-study
fa76c35ff48bf7a240dbe7a8b55dc5a3d2594a3b
9782867d9480e5d68adef635b0141d66ceb81a7e
refs/heads/master
2021-04-17T11:40:12.749992
2020-03-31T23:58:19
2020-03-31T23:58:19
249,439,516
0
0
null
null
null
null
UTF-8
Java
false
false
6,897
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Mar 28 12:14:00 GMT 2020 */ package org.apache.commons.math3.complex; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class Complex_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math3.complex.Complex"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("file.encoding", "UTF-8"); java.lang.System.setProperty("java.awt.headless", "true"); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); java.lang.System.setProperty("user.country", "US"); java.lang.System.setProperty("user.dir", "/home/hewitt/work/DiffTGen-master/output/patch3-Math-5-CapGen-plausible/Math_5_3-plausible_capgen/target/0/17"); java.lang.System.setProperty("user.home", "/home/hewitt"); java.lang.System.setProperty("user.language", "en"); java.lang.System.setProperty("user.name", "hewitt"); java.lang.System.setProperty("user.timezone", "Asia/Chongqing"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Complex_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math3.util.Precision", "org.apache.commons.math3.exception.util.ExceptionContextProvider", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.exception.MathArithmeticException", "org.apache.commons.math3.complex.Complex", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.util.FastMath$ExpIntTable", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.exception.NotPositiveException", "org.apache.commons.math3.util.FastMath$ExpFracTable", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.util.FastMath$CodyWaite", "org.apache.commons.math3.complex.ComplexField", "org.apache.commons.math3.util.MathUtils", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.complex.ComplexField$LazyHolder", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.FieldElement", "org.apache.commons.math3.exception.util.Localizable", "org.apache.commons.math3.complex.ComplexField$1", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.Field", "org.apache.commons.math3.exception.NotFiniteNumberException", "org.apache.commons.math3.util.FastMathLiteralArrays" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(Complex_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.math3.complex.Complex", "org.apache.commons.math3.util.FastMath", "org.apache.commons.math3.util.FastMathLiteralArrays", "org.apache.commons.math3.util.FastMath$ExpIntTable", "org.apache.commons.math3.util.FastMath$ExpFracTable", "org.apache.commons.math3.util.FastMath$lnMant", "org.apache.commons.math3.util.Precision", "org.apache.commons.math3.exception.util.LocalizedFormats", "org.apache.commons.math3.complex.ComplexField", "org.apache.commons.math3.complex.ComplexField$LazyHolder", "org.apache.commons.math3.util.MathUtils", "org.apache.commons.math3.exception.MathIllegalArgumentException", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.exception.util.ExceptionContext", "org.apache.commons.math3.exception.util.ArgUtils", "org.apache.commons.math3.util.FastMath$CodyWaite", "org.apache.commons.math3.exception.MathIllegalNumberException", "org.apache.commons.math3.exception.NumberIsTooSmallException", "org.apache.commons.math3.exception.NotPositiveException" ); } }
[ "1009479460@qq.com" ]
1009479460@qq.com
8017dffd3aeba970fbb619591ce950c55f94962e
6b29e429d089c112d6c3ca49c85edcff87848eda
/src/main/java/com/rci/bean/entity/DishType.java
2ee13b3ff6ee57b1136ba1745ceaba82674299a4
[]
no_license
happyjianguo/Reconciliation-1
0bf7b7e642eb1efb38361a26422a7709976c35d6
a383bec7bd23ada871d8414dbdb15e1df8bf4133
refs/heads/master
2020-07-15T23:45:50.577566
2015-04-18T15:52:50
2015-04-18T15:52:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,112
java
package com.rci.bean.entity; import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import com.rci.annotation.ColumnName; /** * 菜品类型表, 与收银机系统表 [ cybr_bt_dish_type ]同步。如:火锅,香辣炸鸡,饮料 * @author zj * */ @Entity @Table(name="tb_dish_type") public class DishType extends BaseEntity{ /** * */ private static final long serialVersionUID = -4389210770108478872L; private Integer version; private Long dtid; /* 类型编号 */ private String dtNo; /* 类型名称 */ private String dtName; private List<Dish> dishes; private String beDiscount; @Id @GeneratedValue(strategy=GenerationType.IDENTITY) // MYSQL ID generator @Column(name="dtid", nullable=false,updatable=false) public Long getDtid() { return dtid; } public void setDtid(Long dtid) { this.dtid = dtid; } @Column(name="dish_type_no") public String getDtNo() { return dtNo; } @ColumnName("ch_typeno") public void setDtNo(String dtNo) { this.dtNo = dtNo; } @Column(name="dish_type_name") public String getDtName() { return dtName; } @ColumnName("vch_typename") public void setDtName(String dtName) { this.dtName = dtName; } @OneToMany(cascade=CascadeType.ALL,fetch=FetchType.EAGER,mappedBy="dishType") public List<Dish> getDishes() { return dishes; } public void setDishes(List<Dish> dishes) { this.dishes = dishes; } @Column(name="discount") public String getBeDiscount() { return beDiscount; } public void setBeDiscount(String beDiscount) { this.beDiscount = beDiscount; } @Override public Integer getVersion() { return version; } @Override public void setVersion(Integer version) { this.version = version; } }
[ "eric87com@gmail.com" ]
eric87com@gmail.com
2c72b37b623bf991ca898b3e249e203ab50b1397
3ca53c13d2953805c00406476ceda9684887a8ad
/src/com/iwxxm/metarSpeci/TMPeriodDurationPropertyType.java
22a3cd619aeaeede3f918813daea778b83826074
[]
no_license
yw2017051032/tac2iwxxm
ae93c12b08b7316cd59de032d4ae2e8082bc6c0b
5a08cb9ecd0833fd4435bf6db81a2b8126380ec1
refs/heads/master
2020-03-17T03:03:06.671868
2018-06-05T16:55:59
2018-06-05T17:06:03
133,217,637
3
0
null
null
null
null
GB18030
Java
false
false
3,139
java
// // 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.8-b130911.1802 生成的 // 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // 在重新编译源模式时, 对此文件的所有修改都将丢失。 // 生成时间: 2018.04.04 时间 09:34:11 PM CST // package com.iwxxm.metarSpeci; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.Duration; /** * <p>TM_PeriodDuration_PropertyType complex type的 Java 类。 * * <p>以下模式片段指定包含在此类中的预期内容。 * * <pre> * &lt;complexType name="TM_PeriodDuration_PropertyType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence minOccurs="0"> * &lt;element ref="{http://www.isotc211.org/2005/gts}TM_PeriodDuration"/> * &lt;/sequence> * &lt;attribute ref="{http://www.isotc211.org/2005/gco}nilReason"/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TM_PeriodDuration_PropertyType", namespace = "http://www.isotc211.org/2005/gts", propOrder = { "tmPeriodDuration" }) public class TMPeriodDurationPropertyType { @XmlElement(name = "TM_PeriodDuration") protected Duration tmPeriodDuration; @XmlAttribute(name = "nilReason", namespace = "http://www.isotc211.org/2005/gco") protected List<String> nilReason; /** * 获取tmPeriodDuration属性的值。 * * @return * possible object is * {@link Duration } * */ public Duration getTMPeriodDuration() { return tmPeriodDuration; } /** * 设置tmPeriodDuration属性的值。 * * @param value * allowed object is * {@link Duration } * */ public void setTMPeriodDuration(Duration value) { this.tmPeriodDuration = value; } /** * Gets the value of the nilReason property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the nilReason property. * * <p> * For example, to add a new item, do as follows: * <pre> * getNilReason().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getNilReason() { if (nilReason == null) { nilReason = new ArrayList<String>(); } return this.nilReason; } }
[ "852406820@qq.com" ]
852406820@qq.com
ccd1d2bcd20063cf0bb128c24632ea888a3ae7ba
781e2692049e87a4256320c76e82a19be257a05d
/all_data/cs61bl/lab04/cs61bl-mx/Line4.java
7328d364c1ead6933d33bf7c3fe22065306dadcc
[]
no_license
itsolutionscorp/AutoStyle-Clustering
54bde86fe6dbad35b568b38cfcb14c5ffaab51b0
be0e2f635a7558f56c61bc0b36c6146b01d1e6e6
refs/heads/master
2020-12-11T07:27:19.291038
2016-03-16T03:18:00
2016-03-16T03:18:42
59,454,921
4
0
null
2016-05-23T05:40:56
2016-05-23T05:40:56
null
UTF-8
Java
false
false
1,333
java
import java.awt.Point; public class Line4 { Point[] points; void printLength() { double length; length = Math.sqrt ( (points[1].getX()-points[0].getX())*(points[1].getX()-points[0].getX()) + (points[1].getY()-points[0].getY())*(points[1].getY()-points[0].getY()) ) ; System.out.println ("Line length is " + length); } void printAngle() { double angleInDegrees = Math.atan2 ( points[1].getY()-points[0].getY(), points[1].getX()-points[0].getX() ) * 180.0 / Math.PI; System.out.println ("Angle is " + angleInDegrees + " degrees"); } public static void main(String[] args) { System.out.println ("testing Line4"); /* * Here you should set myLine to contain a reference to a new line * object. Initialize myLine's p1 (element 0 of points) to the point (5, * 10), and initialize myLine's p2 (element 1 of points) to the point * (45, 40). Print the line's length, which should be 50. Print the * line's angle, which should be around 36.87 degrees. */ Line4 myLine = new Line4 (); myLine.points = new Point[2]; myLine.points[0] = new Point(5, 10); myLine.points[1] = new Point(45, 40); myLine.printLength (); myLine.printAngle(); } }
[ "moghadam.joseph@gmail.com" ]
moghadam.joseph@gmail.com
8c4c89fe084bfb3ef4d22f7e2c86c8340c63745d
5e846007d2395e638f91f77796fb331032b3fbe4
/src/generated/java/ch/ech/xmlns/ech_0098/_3/MainResidenceType.java
d5de37e1b1aa716a9e8509e7f1a4d17027e4ff7b
[ "MIT" ]
permissive
edigonzales-archiv/LandRegisterParcelDescription
8414bde32cc1ebd87cff9ba7b5de1900836fe1fb
6f1acea246567281a5521f96d27d97ff77e1b18e
refs/heads/master
2020-04-05T12:26:50.806513
2019-02-27T18:21:42
2019-02-27T18:21:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,392
java
package ch.ech.xmlns.ech_0098._3; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; import ch.ech.xmlns.ech_0007._6.Gemeinde; /** * <p>Java class for mainResidenceType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="mainResidenceType"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="reportingMunicipality" type="{http://www.ech.ch/xmlns/eCH-0007/6}swissMunicipalityType"/&gt; * &lt;element name="arrivalDate" type="{http://www.w3.org/2001/XMLSchema}date"/&gt; * &lt;element name="comesFrom" type="{http://www.ech.ch/xmlns/eCH-0098/3}destinationType" minOccurs="0"/&gt; * &lt;element name="businessAddress" type="{http://www.ech.ch/xmlns/eCH-0098/3}dwellingAddressType"/&gt; * &lt;element name="departureDate" type="{http://www.w3.org/2001/XMLSchema}date" minOccurs="0"/&gt; * &lt;element name="goesTo" type="{http://www.ech.ch/xmlns/eCH-0098/3}destinationType" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "mainResidenceType", propOrder = { "reportingMunicipality", "arrivalDate", "comesFrom", "businessAddress", "departureDate", "goesTo" }) public class MainResidenceType { @XmlElement(required = true) protected Gemeinde reportingMunicipality; @XmlElement(required = true) @XmlSchemaType(name = "date") protected XMLGregorianCalendar arrivalDate; protected DestinationType comesFrom; @XmlElement(required = true) protected DwellingAddressType businessAddress; @XmlSchemaType(name = "date") protected XMLGregorianCalendar departureDate; protected DestinationType goesTo; /** * Gets the value of the reportingMunicipality property. * * @return * possible object is * {@link Gemeinde } * */ public Gemeinde getReportingMunicipality() { return reportingMunicipality; } /** * Sets the value of the reportingMunicipality property. * * @param value * allowed object is * {@link Gemeinde } * */ public void setReportingMunicipality(Gemeinde value) { this.reportingMunicipality = value; } /** * Gets the value of the arrivalDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getArrivalDate() { return arrivalDate; } /** * Sets the value of the arrivalDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setArrivalDate(XMLGregorianCalendar value) { this.arrivalDate = value; } /** * Gets the value of the comesFrom property. * * @return * possible object is * {@link DestinationType } * */ public DestinationType getComesFrom() { return comesFrom; } /** * Sets the value of the comesFrom property. * * @param value * allowed object is * {@link DestinationType } * */ public void setComesFrom(DestinationType value) { this.comesFrom = value; } /** * Gets the value of the businessAddress property. * * @return * possible object is * {@link DwellingAddressType } * */ public DwellingAddressType getBusinessAddress() { return businessAddress; } /** * Sets the value of the businessAddress property. * * @param value * allowed object is * {@link DwellingAddressType } * */ public void setBusinessAddress(DwellingAddressType value) { this.businessAddress = value; } /** * Gets the value of the departureDate property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getDepartureDate() { return departureDate; } /** * Sets the value of the departureDate property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public void setDepartureDate(XMLGregorianCalendar value) { this.departureDate = value; } /** * Gets the value of the goesTo property. * * @return * possible object is * {@link DestinationType } * */ public DestinationType getGoesTo() { return goesTo; } /** * Sets the value of the goesTo property. * * @param value * allowed object is * {@link DestinationType } * */ public void setGoesTo(DestinationType value) { this.goesTo = value; } }
[ "edi.gonzales@gmail.com" ]
edi.gonzales@gmail.com
34c8381ab1d74c6b7962a5443902b1e26350f1a9
add46edfe429b1711fe1c41661851eab3975c974
/service-base/src/main/java/com/cnuip/base/domain/params/LabelValueParam.java
0b0cacabd5a65f074017bef5d0e360366de7a221
[]
no_license
yuervsxiami/store
4f47d46655b2c170567f114cd2c3ff516e151b3b
f4992712bc88927744e162cf9e380cb08ff38af1
refs/heads/master
2022-06-29T05:04:42.081957
2020-01-15T09:05:10
2020-01-15T09:05:10
222,386,070
0
0
null
2022-06-17T02:41:37
2019-11-18T07:16:24
Java
UTF-8
Java
false
false
3,031
java
package com.cnuip.base.domain.params; import com.cnuip.base.base.QueryParam; import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * @Author: 王志斌 * @Date: 2018/4/3 15:27 */ @JsonInclude(JsonInclude.Include.NON_NULL) @ApiModel(value = "成果标签值表查询实体", description = "成果标签值表查询实体") public class LabelValueParam extends QueryParam { /** rlt_label.id */ @ApiModelProperty(value="", name="labelId", dataType="Long") private Long labelId; public void setLabelId(Long labelId) { this.labelId = labelId; } public Long getLabelId() { return this.labelId; } /** 值 */ @ApiModelProperty(value="值", name="value", dataType="String") private String value; public void setValue(String value) { this.value = value; } public String getValue() { return this.value; } /** 是否删除 [ YES.是 NO.否 ] */ /** YesNoEnum */ @ApiModelProperty(value="是否删除 [ YES.是 NO.否 ]", name="isDelete", dataType="String", example="NO") private String isDelete; public void setIsDelete(String isDelete) { this.isDelete = isDelete; } public String getIsDelete() { return this.isDelete; } /** 操作人 mbr_user.id */ @ApiModelProperty(value="操作人", name="editorId", dataType="Long") private Long editorId; public void setEditorId(Long editorId) { this.editorId = editorId; } public Long getEditorId() { return this.editorId; } /** 操作人 mbr_user.username */ @ApiModelProperty(value="操作人", name="editorName", dataType="String", example="admin") private String editorName; public void setEditorName(String editorName) { this.editorName = editorName; } public String getEditorName() { return this.editorName; } @ApiModelProperty(value="创建日期", name="createdTime", dataType="java.util.Date") private java.util.Date createdTimeFrom; public void setCreatedTimeFrom(java.util.Date createdTimeFrom) { this.createdTimeFrom = createdTimeFrom; } public java.util.Date getCreatedTimeFrom() { return this.createdTimeFrom; } private java.util.Date createdTimeTo; public void setCreatedTimeTo(java.util.Date createdTimeTo) { this.createdTimeTo = createdTimeTo; } public java.util.Date getCreatedTimeTo() { return this.createdTimeTo; } @ApiModelProperty(value="更新日期", name="updatedTime", dataType="java.util.Date") private java.util.Date updatedTimeFrom; public void setUpdatedTimeFrom(java.util.Date updatedTimeFrom) { this.updatedTimeFrom = updatedTimeFrom; } public java.util.Date getUpdatedTimeFrom() { return this.updatedTimeFrom; } private java.util.Date updatedTimeTo; public void setUpdatedTimeTo(java.util.Date updatedTimeTo) { this.updatedTimeTo = updatedTimeTo; } public java.util.Date getUpdatedTimeTo() { return this.updatedTimeTo; } }
[ "15951766580@139.com" ]
15951766580@139.com
9bc492f5e310466cd7e636fc0f8de0be6ce45832
38a87c581f606263e57165ab11a734f4146b640f
/src/app/IfKeywordAndCodeBlocks.java
86d6f02fa8bef1d5f4cccdde8fc294369cfae157
[]
no_license
bartoszmaleta/javaUdemyMasterclassBuchalka
232667a95fa69b84c3b0852df75b07de2cce83fe
45a2014c0129ef37fc86c29360066738cf6d566f
refs/heads/master
2020-11-27T01:29:37.777448
2020-03-01T18:40:22
2020-03-01T18:40:22
229,256,832
0
0
null
null
null
null
UTF-8
Java
false
false
1,422
java
package app; public class IfKeywordAndCodeBlocks { public static void main(String[] args) { boolean gameOver = true; int score = 4000; int levelCompleted = 5; int bonus = 100; if (score < 5000 && score > 1000) { System.out.println("Your score was less than 5000 but greater than 1000"); } else if (score < 1000) { System.out.println("Your score was less than 1000"); } else { System.out.println("Got here"); } if (gameOver) { int finalScore = score + (levelCompleted * bonus); finalScore += 100; System.out.println("Your final score was " + finalScore); } System.out.println("---------------------------"); score = 10000; levelCompleted = 8; bonus = 200; if (gameOver) { int finalScore2 = score + (levelCompleted * bonus); System.out.println("Your second final score was " + finalScore2); } System.out.println("---------------------------"); boolean newGameOver = true; int newScore = 10000; int newLevelCompleted = 8; int newBonus = 200; if (newGameOver) { int finalScore2 = newScore + (newLevelCompleted * newBonus); System.out.println("Your second final score was " + finalScore2); } } }
[ "bartosz.maleta@gmail.com" ]
bartosz.maleta@gmail.com
3272fd8091f4d1c0decd8b96008c85e96b68bf0e
a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb
/cs-20151215/src/main/java/com/aliyun/cs20151215/models/DeleteClusterNodepoolResponseBody.java
575bfbe7d5ae47e3b00f9ddd1903c96f65b642d3
[ "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
760
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.cs20151215.models; import com.aliyun.tea.*; public class DeleteClusterNodepoolResponseBody extends TeaModel { /** * <p>The ID of the request.</p> */ @NameInMap("request_id") public String requestId; public static DeleteClusterNodepoolResponseBody build(java.util.Map<String, ?> map) throws Exception { DeleteClusterNodepoolResponseBody self = new DeleteClusterNodepoolResponseBody(); return TeaModel.build(map, self); } public DeleteClusterNodepoolResponseBody setRequestId(String requestId) { this.requestId = requestId; return this; } public String getRequestId() { return this.requestId; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
3320287549b3e0b14653deeceef2e3349e390f6a
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/11/11_ce0c49ff3a3335f1da5fab8beeea82ec6327974b/TexAtlasSampleState/11_ce0c49ff3a3335f1da5fab8beeea82ec6327974b_TexAtlasSampleState_t.java
8f1f7ba791fc08b40334af18b3bc4286ed07f3be
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,456
java
package yang.samples.statesystem.states; import yang.graphics.defaults.programs.TextureTileRepeatProgram; import yang.graphics.textures.TextureCoordBounds; import yang.graphics.textures.TextureData; import yang.graphics.textures.TextureProperties; import yang.graphics.textures.enums.TextureFilter; import yang.graphics.textures.enums.TextureWrap; import yang.graphics.translator.Texture; import yang.math.objects.Quadruple; import yang.samples.statesystem.SampleState; public class TexAtlasSampleState extends SampleState { private Texture mAtlasTex; private TextureCoordBounds mGrassBounds; private TextureCoordBounds mSkyBounds; private TextureTileRepeatProgram mTileProgram; @Override public void initGraphics() { mTileProgram = mGraphics.addProgram(TextureTileRepeatProgram.class); TextureData atlasData = mGFXLoader.loadImageData("atlas"); mGrassBounds = atlasData.createBiasBorder(0, 0, 128, 128, 8, TextureWrap.REPEAT, TextureWrap.REPEAT); atlasData.createBiasBorder(128, 0, 128, 128, 4, TextureWrap.CLAMP, TextureWrap.CLAMP); atlasData.createBiasBorder(0, 128, 128, 128, 8, TextureWrap.MIRROR, TextureWrap.MIRROR); mSkyBounds = atlasData.copyWithMargin(128,128, 128,128, mGFXLoader.loadImageData("sky_small"), 2, TextureWrap.REPEAT, TextureWrap.CLAMP); mAtlasTex = mGraphics.createTexture(atlasData, new TextureProperties(TextureFilter.LINEAR)); } @Override protected void step(float deltaTime) { } @Override protected void draw() { mGraphics.clear(0,0,0); mGraphics2D.activate(); mGraphics2D.setShaderProgram(mTileProgram); //mGraphics2D.setDefaultProgram(); mGraphics.bindTexture(mAtlasTex); //mGraphics.bindTexture(mGraphics.createTexture(mGFXLoader.loadImageData("sky_small"), new TextureSettings())); mGraphics2D.setWhite(); mGraphics2D.setSuppData(mSkyBounds); mGraphics2D.drawRect(mGraphics2D.getScreenLeft(),-1,mGraphics2D.getScreenRight(),1, 0,mSkyBounds.getHeight(),mSkyBounds.getWidth()*2,0); mGraphics2D.setSuppData(mGrassBounds); final float SIZE = 0.5f; mGraphics2D.drawRect(-SIZE,-SIZE,SIZE,SIZE, 0,2,2,0); mGraphics2D.setSuppData(Quadruple.Q0011); mGraphics2D.drawRect(mGraphics2D.getScreenRight()-0.7f,mGraphics2D.getScreenTop()-0.7f,mGraphics2D.getScreenRight()-0.03f,mGraphics2D.getScreenTop()-0.03f); } @Override public void stop() { mGraphics2D.setDefaultProgram(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
a4c8e19f2b1807f7205d2d0b45549c22f00bd84c
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/java-design-patterns/learning/7378/App.java
8572fc47cd56e700f62ed73d5e3d88c520ddaa41
[]
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
3,104
java
/** * The MIT License * Copyright (c) 2014-2016 Ilkka Seppälä * * 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.iluwatar.mediator; /** * * The Mediator pattern defines an object that encapsulates how a set of objects interact. This * pattern is considered to be a behavioral pattern due to the way it can alter the program's * running behavior. * <p> * Usually a program is made up of a large number of classes. So the logic and computation is * distributed among these classes. However, as more classes are developed in a program, especially * during maintenance and/or refactoring, the problem of communication between these classes may * become more complex. This makes the program harder to read and maintain. Furthermore, it can * become difficult to change the program, since any change may affect code in several other * classes. * <p> * With the Mediator pattern, communication between objects is encapsulated with a mediator object. * Objects no longer communicate directly with each other, but instead communicate through the * mediator. This reduces the dependencies between communicating objects, thereby lowering the * coupling. * <p> * In this example the mediator encapsulates how a set of objects ({@link PartyMember}) interact. * Instead of referring to each other directly they use the mediator ({@link Party}) interface. * */ public class App { /** * Program entry point * * @param args command line args */ public static void main(String[] args) { // create party and members Party party = new PartyImpl(); Hobbit hobbit = new Hobbit(); Wizard wizard = new Wizard(); Rogue rogue = new Rogue(); Hunter hunter = new Hunter(); // add party members party.addMember(hobbit); party.addMember(wizard); party.addMember(rogue); party.addMember(hunter); // perform actions -> the other party members // are notified by the party hobbit.act(Action.ENEMY); wizard.act(Action.TALE); rogue.act(Action.GOLD); hunter.act(Action.HUNT); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
9e83480366bbe216746afda1270f35d124ac84b7
bbaa0a03f34e83a5641f6f91006390797e57aee6
/Chapter3/taco-jdbc/src/main/java/com/agan/tacocloud/dao/JdbcOrderRepository.java
a928d2a176f937ddb445a00a8148b77890a45776
[]
no_license
AganRun/SpringInAction
f27ab4e1ade17ca5883bf4e73e1b12d7fa07d6d6
621eb522158bb37412163b26d5a58e7115605d6e
refs/heads/master
2022-11-21T20:55:53.458062
2020-07-21T00:03:48
2020-07-21T00:03:48
254,758,387
0
0
null
null
null
null
UTF-8
Java
false
false
2,052
java
// tag::core[] package com.agan.tacocloud.dao; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import com.agan.tacocloud.dao.OrderRepository; import com.agan.tacocloud.pojo.Order; import com.agan.tacocloud.pojo.Taco; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.simple.SimpleJdbcInsert; import org.springframework.stereotype.Repository; import com.fasterxml.jackson.databind.ObjectMapper; @Repository public class JdbcOrderRepository implements OrderRepository { private SimpleJdbcInsert orderInserter; private SimpleJdbcInsert orderTacoInserter; private ObjectMapper objectMapper; @Autowired public JdbcOrderRepository(JdbcTemplate jdbc) { this.orderInserter = new SimpleJdbcInsert(jdbc) .withTableName("Taco_Order") .usingGeneratedKeyColumns("id"); this.orderTacoInserter = new SimpleJdbcInsert(jdbc) .withTableName("Taco_Order_Tacos"); this.objectMapper = new ObjectMapper(); } @Override public Order save(Order order) { order.setPlacedAt(new Date()); long orderId = saveOrderDetails(order); order.setId(orderId); List<Taco> tacos = order.getTacos(); for (Taco taco : tacos) { saveTacoToOrder(taco, orderId); } return order; } private long saveOrderDetails(Order order) { @SuppressWarnings("unchecked") Map<String, Object> values = objectMapper.convertValue(order, Map.class); values.put("placedAt", order.getPlacedAt()); long orderId = orderInserter.executeAndReturnKey(values).longValue(); return orderId; } private void saveTacoToOrder(Taco taco, long orderId) { Map<String, Object> values = new HashMap<>(); values.put("tacoOrder", orderId); values.put("taco", taco.getId()); orderTacoInserter.execute(values); } }
[ "1379154067@qq.com" ]
1379154067@qq.com
6fdf8b638a66e15d11859820d49bf10d1ad11001
727cebcda6c1811694af4096e7c5775a96713f77
/app/src/main/java/netlib/util/ToastUtils.java
79cca8f651a793011fbb2a07ffe3355245e59e46
[]
no_license
JusofunAppMobile/QuanNengBaoAndroid
967a983ac29830d00e898561b67b3e0ac272fed0
4355fec57ff1c274581c36f788ebc09a3329cb9f
refs/heads/master
2020-04-13T11:00:14.493442
2018-12-26T09:42:11
2018-12-26T09:42:11
163,160,807
0
0
null
null
null
null
UTF-8
Java
false
false
1,231
java
package netlib.util; import android.widget.Toast; import com.jusfoun.jusfouninquire.InquireApplication; import static android.R.attr.duration; /** * 说明 * * @时间 2017/10/23 * @作者 LiuGuangDan */ public class ToastUtils { private static Toast mToast; public static void show(String text) { show(text, Toast.LENGTH_SHORT); } public static void show(String text, int duration) { if (text == null) text = "NULL"; if (mToast == null) { // 这里使用Application的Context mToast = Toast.makeText(InquireApplication.application, text, Toast.LENGTH_SHORT); } else { mToast.setText(text); mToast.setDuration(Toast.LENGTH_SHORT); } mToast.show(); } public static void show(int resid) { show(InquireApplication.application.getResources().getString(resid)); } public static void show(int resid, int duration) { show(InquireApplication.application.getResources().getString(resid), duration); } public static void showHttpError() { show("网络连接异常,请检查网络", duration); } }
[ "515376293@qq.com" ]
515376293@qq.com
404f53c53a90b35141f4bb0cd1ba4659ca12d135
6e4d1ee81ed13f5b75014ecfe571d2fb6ec2bbce
/src/main/java/br/com/acaipaidegua/web/rest/TabelaPrecoResource.java
1524a0e44366504a630ecb69357786f07d593d52
[]
no_license
jairosousa/Acai-paidegua-novo
e333728c0a676754f6bf6aa8c86e8638e78a4ab5
dbd5cf7896544173518fa37e28ac73bc949c631a
refs/heads/master
2023-02-01T03:51:41.955926
2023-01-27T17:57:36
2023-01-27T17:57:36
177,417,258
1
1
null
2023-01-27T17:57:38
2019-03-24T13:18:09
Java
UTF-8
Java
false
false
5,349
java
package br.com.acaipaidegua.web.rest; import br.com.acaipaidegua.service.TabelaPrecoService; import br.com.acaipaidegua.web.rest.errors.BadRequestAlertException; import br.com.acaipaidegua.web.rest.util.HeaderUtil; import br.com.acaipaidegua.web.rest.util.PaginationUtil; import br.com.acaipaidegua.service.dto.TabelaPrecoDTO; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing TabelaPreco. */ @RestController @RequestMapping("/api") public class TabelaPrecoResource { private final Logger log = LoggerFactory.getLogger(TabelaPrecoResource.class); private static final String ENTITY_NAME = "tabelaPreco"; private final TabelaPrecoService tabelaPrecoService; public TabelaPrecoResource(TabelaPrecoService tabelaPrecoService) { this.tabelaPrecoService = tabelaPrecoService; } /** * POST /tabela-precos : Create a new tabelaPreco. * * @param tabelaPrecoDTO the tabelaPrecoDTO to create * @return the ResponseEntity with status 201 (Created) and with body the new tabelaPrecoDTO, or with status 400 (Bad Request) if the tabelaPreco has already an ID * @throws URISyntaxException if the Location URI syntax is incorrect */ @PostMapping("/tabela-precos") public ResponseEntity<TabelaPrecoDTO> createTabelaPreco(@Valid @RequestBody TabelaPrecoDTO tabelaPrecoDTO) throws URISyntaxException { log.debug("REST request to save TabelaPreco : {}", tabelaPrecoDTO); if (tabelaPrecoDTO.getId() != null) { throw new BadRequestAlertException("A new tabelaPreco cannot already have an ID", ENTITY_NAME, "idexists"); } TabelaPrecoDTO result = tabelaPrecoService.save(tabelaPrecoDTO); return ResponseEntity.created(new URI("/api/tabela-precos/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString())) .body(result); } /** * PUT /tabela-precos : Updates an existing tabelaPreco. * * @param tabelaPrecoDTO the tabelaPrecoDTO to update * @return the ResponseEntity with status 200 (OK) and with body the updated tabelaPrecoDTO, * or with status 400 (Bad Request) if the tabelaPrecoDTO is not valid, * or with status 500 (Internal Server Error) if the tabelaPrecoDTO couldn't be updated * @throws URISyntaxException if the Location URI syntax is incorrect */ @PutMapping("/tabela-precos") public ResponseEntity<TabelaPrecoDTO> updateTabelaPreco(@Valid @RequestBody TabelaPrecoDTO tabelaPrecoDTO) throws URISyntaxException { log.debug("REST request to update TabelaPreco : {}", tabelaPrecoDTO); if (tabelaPrecoDTO.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } TabelaPrecoDTO result = tabelaPrecoService.save(tabelaPrecoDTO); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(ENTITY_NAME, tabelaPrecoDTO.getId().toString())) .body(result); } /** * GET /tabela-precos : get all the tabelaPrecos. * * @param pageable the pagination information * @return the ResponseEntity with status 200 (OK) and the list of tabelaPrecos in body */ @GetMapping("/tabela-precos") public ResponseEntity<List<TabelaPrecoDTO>> getAllTabelaPrecos(Pageable pageable) { log.debug("REST request to get a page of TabelaPrecos"); Page<TabelaPrecoDTO> page = tabelaPrecoService.findAll(pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(page, "/api/tabela-precos"); return ResponseEntity.ok().headers(headers).body(page.getContent()); } /** * GET /tabela-precos/:id : get the "id" tabelaPreco. * * @param id the id of the tabelaPrecoDTO to retrieve * @return the ResponseEntity with status 200 (OK) and with body the tabelaPrecoDTO, or with status 404 (Not Found) */ @GetMapping("/tabela-precos/{id}") public ResponseEntity<TabelaPrecoDTO> getTabelaPreco(@PathVariable Long id) { log.debug("REST request to get TabelaPreco : {}", id); Optional<TabelaPrecoDTO> tabelaPrecoDTO = tabelaPrecoService.findOne(id); return ResponseUtil.wrapOrNotFound(tabelaPrecoDTO); } /** * DELETE /tabela-precos/:id : delete the "id" tabelaPreco. * * @param id the id of the tabelaPrecoDTO to delete * @return the ResponseEntity with status 200 (OK) */ @DeleteMapping("/tabela-precos/{id}") public ResponseEntity<Void> deleteTabelaPreco(@PathVariable Long id) { log.debug("REST request to delete TabelaPreco : {}", id); tabelaPrecoService.delete(id); return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert(ENTITY_NAME, id.toString())).build(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
4ddecfd010ca5dc6ef0f01c4bfe046ea1982e93c
6baf1fe00541560788e78de5244ae17a7a2b375a
/hollywood/com.oculus.assistant-base/sources/X/C1002qT.java
84d09f558ce5ecc906680a2db8e60c5c650a8521
[]
no_license
phwd/quest-tracker
286e605644fc05f00f4904e51f73d77444a78003
3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba
refs/heads/main
2023-03-29T20:33:10.959529
2021-04-10T22:14:11
2021-04-10T22:14:11
357,185,040
4
2
null
2021-04-12T12:28:09
2021-04-12T12:28:08
null
UTF-8
Java
false
false
511
java
package X; /* renamed from: X.qT reason: case insensitive filesystem */ public final class C1002qT extends AbstractC0552bp { public static final C0546bj A02 = C0546bj.A00("application/octet-stream"); public final C0546bj A00; public final byte[] A01; public C1002qT(byte[] bArr, String str) { C0546bj bjVar; this.A01 = bArr; if (str != null) { bjVar = C0546bj.A00(str); } else { bjVar = A02; } this.A00 = bjVar; } }
[ "cyuubiapps@gmail.com" ]
cyuubiapps@gmail.com
073e9bde05c48d202607e59924912975bfb8fae2
7730793c2e5981f98fcc3c2f12526e153fba2e72
/src/test/java/com/apptium/order/service/mapper/OrdBillingAccountRefMapperTest.java
dedb2519a3ddadc7a3607619f533841fafa3e5ef
[]
no_license
ravi7mech/order-management
3de18db5e26099d5fa5968ea991b62089e9b3699
a968c8cc71fc0a23c739999de4cce1d97f9b2cb3
refs/heads/main
2023-06-16T16:51:09.393167
2021-07-14T07:39:11
2021-07-14T07:39:11
385,852,996
0
0
null
2021-07-14T07:39:12
2021-07-14T07:31:15
Java
UTF-8
Java
false
false
412
java
package com.apptium.order.service.mapper; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; class OrdBillingAccountRefMapperTest { private OrdBillingAccountRefMapper ordBillingAccountRefMapper; @BeforeEach public void setUp() { ordBillingAccountRefMapper = new OrdBillingAccountRefMapperImpl(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
cf853820b81b8e01dea91e02268b443159048ba5
0e56f0ee14594af40246cfa550f4f74dd59947d5
/test/src/test/java/org/zstack/test/applianceVm/TestCreateApplianceVm.java
edf4d683030fcb88afecbb16361552c93aa016c7
[ "Apache-2.0" ]
permissive
fhchina/zstack
3e81471a931a5acdd932cf27775f70fe186ae2c1
85331fa464fd2841b5354df1e9057796df1e290b
refs/heads/master
2021-01-11T17:10:06.404368
2017-01-22T09:46:57
2017-01-22T09:55:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,923
java
package org.zstack.test.applianceVm; import junit.framework.Assert; import org.junit.Before; import org.junit.Test; import org.zstack.appliancevm.*; import org.zstack.core.cloudbus.CloudBus; import org.zstack.core.componentloader.ComponentLoader; import org.zstack.core.db.DatabaseFacade; import org.zstack.header.configuration.InstanceOfferingInventory; import org.zstack.header.core.ReturnValueCompletion; import org.zstack.header.errorcode.ErrorCode; import org.zstack.header.exception.CloudRuntimeException; import org.zstack.header.identity.AccountConstant; import org.zstack.header.image.ImageInventory; import org.zstack.header.network.l3.L3NetworkInventory; import org.zstack.header.vm.VmInstanceState; import org.zstack.header.vm.VmNicInventory; import org.zstack.test.Api; import org.zstack.test.ApiSenderException; import org.zstack.test.DBUtil; import org.zstack.test.deployer.Deployer; import java.util.List; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; public class TestCreateApplianceVm { Deployer deployer; Api api; ComponentLoader loader; CloudBus bus; DatabaseFacade dbf; ApplianceVmFacade apvmf; ApplianceVmType type = new ApplianceVmType("TestApplianceVmType"); CountDownLatch latch = new CountDownLatch(1); boolean success = false; @Before public void setUp() throws Exception { DBUtil.reDeployDB(); deployer = new Deployer("deployerXml/applianceVm/TestCreateApplianceVm.xml"); deployer.build(); api = deployer.getApi(); loader = deployer.getComponentLoader(); bus = loader.getComponent(CloudBus.class); dbf = loader.getComponent(DatabaseFacade.class); apvmf = loader.getComponent(ApplianceVmFacade.class); } @Test public void test() throws ApiSenderException, InterruptedException { ApplianceVmSpec spec = new ApplianceVmSpec(); L3NetworkInventory l31 = deployer.l3Networks.get("TestL3Network1"); L3NetworkInventory l32 = deployer.l3Networks.get("TestL3Network2"); L3NetworkInventory l33 = deployer.l3Networks.get("TestL3Network3"); ImageInventory image = deployer.images.get("TestImage"); InstanceOfferingInventory io = deployer.instanceOfferings.get("TestInstanceOffering"); final ApplianceVmNicSpec mgmtNic = new ApplianceVmNicSpec(); mgmtNic.setL3NetworkUuid(l31.getUuid()); spec.setManagementNic(mgmtNic); spec.setName("testApplianceVm"); spec.setAccountUuid(AccountConstant.INITIAL_SYSTEM_ADMIN_UUID); spec.setApplianceVmType(type); spec.setInstanceOffering(io); spec.setTemplate(image); spec.setApplianceVmType(type); final ApplianceVmNicSpec nic1 = new ApplianceVmNicSpec(); nic1.setL3NetworkUuid(l32.getUuid()); nic1.setAcquireOnNetwork(false); nic1.setGateway("10.10.2.1"); nic1.setIp("10.10.2.10"); nic1.setNetmask("255.0.0.0"); spec.getAdditionalNics().add(nic1); final ApplianceVmNicSpec nic2 = new ApplianceVmNicSpec(); nic2.setL3NetworkUuid(l33.getUuid()); spec.getAdditionalNics().add(nic2); apvmf.createApplianceVm(spec, new ReturnValueCompletion<ApplianceVmInventory>() { private VmNicInventory findNic(List<VmNicInventory> lst, String l3Uuid) { for (VmNicInventory nic : lst) { if (l3Uuid.equals(nic.getL3NetworkUuid())) { return nic; } } throw new CloudRuntimeException(String.format("cannot find nic on L3Network[uuid:%s]", l3Uuid)); } @Override public void success(ApplianceVmInventory vm) { try { findNic(vm.getVmNics(), mgmtNic.getL3NetworkUuid()); findNic(vm.getVmNics(), nic2.getL3NetworkUuid()); VmNicInventory vnic1 = findNic(vm.getVmNics(), nic1.getL3NetworkUuid()); Assert.assertEquals(nic1.getIp(), vnic1.getIp()); Assert.assertEquals(nic1.getGateway(), vnic1.getGateway()); Assert.assertEquals(nic1.getNetmask(), vnic1.getNetmask()); Assert.assertEquals(ApplianceVmConstant.APPLIANCE_VM_TYPE, vm.getType()); Assert.assertEquals(type.toString(), vm.getApplianceVmType()); Assert.assertEquals(VmInstanceState.Running.toString(), vm.getState()); success = true; } finally { latch.countDown(); } } @Override public void fail(ErrorCode errorCode) { success = false; latch.countDown(); } }); latch.await(30, TimeUnit.SECONDS); Assert.assertTrue(success); } }
[ "xuexuemiao@yeah.net" ]
xuexuemiao@yeah.net
f637d485173287e03dfe205a2da24a9ca16b3cb1
7f20b1bddf9f48108a43a9922433b141fac66a6d
/cytoscape3/branches/abeld-gsoc/dev/refactored-viewmodel/application/src/main/java/cytoscape/util/undo/UndoMonitor.java
d69e2024e4a8dc674e23ef7aaa970bb9e3acab9d
[]
no_license
ahdahddl/cytoscape
bf783d44cddda313a5b3563ea746b07f38173022
a3df8f63dba4ec49942027c91ecac6efa920c195
refs/heads/master
2020-06-26T16:48:19.791722
2013-08-28T04:08:31
2013-08-28T04:08:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,915
java
/* File: UndoMonitor.java Copyright (c) 2006, The Cytoscape Consortium (www.cytoscape.org) The Cytoscape Consortium is: - Institute for Systems Biology - University of California San Diego - Memorial Sloan-Kettering Cancer Center - Institut Pasteur - Agilent Technologies 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. The software and documentation provided hereunder is on an "as is" basis, and the Institute for Systems Biology and the Whitehead Institute have no obligations to provide maintenance, support, updates, enhancements or modifications. In no event shall the Institute for Systems Biology and the Whitehead Institute be liable to any party for direct, indirect, special, incidental or consequential damages, including lost profits, arising out of the use of this software and its documentation, even if the Institute for Systems Biology and the Whitehead Institute have been advised of the possibility of such damage. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ package cytoscape.util.undo; import org.cytoscape.work.UndoSupport; import cytoscape.events.SetCurrentNetworkViewEvent; import cytoscape.events.SetCurrentNetworkViewListener; import java.util.Properties; /** * This class monitors the undoable edit stack and implements whatever * discard policy we might have. Currently, we discard all edits if * the network view focus changes. */ public class UndoMonitor implements SetCurrentNetworkViewListener { private UndoSupport undo; private Properties props; public UndoMonitor(UndoSupport undo,Properties props) { this.undo = undo; this.props = props; undo.getUndoManager().setLimit( getLimit() ); } private int getLimit() { int lim; try { lim = Integer.parseInt( props.getProperty("undo.limit") ); } catch ( Exception e ) { e.printStackTrace(); lim = 10; } if ( lim < 0 ) lim = 10; return lim; } /** * This method listens for changes to the current network and discards all edits * when the network changes. * * @param e The change event. */ public void handleEvent(SetCurrentNetworkViewEvent e) { if ( e.getNetworkView() != null ) undo.getUndoManager().discardAllEdits(); } }
[ "abeld@0ecc0d97-ab19-0410-9704-bfe1a75892f5" ]
abeld@0ecc0d97-ab19-0410-9704-bfe1a75892f5
6b3b7c5330cf202aee0dc4b56d56236958d0811c
dea04aa4c94afd38796e395b3707d7e98b05b609
/Participant results/P24/Interaction-7/ArrayIntList_ES_0_Test.java
f94be8bed7afabb38fcced70343093658f2972eb
[]
no_license
PdedP/InterEvo-TR
aaa44ef0a4606061ba4263239bafdf0134bb11a1
77878f3e74ee5de510e37f211e907547674ee602
refs/heads/master
2023-04-11T11:51:37.222629
2023-01-09T17:37:02
2023-01-09T17:37:02
486,658,497
0
0
null
null
null
null
UTF-8
Java
false
false
920
java
/* * This file was automatically generated by EvoSuite * Thu Jan 20 17:52:51 GMT 2022 */ package com.org.apache.commons.collections.primitives; import org.junit.Test; import static org.junit.Assert.*; import com.org.apache.commons.collections.primitives.ArrayIntList; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class ArrayIntList_ES_0_Test extends ArrayIntList_ES_0_Test_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { ArrayIntList arrayIntList0 = new ArrayIntList(); arrayIntList0.add(0); int int0 = arrayIntList0.removeElementAt(0); assertEquals(0, arrayIntList0.size()); assertEquals(0, int0); } }
[ "pedro@uca.es" ]
pedro@uca.es
4c7a6af8a4b03807340712a310857f705e26b80b
e8bf15b7137b1a855c80bc6ca9226ac34bf98fe2
/app/src/main/java/bd/com/supply/module/transaction/PreviewPhotoActivity.java
36d32c601addb361d74dbe19be1036fc30140bb0
[]
no_license
xime123/supply
2907bd6cd29244430acea3437e2f343f60bd6c76
b06459fa52502b86e4b7eb4c033050352d8bb54b
refs/heads/master
2020-11-28T15:53:34.168210
2019-12-24T03:11:37
2019-12-24T03:11:37
229,860,306
0
0
null
null
null
null
UTF-8
Java
false
false
5,563
java
package bd.com.supply.module.transaction; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.ActivityOptionsCompat; import android.support.v4.app.FragmentActivity; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import com.bumptech.glide.Glide; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import bd.com.supply.R; import bd.com.supply.widget.photoview.PhotoView; import bd.com.supply.widget.photoview.PhotoView; public class PreviewPhotoActivity extends FragmentActivity implements View.OnClickListener { private ArrayList<String> paths = new ArrayList<>(); private SparseArray<Drawable> cachePhoto = new SparseArray<>(); public static void start(View v, int index, List<String> pathArray) { if (pathArray.size() <= 0) return; start1(v, index, (ArrayList<String>) pathArray); } public static void start1(View v, int index, ArrayList<String> paths) { String name = "preview" + index; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { v.setTransitionName(name); } Intent intent = new Intent(v.getContext(), PreviewPhotoActivity.class); intent.putExtra("i", index); intent.putStringArrayListExtra("paths", paths); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Context ctx = v.getContext(); if (ctx instanceof Activity) { ActivityOptionsCompat options = ActivityOptionsCompat. makeSceneTransitionAnimation((Activity) ctx, v, name); ctx.startActivity(intent, options.toBundle()); } else { ctx.startActivity(intent); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { postponeEnterTransition(); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { getWindow().setStatusBarColor(0); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); } else { getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN); } final int i = getIntent().getIntExtra("i", 0); ArrayList<String> tempPaths = getIntent().getStringArrayListExtra("paths"); if (tempPaths != null) paths.addAll(tempPaths); setContentView(R.layout.activity_preview_photo); ViewPager previewPager = findViewById(R.id.preview); previewPager.setPageMargin((int) (getResources().getDisplayMetrics().density * 10)); previewPager.setAdapter(new PagerAdapter() { @Override public void finishUpdate(@NonNull ViewGroup container) { super.finishUpdate(container); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { startPostponedEnterTransition(); } } @Override public void setPrimaryItem(@NonNull ViewGroup container, int position, @NonNull Object object) { super.setPrimaryItem(container, position, object); int count = container.getChildCount(); View child; for (int j = 0; j < count; j++) { child = container.getChildAt(j); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (child == object) { ((View) object).setTransitionName("preview" + i); } else { child.setTransitionName(null); } } } } @Override public int getCount() { return paths.size(); } @Override public boolean isViewFromObject(@NonNull View view, @NonNull Object o) { return view == o; } @NonNull @Override public Object instantiateItem(@NonNull ViewGroup container, int position) { PhotoView photoView = new PhotoView(container.getContext()); photoView.enable(); photoView.setOnClickListener(PreviewPhotoActivity.this); Drawable d = cachePhoto.get(position); if (d == null) { Glide.with(PreviewPhotoActivity.this).load(paths.get(position)).into(photoView); } else { photoView.setImageDrawable(d); } container.addView(photoView); return photoView; } @Override public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) { PhotoView photoView = (PhotoView) object; photoView.setImageDrawable(null); cachePhoto.put(position, photoView.getDrawable()); container.removeView(photoView); } }); previewPager.setCurrentItem(i, false); } @Override public void onClick(View v) { onBackPressed(); } }
[ "xumin2@evergrande.com" ]
xumin2@evergrande.com
3ab4b3c7ff2e3b8a62de33b2bdcc16794dd4a872
40d844c1c780cf3618979626282cf59be833907f
/src/testcases/CWE36_Absolute_Path_Traversal/CWE36_Absolute_Path_Traversal__Environment_53d.java
61963cf318c30258627595ac076ca0a678adc494
[]
no_license
rubengomez97/juliet
f9566de7be198921113658f904b521b6bca4d262
13debb7a1cc801977b9371b8cc1a313cd1de3a0e
refs/heads/master
2023-06-02T00:37:24.532638
2021-06-23T17:22:22
2021-06-23T17:22:22
379,676,259
1
0
null
null
null
null
UTF-8
Java
false
false
5,660
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE36_Absolute_Path_Traversal__Environment_53d.java Label Definition File: CWE36_Absolute_Path_Traversal.label.xml Template File: sources-sink-53d.tmpl.java */ /* * @description * CWE: 36 Absolute Path Traversal * BadSource: Environment Read data from an environment variable * GoodSource: A hardcoded string * Sinks: readFile * BadSink : read line from file from disk * Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package * * */ package testcases.CWE36_Absolute_Path_Traversal; import testcasesupport.*; import java.io.*; import javax.servlet.http.*; import java.util.logging.Level; public class CWE36_Absolute_Path_Traversal__Environment_53d { public void badSink(String data ) throws Throwable { /* POTENTIAL FLAW: unvalidated or sandboxed value */ if (data != null) { File file = new File(data); FileInputStream streamFileInputSink = null; InputStreamReader readerInputStreamSink = null; BufferedReader readerBufferdSink = null; if (file.exists() && file.isFile()) { try { streamFileInputSink = new FileInputStream(file); readerInputStreamSink = new InputStreamReader(streamFileInputSink, "UTF-8"); readerBufferdSink = new BufferedReader(readerInputStreamSink); IO.writeLine(readerBufferdSink.readLine()); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* Close stream reading objects */ try { if (readerBufferdSink != null) { readerBufferdSink.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStreamSink != null) { readerInputStreamSink.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } try { if (streamFileInputSink != null) { streamFileInputSink.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } } } } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(String data ) throws Throwable { /* POTENTIAL FLAW: unvalidated or sandboxed value */ if (data != null) { File file = new File(data); FileInputStream streamFileInputSink = null; InputStreamReader readerInputStreamSink = null; BufferedReader readerBufferdSink = null; if (file.exists() && file.isFile()) { try { streamFileInputSink = new FileInputStream(file); readerInputStreamSink = new InputStreamReader(streamFileInputSink, "UTF-8"); readerBufferdSink = new BufferedReader(readerInputStreamSink); IO.writeLine(readerBufferdSink.readLine()); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* Close stream reading objects */ try { if (readerBufferdSink != null) { readerBufferdSink.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing BufferedReader", exceptIO); } try { if (readerInputStreamSink != null) { readerInputStreamSink.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing InputStreamReader", exceptIO); } try { if (streamFileInputSink != null) { streamFileInputSink.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } } } } }
[ "you@example.com" ]
you@example.com
de87e74caaa20a69dd5cd519bf3953ef2d339624
f46ccfd712520cc53db30efc60dd6f335c7bf95f
/trueupdate-core/src/test/java/net/java/trueupdate/core/io/MemoryStore.java
cabea7ebd7a0dc6543f8ef444326d07f9ddb6313
[ "Apache-2.0" ]
permissive
christian-schlichtherle/trueupdate
0abb4964a29d93ebf82b0fff79432506e2c70fe4
2f2dc9963c44130cdaaa210b67f6d7180a0a4bc2
refs/heads/master
2020-03-23T20:17:41.259358
2018-07-23T15:42:35
2018-07-23T15:42:35
142,033,169
0
0
null
null
null
null
UTF-8
Java
false
false
2,022
java
/* * Copyright (C) 2005-2013 Schlichtherle IT Services. * Copyright (C) 2013 Stimulus Software. * All rights reserved. Use is subject to license terms. */ package net.java.trueupdate.core.io; import java.io.*; import javax.annotation.*; /** * A (heap) memory store. * * @author Christian Schlichtherle (copied and edited from TrueLicense Core 2.3.1) */ public final class MemoryStore implements Store { private final int bufsize; private byte[] buffer; /** * Equivalent to <code>new {@link #MemoryStore(int) * MemoryStore(BUFSIZE)}</code>. * * @see Store#BUFSIZE */ public MemoryStore() { this(BUFSIZE); } /** * Constructs a memory store with the given data size to use upon * {@link #output}. * * @param bufsize the data size to use upon {@link #output}. */ public MemoryStore(final int bufsize) { if (0 > (this.bufsize = bufsize)) throw new IllegalArgumentException(); } private static byte[] clone(@CheckForNull byte[] buffer) { return null == buffer ? null : buffer.clone(); } @SuppressWarnings("ReturnOfCollectionOrArrayField") private byte[] checkedData() throws FileNotFoundException { if (null == buffer) throw new FileNotFoundException(); return buffer; } public @Nullable byte[] data() { return clone(buffer); } public void data(@CheckForNull byte[] buffer) { this.buffer = clone(buffer); } @Override public InputStream input() throws IOException { return new ByteArrayInputStream(checkedData()); } @Override public OutputStream output() throws IOException { return new ByteArrayOutputStream(bufsize) { @Override public void close() throws IOException { buffer = toByteArray(); } }; } @Override public void delete() throws IOException { checkedData(); buffer = null; } @Override public boolean exists() { return null != buffer; } }
[ "christian@schlichtherle.de" ]
christian@schlichtherle.de
f783a298416082d4fd6035573c4c72a66fc71151
0321df3ed13f2fb42dd02ddb98d74e2d8b215fd8
/src/main/java/com/example/springbatchexample/job/quartz/QuartzConfiguration.java
0894fe058605e23021080061a54743877f4f5db6
[]
no_license
umanking/spring-batch-example
8551005a2daf69a2fa0853e86d8261d4e2bed117
fd22c4735eb4720bae24f64fedeb29d7430be374
refs/heads/master
2021-12-03T12:01:32.622539
2021-09-17T01:47:37
2021-09-17T01:47:37
248,376,300
0
0
null
null
null
null
UTF-8
Java
false
false
971
java
package com.example.springbatchexample.job.quartz; import org.quartz.JobBuilder; import org.quartz.JobDetail; import org.quartz.SimpleScheduleBuilder; import org.quartz.Trigger; import org.quartz.TriggerBuilder; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class QuartzConfiguration { // quartz jobDetail @Bean public JobDetail quartzJobDetail() { return JobBuilder.newJob(BatchScheduledJob.class) .storeDurably() .build(); } // quartz trigger @Bean public Trigger jobTrigger() { SimpleScheduleBuilder simpleScheduleBuilder = SimpleScheduleBuilder.simpleSchedule() .withIntervalInSeconds(5).withRepeatCount(4); return TriggerBuilder.newTrigger() .forJob(quartzJobDetail()) .withSchedule(simpleScheduleBuilder) .build(); } }
[ "umanking@gmail.com" ]
umanking@gmail.com
28caf4cdd9b9e1ad8cc6d3e5036b781aa001f67d
b75cc09bda54e7b50aeb66770195cdc541f68314
/jymgr-server/src/main/java/com/booting/product/facade/ProductFacade.java
5b397cbd496e605d995e3062ffa1b5dd2cedc936
[]
no_license
284288787/px
46de9f5c57daaaee2084ca350065910e8164c053
f78f88c6c076ef1861e6adf2ace1322c8e271abb
refs/heads/master
2022-11-22T04:29:55.019609
2020-08-27T09:42:14
2020-08-27T09:42:14
161,508,370
0
0
null
2022-11-16T06:28:23
2018-12-12T15:34:49
JavaScript
UTF-8
Java
false
false
8,416
java
/** create by auto at 2018-06-21 14:14:57**/ package com.booting.product.facade; import java.io.Serializable; import java.util.List; import com.star.framework.jdbc.dao.result.PageList; import com.star.framework.jdbc.dao.result.QueryParam; import com.booting.product.dto.ActivityDTO; import com.booting.product.entity.ActivityEntity; import com.booting.product.dto.CurriculumDTO; import com.booting.product.entity.CurriculumEntity; import com.booting.product.dto.EquipmentDTO; import com.booting.product.dto.ProductPictureDTO; import com.booting.product.entity.EquipmentEntity; import com.booting.product.entity.ProductPictureEntity; import com.booting.product.dto.ProductTypeDTO; import com.booting.product.entity.ProductTypeEntity; public interface ProductFacade extends Serializable { /** * 新增 活动 */ public Long saveActivity(ActivityDTO activityDTO); /** * 批量新增 活动 */ public void batchSaveActivity(List<ActivityDTO> dtos); /** * 更新 活动 */ public int updateActivity(ActivityDTO activityDTO); /** * 批量 活动 */ public void batchUpdateActivity(List<ActivityDTO> dtos); /** * 删除 活动 */ public int deleteActivity(long activityId); /** * 根据主键获取 活动 */ public ActivityDTO getActivity(long activityId); /** * 根据条件获取一条 活动 */ public ActivityDTO getActivity(ActivityDTO activityDTO); /** * 查询满足条件的 活动 列表(单表) */ public List<ActivityDTO> getActivityList(ActivityDTO activityDTO); /** * 查询满足条件的 活动 列表(分页)(单表) */ public PageList<ActivityDTO> getActivityListForPage(ActivityDTO activityDTO, int pageNumber, int pageSize); /** * 查询满足条件的 活动 列表(分页)(单表) */ public PageList<ActivityDTO> getActivityListForPage(QueryParam queryParam); /** * 活动DTO 转换成 Entity */ public ActivityEntity toActivityEntity(ActivityDTO activityDTO); /** * 活动DTOs 转换成 Entities */ public List<ActivityEntity> toActivityEntities(List<ActivityDTO> dtoes); /** * 新增 课程 */ public Long saveCurriculum(CurriculumDTO curriculumDTO); /** * 批量新增 课程 */ public void batchSaveCurriculum(List<CurriculumDTO> dtos); /** * 更新 课程 */ public int updateCurriculum(CurriculumDTO curriculumDTO); /** * 批量 课程 */ public void batchUpdateCurriculum(List<CurriculumDTO> dtos); /** * 删除 课程 */ public int deleteCurriculum(long curriculumId); /** * 根据主键获取 课程 */ public CurriculumDTO getCurriculum(long curriculumId); /** * 根据条件获取一条 课程 */ public CurriculumDTO getCurriculum(CurriculumDTO curriculumDTO); /** * 查询满足条件的 课程 列表(单表) */ public List<CurriculumDTO> getCurriculumList(CurriculumDTO curriculumDTO); /** * 查询满足条件的 课程 列表(分页)(单表) */ public PageList<CurriculumDTO> getCurriculumListForPage(CurriculumDTO curriculumDTO, int pageNumber, int pageSize); /** * 查询满足条件的 课程 列表(分页)(单表) */ public PageList<CurriculumDTO> getCurriculumListForPage(QueryParam queryParam); /** * 课程DTO 转换成 Entity */ public CurriculumEntity toCurriculumEntity(CurriculumDTO curriculumDTO); /** * 课程DTOs 转换成 Entities */ public List<CurriculumEntity> toCurriculumEntities(List<CurriculumDTO> dtoes); /** * 新增 设备 */ public Long saveEquipment(EquipmentDTO equipmentDTO); /** * 批量新增 设备 */ public void batchSaveEquipment(List<EquipmentDTO> dtos); /** * 更新 设备 */ public int updateEquipment(EquipmentDTO equipmentDTO); /** * 批量 设备 */ public void batchUpdateEquipment(List<EquipmentDTO> dtos); /** * 删除 设备 */ public int deleteEquipment(long equipmentId); /** * 根据主键获取 设备 */ public EquipmentDTO getEquipment(long equipmentId); /** * 根据条件获取一条 设备 */ public EquipmentDTO getEquipment(EquipmentDTO equipmentDTO); /** * 查询满足条件的 设备 列表(单表) */ public List<EquipmentDTO> getEquipmentList(EquipmentDTO equipmentDTO); /** * 查询满足条件的 设备 列表(分页)(单表) */ public PageList<EquipmentDTO> getEquipmentListForPage(EquipmentDTO equipmentDTO, int pageNumber, int pageSize); /** * 查询满足条件的 设备 列表(分页)(单表) */ public PageList<EquipmentDTO> getEquipmentListForPage(QueryParam queryParam); /** * 设备DTO 转换成 Entity */ public EquipmentEntity toEquipmentEntity(EquipmentDTO equipmentDTO); /** * 设备DTOs 转换成 Entities */ public List<EquipmentEntity> toEquipmentEntities(List<EquipmentDTO> dtoes); /** * 新增 产品类型 */ public Long saveProductType(ProductTypeDTO productTypeDTO); /** * 批量新增 产品类型 */ public void batchSaveProductType(List<ProductTypeDTO> dtos); /** * 更新 产品类型 */ public int updateProductType(ProductTypeDTO productTypeDTO); /** * 批量 产品类型 */ public void batchUpdateProductType(List<ProductTypeDTO> dtos); /** * 删除 产品类型 */ public int deleteProductType(long typeId); /** * 根据主键获取 产品类型 */ public ProductTypeDTO getProductType(long typeId); /** * 根据条件获取一条 产品类型 */ public ProductTypeDTO getProductType(ProductTypeDTO productTypeDTO); /** * 查询满足条件的 产品类型 列表(单表) */ public List<ProductTypeDTO> getProductTypeList(ProductTypeDTO productTypeDTO); /** * 查询满足条件的 产品类型 列表(分页)(单表) */ public PageList<ProductTypeDTO> getProductTypeListForPage(ProductTypeDTO productTypeDTO, int pageNumber, int pageSize); /** * 查询满足条件的 产品类型 列表(分页)(单表) */ public PageList<ProductTypeDTO> getProductTypeListForPage(QueryParam queryParam); /** * 产品类型DTO 转换成 Entity */ public ProductTypeEntity toProductTypeEntity(ProductTypeDTO productTypeDTO); /** * 产品类型DTOs 转换成 Entities */ public List<ProductTypeEntity> toProductTypeEntities(List<ProductTypeDTO> dtoes); /** * 查询满足条件的 列表(多表) */ public <T> List<T> getList(T dto); /** * 查询满足条件的列表(分页)(多表) */ public <T> PageList<T> getListForPage(T dto, int pageNumber, int pageSize); /** * 查询满足条件的列表(分页)(多表) */ public <T> PageList<T> getListForPage(QueryParam queryParam, Class<T> clazz); public void updateBySql(ProductTypeDTO dto); public void updateBySql(ActivityDTO dto); /** * 新增 产品图片 */ public Long saveProductPicture(ProductPictureDTO productPictureDTO); /** * 批量新增 产品图片 */ public void batchSaveProductPicture(List<ProductPictureDTO> dtos); /** * 更新 产品图片 */ public int updateProductPicture(ProductPictureDTO productPictureDTO); /** * 批量 产品图片 */ public void batchUpdateProductPicture(List<ProductPictureDTO> dtos); /** * 删除 产品图片 */ public int deleteProductPicture(long id); /** * 根据主键获取 产品图片 */ public ProductPictureDTO getProductPicture(long id); /** * 根据条件获取一条 产品图片 */ public ProductPictureDTO getProductPicture(ProductPictureDTO productPictureDTO); /** * 查询满足条件的 产品图片 列表(单表) */ public List<ProductPictureDTO> getProductPictureList(ProductPictureDTO productPictureDTO); /** * 查询满足条件的 产品图片 列表(分页)(单表) */ public PageList<ProductPictureDTO> getProductPictureListForPage(ProductPictureDTO productPictureDTO, int pageNumber, int pageSize); /** * 查询满足条件的 产品图片 列表(分页)(单表) */ public PageList<ProductPictureDTO> getProductPictureListForPage(QueryParam queryParam); /** * 产品图片DTO 转换成 Entity */ public ProductPictureEntity toProductPictureEntity(ProductPictureDTO productPictureDTO); /** * 产品图片DTOs 转换成 Entities */ public List<ProductPictureEntity> toProductPictureEntities(List<ProductPictureDTO> dtoes); public void deleteProductPictureBy(int business, Long activityId); public void updateBySql(EquipmentDTO dto); public void updateBySql(CurriculumDTO dto); }
[ "3158459@qq.com" ]
3158459@qq.com
d130eefdf8496e53d2142bda2ec289ba99eceb96
8d6a347b3ee7d5f3abf2144de3ab788e4dfa3162
/src/test/java/com/stevesun/_563Test.java
27f739496a1ee461310fae080a4ebdef0df44b85
[ "Apache-2.0" ]
permissive
Sam-Si/Leetcode
3f58b88325ad6a02da0d84c885f08bee8fce8b0d
5e7403360cd87c6f32bac05863e4679702f3417c
refs/heads/master
2021-01-22T03:31:26.751878
2017-05-24T15:11:50
2017-05-24T15:11:50
92,386,586
2
1
null
2017-05-25T09:18:22
2017-05-25T09:18:21
null
UTF-8
Java
false
false
1,132
java
package com.stevesun; import com.stevesun.common.classes.TreeNode; import com.stevesun.solutions._563; import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.Test; import static junit.framework.Assert.assertEquals; /** * Created by stevesun on 4/23/17. */ public class _563Test { private static _563 test; private static int expected; private static int actual; private static TreeNode root; @BeforeClass public static void setup(){ test = new _563(); actual = 0; } @Test public void test1(){ root = new TreeNode(1); root.left = new TreeNode(2); root.right = new TreeNode(3); expected = 1; actual = test.findTilt(root); assertEquals(expected, actual); } @Ignore @Test public void test2(){ root = new TreeNode(1); root.left = new TreeNode(2); root.right = new TreeNode(3); root.left.left = new TreeNode(4); root.right.left = new TreeNode(5); expected = 11; actual = test.findTilt(root); assertEquals(expected, actual); } }
[ "stevesun@coupang.com" ]
stevesun@coupang.com
dd997f8da8868126013f5422222fbd799023e059
3ac5fe5aaf98149e4e4f6add52081ab01c07596b
/SpringBootTwoJPA/src/main/java/com/example/common/activiti/ActivitiUtils.java
32e4d5cfc1db070070d47452624c03982bfae7fd
[]
no_license
18753377299/SpringBootTwoTest
7ce7cd6f577d70c6a950365dae070537b40e53b2
70306d47ccea8687fd36d80bac714d8d377f0e55
refs/heads/master
2023-05-03T03:30:31.976820
2021-05-13T11:37:51
2021-05-13T11:37:51
307,751,481
0
0
null
null
null
null
UTF-8
Java
false
false
9,171
java
package com.example.common.activiti; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.activiti.engine.*; import org.activiti.engine.history.HistoricActivityInstance; import org.activiti.engine.history.HistoricProcessInstance; import org.activiti.engine.history.HistoricTaskInstance; import org.activiti.engine.history.HistoricVariableInstance; import org.activiti.engine.repository.Deployment; import org.activiti.engine.repository.ProcessDefinition; import org.activiti.engine.runtime.ProcessInstance; import java.util.List; import java.util.Map; @Api("Activity工具类") public class ActivitiUtils { @ApiOperation(value="获取ProcessEngine") public static ProcessEngine getProcessEngine(){ return ProcessEngines.getDefaultProcessEngine(); } @ApiOperation(value="获取RepositoryService类") public static RepositoryService getRepositoryService(){ return getProcessEngine().getRepositoryService(); } @ApiOperation(value="获取RuntimeService类") public static RuntimeService getRuntimeService(){ return getProcessEngine().getRuntimeService(); } @ApiOperation(value="获取TaskService类") public static TaskService getTaskService(){ return getProcessEngine().getTaskService(); } @ApiOperation(value="获取HistoryService类") public static HistoryService getHistoryService(){ return getProcessEngine().getHistoryService(); } @ApiOperation(value="获取IdentityService类") public static IdentityService getIdentityService(){ return getProcessEngine().getIdentityService(); } /** * 部署信息表:act_re_deployment * 流程设计模型部署表: act_re_model * 流程定义数据表: act_re_procdef * */ @ApiOperation(value="进行流程部署") public static void deploy(String bpmnNameAndKey,String resourceName) { RepositoryService repositoryService = getRepositoryService(); String keyName = "processes/" + resourceName+".bpmn20.xml"; Deployment deploy = repositoryService.createDeployment() .addClasspathResource(keyName) .key(bpmnNameAndKey) .name(bpmnNameAndKey + "name").category("HR").deploy(); System.out.println("流程部署ID\t" + deploy.getId()); System.out.println("流程keyID\t" + deploy.getKey()); System.out.println("流程名称ID\t" + deploy.getName()); System.out.println("流程分类ID\t" + deploy.getCategory()); } /** * 第二步: 发布流程 * 流程发布后在 act_ru_task ,act_ru_execution, act_ru_identitylink 表中插入流程数据 * 接下来就可以通过用户ID去查看该用户的任务了 */ @ApiOperation(value="发布流程,指定人员") public static void startFlow(String processInstanceByKey, Map<String,Object> map ){ try { ProcessInstance processInstance = getRuntimeService(). startProcessInstanceByKey(processInstanceByKey,map); System.out.println("流程实例的id: "+processInstance.getId()+ ",流程定义的ID:"+processInstance.getProcessDefinitionId()+ ",activitiId: "+processInstance.getActivityId()+ ",流程实现的ID:"+processInstance.getProcessInstanceId()); System.out.println("name: "+processInstance.getName()); System.out.println("ProcessVariables: "+processInstance.getProcessVariables().toString()); } catch (Exception e) { e.printStackTrace(); } } @ApiOperation(value="执行任务", notes="对于执行完的任务,activiti将从act_ru_task表中删除该任务,下一个任务会被插入进来。") public static void executeTask(String taskId,String userId){ TaskService taskService = getTaskService(); /**添加代理人*/ taskService.setAssignee(taskId,userId); taskService.complete(taskId); } @ApiOperation(value="执行任务,同时设置Variable值") public static void executeTaskByVariable(String taskId, Map<String,Object> map){ TaskService taskService = getTaskService(); taskService.complete(taskId,map); } @ApiOperation(value="通过部署id删除流程定义") public static void deleteProcessDefinition(String deploymentId){ /** 通过部署id删除流程定义, * 普通删除,如果当前规则下有正在执行的流程,则抛异常。 * */ // getRepositoryService().deleteDeployment(deploymentId); /**级联删除,会删除和当前规则相关的所有信息, 正在执行的信息,也包括历史信息 相当于: */ getRepositoryService().deleteDeployment(deploymentId,true); } @ApiOperation(value="删除key相同的所有不同版本的流程定义",notes="keyId:为ActivityConst.ProcessInstanceKeyLeave") public static void deleteProcessDefinitionByKey(String keyId){ List<ProcessDefinition> list = getRepositoryService().createProcessDefinitionQuery() .processDefinitionKey(keyId) .list(); for(ProcessDefinition pd: list){ getRepositoryService().deleteDeployment(pd.getDeploymentId(),true); } } @ApiOperation(value="查询最新版本的流程定义") public static void queryNewProcessDefinition(){ List<ProcessDefinition> list = getRepositoryService().createProcessDefinitionQuery() .orderByProcessDefinitionVersion().asc().list(); } @ApiOperation(value="查询流程状态", notes="取流程实例的状态,运行时流程执行实例表:act_ru_execution") public static void queryProcessState(String processInstanceId){ ProcessInstance pi = getRuntimeService().createProcessInstanceQuery() .processInstanceId(processInstanceId).singleResult(); /*判断流程实例的状态*/ if(null!=pi){ System.out.println("该流程实例"+processInstanceId +"正在运行。。。,当前活动的任务"+pi.getActivityId()); }else{ System.out.println("当前的流程实例"+processInstanceId +"已经结束!"); } } @ApiOperation(value="查询历史流程实例,通过流程实例ID") public static HistoricProcessInstance queryHistoryProcessInstance(String hisProcessInstanceId) { HistoricProcessInstance hpi = getHistoryService().createHistoricProcessInstanceQuery() .processInstanceId(hisProcessInstanceId).singleResult(); return hpi; } @ApiOperation(value="查询历史流程变量list,查询act_hi_varinst表") public static List<HistoricVariableInstance> queryHistoricVariableInstance() { List<HistoricVariableInstance> hviList = getHistoryService() .createHistoricVariableInstanceQuery() // .processInstanceId() //使用流程实例ID查询 .list(); return hviList; } @ApiOperation(value="第五步:查看历史流程实例",notes = "历史流程实例表:act_hi_procinst," + "参数为ActivityConst.ProcessInstanceKeyLeave") public static List<HistoricProcessInstance> findhistProcessInstance(String processDefinitionKey) { HistoryService historyService =ActivitiUtils.getHistoryService(); List<HistoricProcessInstance> list = historyService.createHistoricProcessInstanceQuery() .processDefinitionKey(processDefinitionKey) .orderByProcessInstanceStartTime().desc() // 根据开始时间降序排序 .list(); return list; } @ApiOperation(value="查看历史活动实例",notes = "历史节点表:act_hi_actinst," + "参数为act_hi_actinst表中的pro_inst_id字段") public static List<HistoricActivityInstance> findHistoricActivityInstance(String processInstanceId) { HistoryService historyService =ActivitiUtils.getHistoryService(); List<HistoricActivityInstance> list = historyService.createHistoricActivityInstanceQuery() .processInstanceId(processInstanceId) //使用流程实例ID查询 .orderByHistoricActivityInstanceEndTime().desc() // 根据开始时间降序排序 .list(); return list; } @ApiOperation(value="第六步:查看历史任务, 历史流程任务表:act_hi_taskinst"+ "参数为act_hi_taskinst表中的pro_inst_id字段") public static List<HistoricTaskInstance> findHisTask(String processInstanceId){ HistoryService historyService =ActivitiUtils.getHistoryService(); List<HistoricTaskInstance> list = historyService.createHistoricTaskInstanceQuery() .processInstanceId(processInstanceId)//使用流程实例ID查询 .orderByHistoricTaskInstanceStartTime().desc() // 排序条件 .list(); return list; } }
[ "1733856225@qq.com" ]
1733856225@qq.com