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
68602b023f92a07504d152401e780f1a0fb46ba2
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/checkstyle_cluster/12453/tar_2.java
0d7b0086aeca9c05ca465cff0c10a130c9d84d16
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,547
java
//////////////////////////////////////////////////////////////////////////////// // checkstyle: Checks Java source code for adherence to a set of rules. // Copyright (C) 2001-2005 Oliver Burn // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //////////////////////////////////////////////////////////////////////////////// package com.puppycrawl.tools.checkstyle.checks.imports; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * Represents the result of an access check. * * @author Oliver Burn */ final class AccessResult implements Serializable { /** Numeric value for access result ALLOWED. */ private static final int CODE_ALLOWED = 10; /** Numeric value for access result DISALLOWED. */ private static final int CODE_DISALLOWED = 20; /** Numeric value for access result UNKNOWN. */ private static final int CODE_UNKNOWN = 30; /** Label for access result ALLOWED. */ private static final String LABEL_ALLOWED = "ALLOWED"; /** Label for access result DISALLOWED. */ private static final String LABEL_DISALLOWED = "DISALLOWED"; /** Label for access result UNKNOWN. */ private static final String LABEL_UNKNOWN = "UNKNOWN"; /** Represents that access is allowed. */ public static final AccessResult ALLOWED = new AccessResult(CODE_ALLOWED, LABEL_ALLOWED); /** Represents that access is disallowed. */ public static final AccessResult DISALLOWED = new AccessResult( CODE_DISALLOWED, LABEL_DISALLOWED); /** Represents that access is unknown. */ public static final AccessResult UNKNOWN = new AccessResult(CODE_UNKNOWN, LABEL_UNKNOWN); /** map from results names to the respective result */ private static final Map NAME_TO_LEVEL = new HashMap(); static { NAME_TO_LEVEL.put(LABEL_ALLOWED, ALLOWED); NAME_TO_LEVEL.put(LABEL_DISALLOWED, DISALLOWED); NAME_TO_LEVEL.put(LABEL_UNKNOWN, UNKNOWN); } /** Code for the access result. */ private final int mCode; /** Label for the access result. */ private final String mLabel; /** * Constructs an instance. * * @param aCode the code for the result. * @param aLabel the label for the result. */ private AccessResult(final int aCode, final String aLabel) { mCode = aCode; mLabel = aLabel.trim(); } /** * @return the label for the result. */ String getLabel() { return mLabel; } /** {@inheritDoc} */ public String toString() { return getLabel(); } /** {@inheritDoc} */ public boolean equals(Object aObj) { boolean result = false; if ((aObj instanceof AccessResult) && (((AccessResult) aObj).mCode == this.mCode)) { result = true; } return result; } /** {@inheritDoc} */ public int hashCode() { return mCode; } /** * SeverityLevel factory method. * * @param aName access result name. * @return the {@link AccessResult} associated with the supplied name. */ public static AccessResult getInstance(String aName) { // canonicalize argument final String arName = aName.trim(); final AccessResult retVal = (AccessResult) NAME_TO_LEVEL.get(arName); if (retVal == null) { throw new IllegalArgumentException(arName); } return retVal; } /** * Ensures that we don't get multiple instances of one SeverityLevel * during deserialization. See Section 3.6 of the Java Object * Serialization Specification for details. * * @return the serialization replacement object */ private Object readResolve() { return getInstance(mLabel); } }
[ "375833274@qq.com" ]
375833274@qq.com
ed3d3a72c25eb624b3d0a7091234e969297083cd
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-ocr/src/main/java/com/aliyuncs/ocr/model/v20191230/RecognizeDriverLicenseResponse.java
739f12ac87caa5181a7cd3318ecd58625b5d3501
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
3,718
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.ocr.model.v20191230; import com.aliyuncs.AcsResponse; import com.aliyuncs.ocr.transform.v20191230.RecognizeDriverLicenseResponseUnmarshaller; import com.aliyuncs.transform.UnmarshallerContext; /** * @author auto create * @version */ public class RecognizeDriverLicenseResponse extends AcsResponse { private String requestId; private Data data; public String getRequestId() { return this.requestId; } public void setRequestId(String requestId) { this.requestId = requestId; } public Data getData() { return this.data; } public void setData(Data data) { this.data = data; } public static class Data { private FaceResult faceResult; private BackResult backResult; public FaceResult getFaceResult() { return this.faceResult; } public void setFaceResult(FaceResult faceResult) { this.faceResult = faceResult; } public BackResult getBackResult() { return this.backResult; } public void setBackResult(BackResult backResult) { this.backResult = backResult; } public static class FaceResult { private String name; private String licenseNumber; private String vehicleType; private String startDate; private String endDate; private String issueDate; private String address; private String gender; public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getLicenseNumber() { return this.licenseNumber; } public void setLicenseNumber(String licenseNumber) { this.licenseNumber = licenseNumber; } public String getVehicleType() { return this.vehicleType; } public void setVehicleType(String vehicleType) { this.vehicleType = vehicleType; } public String getStartDate() { return this.startDate; } public void setStartDate(String startDate) { this.startDate = startDate; } public String getEndDate() { return this.endDate; } public void setEndDate(String endDate) { this.endDate = endDate; } public String getIssueDate() { return this.issueDate; } public void setIssueDate(String issueDate) { this.issueDate = issueDate; } public String getAddress() { return this.address; } public void setAddress(String address) { this.address = address; } public String getGender() { return this.gender; } public void setGender(String gender) { this.gender = gender; } } public static class BackResult { private String archiveNumber; public String getArchiveNumber() { return this.archiveNumber; } public void setArchiveNumber(String archiveNumber) { this.archiveNumber = archiveNumber; } } } @Override public RecognizeDriverLicenseResponse getInstance(UnmarshallerContext context) { return RecognizeDriverLicenseResponseUnmarshaller.unmarshall(this, context); } @Override public boolean checkShowJsonItemName() { return false; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
7053f439749a612c87fd80128dd8da9520f9f955
5b8337c39cea735e3817ee6f6e6e4a0115c7487c
/sources/com/google/api/client/googleapis/services/CommonGoogleClientRequestInitializer.java
3b229216894bc5ed85ac64c42c6f1b543f209a90
[]
no_license
karthik990/G_Farm_Application
0a096d334b33800e7d8b4b4c850c45b8b005ccb1
53d1cc82199f23517af599f5329aa4289067f4aa
refs/heads/master
2022-12-05T06:48:10.513509
2020-08-10T14:46:48
2020-08-10T14:46:48
286,496,946
1
0
null
null
null
null
UTF-8
Java
false
false
4,079
java
package com.google.api.client.googleapis.services; import java.io.IOException; public class CommonGoogleClientRequestInitializer implements GoogleClientRequestInitializer { private static final String REQUEST_REASON_HEADER_NAME = "X-Goog-Request-Reason"; private static final String USER_PROJECT_HEADER_NAME = "X-Goog-User-Project"; private final String key; private final String requestReason; private final String userAgent; private final String userIp; private final String userProject; public static class Builder { private String key; private String requestReason; private String userAgent; private String userIp; private String userProject; /* access modifiers changed from: protected */ public Builder self() { return this; } public Builder setKey(String str) { this.key = str; return self(); } public String getKey() { return this.key; } public Builder setUserIp(String str) { this.userIp = str; return self(); } public String getUserIp() { return this.userIp; } public Builder setUserAgent(String str) { this.userAgent = str; return self(); } public String getUserAgent() { return this.userAgent; } public Builder setRequestReason(String str) { this.requestReason = str; return self(); } public String getRequestReason() { return this.requestReason; } public Builder setUserProject(String str) { this.userProject = str; return self(); } public String getUserProject() { return this.userProject; } public CommonGoogleClientRequestInitializer build() { return new CommonGoogleClientRequestInitializer(this); } protected Builder() { } } @Deprecated public CommonGoogleClientRequestInitializer() { this(newBuilder()); } @Deprecated public CommonGoogleClientRequestInitializer(String str) { this(str, null); } @Deprecated public CommonGoogleClientRequestInitializer(String str, String str2) { this(newBuilder().setKey(str).setUserIp(str2)); } protected CommonGoogleClientRequestInitializer(Builder builder) { this.key = builder.getKey(); this.userIp = builder.getUserIp(); this.userAgent = builder.getUserAgent(); this.requestReason = builder.getRequestReason(); this.userProject = builder.getUserProject(); } public static Builder newBuilder() { return new Builder(); } public void initialize(AbstractGoogleClientRequest<?> abstractGoogleClientRequest) throws IOException { String str = this.key; if (str != null) { abstractGoogleClientRequest.put("key", (Object) str); } String str2 = this.userIp; if (str2 != null) { abstractGoogleClientRequest.put("userIp", (Object) str2); } if (this.userAgent != null) { abstractGoogleClientRequest.getRequestHeaders().setUserAgent(this.userAgent); } if (this.requestReason != null) { abstractGoogleClientRequest.getRequestHeaders().set(REQUEST_REASON_HEADER_NAME, (Object) this.requestReason); } if (this.userProject != null) { abstractGoogleClientRequest.getRequestHeaders().set(USER_PROJECT_HEADER_NAME, (Object) this.userProject); } } public final String getKey() { return this.key; } public final String getUserIp() { return this.userIp; } public final String getUserAgent() { return this.userAgent; } public final String getRequestReason() { return this.requestReason; } public final String getUserProject() { return this.userProject; } }
[ "knag88@gmail.com" ]
knag88@gmail.com
5d925fc51cd1fc50de476d27f33268c3564a45be
dc654f1fd11552b97fb062c0c7384017d9a96e66
/app/src/main/java/com/qlckh/chunlvv/common/SendThread.java
49f5a9504a6f9766506b3240fe79a4fd468df1c1
[]
no_license
AndyAls/chulvv
efef7d09d8567d9dacfd091b8a86dc2aa0171f81
7b832883683195e8b25d684b984a902cc4a9dbcb
refs/heads/master
2021-06-20T01:33:21.591074
2019-10-11T02:52:02
2019-10-11T02:52:02
207,237,043
0
0
null
null
null
null
UTF-8
Java
false
false
5,112
java
package com.qlckh.chunlvv.common; import android.os.Handler; import android.os.Message; import android.util.Log; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.net.Socket; import java.util.ArrayList; /** * @author Andy * @date 2018/8/18 15:11 * Desc: */ public class SendThread implements Runnable { private String ip; private int port; BufferedReader in; PrintWriter out; //打印流 Handler mainHandler; Socket s; private String receiveMsg; ArrayList<String> list = new ArrayList<String>(); public SendThread(String ip,int port, Handler mainHandler) { //IP,端口,数据 this.ip = ip; this.port=port; this.mainHandler = mainHandler; } /** * 套接字的打开 */ void open(){ try { s = new Socket(ip, port); //in收单片机发的数据 in = new BufferedReader(new InputStreamReader(s.getInputStream())); out = new PrintWriter(new BufferedWriter(new OutputStreamWriter( s.getOutputStream())), true); } catch (IOException e) { e.printStackTrace(); } } /** * 套接字的关闭 */ void close(){ try { s.close(); } catch (IOException e) { e.printStackTrace(); } } @Override public void run() { //创建套接字 open(); //BufferedReader Thread thread = new Thread(new Runnable() { @Override public void run() { while (true) { try { Thread.sleep(200); close(); open(); } catch (InterruptedException e1) { e1.printStackTrace(); } if (!s.isClosed()) { if (s.isConnected()) { if (!s.isInputShutdown()) { try { Log.i("mr", "等待接收信息"); char[] chars = new char[1024]; //byte[] bys = new byte[1024]; int len = 0; //int len = 0; while((len = in.read(chars)) != -1){ //while((len = in.read(bys)) != -1) { System.out.println("收到的消息: "+new String(chars, 0, len)); in.read(chars,0,len); receiveMsg = new String(chars, 0, len); // } Message msg=mainHandler.obtainMessage(); msg.what=0x00; msg.obj=receiveMsg; mainHandler.sendMessage(msg); } } catch (IOException e) { Log.i("mr", e.getMessage()); try { s.shutdownInput(); s.shutdownOutput(); s.close(); } catch (IOException e1) { e1.printStackTrace(); } e.printStackTrace(); } } } } } } }); thread.start(); while (true) { //连接中 if (!s.isClosed()&&s.isConnected()&&!s.isInputShutdown()) { // 如果消息集合有东西,并且发送线程在工作。 if (list.size() > 0 && !s.isOutputShutdown()) { out.println(list.get(0)); list.remove(0); } Message msg=mainHandler.obtainMessage(); msg.what=0x01; mainHandler.sendMessage(msg); } else { //连接中断了 Log.i("mr", "连接断开了"); Message msg=mainHandler.obtainMessage(); msg.what=0x02; mainHandler.sendMessage(msg); } try { Thread.sleep(200); } catch (InterruptedException e) { try { out.close(); in.close(); s.close(); } catch (IOException e1) { e1.printStackTrace(); } e.printStackTrace(); } } } public void send(String msg) { System.out.println("msg的值为: " + msg); list.add(msg); } }
[ "andy_als@163.com" ]
andy_als@163.com
a13819b94d28a8de77e4537a182f01c19978fae7
3bc62f2a6d32df436e99507fa315938bc16652b1
/dmServer/src/main/java/com/intellij/dmserver/libraries/BundleWrapper.java
8baf20291d4329519bcd28532c211da4cf244f71
[ "Apache-2.0" ]
permissive
JetBrains/intellij-obsolete-plugins
7abf3f10603e7fe42b9982b49171de839870e535
3e388a1f9ae5195dc538df0d3008841c61f11aef
refs/heads/master
2023-09-04T05:22:46.470136
2023-06-11T16:42:37
2023-06-11T16:42:37
184,035,533
19
29
Apache-2.0
2023-07-30T14:23:05
2019-04-29T08:54:54
Java
UTF-8
Java
false
false
1,682
java
package com.intellij.dmserver.libraries; import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.vfs.JarFileSystem; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.Nullable; import org.jetbrains.osgi.jps.build.CachingBundleInfoProvider; /** * @author michael.golubev */ public final class BundleWrapper extends BundleDefinition { private static final Logger LOG = Logger.getInstance(BundleWrapper.class); @NonNls private static final String MANIFEST_PATH = "META-INF/MANIFEST.MF"; @Nullable public static BundleWrapper load(VirtualFile jarFile) { String path = jarFile.getPath(); if (!CachingBundleInfoProvider.isBundle(path)) { return null; } VirtualFile bundleRoot = jarFile.isDirectory() ? jarFile : JarFileSystem.getInstance().getJarRootForLocalFile(jarFile); VirtualFile manifestFile = bundleRoot == null ? null : bundleRoot.findFileByRelativePath(MANIFEST_PATH); if (manifestFile == null) { LOG.error("Manifest is expected to exist"); } return new BundleWrapper(CachingBundleInfoProvider.getBundleSymbolicName(path), CachingBundleInfoProvider.getBundleVersion(path), jarFile, manifestFile); } private final VirtualFile myJarFile; private final VirtualFile myManifestFile; private BundleWrapper(String symbolicName, String version, VirtualFile jarFile, VirtualFile manifestFile) { super(symbolicName, version); myJarFile = jarFile; myManifestFile = manifestFile; } public VirtualFile getJarFile() { return myJarFile; } public VirtualFile getManifestFile() { return myManifestFile; } }
[ "yuriy.artamonov@jetbrains.com" ]
yuriy.artamonov@jetbrains.com
1e2990b5d4658633a497d48278e169c2f45fff5d
c52026fd7a1825d950a7ab08c1c918cb0fe851d8
/src/main/java/com/vasit/uaa/security/jwt/JWTFilter.java
a6cadd04df1e981c58b7978f83366d9b14ceb1f4
[]
no_license
juntong/uaa
3e7da6bb108127a72163e1609cb36746f4ad3d9c
5a9beed15a2beab0ca7240e97a9efbaca6ca336b
refs/heads/main
2023-04-08T22:36:16.772760
2021-04-19T06:19:43
2021-04-19T06:19:43
359,350,193
0
0
null
null
null
null
UTF-8
Java
false
false
1,845
java
package com.vasit.uaa.security.jwt; import java.io.IOException; import javax.servlet.FilterChain; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.util.StringUtils; import org.springframework.web.filter.GenericFilterBean; /** * Filters incoming requests and installs a Spring Security principal if a header corresponding to a valid user is * found. */ public class JWTFilter extends GenericFilterBean { public static final String AUTHORIZATION_HEADER = "Authorization"; private final TokenProvider tokenProvider; public JWTFilter(TokenProvider tokenProvider) { this.tokenProvider = tokenProvider; } @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest; String jwt = resolveToken(httpServletRequest); if (StringUtils.hasText(jwt) && this.tokenProvider.validateToken(jwt)) { Authentication authentication = this.tokenProvider.getAuthentication(jwt); SecurityContextHolder.getContext().setAuthentication(authentication); } filterChain.doFilter(servletRequest, servletResponse); } private String resolveToken(HttpServletRequest request) { String bearerToken = request.getHeader(AUTHORIZATION_HEADER); if (StringUtils.hasText(bearerToken) && bearerToken.startsWith("Bearer ")) { return bearerToken.substring(7); } return null; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
cd31f7a3bc808285c636b164fc8a6b8a714bc9ed
75623123ed599ebfc18c131b0c72b54f41689c32
/src/java/it/csi/gescovid/acquistiapi/dto/test/Asr.java
b821183ebfbea85a2308da18b68fab0a8943fc8b
[]
no_license
regione-piemonte/gescovid19-acquistiapi
3e37381b8077e328fc16fff27c9b3c2a518af6e4
b54a6518dabd041b15107f32e114862905397dd1
refs/heads/master
2022-12-25T22:37:47.905887
2020-09-30T15:39:28
2020-09-30T15:39:28
299,950,678
0
1
null
null
null
null
UTF-8
Java
false
false
1,852
java
package it.csi.gescovid.acquistiapi.dto.test; import java.util.Objects; import java.util.ArrayList; import java.util.HashMap; import java.math.BigDecimal; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.annotate.JsonCreator; import javax.validation.constraints.*; public class Asr { // verra' utilizzata la seguente strategia serializzazione degli attributi: [explicit-as-modeled] private BigDecimal codice = null; private String nome = null; /** * il codice identificativo della ASR **/ @JsonProperty("codice") public BigDecimal getCodice() { return codice; } public void setCodice(BigDecimal codice) { this.codice = codice; } /** * il nome dell&#39;AS **/ @JsonProperty("nome") public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Asr asr = (Asr) o; return Objects.equals(codice, asr.codice) && Objects.equals(nome, asr.nome); } @Override public int hashCode() { return Objects.hash(codice, nome); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Asr {\n"); sb.append(" codice: ").append(toIndentedString(codice)).append("\n"); sb.append(" nome: ").append(toIndentedString(nome)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "raffaelam74@gmail.com" ]
raffaelam74@gmail.com
849ccb132047e3e29378a539797c94e0c55c3c9a
94a8865e16d7b5b8cec605df2462c665026ec59f
/app/src/main/java/com/example/haoji/FloatView/DragView.java
a37093b8c79bc7ce57f9bf5d2c77603419855125
[]
no_license
wuhoulang/Mvp_build2
bf80fbeaf2751bba93a8522c04222e19a8d9f91b
4dafd34a0bb268053b3bef2d307844167154f969
refs/heads/master
2020-09-20T23:59:23.164942
2019-11-28T10:32:22
2019-11-28T10:32:22
224,622,560
0
0
null
null
null
null
UTF-8
Java
false
false
4,789
java
package com.example.haoji.FloatView; import android.animation.ObjectAnimator; import android.annotation.SuppressLint; import android.content.Context; import android.os.Handler; import android.os.Message; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.WindowManager; import android.widget.ImageView; import com.example.haoji.utils.ScreenUtil; import static android.view.FrameMetrics.ANIMATION_DURATION; /** * Created by HAOJI on 2019/8/16. */ @SuppressLint("AppCompatCustomView") public class DragView extends ImageView{ private int width; private int height; private int screenWidth; private int screenHeight; private int KscreenWidth; private int KscreenHeight; private Context context; //是否拖动 private boolean isDrag=false; public boolean isDrag() { return isDrag; } public DragView(Context context) { super(context); this.context=context; } public DragView(Context context, AttributeSet attrs) { super(context, attrs); this.context=context; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, heightMeasureSpec); width=getMeasuredWidth(); height=getMeasuredHeight(); screenWidth= ScreenUtil.getScreenWidth(context); screenHeight=ScreenUtil.getScreenHeight(context)-getStatusBarHeight(); } public int getStatusBarHeight(){ int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); return getResources().getDimensionPixelSize(resourceId); } private float downX; private float downY; private float mTouchStartX; private float mTouchStartY; @Override public boolean onTouchEvent(MotionEvent event) { super.onTouchEvent(event); if (this.isEnabled()) { KscreenWidth= (int) event.getRawX(); KscreenHeight= (int) event.getRawY(); Log.e("Kscreen","KscreenWidth:"+KscreenWidth); Log.e("Kscreen","KscreenHeight:"+KscreenHeight); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: isDrag=false; downX = event.getX(); downY = event.getY(); mTouchStartX = event.getRawX(); mTouchStartY = event.getRawY(); Log.e("kid","ACTION_MOVE"); break; case MotionEvent.ACTION_MOVE: setAlpha(0.5f); Log.e("kid","ACTION_MOVE"); final float xDistance = event.getX() - downX; final float yDistance = event.getY() - downY; int l,r,t,b; //当水平或者垂直滑动距离大于10,才算拖动事件 if (Math.abs(xDistance) >10 ||Math.abs(yDistance)>10) { Log.e("kid","Drag"); isDrag=true; l = (int) (getLeft() + xDistance); r = l+width; t = (int) (getTop() + yDistance); b = t+height; //不划出边界判断,此处应按照项目实际情况,因为本项目需求移动的位置是手机全屏, // 所以才能这么写,如果是固定区域,要得到父控件的宽高位置后再做处理 if(l<0){ l=0; r=l+width; }else if(r>screenWidth){ r=screenWidth; l=r-width; } if(t<0){ t=0; b=t+height; }else if(b>screenHeight){ b=screenHeight; t=b-height; } this.layout(l, t, r, b); } break; case MotionEvent.ACTION_UP: setAlpha(1.0f); Log.e("Kscreen","screenWidth:"+screenWidth/2); if(KscreenWidth<screenWidth/2){ ObjectAnimator.ofFloat(this,"translationX",KscreenWidth-downX,0).setDuration(500).start(); } // setPressed(false); break; case MotionEvent.ACTION_CANCEL: setPressed(false); break; } return true; } return false; } }
[ "1022845861@qq.com" ]
1022845861@qq.com
71a2883d7f0acc5fdd69bfc0427a2a673ede245c
434112393389f4c03a5ae87ec402b94f8cef36c4
/PAYMAT2/app/src/main/java/com/example/paymat/about.java
f80391487a56f61cf6f138a65caf8411630648e1
[]
no_license
NOEL365/paymat
f30315ece6e506022e452d05d3bec1021c56cb73
5308eed69f87ad736f9bc0265fceccc5c5093c0f
refs/heads/master
2020-06-22T15:04:23.028003
2019-07-19T08:37:14
2019-07-19T08:37:14
197,734,455
0
0
null
null
null
null
UTF-8
Java
false
false
326
java
package com.example.paymat; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; public class about extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); } }
[ "you@example.com" ]
you@example.com
9bebb4d89ffdcd6a1439993a5aa6cd0c516a3c85
90eb7a131e5b3dc79e2d1e1baeed171684ef6a22
/sources/p298d/p299a/p300a/p301a/p303y0/p391i/C7207n.java
2dcb895f10cfb2df0d4ddb6a88d3450fff0258d6
[]
no_license
shalviraj/greenlens
1c6608dca75ec204e85fba3171995628d2ee8961
fe9f9b5a3ef4a18f91e12d3925e09745c51bf081
refs/heads/main
2023-04-20T13:50:14.619773
2021-04-26T15:45:11
2021-04-26T15:45:11
361,799,768
0
0
null
null
null
null
UTF-8
Java
false
false
673
java
package p298d.p299a.p300a.p301a.p303y0.p391i; import p298d.p299a.p300a.p301a.p303y0.p304b.C6023b; import p298d.p299a.p300a.p301a.p303y0.p304b.C6046e; import p298d.p299a.p300a.p301a.p303y0.p304b.C6219q; import p298d.p344x.p345b.C6862l; /* renamed from: d.a.a.a.y0.i.n */ public final class C7207n implements C6862l<C6023b, Boolean> { /* renamed from: g */ public final /* synthetic */ C6046e f14443g; public C7207n(C6046e eVar) { this.f14443g = eVar; } public Object invoke(Object obj) { C6023b bVar = (C6023b) obj; return Boolean.valueOf(!C6219q.m11193e(bVar.getVisibility()) && C6219q.m11194f(bVar, this.f14443g)); } }
[ "73280944+shalviraj@users.noreply.github.com" ]
73280944+shalviraj@users.noreply.github.com
c748c54e238f047aeaf0964e8fb28d5926efb979
54f352a242a8ad6ff5516703e91da61e08d9a9e6
/Source Codes/AtCoder/arc063/A/1187721.java
5e722db6d7fa7565ef6663604a9cd533183f05ea
[]
no_license
Kawser-nerd/CLCDSA
5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb
aee32551795763b54acb26856ab239370cac4e75
refs/heads/master
2022-02-09T11:08:56.588303
2022-01-26T18:53:40
2022-01-26T18:53:40
211,783,197
23
9
null
null
null
null
UTF-8
Java
false
false
330
java
import java.util.*; public class Main { static Scanner s = new Scanner(System.in); public static void main(String __[]){ solve(s.next()); } private static final void solve(String s) { int count=0; for(int i=1;i<s.length();i++) if(s.charAt(i)!=s.charAt(i-1)) count++; System.out.println(count); } }
[ "kwnafi@yahoo.com" ]
kwnafi@yahoo.com
965747aa22debd5769e53cdb9299bd6acc6484a3
d74c2ca437a58670dc8bfbf20a3babaecb7d0bea
/SAP_858310_lines/Source - 963k/js.webservices.lib/dev/src/_tc~je~webservices_lib/java/com/sap/engine/services/webservices/jaxr/impl/uddi_v2/types/getbindingdetail.java
d1b5836e816870ed388015d5f6609b945fd4d311
[]
no_license
javafullstackstudens/JAVA_SAP
e848e9e1a101baa4596ff27ce1aedb90e8dfaae8
f1b826bd8a13d1432e3ddd4845ac752208df4f05
refs/heads/master
2023-06-05T20:00:48.946268
2021-06-30T10:07:39
2021-06-30T10:07:39
381,657,064
0
0
null
null
null
null
UTF-8
Java
false
false
4,343
java
 package com.sap.engine.services.webservices.jaxr.impl.uddi_v2.types; /** * Schema complex type representation (generated by SAP Schema to Java generator). * Represents schema complex type {urn:uddi-org:api_v2}get_bindingDetail */ public class GetBindingDetail extends com.sap.engine.services.webservices.jaxrpc.encoding.GeneratedComplexType { public java.lang.String _d_originalUri() { return "urn:uddi-org:api_v2"; } public java.lang.String _d_originalLocalName() { return "get_bindingDetail"; } private static com.sap.engine.services.webservices.jaxrpc.encoding.AttributeInfo[] ATTRIBUTEINFO; private synchronized static void initAttribs() { // Creating attribute fields if (ATTRIBUTEINFO != null) return; ATTRIBUTEINFO = new com.sap.engine.services.webservices.jaxrpc.encoding.AttributeInfo[1]; ATTRIBUTEINFO[0] = new com.sap.engine.services.webservices.jaxrpc.encoding.AttributeInfo(); // Attribute 0 ATTRIBUTEINFO[0].fieldLocalName = "generic"; ATTRIBUTEINFO[0].fieldUri = ""; ATTRIBUTEINFO[0].fieldJavaName = "Generic"; ATTRIBUTEINFO[0].typeName = "string"; ATTRIBUTEINFO[0].typeUri = "http://www.w3.org/2001/XMLSchema"; ATTRIBUTEINFO[0].typeJavaName = "java.lang.String"; ATTRIBUTEINFO[0].defaultValue = null; ATTRIBUTEINFO[0].required = true; ATTRIBUTEINFO[0].setterMethod = "setGeneric"; ATTRIBUTEINFO[0].getterMethod = "getGeneric"; ATTRIBUTEINFO[0].checkMethod = "hasGeneric"; } // Field information private static com.sap.engine.services.webservices.jaxrpc.encoding.FieldInfo[] FIELDINFO; private synchronized static void initFields() { // Creating fields if (FIELDINFO != null) return; FIELDINFO = new com.sap.engine.services.webservices.jaxrpc.encoding.FieldInfo[1]; FIELDINFO[0] = new com.sap.engine.services.webservices.jaxrpc.encoding.FieldInfo(); // Field 0 FIELDINFO[0].defaultValue = null; FIELDINFO[0].fieldJavaName = "BindingKey"; FIELDINFO[0].fieldLocalName = "bindingKey"; FIELDINFO[0].fieldModel = 1; FIELDINFO[0].fieldUri = "urn:uddi-org:api_v2"; FIELDINFO[0].isSoapArray = false; FIELDINFO[0].maxOccurs = 2147483647; FIELDINFO[0].minOccurs = 1; FIELDINFO[0].nillable = false; FIELDINFO[0].soapArrayDimensions = 0; FIELDINFO[0].soapArrayItemTypeJavaName = null; FIELDINFO[0].soapArrayItemTypeLocalName = null; FIELDINFO[0].soapArrayItemTypeUri = null; FIELDINFO[0].typeJavaName = "java.lang.String"; FIELDINFO[0].typeLocalName = "bindingKey"; FIELDINFO[0].typeUri = "urn:uddi-org:api_v2"; FIELDINFO[0].getterMethod = "getBindingKey"; FIELDINFO[0].setterMethod = "setBindingKey"; FIELDINFO[0].checkMethod = "hasBindingKey"; } // Returns model Group Type public int _getModelType() { return 3; } // Attribute field private java.lang.String _a_Generic; private boolean _a_hasGeneric; // set method public void setGeneric(java.lang.String _Generic) { this._a_Generic = _Generic; this._a_hasGeneric = true; } // clear method public void clearGeneric(java.lang.String _Generic) { this._a_hasGeneric = false; } // get method public java.lang.String getGeneric() { return _a_Generic; } // has method public boolean hasGeneric() { return _a_hasGeneric; } // Element field private java.lang.String[] _f_BindingKey = new java.lang.String[0]; public void setBindingKey(java.lang.String[] _BindingKey) { this._f_BindingKey = _BindingKey; } public java.lang.String[] getBindingKey() { return _f_BindingKey; } private static boolean init = false; public synchronized com.sap.engine.services.webservices.jaxrpc.encoding.FieldInfo[] _getFields() { if (init == false) { com.sap.engine.services.webservices.jaxrpc.encoding.FieldInfo[] parent = super._getFields(); FIELDINFO = _insertFieldInfo(parent,FIELDINFO); init = true; } return FIELDINFO; } public int _getNumberOfFields() { return (FIELDINFO.length+super._getNumberOfFields()); } public com.sap.engine.services.webservices.jaxrpc.encoding.AttributeInfo[] _getAttributes() { return ATTRIBUTEINFO; } public int _getNumberOfAttributes() { return ATTRIBUTEINFO.length; } static { initFields(); initAttribs(); } }
[ "Yalin.Arie@checkmarx.com" ]
Yalin.Arie@checkmarx.com
0fefc12fe4ad908d686c7792f46020f335e83d51
e861c6590f6ece5e3c31192e2483c4fa050d0545
/app/src/main/java/plugin/android/ss/com/testsettings/settings/datetime/TimeFormatPreferenceController.java
d981f25612c8f49aafb7496f150a5ab3499cf79b
[]
no_license
calm-sjf/TestSettings
fc9a9c466f007d5eac6b4acdf674cd2e0cffb9a1
fddbb049542ff8423bdecb215b71dbdcc143930c
refs/heads/master
2023-03-22T02:46:23.057328
2020-12-10T07:37:27
2020-12-10T07:37:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,731
java
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package plugin.android.ss.com.testsettings.settings.datetime; import android.content.Context; import android.content.Intent; import android.provider.Settings; import android.support.v14.preference.SwitchPreference; import android.support.v7.preference.Preference; import android.support.v7.preference.TwoStatePreference; import android.text.TextUtils; import android.text.format.DateFormat; import com.android.settings.core.PreferenceControllerMixin; import com.android.settingslib.core.AbstractPreferenceController; import java.util.Calendar; import java.util.Date; public class TimeFormatPreferenceController extends AbstractPreferenceController implements PreferenceControllerMixin { static final String HOURS_12 = "12"; static final String HOURS_24 = "24"; private static final String KEY_TIME_FORMAT = "24 hour"; // Used for showing the current date format, which looks like "12/31/2010", "2010/12/13", etc. // The date value is dummy (independent of actual date). private final Calendar mDummyDate; private final boolean mIsFromSUW; private final UpdateTimeAndDateCallback mUpdateTimeAndDateCallback; public TimeFormatPreferenceController(Context context, UpdateTimeAndDateCallback callback, boolean isFromSUW) { super(context); mIsFromSUW = isFromSUW; mDummyDate = Calendar.getInstance(); mUpdateTimeAndDateCallback = callback; } @Override public boolean isAvailable() { return !mIsFromSUW; } @Override public void updateState(Preference preference) { if (!(preference instanceof TwoStatePreference)) { return; } preference.setEnabled( !AutoTimeFormatPreferenceController.isAutoTimeFormatSelection(mContext)); ((TwoStatePreference) preference).setChecked(is24Hour()); final Calendar now = Calendar.getInstance(); mDummyDate.setTimeZone(now.getTimeZone()); // We use December 31st because it's unambiguous when demonstrating the date format. // We use 13:00 so we can demonstrate the 12/24 hour options. mDummyDate.set(now.get(Calendar.YEAR), 11, 31, 13, 0, 0); final Date dummyDate = mDummyDate.getTime(); preference.setSummary(DateFormat.getTimeFormat(mContext).format(dummyDate)); } @Override public boolean handlePreferenceTreeClick(Preference preference) { if (!(preference instanceof TwoStatePreference) || !TextUtils.equals(KEY_TIME_FORMAT, preference.getKey())) { return false; } final boolean is24Hour = ((SwitchPreference) preference).isChecked(); update24HourFormat(mContext, is24Hour); mUpdateTimeAndDateCallback.updateTimeAndDateDisplay(mContext); return true; } @Override public String getPreferenceKey() { return KEY_TIME_FORMAT; } private boolean is24Hour() { return DateFormat.is24HourFormat(mContext); } static void update24HourFormat(Context context, Boolean is24Hour) { set24Hour(context, is24Hour); timeUpdated(context, is24Hour); } static void timeUpdated(Context context, Boolean is24Hour) { Intent timeChanged = new Intent(Intent.ACTION_TIME_CHANGED); timeChanged.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); int timeFormatPreference; if (is24Hour == null) { timeFormatPreference = Intent.EXTRA_TIME_PREF_VALUE_USE_LOCALE_DEFAULT; } else { timeFormatPreference = is24Hour ? Intent.EXTRA_TIME_PREF_VALUE_USE_24_HOUR : Intent.EXTRA_TIME_PREF_VALUE_USE_12_HOUR; } timeChanged.putExtra(Intent.EXTRA_TIME_PREF_24_HOUR_FORMAT, timeFormatPreference); context.sendBroadcast(timeChanged); } static void set24Hour(Context context, Boolean is24Hour) { String value = is24Hour == null ? null : is24Hour ? HOURS_24 : HOURS_12; Settings.System.putString(context.getContentResolver(), Settings.System.TIME_12_24, value); } }
[ "xiaoxiaoyu@bytedance.com" ]
xiaoxiaoyu@bytedance.com
ea51e1d5ce1d64f4fda0dc4140f213d0c654dbc3
3b6d6f30b455f70918b3b4bde34732a134312138
/simple-stack-mortar-sample/src/main/java/com/example/mortar/screen/ChatScreen.java
bb07bc20df98fd93897e6054817ef031df125b29
[ "Apache-2.0" ]
permissive
ninjahoahong/simple-stack
19b24452c7da34953abfd4e3c9679b564e91acf8
ab40d30d26d0d90c5d17acc14b992840c5d8bb76
refs/heads/master
2021-04-27T19:06:21.058395
2018-07-17T13:15:12
2018-07-17T13:15:12
122,350,608
0
0
Apache-2.0
2018-02-21T15:01:08
2018-02-21T15:01:08
null
UTF-8
Java
false
false
6,387
java
/* * Copyright 2013 Square Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.example.mortar.screen; import android.support.annotation.Nullable; import android.util.Log; import com.example.mortar.R; import com.example.mortar.android.ActionBarOwner; import com.example.mortar.core.SingletonComponent; import com.example.mortar.model.Chat; import com.example.mortar.model.Chats; import com.example.mortar.model.Message; import com.example.mortar.util.BaseKey; import com.example.mortar.util.DaggerService; import com.example.mortar.util.Subscope; import com.example.mortar.util.ViewPresenter; import com.example.mortar.view.ChatView; import com.example.mortar.view.Confirmation; import com.google.auto.value.AutoValue; import com.zhuinden.servicetree.ServiceTree; import com.zhuinden.simplestack.navigator.Navigator; import com.zhuinden.statebundle.StateBundle; import javax.inject.Inject; import dagger.Provides; import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposables; import io.reactivex.functions.Action; import io.reactivex.observers.DisposableObserver; import mortar.PopupPresenter; @AutoValue public abstract class ChatScreen extends BaseKey { public abstract int conversationIndex(); public static ChatScreen create(int conversationIndex) { return new AutoValue_ChatScreen(conversationIndex); } @Override public void bindServices(ServiceTree.Node node) { SingletonComponent singletonComponent = DaggerService.get(node); node.bindService(DaggerService.SERVICE_NAME, // DaggerChatScreen_Component.builder() // .singletonComponent(singletonComponent) // .module(new Module(conversationIndex())) // .build()); node.bindService("PRESENTER", DaggerService.<Component>get(node).presenter()); // <-- for Bundleable callback } @Override public int layout() { return R.layout.chat_view; } @dagger.Component(dependencies = {SingletonComponent.class}, modules = {Module.class}) @Subscope public interface Component extends SingletonComponent { Presenter presenter(); void inject(ChatView chatView); } @dagger.Module public static class Module { private final int conversationIndex; public Module(int conversationIndex) { this.conversationIndex = conversationIndex; } @Provides Chat conversation(Chats chats) { return chats.getChat(conversationIndex); } } @Subscope public static class Presenter extends ViewPresenter<ChatView> implements ServiceTree.Scoped { private final Chat chat; private final ActionBarOwner actionBar; private final PopupPresenter<Confirmation, Boolean> confirmer; private Disposable running = Disposables.empty(); @Inject public Presenter(Chat chat, ActionBarOwner actionBar) { this.chat = chat; this.actionBar = actionBar; this.confirmer = new PopupPresenter<Confirmation, Boolean>() { @Override protected void onPopupResult(Boolean confirmed) { if(confirmed) { Presenter.this.getView().toast("Haven't implemented that, friend."); } } }; } @Override public void dropView(ChatView view) { confirmer.dropView(view.getConfirmerPopup()); super.dropView(view); } @Override public void onLoad(@Nullable StateBundle savedInstanceState) { if(!hasView()) { return; } ActionBarOwner.Config actionBarConfig = actionBar.getConfig(); actionBarConfig = actionBarConfig.withAction(new ActionBarOwner.MenuAction("End", new Action() { @Override public void run() { confirmer.show(new Confirmation("End Chat", "Do you really want to leave this chat?", "Yes", "I guess not")); } })); actionBar.setConfig(actionBarConfig); confirmer.takeView(getView().getConfirmerPopup()); running = chat.getMessages().subscribeWith(new DisposableObserver<Message>() { @Override public void onComplete() { Log.w(getClass().getName(), "That's surprising, never thought this should end."); running = Disposables.empty(); } @Override public void onError(Throwable e) { Log.w(getClass().getName(), "'sploded, will try again on next config change."); Log.w(getClass().getName(), e); running = Disposables.empty(); } @Override public void onNext(Message message) { if(!hasView()) { return; } getView().getItems().add(message); } }); } @Override public void onExitScope() { ensureStopped(); } public void onConversationSelected(int position) { Navigator.getBackstack(getView().getContext()).goTo(MessageScreen.create(chat.getId(), position)); } public void visibilityChanged(boolean visible) { if(!visible) { ensureStopped(); } } private void ensureStopped() { running.dispose(); } } @Override public String title() { return "Chat"; } }
[ "zhuinden@gmail.com" ]
zhuinden@gmail.com
2ace1e7aed2d7693499ca979d8e5d8348aa1b84d
964601fff9212bec9117c59006745e124b49e1e3
/matos-midp-msa/src/main/java/javax/crypto/NoSuchPaddingException.java
51f0be0f65c18de47e67120018ec82fdc2600262
[ "Apache-2.0" ]
permissive
vadosnaprimer/matos-profiles
bf8300b04bef13596f655d001fc8b72315916693
fb27c246911437070052197aa3ef91f9aaac6fc3
refs/heads/master
2020-05-23T07:48:46.135878
2016-04-05T13:14:42
2016-04-05T13:14:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
991
java
package javax.crypto; /* * #%L * Matos * $Id:$ * $HeadURL:$ * %% * Copyright (C) 2004 - 2014 Orange SA * %% * 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.francetelecom.rd.stubs.annotation.ClassDone; @ClassDone public class NoSuchPaddingException extends java.security.GeneralSecurityException{ // Fields // Methods public NoSuchPaddingException(){ return; } public NoSuchPaddingException(String msg){ return; } }
[ "pierre.cregut@orange.com" ]
pierre.cregut@orange.com
a6443911ca68bfe70c74510b1416e336c7c8bbba
f7f29b8c8a8b997ecd8ae3009d17bd7cd42317f8
/35 - IOCProj35-SpringBeanLife-DeclarativeApproach/src/main/java/com/nt/test/SpringBeanLifeCycleTest_BF.java
2561591e33b178c88ce0dd182cd44c3ccf2e97be
[]
no_license
PraveenJavaWorld/Spring
802244885ec9f4e5710a5af630e47621c1c6d973
d4f987b987f2a8b142440c992114ecb66aec3412
refs/heads/master
2023-05-29T08:06:25.273785
2021-06-11T16:18:35
2021-06-11T16:18:35
315,967,988
1
0
null
null
null
null
UTF-8
Java
false
false
795
java
package com.nt.test; import org.springframework.beans.factory.support.DefaultListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanDefinitionReader; import com.nt.beans.VoterEligibilityChecking; public class SpringBeanLifeCycleTest_BF { public static void main(String[] args) { //create IOC Container DefaultListableBeanFactory factory = new DefaultListableBeanFactory(); //create XmlBeanDefinitionReader obj XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory); //load and parse xml file reader.loadBeanDefinitions("com/nt/cfgs/applicationContext.xml"); //get Spring bean VoterEligibilityChecking vote = factory.getBean("vote",VoterEligibilityChecking.class); System.out.println(vote.checking()); } }
[ "praveen97javaworld@gmail.com" ]
praveen97javaworld@gmail.com
5af976dd1741014e8fe3cd635165f957373b3386
eeaf5dd5bb55c67163c81a233a30d788a18d8ecf
/app/src/main/java/com/tylz/googleplay/factory/FragmentFactory.java
7ae1abd89b5c7876a45fb3f09ecab8aaed1761a0
[]
no_license
mmsapling/GooglePlay
39099a673d6c26d17ce43536a7090f377ceff30d
994841bb49ff895704ea6e993b5e95f47e88d450
refs/heads/master
2021-01-10T06:46:59.066156
2016-03-09T15:46:57
2016-03-09T15:46:57
53,510,041
1
0
null
null
null
null
UTF-8
Java
false
false
2,171
java
package com.tylz.googleplay.factory; import com.tylz.googleplay.base.BaseFragment; import com.tylz.googleplay.fragment.AppFragment; import com.tylz.googleplay.fragment.CategoryFragment; import com.tylz.googleplay.fragment.GameFragment; import com.tylz.googleplay.fragment.HomeFragment; import com.tylz.googleplay.fragment.HotFragment; import com.tylz.googleplay.fragment.RecomendFragment; import com.tylz.googleplay.fragment.SubjectFragment; import java.util.HashMap; import java.util.Map; /** * Created by xuanwen on 2016/1/12. */ public class FragmentFactory { public static final int FRAGMENT_HOME = 0; public static final int FRAGMENT_APP = 1; public static final int FRAGMENT_GAME = 2; public static final int FRAGMENT_SUBJECT = 3; public static final int FRAGMENT_RECOMMEND = 4; public static final int FRAGMENT_CATEGORY = 5; public static final int FRAGMENT_HOT = 6; private static Map<Integer,BaseFragment> mCacheFragmentMap = new HashMap<>(); public static BaseFragment createFragment(int position) { BaseFragment fragment = null; if(mCacheFragmentMap.containsKey(position)){ fragment = mCacheFragmentMap.get(position); return fragment; } switch (position) { case FRAGMENT_HOME: fragment = new HomeFragment(); break; case FRAGMENT_APP: fragment = new AppFragment(); break; case FRAGMENT_GAME: fragment = new GameFragment(); break; case FRAGMENT_SUBJECT: fragment = new SubjectFragment(); break; case FRAGMENT_RECOMMEND: fragment = new RecomendFragment(); break; case FRAGMENT_CATEGORY: fragment = new CategoryFragment(); break; case FRAGMENT_HOT: fragment = new HotFragment(); break; default: break; } //保存引用到集合中 mCacheFragmentMap.put(position,fragment); return fragment; } }
[ "tylzcxw@163.com" ]
tylzcxw@163.com
8990020fc6dbd3d47c170d58207e6ac5b493434e
bec08e55120fd09a0d8f59e82aff97bbff228c7b
/2.JavaCore/src/com/javarush/task/task19/task1922/Solution.java
225dbfd1860e06099fc4b2b8fbaf6095c3828a26
[]
no_license
sergeymamonov/JavaRushTasks
79f087ba631334321a275227286a02998c68135f
5723f977672f8631692a0cf3aad5b7a32731dcd1
refs/heads/main
2023-02-22T16:14:32.665336
2021-01-30T07:19:35
2021-01-30T07:19:35
316,418,200
0
0
null
null
null
null
UTF-8
Java
false
false
1,369
java
package com.javarush.task.task19.task1922; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; /* Ищем нужные строки */ public class Solution { public static List<String> words = new ArrayList<String>(); static { words.add("файл"); words.add("вид"); words.add("В"); } public static void main(String[] args) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); try { String fileName = bufferedReader.readLine(); bufferedReader.close(); BufferedReader bufferedReader1 = new BufferedReader(new FileReader(fileName)); String line; while (bufferedReader1.ready()) { int counter = 0; line = bufferedReader1.readLine(); String[] splitLine = line.split(" "); for (String s : splitLine) { if (words.contains(s)) { counter++; } } if (counter == 2) { System.out.println(line); } } bufferedReader1.close(); } catch (IOException e) { } } }
[ "sergei.mamonov@gmail.com" ]
sergei.mamonov@gmail.com
1a3074a9e6d4f975d03acf66c338ef135b500e2b
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Jetty/Jetty1181.java
886e2dbd71c115e1f6df681bf3530b64d964e05b
[]
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
1,114
java
@Test public void testDecode() { testDecode(6,0,"00"); testDecode(6,1,"01"); testDecode(6,62,"3e"); testDecode(6,63,"3f00"); testDecode(6,63+1,"3f01"); testDecode(6,63+0x7e,"3f7e"); testDecode(6,63+0x7f,"3f7f"); testDecode(6,63+0x80,"3f8001"); testDecode(6,63+0x81,"3f8101"); testDecode(6,63+0x7f+0x80*0x01,"3fFf01"); testDecode(6,63+0x00+0x80*0x02,"3f8002"); testDecode(6,63+0x01+0x80*0x02,"3f8102"); testDecode(6,63+0x7f+0x80*0x7f,"3fFf7f"); testDecode(6,63+0x00+0x80*0x80, "3f808001"); testDecode(6,63+0x7f+0x80*0x80*0x7f,"3fFf807f"); testDecode(6,63+0x00+0x80*0x80*0x80,"3f80808001"); testDecode(8,0,"00"); testDecode(8,1,"01"); testDecode(8,128,"80"); testDecode(8,254,"Fe"); testDecode(8,255,"Ff00"); testDecode(8,255+1,"Ff01"); testDecode(8,255+0x7e,"Ff7e"); testDecode(8,255+0x7f,"Ff7f"); testDecode(8,255+0x80,"Ff8001"); testDecode(8,255+0x00+0x80*0x80,"Ff808001"); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
edf36321b55a1fd3ac875f44caf74dbbbe619d29
f5f143087f35fa67fa4c54cad106a32e1fb45c0e
/src/com/jpexs/decompiler/flash/exporters/BinaryDataExporter.java
158185a955ab0049971e35d24ce2aaa810ae5d13
[]
no_license
SiverDX/SWFCopyValues
03b665b8f4ae3a2a22f360ea722813eeb52b4ef0
d146d8dcf6d1f7a69aa0471f85b852e64cad02f7
refs/heads/master
2022-07-29T06:56:55.446686
2021-12-04T09:48:48
2021-12-04T09:48:48
324,795,135
0
1
null
null
null
null
UTF-8
Java
false
false
3,127
java
/* * Copyright (C) 2010-2018 JPEXS, All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ package com.jpexs.decompiler.flash.exporters; import com.jpexs.decompiler.flash.AbortRetryIgnoreHandler; import com.jpexs.decompiler.flash.EventListener; import com.jpexs.decompiler.flash.ReadOnlyTagList; import com.jpexs.decompiler.flash.RetryTask; import com.jpexs.decompiler.flash.exporters.settings.BinaryDataExportSettings; import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag; import com.jpexs.decompiler.flash.tags.Tag; import com.jpexs.helpers.Helper; import com.jpexs.helpers.Path; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.ArrayList; import java.util.List; /** * * @author JPEXS */ public class BinaryDataExporter { public List<File> exportBinaryData(AbortRetryIgnoreHandler handler, String outdir, ReadOnlyTagList tags, BinaryDataExportSettings settings, EventListener evl) throws IOException, InterruptedException { List<File> ret = new ArrayList<>(); if (tags.isEmpty()) { return ret; } File foutdir = new File(outdir); Path.createDirectorySafe(foutdir); int count = 0; for (Tag t : tags) { if (t instanceof DefineBinaryDataTag) { count++; } } if (count == 0) { return ret; } int currentIndex = 1; for (final Tag t : tags) { if (t instanceof DefineBinaryDataTag) { DefineBinaryDataTag bdt = (DefineBinaryDataTag) t; if (evl != null) { evl.handleExportingEvent("binarydata", currentIndex, count, t.getName()); } String ext = bdt.innerSwf == null ? ".bin" : ".swf"; final File file = new File(outdir + File.separator + Helper.makeFileName(bdt.getCharacterExportFileName() + ext)); new RetryTask(() -> { try (OutputStream fos = new BufferedOutputStream(new FileOutputStream(file))) { fos.write(bdt.binaryData.getRangeData()); } }, handler).run(); ret.add(file); if (evl != null) { evl.handleExportedEvent("binarydata", currentIndex, count, t.getName()); } currentIndex++; } } return ret; } }
[ "kai.zahn@yahoo.de" ]
kai.zahn@yahoo.de
14a5a85682d6c8d746a622c000430e1930de6c11
c8c949b3710fbb4b983d03697ec9173a0ad3f79f
/src/HashTable/BinaryTreeInorderTraversal.java
4915343950568997fe95626502ba66a8f11de7f8
[]
no_license
mxx626/myleet
ae4409dec30d81eaaef26518cdf52a75fd3810bc
5da424b2f09342947ba6a9fffb1cca31b7101cf0
refs/heads/master
2020-03-22T15:11:07.145406
2018-07-09T05:12:28
2018-07-09T05:12:28
140,234,151
2
1
null
null
null
null
UTF-8
Java
false
false
1,710
java
package HashTable; import java.util.LinkedList; import java.util.List; import java.util.Stack; public class BinaryTreeInorderTraversal { private List<Integer> res = new LinkedList(); public List<Integer> inorderTraversal(TreeNode root) { helper(root); return res; } private void helper(TreeNode node){ if (node==null) return; helper(node.left); res.add(node.val); helper(node.right); } class TreeNode{ int val; TreeNode left; TreeNode right; public TreeNode(int x){ val = x; } } public List<Integer> inorderTraversal2(TreeNode root) { if (root==null) return res; Stack<TreeNode> s = new Stack<>(); while (root!=null){ s.push(root); root=root.left; } while (!s.isEmpty()){ TreeNode cur = s.pop(); res.add(cur.val); if (cur.right!=null){ TreeNode tmp = cur.right; while (tmp!=null){ s.push(tmp); tmp=tmp.left; } } } return res; } public List<Integer> inorderTraversal3(TreeNode root) { if (root==null) return res; Stack<TreeNode> s = new Stack<>(); while (root!=null || !s.isEmpty()){ if (root!=null){ s.push(root); root=root.left; } else { root = s.pop(); res.add(root.val); root = root.right; } } return res; } }
[ "mxx626@outlook.com" ]
mxx626@outlook.com
b5e2027334ca1005d8ea73074085c6f2b6b0b20a
92f6227f08e19bd2e1bf79738bf906b9ed134091
/chapter_010/ModelMapping/src/main/java/ru/job4j/storage/EngineStorage.java
6472a97444c7da91bf0e131d93560c27c8a8592c
[ "Apache-2.0" ]
permissive
kirillkrohmal/krohmal
b8af0e81b46081f53c8ff857609bb99785165f3f
12a8ce50caf76cf2c3b54a7fbaa2813fd3550a78
refs/heads/master
2023-06-23T17:27:56.513004
2023-06-13T07:05:56
2023-06-13T07:05:56
91,477,464
0
0
Apache-2.0
2023-02-22T08:20:14
2017-05-16T15:58:50
Java
UTF-8
Java
false
false
1,635
java
package ru.job4j.storage; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.query.Query; import ru.job4j.models.Car; import ru.job4j.models.Engine; import java.util.ArrayList; import java.util.List; public class EngineStorage { private static final EngineStorage INSTANSE = new EngineStorage(); public static EngineStorage getInstance() { return INSTANSE; } SessionFactory factory = HibernateFactory.getSessionFactory(); public Engine add(Engine engine) { Session session = factory.openSession(); Transaction tx = session.beginTransaction(); try { session.save(engine); return engine; } finally { tx.commit(); session.close(); } } public void delete(int id) { try (Session session = factory.openSession()) { Transaction tx = session.beginTransaction(); session.delete(new Engine(id)); tx.commit(); } } public List<Engine> getAll() { List<Engine> engines = new ArrayList<>(); try (Session session = factory.openSession();) { engines.addAll(session.createQuery("from engine").list()); } return engines; } public Engine update(Engine engine) { Session session = factory.openSession(); Transaction tx = session.beginTransaction(); try { session.update(engine); return engine; } finally { tx.commit(); session.close(); } } }
[ "krohmal_kirill@mail.ru" ]
krohmal_kirill@mail.ru
0cd0e20738f29fc183e0b0f786c4702bf95767bd
b3e8c286f69ff584622a597ae892b39475028fd6
/TagWriterPoc_source/sources/android/support/design/widget/FloatingActionButtonHoneycombMr1.java
cc7e7948e9a5b1065aa1bc809f1ee2400b9c0fc3
[]
no_license
EXPONENCIAL-IO/Accessphere
292e3ecf389a216cb656d5d3c22981061b7a2f45
1c07e06d85ed85972d14d848818dc24079a0ca2f
refs/heads/master
2022-11-24T22:12:37.776368
2020-07-26T02:30:17
2020-07-26T02:30:17
282,062,061
0
0
null
null
null
null
UTF-8
Java
false
false
3,816
java
package android.support.design.widget; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.support.annotation.Nullable; import android.support.p001v4.view.ViewCompat; import android.view.View; class FloatingActionButtonHoneycombMr1 extends FloatingActionButtonEclairMr1 { /* access modifiers changed from: private */ public boolean mIsHiding; FloatingActionButtonHoneycombMr1(View view, ShadowViewDelegate shadowViewDelegate) { super(view, shadowViewDelegate); } /* access modifiers changed from: 0000 */ public boolean requirePreDrawListener() { return true; } /* access modifiers changed from: 0000 */ public void onPreDraw() { updateFromViewRotation(this.mView.getRotation()); } /* access modifiers changed from: 0000 */ public void hide(@Nullable final InternalVisibilityChangedListener listener) { if (this.mIsHiding || this.mView.getVisibility() != 0) { if (listener != null) { listener.onHidden(); } } else if (!ViewCompat.isLaidOut(this.mView) || this.mView.isInEditMode()) { this.mView.setVisibility(8); if (listener != null) { listener.onHidden(); } } else { this.mView.animate().scaleX(0.0f).scaleY(0.0f).alpha(0.0f).setDuration(200).setInterpolator(AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR).setListener(new AnimatorListenerAdapter() { public void onAnimationStart(Animator animation) { FloatingActionButtonHoneycombMr1.this.mIsHiding = true; FloatingActionButtonHoneycombMr1.this.mView.setVisibility(0); } public void onAnimationCancel(Animator animation) { FloatingActionButtonHoneycombMr1.this.mIsHiding = false; } public void onAnimationEnd(Animator animation) { FloatingActionButtonHoneycombMr1.this.mIsHiding = false; FloatingActionButtonHoneycombMr1.this.mView.setVisibility(8); if (listener != null) { listener.onHidden(); } } }); } } /* access modifiers changed from: 0000 */ public void show(@Nullable final InternalVisibilityChangedListener listener) { if (this.mView.getVisibility() == 0) { return; } if (!ViewCompat.isLaidOut(this.mView) || this.mView.isInEditMode()) { this.mView.setVisibility(0); this.mView.setAlpha(1.0f); this.mView.setScaleY(1.0f); this.mView.setScaleX(1.0f); if (listener != null) { listener.onShown(); return; } return; } this.mView.setAlpha(0.0f); this.mView.setScaleY(0.0f); this.mView.setScaleX(0.0f); this.mView.animate().scaleX(1.0f).scaleY(1.0f).alpha(1.0f).setDuration(200).setInterpolator(AnimationUtils.FAST_OUT_SLOW_IN_INTERPOLATOR).setListener(new AnimatorListenerAdapter() { public void onAnimationStart(Animator animation) { FloatingActionButtonHoneycombMr1.this.mView.setVisibility(0); } public void onAnimationEnd(Animator animation) { if (listener != null) { listener.onShown(); } } }); } private void updateFromViewRotation(float rotation) { if (this.mShadowDrawable != null) { this.mShadowDrawable.setRotation(-rotation); } if (this.mBorderDrawable != null) { this.mBorderDrawable.setRotation(-rotation); } } }
[ "68705557+edomosin-exponencial@users.noreply.github.com" ]
68705557+edomosin-exponencial@users.noreply.github.com
e1c3d75417eab31b124d293af17123a6a25cb75d
e14ab1ee1eac74e510faef92651065f0c6a13502
/AngularJS/src/org/angular2/lang/html/psi/impl/Angular2HtmlNgContentSelectorImpl.java
be8d1101b3f392a4dbbe2b7eda3ba7b5871cbd12
[ "Apache-2.0" ]
permissive
suosuok/intellij-plugins
65d44cacaa31c52aea57d5a257e6fdc431822911
7c2c7d5aa4dd71818279c2159ced3175f33a95c1
refs/heads/master
2022-11-24T16:51:45.620117
2020-06-26T16:41:00
2020-06-29T05:18:48
275,747,122
1
0
null
2020-06-29T06:16:44
2020-06-29T06:16:44
null
UTF-8
Java
false
false
2,523
java
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.angular2.lang.html.psi.impl; import com.intellij.extapi.psi.StubBasedPsiElementBase; import com.intellij.lang.ASTNode; import com.intellij.openapi.util.TextRange; import com.intellij.psi.PsiElementVisitor; import com.intellij.psi.PsiReference; import com.intellij.psi.StubBasedPsiElement; import com.intellij.psi.impl.source.resolve.reference.ReferenceProvidersRegistry; import com.intellij.psi.stubs.IStubElementType; import com.intellij.util.ArrayUtil; import org.angular2.entities.Angular2DirectiveSelector; import org.angular2.entities.Angular2DirectiveSelectorImpl; import org.angular2.lang.html.psi.Angular2HtmlElementVisitor; import org.angular2.lang.html.psi.Angular2HtmlNgContentSelector; import org.angular2.lang.html.stub.Angular2HtmlNgContentSelectorStub; import org.jetbrains.annotations.NotNull; public class Angular2HtmlNgContentSelectorImpl extends StubBasedPsiElementBase<Angular2HtmlNgContentSelectorStub> implements Angular2HtmlNgContentSelector, StubBasedPsiElement<Angular2HtmlNgContentSelectorStub> { public Angular2HtmlNgContentSelectorImpl(@NotNull Angular2HtmlNgContentSelectorStub stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); } public Angular2HtmlNgContentSelectorImpl(@NotNull ASTNode node) { super(node); } @Override public @NotNull Angular2DirectiveSelector getSelector() { Angular2HtmlNgContentSelectorStub stub = getGreenStub(); String text; if (stub != null) { text = stub.getSelector(); } else { text = getText(); } return new Angular2DirectiveSelectorImpl(this, text, p -> new TextRange(p.second, p.second + p.first.length())); } @Override public String toString() { return "Angular2HtmlNgContentSelector (" + getSelector() + ")"; } @Override public PsiReference getReference() { return ArrayUtil.getFirstElement(getReferences()); } @Override public PsiReference @NotNull [] getReferences() { return ReferenceProvidersRegistry.getReferencesFromProviders(this); } @Override public void accept(@NotNull PsiElementVisitor visitor) { if (visitor instanceof Angular2HtmlElementVisitor) { ((Angular2HtmlElementVisitor)visitor).visitNgContentSelector(this); } else { super.accept(visitor); } } }
[ "intellij-monorepo-bot-no-reply@jetbrains.com" ]
intellij-monorepo-bot-no-reply@jetbrains.com
61821efc5c218d48b690c3baaae6e3dc129a6c2c
e7dc41399c522bebefad93f10bd915619fc26648
/common/src/main/java/com/wo56/business/ord/vo/out/OrdGoodsInfoOutParam.java
26d95ae69e0f609e59863b51d7baee6811593a2d
[]
no_license
mlj0381/test3
d022f5952ab086bc7be3dbc81569b7f1b3631e99
669b461e06550e60313bc634c7a384b9769f154a
refs/heads/master
2020-03-17T01:44:41.166126
2017-08-03T02:57:52
2017-08-03T02:57:52
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,382
java
package com.wo56.business.ord.vo.out; import com.framework.core.inter.vo.OutParamVO; public class OrdGoodsInfoOutParam extends OutParamVO { private String consignorName; private String consignorBill; private String address; private String product; private Integer count; private String color; private String standard; private String code; public String getConsignorName() { return consignorName; } public void setConsignorName(String consignorName) { this.consignorName = consignorName; } public String getConsignorBill() { return consignorBill; } public void setConsignorBill(String consignorBill) { this.consignorBill = consignorBill; } public String getAddress() { return address; } public void setAddress(String address) { this.address = address; } public String getProduct() { return product; } public void setProduct(String product) { this.product = product; } public Integer getCount() { return count; } public void setCount(Integer count) { this.count = count; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } public String getStandard() { return standard; } public void setStandard(String standard) { this.standard = standard; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } }
[ "yunqi@DESKTOP-FS7ABO9" ]
yunqi@DESKTOP-FS7ABO9
846fd6305470ef7d73b49de7051f432109476540
26bee76ec7f4cece2a613aaadfb0fd0f32742b8a
/src/ch24/books_examples/DisplayQueryResultsController.java
6c35b5cd4588c39d311f78358358050c8ef9618e
[]
no_license
oeliewoep/JHTP11
c45e9e1d2a7bca40867c6bbdb5f0a49260dc60bd
23124bd6170ef5a7751e0952bab5317c93cd4b3d
refs/heads/master
2021-09-26T23:22:43.219971
2018-11-04T12:20:02
2018-11-04T12:20:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,190
java
package ch24.books_examples;// Fig. 24.29: DisplayQueryResultsController.java // Controller for the DisplayQueryResults app import java.sql.SQLException; import java.util.regex.PatternSyntaxException; import javafx.embed.swing.SwingNode; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Alert; import javafx.scene.control.Alert.AlertType; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.layout.BorderPane; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.RowFilter; import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; public class DisplayQueryResultsController { @FXML private BorderPane borderPane; @FXML private TextArea queryTextArea; @FXML private TextField filterTextField; // database URL, username and password private static final String DATABASE_URL = "jdbc:derby:books"; private static final String USERNAME = "deitel"; private static final String PASSWORD = "deitel"; // default query retrieves all data from Authors table private static final String DEFAULT_QUERY = "SELECT * FROM authors"; // used for configuring JTable to display and sort data private ResultSetTableModel tableModel; private TableRowSorter<TableModel> sorter; public void initialize() { queryTextArea.setText(DEFAULT_QUERY); // create ResultSetTableModel and display database table try { // create TableModel for results of DEFAULT_QUERY tableModel = new ResultSetTableModel(DATABASE_URL, USERNAME, PASSWORD, DEFAULT_QUERY); // create JTable based on the tableModel JTable resultTable = new JTable(tableModel); // set up row sorting for JTable sorter = new TableRowSorter<TableModel>(tableModel); resultTable.setRowSorter(sorter); // configure SwingNode to display JTable, then add to borderPane SwingNode swingNode = new SwingNode(); swingNode.setContent(new JScrollPane(resultTable)); borderPane.setCenter(swingNode); } catch (SQLException sqlException) { displayAlert(AlertType.ERROR, "Database Error", sqlException.getMessage()); tableModel.disconnectFromDatabase(); // close connection System.exit(1); // terminate application } } // query the database and display results in JTable @FXML void submitQueryButtonPressed(ActionEvent event) { // perform a new query try { tableModel.setQuery(queryTextArea.getText()); } catch (SQLException sqlException) { displayAlert(AlertType.ERROR, "Database Error", sqlException.getMessage()); // try to recover from invalid user query // by executing default query try { tableModel.setQuery(DEFAULT_QUERY); queryTextArea.setText(DEFAULT_QUERY); } catch (SQLException sqlException2) { displayAlert(AlertType.ERROR, "Database Error", sqlException2.getMessage()); tableModel.disconnectFromDatabase(); // close connection System.exit(1); // terminate application } } } // apply specified filter to results @FXML void applyFilterButtonPressed(ActionEvent event) { String text = filterTextField.getText(); if (text.length() == 0) { sorter.setRowFilter(null); } else { try { sorter.setRowFilter(RowFilter.regexFilter(text)); } catch (PatternSyntaxException pse) { displayAlert(AlertType.ERROR, "Regex Error", "Bad regex pattern"); } } } // display an Alert dialog private void displayAlert( AlertType type, String title, String message) { Alert alert = new Alert(type); alert.setTitle(title); alert.setContentText(message); alert.showAndWait(); } } /************************************************************************** * (C) Copyright 1992-2018 by Deitel & Associates, Inc. and * * Pearson Education, Inc. All Rights Reserved. * * * * DISCLAIMER: The authors and publisher of this book have used their * * best efforts in preparing the book. These efforts include the * * development, research, and testing of the theories and programs * * to determine their effectiveness. The authors and publisher make * * no warranty of any kind, expressed or implied, with regard to these * * programs or to the documentation contained in these books. The authors * * and publisher shall not be liable in any event for incidental or * * consequential damages in connection with, or arising out of, the * * furnishing, performance, or use of these programs. * *************************************************************************/
[ "mpaesen@gmail.com" ]
mpaesen@gmail.com
04320a221d73549d52a8c76ccf96adfcf2ff4ec0
a2df6764e9f4350e0d9184efadb6c92c40d40212
/aliyun-java-sdk-sofa/src/main/java/com/aliyuncs/sofa/transform/v20190815/UpdateMsGuardianRulesResponseUnmarshaller.java
93c57bb5a225cdf3210591823c03f7a20a0bbe3d
[ "Apache-2.0" ]
permissive
warriorsZXX/aliyun-openapi-java-sdk
567840c4bdd438d43be6bd21edde86585cd6274a
f8fd2b81a5f2cd46b1e31974ff6a7afed111a245
refs/heads/master
2022-12-06T15:45:20.418475
2020-08-20T08:37:31
2020-08-26T06:17:49
290,450,773
1
0
NOASSERTION
2020-08-26T09:15:48
2020-08-26T09:15:47
null
UTF-8
Java
false
false
1,421
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.sofa.transform.v20190815; import com.aliyuncs.sofa.model.v20190815.UpdateMsGuardianRulesResponse; import com.aliyuncs.transform.UnmarshallerContext; public class UpdateMsGuardianRulesResponseUnmarshaller { public static UpdateMsGuardianRulesResponse unmarshall(UpdateMsGuardianRulesResponse updateMsGuardianRulesResponse, UnmarshallerContext _ctx) { updateMsGuardianRulesResponse.setRequestId(_ctx.stringValue("UpdateMsGuardianRulesResponse.RequestId")); updateMsGuardianRulesResponse.setResultCode(_ctx.stringValue("UpdateMsGuardianRulesResponse.ResultCode")); updateMsGuardianRulesResponse.setResultMessage(_ctx.stringValue("UpdateMsGuardianRulesResponse.ResultMessage")); updateMsGuardianRulesResponse.setResult(_ctx.longValue("UpdateMsGuardianRulesResponse.Result")); return updateMsGuardianRulesResponse; } }
[ "sdk-team@alibabacloud.com" ]
sdk-team@alibabacloud.com
93149fccc64919feec177d8bb0d9d151b76a8748
6ed96ccecf2d6f0425f93828a2a185e5a34e7c32
/ngg/src/main/java/com/ntdlg/ngg/dataformat/DfNyq.java
c84b784f73839fee4553c56a9afa3d73490d2cc7
[]
no_license
phx1314/NGG
2b745dd454d68764e0247976d0de9d2fb979b8c0
5bf584a23c1b2a6f6723f53931c032e934f11aaa
refs/heads/master
2022-04-13T12:38:54.014218
2020-04-11T01:28:11
2020-04-11T01:28:11
254,769,854
0
0
null
null
null
null
UTF-8
Java
false
false
1,208
java
// // DfNyq // // Created by df on 2017-02-10 14:53:54 // Copyright (c) df All rights reserved. /** */ package com.ntdlg.ngg.dataformat; import android.content.Context; import com.mdx.framework.adapter.MAdapter; import com.mdx.framework.server.api.Son; import com.mdx.framework.widget.util.DataFormat; import com.ntdlg.ngg.ada.AdaNyq; import com.udows.common.proto.STopicList; public class DfNyq extends DataFormat { int size; String begin = ""; int isWodeType; @Override public boolean hasNext() { return size >= 10; } public DfNyq(int isWodeType) { this.isWodeType = isWodeType; } public DfNyq() { } @Override public MAdapter<?> getAdapter(Context context, Son son, int page) { size = ((STopicList) son.getBuild()).list.size();// 每页10条 // if (size > 0) // begin = ((STopicList) son.getBuild()).list.get(size - 1).createTime; return new AdaNyq(context, ((STopicList) son.getBuild()).list,isWodeType); } @Override public String[][] getPageNext() { // return new String[][]{{"begin", begin}}; return null; } @Override public void reload() { } }
[ "1163096519@qq.com" ]
1163096519@qq.com
f8c3d181c4d7c24d6c9aafa8f9ee34584b277ab3
62004846647d35151a636714ee0fc5227e073bc7
/jike.2015.1.23(2.0.1)/src/jk/o1office/order/servlet/DeleteOrder.java
4038781e3745e2674a952aac6b3cb3cb07a9002e
[]
no_license
yonghai/JKWebPortal
aa86d6c02b0c9ebec148cbb7167746c108d21e37
3e591ee5d39d57b0fdb5968d9ae59fa9fbcd4931
refs/heads/master
2021-01-15T23:01:59.284192
2015-01-23T07:15:51
2015-01-23T07:15:51
28,065,308
0
0
null
null
null
null
UTF-8
Java
false
false
2,779
java
package jk.o1office.order.servlet; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import jk.o1office.excetion.FailException; import jk.o1office.excetion.NullException; import jk.o1office.ht.utils.ExceptionInfo; import jk.o1office.log.FileType; import jk.o1office.log.MyLog; import jk.o1office.log.OperateType; import jk.o1office.service.OrderService; import jk.o1office.validator.Validator; /** * 删除订单 * 参数已验证 */ public class DeleteOrder extends HttpServlet{ private Logger logger = Logger.getLogger("jk.o1office.order.servlet.DeleteOrder"); private OrderService orderService; private Validator validator; public Validator getValidator() { return validator; } public void setValidator(Validator validator) { this.validator = validator; } public OrderService getOrderService() { return orderService; } public void setOrderService(OrderService orderService) { this.orderService = orderService; } @Override public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { doPost(req, resp); } @Override public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { req.setCharacterEncoding("utf-8"); resp.setCharacterEncoding("utf-8"); resp.setContentType("text/html;charset=utf-8"); PrintWriter printWriter = resp.getWriter(); String token = ""; String returninfo = ""; try { String deviceid = req.getParameter("device_id"); String time = validator.isNull(req.getParameter("time"), "time"); token = validator.isNull(req.getParameter("token"), "token"); String orderid = validator.isNull(req.getParameter("order_id"), "order_id"); returninfo = orderService.deleteOrder(orderid,time,token); MyLog.newInstance().writeLog(OperateType.UDELORDER, FileType.UUSERORDER, token, "success"); } catch (NullException e) { returninfo = "{\"success\":false,\"token\":\""+token+"\",\"emsg\":\""+validator.getName()+"不能为null\"}"; MyLog.newInstance().writeLog(OperateType.UDELORDER, FileType.UUSERORDER, token, "fail"); e.printStackTrace(); e.printStackTrace(ExceptionInfo.out()); ExceptionInfo.out().flush(); } catch(Exception e){ returninfo = "{\"success\":false,\"token\":\""+token+"\",\"emsg\":\"删除订单出错了\"}"; MyLog.newInstance().writeLog(OperateType.UDELORDER, FileType.UUSERORDER, token, "fail"); e.printStackTrace(); e.printStackTrace(ExceptionInfo.out()); ExceptionInfo.out().flush(); } finally{ printWriter.println(returninfo); } } }
[ "811067920@qq.com" ]
811067920@qq.com
19877bd692994524032589828a2d4c4aaa54deac
7645f111da2eee97cfab1801b9a527849f952b08
/src/sa/lib/SLibTimeConsts.java
1c289e6e5deec930d417d3d50f757774d68aae79
[ "MIT" ]
permissive
swaplicado/sa-lib-10
639117d4ddd728a8fe1fdc5927250489b79c05e1
d5baf5dc3b884c0f30a34c53850185a683d04b3d
refs/heads/master
2023-07-20T00:59:35.691753
2023-07-13T16:45:53
2023-07-13T16:45:53
119,547,010
0
0
null
null
null
null
UTF-8
Java
false
false
509
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package sa.lib; /** * * @author Sergio Flores */ public class SLibTimeConsts { public static final int YEAR_MIN = 2001; public static final int YEAR_MAX = 2100; public static final int MONTH_MIN = 1; public static final int MONTH_MAX = 12; public static final int MONTHS = 12; public static final String TXT_DAY = "día"; public static final String TXT_DAYS = "días"; }
[ "sflores@swaplicado.com.mx" ]
sflores@swaplicado.com.mx
845419930525305f07e6984e3964ac72e86f6d12
4e3ad3a6955fb91d3879cfcce809542b05a1253f
/schema/ab-products/common/connectors/src/main/com/archibus/app/common/connectors/impl/archibus/translation/segregate/SegregateByData.java
5a40bd346ceb387332dafdb753a7f87b9c173bc2
[]
no_license
plusxp/ARCHIBUS_Dev
bee2f180c99787a4a80ebf0a9a8b97e7a5666980
aca5c269de60b6b84d7871d79ef29ac58f469777
refs/heads/master
2021-06-14T17:51:37.786570
2017-04-07T16:21:24
2017-04-07T16:21:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,526
java
package com.archibus.app.common.connectors.impl.archibus.translation.segregate; import java.text.ParseException; import java.util.*; import org.json.JSONObject; import com.archibus.app.common.connectors.domain.ConnectorFieldConfig; import com.archibus.app.common.connectors.exception.ConfigurationException; import com.archibus.datasource.*; import com.archibus.datasource.data.*; import com.archibus.datasource.restriction.Restrictions; /** * Populates field values on a record using field values from records from a data table. * * @author cole * @since 22.1 * */ public class SegregateByData implements ISegregateRule { /** * The parameter for the map from field names in the ARCHIBUS table to fields on the transaction * record for fields that should match. */ private static final String RESTRICTION_PARAM = "restrictionMap"; /** * The parameter for the map from field names on the ARCHIBUS table to fields on the transaction * record for fields that should be set. */ private static final String VALUE_PARAM = "valueMap"; /** * The name of the data table. */ private String tableName; /** * The list of fields on the table involved either in a restriction or an assignment. */ private String[] fieldNames; /** * The map from field names in the data table to fields on the transaction record for fields * that should match. */ private JSONObject restrictionMapping; /** * The map from field names on the data table to fields on the transaction record for fields * that should be set. */ private JSONObject fieldMapping; @Override public void init(final ConnectorFieldConfig connectorField) throws ConfigurationException { JSONObject parameters; try { parameters = new JSONObject(connectorField.getParameter()); } catch (final ParseException e) { throw new ConfigurationException("Unable to parse parameter for " + connectorField.getFieldId(), e); } this.tableName = connectorField.getValidateTbl(); this.restrictionMapping = parameters.getJSONObject(RESTRICTION_PARAM); this.fieldMapping = parameters.getJSONObject(VALUE_PARAM); final Set<String> fieldNameSet = new HashSet<String>(); final Iterator<String> restrictionMappingKeys = this.restrictionMapping.keys(); while (restrictionMappingKeys.hasNext()) { fieldNameSet.add(this.restrictionMapping.getString(restrictionMappingKeys.next())); } final Iterator<String> fieldMappingKeys = this.fieldMapping.keys(); while (fieldMappingKeys.hasNext()) { fieldNameSet.add(this.fieldMapping.getString(fieldMappingKeys.next())); } this.fieldNames = fieldNameSet.toArray(new String[fieldNameSet.size()]); } /** * @return false, since this sets the value of one or more fields based on something other than * data. */ @Override public boolean requiresExistingValue() { return false; } @Override public List<Map<String, Object>> segregate(final Map<String, Object> record) { final DataSource dataSource = DataSourceFactory.createDataSourceForFields(this.tableName, this.fieldNames); final Iterator<String> restrictionFields = this.restrictionMapping.keys(); while (restrictionFields.hasNext()) { final String fieldKey = restrictionFields.next(); final Object sourceValue = record.get(this.restrictionMapping.get(fieldKey)); if (sourceValue == null) { dataSource.addRestriction(Restrictions.isNull(this.tableName, fieldKey)); } else { dataSource.addRestriction(Restrictions.eq(this.tableName, fieldKey, sourceValue)); } } final List<Map<String, Object>> records = new ArrayList<Map<String, Object>>(); for (final DataRecord dataRecord : dataSource.getRecords()) { final List<DataValue> fieldValues = dataRecord.getFields(); for (final DataValue fieldValue : fieldValues) { if (this.fieldMapping.has(fieldValue.getName())) { record.put(this.fieldMapping.getString(fieldValue.getName()), fieldValue.getValue()); } } records.add(record); } return records; } }
[ "imranh.khan@ucalgary.ca" ]
imranh.khan@ucalgary.ca
331bca0f89b1d398916253af341dcee0ad00437c
0f64ae0f9f66cc891481352fdacece3456755762
/easymqtt4j-jaas-plugins/src/main/java/com/github/zengfr/easymqtt4j/plugins/jaas/JaasAbstractLoginModule.java
b9a50573198ad8c15fe6556b69972c47b82053e3
[ "Apache-2.0" ]
permissive
xfyecn/easymqtt4j
5326ff8c901e238ced7c41d627a905722a1f5d63
1537978dea5d089854689335e2db2e48ce8183d7
refs/heads/master
2022-09-25T13:52:55.404329
2020-06-04T10:13:11
2020-06-08T06:09:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,362
java
package com.github.zengfr.easymqtt4j.plugins.jaas; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.security.auth.Subject; import javax.security.auth.callback.*; import javax.security.auth.login.LoginException; import javax.security.auth.spi.LoginModule; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.*; /** * Created by zengfr on 2020/6/5. */ public abstract class JaasAbstractLoginModule implements LoginModule { public class Context { public boolean loginSuccess = false; public String userName; public Set<String> roles = new HashSet<>(); public Set<String> groups = new HashSet<>(); } protected static final Logger log = LoggerFactory.getLogger(JaasAbstractLoginModule.class); private static int userNameMinLength = 6; private static int userMaxTimes = 3; private static Map<String, Long> times = new HashMap<>(); private CallbackHandler callbackHandler; private Map sharedState; private Map options; private Subject subject; private boolean debug; private Context context; public JaasAbstractLoginModule() { context = new Context(); } protected abstract void init(boolean debug, Map<String, ?> options); protected abstract String getUserPassword(String userName); protected abstract Set<String> getUserRoles(String userName); protected abstract Set<String> getUserGroups(String userName); protected abstract boolean commitPrincipals(Subject subject, Context context); @Override public void initialize(Subject subject, CallbackHandler callbackHandler, Map<String, ?> sharedState, Map<String, ?> options) { this.callbackHandler = callbackHandler; this.subject = subject; this.sharedState = sharedState; this.options = options; if (options.containsKey("debug")) { debug = "true".equalsIgnoreCase((String) options.get("debug")); } this.init(debug, this.options); } @Override public boolean login() throws LoginException { boolean result = false; Context c = context; c.loginSuccess = result; Callback[] callbacks = new Callback[]{new NameCallback("username:"), new PasswordCallback("password:", false)}; try { this.callbackHandler.handle(callbacks); String userName = ((NameCallback) callbacks[0]).getName(); char[] password = ((PasswordCallback) callbacks[1]).getPassword(); c.userName = userName; if (this.validateUserName(userName) && password != null && password.length > 0) { if (this.checkTimesOK(userName)) { String password2 = getUserPassword(userName); result = this.validatePassword(password, password2); } } log.debug(String.format("login:%s,%s", userName, result)); } catch (IOException ex1) { throw new LoginException(ex1.getMessage()); } catch (UnsupportedCallbackException ex2) { throw new LoginException(ex2.getMessage()); } c.loginSuccess = result; return result; } @Override public boolean commit() throws LoginException { Context c = context; boolean result = c.loginSuccess; try { if (result) { String userName = c.userName; if (this.validateUserName(userName)) { this.commitPrincipals(subject, c); } } } catch (Exception ex) { log.error("", ex); } return true; } @Override public boolean abort() throws LoginException { this.logout(); return true; } @Override public boolean logout() throws LoginException { Context c = context; c.loginSuccess = false; subject.getPrincipals().clear(); times.put(c.userName, 0L); return true; } private static boolean checkTimesOK(String userName) { Long time = times.getOrDefault(userName, 0L); times.put(userName, ++time); return time <= userMaxTimes; } protected static boolean validateUserName(String userName) { return userName != null && userName.length() >= userNameMinLength; } private static boolean validatePassword(char[] password, String password2) { return password != null && password2 != null && password2.equalsIgnoreCase(new String(password)); } protected static void loadProp(Properties prop, String fileName) { try { FileInputStream fis = new FileInputStream(fileName); prop.load(fis); } catch (FileNotFoundException e) { log.error("", e); } catch (IOException e) { log.error("", e); } } protected static void storeProp(Properties prop, String fileName) { try { FileOutputStream fos = new FileOutputStream(fileName); prop.store(fos, JaasAbstractLoginModule.class.getName()); } catch (FileNotFoundException e) { log.error("", e); } catch (IOException e) { log.error("", e); } } }
[ "zengfrcomputer2@git.com" ]
zengfrcomputer2@git.com
88122c7c852bb9c712797f77c21cdf9e31ff334a
df5d6a911400cbc26a990349891310f2ee118ef1
/smoothcsv-app-modules/smoothcsv-core/src/main/java/command/grid/FocusCommand.java
6bfce90e5da53e4f1c259148e6c8ea8b06abd763
[ "Apache-2.0" ]
permissive
k-hatano/smoothcsv
8df0eb4a9d66e24e08b547f5aa20d6cbb2b8254c
ab37ddd2c9f45d05872c8bf1d43ff49e3de2c18a
refs/heads/master
2022-05-22T17:35:16.465561
2020-06-06T01:28:18
2020-06-06T01:39:45
204,708,583
1
0
null
2019-08-27T22:24:14
2019-08-27T13:24:13
null
UTF-8
Java
false
false
972
java
/* * Copyright 2016 kohii * * 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 command.grid; import com.smoothcsv.core.command.GridCommand; import com.smoothcsv.core.csvsheet.CsvGridSheetPane; /** * @author kohii */ public class FocusCommand extends GridCommand { @Override public void run(CsvGridSheetPane gridSheetPane) { if (gridSheetPane.isEditing()) { gridSheetPane.stopCellEditingIfEditing(); } gridSheetPane.requestFocus(); } }
[ "kohii.git@gmail.com" ]
kohii.git@gmail.com
2bed84f6b539a2986d6358cfdd1af12eb16d463a
228a36a3bd0fb3ac57a2b80e4a0da9a7c931f71a
/src/combit/ListLabel24/DefinePrintOptionsHandler.java
3b942426cdf92562e7e092305ab76ee9db62b83d
[]
no_license
Javonet-io-user/51231a55-11d9-48ca-acc1-07050ae1a4a8
f95fdc610f310fb054caea59f3a23d47ef49869f
52adc814c098fc94f64c36e153201725adc10c0a
refs/heads/master
2020-04-28T17:03:40.894650
2019-03-13T14:06:01
2019-03-13T14:06:01
175,433,069
0
0
null
null
null
null
UTF-8
Java
false
false
964
java
package combit.ListLabel24; import Common.Activation; import static Common.JavonetHelper.Convert; import static Common.JavonetHelper.getGetObjectName; import static Common.JavonetHelper.getReturnObjectName; import static Common.JavonetHelper.ConvertToConcreteInterfaceImplementation; import Common.JavonetHelper; import Common.MethodTypeAnnotation; import com.javonet.Javonet; import com.javonet.JavonetException; import com.javonet.JavonetFramework; import com.javonet.api.NObject; import com.javonet.api.NEnum; import com.javonet.api.keywords.NRef; import com.javonet.api.keywords.NOut; import com.javonet.api.NControlContainer; import java.util.concurrent.atomic.AtomicReference; import java.util.Iterator; import java.lang.*; import combit.ListLabel24.*; import jio.System.*; public interface DefinePrintOptionsHandler { /** Method */ @MethodTypeAnnotation(type = "Method") public void Invoke(Object sender, EventArgs e); }
[ "support@javonet.com" ]
support@javonet.com
8e31508d0d93dce834756e6bbbe2a931399df73e
500934481bd99d0c6ee59add9e7c3ba43d1e459d
/core/src/test/java/nl/weeaboo/vn/impl/render/DrawTransformTest.java
64c680184b65bfba04bc0f505116c5dc5201fcf7
[ "Apache-2.0" ]
permissive
anonl/nvlist
c60c1cf92eb91e0441385f2db1a66992e3653be3
235b251c0896c9fb568398012a4316f2f4177fd9
refs/heads/master
2023-08-24T01:00:05.582554
2023-07-29T11:31:12
2023-07-29T11:31:12
39,298,591
26
5
NOASSERTION
2023-09-09T07:54:45
2015-07-18T13:07:58
Java
UTF-8
Java
false
false
1,068
java
package nl.weeaboo.vn.impl.render; import org.junit.Assert; import org.junit.Test; import nl.weeaboo.vn.core.BlendMode; import nl.weeaboo.vn.math.Matrix; public class DrawTransformTest { @Test public void defaultValues() { DrawTransform dt = new DrawTransform(); Assert.assertEquals(0, dt.getZ()); Assert.assertEquals(true, dt.isClipEnabled()); Assert.assertEquals(BlendMode.DEFAULT, dt.getBlendMode()); Assert.assertEquals(Matrix.identityMatrix(), dt.getTransform()); } @Test public void copyConstructor() { DrawTransform dt = new DrawTransform(); dt.setZ((short)1); dt.setClipEnabled(false); dt.setBlendMode(BlendMode.ADD); dt.setTransform(Matrix.translationMatrix(1, 2)); dt = new DrawTransform(dt); Assert.assertEquals(1, dt.getZ()); Assert.assertEquals(false, dt.isClipEnabled()); Assert.assertEquals(BlendMode.ADD, dt.getBlendMode()); Assert.assertEquals(Matrix.translationMatrix(1, 2), dt.getTransform()); } }
[ "mail@weeaboo.nl" ]
mail@weeaboo.nl
58b11d3033d8b971b33f1935a802446f5564f0f2
cd8843d24154202f92eaf7d6986d05a7266dea05
/saaf-base-5.0/2000_saaf-tta-model/src/main/java/com/sie/watsons/base/questionnaire/model/inter/server/TtaQuestionNewMapDetailServer.java
d82abb94e482604541c89c37d390ad073b62cd18
[]
no_license
lingxiaoti/tta_system
fbc46c7efc4d408b08b0ebb58b55d2ad1450438f
b475293644bfabba9aeecfc5bd6353a87e8663eb
refs/heads/master
2023-03-02T04:24:42.081665
2021-02-07T06:48:02
2021-02-07T06:48:02
336,717,227
0
0
null
null
null
null
UTF-8
Java
false
false
5,632
java
package com.sie.watsons.base.questionnaire.model.inter.server; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.sie.saaf.common.model.dao.BaseCommonDAO_HI; import com.sie.saaf.common.model.inter.server.BaseCommonServer; import com.sie.saaf.common.util.BigDecimalUtils; import com.sie.saaf.common.util.SaafToolUtils; import com.sie.watsons.base.questionnaire.model.dao.readonly.TtaQuestionNewMapDetailDAO_HI_RO; import com.sie.watsons.base.questionnaire.model.entities.TtaQuestionNewMapDetailEntityModel; import com.sie.watsons.base.questionnaire.model.entities.TtaQuestionNewMapDetailEntity_HI; import com.sie.watsons.base.questionnaire.model.entities.readonly.TtaQuestionNewMapDetailEntity_HI_RO; import com.sie.watsons.base.questionnaire.model.inter.ITtaQuestionNewMapDetail; import com.sie.watsons.base.report.utils.EasyExcelUtil; import com.yhg.base.utils.StringUtils; import com.yhg.hibernate.core.paging.Pagination; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.util.Assert; import org.springframework.web.multipart.MultipartFile; import java.util.HashMap; import java.util.List; import java.util.Map; @Component("ttaQuestionNewMapDetailServer") public class TtaQuestionNewMapDetailServer extends BaseCommonServer<TtaQuestionNewMapDetailEntity_HI> implements ITtaQuestionNewMapDetail{ private static final Logger LOGGER = LoggerFactory.getLogger(TtaQuestionNewMapDetailServer.class); @Autowired private BaseCommonDAO_HI<TtaQuestionNewMapDetailEntity_HI> ttaQuestionNewMapDetailDAO_HI; @Autowired private TtaQuestionNewMapDetailDAO_HI_RO ttaQuestionNewMapDetailDAO_HI_RO; public TtaQuestionNewMapDetailServer() { super(); } @Override public void saveOrUpadateBatchDetail(JSONObject jsonParams) { if (jsonParams != null && jsonParams.getJSONArray("lineArr") != null) { JSONArray lineArr = jsonParams.getJSONArray("lineArr"); List<TtaQuestionNewMapDetailEntity_HI> list = JSON.parseArray(lineArr.toJSONString(), TtaQuestionNewMapDetailEntity_HI.class); Integer varUserId = jsonParams.getInteger("varUserId"); for (TtaQuestionNewMapDetailEntity_HI entity : list) { entity.setLastUpdatedBy(varUserId); entity.setCreatedBy(varUserId); entity.setOperatorUserId(varUserId); } ttaQuestionNewMapDetailDAO_HI.saveOrUpdateAll(list); } } @Override public Pagination<TtaQuestionNewMapDetailEntity_HI_RO> queryQuestionNewMapDetailList(JSONObject queryParamJSON, Integer pageIndex, Integer pageRows) { Map<String, Object> paramsMap = new HashMap<String, Object>(); StringBuffer sbSql = new StringBuffer(); sbSql.append(TtaQuestionNewMapDetailEntity_HI_RO.querySlq); SaafToolUtils.parperParam(queryParamJSON, "t.proposal_id", "proposalId", sbSql, paramsMap, "="); SaafToolUtils.changeQuerySort(queryParamJSON, sbSql, " map_detail_id asc", false); return ttaQuestionNewMapDetailDAO_HI_RO.findPagination(sbSql.toString(),SaafToolUtils.getSqlCountString(sbSql), paramsMap, pageIndex, pageRows); } @Override public void saveImportNewProductList(JSONObject jsonObject, MultipartFile file) throws Exception { String proposalId = jsonObject.getString("proposalId"); String saleType = jsonObject.getString("saleType"); Map<String,Object> result = EasyExcelUtil.readExcel(file, TtaQuestionNewMapDetailEntityModel.class,0); List<Map<String, Object>> datas = (List<Map<String, Object>>)result.get("datas"); if (datas != null) { datas.forEach(item->{ item.put("OPERATOR_USER_ID", jsonObject.get("varUserId")); item.put("PROPOSAL_ID", proposalId); String cost = item.get("COST") + ""; String retailPrice = item.get("RETAIL_PRICE") + ""; String promoPrice = item.get("PROMO_PRICE") + ""; if (StringUtils.isBlank(cost) || "null".equalsIgnoreCase(cost)) { Assert.isTrue(false, "上传新品附件有cost为空的值,请检查"); } if (StringUtils.isBlank(retailPrice) || "null".equalsIgnoreCase(retailPrice)) { Assert.isTrue(false, "上传新品附件有retailPrice为空的值,请检查"); } if (StringUtils.isBlank(promoPrice) || "null".equalsIgnoreCase(promoPrice)) { Assert.isTrue(false, "上传新品附件有promoPrice为空的值,请检查"); } Double normalGp = BigDecimalUtils.formatRoundUp(BigDecimalUtils.subtract(1, BigDecimalUtils.divide(Double.parseDouble(cost), Double.parseDouble(retailPrice))) * 100, 2); item.put("NORMAL_GP", normalGp); if ("B01".equalsIgnoreCase(saleType)) { if (StringUtils.isNotEmpty(cost) && StringUtils.isNotEmpty(promoPrice)) { Double promoGp = BigDecimalUtils.formatRoundUp(BigDecimalUtils.subtract(1, BigDecimalUtils.divide(Double.parseDouble(cost), Double.parseDouble(promoPrice))) * 100, 2); item.put("PROMO_GP", promoGp); } } else { item.put("PROMO_GP", item.get("NORMAL_GP")); } }); } List<TtaQuestionNewMapDetailEntity_HI> newMapDetailList = JSON.parseArray(SaafToolUtils.toJson(datas), TtaQuestionNewMapDetailEntity_HI.class); ttaQuestionNewMapDetailDAO_HI.saveOrUpdateAll(newMapDetailList); //ttaQuestionNewMapDetailDAO_HI.saveSeqBatchJDBC("TTA_QUESTION_NEW_MAP_DETAIL",datas,"MAP_DETAIL_ID","SEQ_TTA_QUESTION_NEW_MAP_DETAIL.NEXTVAL"); System.out.println(datas); } public static void main(String[] args) { Double subtract = BigDecimalUtils.formatRoundUp(BigDecimalUtils.subtract(1, BigDecimalUtils.divide(1.0, 3.0)) * 100,2); System.out.println(subtract); } }
[ "huang491591@qq.com" ]
huang491591@qq.com
592808e62a39c8dc8be2e66d6cc14788c27e9f30
a5b866f5708d857347a50d6f106754c040d1acf4
/Data Types and Variables - Exercise/src/SpiceMustFlow.java
0eb0492798226b562a5bd6337a6f6045705cf6a9
[]
no_license
StanchevaYoana/Java-Fundamentals
3c8434cdab20a009737e0d25be2d45bc0d772e37
99a883c313864f52ae39026a508925f4924325d4
refs/heads/master
2020-06-21T20:00:54.710482
2019-08-05T13:50:29
2019-08-05T13:50:29
197,541,288
3
0
null
null
null
null
UTF-8
Java
false
false
692
java
import java.util.Scanner; public class SpiceMustFlow { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long starting = Long.parseLong(scanner.nextLine()); long days = 0; long yielded = 0; if (starting < 100) { System.out.println(days); System.out.println(yielded); } else { while (starting >= 100) { days++; yielded += starting; starting -= 10; yielded -= 26; } yielded -= 26; System.out.println(days); System.out.println(yielded); } } }
[ "yoana.radoslavova@gmail.com" ]
yoana.radoslavova@gmail.com
f83b032bfd499b152121e000e89f29d8194e6bbd
d36d5ba4d8d1df1ad4494c94bd39252e128c5b5b
/com.jaspersoft.studio.book/src/com/jaspersoft/studio/book/messages/MessagesByKeys.java
931184801b78d1ab8595b788817f78e994fb4918
[]
no_license
xviakoh/jaspersoft-xvia-plugin
6dfca36eb27612f136edc4c206e631d8dd8470f0
c037a0568a518e858a201fda257a8fa416af3908
refs/heads/master
2021-01-01T19:35:32.905460
2015-06-18T15:21:11
2015-06-18T15:21:11
37,666,261
0
0
null
null
null
null
UTF-8
Java
false
false
1,290
java
/******************************************************************************* * Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved. * http://www.jaspersoft.com. * * Unless you have purchased a commercial license agreement from Jaspersoft, * the following license terms apply: * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package com.jaspersoft.studio.book.messages; import java.util.MissingResourceException; import java.util.ResourceBundle; public class MessagesByKeys { private static final String MESSAGES_BY_KEYS = "com.jaspersoft.studio.book.messages.messagesbykeys"; private static final ResourceBundle RB_MESSAGES_BY_KEYS = ResourceBundle.getBundle(MESSAGES_BY_KEYS); private MessagesByKeys(){ } public static String getString(String key) { try { return RB_MESSAGES_BY_KEYS.getString(key.toLowerCase()); } catch (MissingResourceException e) { return key; } } public static boolean hasTranslation(String key) { return RB_MESSAGES_BY_KEYS.containsKey(key); } }
[ "kyungseog.oh@trackvia.com" ]
kyungseog.oh@trackvia.com
0191fea42d219f3f5faac448f6823f2fb9c40ee1
9df342b8b7ecd2a9a39a585b6b84f9c19ee1506b
/src/indi/wangx/java/collection/IteratorTest.java
ebadffbe44f15005f4e039f7511db037a022f9a0
[]
no_license
WangXinW/jdk1.8-src
2abbf6771ec7d69eca457c635ca665c6c26980b9
112ff6c8844a205c158743afa0e94fc6ebd3d386
refs/heads/master
2020-07-28T20:46:53.809525
2019-10-09T03:47:20
2019-10-09T03:47:20
209,532,127
0
0
null
null
null
null
UTF-8
Java
false
false
804
java
package indi.wangx.java.collection; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.junit.Test; /** * @author 27630 * @since 20190930 */ public class IteratorTest { @Test public void testIterator() { // HashMap Iterator // ArrayList Iterator List<String> list = new ArrayList<String>(); for (int i = 0;i < 10;i++) { list.add( Integer.toString(i)); } for (String item : list) { if ("0".equals(item)) { // list.remove("0"); } } for (int i = 0;i < list.size();i++) { if ("0".equals(list.get(i))) { list.remove(i); } } Iterator<String> iter = list.iterator(); while (iter.hasNext()) { if ("0".equals(iter.next())) { iter.remove(); } } } }
[ "2763041366@qq.com" ]
2763041366@qq.com
c457169e7758c9a1adb96aab4c7e0a717e52c802
fcf62ead7c86c4c6a0c7b25270e8f9b1331578dc
/base/src/main/kotlin/com/dcc/ibase/network/request/UploadRequest.java
d6cb3ca3576b426d8614ffeb413ecf3a37759cf6
[]
no_license
dccjll/ibase
e39f9c09630c9bc836772a551e0115ce74c5a3f7
4e8eef85fd26636dfceb2344aab690cd0f8572c3
refs/heads/master
2021-08-22T14:14:04.090901
2020-04-09T10:22:17
2020-04-09T10:22:17
159,888,745
0
0
null
null
null
null
UTF-8
Java
false
false
7,945
java
package com.dcc.ibase.network.request; import com.dcc.ibase.network.body.UploadProgressRequestBody; import com.dcc.ibase.network.callback.ACallback; import com.dcc.ibase.network.callback.UCallback; import com.dcc.ibase.network.core.ApiManager; import com.dcc.ibase.network.mode.CacheResult; import com.dcc.ibase.network.mode.MediaTypes; import com.dcc.ibase.network.subscriber.ApiCallbackSubscriber; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import io.reactivex.Observable; import io.reactivex.annotations.NonNull; import io.reactivex.observers.DisposableObserver; import okhttp3.MediaType; import okhttp3.MultipartBody; import okhttp3.RequestBody; import okhttp3.internal.Util; import okio.BufferedSink; import okio.Okio; import okio.Source; /** * @Description: 上传请求 * @author: <a href="http://www.xiaoyaoyou1212.com">DAWI</a> * @date: 17/5/14 20:28. */ public class UploadRequest extends BaseHttpRequest<UploadRequest> { protected List<MultipartBody.Part> multipartBodyParts = new ArrayList<>(); protected StringBuilder stringBuilder = new StringBuilder(); public UploadRequest(String suffixUrl) { super(suffixUrl); } public UploadRequest(String suffixUrl, UCallback callback) { super(suffixUrl); this.uploadCallback = callback; } @Override protected <T> Observable<T> execute(Type type) { if (stringBuilder.length() > 0) { suffixUrl = suffixUrl + stringBuilder.toString(); } if (params != null && params.size() > 0) { Iterator<Map.Entry<String, String>> entryIterator = params.entrySet().iterator(); Map.Entry<String, String> entry; while (entryIterator.hasNext()) { entry = entryIterator.next(); if (entry != null) { multipartBodyParts.add(MultipartBody.Part.createFormData(entry.getKey(), entry.getValue())); } } } return apiService.uploadFiles(suffixUrl, multipartBodyParts).compose(this.<T>norTransformer(type)); } @Override protected <T> Observable<CacheResult<T>> cacheExecute(Type type) { return null; } @Override protected <T> void execute(ACallback<T> callback) { DisposableObserver disposableObserver = new ApiCallbackSubscriber(callback); if (super.tag != null) { ApiManager.get().add(super.tag, disposableObserver); } this.execute(getType(callback)).subscribe(disposableObserver); } public UploadRequest addUrlParam(String paramKey, String paramValue) { if (paramKey != null && paramValue != null) { if (stringBuilder.length() == 0) { stringBuilder.append("?"); } else { stringBuilder.append("&"); } stringBuilder.append(paramKey).append("=").append(paramValue); } return this; } public UploadRequest addFiles(Map<String, File> fileMap) { if (fileMap == null) { return this; } for (Map.Entry<String, File> entry : fileMap.entrySet()) { addFile(entry.getKey(), entry.getValue()); } return this; } public UploadRequest addFile(String key, File file) { return addFile(key, file, null); } public UploadRequest addFile(String key, File file, UCallback callback) { if (key == null || file == null) { return this; } RequestBody requestBody = RequestBody.create(MediaTypes.APPLICATION_OCTET_STREAM_TYPE, file); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), requestBody); this.multipartBodyParts.add(part); } return this; } public UploadRequest addImageFile(String key, File file) { return addImageFile(key, file, null); } public UploadRequest addImageFile(String key, File file, UCallback callback) { if (key == null || file == null) { return this; } RequestBody requestBody = RequestBody.create(MediaTypes.IMAGE_TYPE, file); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, file.getName(), requestBody); this.multipartBodyParts.add(part); } return this; } public UploadRequest addBytes(String key, byte[] bytes, String name) { return addBytes(key, bytes, name, null); } public UploadRequest addBytes(String key, byte[] bytes, String name, UCallback callback) { if (key == null || bytes == null || name == null) { return this; } RequestBody requestBody = RequestBody.create(MediaTypes.APPLICATION_OCTET_STREAM_TYPE, bytes); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, requestBody); this.multipartBodyParts.add(part); } return this; } public UploadRequest addStream(String key, InputStream inputStream, String name) { return addStream(key, inputStream, name, null); } public UploadRequest addStream(String key, InputStream inputStream, String name, UCallback callback) { if (key == null || inputStream == null || name == null) { return this; } RequestBody requestBody = create(MediaTypes.APPLICATION_OCTET_STREAM_TYPE, inputStream); if (callback != null) { UploadProgressRequestBody uploadProgressRequestBody = new UploadProgressRequestBody(requestBody, callback); MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, uploadProgressRequestBody); this.multipartBodyParts.add(part); } else { MultipartBody.Part part = MultipartBody.Part.createFormData(key, name, requestBody); this.multipartBodyParts.add(part); } return this; } protected RequestBody create(final MediaType mediaType, final InputStream inputStream) { return new RequestBody() { @Override public MediaType contentType() { return mediaType; } @Override public long contentLength() { try { return inputStream.available(); } catch (IOException e) { return 0; } } @Override public void writeTo(@NonNull BufferedSink sink) throws IOException { Source source = null; try { source = Okio.source(inputStream); sink.writeAll(source); } finally { Util.closeQuietly(source); } } }; } }
[ "yiyeshu1015@vip.qq.com" ]
yiyeshu1015@vip.qq.com
f16a921248c051521ef6319cef9860e7f886228a
3581ea333137a694eeec2e07da2b3c7b556ac32c
/testsuite/integration-tests/src/test/java/org/jboss/resteasy/test/resource/basic/resource/GenericEntityDoubleWriter.java
437b0fe0fd0f2f1f446d6dcd5287ffd3ade2cc9c
[ "Apache-2.0" ]
permissive
fabiocarvalho777/Resteasy
d8b39366c50d49d197d5938b97c73b1a5cb581b5
94dae2cf6866705fe409048fde78ef2316c93121
refs/heads/master
2020-12-02T16:28:18.396872
2017-07-07T18:36:57
2017-07-07T18:36:57
96,557,475
1
0
null
2017-07-07T16:41:04
2017-07-07T16:41:04
null
UTF-8
Java
false
false
2,046
java
package org.jboss.resteasy.test.resource.basic.resource; import org.jboss.logging.Logger; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; import java.io.IOException; import java.io.OutputStream; import java.lang.annotation.Annotation; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.List; @Provider @Produces("*/*") public class GenericEntityDoubleWriter implements MessageBodyWriter<List<Double>> { private static Logger logger = Logger.getLogger(GenericEntityDoubleWriter.class); public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { logger.info("DoubleWriter type: " + type.getName()); if (!List.class.isAssignableFrom(type)) { return false; } logger.info("DoubleWriter: " + genericType); if (!(genericType instanceof ParameterizedType)) { return false; } logger.info("DoubleWriter"); ParameterizedType pt = (ParameterizedType) genericType; boolean result = pt.getActualTypeArguments()[0].equals(Double.class); logger.info("Doublewriter result!!!: " + result); return result; } public long getSize(List<Double> doubles, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) { return -1; } public void writeTo(List<Double> floats, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { StringBuffer buf = new StringBuffer(); for (Double f : floats) { buf.append(f.toString()).append("D "); } entityStream.write(buf.toString().getBytes()); } }
[ "asoldano@redhat.com" ]
asoldano@redhat.com
d78c9e8cd52552297348ce11a293178f6f726d7e
7c88e6cd7c2604a9bfebd197a9f192bdddfbcb7c
/Net/src/main/java/HalfNio/NioClient.java
02a79741abbca21cb02e72b9ed691de08f90a0b9
[]
no_license
fcy-nienan/Image
1bca0a42085d681f73f41420a242e2c4b542f0e7
168bc4b5a50d5887693ac4ac44bbee3447e84105
refs/heads/develop
2022-12-24T04:33:53.026049
2022-07-27T16:31:10
2022-07-27T16:31:10
154,528,986
0
0
null
2022-12-16T01:43:43
2018-10-24T15:56:29
Java
UTF-8
Java
false
false
1,130
java
package HalfNio; import java.io.*; import java.net.Socket; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * @descripiton: * @author: fcy * @date: 2018-08-03 11:00 */ public class NioClient { public static void main(String args[]) throws Exception { ExecutorService service= Executors.newCachedThreadPool(); for(int i=0;i<444;i++){ service.submit(new Client()); } service.shutdown(); } public static void send()throws Exception{ Socket socket=new Socket("127.0.0.1",8778); OutputStream stream=socket.getOutputStream(); BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(stream)); while(true){ Thread.sleep(1000); writer.append(Thread.currentThread().getId()+":Hello World!"); writer.flush(); } } static class Client implements Runnable{ @Override public void run() { try { send(); } catch (Exception e) { e.printStackTrace(); } } } }
[ "807715333@qq.com" ]
807715333@qq.com
3bc45bf5a8e699b64016e3b46f7994e2e9998198
3632c9297cd8a75ebfcad71e7543296bab3efcbf
/bc2/src/shared/java/com/topfinance/ebo/msg/Saps37300101.java
6ef0add952db4c4c9243f1670f52fb510bb5b23a
[]
no_license
luboid/leontestbed
9850500166bd42378ae35f92768a198b1c2dd7c2
eb1c704b1ea77a62097375239ecb2c025c7a19dc
refs/heads/master
2021-01-10T21:48:41.905677
2015-09-24T10:28:18
2015-09-24T10:28:18
41,542,498
1
0
null
null
null
null
UTF-8
Java
false
false
2,119
java
package com.topfinance.ebo.msg; import com.topfinance.ebo.msg.JaxbMapping; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.CascadeType; import javax.persistence.FetchType; import javax.persistence.OneToMany; /** * Saps37300101 generated by ParseSampleXml */ @Entity @Table(name = "T_C2_SAPS_373") public class Saps37300101 implements java.io.Serializable { // Fields @JaxbMapping(objPath="") private Integer id; @JaxbMapping(objPath="fndsOfPoolMgmt.fndsOfPoolMgmtInf.brnchList[0].mmbId") private String mmbId; private Saps37300101Hdr fid; /** default constructor */ public Saps37300101() { } /** * Returns the id * * @return the id */ @Id @Column(name = "ID", unique = true, nullable = false, precision = 22, scale = 0) @SequenceGenerator(name = "CFG_SEQUNCE_GEN", sequenceName = "S_CFG_SEQUNCE") @GeneratedValue(strategy = GenerationType.AUTO, generator = "CFG_SEQUNCE_GEN") public Integer getid() { return id; } /** * Sets the id * * @param newid the new id */ public void setid(Integer newid) { id = newid; } /** * Returns the mmbId * * @return the mmbId */ @Column(name = "MMBID") public String getMmbId() { return mmbId; } /** * Sets the mmbId * * @param newMmbId the new mmbId */ public void setMmbId(String newMmbId) { mmbId = newMmbId; } @ManyToOne(cascade=CascadeType.ALL) @JoinColumn(name="FID", nullable=false, updatable=false) public Saps37300101Hdr getFid() { return fid; } public void setFid(Saps37300101Hdr fid) { this.fid = fid; } }
[ "youranklean@gmail.com" ]
youranklean@gmail.com
b1b8093e8e9cb5f7230ce894d8802efc1eb15c2b
3de85c8d0aa02af359cc2108d84734014b6dd1f4
/src/ooxml/java/org/apache/poi/xssf/binary/XSSFBRichTextString.java
d9bfc8137cedb2cb509c6162915085dadca4de06
[]
no_license
kinow/poi
30695fb6a7a07027df9e53e33dc2a1ac8b5a0e59
bfeeba5eb8f03d0d7ac588a30712ec4e66f107aa
refs/heads/trunk
2021-01-22T21:45:40.637254
2017-03-18T18:46:15
2017-03-18T18:46:15
85,472,973
0
0
null
2017-03-19T12:07:46
2017-03-19T12:07:46
null
UTF-8
Java
false
false
2,332
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.poi.xssf.binary; import org.apache.poi.ss.usermodel.Font; import org.apache.poi.util.Internal; import org.apache.poi.util.NotImplemented; import org.apache.poi.xssf.usermodel.XSSFRichTextString; /** * Wrapper class around String so that we can use it in Comment. * Nothing has been implemented yet except for {@link #getString()}. * * @since 3.16-beta3 */ @Internal class XSSFBRichTextString extends XSSFRichTextString { private final String string; XSSFBRichTextString(String string) { this.string = string; } @Override @NotImplemented public void applyFont(int startIndex, int endIndex, short fontIndex) { } @Override @NotImplemented public void applyFont(int startIndex, int endIndex, Font font) { } @Override @NotImplemented public void applyFont(Font font) { } @Override @NotImplemented public void clearFormatting() { } @Override public String getString() { return string; } @Override public int length() { return string.length(); } @Override @NotImplemented public int numFormattingRuns() { return 0; } @Override @NotImplemented public int getIndexOfFormattingRun(int index) { return 0; } @Override @NotImplemented public void applyFont(short fontIndex) { } }
[ "tallison@apache.org" ]
tallison@apache.org
e59afab792d655dc183591ed86c9ed5022ca279a
9f3fb735b67bf2734c301cadf88f844a74b2f41c
/tensquare_base/src/test/java/leetCode/Solution4.java
b6c392a05d1c621d22119d83682359c0150e308b
[]
no_license
CXLYJ/tensquare_parent
a682ee3fddcac2a9b5983fcccefc4ffcf8f03bab
d8760820d5a66414b1df50362d86ab58a12479bb
refs/heads/master
2022-06-24T19:40:15.488773
2020-11-19T07:07:02
2020-11-19T07:07:02
180,058,563
2
3
null
2022-06-17T02:10:14
2019-04-08T02:57:53
Java
UTF-8
Java
false
false
1,388
java
package leetCode; /** * @author :lyj * @email: : iclyj@iclyj.cn * @date :2019/5/13 11:22 * * LeetCode-大于给定元素的最小元素 */ public class Solution4 { /** * 题目描述 * * 题目描述:给定一个有序的字符数组 letters 和一个字符 target, * 要求找出 letters 中大于 target 的最小字符,如果找不到就返回第 1 个字符。 * * Input: letters = ["c", "f", "j"] target = "d" Output: "f" Input: letters = ["c", "f", "j"] target = "k" Output: "c" */ /** * 思路 * * 给定数组是有序的,给定一个key值。每次查找最中间的值,如果相等,就返回对应下标,如果key大于最中间的值, * 则在数组的右半边继续查找,如果小于,则在数组左半边查找,最终有两种结果,一种是找到并返回下标,第二种是没找到 * @param letters * @param target * @return */ public char nextGreatestLetter(char[] letters, char target){ int n = letters.length; int l = 0, h = n - 1; while (l <= h){ int m = l + (h - 1) / 2; if (target >= letters[m]){ l = m + 1; } else { h = m - 1; } } return 1 < n ? letters[l] : letters[0]; } }
[ "1421805850@qq.com" ]
1421805850@qq.com
dadf161e366646a3819f47ef1d6114781f3cb2f7
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/platform/bootstrap/gensrc/de/hybris/platform/promotionengineservices/promotionengine/report/data/PromotionEngineResults.java
9015773e9e260becf23d9e979735108b11e49da4
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
2,500
java
/* * ---------------------------------------------------------------- * --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! * --- Generated at Jan 17, 2020 11:49:29 AM * ---------------------------------------------------------------- * * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.promotionengineservices.promotionengine.report.data; import java.io.Serializable; import de.hybris.platform.promotionengineservices.promotionengine.report.data.OrderEntryLevelPromotionEngineResults; import de.hybris.platform.promotionengineservices.promotionengine.report.data.OrderLevelPromotionEngineResults; import java.util.List; public class PromotionEngineResults implements Serializable { /** Default serialVersionUID value. */ private static final long serialVersionUID = 1L; /** <i>Generated property</i> for <code>PromotionEngineResults.orderLevelPromotionEngineResults</code> property defined at extension <code>promotionengineservices</code>. */ private OrderLevelPromotionEngineResults orderLevelPromotionEngineResults; /** <i>Generated property</i> for <code>PromotionEngineResults.orderEntryLevelPromotionEngineResults</code> property defined at extension <code>promotionengineservices</code>. */ private List<OrderEntryLevelPromotionEngineResults> orderEntryLevelPromotionEngineResults; public PromotionEngineResults() { // default constructor } public void setOrderLevelPromotionEngineResults(final OrderLevelPromotionEngineResults orderLevelPromotionEngineResults) { this.orderLevelPromotionEngineResults = orderLevelPromotionEngineResults; } public OrderLevelPromotionEngineResults getOrderLevelPromotionEngineResults() { return orderLevelPromotionEngineResults; } public void setOrderEntryLevelPromotionEngineResults(final List<OrderEntryLevelPromotionEngineResults> orderEntryLevelPromotionEngineResults) { this.orderEntryLevelPromotionEngineResults = orderEntryLevelPromotionEngineResults; } public List<OrderEntryLevelPromotionEngineResults> getOrderEntryLevelPromotionEngineResults() { return orderEntryLevelPromotionEngineResults; } }
[ "travis.d.crawford@accenture.com" ]
travis.d.crawford@accenture.com
c4a49766b6ac7499bbc3cd1ed40e4e0cb0f704c0
57e4d7ee5ed61538ab5139505226bd1b52f1a122
/websocket-spring-reactive/src/main/java/me/silloy/study/websocket/netty/config/ReactiveJavaClientWebSocket.java
666eb34cf7db36cc7a9b11a5e9be611fcbb90089
[]
no_license
silloy/rookie
e9bda43b3de5daf5674511748387f026250b2354
fc448f0d2293e92a67aad3778efb025830e1c954
refs/heads/main
2023-03-08T20:46:23.567851
2023-03-06T08:05:40
2023-03-06T08:05:40
304,278,168
0
2
null
null
null
null
UTF-8
Java
false
false
941
java
package me.silloy.study.websocket.netty.config; import java.net.URI; import java.time.Duration; import org.springframework.web.reactive.socket.WebSocketMessage; import org.springframework.web.reactive.socket.client.ReactorNettyWebSocketClient; import org.springframework.web.reactive.socket.client.WebSocketClient; import reactor.core.publisher.Mono; public class ReactiveJavaClientWebSocket { public static void main(String[] args) throws InterruptedException { WebSocketClient client = new ReactorNettyWebSocketClient(); client.execute( URI.create("ws://127.0.0.1:8080/event-emitter"), session -> session.send( Mono.just(session.textMessage("event-spring-reactive-client-websocket"))) .thenMany(session.receive() .map(WebSocketMessage::getPayloadAsText) .log()) .then()) .block(Duration.ofSeconds(10L)) ; } }
[ "sshzh90@gmail.com" ]
sshzh90@gmail.com
94bdf37e3c011d97df9a0928ad3565ad67bd2636
f4d09c0998873e7b0f7c2a2138f70f72e1cca0fe
/app/docksidestage/dbflute/exbhv/MemberFollowingBhv.java
0024c82f725edb21d40553763913197d25964af5
[ "Apache-2.0" ]
permissive
dbflute-example/dbflute-example-on-play2java
aec77bff569418a8e51dc52ad02eec68b218d03a
85f39e9cbc0d7b9dcd620f5f373909df93edf607
refs/heads/master
2022-06-15T07:09:42.916040
2022-05-14T06:33:18
2022-05-14T06:33:18
27,213,603
2
0
null
2015-09-08T06:23:03
2014-11-27T07:16:37
Java
UTF-8
Java
false
false
966
java
/* * Copyright 2014-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package docksidestage.dbflute.exbhv; import docksidestage.dbflute.bsbhv.BsMemberFollowingBhv; /** * The behavior of MEMBER_FOLLOWING. * <p> * You can implement your original methods here. * This class remains when re-generating. * </p> * @author DBFlute(AutoGenerator) */ public class MemberFollowingBhv extends BsMemberFollowingBhv { }
[ "dbflute@gmail.com" ]
dbflute@gmail.com
5750bec88a0e9962ae60aa023d78d1a66c69c52d
665110e99befea67ea7dcdd6939e313cff471654
/src/main/java/net/smert/frameworkgl/collision/narrowphase/algorithm/NarrowphaseAlgorithm.java
3599116128dc1c66fd6b317069b3400161705f30
[ "Apache-2.0" ]
permissive
kovertopz/Framework-GL
187cd6771c5ed0192da3564a22c6281956bb2ce2
1504f4746c80bf0667f62ecea2569f8d37a46184
refs/heads/master
2021-06-07T08:22:46.693230
2017-07-08T09:10:17
2017-07-08T09:10:17
24,876,706
10
1
null
null
null
null
UTF-8
Java
false
false
1,046
java
/** * Copyright 2012 Jason Sorensen (sorensenj@smert.net) * * 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 net.smert.frameworkgl.collision.narrowphase.algorithm; import net.smert.frameworkgl.collision.CollisionGameObject; import net.smert.frameworkgl.collision.narrowphase.ContactData; /** * * @author Jason Sorensen <sorensenj@smert.net> */ public interface NarrowphaseAlgorithm { public int processCollision(CollisionGameObject collisionObject0, CollisionGameObject collisionObject1, ContactData contactData); }
[ "git@smert.net" ]
git@smert.net
b9aa7f333b5180204bbd90f1b5041501c4301a0d
5bcc7ba7ffa8b03720ed54a12c661c9cfd4e751d
/zkclient/src/main/java/edu/uw/zookeeper/protocol/client/OperationClientExecutor.java
ddb21b4ef2808004ee82023d10ec9f8803e9618c
[ "Apache-2.0" ]
permissive
lisaglendenning/zookeeper-lite
2b1165038272a4b86d96674967df8c00247069cc
2a9679ddb196b3f65d687d67d7ef534e162fe6d9
refs/heads/master
2020-05-17T12:13:13.230458
2015-07-02T21:53:50
2015-07-02T21:53:50
9,090,323
10
1
null
null
null
null
UTF-8
Java
false
false
5,390
java
package edu.uw.zookeeper.protocol.client; import java.lang.ref.SoftReference; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.concurrent.ScheduledExecutorService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; import edu.uw.zookeeper.common.LoggingFutureListener; import edu.uw.zookeeper.common.Promise; import edu.uw.zookeeper.common.SettableFuturePromise; import edu.uw.zookeeper.common.TimeValue; import edu.uw.zookeeper.protocol.Message; import edu.uw.zookeeper.protocol.ConnectMessage; import edu.uw.zookeeper.protocol.Operation; import edu.uw.zookeeper.protocol.ProtocolConnection; public class OperationClientExecutor<C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> extends PendingQueueClientExecutor<Operation.Request, Message.ServerResponse<?>, PendingQueueClientExecutor.RequestTask<Operation.Request, Message.ServerResponse<?>>, C, PendingQueueClientExecutor.PendingPromiseTask> { public static <C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> OperationClientExecutor<C> newInstance( ConnectMessage.Request request, C connection, ScheduledExecutorService executor) { return newInstance( request, AssignXidProcessor.newInstance(), connection, executor); } public static <C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> OperationClientExecutor<C> newInstance( ConnectMessage.Request request, AssignXidProcessor xids, C connection, ScheduledExecutorService executor) { return newInstance( ConnectTask.connect(request, connection), xids, connection, TimeValue.milliseconds(request.getTimeOut()), executor); } public static <C extends ProtocolConnection<? super Message.ClientSession, ? extends Operation.Response,?,?,?>> OperationClientExecutor<C> newInstance( ListenableFuture<ConnectMessage.Response> session, AssignXidProcessor xids, C connection, TimeValue timeOut, ScheduledExecutorService executor) { return new OperationClientExecutor<C>( xids, LogManager.getLogger(OperationClientExecutor.class), session, connection, timeOut, executor); } protected final OperationActor actor; protected final AssignXidProcessor xids; protected OperationClientExecutor( AssignXidProcessor xids, Logger logger, ListenableFuture<ConnectMessage.Response> session, C connection, TimeValue timeOut, ScheduledExecutorService scheduler) { super(logger, session, connection, timeOut, scheduler); this.xids = xids; this.actor = new OperationActor(logger); } @Override public ListenableFuture<Message.ServerResponse<?>> submit( Operation.Request request, Promise<Message.ServerResponse<?>> promise) { RequestTask<Operation.Request, Message.ServerResponse<?>> task = RequestTask.of(request, promise); LoggingFutureListener.listen(logger(), task); if (! send(task)) { task.cancel(true); } return Futures.nonCancellationPropagating(task); } @Override public void onSuccess(PendingPromiseTask result) { try { Message.ServerResponse<?> response = result.get(); result.getPromise().set(response); } catch (ExecutionException e) { result.getPromise().setException(e.getCause()); onFailure(e.getCause()); } catch (CancellationException e) { result.getPromise().cancel(true); } catch (InterruptedException e) { throw new AssertionError(e); } } @Override protected OperationActor actor() { return actor; } @Override protected Logger logger() { return actor.logger(); } protected class OperationActor extends ForwardingActor { protected OperationActor( Logger logger) { super(connection, logger); } @Override protected boolean apply(RequestTask<Operation.Request, Message.ServerResponse<?>> input) { if (! input.isDone()) { // Assign xids here so we can properly track message request -> response Message.ClientRequest<?> message = (Message.ClientRequest<?>) xids.apply(input.task()); PendingPromiseTask task = PendingPromiseTask.create( input.promise(), new SoftReference<Message.ClientRequest<?>>(message), SettableFuturePromise.<Message.ServerResponse<?>>create()); if (! pending.send(task)) { input.cancel(true); } } return true; } } }
[ "lisa@glendenning.net" ]
lisa@glendenning.net
db781b5af48d5a35e121bca686754553caf9c3db
456d43c584fb66f65c6a7147cdd22595facf8bd9
/jpa/deferred/src/main/java/example/model/Customer598.java
5f4ada83cfcc882d2971fd81ca5ace9c38f51a8c
[ "Apache-2.0" ]
permissive
niushapaks/spring-data-examples
283eec991014e909981055f48efe67ff1e6e19e6
1ad228b04523e958236d58ded302246bba3c1e9b
refs/heads/main
2023-08-21T14:25:55.998574
2021-09-29T13:14:33
2021-09-29T13:14:33
411,679,335
1
0
Apache-2.0
2021-09-29T13:11:03
2021-09-29T13:11:02
null
UTF-8
Java
false
false
624
java
package example.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Customer598 { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String firstName; private String lastName; protected Customer598() {} public Customer598(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @Override public String toString() { return String.format("Customer598[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName); } }
[ "ogierke@pivotal.io" ]
ogierke@pivotal.io
ab803467de0b378f0f612ad49e04ec042d88d323
30998a3486f3fad0b336cd7aa8e5ab20fa91181e
/src/main/java/com/liuqi/business/controller/admin/AdminServiceChargeController.java
085bb8099842f027753a6be6b21c781a97e649d5
[]
no_license
radar9494/Radar-Star-admin
cbf8c9a0b5b782d2bcc281dfd5ee78ce5b31f086
9e4622d3932c2cd2219152814fc91858030cc196
refs/heads/main
2023-02-24T00:07:03.150304
2021-01-26T02:51:38
2021-01-26T02:51:38
332,949,996
3
0
null
null
null
null
UTF-8
Java
false
false
3,654
java
package com.liuqi.business.controller.admin; import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateTime; import com.liuqi.base.BaseAdminController; import com.liuqi.base.BaseService; import com.liuqi.business.model.CurrencyModelDto; import com.liuqi.business.model.ServiceChargeModel; import com.liuqi.business.model.ServiceChargeModelDto; import com.liuqi.business.service.CurrencyService; import com.liuqi.business.service.ServiceChargeService; import com.liuqi.response.ReturnResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Date; import java.util.List; @Controller @RequestMapping("/admin/serviceCharge") public class AdminServiceChargeController extends BaseAdminController<ServiceChargeModel, ServiceChargeModelDto> { @Autowired private ServiceChargeService serviceChargeService; //jsp基础路径 private final static String JSP_BASE_PTH = "admin"; //模块 private final static String BASE_MODUEL = "serviceCharge"; //默认为""表示可以使用add和update。 重写add或update时,原有方法禁止使用 NOT_OPERATE="add,update" private final static String NOT_OPERATE = "add,update"; @Override public BaseService getBaseService() { return this.serviceChargeService; } @Override public String getJspBasePath() { return JSP_BASE_PTH; } @Override public String getBaseModuel() { return BASE_MODUEL; } @Override public String getNotOperate() { return NOT_OPERATE; } @Override public String getDefaultExportName() { return DEFAULT_EXPORTNAME; } /*******待修改 排序 导出**********************************************************************************************************/ //默认导出名称 private final static String DEFAULT_EXPORTNAME = "手续费"; @Override public String[] getDefaultExportHeaders() { String[] headers = {"主键", "创建时间", "更新时间", "备注", "版本号", "统计日期", "币种id", "手续费"}; return headers; } @Override public String[] getDefaultExportColumns() { String[] columns = {"id", "createTime", "updateTime", "remark", "version", "calcDate", "currencyName", "charge"}; return columns; } /*******自己代码**********************************************************************************************************/ @Autowired private CurrencyService currencyService; @Override protected void toListHandle(ModelMap modelMap, HttpServletRequest request, HttpServletResponse response) { List<CurrencyModelDto> list = currencyService.getAll(); modelMap.put("list", list); } /** * 手动汇总 * * @param remark * @param request * @return */ @RequestMapping(value = "/totalRecharge") @ResponseBody public ReturnResponse totalRecharge(String remark, HttpServletRequest request) { try { Date date = DateTime.now().offset(DateField.DAY_OF_YEAR, -1); serviceChargeService.totalCharge(date); return ReturnResponse.backSuccess(); } catch (Exception e) { e.printStackTrace(); return ReturnResponse.backFail(e.getMessage()); } } }
[ "radar131419@gmail.com" ]
radar131419@gmail.com
ed60d4059b40bc6352bd36f7d226538d1a436688
70cbaeb10970c6996b80a3e908258f240cbf1b99
/WiFi万能钥匙dex1-dex2jar.jar.src/com/linksure/apservice/a/c/x.java
f45a0af8d2af75d25420fad5ceef5c78575569ec
[]
no_license
nwpu043814/wifimaster4.2.02
eabd02f529a259ca3b5b63fe68c081974393e3dd
ef4ce18574fd7b1e4dafa59318df9d8748c87d37
refs/heads/master
2021-08-28T11:11:12.320794
2017-12-12T03:01:54
2017-12-12T03:01:54
113,553,417
2
1
null
null
null
null
UTF-8
Java
false
false
657
java
package com.linksure.apservice.a.c; import com.linksure.apservice.a.a.f; import com.linksure.apservice.a.d.a.b; import com.linksure.apservice.a.f.b.a; import com.linksure.apservice.a.j; final class x extends b.a { x(v paramv, String paramString, j paramj) {} public final void a() { long l = v.a(this.c).b(this.a); this.b.a(Long.valueOf(l)); } public final void a(Exception paramException) { this.b.a(new b(paramException)); } } /* Location: /Users/hanlian/Downloads/WiFi万能钥匙dex1-dex2jar.jar!/com/linksure/apservice/a/c/x.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "lianh@jumei.com" ]
lianh@jumei.com
651faae9e67383dda046febc7b5a9fdf8def87fc
9640134296cea3cb9011aac322807a2b3abb4204
/src/main/java/com/simmi1969/my1stjhipsterapp1/web/rest/errors/BadRequestAlertException.java
a9d88ed954c2ac4d709b6bb05e9be14200cb176b
[]
no_license
simmi1969/jhipster-sample-application1
12859220ad81df7c67b717b8c8ea82951adb7810
836885f75cdf78e58307e8bcf141707245aa4f36
refs/heads/main
2023-02-21T22:59:36.596701
2021-01-23T07:54:44
2021-01-23T07:54:44
332,157,029
0
0
null
null
null
null
UTF-8
Java
false
false
1,332
java
package com.simmi1969.my1stjhipsterapp1.web.rest.errors; import java.net.URI; import java.util.HashMap; import java.util.Map; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; public class BadRequestAlertException extends AbstractThrowableProblem { private static final long serialVersionUID = 1L; private final String entityName; private final String errorKey; public BadRequestAlertException(String defaultMessage, String entityName, String errorKey) { this(ErrorConstants.DEFAULT_TYPE, defaultMessage, entityName, errorKey); } public BadRequestAlertException(URI type, String defaultMessage, String entityName, String errorKey) { super(type, defaultMessage, Status.BAD_REQUEST, null, null, null, getAlertParameters(entityName, errorKey)); this.entityName = entityName; this.errorKey = errorKey; } public String getEntityName() { return entityName; } public String getErrorKey() { return errorKey; } private static Map<String, Object> getAlertParameters(String entityName, String errorKey) { Map<String, Object> parameters = new HashMap<>(); parameters.put("message", "error." + errorKey); parameters.put("params", entityName); return parameters; } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
2d9ec3068801d1f8d9a2f10cd9d04ef1833ad7c5
b44018861005dff02b9174a13144b12059e5865d
/src/main/java/jetbrick/io/resource/AbstractResource.java
88f1ffed18127d45a3f7795f742d293265be128e
[ "Apache-2.0" ]
permissive
gyk001/jetbrick-commons
40fe94802e51c03f1e1de136b2acd76a31aa710b
751bf934f01b93ad341be7ada99550350f4b8cd9
refs/heads/master
2020-04-05T23:18:54.682711
2015-05-24T05:10:49
2015-05-24T05:10:49
36,156,711
0
0
null
2015-05-24T04:57:15
2015-05-24T04:57:15
null
UTF-8
Java
false
false
3,188
java
/** * Copyright 2013-2014 Guoqiang Chen, Shanghai, China. All rights reserved. * * Author: Guoqiang Chen * Email: subchen@gmail.com * WebURL: https://github.com/subchen * * 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 jetbrick.io.resource; import java.io.File; import java.net.URI; import java.net.URL; import java.nio.charset.Charset; import jetbrick.io.IoUtils; import jetbrick.util.PathUtils; public abstract class AbstractResource implements Resource { protected String relativePathName; @Override public void setRelativePathName(String relativePathName) { this.relativePathName = relativePathName; } @Override public String getRelativePathName() { return relativePathName; } /** * @deprecated replaced by {@link #setRelativePathName(String)} */ @Deprecated public void setPath(String path) { this.relativePathName = path; } /** * @deprecated replaced by {@link #getRelativePathName()} */ @Deprecated @Override public String getPath() { return relativePathName; } @Override public byte[] toByteArray() throws ResourceNotFoundException { return IoUtils.toByteArray(openStream()); } @Override public char[] toCharArray(Charset charset) throws ResourceNotFoundException { return IoUtils.toCharArray(openStream(), charset); } @Override public String toString(Charset charset) throws ResourceNotFoundException { return IoUtils.toString(openStream(), charset); } @Override public File getFile() throws UnsupportedOperationException { return PathUtils.urlAsFile(getURL()); } @Override public URI getURI() throws UnsupportedOperationException { try { return getURL().toURI(); } catch (java.net.URISyntaxException e) { throw new IllegalStateException(e); } } @Override public URL getURL() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @Override public String getFileName() { int slash = relativePathName.lastIndexOf('/'); if (slash >= 0) { return relativePathName.substring(slash + 1); } return relativePathName; } @Override public boolean exist() { return false; } @Override public boolean isDirectory() { return false; } @Override public boolean isFile() { return false; } @Override public long length() { return -1; } @Override public long lastModified() { return 0; } }
[ "subchen@gmail.com" ]
subchen@gmail.com
cd3650f4ff11ad3b936c0153066069d666a6981f
1f268ea50698d7b48c6ea2fe35a6e2a56d5dd6f5
/pml_api/lib/Jena-2.5.6/src/com/hp/hpl/jena/db/test/TestReifier.java
3eab4b02b158a0b7a858b8a091f46be859b3ce4f
[ "BSD-3-Clause", "Apache-2.0" ]
permissive
paulopinheiro1234/inference-web
ece8dcb2aa383120f0557655c403c6216fb086c3
6b1fe6c500e4904ece40dcd01b704f0a9ac0c672
refs/heads/master
2020-04-15T20:45:00.864333
2019-01-10T07:19:43
2019-01-10T07:19:43
165,006,572
0
0
null
null
null
null
UTF-8
Java
false
false
3,654
java
/* (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP [See end of file] $Id: TestReifier.java,v 1.22 2008/01/02 12:08:14 andy_seaborne Exp $ */ package com.hp.hpl.jena.db.test; import com.hp.hpl.jena.db.*; import com.hp.hpl.jena.graph.*; import com.hp.hpl.jena.graph.test.*; import com.hp.hpl.jena.shared.*; import junit.framework.*; /** Derived from the original reifier tests, and then folded back in by using an abstract test base class. @author kers, csayers. */ public class TestReifier extends AbstractTestReifier { private int count; private Graph properties; private IDBConnection con; public TestReifier( String name ) { super(name); } /** Initialiser required for MetaTestGraph interface. */ public TestReifier( Class graphClass, String name, ReificationStyle style ) { super( name ); } public static TestSuite suite() { return MetaTestGraph.suite( TestReifier.class, LocalGraphRDB.class ); } /** LocalGraphRDB - an extension of GraphRDB that fixes the connection to TestReifier's connection, passes in the appropriate reification style, uses the default properties of the connection, and gives each graph a new name exploiting the count. @author kers */ public class LocalGraphRDB extends GraphRDB { public LocalGraphRDB( ReificationStyle style ) { super( con, "testGraph-" + count ++, properties, styleRDB( style ), true ); } } public void setUp() { con = TestConnection.makeAndCleanTestConnection(); properties = con.getDefaultModelProperties().getGraph(); } public void tearDown() throws Exception { con.close(); } public Graph getGraph( ReificationStyle style ) { return new LocalGraphRDB( style ); } public Graph getGraph() { return getGraph( ReificationStyle.Minimal ); } } /* (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
[ "pp3223@gmail.com" ]
pp3223@gmail.com
341d3c1cb7abbeb45045e529a1f0df90f74c9cf4
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Jsoup-87/org.jsoup.parser.HtmlTreeBuilderState/BBC-F0-opt-60/tests/8/org/jsoup/parser/HtmlTreeBuilderState_ESTest_scaffolding.java
26d3141d0e8c9c5161bf91343017317c8c2f06fa
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
5,005
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Thu Oct 14 00:10:35 GMT 2021 */ package org.jsoup.parser; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; @EvoSuiteClassExclude public class HtmlTreeBuilderState_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.jsoup.parser.HtmlTreeBuilderState"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { /*No java.lang.System property to set*/ } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(HtmlTreeBuilderState_ESTest_scaffolding.class.getClassLoader() , "org.jsoup.parser.HtmlTreeBuilderState$18", "org.jsoup.parser.HtmlTreeBuilderState$19", "org.jsoup.parser.HtmlTreeBuilderState$16", "org.jsoup.parser.HtmlTreeBuilderState$17", "org.jsoup.parser.HtmlTreeBuilderState$14", "org.jsoup.parser.TreeBuilder", "org.jsoup.parser.Token$StartTag", "org.jsoup.parser.HtmlTreeBuilderState$15", "org.jsoup.nodes.DocumentType", "org.jsoup.nodes.LeafNode", "org.jsoup.nodes.Element", "org.jsoup.parser.HtmlTreeBuilderState$12", "org.jsoup.parser.HtmlTreeBuilderState$13", "org.jsoup.parser.HtmlTreeBuilderState$10", "org.jsoup.parser.HtmlTreeBuilderState$Constants", "org.jsoup.parser.HtmlTreeBuilderState$11", "org.jsoup.parser.Token", "org.jsoup.parser.Token$Tag", "org.jsoup.parser.Token$Character", "org.jsoup.parser.HtmlTreeBuilderState$2", "org.jsoup.parser.HtmlTreeBuilderState$1", "org.jsoup.nodes.Node", "org.jsoup.parser.HtmlTreeBuilderState$4", "org.jsoup.parser.HtmlTreeBuilderState$3", "org.jsoup.parser.Token$EndTag", "org.jsoup.parser.HtmlTreeBuilderState", "org.jsoup.parser.HtmlTreeBuilderState$23", "org.jsoup.parser.HtmlTreeBuilderState$9", "org.jsoup.parser.HtmlTreeBuilderState$24", "org.jsoup.parser.HtmlTreeBuilderState$21", "org.jsoup.parser.HtmlTreeBuilderState$22", "org.jsoup.parser.HtmlTreeBuilderState$6", "org.jsoup.parser.HtmlTreeBuilderState$5", "org.jsoup.parser.HtmlTreeBuilderState$20", "org.jsoup.parser.HtmlTreeBuilderState$8", "org.jsoup.parser.HtmlTreeBuilder", "org.jsoup.parser.HtmlTreeBuilderState$7", "org.jsoup.nodes.FormElement" ); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(HtmlTreeBuilderState_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.jsoup.parser.HtmlTreeBuilderState", "org.jsoup.parser.HtmlTreeBuilderState$Constants", "org.jsoup.parser.TokeniserState" ); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
8c03fa50b98b8fe891899d9465eb77f8170ae221
ea3b9ab73e44e84e42b7d756e660f8076f783dfd
/com.siteview.kernel.core/src/COM/dragonflow/Utils/ParameterParser.java
16915ffcdc7d61419521daff134fc80fe65d3021
[]
no_license
SiteView/NEWECC9.2
b34cf894f9e6fc7136af7d539ebd99bae48ba116
86e95c40fc481c4aad5a2480ac6a08fe64df1cb1
refs/heads/master
2016-09-05T23:05:16.432869
2013-01-17T02:37:46
2013-01-17T02:37:46
5,685,712
0
1
null
null
null
null
UTF-8
Java
false
false
4,302
java
/* * Created on 2005-2-9 3:06:20 * * .java * * History: * */ package COM.dragonflow.Utils; /** * Comment for <code></code> * * @author * @version 0.0 * * */ import java.util.LinkedList; import java.util.StringTokenizer; // Referenced classes of package COM.dragonflow.Utils: // TextUtils public class ParameterParser { private String _paramString; private java.util.List _paramsList; private java.util.List _holdList; private int _shellToEmulate; private boolean _insideQuotedString; private static final String BACKSLASH_LITERAL_MARKER = "SITEVIEW_BACKSLASH_LITERAL"; private static final String QUOTE_LITERAL_MARKER = "SITEVIEW_QUOTE_LITERAL"; static final String UNTERMINATED_STRING_ERROR = "ERROR: UNTERMINATED QUOTED STRING"; public static final int BASH_SHELL = 0; public static final int WINDOWS_SHELL = 1; public ParameterParser(String s) { _paramString = s; _shellToEmulate = 0; } public ParameterParser(String s, int i) throws java.lang.IllegalArgumentException { _paramString = s; if(i < 0 || i > 1) { throw new IllegalArgumentException("Unknown shell"); } else { _shellToEmulate = i; return; } } public java.util.List doParse() { preProcessEscapedCharacters(); java.util.StringTokenizer stringtokenizer = new StringTokenizer(_paramString, " \\\"", true); _paramsList = new LinkedList(); _holdList = new LinkedList(); _insideQuotedString = false; while(stringtokenizer.hasMoreTokens()) { String s = stringtokenizer.nextToken(); if(s.equals("\"")) { if(_insideQuotedString) { addHoldListToParamsList(); } _insideQuotedString = !_insideQuotedString; } else { processToken(s); } } if(_insideQuotedString) { _paramsList.add("ERROR: UNTERMINATED QUOTED STRING"); } return _paramsList; } private void preProcessEscapedCharacters() { _paramString = COM.dragonflow.Utils.TextUtils.replaceString(_paramString, "\\\\", "SITEVIEW_BACKSLASH_LITERALSITEVIEW_BACKSLASH_LITERAL"); _paramString = COM.dragonflow.Utils.TextUtils.replaceString(_paramString, "\\\"", "SITEVIEW_BACKSLASH_LITERALSITEVIEW_QUOTE_LITERAL"); if(_shellToEmulate == 1) { _paramString = COM.dragonflow.Utils.TextUtils.replaceString(_paramString, "\\", "SITEVIEW_BACKSLASH_LITERAL"); } else { _paramString = COM.dragonflow.Utils.TextUtils.replaceString(_paramString, "\\", ""); } } private void processToken(String s) { s = COM.dragonflow.Utils.TextUtils.replaceString(s, "SITEVIEW_BACKSLASH_LITERAL", "\\"); s = COM.dragonflow.Utils.TextUtils.replaceString(s, "SITEVIEW_QUOTE_LITERAL", "\""); if(_insideQuotedString) { _holdList.add(s); } else if(!s.equals(" ")) { _paramsList.add(s); } } private void addHoldListToParamsList() { String s = ""; for(int i = 0; i < _holdList.size(); i++) { s = s + (String)_holdList.get(i); } _paramsList.add(s); _holdList.clear(); } public static String arrayCmdToStringCmd(String as[]) { StringBuffer stringbuffer = new StringBuffer(); for(int i = 0; i < as.length; i++) { if(stringbuffer.length() > 0) { stringbuffer.append(" "); } boolean flag = !as[i].startsWith("\""); if(flag) { stringbuffer.append("\""); } stringbuffer.append(as[i]); if(flag) { stringbuffer.append("\""); } } return stringbuffer.toString(); } }
[ "lihua.zhong@dragonflow.com" ]
lihua.zhong@dragonflow.com
2254ccc8fd6eb2f7042a6b14c3ca83c8ed5a2333
123467174737c4d33a7fd54fb61d93f9f1e710d2
/src/com/robo/store/view/CustomDurationScroller.java
305e03ae735c7eb01b24c61eff119908f1cb4db5
[]
no_license
meixililu/robostore
3a789ae42708090ea5fc7df88aa7c53ad6a30277
f72171080230d58dfc6ef460912640575dbd04e2
refs/heads/master
2021-01-21T12:07:01.793952
2016-05-19T15:28:16
2016-05-19T15:28:16
37,256,964
0
0
null
null
null
null
UTF-8
Java
false
false
1,247
java
package com.robo.store.view; import android.content.Context; import android.view.animation.Interpolator; import android.widget.Scroller; /** * CustomDurationScroller * * @author <a href="http://www.trinea.cn" target="_blank">Trinea</a> 2014-3-2 */ public class CustomDurationScroller extends Scroller { private double scrollFactor = 1; public CustomDurationScroller(Context context) { super(context); } public CustomDurationScroller(Context context, Interpolator interpolator) { super(context, interpolator); } /** * not exist in android 2.3 * * @param context * @param interpolator * @param flywheel */ // @SuppressLint("NewApi") // public CustomDurationScroller(Context context, Interpolator interpolator, boolean flywheel){ // super(context, interpolator, flywheel); // } /** * Set the factor by which the duration will change */ public void setScrollDurationFactor(double scrollFactor) { this.scrollFactor = scrollFactor; } @Override public void startScroll(int startX, int startY, int dx, int dy, int duration) { super.startScroll(startX, startY, dx, dy, (int)(duration * scrollFactor)); } }
[ "meixililulu@163.com" ]
meixililulu@163.com
614d4e6be857c4f15db1ad65f72bc1e02400d592
cd4802766531a9ccf0fb54ca4b8ea4ddc15e31b5
/java/com/l2jmobius/gameserver/model/events/impl/character/npc/OnAttackableHate.java
a51372b2518406d19eb320c83bd645c51a5bda02
[]
no_license
singto53/underground
8933179b0d72418f4b9dc483a8f8998ef5268e3e
94264f5168165f0b17cc040955d4afd0ba436557
refs/heads/master
2021-01-13T10:30:20.094599
2016-12-11T20:32:47
2016-12-11T20:32:47
76,455,182
0
1
null
null
null
null
UTF-8
Java
false
false
1,634
java
/* * This file is part of the L2J Mobius project. * * 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 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 * 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.l2jmobius.gameserver.model.events.impl.character.npc; import com.l2jmobius.gameserver.model.actor.L2Attackable; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.events.EventType; import com.l2jmobius.gameserver.model.events.impl.IBaseEvent; /** * @author UnAfraid */ public class OnAttackableHate implements IBaseEvent { private final L2Attackable _npc; private final L2PcInstance _activeChar; private final boolean _isSummon; public OnAttackableHate(L2Attackable npc, L2PcInstance activeChar, boolean isSummon) { _npc = npc; _activeChar = activeChar; _isSummon = isSummon; } public final L2Attackable getNpc() { return _npc; } public final L2PcInstance getActiveChar() { return _activeChar; } public boolean isSummon() { return _isSummon; } @Override public EventType getType() { return EventType.ON_NPC_HATE; } }
[ "MobiusDev@7325c9f8-25fd-504a-9f63-8876acdc129b" ]
MobiusDev@7325c9f8-25fd-504a-9f63-8876acdc129b
69a3ed2111139091a2bf15eadfd1bac115ca7266
0687bfb68c2b6ebd6951ea1ab2a9154e88193b24
/backend/rmncha-collection-service/src/main/java/org/sdrc/rmncha/util/AreaMapObject.java
3d998e06fab815c29e1e33fd248e1286f8800c65
[]
no_license
SDRC-India/ADARSSH
c689ae9c93cbbc1d44ae875f80182caae29ca42b
e5563449292bfc9e02744d9a70f2db5546d89fd9
refs/heads/main
2023-03-30T02:26:51.648770
2021-04-01T07:42:06
2021-04-01T07:42:06
353,615,854
0
0
null
null
null
null
UTF-8
Java
false
false
220
java
package org.sdrc.rmncha.util; import java.util.List; import java.util.Map; import lombok.Data; @Data public class AreaMapObject { private List<Integer> areaList; private Map<Integer, Integer> areaMap; }
[ "ratikanta131@gmail.com" ]
ratikanta131@gmail.com
e81ca65afa57f8b4fd183cfa9af6a2038ead864a
4cb30cd27ae9083fdcf072143ab3f008bdfd9a7a
/com/planet_ink/coffee_mud/Abilities/Prayers/Prayer_AnimateSkeleton.java
0c04597f46a0b5d3211b331f96acb3ca496259ff
[ "Apache-2.0" ]
permissive
Banbury/CoffeeMud
f786f075017b3e0b32ba81afa55ff6a88e13fd30
a35c14498bf550673bab30e885806ddacc047256
refs/heads/master
2021-01-18T05:27:54.995262
2015-01-20T08:10:35
2015-01-20T08:10:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,608
java
package com.planet_ink.coffee_mud.Abilities.Prayers; import com.planet_ink.coffee_mud.core.interfaces.*; import com.planet_ink.coffee_mud.core.*; import com.planet_ink.coffee_mud.core.collections.*; import com.planet_ink.coffee_mud.Abilities.interfaces.*; import com.planet_ink.coffee_mud.Areas.interfaces.*; import com.planet_ink.coffee_mud.Behaviors.interfaces.*; import com.planet_ink.coffee_mud.CharClasses.interfaces.*; import com.planet_ink.coffee_mud.Commands.interfaces.*; import com.planet_ink.coffee_mud.Common.interfaces.*; import com.planet_ink.coffee_mud.Exits.interfaces.*; import com.planet_ink.coffee_mud.Items.interfaces.*; import com.planet_ink.coffee_mud.Libraries.interfaces.*; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; import java.util.*; /* Copyright 2003-2015 Bo Zimmerman 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. */ @SuppressWarnings("rawtypes") public class Prayer_AnimateSkeleton extends Prayer { @Override public String ID() { return "Prayer_AnimateSkeleton"; } private final static String localizedName = CMLib.lang().L("Animate Skeleton"); @Override public String name() { return localizedName; } @Override public int classificationCode(){return Ability.ACODE_PRAYER|Ability.DOMAIN_DEATHLORE;} @Override public int abstractQuality(){ return Ability.QUALITY_INDIFFERENT;} @Override public int enchantQuality(){return Ability.QUALITY_INDIFFERENT;} @Override public long flags(){return Ability.FLAG_UNHOLY;} @Override protected int canTargetCode(){return CAN_ITEMS;} public void makeSkeletonFrom(Room R, DeadBody body, MOB mob, int level) { String race="a"; if((body.charStats()!=null)&&(body.charStats().getMyRace()!=null)) race=CMLib.english().startWithAorAn(body.charStats().getMyRace().name()).toLowerCase(); String description=body.geteMobDescription(); if(description.trim().length()==0) description="It looks dead."; else description+="\n\rIt also looks dead."; final MOB newMOB=CMClass.getMOB("GenUndead"); newMOB.setName(L("@x1 skeleton",race)); newMOB.setDescription(description); newMOB.setDisplayText(L("@x1 skeleton is here",race)); newMOB.basePhyStats().setLevel(level+(super.getX1Level(mob)*2)+super.getXLEVELLevel(mob)); newMOB.baseCharStats().setStat(CharStats.STAT_GENDER,body.charStats().getStat(CharStats.STAT_GENDER)); newMOB.baseCharStats().setMyRace(CMClass.getRace("Skeleton")); newMOB.baseCharStats().setBodyPartsFromStringAfterRace(body.charStats().getBodyPartsAsString()); final Ability P=CMClass.getAbility("Prop_StatTrainer"); if(P!=null) { P.setMiscText("NOTEACH STR=16 INT=10 WIS=10 CON=10 DEX=15 CHA=2"); newMOB.addNonUninvokableEffect(P); } newMOB.recoverCharStats(); newMOB.basePhyStats().setAttackAdjustment(CMLib.leveler().getLevelAttack(newMOB)); newMOB.basePhyStats().setDamage(CMLib.leveler().getLevelMOBDamage(newMOB)); CMLib.factions().setAlignment(newMOB,Faction.Align.EVIL); newMOB.baseState().setHitPoints(15*newMOB.basePhyStats().level()); newMOB.baseState().setMovement(CMLib.leveler().getLevelMove(newMOB)); newMOB.basePhyStats().setArmor(CMLib.leveler().getLevelMOBArmor(newMOB)); newMOB.addNonUninvokableEffect(CMClass.getAbility("Prop_ModExperience")); newMOB.baseState().setMana(0); final Behavior B=CMClass.getBehavior("Aggressive"); if((B!=null)&&(mob!=null)){ B.setParms("+NAMES \"-"+mob.Name()+"\""); } if(B!=null) newMOB.addBehavior(B); newMOB.recoverCharStats(); newMOB.recoverPhyStats(); newMOB.recoverMaxState(); newMOB.resetToMaxState(); newMOB.text(); newMOB.bringToLife(R,true); CMLib.beanCounter().clearZeroMoney(newMOB,null); R.showOthers(newMOB,null,CMMsg.MSG_OK_ACTION,L("<S-NAME> appears!")); int it=0; while(it<R.numItems()) { final Item item=R.getItem(it); if((item!=null)&&(item.container()==body)) { final CMMsg msg2=CMClass.getMsg(newMOB,body,item,CMMsg.MSG_GET,null); newMOB.location().send(newMOB,msg2); final CMMsg msg4=CMClass.getMsg(newMOB,item,null,CMMsg.MSG_GET,null); newMOB.location().send(newMOB,msg4); final CMMsg msg3=CMClass.getMsg(newMOB,item,null,CMMsg.MSG_WEAR,null); newMOB.location().send(newMOB,msg3); if(!newMOB.isMine(item)) it++; else it=0; } else it++; } body.destroy(); newMOB.setStartRoom(null); R.show(newMOB,null,CMMsg.MSG_OK_VISUAL,L("<S-NAME> begin(s) to rise!")); R.recoverRoomStats(); } @Override public boolean invoke(MOB mob, Vector commands, Physical givenTarget, boolean auto, int asLevel) { final Physical target=getAnyTarget(mob,commands,givenTarget,Wearable.FILTER_UNWORNONLY); if(target==null) return false; if(target==mob) { mob.tell(L("@x1 doesn't look dead yet.",target.name(mob))); return false; } if(!(target instanceof DeadBody)) { mob.tell(L("You can't animate that.")); return false; } final DeadBody body=(DeadBody)target; if(body.isPlayerCorpse()||(body.getMobName().length()==0) ||((body.charStats()!=null)&&(body.charStats().getMyRace()!=null)&&(body.charStats().getMyRace().racialCategory().equalsIgnoreCase("Undead")))) { mob.tell(L("You can't animate that.")); return false; } if(!super.invoke(mob,commands,givenTarget,auto,asLevel)) return false; final boolean success=proficiencyCheck(mob,0,auto); if(success) { final CMMsg msg=CMClass.getMsg(mob,target,this,verbalCastCode(mob,target,auto),auto?"":L("^S<S-NAME> @x1 to animate <T-NAMESELF> as a skeleton.^?",prayForWord(mob))); if(mob.location().okMessage(mob,msg)) { mob.location().send(mob,msg); makeSkeletonFrom(mob.location(),body,mob,1); } } else return beneficialWordsFizzle(mob,target,L("<S-NAME> @x1 to animate <T-NAMESELF>, but fail(s) miserably.",prayForWord(mob))); // return whether it worked return success; } }
[ "bo@zimmers.net" ]
bo@zimmers.net
e34cf096323a490910eefc10b3a47bf603a7f214
6b0dcff85194eddf0706e867162526b972b441eb
/kernel/api/fabric3-spi/src/main/java/org/fabric3/spi/federation/TopologyListener.java
4bb6c7fe65fb7e00a1cdad7f5f9755686c2c63f3
[]
no_license
jbaeck/fabric3-core
802ae3889169d7cc5c2f3e2704cfe3338931ec76
55aaa7b2228c9bf2c2630cc196938d48a71274ff
refs/heads/master
2021-01-18T15:27:25.959653
2012-11-04T00:36:36
2012-11-04T00:36:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,283
java
/* * Fabric3 * Copyright (c) 2009-2012 Metaform Systems * * Fabric3 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version, with the * following exception: * * Linking this software statically or dynamically with other * modules is making a combined work based on this software. * Thus, the terms and conditions of the GNU General Public * License cover the whole combination. * * As a special exception, the copyright holders of this software * give you permission to link this software with independent * modules to produce an executable, regardless of the license * terms of these independent modules, and to copy and distribute * the resulting executable under terms of your choice, provided * that you also meet, for each linked independent module, the * terms and conditions of the license of that module. An * independent module is a module which is not derived from or * based on this software. If you modify this software, you may * extend this exception to your version of the software, but * you are not obligated to do so. If you do not wish to do so, * delete this exception statement from your version. * * Fabric3 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 Fabric3. * If not, see <http://www.gnu.org/licenses/>. */ package org.fabric3.spi.federation; /** * Receives callbacks when a domain topology changes. */ public interface TopologyListener { /** * Callback when a runtime joins a domain. * * @param name the runtime name */ void onJoin(String name); /** * Callback when a runtime leaves a domain. * * @param name the runtime name */ void onLeave(String name); /** * Callback when a runtime is elected leader in a domain. * * @param name the runtime name */ void onLeaderElected(String name); }
[ "jim.marino@gmail.com" ]
jim.marino@gmail.com
775f5d8cdbc031a299df963e6c911e03d26203f7
a17dd1e9f5db1c06e960099c13a5b70474d90683
/core/src/main/java/jp/co/sint/webshop/service/catalog/RelatedSearchQueryGift.java
b60f808eb758bfd26cd4b1e9d3c34f7a7f23217a
[]
no_license
giagiigi/ec_ps
4e404afc0fc149c9614d0abf63ec2ed31d10bebb
6eb19f4d14b6f3a08bfc2c68c33392015f344cdd
refs/heads/master
2020-12-14T07:20:24.784195
2015-02-09T10:00:44
2015-02-09T10:00:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,317
java
package jp.co.sint.webshop.service.catalog; import java.util.ArrayList; import java.util.List; import jp.co.sint.webshop.data.AbstractQuery; import jp.co.sint.webshop.data.DatabaseUtil; import jp.co.sint.webshop.data.dto.Gift; import jp.co.sint.webshop.data.dto.GiftCommodity; import jp.co.sint.webshop.utility.SqlDialect; import jp.co.sint.webshop.utility.StringUtil; public class RelatedSearchQueryGift extends AbstractQuery <RelatedGift> { /** * */ private static final long serialVersionUID = 1L; /** * */ public RelatedSearchQueryGift() { } /** * 該当の商品コードに関連付いているギフトの一覧を取得する */ public RelatedSearchQueryGift createRelatedGiftSearchQuery(RelatedSearchConditionBaseCommodity condition) { StringBuilder builder = new StringBuilder(); List<Object> params = new ArrayList<Object>(); builder.append(" SELECT A.SHOP_CODE, " + " A.GIFT_CODE, " + " A.GIFT_NAME, " + " A.GIFT_PRICE, " + " A.GIFT_DESCRIPTION, " + " A.GIFT_TAX_TYPE, " + " B.COMMODITY_CODE " + " FROM (" + DatabaseUtil.getSelectAllQuery(Gift.class) + " WHERE SHOP_CODE = ?) A " + " LEFT OUTER JOIN (" + DatabaseUtil.getSelectAllQuery(GiftCommodity.class) + " WHERE SHOP_CODE = ? AND " + " COMMODITY_CODE = ?) B " + " ON A.SHOP_CODE = B.SHOP_CODE AND " + " A.GIFT_CODE = B.GIFT_CODE "); params.add(condition.getShopCode()); params.add(condition.getShopCode()); params.add(condition.getCommodityCode()); builder.append(" WHERE 1 = 1 "); if (StringUtil.hasValue(condition.getSearchEffectualCodeStart()) && StringUtil.hasValue(condition.getSearchEffectualCodeEnd())) { builder.append(" AND A.GIFT_CODE BETWEEN ? AND ?"); params.add(condition.getSearchEffectualCodeStart()); params.add(condition.getSearchEffectualCodeEnd()); } else if (StringUtil.hasValue(condition.getSearchEffectualCodeStart())) { builder.append(" AND A.GIFT_CODE >= ?"); params.add(condition.getSearchEffectualCodeStart()); } else if (StringUtil.hasValue(condition.getSearchEffectualCodeEnd())) { builder.append(" AND A.GIFT_CODE <= ?"); params.add(condition.getSearchEffectualCodeEnd()); } if (StringUtil.hasValue(condition.getSearchEffectualName())) { builder.append(" AND "); builder.append(SqlDialect.getDefault().getLikeClausePattern("A.GIFT_NAME")); String commodityName = SqlDialect.getDefault().escape(condition.getSearchEffectualName()); commodityName = "%" + commodityName + "%"; params.add(commodityName); } builder.append(" ORDER BY A.GIFT_CODE"); setSqlString(builder.toString()); setParameters(params.toArray()); setPageNumber(condition.getCurrentPage()); setPageSize(condition.getPageSize()); return this; } /** * */ public Class <RelatedGift> getRowType() { return RelatedGift.class; } }
[ "fengperfect@126.com" ]
fengperfect@126.com
cc5d38ff2f574e0a6b25d5bc46608d06e6ca101f
0fd4f55b08bf6cee6a505f2346926a1e4c9bde24
/Design Patterns Geeks for Geeks/IteratorPattern/NameRespository.java
1188d100e3399bb76d3cde9bfe12354d19df5045
[]
no_license
david2999999/Advanced-Java
1d7089a050fa1b8e1b574aa4855b10363b1ad383
78f17038c75be8c5d3456d92ac81841fb502bf56
refs/heads/master
2021-07-19T19:03:06.061598
2020-04-08T19:37:40
2020-04-08T19:37:40
128,837,674
1
0
null
null
null
null
UTF-8
Java
false
false
689
java
package IteratorPattern; public class NameRespository implements Container { public String name[] = {"Robert", "John", "Julie", "Lora"}; @Override public Iterator getIterator() { return new NameIterator(); } private class NameIterator implements Iterator { int index; @Override public boolean hasNext() { if (index < name.length) { return true; } return false; } @Override public Object next() { if (hasNext()) { return name[index++]; } return null; } } }
[ "djiang86@binghamton.edu" ]
djiang86@binghamton.edu
745b59fe855cbfa0906c2051466dbea7c890e323
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_cec88aceddfd7887ee9490a85b8d571d14540db7/CardListFragment/9_cec88aceddfd7887ee9490a85b8d571d14540db7_CardListFragment_s.java
34f89015bea49766513c2f6fc17268f1a20cc5bb
[]
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,699
java
package edu.mit.mobile.android.livingpostcards; import java.io.IOException; import android.content.ContentUris; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.graphics.drawable.Drawable; import android.graphics.drawable.InsetDrawable; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.ListFragment; import android.support.v4.app.LoaderManager.LoaderCallbacks; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.AdapterView.OnItemClickListener; import android.widget.TextView; import android.widget.Toast; import com.stackoverflow.ArrayUtils; import edu.mit.mobile.android.imagecache.ImageCache; import edu.mit.mobile.android.imagecache.ImageLoaderAdapter; import edu.mit.mobile.android.imagecache.SimpleThumbnailCursorAdapter; import edu.mit.mobile.android.livingpostcards.auth.Authenticator; import edu.mit.mobile.android.livingpostcards.data.Card; import edu.mit.mobile.android.locast.data.PrivatelyAuthorable; import edu.mit.mobile.android.locast.sync.LocastSyncService; public class CardListFragment extends ListFragment implements LoaderCallbacks<Cursor>, OnItemClickListener { private static final String[] FROM = { Card.COL_TITLE, Card.COL_AUTHOR, Card.COL_COVER_PHOTO, Card.COL_THUMBNAIL }; private static final int[] TO = { R.id.title, R.id.author, R.id.card_media_thumbnail, R.id.card_media_thumbnail }; private static final String[] PROJECTION = ArrayUtils.concat(new String[] { Card._ID, Card.COL_PRIVACY, Card.COL_AUTHOR_URI, Card.COL_WEB_URL }, FROM); private SimpleThumbnailCursorAdapter mAdapter; ImageCache mImageCache; public static final String ARG_CARD_DIR_URI = "uri"; private Uri mCards = Card.ALL_BUT_DELETED; private float mDensity; private static final String TAG = CardListFragment.class.getSimpleName(); private static final int[] IMAGE_IDS = new int[] { R.id.card_media_thumbnail }; public CardListFragment() { super(); } public static CardListFragment instantiate(Uri cardDir) { final Bundle b = new Bundle(); b.putParcelable(ARG_CARD_DIR_URI, cardDir); final CardListFragment f = new CardListFragment(); f.setArguments(b); return f; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final Bundle args = getArguments(); if (args != null) { final Uri newUri = args.getParcelable(ARG_CARD_DIR_URI); mCards = newUri != null ? newUri : mCards; } } @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mImageCache = ImageCache.getInstance(getActivity()); mAdapter = new SimpleThumbnailCursorAdapter(getActivity(), R.layout.card_list_item, null, FROM, TO, IMAGE_IDS, 0) { @Override public void bindView(View v, Context context, Cursor c) { super.bindView(v, context, c); ((TextView) v.findViewById(R.id.title)).setText(Card.getTitle(context, c)); } }; setListAdapter(new ImageLoaderAdapter(getActivity(), mAdapter, mImageCache, IMAGE_IDS, 133, 100, ImageLoaderAdapter.UNIT_DIP)); getListView().setOnItemClickListener(this); getLoaderManager().initLoader(0, null, this); LocastSyncService.startExpeditedAutomaticSync(getActivity(), mCards); registerForContextMenu(getListView()); mDensity = getActivity().getResources().getDisplayMetrics().density; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { return inflater.inflate(R.layout.card_list_fragment, container, false); } @Override public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) { return new CursorLoader(getActivity(), mCards, PROJECTION, null, null, null); } @Override public void onLoadFinished(Loader<Cursor> arg0, Cursor c) { mAdapter.swapCursor(c); } @Override public void onLoaderReset(Loader<Cursor> arg0) { mAdapter.swapCursor(null); } @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final Uri item = ContentUris.withAppendedId(mCards, id); startActivity(new Intent(Intent.ACTION_VIEW, item)); } @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { getActivity().getMenuInflater().inflate(R.menu.activity_card_view, menu); final Cursor c = mAdapter.getCursor(); if (c == null) { return; } final String myUserUri = Authenticator.getUserUri(getActivity()); final boolean isEditable = PrivatelyAuthorable.canEdit(myUserUri, c); menu.findItem(R.id.delete).setVisible(isEditable); menu.findItem(R.id.edit).setVisible(isEditable); menu.setHeaderTitle(Card.getTitle(getActivity(), c)); Drawable icon; try { icon = mImageCache.loadImage(0, Uri.parse(c.getString(c.getColumnIndexOrThrow(Card.COL_COVER_PHOTO))), (int) (133 * mDensity), (int) (100 * mDensity)); if (icon != null) { menu.setHeaderIcon(new InsetDrawable(icon, (int) (5 * mDensity))); } } catch (final IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (final IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } private void send(Cursor c) { final String mWebUrl = c.getString(c.getColumnIndexOrThrow(Card.COL_WEB_URL)); if (mWebUrl == null) { Toast.makeText(getActivity(), R.string.err_share_intent_no_web_url_editable, Toast.LENGTH_LONG).show(); return; } startActivity(Card.createShareIntent(getActivity(), mWebUrl, Card.getTitle(getActivity(), c))); } @Override public boolean onContextItemSelected(MenuItem item) { AdapterView.AdapterContextMenuInfo info; try { info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo(); } catch (final ClassCastException e) { Log.e(TAG, "bad menuInfo", e); return false; } final Uri card = ContentUris.withAppendedId(mCards, info.id); switch (item.getItemId()) { case R.id.share: send(mAdapter.getCursor()); return true; case R.id.edit: startActivity(new Intent(Intent.ACTION_EDIT, card)); return true; case R.id.delete: startActivity(new Intent(Intent.ACTION_DELETE, card)); return true; default: return super.onContextItemSelected(item); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
0372f40960a217e921637d62323eb1c2283dcb2b
b203bbf64ac3bde4827fa484c5d96a50d8874a90
/src/com/neeraj/design_patterns/behavioural/chain_of_responsibility/Logger.java
f282ffed5c5435aa940db7f62a84e5c9d99db69b
[]
no_license
neerajjain92/DesignPatterns
e4921bea47f3bd3013b4f9bf4a8487d92b5d3e6e
48af00b0c9f46ff5f1ec1c8fb2629453a427c836
refs/heads/master
2022-11-24T00:18:59.265574
2020-07-30T19:17:39
2020-07-30T19:17:39
283,839,611
0
0
null
null
null
null
UTF-8
Java
false
false
442
java
package com.neeraj.design_patterns.behavioural.chain_of_responsibility; /** * @author neeraj on 13/07/20 * Copyright (c) 2019, DesignPatterns. * All rights reserved. */ public class Logger extends Handler { public Logger(Handler next) { super(next); } @Override public boolean doHandle(HttpRequest httpRequest) { System.out.println("Logging the request..." + httpRequest); return false; } }
[ "neeraj_jain@apple.com" ]
neeraj_jain@apple.com
629b04bbe7e05d54da0687f99cd7540dc84fc05c
c3bb807d1c1087254726c4cd249e05b8ed595aaa
/src/oc/whfb/units/im/IMErzlektordesSigmar.java
709cae448f74572d08f2575d64495011c7aa8f2e
[]
no_license
spacecooky/OnlineCodex30k
f550ddabcbe6beec18f02b3e53415ed5c774d92f
db6b38329b2046199f6bbe0f83a74ad72367bd8d
refs/heads/master
2020-12-31T07:19:49.457242
2014-05-04T14:23:19
2014-05-04T14:23:19
55,958,944
0
0
null
null
null
null
ISO-8859-1
Java
false
false
2,941
java
package oc.whfb.units.im; import oc.BuildaHQ; import oc.BuildaMenu; import oc.Eintrag; import oc.OptionsEinzelUpgrade; import oc.RuestkammerStarter; public class IMErzlektordesSigmar extends Eintrag { OptionsEinzelUpgrade oe; RuestkammerStarter rkEquipment; RuestkammerStarter rkMount; RuestkammerStarter rkBanner; RuestkammerStarter rkMagic; boolean altar = false; boolean set = false; boolean genSelected = false; OptionsEinzelUpgrade oGen; public IMErzlektordesSigmar() { name = BuildaHQ.translate("Erzlektor des Sigmar"); grundkosten = 125; seperator(12); add(oGen = new OptionsEinzelUpgrade(ID, randAbstand, cnt, "", BuildaHQ.translate("General"), 0, false)); seperator(); rkEquipment = new RuestkammerStarter(ID, randAbstand, cnt, "IMEquipment", ""); rkEquipment.initKammer(true, false, false, false, false); rkEquipment.setButtonText(BuildaHQ.translate("Ausrüstung")); add(rkEquipment); seperator(); rkMount = new RuestkammerStarter(ID, randAbstand, cnt, "IMMount", ""); rkMount.initKammer(true, false, false, false, false, false, false, false); rkMount.setButtonText(BuildaHQ.translate("Reittier")); add(rkMount); seperator(); rkMagic = new RuestkammerStarter(ID, randAbstand, cnt, "IMMagicItems", ""); rkMagic.initKammer(false, true, true, true, false, true, false); rkMagic.setButtonText(BuildaHQ.translate("Magische Gegenstände")); add(rkMagic); complete(); } @Override public void refreshen() { int sigmar = BuildaHQ.getCountFromInformationVector("IM_SIGMAR"); sigmar++; if(!set){ BuildaHQ.setInformationVectorValue("IM_SIGMAR", sigmar); } set = true; BuildaHQ.getChooserGruppe(3).addSpezialAuswahl(BuildaHQ.translate("Kern Flagellanten")); BuildaHQ.refreshEntries(3); boolean genGlobal = ( BuildaHQ.getCountFromInformationVector("Gen") > 0 ? true : false ); if(genGlobal && !genSelected) oGen.setAktiv(false); else oGen.setAktiv(true); if(oGen.isSelected()) { genSelected = true; BuildaHQ.setInformationVectorValue("Gen", 1); } else { if(genSelected) { genSelected = false; BuildaHQ.setInformationVectorValue("Gen", 0); BuildaHQ.refreshEntries(2); } } /*if (ico != null ) panel.remove(ico); if ( BuildaMenu.bilderAneigen.isSelected() ) { ico = BuildaHQ.createPictureJLabel(BuildaHQ.IMAGEPFAD + reflectionKennung.toLowerCase() + "/" + getClass().getSimpleName() + JPG); ico.setLocation((290 - (ico.getSize().width - 100) / 2), 30); panel.add(ico); }*/ } @Override public void deleteYourself() { super.deleteYourself(); int sigmar = BuildaHQ.getCountFromInformationVector("IM_SIGMAR"); sigmar--; BuildaHQ.setInformationVectorValue("IM_SIGMAR", sigmar); if(sigmar == 0){ BuildaHQ.getChooserGruppe(3).removeSpezialAuswahl("Kern Flagellanten"); BuildaHQ.refreshEntries(3); } if(genSelected) { BuildaHQ.setInformationVectorValue("Gen", 0); } } }
[ "spacecooky@b551ab73-3a01-0010-9fae-47f737f7a8aa" ]
spacecooky@b551ab73-3a01-0010-9fae-47f737f7a8aa
2f11670bcbc7c87f7472a8c14f8d838a07bb1c8a
e7e497b20442a4220296dea1550091a457df5a38
/main_project/oce-java-tester-backup/src/com/xiaonei/xcetest/invoke/AccountTester.java
f199b993d827d850a55723ca6c2609603aa1c15a
[]
no_license
gunner14/old_rr_code
cf17a2dedf8dfcdcf441d49139adaadc770c0eea
bb047dc88fa7243ded61d840af0f8bad22d68dee
refs/heads/master
2021-01-17T18:23:28.154228
2013-12-02T23:45:33
2013-12-02T23:45:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,305
java
package com.xiaonei.xcetest.invoke; import java.util.Date; import junit.framework.TestCase; import mop.hi.oce.adapter.AccountAdapter; import mop.hi.oce.adapter.impl.AccountAdapterImpl; import mop.hi.oce.domain.model.Deposit; import mop.hi.oce.domain.model.Expenditure; import mop.hi.svc.model.RollbackException; public class AccountTester extends TestCase{ public AccountAdapter adapter = new AccountAdapterImpl(); public void test1() throws RollbackException { int [] fids = { -1 }; int [] uids = {230105116 }; int [] rmb = { 100 }; for(int i = 0; i< fids.length; i++){ Deposit dep = new Deposit(); dep.setFid(fids[i]); dep.setRMB(rmb[i]); dep.setTimestamp(new Date()); dep.setUserId(uids[i]); dep.setXNB(rmb[i]); adapter.inc(dep); System.out.println(uids[i]); } } public void test2() throws RollbackException { Expenditure exp = new Expenditure(); exp.setDescription("-1"); exp.setProductName("-1"); exp.setProductType("-1"); exp.setTimestamp(new Date()); exp.setUserId(200080602); exp.setXNB(87); adapter.dec(exp); } public void test3() { int [] uids = {200080602 }; for(int i = 0 ; i< uids.length; i++) { System.out.print(uids[i]); System.out.print("="); System.out.println(adapter.getAccount(uids[i]).getXNB()); } } }
[ "liyong19861014@gmail.com" ]
liyong19861014@gmail.com
94178cd965c7331209f6083e01c58f97cfb50cbe
1a5b960f23f9a4bf8895a2579984edd6cf4089e6
/samples/src/java/org/jpox/samples/embedded/EmbeddedObject2.java
69d544f86f74226ff0ded2af3e8d1e5b66f8f057
[ "Apache-2.0" ]
permissive
nonstans/tests
8f1dd632301518f35ba120599ffa6daceafe47ea
7d62fc4508e1fa829a91d6fcd40b7c062424f77f
refs/heads/master
2020-03-11T03:49:58.382939
2018-12-03T12:46:04
2018-12-03T12:46:04
129,760,005
0
0
null
2018-04-16T14:52:10
2018-04-16T14:52:09
null
UTF-8
Java
false
false
1,212
java
/********************************************************************** Copyright (c) 2016 Andy Jefferson and others. 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. Contributors: ... **********************************************************************/ package org.jpox.samples.embedded; import java.util.HashSet; import java.util.Set; /** * Embedded 1-1 object, used by EmbeddedOwner2. */ public class EmbeddedObject2 { String name; Set<String> stringSet = new HashSet<>(); public EmbeddedObject2(String name) { this.name = name; } public Set<String> getStringSet() { return stringSet; } public String getName() { return name; } }
[ "andy@datanucleus.org" ]
andy@datanucleus.org
136478cfd3a41cd629609bc652f81ae43f0c63e9
ce8379ba7e71d91578ebf930ba95b8dd0b196746
/jooby/src/main/java/io/jooby/annotation/PathParam.java
0e039efde50211efd334387312dba08cbdfe6782
[ "Apache-2.0" ]
permissive
jooby-project/jooby
965e927574f829c7e55447961f4ffaa71a4bec86
4b613504eb6c265856b2aa6035d26827eef33f00
refs/heads/3.x
2023-09-03T05:21:03.310467
2023-08-28T17:30:40
2023-08-28T17:30:40
25,446,835
1,799
311
Apache-2.0
2023-09-12T17:14:23
2014-10-20T02:03:16
Java
UTF-8
Java
false
false
736
java
/* * Jooby https://jooby.io * Apache License Version 2.0 https://jooby.io/LICENSE.txt * Copyright 2014 Edgar Espina */ package io.jooby.annotation; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * Allow access to path variable from MVC route method. * * <pre>{@code * &#64;Path("/:id") * public String findById(&#64;PathParam String id) { * ... * } * }</pre> */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface PathParam { /** * Path pattern. Default <code>/</code>. * * @return Path pattern. Default <code>/</code>. */ String value() default ""; }
[ "espina.edgar@gmail.com" ]
espina.edgar@gmail.com
01d485edd6e6b1396453bc8f4a7ba387b673f5e0
2df4793e4f113ad42629268b28d8f3287f906758
/启发式搜索与演化算法/HESA_assignment1/src/ontology/avatar/MovingAvatar.java
4ecf11b3f09b2b0a51da910d157434a266ef0fe1
[ "GPL-3.0-or-later", "MIT" ]
permissive
jocelyn2002/NJUAI_CodingHW
7c692a08fb301f5cac146fef6da3f94d5043f2e9
002c5ecbad671b75059290065db73a7152c98db9
refs/heads/main
2023-04-29T06:25:46.607063
2021-05-25T02:45:58
2021-05-25T02:45:58
448,436,119
5
1
MIT
2022-01-16T02:06:27
2022-01-16T02:06:26
null
UTF-8
Java
false
false
8,079
java
package ontology.avatar; import java.awt.Dimension; import java.util.ArrayList; import core.vgdl.VGDLSprite; import core.competition.CompetitionParameters; import core.content.SpriteContent; import core.game.Game; import core.player.Player; import ontology.Types; import ontology.Types.ACTIONS; import tools.*; /** * Created with IntelliJ IDEA. * User: Diego * Date: 22/10/13 * Time: 18:04 * This is a Java port from Tom Schaul's VGDL - https://github.com/schaul/py-vgdl */ public class MovingAvatar extends VGDLSprite { public ArrayList<Types.ACTIONS> actions; public ArrayList<Types.ACTIONS> actionsNIL; public Player player; private int playerID; private double score = 0.0; private Types.WINNER winState = Types.WINNER.NO_WINNER; /** * Disqualified flag, moved from Game class to individual players, * as there may be more than 1 in a game; variable still in Game * class for single player games to keep back-compatibility */ protected boolean is_disqualified; //Avatar can have any KeyHandler system. We use KeyInput by default. private KeyHandler ki; public Types.MOVEMENT lastMovementType = Types.MOVEMENT.STILL; public MovingAvatar() { } public MovingAvatar(Vector2d position, Dimension size, SpriteContent cnt) { //Init the sprite this.init(position, size); //Specific class default parameter values. loadDefaults(); //Parse the arguments. this.parseParameters(cnt); } protected void loadDefaults() { super.loadDefaults(); actions = new ArrayList<Types.ACTIONS>(); actionsNIL = new ArrayList<Types.ACTIONS>(); color = Types.WHITE; speed = 1; is_avatar = true; is_disqualified = false; } public void postProcess() { //Define actions here first. if(actions.size()==0) { actions.add(Types.ACTIONS.ACTION_LEFT); actions.add(Types.ACTIONS.ACTION_RIGHT); actions.add(Types.ACTIONS.ACTION_DOWN); actions.add(Types.ACTIONS.ACTION_UP); } super.postProcess(); //A separate array with the same actions, plus NIL. for(Types.ACTIONS act : actions) { actionsNIL.add(act); } actionsNIL.add(Types.ACTIONS.ACTION_NIL); } /** * This update call is for the game tick() loop. * @param game current state of the game. */ public void updateAvatar(Game game, boolean requestInput, boolean[] actionMask) { lastMovementType = Types.MOVEMENT.STILL; Direction action; if (requestInput || actionMask == null) { //Sets the input mask for this cycle. ki.setMask(getPlayerID()); //Get the input from the player. requestPlayerInput(game); //Map from the action mask to a Vector2D action. action = Utils.processMovementActionKeys(ki.getMask(), getPlayerID()); } else { action = Utils.processMovementActionKeys(actionMask, getPlayerID()); } //Apply the physical movement. applyMovement(game, action); } public void applyMovement(Game game, Direction action) { //this.physics.passiveMovement(this); if (physicstype != Types.GRID) super.updatePassive(); lastMovementType = this.physics.activeMovement(this, action, speed); } /** * Requests the controller's input, setting the game.ki.action mask with the processed data. * @param game */ protected void requestPlayerInput(Game game) { ElapsedCpuTimer ect = new ElapsedCpuTimer(); ect.setMaxTimeMillis(CompetitionParameters.ACTION_TIME); Types.ACTIONS action; if (game.no_players > 1) { action = this.player.act(game.getObservationMulti(playerID), ect.copy()); } else { action = this.player.act(game.getObservation(), ect.copy()); } if(action == null){ action = ACTIONS.ACTION_NIL; } if (CompetitionParameters.TIME_CONSTRAINED && ect.exceededMaxTime()) { long exceeded = -ect.remainingTimeMillis(); if (ect.elapsedMillis() > CompetitionParameters.ACTION_TIME_DISQ) { //The agent took too long to replay. The game is over and the agent is disqualified System.out.println("Too long: " + playerID + "(exceeding " + (exceeded) + "ms): controller disqualified."); game.disqualify(playerID); } else { System.out.println("Overspent: " + playerID + "(exceeding " + (exceeded) + "ms): applying ACTION_NIL."); } action = Types.ACTIONS.ACTION_NIL; } if (action.equals(Types.ACTIONS.ACTION_ESCAPE)) { game.abort(); } else if (!actions.contains(action)) { action = Types.ACTIONS.ACTION_NIL; } this.player.logAction(action); game.setAvatarLastAction(action, getPlayerID()); ki.reset(getPlayerID()); ki.setAction(action, getPlayerID()); } public void updateUse(Game game) { //Nothing to do by default. } /** * Gets the key handler of this avatar. * @return - KeyHandler object. */ public KeyHandler getKeyHandler() { return ki; } /** * Sets the key handler of this avatar. * @param k - new KeyHandler object. */ public void setKeyHandler(KeyHandler k) { if (k instanceof KeyInput) ki = new KeyInput(); else ki = k; } /** * Checks whether this player is disqualified. * @return true if disqualified, false otherwise. */ public boolean is_disqualified() { return is_disqualified; } /** * Sets the disqualified flag. */ public void disqualify(boolean is_disqualified) { this.is_disqualified = is_disqualified; } /** * Gets the score of this player. * @return score. */ public double getScore() { return score; } /** * Sets the score of this player to a new value. * @param s - new score. */ public void setScore(double s) { score = s; } /** * Adds a value to the current score of this player. * @param s - value to add to the score. */ public void addScore (double s) { score += s; } /** * Gets the win state of this player. * @return - win state, value of Types.WINNER */ public Types.WINNER getWinState() { return winState; } /** * Sets the win state of this player. * @param w - new win state. */ public void setWinState(Types.WINNER w) { winState = w; } /** * Get this player's ID. * @return player ID. */ public int getPlayerID() { return playerID; } /** * Set this player's ID to a new value. * @param id - new player ID. */ public void setPlayerID(int id) { playerID = id; } public VGDLSprite copy() { MovingAvatar newSprite = new MovingAvatar(); this.copyTo(newSprite); //copy player try { newSprite.player = player; } catch (Exception e) {e.printStackTrace();} return newSprite; } public void copyTo(VGDLSprite target) { MovingAvatar targetSprite = (MovingAvatar) target; targetSprite.actions = new ArrayList<Types.ACTIONS>(); targetSprite.actionsNIL = new ArrayList<Types.ACTIONS>(); targetSprite.playerID = this.playerID; targetSprite.winState = this.winState; targetSprite.score = this.score; //copy key handler targetSprite.setKeyHandler(this.getKeyHandler()); // need to copy orientation here already because MovingAvatar.postProcess() requires the orientation targetSprite.orientation = this.orientation.copy(); targetSprite.postProcess(); super.copyTo(targetSprite); } }
[ "dinghao12601@126.com" ]
dinghao12601@126.com
36e22ab29efa5e59e3f791c822b724f84c77c016
8dcd6fac592760c5bff55349ffb2d7ce39d485cc
/com/bumptech/glide/load/model/stream/HttpUrlGlideUrlLoader.java
88285391cc5c3f1bdbe9bfda2b79c33c52ba191c
[]
no_license
andrepcg/hikam-android
9e3a02e0ba9a58cf8a17c5e76e2f3435969e4b3a
bf39e345a827c6498052d9df88ca58d8823178d9
refs/heads/master
2021-09-01T11:41:10.726066
2017-12-26T19:04:42
2017-12-26T19:04:42
115,447,829
2
2
null
null
null
null
UTF-8
Java
false
false
1,626
java
package com.bumptech.glide.load.model.stream; import android.content.Context; import com.bumptech.glide.load.data.DataFetcher; import com.bumptech.glide.load.data.HttpUrlFetcher; import com.bumptech.glide.load.model.GenericLoaderFactory; import com.bumptech.glide.load.model.GlideUrl; import com.bumptech.glide.load.model.ModelCache; import com.bumptech.glide.load.model.ModelLoader; import com.bumptech.glide.load.model.ModelLoaderFactory; import java.io.InputStream; public class HttpUrlGlideUrlLoader implements ModelLoader<GlideUrl, InputStream> { private final ModelCache<GlideUrl, GlideUrl> modelCache; public static class Factory implements ModelLoaderFactory<GlideUrl, InputStream> { private final ModelCache<GlideUrl, GlideUrl> modelCache = new ModelCache(500); public ModelLoader<GlideUrl, InputStream> build(Context context, GenericLoaderFactory factories) { return new HttpUrlGlideUrlLoader(this.modelCache); } public void teardown() { } } public HttpUrlGlideUrlLoader() { this(null); } public HttpUrlGlideUrlLoader(ModelCache<GlideUrl, GlideUrl> modelCache) { this.modelCache = modelCache; } public DataFetcher<InputStream> getResourceFetcher(GlideUrl model, int width, int height) { GlideUrl url = model; if (this.modelCache != null) { url = (GlideUrl) this.modelCache.get(model, 0, 0); if (url == null) { this.modelCache.put(model, 0, 0, model); url = model; } } return new HttpUrlFetcher(url); } }
[ "andrepcg@gmail.com" ]
andrepcg@gmail.com
2287889ced1744608138bb29617191e24e6fe73b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_66d580495d311b881e82fd002067f4f8e74b5ae5/DocumentFunction/2_66d580495d311b881e82fd002067f4f8e74b5ae5_DocumentFunction_s.java
e8e93e7d8508471b74b2f9c2b9d11ba6b340f833
[]
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,935
java
/* * $Header$ * $Revision$ * $Date$ * * ==================================================================== * * Copyright (C) 2000-2002 bob mcwhirter & James Strachan. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions, and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions, and the disclaimer that follows * these conditions in the documentation and/or other materials * provided with the distribution. * * 3. The name "Jaxen" must not be used to endorse or promote products * derived from this software without prior written permission. For * written permission, please contact license@jaxen.org. * * 4. Products derived from this software may not be called "Jaxen", nor * may "Jaxen" appear in their name, without prior written permission * from the Jaxen Project Management (pm@jaxen.org). * * In addition, we request (but do not require) that you include in the * end-user documentation provided with the redistribution and/or in the * software itself an acknowledgement equivalent to the following: * "This product includes software developed by the * Jaxen Project (http://www.jaxen.org/)." * Alternatively, the acknowledgment may be graphical using the logos * available at http://www.jaxen.org/ * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE Jaxen AUTHORS OR THE PROJECT * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * ==================================================================== * This software consists of voluntary contributions made by many * individuals on behalf of the Jaxen Project and was originally * created by bob mcwhirter <bob@werken.com> and * James Strachan <jstrachan@apache.org>. For more information on the * Jaxen Project, please see <http://www.jaxen.org/>. * * $Id$ */ package org.jaxen.function.xslt; import org.jaxen.Context; import org.jaxen.Function; import org.jaxen.Navigator; import org.jaxen.FunctionCallException; import org.jaxen.function.StringFunction; import java.util.List; /** * Implements the XSLT document() function * * @author <a href="mailto:jstrachan@apache.org">James Strachan</a> */ public class DocumentFunction implements Function { public Object call(Context context, List args) throws FunctionCallException { if (args.size() == 1) { Navigator nav = context.getNavigator(); String url = StringFunction.evaluate( args.get( 0 ), nav ); return evaluate( url, nav ); } throw new FunctionCallException( "false() requires no arguments." ); } public static Object evaluate(String url, Navigator nav) throws FunctionCallException { return nav.getDocument( url ); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
b268b2e619f68e882c0c7de1ab7c793463726e41
d50cefd9b56b96726f12ecafaea923e8ce24f5d8
/workspace/draw/src/game/Ball.java
9d41df0cf9ab15becd93df1e867ad9264b60b0d5
[]
no_license
lyk4411/java_learning
673a3661391c04f5bd01bf9e8978c3f2f8fa36a6
bcec6298896a75616c3c3b3d6affb3406d4c2fa7
refs/heads/master
2020-02-26T14:59:57.560378
2019-11-07T07:46:28
2019-11-07T07:46:28
31,747,198
1
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package game; import java.awt.Color; import java.awt.Component; import java.awt.Graphics; import java.awt.Point; public class Ball implements Runnable{ private int r; private Color c; private Point pos; private int speed; private Component owner; public Ball(int r,Color c,int speed,Component owner){ this.r = r; this.c = c; this.speed = speed; this.owner = owner; } public Ball(Component owner){ this.owner = owner; this.r = (int)(Math.random() * 11 + 10); this.c = new Color((int)(Math.random() * 256), (int)(Math.random() * 256), (int)(Math.random() * 256)); this.pos = new Point(0,0); int width = (int) owner.getSize().getWidth(); pos.x = (int) (r + (width - 2 * r) * Math.random()); pos.y = (int) owner.getSize().getHeight() - r; speed = (int)((Math.random() * 15) + 5); } public void draw(Graphics g){ g.setColor(c); g.fillOval(pos.x - r, pos.y - r, 2*r, 2*r); } public boolean isPointIn(Point pt){ return pt.distance(pos) <= r; } @Override public void run() { // TODO Auto-generated method stub while (true){ try{ Thread.sleep(speed); } catch(Exception e){ } pos.y -= 1; owner.repaint(pos.x-r-1,pos.y-r-1,2*r+2,2*r+4); if(pos.y - r <= 0){ break; } } } public void start(){ Thread t = new Thread(this); t.start(); } }
[ "liu.yongkai@bestv.com.cn" ]
liu.yongkai@bestv.com.cn
8b719d521f504780bfaacc6b2252ec9dec7bf004
8b5c955989280412e2e7fca4453722d090c3b347
/Data Structure and Algorithm PDF -Sixth Edition/First Time/Chapter 2 OOD/Generics/Basic/Pair.java
9dd82bca5ffa601b907c6f33980bdf1e47df1797
[]
no_license
david2999999/Java-Algorithm
a8962629819df73a9b9c733e5f8be91952747554
8e235826b2e7e864f1fd991dbaa2dbb44caaab8c
refs/heads/master
2021-06-03T23:09:13.092268
2020-03-22T18:42:21
2020-03-22T18:42:21
146,636,630
3
0
null
null
null
null
UTF-8
Java
false
false
224
java
public class Pair<A, B> { A first; B second; public Pair(A a, B b) { first = a; second = b; } public A getFirst( ) { return first; } public B getSecond( ) { return second;} }
[ "djiang86@binghamton.edu" ]
djiang86@binghamton.edu
c3d575f5b4180ba49a33fabf95022df4fe1bc4b7
9a6ea6087367965359d644665b8d244982d1b8b6
/src/main/java/X/AnonymousClass3HW.java
a06537e79f97e0bab85153abedb1d9ae3e2503ad
[]
no_license
technocode/com.wa_2.21.2
a3dd842758ff54f207f1640531374d3da132b1d2
3c4b6f3c7bdef7c1523c06d5bd9a90b83acc80f9
refs/heads/master
2023-02-12T11:20:28.666116
2021-01-14T10:22:21
2021-01-14T10:22:21
329,578,591
2
1
null
null
null
null
UTF-8
Java
false
false
449
java
package X; import com.whatsapp.authentication.FingerprintBottomSheet; /* renamed from: X.3HW reason: invalid class name */ public class AnonymousClass3HW { public final /* synthetic */ FingerprintBottomSheet A00; public final /* synthetic */ AbstractC63192w0 A01; public AnonymousClass3HW(AbstractC63192w0 r1, FingerprintBottomSheet fingerprintBottomSheet) { this.A01 = r1; this.A00 = fingerprintBottomSheet; } }
[ "madeinborneo@gmail.com" ]
madeinborneo@gmail.com
8eb52a7177cdd7b7e111575bb02075bb53a1d062
88f3340db957ef8b61e8c201d05dbd85aee49e35
/app/src/main/java/com/example/xiaojun/posji/beans/BiDuiFanHui.java
7cc1f60ed993162fca38e1088279ebd1c8d9d136
[]
no_license
yoyo89757001/PosJi1
ce215989ecae176443d689f2933204c74878cb57
27e60098820a2043c54ce0d56c40a7f1b4cc9a73
refs/heads/master
2021-01-18T22:18:46.179619
2018-01-12T10:14:45
2018-01-12T10:14:45
100,559,245
0
0
null
null
null
null
UTF-8
Java
false
false
4,050
java
package com.example.xiaojun.posji.beans; /** * Created by Administrator on 2017/10/23. */ public class BiDuiFanHui { /** * face1 : {"rect":{"left":576,"top":589,"width":311,"height":311},"confidence":0.99959975} * face2 : {"rect":{"left":492,"top":754,"width":702,"height":702},"confidence":0.999997} * score : 96.36503 */ private Face1Bean face1; private Face2Bean face2; private double score; public Face1Bean getFace1() { return face1; } public void setFace1(Face1Bean face1) { this.face1 = face1; } public Face2Bean getFace2() { return face2; } public void setFace2(Face2Bean face2) { this.face2 = face2; } public double getScore() { return score; } public void setScore(double score) { this.score = score; } public static class Face1Bean { /** * rect : {"left":576,"top":589,"width":311,"height":311} * confidence : 0.99959975 */ private RectBean rect; private double confidence; public RectBean getRect() { return rect; } public void setRect(RectBean rect) { this.rect = rect; } public double getConfidence() { return confidence; } public void setConfidence(double confidence) { this.confidence = confidence; } public static class RectBean { /** * left : 576 * top : 589 * width : 311 * height : 311 */ private int left; private int top; private int width; private int height; public int getLeft() { return left; } public void setLeft(int left) { this.left = left; } public int getTop() { return top; } public void setTop(int top) { this.top = top; } public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } } } public static class Face2Bean { /** * rect : {"left":492,"top":754,"width":702,"height":702} * confidence : 0.999997 */ private RectBeanX rect; private double confidence; public RectBeanX getRect() { return rect; } public void setRect(RectBeanX rect) { this.rect = rect; } public double getConfidence() { return confidence; } public void setConfidence(double confidence) { this.confidence = confidence; } public static class RectBeanX { /** * left : 492 * top : 754 * width : 702 * height : 702 */ private int left; private int top; private int width; private int height; public int getLeft() { return left; } public void setLeft(int left) { this.left = left; } public int getTop() { return top; } public void setTop(int top) { this.top = top; } public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } } } }
[ "332663557@qq.com" ]
332663557@qq.com
4871b1b5e5a866b79344a2d18bf723ee7d6f91d1
0f4f2ab64f55e374e33837c4044333f15b00361b
/DesignPattarn/src/com/jspider/spring/creational/builderdesignpattern/TestBuilderPattern.java
dc738051464c8e7728b47c598b46a1e74d95bd7b
[]
no_license
singhvikash630/design_patterns
481ccb36a7cf5e50fc73e8b0d3758c0b74c65a3e
e3255092ba91c7deae1bf983b859ddae566e34a6
refs/heads/master
2022-11-07T17:15:59.009941
2020-06-25T12:58:56
2020-06-25T12:58:56
274,915,723
0
0
null
null
null
null
UTF-8
Java
false
false
248
java
package com.jspider.spring.creational.builderdesignpattern; public class TestBuilderPattern { public static void main(String[] args) { Phone phone = new PhoneBuilder().setBattery(1).setOs("ios").getPhone(); System.out.println(phone); } }
[ "singh.vikash630@gmail.com" ]
singh.vikash630@gmail.com
9ce8fee6e781f2f1c646074f5feec6b3c8b62f97
be83c2179f877915e9705a733714341f6290eef2
/src/main/java/org/eweb4j/solidbase/user/web/ListUserActivityLogAction.java
d1d44dff8c2115ab4a3dff78abec849e2ab71ae4
[]
no_license
njcharran/eweb4j-solidbase
5e0ebe836d19c64815f981b4a36183e7b91edb42
18d2b1ad00f8fb3aa514cfd430af2ff2fde7ac0f
refs/heads/master
2021-01-18T17:44:30.534054
2013-03-10T10:13:14
2013-03-10T10:13:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,889
java
package org.eweb4j.solidbase.user.web; import java.util.Collection; import java.util.Map; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import org.eweb4j.ioc.IOC; import org.eweb4j.mvc.view.DataAssemUtil; import org.eweb4j.mvc.view.DivPageComp; import org.eweb4j.mvc.view.ListPage; import org.eweb4j.mvc.view.PageMod; import org.eweb4j.mvc.view.SearchForm; import org.eweb4j.solidbase.user.model.UserActivityLog; import org.eweb4j.solidbase.user.model.UserActivityLogCons; import org.eweb4j.solidbase.user.model.UserActivityLogService; import org.eweb4j.solidbase.user.model.UserCons; @Path("${UserConstant.MODEL_NAME}") public class ListUserActivityLogAction { private UserActivityLogService service = IOC.getBean(UserActivityLogCons .IOC_SERVICE_BEAN_ID()); private int pageNum = 1; private int numPerPage = 20; private PageMod<UserActivityLog> pageMod = null; private long allCount = 0; private Collection<UserActivityLog> pojos = null; private DivPageComp dpc = null; private ListPage listPage = null; private SearchForm searchForm = new SearchForm("users/logs/search", ""); @Path("/logs") @GET @POST public String doGet(Map<String, Object> model) { try { pageMod = service.getListPage(pageNum, numPerPage); allCount = pageMod.getAllCount(); pojos = pageMod.getPojos(); dpc = new DivPageComp(pageNum, numPerPage, allCount, 10); listPage = new ListPage("users/logs", searchForm, pojos, dpc); listPage = DataAssemUtil.assemHead(listPage, pojos, UserActivityLogCons.getMap()); model.put("listPage", listPage); model.put("random", Math.random()); } catch (Exception e) { return e.toString(); } return UserCons.PAGING_LOG_ACTION_RESULT(); } public void setPageNum(int pageNum) { this.pageNum = pageNum; } public void setNumPerPage(int numPerPage) { this.numPerPage = numPerPage; } }
[ "l.weiwei@163.com" ]
l.weiwei@163.com
11fa23f2078921d9cd2afa55a2b071fe6566ca36
7780422ea62de5e5e91d75cd14344de1fbfe451a
/pluginloader/src/main/java/com/mchenys/pluginloader/core/ActivityLifecycleCallbacksProxy.java
99a479326a2c51249d44dcdb479784ef756d994f
[]
no_license
mChenys/MyDynamicLoaderHook
e3dee58da9ef082a3875d0925a3e797ff4be1374
b3653d51d7f61e4a61d57cfec05cecef63f9f6d5
refs/heads/master
2023-04-30T19:39:07.917809
2021-05-16T14:15:13
2021-05-16T14:15:13
365,275,601
0
0
null
null
null
null
UTF-8
Java
false
false
3,699
java
package com.mchenys.pluginloader.core; import android.app.Activity; import android.app.Application; import android.os.Bundle; import com.mchenys.pluginloader.utils.ReflectUtils; import java.util.ArrayList; /** * @Author: mChenys * @Date: 2021/5/12 * @Description: 插件ActivityLifecycleCallbacks代理 */ public class ActivityLifecycleCallbacksProxy implements Application.ActivityLifecycleCallbacks { final ArrayList<Application.ActivityLifecycleCallbacks> mActivityLifecycleCallbacks = ReflectUtils.getFieldSlience("android.app.Application", ReflectUtils.getActivityThreadApplication(), "mActivityLifecycleCallbacks"); Object[] collectActivityLifecycleCallbacks() { if (mActivityLifecycleCallbacks == null) { return null; } Object[] callbacks = null; synchronized (mActivityLifecycleCallbacks) { if (mActivityLifecycleCallbacks.size() > 0) { callbacks = mActivityLifecycleCallbacks.toArray(); } } return callbacks; } @Override public void onActivityCreated(Activity activity, Bundle savedInstanceState) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityCreated(activity, savedInstanceState); } } } @Override public void onActivityStarted(Activity activity) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityStarted(activity); } } } @Override public void onActivityResumed(Activity activity) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityResumed(activity); } } } @Override public void onActivityPaused(Activity activity) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityPaused(activity); } } } @Override public void onActivityStopped(Activity activity) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityStopped(activity); } } } @Override public void onActivitySaveInstanceState(Activity activity, Bundle outState) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivitySaveInstanceState(activity, outState); } } } @Override public void onActivityDestroyed(Activity activity) { Object[] callbacks = collectActivityLifecycleCallbacks(); if (callbacks != null) { for (int i = 0; i < callbacks.length; i++) { ((Application.ActivityLifecycleCallbacks) callbacks[i]).onActivityDestroyed(activity); } } } }
[ "643353964@qq.com" ]
643353964@qq.com
919a06ec1659e8469eb96dbd3e929017856fb007
71f7c817d9d82e7ac6d4ca038e9f89d6f2959d40
/app/src/main/java/org/golde/android/carcontroller/ui/picker/ColorPickerWheel.java
6991c6bdc30ff481273bd2468a8975c632c8ab42
[]
no_license
egold555/CarController
b040852d1c48ce18d3e48805d6484ebc79eae5d1
d4d5063fd58919097696058750c00b89dc343e05
refs/heads/master
2020-06-28T20:19:58.449440
2019-08-03T06:45:32
2019-08-03T06:45:32
200,331,948
3
0
null
null
null
null
UTF-8
Java
false
false
2,348
java
package org.golde.android.carcontroller.ui.picker; import android.graphics.Bitmap; import android.graphics.Color; import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; import org.golde.android.carcontroller.MainActivity; import org.golde.android.carcontroller.R; import org.golde.android.carcontroller.ui.BetterColor; import org.golde.android.carcontroller.ui.ColorChangeCallback; public class ColorPickerWheel { private final ColorChangeCallback callback; ImageView mImageView; Bitmap bitmap; private int r = 255, g = 255, b = 255; public ColorPickerWheel(MainActivity main, ColorChangeCallback callback){ this.callback = callback; mImageView = main.findViewById(R.id.imageView); //Not exactly sure what this does but I needed it mImageView.setDrawingCacheEnabled(true); mImageView.buildDrawingCache(true); calcColor(); //On touch of the image. Seems to be global though for on touch whereever on the screen mImageView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if(motionEvent.getAction() == MotionEvent.ACTION_DOWN || motionEvent.getAction() == MotionEvent.ACTION_MOVE){ bitmap = mImageView.getDrawingCache(); int px = (int) motionEvent.getX(); int py = (int) motionEvent.getY(); //Fixes crashing when touching places not on the image. See comment about the setOnTouchListener if(py >= bitmap.getHeight() || px >= bitmap.getWidth()){ return true; } int pixel = bitmap.getPixel(px, py); //Black when clicking any transparent part of the image. Fixes that if(Color.alpha(pixel) != 255){ return true; } r = Color.red(pixel); g = Color.green(pixel); b = Color.blue(pixel); calcColor(); } return true; } }); } void calcColor(){ callback.onColorChange(new BetterColor(r, g, b)); } }
[ "eric@golde.org" ]
eric@golde.org
e1aee2def80168abafab3d3dbf3f9d7f4bfcbed1
8c12b5a87c4ad1285a1b5c7b44674a2753fc002a
/src/main/java/com/julienviet/benchmarks/FindFirstSpecialByte.java
2b1386f826f1b57c6087b0fca8ef98d1d41a3fad
[ "Apache-2.0" ]
permissive
franz1981/perf-experiments
7d5e5fa56ff47e0b2d22ade504b9371ff534e8e5
2e75534c4e899231213e73c7853dc2aeded4261b
refs/heads/master
2021-08-30T22:03:38.350982
2017-12-19T15:26:11
2017-12-19T15:41:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,578
java
package com.julienviet.benchmarks; import sun.misc.Unsafe; import java.lang.reflect.Field; public abstract class FindFirstSpecialByte { public static final Unsafe unsafe = getUnsafe(); public static final long byteArrayOffset = unsafe.arrayBaseOffset(byte[].class); private static Unsafe getUnsafe() { try { Field singleoneInstanceField = Unsafe.class.getDeclaredField("theUnsafe"); singleoneInstanceField.setAccessible(true); return (Unsafe) singleoneInstanceField.get(null); } catch (IllegalArgumentException | SecurityException | NoSuchFieldException | IllegalAccessException e) { throw new RuntimeException(e); } } public abstract long find(); public static abstract class HeapVersion extends FindFirstSpecialByte { final byte[] data; final byte[] lookup; final int size; public HeapVersion(String data) { this(data.getBytes()); } public HeapVersion(byte[] data) { this.data = data; this.size = data.length; lookup = new byte[256]; for (int i = 0;i < 0x20;i++) { lookup[i] = 1; } for (int i = 128;i < 256;i++) { lookup[i] = 1; } lookup['"'] = 1; lookup['\\'] = 1; } } public static class SimpleVersion extends HeapVersion { public SimpleVersion(String data) { super(data); } public SimpleVersion(byte[] data) { super(data); } @Override public long find() { for (int i = 0;i < size;i++) { int b = data[i] & 0xFF; if (b < 0x20 || b > 127 || b == '"' || b == '\\') { return i; } } return -1; } } public static class SimpleUnrolledVersion extends HeapVersion { public SimpleUnrolledVersion(String data) { super(data); } public SimpleUnrolledVersion(byte[] data) { super(data); } @Override public long find() { int i = 0; while (i < size) { int b1 = data[i] & 0xFF; if (b1 < 0x20 || b1 > 127 || b1 == '"' || b1 == '\\') { return i; } int b2 = data[i + 1] & 0xFF; if (b2 < 0x20 || b2 > 127 || b2 == '"' || b2 == '\\') { return i + 1; } int b3 = data[i + 2] & 0xFF; if (b3 < 0x20 || b3 > 127 || b3 == '"' || b3 == '\\') { return i + 2; } int b4 = data[i + 3] & 0xFF; if (b4 < 0x20 || b4 > 127 || b4 == '"' || b4 == '\\') { return i + 3; } i += 4; } return -1; } } public static class UnsafeVersion extends HeapVersion { public UnsafeVersion(String data) { super(data); } public UnsafeVersion(byte[] data) { super(data); } public long find() { long addr = byteArrayOffset; long limit = addr + size; while (addr < limit) { int b = unsafe.getByte(data, addr) & 0xFF; if (b < 0x20 || b > 127 || b == '"' || b == '\\') { return addr - byteArrayOffset; } addr++; } return -1; } } public static class UnsafeUnrolledVersion extends HeapVersion { public UnsafeUnrolledVersion(String data) { super(data); } public UnsafeUnrolledVersion(byte[] data) { super(data); } public long find() { long addr = byteArrayOffset; long limit = addr + size; while (addr < limit) { int b1 = unsafe.getByte(data, addr) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b1) != 0) { return addr - byteArrayOffset; } int b2 = unsafe.getByte(data, addr + 1) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b2) != 0) { return addr - byteArrayOffset + 1; } int b3 = unsafe.getByte(data, addr + 2) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b3) != 0) { return addr - byteArrayOffset + 2; } int b4 = unsafe.getByte(data, addr + 3) & 0xFF; if (unsafe.getByte(lookup, byteArrayOffset + b4) != 0) { return addr - byteArrayOffset + 3; } addr += 4; } return -1; } } public static abstract class OffHeapBase extends FindFirstSpecialByte { final long offHeapData; final long offHeapLookup; final int size; public OffHeapBase(String data) { this(data.getBytes()); } public OffHeapBase(byte[] data) { size = data.length; offHeapData = unsafe.allocateMemory(size); for (int i = 0; i < size; i++) { unsafe.putByte(offHeapData + i, data[i]); } offHeapLookup = unsafe.allocateMemory(256); for (int i = 0; i < 256;i++) { unsafe.putByte(offHeapLookup + i, (byte)0); } for (int i = 0;i < 0x20;i++) { unsafe.putByte(offHeapLookup + i, (byte)1); } for (int i = 128;i < 256;i++) { unsafe.putByte(offHeapLookup + i, (byte)1); } unsafe.putByte(offHeapLookup + '"', (byte)1); unsafe.putByte(offHeapLookup + '\\', (byte)1); } } public static class OffHeapVersion extends OffHeapBase { public OffHeapVersion(String data) { super(data); } public OffHeapVersion(byte[] data) { super(data); } public long find() { long addr = offHeapData; long limit = addr + size; while (addr < limit) { int b = unsafe.getByte(addr) & 0xFF; if (b < 0x20 || b > 127 || b == '"' || b == '\\') { return addr - offHeapData; } addr++; } return -1; } } public static class OffHeapUnrolledVersion extends OffHeapBase { public OffHeapUnrolledVersion(String data) { super(data); } public OffHeapUnrolledVersion(byte[] data) { super(data); } public long find() { long addr = offHeapData; long limit = addr + size; while (addr < limit) { int b1 = unsafe.getByte(addr) & 0xFF; if (unsafe.getByte(offHeapLookup + b1) != 0) { return addr - offHeapData; } int b2 = unsafe.getByte( addr + 1) & 0xFF; if (unsafe.getByte(offHeapLookup + b2) != 0) { return addr - offHeapData + 1; } int b3 = unsafe.getByte( addr + 2) & 0xFF; if (unsafe.getByte(offHeapLookup + b3) != 0) { return addr - offHeapData + 2; } int b4 = unsafe.getByte( addr + 3) & 0xFF; if (unsafe.getByte(offHeapLookup + b4) != 0) { return addr - offHeapData + 3; } addr += 4; } return -1; } } }
[ "julien@julienviet.com" ]
julien@julienviet.com
fed1c3c2f3cb6aa06b30cfed4fe1efe2a67985ce
f168302ab6abe7dc754d50389cb359c15116dd60
/src/main/java/com/elmakers/mine/bukkit/ChunkManager.java
496312e37e75667675372d04b5bb0f449ad57c93
[ "MIT" ]
permissive
elBukkit/NoFlatlands
70a93c7af0bad669763ebf0cd122fe6af9c7b736
18148dc187c79ae8ee0b6099feb6e99c77c457e3
refs/heads/master
2016-08-06T10:35:34.218834
2014-09-08T18:14:57
2014-09-08T18:14:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,754
java
package com.elmakers.mine.bukkit; import org.apache.commons.lang.StringUtils; import org.bukkit.*; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.world.ChunkLoadEvent; import org.bukkit.plugin.Plugin; import java.util.*; public class ChunkManager implements Listener { private int chunkListLength = 2048; private int chunkRegenDelayMin = 10; private int chunkRegenDelayMax = 20; private int chunkMaxSearchHeight = 70; private int chunkMinSearchHeight = 5; private int chunkMinX = 8; private int chunkMaxX = 8; private int chunkMinZ = 8; private int chunkMaxZ = 8; private final Random random = new Random(); private final WorldGuardManager manager; private final Plugin plugin; private final Set<String> worlds = new HashSet<String>(); private final TreeSet<String> checked = new TreeSet<String>(); public ChunkManager(Plugin plugin) { this.plugin = plugin; this.manager = new WorldGuardManager(); manager.initialize(plugin); } public void setWorlds(Collection<String> worldNames) { worlds.clear(); if (worldNames != null) { worlds.addAll(worldNames); } if (worlds.size() > 0) { plugin.getLogger().info("Regenerating flatland chunks in: " + StringUtils.join(worlds, ", ")); } } @EventHandler public void onChunkLoad(ChunkLoadEvent e) { if (!worlds.contains(e.getWorld().getName())) return; final Chunk chunk = e.getChunk(); String chunkKey = chunk.getX() + "," + chunk.getZ(); if (checked.contains(chunkKey)) return; checked.add(chunkKey); if (checked.size() > chunkListLength) { String oldestKey = checked.pollFirst(); if (oldestKey != null) { checked.remove(oldestKey); } } final World world = chunk.getWorld(); Location location = chunk.getBlock(8, 64, 8).getLocation(); if (!manager.isPassthrough(location)) return; for (int y = chunkMinSearchHeight; y <= chunkMaxSearchHeight; y++) { for (int x = chunkMinX; x <= chunkMaxX; x++) { for (int z = chunkMinZ; z <= chunkMaxZ; z++) { if (chunk.getBlock(x, y, z).getType() != Material.AIR) return; } } } int chunkRegenDelay = chunkRegenDelayMin + random.nextInt(chunkRegenDelayMin + chunkRegenDelayMax); Bukkit.getScheduler().runTaskLater(plugin, new Runnable() { @Override public void run() { world.regenerateChunk(chunk.getX(), chunk.getZ()); } }, chunkRegenDelay); } }
[ "nathan@elmakers.com" ]
nathan@elmakers.com
866f9ea01517e37c53cccbd4fa441626747ab6d1
c1e87eb6aa66ff742db4d0726d8f57619edae534
/app/src/main/java/com/spade/mek/ui/login/view/LoginFragment.java
076d939dbf3bfd13d69459429ad311ce8f4adfba
[]
no_license
ddopik/ProjectM
10e8c98f27270a07b131df8cefd1e57907849856
61ee763b0fe4a62db033a7fb63b4bec18e290dfe
refs/heads/master
2020-03-20T22:34:30.944414
2019-03-06T10:25:42
2019-03-06T10:25:42
137,805,144
0
0
null
null
null
null
UTF-8
Java
false
false
4,621
java
package com.spade.mek.ui.login.view; import android.content.Intent; import android.graphics.Paint; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; import com.google.android.gms.analytics.HitBuilders; import com.google.android.gms.analytics.Tracker; import com.spade.mek.R; import com.spade.mek.application.MekApplication; import com.spade.mek.base.BaseFragment; import com.spade.mek.ui.home.MainActivity; import com.spade.mek.ui.login.presenter.LoginPresenter; import com.spade.mek.ui.login.presenter.LoginPresenterImpl; import com.spade.mek.ui.login.server_login.ServerLoginActivity; import com.spade.mek.ui.register.RegisterActivity; import com.spade.mek.utils.ImageUtils; import com.spade.mek.utils.PrefUtils; /** * Created by Ayman Abouzeidd on 6/12/17. */ public class LoginFragment extends BaseFragment implements LoginView { private LoginPresenter mLoginPresenter; private View mView; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { mView = inflater.inflate(R.layout.fragment_login, container, false); initViews(); overrideFonts(getContext(), mView); Tracker tracker = MekApplication.getDefaultTracker(); tracker.setScreenName(getResources().getString(R.string.login)); tracker.send(new HitBuilders.ScreenViewBuilder().build()); return mView; } @Override protected void initPresenter() { mLoginPresenter = new LoginPresenterImpl(this, getContext()); mLoginPresenter.initLoginManagers(getActivity()); } @Override protected void initViews() { TextView continueAsGuest = (TextView) mView.findViewById(R.id.loginAsGuestBtn); Button loginWithFacebook = (Button) mView.findViewById(R.id.loginWithFacebookBtn); Button loginWithGoogle = (Button) mView.findViewById(R.id.loginWithGoogleBtn); Button signInButton = (Button) mView.findViewById(R.id.loginBtn); Button registerButton = (Button) mView.findViewById(R.id.registerBtn); ImageView imageView = (ImageView) mView.findViewById(R.id.logo_image_view); String appLang = PrefUtils.getAppLang(getContext()); imageView.setImageResource(ImageUtils.getSplashLogo(appLang)); continueAsGuest.setOnClickListener(v -> mLoginPresenter.loginAsGuest()); loginWithFacebook.setOnClickListener(v -> mLoginPresenter.loginWithFacebook(this)); loginWithGoogle.setOnClickListener(v -> mLoginPresenter.loginWithGoogle(this)); registerButton.setOnClickListener(v -> { Intent intent = RegisterActivity.getLaunchIntent(getContext()); intent.putExtra(RegisterActivity.EXTRA_TYPE, RegisterActivity.REGISTER_TYPE); startActivity(intent); }); signInButton.setOnClickListener(v -> startActivity(ServerLoginActivity.getLaunchIntent(getContext()))); continueAsGuest.setPaintFlags(Paint.UNDERLINE_TEXT_FLAG); } @Override public void onError(String message) { Toast.makeText(getContext(), message, Toast.LENGTH_LONG).show(); } @Override public void onError(int resID) { Toast.makeText(getContext(), getString(resID), Toast.LENGTH_LONG).show(); } @Override public void showLoading() { } @Override public void hideLoading() { } @Override public void finish() { getActivity().finish(); } @Override public void navigate() { startActivity(MainActivity.getLaunchIntent(getContext())); } @Override public void navigateToMainScreen() { startActivity(MainActivity.getLaunchIntent(getContext())); getActivity().finish(); } @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); mLoginPresenter.onActivityResult(requestCode, resultCode, data); } @Override public void onStop() { super.onStop(); mLoginPresenter.disconnectGoogleApiClient(); } @Override public void onDestroy() { super.onDestroy(); mLoginPresenter.disconnectGoogleApiClient(); } }
[ "ddopik.01@gmail.com" ]
ddopik.01@gmail.com
a77c2c2d42a71f768e2f1b7ca8746cd1e367017e
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/LANG-39b-2-15-FEMO-WeightedSum:TestLen:CallDiversity/org/apache/commons/lang3/StringUtils_ESTest.java
b80c94a9305e619abd689f79a96b953a6dd40139
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
830
java
/* * This file was automatically generated by EvoSuite * Sat Apr 04 07:01:01 UTC 2020 */ package org.apache.commons.lang3; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.apache.commons.lang3.StringUtils; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class StringUtils_ESTest extends StringUtils_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { String[] stringArray0 = new String[3]; stringArray0[0] = "#g/u&JW\"+C2ci?gz"; // Undeclared exception! StringUtils.replaceEach("#g/u&JW\"+C2ci?gz", stringArray0, stringArray0); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
399420c6834955f93fa6a1db847a8b1eedaaf3ce
6e0f671f2dfa4ade140fc0ec503117e04044f7b6
/src/test/java/io/aseg/application/security/DomainUserDetailsServiceIntTest.java
69daf1389e34e38c99a1b2ad34fb719c0c19cfcd
[]
no_license
hasega/jhbase
a0dd664c75e85007b5d4d71af1785a8419db633d
3209d6ea029d3038f8bdcdd442b480a67abba808
refs/heads/master
2021-05-13T16:55:53.363460
2018-01-09T11:17:14
2018-01-09T11:17:14
116,806,413
0
0
null
null
null
null
UTF-8
Java
false
false
4,647
java
package io.aseg.application.security; import io.aseg.application.JhbaseApp; import io.aseg.application.domain.User; import io.aseg.application.repository.UserRepository; import org.apache.commons.lang3.RandomStringUtils; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetailsService; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.transaction.annotation.Transactional; import java.util.Locale; import static org.assertj.core.api.Assertions.assertThat; /** * Test class for DomainUserDetailsService. * * @see DomainUserDetailsService */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhbaseApp.class) @Transactional public class DomainUserDetailsServiceIntTest { private static final String USER_ONE_LOGIN = "test-user-one"; private static final String USER_ONE_EMAIL = "test-user-one@localhost"; private static final String USER_TWO_LOGIN = "test-user-two"; private static final String USER_TWO_EMAIL = "test-user-two@localhost"; private static final String USER_THREE_LOGIN = "test-user-three"; private static final String USER_THREE_EMAIL = "test-user-three@localhost"; @Autowired private UserRepository userRepository; @Autowired private UserDetailsService domainUserDetailsService; private User userOne; private User userTwo; private User userThree; @Before public void init() { userOne = new User(); userOne.setLogin(USER_ONE_LOGIN); userOne.setPassword(RandomStringUtils.random(60)); userOne.setActivated(true); userOne.setEmail(USER_ONE_EMAIL); userOne.setFirstName("userOne"); userOne.setLastName("doe"); userOne.setLangKey("en"); userRepository.save(userOne); userTwo = new User(); userTwo.setLogin(USER_TWO_LOGIN); userTwo.setPassword(RandomStringUtils.random(60)); userTwo.setActivated(true); userTwo.setEmail(USER_TWO_EMAIL); userTwo.setFirstName("userTwo"); userTwo.setLastName("doe"); userTwo.setLangKey("en"); userRepository.save(userTwo); userThree = new User(); userThree.setLogin(USER_THREE_LOGIN); userThree.setPassword(RandomStringUtils.random(60)); userThree.setActivated(false); userThree.setEmail(USER_THREE_EMAIL); userThree.setFirstName("userThree"); userThree.setLastName("doe"); userThree.setLangKey("en"); userRepository.save(userThree); } @Test @Transactional public void assertThatUserCanBeFoundByLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByLoginIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_LOGIN.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmail() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatUserCanBeFoundByEmailIgnoreCase() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_TWO_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_TWO_LOGIN); } @Test @Transactional public void assertThatEmailIsPrioritizedOverLogin() { UserDetails userDetails = domainUserDetailsService.loadUserByUsername(USER_ONE_EMAIL.toUpperCase(Locale.ENGLISH)); assertThat(userDetails).isNotNull(); assertThat(userDetails.getUsername()).isEqualTo(USER_ONE_LOGIN); } @Test(expected = UserNotActivatedException.class) @Transactional public void assertThatUserNotActivatedExceptionIsThrownForNotActivatedUsers() { domainUserDetailsService.loadUserByUsername(USER_THREE_LOGIN); } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
1313924bdbb6ab0e8c4cffe544a0178e669f35ac
08029f12f5ec9336c763b82affb0616d9a89efc8
/src/main/java/name/pehl/karaka/client/application/NavigationView.java
2df4d5f92036f580051df20974625661e937ca01
[]
no_license
hpehl/karaka
dd7b47b9fd206b611fc40876f8f2e73bca23ed60
76686f40ecb693e9d85ee33986f4e1668fbf9bca
refs/heads/master
2020-05-18T09:58:18.426332
2013-04-09T09:01:18
2013-04-09T09:01:18
6,405,796
1
0
null
null
null
null
UTF-8
Java
false
false
3,795
java
package name.pehl.karaka.client.application; import com.google.common.collect.ImmutableMap; import com.google.gwt.dom.client.AnchorElement; import com.google.gwt.dom.client.SpanElement; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.HasOneWidget; import com.google.gwt.user.client.ui.Hyperlink; import com.google.gwt.user.client.ui.InlineHyperlink; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Inject; import com.gwtplatform.mvp.client.ViewImpl; import name.pehl.karaka.client.NameTokens; import name.pehl.karaka.client.resources.Resources; import name.pehl.karaka.client.ui.UiUtils; import name.pehl.karaka.shared.model.User; import java.util.Map; /** * @author $Author: harald.pehl $ * @version $Date: 2010-12-16 10:41:46 +0100 (Do, 16. Dez 2010) $ $Revision: 175 * $ */ public class NavigationView extends ViewImpl implements NavigationPresenter.MyView { public interface Binder extends UiBinder<Widget, NavigationView> { } private final Widget widget; private final Resources resources; private final Map<String, Hyperlink> navigationLinks; @UiField InlineHyperlink dashboard; @UiField InlineHyperlink projects; @UiField InlineHyperlink clients; @UiField InlineHyperlink tags; @UiField InlineHyperlink reports; @UiField InlineHyperlink help; @UiField InlineHyperlink settings; @UiField AnchorElement logout; @UiField SpanElement username; @UiField HasOneWidget messagePanel; @Inject public NavigationView(final Binder binder, final Resources resources) { this.resources = resources; this.resources.navigation().ensureInjected(); this.widget = binder.createAndBindUi(this); this.navigationLinks = new ImmutableMap.Builder<String, Hyperlink>().put(NameTokens.dashboard, dashboard) .put(NameTokens.projects, projects).put(NameTokens.clients, clients).put(NameTokens.tags, tags) .put(NameTokens.reports, reports).put(NameTokens.help, help).put(NameTokens.settings, settings).build(); } @Override public Widget asWidget() { return widget; } @Override public void setInSlot(Object slot, Widget content) { if (slot == NavigationPresenter.SLOT_Message) { UiUtils.setContent(messagePanel, content); } else { super.setInSlot(slot, content); } } @Override public void highlight(String token) { if (token != null) { for (Map.Entry<String, Hyperlink> entry : navigationLinks.entrySet()) { String currentToken = entry.getKey(); Hyperlink currentLink = entry.getValue(); if (token.equals(currentToken)) { currentLink.addStyleName(resources.navigation().selectedNavigationEntry()); } else { currentLink.removeStyleName(resources.navigation().selectedNavigationEntry()); } } } } @Override public void setDashboardToken(String token) { if (token != null) { dashboard.setTargetHistoryToken(token); } } @Override public void updateUser(User user) { if (user != null) { if (user.getLogoutUrl() != null) { logout.setHref(user.getLogoutUrl()); } username.setInnerText(user.getUsername()); } } }
[ "harald.pehl@gmail.com" ]
harald.pehl@gmail.com
8780adcd9f0a02016ede261b006df1a9427110f6
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/4/4_84d78c277ce66e370d992fd9b4717f36fe0c82b8/MessageSink/4_84d78c277ce66e370d992fd9b4717f36fe0c82b8_MessageSink_s.java
4c93036adcff1636854909d56343f5d2bf8e6b90
[]
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,490
java
/* * Copyright (c) 2012 European Synchrotron Radiation Facility, * Diamond Light Source Ltd. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.dawb.passerelle.actors.ui; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.management.InstanceNotFoundException; import javax.management.MBeanServerConnection; import org.dawb.passerelle.common.actors.AbstractDataMessageSink; import org.dawb.passerelle.common.actors.ActorUtils; import org.dawb.passerelle.common.message.DataMessageComponent; import org.dawb.passerelle.common.message.IVariable; import org.dawb.passerelle.common.message.MessageUtils; import org.dawb.passerelle.common.parameter.ParameterUtils; import org.dawb.workbench.jmx.RemoteWorkbenchAgent; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ptolemy.data.expr.Parameter; import ptolemy.data.expr.StringParameter; import ptolemy.kernel.CompositeEntity; import ptolemy.kernel.util.IllegalActionException; import ptolemy.kernel.util.NameDuplicationException; import ptolemy.kernel.util.Settable; import com.isencia.passerelle.actor.ProcessingException; import com.isencia.passerelle.core.PasserelleToken; import com.isencia.passerelle.core.Port; import com.isencia.passerelle.core.PortFactory; import com.isencia.passerelle.util.ptolemy.IAvailableChoices; import com.isencia.passerelle.util.ptolemy.StringChoiceParameter; /** * Attempts to plot data in eclipse or writes a csv file with the data if * that is not possible. * * @author gerring * */ public class MessageSink extends AbstractDataMessageSink { /** * */ private static final long serialVersionUID = 7807261809740835047L; private static final Logger logger = LoggerFactory.getLogger(MessageSink.class); private Parameter messageType,messageParam, messageTitle; private final Map<String, String> visibleChoices = new HashMap<String, String>(3); /** * NOTE Ports must be public for composites to work. */ public Port shownMessagePort; public MessageSink(CompositeEntity container, String name) throws NameDuplicationException, IllegalActionException { super(container, name); visibleChoices.put(MessageDialog.ERROR+"", "ERROR"); visibleChoices.put(MessageDialog.WARNING+"", "WARNING"); visibleChoices.put(MessageDialog.INFORMATION+"", "INFORMATION"); messageType = new StringChoiceParameter(this, "Message Type", new IAvailableChoices() { @Override public Map<String, String> getVisibleChoices() { return visibleChoices; } @Override public String[] getChoices() { return visibleChoices.keySet().toArray(new String[0]); } }, SWT.SINGLE); messageType.setExpression(MessageDialog.INFORMATION+""); registerConfigurableParameter(messageType); messageParam = new StringParameter(this, "Message"); messageParam.setExpression("${message_text}"); registerConfigurableParameter(messageParam); messageTitle = new StringParameter(this, "Message Title"); messageTitle.setExpression("Error Message"); registerConfigurableParameter(messageTitle); memoryManagementParam.setVisibility(Settable.NONE); passModeParameter.setExpression(EXPRESSION_MODE.get(1)); passModeParameter.setVisibility(Settable.NONE); shownMessagePort = PortFactory.getInstance().createOutputPort(this, "shownMessage"); } @Override protected void sendCachedData(final List<DataMessageComponent> cache) throws ProcessingException { try { if (cache==null) return; if (cache.isEmpty()) return; final DataMessageComponent despatch = MessageUtils.mergeAll(cache); if (despatch.getScalar()==null || despatch.getScalar().isEmpty()) return; final String title = ParameterUtils.getSubstituedValue(messageTitle, cache); final String message = ParameterUtils.getSubstituedValue(messageParam, cache); final int type = Integer.parseInt(messageType.getExpression()); try { logInfo(visibleChoices.get(type+"") + " message: '" + message + "'"); if (MessageUtils.isErrorMessage(cache)) getManager().stop(); final MBeanServerConnection client = ActorUtils.getWorkbenchConnection(); if (client!=null) { final Object ob = client.invoke(RemoteWorkbenchAgent.REMOTE_WORKBENCH, "showMessage", new Object[]{title,message,type}, new String[]{String.class.getName(),String.class.getName(),int.class.getName()}); if (ob==null || !((Boolean)ob).booleanValue()) { throw createDataMessageException("Show message '"+getName()+"'!", new Exception()); } } } catch (InstanceNotFoundException noService) { logger.error(title+"> "+message); } if (shownMessagePort.getWidth()>0) { shownMessagePort.broadcast(new PasserelleToken(MessageUtils.getDataMessage(despatch))); } } catch (Exception e) { throw createDataMessageException("Cannot show error message '"+getName()+"'", e); } } public List<IVariable> getOutputVariables() { return getInputVariables(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
d3ba3f063915d471680d1056ef800e8c52c0a3a3
8c085f12963e120be684f8a049175f07d0b8c4e5
/castor/tags/DEV0_8/castor-2002/castor/src/main/org/exolab/castor/persist/Cache.java
2684b50bcf12703eb961be4bdd0fdeed2caeb74e
[]
no_license
alam93mahboob/castor
9963d4110126b8f4ef81d82adfe62bab8c5f5bce
974f853be5680427a195a6b8ae3ce63a65a309b6
refs/heads/master
2020-05-17T08:03:26.321249
2014-01-01T20:48:45
2014-01-01T20:48:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,088
java
/** * Redistribution and use of this software and associated documentation * ("Software"), with or without modification, are permitted provided * that the following conditions are met: * * 1. Redistributions of source code must retain copyright * statements and notices. Redistributions must also contain a * copy of this document. * * 2. Redistributions in binary form must reproduce the * above copyright notice, this list of conditions and the * following disclaimer in the documentation and/or other * materials provided with the distribution. * * 3. The name "Exolab" must not be used to endorse or promote * products derived from this Software without prior written * permission of Exoffice Technologies. For written permission, * please contact info@exolab.org. * * 4. Products derived from this Software may not be called "Exolab" * nor may "Exolab" appear in their names without prior written * permission of Exoffice Technologies. Exolab is a registered * trademark of Exoffice Technologies. * * 5. Due credit should be given to the Exolab Project * (http://www.exolab.org/). * * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * * Copyright 1999 (C) Exoffice Technologies Inc. All Rights Reserved. * * $Id$ */ package org.exolab.castor.persist; import java.util.Hashtable; import java.util.Enumeration; import org.exolab.castor.jdo.LockNotGrantedException; /** * A cache for holding objects of a particular type. The cache has a * finite size and can be optimized for a particular class based on * the application behavior. * * @author <a href="arkin@exoffice.com">Assaf Arkin</a> * @version $Revision$ $Date$ */ final class Cache extends Thread { /** * Mapping of object locks to OIDs. The {@link OID} is used as the * key, and {@link ObjectLock} is the value. There is one lock per OID. */ private final Hashtable _locks = new Hashtable(); private long _counter; private static TransactionContext _cacheTx = new CacheTransaction(); private static final long StampInUse = 0; Cache() { } synchronized ObjectLock getLock( OID oid ) { CacheEntry entry; entry = (CacheEntry) _locks.get( oid ); if ( entry == null ) return null; entry.stamp = StampInUse; return entry.lock; } synchronized ObjectLock releaseLock( OID oid ) { CacheEntry entry; entry = (CacheEntry) _locks.get( oid ); if ( entry == null ) return null; entry.stamp = System.currentTimeMillis(); return entry.lock; } synchronized void addLock( OID oid, ObjectLock lock ) { CacheEntry entry; entry = new CacheEntry( oid, lock ); entry.stamp = StampInUse; _locks.put( oid, entry ); } void removeLock( OID oid ) { _locks.remove( oid ); } public void run() { Enumeration enum; CacheEntry entry; OID oid; while ( true ) { enum = _locks.keys(); while ( enum.hasMoreElements() ) { oid = (OID) enum.nextElement(); entry = (CacheEntry) _locks.get( oid ); synchronized ( this ) { if ( entry.stamp != StampInUse ) { try { Object obj; obj = entry.lock.acquire( _cacheTx, true, 0 ); _locks.remove( oid ); entry.lock.release( _cacheTx ); } catch ( LockNotGrantedException except ) { } } } } } } static class CacheEntry { final ObjectLock lock; long stamp; CacheEntry( OID oid, ObjectLock lock ) { this.lock = lock; } } static class CacheTransaction extends TransactionContext { public Object getConnection( PersistenceEngine engine ) { return null; } protected void commitConnections() { } protected void rollbackConnections() { } } }
[ "nobody@b24b0d9a-6811-0410-802a-946fa971d308" ]
nobody@b24b0d9a-6811-0410-802a-946fa971d308
64a8519fb8d5a33ae87d36fa9ee24c83f1d39a94
677197bbd8a9826558255b8ec6235c1e16dd280a
/src/com/alibaba/fastjson/parser/deserializer/PointDeserializer.java
0ebafd3e3f6e0ed06f42369f6ba80ed16c4cb88b
[]
no_license
xiaolongyuan/QingTingCheat
19fcdd821650126b9a4450fcaebc747259f41335
989c964665a95f512964f3fafb3459bec7e4125a
refs/heads/master
2020-12-26T02:31:51.506606
2015-11-11T08:12:39
2015-11-11T08:12:39
45,967,303
0
1
null
2015-11-11T07:47:59
2015-11-11T07:47:59
null
UTF-8
Java
false
false
2,384
java
package com.alibaba.fastjson.parser.deserializer; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.parser.DefaultJSONParser; import com.alibaba.fastjson.parser.JSONLexer; import java.awt.Point; import java.lang.reflect.Type; public class PointDeserializer implements ObjectDeserializer { public static final PointDeserializer instance = new PointDeserializer(); public <T> T deserialze(DefaultJSONParser paramDefaultJSONParser, Type paramType, Object paramObject) { JSONLexer localJSONLexer = paramDefaultJSONParser.getLexer(); if (localJSONLexer.token() == 8) { localJSONLexer.nextToken(16); return null; } if ((localJSONLexer.token() != 12) && (localJSONLexer.token() != 16)) throw new JSONException("syntax error"); localJSONLexer.nextToken(); int i = 0; int j = 0; String str; label262: label277: while (true) { if (localJSONLexer.token() == 13) { localJSONLexer.nextToken(); return new Point(i, j); } int k; if (localJSONLexer.token() == 4) { str = localJSONLexer.stringVal(); if (JSON.DEFAULT_TYPE_KEY.equals(str)) { paramDefaultJSONParser.acceptType("java.awt.Point"); } else { localJSONLexer.nextTokenWithColon(2); if (localJSONLexer.token() == 2) { k = localJSONLexer.intValue(); localJSONLexer.nextToken(); if (!str.equalsIgnoreCase("x")) break label262; i = k; } } } else { while (true) { if (localJSONLexer.token() != 16) break label277; localJSONLexer.nextToken(4); break; throw new JSONException("syntax error"); throw new JSONException("syntax error : " + localJSONLexer.tokenName()); if (!str.equalsIgnoreCase("y")) break label279; j = k; } } } label279: throw new JSONException("syntax error, " + str); } public int getFastMatchToken() { return 12; } } /* Location: /Users/zhangxun-xy/Downloads/qingting2/classes_dex2jar.jar * Qualified Name: com.alibaba.fastjson.parser.deserializer.PointDeserializer * JD-Core Version: 0.6.2 */
[ "cnzx219@qq.com" ]
cnzx219@qq.com
beda486927ff8c1119e7b93fbced12f55d191838
f68e7dddd8ef362cc967c32be7e7a244cf66b96d
/test/src/main/java/businessFramework/module/hospital/pages/nurseDepart/NurseDepartHelper.java
f75801a1d89e42b12836a492338c88438b35f33a
[]
no_license
skygbr/N2O_IntellijIDEA_Tests_Regres_Smoke
6e3fbed09464c4cf0929bd7e630f9e6c1892161a
985e74067cc220eacf90c5c4876390d1494a1421
refs/heads/master
2020-06-28T16:46:42.012449
2016-11-23T12:57:43
2016-11-23T12:57:43
74,489,672
0
0
null
null
null
null
UTF-8
Java
false
false
1,701
java
package businessFramework.module.hospital.pages.nurseDepart; import businessFramework.module.Values; import net.framework.autotesting.ApplicationManager; import net.framework.autotesting.meta.*; import net.framework.autotesting.meta.components.*; public class NurseDepartHelper extends Page implements Values { public NurseDepartHelper(ApplicationManager app) { super(app); } public Container getContainerPatientList() { return getContainer("patientList"); } public Container getContainerBedList() { return getContainer("bedList"); } public Container getContainerHospitalRecordList() { return getContainer("hospitalRecordList"); } public Button getCreateBedResourceButton() { return getContainerBedList().getButton("create"); } public Button getUpdateBedResourceButton() { return getContainerBedList().getButton("update"); } public Button getDeleteBedResourceButton() { return getContainerBedList().getButton("delete"); } public Button getCreateHospitalRecordButton() { return getContainerHospitalRecordList().getButton("create"); } public Button getEditHospitalRecordButton() { return getContainerHospitalRecordList().getButton("update"); } public Button getDeleteHospitalButton() { return getContainerHospitalRecordList().getButton("delete"); } public Button getMedicalHistoryButton() { return getContainerPatientList().getButton("medicalHistory"); } public Button getDischargeButton() { return getContainerPatientList().getButton("discharge"); } }
[ "bulat.garipov@rtlabs.ru" ]
bulat.garipov@rtlabs.ru
0c765ca21deb33a4fb669cab006bbd729b1e3c2e
618e98db053821614d25e7c4fbaefddbc3ad5e99
/ziguiw-schoolsite/app/models/SchoolXxyd.java
67c2e24cd774263c5400bb44a58e6c690134db99
[]
no_license
lizhou828/ziguiw
2a8d5a1c4310d83d4b456f3124ab49d90a242bad
76f2bedcf611dfecbf6119224c169ebcea915ad7
refs/heads/master
2022-12-23T04:13:06.645117
2014-10-08T07:42:57
2014-10-08T07:42:57
24,621,998
1
1
null
2022-12-14T20:59:50
2014-09-30T02:53:21
Python
UTF-8
Java
false
false
4,405
java
package models; import com.arj.ziguiw.common.Status; import play.db.jpa.JPASupport; import javax.persistence.*; import java.util.Date; import java.util.List; /** * Created with IntelliJ IDEA. * User: Administrator * Date: 13-3-1 * Time: 上午11:57 */ @Entity @Table(name = "s_school_xxyd") @Form(displayName = "学习园地") @SequenceGenerator(name = "s_school_xxyd_seq", sequenceName = "s_school_xxyd_seq", allocationSize = 1, initialValue = 100000) public class SchoolXxyd extends JPASupport{ @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "s_school_xxyd_seq") public Long id; @Column(name = "title", length = 255) @Field(displayName = "标题") public String title; @Column(name = "cause", length = 1000) @Field(displayName = "失败原因") public String cause; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "school_id") @Field(displayName = "学校") public School school; @Column(name="type", columnDefinition = "number(2)", nullable = false) @Field(displayName = "类型") public Integer type; @Column(name = "create_time", nullable = false, columnDefinition = "DATE") @Field(displayName = "创建时间") public Date createTime = new Date(); @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "user_id") @Field(displayName = "用户") public UserBase user; @Column(name = "VISIT_COUNT") @Field(displayName = "查看次数") public Integer visitCount = 0; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "class_id") @Field(displayName = "班级") public SchoolClazz clazz; @Column(name = "url", length = 1000) @Field(displayName = "图片") public String url; @Column(name = "video_url", length = 1000) @Field(displayName = "图片") public String videoUrl; @Lob @Basic(fetch= FetchType.EAGER, optional=true) @Column(name = "content") @Field(displayName = "内容") public String content; @Column(name = "status", nullable = false, columnDefinition = "number(2)") @Field(displayName = "状态") public int status = Status.UNVERIFIED; public static List<SchoolXxyd> findBySchoolId(long schoolId , int count){ return find("from SchoolXxyd where school.id = ? and status = ? order by createTime desc", schoolId,Status.OK).fetch(count); } public static List<SchoolXxyd> findUrl(Long schoolId , int count) { return find("from SchoolXxyd where school.id = ? and status = ? and url is not null order by createTime desc", schoolId,Status.OK).fetch(count); } public static Page<SchoolXxyd> findPage(Integer page , Integer pageSize ,Long schoolId,Integer type){ List<SchoolXxyd> list = find("from SchoolXxyd where school.id = ? and status = ? and type = ? order by createTime desc", schoolId,Status.OK,type).fetch(page,pageSize); long count = count("select count(*) from SchoolXxyd where school.id = ? and status = ? and type = ? order by createTime desc", schoolId,Status.OK,type); return new Page<SchoolXxyd>(page,pageSize,count,list); } public static List<SchoolXxyd> findByClassId(Long classId , Long schoolId , int count){ return find("from SchoolXxyd where school.id = ? and status = ? and clazz.id = ? order by createTime desc", schoolId,Status.OK,classId).fetch(count); } public static List<SchoolXxyd> findByClassUrl(Long classId,Long schoolId , int count) { return find("from SchoolXxyd where school.id = ? and status = ? and clazz.id = ? and url is not null order by createTime desc", schoolId,Status.OK,classId).fetch(count); } public static Page<SchoolXxyd> findPageByClassId(Long classId, Long schoolId, Integer type , Integer page , Integer pageSize) { List<SchoolXxyd> list = find("from SchoolXxyd where school.id = ? and status = ? and type = ? and clazz.id = ? order by createTime desc", schoolId,Status.OK,type,classId).fetch(page,pageSize); long count = count("select count(*) from SchoolXxyd where school.id = ? and status = ? and type = ? and clazz.id = ? order by createTime desc", schoolId,Status.OK,type,classId); return new Page<SchoolXxyd>(page,pageSize,count,list); } }
[ "lizhou828@126.com" ]
lizhou828@126.com
041905736f942a41d4ae66fd8cb4d678b3b58d2f
ad3d871e360f198aebd51b2958526ee5de23e36c
/src/java/ch/laoe/operation/AOLoopable.java
b0919b02eeb59309e9a592ecb782a05ac25b21ff
[]
no_license
umjammer/vavi-apps-laoe
d115a03ed05ddcf0ea1ed940d34af8c03acff3b4
7ccee1c179073228b39a60b4f584f750b62877b3
refs/heads/master
2021-07-22T19:26:56.081636
2009-10-08T15:56:13
2009-10-08T15:56:13
109,250,690
1
0
null
null
null
null
ISO-8859-1
Java
false
false
2,667
java
/* * This file is part of LAoE. * * LAoE 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. * * LAoE 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 LAoE; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package ch.laoe.operation; import ch.laoe.clip.AChannelSelection; /** * makes a selection loopable, different modes are possible: - * * @autor olivier gäumann, neuchâtel (switzerland) * @target JDK 1.3 * * @version 14.05.01 first draft oli4 * 21.06.01 add loopcount oli4 * 15.09.01 completely redefined oli4 */ public class AOLoopable extends AOperation { public AOLoopable(int order) { super(); this.order = order; } private int order; public void operate(AChannelSelection ch1) { float s1[] = ch1.getChannel().sample; int o1 = ch1.getOffset(); int l1 = ch1.getLength(); float tmp[] = new float[l1]; // mark changed channels... ch1.getChannel().changeId(); // copy center for (int i = 0; i < l1; i++) { tmp[i] = s1[i + o1]; } float oldRms = AOToolkit.rmsAverage(tmp, 0, tmp.length); // fade in left part AChannelSelection ch2 = new AChannelSelection(ch1.getChannel(), 0, o1); ch2.operateChannel(new AOFade(AOFade.IN, order, 0, false)); // fade out right part AChannelSelection ch3 = new AChannelSelection(ch1.getChannel(), o1 + l1, s1.length - o1 - l1); ch3.operateChannel(new AOFade(AOFade.OUT, order, 0, false)); // copy left part for (int i = 0; i < l1; i++) { if (o1 - l1 + i >= 0) { tmp[i] += s1[o1 - l1 + i]; } } // copy right part for (int i = 0; i < l1; i++) { if (o1 + l1 + i < s1.length) { tmp[i] += s1[o1 + l1 + i]; } } // RMS-calibration float newRms = AOToolkit.rmsAverage(tmp, 0, tmp.length); AOToolkit.multiply(tmp, 0, tmp.length, (oldRms / newRms)); // replace old samples with new samples ch1.getChannel().sample = tmp; } }
[ "umjammer@00cfdfb4-7834-11de-ac83-69fcb5c178b1" ]
umjammer@00cfdfb4-7834-11de-ac83-69fcb5c178b1
dec043a8e9c71672f46c34ba431966b21cc34232
504e7fbe35cd2dc9f9924312e84540018880de56
/code/app/src/main/java/cn/fizzo/hub/fitness/ui/widget/fizzo/FrameMainLayoutBind.java
683db91648011b17287c33a5640545cd74e40cb9
[]
no_license
RaulFan2019/FitnessHub
c16bcad794197b175a0a5b2fc611ddd1ddbbfc0e
41755b81a077d5db38e95697708cd4a790e5741c
refs/heads/master
2020-05-17T05:59:31.939185
2020-03-30T02:15:02
2020-03-30T02:15:02
183,548,074
0
1
null
null
null
null
UTF-8
Java
false
false
1,281
java
package cn.fizzo.hub.fitness.ui.widget.fizzo; import android.content.Context; import android.util.AttributeSet; import java.util.List; import cn.fizzo.hub.fitness.entity.model.MainMenuItemBindME; import cn.fizzo.hub.fitness.utils.DeviceU; /** * 主页面承载锻炼 * Created by Raul.fan on 2018/1/31 0031. * Mail:raul.fan@139.com * QQ: 35686324 */ public class FrameMainLayoutBind extends FrameMainLayout { private Context mContext; public FrameMainLayoutBind(Context context) { super(context); this.mContext = context; } public FrameMainLayoutBind(Context context, AttributeSet attrs) { super(context, attrs); this.mContext = context; } public void updateViews(final List<MainMenuItemBindME> listSport) { removeAllViews(); int margin = (int) DeviceU.dpToPixel(17); int increment = (int) DeviceU.dpToPixel(348); for (int i = 0; i < listSport.size(); i++) { MainMenuItemBind itemSport = new MainMenuItemBind(mContext); itemSport.updateView(listSport.get(i)); addView(itemSport); LayoutParams lp = (LayoutParams) itemSport.getLayoutParams(); lp.leftMargin = margin; margin += increment; } } }
[ "raul.fan@fizzo.cn" ]
raul.fan@fizzo.cn
1b066a521ceb5a05a73fbc07a6d04746ad0bcac1
6251ec8dd7f02c15174e897910f72aa37e9e3c51
/JavaSE/src/main/java/test/CalendarTest.java
d930272068c41c08928f279ce5a87fd458835c5d
[]
no_license
Wincher/JavaWorkout
ff55ecdf6d2867ed56ec2e1f95e7cf7d41aee068
81e80bfb4aec823ffe625cc98330d123ffd1e3d6
refs/heads/master
2023-06-28T07:07:38.727462
2023-03-18T06:57:55
2023-03-18T07:14:32
99,265,446
0
0
null
2023-06-14T22:46:52
2017-08-03T18:56:37
Java
UTF-8
Java
false
false
1,695
java
package test; import java.text.SimpleDateFormat; import java.util.Calendar; public class CalendarTest { public static void main(String[] args) { getTimeOfMillionsTime(1563879779-1563850979); Calendar now = Calendar.getInstance(); clearTime(now); System.out.println(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(now.getTime())); Calendar expire = Calendar.getInstance(); clearTime(expire); expire.add(Calendar.MONTH, -24); now.add(Calendar.MONTH, -24); System.out.println(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(expire.getTime())); System.out.println(new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(now.getTime())); System.out.println(now.after(expire)); } private static void clearTime(Calendar calendar) { calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); } private static void getTimeOfMillionsTime(long timestamp) { Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(timestamp); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day = calendar.get(Calendar.DAY_OF_MONTH); int hour = calendar.get(Calendar.HOUR_OF_DAY);//24小时制 // int hour = calendar.get(Calendar.HOUR);//12小时制 int minute = calendar.get(Calendar.MINUTE); int second = calendar.get(Calendar.SECOND); System.out.println(year + "年" + (month + 1) + "月" + day + "日" + hour + "时" + minute + "分" + second + "秒"); } }
[ "wincher.hoo@gmail.com" ]
wincher.hoo@gmail.com
91eb80531d8e3ebf47e70b1d3c3197fe1032f6e1
b2016b74acf02c0117128b505baac48338d825c9
/sophia.mmorpg/src/main/java/sophia/mmorpg/stat/StatOnlineTickerImpl.java
5c4590f26b477ffad5a6f959a85db2dbe19dbaa1
[]
no_license
atom-chen/server
979830e60778a3fba1740ea3afb2e38937e84cea
c44e12a3efe5435d55590c9c0fd9e26cec58ed65
refs/heads/master
2020-06-17T02:54:13.348191
2017-10-13T18:40:21
2017-10-13T18:40:21
195,772,502
0
1
null
2019-07-08T08:46:37
2019-07-08T08:46:37
null
UTF-8
Java
false
false
3,387
java
/** * Copyright 2013-2015 Sophia * * 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 sophia.mmorpg.stat; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; import sophia.mmorpg.player.PlayerManager; import sophia.mmorpg.player.persistence.PlayerDAO; public class StatOnlineTickerImpl extends sophia.stat.StatOnlineTicker { private AtomicInteger connectedNum = new AtomicInteger(0); private List<String> connectedIps = new ArrayList<String>(); private AtomicInteger loggedNum = new AtomicInteger(0); private List<String> loggedUids = new ArrayList<String>(); private AtomicInteger enteredNum = new AtomicInteger(0); private List<String> enteredUids = new ArrayList<String>(); private int last_players =-1; private int totalNum = 0; @Override public void selectTotalNum() { setTotalNum(PlayerDAO.getInstance().getSelectPlayerTotal()); } @Override public int getTotalNum() { return totalNum; } @Override public void addTotalNum(int addNum) { totalNum += addNum; } @Override public void setTotalNum(int totalNum) { this.totalNum = totalNum; } @Override public int getOnlineNum() { return PlayerManager.getOnlineTotalCount(); } @Override public int getTotalIncNum() { if(last_players == -1){ return 0; } return getTotalNum() - last_players; } @Override public int getConnectedNum() { return connectedNum.get(); } @Override public int getConnectedIpNum() { synchronized (connectedIps) { return connectedIps.size(); } } @Override public int getLoggedNum() { return loggedNum.get(); } @Override public int getLoggedUidNum() { synchronized (loggedUids) { return loggedUids.size(); } } @Override public int getEnteredNum() { return enteredNum.get(); } @Override public int getEnteredUidNum() { synchronized (enteredUids) { return enteredUids.size(); } } @Override public void onTickSave() { last_players = getTotalNum(); connectedNum.set(0); loggedNum.set(0); enteredNum.set(0); synchronized (connectedIps) { connectedIps.clear(); } synchronized (loggedUids) { loggedUids.clear(); } synchronized (enteredUids) { enteredUids.clear(); } } @Override public void onConnected(String ip) { connectedNum.addAndGet(1); synchronized (connectedIps) { if (!connectedIps.contains(ip)) connectedIps.add(ip); } } @Override public void onLogged(String identityId) { if (identityId == null) identityId = ""; loggedNum.addAndGet(1); synchronized (loggedUids) { if (!loggedUids.contains(identityId)) loggedUids.add(identityId); } } @Override public void onEntered(String identityId) { enteredNum.addAndGet(1); synchronized (enteredUids) { if (!enteredUids.contains(identityId)) enteredUids.add(identityId); } } }
[ "hi@luanhailiang.cn" ]
hi@luanhailiang.cn
9830f0f10e553b9101c8168ee5fa744a677d0b5d
cd0bd4b251a98646f086f27687402a1c8042fdbc
/e2/src/vip/hht/Tools/JRedisUtil.java
c4fcb39a13e94e18e0688fbbbbf3c018bb45098c
[]
no_license
huanghetang/eclipse_workspace
4bd76d339ba1878a084f595bb0832e7987954db7
a89dc12d021ab55810e86016050829a0103adde1
refs/heads/master
2020-03-26T11:04:10.524462
2018-08-15T08:40:42
2018-08-15T08:40:42
144,826,607
0
0
null
null
null
null
GB18030
Java
false
false
2,385
java
package vip.hht.Tools; import java.io.IOException; import java.io.InputStream; import java.util.Properties; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig; /** * Java for Redis Tool * @author zhoumo * */ public class JRedisUtil { private static Properties properties; private static JedisPool jedisPool = null; static{ InputStream is = JRedisUtil.class.getClassLoader().getResourceAsStream("env.properties"); // InputStream is = First.class.getResourceAsStream("/env.properties");//此方法'/'代表相对src的路径,不加代表相对包下面的路径,最终还是通过该classloader来找 properties = new Properties(); try { properties.load(is); is.close(); } catch (IOException e) { e.printStackTrace(); } } /** * 获取JedisPool连接池 * @return */ public static JedisPool getJedisPool() { if(jedisPool!=null){ return jedisPool; } JedisPoolConfig poolConfig = new JedisPoolConfig(); poolConfig.setMaxTotal(Integer.valueOf(properties.getProperty("jedis.maxTotle"))); poolConfig.setMinIdle(Integer.valueOf(properties.getProperty("jedis.minIdle"))); poolConfig.setMaxIdle(Integer.valueOf(properties.getProperty("jedis.maxIdle"))); JedisPool jedisPool = new JedisPool(poolConfig, properties.getProperty("jedis.url"), Integer.valueOf(properties.getProperty("jedis.port"))); return jedisPool; } /** * 向Redis中存String类型的值 * @param key * @param value * @param second */ public static void setString2Redis(String key,String value,int sceond){ JedisPool jedisPool = getJedisPool(); Jedis jedis = jedisPool.getResource(); jedis.set(key, value); jedis.expire(key, sceond);//设置过期时间 jedis.close(); } /** * 向Redis获取key * @param key * @param value */ public static String getString4Redis(String key){ JedisPool jedisPool = getJedisPool(); Jedis jedis = jedisPool.getResource(); //判断超时 Long ttl = jedis.ttl(key); if(ttl.intValue()==-2){//key超时 jedis.close(); return "-2"; } String value = jedis.get(key); jedis.close(); return value; } public static void main(String[] args) { JedisPool jedisPool = getJedisPool(); Jedis jedis = jedisPool.getResource(); String s = jedis.get("username"); jedisPool.close(); System.out.println(s); } }
[ "1278699240@qq.com" ]
1278699240@qq.com
2b5f979c8eb8166a94e7cefecbd132d4df672ee6
7559bead0c8a6ad16f016094ea821a62df31348a
/src/com/vmware/vim25/ReplicationDiskConfigFaultReasonForFault.java
f34325fa0b4163a106af97a966a5d550e175332e
[]
no_license
ZhaoxuepengS/VsphereTest
09ba2af6f0a02d673feb9579daf14e82b7317c36
59ddb972ce666534bf58d84322d8547ad3493b6e
refs/heads/master
2021-07-21T13:03:32.346381
2017-11-01T12:30:18
2017-11-01T12:30:18
109,128,993
1
1
null
null
null
null
UTF-8
Java
false
false
2,293
java
package com.vmware.vim25; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for ReplicationDiskConfigFaultReasonForFault. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="ReplicationDiskConfigFaultReasonForFault"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="diskNotFound"/> * &lt;enumeration value="diskTypeNotSupported"/> * &lt;enumeration value="invalidDiskKey"/> * &lt;enumeration value="invalidDiskReplicationId"/> * &lt;enumeration value="duplicateDiskReplicationId"/> * &lt;enumeration value="invalidPersistentFilePath"/> * &lt;enumeration value="reconfigureDiskReplicationIdNotAllowed"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "ReplicationDiskConfigFaultReasonForFault") @XmlEnum public enum ReplicationDiskConfigFaultReasonForFault { @XmlEnumValue("diskNotFound") DISK_NOT_FOUND("diskNotFound"), @XmlEnumValue("diskTypeNotSupported") DISK_TYPE_NOT_SUPPORTED("diskTypeNotSupported"), @XmlEnumValue("invalidDiskKey") INVALID_DISK_KEY("invalidDiskKey"), @XmlEnumValue("invalidDiskReplicationId") INVALID_DISK_REPLICATION_ID("invalidDiskReplicationId"), @XmlEnumValue("duplicateDiskReplicationId") DUPLICATE_DISK_REPLICATION_ID("duplicateDiskReplicationId"), @XmlEnumValue("invalidPersistentFilePath") INVALID_PERSISTENT_FILE_PATH("invalidPersistentFilePath"), @XmlEnumValue("reconfigureDiskReplicationIdNotAllowed") RECONFIGURE_DISK_REPLICATION_ID_NOT_ALLOWED("reconfigureDiskReplicationIdNotAllowed"); private final String value; ReplicationDiskConfigFaultReasonForFault(String v) { value = v; } public String value() { return value; } public static ReplicationDiskConfigFaultReasonForFault fromValue(String v) { for (ReplicationDiskConfigFaultReasonForFault c: ReplicationDiskConfigFaultReasonForFault.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "495149700@qq.com" ]
495149700@qq.com
ae0a9ce6045d5a5cd84868b1e9b7dfb3cd44b172
8a8254c83cc2ec2c401f9820f78892cf5ff41384
/instrumented-nappa-greedy/AntennaPod/core/src/main/java/nappagreedy/de/danoeh/antennapod/core/receiver/MediaButtonReceiver.java
dd6002647f15496165a64ebb733cea22dafd5d88
[ "MIT" ]
permissive
VU-Thesis-2019-2020-Wesley-Shann/subjects
46884bc6f0f9621be2ab3c4b05629e3f6d3364a0
14a6d6bb9740232e99e7c20f0ba4ddde3e54ad88
refs/heads/master
2022-12-03T05:52:23.309727
2020-08-19T12:18:54
2020-08-19T12:18:54
261,718,101
0
0
null
2020-07-11T12:19:07
2020-05-06T09:54:05
Java
UTF-8
Java
false
false
1,573
java
package nappagreedy.de.danoeh.antennapod.core.receiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import androidx.core.content.ContextCompat; import android.util.Log; import android.view.KeyEvent; import nappagreedy.de.danoeh.antennapod.core.ClientConfig; import nappagreedy.de.danoeh.antennapod.core.service.playback.PlaybackService; /** Receives media button events. */ public class MediaButtonReceiver extends BroadcastReceiver { private static final String TAG = "MediaButtonReceiver"; public static final String EXTRA_KEYCODE = "nappagreedy.de.danoeh.antennapod.core.service.extra.MediaButtonReceiver.KEYCODE"; public static final String EXTRA_SOURCE = "nappagreedy.de.danoeh.antennapod.core.service.extra.MediaButtonReceiver.SOURCE"; public static final String NOTIFY_BUTTON_RECEIVER = "nappagreedy.de.danoeh.antennapod.NOTIFY_BUTTON_RECEIVER"; @Override public void onReceive(Context context, Intent intent) { Log.d(TAG, "Received intent"); if (intent == null || intent.getExtras() == null) { return; } KeyEvent event = (KeyEvent) intent.getExtras().get(Intent.EXTRA_KEY_EVENT); if (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount()==0) { ClientConfig.initialize(context); Intent serviceIntent = new Intent(context, PlaybackService.class); serviceIntent.putExtra(EXTRA_KEYCODE, event.getKeyCode()); serviceIntent.putExtra(EXTRA_SOURCE, event.getSource()); ContextCompat.startForegroundService(context, serviceIntent); } } }
[ "sshann95@outlook.com" ]
sshann95@outlook.com