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
9418429dd2ce808ccc3cdee9e174fa43cbdf46ec
b6eb0ecadbb70ed005d687268a0d40e89d4df73e
/feilong-lib/feilong-lib-ognl/src/main/java/com/feilong/lib/javassist/compiler/ast/NewExpr.java
40459c442dffd55b6cbb6d97dcb04f8980dbd52c
[ "Apache-2.0" ]
permissive
ifeilong/feilong
b175d02849585c7b12ed0e9864f307ed1a26e89f
a0d4efeabc29503b97caf0c300afe956a5caeb9f
refs/heads/master
2023-08-18T13:08:46.724616
2023-08-14T04:30:34
2023-08-14T04:30:34
252,767,655
97
28
Apache-2.0
2023-04-17T17:47:44
2020-04-03T15:14:35
Java
UTF-8
Java
false
false
2,591
java
/* * Javassist, a Java-bytecode translator toolkit. * Copyright (C) 1999- Shigeru Chiba. All Rights Reserved. * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. Alternatively, the contents of this file may be used under * the terms of the GNU Lesser General Public License Version 2.1 or later, * or the Apache License Version 2.0. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. */ package com.feilong.lib.javassist.compiler.ast; import com.feilong.lib.javassist.compiler.CompileError; import com.feilong.lib.javassist.compiler.TokenId; /** * New Expression. */ public class NewExpr extends ASTList implements TokenId{ /** default serialVersionUID */ private static final long serialVersionUID = 1L; protected boolean newArray; protected int arrayType; public NewExpr(ASTList className, ASTList args){ super(className, new ASTList(args)); newArray = false; arrayType = CLASS; } public NewExpr(int type, ASTList arraySize, ArrayInit init){ super(null, new ASTList(arraySize)); newArray = true; arrayType = type; if (init != null){ append(this, init); } } public static NewExpr makeObjectArray(ASTList className,ASTList arraySize,ArrayInit init){ NewExpr e = new NewExpr(className, arraySize); e.newArray = true; if (init != null){ append(e, init); } return e; } public boolean isArray(){ return newArray; } /* * TokenId.CLASS, TokenId.INT, ... */ public int getArrayType(){ return arrayType; } public ASTList getClassName(){ return (ASTList) getLeft(); } public ASTList getArguments(){ return (ASTList) getRight().getLeft(); } public ASTList getArraySize(){ return getArguments(); } public ArrayInit getInitializer(){ ASTree t = getRight().getRight(); if (t == null){ return null; } return (ArrayInit) t.getLeft(); } @Override public void accept(Visitor v) throws CompileError{ v.atNewExpr(this); } @Override protected String getTag(){ return newArray ? "new[]" : "new"; } }
[ "venusdrogon@163.com" ]
venusdrogon@163.com
84162998a328fbe022e22b924de925e3d590d0d5
2daea090c54d11688b7e2f40fbeeda22fe3d01f6
/header/src/main/java/org/zstack/header/errorcode/OperationFailureException.java
4a530b8ec32f48e9f46ed1cd1bbd6db8502c2a1f
[ "Apache-2.0" ]
permissive
jxg01713/zstack
1f0e474daa6ca4647d0481c7e44d86a860ac209c
182fb094e9a6ef89cf010583d457a9bf4f033f33
refs/heads/1.0.x
2021-06-20T12:36:16.609798
2016-03-17T08:03:29
2016-03-17T08:03:29
197,339,567
0
0
Apache-2.0
2021-03-19T20:23:19
2019-07-17T07:36:39
Java
UTF-8
Java
false
false
588
java
package org.zstack.header.errorcode; /** */ public class OperationFailureException extends RuntimeException { private ErrorCode errorCode; @Override public String getMessage() { return String.format("%s: %s", OperationFailureException.class.getName(), errorCode); } public OperationFailureException(ErrorCode errorCode) { this.errorCode = errorCode; } public ErrorCode getErrorCode() { return errorCode; } public void setErrorCode(ErrorCode errorCode) { this.errorCode = errorCode; } }
[ "xing5820@gmail.com" ]
xing5820@gmail.com
854aae545a7cd09fd3e431940e96d2567d61b311
e27942cce249f7d62b7dc8c9b86cd40391c1ddd4
/modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201702/ContentMetadataKeyHierarchyErrorReason.java
b8a283296caf16c2a5a805496f66d5f38de116b5
[ "Apache-2.0" ]
permissive
mo4ss/googleads-java-lib
b4b6178747d25d16ae6aa0c80d80ee18a2dfe01a
efaa9c3bd8a46a3ed4b00963dc9760c6dd8bd641
refs/heads/master
2022-12-05T00:30:56.740813
2022-11-16T10:47:15
2022-11-16T10:47:15
108,132,394
0
0
Apache-2.0
2022-11-16T10:47:16
2017-10-24T13:41:43
Java
UTF-8
Java
false
false
2,566
java
// Copyright 2017 Google Inc. 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.google.api.ads.dfp.jaxws.v201702; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ContentMetadataKeyHierarchyError.Reason. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="ContentMetadataKeyHierarchyError.Reason"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="LEVEL_MISSING"/> * &lt;enumeration value="INVALID_DSM_HIERARCHY"/> * &lt;enumeration value="CANNOT_USE_BROWSE_BY_KEY_WITH_HIERARCHY_FEATURE_ENABLED"/> * &lt;enumeration value="UNKNOWN"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "ContentMetadataKeyHierarchyError.Reason") @XmlEnum public enum ContentMetadataKeyHierarchyErrorReason { /** * * One or more levels of the hierarchy are missing. For example, if the levels are {1, 2, 2} * or {1, 3, 4}, this error will be thrown. * * */ LEVEL_MISSING, /** * * DSM networks can only have one hierarchy per network and that hierarchy can only have * one level. * * */ INVALID_DSM_HIERARCHY, /** * * Cannot load or save the network browse by key when the content metadata key hierarchy * feature is enabled. * * */ CANNOT_USE_BROWSE_BY_KEY_WITH_HIERARCHY_FEATURE_ENABLED, /** * * The value returned if the actual value is not exposed by the requested API version. * * */ UNKNOWN; public String value() { return name(); } public static ContentMetadataKeyHierarchyErrorReason fromValue(String v) { return valueOf(v); } }
[ "api.cseeley@gmail.com" ]
api.cseeley@gmail.com
f076694abed4bb8fcb1a8e0eeb5e9612c837f07f
afb1e00ca97e3266aa34d4d737a7fed2ec1a0fcc
/app/src/main/java/com/yuefeng/contacts/modle/groupchat/GroupCreateBean.java
d5a1273fa01d7993f7301e7bfabfb4f06c1fa13a
[]
no_license
liangminxiong/PlatFormCompanyProject
d1117afa07cb40a841647158953d894a3a7818ed
072b7f8275961433ed4955ef976af77d8811cdef
refs/heads/master
2020-03-29T18:27:53.654271
2018-12-30T10:57:22
2018-12-30T10:57:22
150,214,454
2
2
null
null
null
null
UTF-8
Java
false
false
938
java
package com.yuefeng.contacts.modle.groupchat; import java.io.Serializable; /*创建群主*/ public class GroupCreateBean implements Serializable { /** * success : true * code : 200 * text : 说明:返回创建的群组id * data : c09a99c40a00004212dfbaa815b50a95 */ private boolean success; private int code; private String text; private String data; public boolean isSuccess() { return success; } public void setSuccess(boolean success) { this.success = success; } public int getCode() { return code; } public void setCode(int code) { this.code = code; } public String getText() { return text; } public void setText(String text) { this.text = text; } public String getData() { return data; } public void setData(String data) { this.data = data; } }
[ "1409318524@qq.com" ]
1409318524@qq.com
e8154a4a0314696b076667f616e23909e85ebd71
38c34ff168b64a67e969bd81a60556ad0b17e62c
/live-20161101/src/main/java/com/aliyun/live20161101/models/ForbidLiveStreamRequest.java
ee28ced8a99a8c38f841ebea1a6fe3dc865edec6
[ "Apache-2.0" ]
permissive
bestchendong/alibabacloud-java-sdk
1474344c006641fbab882af4c277b5cbb343ea80
737c2b966c5e46903d5875e269c971cb80dd678f
refs/heads/master
2023-04-15T05:34:29.011451
2021-04-22T09:14:46
2021-04-22T09:14:46
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,582
java
// This file is auto-generated, don't edit it. Thanks. package com.aliyun.live20161101.models; import com.aliyun.tea.*; public class ForbidLiveStreamRequest extends TeaModel { @NameInMap("OwnerId") public Long ownerId; @NameInMap("DomainName") public String domainName; @NameInMap("AppName") public String appName; @NameInMap("StreamName") public String streamName; @NameInMap("LiveStreamType") public String liveStreamType; @NameInMap("Oneshot") public String oneshot; @NameInMap("ControlStreamAction") public String controlStreamAction; @NameInMap("ResumeTime") public String resumeTime; public static ForbidLiveStreamRequest build(java.util.Map<String, ?> map) throws Exception { ForbidLiveStreamRequest self = new ForbidLiveStreamRequest(); return TeaModel.build(map, self); } public ForbidLiveStreamRequest setOwnerId(Long ownerId) { this.ownerId = ownerId; return this; } public Long getOwnerId() { return this.ownerId; } public ForbidLiveStreamRequest setDomainName(String domainName) { this.domainName = domainName; return this; } public String getDomainName() { return this.domainName; } public ForbidLiveStreamRequest setAppName(String appName) { this.appName = appName; return this; } public String getAppName() { return this.appName; } public ForbidLiveStreamRequest setStreamName(String streamName) { this.streamName = streamName; return this; } public String getStreamName() { return this.streamName; } public ForbidLiveStreamRequest setLiveStreamType(String liveStreamType) { this.liveStreamType = liveStreamType; return this; } public String getLiveStreamType() { return this.liveStreamType; } public ForbidLiveStreamRequest setOneshot(String oneshot) { this.oneshot = oneshot; return this; } public String getOneshot() { return this.oneshot; } public ForbidLiveStreamRequest setControlStreamAction(String controlStreamAction) { this.controlStreamAction = controlStreamAction; return this; } public String getControlStreamAction() { return this.controlStreamAction; } public ForbidLiveStreamRequest setResumeTime(String resumeTime) { this.resumeTime = resumeTime; return this; } public String getResumeTime() { return this.resumeTime; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
81e498279082c4bf24d9d5ec748086228ac88384
485cea47fd87f58a753ba581eae1e88e67f01be7
/CoyoteMC/src/main/java/coyote/dx/reader/SnowMetricReader.java
d35ef626410245550120df4d2510fe04a10182de
[]
no_license
sdcote/coyote
18706dc345addf6cd64809f840e2bddb4309bc17
7de908e3f089715ad1652f357dc95d2ceb5483c4
refs/heads/main
2023-03-06T23:42:49.573817
2023-03-02T17:06:31
2023-03-02T17:06:31
89,138,130
8
4
null
2022-11-10T22:06:36
2017-04-23T11:52:21
JavaScript
UTF-8
Java
false
false
1,774
java
/* * Copyright (c) 2019 Stephan D. Cote' - All rights reserved. * * This program and the accompanying materials are made available under the * terms of the MIT License which accompanies this distribution, and is * available at http://creativecommons.org/licenses/MIT/ */ package coyote.dx.reader; import coyote.dataframe.DataFrame; import coyote.dx.ConfigTag; import coyote.dx.FrameReader; /** * This is a reader which connects to a ServiceNow instance and queries data via URL export and generates metrics based * on the incidents in the "incident" table. */ public abstract class SnowMetricReader extends SnowReader implements FrameReader { /** * Build a metric frame from the given data * * @param metricName the name of the metric * @param value the value of the meric * @param helpText the help text * @param type the type of metric * @param instanceName the name of the instance * @return a dataframe with the fields populated */ protected DataFrame buildMetric(String metricName, long value, String helpText, String type, String instanceName) { DataFrame metric = new DataFrame(); metric.set(ConfigTag.NAME, metricName); metric.set(ConfigTag.VALUE, value); metric.set(ConfigTag.HELP, helpText); metric.set(ConfigTag.TYPE, type); metric.set(INSTANCE, instanceName); return metric; } protected DataFrame buildMetric(String metricName, float value, String helpText, String type, String instanceName) { DataFrame metric = new DataFrame(); metric.set(ConfigTag.NAME, metricName); metric.set(ConfigTag.VALUE, value); metric.set(ConfigTag.HELP, helpText); metric.set(ConfigTag.TYPE, type); metric.set(INSTANCE, instanceName); return metric; } }
[ "sdcote@aep.com" ]
sdcote@aep.com
8cb8d8972a28f76c4cf4e70a9d4186296589165c
593c08543d7eb1c2492fa11b865a7be23085c586
/org/omg/DynamicAny/DynValue.java
4654c13a5a87f2af692422f1d6f5f8b9c3406209
[]
no_license
liuzhengyang/jdk-research
bacdb1297ccf3f7f5dd6394aad2d90a4aecf4923
8745611af673afceb662102404439ced180d0666
refs/heads/master
2021-01-10T08:10:38.170309
2016-02-25T09:31:11
2016-02-25T09:31:11
52,512,855
0
0
null
null
null
null
UTF-8
Java
false
false
1,279
java
package org.omg.DynamicAny; /** * org/omg/DynamicAny/DynValue.java . * Generated by the IDL-to-Java compiler (portable), version "3.2" * from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl * Thursday, December 18, 2014 4:24:04 PM PST */ /** * DynValue objects support the manipulation of IDL non-boxed value types. * The DynValue interface can represent both null and non-null value types. * For a DynValue representing a non-null value type, the DynValue's components comprise * the public and private members of the value type, including those inherited from concrete base value types, * in the order of definition. A DynValue representing a null value type has no components * and a current position of -1. * <P>Warning: Indiscriminantly changing the contents of private value type members can cause the value type * implementation to break by violating internal constraints. Access to private members is provided to support * such activities as ORB bridging and debugging and should not be used to arbitrarily violate * the encapsulation of the value type. */ public interface DynValue extends DynValueOperations, org.omg.DynamicAny.DynValueCommon, org.omg.CORBA.portable.IDLEntity { } // interface DynValue
[ "liuzhengyang@meituan.com" ]
liuzhengyang@meituan.com
85fa24fb411a0f95e6509937e70dbef68ed5842f
1cc41aef9bd36b7ff3245faac79adb569c65a0cf
/java/hibernate/spring-hibernate/src/main/java/org/javabrains/koushks33/configuring_second_level_cache/UserDetails.java
7310ce77fbd557064fdd27c7605315293cb4a12b
[]
no_license
seungbeomi/development
fca4d350b31fefd56a9517bcc8c49ea39d6af19e
11c1c6c9f2ec522ce9e90808e1b0876eff5039df
refs/heads/master
2023-03-10T17:57:07.819034
2022-02-16T15:18:39
2022-02-16T15:18:39
1,160,501
2
3
null
2023-03-07T09:08:19
2010-12-12T08:10:56
Java
UTF-8
Java
false
false
634
java
package org.javabrains.koushks33.configuring_second_level_cache; import javax.persistence.Cacheable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Table; import lombok.Data; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; @Data @Entity @Cacheable @Cache(usage=CacheConcurrencyStrategy.READ_ONLY) @Table(name="USER_DETAILS") public class UserDetails { @Id @GeneratedValue(strategy=GenerationType.AUTO) private int userId; private String userName; }
[ "seungbeomi@gmail.com" ]
seungbeomi@gmail.com
ba32d5e653646acbb8ee753c3f5efd38349f012c
963599f6f1f376ba94cbb504e8b324bcce5de7a3
/sources/com/google/android/play/core/splitinstall/C2365ar.java
1d0d2bfa3231b38ac82d169af9a512d68982190d
[]
no_license
NikiHard/cuddly-pancake
563718cb73fdc4b7b12c6233d9bf44f381dd6759
3a5aa80d25d12da08fd621dc3a15fbd536d0b3d4
refs/heads/main
2023-04-09T06:58:04.403056
2021-04-20T00:45:08
2021-04-20T00:45:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
802
java
package com.google.android.play.core.splitinstall; import android.os.Bundle; import android.os.RemoteException; import com.google.android.play.core.tasks.C2415i; import java.util.ArrayList; import java.util.List; /* renamed from: com.google.android.play.core.splitinstall.ar */ final class C2365ar extends C2367at<List<SplitInstallSessionState>> { C2365ar(C2368au auVar, C2415i<List<SplitInstallSessionState>> iVar) { super(auVar, iVar); } /* renamed from: h */ public final void mo33856h(List<Bundle> list) throws RemoteException { super.mo33856h(list); ArrayList arrayList = new ArrayList(list.size()); for (Bundle d : list) { arrayList.add(SplitInstallSessionState.m1454d(d)); } this.f2085a.mo34076e(arrayList); } }
[ "a.amirovv@mail.ru" ]
a.amirovv@mail.ru
742dc279923b789c4119b46ca05592e72ebf6cf6
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--intellij-community/3842c6a775c6ce5edbc0af2cf9070c52c355a5ad/before/CheckboxTree.java
2d772c537c0109fdf876210c8352a5a1a082d6e0
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
1,851
java
/* * Copyright 2000-2009 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.ui; import java.awt.event.KeyEvent; /** * User: lex * Date: Sep 18, 2003 * Time: 5:40:20 PM */ public class CheckboxTree extends CheckboxTreeBase { public static abstract class CheckboxTreeCellRenderer extends CheckboxTreeCellRendererBase { // This is 6.0 compatibility layer protected CheckboxTreeCellRenderer() { } protected CheckboxTreeCellRenderer(final boolean opaque) { super(opaque); } protected CheckboxTreeCellRenderer(boolean opaque, boolean usePartialStatusForParentNodes) { super(opaque, usePartialStatusForParentNodes); } } public CheckboxTree(final CheckboxTreeCellRenderer cellRenderer, CheckedTreeNode root) { super(cellRenderer, root); TreeToolTipHandler.install(this); installSpeedSearch(); } public CheckboxTree(final CheckboxTreeCellRenderer cellRenderer, CheckedTreeNode root, final CheckPolicy checkPolicy) { super(cellRenderer, root, checkPolicy); TreeToolTipHandler.install(this); installSpeedSearch(); } protected void installSpeedSearch() { new TreeSpeedSearch(this); } protected boolean isToggleEvent(KeyEvent e) { return super.isToggleEvent(e) && !SpeedSearchBase.hasActiveSpeedSearch(this); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
c21424b2bfdbd94a085a55829ab24bffe0de185d
497fcb88c10c94fed1caa160ee110561c07b594c
/platform/platform-api/src/main/java/com/yazino/platform/table/TableSummary.java
879c5c8af2c2ca040f40d11e343c3b47e271abc6
[]
no_license
ShahakBH/jazzino-master
3f116a609c5648c00dfbe6ab89c6c3ce1903fc1a
2401394022106d2321873d15996953f2bbc2a326
refs/heads/master
2016-09-02T01:26:44.514049
2015-08-10T13:06:54
2015-08-10T13:06:54
40,482,590
0
1
null
null
null
null
UTF-8
Java
false
false
5,377
java
package com.yazino.platform.table; import com.yazino.game.api.GameType; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import java.io.Serializable; import java.math.BigDecimal; import java.util.Collections; import java.util.Set; import static org.apache.commons.lang3.Validate.notNull; public class TableSummary implements Serializable { private static final long serialVersionUID = 8674895568564876382L; private final BigDecimal id; private final String name; private final TableStatus status; private final GameType gameType; private final BigDecimal ownerId; private final String clientId; private final String clientFile; private final String templateName; private final String monitoringMessage; private final String gameTypeId; private final Set<BigDecimal> playersAtTable; private final Set<String> tags; public TableSummary(final BigDecimal id, final String name, final TableStatus status, final String gameTypeId, final GameType gameType, final BigDecimal ownerId, final String clientId, final String clientFile, final String templateName, final String monitoringMessage, final Set<BigDecimal> playersAtTable, final Set<String> tags) { notNull(id, "id may not be null"); this.playersAtTable = playersAtTable; this.id = id; this.name = name; this.status = status; this.gameTypeId = gameTypeId; this.gameType = gameType; this.ownerId = ownerId; this.clientId = clientId; this.clientFile = clientFile; this.templateName = templateName; this.monitoringMessage = monitoringMessage; this.tags = tags; } public BigDecimal getId() { return id; } public String getName() { return name; } public TableStatus getStatus() { return status; } public String getGameTypeId() { return gameTypeId; } public GameType getGameType() { return gameType; } public BigDecimal getOwnerId() { return ownerId; } public String getClientId() { return clientId; } public String getClientFile() { return clientFile; } public String getTemplateName() { return templateName; } public String getMonitoringMessage() { return monitoringMessage; } public int getNumberOfPlayers() { if (playersAtTable != null) { return playersAtTable.size(); } return 0; } public Set<BigDecimal> getPlayersAtTable() { if (playersAtTable == null) { return Collections.emptySet(); } return playersAtTable; } public Set<String> getTags() { if (tags == null) { return Collections.emptySet(); } return tags; } public boolean isOpen() { return status != null && TableStatus.open.equals(status); } @Override public boolean equals(final Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (obj.getClass() != getClass()) { return false; } final TableSummary rhs = (TableSummary) obj; return new EqualsBuilder() .append(id, rhs.id) .append(name, rhs.name) .append(status, rhs.status) .append(gameTypeId, rhs.gameTypeId) .append(gameType, rhs.gameType) .append(ownerId, rhs.ownerId) .append(clientId, rhs.clientId) .append(clientFile, rhs.clientFile) .append(templateName, rhs.templateName) .append(monitoringMessage, rhs.monitoringMessage) .append(playersAtTable, rhs.playersAtTable) .append(tags, rhs.tags) .isEquals(); } @Override public int hashCode() { return new HashCodeBuilder(13, 17) .append(id) .append(name) .append(status) .append(gameTypeId) .append(gameType) .append(ownerId) .append(clientId) .append(clientFile) .append(templateName) .append(monitoringMessage) .append(playersAtTable) .append(tags) .toHashCode(); } @Override public String toString() { return new ToStringBuilder(this) .append(id) .append(name) .append(status) .append(gameTypeId) .append(gameType) .append(ownerId) .append(clientId) .append(clientFile) .append(templateName) .append(monitoringMessage) .append(playersAtTable) .append(tags) .toString(); } }
[ "shahak.ben-hamo@rbpkrltd.com" ]
shahak.ben-hamo@rbpkrltd.com
28a23458da3a05e98f78f26f0c5ab4bce5af6333
3b4662bf1c81780688da933f5278a9db59022945
/app/src/main/java/com/linkpay/Activity/Mine/More/PasswordActivity.java
4b99cf2739c21809073209e587b5fb1c178e3786
[]
no_license
jiangadmin/LinkPay
ebd36f407a32212846cfca5eb4576e5c300792c6
e425c1420fdee1a9600b1e3090aeffd0c7f6e0cf
refs/heads/master
2021-01-19T22:41:30.018502
2017-04-20T09:30:29
2017-04-20T09:30:29
88,846,625
1
0
null
null
null
null
UTF-8
Java
false
false
3,814
java
package com.linkpay.Activity.Mine.More; import android.app.ProgressDialog; import android.os.Bundle; import android.view.View; import android.view.WindowManager; import android.widget.Button; import android.widget.CompoundButton; import android.widget.EditText; import android.widget.Switch; import com.linkpay.Activity.BaseActivity; import com.linkpay.Application.Const; import com.linkpay.Application.MyApplication; import com.linkpay.R; import com.linkpay.Service.UpdatepasswordServlet; import com.linkpay.Utils.SharedPreferencesUtil; import com.linkpay.Utils.TabToast; import com.linkpay.Utils.ToolUtil; /** * Created by jiangmac * on 15/11/18. * Email: www.fangmu@qq.com * Phone:186 6120 1018 * Purpose:密码管理 */ public class PasswordActivity extends BaseActivity implements CompoundButton.OnCheckedChangeListener { EditText oldpwd; EditText newpwd1; EditText newpwd2; Button submit; private ProgressDialog progressdialog; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_update_password); setTitle("密码管理"); setBack(true); initview(); } private void initview() { oldpwd = (EditText) findViewById(R.id.password_old); newpwd1 = (EditText) findViewById(R.id.password_new1); newpwd2 = (EditText) findViewById(R.id.password_new2); submit = (Button) findViewById(R.id.password_submit); // if (ToolUtil.isEmpty( // SharedPreferencesUtil.getInstance(this).getStringValue( // SharedPreferencesUtil.getInstance(this).getStringValue("phone") + "locuspwd"))) { // sspwd.setChecked(false); // } else { // sspwd.setChecked(true); // } } // @Override // protected void onRestart() { // super.onRestart(); // if (ToolUtil.isEmpty(SharedPreferencesUtil.getInstance(this).getStringValue(SharedPreferencesUtil.getInstance(this).getStringValue("phone") + "locuspwd"))) { // sspwd.setChecked(false); // } else { // sspwd.setChecked(true); // } // } public void Submit(View view){ String oldpwdtext = oldpwd.getText().toString().trim(); String newpwdtext1 = newpwd1.getText().toString().trim(); String newpwdtext2 = newpwd2.getText().toString().trim(); if ("".equals(oldpwdtext)) { TabToast.makeText(this, "请输入原密码!"); return; } if ("".equals(newpwdtext1)) { TabToast.makeText(this, "请输入新密码!"); return; } if (newpwdtext1.length() < 6) { TabToast.makeText(this, "密码过于简单!"); return; } if (!newpwdtext1.equals(newpwdtext2)) { TabToast.makeText(this, "两次密码不一样!"); return; } progressdialog = ProgressDialog.show(this, "请等待...", "正在修改..."); UpdatepasswordServlet.UpdatePasswordInfo updatePasswordInfo = new UpdatepasswordServlet.UpdatePasswordInfo(); updatePasswordInfo.setPhone(Const.LOGIN_PHONE); updatePasswordInfo.setOldpwd(oldpwdtext); updatePasswordInfo.setNewpwd(newpwdtext1); new UpdatepasswordServlet(this, progressdialog).execute(); } @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (ToolUtil.isEmpty( SharedPreferencesUtil.getInstance(this).getStringValue( SharedPreferencesUtil.getInstance(this).getStringValue("phone") + "locuspwd")) == isChecked) { // startActivity(new Intent(this, LocusPWDActivity.class)); } } }
[ "www.fangmu@qq.com" ]
www.fangmu@qq.com
339fe316e1aa0820ae4d1866117495d7267a1525
419e0607d4bb1ff298faca921447ee4b35e5b894
/server/src/main/java/org/elasticsearch/common/network/CloseableChannel.java
e547bcdbc93326c82da378dd4cb4f440a9154b50
[ "LicenseRef-scancode-generic-cla", "Apache-2.0" ]
permissive
crate/crate
7af793e2f709b77a5addc617d6e9dbba452d4e68
8acb044a7cdbab048b045854d0466fccc2492550
refs/heads/master
2023-08-31T07:17:42.891453
2023-08-30T15:09:09
2023-08-30T17:13:14
9,342,529
3,540
639
Apache-2.0
2023-09-14T21:00:43
2013-04-10T09:17:16
Java
UTF-8
Java
false
false
5,711
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch 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.elasticsearch.common.network; import java.io.Closeable; import java.io.IOException; import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.ActionListener; import io.crate.action.FutureActionListener; import io.crate.common.io.IOUtils; import io.crate.common.unit.TimeValue; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; public class CloseableChannel implements Closeable { private final boolean isServerChannel; private final Channel channel; private final CompletableFuture<Void> closeFuture = new CompletableFuture<>(); private volatile long lastAccessedTime; public CloseableChannel(Channel channel, boolean isServerChannel) { this.lastAccessedTime = TimeValue.nsecToMSec(System.nanoTime()); this.isServerChannel = isServerChannel; this.channel = channel; this.channel.closeFuture().addListener(f -> { if (f.isSuccess()) { closeFuture.complete(null); } else { Throwable cause = f.cause(); closeFuture.completeExceptionally(cause); if (cause instanceof Error) { ExceptionsHelper.maybeDieOnAnotherThread(cause); } } }); } public ChannelFuture writeAndFlush(ByteBuf byteBuf) { return channel.writeAndFlush(byteBuf); } public boolean isServerChannel() { return isServerChannel; } public void markAccessed(long relativeMillisTime) { lastAccessedTime = relativeMillisTime; } public long lastAccessedTime() { return lastAccessedTime; } /** * Adds a listener that will be executed when the channel is closed. If the channel is still open when * this listener is added, the listener will be executed by the thread that eventually closes the * channel. If the channel is already closed when the listener is added the listener will immediately be * executed by the thread that is attempting to add the listener. * * @param listener to be executed */ public void addCloseListener(ActionListener<Void> listener) { closeFuture.whenComplete(listener); } /** * Indicates whether a channel is currently open * * @return boolean indicating if channel is open */ public boolean isOpen() { return channel.isOpen(); } /** * @return the local address of this channel. */ public InetSocketAddress getLocalAddress() { return (InetSocketAddress) channel.localAddress(); } public InetSocketAddress getRemoteAddress() { return (InetSocketAddress) channel.remoteAddress(); } @Override public void close() { channel.close(); } /** * Closes the channel. * * @param channel to close * @param blocking indicates if we should block on channel close */ public static void closeChannel(CloseableChannel channel, boolean blocking) { closeChannels(Collections.singletonList(channel), blocking); } /** * Closes the channels. * * @param channels to close * @param blocking indicates if we should block on channel close */ public static void closeChannels(Collection<? extends CloseableChannel> channels, boolean blocking) { try { IOUtils.close(channels); } catch (IOException e) { // The CloseableChannel#close method does not throw IOException, so this should not occur. throw new AssertionError(e); } if (blocking) { ArrayList<CompletableFuture<Void>> futures = new ArrayList<>(channels.size()); for (var channel : channels) { FutureActionListener<Void, Void> closeFuture = FutureActionListener.newInstance(); channel.addCloseListener(closeFuture); futures.add(closeFuture); } for (var future : futures) { try { future.get(); } catch (ExecutionException e) { // Ignore as we are only interested in waiting for the close process to complete. Logging // close exceptions happens elsewhere. } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } } } @Override public String toString() { return "Channel{" + "isServer=" + isServerChannel + ", lastAccess=" + lastAccessedTime + ", netty=" + channel + "}"; } }
[ "37929162+mergify[bot]@users.noreply.github.com" ]
37929162+mergify[bot]@users.noreply.github.com
d53595271b03a1cc394d6cb7fc25ba71659a1086
368c663f8d031f576e3add37dde8e9052dc628d8
/java/bbop/tags/initial/src/org/bbop/framework/FrameworkUtil.java
a7b7373ff2e40c97f77a4f917be6f613989963f6
[]
no_license
mahmoudimus/obo-edit
494a588830758ddbd7cf43d2e70550ddd542cb1b
61c146958fd7d0ba7f78cda77f56d45849897b3e
refs/heads/master
2022-01-31T22:59:21.316185
2014-03-20T17:05:47
2014-03-20T17:05:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
395
java
package org.bbop.framework; import java.awt.Image; import java.awt.Toolkit; public class FrameworkUtil { protected static ClassLoader getClassLoader() { return FrameworkUtil.class.getClassLoader(); } public static Image getResourceImage(String name) { return Toolkit.getDefaultToolkit().getImage( getClassLoader().getResource( "org/bbop/framework/resources/" + name)); } }
[ "jmr39@6f0e8829-b336-0410-acfb-cb9b228023ad" ]
jmr39@6f0e8829-b336-0410-acfb-cb9b228023ad
9587fa4630978808683806cb4c92e62e66a7bae0
762f59aa92615477756e9d6daebfc4c5fac3acd7
/advancedtoolbar/src/main/java/com/hkm/advancedtoolbar/advBar.java
c2e92b0cf5c099e4b46c0cbfa50dd0e7f6faa6d1
[ "MIT" ]
permissive
aaaliua/ToolBarLib
5863f6567af35ec50c719852c8913fbf0f7837fd
20f09e9a37fe0f184a303467d7ede12a12106c92
refs/heads/master
2017-11-15T23:31:10.530815
2015-07-21T01:30:31
2015-07-21T01:30:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
993
java
package com.hkm.advancedtoolbar; import android.app.Activity; import android.content.Context; import android.support.annotation.Nullable; import android.support.v7.widget.Toolbar; import android.util.AttributeSet; import com.hkm.advancedtoolbar.Util.ToolbarColorizeHelper; /** * Created by hesk on 8/5/15. */ public class advBar extends Toolbar { private final Context contx; public advBar(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); contx = context; init(); } public advBar(Context context, @Nullable AttributeSet attrs) { super(context, attrs); contx = context; init(); } public advBar(Context context) { super(context); contx = context; init(); } private void init() { } public void colorize(int colorResId, Activity actio) { ToolbarColorizeHelper.colorizeToolbar(this, colorResId, actio); } }
[ "jobhesk@gmail.com" ]
jobhesk@gmail.com
40d06352a4d91db17d076a14c3ca1f4de58dc69c
ed94ed3f6a242e392dbb4a3f2de32b71f3335043
/DP6_3_2/app/src/main/java/com/example/jianqiang/dp6_3_2/MainActivity.java
99f27cfc8a5f4483bb0d70c9ff8c3a860b05c810
[ "MIT" ]
permissive
BaoBaoJianqiang/AndroidDesignPatternDemo
194fc1476b8fb880d5de90d39fdf8e316fe6d9be
c4560df8a608960701007796536504d0aa6278e3
refs/heads/master
2021-01-20T13:46:01.152611
2017-05-07T11:00:52
2017-05-07T11:00:56
90,526,393
1
2
null
null
null
null
UTF-8
Java
false
false
629
java
package com.example.jianqiang.dp6_3_2; import android.app.Activity; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Content content = new Content(); User user1 = new User("baobao", "baobao@qq.com"); content.addUser(user1); User user2 = new User("jianqiang", "jianqiang@hotmail.com"); content.addUser(user1); content.notifyUsers(); } }
[ "16230091@qq.com" ]
16230091@qq.com
bb4f10ddbbecf82d5b8cac1e59711d890743d55a
74acea1b7f2a3a509b9ead48f186c9349bf55cc8
/framework/src/main/java/com/enjoyf/platform/serv/shorturl/ShortUrlInitializer.java
339701c55bc3ca7aa1b6dd57e9626489d28194de
[]
no_license
liu67224657/besl-platform
6cd2bfcc7320a4039e61b114173d5f350345f799
68c126bea36c289526e0cc62b9d5ce6284353d11
refs/heads/master
2022-04-16T02:23:40.178907
2020-04-17T09:00:01
2020-04-17T09:00:01
109,520,110
1
1
null
null
null
null
UTF-8
Java
false
false
1,236
java
/** * CopyRight 2007 Fivewh.com */ package com.enjoyf.platform.serv.shorturl; import com.enjoyf.platform.serv.thrserver.ServerThreadRequestPool; import com.enjoyf.platform.serv.thrserver.ServiceConfig; import com.enjoyf.platform.serv.thrserver.ServiceInitializer; import com.enjoyf.platform.service.shorturl.ShortUrlConstants; import com.enjoyf.platform.util.FiveProps; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * @author <a href=mailto:yinpengyi@fivewh.com>Yin Pengyi</a> */ class ShortUrlInitializer implements ServiceInitializer { private static final Logger logger = LoggerFactory.getLogger(ShortUrlInitializer.class); public ServiceConfig init(FiveProps servProps) { ServerThreadRequestPool server = new ServerThreadRequestPool(ShortUrlConstants.SERVICE_PREFIX, servProps); ShortUrlConfig config = new ShortUrlConfig(servProps); logger.info("ShortUrlInitializer, config is " + config.toString()); ShortUrlLogic logic = new ShortUrlLogic(config); server.setPacketProcessor(new ShortUrlPacketDecoder(logic)); return new ServiceConfig(servProps, ShortUrlConstants.SERVICE_PREFIX, server); } public void postStart() { //todo } }
[ "ericliu@staff.joyme.com" ]
ericliu@staff.joyme.com
8d33ec83db2a5c8f678dac8ef7bd18f56605331c
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/35/35_a28a019d19ecbb426f987f10eb4d804ba12e041c/BaseMessagesManager/35_a28a019d19ecbb426f987f10eb4d804ba12e041c_BaseMessagesManager_t.java
ae5ff9b73051e7034890300b8f52dfdb784754d2
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
6,319
java
package org.java_websocket.MessagesManagers; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.Calendar; import org.json.simple.JSONObject; import org.java_websocket.DoctorClientManager; import org.java_websocket.Messages.EyeTrackerDataPacket; /** * * @author Matteo Ciman */ public abstract class BaseMessagesManager extends Thread { protected String folderWhereArchive = "archivio_visite"; protected String relativeFolder = null; protected String separator = File.separator; protected BufferedWriter touchWriter = null; protected BufferedWriter imageWriter = null; protected BufferedWriter eyeTrackerWriter = null; protected BufferedWriter deltaWriter = null; protected Boolean endGame = false; protected String fileTouch = null; protected String fileImage = null; protected String fileEyeTracking = null; protected String fileSpecs = null; protected int visitID = 0; protected boolean withEyeTracker = false; public ArrayList<JSONObject> messagesGameBuffer = new ArrayList<JSONObject>(); public ArrayList<JSONObject> messagesEyeTrackerBuffer = new ArrayList<JSONObject>(); public long startTime = 0; public final Object bufferSynchronizer = new Object(); protected int maxFPS = 25; protected Long MAX_DIFFERENCE = new Long(1000 / maxFPS + (1000 / maxFPS) / 2); protected Long MAX_TIME_WAITING = new Long((1000 / maxFPS) * 2); protected static DoctorClientManager doctorManager = null; public BaseMessagesManager(String patientID, int visitID, boolean withEyeTracker) { this.visitID = visitID; this.withEyeTracker = withEyeTracker; if (!this.withEyeTracker) { messagesEyeTrackerBuffer = null; } // devo creare cartella dove salverò i file Calendar giornoVisita = Calendar.getInstance(); String anno = new Integer(giornoVisita.get(Calendar.YEAR)).toString(); String mese = new Integer(giornoVisita.get(Calendar.MONTH) + 1).toString(); String giorno = new Integer(giornoVisita.get(Calendar.DAY_OF_MONTH)).toString(); String ora = new Integer(giornoVisita.get(Calendar.HOUR_OF_DAY)).toString(); String minuti = new Integer(giornoVisita.get(Calendar.MINUTE)).toString(); String subfolder = anno + "-" + mese + "-" + giorno + "-" + ora + "-" + minuti + "-" + new Integer(visitID).toString(); relativeFolder = folderWhereArchive.concat(separator) .concat(patientID).concat(separator).concat(subfolder) .concat(separator); folderWhereArchive = System.getProperty("user.dir") .concat(separator).concat(relativeFolder).concat(separator); File folder = new File(folderWhereArchive); if (!folder.exists()) { folder.mkdirs(); } fileTouch = folderWhereArchive.concat("InputTouch.txt"); fileImage = folderWhereArchive.concat("InputImage.txt"); fileEyeTracking = folderWhereArchive.concat("InputEyeTracking.txt"); String fileDelta = folderWhereArchive.concat("DeltaValues.txt"); while (touchWriter == null || imageWriter == null || eyeTrackerWriter == null || deltaWriter == null ) { try { if (touchWriter == null) { touchWriter = new BufferedWriter(new FileWriter(fileTouch)); } if (imageWriter == null) { imageWriter = new BufferedWriter(new FileWriter(fileImage)); } if (eyeTrackerWriter == null) { eyeTrackerWriter = new BufferedWriter(new FileWriter(fileEyeTracking)); } if (deltaWriter == null) { deltaWriter = new BufferedWriter(new FileWriter(fileDelta)); } } catch(IOException exc) { exc.printStackTrace(); } } } @Override public abstract void run(); void endGame() { endGame = true; } public static void setDoctorClient(DoctorClientManager doctorManager) { BaseMessagesManager.doctorManager = doctorManager; } public String getFolderWhereArchive() { return relativeFolder; } public void writeDirectionInfo(String direction) { try { String toWrite = "----- " + direction + " -----"; touchWriter.write(toWrite); touchWriter.newLine(); touchWriter.flush(); eyeTrackerWriter.write(toWrite); eyeTrackerWriter.newLine(); eyeTrackerWriter.flush(); imageWriter.write(toWrite); imageWriter.newLine(); imageWriter.flush(); } catch(IOException exc) { } } public void writeGameSpecs(Long imgWidth, Long imgHeight, Long screenWidth, Long screenHeight) { fileSpecs = folderWhereArchive.concat("GameSpecs.ini"); try { BufferedWriter specsWriter = new BufferedWriter(new FileWriter(fileSpecs, true)); specsWriter.write(screenWidth.toString() + 'x' + screenHeight.toString()); specsWriter.newLine(); specsWriter.write(imgWidth.toString() + 'x' + imgHeight.toString()); specsWriter.flush(); specsWriter.close(); } catch(IOException exc) { System.out.println("Cannot create specs file: " + exc.toString()); } } void writeEyeTrackerMessage(EyeTrackerDataPacket packet) { try { eyeTrackerWriter.write(packet.toString()); eyeTrackerWriter.newLine(); eyeTrackerWriter.flush(); } catch(IOException exc) {} } public void manageDifferentGameData(JSONObject packet) {} public void gameIsEnded() {} public void withoutTracker() { this.withEyeTracker = false; messagesEyeTrackerBuffer = null; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
761bd47e5d4bac508cbb632bba00d7eee3c29acd
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Roller/Roller2245.java
0fe1876b5e125554b05ffbba8abf1480ba34fd79
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
815
java
public Date getLastModified() { Date lastModified = null; // first try our cached version if(this.lastUpdateTime != null) { lastModified = (Date) this.lastUpdateTime.getValue(); } // still null, we need to get a fresh value if(lastModified == null) { // TODO: create a WeblogManager.getLastUpdated() method to use below lastModified = null; if (lastModified == null) { lastModified = new Date(); log.warn("Can't get lastUpdate time, using current time instead"); } this.lastUpdateTime = new ExpiringCacheEntry(lastModified, this.timeout); } return lastModified; }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
022f729be6076b97f7e427ece8271396b5b23684
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/actorapp--actor-platform/82b97010bf6f5074e1cdc72a00298010c0b1fe97/after/JsCryptoProvider.java
b7209331f2c5bf2b7645baa3523f2a2a9d54a407
[]
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
417
java
/* * Copyright (C) 2015 Actor LLC. <https://actor.im> */ package im.actor.runtime.js; import im.actor.runtime.crypto.CryptoKeyPair; import im.actor.runtime.crypto.bouncycastle.BouncyCastleRuntime; import im.actor.runtime.js.crypto.Rsa; public class JsCryptoProvider extends BouncyCastleRuntime { @Override public CryptoKeyPair generateRSA1024KeyPair() { return Rsa.generate1024RsaKey(); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
9f8514b0fcdd4af6618e02cb65d7813b0bd7acac
0e06e096a9f95ab094b8078ea2cd310759af008b
/classes52-dex2jar/com/google/android/gms/games/PlayerLevelInfo.java
ae9083b4b35fda0beed454a7cf0e3cbfc2e256ea
[]
no_license
Manifold0/adcom_decompile
4bc2907a057c73703cf141dc0749ed4c014ebe55
fce3d59b59480abe91f90ba05b0df4eaadd849f7
refs/heads/master
2020-05-21T02:01:59.787840
2019-05-10T00:36:27
2019-05-10T00:36:27
185,856,424
1
2
null
2019-05-10T00:36:28
2019-05-09T19:04:28
Java
UTF-8
Java
false
false
3,777
java
// // Decompiled by Procyon v0.5.34 // package com.google.android.gms.games; import android.os.Parcelable; import com.google.android.gms.common.internal.safeparcel.SafeParcelWriter; import android.os.Parcel; import com.google.android.gms.common.internal.Objects; import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Constructor; import com.google.android.gms.common.internal.Preconditions; import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Param; import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Field; import android.os.Parcelable$Creator; import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Reserved; import com.google.android.gms.common.internal.safeparcel.SafeParcelable$Class; import com.google.android.gms.games.internal.zzd; @SafeParcelable$Class(creator = "PlayerLevelInfoCreator") @SafeParcelable$Reserved({ 1000 }) public final class PlayerLevelInfo extends zzd { public static final Parcelable$Creator<PlayerLevelInfo> CREATOR; @SafeParcelable$Field(getter = "getCurrentXpTotal", id = 1) private final long zzcs; @SafeParcelable$Field(getter = "getLastLevelUpTimestamp", id = 2) private final long zzct; @SafeParcelable$Field(getter = "getCurrentLevel", id = 3) private final PlayerLevel zzcu; @SafeParcelable$Field(getter = "getNextLevel", id = 4) private final PlayerLevel zzcv; static { CREATOR = (Parcelable$Creator)new zzar(); } @SafeParcelable$Constructor public PlayerLevelInfo(@SafeParcelable$Param(id = 1) final long zzcs, @SafeParcelable$Param(id = 2) final long zzct, @SafeParcelable$Param(id = 3) final PlayerLevel zzcu, @SafeParcelable$Param(id = 4) final PlayerLevel zzcv) { Preconditions.checkState(zzcs != -1L); Preconditions.checkNotNull((Object)zzcu); Preconditions.checkNotNull((Object)zzcv); this.zzcs = zzcs; this.zzct = zzct; this.zzcu = zzcu; this.zzcv = zzcv; } public final boolean equals(final Object o) { if (o instanceof PlayerLevelInfo) { if (o == this) { return true; } final PlayerLevelInfo playerLevelInfo = (PlayerLevelInfo)o; if (Objects.equal((Object)this.zzcs, (Object)playerLevelInfo.zzcs) && Objects.equal((Object)this.zzct, (Object)playerLevelInfo.zzct) && Objects.equal((Object)this.zzcu, (Object)playerLevelInfo.zzcu) && Objects.equal((Object)this.zzcv, (Object)playerLevelInfo.zzcv)) { return true; } } return false; } public final PlayerLevel getCurrentLevel() { return this.zzcu; } public final long getCurrentXpTotal() { return this.zzcs; } public final long getLastLevelUpTimestamp() { return this.zzct; } public final PlayerLevel getNextLevel() { return this.zzcv; } public final int hashCode() { return Objects.hashCode(new Object[] { this.zzcs, this.zzct, this.zzcu, this.zzcv }); } public final boolean isMaxLevel() { return this.zzcu.equals(this.zzcv); } public final void writeToParcel(final Parcel parcel, final int n) { final int beginObjectHeader = SafeParcelWriter.beginObjectHeader(parcel); SafeParcelWriter.writeLong(parcel, 1, this.getCurrentXpTotal()); SafeParcelWriter.writeLong(parcel, 2, this.getLastLevelUpTimestamp()); SafeParcelWriter.writeParcelable(parcel, 3, (Parcelable)this.getCurrentLevel(), n, false); SafeParcelWriter.writeParcelable(parcel, 4, (Parcelable)this.getNextLevel(), n, false); SafeParcelWriter.finishObjectHeader(parcel, beginObjectHeader); } }
[ "querky1231@gmail.com" ]
querky1231@gmail.com
62be4e0cadee4bfb54d36ad58eaa73c6d432cf73
8d3f62fb5f3ae00cf29502ea519be8733665f39c
/dterp/src/hr/salary_standard/register_ok.java
c6f1e7d84e70efdee5181a1ed6726331fe92f8ad
[]
no_license
xu03101431/dterp
8f14c6f360235d39d24a249437f4100fe12b0ad9
a84ec9ce7bc9bee5cb9f5a8a2c62cdc04f294bdf
refs/heads/master
2021-01-19T09:51:52.382108
2010-12-21T02:27:40
2010-12-21T02:27:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,815
java
/* *this file is part of nseer erp *Copyright (C)2006-2010 Nseer(Beijing) Technology co.LTD/http://www.nseer.com * *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, or (at your option) any later version. */ package hr.salary_standard; import javax.servlet.http.*; import javax.servlet.jsp.*; import javax.servlet.*; import java.sql.ResultSet; import java.util.*; import java.io.* ; import include.nseer_cookie.*; import include.nseer_db.*; import validata.ValidataNumber; public class register_ok extends HttpServlet{ //创建方法 ServletContext application; HttpSession session; public synchronized void service(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException{ HttpSession dbSession=request.getSession(); JspFactory _jspxFactory=JspFactory.getDefaultFactory(); PageContext pageContext = _jspxFactory.getPageContext(this,request,response,"",true,8192,true); ServletContext dbApplication=dbSession.getServletContext(); counter count = new counter(dbApplication); try{ nseer_db_backup1 hr_db = new nseer_db_backup1(dbApplication); HttpSession session=request.getSession(); PrintWriter out=response.getWriter(); if(hr_db.conn((String)dbSession.getAttribute("unit_db_name"))){ ValidataNumber validata= new ValidataNumber(); String standard_ID=request.getParameter("standard_ID"); String standard_name=request.getParameter("standard_name"); String register=request.getParameter("register") ; String register_time=request.getParameter("register_time") ; String major_type=request.getParameter("major_type") ; String designer=request.getParameter("designer") ; String[] item_name=request.getParameterValues("item_name"); String[] salary=request.getParameterValues("salary"); String[] details_number=request.getParameterValues("details_number"); int p=0; for(int i=0;i<item_name.length;i++){ if(!salary[i].equals("")){ StringTokenizer tokenTO4 = new StringTokenizer(salary[i],","); String salary1=""; while(tokenTO4.hasMoreTokens()) { salary1+= tokenTO4.nextToken(); } if(!validata.validata(salary1)){ p++; } } } if(p==0){ int n=0; double salary_sum=0.0d; for(int i=0;i<item_name.length;i++){ if(!salary[i].equals("")){ StringTokenizer tokenTO4 = new StringTokenizer(salary[i],","); String salary1=""; while(tokenTO4.hasMoreTokens()) { salary1+= tokenTO4.nextToken(); if(salary1.indexOf("-")!=-1){ n++; } } } } if(n==0){ try{ String sql1="delete from hr_salary_standard where standard_ID='"+standard_ID+"'"; hr_db.executeUpdate(sql1); String sql3="delete from hr_salary_standard_details where standard_ID='"+standard_ID+"'"; hr_db.executeUpdate(sql3); for(int i=0;i<item_name.length;i++){ if(salary[i].equals("")) salary[i]="0"; String salarying=""; StringTokenizer tokenTO = new StringTokenizer(salary[i],","); while(tokenTO.hasMoreTokens()) { salarying+=tokenTO.nextToken(); } salary_sum+=Double.parseDouble(salarying); String sql4="insert into hr_salary_standard_details(standard_ID,standard_name,details_number,item_name,salary) values('"+standard_ID+"','"+standard_name+"','"+details_number[i]+"','"+item_name[i]+"','"+salarying+"')"; hr_db.executeUpdate(sql4); } String mod=request.getRequestURI(); count.writeTime((String)dbSession.getAttribute("unit_db_name"),mod); String sql2="insert into hr_salary_standard(standard_ID,standard_name,major_type,designer,register,register_time,salary_sum) values('"+standard_ID+"','"+standard_name+"','"+major_type+"','"+designer+"','"+register+"','"+register_time+"','"+salary_sum+"')"; hr_db.executeUpdate(sql2); List rsList = GetWorkflow.getList(hr_db, "hr_config_workflow", "02"); if(rsList.size()==0){ String sql="update hr_salary_standard set check_tag='1' where standard_ID='"+standard_ID+"'"; hr_db.executeUpdate(sql); }else{ Iterator ite=rsList.iterator(); while(ite.hasNext()){ String[] elem=(String[])ite.next(); String sql = "insert into hr_workflow(config_id,object_ID,type_id,describe1,describe2) values ('"+elem[0]+"','"+standard_ID+"','02','"+elem[1]+"','"+elem[2]+"')" ; hr_db.executeUpdate(sql); } } }catch (Exception ex){ out.println("error"+ex); } response.sendRedirect("hr/salary_standard/register_ok_a.jsp"); }else{ response.sendRedirect("hr/salary_standard/register_ok_b.jsp"); }}else{ response.sendRedirect("hr/salary_standard/register_ok_c.jsp"); } hr_db.commit(); hr_db.close(); }else{ response.sendRedirect("error_conn.htm"); } }catch(Exception ex){} } }
[ "koldwang@c656a910-b44f-1779-863a-4890726b0c2b" ]
koldwang@c656a910-b44f-1779-863a-4890726b0c2b
98494f9aa594740188a0c1d3fe77f0fbfb5b4f12
1671d87c2e414de8186570983c65c220888f20b1
/第一阶段/day08/src/com/atguigu/java/AnonymityObject.java
032b25bde9dd161e2f995ae9f762e0f175e40716
[]
no_license
qisirendexudoudou/BigData_0722
4f25b508b4c20088d4155abb2d52e1d39c8b0e81
e474e6ebcbbfedd12f859f0198238f58b73e5bec
refs/heads/master
2022-07-21T17:41:47.611707
2019-11-16T05:59:11
2019-11-16T05:59:11
221,875,869
0
0
null
2022-06-21T02:14:43
2019-11-15T08:10:07
Java
UTF-8
Java
false
false
760
java
package com.atguigu.java; /* 匿名对象 : 没有名字的对象 特点 : 只能使用一次。 使用场景 : 往往将匿名对象作为实参进行传递。 */ class Cat{ String name; public void run(){ System.out.println(name + "在跑步"); } } public class AnonymityObject { public static void main(String[] args) { //创建对象 Cat cat = new Cat(); cat.name = "菊猫"; cat.run(); //创建匿名对象 new Cat().name = "小猫咪"; new Cat().run(); //调用方法 Cat c = new Cat(); new AnonymityObject().setCat(new Cat()); } //方法 public void setCat(Cat cat){ //注意 : 如果形参是一个引用数据类型,那么我们往往传递的是该类的类型的对象。 } }
[ "546223079@qq.com" ]
546223079@qq.com
3c7a03f259f6869d8a57e0568b2750403b774fdd
04e0a881aeffbbac97a91a781828e4b2dabe3cba
/aksw-commons-beans/src/main/java/org/aksw/commons/beans/datatype/TypeUtils.java
22c78a7790ed132ada81ce4cc665ee621e192f5c
[ "Apache-2.0" ]
permissive
SmartDataAnalytics/aksw-commons
3eb7bf4d64e29f5d7606109e237d0a3f17a98946
41bf1a0b8d79e02404bb6be0ab77e3c2812b68bf
refs/heads/develop
2023-08-31T00:33:10.251977
2023-08-24T11:18:34
2023-08-24T11:18:34
39,384,919
1
1
null
2023-06-14T22:50:15
2015-07-20T13:18:56
Java
UTF-8
Java
false
false
3,054
java
package org.aksw.commons.beans.datatype; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.lang.reflect.WildcardType; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; import com.google.common.collect.Maps; public class TypeUtils { // Getter must be no-arg methods, whose result type is either a subclass of // RDFNode or a type registered at jena's type factory public static List<Class<?>> extractItemTypes(Type genericType) { List<Class<?>> result = new ArrayList<>(); if(genericType instanceof ParameterizedType) { ParameterizedType pt = (ParameterizedType)genericType; java.lang.reflect.Type[] types = pt.getActualTypeArguments(); for( java.lang.reflect.Type argType : types) { if(argType instanceof Class) { result.add((Class<?>)argType); } else if(argType instanceof WildcardType) { // TODO We should take bounds into account result.add(Object.class); } else { result.add(null); //throw new RuntimeException("Don't know how to handle " + argType); } } } return result; } public static Entry<Class<?>, Class<?>> extractMapTypes(Type genericType) { Entry<Class<?>, Class<?>> result = null; List<Class<?>> types = extractItemTypes(genericType); if(types.size() == 2) { Class<?> keyType = types.get(0); Class<?> valueType = types.get(1); if(keyType != null && valueType != null) { result = Maps.immutableEntry(keyType, valueType); } else { throw new RuntimeException("Don't know how to handle " + genericType); } } return result; } public static Class<?> extractItemType(Type genericType) { Class<?> result = null; List<Class<?>> types = extractItemTypes(genericType); if(types.size() == 1) { Class<?> argType = types.get(0); if(argType != null) { result = argType; } else { throw new RuntimeException("Don't know how to handle " + genericType); } } // if(genericType instanceof ParameterizedType) { // ParameterizedType pt = (ParameterizedType)genericType; // java.lang.reflect.Type[] types = pt.getActualTypeArguments(); // if(types.length == 1) { // Type argType = types[0]; // if(argType instanceof Class) { // result = (Class<?>)argType; // } else if(argType instanceof WildcardType) { // // TODO We should take bounds into account // result = Object.class; // } else { // throw new RuntimeException("Don't know how to handle " + argType); // } // } // } return result; } }
[ "RavenArkadon@googlemail.com" ]
RavenArkadon@googlemail.com
e4fde5bfc45b96fc328f3e0ac88562633b9267f9
3c68655e399307704790a8c1e17e668b235d27d3
/07_JSON_Processing/exercises/ProductsShop/src/main/java/app/repositories/UserRepository.java
6f2520e81ccee9c7f6931c30b8bc1d42421b2f85
[]
no_license
IvoIvanov77/Databases-Frameworks---Hibernate-Spring-Data---March-2018
17a3cecaab17f288e2306386b43a90df84a0f7b5
ffb249fd1b98408be651360af28db91977657edd
refs/heads/master
2021-03-30T21:28:22.868394
2018-05-14T19:13:18
2018-05-14T19:13:18
124,792,252
0
0
null
null
null
null
UTF-8
Java
false
false
1,649
java
package app.repositories; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import app.domain.models.User; import java.util.List; @Repository public interface UserRepository extends JpaRepository<User, Long> { /** Get all users who have at least 1 sold item with a buyer. * Order them by last name, then by first name. Select the person's first and last name. * For each of the sold products (products with buyers), select the product's name, * price and the buyer's first and last name. * @return List of users */ @Query("select distinct u from User u inner join fetch u.soldProducts p " + "where p.buyer is not null " + "order by u.lastName, u.firstName") List<User> findBySoldProducts(); // SELECT u.first_name, u.last_name, COUNT(p.id) AS products_count // FROM users AS u // INNER JOIN products AS p ON p.seller_id = u.id // WHERE p.buyer_id IS NOT NULL // GROUP BY u.id // ORDER BY products_count DESC, u.last_name; /** Get all users who have at least 1 sold product. Order them by the number of sold products * (from highest to lowest), then by last name (ascending). * Select only their first and last name, age and for each product - name and price. * * @return List of users */ @Query("select distinct u from User u " + "inner join fetch u.soldProducts p " + "where p.buyer is not null " + "order by u.lastName") List<User> findAllUsersWithSoldProducts(); }
[ "ivanov_ir@abv.bg" ]
ivanov_ir@abv.bg
f48969b43755b7520998644b755c4575ba79776b
d4e21881b569f6fe1c1781f7c933369909dac2e5
/java-programming-samples/functional/009-evolving-apis/src/main/java/org/joolzminer/examples/functional/Resizable.java
0209480d61dacdec3e3dad0889e308b6f474ae58
[]
no_license
sergiofgonzalez/Java-Programming-Repo
985640c7d26cfb7e46afbc8babd8004f3098d13e
837d9f8365a594d2f766fcff76b5b98a06065bce
refs/heads/master
2021-01-21T22:26:12.158608
2015-05-04T07:12:08
2015-05-04T07:12:08
17,510,341
0
0
null
null
null
null
UTF-8
Java
false
false
521
java
package org.joolzminer.examples.functional; public interface Resizable extends Drawable { // API version 1 int getWidth(); int getHeight(); void setWidth(int width); void setHeight(int height); void setAbsoluteSize(int width, int height); // API version 2 // void setRelativeSize(int wFactor, int hFactor); <- this breaks client code!! // this will not make client code break default void setRelativeSize(int wFactor, int hFactor) { setAbsoluteSize(getWidth() / wFactor, getHeight() / hFactor); } }
[ "sergio.f.gonzalez@gmail.com" ]
sergio.f.gonzalez@gmail.com
8555b2e0ebaea3aeb02716857960aa5fc6db9e76
13c69108255837703a4e809e649a4008cc6ae90a
/src/main/java/com/lightwing/ch36_Examples/p03/_02_addElement.java
3a3b566aad2210c236567748450180303874c8cf
[]
no_license
Lightwing-Ng/Java_RunoobTutorial
2cca057289b1487d638de0cda09d3a0413972de9
fd1997ac2d96fdf966c9a418b1bf02ae293e8afe
refs/heads/master
2020-03-25T15:15:37.769673
2018-08-12T11:01:23
2018-08-12T11:01:23
143,874,672
0
0
null
null
null
null
UTF-8
Java
false
false
1,532
java
package com.lightwing.ch36_Examples.p03; import java.util.Arrays; /** * @ClassName _02_addElement * @Description TODO * @Author Lightwing Ng * @DateTime 2018/8/10, 14:28 * @Version 1.0 **/ public class _02_addElement { public static void main(String args[]) { int array[] = { 2, 5, -2, 6, -3, 8, 0, -7, -9, 4 }; Arrays.sort(array); printArray("数组排序", array); int index = Arrays.binarySearch(array, 1); System.out.println( "元素 1 所在位置(负数为不存在):" + index ); int newIndex = -index - 1; array = insertElement(array, 1, newIndex); printArray("数组添加元素 1", array); } private static void printArray(String message, int array[]) { System.out.println(message + ": [length: " + array.length + "]"); for (int i = 0; i < array.length; i++) { if (i != 0) System.out.print(", "); System.out.print(array[i]); } System.out.println(); } private static int[] insertElement( int original[], int element, int index) { int length = original.length; int destination[] = new int[length + 1]; System.arraycopy(original, 0, destination, 0, index); destination[index] = element; System.arraycopy(original, index, destination, index + 1, length - index); return destination; } }
[ "rodney_ng@icloud.com" ]
rodney_ng@icloud.com
ab6861b0985b2901d2c2ec6635a4a15560f6452d
e8597168f6d610d853842133fc1b20403ced8558
/src/main/java/betterquesting/api2/client/gui/controls/callbacks/CallbackMulti.java
ec919cdc1808f48c590d9c2e41364871f9646f74
[ "MIT" ]
permissive
Funwayguy/BetterQuesting
8cb4a016991e43f6ccce8eff517c86511a7c0ecf
414be1e8677a4ec7cca5945c41905ff3045309fa
refs/heads/1.12
2022-11-15T08:00:55.080382
2020-05-06T23:55:25
2020-05-06T23:55:25
48,046,159
77
80
MIT
2022-10-30T00:55:22
2015-12-15T13:55:36
Java
UTF-8
Java
false
false
466
java
package betterquesting.api2.client.gui.controls.callbacks; import betterquesting.api.misc.ICallback; public class CallbackMulti<T> implements ICallback<T> { private final ICallback<T>[] callbacks; public CallbackMulti(ICallback<T>... callbacks) { this.callbacks = callbacks; } @Override public void setValue(T value) { for(ICallback<T> c : callbacks) { c.setValue(value); } } }
[ "FunwayguyEmail@gmail.com" ]
FunwayguyEmail@gmail.com
32895f415b7e2567f721e22040ea47ba4b118eb1
6672a107a3dcce0a618ef34e40d41d4852c24fa2
/src/main/java/com/pojo/User.java
3b47b8b911a61108e62aad246e18c4d9c1b785ed
[]
no_license
tuojiang/Guidesystem
320645e2abdb6cffbec5757bc76c6f64a81a3809
63e5f61009cc3f9d4151d1f604ee74b6eb44d278
refs/heads/master
2021-05-08T19:36:29.968206
2018-12-14T07:14:44
2018-12-14T07:14:44
119,573,135
0
0
null
null
null
null
UTF-8
Java
false
false
2,121
java
package com.pojo; /** * <p>Description: </p> * * @author:boboan * @version:1.0 */ public class User { /** * 学号id */ private Integer id; /** * 姓名 */ private String name; /** * 用户密码 */ private String passwd; /** * 学院 */ private String college; /** * 专业 */ private String professional; /** * 班级 */ private String classes; /** * 社团 */ private String corporation; /** * 审核状态 默认为0,审核通过为1 */ private Integer status; /** * 用户角色默认为0,普通用户,1:管理员 */ private Integer role; public User() { } public User(Integer id, String name, String passwd, String college, String professional, String classes, String corporation, Integer status, Integer role) { this.id = id; this.name = name; this.passwd = passwd; this.college = college; this.professional = professional; this.classes = classes; this.corporation = corporation; this.status = status; this.role = role; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPasswd() { return passwd; } public void setPasswd(String passwd) { this.passwd = passwd; } public String getCollege() { return college; } public void setCollege(String college) { this.college = college; } public String getProfessional() { return professional; } public void setProfessional(String professional) { this.professional = professional; } public String getClasses() { return classes; } public void setClasses(String classes) { this.classes = classes; } public String getCorporation() { return corporation; } public void setCorporation(String corporation) { this.corporation = corporation; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Integer getRole() { return role; } public void setRole(Integer role) { this.role = role; } }
[ "yihongou@tcl.com" ]
yihongou@tcl.com
a8506bd313faef5e5dd9290a7c5b41e5fcb5387f
8b5cdda28454b0aab451a4b3216a58ca87517c41
/AL-Game/src/com/aionemu/gameserver/utils/collections/cachemap/AbstractCacheMap.java
589f343bd73c08d8c2a5356811ad964741d28eaa
[]
no_license
flroexus/aelp
ac36cd96963bd12847e37118531b68953f9e8440
4f6cca6b462419accf53b58c454be0cf6abe39c0
refs/heads/master
2023-05-28T18:36:47.919387
2020-09-05T07:27:49
2020-09-05T07:27:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,936
java
package com.aionemu.gameserver.utils.collections.cachemap; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; import java.util.HashMap; import java.util.Map; import org.slf4j.Logger; /** * Base class for {@link WeakCacheMap} and {@link SoftCacheMap} * * @author Luno * @param <K> * @param <V> */ abstract class AbstractCacheMap<K, V> implements CacheMap<K, V> { private final Logger log; protected final String cacheName; protected final String valueName; /** Map storing references to cached objects */ protected final Map<K, Reference<V>> cacheMap = new HashMap<K, Reference<V>>(); protected final ReferenceQueue<V> refQueue = new ReferenceQueue<V>(); /** * @param cacheName * @param valueName */ AbstractCacheMap(String cacheName, String valueName, Logger log) { this.cacheName = "#CACHE [" + cacheName + "]# "; this.valueName = valueName; this.log = log; } /** {@inheritDoc} */ @Override public void put(K key, V value) { cleanQueue(); if (cacheMap.containsKey(key)) throw new IllegalArgumentException("Key: " + key + " already exists in map"); Reference<V> entry = newReference(key, value, refQueue); cacheMap.put(key, entry); if (log.isDebugEnabled()) log.debug(cacheName + " : added " + valueName + " for key: " + key); } /** {@inheritDoc} */ @Override public V get(K key) { cleanQueue(); Reference<V> reference = cacheMap.get(key); if (reference == null) return null; V res = reference.get(); if (res != null && log.isDebugEnabled()) log.debug(cacheName + " : obtained " + valueName + " for key: " + key); return res; } @Override public boolean contains(K key) { cleanQueue(); return cacheMap.containsKey(key); } protected abstract void cleanQueue(); @Override public void remove(K key) { cacheMap.remove(key); } protected abstract Reference<V> newReference(K key, V value, ReferenceQueue<V> queue); }
[ "luiz.philip@amedigital.com" ]
luiz.philip@amedigital.com
e18c3466770eb08c47530dc8203f4b7d06cfe354
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-1.3-rc2/samples/loanbroker/src/java/org/mule/samples/loanbroker/AsyncLoanBroker.java
e3ba011bcb381350cc2f4267733f5a107b6a8810
[ "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-symphonysoft" ]
permissive
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
2,433
java
/* * $Header$ * $Revision$ * $Date$ * ------------------------------------------------------------------------------------------------------ * * Copyright (c) SymphonySoft Limited. All rights reserved. * http://www.symphonysoft.com * * The software in this package is published under the terms of the BSD * style license a copy of which has been included with this distribution in * the LICENSE.txt file. */ package org.mule.samples.loanbroker; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mule.samples.loanbroker.service.LoanBroker; /** * <code>LoanBroker</code> is the Service that starts the loan * request process. The broker also receives the final quote. * * @author <a href="mailto:ross.mason@symphonysoft.com">Ross Mason</a> * @version $Revision$ */ public class AsyncLoanBroker implements LoanBroker { /** * logger used by this class */ protected static transient Log logger = LogFactory.getLog(AsyncLoanBroker.class); private static volatile int quotes = 0; private static volatile int requests = 0; private static long start = 0; public BankQuoteRequest getLoanQuote(LoanRequest request) { logger.info("\nClient " + request.getCustomer().getName() + " with ssn= " + request.getCustomer().getSsn() + " requests a loan of amount= " + request.getLoanAmount() + " for " + request.getLoanDuration() + " months"); BankQuoteRequest bqr = new BankQuoteRequest(); bqr.setLoanRequest(request); //System.out.println("ORequest: " + incRequests()); return bqr ; } public Object receiveQuote(LoanQuote quote) { logger.info("\nLoan Broker Quote received: " + quote); System.out.println("Quote " + incQuotes() + " received: " + quote); //System.out.println("OQuote: " + incQuotes()); return null; } public synchronized int incQuotes() { // if(quotes % 100 == 0) { // System.out.println("%% Received " + quotes + " quotes in: " + (System.currentTimeMillis() - start)); // } return ++quotes; } public synchronized int incRequests() { if(requests==0) start = System.currentTimeMillis(); // if(requests % 100 == 0) { // System.out.println("## Sent " + requests + " messages in: " + (System.currentTimeMillis() - start)); // } return ++requests; } }
[ "(no author)@bf997673-6b11-0410-b953-e057580c5b09" ]
(no author)@bf997673-6b11-0410-b953-e057580c5b09
13e5533b42c1fd5b7b8338bcd07ba4162a9853f9
f5b1b1fd906429545471ff597c2d7b32ffe8e9ec
/GPISetp/base/com/base/interceptor/page/SQLHelper.java
ca1464eb261513497574700ff5fcc08846d3ac46
[]
no_license
qiupengwei0828/code
71fe936136727be1c312ca720dff1acab7596217
91ace50d775c8d79c425363e0473a3d93f98d422
refs/heads/master
2021-05-14T01:35:44.801805
2018-01-27T02:57:41
2018-01-27T02:58:02
116,566,974
2
0
null
null
null
null
UTF-8
Java
false
false
7,021
java
/** * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved. */ package com.base.interceptor.page; import org.apache.ibatis.executor.ErrorContext; import org.apache.ibatis.executor.ExecutorException; import org.apache.ibatis.logging.Log; import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.ParameterMapping; import org.apache.ibatis.mapping.ParameterMode; import org.apache.ibatis.reflection.MetaObject; import org.apache.ibatis.reflection.property.PropertyTokenizer; import org.apache.ibatis.scripting.xmltags.ForEachSqlNode; import org.apache.ibatis.session.Configuration; import org.apache.ibatis.type.TypeHandler; import org.apache.ibatis.type.TypeHandlerRegistry; import com.base.dialect.Dialect; import com.base.page.Page; import com.base.utils.Reflections; import com.base.utils.comm.Global; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * SQL工具类 * * @author poplar.yfyang / thinkgem * @version 2013-8-28 */ public class SQLHelper { /** * 对SQL参数(?)设值,参考org.apache.ibatis.executor.parameter. * DefaultParameterHandler * * @param ps * 表示预编译的 SQL 语句的对象。 * @param mappedStatement * MappedStatement * @param boundSql * SQL * @param parameterObject * 参数对象 * @throws java.sql.SQLException * 数据库异常 */ @SuppressWarnings("unchecked") public static void setParameters(PreparedStatement ps, MappedStatement mappedStatement, BoundSql boundSql, Object parameterObject) throws SQLException { ErrorContext.instance().activity("setting parameters").object(mappedStatement.getParameterMap().getId()); List<ParameterMapping> parameterMappings = boundSql.getParameterMappings(); if (parameterMappings != null) { Configuration configuration = mappedStatement.getConfiguration(); TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry(); MetaObject metaObject = parameterObject == null ? null : configuration.newMetaObject(parameterObject); for (int i = 0; i < parameterMappings.size(); i++) { ParameterMapping parameterMapping = parameterMappings.get(i); if (parameterMapping.getMode() != ParameterMode.OUT) { Object value; String propertyName = parameterMapping.getProperty(); PropertyTokenizer prop = new PropertyTokenizer(propertyName); if (parameterObject == null) { value = null; } else if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) { value = parameterObject; } else if (boundSql.hasAdditionalParameter(propertyName)) { value = boundSql.getAdditionalParameter(propertyName); } else if (propertyName.startsWith(ForEachSqlNode.ITEM_PREFIX) && boundSql.hasAdditionalParameter(prop.getName())) { value = boundSql.getAdditionalParameter(prop.getName()); if (value != null) { value = configuration.newMetaObject(value).getValue(propertyName.substring(prop.getName().length())); } } else { value = metaObject == null ? null : metaObject.getValue(propertyName); } @SuppressWarnings("rawtypes") TypeHandler typeHandler = parameterMapping.getTypeHandler(); if (typeHandler == null) { throw new ExecutorException("There was no TypeHandler found for parameter " + propertyName + " of statement " + mappedStatement.getId()); } typeHandler.setParameter(ps, i + 1, value, parameterMapping.getJdbcType()); } } } } /** * 查询总纪录数 * * @param sql * SQL语句 * @param connection * 数据库连接 * @param mappedStatement * mapped * @param parameterObject * 参数 * @param boundSql * boundSql * @return 总记录数 * @throws SQLException * sql查询错误 */ public static int getCount(final String sql, final Connection connection, final MappedStatement mappedStatement, final Object parameterObject, final BoundSql boundSql, Log log) throws SQLException { String dbName = Global.getConfig("jdbc.type"); final String countSql; if ("oracle".equals(dbName)) { countSql = "select count(1) from (" + sql + ") tmp_count"; } else { countSql = "select count(1) from (" + removeOrders(sql) + ") tmp_count"; // countSql = "select count(1) " + removeSelect(removeOrders(sql)); } Connection conn = connection; PreparedStatement ps = null; ResultSet rs = null; try { if (log.isDebugEnabled()) { log.debug("COUNT SQL: " + org.apache.commons.lang3.StringUtils.replaceEach(countSql, new String[] { "\n", "\t" }, new String[] { " ", " " })); } if (conn == null) { conn = mappedStatement.getConfiguration().getEnvironment().getDataSource().getConnection(); } ps = conn.prepareStatement(countSql); BoundSql countBS = new BoundSql(mappedStatement.getConfiguration(), countSql, boundSql.getParameterMappings(), parameterObject); // 解决MyBatis 分页foreach 参数失效 start if (Reflections.getFieldValue(boundSql, "metaParameters") != null) { MetaObject mo = (MetaObject) Reflections.getFieldValue(boundSql, "metaParameters"); Reflections.setFieldValue(countBS, "metaParameters", mo); } // 解决MyBatis 分页foreach 参数失效 end SQLHelper.setParameters(ps, mappedStatement, countBS, parameterObject); rs = ps.executeQuery(); int count = 0; if (rs.next()) { count = rs.getInt(1); } return count; } finally { if (rs != null) { rs.close(); } if (ps != null) { ps.close(); } if (conn != null) { conn.close(); } } } /** * 根据数据库方言,生成特定的分页sql * * @param sql * Mapper中的Sql语句 * @param page * 分页对象 * @param dialect * 方言类型 * @return 分页SQL */ public static String generatePageSql(String sql, Page<Object> page, Dialect dialect) { if (dialect.supportsLimit()) { return dialect.getLimitString(sql, page.getFirstResult(), page.getMaxResults()); } else { return sql; } } /** * 去除qlString的select子句。 * * @param hql * @return */ @SuppressWarnings("unused") private static String removeSelect(String qlString) { int beginPos = qlString.toLowerCase().indexOf("from"); return qlString.substring(beginPos); } /** * 去除hql的orderBy子句。 * * @param hql * @return */ private static String removeOrders(String qlString) { Pattern p = Pattern.compile("order\\s*by[\\w|\\W|\\s|\\S]*", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher(qlString); StringBuffer sb = new StringBuffer(); while (m.find()) { m.appendReplacement(sb, ""); } m.appendTail(sb); return sb.toString(); } }
[ "1940519031@qq.com" ]
1940519031@qq.com
e825c53656907b03d92d624b73653f50beff2098
2e53b1e78ceb2014acb99dfbdd4e5af671da7971
/app/src/main/java/com/meiku/dev/utils/DropDownAnim.java
5b05668605b5df6c349a4eda045fe7d225528358
[]
no_license
hs5240leihuang/MrrckApplication
7960cb2278a1a8098c5bc908b3c5d7b241869c5d
aef126d4876e3e45b0984c1b829c38aa326ba598
refs/heads/master
2021-01-12T02:47:13.236711
2017-01-05T11:13:11
2017-01-05T11:14:05
78,102,342
0
0
null
null
null
null
UTF-8
Java
false
false
1,431
java
package com.meiku.dev.utils; import android.view.View; import android.view.animation.Animation; import android.view.animation.Transformation; public class DropDownAnim extends Animation { /** 目标的高度 */ private int targetHeight; /** 目标view */ private View view; /** 是否向下展开 */ private boolean down; /** * 构造方法 * * @param targetview * 需要被展现的view * @param vieweight * 目的高 * @param isdown * true:向下展开,false:收起 */ public DropDownAnim(View targetview, int vieweight, boolean isdown) { this.view = targetview; this.targetHeight = vieweight; this.down = isdown; } // down的时候,interpolatedTime从0增长到1,这样newHeight也从0增长到targetHeight @Override protected void applyTransformation(float interpolatedTime, Transformation t) { int newHeight; if (down) { newHeight = (int) (targetHeight * interpolatedTime); } else { newHeight = (int) (targetHeight * (1 - interpolatedTime)); } view.getLayoutParams().height = newHeight; view.requestLayout(); if (view.getVisibility() == View.GONE) { view.setVisibility(View.VISIBLE); } } @Override public void initialize(int width, int height, int parentWidth, int parentHeight) { super.initialize(width, height, parentWidth, parentHeight); } @Override public boolean willChangeBounds() { return true; } }
[ "837851174@qq.com" ]
837851174@qq.com
2b8a38368bd7b1955bc905cdf2e65b594fa2c79a
ab7619cb640580c931b087d85f7f26fa176702e2
/h2/src/main/org/h2/command/ddl/PrepareProcedure.java
8f9d44f996182a080450171c1c0eba3c80c6ab25
[]
no_license
pkouki/icdm2017
440da58c66f56a36e98853ff34b14e2c066ed0f7
e05618c285c43416d7615bf41c812b6dede596bc
refs/heads/master
2021-01-21T13:29:22.566573
2017-11-19T04:29:47
2017-11-19T04:29:47
102,126,018
4
0
null
null
null
null
UTF-8
Java
false
false
1,184
java
/* * Copyright 2004-2009 H2 Group. Multiple-Licensed under the H2 License, * Version 1.0, and under the Eclipse Public License, Version 1.0 * (http://h2database.com/html/license.html). * Initial Developer: H2 Group */ package org.h2.command.ddl; import java.sql.SQLException; import org.h2.command.Prepared; import org.h2.engine.Procedure; import org.h2.engine.Session; /** * This class represents the statement * PREPARE */ public class PrepareProcedure extends DefineCommand { private String procedureName; private Prepared prepared; public PrepareProcedure(Session session) { super(session); } public void checkParameters() { // no not check parameters } public int update() throws SQLException { Procedure proc = new Procedure(procedureName, prepared); prepared.setParameterList(parameters); prepared.setPrepareAlways(prepareAlways); prepared.prepare(); session.addProcedure(proc); return 0; } public void setProcedureName(String name) { this.procedureName = name; } public void setPrepared(Prepared prep) { this.prepared = prep; } }
[ "pkouki@umiacs.umd.edu" ]
pkouki@umiacs.umd.edu
9651f9b34878e00baa938adfd7aa33e366b71fd1
9c0d7e84e99bea9d8e0db5ebc40b3de153198fa1
/DataProcessingDSLPart1/ASEProject-Metamodel.diagram/src/pipelineproject/diagram/edit/policies/CustomCleaningCustomCleaningCustomParamsCompartmentCanonicalEditPolicy.java
acf09e62e52b666eeb624ce9fc8ffb133cb87fc7
[]
no_license
FrancescoPinto/DataProcessingDSL
ea36221638d15c69948abe3386bc73a7ae899e3f
eff66e28aa1e575f0817332c6281506582704d20
refs/heads/master
2022-04-24T09:59:55.097385
2020-04-20T18:57:30
2020-04-20T18:57:30
257,376,186
0
0
null
null
null
null
UTF-8
Java
false
false
7,047
java
/* * */ package pipelineproject.diagram.edit.policies; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.gef.EditPart; import org.eclipse.gef.commands.Command; import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil; import org.eclipse.gmf.runtime.diagram.ui.commands.DeferredLayoutCommand; import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy; import org.eclipse.gmf.runtime.diagram.ui.commands.SetViewMutabilityCommand; import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy; import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest; import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter; import org.eclipse.gmf.runtime.notation.Node; import org.eclipse.gmf.runtime.notation.View; import pipelineproject.PipelineprojectPackage; import pipelineproject.diagram.edit.parts.CustomParamEditPart; import pipelineproject.diagram.part.PipelineprojectDiagramUpdater; import pipelineproject.diagram.part.PipelineprojectNodeDescriptor; import pipelineproject.diagram.part.PipelineprojectVisualIDRegistry; /** * @generated */ public class CustomCleaningCustomCleaningCustomParamsCompartmentCanonicalEditPolicy extends CanonicalEditPolicy { /** * @generated */ protected void refreshOnActivate() { // Need to activate editpart children before invoking the canonical refresh for EditParts to add event listeners List<?> c = getHost().getChildren(); for (int i = 0; i < c.size(); i++) { ((EditPart) c.get(i)).activate(); } super.refreshOnActivate(); } /** * @generated */ protected EStructuralFeature getFeatureToSynchronize() { return PipelineprojectPackage.eINSTANCE.getCustomCleaning_CustomParams(); } /** * @generated */ @SuppressWarnings("rawtypes") protected List getSemanticChildrenList() { View viewObject = (View) getHost().getModel(); LinkedList<EObject> result = new LinkedList<EObject>(); List<PipelineprojectNodeDescriptor> childDescriptors = PipelineprojectDiagramUpdater .getCustomCleaningCustomCleaningCustomParamsCompartment_7094SemanticChildren(viewObject); for (PipelineprojectNodeDescriptor d : childDescriptors) { result.add(d.getModelElement()); } return result; } /** * @generated */ protected boolean isOrphaned(Collection<EObject> semanticChildren, final View view) { return isMyDiagramElement(view) && !semanticChildren.contains(view.getElement()); } /** * @generated */ private boolean isMyDiagramElement(View view) { return CustomParamEditPart.VISUAL_ID == PipelineprojectVisualIDRegistry.getVisualID(view); } /** * @generated */ protected void refreshSemantic() { if (resolveSemanticElement() == null) { return; } LinkedList<IAdaptable> createdViews = new LinkedList<IAdaptable>(); List<PipelineprojectNodeDescriptor> childDescriptors = PipelineprojectDiagramUpdater .getCustomCleaningCustomCleaningCustomParamsCompartment_7094SemanticChildren( (View) getHost().getModel()); LinkedList<View> orphaned = new LinkedList<View>(); // we care to check only views we recognize as ours LinkedList<View> knownViewChildren = new LinkedList<View>(); for (View v : getViewChildren()) { if (isMyDiagramElement(v)) { knownViewChildren.add(v); } } // alternative to #cleanCanonicalSemanticChildren(getViewChildren(), semanticChildren) // // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren() for (Iterator<PipelineprojectNodeDescriptor> descriptorsIterator = childDescriptors .iterator(); descriptorsIterator.hasNext();) { PipelineprojectNodeDescriptor next = descriptorsIterator.next(); String hint = PipelineprojectVisualIDRegistry.getType(next.getVisualID()); LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor for (View childView : getViewChildren()) { EObject semanticElement = childView.getElement(); if (next.getModelElement().equals(semanticElement)) { if (hint.equals(childView.getType())) { perfectMatch.add(childView); // actually, can stop iteration over view children here, but // may want to use not the first view but last one as a 'real' match (the way original CEP does // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren } } } if (perfectMatch.size() > 0) { descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor // use only one view (first or last?), keep rest as orphaned for further consideration knownViewChildren.remove(perfectMatch.getFirst()); } } // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to, // or those we have potential matches to, and thus need to be recreated, preserving size/location information. orphaned.addAll(knownViewChildren); // ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>( childDescriptors.size()); for (PipelineprojectNodeDescriptor next : childDescriptors) { String hint = PipelineprojectVisualIDRegistry.getType(next.getVisualID()); IAdaptable elementAdapter = new CanonicalElementAdapter(next.getModelElement(), hint); CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(elementAdapter, Node.class, hint, ViewUtil.APPEND, false, host().getDiagramPreferencesHint()); viewDescriptors.add(descriptor); } boolean changed = deleteViews(orphaned.iterator()); // CreateViewRequest request = getCreateViewRequest(viewDescriptors); Command cmd = getCreateViewCommand(request); if (cmd != null && cmd.canExecute()) { SetViewMutabilityCommand.makeMutable(new EObjectAdapter(host().getNotationView())).execute(); executeCommand(cmd); @SuppressWarnings("unchecked") List<IAdaptable> nl = (List<IAdaptable>) request.getNewObject(); createdViews.addAll(nl); } if (changed || createdViews.size() > 0) { postProcessRefreshSemantic(createdViews); } if (createdViews.size() > 1) { // perform a layout of the container DeferredLayoutCommand layoutCmd = new DeferredLayoutCommand(host().getEditingDomain(), createdViews, host()); executeCommand(new ICommandProxy(layoutCmd)); } makeViewsImmutable(createdViews); } }
[ "francesco1.pinto@mail.polimi.it" ]
francesco1.pinto@mail.polimi.it
365d7e08c4a2c2b753f1e84397380788ea3acebf
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/35/35_746afe8c5add85631441c0811570482fc48769c1/RealWorldTest/35_746afe8c5add85631441c0811570482fc48769c1_RealWorldTest_s.java
6ec3a0e5842d078d5192b28b7c9f233a23b59979
[]
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
1,015
java
package de.fuberlin.projecta; import static org.junit.Assert.assertEquals; import org.junit.Test; public class RealWorldTest { @Test public void fib() { String source = "def int main(){int x; x = fib(4); print x; return 1; }\n" + "def int fib(int x){" + "if(x == 0) return 0;"+ "if(x == 1) return 1;"+ "return fib(x-2) + fib(x-1);"+ "}\n"; String output = CompilerTest.executeCode(source); assertEquals(output, "3"); } @Test public void addTwoFunctions(){ String source = ""+ "def int foo(int x){"+ "return x;"+ "}"+ "def int main() {int x; x = foo(1) + foo(2); print x; return 1;}"; String output = CompilerTest.executeCode(source); assertEquals(output, "3"); } @Test public void compareTwoFunctions(){ String source = ""+ "def int foo(int x){"+ "return x;"+ "}"+ "def int main() {bool x; x = foo(1) <= foo(2); print x; return 1;}"; String output = CompilerTest.executeCode(source); assertEquals(output, "0"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b831d45bf4d4681a2997689c09b243a0d53541e3
acef3734b40f00c3db23455883d2610dfbb41f7e
/spring-webflux/src/main/java/org/springframework/web/reactive/support/AbstractServletHttpHandlerAdapterInitializer.java
f2c8bb4aa2eef869afb2d9a727a221ae4cb2338a
[ "Apache-2.0" ]
permissive
soaryang/spring
50ff0e1b138307aee999c183938150e32aa87a83
dba1b0d3498c07f9bad6a1e856120c4f009c4edc
refs/heads/master
2023-01-07T18:42:41.622736
2020-10-14T17:07:40
2020-10-14T17:07:40
295,474,567
1
0
null
null
null
null
UTF-8
Java
false
false
4,696
java
/* * Copyright 2002-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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.reactive.support; import org.springframework.http.server.reactive.HttpHandler; import org.springframework.http.server.reactive.ServletHttpHandlerAdapter; import org.springframework.util.Assert; import org.springframework.web.WebApplicationInitializer; import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.ServletRegistration; /** * Base class for {@link org.springframework.web.WebApplicationInitializer} * implementations that register a {@link ServletHttpHandlerAdapter} in the * servlet context. * * @author Arjen Poutsma * @since 5.0 * @deprecated in favor of * {@link org.springframework.web.server.adapter.AbstractReactiveWebInitializer * AbstractReactiveWebInitializer} */ @Deprecated public abstract class AbstractServletHttpHandlerAdapterInitializer implements WebApplicationInitializer { /** * The default servlet name. Can be customized by overriding {@link #getServletName}. */ public static final String DEFAULT_SERVLET_NAME = "http-handler-adapter"; @Override public void onStartup(ServletContext servletContext) throws ServletException { registerHandlerAdapter(servletContext); } /** * Register a {@link ServletHttpHandlerAdapter} against the given servlet context. * <p>This method will create a {@code HttpHandler} using {@link #createHttpHandler()}, * and use it to create a {@code ServletHttpHandlerAdapter} with the name returned * by {@link #getServletName()}, and mapping it to the patterns returned from * {@link #getServletMappings()}. * <p>Further customization can be achieved by overriding * {@link #customizeRegistration(ServletRegistration.Dynamic)} or * {@link #createServlet(HttpHandler)}. * * @param servletContext the context to register the servlet with */ protected void registerHandlerAdapter(ServletContext servletContext) { String servletName = getServletName(); Assert.hasLength(servletName, "getServletName() must not return null or empty"); HttpHandler httpHandler = createHttpHandler(); Assert.notNull(httpHandler, "createHttpHandler() must not return null"); ServletHttpHandlerAdapter servlet = createServlet(httpHandler); Assert.notNull(servlet, "createServlet(HttpHandler) must not return null"); ServletRegistration.Dynamic registration = servletContext.addServlet(servletName, servlet); if (registration == null) { throw new IllegalStateException("Failed to register servlet with name '" + servletName + "'. " + "Check if there is another servlet registered under the same name."); } registration.setLoadOnStartup(1); registration.addMapping(getServletMappings()); registration.setAsyncSupported(true); customizeRegistration(registration); } /** * Return the name under which the {@link ServletHttpHandlerAdapter} will be registered. * Defaults to {@link #DEFAULT_SERVLET_NAME}. * * @see #registerHandlerAdapter(ServletContext) */ protected String getServletName() { return DEFAULT_SERVLET_NAME; } /** * Create the {@link HttpHandler}. */ protected abstract HttpHandler createHttpHandler(); /** * Create a {@link ServletHttpHandlerAdapter} with the specified . * <p>The default implementation returns a {@code ServletHttpHandlerAdapter} * with the provided {@code httpHandler}. */ protected ServletHttpHandlerAdapter createServlet(HttpHandler httpHandler) { return new ServletHttpHandlerAdapter(httpHandler); } /** * Specify the servlet mapping(s) for the {@code ServletHttpHandlerAdapter}: * for example {@code "/"}, {@code "/app"}, etc. * * @see #registerHandlerAdapter(ServletContext) */ protected abstract String[] getServletMappings(); /** * Optionally perform further registration customization once * {@link #registerHandlerAdapter(ServletContext)} has completed. * * @param registration the {@code DispatcherServlet} registration to be customized * @see #registerHandlerAdapter(ServletContext) */ protected void customizeRegistration(ServletRegistration.Dynamic registration) { } }
[ "asdasd" ]
asdasd
7c1049e1224c700ea1b4e891f340e3101a78bdf8
3d801e23c9a1dadcd2c0a9ecd2868b2bc02b3b15
/ct-project/ct-consumer/src/main/java/com/fuyi/ct/producer/PropertiesUtil.java
70cd20674d13a3bb2d07e2ee5abfe22a93118830
[]
no_license
unknow16/hadoop-demo
d1abd093b36e722770828794a5be657cfb7b2b41
74ce7d65eea8b751bba101c1e3e187901c42432e
refs/heads/master
2020-04-28T00:03:37.121184
2019-04-21T15:23:31
2019-04-21T15:23:31
174,801,844
0
0
null
null
null
null
UTF-8
Java
false
false
625
java
package com.fuyi.ct.producer; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class PropertiesUtil { public static Properties properties = null; static { try { // 加载配置属性 InputStream inputStream = ClassLoader.getSystemResourceAsStream("kafka.properties"); properties = new Properties(); properties.load(inputStream); } catch (IOException e) { e.printStackTrace(); } } public static String getProperty(String key) { return properties.getProperty(key); } }
[ "1406751952@qq.com" ]
1406751952@qq.com
25860657c2ce4aaf268ee7874b84a0fc48207f83
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module1551_public/tests/unittests/src/java/module1551_public_tests_unittests/a/Foo2.java
baf9ed81f268a360273ef52f5fcb85b8f1f8178b
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
1,715
java
package module1551_public_tests_unittests.a; import java.util.logging.*; import java.util.zip.*; import javax.annotation.processing.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see javax.net.ssl.ExtendedSSLSession * @see javax.rmi.ssl.SslRMIClientSocketFactory * @see java.awt.datatransfer.DataFlavor */ @SuppressWarnings("all") public abstract class Foo2<S> extends module1551_public_tests_unittests.a.Foo0<S> implements module1551_public_tests_unittests.a.IFoo2<S> { java.beans.beancontext.BeanContext f0 = null; java.io.File f1 = null; java.rmi.Remote f2 = null; public S element; public static Foo2 instance; public static Foo2 getInstance() { return instance; } public static <T> T create(java.util.List<T> input) { return module1551_public_tests_unittests.a.Foo0.create(input); } public String getName() { return module1551_public_tests_unittests.a.Foo0.getInstance().getName(); } public void setName(String string) { module1551_public_tests_unittests.a.Foo0.getInstance().setName(getName()); return; } public S get() { return (S)module1551_public_tests_unittests.a.Foo0.getInstance().get(); } public void set(Object element) { this.element = (S)element; module1551_public_tests_unittests.a.Foo0.getInstance().set(this.element); } public S call() throws Exception { return (S)module1551_public_tests_unittests.a.Foo0.getInstance().call(); } }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
ebda7ebf6b54ea4340fdf6466db325627cec525c
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project58/src/main/java/org/gradle/test/performance58_3/Production58_213.java
84158f3b21fa0a46416a6cbc323f9e90d6973224
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
305
java
package org.gradle.test.performance58_3; public class Production58_213 extends org.gradle.test.performance15_3.Production15_213 { private final String property; public Production58_213() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
3b0a2a1c0a4526986283fe55c5a7b556c68c8a1a
e49ddf6e23535806c59ea175b2f7aa4f1fb7b585
/tags/release-4.4.0/mipav/src/gov/nih/mipav/model/algorithms/levelset/LseCurvatureFlow2.java
494c459b098c50ec5e75a1ef4eecb0bd5bd86e57
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
svn2github/mipav
ebf07acb6096dff8c7eb4714cdfb7ba1dcace76f
eb76cf7dc633d10f92a62a595e4ba12a5023d922
refs/heads/master
2023-09-03T12:21:28.568695
2019-01-18T23:13:53
2019-01-18T23:13:53
130,295,718
1
0
null
null
null
null
UTF-8
Java
false
false
3,165
java
package gov.nih.mipav.model.algorithms.levelset; /** * <p>This class implements the <i>curvature flow filter</i> for 2D images * using a finite-difference-based solver for the partial differential * equation: * <br><br> &nbsp; &nbsp; * du/dt = |grad(u)|*divergence(grad(u)/|grad(u)|) * <br><br> * where u(x,y,t) is the evolved image at time t, du/dt is the time * derivative of u, and grad(u) is the gradient of u with respect to the * spatial variables. The notation divergence(Q) = Q0_x + Q1_y, the sum of * first-order derivatives of the vector-valued function Q = (Q0,Q1).</p> * * <p>The right-hand side of the PDE is the product of the gradient magnitude * with the curvature of the level curves.</p> * * @version 0.1 November 7, 2006 * @author David Eberly */ public class LseCurvatureFlow2 extends LsePdeFilter2 { //~ Constructors --------------------------------------------------------- /** * Creates a new LseCurvatureFlow2 object. * * @param iXBound The x-bound of the image. * @param iYBound The y-bound of the image. * @param fXSpacing The x-spacing of the image. * @param fYSpacing The y-spacing of the image. * @param afData The image elements, stored in lexicographical order. * @param abMask The image mask, stored in lexicographical order. A * pixel value is processed by the PDE solver only when the mask value * is false. * @param fBorderValue Specifies how to handle the image value. When set * to Float.MAX_VALUE, Neumann conditions are in use, in which case * zero-valued derivatives are assumed on the image border. Otherwise, * Dirichlet conditions are used, in which case the image is assumed * to be constant on the border with value specified by fBorderValue. * @param eScaleType The type of scaling to apply to the input image. * The choices are NONE, UNIT, SYMMETRIC, or PRESERVE_ZERO. */ public LseCurvatureFlow2 (int iXBound, int iYBound, float fXSpacing, float fYSpacing, float[] afData, boolean[] abMask, float fBorderValue, int eScaleType) { super(iXBound,iYBound,fXSpacing,fYSpacing,afData,abMask,fBorderValue, eScaleType); } //~ Methods -------------------------------------------------------------- /** * The per-pixel update function of the PDE solver. * * @param iX The x-value of the pixel to be updated. * @param iY The y-value of the pixel to be updated. */ protected void onUpdate (int iX, int iY) { lookUp9(iX,iY); float fUx = m_fHalfInvDx*(m_fUpz - m_fUmz); float fUy = m_fHalfInvDy*(m_fUzp - m_fUzm); float fUxx = m_fInvDxDx*(m_fUpz - 2.0f*m_fUzz + m_fUmz); float fUxy = m_fFourthInvDxDy*(m_fUmm + m_fUpp - m_fUmp - m_fUpm); float fUyy = m_fInvDyDy*(m_fUzp - 2.0f*m_fUzz + m_fUzm); float fSqrUx = fUx*fUx; float fSqrUy = fUy*fUy; float fSqrLength = fSqrUx + fSqrUy + 1e-08f; // prevent zero division m_aafDst[iY][iX] = m_fUzz + m_fTimeStep*(fUxx*fSqrUy + fUyy*fSqrUx - 0.5f*fUxy*fUx*fUy)/fSqrLength; } }
[ "NIH\\mccreedy@ba61647d-9d00-f842-95cd-605cb4296b96" ]
NIH\mccreedy@ba61647d-9d00-f842-95cd-605cb4296b96
048d6e915bbc8fa9761301d3fb8e53d6c2baffe0
4ad54a56ea1d1da711c1423c254b2b40b5619c9f
/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/admin/system/AdminLanguageView.java
04ad89c50a69e065dc5ceab0097114f773c01f9f
[ "Apache-2.0" ]
permissive
mushfiqur47/cia
1cc52cf2eb2bb96be7bd26822b5c3832fbc16905
3ddc99ffa278df6b479bf2df9cc59d7d6194cef8
refs/heads/master
2022-10-23T06:28:17.475685
2020-06-20T12:48:33
2020-06-20T12:48:33
273,761,227
1
0
Apache-2.0
2020-06-20T18:15:15
2020-06-20T18:15:14
null
UTF-8
Java
false
false
1,883
java
/* * Copyright 2010-2020 James Pether Sörling * * 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. * * $Id$ * $HeadURL$ */ package com.hack23.cia.web.impl.ui.application.views.admin.system; import org.springframework.beans.factory.config.ConfigurableBeanFactory; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import com.hack23.cia.web.impl.ui.application.views.admin.common.AbstractAdminView; import com.hack23.cia.web.impl.ui.application.views.common.pagemode.PageModeContentFactory; import com.hack23.cia.web.impl.ui.application.views.common.viewnames.AdminViews; import com.vaadin.spring.annotation.SpringView; /** * The Class AdminDataSummaryView. */ @Service @Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) @SpringView(name = AdminLanguageView.NAME) public final class AdminLanguageView extends AbstractAdminView { /** The Constant NAME. */ public static final String NAME = AdminViews.ADMIN_LANGUAGE_VIEW_NAME; /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** * Instantiates a new admin language view. * * @param context * the context */ public AdminLanguageView(final ApplicationContext context) { super(context.getBeansOfType(PageModeContentFactory.class), NAME); } }
[ "pether.sorling@gmail.com" ]
pether.sorling@gmail.com
b3ab232d6e3ec274b9cd75c9ad2927dceaa382e3
2f219b5a60919cb2ed92dfe4e147ad7dd40e42f9
/S03_MVVM/src/Ex4_6/model/ModelFactory.java
5c4c0b9129268e63a2a5f705743714a4d6581eac
[]
no_license
KhaledHammoun/Second-semester
6a440027ff3cc4078b74f04c5878a9c7b74e8c61
d8d9628fa2de3d68933cfb5a12e83ba9fee5e551
refs/heads/main
2023-04-18T17:55:12.470383
2021-05-04T12:41:05
2021-05-04T12:41:05
337,375,515
0
0
null
null
null
null
UTF-8
Java
false
false
249
java
package Ex4_6.model; public class ModelFactory { private DataModel dataModel; public DataModel getDataModel() { if(dataModel == null) { dataModel = new DataModelManager(); } return dataModel; } }
[ "kh.hammoun@gmail.com" ]
kh.hammoun@gmail.com
54b2fed5d248ca38802c92e9bfdc545778864d9a
3349391c82effb6744c3d08d873d0fc7da7cd29c
/src/main/java/eu/hansolo/fx/charts/HorizonChartTest.java
18d82b1527033d5851ffe98f081ad34a700c32ef
[ "Apache-2.0" ]
permissive
corakm/charts
7a09f6c3410912b9853914e290eb1c73a5babf82
7a541f7f9e0e672b18edc022938af01046398971
refs/heads/master
2021-08-11T12:23:13.240257
2017-11-13T17:25:56
2017-11-13T17:25:56
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,033
java
package eu.hansolo.fx.charts; import eu.hansolo.fx.charts.data.XYData; import eu.hansolo.fx.charts.data.XYDataObject; import eu.hansolo.fx.charts.series.XYSeries; import javafx.application.Application; import javafx.stage.Stage; import javafx.scene.layout.StackPane; import javafx.scene.Scene; import java.util.ArrayList; import java.util.List; import java.util.Random; /** * User: hansolo * Date: 13.11.17 * Time: 09:27 */ public class HorizonChartTest extends Application { private static final Random RND = new Random(); private static final int NO_OF_X_VALUES = 1500; private XYSeries<XYDataObject> xySeries; private XYPane xyPane; @Override public void init() { int bands = 4; int noOfValues = 1500; List<XYDataObject> xyData = new ArrayList<>(noOfValues); for (int i = 0 ; i < noOfValues; i++) { double value = Math.abs(Math.cos(i/100.0) + (RND.nextDouble() - 0.5) / 10.0); // Only positive data xyData.add(new XYDataObject(i, value, "P" + i)); } double minY = xyData.stream().mapToDouble(XYData::getY).min().getAsDouble(); double maxY = xyData.stream().mapToDouble(XYData::getY).max().getAsDouble(); xySeries = new XYSeries<>(xyData, ChartType.HORIZON); xyPane = new XYPane(bands, xySeries); xyPane.setPrefSize(400, 30); xyPane.setLowerBoundX(0); xyPane.setUpperBoundX(NO_OF_X_VALUES); xyPane.setLowerBoundY(minY); xyPane.setUpperBoundY(maxY); } @Override public void start(Stage stage) { StackPane pane = new StackPane(xyPane); Scene scene = new Scene(pane); stage.setTitle("Horizon Chart"); stage.setScene(scene); stage.show(); } @Override public void stop() { System.exit(0); } public static void main(String[] args) { launch(args); } }
[ "han.solo@mac.com" ]
han.solo@mac.com
6c1f818cc20b166dbdef61ca92cbcc3d3264c5a2
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/25/25_1310f0c9127e59e26705aac63f05298d80d461c8/ClusterTest/25_1310f0c9127e59e26705aac63f05298d80d461c8_ClusterTest_t.java
bb02beb5043df382a59fe50912f80835bf299643
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,557
java
/* * 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.inmobi.databus; import java.io.File; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Random; import java.util.Set; import org.apache.log4j.Logger; import org.testng.annotations.Test; @Test public class ClusterTest { private static Logger LOG = Logger.getLogger(ClusterTest.class); public void getLocalDestDir() { try { Cluster cluster = buildCluster(); LOG.debug("getLocalDestDir ::"); String expectedPath = "hdfs://localhost:8020/databus/streams_local" + "/testCategory/1970/02/07/18/18/"; Calendar calendar = new GregorianCalendar(1970, 1, 7, 18, 18); // month // starts // from 0 // :P String path = cluster.getLocalDestDir("testCategory", calendar.getTime()); LOG.debug("Expected Path [" + expectedPath + "]"); LOG.debug("Path [" + path + "]"); assert expectedPath.equals(path); } catch (Exception e) { e.printStackTrace(); assert false; } } public void getDateTimeDestDir() { LOG.debug("getDateTimeDestDir ::"); try { Cluster cluster = buildCluster(); String expectedPath = "testCategory/1970/09/05/16/43/"; Calendar calendar = new GregorianCalendar(1970, 8, 5, 16, 43); String path = cluster.getDateTimeDestDir("testCategory", calendar.getTimeInMillis()); LOG.debug("Path [" + path + "]"); LOG.debug("Expected Path [" + expectedPath + "]"); assert expectedPath.equals(path); } catch (Exception e) { e.printStackTrace(); assert false; } } public void getFinalDestDir() { LOG.debug("getFinalDestDir ::"); try { Cluster cluster = buildCluster(); String path = null; String expectedPath = "hdfs://localhost:8020/databus/streams/testCategory/1970/09/05/16/43/"; Calendar calendar = new GregorianCalendar(1970, 8, 5, 16, 43); path = cluster .getFinalDestDir("testCategory", calendar.getTimeInMillis()); LOG.debug("Path [" + path + "]"); LOG.debug("Expected Path [" + expectedPath + "]"); assert expectedPath.equals(path); } catch (Exception e) { e.printStackTrace(); assert false; } } public void getFinalDestDirTillHour() { LOG.debug("getFinalDestDirTillHour ::"); try { Cluster cluster = buildCluster(); String path = null; String expectedPath = "hdfs://localhost:8020/databus/streams/testCategory/1970/09/05/16/"; Calendar calendar = new GregorianCalendar(1970, 8, 5, 16, 0); path = cluster.getFinalDestDirTillHour("testCategory", calendar.getTimeInMillis()); LOG.debug("Path [" + path + "]"); LOG.debug("Expected Path [" + expectedPath + "]"); assert expectedPath.equals(path); } catch (Exception e) { e.printStackTrace(); assert false; } } public static Cluster buildCluster() throws Exception { Map<String, String> clusterElementsMap = new HashMap<String, String>(); clusterElementsMap.put("name", "testCluster"); clusterElementsMap.put("hdfsurl", "hdfs://localhost:8020"); clusterElementsMap.put("jturl", "http://localhost:8021"); clusterElementsMap.put("jobqueuename", "default"); return new Cluster(clusterElementsMap, "databus", null, null); } public static Cluster buildLocalCluster() throws Exception { return buildLocalCluster(null, null, null); } public static Cluster buildLocalCluster(String rootdir, String clusterName, String hdfsUrl, String jtUrl, Set<String> sourcestreams, Map<String, DestinationStream> consumestreams) throws Exception { if (jtUrl == null) jtUrl = "http://localhost:8021"; if (hdfsUrl == null) hdfsUrl = "file:///tmp/" + new Random().nextLong() + File.separator; if (clusterName == null) clusterName = "localCluster"; Map<String, String> clusterElementsMap = new HashMap<String, String>(); clusterElementsMap.put("name", clusterName); clusterElementsMap.put("hdfsurl", hdfsUrl); clusterElementsMap.put("jturl", jtUrl); clusterElementsMap.put("jobqueuename", "default"); return new Cluster(clusterElementsMap, rootdir, ((consumestreams == null) ? (new HashMap<String, DestinationStream>()) : consumestreams), ((sourcestreams == null) ? (new HashSet<String>()) : sourcestreams)); } public static Cluster buildLocalCluster(String clusterName, String hdfsUrl, String jtUrl) throws Exception { return buildLocalCluster("databus", clusterName, hdfsUrl, jtUrl, null, null); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
38e62102ee45ec40779b3e83b811c707bcadb560
a3c07385553254453e7a0d23e47e684d41057f8d
/src/main/java/org/cxml/invoicedetail/XadesCommitmentTypeQualifier.java
7d798bf66702bdcc81dc683d1245fc3b17e0a3b8
[]
no_license
Effie/cxml-api
1011d1a89c2bee2c9ecbd2bc2db7a58cf9fb6049
6dde4f1f80ac9821060eca113faf0cb369d83590
refs/heads/master
2020-12-25T12:41:21.334993
2016-01-23T10:26:26
2016-01-23T10:26:26
50,233,787
0
0
null
2016-01-23T10:23:00
2016-01-23T10:23:00
null
UTF-8
Java
false
false
1,293
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2013.08.06 at 12:54:05 AM EDT // package org.cxml.invoicedetail; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "value" }) @XmlRootElement(name = "xades:CommitmentTypeQualifier") public class XadesCommitmentTypeQualifier { @XmlValue protected String value; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getvalue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setvalue(String value) { this.value = value; } }
[ "bradsdavis@gmail.com" ]
bradsdavis@gmail.com
d3dab9e0787358344d77a6d24147e2a023ceed4b
097df92ce1bfc8a354680725c7d10f0d109b5b7d
/com/amazon/ws/emr/hadoop/fs/shaded/org/apache/commons/lang3/AnnotationUtils.java
1b3c8bc377e13ec6cb1d1fb991a1384f8df4d66c
[]
no_license
cozos/emrfs-hadoop
7a1a1221ffc3aa8c25b1067cf07d3b46e39ab47f
ba5dfa631029cb5baac2f2972d2fdaca18dac422
refs/heads/master
2022-10-14T15:03:51.500050
2022-10-06T05:38:49
2022-10-06T05:38:49
233,979,996
2
2
null
2022-10-06T05:41:46
2020-01-15T02:24:16
Java
UTF-8
Java
false
false
7,179
java
package com.amazon.ws.emr.hadoop.fs.shaded.org.apache.commons.lang3; import com.amazon.ws.emr.hadoop.fs.shaded.org.apache.commons.lang3.builder.ToStringBuilder; import com.amazon.ws.emr.hadoop.fs.shaded.org.apache.commons.lang3.builder.ToStringStyle; import java.lang.annotation.Annotation; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.Arrays; public class AnnotationUtils { private static final ToStringStyle TO_STRING_STYLE = new ToStringStyle() { private static final long serialVersionUID = 1L; protected String getShortClassName(Class<?> cls) { Class<? extends Annotation> annotationType = null; for (Class<?> iface : ClassUtils.getAllInterfaces(cls)) { if (Annotation.class.isAssignableFrom(iface)) { Class<? extends Annotation> found = iface; annotationType = found; break; } } return new StringBuilder(annotationType == null ? "" : annotationType.getName()).insert(0, '@').toString(); } protected void appendDetail(StringBuffer buffer, String fieldName, Object value) { if ((value instanceof Annotation)) { value = AnnotationUtils.toString((Annotation)value); } super.appendDetail(buffer, fieldName, value); } }; public static boolean equals(Annotation a1, Annotation a2) { if (a1 == a2) { return true; } if ((a1 == null) || (a2 == null)) { return false; } Class<? extends Annotation> type = a1.annotationType(); Class<? extends Annotation> type2 = a2.annotationType(); Validate.notNull(type, "Annotation %s with null annotationType()", new Object[] { a1 }); Validate.notNull(type2, "Annotation %s with null annotationType()", new Object[] { a2 }); if (!type.equals(type2)) { return false; } try { for (Method m : type.getDeclaredMethods()) { if ((m.getParameterTypes().length == 0) && (isValidAnnotationMemberType(m.getReturnType()))) { Object v1 = m.invoke(a1, new Object[0]); Object v2 = m.invoke(a2, new Object[0]); if (!memberEquals(m.getReturnType(), v1, v2)) { return false; } } } } catch (IllegalAccessException ex) { return false; } catch (InvocationTargetException ex) { return false; } return true; } public static int hashCode(Annotation a) { int result = 0; Class<? extends Annotation> type = a.annotationType(); for (Method m : type.getDeclaredMethods()) { try { Object value = m.invoke(a, new Object[0]); if (value == null) { throw new IllegalStateException(String.format("Annotation method %s returned null", new Object[] { m })); } result += hashMember(m.getName(), value); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); } } return result; } public static String toString(Annotation a) { ToStringBuilder builder = new ToStringBuilder(a, TO_STRING_STYLE); for (Method m : a.annotationType().getDeclaredMethods()) { if (m.getParameterTypes().length <= 0) { try { builder.append(m.getName(), m.invoke(a, new Object[0])); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); } } } return builder.build(); } public static boolean isValidAnnotationMemberType(Class<?> type) { if (type == null) { return false; } if (type.isArray()) { type = type.getComponentType(); } return (type.isPrimitive()) || (type.isEnum()) || (type.isAnnotation()) || (String.class.equals(type)) || (Class.class.equals(type)); } private static int hashMember(String name, Object value) { int part1 = name.hashCode() * 127; if (value.getClass().isArray()) { return part1 ^ arrayMemberHash(value.getClass().getComponentType(), value); } if ((value instanceof Annotation)) { return part1 ^ hashCode((Annotation)value); } return part1 ^ value.hashCode(); } private static boolean memberEquals(Class<?> type, Object o1, Object o2) { if (o1 == o2) { return true; } if ((o1 == null) || (o2 == null)) { return false; } if (type.isArray()) { return arrayMemberEquals(type.getComponentType(), o1, o2); } if (type.isAnnotation()) { return equals((Annotation)o1, (Annotation)o2); } return o1.equals(o2); } private static boolean arrayMemberEquals(Class<?> componentType, Object o1, Object o2) { if (componentType.isAnnotation()) { return annotationArrayMemberEquals((Annotation[])o1, (Annotation[])o2); } if (componentType.equals(Byte.TYPE)) { return Arrays.equals((byte[])o1, (byte[])o2); } if (componentType.equals(Short.TYPE)) { return Arrays.equals((short[])o1, (short[])o2); } if (componentType.equals(Integer.TYPE)) { return Arrays.equals((int[])o1, (int[])o2); } if (componentType.equals(Character.TYPE)) { return Arrays.equals((char[])o1, (char[])o2); } if (componentType.equals(Long.TYPE)) { return Arrays.equals((long[])o1, (long[])o2); } if (componentType.equals(Float.TYPE)) { return Arrays.equals((float[])o1, (float[])o2); } if (componentType.equals(Double.TYPE)) { return Arrays.equals((double[])o1, (double[])o2); } if (componentType.equals(Boolean.TYPE)) { return Arrays.equals((boolean[])o1, (boolean[])o2); } return Arrays.equals((Object[])o1, (Object[])o2); } private static boolean annotationArrayMemberEquals(Annotation[] a1, Annotation[] a2) { if (a1.length != a2.length) { return false; } for (int i = 0; i < a1.length; i++) { if (!equals(a1[i], a2[i])) { return false; } } return true; } private static int arrayMemberHash(Class<?> componentType, Object o) { if (componentType.equals(Byte.TYPE)) { return Arrays.hashCode((byte[])o); } if (componentType.equals(Short.TYPE)) { return Arrays.hashCode((short[])o); } if (componentType.equals(Integer.TYPE)) { return Arrays.hashCode((int[])o); } if (componentType.equals(Character.TYPE)) { return Arrays.hashCode((char[])o); } if (componentType.equals(Long.TYPE)) { return Arrays.hashCode((long[])o); } if (componentType.equals(Float.TYPE)) { return Arrays.hashCode((float[])o); } if (componentType.equals(Double.TYPE)) { return Arrays.hashCode((double[])o); } if (componentType.equals(Boolean.TYPE)) { return Arrays.hashCode((boolean[])o); } return Arrays.hashCode((Object[])o); } } /* Location: * Qualified Name: com.amazon.ws.emr.hadoop.fs.shaded.org.apache.commons.lang3.AnnotationUtils * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "Arwin.tio@adroll.com" ]
Arwin.tio@adroll.com
57f43c6eccddbfa654124b01f15fffa1a5fcfa3a
6d471aeb75faab34a52b21994053e42ce8a1f2a6
/paas_createcardrelatedcontract/src/main/java/pe/bbva/aso/servicios/createcardrelatedcontract/controller/validator/CreateCardRelatedContractValidator.java
f985ba38542d7519b6de69a41a1d06688b2adeab
[]
no_license
lennindavila/aso-client-services
1341e6f96c0a72c7b346a62bb8ef8f9ef2991ac3
2af4e76c223083ba614944f067984885ae050d87
refs/heads/master
2022-01-12T07:02:56.869255
2019-03-14T07:29:01
2019-03-14T07:29:01
161,132,305
0
0
null
null
null
null
UTF-8
Java
false
false
1,270
java
package pe.bbva.aso.servicios.createcardrelatedcontract.controller.validator; import org.apache.commons.lang.StringUtils; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import org.springframework.validation.Errors; import org.springframework.validation.Validator; import ch.qos.logback.classic.Logger; import pe.bbva.aso.servicios.createcardrelatedcontract.dto.RequestCreateCardRelatedContract; @Component @Scope("prototype") public class CreateCardRelatedContractValidator implements Validator { Logger logger = (Logger) LoggerFactory.getLogger(getClass()); @Override public boolean supports(Class<?> clazz) { return true; } @Override public void validate(Object target, Errors errors) { logger.debug("validate: inicio"); RequestCreateCardRelatedContract request = (RequestCreateCardRelatedContract) target; if (StringUtils.isBlank(request.getCardId())) { logger.error("Codigo de cliente es requerido"); errors.rejectValue("cardId", "Es requerido"); }else if (StringUtils.isBlank(request.getContractId())) { logger.error("Codigo de cliente es requerido"); errors.rejectValue("contractId", "Es requerido"); } logger.debug("validate: fin"); } }
[ "lennin.davila@gmail.com" ]
lennin.davila@gmail.com
24b95df81afcb7f8a45daf38c747fecdb0080785
7da6648b7b39329e49decc9f8103ce259ab37fbf
/TP/trad-dc/src/main/java/cn/fintechstar/traddc/config/InstantMqBeanInfoRegistryPostProcessor.java
60bf6e476c054737500e1e8d0a00a7d93d505718
[]
no_license
codingsf/source_code
8441775ccc89b0382b76bd9ceb6a6f8e47b7478c
7a247411a84386fa001882310e6478f9251b66f2
refs/heads/master
2020-03-22T03:37:04.588887
2018-06-12T06:25:12
2018-06-12T06:25:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,222
java
package cn.fintechstar.traddc.config; import java.util.HashMap; import java.util.Map; import org.springframework.amqp.core.Binding; import org.springframework.amqp.core.Binding.DestinationType; import org.springframework.amqp.core.Queue; import org.springframework.beans.BeansException; import org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConstructorArgumentValues; import org.springframework.beans.factory.support.BeanDefinitionReaderUtils; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.context.EnvironmentAware; import org.springframework.context.annotation.AnnotationConfigUtils; import org.springframework.context.annotation.AnnotationScopeMetadataResolver; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ScopeMetadata; import org.springframework.context.annotation.ScopeMetadataResolver; import org.springframework.core.env.Environment; @Configuration public class InstantMqBeanInfoRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor, EnvironmentAware{ private ScopeMetadataResolver scopeMetadataResolver = new AnnotationScopeMetadataResolver(); private String instantExchange; private Map<String, Object> queueMap = new HashMap<>(); @Override public void setEnvironment(Environment environment) { instantExchange = environment.getProperty("mq.instantExchange"); RelaxedPropertyResolver propertyResolver = new RelaxedPropertyResolver(environment, "mq."); queueMap = propertyResolver.getSubProperties("instantSignalQueue"); } @Override public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { for(String key : queueMap.keySet()){ String queueName = (String) queueMap.get(key); BeanDefinition queue = beanFactory.getBeanDefinition(queueName); ConstructorArgumentValues queueConstructor = queue.getConstructorArgumentValues(); queueConstructor.addGenericArgumentValue(queueName); queueConstructor.addGenericArgumentValue(false); queueConstructor.addGenericArgumentValue(false); queueConstructor.addGenericArgumentValue(true); BeanDefinition binding1 = beanFactory.getBeanDefinition(queueName + "Binding1"); ConstructorArgumentValues bindingConstructor1 = binding1.getConstructorArgumentValues(); bindingConstructor1.addGenericArgumentValue(queueName); bindingConstructor1.addGenericArgumentValue(DestinationType.QUEUE); bindingConstructor1.addGenericArgumentValue(instantExchange); bindingConstructor1.addGenericArgumentValue(key.replace(".", "")); bindingConstructor1.addGenericArgumentValue(new HashMap<String,Object>()); } } @Override public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { for(String key : queueMap.keySet()){ String queueName = (String) queueMap.get(key); registerBean(registry, queueName, Queue.class); registerBean(registry, queueName + "Binding1", Binding.class); } } private void registerBean(BeanDefinitionRegistry registry, String name, Class<?> beanClass) { AnnotatedGenericBeanDefinition annotatedGenericBeanDefinition = new AnnotatedGenericBeanDefinition(beanClass); ScopeMetadata scopeMetadata = this.scopeMetadataResolver.resolveScopeMetadata(annotatedGenericBeanDefinition); annotatedGenericBeanDefinition.setScope(scopeMetadata.getScopeName()); AnnotationConfigUtils.processCommonDefinitionAnnotations(annotatedGenericBeanDefinition); BeanDefinitionHolder definitionHolder = new BeanDefinitionHolder(annotatedGenericBeanDefinition, name); BeanDefinitionReaderUtils.registerBeanDefinition(definitionHolder, registry); } }
[ "kevin.fu@fintechstar.cn" ]
kevin.fu@fintechstar.cn
c597cd0ec274b6b8628a7945ac5e4936483355a4
cf10d1426dfea9082121f4dbd5fbc3a911a70607
/ps-cashloan-business-core/src/main/java/com/adpanshi/cashloan/business/core/common/util/NidGenerator.java
714addc5fd3adbc8396f5c9497f06d0ed5212861
[]
no_license
wudongpo/ps-cashloan-business
8e1d9724fec9b25dd95998e7899486910438fde1
bbba3f3de808aaaab3e8e9d73cbf193d7ba548c9
refs/heads/master
2020-05-22T14:04:28.435113
2018-09-29T08:22:52
2018-09-29T08:22:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,732
java
package com.adpanshi.cashloan.business.core.common.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.text.SimpleDateFormat; import java.util.Date; import java.util.UUID; /** * 编号生成器 * */ public class NidGenerator { public static final Logger logger = LoggerFactory.getLogger(NidGenerator.class); protected final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); private static int getHashCode() { int hashCode = UUID.randomUUID().toString().hashCode(); if (hashCode < 0) { hashCode = -hashCode; } return hashCode; } /** * orderNo * @return */ public synchronized static String getOrderNo(){ int[] reult = randomCommon(100,999,2); String msecStr = DateUtil.dateStr(new Date(),DateUtil.YYMMDD)+System.currentTimeMillis(); if(null != reult && reult.length >0) return msecStr+reult[0]; return msecStr; } /** * 评分卡nid * @return */ public static String getCardNid() { int hashCode = getHashCode(); return "CC" + String.format("%011d", hashCode); } /** *评分项目nid * @return */ public static String getItemNid() { int hashCode = getHashCode(); return "CI" + String.format("%011d", hashCode); } /** * 评分卡因子nid * @return */ public static String getFactorNid() { int hashCode = getHashCode(); return "CF" + String.format("%011d", hashCode); } /** * 评分参数nid * @return */ public static String getParamNid() { int hashCode = getHashCode(); return "CFP" + String.format("%010d", hashCode); } /** * 随机指定范围内N个不重复的数 * 最简单最基本的方法 * @param min 指定范围最小值 * @param max 指定范围最大值 * @param n 随机数个数 */ public static int[] randomCommon(int min, int max, int n){ if (n > (max - min + 1) || max < min) { return null; } int[] result = new int[n]; int count = 0; while(count < n) { int num = (int) (Math.random() * (max - min)) + min; boolean flag = true; for (int j = 0; j < n; j++) { if(num == result[j]){ flag = false; break; } } if(flag){ result[count] = num; count++; } } return result; } public static void main(String[] args) { System.out.println(getOrderNo()); } }
[ "zhoushanwen8502@adpanshi.com" ]
zhoushanwen8502@adpanshi.com
f6cb1d399b823cb4e81b0599de602f44e91e9683
02accd85cb86f7819ccb8100a7edcb9c8ab06232
/20190804-Menu+RCLib/pr_data_source/items/technician/GetRecordsItem.java
82098f7ef444bbbf60b142bca7066123b5537f8a
[]
no_license
select26/telran
77c7747297d59951c61b9081d468e5ea1d406658
72ea0765fac32a33e8b2f78c471b08dd01bfe42a
refs/heads/master
2022-12-25T14:35:59.139473
2019-10-24T11:47:14
2019-10-24T11:47:14
191,749,937
0
0
null
null
null
null
UTF-8
Java
false
false
764
java
package telran.cars.items.technician; import java.util.List; import telran.cars.dto.RentRecord; import telran.cars.items.RentCompanyItem; import telran.cars.service.IRentCompany; import telran.view.InputOutput; public class GetRecordsItem extends RentCompanyItem { public GetRecordsItem(InputOutput inputOutput, IRentCompany company) { super(inputOutput, company); } @Override public String displayedName() { return "Display records"; } @Override public void perform() { fillFromToDates(); if(fromDate==null||toDate==null) return; List<RentRecord> records=company.getRentRecordsAtDates(fromDate, toDate); if(records.isEmpty()) { inputOutput.outputLine("no records"); return; } records.forEach(inputOutput::outputLine); } }
[ "Dennis@Chertkov.info" ]
Dennis@Chertkov.info
f8eb3124b8c951a2dc4817c47cecc1c297482124
10ecbe1057bbcf6e2a3f317a1da522b3da24c561
/jstarcraft-ai-math/src/main/java/com/jstarcraft/ai/math/algorithm/lsh/SimHashFunction.java
7f39f8428992f81ce66eae8698c8a60f8ed6f166
[ "Apache-2.0" ]
permissive
XrosLiang/jstarcraft-ai
04de995ee74e202d733d9aa33b338892a592335f
143b8e52861db09203a9ffad99af58f1d23e764c
refs/heads/master
2022-07-16T02:13:06.640230
2020-05-14T13:10:22
2020-05-14T13:10:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,085
java
package com.jstarcraft.ai.math.algorithm.lsh; import java.util.Random; import com.jstarcraft.ai.math.structure.DefaultScalar; import com.jstarcraft.ai.math.structure.MathScalar; import com.jstarcraft.ai.math.structure.vector.ArrayVector; import com.jstarcraft.ai.math.structure.vector.MathVector; public class SimHashFunction implements VectorHashFunction { private MathVector projection; public SimHashFunction(Random random, MathVector projection) { int dimensions = projection.getElementSize(); this.projection = new ArrayVector(dimensions, new float[dimensions]); for (int dimension = 0; dimension < dimensions; dimension++) { float value = projection.getValue(dimension); this.projection.setValue(dimension, random.nextBoolean() ? value : -value); } } public int hash(MathVector vector) { MathScalar scalar = DefaultScalar.getInstance(); // calculate the dot product. float hash = scalar.dotProduct(vector, projection).getValue(); // returns a 'bit' encoded as an integer. // 1 when positive or zero, 0 otherwise. return hash > 0 ? 1 : 0; } }
[ "Birdy@LAPTOP-QRG8T75T" ]
Birdy@LAPTOP-QRG8T75T
0a9906ed181d12b4e166a18b7c0bc9e7ca35cb7b
1c0df66bdc53d84aea6f7aa1f0183cf6f8392ab1
/temp/src/minecraft/net/minecraft/client/gui/inventory/GuiEditSign.java
c1c5647763c5acbc6194423fc3d625da3fda7caf
[]
no_license
yuwenyong/Minecraft-1.9-MCP
9b7be179db0d7edeb74865b1a78d5203a5f75d08
bc89baf1fd0b5d422478619e7aba01c0b23bd405
refs/heads/master
2022-05-23T00:52:00.345068
2016-03-11T21:47:32
2016-03-11T21:47:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,607
java
package net.minecraft.client.gui.inventory; import java.io.IOException; import net.minecraft.block.Block; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.client.resources.I18n; import net.minecraft.init.Blocks; import net.minecraft.network.play.client.CPacketUpdateSign; import net.minecraft.tileentity.TileEntitySign; import net.minecraft.util.ChatAllowedCharacters; import net.minecraft.util.text.TextComponentString; import org.lwjgl.input.Keyboard; public class GuiEditSign extends GuiScreen { private TileEntitySign field_146848_f; private int field_146849_g; private int field_146851_h; private GuiButton field_146852_i; public GuiEditSign(TileEntitySign p_i1097_1_) { this.field_146848_f = p_i1097_1_; } public void func_73866_w_() { this.field_146292_n.clear(); Keyboard.enableRepeatEvents(true); this.field_146292_n.add(this.field_146852_i = new GuiButton(0, this.field_146294_l / 2 - 100, this.field_146295_m / 4 + 120, I18n.func_135052_a("gui.done", new Object[0]))); this.field_146848_f.func_145913_a(false); } public void func_146281_b() { Keyboard.enableRepeatEvents(false); NetHandlerPlayClient nethandlerplayclient = this.field_146297_k.func_147114_u(); if(nethandlerplayclient != null) { nethandlerplayclient.func_147297_a(new CPacketUpdateSign(this.field_146848_f.func_174877_v(), this.field_146848_f.field_145915_a)); } this.field_146848_f.func_145913_a(true); } public void func_73876_c() { ++this.field_146849_g; } protected void func_146284_a(GuiButton p_146284_1_) throws IOException { if(p_146284_1_.field_146124_l) { if(p_146284_1_.field_146127_k == 0) { this.field_146848_f.func_70296_d(); this.field_146297_k.func_147108_a((GuiScreen)null); } } } protected void func_73869_a(char p_73869_1_, int p_73869_2_) throws IOException { if(p_73869_2_ == 200) { this.field_146851_h = this.field_146851_h - 1 & 3; } if(p_73869_2_ == 208 || p_73869_2_ == 28 || p_73869_2_ == 156) { this.field_146851_h = this.field_146851_h + 1 & 3; } String s = this.field_146848_f.field_145915_a[this.field_146851_h].func_150260_c(); if(p_73869_2_ == 14 && !s.isEmpty()) { s = s.substring(0, s.length() - 1); } if(ChatAllowedCharacters.func_71566_a(p_73869_1_) && this.field_146289_q.func_78256_a(s + p_73869_1_) <= 90) { s = s + p_73869_1_; } this.field_146848_f.field_145915_a[this.field_146851_h] = new TextComponentString(s); if(p_73869_2_ == 1) { this.func_146284_a(this.field_146852_i); } } public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.func_146276_q_(); this.func_73732_a(this.field_146289_q, I18n.func_135052_a("sign.edit", new Object[0]), this.field_146294_l / 2, 40, 16777215); GlStateManager.func_179131_c(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.func_179094_E(); GlStateManager.func_179109_b((float)(this.field_146294_l / 2), 0.0F, 50.0F); float f = 93.75F; GlStateManager.func_179152_a(-f, -f, -f); GlStateManager.func_179114_b(180.0F, 0.0F, 1.0F, 0.0F); Block block = this.field_146848_f.func_145838_q(); if(block == Blocks.field_150472_an) { float f1 = (float)(this.field_146848_f.func_145832_p() * 360) / 16.0F; GlStateManager.func_179114_b(f1, 0.0F, 1.0F, 0.0F); GlStateManager.func_179109_b(0.0F, -1.0625F, 0.0F); } else { int i = this.field_146848_f.func_145832_p(); float f2 = 0.0F; if(i == 2) { f2 = 180.0F; } if(i == 4) { f2 = 90.0F; } if(i == 5) { f2 = -90.0F; } GlStateManager.func_179114_b(f2, 0.0F, 1.0F, 0.0F); GlStateManager.func_179109_b(0.0F, -1.0625F, 0.0F); } if(this.field_146849_g / 6 % 2 == 0) { this.field_146848_f.field_145918_i = this.field_146851_h; } TileEntityRendererDispatcher.field_147556_a.func_147549_a(this.field_146848_f, -0.5D, -0.75D, -0.5D, 0.0F); this.field_146848_f.field_145918_i = -1; GlStateManager.func_179121_F(); super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); } }
[ "jholley373@yahoo.com" ]
jholley373@yahoo.com
d1553eaecb09b7457e68914adf660acb5c4bed8a
e5afc547f77cb9c2f1eed59f43f250f5804bd200
/Commoner/app/src/main/java/com/chenpan/commoner/NewsDetailActivity.java
f718fbd48a15af4f32c196b781c752cd526aaf9b
[ "Apache-2.0" ]
permissive
a616707902/Commoner
3f5ad445e8a39aec45ef440185aff1fee5b9b4bf
61f3919bcabf05a4632ad99cb26a1f13591c86be
refs/heads/master
2020-05-25T15:43:43.742473
2016-10-18T09:32:21
2016-10-18T09:32:21
60,163,597
0
0
null
null
null
null
UTF-8
Java
false
false
6,161
java
package com.chenpan.commoner; import android.os.Bundle; import android.support.design.widget.AppBarLayout; import android.support.design.widget.CollapsingToolbarLayout; import android.support.design.widget.FloatingActionButton; import android.support.v4.content.ContextCompat; import android.support.v7.widget.Toolbar; import android.text.Html; import android.view.MenuItem; import android.view.View; import android.widget.ImageView; import android.widget.TextView; import com.chenpan.commoner.base.BaseActivity; import com.chenpan.commoner.bean.NewsDetail; import com.chenpan.commoner.common.Constants; import com.chenpan.commoner.mvp.presenter.NewsDetailPresenter; import com.chenpan.commoner.mvp.view.INewsDetailView; import com.chenpan.commoner.utils.CommonUtils; import com.chenpan.commoner.utils.SystemUtils; import com.chenpan.commoner.widget.URLImageGetter; import com.chenpan.commoner.widget.load.LoadingState; import com.chenpan.commoner.widget.load.LoadingView; import com.chenpan.commoner.widget.load.OnRetryListener; import com.daimajia.androidanimations.library.Techniques; import com.daimajia.androidanimations.library.YoYo; import com.nostra13.universalimageloader.core.ImageLoader; import java.util.List; import butterknife.Bind; public class NewsDetailActivity extends BaseActivity<INewsDetailView, NewsDetailPresenter> implements INewsDetailView { @Bind(R.id.news_detail_photo_iv) ImageView mNewsDetailPhotoIv; @Bind(R.id.mask_view) View mMaskView; @Bind(R.id.toolbar) Toolbar mToolbar; @Bind(R.id.toolbar_layout) CollapsingToolbarLayout mToolbarLayout; @Bind(R.id.app_bar) AppBarLayout mAppBar; @Bind(R.id.news_detail_from_tv) TextView mNewsDetailFromTv; @Bind(R.id.news_detail_body_tv) TextView mNewsDetailBodyTv; @Bind(R.id.fl_loading) LoadingView flLoading; @Bind(R.id.fab) FloatingActionButton mFab; String postId; private URLImageGetter mUrlImageGetter; private String mNewsTitle; private String mShareLink; @Override public NewsDetailPresenter createPresenter() { return new NewsDetailPresenter(); } @Override public int getToolBarId() { return R.id.toolbar; } @Override public boolean isSetStatusBar() { return false; } @Override public void getIntentValue() { postId = getIntent().getStringExtra(Constants.NEWS_POST_ID); } @Override public void bindViewAndAction(Bundle savedInstanceState) { mPresenter.setPostId(postId); mPresenter.loadNewsDetail(this); flLoading.withLoadedEmptyText("≥﹏≤ , 连条毛都没有 !").withEmptyIco(R.drawable.note_empty).withBtnEmptyEnnable(false) .withErrorIco(R.drawable.ic_chat_empty).withLoadedErrorText("(῀( ˙᷄ỏ˙᷅ )῀)ᵒᵐᵍᵎᵎᵎ,我家程序猿跑路了 !").withbtnErrorText("去找回她!!!") .withLoadedNoNetText("你挡着信号啦o( ̄ヘ ̄o)☞ᗒᗒ 你走").withNoNetIco(R.drawable.ic_chat_empty).withbtnNoNetText("网弄好了,重试") .withLoadingText("加载中...").withOnRetryListener(new OnRetryListener() { @Override public void onRetry() { mPresenter.loadNewsDetail(NewsDetailActivity.this); } }).build(); } @Override public int getContentLayout() { return R.layout.activity_news_detail; } @Override public void setNewsDetail(NewsDetail newsDetail) { mShareLink = newsDetail.getShareLink(); mNewsTitle = newsDetail.getTitle(); String newsSource = newsDetail.getSource(); String newsTime = SystemUtils.formatDate(newsDetail.getPtime()); String newsBody = newsDetail.getBody(); String NewsImgSrc = getImgSrcs(newsDetail); setToolBarLayout(mNewsTitle); // mNewsDetailTitleTv.setText(newsTitle); mNewsDetailFromTv.setText(getString(R.string.news_from, newsSource, newsTime)); setNewsDetailPhotoIv(NewsImgSrc); setBody(newsDetail, newsBody); } @Override public void showFild() { flLoading.setVisibility(View.VISIBLE); flLoading.setState(LoadingState.STATE_EMPTY); } private void setNewsDetailPhotoIv(String imgSrc) { if (!CommonUtils.isEmpty(imgSrc)) { ImageLoader.getInstance().displayImage(imgSrc,mNewsDetailPhotoIv); } } private void setBody(NewsDetail newsDetail, String newsBody) { flLoading.setVisibility(View.GONE); mFab.setVisibility(View.VISIBLE); YoYo.with(Techniques.RollIn).playOn(mFab); int imgTotal = newsDetail.getImg().size(); // if (isShowBody(newsBody, imgTotal)) { // mNewsDetailBodyTv.setMovementMethod(LinkMovementMethod.getInstance());//加这句才能让里面的超链接生效,实测经常卡机崩溃 mUrlImageGetter = new URLImageGetter(mNewsDetailBodyTv, newsBody, imgTotal); mNewsDetailBodyTv.setText(Html.fromHtml(newsBody, mUrlImageGetter, null)); // } else { // mNewsDetailBodyTv.setText(Html.fromHtml(newsBody)); // } } private void setToolBarLayout(String newsTitle) { mToolbarLayout.setTitle(newsTitle); mToolbarLayout.setExpandedTitleColor(ContextCompat.getColor(this, R.color.white)); mToolbarLayout.setCollapsedTitleTextColor(ContextCompat.getColor(this, R.color.primary_text_white)); } private String getImgSrcs(NewsDetail newsDetail) { List<NewsDetail.ImgBean> imgSrcs = newsDetail.getImg(); String imgSrc; if (imgSrcs != null && imgSrcs.size() > 0) { imgSrc = imgSrcs.get(0).getSrc(); } else { imgSrc = getIntent().getStringExtra(Constants.NEWS_IMG_RES); } return imgSrc; } @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; default: return super.onOptionsItemSelected(item); } } }
[ "616707902@qq.com" ]
616707902@qq.com
d638c24d924f0525bb230e5f95c13588e5c12c0f
be97af1b87ae4625112f98d9ed376ea14de6acd5
/src/test/java/io/goodforgod/api/etherscan/account/AccountTokenBalanceTests.java
3919982289f6761508ed3575b5bc4f4e6ce7cf5d
[ "MIT" ]
permissive
GoodforGod/java-etherscan-api
bffbc4942fce3ddee3bfe002ae1933dcf0113784
0e1dcccea1c3723fe39fe40871341b2dc946265a
refs/heads/master
2023-05-27T08:49:05.868325
2023-05-17T22:11:42
2023-05-17T22:11:42
155,629,163
48
42
MIT
2023-05-17T21:39:46
2018-10-31T22:05:09
Java
UTF-8
Java
false
false
2,131
java
package io.goodforgod.api.etherscan.account; import io.goodforgod.api.etherscan.ApiRunner; import io.goodforgod.api.etherscan.EtherScanAPI; import io.goodforgod.api.etherscan.error.EtherScanInvalidAddressException; import io.goodforgod.api.etherscan.model.TokenBalance; import org.junit.jupiter.api.Test; /** * @author GoodforGod * @since 03.11.2018 */ class AccountTokenBalanceTests extends ApiRunner { private final EtherScanAPI api = getApi(); @Test void correct() { TokenBalance balance = api.account().balance("0x5d807e7F124EC2103a59c5249187f772c0b8D6b2", "0x5EaC95ad5b287cF44E058dCf694419333b796123"); assertNotNull(balance); assertNotNull(balance.getBalanceInWei()); assertNotNull(balance.getAddress()); assertNotNull(balance.getContract()); assertNotNull(balance.toString()); TokenBalance balance2 = new TokenBalance("125161", balance.getBalanceInWei(), balance.getContract()); assertNotEquals(balance, balance2); assertNotEquals(balance.hashCode(), balance2.hashCode()); } @Test void invalidAddressParamWithError() { assertThrows(EtherScanInvalidAddressException.class, () -> api.account().balance("0x5807e7F124EC2103a59c5249187f772c0b8D6b2", "0x5EaC95ad5b287cF44E058dCf694419333b796123")); } @Test void invalidContractParamWithError() { assertThrows(EtherScanInvalidAddressException.class, () -> api.account().balance("0x5d807e7F124EC2103a59c5249187f772c0b8D6b2", "0xEaC95ad5b287cF44E058dCf694419333b796123")); } @Test void correctParamWithEmptyExpectedResult() { TokenBalance balance = api.account().balance("0x1d807e7F124EC2103a59c5249187f772c0b8D6b2", "0x5EaC95ad5b287cF44E058dCf694419333b796123"); assertNotNull(balance); assertNotNull(balance.getBalanceInWei()); assertNotNull(balance.getAddress()); assertNotNull(balance.getContract()); assertEquals(0, balance.getBalanceInWei().asWei().intValue()); } }
[ "goodforgod.dev@gmail.com" ]
goodforgod.dev@gmail.com
91cc96ba1138d48cb49be6f1eb2185887ffc0a6a
bc67bd70aaa83b0c8c902defbb928838f5e9b668
/tags/monolithic-src-tree/java/hibernate/src/java/org/nanocontainer/hibernate/SessionProvider.java
4034a9e97fb8c4226a802d818a5d994daf3bec6a
[ "BSD-3-Clause" ]
permissive
codehaus/picocontainer
b07475fe034384926579e2b4f6f25e68f057cae2
7be6b8b0eb33421dc7a755817628e06b79bd879d
refs/heads/master
2023-07-20T01:30:02.348980
2014-10-08T04:44:44
2014-10-08T04:44:44
36,501,409
2
2
null
null
null
null
UTF-8
Java
false
false
1,966
java
/***************************************************************************** * Copyright (c) PicoContainer Organization. All rights reserved. * * ------------------------------------------------------------------------- * * The software in this package is published under the terms of the BSD * * style license a copy of which has been included with this distribution in * * the license.html file. * * * * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant * *****************************************************************************/ package org.nanocontainer.hibernate; import net.sf.hibernate.HibernateException; import net.sf.hibernate.Session; /** * implementors provide session session management. * * @author Konstantin Pribluda ( konstantin.pribluda[at]infodesire.com ) * @version $Revision$ */ public interface SessionProvider { /** * provide hibernate session out of factory create new one if necessary, * * @return The Session value * @throws HibernateException Description of Exception */ Session getSession() throws HibernateException; /** * commit transaction currently underway, and start new one ( as side effect * hibernate session will be flushed ) */ void commit() throws HibernateException; /** * rollback active transaction if any was started. transaction will be reset * * @throws HibernateException if transaction can not be rolled back */ void rollback() throws HibernateException; /** * normal session close. commit transaction is any */ void close() throws HibernateException; /** * reset and clean up everything. shall be used is something went * wrong ( for example you received hibernate exception ) */ void reset(); }
[ "mauro@ac66bb80-72f5-0310-8d68-9f556cfffb23" ]
mauro@ac66bb80-72f5-0310-8d68-9f556cfffb23
66261d36ddda86b98b630f42f4ec777f62392fbe
f7f9d7fa841e856927e02513ecc74dc00c935f8a
/server/src/test/java/org/codelibs/fesen/index/engine/NoOpEngineRecoveryTests.java
b6ef599f94707023f802d07f13e7b22aa2877552
[ "CDDL-1.0", "MIT", "BSD-3-Clause", "LGPL-2.0-or-later", "LGPL-2.1-only", "NAIST-2003", "LicenseRef-scancode-generic-export-compliance", "ICU", "SunPro", "Python-2.0", "CC-BY-SA-3.0", "MPL-1.1", "GPL-2.0-only", "CPL-1.0", "LicenseRef-scancode-other-copyleft", "Apache-2.0", "LicenseRef-scancode-public-domain", "CC-PDDC", "BSD-2-Clause", "LicenseRef-scancode-unicode-mappings", "LicenseRef-scancode-unicode", "CC0-1.0", "Apache-1.1", "EPL-1.0", "Classpath-exception-2.0" ]
permissive
codelibs/fesen
3f949fd3533e8b25afc3d3475010d1b1a0d95c09
b2440fbda02e32f7abe77d2be95ead6a16c8af06
refs/heads/main
2022-07-27T21:14:02.455938
2021-12-21T23:54:20
2021-12-21T23:54:20
330,334,670
4
0
Apache-2.0
2022-05-17T01:54:31
2021-01-17T07:07:56
Java
UTF-8
Java
false
false
2,503
java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch 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.codelibs.fesen.index.engine; import org.codelibs.fesen.cluster.routing.ShardRouting; import org.codelibs.fesen.cluster.routing.RecoverySource.ExistingStoreRecoverySource; import org.codelibs.fesen.common.settings.Settings; import org.codelibs.fesen.index.engine.NoOpEngine; import org.codelibs.fesen.index.shard.IndexShard; import org.codelibs.fesen.index.shard.IndexShardTestCase; import static org.codelibs.fesen.cluster.routing.ShardRoutingHelper.initWithSameId; import java.io.IOException; public class NoOpEngineRecoveryTests extends IndexShardTestCase { public void testRecoverFromNoOp() throws IOException { final int nbDocs = scaledRandomIntBetween(1, 100); final IndexShard indexShard = newStartedShard(true); for (int i = 0; i < nbDocs; i++) { indexDoc(indexShard, "_doc", String.valueOf(i)); } indexShard.close("test", true); final ShardRouting shardRouting = indexShard.routingEntry(); IndexShard primary = reinitShard(indexShard, initWithSameId(shardRouting, ExistingStoreRecoverySource.INSTANCE), indexShard.indexSettings().getIndexMetadata(), NoOpEngine::new); recoverShardFromStore(primary); assertEquals(primary.seqNoStats().getMaxSeqNo(), primary.getMaxSeqNoOfUpdatesOrDeletes()); assertEquals(nbDocs, primary.docStats().getCount()); IndexShard replica = newShard(false, Settings.EMPTY, NoOpEngine::new); recoverReplica(replica, primary, true); assertEquals(replica.seqNoStats().getMaxSeqNo(), replica.getMaxSeqNoOfUpdatesOrDeletes()); assertEquals(nbDocs, replica.docStats().getCount()); closeShards(primary, replica); } }
[ "shinsuke@apache.org" ]
shinsuke@apache.org
b90a2aa69c4892be9f43b925d853bfd981e23ad1
cfed60e66cbe33d12782972c95b5a47e59dd0874
/android/app/src/main/java/com/testdating_18535/MainApplication.java
16c2afb70f123412c3b706d32b87b9449862f54e
[]
no_license
crowdbotics-apps/testdating-18535
957a04ae7b2b51eecf916117ca3f873114c2b041
156541ae2b41fbd697b53fe65996e89dd585d821
refs/heads/master
2022-11-19T05:18:49.590102
2020-07-02T17:38:29
2020-07-02T17:38:29
276,437,912
0
0
null
null
null
null
UTF-8
Java
false
false
1,369
java
package com.testdating_18535; import android.app.Application; import android.util.Log; import com.facebook.react.PackageList; import com.facebook.hermes.reactexecutor.HermesExecutorFactory; import com.facebook.react.bridge.JavaScriptExecutorFactory; import com.facebook.react.ReactApplication; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; import com.facebook.soloader.SoLoader; import java.util.List; public class MainApplication extends Application implements ReactApplication { private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { @Override public boolean getUseDeveloperSupport() { return BuildConfig.DEBUG; } @Override protected List<ReactPackage> getPackages() { @SuppressWarnings("UnnecessaryLocalVariable") List<ReactPackage> packages = new PackageList(this).getPackages(); // Packages that cannot be autolinked yet can be added manually here, for example: // packages.add(new MyReactNativePackage()); return packages; } @Override protected String getJSMainModuleName() { return "index"; } }; @Override public ReactNativeHost getReactNativeHost() { return mReactNativeHost; } @Override public void onCreate() { super.onCreate(); SoLoader.init(this, /* native exopackage */ false); } }
[ "team@crowdbotics.com" ]
team@crowdbotics.com
4de9971b2254992fe90800fb0cd8215a80ac6a86
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_de0ebc92a0c679da94ad40359cd0c86a2bf0f5e8/MessageRecordHandler/5_de0ebc92a0c679da94ad40359cd0c86a2bf0f5e8_MessageRecordHandler_t.java
d5df9f6be2e0df9d3d25be1a0b98d703ea7e0162
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
3,076
java
/** * EasySOA Proxy * Copyright 2011 Open Wide * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Contact : easysoa-dev@googlegroups.com */ package org.easysoa.proxy.core.api.exchangehandler; import org.apache.log4j.Logger; import org.easysoa.message.InMessage; import org.easysoa.message.OutMessage; import org.easysoa.proxy.core.api.configuration.ProxyConfiguration; import org.easysoa.proxy.core.api.run.RunManager; import org.easysoa.records.ExchangeRecord; import org.osoa.sca.annotations.Reference; import org.osoa.sca.annotations.Scope; /** * Handler to record messages using the run manager * @author jguillemotte * */ @Scope("composite") public class MessageRecordHandler implements MessageHandler { public final static String HANDLER_ID = "messageRecordHandler"; /** * Logger */ private Logger logger = Logger.getLogger(MessageRecordHandler.class.getName()); private boolean enabled = true; @Reference protected RunManager runManager; /** * @param runManager */ public MessageRecordHandler(){ } /** * @param runManager */ // TODO : Find an other way to init runManager (from nuxeo). When done, remove this setter public void setRunManager(RunManager runManager){ this.runManager = runManager; } @Override public void handleMessage(InMessage inMessage, OutMessage outMessage) throws Exception { if(enabled){ logger.debug("Message received, calling registered handlers"); // Builds a new Exchange record with data contained in request and response ExchangeRecord record = new ExchangeRecord(); record.setInMessage(inMessage); record.setOutMessage(outMessage); // Call runManager to register the exchange record runManager.record(record); } else { logger.info("Message record handler is disabled"); } } @Override public void setHandlerConfiguration(ProxyConfiguration configuration) { // Nothing to do } @Override public void enable() { this.enabled = true; } @Override public void disable() { this.enabled = false; } @Override public String getID() { return HANDLER_ID; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
0ec53eca3b8ba7e9422a80200539a32fba30fdd7
dd4a8106f9bdb2cb42d192644766fd93cb529eb5
/_/01/welcome/src/com/example/welcome/WelcomeUI.java
bb679067e1a132b5e02373bd689527c855c67995
[ "Apache-2.0" ]
permissive
paullewallencom/vaadin-978-1-7821-6226-1
42c8b1a503875b9626b83c4fbc74dc50994ff9ab
ee8d5a97822834d93c59058b38e35a49055c69a0
refs/heads/main
2023-02-05T20:29:23.100623
2020-12-30T01:29:17
2020-12-30T01:29:17
319,441,484
0
0
null
null
null
null
UTF-8
Java
false
false
1,506
java
package com.example.welcome; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; import com.vaadin.ui.TextField; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; @SuppressWarnings("serial") public class WelcomeUI extends UI { protected void init(VaadinRequest request) { final VerticalLayout layout = new VerticalLayout(); layout.setMargin(true); setContent(layout); final TextField name1 = new TextField("Somebody's name"); final TextField name2 = new TextField("somebody's name"); layout.addComponent(name1); layout.addComponent(name2); Button button = new Button("Click Me"); button.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { String phrase = getFunnyPhrase(name1.getValue(), name2.getValue()); layout.addComponent(new Label(phrase)); } }); layout.addComponent(button); } public String getFunnyPhrase(String name1, String name2) { String[] verbs = new String[] {"eats", "melts", "breaks", "whshes", "sells"}; String[] bodyParts = new String[] {"head", "hands", "waist", "eyes", "elbows"}; return name1 + " " + verbs[(int) (Math.random() * 100 % verbs.length)] + " " + name2 + "'s " + bodyParts[(int) (Math.random() * 100 % verbs.length)]; } }
[ "paullewallencom@users.noreply.github.com" ]
paullewallencom@users.noreply.github.com
1b49fcb21cd31b51bf9a01ecc2819d252942a531
be67c1f981b461cd09a54e83aa3c8622745d5368
/src/main/java/io/agroapp/application/repository/PedidoRepository.java
3b46a2afac6792e85394c7778298f457f6f2b919
[]
no_license
gpellegrini87/jhipster-agroapp
0d650c1d89e8123a85e943252047f1b4f2e3a080
63c1cdff23b3ca22452fd56538375c70a0201c6f
refs/heads/master
2020-04-09T12:25:30.707663
2019-05-14T11:49:14
2019-05-14T11:49:14
160,349,358
0
0
null
2019-05-14T11:49:15
2018-12-04T11:48:33
Java
UTF-8
Java
false
false
364
java
package io.agroapp.application.repository; import io.agroapp.application.domain.Pedido; import org.springframework.data.jpa.repository.*; import org.springframework.stereotype.Repository; /** * Spring Data repository for the Pedido entity. */ @SuppressWarnings("unused") @Repository public interface PedidoRepository extends JpaRepository<Pedido, Long> { }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
e4abd811a0013ab1055790caa783d38eec2ed7b6
312e02ac31d750ac91e0fbe7aaf52705edcb7ab1
/other/2061/13.Interface/example/01.Interface/src/club/banyuan/Father.java
fe06bc9b2ba5c71c3e15979c3f658ece50a1e0c0
[]
no_license
samho2008/2010JavaSE
52f423c4c135a7ce61c62911ed62cbe2ad91c7ba
890a4f5467aa2e325383f0e4328e6a9249815ebc
refs/heads/master
2023-06-14T07:57:37.914624
2021-07-05T16:34:18
2021-07-05T16:34:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
227
java
package club.banyuan; public class Father { private String familyName; public String getFamilyName() { return familyName; } public void setFamilyName(String familyName) { this.familyName = familyName; } }
[ "zhoujian@banyuan.club" ]
zhoujian@banyuan.club
bd86709ae8ac4641698a79a76ccdd1ce5b23ff07
930c207e245c320b108e9699bbbb036260a36d6a
/BRICK-RDF4J/generatedCode/src/main/java/brickschema/org/schema/_1_0_2/Brick/IDual_Band_Mode_Setpoint.java
8244a21aa4637b233323e543f750899a676f117a
[]
no_license
InnovationSE/BRICK-Generated-By-OLGA
24d278f543471e1ce622f5f45d9e305790181fff
7874dfa450a8a2b6a6f9927c0f91f9c7d2abd4d2
refs/heads/master
2021-07-01T14:13:11.302860
2017-09-21T12:44:17
2017-09-21T12:44:17
104,251,784
1
0
null
null
null
null
UTF-8
Java
false
false
426
java
/** * This file is automatically generated by OLGA * @author OLGA * @version 1.0 */ package brickschema.org.schema._1_0_2.Brick; import java.util.ArrayList; import java.util.List; import org.eclipse.rdf4j.model.IRI; import org.eclipse.rdf4j.model.vocabulary.RDF; import brickschema.org.schema._1_0_2.Brick.IMode_Setpoint; public interface IDual_Band_Mode_Setpoint extends IMode_Setpoint { public IRI iri(); }
[ "Andre.Ponnouradjane@non.schneider-electric.com" ]
Andre.Ponnouradjane@non.schneider-electric.com
fa2d849840364da5a1b9234673f895ba508710bb
9728b9b3a12cfff4b30dae4d3de4f1974252f5f6
/mapreduce-demo/src/main/java/com/hfl/wordcount/WordCountMap.java
fd910a0dd5814cf0f2a0bbcffe3858c47996b802
[]
no_license
hufanglei/bigdata12
381f34ed133c0e14599a04af80a8de5dfd4b666c
5363dd608db48251379a0322091738950737e264
refs/heads/master
2022-05-09T13:30:19.620437
2020-03-22T04:02:26
2020-03-22T04:02:26
189,749,154
0
0
null
null
null
null
UTF-8
Java
false
false
830
java
package com.hfl.wordcount; import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import java.io.IOException; //坑,自动导包Text很容易导成java public class WordCountMap extends Mapper<LongWritable, Text, Text, LongWritable> { protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { System.out.println(key); //拿到数据,进行数据转换Text=》String String line = value.toString(); //按照空格切分 String[] split = line.split(" "); //输出数据KEYOUT, VALUEOUT for (String s : split) { //数据转换String=》Text int=》IntWritable context.write(new Text(s), new LongWritable(1)); } } }
[ "690328661@qq.com" ]
690328661@qq.com
4a57b1644e762b4aabc5f84006e76821f9ca2a2b
de3145ba9eee5c2aa81bc0d1d98b77c97bfb7bc6
/services/user/src/main/java/com/jemmy/services/user/mapper/UacGroupUserMapper.java
d72691fa53f9be8770020710dc080bc370f84644
[ "Apache-2.0" ]
permissive
hijemmy/spring-cloud-blueprint
63c718f66847d691924e4f35fd3d6edd666f1bf9
8ffa25bd59eb68df76dcf4978d4657f5be08b6c4
refs/heads/master
2020-04-01T03:37:22.347292
2018-11-28T03:44:14
2018-11-28T03:44:14
152,829,128
0
0
null
null
null
null
UTF-8
Java
false
false
1,850
java
/* * Copyright (c) 2018. paascloud.net All Rights Reserved. * 项目名称:paascloud快速搭建企业级分布式微服务平台 * 类名称:UacGroupUserMapper.java * 创建人:刘兆明 * 联系方式:paascloud.net@gmail.com * 开源地址: https://github.com/paascloud * 博客地址: http://blog.paascloud.net * 项目官网: http://paascloud.net */ package com.jemmy.services.user.mapper; import com.jemmy.common.core.mybatis.RootMapper; import com.jemmy.services.user.model.domain.UacGroup; import com.jemmy.services.user.model.domain.UacGroupUser; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; import java.util.List; /** * The interface Uac group user mapper. * * @author paascloud.net@gmail.com */ @Mapper @Component public interface UacGroupUserMapper extends RootMapper<UacGroupUser> { /** * Query by user id uac group user. * * @param userId the user id * * @return the uac group user */ UacGroupUser getByUserId(Long userId); /** * Update by user id int. * * @param uacGroupUser the uac group user * * @return the int */ int updateByUserId(UacGroupUser uacGroupUser); /** * Select group list by user id list. * * @param userId the user id * * @return the list */ List<UacGroup> selectGroupListByUserId(Long userId); /** * List by group id list. * * @param groupId the group id * * @return the list */ List<UacGroupUser> listByGroupId(@Param("groupId") Long groupId); /** * Delete exclude super mng int. * * @param groupId the group id * @param superManagerRoleId the super manager role id * * @return the int */ int deleteExcludeSuperMng(@Param("currentGroupId") Long groupId, @Param("superManagerRoleId") Long superManagerRoleId); }
[ "caiqingh2006@126.com" ]
caiqingh2006@126.com
683012756f8d4fc8dddf3cb598975e4239b0034a
a99d7938a72fa102694758075d907c549f25e94b
/bus-health/src/main/java/org/aoju/bus/health/software/linux/LinuxUserGroupInfo.java
78762a78233d3c600be95a712824103e95534cc4
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
RebeccaQn/bus
bfe53d26aced66f7dee5332c9ba1819535368056
6430904ad9f5fe3fd9cc94d3a560c2e0c35ad651
refs/heads/master
2020-12-05T21:33:13.911966
2019-12-31T10:14:51
2019-12-31T10:14:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,918
java
/* * The MIT License * * Copyright (c) 2017 aoju.org All rights reserved. * * 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 org.aoju.bus.health.software.linux; import org.aoju.bus.core.lang.Symbol; import org.aoju.bus.health.Command; import org.aoju.bus.health.software.OSUser; import java.util.HashMap; import java.util.List; import java.util.Map; /** * <p> * LinuxUserGroupInfo class. * </p> * * @author Kimi Liu * @version 5.5.0 * @since JDK 1.8+ */ public class LinuxUserGroupInfo { // Temporarily cache users and groups private Map<String, OSUser> usersIdMap = new HashMap<>(); private Map<String, String> groupsIdMap = new HashMap<>(); /** * <p> * getUser. * </p> * * @param userId a {@link java.lang.String} object. * @return a {@link OSUser} object. */ public OSUser getUser(String userId) { if (this.usersIdMap.isEmpty()) { cacheUsers(); } OSUser user = this.usersIdMap.get(userId); if (user != null) { return user; } user = new OSUser(); user.setUserId(userId); user.setUserName("Unknown"); return user; } /** * <p> * getGroupName. * </p> * * @param groupId a {@link java.lang.String} object. * @return a {@link java.lang.String} object. */ public String getGroupName(String groupId) { if (this.groupsIdMap.isEmpty()) { cacheGroups(); } String group = this.groupsIdMap.get(groupId); return (group != null) ? group : "Unknown"; } private void cacheUsers() { List<String> passwd = Command.runNative("getent passwd"); // see man 5 passwd for the fields for (String entry : passwd) { String[] split = entry.split(Symbol.COLON); if (split.length < 3) { continue; } String userName = split[0]; String uid = split[2]; // it is allowed to have multiple entries for the same userId, // we use the first one if (!this.usersIdMap.containsKey(uid)) { OSUser user = new OSUser(); user.setUserId(uid); user.setUserName(userName); this.usersIdMap.put(uid, user); } } } private void cacheGroups() { List<String> group = Command.runNative("getent group"); // see man 5 group for the fields for (String entry : group) { String[] split = entry.split(Symbol.COLON); if (split.length < 3) { continue; } String groupName = split[0]; String gid = split[2]; if (!this.groupsIdMap.containsKey(gid)) { this.groupsIdMap.put(gid, groupName); } } } }
[ "839536@qq.com" ]
839536@qq.com
667c3677f8117061e06daa1397b629c49f05fcfc
86746294f3c83c89ed6fea54522944b04fdd5b18
/cdt-java-client/src/main/java/com/github/kklisura/cdt/services/types/EventListenerImpl.java
6165df2896521b6e18020db2e9c160bbbc3f68ab
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
sechawk/chrome-devtools-java-client
cd029ce51fe0339cedb822fa84a0049798de6b7a
5720062f2ac4918c322d93f717c1f6e5f66ab7f0
refs/heads/master
2021-06-25T04:09:49.619320
2020-12-18T18:28:01
2020-12-18T18:28:01
186,698,915
0
0
Apache-2.0
2019-05-14T20:53:53
2019-05-14T20:53:53
null
UTF-8
Java
false
false
2,112
java
package com.github.kklisura.cdt.services.types; /*- * #%L * cdt-java-client * %% * Copyright (C) 2018 Kenan Klisura * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ import com.github.kklisura.cdt.protocol.support.types.EventHandler; import com.github.kklisura.cdt.protocol.support.types.EventListener; import com.github.kklisura.cdt.services.ChromeDevToolsService; /** * Event listener implementation. * * @author Kenan Klisura */ public class EventListenerImpl implements EventListener { private ChromeDevToolsService service; private String key; private EventHandler handler; private Class<?> paramType; /** * Instantiates a new Event listener. * * @param key Domain.event key. * @param handler Event handler. * @param paramType Event param type. * @param service Service. */ public EventListenerImpl( String key, EventHandler handler, Class<?> paramType, ChromeDevToolsService service) { this.service = service; this.key = key; this.paramType = paramType; this.handler = handler; } @Override public void off() { unsubscribe(); } @Override public void unsubscribe() { service.removeEventListener(this); } /** * Gets the domain.event key. * * @return Key. key */ public String getKey() { return key; } /** * Gets the event handler. * * @return Event handler. */ public EventHandler getHandler() { return handler; } /** * Gets param type. * * @return Event param type. */ public Class<?> getParamType() { return paramType; } }
[ "kklisura@hotmail.com" ]
kklisura@hotmail.com
f3abd68cbe19cfd3c3ea00b4a45b3002979564dd
93da970fe747061bec11ec425507c2816386da81
/viewpagedemo0/src/main/java/com/example/fish/viewpagedemo0/MainActivity.java
c20ca8179cc3838f4cdf63e0a9e2a4e7b1d99141
[]
no_license
chefish/FishProject
a958633e18ce132511bddc1949720bb1ba394faa
d011b37234b4df85e2ecd9e4e872e01ecb4ce129
refs/heads/master
2020-04-23T22:19:36.556044
2019-02-19T15:26:11
2019-02-19T15:26:11
171,497,920
0
0
null
null
null
null
UTF-8
Java
false
false
699
java
package com.example.fish.viewpagedemo0; import android.os.Bundle; import com.fish.lib.fishlib.ui.activity.IntroListActivity; import demo1.FuncIntroActivity; import demo2.ScrollActivity; import demo3.FromNetActivity; /** * 导航的ListActivity,每点击里面一项,都进入某个activity */ public class MainActivity extends IntroListActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addData("demo1", FuncIntroActivity.class); addData("demo2", ScrollActivity.class); //class int tt=0 // ; // int dd=77/tt; addData("demo3", FromNetActivity.class); } }
[ "xiaomin.yxm@alibaba-inc.com" ]
xiaomin.yxm@alibaba-inc.com
ba3fa78b57684907ecb87870a95f0b787c01c8d8
2af06ac21b07978a8a56336e27e4dffa58b5ac93
/src/OOPHigher/Encapsulation/DemoEncapsulation.java
2e91a8572ffd0bc176055f753edd5f8ede4cd164
[]
no_license
phamtanphat/JavaFundamental18102021
63ab87fdef0254a9748daef219d2d5ec48f729af
4fb50939cbb425129792c1bc7bce205998a240e0
refs/heads/master
2023-08-29T16:33:57.517262
2021-11-03T12:32:39
2021-11-03T12:32:39
420,089,832
0
0
null
null
null
null
UTF-8
Java
false
false
719
java
package OOPHigher.Encapsulation; import java.io.Closeable; public class DemoEncapsulation { public static void main(String[] args) { Product product1 = new Product(); try{ product1.setName("Product1"); product1.setWeight(1); }catch (Exception e){ System.out.println(e.getMessage()); } System.out.println(product1.getName()); System.out.println(product1.getWeight()); // try catch // try { // Object a = null; // int ketQua = a.hashCode(); // } catch (Exception e) { // System.out.println(e.getMessage()); // } // System.out.println("Tiếp tục"); } }
[ "phatdroid94@gmail.com" ]
phatdroid94@gmail.com
27051433d7d50d9875211c53802032a1ba44431f
62b5f0ff1ff1af44d0bcf953ebdd3cc9e1a07f0e
/use-cases/AME_2016/XMLTextFramework/src/Library3/AnyGenericAttribute.java
4138497add0d989d15f88570315595f9b46b0f27
[ "MIT" ]
permissive
patrickneubauer/XMLIntellEdit
5014a2fa426116e42c7f4b318d636c3a48720059
5e4a0ad59b7e9446e7f79dcb32e09971c2193118
refs/heads/master
2021-01-12T01:56:56.595551
2018-11-10T00:35:14
2018-11-10T00:35:14
78,438,535
7
0
null
null
null
null
UTF-8
Java
false
false
2,353
java
/** */ package Library3; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Any Generic Attribute</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link Library3.AnyGenericAttribute#getAttrName <em>Attr Name</em>}</li> * <li>{@link Library3.AnyGenericAttribute#getAttrValue <em>Attr Value</em>}</li> * </ul> * * @see Library3.Library3Package#getAnyGenericAttribute() * @model * @generated */ public interface AnyGenericAttribute extends EObject { /** * Returns the value of the '<em><b>Attr Name</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Attr Name</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Attr Name</em>' attribute. * @see #setAttrName(String) * @see Library3.Library3Package#getAnyGenericAttribute_AttrName() * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" * @generated */ String getAttrName(); /** * Sets the value of the '{@link Library3.AnyGenericAttribute#getAttrName <em>Attr Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Attr Name</em>' attribute. * @see #getAttrName() * @generated */ void setAttrName(String value); /** * Returns the value of the '<em><b>Attr Value</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Attr Value</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Attr Value</em>' attribute. * @see #setAttrValue(String) * @see Library3.Library3Package#getAnyGenericAttribute_AttrValue() * @model dataType="org.eclipse.emf.ecore.xml.type.String" required="true" * @generated */ String getAttrValue(); /** * Sets the value of the '{@link Library3.AnyGenericAttribute#getAttrValue <em>Attr Value</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Attr Value</em>' attribute. * @see #getAttrValue() * @generated */ void setAttrValue(String value); } // AnyGenericAttribute
[ "neubauer@big.tuwien.ac.at" ]
neubauer@big.tuwien.ac.at
9c2310dc2079c6b1a499f039c6b95e61a7439fd8
42b1514b7dc0f11aee7c81768a791a79e1f35f5f
/data-factory-core/src/test/java/com/github/houbb/data/factory/core/api/data/primitive/ByteDataTest.java
ba860ebe12c96b5ab286e67fc4c17a82e91f579e
[ "Apache-2.0" ]
permissive
jiaAicoder/data-factory
2a20ebbfcd073f2f67d17511ee317d1a063788ad
7e9453c01c5a48eadc1329101b11121f7e7eba85
refs/heads/master
2023-07-13T02:40:34.377169
2021-08-23T07:24:12
2021-08-23T07:24:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
379
java
package com.github.houbb.data.factory.core.api.data.primitive; import org.junit.jupiter.api.Test; /** * <p> ByteData Tester. </p> * <p> 2019-02-26 16:20:40.497 </p> * * @author binbin.hou * @version 0.0.1-SNAPSHOT */ public class ByteDataTest { /** * * Method: build(context, booleanClass) */ @Test public void buildTest() throws Exception { } }
[ "1060732496@qq.com" ]
1060732496@qq.com
ca7c4cad2eeeb96aff20145c1be39e19570c9a8c
31a68a694120e47505a7b628a6b9f232618378e2
/peony-tancms/src/main/java/com/peony/peonyfront/event/model/Event.java
1f357e34ff9681a147aa0e4adbaa61750f40e307
[]
no_license
ganzhiping/peony-newTancms
1b02ad1f137c882147c756230e0cb28cbb7823ab
cf2eb49ea5728e9338138ada2c29f6853b95cffd
refs/heads/master
2021-01-16T21:29:55.002026
2018-03-23T02:15:10
2018-03-23T02:15:10
100,232,075
0
1
null
null
null
null
UTF-8
Java
false
false
1,392
java
package com.peony.peonyfront.event.model; import com.peony.core.base.pojo.BasePojo; public class Event extends BasePojo { private static final long serialVersionUID = 1L; private Integer eventid; private String eventname; private Integer parenteventid; private Integer status; private String eventArray; private Integer isPublic; public Integer getEventid() { return eventid; } public void setEventid(Integer eventid) { this.eventid = eventid; } public String getEventname() { return eventname; } public void setEventname(String eventname) { this.eventname = eventname; } public Integer getParenteventid() { return parenteventid; } public void setParenteventid(Integer parenteventid) { this.parenteventid = parenteventid; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getEventArray() { return eventArray; } public void setEventArray(String eventArray) { this.eventArray = eventArray; } public Integer getIsPublic() { return isPublic; } public void setIsPublic(Integer isPublic) { this.isPublic = isPublic; } }
[ "695203640@qq.com" ]
695203640@qq.com
4187daccb10905c1d2766604a5618d248468a774
6e57bdc0a6cd18f9f546559875256c4570256c45
/cts/tests/tests/media/src/android/media/cts/ToneGeneratorTest.java
91ff2f8ebc951b3064763c3a2cdcaa1db1bac166
[]
no_license
dongdong331/test
969d6e945f7f21a5819cd1d5f536d12c552e825c
2ba7bcea4f9d9715cbb1c4e69271f7b185a0786e
refs/heads/master
2023-03-07T06:56:55.210503
2020-12-07T04:15:33
2020-12-07T04:15:33
134,398,935
2
1
null
2022-11-21T07:53:41
2018-05-22T10:26:42
null
UTF-8
Java
false
false
1,326
java
/* * Copyright (C) 2009 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 android.media.cts; import android.media.AudioManager; import android.media.ToneGenerator; import android.platform.test.annotations.AppModeFull; import android.test.AndroidTestCase; @AppModeFull(reason = "TODO: evaluate and port to instant") public class ToneGeneratorTest extends AndroidTestCase { public void testSyncGenerate() throws Exception { ToneGenerator toneGen = new ToneGenerator(AudioManager.STREAM_RING, ToneGenerator.MAX_VOLUME); toneGen.startTone(ToneGenerator.TONE_PROP_BEEP2); final long DELAYED = 1000; Thread.sleep(DELAYED); toneGen.stopTone(); toneGen.release(); } }
[ "dongdong331@163.com" ]
dongdong331@163.com
f53f9e2a97ab35e4d46edefd7ab8a9a45b6b41cd
47ccecc546bba042c0416f3853602114c2d0f911
/src/main/java/com/adanac/module/blog/dynamic/RecordList.java
649af4ee73e22e973c18295c76c89832caed8ff0
[]
no_license
nackng/adanac-blog2
eb1b3d89794143d8f8d4eb547916e1ed14140a25
88d6a6d22219bd890bc30cc854ea1ad472bea7c5
refs/heads/master
2020-12-02T04:43:31.210325
2017-05-18T14:39:33
2017-05-18T14:39:33
66,923,057
1
0
null
null
null
null
UTF-8
Java
false
false
1,581
java
package com.adanac.module.blog.dynamic; /* * Copyright 2002-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import com.adanac.module.blog.freemarker.QuestionListHelper; import com.adanac.module.blog.freemarker.RecordHelper; import com.adanac.module.blog.freemarker.RecordListHelper; import com.adanac.module.blog.model.ViewMode; import com.adanac.module.blog.mvc.DataMap; import com.adanac.module.blog.mvc.Namespace; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Map; /** * @author adanac * @since 15/6/21 00:56 */ @Namespace("record") public class RecordList implements DataMap { @Override public void putCustomData(Map<String, Object> data, HttpServletRequest request, HttpServletResponse response) { Integer current = 1; if (request.getParameter("current") != null) { current = Integer.valueOf(request.getParameter("current")); } RecordListHelper.putDataMap(current, data, ViewMode.DYNAMIC); } }
[ "adanac@sina.com" ]
adanac@sina.com
1f51ff92de34aced060856b072ae7f0f0a440f0b
92b3c5ab7a2591bec9a5eeb907a1a70299f41375
/work/mmfoo_ok/src/com/ok/tags/GetFriendsByid.java
c91ee2b23104c5d636f2171bbd8e2da80c0fc3ec
[]
no_license
bigdog001/opensource_code
d394a3c3ca5bfe08cb5e3353aa5b74dcf8da12f9
0d03fba4ef9188fdbd702b00bc6229e404c1e7b3
refs/heads/master
2021-07-04T01:07:14.656470
2016-09-07T14:20:36
2016-09-07T14:20:36
17,190,145
0
1
null
null
null
null
UTF-8
Java
false
false
1,552
java
package com.ok.tags; import com.ok.bean.User; import com.ok.dao.UserDao; import com.ok.daoimpl.UserImpl; import org.apache.log4j.Logger; import org.springframework.context.ApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.TagSupport; import java.util.List; /** * Created by wangjiunian * User: Administrator * Date: 2011-5-24 * Time: 22:45:52 */ public class GetFriendsByid extends TagSupport { private static Logger logger = Logger.getLogger(GetFriendsByid.class); private int user_id; private int page; private int size; //根据给定的分页参数 取出我的前N位好友对象列表 public void setUser_id(int user_id) { this.user_id = user_id; } public void setPage(int page) { this.page = page; } public void setSize(int size) { this.size = size; } public int doStartTag() throws JspException { JspWriter out = pageContext.getOut(); ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(((HttpServletRequest)pageContext.getRequest()).getSession().getServletContext()); UserDao nd = (UserImpl) ctx.getBean("userdao"); List<User> users= nd.getMytopFriends(user_id,page,size); pageContext.getRequest().setAttribute("friendsbyid",users); return SKIP_PAGE; //忽略对标签体的处理 } }
[ "294356967@qq.com" ]
294356967@qq.com
e3f212afe70a577cc6244f5fe05ae81f955cec05
c7b70bfc62c76c6ee4c2c3dab1414c47f6af1754
/server/src/com/rs/game/player/actions/farming/v0_5/Farming.java
217cbd0f65e14d878be93ef6717bb67bbd4ccfef
[]
no_license
EnlistedGhost/MorrowRealm-v718
4459bb58f5ceb4dca8e4ef5ee7dcd55e57951a6b
8608210d1a3a3bd4374200ffe938fc56d071b554
refs/heads/master
2020-06-01T21:26:28.610346
2019-06-24T18:48:29
2019-06-24T18:48:29
190,932,255
2
1
null
null
null
null
UTF-8
Java
false
false
1,659
java
package com.rs.game.player.actions.farming.v0_5; import com.rs.game.Animation; import com.rs.game.player.Player; import com.rs.game.player.Skills; public class Farming { public static int RAKE = 5341; public static final Animation USERAKE = new Animation(2273); public enum patches { FLOWER_PATCH("Flower Patch", 1, 100, "rake"), HERB_PATCH("Herb Patch", 50, 200, "rake"), ALLOTMENT("Allotment", 75, 300, "rake"); private String patchType; private int level; private int xp; private String actionType; patches(String patchType, int level, int xp, String actionType) { this.patchType = patchType; this.level = level; this.xp = xp; this.actionType = actionType; } public String getPatchType() { return patchType; } public int getReqLevel() { return level; } public int getXp() { return xp; } public String getActionType() { return actionType; } } public static void startRake(Player player, String patch) { for (patches p : patches.values()) { if (p.patchType.equalsIgnoreCase(patch)) { if (player.getSkills().getLevel(Skills.FARMING) >= p.level) { if (p.actionType.equals("rake")) { if (player.getInventory().containsItem(RAKE, 1)) { player.lock(4); player.sm("You "+p.actionType+" the "+p.patchType+"."); player.setNextAnimation(USERAKE); player.getSkills().addXp(Skills.FARMING, p.xp); player.getGoals().increase(Skills.FARMING); } else { player.sm("You must first have a rake to farm this!"); } return; } } else { player.sm("You must have atleast "+p.level+" farming to "+p.actionType+" this!"); } } } } }
[ "enlisted.ghost@gmail.com" ]
enlisted.ghost@gmail.com
7c67c42c2dd955ab434acfc630c2885f24a6a591
89fd441aaae4f241fbac8915ea7607a03e605859
/src/net/genesishub/gFeaturesCanary/Plus/Skript/gEssentialsHub/Configure.java
5ed7ca8df8500404a67ee8dfd806dde801001600
[ "Apache-2.0" ]
permissive
GenesisHub/gFeatures
f9a5979765a4dafca4d5b8ad5c6532c70bcd7aad
718b83770cdf9dd251be3e55bbb6c69a0d55f9d0
refs/heads/master
2016-09-05T20:04:02.752527
2015-12-11T14:24:09
2015-12-11T14:24:09
33,052,981
1
2
null
null
null
null
UTF-8
Java
false
false
1,066
java
package net.genesishub.gFeatures.Plus.Skript.gEssentialsHub; import net.genesishub.gFeatures.Basic; import net.genesishub.gFeatures.Configs; import net.genesishub.gFeatures.Extension; import net.genesishub.gFeatures.ExtensionsType; /* gFeatures https://github.com/GenesisHub/gFeatures Copyright 2015 GenesisHub 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. */ public class Configure { @Configs public static void onSetup(){ Extension gCrates = new Extension("gEssentialsHub", "0.7-ALPHA", ExtensionsType.Skript); Basic.addExtension(gCrates); } }
[ "aguy867@gmail.com" ]
aguy867@gmail.com
cb98dc6157ef8a4854d3ede2d49360299c3689d2
5979994b215fabe125cd756559ef2166c7df7519
/aimir-mdms-iesco/src/main/java/org/multispeak/version_4/CircuitElementAndDistance.java
347a5b830b5c7275b064935eeadea05d7ed89bf0
[]
no_license
TechTinkerer42/Haiti
91c45cb1b784c9afc61bf60d43e1d5623aeba888
debaea96056d1d4611b79bd846af8f7484b93e6e
refs/heads/master
2023-04-28T23:39:43.176592
2021-05-03T10:49:42
2021-05-03T10:49:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,536
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.07.22 at 06:40:55 PM KST // package org.multispeak.version_4; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for circuitElementAndDistance complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="circuitElementAndDistance"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="circuitElement" type="{http://www.multispeak.org/Version_4.1_Release}circuitElement" minOccurs="0"/> * &lt;element name="distance" type="{http://www.multispeak.org/Version_4.1_Release}lengthUnitValue" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "circuitElementAndDistance", propOrder = { "circuitElement", "distance" }) public class CircuitElementAndDistance { protected CircuitElement circuitElement; protected LengthUnitValue distance; /** * Gets the value of the circuitElement property. * * @return * possible object is * {@link CircuitElement } * */ public CircuitElement getCircuitElement() { return circuitElement; } /** * Sets the value of the circuitElement property. * * @param value * allowed object is * {@link CircuitElement } * */ public void setCircuitElement(CircuitElement value) { this.circuitElement = value; } /** * Gets the value of the distance property. * * @return * possible object is * {@link LengthUnitValue } * */ public LengthUnitValue getDistance() { return distance; } /** * Sets the value of the distance property. * * @param value * allowed object is * {@link LengthUnitValue } * */ public void setDistance(LengthUnitValue value) { this.distance = value; } }
[ "marsr0913@nuritelecom.com" ]
marsr0913@nuritelecom.com
782093bd3fc7542c787c634922641df038f23dfb
d98de110431e5124ec7cc70d15906dac05cfa61a
/public/source/ors/src/main/java/org/marketcetera/ors/info/Messages.java
ec8cb6f51506b6556abcc5ace329efac04e50597
[]
no_license
dhliu3/marketcetera
367f6df815b09f366eb308481f4f53f928de4c49
4a81e931a044ba19d8f35bdadd4ab081edd02f5f
refs/heads/master
2020-04-06T04:39:55.389513
2012-01-30T06:49:25
2012-01-30T06:49:25
29,947,427
0
1
null
2015-01-28T02:54:39
2015-01-28T02:54:39
null
UTF-8
Java
false
false
1,541
java
package org.marketcetera.ors.info; import org.marketcetera.util.log.I18NLoggerProxy; import org.marketcetera.util.log.I18NMessage0P; import org.marketcetera.util.log.I18NMessage1P; import org.marketcetera.util.log.I18NMessage3P; import org.marketcetera.util.log.I18NMessageProvider; import org.marketcetera.util.misc.ClassVersion; /** * The internationalization constants used by this package. * * @author tlerios@marketcetera.com * @since 2.0.0 * @version $Id: Messages.java 10885 2009-11-17 19:22:56Z klim $ */ /* $License$ */ @ClassVersion("$Id: Messages.java 10885 2009-11-17 19:22:56Z klim $") public interface Messages { /** * The message provider. */ static final I18NMessageProvider PROVIDER= new I18NMessageProvider("ors_info"); //$NON-NLS-1$ /** * The logger. */ static final I18NLoggerProxy LOGGER= new I18NLoggerProxy(PROVIDER); /* * The messages. */ static final I18NMessage0P NULL_KEY= new I18NMessage0P(LOGGER,"null_key"); //$NON-NLS-1$ static final I18NMessage1P MISSING_VALUE= new I18NMessage1P(LOGGER,"missing_value"); //$NON-NLS-1$ static final I18NMessage1P NULL_VALUE= new I18NMessage1P(LOGGER,"null_value"); //$NON-NLS-1$ static final I18NMessage3P BAD_CLASS_VALUE= new I18NMessage3P(LOGGER,"bad_class_value"); //$NON-NLS-1$ static final I18NMessage3P VALUE_EXISTS= new I18NMessage3P(LOGGER,"value_exists"); //$NON-NLS-1$ }
[ "stevenshack@stevenshack.com" ]
stevenshack@stevenshack.com
06933613352b87c72ebad88c1b5970dd92e155ed
7a9746b5c57033dcbf8fbcaa305a483c8423b173
/src/test/java/dragon2/ItemList.java
8172e88f0e85295a6859e1fe7ed3789fdb903490
[]
no_license
piropiro/dragon2
6df21a01c65dfc91fddce303938fe19f3f0f165b
c89bd18b3c639de54894edc374974bc27f7305d3
refs/heads/master
2020-09-27T02:44:38.804859
2016-08-20T08:55:15
2016-08-20T08:55:15
66,137,895
0
0
null
null
null
null
UTF-8
Java
false
false
1,646
java
package dragon2; import java.util.Vector; import dragon2.Sort; import dragon2.Statics; import dragon2.common.Body; import mine.DataStream; import mine.io.BeanIO; public class ItemList { public ItemList() { } public static void main(String args[]) { Statics.setup(); Vector<Body> vector = new Vector<>(); Vector<Body> vector1 = new Vector<>(); for (int i = 0; i < 30; i++) { Vector<Body> vector2 = (Vector<Body>) BeanIO.read("data/body/E" + i + ".xml"); if (vector2 != null) { for (int j = 0; j < vector2.size(); j++) { Body body = (Body) vector2.elementAt(j); switch (body.getKind()) { case CLASS: // '\001' case WEPON: // '\002' case ARMOR: // '\003' case ITEM: // '\004' case DOLL: // '\'' add(vector, body); break; default: add(vector1, body); break; } } } } Vector vector3 = Sort.sort(vector); for (int k = 0; k < vector3.size(); k++) { Body body1 = (Body) vector3.elementAt(k); body1.setX(k % 20); body1.setY(k / 20); } for (int l = 0; l < vector1.size(); l++) { Body body2 = (Body) vector1.elementAt(l); body2.setX(l % 20); body2.setY(l / 20 + 8); } DataStream.write("data/E90.txt", vector3); DataStream.write("data/E91.txt", vector1); } private static void add(Vector vector, Body body) { for (int i = 0; i < vector.size(); i++) { Body body1 = (Body) vector.elementAt(i); if (body.getImg() == body1.getImg() && body1.getName().equals(body.getName())) return; } vector.add(body); } }
[ "mela825@gmail.com" ]
mela825@gmail.com
90ed9fb96532e55f320d28d00d9b18a014ad5434
1d64bf4b7cec44c8a12e4086ad2918e8df6dcc76
/SpringRelatedJars/spring-framework-2.0.5/dist/org/springframework/orm/hibernate3/SpringSessionContext.java
46ce9d64766d0195b285596caea6d9dc67bb84a4
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
XerO00/AllJarFiles
03472690fad55b5c2fcae530ac7de6294c54521e
d546337cfa29f4d33c3d3c5a4479a35063771612
refs/heads/master
2020-05-07T15:51:39.184855
2019-04-10T20:08:57
2019-04-10T20:08:57
180,655,268
0
0
null
null
null
null
UTF-8
Java
false
false
2,635
java
/* * Copyright 2002-2006 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.orm.hibernate3; import org.hibernate.HibernateException; import org.hibernate.classic.Session; import org.hibernate.context.CurrentSessionContext; import org.hibernate.engine.SessionFactoryImplementor; /** * Implementation of Hibernate 3.1's CurrentSessionContext interface * that delegates to Spring's SessionFactoryUtils for providing a * Spring-managed current Session. * * <p>Used by Spring's LocalSessionFactoryBean if told to not expose a * transaction-aware SessionFactory proxy. LocalSessionFactoryBean's default * is still SessionFactory proxying, though, mainly to remain compatible with * Hibernate 3.0 as well. Turn the "exposeTransactionAwareSessionFactory" flag * to "false" to expose the raw Hibernate 3.1 CurrentSessionContext mechanism. * * <p>This CurrentSessionContext implementation can be specified in custom * SessionFactory setup through the "hibernate.current_session_context_class" * property, with the fully qualified name of this class as value. * * @author Juergen Hoeller * @since 2.0 * @see SessionFactoryUtils#doGetSession * @see LocalSessionFactoryBean#setExposeTransactionAwareSessionFactory */ public class SpringSessionContext implements CurrentSessionContext { private final SessionFactoryImplementor sessionFactory; /** * Create a new SpringSessionContext for the given Hibernate SessionFactory. * @param sessionFactory the SessionFactory to provide current Sessions for */ public SpringSessionContext(SessionFactoryImplementor sessionFactory) { this.sessionFactory = sessionFactory; } /** * Retrieve the Spring-managed Session for the current thread, if any. */ public Session currentSession() throws HibernateException { try { return (org.hibernate.classic.Session) SessionFactoryUtils.doGetSession(this.sessionFactory, false); } catch (IllegalStateException ex) { throw new HibernateException(ex.getMessage()); } } }
[ "prasannadandhalkar1@gmail.com" ]
prasannadandhalkar1@gmail.com
839b074f6e8b3d3135fea8776d4f64100d134267
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_915c73da33b5501ddb78747be03a980a5e4ad402/ArchiveUtils/2_915c73da33b5501ddb78747be03a980a5e4ad402_ArchiveUtils_s.java
57661e0794b866c52500e9b4f97b980f345c317e
[]
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,489
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.deltaspike.test.util; import org.jboss.shrinkwrap.api.asset.Asset; import org.jboss.shrinkwrap.api.asset.StringAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; /** * This class contains helpers for building frequently used archives */ public class ArchiveUtils { private ArchiveUtils() { } public static JavaArchive[] getDeltaSpikeCoreAndSecurityArchive() { //X TODO remove this workaround - lightguard.jp We don't need the work around, we have to have the META-INF/beans.xml for all containers //boolean isOwbAvailable = ClassUtils.tryToLoadClassForName("org.apache.webbeans.spi.ContainerLifecycle") != null; String[] excludedFiles; //if (isOwbAvailable) //{ excludedFiles = new String[]{"META-INF.apache-deltaspike.properties"}; //} //else //{ // excludedFiles = new String[]{"META-INF.apache-deltaspike.properties", "META-INF.beans.xml"}; //} return ShrinkWrapArchiveUtil.getArchives(null, "META-INF/beans.xml", new String[]{"org.apache.deltaspike.core", "org.apache.deltaspike.security"}, excludedFiles); } public static Asset getBeansXml() { @SuppressWarnings("UnnecessaryLocalVariable") Asset beansXml = new StringAsset( "<beans>" + "<interceptors>" + "<class>org.apache.deltaspike.security.impl.authorization.SecurityInterceptor</class>" + "</interceptors>" + "</beans>" ); return beansXml; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
63a4e934441f5489c9c7af35e5dddb7ea3d52210
626038e91f2eba7d899d4d12e29b9dea354566cc
/src/main/java/io/github/microcks/jenkins/plugin/Messages.java
9aebac55e0532036c60d8883fc7d5e4e2bcf8a05
[ "Apache-2.0" ]
permissive
microcks/microcks-jenkins-plugin
2d305a0f4ade176a2390ab3380fe6fdba902a960
4cb7e588e6ded13ba242e8b940ec3978842df05f
refs/heads/master
2023-04-18T06:46:37.823307
2022-10-18T15:40:41
2022-10-18T15:40:41
99,902,351
9
2
Apache-2.0
2023-03-16T16:04:08
2017-08-10T08:53:46
Java
UTF-8
Java
false
false
1,445
java
/* * Licensed to Laurent Broudoux (the "Author") under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. Author 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 io.github.microcks.jenkins.plugin; /** * @author laurent */ public class Messages { public static final String EXIT_CONFIG_BAD = "\n\nExiting \"%s\" unsuccessfully; configuration is not correct: \"%s\""; public static final String EXIT_TEST_BAD = "\n\nExiting \"%s\" unsuccessfully; test \"%s\" did not complete successfully within the configured timeout of \"%s\" ms."; public static final String EXIT_TEST_GOOD = "\n\nExiting \"%s\" successfully; test \"%s\" has completed successfully with success."; public static final String START_TEST_RELATED_PLUGINS = "\n\nStarting the \"%s\" step with test config \"%s\"."; }
[ "laurent.broudoux@gmail.com" ]
laurent.broudoux@gmail.com
f0ce1ba0d592fa6d793b3c4b9be3e94866d50c1b
8ef2614cf5474b731a4cbe3dca0ddbc1e92b27b6
/src/com/lph/jianzhi/BianTaiStage.java
d2b5a0d4590d01d8e30fe23c0610255f43eff70b
[]
no_license
690074384/Algorithm
3a1110a6d55314785568b59643f3ad0916af851e
25e6cd1cb09214943f996d013dd48eb389fda3a6
refs/heads/master
2021-08-30T22:04:58.901054
2017-12-19T15:47:29
2017-12-19T15:47:29
109,276,834
0
0
null
null
null
null
UTF-8
Java
false
false
612
java
package com.lph.jianzhi; /** * 一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。求该青蛙跳上一个n级的台阶总共有多少种跳法。 */ public class BianTaiStage { public int JumpFloorII(int target) { int result = 1; if (target == 1) return 1; else if (target == 2) return 2; else return 2 * JumpFloorII(target - 1); } /** * 简单 * * @param target * @return */ public int JumpFloorII2(int target) { return 1 << (target - 1); } }
[ "690074384@qq.com" ]
690074384@qq.com
d7937b76681f62ae1c8bdfa706295bfabba26cf4
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/5/5_0b15d6eaef49133b484733a3b1d683481bcd4ab2/StockRepository/5_0b15d6eaef49133b484733a3b1d683481bcd4ab2_StockRepository_s.java
adefc41e596929fd6b5198972071a32086e0210e
[]
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
519
java
package devopsdistilled.operp.server.data.repo.stock; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import devopsdistilled.operp.server.data.entity.items.Item; import devopsdistilled.operp.server.data.entity.stock.Stock; import devopsdistilled.operp.server.data.entity.stock.Warehouse; @Repository public interface StockRepository extends JpaRepository<Stock, Long> { Stock findByItemAndWarehouse(Item item, Warehouse warehouse); }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
6e10bacafd67b33e82a8c92363357d9eafdf7faf
73a41271001ffde1223df992bd7a4a39b3eaeac9
/jpa/src/main/java/com/payno/jpa/base/entity/inherit/Flow.java
41921e29a42fed10ab5b195ff3e64a609b5c79fa
[]
no_license
BigPayno/SpringGuide
389d8e429c725f7cbb77a2570d21401a7a0ffd2d
b9f51463b5cb1fbf429656df8bbf584ca328e7f5
refs/heads/master
2022-12-11T05:21:07.360284
2020-06-01T03:39:22
2020-06-01T03:39:22
222,332,739
1
0
null
2022-06-17T03:30:24
2019-11-18T00:32:16
Java
UTF-8
Java
false
false
814
java
package com.payno.jpa.base.entity.inherit; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.hibernate.annotations.GenericGenerator; import javax.persistence.*; import java.util.Set; @NoArgsConstructor @Data @Builder @AllArgsConstructor @Entity(name = "Flow") @NamedEntityGraph(name = "Flow.Graph", attributeNodes = {@NamedAttributeNode("nodes")}) public class Flow { @Id @GeneratedValue(generator = "UUIDGenerator") @GenericGenerator(name = "UUIDGenerator", strategy = "com.payno.jpa.util.UUIDGenerator") private String flowId; private String flowCode; private String flowDefinition; private String localDate; private boolean needMessage; @OneToMany(mappedBy = "flowId") private Set<Node> nodes; }
[ "1361098889@qq.com" ]
1361098889@qq.com
da748ea7be5ffe062c9c6e9e6329ae6f6385552e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/1/1_743ac11a7aa546f3e1e12b26778d0c0e8eedcf4c/Workspace/1_743ac11a7aa546f3e1e12b26778d0c0e8eedcf4c_Workspace_t.java
b7f61d3c4520f62ba940f1abb2298c7fd8be9833
[]
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,028
java
package aQute.bnd.build; import java.io.*; import java.lang.ref.*; import java.util.*; import java.util.concurrent.*; import java.util.concurrent.locks.*; import java.util.jar.*; import javax.naming.*; import aQute.bnd.maven.support.*; import aQute.bnd.service.*; import aQute.bnd.service.action.*; import aQute.lib.deployer.*; import aQute.lib.io.*; import aQute.lib.osgi.*; public class Workspace extends Processor { public static final String BUILDFILE = "build.bnd"; public static final String CNFDIR = "cnf"; public static final String BNDDIR = "bnd"; public static final String CACHEDIR = "cache"; static Map<File, WeakReference<Workspace>> cache = newHashMap(); final Map<String, Project> models = newHashMap(); final Map<String, Action> commands = newMap(); final CachedFileRepo cachedRepo; final File buildDir; final Maven maven = new Maven(Processor.getExecutor()); /** * This static method finds the workspace and creates a project (or returns * an existing project) * * @param projectDir * @return */ public static Project getProject(File projectDir) throws Exception { projectDir = projectDir.getAbsoluteFile(); assert projectDir.isDirectory(); Workspace ws = getWorkspace(projectDir.getParentFile()); return ws.getProject(projectDir.getName()); } public static Workspace getWorkspace(File parent) throws Exception { File workspaceDir = parent.getAbsoluteFile(); // the cnf directory can actually be a // file that redirects while (workspaceDir.isDirectory()) { File test = new File(workspaceDir, CNFDIR); if (!test.exists()) test = new File(workspaceDir, BNDDIR); if (test.isDirectory()) break; if (test.isFile()) { String redirect = IO.collect(test).trim(); test = getFile(test.getParentFile(), redirect).getAbsoluteFile(); workspaceDir = test; } if (!test.exists()) throw new IllegalArgumentException("No Workspace found from: " + parent); } synchronized (cache) { WeakReference<Workspace> wsr = cache.get(workspaceDir); Workspace ws; if (wsr == null || (ws = wsr.get()) == null) { ws = new Workspace(workspaceDir); cache.put(workspaceDir, new WeakReference<Workspace>(ws)); } return ws; } } public Workspace(File dir) throws Exception { dir = dir.getAbsoluteFile(); dir.mkdirs(); assert dir.isDirectory(); File buildDir = new File(dir, BNDDIR).getAbsoluteFile(); if (!buildDir.isDirectory()) buildDir = new File(dir, CNFDIR).getAbsoluteFile(); this.buildDir = buildDir; File buildFile = new File(buildDir, BUILDFILE).getAbsoluteFile(); if (!buildFile.isFile()) warning("No Build File in " + dir); File extDir = new File(this.buildDir, "ext"); File[] extensions = extDir.listFiles(); if (extensions != null) { for (File extension : extensions) { if (extension.getName().endsWith(".bnd")) doIncludeFile(extension, true, getProperties()); } } setProperties(buildFile, dir); cachedRepo = new CachedFileRepo(); } public Project getProject(String bsn) throws Exception { synchronized (models) { Project project = models.get(bsn); if (project != null) return project; File projectDir = getFile(bsn); project = new Project(this, projectDir); if (!project.isValid()) return null; models.put(bsn, project); return project; } } public boolean isPresent(String name) { return models.containsKey(name); } public Collection<Project> getCurrentProjects() { return models.values(); } public boolean refresh() { if (super.refresh()) { for (Project project : getCurrentProjects()) { project.propertiesChanged(); } return true; } return false; } public String _workspace(String args[]) { return getBase().getAbsolutePath(); } public void addCommand(String menu, Action action) { commands.put(menu, action); } public void removeCommand(String menu) { commands.remove(menu); } public void fillActions(Map<String, Action> all) { all.putAll(commands); } public Collection<Project> getAllProjects() throws Exception { List<Project> projects = new ArrayList<Project>(); for (File file : getBase().listFiles()) { if (new File(file, Project.BNDFILE).isFile()) projects.add(getProject(file)); } return projects; } /** * Inform any listeners that we changed a file (created/deleted/changed). * * @param f * The changed file */ public void changedFile(File f) { List<BndListener> listeners = getPlugins(BndListener.class); for (BndListener l : listeners) try { l.changed(f); } catch (Exception e) { e.printStackTrace(); } } private void copy(InputStream in, OutputStream out) throws Exception { byte data[] = new byte[10000]; int size = in.read(data); while (size > 0) { out.write(data, 0, size); size = in.read(data); } } class CachedFileRepo extends FileRepo { final Lock lock = new ReentrantLock(); boolean inited; CachedFileRepo() { super("cache", getFile(buildDir, CACHEDIR), false); } protected void init() throws Exception { if (lock.tryLock(50, TimeUnit.SECONDS) == false) throw new TimeLimitExceededException( "Cached File Repo is locked and can't acquire it"); try { if (!inited) { inited = true; root.mkdirs(); if (!root.isDirectory()) throw new IllegalArgumentException("Cannot create cache dir " + root); InputStream in = getClass().getResourceAsStream(EMBEDDED_REPO); if (in != null) unzip(in, root); } } finally { lock.unlock(); } } void unzip(InputStream in, File dir) throws Exception { try { JarInputStream jin = new JarInputStream(in); JarEntry jentry = jin.getNextJarEntry(); while (jentry != null) { if (!jentry.isDirectory()) { File dest = Processor.getFile(dir, jentry.getName()); if (!dest.isFile() || dest.lastModified() < jentry.getTime() || jentry.getTime() == 0) { dest.getParentFile().mkdirs(); FileOutputStream out = new FileOutputStream(dest); try { copy(jin, out); } finally { out.close(); } } } jentry = jin.getNextJarEntry(); } } finally { in.close(); } } } public List<RepositoryPlugin> getRepositories() { return getPlugins(RepositoryPlugin.class); } public static Workspace getWorkspace(String path) throws Exception { File file = IO.getFile(new File(""), path); return getWorkspace(file); } public Maven getMaven() { return maven; } @Override protected void setTypeSpecificPlugins( Set<Object> list) { super.setTypeSpecificPlugins(list); list.add(maven); list.add(cachedRepo); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
f2065b39305a6483698053cc9c26256812a28f88
cca8a9526ca3bf6d113252fc9326c5bab090240a
/src/main/java/sp/spring/io/shop/common/entity/sql/info/OrderInfo.java
40177e0f06d7bf6b26b87450d98506325d631188
[]
no_license
sandeep-4/easy-shop-java
798c9f4e02661ca883a35922ca5cb692e938f6b9
c23ee742882f408a8d37907299419593303c29af
refs/heads/main
2023-06-12T19:39:19.491213
2021-07-06T06:26:17
2021-07-06T06:26:17
383,362,760
0
0
null
null
null
null
UTF-8
Java
false
false
1,419
java
package sp.spring.io.shop.common.entity.sql.info; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import lombok.ToString; @Getter @Setter @NoArgsConstructor @ToString @Entity public class OrderInfo { @Id @GeneratedValue(strategy= GenerationType.IDENTITY) private int id; private int customerId; private String timestamp; private String deliveryStatus; private String trackPackageLink; @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinColumn(name = "address_id", referencedColumnName = "id") private AddressInfo addressInfo; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "product_id") private OrderInfo orderInfo; public OrderInfo(int customerId, String timestamp, String deliveryStatus, String trackPackageLink, OrderInfo orderInfo) { this.customerId = customerId; this.timestamp = timestamp; this.deliveryStatus = deliveryStatus; this.trackPackageLink = trackPackageLink; this.orderInfo = orderInfo; } }
[ "shwandeep@gmail.com" ]
shwandeep@gmail.com
d554782e28c5625d93a1101086b5cbd6c4ba9f8d
0d60ddf97ec2b53572f5933054e899323d702840
/simple-stack/src/main/java/com/zhuinden/simplestack/navigator/ViewChangeHandler.java
5782a85a8dee082105218ddb4e6750f30125b0bd
[ "Apache-2.0" ]
permissive
matyj/simple-stack
0b42f344238e247e3e12087ee93d448925ba789a
272cb6346e18ec401fb5141782716940a67a6d14
refs/heads/master
2020-12-30T14:46:18.217098
2017-05-08T06:46:47
2017-05-08T06:46:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,847
java
/* * Copyright 2017 Gabor Varadi * * 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.zhuinden.simplestack.navigator; import android.support.annotation.NonNull; import android.view.View; import android.view.ViewGroup; /** * An interface that represents the view change when a state change occurs. * * Specified in {@link StateKey}, if {@link DefaultStateChanger} is used. */ public interface ViewChangeHandler { /** * It must be called to signal that the view change is complete. */ interface CompletionCallback { void onCompleted(); } /** * Perform the view change. The previous view must be removed from the container, and the new view must be added to the container. * When complete, the completion callback must be called. * * @param container the container for the views * @param previousView the previous view * @param newView the new view * @param direction the direction (from the StateChange) * @param completionCallback the callback that must be called when the view change is complete. */ void performViewChange(@NonNull final ViewGroup container, @NonNull final View previousView, @NonNull final View newView, final int direction, @NonNull final CompletionCallback completionCallback); }
[ "zhuinden@gmail.com" ]
zhuinden@gmail.com
101f0e23f5b5e07dd624fff60b0268984d2921ad
15274f5065c785297baba29934a1bc6052f64e29
/hw-gae-client_core/src/main/java/hu/hw/cloud/client/core/event/SetPageTitleEvent.java
f6c393f9a64441f21834ca047be4aa0b78e38c82
[ "Apache-2.0" ]
permissive
LetsCloud/hw-gae
e5196cc9f1c7744c341e6d34fda2bfc0100d82de
e4a55f8fe152ad588156942ddc28e852faf8ebcd
refs/heads/master
2018-11-04T03:43:23.338526
2018-10-06T20:36:14
2018-10-06T20:36:14
115,553,009
0
1
Apache-2.0
2018-10-06T20:36:15
2017-12-27T19:55:26
Java
UTF-8
Java
false
false
1,442
java
/** * */ package hu.hw.cloud.client.core.event; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.HasHandlers; import hu.hw.cloud.shared.cnst.MenuItemType; /** * @author CR * */ public class SetPageTitleEvent extends GwtEvent<SetPageTitleEvent.SetPageTitleHandler> { public interface SetPageTitleHandler extends EventHandler { void onSetPageTitle(SetPageTitleEvent event); } public static final Type<SetPageTitleHandler> TYPE = new Type<>(); private final String title; private final String description; private final MenuItemType menuItemType; public SetPageTitleEvent(String title, String description, MenuItemType menuItemType) { this.title = title; this.description = description; this.menuItemType = menuItemType; } public static void fire(String title, String description, MenuItemType menuItemType, HasHandlers source) { source.fireEvent(new SetPageTitleEvent(title, description, menuItemType)); } public String getTitle() { return title; } public String getDescription() { return description; } public MenuItemType getMenuItemType() { return menuItemType; } @Override public Type<SetPageTitleHandler> getAssociatedType() { return TYPE; } @Override protected void dispatch(SetPageTitleHandler handler) { handler.onSetPageTitle(this); } }
[ "csernikr@gmail.com" ]
csernikr@gmail.com
4c2ced30fa04b41e3ac78b2af5a94d8daf201de8
6c777cf936e7375f8f50f47124e58397e61971f3
/editor/src/main/java/yuku/ambilwarna/widget/AmbilWarnaPreference.java
7fb2705ec8fb685b8ca5cc347a19bdec54f79ce4
[]
no_license
thomaswp/platforge
ace1a3c8385b7b477d146ddd15cf89e868ba9355
067aab6cc31b3419596f7e42d28340db9ad82727
refs/heads/master
2021-01-18T13:53:31.231287
2015-01-02T03:53:22
2015-01-02T03:53:22
12,644,628
0
0
null
null
null
null
UTF-8
Java
false
false
3,673
java
package yuku.ambilwarna.widget; import com.platforge.editor.maker.R; import android.content.Context; import android.content.res.TypedArray; import android.os.Parcel; import android.os.Parcelable; import android.preference.Preference; import android.util.AttributeSet; import android.view.View; import yuku.ambilwarna.AmbilWarnaDialog; public class AmbilWarnaPreference extends Preference { int value; public AmbilWarnaPreference(Context context, AttributeSet attrs) { super(context, attrs); setWidgetLayoutResource(R.layout.ambilwarna_pref_widget); } @Override protected void onBindView(View view) { super.onBindView(view); // Set our custom views inside the layout final View kotak = view.findViewById(R.id.ambilwarna_pref_widget_kotak); if (kotak != null) { kotak.setBackgroundColor(value); } } @Override protected void onClick() { new AmbilWarnaDialog(getContext(), value, new AmbilWarnaDialog.OnAmbilWarnaListener() { @Override public void onOk(AmbilWarnaDialog dialog, int color) { if (!callChangeListener(color)) return; // They don't want the value to be set value = color; persistInt(value); notifyChanged(); } @Override public void onCancel(AmbilWarnaDialog dialog) { // nothing to do } }).show(); } public void forceSetValue(int value) { this.value = value; persistInt(value); notifyChanged(); } @Override protected Object onGetDefaultValue(TypedArray a, int index) { // This preference type's value type is Integer, so we read the default value from the attributes as an Integer. return a.getInteger(index, 0); } @Override protected void onSetInitialValue(boolean restoreValue, Object defaultValue) { if (restoreValue) { // Restore state value = getPersistedInt(value); } else { // Set state int value = (Integer) defaultValue; this.value = value; persistInt(value); } } /* * Suppose a client uses this preference type without persisting. We * must save the instance state so it is able to, for example, survive * orientation changes. */ @Override protected Parcelable onSaveInstanceState() { final Parcelable superState = super.onSaveInstanceState(); if (isPersistent()) return superState; // No need to save instance state since it's persistent final SavedState myState = new SavedState(superState); myState.value = value; return myState; } @Override protected void onRestoreInstanceState(Parcelable state) { if (!state.getClass().equals(SavedState.class)) { // Didn't save state for us in onSaveInstanceState super.onRestoreInstanceState(state); return; } // Restore the instance state SavedState myState = (SavedState) state; super.onRestoreInstanceState(myState.getSuperState()); this.value = myState.value; notifyChanged(); } /** * SavedState, a subclass of {@link BaseSavedState}, will store the state * of MyPreference, a subclass of Preference. * <p> * It is important to always call through to super methods. */ private static class SavedState extends BaseSavedState { int value; public SavedState(Parcel source) { super(source); value = source.readInt(); } @Override public void writeToParcel(Parcel dest, int flags) { super.writeToParcel(dest, flags); dest.writeInt(value); } public SavedState(Parcelable superState) { super(superState); } @SuppressWarnings("unused") public static final Parcelable.Creator<SavedState> CREATOR = new Parcelable.Creator<SavedState>() { public SavedState createFromParcel(Parcel in) { return new SavedState(in); } public SavedState[] newArray(int size) { return new SavedState[size]; } }; } }
[ "thomaswprice@msn.com" ]
thomaswprice@msn.com
15278ea669ecbc935952f1f3621ee89205314a5d
c4a14d70951d7ec5aac7fe7ebb2db891cfe6c0b1
/instalador/trunk/UpdaterFramework/updaterPlugin/src/main/java/com/localgis/maven/plugins/updater/DeployModMojo.java
41b50b86b9d8e0281ddacc254aa05ea801d1e8d5
[]
no_license
pepeysusmapas/allocalgis
925756321b695066775acd012f9487cb0725fcde
c14346d877753ca17339f583d469dbac444ffa98
refs/heads/master
2020-09-14T20:15:26.459883
2016-09-27T10:08:32
2016-09-27T10:08:32
null
0
0
null
null
null
null
WINDOWS-1252
Java
false
false
1,612
java
/** * DeployModMojo.java * © MINETUR, Government of Spain * This program is part of LocalGIS * 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, or (at your option) any later version. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.localgis.maven.plugins.updater; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; /** * * @author juacas * @goal deployMod */ public class DeployModMojo extends AbstractMojo { /** * The groupId of the artifact to download. Ignored if {@link #artifact} is used. * * @parameter expression="${project.groupId}" */ public String groupId = "com.localgis.modules"; /** * The artifactId of the artifact to download. Ignored if {@link #artifact} is used. * * @required * @parameter expression="${project.artifactId}" */ public String artifactId; public void execute() throws MojoExecutionException, MojoFailureException { // TODO Auto-generated method stub } }
[ "jorge.martin@cenatic.es" ]
jorge.martin@cenatic.es
2a003dd5ee8172b9e53f2cd1e1e937b25b578c4e
d5decb236da7da2bb8d123311207766b6a8435cf
/src/com/taobao/api/domain/DistributorArchive.java
3cf0471aa61882f6f34ea9973722b39f71cebad7
[]
no_license
tasfe/my-project-taobao-demo
85fee9861361e1e9ef4810f56aa5bbb3290ea216
f05a8141b6f3b23e88053bad4a12c8a138c2ef51
refs/heads/master
2021-01-13T01:30:17.440485
2013-02-16T08:38:02
2013-02-16T08:38:02
32,249,939
0
1
null
null
null
null
UTF-8
Java
false
false
2,413
java
package com.taobao.api.domain; import com.taobao.api.TaobaoObject; import com.taobao.api.internal.mapping.ApiField; /** * 分销商档案信息 * * @author auto create * @since 1.0, null */ public class DistributorArchive extends TaobaoObject { private static final long serialVersionUID = 5436235498192839361L; /** * 供应商授权分销商的产品的下载率。 率的值都是*10000后的,取值后直接除以100后加上%即可。比如12.33%,返回值是1233。 */ @ApiField("down_load_ratio") private String downLoadRatio; /** * 供应商在分销商店铺中的成交(已付款)订单笔数占比。 率的值都是*10000后的,取值后直接除以100后加上%即可。比如12.33%,返回值是1233。 */ @ApiField("order_shop_ratio") private String orderShopRatio; /** * 供应商授权分销商的产品的上架率。 率的值都是*10000后的,取值后直接除以100后加上%即可。比如12.33%,返回值是1233。 */ @ApiField("up_self_ratio") private String upSelfRatio; /** * 供应商在分销商店铺中的上架商品占比。 率的值都是*10000后的,取值后直接除以100后加上%即可。比如12.33%,返回值是1233。 */ @ApiField("up_shop_ratio") private String upShopRatio; /** * 供应商在分销商店铺中铺货商品UV占店铺商品总UV的比。 率的值都是*10000后的,取值后直接除以100后加上%即可。比如12.33%,返回值是1233。 */ @ApiField("uv_shop_ratio") private String uvShopRatio; public String getDownLoadRatio() { return this.downLoadRatio; } public void setDownLoadRatio(String downLoadRatio) { this.downLoadRatio = downLoadRatio; } public String getOrderShopRatio() { return this.orderShopRatio; } public void setOrderShopRatio(String orderShopRatio) { this.orderShopRatio = orderShopRatio; } public String getUpSelfRatio() { return this.upSelfRatio; } public void setUpSelfRatio(String upSelfRatio) { this.upSelfRatio = upSelfRatio; } public String getUpShopRatio() { return this.upShopRatio; } public void setUpShopRatio(String upShopRatio) { this.upShopRatio = upShopRatio; } public String getUvShopRatio() { return this.uvShopRatio; } public void setUvShopRatio(String uvShopRatio) { this.uvShopRatio = uvShopRatio; } }
[ "bingzhaoliu@gmail.com@28b099c3-0654-7635-3fca-eff556b9d3f2" ]
bingzhaoliu@gmail.com@28b099c3-0654-7635-3fca-eff556b9d3f2
3d5d31b2f50d27d91636a6934699335051011ebc
21c97e560417c64e4b72a5c22a35aae1cb9e7928
/frame-router-support/src/main/java/com/lvmoney/router/spring/RouterServiceHolder.java
0cf6c063926af49f3a1fbe1e92a67ae0f6c53c80
[]
no_license
lvmoney/frame
5680dedc556abbfe06089c8cd0e2e7f35a25fd06
69769ee0a83982e7fc49cab219f53bbeb955a870
refs/heads/master
2023-08-08T15:34:57.169564
2020-07-27T08:54:53
2020-07-27T08:54:53
194,578,286
10
4
null
2023-07-22T09:41:59
2019-07-01T01:14:18
JavaScript
UTF-8
Java
false
false
4,115
java
package com.lvmoney.router.spring; import java.lang.reflect.Method; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.lvmoney.router.config.PermissionValidatedConfig; import com.lvmoney.router.annotation.AuthenticationValidated; import com.lvmoney.router.annotation.ParamValidated; import com.lvmoney.router.annotation.PermissionValidated; import com.lvmoney.router.config.AuthenticationValidatedConfig; import com.lvmoney.router.config.RouterMethodConfig; import com.lvmoney.router.config.RouterServiceConfig; import com.lvmoney.router.config.ParamValidatedConfig; /** * @describe:根据定义的uri获得对应的接口实现方法 * @author: lvmoney /xxxx科技有限公司 * @version:v1.0 2018年12月29日 上午11:32:20 */ public class RouterServiceHolder { private static final Logger LOGGER = LoggerFactory.getLogger(RouterServiceHolder.class); public Map<String, RouterServiceConfig> serviceMap = new java.util.concurrent.ConcurrentHashMap<>(); private final String SPLIT = "."; private static class InstanceHolder { private static final RouterServiceHolder INSTANCE = new RouterServiceHolder(); } private RouterServiceHolder() { } public static final RouterServiceHolder getInstance() { return InstanceHolder.INSTANCE; } public void put(RouterServiceConfig service) { serviceMap.put(service.getPath(), service); if (LOGGER.isDebugEnabled()) { LOGGER.info("service {} mapping {} ", service.getClazz().getName(), service.getPath()); } } public RouterMethodConfig findMethodByUri(String uri) { if (StringUtils.isNotBlank(uri)) { String path = StringUtils.substringBeforeLast(uri, SPLIT); String methodName = StringUtils.substringAfterLast(uri, SPLIT); RouterServiceConfig service = serviceMap.get(path); if (service != null) { return service.getMethod(methodName); } } return null; } public ParamValidatedConfig findValidateByUri(String uri) { RouterMethodConfig routerMethodConfig = this.findMethodByUri(uri); // Annotation[] annotation = RouterMethodConfig.getMethod().getAnnotations(); // boolean isValidate=false; // for(Annotation annotation:annotation){ // if(annotation instanceof ValidateMethod){ // ValidateMethod ValidateMethod = (ValidateMethod)annotation; // isValidate = ValidateMethod.isValidate(); // break; // } // } boolean isValidate = false; Method method = routerMethodConfig.getMethod(); if (method.isAnnotationPresent(ParamValidated.class)) { ParamValidated paramValidated = method.getAnnotation(ParamValidated.class); isValidate = paramValidated.isValidate(); } return new ParamValidatedConfig(routerMethodConfig.getMethod(), isValidate); } public AuthenticationValidatedConfig findAuthenticationByUri(String uri) { RouterMethodConfig routerMethodConfig = this.findMethodByUri(uri); boolean isValidate = false; Method method = routerMethodConfig.getMethod(); if (method.isAnnotationPresent(AuthenticationValidated.class)) { AuthenticationValidated authValidated = method.getAnnotation(AuthenticationValidated.class); isValidate = authValidated.isValidate(); } return new AuthenticationValidatedConfig(routerMethodConfig.getMethod(), isValidate); } public PermissionValidatedConfig findPermissionByUri(String uri) { RouterMethodConfig routerMethodConfig = this.findMethodByUri(uri); String role = ""; Method method = routerMethodConfig.getMethod(); if (method.isAnnotationPresent(PermissionValidated.class)) { PermissionValidated permissionValidated = method.getAnnotation(PermissionValidated.class); role = permissionValidated.role(); } return new PermissionValidatedConfig(routerMethodConfig.getMethod(), role); } }
[ "xmangl1990728" ]
xmangl1990728
ea11248169b4d6d98eea3d73c5edda7a6935cde1
93f3578669fb0d0030a550316aebe0d7b4221631
/merchant-supplychain/src/main/java/cn/com/glsx/merchant/supplychain/vo/jxc/JXCTransferOrderQueryVo.java
ec92ad5f02117375ea7bc226f4b07d43602c2533
[]
no_license
shanghaif/supplychain
4d7de62809b6c88ac5080a85a77fc4bf3d856db8
c36c771b0304c5739de98bdfc322c0082a9e523d
refs/heads/master
2023-02-09T19:01:35.562699
2021-01-05T09:39:11
2021-01-05T09:39:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,048
java
package cn.com.glsx.merchant.supplychain.vo.jxc; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; /** * @author luoqiang * @version 1.0 * @program: supplychain * @description: * @date 2020/10/26 13:55 */ @SuppressWarnings("serial") public class JXCTransferOrderQueryVo implements Serializable { @ApiModelProperty(name = "inServiceProviderName", notes = "调入服务商名称", dataType = "string", required = false, example = "") private String inServiceProviderName; @ApiModelProperty(name = "transferType", notes = "调拨类型 IN:调入 OUT:调出", dataType = "string", required = false, example = "") private String transferType; @ApiModelProperty(name = "orderSource", notes = "发起方 GXS:广联商务 SMJ:服务商pc经销存 SMX:服务商JXC小程序", dataType = "string", required = false, example = "") private String orderSource; @ApiModelProperty(name = "materialName", notes = "物料名称/编码", dataType = "string", required = false, example = "") private String materialName; @ApiModelProperty(name = "orderStatus", notes = "调拨状态:WC:待审核,WS:待发货,PS:部分完成,FA:已完成,RB:审核驳回 ", dataType = "string", required = false, example = "") private String orderStatus; @ApiModelProperty(name = "pageNum", notes = "当前页", dataType = "int", required = true, example = "") private Integer pageNum; @ApiModelProperty(name = "pageSize", notes = "页面大小", dataType = "int", required = true, example = "") private Integer pageSize; public String getInServiceProviderName() { return inServiceProviderName; } public void setInServiceProviderName(String inServiceProviderName) { this.inServiceProviderName = inServiceProviderName; } public String getTransferType() { return transferType; } public void setTransferType(String transferType) { this.transferType = transferType; } public String getOrderSource() { return orderSource; } public void setOrderSource(String orderSource) { this.orderSource = orderSource; } public String getMaterialName() { return materialName; } public void setMaterialName(String materialName) { this.materialName = materialName; } public String getOrderStatus() { return orderStatus; } public void setOrderStatus(String orderStatus) { this.orderStatus = orderStatus; } public Integer getPageNum() { return pageNum; } public void setPageNum(Integer pageNum) { this.pageNum = pageNum; } public Integer getPageSize() { return pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } @Override public String toString() { return "JXCTransferOrderQueryVo{" + "inServiceProviderName='" + inServiceProviderName + '\'' + ", transferType='" + transferType + '\'' + ", orderSource='" + orderSource + '\'' + ", materialName='" + materialName + '\'' + ", orderStatus='" + orderStatus + '\'' + ", pageNum=" + pageNum + ", pageSize=" + pageSize + '}'; } }
[ "3064741443@qq.com" ]
3064741443@qq.com
6c632b673c55066e778c0db081962e90fa74b823
fb916e95bebd1a1cb556e62d2f530d2fde10adf7
/src/main/java/com/mint/cms/manager/impl/ApiInfoMngImpl.java
b1cafb22f23a77e247910a33a9e60abc657c1ece
[]
no_license
xrogzu/mint
9dfcdaf0ae4b8dcd3430025326fb2b16e4dab4f6
d1595d8e826b751915ad95b95715326216b4500a
refs/heads/master
2021-04-12T09:36:51.369502
2018-02-07T07:31:08
2018-02-07T07:31:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,710
java
package com.mint.cms.manager.impl; import com.mint.cms.dao.ApiInfoDao; import com.mint.cms.entity.ApiInfo; import com.mint.cms.manager.ApiInfoMng; import com.mint.common.hibernate4.Updater; import com.mint.common.page.Pagination; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @Service @Transactional public class ApiInfoMngImpl implements ApiInfoMng { private ApiInfoDao dao; @Transactional(readOnly = true) public Pagination getPage(int pageNo, int pageSize) { Pagination page = this.dao.getPage(pageNo, pageSize); return page; } @Transactional(readOnly = true) public ApiInfo findById(Long id) { ApiInfo entity = this.dao.findById(id); return entity; } public ApiInfo findByApiUrl(String apiUrl) { return this.dao.findByApiUrl(apiUrl); } public ApiInfo save(ApiInfo bean) { bean.init(); this.dao.save(bean); return bean; } public ApiInfo update(ApiInfo bean) { Updater updater = new Updater(bean); ApiInfo entity = this.dao.updateByUpdater(updater); return entity; } public ApiInfo deleteById(Long id) { ApiInfo bean = this.dao.deleteById(id); return bean; } public ApiInfo[] deleteByIds(Long[] ids) { ApiInfo[] beans = new ApiInfo[ids.length]; int i = 0; for (int len = ids.length; i < len; i++) { beans[i] = deleteById(ids[i]); } return beans; } @Autowired public void setDao(ApiInfoDao dao) { this.dao = dao; } }
[ "xushipeng@meizu.com" ]
xushipeng@meizu.com
1f0a2f3ab9e6e51eac32c9f09ed538738b280e1b
4a94a5e6b3464b0522abcbdd6071fc5026d8891d
/aliyun-java-sdk-openanalytics-open/src/main/java/com/aliyuncs/openanalytics_open/model/v20180619/GetEndPointRequest.java
9b733a54dd2c7ad09388cffd10d586dac546733d
[ "Apache-2.0" ]
permissive
ShanJiXin/aliyun-openapi-java-sdk
75128280237b995c5b6cc5e63bec53e902879470
e27bdd419f7771495c16b9107b1fff5e5272a8dc
refs/heads/master
2022-11-09T16:18:41.450862
2020-06-23T02:06:54
2020-06-23T02:06:54
274,295,253
0
0
NOASSERTION
2020-06-23T03:02:15
2020-06-23T03:02:15
null
UTF-8
Java
false
false
1,624
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.openanalytics_open.model.v20180619; import com.aliyuncs.RpcAcsRequest; import com.aliyuncs.http.MethodType; import com.aliyuncs.openanalytics_open.Endpoint; /** * @author auto create * @version */ public class GetEndPointRequest extends RpcAcsRequest<GetEndPointResponse> { private String endPointID; public GetEndPointRequest() { super("openanalytics-open", "2018-06-19", "GetEndPoint"); setMethod(MethodType.POST); try { com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap); com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType); } catch (Exception e) {} } public String getEndPointID() { return this.endPointID; } public void setEndPointID(String endPointID) { this.endPointID = endPointID; if(endPointID != null){ putBodyParameter("EndPointID", endPointID); } } @Override public Class<GetEndPointResponse> getResponseClass() { return GetEndPointResponse.class; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
27bdc3627f9ddf611ccec8b34e937582a2cce978
5312711301c7289b1d318a73a966684ba836c01b
/CoreJavaSamples/src/com/joe/net/ReadContentsFromUrl.java
0d2e2029419d59110698ba7764a11b73cd0b88a7
[]
no_license
xiaojunshcn/CoreJavaSamples
260f72982e09d1ab1cb9c53d8684e50c06126324
4855d13ee2e481e7205b5d295db09eb7a6d4d3c6
refs/heads/master
2021-01-19T20:03:09.823522
2017-04-21T06:38:08
2017-04-21T06:38:08
88,477,786
0
0
null
null
null
null
UTF-8
Java
false
false
1,789
java
package com.joe.net; import java.io.DataInputStream; import java.net.URL; import java.net.URLConnection; /** * 两种方式读取URL的内容 * * @author JoeXIAO * */ public class ReadContentsFromUrl { public static void main(String[] args) { methodUrl(); System.out.println("---------------"); methodURLConnection(); } private static void methodUrl() { try { //when in an intranet, this 2 lines are required // System.setProperty("http.proxyHost", "proxy.jpn.hp.com"); // System.setProperty("http.proxyPort", "8080"); // 根据参数args[0])构造一个绝对的URL对象 URL url = new URL("http://www.baidu.com/"); // 通过URL对象打开一个数据输入流 DataInputStream dis = new DataInputStream(url.openStream()); String inputLine; while ((inputLine = dis.readLine()) != null) { System.out.println(inputLine); } dis.close(); } catch (Exception e) { e.printStackTrace(); } } private static void methodURLConnection() { try { // when in an intranet, this 2 lines are required // System.setProperty("http.proxyHost", "proxy.jpn.hp.com"); // System.setProperty("http.proxyPort", "8080"); // 根据绝对URL地址构造URL对象 URL cumtURL = new URL("http://www.baidu.com"); // 利用cumtURL建立一个URLconnection连接 URLConnection cumtConnection = cumtURL.openConnection(); // 获取cumtConnection对象的数据输入流 DataInputStream din = new DataInputStream(cumtConnection.getInputStream()); String inputLine; while ((inputLine = din.readLine()) != null) { System.out.println(inputLine); } din.close(); } catch (Exception e) { e.printStackTrace(); } } }
[ "xiaojunshcn@gmail.com" ]
xiaojunshcn@gmail.com
38bd5e1d88b7af2144609b1dbdade2e21a85f212
54a24781a7a09311456cb685f63f0e6d2bab4bab
/src/l1j/server/server/model/Instance/L1TrapInstance.java
869159395d6e8176a4613fa0ddd10aac43c23f33
[]
no_license
crazyidol9/L1J-KR_3.80
b1c2d849a0daad99fd12166611e82b6804d2b26d
43c5da32e1986082be6f1205887ffc4538baa2c6
refs/heads/master
2021-08-16T13:50:50.570172
2017-11-20T01:20:52
2017-11-20T01:20:52
111,041,969
0
0
null
2017-11-17T01:24:24
2017-11-17T01:24:24
null
UTF-8
Java
false
false
3,767
java
/* * 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, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * 02111-1307, USA. * * http://www.gnu.org/copyleft/gpl.html */ package l1j.server.server.model.Instance; import java.util.List; import java.util.Random; import java.util.concurrent.CopyOnWriteArrayList; import l1j.server.server.model.L1Location; import l1j.server.server.model.L1Object; import l1j.server.server.model.map.L1Map; import l1j.server.server.model.skill.L1SkillId; import l1j.server.server.model.trap.L1Trap; import l1j.server.server.serverpackets.S_RemoveObject; import l1j.server.server.serverpackets.S_Trap; import l1j.server.server.types.Point; public class L1TrapInstance extends L1Object { /** * */ private static final long serialVersionUID = 1L; private final L1Trap _trap; private final Point _baseLoc = new Point(); private final Point _rndPt = new Point(); private int _trapDoorId; private final int _span; private boolean _isEnable = true; private final String _nameForView; private List<L1PcInstance> _knownPlayers = new CopyOnWriteArrayList<L1PcInstance>(); private static final Random _random = new Random(System.nanoTime()); public L1TrapInstance(int id, L1Trap trap, L1Location loc, Point rndPt, int span, int trapDoorId) { setId(id); _trap = trap; _trapDoorId = trapDoorId; getLocation().set(loc); _baseLoc.set(loc); _rndPt.set(rndPt); _span = span; _nameForView = "trap"; resetLocation(); } public L1TrapInstance(int id, L1Location loc) { setId(id); _trap = L1Trap.newNull(); getLocation().set(loc); _span = 0; _nameForView = "trap base"; } public void resetLocation() { if (_rndPt.getX() == 0 && _rndPt.getY() == 0) { return; } L1Map map = null; for (int i = 0; i < 50; i++) { int rndX = _random.nextInt(_rndPt.getX() + 1) * (_random.nextInt(2) == 1 ? 1 : -1); int rndY = _random.nextInt(_rndPt.getY() + 1) * (_random.nextInt(2) == 1 ? 1 : -1); rndX += _baseLoc.getX(); rndY += _baseLoc.getY(); map = getLocation().getMap(); if (map.isInMap(rndX, rndY) && map.isPassable(rndX, rndY)) { getLocation().set(rndX, rndY); break; } } } public void enableTrap() { _isEnable = true; } public void disableTrap() { _isEnable = false; for (L1PcInstance pc : _knownPlayers) { if (pc == null) continue; pc.getNearObjects().removeKnownObject(this); pc.sendPackets(new S_RemoveObject(this)); } _knownPlayers.clear(); } public boolean isEnable() { return _isEnable; } public int getSpan() { return _span; } public int getTrapDoorId() { return _trapDoorId; } public void onTrod(L1PcInstance trodFrom) { _trap.onTrod(trodFrom, this); } public void onDetection(L1PcInstance caster) { _trap.onDetection(caster, this); } @Override public void onPerceive(L1PcInstance perceivedFrom) { if (perceivedFrom == null) return; if (perceivedFrom.getSkillEffectTimerSet().hasSkillEffect( L1SkillId.GMSTATUS_SHOWTRAPS)) { perceivedFrom.getNearObjects().addKnownObject(this); perceivedFrom.sendPackets(new S_Trap(this, _nameForView)); _knownPlayers.add(perceivedFrom); } } }
[ "wantedgaming.net@gmail.com" ]
wantedgaming.net@gmail.com
247b105b3fcf4ec13f474d1bd4590056a699e343
2f165622d142eeab5b342d92afda8c756b27e2bd
/server/src/intercept/logging/ConsoleApplicationLog.java
6b6340b71e70a7ab43e199f221a5d69596b5aa89
[ "Apache-2.0" ]
permissive
hsiboy/intercept
6da7cafd831d7a071a939c6ecca6b2b99fc38638
9a24f08133941821cb081b7e3e5e7368f82531b0
refs/heads/master
2020-12-25T09:28:24.148168
2012-03-13T20:25:24
2012-03-13T20:25:24
3,981,584
0
1
null
null
null
null
UTF-8
Java
false
false
400
java
package intercept.logging; public class ConsoleApplicationLog implements ApplicationLog { private boolean verbose = false; public void log(String message) { System.out.println(message); } public void trace(String message) { if (verbose) { System.out.println(message); } } public void setVerbose() { this.verbose = true; } }
[ "graham@grahambrooks.com" ]
graham@grahambrooks.com