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
9f3a56c901c9fe3c9016a2379059e5f7ccf9b106
fff3302fe8193d13360f12e5b13d376ef76cf4d6
/AppLock/com/facebook/ads/internal/p030j/p032b/p033a/C1636b.java
02ff8a110d05e2504a3d6cc44e555f8800a00f30
[]
no_license
shaolin-example-com-my-shopify-com/KidWatcher
2912950b7ca4773c3d29005b9d231ad6035b4912
f67a81b757043159ea358b7f9e4b16fd6be0e0c0
refs/heads/master
2022-04-25T17:19:28.800922
2020-04-30T02:53:20
2020-04-30T02:53:20
260,098,439
0
0
null
2020-04-30T02:51:49
2020-04-30T02:51:48
null
UTF-8
Java
false
false
3,299
java
package com.facebook.ads.internal.p030j.p032b.p033a; import com.facebook.ads.internal.p030j.p032b.C1635a; import com.facebook.ads.internal.p030j.p032b.C1661l; import java.io.File; import java.io.RandomAccessFile; public class C1636b implements C1635a { public File f4044a; private final C1634a f4045b; private RandomAccessFile f4046c; public C1636b(File file, C1634a c1634a) { if (c1634a == null) { try { throw new NullPointerException(); } catch (Throwable e) { throw new C1661l("Error using file " + file + " as disc cache", e); } } this.f4045b = c1634a; C1640d.m4618a(file.getParentFile()); boolean exists = file.exists(); this.f4044a = exists ? file : new File(file.getParentFile(), file.getName() + ".download"); this.f4046c = new RandomAccessFile(this.f4044a, exists ? "r" : "rw"); } private boolean m4608a(File file) { return file.getName().endsWith(".download"); } public synchronized int mo2760a() { try { } catch (Throwable e) { throw new C1661l("Error reading length of file " + this.f4044a, e); } return (int) this.f4046c.length(); } public synchronized int mo2761a(byte[] bArr, long j, int i) { try { this.f4046c.seek(j); } catch (Throwable e) { throw new C1661l(String.format("Error reading %d bytes with offset %d from file[%d bytes] to buffer[%d bytes]", new Object[]{Integer.valueOf(i), Long.valueOf(j), Integer.valueOf(mo2760a()), Integer.valueOf(bArr.length)}), e); } return this.f4046c.read(bArr, 0, i); } public synchronized void mo2762a(byte[] bArr, int i) { try { if (mo2765d()) { throw new C1661l("Error append cache: cache file " + this.f4044a + " is completed!"); } this.f4046c.seek((long) mo2760a()); this.f4046c.write(bArr, 0, i); } catch (Throwable e) { throw new C1661l(String.format("Error writing %d bytes to %s from buffer with size %d", new Object[]{Integer.valueOf(i), this.f4046c, Integer.valueOf(bArr.length)}), e); } } public synchronized void mo2763b() { try { this.f4046c.close(); this.f4045b.mo2766a(this.f4044a); } catch (Throwable e) { throw new C1661l("Error closing file " + this.f4044a, e); } } public synchronized void mo2764c() { if (!mo2765d()) { mo2763b(); File file = new File(this.f4044a.getParentFile(), this.f4044a.getName().substring(0, this.f4044a.getName().length() - ".download".length())); if (this.f4044a.renameTo(file)) { this.f4044a = file; try { this.f4046c = new RandomAccessFile(this.f4044a, "r"); } catch (Throwable e) { throw new C1661l("Error opening " + this.f4044a + " as disc cache", e); } } throw new C1661l("Error renaming file " + this.f4044a + " to " + file + " for completion!"); } } public synchronized boolean mo2765d() { return !m4608a(this.f4044a); } }
[ "Nist@netcompany.com" ]
Nist@netcompany.com
bac81ad82ae390e388d2bb52fc8f595d2a4d83c4
4645f0902adad06800f349d83790fa8563cf4de0
/intarsys-tools-runtime/src/main/java/de/intarsys/tools/factory/IFactory.java
17d4c54bf9f09efb8f8d719a27782496552f273b
[ "BSD-3-Clause" ]
permissive
intarsys/runtime
51436fd883c1021238572a1967a1ca99177946a7
00afced0b6629dbdda4463e4b440ec962225b4ec
refs/heads/master
2023-09-03T02:50:13.190773
2023-07-25T12:52:50
2023-08-23T13:41:40
11,248,689
1
4
null
null
null
null
UTF-8
Java
false
false
309
java
package de.intarsys.tools.factory; import de.intarsys.tools.functor.IArgs; import de.intarsys.tools.reflect.ObjectCreationException; public interface IFactory<T> { public T createInstance(IArgs args) throws ObjectCreationException; public String getId(); public Class<? extends T> getResultType(); }
[ "eheck@intarsys.de" ]
eheck@intarsys.de
99c07e31ef10393b2b3014b867f11cc55b8713f4
6c75bc3f0b09f3d01765f973020b0b2a5af35deb
/enjoysdk_core/src/main/java/com/enjoy/sdk/core/http/exception/EnjoyServerException.java
32e4d4c88ed7dda0632cb52dc58e35b6e7830f1e
[]
no_license
luckkiss/enjoySDK
40d15593b2e31fedcdb7ca18e58381469bbc1037
7ccd4bd4a13ecf7a4376ebe0dc0ef41c7ee67c81
refs/heads/main
2023-08-31T12:34:59.553328
2021-11-08T10:28:00
2021-11-08T10:28:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
583
java
package com.enjoy.sdk.core.http.exception; import com.enjoy.sdk.core.http.EnjoyResponse; /** * Data:24/12/2018-11:07 AM * Author: ranger */ public class EnjoyServerException extends Exception { private String serverMsg; private String serverData; public EnjoyServerException(EnjoyResponse tnResponse) { super(tnResponse.toString()); serverMsg = tnResponse.msg; serverData = tnResponse.data; } public String getServerMsg() { return serverMsg; } public String getServerData() { return serverData; } }
[ "1628103949@qq.com" ]
1628103949@qq.com
df88294b424998c0cf8ee53352d1c0b26b9d30ef
0c98cf3f64a72ceb4987f23936979d587183e269
/services/cbs/src/main/java/com/huaweicloud/sdk/cbs/v1/model/QaBotAnswer.java
196851861ba4dc2b6453e5d43c5e0c09560704a3
[ "Apache-2.0" ]
permissive
cwray01/huaweicloud-sdk-java-v3
765d08e4b6dfcd88c2654bdbf5eb2dd9db19f2ef
01b5a3b4ea96f8770a2eaa882b244930e5fd03e7
refs/heads/master
2023-07-17T10:31:20.119625
2021-08-31T11:38:37
2021-08-31T11:38:37
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,255
java
package com.huaweicloud.sdk.cbs.v1.model; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import java.util.function.Consumer; import java.util.Objects; /** * */ public class QaBotAnswer { @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="qa_pair_id") private String qaPairId; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="st_question") private String stQuestion; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="answer") private String answer; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="score") private Double score; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="domain") private String domain; @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty(value="top_score_question") private String topScoreQuestion; public QaBotAnswer withQaPairId(String qaPairId) { this.qaPairId = qaPairId; return this; } /** * 问答对ID。 * @return qaPairId */ public String getQaPairId() { return qaPairId; } public void setQaPairId(String qaPairId) { this.qaPairId = qaPairId; } public QaBotAnswer withStQuestion(String stQuestion) { this.stQuestion = stQuestion; return this; } /** * 标准问题。 * @return stQuestion */ public String getStQuestion() { return stQuestion; } public void setStQuestion(String stQuestion) { this.stQuestion = stQuestion; } public QaBotAnswer withAnswer(String answer) { this.answer = answer; return this; } /** * 知识库答案,包含该字段的回答为直接回答,未包含该字段的是推荐回答。 * @return answer */ public String getAnswer() { return answer; } public void setAnswer(String answer) { this.answer = answer; } public QaBotAnswer withScore(Double score) { this.score = score; return this; } /** * 相似度得分,精确到小数点后3位。 * @return score */ public Double getScore() { return score; } public void setScore(Double score) { this.score = score; } public QaBotAnswer withDomain(String domain) { this.domain = domain; return this; } /** * 所属领域。 * @return domain */ public String getDomain() { return domain; } public void setDomain(String domain) { this.domain = domain; } public QaBotAnswer withTopScoreQuestion(String topScoreQuestion) { this.topScoreQuestion = topScoreQuestion; return this; } /** * 最高评分的扩展问或标准问,当关闭内部阈值处理时返回。 * @return topScoreQuestion */ public String getTopScoreQuestion() { return topScoreQuestion; } public void setTopScoreQuestion(String topScoreQuestion) { this.topScoreQuestion = topScoreQuestion; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } QaBotAnswer qaBotAnswer = (QaBotAnswer) o; return Objects.equals(this.qaPairId, qaBotAnswer.qaPairId) && Objects.equals(this.stQuestion, qaBotAnswer.stQuestion) && Objects.equals(this.answer, qaBotAnswer.answer) && Objects.equals(this.score, qaBotAnswer.score) && Objects.equals(this.domain, qaBotAnswer.domain) && Objects.equals(this.topScoreQuestion, qaBotAnswer.topScoreQuestion); } @Override public int hashCode() { return Objects.hash(qaPairId, stQuestion, answer, score, domain, topScoreQuestion); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class QaBotAnswer {\n"); sb.append(" qaPairId: ").append(toIndentedString(qaPairId)).append("\n"); sb.append(" stQuestion: ").append(toIndentedString(stQuestion)).append("\n"); sb.append(" answer: ").append(toIndentedString(answer)).append("\n"); sb.append(" score: ").append(toIndentedString(score)).append("\n"); sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); sb.append(" topScoreQuestion: ").append(toIndentedString(topScoreQuestion)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "hwcloudsdk@huawei.com" ]
hwcloudsdk@huawei.com
9ea27a98c79f4bd8738c66b6245f20d2a7435621
f9b254b3d57453bd6fc4e66dc082f3e92dce4179
/EHomeHDV5_1/CustomView/src/com/yuantuo/customview/nineoldandroids/util/NoSuchPropertyException.java
e2b0b9f658c2f1c019fe034d7cef6b4e00fff3f3
[]
no_license
zcz123/ehome
a45255bb4ebbfeb7804f424b1be53cf531589bf6
5a2df0be832f542cab6b49e7a0e8071d4f101525
refs/heads/master
2021-01-19T21:47:57.674732
2017-04-19T04:13:16
2017-04-19T04:13:16
88,708,738
3
0
null
2017-04-19T06:24:17
2017-04-19T06:24:17
null
UTF-8
Java
false
false
1,012
java
/* * Copyright (C) 2011 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.yuantuo.customview.nineoldandroids.util; /** * Thrown when code requests a {@link Property} on a class that does * not expose the appropriate method or field. * * @see Property#of(java.lang.Class, java.lang.Class, java.lang.String) */ public class NoSuchPropertyException extends RuntimeException { public NoSuchPropertyException(String s) { super(s); } }
[ "584692417@qq.com" ]
584692417@qq.com
183c12e3e73e99cc29592d27b39b447181a645f0
b81d1df0562de9d4ff5c30bec90647402972f478
/src/test/java/pl/pancordev/leak/three/nine/DummyControllerTest9.java
ee80bce6df79ab0efe20695873da1006fda4060a
[]
no_license
Pancor/leak
eea9fe401a7c9b543bf95a929f0bbf7ee6113dc9
f060ff6a1a8c829b287cffb35b9d63040ca3c7ec
refs/heads/master
2023-01-30T17:14:38.463089
2020-12-14T12:01:00
2020-12-14T12:01:00
321,322,490
0
2
null
null
null
null
UTF-8
Java
false
false
1,969
java
package pl.pancordev.leak.three.nine; 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.boot.test.mock.mockito.MockBean; import org.springframework.http.MediaType; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.context.WebApplicationContext; import pl.pancordev.leak.services.Service9; import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @WebAppConfiguration @RunWith(SpringRunner.class) public class DummyControllerTest9 { @Autowired private WebApplicationContext webApplicationContext; @MockBean private Service9 service9; private MockMvc mvc; @Before public void setUp() { mvc = MockMvcBuilders.webAppContextSetup(webApplicationContext) .defaultRequest(delete("/").contentType(MediaType.APPLICATION_JSON)) .alwaysDo(print()) .apply(springSecurity()) .build(); } @Test public void shouldReturnProperResponseFromIndexPage() throws Exception { mvc.perform(delete("/")) .andExpect(status().isOk()) .andExpect(content().string("It's dummy response from server")); } }
[ "pancordev@gmail.com" ]
pancordev@gmail.com
3bb89f8328f749f81a9eb483eabb19135bd24079
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Hibernate/Hibernate11695.java
91c418a158b7a8604000ca2ee07455fec295e5f9
[]
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
849
java
private Operation findQueryOperation(final boolean isWarmup) { return new Operation("FIND_QUERY") { @Override boolean call(final int run) throws Exception { return captureThrowables(new Callable<Boolean>() { @Override public Boolean call() throws Exception { Session s = sessionFactory.openSession(); Query query = s.createQuery("from Family") .setCacheable(true); int maxResults = isWarmup ? 10 : 100; query.setMaxResults(maxResults); List<Family> result = (List<Family>) query.list(); assertEquals(maxResults, result.size()); s.close(); return true; } }); } }; }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
0427edb52ee6f346744bb4f6f7aad321e721f94a
1d3b316a99acb2f33bcd302c373f6a5034a2a216
/core/konekti.dao.api/src/main/java/com/thingtrack/konekti/dao/api/EmployeeAgentStatusDao.java
2cc04ac66675a96e0c41bff85d06dbcc6cf4b6ac
[ "Apache-2.0" ]
permissive
carlos-salinas/konekti
33eddf866b043ee4d50cdc5adb342cedd19d1d8c
165ec92f4b960b7ec94b5daceb2dbfce52be312c
refs/heads/master
2021-01-25T05:11:08.741071
2013-04-25T07:57:32
2013-04-25T07:57:32
10,340,638
1
0
null
null
null
null
UTF-8
Java
false
false
933
java
/* * Copyright 2011 Thingtrack, S.L. * * 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.thingtrack.konekti.dao.api; import com.thingtrack.konekti.dao.template.Dao; import com.thingtrack.konekti.domain.EmployeeAgentStatus; /** * @author Thingtrack S.L. * */ public interface EmployeeAgentStatusDao extends Dao<EmployeeAgentStatus, Integer> { public EmployeeAgentStatus getByName(String name) throws Exception; }
[ "carlos@thingtrack.com" ]
carlos@thingtrack.com
f2082f6f231a01b00526531b6412cf55768de1c8
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-3.0.0-M2-20090922/transports/cxf/src/main/java/org/mule/transport/cxf/component/WebServiceWrapperComponent.java
6a5d0f292a4c9ded39488bf1062bc9321d4d158c
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
2,588
java
/* * $Id: WebServiceWrapperComponent.java 12228 2008-07-03 00:26:59Z aguenther $ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.transport.cxf.component; import org.mule.DefaultMuleMessage; import org.mule.api.MuleContext; import org.mule.api.MuleEvent; import org.mule.api.MuleMessage; import org.mule.api.endpoint.EndpointBuilder; import org.mule.api.endpoint.OutboundEndpoint; import org.mule.config.i18n.CoreMessages; import org.mule.endpoint.EndpointURIEndpointBuilder; import org.mule.transport.soap.component.AbstractWebServiceWrapperComponent; public class WebServiceWrapperComponent extends AbstractWebServiceWrapperComponent { private String wsdlPort; private String operation; protected MuleMessage doInvoke(MuleEvent event) throws Exception { MuleContext muleContext = event.getMuleContext(); String tempUrl; if (addressFromMessage) { tempUrl = event.getMessage().getStringProperty(WS_SERVICE_URL, null); if (tempUrl == null) { throw new IllegalArgumentException(CoreMessages.propertyIsNotSetOnEvent(WS_SERVICE_URL) .toString()); } } else { tempUrl = address; } MuleMessage message = new DefaultMuleMessage(event.transformMessage(), muleContext); EndpointBuilder endpointBuilder = new EndpointURIEndpointBuilder("cxf:" + tempUrl, muleContext); if (wsdlPort != null) { endpointBuilder.setProperty("wsdlPort", wsdlPort); } if (operation != null) { endpointBuilder.setProperty("operation", operation); } OutboundEndpoint endpoint = muleContext.getRegistry().lookupEndpointFactory().getOutboundEndpoint( endpointBuilder); MuleMessage result = event.getSession().sendEvent(message, endpoint); return result; } public String getWsdlPort() { return wsdlPort; } public void setWsdlPort(String wsdlPort) { this.wsdlPort = wsdlPort; } public String getOperation() { return operation; } public void setOperation(String operation) { this.operation = operation; } }
[ "rossmason@bf997673-6b11-0410-b953-e057580c5b09" ]
rossmason@bf997673-6b11-0410-b953-e057580c5b09
1858bd09fabc0389c3eb4718f3b215e4a27e1687
66b0b2dbdf000affc0411a8019d64dda8990d6c3
/Android_source/Android_source/workspace(書籍掲載全リスト)/AirSword/src/com/study/android/airsword/AirSwordListener.java
b1cb5e3d3549f96366868a044a5f49084a6f148f
[]
no_license
takagotch/and
e6bf811e194f47d7e2b30079c308380f7d118929
dfba108b0a1eb965a71ee2c559ac1666a7a6af57
refs/heads/master
2021-09-15T20:02:34.048548
2018-06-09T18:43:20
2018-06-09T18:43:20
109,402,630
0
0
null
null
null
null
UTF-8
Java
false
false
2,891
java
package com.study.android.airsword; import java.util.List; import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.widget.Toast; public class AirSwordListener implements SensorEventListener { // 加速度検知しきい値 private static final float DETECT_ACCELERO = 13.0F; private static final int DETECT_ACCELERO_COUNT = 3; // フィールド private OnAirSwordListener asListener; private SensorManager smng; private Context context; private int counter; // コンストラクタ public AirSwordListener(Context con) { // センサーサービスを取得 smng = (SensorManager) con.getSystemService(Context.SENSOR_SERVICE); context = con; } // 加速検知リスナー public interface OnAirSwordListener { // 加速検知メソッドを呼び出す void onAccelero(); } // 加速検知リスナー設定 public void setOnAirSwordListener(OnAirSwordListener listener) { // 加速検知リスナーにリスナーをセット asListener = listener; } // レジュームメソッド public void onResume() { // 加速度センサーリスト取得 List<Sensor> list = smng.getSensorList(Sensor.TYPE_ACCELEROMETER); // リストのサイズが1より小の場合は終了 if (list.size() < 1) return; // センサーマネージャーに登録、ディレイ設定 smng.registerListener(this, list.get(0), SensorManager.SENSOR_DELAY_UI); } // ポーズメソッド public void onPause() { // センサーマネージャーの登録解除 smng.unregisterListener(this); } // 精度変更処理 public void onAccuracyChanged(Sensor s, int ac) { } // センサー検出値変更イベント public void onSensorChanged(SensorEvent evt) { // 加速度センサー以外の場合は終了 if (evt.sensor.getType() != Sensor.TYPE_ACCELEROMETER) { return; } // 検出値をセット float x = Math.abs(evt.values[0]); float y = Math.abs(evt.values[1]); float z = Math.abs(evt.values[2]); // 加速度が所定値より大きいかのチェック if ((x > DETECT_ACCELERO) || (y > DETECT_ACCELERO) || (z > DETECT_ACCELERO)) { // 検出カウンタカウント counter++; // 所定回数以上の場合 if (counter > DETECT_ACCELERO_COUNT) { // カウンタを0にリセット counter = 0; // トースト加速度表示 Toast.makeText( context, "加速検知\n" + String.valueOf(x) + "\n" + String.valueOf(y) + "\n" + String.valueOf(z), Toast.LENGTH_SHORT) .show(); // 加速検知メソッド呼び出し if (asListener != null) { asListener.onAccelero(); } } } else { // 1回でも加速度が小さい場合は0にリセット counter = 0; } } }
[ "dyaccb@gmail.com" ]
dyaccb@gmail.com
7e1ef739a28141500fd4970c8690c43fb8ef82ed
29e184b262bb73e7301fca6b8069c873e910111c
/src/main/java/com/example/jaxb/fpml/recordkeeping/ForwardRateCurve.java
f1999a521f874252b06637bbe6705c359e2b1a73
[]
no_license
oliversalmon/fpml
6c0578d8b2460e3976033fa9aea4254341aba65b
cecf5321e750bbb88c14e9bd75ee341acdccc444
refs/heads/master
2020-04-03T17:41:00.682605
2018-10-30T20:58:56
2018-10-30T20:58:56
155,455,414
0
0
null
null
null
null
UTF-8
Java
false
false
2,517
java
package com.example.jaxb.fpml.recordkeeping; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * A curve used to model a set of forward interest rates. Used for forecasting interest rates as part of a pricing calculation. * * <p>Java class for ForwardRateCurve complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ForwardRateCurve"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="assetReference" type="{http://www.fpml.org/FpML-5/recordkeeping}AssetReference" minOccurs="0"/> * &lt;element name="rateCurve" type="{http://www.fpml.org/FpML-5/recordkeeping}TermCurve" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ForwardRateCurve", namespace = "http://www.fpml.org/FpML-5/recordkeeping", propOrder = { "assetReference", "rateCurve" }) public class ForwardRateCurve { @XmlElement(namespace = "http://www.fpml.org/FpML-5/recordkeeping") protected AssetReference assetReference; @XmlElement(namespace = "http://www.fpml.org/FpML-5/recordkeeping") protected TermCurve rateCurve; /** * Gets the value of the assetReference property. * * @return * possible object is * {@link AssetReference } * */ public AssetReference getAssetReference() { return assetReference; } /** * Sets the value of the assetReference property. * * @param value * allowed object is * {@link AssetReference } * */ public void setAssetReference(AssetReference value) { this.assetReference = value; } /** * Gets the value of the rateCurve property. * * @return * possible object is * {@link TermCurve } * */ public TermCurve getRateCurve() { return rateCurve; } /** * Sets the value of the rateCurve property. * * @param value * allowed object is * {@link TermCurve } * */ public void setRateCurve(TermCurve value) { this.rateCurve = value; } }
[ "oliver.salmon@gmail.com" ]
oliver.salmon@gmail.com
14e7f4396b99d2e0a69428cfa3ee4e5305b5646c
f38cc59518903e8ceef22f2153944279f0481134
/rift_lib/src/rift_extractor/classgen/classes/_2233.java
6e280f48c78d9920a044ec2bd85bc17d4a5ce8f3
[]
no_license
imathrowback/riftools
8de04a5efc906a1ecadf7913a9747091ef6706ec
a9c4021783c1b89c701fa227100260b359ae563d
refs/heads/master
2023-03-31T10:45:49.780385
2023-03-24T07:46:59
2023-03-24T07:46:59
94,748,733
3
1
null
null
null
null
UTF-8
Java
false
false
868
java
package rift_extractor.classgen.classes; import org.imathrowback.datparser.CObject; import static rift_extractor.classgen.ClassUtils.*; import rift_extractor.classgen.ClassUtils; /** 2233 **/ @com.thoughtworks.xstream.annotations.XStreamAlias("_2233") public class _2233 { public _2233(){} @com.thoughtworks.xstream.annotations.XStreamAsAttribute java.lang.Long unk0; java.lang.Long unk1; java.lang.Long unk2; java.lang.Float unk3; java.lang.Float unk4; public void parse(CObject obj) { ClassUtils.assertType(obj, 2233); unk0 = ClassUtils.getFieldMember(java.lang.Long.class,obj, 0); unk1 = ClassUtils.getFieldMember(java.lang.Long.class,obj, 1); unk2 = ClassUtils.getFieldMember(java.lang.Long.class,obj, 2); unk3 = ClassUtils.getFieldMember(java.lang.Float.class,obj, 3); unk4 = ClassUtils.getFieldMember(java.lang.Float.class,obj, 4); } }
[ "imathrowback@nowhere.com" ]
imathrowback@nowhere.com
5635f4b32eaec9edf469aeb901ab303c8a26643a
4e856508c5626f6513e9b8adaed631f0a0d7a84b
/app/src/main/java/com/turman/fb/xml/SaxHelper.java
64697a5929b19b8f50b758d8ec7b5ffeb4723112
[]
no_license
buobao/FB
b7a09240c4d7becbba5e84bb2e1ce5ee1661e379
b082ecfc71a3c1191c619bb090964c0171d61553
refs/heads/master
2016-08-11T19:09:26.604227
2016-04-12T23:36:39
2016-04-12T23:36:39
50,572,287
0
0
null
null
null
null
UTF-8
Java
false
false
2,716
java
package com.turman.fb.xml; import android.util.Log; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; import java.util.ArrayList; /** * Created by dqf on 2016/2/26. */ public class SaxHelper extends DefaultHandler { private Person person; private ArrayList<Person> persons; //当前解析的元素标签 private String tagName = null; /** * 当读取到文档开始标志是触发,通常在这里完成一些初始化操作 */ @Override public void startDocument() throws SAXException { this.persons = new ArrayList<Person>(); Log.i("SAX", "读取到文档头,开始解析xml"); } /** * 读到一个开始标签时调用,第二个参数为标签名,最后一个参数为属性数组 */ @Override public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { if (localName.equals("person")) { person = new Person(); person.setId(Integer.parseInt(attributes.getValue("id"))); Log.i("SAX", "开始处理person元素~"); } this.tagName = localName; } /** * 读到到内容,第一个参数为字符串内容,后面依次为起始位置与长度 */ @Override public void characters(char[] ch, int start, int length) throws SAXException { //判断当前标签是否有效 if (this.tagName != null) { String data = new String(ch, start, length); //读取标签中的内容 if (this.tagName.equals("name")) { this.person.setName(data); Log.i("SAX", "处理name元素内容"); } else if (this.tagName.equals("age")) { this.person.setAge(Integer.parseInt(data)); Log.i("SAX", "处理age元素内容"); } } } /** * 处理元素结束时触发,这里将对象添加到结合中 */ @Override public void endElement(String uri, String localName, String qName) throws SAXException { if (localName.equals("person")) { this.persons.add(person); person = null; Log.i("SAX", "处理person元素结束~"); } this.tagName = null; } /** * 读取到文档结尾时触发, */ @Override public void endDocument() throws SAXException { super.endDocument(); Log.i("SAX", "读取到文档尾,xml解析结束"); } //获取persons集合 public ArrayList<Person> getPersons() { return persons; } }
[ "1039163450@qq.com" ]
1039163450@qq.com
50caf113408287468e62c35bd4b44a5bb83e7496
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/MATH-40b-5-29-Single_Objective_GGA-WeightedSum-BasicBlockCoverage/org/apache/commons/math/analysis/solvers/BracketingNthOrderBrentSolver_ESTest_scaffolding.java
f35f116813246dfb6f60bfed2e080a33744b5baa
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
5,126
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Mon May 18 01:59:51 UTC 2020 */ package org.apache.commons.math.analysis.solvers; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class BracketingNthOrderBrentSolver_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.apache.commons.math.analysis.solvers.BracketingNthOrderBrentSolver"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.Runtime.getInstance().resetRuntime(); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); 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.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(BracketingNthOrderBrentSolver_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.math.exception.MathIllegalStateException", "org.apache.commons.math.exception.NumberIsTooSmallException", "org.apache.commons.math.util.Incrementor", "org.apache.commons.math.exception.NullArgumentException", "org.apache.commons.math.exception.util.ExceptionContext", "org.apache.commons.math.analysis.solvers.UnivariateRealSolverUtils", "org.apache.commons.math.util.Incrementor$MaxCountExceededCallback", "org.apache.commons.math.util.FastMath", "org.apache.commons.math.util.MathUtils", "org.apache.commons.math.analysis.solvers.BracketingNthOrderBrentSolver$1", "org.apache.commons.math.analysis.solvers.UnivariateRealSolver", "org.apache.commons.math.exception.NotStrictlyPositiveException", "org.apache.commons.math.exception.NotFiniteNumberException", "org.apache.commons.math.analysis.SinFunction", "org.apache.commons.math.util.Precision", "org.apache.commons.math.exception.MathIllegalArgumentException", "org.apache.commons.math.analysis.QuinticFunction$1", "org.apache.commons.math.analysis.solvers.AbstractUnivariateRealSolver", "org.apache.commons.math.analysis.solvers.BaseAbstractUnivariateRealSolver", "org.apache.commons.math.util.FastMath$ExpIntTable", "org.apache.commons.math.exception.MathIllegalNumberException", "org.apache.commons.math.analysis.solvers.BracketedUnivariateRealSolver", "org.apache.commons.math.analysis.solvers.BracketingNthOrderBrentSolver", "org.apache.commons.math.util.FastMathLiteralArrays", "org.apache.commons.math.analysis.UnivariateFunction", "org.apache.commons.math.analysis.SinFunction$1", "org.apache.commons.math.analysis.solvers.AllowedSolution", "org.apache.commons.math.exception.NumberIsTooLargeException", "org.apache.commons.math.exception.MathInternalError", "org.apache.commons.math.analysis.solvers.BaseUnivariateRealSolver", "org.apache.commons.math.exception.TooManyEvaluationsException", "org.apache.commons.math.analysis.SincFunction", "org.apache.commons.math.analysis.XMinus5Function$1", "org.apache.commons.math.analysis.DifferentiableUnivariateFunction", "org.apache.commons.math.exception.util.Localizable", "org.apache.commons.math.analysis.Expm1Function", "org.apache.commons.math.util.Incrementor$1", "org.apache.commons.math.exception.MaxCountExceededException", "org.apache.commons.math.analysis.MonitoredFunction", "org.apache.commons.math.exception.MathArithmeticException", "org.apache.commons.math.analysis.Expm1Function$1", "org.apache.commons.math.analysis.QuinticFunction", "org.apache.commons.math.exception.util.LocalizedFormats", "org.apache.commons.math.analysis.SincFunction$1", "org.apache.commons.math.exception.util.ExceptionContextProvider", "org.apache.commons.math.analysis.XMinus5Function", "org.apache.commons.math.util.FastMath$ExpFracTable", "org.apache.commons.math.exception.NoBracketingException", "org.apache.commons.math.exception.util.ArgUtils" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
da6b155d4c04fc2ac64f148b740b5dae0dd68a0c
f83d15dfc3d61de87eaa97594e370639a6001c02
/admin-service/src/test/java/com/vennetics/bell/sam/admin/service/repositories/ProtocolTypeRepositoryTest.java
358b93a66149932986920e26600354b0206f32ef
[]
no_license
echalkpad/bell-sam2
ef593fac56178e6b49c1d34a5b1b63d0e4193840
0bc72709ce9ec533e325b69a4c37210fce2bc8ef
refs/heads/master
2021-01-22T00:37:28.903573
2016-04-20T15:30:36
2016-04-20T15:30:36
56,794,135
0
1
null
2016-04-21T17:46:22
2016-04-21T17:46:21
null
UTF-8
Java
false
false
6,804
java
package com.vennetics.bell.sam.admin.service.repositories; import com.datastax.driver.core.querybuilder.QueryBuilder; import com.datastax.driver.core.querybuilder.Select; import com.vennetics.bell.sam.admin.service.AdminServiceCassandraTestConfig; import com.vennetics.bell.sam.admin.service.utils.TestUtils; import com.vennetics.bell.sam.core.cassandra.helpers.EmbeddedCassandraTestHelper; import com.vennetics.bell.sam.model.admin.service.entities.cassandra.CassandraProtocolType; import org.cassandraunit.utils.EmbeddedCassandraServerHelper; import org.junit.After; import org.junit.AfterClass; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.cassandra.core.cql.CqlIdentifier; import org.springframework.data.cassandra.core.CassandraAdminTemplate; import org.springframework.data.cassandra.core.CassandraOperations; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; /** * CassandraProtocolType repo test */ @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(classes = AdminServiceCassandraTestConfig.class) public class ProtocolTypeRepositoryTest { private static final Logger logger = LoggerFactory.getLogger(ProtocolTypeRepositoryTest.class); public static final Set<String> UPDATED_SERVICE_TYPE_IDS = new HashSet<String>( Arrays.asList("ServiceType1", "ServiceType2")); @Autowired private CassandraAdminTemplate cassandraAdminTemplate; @Autowired private CassandraOperations cassandraTemplate; @Value("${local.server.port}") private static int port; @BeforeClass public static void startCassandraEmbedded() throws Exception { EmbeddedCassandraTestHelper.startCassandraCluster(EmbeddedCassandraServerHelper.CASSANDRA_RNDPORT_YML_FILE, port, TestUtils.CASSANDRA_HOST, TestUtils.KEYSPACE_CREATE, TestUtils.CREATE_PROTOCOL_TYPE_TABLE); } @Before public void createTable() { cassandraAdminTemplate.createTable(true, CqlIdentifier.cqlId(CassandraProtocolType.TABLE_NAME), CassandraProtocolType.class, new HashMap<String, Object>()); logger.debug("CassandraProtocolType Table Created"); } @After public void dropTable() { cassandraAdminTemplate.dropTable(CqlIdentifier.cqlId(CassandraProtocolType.TABLE_NAME)); logger.debug("CassandraProtocolType Table Dropped"); } @AfterClass public static void stopCassandraEmbedded() throws Exception { logger.debug("Cleaning Embedded Cassandra..."); EmbeddedCassandraServerHelper.cleanEmbeddedCassandra(); logger.debug("Embedded Cassandra Cleaned"); } @Test public void shouldAssertProtocolTypeIsInserted() { logger.debug("Creating CassandraProtocolType..."); final CassandraProtocolType cassandraProtocolType = TestUtils.createDummyCassProtocolType(); final String protocolTypeId = cassandraProtocolType.getProtocolTypeId(); logger.debug("Created CassandraProtocolType with id: [{}]", protocolTypeId); cassandraTemplate.insert(cassandraProtocolType); logger.debug("CassandraProtocolType with id [{}] inserted into Cassandra", protocolTypeId); final Select select = QueryBuilder.select().from(CassandraProtocolType.TABLE_NAME).where( QueryBuilder.eq(CassandraProtocolType.PROTOCOL_TYPE_ID, protocolTypeId)).limit(10); final CassandraProtocolType result = cassandraTemplate.selectOne(select, CassandraProtocolType.class); assertEquals(protocolTypeId, result.getProtocolTypeId()); } @Test public void shouldAssertProtocolTypeIsInsertedAndUpdated() { final CassandraProtocolType cassandraProtocolType = insertProtocolType(); cassandraProtocolType.setServiceTypeIds(UPDATED_SERVICE_TYPE_IDS); cassandraTemplate.update(cassandraProtocolType); final Select select = QueryBuilder.select().from(CassandraProtocolType.TABLE_NAME) .where(QueryBuilder.eq( CassandraProtocolType.PROTOCOL_TYPE_ID, cassandraProtocolType.getProtocolTypeId())).limit(10); CassandraProtocolType updatedResult = cassandraTemplate.selectOne(select, CassandraProtocolType.class); assertEquals(UPDATED_SERVICE_TYPE_IDS, updatedResult.getServiceTypeIds()); } @Test public void shouldAssertProtocolTypeIsDeleted() { final CassandraProtocolType cassandraProtocolType = insertProtocolType(); cassandraTemplate.delete(cassandraProtocolType); final Select select = QueryBuilder.select().from(CassandraProtocolType.TABLE_NAME) .where(QueryBuilder.eq(CassandraProtocolType.PROTOCOL_TYPE_ID, cassandraProtocolType.getProtocolTypeId())).limit(10); CassandraProtocolType updatedResult = cassandraTemplate.selectOne(select, CassandraProtocolType.class); assertNull(updatedResult); } private CassandraProtocolType insertProtocolType() { logger.debug("Creating CassandraProtocolType..."); final CassandraProtocolType cassandraProtocolType = TestUtils.createDummyCassProtocolType(); final String protocolTypeId = cassandraProtocolType.getProtocolTypeId(); logger.debug("Created CassandraProtocolType with protocolTypeId: [{}]", protocolTypeId); cassandraTemplate.insert(cassandraProtocolType); logger.debug("CassandraProtocolType with protocolTypeId [{}] inserted into Cassandra", protocolTypeId); final Select select = QueryBuilder.select().from(CassandraProtocolType.TABLE_NAME) .where(QueryBuilder.eq(CassandraProtocolType.PROTOCOL_TYPE_ID, protocolTypeId)).limit(10); final CassandraProtocolType result = cassandraTemplate.selectOne(select, CassandraProtocolType.class); assertEquals(protocolTypeId, result.getProtocolTypeId()); return cassandraProtocolType; } }
[ "martin.caldwell@vennetics.com" ]
martin.caldwell@vennetics.com
2d5a27069b6dc5fcecf75fcbce97a42288b3e8fd
212795922990b0a7187adc76c9d4de724f177e02
/back-end/service/service_statistics/src/test/java/demo/CodeGenerator.java
49034a1a77670596b7be393986fd0bf72d9f14b6
[]
no_license
750043194/guli-parent
b9c9fb37f221244a53fde2bb92cd783408d156a3
760ffe25cce5c22377d5ac2b524d5b3f29ec36b5
refs/heads/master
2023-01-03T23:09:50.238450
2020-10-26T09:31:59
2020-10-26T09:31:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,092
java
package demo; import com.baomidou.mybatisplus.annotation.DbType; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.generator.AutoGenerator; import com.baomidou.mybatisplus.generator.config.DataSourceConfig; import com.baomidou.mybatisplus.generator.config.GlobalConfig; import com.baomidou.mybatisplus.generator.config.PackageConfig; import com.baomidou.mybatisplus.generator.config.StrategyConfig; import com.baomidou.mybatisplus.generator.config.rules.DateType; import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; import org.junit.Test; /** * @author * @since 2018/12/13 */ public class CodeGenerator { @Test public void run() { // 1、创建代码生成器 AutoGenerator mpg = new AutoGenerator(); // 2、全局配置 GlobalConfig gc = new GlobalConfig(); String projectPath = System.getProperty("user.dir"); //输出目录 gc.setOutputDir("D:\\i_cant_study\\Demo\\guli_parent\\service\\service_statistics" + "/src/main/java"); gc.setAuthor("testjava"); gc.setOpen(false); //生成后是否打开资源管理器 gc.setFileOverride(false); //重新生成时文件是否覆盖 gc.setServiceName("%sService"); //去掉Service接口的首字母I gc.setIdType(IdType.ID_WORKER_STR); //主键策略 gc.setDateType(DateType.ONLY_DATE);//定义生成的实体类中日期类型 gc.setSwagger2(true);//开启Swagger2模式 mpg.setGlobalConfig(gc); // 3、数据源配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setUrl("jdbc:mysql://localhost:3306/guli?serverTimezone=GMT%2B8"); dsc.setDriverName("com.mysql.cj.jdbc.Driver"); dsc.setUsername("root"); dsc.setPassword("lyp82nlf"); dsc.setDbType(DbType.MYSQL); mpg.setDataSource(dsc); // 4、包配置 生成包的包名com.example.demo.edu.controller... PackageConfig pc = new PackageConfig(); pc.setModuleName("staservice"); //模块名 pc.setParent("com.example.demo"); pc.setController("controller"); pc.setEntity("entity"); pc.setService("service"); pc.setMapper("mapper"); mpg.setPackageInfo(pc); // 5、策略配置 StrategyConfig strategy = new StrategyConfig(); strategy.setInclude("statistics_daily"); strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略 strategy.setTablePrefix(pc.getModuleName() + "_"); //生成实体时去掉表前缀 strategy.setColumnNaming(NamingStrategy.underline_to_camel);//数据库表字段映射到实体的命名策略 strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作 strategy.setRestControllerStyle(true); //restful api风格控制器 strategy.setControllerMappingHyphenStyle(true); //url中驼峰转连字符 mpg.setStrategy(strategy); // 6、执行 mpg.execute(); } }
[ "you@example.com" ]
you@example.com
5e219dcb910798c90592e4c857fbc413f8ace5c0
09649412e12bdc15cf61607e881203735cfafa50
/src/test/java/com/microsoft/bingads/api/test/entities/ad_extension/call/read/BulkCallAdExtensionReadFromRowValuesVersionTest.java
40437dd07e63bd9276c4c33dc1e25e8a98d4534f
[ "MIT" ]
permissive
yosefarr/BingAds-Java-SDK
cec603b74a921e71c6173ce112caccdf7c1fdbc8
d1c333d0ba5b7e434c85a92c7a80dad0add0d634
refs/heads/master
2021-01-18T15:02:53.945816
2016-03-06T13:18:32
2016-03-06T13:18:32
51,738,651
0
1
null
2016-02-15T07:38:14
2016-02-15T07:38:13
null
UTF-8
Java
false
false
1,322
java
package com.microsoft.bingads.api.test.entities.ad_extension.call.read; import com.microsoft.bingads.api.test.entities.ad_extension.call.BulkCallAdExtensionTest; import com.microsoft.bingads.bulk.entities.BulkCallAdExtension; import com.microsoft.bingads.internal.functionalinterfaces.Function; import java.util.Arrays; import java.util.Collection; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class BulkCallAdExtensionReadFromRowValuesVersionTest extends BulkCallAdExtensionTest { @Parameter(value = 1) public Integer expectedResult; @Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {"123", 123}, {"2147483647", 2147483647}, {"", null}, {null, null} }); } @Test public void testRead() { this.<Integer>testReadProperty("Version", this.datum, this.expectedResult, new Function<BulkCallAdExtension, Integer>() { @Override public Integer apply(BulkCallAdExtension c) { return c.getCallAdExtension().getVersion(); } }); } }
[ "bing_ads_sdk@microsoft.com" ]
bing_ads_sdk@microsoft.com
5354801655de4855aaeb3a547b4bdb119ffe69f0
447520f40e82a060368a0802a391697bc00be96f
/apks/playstore_apps/com_idamob_tinkoff_android/source/com/pushserver/android/g.java
23b9af5e3d6c82fc3252c0ed28c8496bd915a454
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
3,743
java
package com.pushserver.android; import android.content.Context; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import java.util.Collections; import java.util.Map; import java.util.Set; import java.util.UUID; public class g { private static final String h = g.class.getCanonicalName(); private static g i; public final SharedPreferences a; final b b; public final d c; com.pushserver.android.model.b d; String e; String f; c g; private final t j; private final n k; private g(final Context paramContext) { try { Object localObject1 = paramContext.getPackageManager().getApplicationInfo(paramContext.getPackageName(), 128); if (localObject1 == null) { localObject1 = localObject2; this.b = new b((Bundle)localObject1, paramContext); this.a = paramContext.getSharedPreferences(g.class.getName(), 0); this.c = new d(this.b.g, h); this.j = new t(this.a); this.k = new n(this.a); if (this.b.l == -1L) { break label176; } m = 1; if (m != 0) { this.g = new c(this.b.l, new Runnable() { public final void run() { g.a(g.this); h.a(paramContext); } }); this.g.a(); } } } catch (PackageManager.NameNotFoundException localNameNotFoundException) { for (;;) { Bundle localBundle = null; continue; localBundle = localBundle.metaData; continue; label176: int m = 0; } } } public static g a(Context paramContext) { try { if (i == null) { i = new g(paramContext); } paramContext = i; return paramContext; } finally {} } final f a(int paramInt) { switch (2.a[(paramInt - 1)]) { default: return null; case 1: return this.j; } return this.k; } public final com.pushserver.android.model.b a() { if (this.d == null) { String str = this.a.getString("pref.device.address", null); if (str != null) { this.d = new com.pushserver.android.model.b(str); } } return this.d; } final void a(int... paramVarArgs) { int m = 0; while (m <= 0) { f localF = a(paramVarArgs[0]); if (localF != null) { localF.a(localF.a, Collections.emptySet()); } m += 1; } } final boolean a(String paramString) { b localB = this.b; return (paramString == null) || (localB.a == null) || (localB.a.isEmpty()) || (localB.a.containsKey(paramString)); } public final String b() { if (this.e == null) { this.e = this.a.getString("pref.registration.id", null); } return this.a.getString("pref.registration.id", null); } final String b(String paramString) { b localB = this.b; if ((paramString == null) || (localB.a == null) || (localB.a.isEmpty()) || (!localB.a.containsKey(paramString))) { return localB.b; } return (String)localB.a.get(paramString); } public final String c() { String str2 = this.a.getString("pref.device.uuid", null); String str1 = str2; if (str2 == null) { str1 = str2; if (this.b.h) { str1 = UUID.randomUUID().toString(); } } return str1; } final Set<String> d() { b localB = this.b; if ((localB.a != null) && (!localB.a.isEmpty())) { return localB.a.keySet(); } return null; } }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
20e105c2cf3ca9ccdb05744e0fb61cef207a57e2
4c3030478340c4474340a0dec9f5340199284b5f
/java-tutorial-juc/src/main/java/com/geekerstar/aqs/AQSDemo.java
50bce23d4f9d8e32f1309c887d693f32d69ec5fe
[]
no_license
jinguicheng-personal/java-tutorial
f48b5d8fa21c1f4a293929cc7019d43ca0b60118
5971344918aaf86f2697fc1b7ffb726d55292295
refs/heads/master
2023-07-03T23:48:07.339343
2021-08-14T09:47:26
2021-08-14T09:47:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
175
java
package com.geekerstar.aqs; /** * @author geekerstar * @date 2020/2/9 16:54 * @description */ public class AQSDemo { public static void main(String[] args) { } }
[ "247507792@qq.com" ]
247507792@qq.com
d20c85259c124643a4511584fa6c60ea7d977bbf
94babe4ece32c1f594ee4eef3b69e11fd51c7f04
/src/main/java/sparkcorejava/homework/CustomerPartitions.java
9f943af8ef93af1ff03233d441b2e870a33757d0
[]
no_license
Zhangxin0802/bigdata
fb9017a89e0a1ba29ac414c54b19909f7233ac64
bb766cbd329664389c65d4d35176132c9d32768e
refs/heads/master
2020-07-24T20:44:07.055199
2018-12-21T07:13:13
2018-12-21T07:13:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,327
java
package sparkcorejava.homework; import org.apache.spark.Partitioner; public class CustomerPartitions extends Partitioner { private static final long serialVersionUID = 1876040429805834645L; private int numPartitions; public CustomerPartitions(int numPartitions) { this.numPartitions = numPartitions; } public int getNumPartitions() { return numPartitions; } public void setNumPartitions(int numPartitions) { this.numPartitions = numPartitions; } @Override public int numPartitions() { return numPartitions; } @Override public int getPartition(Object key) { EmployeeKey key1 = (EmployeeKey) key; String department = key1.getDepartment(); //相同部门的数据,放在在一个分区。 return Math.abs(department.hashCode() % numPartitions); } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (this == obj) { return true; } if (getClass() != obj.getClass()) { return false; } CustomerPartitions cp = (CustomerPartitions) obj; if (cp.getNumPartitions() == numPartitions) {//分区相同 return true; } return false; } }
[ "ghl1149660196@163.com" ]
ghl1149660196@163.com
6850e957e357020abf74d8f832dfbe79b70f1322
c96aafd3dd85d7fe2499dbcdb078ce5f88cc384e
/cyclops-pattern-matching/src/main/java/com/aol/cyclops/matcher/builders/Matching.java
96d20f8e392fcbda2f4ec3133c7a134344105a9d
[ "MIT" ]
permissive
rbygrave/cyclops
d8e2b8bb550716fdaca96656c10a7937cd49165c
90894667e92d298ba72aa3ba70cfb7397bd9215c
refs/heads/master
2021-01-18T07:04:19.384313
2015-06-23T20:48:25
2015-06-23T20:48:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,267
java
package com.aol.cyclops.matcher.builders; import java.util.function.Function; import com.aol.cyclops.matcher.Cases; /** * Pattern Matching builder * * @author johnmcclean * */ public class Matching { /** * *Create a Pattern Matcher Builder from supplied Cases * * @param cases to match on * @return Pattern Mather Builder */ public static final <T,X> MatchingInstance<T,X> of(Cases<T,X,? extends Function<T,X>> cases){ return new MatchingInstance(new CheckTypeAndValues(new PatternMatcher().withCases(cases))); } /** * Create a builder for Matching on Case classes. This is the closest builder * for Scala / ML style pattern matching. * * Case classes can be constructed succintly in Java with Lombok or jADT * e.g. * <pre>{@code * \@Value final class CaseClass implements Decomposable { int field1; String field2;} * } * * Use with static imports from the Predicates class to get wildcards via '__' or ANY() * And to apply nested / recursive matching via Predicates.type( ).with ( ) * * Match disaggregated elements by type, value, JDK 8 Predicate or Hamcrest Matcher * * @return Case Class style Pattern Matching Builder */ public static final<USER_VALUE> CheckTypeAndValues<USER_VALUE> whenValues(){ CheckTypeAndValues cse = new CheckTypeAndValues(new PatternMatcher()); return cse; } /** * Create a builder for Matching against a provided Object as is (i.e. the Steps this builder provide assume you don't wish to disaggregate it and * match on it's decomposed parts separately). * * Allows matching by type, value, JDK 8 Predicate, or Hamcrest Matcher * * @return Simplex Element based Pattern Matching Builder */ public static final<X> ElementCase<X> when(){ ElementCase<X> cse = new ElementCase<>(new PatternMatcher()); return cse; } /** * Create a builder for matching on the disaggregated elements of a collection. * * Allows matching by type, value, JDK 8 Predicate, or Hamcrest Matcher per element * * @return Iterable / Collection based Pattern Matching Builder */ public static final<USER_VALUE> IterableCase<USER_VALUE> whenIterable(){ IterableCase cse = new IterableCase(new PatternMatcher()); return cse; } /** * Create a builder that builds Pattern Matching Cases from Streams of data. * * * @return Stream based Pattern Matching Builder */ public static final StreamCase whenFromStream(){ StreamCase cse = new StreamCase(new PatternMatcher()); return cse; } /** * Create a builder for Matching on Case classes. This is the closest builder * for Scala / ML style pattern matching. * * Case classes can be constructed succintly in Java with Lombok or jADT * e.g. * <pre>{@code * \@Value final class CaseClass implements Decomposable { int field1; String field2;} * } * * Use with static imports from the Predicates class to get wildcards via '__' or ANY() * And to apply nested / recursive matching via Predicates.type( ).with ( ) * * Match disaggregated elements by type, value, JDK 8 Predicate or Hamcrest Matcher * * @param fn Function that accepts the Case for Case classes and returns the output of that builder * @return Pattern Matching Builder */ @Deprecated public static final<X> MatchingInstance<? extends Object,X> when(Function<CheckTypeAndValues<? extends Object>,MatchingInstance<? extends Object,X>> fn){ CheckTypeAndValues cse = new CheckTypeAndValues(new PatternMatcher()); return fn.apply(cse); } /** * Create a builder for Matching against a provided Object as is (i.e. the Steps this builder provide assume you don't wish to disaggregate it and * match on it's decomposed parts separately). * * Allows matching by type, value, JDK 8 Predicate, or Hamcrest Matcher * * @param fn Function that accepts a Simplex Element based Pattern Matching Builder and returns it's output * @return Pattern Matching Builder */ @Deprecated public static final<X> MatchingInstance<? extends Object,X> whenValues(Function<ElementCase<X>,MatchingInstance<? extends Object,X>>fn){ ElementCase<X> cse = new ElementCase(new PatternMatcher()); return fn.apply(cse); } /** * Create a builder for matching on the disaggregated elements of a collection. * * Allows matching by type, value, JDK 8 Predicate, or Hamcrest Matcher per element * * @param fn a Function that accepts a Iterable / Collection based Pattern Matching Builder and returns it's output * @return Pattern Matching Builder */ @Deprecated public static final<X> MatchingInstance<? extends Object,X> whenIterable(Function<IterableCase<? extends Object>,MatchingInstance<? extends Object,X>> fn){ IterableCase cse = new IterableCase(new PatternMatcher()); return fn.apply(cse); } /** * Create a builder that builds Pattern Matching Cases from Streams of data. * * @param fn a function that accepts a Stream based pattern matching builder * @return Pattern Matching Builder */ @Deprecated public static final <T,X> MatchingInstance<T,X> whenFromStream(Function<CaseBeingBuilt,MatchingInstance<T,X>> fn){ StreamCase cse = new StreamCase(new PatternMatcher()); return fn.apply(cse); } }
[ "john.mcclean@teamaol.com" ]
john.mcclean@teamaol.com
8af9d335932f0120b850d94e36a315b4f3216224
a4f94f4701a59cafc7407aed2d525b2dff985c95
/plugins/vcs/source_gen/jetbrains/mps/vcs/changesmanager/_Adapters.java
225a719691d483f77c3263d0ba280b87f7e80575
[]
no_license
jamice/code-orchestra-core
ffda62860f5b117386aa6455f4fdf61661abbe9e
b2bbf8362be2e2173864c294c635badb2e27ecc6
refs/heads/master
2021-01-15T13:24:53.517854
2013-05-09T21:39:28
2013-05-09T21:39:28
null
0
0
null
null
null
null
UTF-8
Java
false
false
511
java
package jetbrains.mps.vcs.changesmanager; /*Generated by MPS */ import jetbrains.mps.baseLanguage.closures.runtime._FunctionTypes; public class _Adapters { public static class _return_P0_E0_to_Runnable_adapter implements Runnable { private _FunctionTypes._return_P0_E0<? extends Object> adapted; public _return_P0_E0_to_Runnable_adapter(_FunctionTypes._return_P0_E0<? extends Object> adapted) { this.adapted = adapted; } public void run() { this.adapted.invoke(); } } }
[ "a.a.eliseyev@gmail.com" ]
a.a.eliseyev@gmail.com
3c91e05279cc476f34e2c8e75bf333aa2d978e00
a14c418ea8b29d6036fb3af4eb84a857cc152b33
/src/com/bjpowernode/annotationreflection/Test03.java
2e40a8f6dd9b550404fff35fb0d8a772ba33681b
[]
no_license
1635269861/code_study_test
62c39b5f43a2391075bbeff9eff5a516975c0d1e
ef454c5ffd265eb4b816b5c9bdbb92afc0b9fc5f
refs/heads/master
2023-01-10T09:25:32.418411
2020-10-24T10:26:52
2020-10-24T10:26:52
306,858,653
0
0
null
null
null
null
UTF-8
Java
false
false
650
java
package com.bjpowernode.annotationreflection; import org.junit.Test; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * @李永琪 * @create 2020-10-17 23:05 */ public class Test03 { @MyAnnotation03(schools = {"西北大学","西工大"},id = 4) public void test1(){ } } //定义一个注解 @Target(value = ElementType.METHOD) @Retention(value = RetentionPolicy.RUNTIME) @interface MyAnnotation03{ String value() default "all"; int age() default 5; int id() default -1; String[] schools(); }
[ "goodMorning_glb@atguigu.com" ]
goodMorning_glb@atguigu.com
92a14de5606b9a6f50240500283f86360939c866
54f352a242a8ad6ff5516703e91da61e08d9a9e6
/Source Codes/AtCoder/abc030/A/4228517.java
2d7cd10852d4233ea6b95fe0c79c8d94c12200c6
[]
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
1,415
java
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); //String s=sc.next(); int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int d=sc.nextInt(); //int l=s.length(); System.out.println(b*c>a*d?"TAKAHASHI":b*c<a*d?"AOKI":"DRAW"); } //---------------------------------------------------------- static int l_min(int[] a) { Arrays.sort(a); return a[0]; } static int l_max(int[] a) { int l=a.length; Arrays.sort(a); return a[l-1]; } public static PrintWriter out; public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
[ "kwnafi@yahoo.com" ]
kwnafi@yahoo.com
72782a9c60c87348230bef02a61a60dc6e5fbdc9
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13546-8-1-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/org/xwiki/configuration/internal/AbstractDocumentConfigurationSource_ESTest_scaffolding.java
50d598158d0086a40af26c10de226a119d79f486
[]
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
472
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Apr 05 15:24:58 UTC 2020 */ package org.xwiki.configuration.internal; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class AbstractDocumentConfigurationSource_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
d606feae90412da8a8202ae855d64f413cbfa81b
332e7cd168b162e30aefee3edd6743d1a785ff7b
/tags/match 52/src/main/java/frc/robot/subsystems/Manipulator.java
b4e2a8180e5ae8d9eaa964df36c31c1473761b60
[]
no_license
first-team-93-new-apple-corp/OldSvnRepos
6a9ab7adcae96c5c1aec1cd07f94e9a27f6c5218
91a8bc09fc48f77ac32ca8fa182456fa7f0cba25
refs/heads/master
2020-05-21T03:51:03.176033
2019-05-10T01:22:11
2019-05-10T01:22:11
185,892,238
0
0
null
null
null
null
UTF-8
Java
false
false
4,126
java
/*----------------------------------------------------------------------------*/ /* Copyright (c) 2018 FIRST. All Rights Reserved. */ /* Open Source Software - may be modified and shared by FRC teams. The code */ /* must be accompanied by the FIRST BSD license file in the root directory of */ /* the project. */ /*----------------------------------------------------------------------------*/ package frc.robot.subsystems; import edu.wpi.first.wpilibj.AnalogInput; import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.PIDController; import edu.wpi.first.wpilibj.Servo; import edu.wpi.first.wpilibj.command.Subsystem; import frc.robot.utilities.ScaledPIDSource; import frc.robot.RobotMap; import frc.robot.commands.ManipulatorContinuous; import frc.robot.other.CANTalonSRX; import frc.robot.other.CANVictorSPX; /** * Add your docs here. */ public class Manipulator extends Subsystem { // Put methods for controlling this subsystem // here. Call these from Commands. public enum Mode{ HATCH, CARGO }; public static Mode robotMode; //WRIST OBJECTS public static CANVictorSPX wristRotator; //rotates the entire manipulator public static AnalogInput rotateWristSensor; // hall effect sensor that measures the angle of the rotatorpulator public static boolean cargoMode; // when robot is picking up cargo (robot is either in cargo mode or hatch mode) public static DigitalInput wristUpLimit; public static ScaledPIDSource scaledRotateWrist; public static PIDController wristPID; //PID FOR CONTROLLING THE WRIST //HATCH MANIPULATOR OBJECTS public static Servo hatchManipulatorServoRight; // servo that positions in certain area to pick up or remove hatch from different spots public static Servo hatchManipulatorServoLeft; // servo that positions in certain area to pick up or remove hatch from different spots //KICKER OBJECTS public static CANTalonSRX kicker; //rotates downwards to rip off the hatch from the hatch manipulator public static AnalogInput kickerSensor; // measures rotation that the hatch remover goes public static PIDController removerPID; // the PID for the hatch remover public static ScaledPIDSource scaledHatchRemoverRotator; //INTAKE OBJECTS public static CANVictorSPX cargoIntake; //left-hand motor for the cargo-intake public static DigitalInput intakeLightSensor; // light sensor that senses to see if ball is in the cargo intake //ENDGAME OBJECTS public static CANVictorSPX habLift; public static Encoder habLiftEncoder; //SAYS WHETHER WE HAVE HATCH OR NOT, USER DEFINES public static Boolean haveHatch = false; public Manipulator() { robotMode = Mode.CARGO; //WRIST OBJECTS wristRotator = new CANVictorSPX(RobotMap.Wrist); rotateWristSensor = new AnalogInput(RobotMap.WristSensor); scaledRotateWrist = new ScaledPIDSource(rotateWristSensor, 100); wristPID = new PIDController(-1, 0.00, -0.5, rotateWristSensor, wristRotator); wristPID.setAbsoluteTolerance(0.1); wristUpLimit = new DigitalInput(RobotMap.wristUpLimit); //HATCH MANIPULATOR OBJECTS hatchManipulatorServoRight = new Servo(RobotMap.HatchManipulatorServoRight); hatchManipulatorServoLeft = new Servo(RobotMap.HatchManipulatorServoLeft); //KICKER OBJECTS kicker = new CANTalonSRX(RobotMap.kicker); kicker.setInverted(); kickerSensor = new AnalogInput(RobotMap.kickerSensor); scaledHatchRemoverRotator = new ScaledPIDSource(kickerSensor, 100); removerPID = new PIDController(0.1, 0.1, 0.1, scaledHatchRemoverRotator, kicker); //INTAKE OBJECTS cargoIntake = new CANVictorSPX(RobotMap.intake); intakeLightSensor = new DigitalInput(RobotMap.IntakeLightSensor); //ENDGAME OBJECTS habLift = new CANVictorSPX(RobotMap.habLift); habLiftEncoder = new Encoder(RobotMap.HabLiftEncoderA, RobotMap.HabLiftEncoderB); } @Override public void initDefaultCommand() { setDefaultCommand(new ManipulatorContinuous()); } }
[ "plexus@aasd.k12.wi.us" ]
plexus@aasd.k12.wi.us
476a1c3933ea5511e2ca78aeae51e8a363fab4f0
0118956ece52559399cd1805dd68ac21e83ae3d9
/fitnesse/lib/src/fitlibrarySrc/fitlibrary/exception/classes/ConstructorNotVisible.java
1e67c1489c8afbc602e6ae7ab1cc34ae25cdb598
[]
no_license
JavaQualitasCorpus/fitlibraryforfitnesse-20110301
6588290ca08deb254e76f67aa6936d2a6f24370f
ceb5abcce236ae380cc0745a7920f82cfba69a19
refs/heads/master
2023-08-12T08:37:17.890919
2019-03-12T23:27:44
2019-03-12T23:27:44
167,004,721
0
1
null
null
null
null
UTF-8
Java
false
false
695
java
/* * Copyright (c) 2006 Rick Mugridge, www.RimuResearch.com * Released under the terms of the GNU General Public License version 2 or later. */ package fitlibrary.exception.classes; import fitlibrary.exception.FitLibraryException; import fitlibrary.runtime.RuntimeContextInternal; import fitlibrary.utility.ExtendedCamelCase; public class ConstructorNotVisible extends FitLibraryException { private static final long serialVersionUID = 1L; public ConstructorNotVisible(String className, RuntimeContextInternal runtime) { super("Constructor for class is not visible: "+ ExtendedCamelCase.camelClassName(className,runtime.getConfiguration().keepingUniCode())); } }
[ "taibi@sonar-scheduler.rd.tut.fi" ]
taibi@sonar-scheduler.rd.tut.fi
f3aaa4519a610546b2ffa9e6e092a2cfe2cf038a
fb5444a71f362cf7c960435f2571b6577eca4838
/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyCartsReplicateTest.java
69ed3b3c7867da51b64e89f7918c25679ea64fc4
[ "Apache-2.0" ]
permissive
bogste/commercetools-sdk-java-v2
1a406f57a509282d3eb33579510377d045f7bb8b
e95dd94d90c1eb582a526c42f917df0972dd5ac9
refs/heads/main
2023-07-19T07:02:31.589574
2021-09-14T07:08:35
2021-09-14T07:08:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,083
java
package com.commercetools.api.client.resource; import java.nio.charset.StandardCharsets; import java.util.concurrent.CompletableFuture; import junitparams.JUnitParamsRunner; import junitparams.Parameters; import com.commercetools.api.client.ApiRoot; import io.vrap.rmf.base.client.*; import io.vrap.rmf.base.client.ApiHttpClient; import io.vrap.rmf.base.client.ApiHttpRequest; import io.vrap.rmf.base.client.VrapHttpClient; import io.vrap.rmf.base.client.error.ApiClientException; import io.vrap.rmf.base.client.error.ApiServerException; import io.vrap.rmf.base.client.utils.Generated; import org.assertj.core.api.Assertions; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; @Generated(value = "io.vrap.rmf.codegen.rendring.CoreCodeGenerator", comments = "https://github.com/vrapio/rmf-codegen") @RunWith(JUnitParamsRunner.class) public class ByProjectKeyCartsReplicateTest { private final VrapHttpClient httpClientMock = Mockito.mock(VrapHttpClient.class); private final String projectKey = "test_projectKey"; private final ApiRoot apiRoot = ApiRoot.of(); private final ApiHttpClient client = ClientBuilder.of(httpClientMock).defaultClient("").build(); @Test @Parameters(method = "requestWithMethodParameters") public void withMethods(ApiHttpRequest request, String httpMethod, String uri) { Assert.assertEquals(httpMethod, request.getMethod().name().toLowerCase()); Assert.assertEquals(uri, request.getUri().toString()); } @Test @Parameters(method = "executeMethodParameters") public void executeServerException(ClientRequestCommand<?> httpRequest) throws Exception { Mockito.when(httpClientMock.execute(Mockito.any())) .thenReturn(CompletableFuture.completedFuture( new ApiHttpResponse<>(500, null, "".getBytes(StandardCharsets.UTF_8), "Oops!"))); Assertions.assertThatThrownBy(() -> client.execute(httpRequest).get()) .hasCauseInstanceOf(ApiServerException.class); } @Test @Parameters(method = "executeMethodParameters") public void executeClientException(ClientRequestCommand<?> httpRequest) throws Exception { Mockito.when(httpClientMock.execute(Mockito.any())) .thenReturn(CompletableFuture.completedFuture( new ApiHttpResponse<>(400, null, "".getBytes(StandardCharsets.UTF_8), "Oops!"))); Assertions.assertThatThrownBy(() -> client.execute(httpRequest).get()) .hasCauseInstanceOf(ApiClientException.class); } private Object[] requestWithMethodParameters() { return new Object[] { new Object[] { apiRoot.withProjectKey("test_projectKey").carts().replicate().post(null).createHttpRequest(), "post", "/test_projectKey/carts/replicate", } }; } private Object[] executeMethodParameters() { return new Object[] { new Object[] { apiRoot.withProjectKey("test_projectKey").carts().replicate().post(null), } }; } }
[ "automation@commercetools.com" ]
automation@commercetools.com
aa539e79a3e2a35d79a5f4be098eba8d362f5d9a
8cd01526f0e84cf36bc27515876eda9bcc52f49a
/code/vim_android/office/src/main/java/com/wxiwei/office/fc/hslf/record/Environment.java
ca8938cd34abfeb8913c77dff91ebd4186c79ebc
[]
no_license
liyawei7711/shenlun
a0baa859cec59b9d46825c8b1797173bd56d4d3f
602b103d90df98c100ce55efee132596b0100445
refs/heads/master
2021-01-09T12:52:18.359146
2020-06-29T08:21:20
2020-06-29T08:21:20
242,304,879
1
0
null
null
null
null
UTF-8
Java
false
false
3,108
java
/* ==================================================================== Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==================================================================== */ package com.wxiwei.office.fc.hslf.record; import java.io.IOException; import java.io.OutputStream; /** * Environment, which contains lots of settings for the document. * * @author Nick Burch */ public final class Environment extends PositionDependentRecordContainer { /** * Returns the FontCollection of this Environment */ public FontCollection getFontCollection() { return fontCollection; } /** * Set things up, and find our more interesting children */ protected Environment(byte[] source, int start, int len) { // Grab the header _header = new byte[8]; System.arraycopy(source, start, _header, 0, 8); // Find our children _children = Record.findChildRecords(source, start + 8, len - 8); // Find our FontCollection record for (int i = 0; i < _children.length; i++) { if (_children[i] instanceof FontCollection) { fontCollection = (FontCollection)_children[i]; } else if (_children[i] instanceof TxMasterStyleAtom) { txmaster = (TxMasterStyleAtom)_children[i]; } } if (fontCollection == null) { throw new IllegalStateException("Environment didn't contain a FontCollection record!"); } } public TxMasterStyleAtom getTxMasterStyleAtom() { return txmaster; } /** * We are of type 1010 */ public long getRecordType() { return _type; } /** * */ public void dispose() { _header = null; if (fontCollection != null) { fontCollection.dispose(); fontCollection = null; } if (txmaster != null) { txmaster.dispose(); txmaster = null; } } private byte[] _header; private static long _type = 1010; // Links to our more interesting children private FontCollection fontCollection; //master style for text with type=TextHeaderAtom.OTHER_TYPE private TxMasterStyleAtom txmaster; }
[ "751804582@qq.com" ]
751804582@qq.com
08cbb9df8882248bd8e68b7f2941b55389a2c882
af8c70f1cf2459a9f7317fbfd8b4edf60f6f3c0d
/subprojects/griffon-core/src/main/java/griffon/core/editors/BytePropertyEditor.java
05a2683a3b08f467d4afcb111a8467f56443a68e
[ "Apache-2.0" ]
permissive
OlegDokuka/griffon
cbc23cc7815a2507c8c5c4383330caf60df40fc6
30f0433d6e8a0d618511fad8ea36ec673be265ee
refs/heads/development
2021-01-15T09:15:52.504366
2015-11-13T01:30:50
2015-11-13T01:30:50
46,296,147
1
0
null
2015-11-16T19:12:23
2015-11-16T19:12:23
null
UTF-8
Java
false
false
1,810
java
/* * Copyright 2008-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 griffon.core.editors; import griffon.core.formatters.ByteFormatter; import griffon.core.formatters.Formatter; import static griffon.util.GriffonNameUtils.isBlank; /** * @author Andres Almiray * @since 2.0.0 */ public class BytePropertyEditor extends AbstractPropertyEditor { protected void setValueInternal(Object value) { if (null == value) { super.setValueInternal(null); } else if (value instanceof CharSequence) { handleAsString(String.valueOf(value)); } else if (value instanceof Number) { handleAsNumber((Number) value); } else { throw illegalValue(value, Byte.class); } } protected void handleAsString(String str) { try { super.setValueInternal(isBlank(str) ? null : Byte.parseByte(str)); } catch (NumberFormatException e) { throw illegalValue(str, Byte.class, e); } } protected void handleAsNumber(Number number) { super.setValueInternal(number.byteValue()); } protected Formatter<Byte> resolveFormatter() { return isBlank(getFormat()) ? null : new ByteFormatter(getFormat()); } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
b8926f2ab4c834e658b78627cae943782b92424e
a1e93889e31bf52b6ce6d193af810faf4741daa8
/sofa-boot-samples/src/main/java/com/alipay/sofa/rpc/samples/annotation/AnotationClientApplication.java
07f5b5b94fc6936c557d1e0548b90f2ee3d12f69
[ "Apache-2.0" ]
permissive
driphub/sofa-rpc-boot-projects
c56e344fe9bab8a03ba4324f60f16c22527a153b
c9897a70d65338415f8c1558a0c8ea5ea416cfbc
refs/heads/master
2020-06-15T00:14:43.376693
2019-06-11T13:23:24
2019-06-11T13:23:24
195,161,829
1
0
Apache-2.0
2019-07-04T03:20:50
2019-07-04T03:20:49
null
UTF-8
Java
false
false
1,937
java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alipay.sofa.rpc.samples.annotation; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.ApplicationContext; /** * @author <a href="mailto:leizhiyuan@gmail.com">leizhiyuan</a> */ @SpringBootApplication public class AnotationClientApplication { public static void main(String[] args) { //change port to run in local machine System.setProperty("server.port", "8081"); SpringApplication springApplication = new SpringApplication(AnotationClientApplication.class); ApplicationContext applicationContext = springApplication.run(args); AnnotationClientImpl annotationService = applicationContext.getBean(AnnotationClientImpl.class); String result = annotationService.sayClientAnnotation("annotation"); System.out.println("invoke result:" + result); if ("annotation".equalsIgnoreCase(result)) { System.out.println("annotation invoke success"); } else { System.out.println("annotation invoke fail"); } } }
[ "zhanggeng.zg@antfin.com" ]
zhanggeng.zg@antfin.com
7dda1b0e79768fa8426dfc2094245f724dec755e
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Math/102/org/apache/commons/math/stat/inference/ChiSquareTest_chiSquareTest_214.java
40d14f28018e01dcfc77747f9046d6585459c004
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
1,423
java
org apach common math stat infer chi squar test handl distribut distribut unknown provid sampl link unknown distribut chi squar test unknowndistributionchisquaretest unknown distribut chi squar test unknowndistributionchisquaretest extend version revis date chi squar test chisquaretest perform href http www itl nist gov div898 handbook prc section4 prc45 htm chi squar test independ evalu hypothesi classif repres count column input tabl independ row signific level code alpha code return iff hypothesi reject alpha percent confid row tabl code count count count length code strong strong test hypothesi count code count count count length code correspond underli probabl distribut level code chi squar test chisquaretest count code strong precondit strong count count arrai rectangular count subarrai length tabl repres code count code column row precondit met code illeg argument except illegalargumentexcept code thrown param count arrai represent tabl param alpha signific level test iff hypothesi reject confid alpha illeg argument except illegalargumentexcept precondit met math except mathexcept error occur perform test chi squar test chisquaretest count alpha illeg argument except illegalargumentexcept math except mathexcept
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
f731e618558c617537d5cebf7330f245c5814ef4
4da9097315831c8639a8491e881ec97fdf74c603
/src/StockIT-v2-release_source_from_JADX/sources/kotlin/reflect/jvm/internal/impl/serialization/deserialization/descriptors/DeserializedMemberScope$NoReorderImplementation$allFunctions$2.java
7b48977ae8887543dc677c0f672a8d28f772719d
[ "Apache-2.0" ]
permissive
atul-vyshnav/2021_IBM_Code_Challenge_StockIT
5c3c11af285cf6f032b7c207e457f4c9a5b0c7e1
25c26a4cc59a3f3e575f617b59acc202ee6ee48a
refs/heads/main
2023-08-11T06:17:05.659651
2021-10-01T08:48:06
2021-10-01T08:48:06
410,595,708
1
1
null
null
null
null
UTF-8
Java
false
false
1,183
java
package kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors; import java.util.List; import kotlin.collections.CollectionsKt; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.Lambda; import kotlin.reflect.jvm.internal.impl.descriptors.SimpleFunctionDescriptor; import kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedMemberScope; /* compiled from: DeserializedMemberScope.kt */ final class DeserializedMemberScope$NoReorderImplementation$allFunctions$2 extends Lambda implements Function0<List<? extends SimpleFunctionDescriptor>> { final /* synthetic */ DeserializedMemberScope.NoReorderImplementation this$0; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ DeserializedMemberScope$NoReorderImplementation$allFunctions$2(DeserializedMemberScope.NoReorderImplementation noReorderImplementation) { super(0); this.this$0 = noReorderImplementation; } public final List<SimpleFunctionDescriptor> invoke() { return CollectionsKt.plus(this.this$0.getDeclaredFunctions(), this.this$0.computeAllNonDeclaredFunctions()); } }
[ "57108396+atul-vyshnav@users.noreply.github.com" ]
57108396+atul-vyshnav@users.noreply.github.com
0b13796c91b9b5657f38927c19779f3cbf540bd9
0fb7a2ed774983f2ac12c8403b6269808219e9bc
/yikatong-core/src/main/java/com/alipay/api/domain/AlipayDataDataserviceYuebaolqdDetailQueryModel.java
0c383998f7f2b06cf49aa0ac6e5ab62dbf891753
[]
no_license
zhangzh56/yikatong-parent
e605b4025c934fb4099d5c321faa3a48703f8ff7
47e8f627ba3471eff71f593189e82c6f08ceb1a3
refs/heads/master
2020-03-19T11:23:47.000077
2018-04-26T02:26:48
2018-04-26T02:26:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
653
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 余额宝负债端预测数据 * * @author auto create * @since 1.0, 2018-01-22 10:50:26 */ public class AlipayDataDataserviceYuebaolqdDetailQueryModel extends AlipayObject { private static final long serialVersionUID = 6313256813435695346L; /** * 服务入参,格式为yyyymmdd */ @ApiField("report_date") private String reportDate; public String getReportDate() { return this.reportDate; } public void setReportDate(String reportDate) { this.reportDate = reportDate; } }
[ "xiangyu.zhang@foxmail.com" ]
xiangyu.zhang@foxmail.com
bc571d4e6c5ad4a843f4ee47aed64d00ecd454fa
f22340f0d277081bf1ee79636aa8845fb42a8024
/src/test/java/test/puzzle/pentomino/TestPentomino.java
93a1c6abab745be4bc9263f84852db17f435b047
[]
no_license
saka1029/Puzzle
f0cf6e611fcc46580fcfe03325dee76f6b440c9c
edf8810343190be530fb77f36c1414e8266e8a78
refs/heads/master
2023-04-03T10:00:48.988223
2023-03-19T21:41:46
2023-03-19T21:41:46
208,369,149
0
0
null
2022-09-01T23:52:07
2019-09-14T00:50:11
Java
UTF-8
Java
false
false
5,035
java
package test.puzzle.pentomino; import static org.junit.Assert.*; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import org.junit.Test; import puzzle.pentomino.Board; import puzzle.pentomino.Mino; import puzzle.pentomino.Point; import puzzle.pentomino.Solver; public class TestPentomino { // @Test public void test10x6() { int[][] matrix = new int[10][6]; for (int[] row : matrix) Arrays.fill(row, Board.VACANT); Board board = new Board(matrix); List<Set<Mino>> minos = Mino.allMinosSet(5); assertEquals(12, minos.size()); Set<Board> all = new HashSet<>(); Set<Board> uniq = new HashSet<>(); Solver.solve(board, minos, b -> { if (all.contains(b)) return true; Board n = new Board(b.board); uniq.add(n); all.addAll(n.allDirections()); return true; }, null); assertEquals(2339, uniq.size()); } @Test public void test12x5() { int[][] matrix = new int[12][5]; for (int[] row : matrix) Arrays.fill(row, Board.VACANT); Board board = new Board(matrix); List<Set<Mino>> minos = Mino.allMinosSet(5); assertEquals(12, minos.size()); Set<Board> all = new HashSet<>(); Set<Board> uniq = new HashSet<>(); Solver.solve(board, minos, b -> { if (all.contains(b)) return true; Board n = new Board(b.board); uniq.add(n); all.addAll(n.allDirections()); return true; }, null); assertEquals(1010, uniq.size()); } @Test public void test20x3() { int[][] matrix = new int[20][3]; for (int[] row : matrix) Arrays.fill(row, Board.VACANT); Board board = new Board(matrix); List<Set<Mino>> minos = Mino.allMinosSet(5); assertEquals(12, minos.size()); Set<Board> all = new HashSet<>(); Set<Board> uniq = new HashSet<>(); Solver.solve(board, minos, b -> { if (all.contains(b)) return true; Board n = new Board(b.board); uniq.add(n); all.addAll(n.allDirections()); return true; }, null); assertEquals(2, uniq.size()); } @Test public void test15x4() { int[][] matrix = new int[15][4]; for (int[] row : matrix) Arrays.fill(row, Board.VACANT); Board board = new Board(matrix); List<Set<Mino>> minos = Mino.allMinosSet(5); assertEquals(12, minos.size()); Set<Board> all = new HashSet<>(); Set<Board> uniq = new HashSet<>(); Solver.solve(board, minos, b -> { if (all.contains(b)) return true; Board n = new Board(b.board); uniq.add(n); all.addAll(n.allDirections()); return true; }, null); assertEquals(368, uniq.size()); } @Test public void test8x8VacantCenter() { int[][] matrix = new int[8][8]; for (int[] row : matrix) Arrays.fill(row, Board.VACANT); matrix[3][3] = Board.BLOCK; matrix[3][4] = Board.BLOCK; matrix[4][3] = Board.BLOCK; matrix[4][4] = Board.BLOCK; Board board = new Board(matrix); List<Set<Mino>> minos = Mino.allMinosSet(5); assertEquals(12, minos.size()); Set<Board> all = new HashSet<>(); Set<Board> uniq = new HashSet<>(); Solver.solve(board, minos, b -> { if (all.contains(b)) return true; Board n = new Board(b.board); uniq.add(n); all.addAll(n.allDirections()); return true; }, null); assertEquals(65, uniq.size()); } interface Trans { Point trans(Point p, Point s); default Trans compose(Trans t) { return (p, s) -> t.trans(trans(p, s), s); } } Trans 上下反転 = (p, s) -> Point.of(s.x - p.x - 1, p.y); Trans 左右反転 = (p, s) -> Point.of(p.x, s.y - p.y - 1); Trans 転置 = (p, s) -> Point.of(p.y, p.x); static String[][] m = { {"A", "B"}, {"C", "D"} }; static String[][] trans(String[][] m, Trans t) { Point s = Point.of(m.length, m[0].length); String[][] r = new String[s.x][s.y]; for (int x = 0; x < s.x; ++x) for (int y = 0; y < s.y; ++y) { Point q = t.trans(Point.of(x, y), s); r[q.x][q.y] = m[x][y]; } return r; } static void print(String[][] m) { System.out.println(Arrays.deepToString(m)); } @Test public void testTrans() { print(m); for (int i = 0; i < 4; ++i) { print(m = trans(m, 左右反転)); print(m = trans(m, 転置)); } // print(trans(m, 左右反転)); // print(trans(m, 上下反転)); // print(trans(m, 左右反転.compose(上下反転))); } }
[ "saka1029@gmail.com" ]
saka1029@gmail.com
a757a05863b703008089326c3f013e21a1d409e6
df0da4660d613242c2b243d928b1e7184e4cb2c8
/morsearch-port/src/main/java/com/morsearch/controller/mall/MallGoodsController.java
5c3a6bf89ccbfe8f28ca9f7ba81031644db91dd2
[]
no_license
13265311042/morsearch
4e4f8a7d78eac5a7e9e4859bfcf2f6aaeadc3dff
1419cb0947370dbd4b80874e7c49d564351ee903
refs/heads/master
2020-03-07T12:57:23.702216
2018-03-31T01:46:26
2018-03-31T01:46:26
127,488,905
1
0
null
null
null
null
UTF-8
Java
false
false
6,116
java
package com.morsearch.controller.mall; import com.morsearch.base.BaseController; import com.morsearch.common.constant.Constants; import com.morsearch.common.util.CommonUtil; import com.morsearch.common.util.ControllerUtils; import com.morsearch.model.Mall_Evaluate; import com.morsearch.model.Mall_Goods; import com.morsearch.service.MallEvaluateService; import com.morsearch.service.MallGoodsService; import com.morsearch.vo.AppPage; import com.morsearch.vo.AppResult; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * Created by hyt on 2018/1/9. */ //前端商城商品 @Controller("MallGoodsController") @RequestMapping("/mall/") public class MallGoodsController extends BaseController { @Resource private MallGoodsService mallGoodsService; @Resource private MallEvaluateService mallEvaluateService; /*** * @param request *Mall_Goods * 商城商品详细信息(每一种商品) * */ @SuppressWarnings({ "unused", "null" }) @RequestMapping(value = "getmallgoodsdetail", method ={RequestMethod.POST, RequestMethod.GET}, produces = "text/json; charset=utf-8") public String getmallgoodsdetail(HttpServletRequest request, HttpServletResponse response) throws Exception { PrintWriter out = ControllerUtils.getPrintWriter(response, logger, "----"); AppResult appresult=new AppResult(); appresult.setStatus(Constants.RESULT_STATUS_SUCC); appresult.setMessage(Constants.RESULT_MESSAGE_SUCC); String rs = ""; Boolean flag_pass=true; //获取de_id,查询的条件 String mg_id = request.getParameter("mg_id");//商品id /*检查参数 begin*/ if (CommonUtil.isEmpty(mg_id)&&flag_pass==true) { appresult.setStatus(Constants.RESULT_STATUS_FAIL); appresult.setMessage("商品id不能为空"); flag_pass = false; }; /*检查参数 end*/ /*处理逻辑 begin*/ Mall_Goods mg = new Mall_Goods(); if (flag_pass==true) { try { mg = mallGoodsService.getMall_Goodsdetail(Long.parseLong(mg_id),1); if (mg!=null){ }else{ appresult.setStatus(Constants.RESULT_STATUS_FAIL); appresult.setMessage(Constants.RESULT_MESSAGE_NULL); } } catch (Exception e) { logger.error(e.getMessage()); appresult.setStatus(Constants.RESULT_STATUS_FAIL); appresult.setMessage(Constants.RESULT_MESSAGE_UNUSUAL); } } /*处理逻辑 end*/ /*返回数据 begin*/ appresult.setData(mg); rs= CommonUtil.datatype_convert(request,gson.toJson(appresult)); /*处理数据格式*/ out.print(rs); out.close(); /*返回数据 end*/ return null; } /*** * @param request *Mall_Evaluate//商品评价 * 商城商品详细信息(每一种商品)的所有评价 * */ @SuppressWarnings({ "unused", "null" }) @RequestMapping(value = "getmallevaluatelist", method ={RequestMethod.POST, RequestMethod.GET}, produces = "text/json; charset=utf-8") public String getmallevaluatelist(HttpServletRequest request, HttpServletResponse response) throws Exception { PrintWriter out = ControllerUtils.getPrintWriter(response, logger, "----"); AppResult appresult=new AppResult(); appresult.setStatus(Constants.RESULT_STATUS_SUCC); appresult.setMessage(Constants.RESULT_MESSAGE_SUCC); String rs = ""; Boolean flag_pass=true; //获取de_id,查询的条件 String se_goodid = request.getParameter("se_goodid");//商品id /*检查参数 begin*/ if (CommonUtil.isEmpty(se_goodid)&&flag_pass==true) { appresult.setStatus(Constants.RESULT_STATUS_FAIL); appresult.setMessage("商品id不能为空"); flag_pass = false; }; /*检查参数 end*/ /*处理逻辑 begin*/ List<Mall_Evaluate> me = new ArrayList<>(); if (flag_pass==true) { try { AppPage page = new AppPage(); page.setPageindex(request.getParameter("pageindex"));/*当前页*/ page.setPagesize(request.getParameter("pagesize"));/*分页*/ Map<String, Object> map = new HashMap<String, Object>(); map.put("pagestart", page.getPagestart()); map.put("pagesize", page.getPagesize()); map.put("se_goodid", CommonUtil.convert_Long(request.getParameter("se_goodid")));//商品id me = mallEvaluateService.getMall_EvaluateList(map);//list列表 page.setRowcount(mallEvaluateService.getCountMall_Evaluate(map));//list的大小 appresult.setPage(page); if(!CommonUtil.isNullOrEmpty(me)&&me.size()>0){ appresult.setStatus(Constants.RESULT_STATUS_SUCC); appresult.setMessage(Constants.RESULT_MESSAGE_SUCC); }else{ appresult.setStatus(Constants.RESULT_STATUS_FAIL); appresult.setMessage(Constants.RESULT_MESSAGE_FAIL); } } catch (Exception e) { logger.error(e.getMessage()); appresult.setStatus(Constants.RESULT_STATUS_FAIL); appresult.setMessage(Constants.RESULT_MESSAGE_UNUSUAL); } } /*处理逻辑 end*/ /*返回数据 begin*/ appresult.setData(me); rs= CommonUtil.datatype_convert(request,gson.toJson(appresult)); /*处理数据格式*/ out.print(rs); out.close(); /*返回数据 end*/ return null; } }
[ "1078606377@qq.com" ]
1078606377@qq.com
f2a3f4030af79626bf098345c3e9ea36a7d13eb6
ffbe549bb245a140ff86ba8213723cc7e803ca68
/src/main/java/de/origindd/mpeg/mpegv/sev/TurnType.java
d90b1ca1a206f4f28a303872e5c616cdbdf5dff0
[]
no_license
OriginDD/mpeg-7-extractor
43259f3a1b0dea1cc204395039e6221624599717
c7c1cb5e9d7d09286ff95e1e4baa8dff9a0483bb
refs/heads/master
2021-01-17T09:58:54.051776
2017-03-17T06:46:25
2017-03-17T06:46:25
83,997,792
0
0
null
null
null
null
UTF-8
Java
false
false
2,277
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.4-2 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.01.12 at 06:38:19 PM BRST // package de.origindd.mpeg.mpegv.sev; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for TurnType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="TurnType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;attribute name="direction" type="{urn:mpeg:mpeg-v:2010:01-SEV-NS}TurnAngleType" /> * &lt;attribute name="speed" type="{http://www.w3.org/2001/XMLSchema}float" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TurnType") public class TurnType { @XmlAttribute(name = "direction") protected Integer direction; @XmlAttribute(name = "speed") protected Float speed; /** * Gets the value of the direction property. * * @return * possible object is * {@link Integer } * */ public Integer getDirection() { return direction; } /** * Sets the value of the direction property. * * @param value * allowed object is * {@link Integer } * */ public void setDirection(Integer value) { this.direction = value; } /** * Gets the value of the speed property. * * @return * possible object is * {@link Float } * */ public Float getSpeed() { return speed; } /** * Sets the value of the speed property. * * @param value * allowed object is * {@link Float } * */ public void setSpeed(Float value) { this.speed = value; } }
[ "ulrich.kowohl@zalando.de" ]
ulrich.kowohl@zalando.de
350316c55471fdd0fac2ce375cd52d83ee3a1380
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/17/17_3d37f16b25895c5025fbd92e3812fcdfe1e27709/WebDriverFactoryTest/17_3d37f16b25895c5025fbd92e3812fcdfe1e27709_WebDriverFactoryTest_s.java
50e3c5c01a3693eeb8d07e7e922678618171db33
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,424
java
package org.springside.modules.test.functional; import static org.junit.Assert.*; import java.net.URL; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.htmlunit.HtmlUnitDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.remote.RemoteWebDriver; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.modules.junit4.PowerMockRunner; @RunWith(PowerMockRunner.class) @PrepareForTest({ WebDriverFactory.class, FirefoxDriver.class, InternetExplorerDriver.class, ChromeDriver.class, HtmlUnitDriver.class, RemoteWebDriver.class }) public class WebDriverFactoryTest { @Mock FirefoxDriver firefoxDriver; @Mock InternetExplorerDriver internetExplorerDriver; @Mock ChromeDriver chromerDriver; @Mock HtmlUnitDriver htmlUnitDriver; @Mock RemoteWebDriver remoteWebDriver; @Test public void buildWebDriver() throws Exception { MockitoAnnotations.initMocks(this); PowerMockito.whenNew(FirefoxDriver.class).withNoArguments().thenReturn(firefoxDriver); WebDriver driver = WebDriverFactory.createDriver("firefox"); assertTrue(driver instanceof FirefoxDriver); PowerMockito.whenNew(InternetExplorerDriver.class).withNoArguments().thenReturn(internetExplorerDriver); driver = WebDriverFactory.createDriver("ie"); assertTrue(driver instanceof InternetExplorerDriver); PowerMockito.whenNew(ChromeDriver.class).withNoArguments().thenReturn(chromerDriver); driver = WebDriverFactory.createDriver("chrome"); assertTrue(driver instanceof ChromeDriver); PowerMockito.whenNew(HtmlUnitDriver.class).withNoArguments().thenReturn(htmlUnitDriver); driver = WebDriverFactory.createDriver("htmlunit"); assertTrue(driver instanceof HtmlUnitDriver); PowerMockito.whenNew(RemoteWebDriver.class) .withArguments(new URL("http://localhost:3000/wd"), DesiredCapabilities.firefox()) .thenReturn(remoteWebDriver); driver = WebDriverFactory.createDriver("remote:localhost:3000:firefox"); assertTrue(driver instanceof RemoteWebDriver); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
52411f2f17295cc8b33f63a61011562aa7de10af
25da4ae6e32407a39e0061aef370ee4b05520603
/src/main/java/com/gavin/myapp/service/mapper/CommonTableSimpleMapper.java
cc89f6b02fcfef61f12d4f407acd706aad8425b6
[]
no_license
lugavin/jhipster-pro-sample
3427d1785fe6c43c6ad32579726e757770fb90bd
2aec8327c07ac342b8a8461433ce5da80a96017f
refs/heads/main
2023-05-28T23:17:19.401842
2021-06-08T09:24:52
2021-06-08T09:24:52
374,954,140
1
0
null
null
null
null
UTF-8
Java
false
false
770
java
package com.gavin.myapp.service.mapper; import com.gavin.myapp.domain.*; import com.gavin.myapp.service.dto.CommonTableSimpleDTO; import org.mapstruct.*; /** * Mapper for the entity {@link CommonTable} and its DTO {@link CommonTableSimpleDTO}. */ @Mapper(componentModel = "spring") public interface CommonTableSimpleMapper extends EntityMapper<CommonTableSimpleDTO, CommonTable> { @BeanMapping(ignoreByDefault = true) @Mapping(target = "id", source = "id") @Mapping(target = "name", source = "name") CommonTableSimpleDTO toDto(CommonTable commonTable); @BeanMapping(ignoreByDefault = true) @Mapping(target = "id", source = "id") @Mapping(target = "name", source = "name") CommonTable toEntity(CommonTableSimpleDTO commonTableDTO); }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
fe2d0709498b7d50e34cb34c36432f0a7b0d69d9
e047870136e1958ce80dad88fa931304ada49a1b
/eu.cessar.ct.core.platform/src/eu/cessar/ct/core/platform/concurrent/IAsyncWorkExecManager.java
eb098dbc58ec428b7008f3178a9fe6c8c6dc091d
[]
no_license
ONagaty/SEA-ModellAR
f4994a628459a20b9be7af95d41d5e0ff8a21f77
a0f6bdbb072503ea584d72f872f29a20ea98ade5
refs/heads/main
2023-06-04T07:07:02.900503
2021-06-19T20:54:47
2021-06-19T20:54:47
376,735,297
0
0
null
null
null
null
UTF-8
Java
false
false
1,204
java
/** * <copyright> * * Copyright (c) Continental Engineering Services and others.<br/> * http://www.conti-engineering.com All rights reserved. * * File created by uidl6458<br/> * 15 iul. 2014 13:39:41 * * </copyright> */ package eu.cessar.ct.core.platform.concurrent; /** * * @author uidl6458 * * %created_by: uidg3464 % * * %date_created: Fri Jul 18 09:09:14 2014 % * * %version: 3 % * @param <T> * - the type of the target of the job * @param <V> * - the type of the callBack that has to be notified when the job has finished */ public interface IAsyncWorkExecManager<T, V> { /** * Ask the manager to run the given job on the <code>target</code>, on the next reasonable opportunity, registering * with given <code>callBack</code> in order to receive feedback when the job has finished * * @param target * the target of the job * @param callBack * the callBack that has to be notified when the job has finished */ public void performWork(T target, ICallback<V> callBack); /** * Unregister a previously added callback * * @param callBack */ public void forgetWork(ICallback<V> callBack); }
[ "onagaty@a5sol.com" ]
onagaty@a5sol.com
5a021ac1b368a3800ee533a872ad18711a180376
f5e2bf8263a2324b326d87510d5bdd5e6f16bdf1
/bookkeeper-server/src/main/java/org/apache/bookkeeper/client/ListenerBasedPendingReadOp.java
afb21bf14d00e5c52456fb32ce00057ae37a7447
[ "Apache-2.0" ]
permissive
kramasamy/bookkeeper
d4cc7ef02082d680598bec85f4dea551f62203c1
e9b857092703719c9ea38a3a74107fe5114af94a
refs/heads/master
2021-07-19T03:42:32.423721
2017-10-27T18:58:19
2017-10-27T18:58:19
108,588,035
0
1
null
2017-10-27T19:41:04
2017-10-27T19:41:04
null
UTF-8
Java
false
false
3,224
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.bookkeeper.client; import java.util.NoSuchElementException; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; import org.apache.bookkeeper.proto.BookkeeperInternalCallbacks.ReadEntryListener; import org.apache.bookkeeper.util.MathUtils; class ListenerBasedPendingReadOp extends PendingReadOp { final ReadEntryListener listener; ListenerBasedPendingReadOp(LedgerHandle lh, ScheduledExecutorService scheduler, long startEntryId, long endEntryId, ReadEntryListener listener, Object ctx) { this( lh, scheduler, startEntryId, endEntryId, listener, ctx, false); } ListenerBasedPendingReadOp(LedgerHandle lh, ScheduledExecutorService scheduler, long startEntryId, long endEntryId, ReadEntryListener listener, Object ctx, boolean isRecoveryRead) { super(lh, scheduler, startEntryId, endEntryId, null, ctx, isRecoveryRead); this.listener = listener; } @Override protected void submitCallback(int code) { LedgerEntryRequest request; while ((request = seq.peek()) != null) { if (!request.isComplete()) { return; } seq.remove(); long latencyNanos = MathUtils.elapsedNanos(requestTimeNanos); if (BKException.Code.OK == request.getRc()) { readOpLogger.registerSuccessfulEvent(latencyNanos, TimeUnit.NANOSECONDS); } else { readOpLogger.registerFailedEvent(latencyNanos, TimeUnit.NANOSECONDS); } // callback with completed entry listener.onEntryComplete(request.getRc(), lh, request, ctx); } // if all entries are already completed. cancelSpeculativeTask(true); } @Override public boolean hasMoreElements() { return false; } @Override public LedgerEntry nextElement() throws NoSuchElementException { throw new NoSuchElementException(); } }
[ "sijie@apache.org" ]
sijie@apache.org
a215ea30a7279c119175d03213e0cc23e60f16b5
e84e87b41628705108d3e9b532f56469de7b41db
/00_framework/chat/src/main/java/com/ABC/bitrade/entity/ChatMessageRecord.java
a75f48f6a50edb20b2ce391d8bd522dc1a7e9078
[ "Apache-2.0" ]
permissive
gcodeabc/ABC-CoinExchange
e0ccb510b75c725faa4ad72d7b63ea9d22853309
f8b88ae6c404a8e926db727e0d5fced5a2b5aac9
refs/heads/main
2023-03-29T22:55:45.844917
2021-04-03T15:58:38
2021-04-03T15:58:38
352,097,727
1
1
null
null
null
null
UTF-8
Java
false
false
345
java
package com.ABC.bitrade.entity; import lombok.Data; import lombok.ToString; /** * mogondb保存聊天消息的格式规范 */ @Data @ToString(callSuper = true) public class ChatMessageRecord extends BaseMessage{ private String content ; private long sendTime ; private String sendTimeStr ; private String fromAvatar; }
[ "songxiaoyuaaaaa@qq.com" ]
songxiaoyuaaaaa@qq.com
1fa7447f98b952ab70f90eef6c45f01bacc3ad70
3144772be9d90dfc72346b6dec053730c804273d
/src/main/java/sul/protocol/bedrock150/play/ServerToClientHandshake.java
0d620cdfd947d40965ef7a3e5a36471db84c0735
[ "MIT" ]
permissive
sel-utils/java
be42f04044674afd77808ae324515358995ba854
9b9cc88dfc6e871ceb7eddb3d7c6585756fe1e07
refs/heads/master
2021-01-23T05:57:03.737951
2018-02-05T12:12:02
2018-02-05T12:12:02
86,325,412
3
1
null
2017-06-14T20:36:36
2017-03-27T11:06:07
Java
UTF-8
Java
false
false
2,138
java
/* * This file was automatically generated by sel-utils and * released under the MIT License. * * License: https://github.com/sel-project/sel-utils/blob/master/LICENSE * Repository: https://github.com/sel-project/sel-utils * Generated from https://github.com/sel-project/sel-utils/blob/master/xml/protocol/bedrock150.xml */ package sul.protocol.bedrock150.play; import java.nio.charset.StandardCharsets; import java.util.Arrays; import sul.utils.*; public class ServerToClientHandshake extends Packet { public static final int ID = (int)3; public static final boolean CLIENTBOUND = true; public static final boolean SERVERBOUND = false; @Override public int getId() { return ID; } public String serverPublicKey; public byte[] token = new byte[0]; public ServerToClientHandshake() {} public ServerToClientHandshake(String serverPublicKey, byte[] token) { this.serverPublicKey = serverPublicKey; this.token = token; } @Override public int length() { return Buffer.varuintLength(serverPublicKey.getBytes(StandardCharsets.UTF_8).length) + serverPublicKey.getBytes(StandardCharsets.UTF_8).length + Buffer.varuintLength(token.length) + token.length + 1; } @Override public byte[] encode() { this._buffer = new byte[this.length()]; this.writeVaruint(ID); byte[] cvdvuvbl=serverPublicKey.getBytes(StandardCharsets.UTF_8); this.writeVaruint((int)cvdvuvbl.length); this.writeBytes(cvdvuvbl); this.writeVaruint((int)token.length); this.writeBytes(token); return this.getBuffer(); } @Override public void decode(byte[] buffer) { this._buffer = buffer; this.readVaruint(); int bvcvdvuv=this.readVaruint(); serverPublicKey=new String(this.readBytes(bvcvdvuv), StandardCharsets.UTF_8); int brav=this.readVaruint(); token=this.readBytes(brav); } public static ServerToClientHandshake fromBuffer(byte[] buffer) { ServerToClientHandshake ret = new ServerToClientHandshake(); ret.decode(buffer); return ret; } @Override public String toString() { return "ServerToClientHandshake(serverPublicKey: " + this.serverPublicKey + ", token: " + Arrays.toString(this.token) + ")"; } }
[ "selutils@mail.com" ]
selutils@mail.com
9a42b39602afae400b62027c92448cced48675aa
b4085155ba302a4c76d0839350bd024d4758cab5
/extensions/amazon-lambda/common-deployment/src/main/java/io/quarkus/amazon/lambda/deployment/DevServicesLambdaProcessor.java
6b41e5100b0c965764f2bdc526e1c72956b26c8f
[ "Apache-2.0" ]
permissive
cristian-com/quarkus
bfdaaa24e0454ed9cae32d273e2b7e8c13f9512f
b0d086a220ef0161ce192eae1ff810db5f0fde8f
refs/heads/main
2023-08-04T14:42:36.697545
2021-09-09T18:02:48
2021-09-09T18:02:48
356,559,618
1
0
Apache-2.0
2021-04-10T11:23:36
2021-04-10T11:23:36
null
UTF-8
Java
false
false
3,767
java
package io.quarkus.amazon.lambda.deployment; import static io.quarkus.deployment.annotations.ExecutionTime.STATIC_INIT; import java.util.Optional; import java.util.function.Supplier; import org.jboss.logging.Logger; import io.quarkus.amazon.lambda.runtime.AmazonLambdaApi; import io.quarkus.amazon.lambda.runtime.LambdaHotReplacementRecorder; import io.quarkus.amazon.lambda.runtime.MockEventServer; import io.quarkus.bootstrap.classloading.QuarkusClassLoader; import io.quarkus.deployment.IsNormal; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.builditem.DevServicesNativeConfigResultBuildItem; import io.quarkus.deployment.builditem.LaunchModeBuildItem; import io.quarkus.deployment.builditem.ServiceStartBuildItem; import io.quarkus.runtime.LaunchMode; public class DevServicesLambdaProcessor { private static final Logger log = Logger.getLogger(DevServicesLambdaProcessor.class); static MockEventServer server; static LaunchMode startMode; @BuildStep(onlyIfNot = IsNormal.class) @Record(STATIC_INIT) public void enableHotReplacementChecker(LaunchModeBuildItem launchMode, LambdaHotReplacementRecorder recorder, LambdaObjectMapperInitializedBuildItem dependency) { if (launchMode.getLaunchMode().isDevOrTest()) { if (!legacyTestingEnabled()) { recorder.enable(); } } } private boolean legacyTestingEnabled() { try { Class.forName("io.quarkus.amazon.lambda.test.LambdaClient"); return true; } catch (ClassNotFoundException e) { return false; } } @BuildStep(onlyIfNot = IsNormal.class) public void startEventServer(LaunchModeBuildItem launchMode, LambdaConfig config, Optional<EventServerOverrideBuildItem> override, BuildProducer<DevServicesNativeConfigResultBuildItem> devServicePropertiesProducer, BuildProducer<ServiceStartBuildItem> serviceStartBuildItemBuildProducer) throws Exception { if (!launchMode.getLaunchMode().isDevOrTest()) return; if (legacyTestingEnabled()) return; if (server != null) { return; } Supplier<MockEventServer> supplier = null; if (override.isPresent()) { supplier = override.get().getServer(); } else { supplier = () -> new MockEventServer(); } server = supplier.get(); int port = launchMode.getLaunchMode() == LaunchMode.TEST ? config.mockEventServer.testPort : config.mockEventServer.devPort; startMode = launchMode.getLaunchMode(); server.start(port); String baseUrl = "localhost:" + port + MockEventServer.BASE_PATH; System.setProperty(AmazonLambdaApi.QUARKUS_INTERNAL_AWS_LAMBDA_TEST_API, baseUrl); devServicePropertiesProducer.produce( new DevServicesNativeConfigResultBuildItem(AmazonLambdaApi.QUARKUS_INTERNAL_AWS_LAMBDA_TEST_API, baseUrl)); Runnable closeTask = () -> { if (server != null) { try { server.close(); } catch (Throwable e) { log.error("Failed to stop the Lambda Mock Event Server", e); } finally { server = null; } } startMode = null; server = null; }; QuarkusClassLoader cl = (QuarkusClassLoader) Thread.currentThread().getContextClassLoader(); ((QuarkusClassLoader) cl.parent()).addCloseTask(closeTask); } }
[ "bburke@redhat.com" ]
bburke@redhat.com
a17953dcbb491e3b2a571ff5eccbfc83989f893d
c3300b1ec4d2ab6752991dcd907f6a4e0c5cb752
/EpicFarming-API/src/main/java/com/songoda/epicfarming/api/farming/Farm.java
b6b40295fc35ca0dd7b7b130ad4c6df25108432d
[ "LicenseRef-scancode-other-permissive" ]
permissive
alfdef1/EpicFarming
11a3fda5da3fa70af1df2e2c2aea55cefc8f1ff7
b3205166969ad56096acd9025e2c29042f2a452f
refs/heads/master
2020-03-28T16:14:13.981364
2018-09-10T19:40:13
2018-09-10T19:40:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
package com.songoda.epicfarming.api.farming; import org.bukkit.Location; import org.bukkit.inventory.Inventory; public interface Farm { Inventory getInventory(); Location getLocation(); void setLocation(Location location); Level getLevel(); }
[ "bri@songoda.com" ]
bri@songoda.com
0a3c129738986f646bfc08d817d7d15d60ad538b
986fbc8d16bd8011e16c4cdc1fcb950981348049
/src/test/java/cn/guanmai/open/stock/OpenStockSaleRefundTest.java
ff28369d5ac8f475bed554de7fed4fcc998eaf0f
[]
no_license
wdkimsea/test_station
9a47e7df6756621d624e818555c0409fdfe2cb8d
9607c321a3f9aa45d8c2fef328b917cc72183b72
refs/heads/master
2023-01-19T00:47:59.028105
2020-11-22T01:16:36
2020-11-22T01:16:36
314,933,825
0
0
null
null
null
null
UTF-8
Java
false
false
6,656
java
package cn.guanmai.open.stock; import java.util.List; import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import cn.guanmai.open.bean.stock.OpenStockSaleRefundBean; import cn.guanmai.open.bean.stock.param.OpenStockSaleRefundFilterParam; import cn.guanmai.open.impl.stock.OpenStockSaleRefundServiceImpl; import cn.guanmai.open.interfaces.stock.OpenStockSaleRefundService; import cn.guanmai.open.tool.AccessToken; import cn.guanmai.util.NumberUtil; import cn.guanmai.util.ReporterCSS; import cn.guanmai.util.TimeUtil; /** * @author liming * @date 2019年12月18日 * @time 下午5:29:47 * @des TODO */ public class OpenStockSaleRefundTest extends AccessToken { private Logger logger = LoggerFactory.getLogger(OpenStockSaleRefundTest.class); private OpenStockSaleRefundService openStockSaleRefundService; private OpenStockSaleRefundFilterParam openStockSaleRefundFilterParam; private String todayStr = TimeUtil.getCurrentTime("yyyy-MM-dd"); @BeforeClass public void initData() { openStockSaleRefundService = new OpenStockSaleRefundServiceImpl(getAccess_token()); } @BeforeMethod public void beforeMethod() { openStockSaleRefundFilterParam = new OpenStockSaleRefundFilterParam(); openStockSaleRefundFilterParam.setStart_date(todayStr); openStockSaleRefundFilterParam.setEnd_date(todayStr); } @Test public void openStockSaleRefundTestCase01() { ReporterCSS.title("测试点: 搜索过滤商户退货单"); try { List<OpenStockSaleRefundBean> openStockSaleRefundList = openStockSaleRefundService .filterStockSaleRefund(openStockSaleRefundFilterParam); Assert.assertNotEquals(openStockSaleRefundList, null, "搜索过滤商户退货单失败"); } catch (Exception e) { logger.error("搜索过滤商户退货单遇到错误: ", e); Assert.fail("搜索过滤商户退货单遇到错误: ", e); } } @Test public void openStockSaleRefundTestCase02() { ReporterCSS.title("测试点: 搜索过滤商户退货单"); try { List<OpenStockSaleRefundBean> openStockSaleRefundList = openStockSaleRefundService .filterStockSaleRefund(openStockSaleRefundFilterParam); Assert.assertNotEquals(openStockSaleRefundList, null, "搜索过滤商户退货单失败"); Assert.assertEquals(openStockSaleRefundList.size() > 0, true, "商户退货无条目数,无法进行后续测试"); String order_id = NumberUtil.roundNumberInList(openStockSaleRefundList).getOrder_id(); openStockSaleRefundFilterParam.setOrder_id(order_id); openStockSaleRefundList = openStockSaleRefundService.filterStockSaleRefund(openStockSaleRefundFilterParam); Assert.assertNotEquals(openStockSaleRefundList, null, "搜索过滤商户退货单失败"); Assert.assertEquals(openStockSaleRefundList.size() >= 1, true, "商户退货入库列表,以订单ID过滤,过滤出的条目数应该大于等于1"); List<OpenStockSaleRefundBean> tempList = openStockSaleRefundList.stream() .filter(s -> !s.getOrder_id().equals(order_id)).collect(Collectors.toList()); Assert.assertEquals(tempList.size(), 0, "商户退货入库列表,以订单号过滤,过滤出了不合符条件的数据"); } catch (Exception e) { logger.error("搜索过滤商户退货单遇到错误: ", e); Assert.fail("搜索过滤商户退货单遇到错误: ", e); } } @Test public void openStockSaleRefundTestCase03() { ReporterCSS.title("测试点: 搜索过滤商户退货单"); try { List<OpenStockSaleRefundBean> openStockSaleRefundList = openStockSaleRefundService .filterStockSaleRefund(openStockSaleRefundFilterParam); Assert.assertNotEquals(openStockSaleRefundList, null, "搜索过滤商户退货单失败"); Assert.assertEquals(openStockSaleRefundList.size() > 0, true, "商户退货无条目数,无法进行后续测试"); String address_id = NumberUtil.roundNumberInList(openStockSaleRefundList).getAddress_id(); openStockSaleRefundFilterParam.setAddress_id(address_id); openStockSaleRefundList = openStockSaleRefundService.filterStockSaleRefund(openStockSaleRefundFilterParam); Assert.assertNotEquals(openStockSaleRefundList, null, "搜索过滤商户退货单失败"); Assert.assertEquals(openStockSaleRefundList.size() >= 1, true, "商户退货入库列表,以商户ID过滤,过滤出的条目数应该大于等于1"); List<OpenStockSaleRefundBean> tempList = openStockSaleRefundList.stream() .filter(s -> !s.getAddress_id().equals(address_id)).collect(Collectors.toList()); Assert.assertEquals(tempList.size(), 0, "商户退货入库列表,以商户ID过滤,过滤出了不合符条件的数据"); } catch (Exception e) { logger.error("搜索过滤商户退货单遇到错误: ", e); Assert.fail("搜索过滤商户退货单遇到错误: ", e); } } @Test public void openStockSaleRefundTestCase04() { ReporterCSS.title("测试点: 搜索过滤商户退货单"); try { openStockSaleRefundFilterParam.setState("1"); List<OpenStockSaleRefundBean> openStockSaleRefundList = openStockSaleRefundService .filterStockSaleRefund(openStockSaleRefundFilterParam); Assert.assertNotEquals(openStockSaleRefundList, null, "搜索过滤商户退货单失败"); List<OpenStockSaleRefundBean> tempList = openStockSaleRefundList.stream().filter(s -> s.getState() != 1) .collect(Collectors.toList()); Assert.assertEquals(tempList.size(), 0, "商户退货入库列表,以状态值过滤,过滤出了不合符条件的数据"); } catch (Exception e) { logger.error("搜索过滤商户退货单遇到错误: ", e); Assert.fail("搜索过滤商户退货单遇到错误: ", e); } } @Test public void openStockSaleRefundTestCase05() { ReporterCSS.title("测试点: 搜索过滤商户退货单"); try { openStockSaleRefundFilterParam.setState("2"); List<OpenStockSaleRefundBean> openStockSaleRefundList = openStockSaleRefundService .filterStockSaleRefund(openStockSaleRefundFilterParam); Assert.assertNotEquals(openStockSaleRefundList, null, "搜索过滤商户退货单失败"); List<OpenStockSaleRefundBean> tempList = openStockSaleRefundList.stream().filter(s -> s.getState() != 2) .collect(Collectors.toList()); Assert.assertEquals(tempList.size(), 0, "商户退货入库列表,以状态值过滤,过滤出了不合符条件的数据"); } catch (Exception e) { logger.error("搜索过滤商户退货单遇到错误: ", e); Assert.fail("搜索过滤商户退货单遇到错误: ", e); } } }
[ "yangjinhai@guanmai.cn" ]
yangjinhai@guanmai.cn
f8841c2ab7134993e704cd2570239d6d426491a2
2bc2eadc9b0f70d6d1286ef474902466988a880f
/tags/mule-2.0.0-M2/core/src/main/java/org/mule/config/spring/parsers/specific/ForwardingRouterDefinitionParser.java
d9d16d457137e4c624e1a3c4f000fc0ea1727c30
[]
no_license
OrgSmells/codehaus-mule-git
085434a4b7781a5def2b9b4e37396081eaeba394
f8584627c7acb13efdf3276396015439ea6a0721
refs/heads/master
2022-12-24T07:33:30.190368
2020-02-27T19:10:29
2020-02-27T19:10:29
243,593,543
0
0
null
2022-12-15T23:30:00
2020-02-27T18:56:48
null
UTF-8
Java
false
false
2,367
java
/* * $Id$ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */ package org.mule.config.spring.parsers.specific; import org.mule.components.simple.NullComponent; import org.mule.config.spring.parsers.delegate.AbstractSerialDelegatingDefinitionParser; import org.mule.config.spring.parsers.generic.GrandchildDefinitionParser; import org.mule.routing.inbound.ForwardingConsumer; import org.mule.util.object.SingletonObjectFactory; import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.xml.ParserContext; import org.w3c.dom.Element; /** * In addition to a ForwardingConsumer router, implicitly create a NullComponent service as a placeholder. * * We use AbstractSerialDelegatingDefinitionParser to be able to create 2 beans from a single element. * * We use a ParentDefinitionParser for the NullComponent, because it needs to be set not on * <inbound-router> (the surrounding element), but on <service> (one level up). * * <service name="BridgeOut"> * <inbound-router> * <inbound-endpoint address="tcp://localhost:9994" transformer-ref="NoAction"/> * <forwarding-router/> * </inbound-router> * </service> */ public class ForwardingRouterDefinitionParser extends AbstractSerialDelegatingDefinitionParser { public ForwardingRouterDefinitionParser() { super(); addDelegate(new RouterDefinitionParser("router", ForwardingConsumer.class)); addDelegate(new NullComponentPlaceholder()); } class NullComponentPlaceholder extends GrandchildDefinitionParser { public NullComponentPlaceholder() { super("serviceFactory", SingletonObjectFactory.class); } protected void parseChild(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) { builder.addPropertyValue("objectClassName", NullComponent.class.getName()); super.parseChild(element, parserContext, builder); } } }
[ "tcarlson@bf997673-6b11-0410-b953-e057580c5b09" ]
tcarlson@bf997673-6b11-0410-b953-e057580c5b09
a82d05f1e50f8a53cfc8b14e6d1411e246193ba8
1ee24224273997c55967b2875a9fa5f10725d075
/aula06/exercicio02/App.java
27795f766c23391faf216fe18303f08a201f0012
[]
no_license
EderSerra/ItauGamaTurma7
57b284bd7da4d45af987612f900613940df6f907
cce0ff4aa42afde802996f99f03c76f9822f1dad
refs/heads/master
2022-12-05T17:49:26.572284
2020-09-03T20:51:00
2020-09-03T20:51:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,967
java
package exercicio02; import java.util.ArrayList; import java.util.Scanner; public class App { public static void main(String[] args) { Scanner in = new Scanner(System.in); int opcao; int numeroConta; double valor, limite; /* ContaCorrente cc = null; ContaEspecial ce = null; ContaPoupanca cp = null; */ Conta conta = null; ArrayList<Conta> listaDeContas = new ArrayList<>(); do { System.out.println("1-Nova conta corrente"); System.out.println("2-Nova conta poupança"); System.out.println("3-Nova conta especial"); System.out.println("4-Exibir o saldo"); System.out.println("5-Fazer saque"); System.out.println("6-Fazer um depósito"); System.out.println("7-Sair"); System.out.print("==> "); opcao = in.nextInt(); switch (opcao) { //alernativa ao if/else case 1: System.out.println("Informe o numero da conta:"); numeroConta = in.nextInt(); conta = new ContaCorrente(numeroConta); listaDeContas.add(conta); break; case 2: System.out.println("Informe o numero da conta:"); numeroConta = in.nextInt(); conta = new ContaPoupanca(numeroConta); listaDeContas.add(conta); break; case 3: System.out.println("Informe o numero da conta:"); numeroConta = in.nextInt(); System.out.println("Informe o valor do limite:"); limite = in.nextDouble(); conta = new ContaEspecial(numeroConta, limite); listaDeContas.add(conta); break; case 4: System.out.println("Informe o numero da conta:"); numeroConta = in.nextInt(); for(int i = 0; i < listaDeContas.size(); i++){ conta = listaDeContas.get(i); if(conta.getNumero() == numeroConta){ System.out.println("saldo: " + conta.getSaldo()); break; } } break; case 5: System.out.println("Informe o numero da conta:"); numeroConta = in.nextInt(); for(int i = 0; i < listaDeContas.size(); i++){ conta = listaDeContas.get(i); if(conta.getNumero() == numeroConta){ System.out.println("Informe o valor do saque:"); valor = in.nextDouble(); conta.sacar(valor); break; } } break; case 6: System.out.println("Informe o numero da conta:"); numeroConta = in.nextInt(); for(int i = 0; i < listaDeContas.size(); i++){ conta = listaDeContas.get(i); if(conta.getNumero() == numeroConta){ System.out.println("Informe o valor do depósito:"); valor = in.nextDouble(); conta.depositar(valor); break; } } break; case 7: break; default: //qualquer outra opção diferente das listadas acima System.out.println("Opção inválida"); //break; } } while (opcao != 7); in.close(); } }
[ "emerson.paduan@gmail.com" ]
emerson.paduan@gmail.com
b899864acc306dfb088657f4e107595ef5179a8a
b7eab1bc2c0ffd9d6689df9d803db375326baf56
/tests/src/com/mediatek/camera/tests/v3/operator/GoToGalleryOperator.java
9ae6efca763ca1615f19a2bdfca53c7e979f6b38
[ "Apache-2.0" ]
permissive
cc-china/MTK_AS_Camera2
8e687aa319db7009faee103496a79bd60ffdadec
9b3b73174047f0ea8d2f7860813c0a72f37a2d7a
refs/heads/master
2022-03-09T08:21:11.948397
2019-11-14T09:37:30
2019-11-14T09:37:30
221,654,668
3
2
null
null
null
null
UTF-8
Java
false
false
890
java
package com.mediatek.camera.tests.v3.operator; import android.support.test.uiautomator.By; import android.support.test.uiautomator.UiObject2; import com.mediatek.camera.tests.v3.arch.OperatorOne; import com.mediatek.camera.tests.v3.arch.Page; import com.mediatek.camera.tests.v3.util.Utils; public class GoToGalleryOperator extends OperatorOne { @Override protected void doOperate() { UiObject2 thumb = Utils.findObject( By.res("com.mediatek.camera:id/thumbnail").clickable(true).enabled(true)); Utils.assertRightNow(thumb != null); thumb.click(); } @Override public Page getPageBeforeOperate() { return Page.PREVIEW; } @Override public Page getPageAfterOperate() { return null; } @Override public String getDescription() { return "Click thumbnail to launch gallery"; } }
[ "com_caoyun@163.com" ]
com_caoyun@163.com
f271b28ed448f48b1d5aa413b9ff57d86231a750
3a81339ee39494fbd0250df6abc6411f386907f9
/src/main/java/act/event/OnceEventListener.java
0892f150a7137054087439b99d5dfa9daa815018
[ "Apache-2.0" ]
permissive
zhaoyancong/actframework
cafba5687d78bbf78e4834b46168b1bd73e2a193
d910531793047a75e7067fcaacbf7caebe58132c
refs/heads/master
2021-01-13T05:01:11.170769
2017-02-07T07:40:46
2017-02-07T07:40:46
81,185,396
1
0
null
2017-02-07T08:34:16
2017-02-07T08:34:16
null
UTF-8
Java
false
false
353
java
package act.event; import java.util.EventListener; import java.util.EventObject; /** * `OnceEventListener` handle event and return a * `boolean` value indicate if the event is handled * or not */ public interface OnceEventListener<EVENT_TYPE extends EventObject> extends EventListener { boolean tryHandle(EVENT_TYPE event) throws Exception; }
[ "greenlaw110@gmail.com" ]
greenlaw110@gmail.com
b6de2ee6dfe5ef9cf907f8027c75c62bc1feea97
ef7c846fd866bbc748a2e8719358c55b73f6fc96
/library/weiui/src/main/java/vip/kuaifan/weiui/extend/integration/glide/load/data/DataRewinderRegistry.java
a9c80d3aba02529a1bffd9323a9859fd6514c31b
[ "MIT" ]
permissive
shaibaoj/weiui
9e876fa3797537faecccca74a0c9206dba67e444
131a8e3a6ecad245f421f039d2bedc8a0362879d
refs/heads/master
2020-03-17T22:45:52.855193
2018-07-02T01:56:51
2018-07-02T01:56:51
134,017,696
0
0
null
2018-07-02T01:56:52
2018-05-19T01:01:44
Java
UTF-8
Java
false
false
2,109
java
package vip.kuaifan.weiui.extend.integration.glide.load.data; import android.support.annotation.NonNull; import vip.kuaifan.weiui.extend.integration.glide.util.Preconditions; import java.util.HashMap; import java.util.Map; /** * Stores a mapping of data class to {@link vip.kuaifan.weiui.extend.integration.glide.load.data.DataRewinder.Factory} and * allows registration of new types and factories. */ public class DataRewinderRegistry { private final Map<Class<?>, DataRewinder.Factory<?>> rewinders = new HashMap<>(); private static final DataRewinder.Factory<?> DEFAULT_FACTORY = new DataRewinder.Factory<Object>() { @NonNull @Override public DataRewinder<Object> build(@NonNull Object data) { return new DefaultRewinder(data); } @NonNull @Override public Class<Object> getDataClass() { throw new UnsupportedOperationException("Not implemented"); } }; public synchronized void register(@NonNull DataRewinder.Factory<?> factory) { rewinders.put(factory.getDataClass(), factory); } @NonNull @SuppressWarnings("unchecked") public synchronized <T> DataRewinder<T> build(@NonNull T data) { Preconditions.checkNotNull(data); DataRewinder.Factory<T> result = (DataRewinder.Factory<T>) rewinders.get(data.getClass()); if (result == null) { for (DataRewinder.Factory<?> registeredFactory : rewinders.values()) { if (registeredFactory.getDataClass().isAssignableFrom(data.getClass())) { result = (DataRewinder.Factory<T>) registeredFactory; break; } } } if (result == null) { result = (DataRewinder.Factory<T>) DEFAULT_FACTORY; } return result.build(data); } private static final class DefaultRewinder implements DataRewinder<Object> { private final Object data; DefaultRewinder(@NonNull Object data) { this.data = data; } @NonNull @Override public Object rewindAndGet() { return data; } @Override public void cleanup() { // Do nothing. } } }
[ "342210020@qq.com" ]
342210020@qq.com
7d6ffa8fd4a54423942c1fd9ae720d50561521bc
3ef55e152decb43bdd90e3de821ffea1a2ec8f75
/large/module1828_public/tests/more/src/java/module1828_public_tests_more/a/IFoo1.java
a71e34c76be17a77e0df2c19108cc594dd95e59c
[ "BSD-3-Clause" ]
permissive
salesforce/bazel-ls-demo-project
5cc6ef749d65d6626080f3a94239b6a509ef145a
948ed278f87338edd7e40af68b8690ae4f73ebf0
refs/heads/master
2023-06-24T08:06:06.084651
2023-03-14T11:54:29
2023-03-14T11:54:29
241,489,944
0
5
BSD-3-Clause
2023-03-27T11:28:14
2020-02-18T23:30:47
Java
UTF-8
Java
false
false
880
java
package module1828_public_tests_more.a; import java.sql.*; import java.util.logging.*; import java.util.zip.*; /** * Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut * labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. * Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. * * @see javax.management.Attribute * @see javax.naming.directory.DirContext * @see javax.net.ssl.ExtendedSSLSession */ @SuppressWarnings("all") public interface IFoo1<B> extends module1828_public_tests_more.a.IFoo0<B> { javax.rmi.ssl.SslRMIClientSocketFactory f0 = null; java.awt.datatransfer.DataFlavor f1 = null; java.beans.beancontext.BeanContext f2 = null; String getName(); void setName(String s); B get(); void set(B e); }
[ "gwagenknecht@salesforce.com" ]
gwagenknecht@salesforce.com
70249674d27598bd09a299155e1e5aae6fb710bd
b2d7b0517bc16e6a0cf281b1424178413b55b947
/java-project2-server/src15/main/java/com/eomcs/lms/dao/PhotoFileDao.java
f7e2491d7ed8036f37e33825c80f6b6af16539dd
[]
no_license
gwanghosong/bitcamp-java-2018-12
5ea3035c1beb5b9ce7c5348503daf5ed72304dc9
8782553c4505c5943db0009b6a2ebf742c84e38c
refs/heads/master
2021-08-06T20:30:07.181054
2019-06-26T16:18:50
2019-06-26T16:18:50
163,650,672
0
0
null
2020-04-30T06:28:29
2018-12-31T08:00:40
Java
UTF-8
Java
false
false
270
java
package com.eomcs.lms.dao; import java.util.List; import com.eomcs.lms.domain.PhotoFile; public interface PhotoFileDao { void insert(List<PhotoFile> photoFiles); List<PhotoFile> findByPhotoBoardNo(int photoBoardNo); int deleteByPhotoBoardNo(int PhotoBoardNo); }
[ "gwanghosong91@gmail.com" ]
gwanghosong91@gmail.com
5a22bd298a05748833c1d2cd68830eb1294d162f
b97bc0706448623a59a7f11d07e4a151173b7378
/src/main/java/com/tcmis/client/utc/action/OciCatalogAction.java
d82944f2732de4704800eca7fe3a3b7f4117c8ff
[]
no_license
zafrul-ust/tcmISDev
576a93e2cbb35a8ffd275fdbdd73c1f9161040b5
71418732e5465bb52a0079c7e7e7cec423a1d3ed
refs/heads/master
2022-12-21T15:46:19.801950
2020-02-07T21:22:50
2020-02-07T21:22:50
241,601,201
0
0
null
2022-12-13T19:29:34
2020-02-19T11:08:43
Java
UTF-8
Java
false
false
6,414
java
package com.tcmis.client.utc.action; import java.math.BigDecimal; import java.util.Collection; import java.util.Vector; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Locale; import org.apache.commons.beanutils.DynaBean; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import com.tcmis.client.catalog.beans.CatalogCartBean; import com.tcmis.client.catalog.beans.CatalogInputBean; import com.tcmis.client.catalog.beans.PrCatalogScreenSearchBean; import com.tcmis.client.catalog.process.CatalogProcess; import com.tcmis.client.catalog.process.OrderTrackingProcess; import com.tcmis.common.admin.process.LoginProcess; import com.tcmis.common.admin.beans.PersonnelBean; import com.tcmis.common.exceptions.BaseException; import com.tcmis.common.framework.TcmISBaseAction; import com.tcmis.common.util.BeanHandler; /** * *************************************************************************** * Controller for receiving * * @version 1.0 * **************************************************************************** */ public class OciCatalogAction extends TcmISBaseAction { public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws BaseException, Exception { PersonnelBean user = null; String uAction = request.getParameter("uAction"); BigDecimal personnelId = null; OrderTrackingProcess orderTrackingProcess = null; if (form == null) { try { user = new PersonnelBean(); user.setCompanyId(this.getClient(request)); if (request.getParameter("userid") == null || request.getParameter("userid").length() == 0) { return mapping.findForward("nopermissions"); } user.setLogonId(request.getParameter("userid")); user.setClearTextPassword(request.getParameter("passwd")); LoginProcess loginProcess = new LoginProcess(this.getDbUser(request)); user = loginProcess.loginWeb(user, false); user.setDbUser(this.getDbUser(request)); this.setSessionObject(request, user, "personnelBean"); Locale locale = null; if ("fr".equalsIgnoreCase(request.getParameter("locale"))) { locale = new Locale("fr", "FR"); com.tcmis.common.admin.action.LoginAction.setLocaleAnyway(request, request.getSession(), locale.toString()); user.setLocale(locale); } else { locale = new Locale("en", "US"); com.tcmis.common.admin.action.LoginAction.setLocaleAnyway(request, request.getSession(), locale.toString()); user.setLocale(locale); } } catch (Exception ex) { return mapping.findForward("nopermissions"); } orderTrackingProcess = new OrderTrackingProcess(this. getDbUser(request), this.getTcmISLocaleString(request)); personnelId = new BigDecimal(user.getPersonnelId()); request.setAttribute("myWorkareaFacilityViewBeanCollection", orderTrackingProcess.getMyWorkareaFacilityViewBean(personnelId)); request.setAttribute("myDefaultFacilityId",orderTrackingProcess.getMyDefaultFacility(personnelId,user.getCompanyId())); // enable utc ocicatalog only features request.setAttribute("showcart", "true"); request.setAttribute("showmenu", "true"); request.setAttribute("ecommerceLogon", "Y"); request.setAttribute("ecommerceSource", "OCI"); return mapping.findForward("success"); } if (!this.isLoggedIn(request)) return mapping.findForward("nopermissions"); System.out.print("locale==" + request.getSession().getAttribute("tcmISLocale")); user = (PersonnelBean) this.getSessionObject(request, "personnelBean"); orderTrackingProcess = new OrderTrackingProcess(this. getDbUser(request), this.getTcmISLocaleString(request)); personnelId = new BigDecimal(user.getPersonnelId()); //if form is not null we have to perform some action if (form != null) { //copy date from dyna form to the data form CatalogInputBean bean = new CatalogInputBean(); BeanHandler.copyAttributes(form, bean, this.getTcmISLocale(request)); // for( String key: (java.util.Set<String>) request.getParameterMap().keySet() ) { // System.out.println(key+":"+request.getParameter(key)); // } CatalogProcess catalogProcess = new CatalogProcess(this.getDbUser(request), this.getTcmISLocaleString(request)); if (uAction != null && uAction.equals("showCart")) { Collection<CatalogCartBean> beans = BeanHandler.getBeans((DynaBean) form, "CatalogCartBean", new CatalogCartBean(), this.getLocale(request)); request.setAttribute("CatalogCartBeanCollection", beans); return mapping.findForward("showcart"); } else if ("search".equals(uAction)) { Vector<PrCatalogScreenSearchBean> c = (Vector<PrCatalogScreenSearchBean>) catalogProcess.getSearchResult(bean, user); Object[] results = catalogProcess.createRelationalObjects(c); request.setAttribute("prCatalogScreenSearchBeanCollection", results[0]); request.setAttribute("rowCountPart", results[1]); request.setAttribute("rowCountItem", results[2]); this.saveTcmISToken(request); } else if ("createXSL".equals(uAction)) { this.setExcel(response, "OCICatalogSearch"); try { catalogProcess.getPartExcelReport(bean, user).write(response.getOutputStream()); } catch (Exception ex) { ex.printStackTrace(); return mapping.findForward("genericerrorpage"); } return noForward; } else if ("loaddata".equals(uAction)) { PrCatalogScreenSearchBean pbean = new PrCatalogScreenSearchBean(); BeanHandler.copyAttributes(form, pbean, this.getTcmISLocale(request)); request.setAttribute("specColl", catalogProcess.getSpecMenu(pbean)); request.setAttribute("partInvColl", catalogProcess.getInventoryMenu(pbean)); request.setAttribute("stockingReorder", catalogProcess.getStockingReorder(pbean)); request.setAttribute("ImgLit", catalogProcess.getImgLit(pbean)); return mapping.findForward("success"); } // search frame else { request.setAttribute("myWorkareaFacilityViewBeanCollection", orderTrackingProcess.getMyWorkareaFacilityViewBean(personnelId)); request.setAttribute("myDefaultFacilityId",orderTrackingProcess.getMyDefaultFacility(personnelId,user.getCompanyId())); } return mapping.findForward("success"); } return mapping.findForward("success"); } }
[ "julio.rivero@wescoair.com" ]
julio.rivero@wescoair.com
5f4b0de97f5e15a050b1fd73e2e39b28bcb2917d
854661668f6ee8ed09cfc9950fd05f5e884e2842
/grainoil-common/grainoil-common-core/src/main/java/com/grainoil/common/core/dao/BaseMapper.java
c6689db0de33338ada89401a85c28c26bb4df917
[ "MIT" ]
permissive
18406611280/oil
f69e6bd06e25befd349aade5e114d637b87e2c75
d48e2f4984eb735292021d0f76945bb97741db87
refs/heads/master
2023-05-08T19:54:57.543358
2021-05-31T03:43:40
2021-05-31T03:43:40
372,158,123
0
0
null
null
null
null
UTF-8
Java
false
false
712
java
/* * @(#)BaseMapper.java 2016-3-30 下午5:57:15 * Copyright 2016 张孟如, Inc. All rights reserved. * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.grainoil.common.core.dao; import tk.mybatis.mapper.common.ConditionMapper; import tk.mybatis.mapper.common.IdsMapper; import tk.mybatis.mapper.common.Mapper; import tk.mybatis.mapper.common.special.InsertListMapper; /** * <p>File:BaseMapper.java</p> * <p>Title: </p> * <p>Description:</p> * <p>Copyright: Copyright (c) 2016 2016-3-30 下午5:57:15</p> * <p>Company: </p> * @author 张孟如 * @version 1.0 */ public interface BaseMapper<T> extends Mapper<T>, IdsMapper<T>, InsertListMapper<T>, ConditionMapper<T> { }
[ "823169071@qq.com" ]
823169071@qq.com
a336f1e6a859e967cffc7a8e3166696cd9be74fa
c4fcb3b5e335906e003cb2d648af0c703c88876d
/springboot/src/main/java/com/wonseok/spring/demo/chapter1/level5/DaoFactory.java
cc250c9ad2c0742c2227e54722dd7213f985a3b5
[]
no_license
wonseok5893/spring-study
007c094d02e9ec4dd5ad97f1cf61e04115a11ae9
3d75cd794412f568b5149d3c5a650a6e585f500d
refs/heads/main
2023-05-10T14:01:45.572369
2021-06-03T08:18:05
2021-06-03T08:18:05
288,704,589
0
0
null
null
null
null
UTF-8
Java
false
false
566
java
package com.wonseok.spring.demo.chapter1.level5; import com.wonseok.spring.demo.chapter1.level5.*; public class DaoFactory { public UserDaoLevel5 userDao(){ return new UserDaoLevel5(new DConnectionMaker()); } public AccountDao accountDao(){ return new AccountDao(new DConnectionMaker()); } public MessageDao messageDao(){ return new MessageDao(new DConnectionMaker()); } //반복되는 코드를 처리하기 위해 public ConnectionMaker connectionMaker(){ return new DConnectionMaker(); } }
[ "wonseok5893@naver.com" ]
wonseok5893@naver.com
f1227c02dcbb349cb54e0e832327bd906e93b60c
85659db6cd40fcbd0d4eca9654a018d3ac4d0925
/packages/apps/PimBackupRestore/src/com/motorola/filemanager/multiselect/local/SearchSuggestionsProvider.java
17cd6269a447d2d42a91c8dbb948dab4ffef24fa
[]
no_license
qwe00921/switchui
28e6e9e7da559c27a3a6663495a5f75593f48fb8
6d859b67402fb0cd9f7e7a9808428df108357e4d
refs/heads/master
2021-01-17T06:34:05.414076
2014-01-15T15:40:35
2014-01-15T15:40:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,289
java
/* * Copyright (c) 2010 Motorola, Inc. * All Rights Reserved * * The contents of this file are Motorola Confidential Restricted (MCR). */ package com.motorola.filemanager.multiselect.local; import java.io.FileNotFoundException; import android.app.SearchManager; import android.content.ContentProvider; import android.content.ContentResolver; import android.content.ContentValues; import android.content.UriMatcher; import android.database.Cursor; import android.net.Uri; import android.os.ParcelFileDescriptor; import android.provider.BaseColumns; import com.motorola.filemanager.multiselect.FileManagerApp; public class SearchSuggestionsProvider extends ContentProvider { private static final String TAG = "SearchSuggestionsProvider"; private static String AUTHORITY = "com.motorola.filemanager.local.SearchSuggestionsProvider"; public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/searchsuggestions"); // UriMatcher stuff private static final int GET_RECORD = 0; private static final int SEARCH_SUGGEST = 1; private static final UriMatcher m_sURIMatcher = buildUriMatcher(); private SearchContentDatabase mDictionary; public static final String RECORD_MIME_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE + "/com.motorola.filemanager.local.searchsuggestionsprovider"; /** * Builds up a UriMatcher for search suggestion and shortcut refresh queries. */ private static UriMatcher buildUriMatcher() { UriMatcher matcher = new UriMatcher(UriMatcher.NO_MATCH); // to get record... matcher.addURI(AUTHORITY, "searchsuggestions/#", GET_RECORD); // to get suggestions... matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY, SEARCH_SUGGEST); matcher.addURI(AUTHORITY, SearchManager.SUGGEST_URI_PATH_QUERY + "/*", SEARCH_SUGGEST); return matcher; } @Override public boolean onCreate() { FileManagerApp.log(TAG + " onCreate "); mDictionary = new SearchContentDatabase(getContext()); return true; } @Override public int delete(Uri uri, String s, String[] as) { // not supported throw new UnsupportedOperationException(); } @Override public String getType(Uri uri) { // return file extension (uri.lastIndexOf(".")) if (m_sURIMatcher.match(uri) == SEARCH_SUGGEST) { return SearchManager.SUGGEST_MIME_TYPE; } else if (m_sURIMatcher.match(uri) == GET_RECORD) { return RECORD_MIME_TYPE; } else { throw new IllegalArgumentException("Unknown URL " + uri); } } @Override public Uri insert(Uri uri, ContentValues contentvalues) { // not supported throw new UnsupportedOperationException(); } @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { if (m_sURIMatcher.match(uri) == SEARCH_SUGGEST) { if (selectionArgs == null) { throw new IllegalArgumentException("selectionArgs must be provided for the Uri: " + uri); } FileManagerApp.log(TAG + " query: " + "uri=" + uri + "," + "selectionArgs[0]=" + selectionArgs[0]); return getSuggestions(selectionArgs[0]); } else if (m_sURIMatcher.match(uri) == GET_RECORD) { FileManagerApp.log(TAG + " GET_RECORD: " + "uri=" + uri + ","); return getRecord(uri); } else { throw new RuntimeException("Unsupported uri"); } } private Cursor getSuggestions(String query) { query = query.toLowerCase(); String[] columns = new String[]{BaseColumns._ID, SearchContentDatabase.KEY_FOLDER, /* SearchContentDatabase.KEY_FULL_PATH, */ SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID}; return mDictionary.getPathMatches(query, columns); } private Cursor getRecord(Uri uri) { String rowId = uri.getLastPathSegment(); String[] columns = new String[]{SearchContentDatabase.KEY_FOLDER, SearchContentDatabase.KEY_FULL_PATH}; return mDictionary.getPath(rowId, columns); } @Override public ParcelFileDescriptor openFile(Uri uri, String mode) throws FileNotFoundException { return null; } @Override public int update(Uri uri, ContentValues contentvalues, String s, String[] as) { // not supported throw new UnsupportedOperationException(); } }
[ "cheng.carmark@gmail.com" ]
cheng.carmark@gmail.com
792f5f33d416ee4c9bce24af9cceed01497ccc37
dbe9dfc23781b99e83577df1ff50aa8614705211
/temp/src/minecraft/net/minecraft/src/SlotBrewingStandIngredient.java
abbb9834d7bd87a680c5f7cbd716a1163ab3f8cd
[]
no_license
bbernardoni/RubiksCraft
9041ba72785caa37274b1d6144702f762963cc03
428ddb1ea0e1038629b86de29cadf56da539fa11
refs/heads/master
2021-07-23T17:05:11.745763
2017-11-04T00:45:44
2017-11-04T00:45:44
109,455,526
0
0
null
null
null
null
UTF-8
Java
false
false
801
java
package net.minecraft.src; import net.minecraft.src.ContainerBrewingStand; import net.minecraft.src.IInventory; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; import net.minecraft.src.Slot; class SlotBrewingStandIngredient extends Slot { // $FF: synthetic field final ContainerBrewingStand field_75226_a; public SlotBrewingStandIngredient(ContainerBrewingStand p_i3598_1_, IInventory p_i3598_2_, int p_i3598_3_, int p_i3598_4_, int p_i3598_5_) { super(p_i3598_2_, p_i3598_3_, p_i3598_4_, p_i3598_5_); this.field_75226_a = p_i3598_1_; } public boolean func_75214_a(ItemStack p_75214_1_) { return p_75214_1_ != null?Item.field_77698_e[p_75214_1_.field_77993_c].func_77632_u():false; } public int func_75219_a() { return 64; } }
[ "bennett.bernardoni@gmail.com" ]
bennett.bernardoni@gmail.com
22c326ef78b9ea7ee6b0bf9541e8308d84424230
0d7a63fe9f24bfe3ac86ca7e94faf98bc22a8baf
/clients/CLW_TQC_YGB_Client/src/com/yutong/clw/ygbclient/common/push/.svn/text-base/AbstractPush.java.svn-base
782ee532a0c9af56833256c26b3adfeaf446d6c7
[]
no_license
koalhou/Android
cc664ffc6eb085fc2275319fcd7bc50d77288a10
2d11a4d8bd965e3e5e7809422d254459105af9d8
refs/heads/master
2021-01-10T08:28:39.720592
2015-10-22T06:24:32
2015-10-22T06:24:32
44,721,409
1
1
null
null
null
null
UTF-8
Java
false
false
3,061
/** * @公司名称:YUTONG * @作者:zhangzhia * @版本号:1.0 * @生成日期:2013-10-23 上午9:29:55 * @功能描述: */ package com.yutong.clw.ygbclient.common.push; import java.util.Date; import org.json.JSONException; import org.json.JSONObject; import com.yutong.clw.ygbclient.common.Logger; import com.yutong.clw.ygbclient.common.enums.MsgPushType; import com.yutong.clw.ygbclient.common.utils.DateUtils; /** * 推送内容抽象类 * * @author zhangzhia 2013-9-3 上午10:36:19 */ public abstract class AbstractPush { public MsgPushType msgPushType = MsgPushType.Unknow; public String id; public String rule_id; /** 用户code */ public String user_code; public Date event_time; public JSONObject contentJsonObj; public MsgPushType getMsgPushType() { return msgPushType; } public boolean parse(String msg) { JSONObject jsonObject; try { jsonObject = new JSONObject(msg); id = jsonObject.optString("id"); rule_id = jsonObject.optString("rule_id"); user_code = jsonObject.optString("user_code"); event_time = DateUtils.strToDate(jsonObject.optString("event_time"), "yyyyMMddHHmmss"); contentJsonObj = jsonObject.optJSONObject("content"); msgPushType = MsgPushType.myNameOf(rule_id); return parseContent(); } catch (JSONException e) { Logger.e(this.getClass(), "[推送内容抽象类]:解析接受消息出错,详细信息:", e); return false; } } @Override public boolean equals(Object o) { if (null == o) return true; if (!(o instanceof AbstractPush)) { return true; } AbstractPush push = (AbstractPush) o; if (this.id.equals(push.id)) { return true; } else { return false; } } /** * 解析内容 * * @param jsonObject * @return */ abstract boolean parseContent(); public String getRule_id() { return rule_id; } public void setRule_id(String rule_id) { this.rule_id = rule_id; } // /** // * 获取内容值 // * // * @author zhangzhia 2013-9-10 上午11:26:46 // * @param key key // */ // public String getContent(String key) // { // try // { // String value = null; // if (contentJsonObj != null) // { // value = contentJsonObj.optString(key); // // } // // return value; // } // catch (Exception e) // { // return null; // } // } // // /** // * 获取内容值Map集合 // * // * @author zhangzhia 2013-9-10 上午11:26:46 // */ // public Map<String, String> getContents() // { // try // { // Map<String, String> map = new HashMap<String, String>(); // if (contentJsonObj != null) // { // // value = contentJsonObj.optString(key); // Iterator<?> it = contentJsonObj.keys(); // while (it.hasNext()) // { // String key = (String) it.next(); // map.put(key, contentJsonObj.getString(key)); // // } // } // // return map; // } // catch (Exception e) // { // return null; // } // } }
[ "houjunhu_2009@163.com" ]
houjunhu_2009@163.com
4768591bcc73433d47a33937d2632a1d98ad6498
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MOCKITO-38b-2-8-FEMO-WeightedSum:TestLen:CallDiversity/org/mockito/internal/verification/argumentmatching/ArgumentMatchingTool_ESTest_scaffolding.java
d4df100b6fe1059611870ada0304904a82f31bf7
[]
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
475
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Apr 04 06:57:32 UTC 2020 */ package org.mockito.internal.verification.argumentmatching; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class ArgumentMatchingTool_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
509c462313f38e915bdd01f1c7c1139e918c7ceb
fdbe6343fc0ea6d3d4b7f270bddc98a47cb139e6
/src/main/java/org/daniels/samples/rest/service/impl/UserServiceImpl.java
5bd61bfad18d3802682a21dbf6f0310bdf710f8f
[]
no_license
daniels75/JacksonGuiceSpringExample
d2a584d36644555009321c9a653026a0363d0718
22ca6f27dc7e8198ec8d57e39aed4e910195091e
refs/heads/master
2021-04-09T16:41:08.887385
2014-06-11T16:54:09
2014-06-11T16:54:09
20,727,112
1
0
null
null
null
null
UTF-8
Java
false
false
2,592
java
package org.daniels.samples.rest.service.impl; import com.daniels.transaction.TransactionBo; import com.google.inject.Inject; import com.google.inject.Singleton; import java.util.Date; import java.util.List; import org.daniels.examples.hibernate.util.HibernateUtil; import org.daniels.examples.model.Employee1; import org.daniels.samples.rest.domain.User; import org.daniels.samples.rest.repositories.contract.UserRepository; import org.daniels.samples.rest.service.contract.UserService; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; //@Component @Singleton public class UserServiceImpl implements UserService { private final UserRepository userRepository; // @Autowired // TransactionBo transactionBo; @Inject TransactionBo transactionBo; @Inject SessionFactory sessionFactory; @Inject public UserServiceImpl(UserRepository userRepository) { this.userRepository = userRepository; } public int insertUser(){ System.out.println("sessionFactory is null? " + sessionFactory == null); Employee1 emp = new Employee1(); emp.setName("David"); emp.setRole("Developer"); emp.setInsertTime(new Date()); //Get Session Session session = sessionFactory.getCurrentSession(); //start transaction session.beginTransaction(); //Save the Model object session.save(emp); //Commit transaction session.getTransaction().commit(); System.out.println("Employee ID="+emp.getId()); return emp.getId(); } @Override public List getAllUsers() { System.out.println("sessionFactory is null? " + sessionFactory == null); System.out.println("transactionBo is null? " + transactionBo == null); if (transactionBo != null){ String str = transactionBo.save(); System.out.println(">>>>>>>>>>>>> " + str); } return this.userRepository.getAll(); } @Override public User getById(int id) { return this.userRepository.getById(id); } @Override public User createNewUser(User user) { User u = this.userRepository.create(user); return u; } @Override public User update(User user) { return this.userRepository.update(user); } @Override public void remove(int id) { this.userRepository.remove(id); } @Override public int getNumberOfUsers() { return this.userRepository.getNumberOfUsers(); } }
[ "daniel.sadowski75@gmail.com" ]
daniel.sadowski75@gmail.com
1d8838c651a2d1f4f637beec2f3d311e1128447a
f686bbe54805c78f3437b39ff5ae912ad2613dda
/twitch/src/main/java/tv/twitch/android/core/user/TwitchAccountManager.java
31d8c702c39e3836876f7729f5ceade3f21b284c
[ "MIT" ]
permissive
deleteBlack666/TwitchMod
39ddb7e6fe0ed07306b6b6a95a02895ede1d254b
39cc43dad2973c132435498a38c59b718b94f756
refs/heads/master
2023-02-28T05:17:13.819392
2021-01-17T18:19:03
2021-01-17T18:19:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
465
java
package tv.twitch.android.core.user; public final class TwitchAccountManager { /* ... */ public final String getUsername() { /* ... */ return null; } public final int getUserId() { return -1; } public final boolean isAffiliate() { return false; } public final boolean isPartner() { return false; } public final boolean isStaff() { return false; } /* ... */ }
[ "nopbreak@gmail.com" ]
nopbreak@gmail.com
2351f588831ddecf773ab128cda00c4b77f2f8cc
17e8438486cb3e3073966ca2c14956d3ba9209ea
/dso/tags/2.7.3/code/base/dso-tests-jdk15/tests.base/com/tctest/ListLocalStateTestApp.java
f74ee481a65c4376453b43bc0a321b5f30e6578c
[]
no_license
sirinath/Terracotta
fedfc2c4f0f06c990f94b8b6c3b9c93293334345
00a7662b9cf530dfdb43f2dd821fa559e998c892
refs/heads/master
2021-01-23T05:41:52.414211
2015-07-02T15:21:54
2015-07-02T15:21:54
38,613,711
1
0
null
null
null
null
UTF-8
Java
false
false
6,361
java
/* * All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright * notice. All rights reserved. */ package com.tctest; import com.tc.object.config.ConfigVisitor; import com.tc.object.config.DSOClientConfigHelper; import com.tc.object.config.TransparencyClassSpec; import com.tc.simulator.app.ApplicationConfig; import com.tc.simulator.listener.ListenerProvider; import com.tc.util.Assert; import com.tc.util.TIMUtil; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Stack; import java.util.Vector; /** * Test to make sure local object state is preserved when TC throws: UnlockedSharedObjectException ReadOnlyException * TCNonPortableObjectError List version INT-186 * * @author hhuynh */ public class ListLocalStateTestApp extends GenericLocalStateTestApp { private List<List> root = new ArrayList<List>(); private Class[] listClasses = new Class[] { ArrayList.class, Vector.class, LinkedList.class, Stack.class }; public ListLocalStateTestApp(String appId, ApplicationConfig cfg, ListenerProvider listenerProvider) { super(appId, cfg, listenerProvider); } protected void runTest() throws Throwable { initTest(); for (LockMode lockMode : LockMode.values()) { for (List list : root) { testMutate(initList(list), lockMode, AddMutator.class); testMutate(initList(list), lockMode, AddAllMutator.class); testMutate(initList(list), lockMode, RemoveMutator.class); testMutate(initList(list), lockMode, ClearMutator.class); testMutate(initList(list), lockMode, RemoveAllMutator.class); testMutate(initList(list), lockMode, RetainAllMutator.class); testMutate(initList(list), lockMode, IteratorRemoveMutator.class); testMutate(initList(list), lockMode, IteratorAddMutator.class); testMutate(initList(list), lockMode, ListIteratorRemoveMutator.class); // failing - CDV-163 // testMutate2(initList(list), lockMode, AddAllNonPortableMutator.class); } } } private List initList(List l) { synchronized (l) { l.clear(); l.add("v1"); l.add("v2"); l.add("v3"); return l; } } private void initTest() throws Exception { synchronized (root) { for (Class c : listClasses) { root.add((List) c.newInstance()); } } } protected void validate(int before, int after, Object testTarget, LockMode lockMode, Class mutatorClass) throws Exception { switch (lockMode) { case NONE: case READ: Assert.assertEquals(testTarget, before, after); break; case WRITE: Assert.assertTrue(testTarget, before != after); break; default: throw new RuntimeException("Shouldn't happen"); } if (mutatorClass.equals(AddAllNonPortableMutator.class)) { for (Iterator it = ((List) testTarget).iterator(); it.hasNext();) { Object o = it.next(); Assert.assertFalse("Found NonPortable instance: " + testTarget, o instanceof NonPortable); } } } public static void visitL1DSOConfig(ConfigVisitor visitor, DSOClientConfigHelper config) { config.addModule(TIMUtil.COMMONS_COLLECTIONS_3_1, TIMUtil.getVersion(TIMUtil.COMMONS_COLLECTIONS_3_1)); String testClass = ListLocalStateTestApp.class.getName(); TransparencyClassSpec spec = config.getOrCreateSpec(testClass); config.addIncludePattern(testClass + "$*"); config.addIncludePattern(GenericLocalStateTestApp.class.getName() + "$*"); config.addExcludePattern(NonPortable.class.getName()); config.addWriteAutolock("* " + testClass + "*.initList(..)"); config.addWriteAutolock("* " + testClass + "*.initTest()"); config.addWriteAutolock("* " + testClass + "*.validate(..)"); config.addReadAutolock("* " + testClass + "*.runTest()"); spec.addRoot("root", "root"); config.addReadAutolock("* " + Handler.class.getName() + "*.invokeWithReadLock(..)"); config.addWriteAutolock("* " + Handler.class.getName() + "*.invokeWithWriteLock(..)"); config.addWriteAutolock("* " + Handler.class.getName() + "*.setLockMode(..)"); } static class AddMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; l.add("v4"); } } static class AddAllMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; List anotherList = new ArrayList(); anotherList.add("v"); l.addAll(anotherList); } } static class RemoveMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; l.remove("v1"); } } static class ClearMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; l.clear(); } } static class RemoveAllMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; List a = new ArrayList(); a.add("v1"); a.add("v2"); l.removeAll(a); } } static class RetainAllMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; List a = new ArrayList(); a.add("v1"); a.add("v2"); l.retainAll(a); } } static class IteratorRemoveMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; for (Iterator it = l.iterator(); it.hasNext();) { it.next(); it.remove(); } } } static class ListIteratorRemoveMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; for (ListIterator it = l.listIterator(); it.hasNext();) { it.next(); it.remove(); } } } static class IteratorAddMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; ListIterator it = l.listIterator(); it.add("v"); } } static class AddAllNonPortableMutator implements Mutator { public void doMutate(Object o) { List l = (List) o; List anotherList = new ArrayList(); anotherList.add("v4"); anotherList.add("v5"); anotherList.add(new NonPortable()); anotherList.add("v6"); l.addAll(anotherList); } } }
[ "hhuynh@7fc7bbf3-cf45-46d4-be06-341739edd864" ]
hhuynh@7fc7bbf3-cf45-46d4-be06-341739edd864
3b3cc0bdc6cb99c0cca6de3158bfa1f42b8a96c4
09e9721ca121d2593189667c222a4f930e471fb8
/Primary_Extension/src/main/java/org/lobobrowser/primary/screenshot/ScreenShootFrame.java
8bb1f41f3fb9a90fcd0270912e9e0bba64823765
[]
no_license
meetkumarpatel/Loboevolution
e89f822fed8b3fa24acc78f7582f602cc95a1272
4c587553bcd9885d7589ee7f867bf3e633733887
refs/heads/master
2020-12-29T00:25:54.817591
2016-08-02T11:15:00
2016-08-02T11:15:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,884
java
/* GNU GENERAL LICENSE Copyright (C) 2006 The Lobo Project. Copyright (C) 2014 - 2016 Lobo Evolution 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 verion 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General License for more details. You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Contact info: lobochief@users.sourceforge.net; ivan.difrancesco@yahoo.it */ package org.lobobrowser.primary.screenshot; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.logging.Logger; import javax.imageio.ImageIO; import javax.swing.AbstractAction; import javax.swing.Action; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.SwingUtilities; import javax.swing.filechooser.FileNameExtensionFilter; /** * The Class ScreenShootFrame. */ public class ScreenShootFrame extends JFrame { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** The image. */ private BufferedImage image; /** The Constant logger. */ private static final Logger logger = Logger.getLogger(ScreenShootFrame.class.getName()); public ScreenShootFrame(JPanel panelframe) { setTitle("Screenshot"); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); setPreferredSize(new Dimension(700, 600)); JMenuBar mb = new JMenuBar(); JMenu file = new JMenu("File"); file.add(saveAction); mb.add(file); setJMenuBar(mb); JFrame win = (JFrame) SwingUtilities.getWindowAncestor(panelframe); JPanel panel = new JPanel(); Dimension size = win.getSize(); image = (BufferedImage) win.createImage(size.width, size.height); Graphics g = image.getGraphics(); win.paint(g); ImageIcon pic = new ImageIcon(image); Image newimg = image.getScaledInstance(650, 500, Image.SCALE_SMOOTH); pic = new ImageIcon(newimg); panel.add(new JLabel(pic)); add(panel); revalidate(); repaint(); pack(); this.setVisible(true); } /** The save action. */ Action saveAction = new AbstractAction("Save") { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent evt) { JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); FileNameExtensionFilter filterjpg = new FileNameExtensionFilter("Joint Photographic Experts Group(.jpg)", ".jpg"); fileChooser.setFileFilter(filterjpg); fileChooser.setAcceptAllFileFilterUsed(true); int returnValue = fileChooser.showOpenDialog(ScreenShootFrame.this); if (returnValue == JFileChooser.APPROVE_OPTION) { File selectedFile = getSelectedFileWithExtension(fileChooser); if (selectedFile.exists()) { int response = JOptionPane.showConfirmDialog(null, "Overwrite existing file?", "Confirm Overwrite", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (response == JOptionPane.CANCEL_OPTION) { return; } } try { ImageIO.write(image, "jpg", new File(selectedFile.getAbsolutePath())); } catch (IOException e) { logger.severe(e.getMessage()); } } } }; /** * Returns the selected file from a JFileChooser, including the extension * from the file filter. * * @param c * the c * @return the selected file with extension */ private File getSelectedFileWithExtension(JFileChooser c) { File file = c.getSelectedFile(); if (c.getFileFilter() instanceof FileNameExtensionFilter) { String[] exts = ((FileNameExtensionFilter) c.getFileFilter()).getExtensions(); String nameLower = file.getName().toLowerCase(); for (String ext : exts) { // check if it already has a valid // extension if (nameLower.endsWith('.' + ext.toLowerCase())) { return file; // if yes, return as-is } } // if not, append the first extension from the selected filter file = new File(file.toString() + exts[0]); } return file; } }
[ "ivan.difrancesco@yahoo.it" ]
ivan.difrancesco@yahoo.it
27a75f45aa3840368f9920fda3e7ec03985787f5
a0df441ca8c96ce9e15c5854f6d37cf9689a47a6
/src/main/java/vol1/chap12/sec04/RadioButtonFrame.java
f1499ef6e888103657f75c008d8033882e7bace4
[]
no_license
goodwinn11/core-java
a5901c7a730e4edb66129c5d676e3e3463bd0639
513871fbaa2068bd7efc60fa74b536b54945b352
refs/heads/master
2022-11-29T16:20:16.604318
2020-08-14T00:42:16
2020-08-14T00:42:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,644
java
/* * Chapter 12 User Interface Components * Section 4 Choice Components - Radio Buttons */ package vol1.chap12.sec04; import java.awt.*; import java.awt.event.*; import javax.swing.*; /** * A frame with a sample radio buttons for selecting a font * @author emaphis */ public class RadioButtonFrame extends JFrame { private JPanel buttonPanel; private JLabel label; private ButtonGroup group; private JCheckBox italic; private static final int DEFAULT_SIZE = 36; public RadioButtonFrame() { // add the sample text label label = new JLabel("The quick brown fox jumps over the lazy dog."); label.setFont(new Font("Serif", Font.PLAIN, DEFAULT_SIZE)); add(label, BorderLayout.CENTER); // Add the check boxes group = new ButtonGroup(); buttonPanel = new JPanel(); addRadioButton("Small", 8); addRadioButton("Medium", 12); addRadioButton("Large", 18); addRadioButton("Extra large", 35); add(buttonPanel, BorderLayout.SOUTH); pack(); } /** * Add a radio button that sets the font size of the sample text. * @param name the string to appear on the button * @param size the font size this button sets */ public void addRadioButton(String name, int size) { boolean selected = (size == DEFAULT_SIZE); var button = new JRadioButton(name, selected); group.add(button); buttonPanel.add(button); // this listener set the label font size ActionListener listener = event -> label.setFont(new Font("Serif", Font.PLAIN, size)); button.addActionListener(listener); } }
[ "emaphis85@gmail.com" ]
emaphis85@gmail.com
d7a0d2fda7f04920d334c92fa7fa76d55bfed009
42b563221106a13c7dbbda2cfafeb5b12bf162ec
/app/src/main/java/com/blankj/androidutilcode/feature/core/permission/PermissionActivity.java
c9b810f479ba5c0d13ddd58f6db375bfc890ad6e
[ "Apache-2.0" ]
permissive
Forevas/AndroidUtilCode
40cd2bfb423ee743adca7768fa62f23207b51470
d5b898bd434b0e80c27e8de8a1457c96367965df
refs/heads/master
2021-01-22T23:10:14.201645
2018-01-18T07:19:32
2018-01-18T07:19:32
65,339,368
0
0
Apache-2.0
2018-01-18T07:23:39
2016-08-10T01:11:38
Java
UTF-8
Java
false
false
5,728
java
package com.blankj.androidutilcode.feature.core.permission; import android.Manifest; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.TextView; import com.blankj.androidutilcode.R; import com.blankj.androidutilcode.base.BaseBackActivity; import com.blankj.androidutilcode.helper.DialogHelper; import com.blankj.utilcode.constant.PermissionConstants; import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.PermissionUtils; import com.blankj.utilcode.util.ScreenUtils; import com.blankj.utilcode.util.SpanUtils; import java.util.List; /** * <pre> * author: Blankj * blog : http://blankj.com * time : 2018/01/01 * desc : Permission 工具类 Demo * </pre> */ public class PermissionActivity extends BaseBackActivity { TextView tvAboutPermission; String permissions; public static void start(Context context) { Intent starter = new Intent(context, PermissionActivity.class); context.startActivity(starter); } @Override public void initData(Bundle bundle) { } @Override public int bindLayout() { return R.layout.activity_permission; } @Override public void initView(Bundle savedInstanceState, View view) { getToolBar().setTitle(getString(R.string.demo_permission)); tvAboutPermission = findViewById(R.id.tv_about_permission); findViewById(R.id.btn_open_app_settings).setOnClickListener(this); findViewById(R.id.btn_request_calendar).setOnClickListener(this); findViewById(R.id.btn_request_record_audio).setOnClickListener(this); StringBuilder sb = new StringBuilder(); for (String s : PermissionUtils.getPermissions()) { sb.append(s.substring(s.lastIndexOf('.') + 1)).append("\n"); } permissions = sb.toString(); } @Override protected void onResume() { super.onResume(); updateAboutPermission(); } @Override public void doBusiness() { } @Override public void onWidgetClick(View view) { switch (view.getId()) { case R.id.btn_open_app_settings: PermissionUtils.openAppSettings(); break; case R.id.btn_request_calendar: PermissionUtils.permission(PermissionConstants.CALENDAR) .rationale(new PermissionUtils.OnRationaleListener() { @Override public void rationale(final ShouldRequest shouldRequest) { DialogHelper.showRationaleDialog(shouldRequest); } }) .callback(new PermissionUtils.FullCallback() { @Override public void onGranted(List<String> permissionsGranted) { updateAboutPermission(); } @Override public void onDenied(List<String> permissionsDeniedForever, List<String> permissionsDenied) { if (!permissionsDeniedForever.isEmpty()) { DialogHelper.showOpenAppSettingDialog(); } LogUtils.d(permissionsDeniedForever, permissionsDenied); } }) .theme(new PermissionUtils.ThemeCallback() { @Override public void onActivityCreate(Activity activity) { ScreenUtils.setFullScreen(activity); } }) .request(); break; case R.id.btn_request_record_audio: PermissionUtils.permission(PermissionConstants.MICROPHONE) .rationale(new PermissionUtils.OnRationaleListener() { @Override public void rationale(final ShouldRequest shouldRequest) { DialogHelper.showRationaleDialog(shouldRequest); } }) .callback(new PermissionUtils.FullCallback() { @Override public void onGranted(List<String> permissionsGranted) { updateAboutPermission(); } @Override public void onDenied(List<String> permissionsDeniedForever, List<String> permissionsDenied) { if (!permissionsDeniedForever.isEmpty()) { DialogHelper.showOpenAppSettingDialog(); } LogUtils.d(permissionsDeniedForever, permissionsDenied); } }) .request(); break; } } private void updateAboutPermission() { tvAboutPermission.setText(new SpanUtils() .append(permissions).setBold() .appendLine("READ_CALENDAR: " + PermissionUtils.isGranted(Manifest.permission.READ_CALENDAR)) .appendLine("RECORD_AUDIO: " + PermissionUtils.isGranted(Manifest.permission.RECORD_AUDIO)) .create()); } }
[ "625783482@qq.com" ]
625783482@qq.com
76c151d7214876c02a7fbc506f710509ef298fd2
37b958267a8a3bdafb2f30f3f279717155b00333
/src/main/java/com/fjd/wechat/WeChatCmd.java
6966dfb35ba326d42891161452bcbe8194301602
[]
no_license
fanjingdan012/sns
065258d40b3b0661383c1b97d1585c402060123c
3a19f7e1046483ef6d612916d6cc255bb841ef80
refs/heads/master
2023-04-22T13:37:49.018881
2021-05-07T07:31:54
2021-05-07T07:31:54
365,150,504
0
0
null
null
null
null
UTF-8
Java
false
false
1,829
java
package com.fjd.wechat; import com.fjd.cli.SocialCmd; import com.fjd.pinterest.PinterestClientServiceImpl; import com.fjd.social.BareBonesBrowserLaunch; import com.fjd.social.CmtClient; import com.fjd.wechat.WeChatClientServiceImpl; import java.io.IOException; public class WeChatCmd implements SocialCmd { private static String appId = ""; private static String appSecret = ""; private static String redirectUri = ""; private static String proxyHost = ""; private static String proxyPort = ""; @Override public String validateAccessToken(String accessToken) throws IOException { WeChatClientServiceImpl wcs = new WeChatClientServiceImpl(); String status = "no function now";//wcs.searchUserWork("a", accessToken); System.out.println("is working:" + status); return status; } @Override public String getAccessToken(String code) { try { WeChatClientServiceImpl pcs = new WeChatClientServiceImpl(); String accessToken = pcs.getAccessToken(appId,appSecret); // Date time = new Date(expireTime); System.out.println("accessToken:" + accessToken); return accessToken; } catch (Exception e) { System.out.println("Excpetion" + e.getMessage()); e.printStackTrace(); return null; } } public WeChatCmd(CmtClient cfgBundle) { appId = cfgBundle.getGlobalSettings("Global.WeChat.AppId"); appSecret = cfgBundle.getGlobalSettings("Global.WeChat.AppSecret"); redirectUri = cfgBundle.getGlobalSettings("Global.WeChat.redirectUrl"); proxyHost = cfgBundle.getGlobalSettings("proxyHost"); proxyPort = cfgBundle.getGlobalSettings("proxyPort"); } @Override public void getCode() { } }
[ "judy.fan@sap.com" ]
judy.fan@sap.com
3a28ff78acdb4b4d7cf1f43bb268a374a8bc6915
17c30fed606a8b1c8f07f3befbef6ccc78288299
/P9_8_0_0/src/main/java/com/android/server/security/trustcircle/tlv/command/auth/CMD_AUTH_SLAVE_RECV_KEY.java
ba45dfcd8acb79667278181d32edf60c280c0033
[]
no_license
EggUncle/HwFrameWorkSource
4e67f1b832a2f68f5eaae065c90215777b8633a7
162e751d0952ca13548f700aad987852b969a4ad
refs/heads/master
2020-04-06T14:29:22.781911
2018-11-09T05:05:03
2018-11-09T05:05:03
157,543,151
1
0
null
2018-11-14T12:08:01
2018-11-14T12:08:01
null
UTF-8
Java
false
false
1,042
java
package com.android.server.security.trustcircle.tlv.command.auth; import com.android.server.security.trustcircle.tlv.core.TLVNumberInvoker.TLVLongInvoker; import com.android.server.security.trustcircle.tlv.core.TLVTree.TLVRootTree; import com.android.server.security.trustcircle.tlv.core.TLVTreeInvoker.TLVChildTreeInvoker; import java.util.Vector; public class CMD_AUTH_SLAVE_RECV_KEY extends TLVRootTree { public static final int ID = 12; public static final short TAG_AUTH_ID = (short) 6656; public static final short TAG_CMD_AUTH_SLAVE_RECV_KEY = (short) 26; public TLVLongInvoker authID; public TLVChildTreeInvoker cert; public CMD_AUTH_SLAVE_RECV_KEY() { this.authID = new TLVLongInvoker((short) 6656); this.cert = new TLVChildTreeInvoker(3842); this.mNodeList = new Vector(); this.mNodeList.add(this.authID); this.mNodeList.add(this.cert); } public int getCmdID() { return 12; } public short getTreeTag() { return (short) 26; } }
[ "lygforbs0@mail.com" ]
lygforbs0@mail.com
b5fe45d490670e03d65ba8cd9645e23f41e399f8
c284a9705e55828d3707bb06702eac3ceadf3237
/src/main/java/com/baidu/beidou/api/external/cprogroup/vo/request/AddTradePriceRequest.java
37183301f1a136ab94f1eb2e85bb99a1b30d0b89
[]
no_license
pologood/beidou-api
06efa59ba5443084eb107b423683844973aca1c9
05d0d7440b92f577c45c0530cb397e2e2fcd8bfd
refs/heads/master
2021-01-19T09:37:40.873104
2017-04-04T03:53:51
2017-04-04T03:53:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
955
java
package com.baidu.beidou.api.external.cprogroup.vo.request; import org.apache.commons.lang.ArrayUtils; import com.baidu.beidou.api.external.cprogroup.vo.GroupTradePriceType; import com.baidu.beidou.api.external.util.constant.ApiConstant; import com.baidu.beidou.api.external.util.request.ApiRequest; /** * * ClassName: AddTradePriceRequest <br> * Function: 添加分行业出价请求头 * * @author zhangxu * @date Jun 3, 2012 */ public class AddTradePriceRequest implements ApiRequest { private GroupTradePriceType[] tradePrices; public int getDataSize() { int result = ApiConstant.REQUEST_DEFAULT_DATA_SIZE; if (!ArrayUtils.isEmpty(tradePrices)) { result = tradePrices.length; } return result; } public GroupTradePriceType[] getTradePrices() { return tradePrices; } public void setTradePrices(GroupTradePriceType[] tradePrices) { this.tradePrices = tradePrices; } }
[ "berryjamcoding@gmail.com" ]
berryjamcoding@gmail.com
62e3ba1bdbae92f6e9737217cbb0728544304d4f
e20f608607c4f922a186bf8b245f6a2c2ee314d8
/src/zeprs/org/rti/zcore/utils/database/DatabaseCompatability.java
7d511a9389aa74d34634f0d3d1e136f7cf5c1af4
[ "Apache-2.0" ]
permissive
rashaatef/zeprs
cb6292f99f81a60d9637a9621f580af5a9d79c98
6ea42325332aab8a331b7683df042b7360b87991
refs/heads/master
2020-05-18T13:46:45.858449
2014-11-04T14:32:06
2014-11-04T14:32:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,507
java
package org.rti.zcore.utils.database; import java.util.ArrayList; import org.cidrz.webapp.dynasite.Constants; /** * Enables cross-database compatibility * @author ckelley * @date Feb 9, 2010 */ public class DatabaseCompatability { /** * Assembles a concat string for SQL statements based on different db's implementation of concatenation. * @param items * @param functionName - mysql only - CONCAT or CONCAT_SW. CONCAT if null. * @param databaseType * @param separator - MySQL CONCAT_WS take a separator string. * @return */ public static String concat(ArrayList<String> items, String functionName, String databaseType, String separator) { String results = null; String concatOperator = ""; String functionOpen = ""; String functionClose = ""; if (databaseType == null) { databaseType = Constants.DATABASE_TYPE; } if (databaseType.equals("derby")) { functionName = ""; concatOperator = "||"; functionOpen = ""; functionClose = ""; } else if (databaseType.equals("mysql")) { if (functionName == null) { functionName = "CONCAT"; } concatOperator = ","; functionOpen = "("; functionClose = ")"; } else if (databaseType.equals("mssql")) { if (functionName == null) { functionName = ""; } concatOperator = "+"; functionOpen = ""; functionClose = ""; } int i=0; results = functionName.concat(functionOpen); if (separator != null) { results = results.concat(separator).concat(concatOperator); } for (String item : items) { i++; results = results.concat(item); if (i < items.size()) { results = results.concat(concatOperator); } } results = results.concat(functionClose); return results; } /** * Concats strings * @param functionName - mysql only - CONCAT or CONCAT_SW. CONCAT if null. * @param databaseType null if you want to use default value from Constants * @param separator TODO * @param args * @return */ public static String concat(String functionName, String databaseType, String separator, String... args) { String results = null; ArrayList<String> items = new ArrayList<String>(); for(String arg:args) { items.add(arg); } results = DatabaseCompatability.concat(items, functionName, databaseType, null); return results; } /** * Creates string for ageCalc used in patient search on home page. Calculated the difference between the current date and the datefield. * @param dateField birth date field * @return age in years. */ public static String ageCalc(String dateField) { String results = null; if (dateField == null) { dateField = "pr.birth_date"; } if (Constants.DATABASE_TYPE.equals("derby")) { results = "integer(floor({fn TIMESTAMPDIFF(SQL_TSI_YEAR, " + dateField + ", CURRENT_DATE)}))"; } else if (Constants.DATABASE_TYPE.equals("mysql")) { results = "integer(floor({fn TIMESTAMPDIFF(SQL_TSI_YEAR, " + dateField + ", CURRENT_DATE)}))"; } else if (Constants.DATABASE_TYPE.equals("mssql")) { results = "floor(DATEDIFF(YEAR, " + dateField + ", GETDATE()))"; } return results; } /** * Appends time string to a date string. ISO 8601 formatting for mssql. * @param value * @return */ public static String fixDateValues(String value) { String results = null; if (Constants.DATABASE_TYPE.equals("derby")) { results = value.concat(" 00:00:00"); } else if (Constants.DATABASE_TYPE.equals("mysql")) { results = value.concat(" 00:00:00"); } else if (Constants.DATABASE_TYPE.equals("mssql")) { // ISO 8601 formatting. results = value.concat("T00:00:00"); } return results; } /** * Creates last autogenerated identity string. * @param databaseType TODO * * @return */ public static String insertLastIdentityString(String databaseType) { String results = null; if (databaseType.equals("derby")) { results = "IDENTITY_VAL_LOCAL()"; } else if (databaseType.equals("mysql")) { results = "LAST_INSERT_ID()"; } else if (databaseType.equals("mssql")) { //results = "?"; results = "SCOPE_IDENTITY() AS [IDENTITY]()"; } return results; } /** * Creates select statement to find last identity string created by the database. * @param databaseType * @param tableName - if databaseType == mssql, specify tableName if you want table-level granularity. * @return */ public static String selectLastIdentityString(String databaseType, String tableName) { String results = null; if (databaseType.equals("derby")) { results = "VALUES " + insertLastIdentityString(databaseType); } else if (databaseType.equals("mysql")) { results = "SELECT " + insertLastIdentityString(databaseType); } else if (databaseType.equals("mssql")) { if (tableName != null) { results = "SELECT IDENT_CURRENT('" + tableName + "')"; } else { results = "SELECT " + insertLastIdentityString(databaseType); } } return results; } /** * Adds different permutations of "Select id " statement for use when generating pager sql * @param database * @param tableName TODO * @param orderBy * @return */ public static String insertPagerSelect(String database, String maxRows, String tableName) { String results = null; if (tableName != null) { if (database.equals("derby")) { results = "SELECT " + tableName + ".id, "; } else if (database.equals("mysql")) { results = "SELECT " + tableName + ".id, "; } else if (database.equals("mssql")) { // SELECT TOP " + maxRows + " results = "id, "; } } else { if (database.equals("derby")) { results = "SELECT id, "; } else if (database.equals("mysql")) { results = "SELECT id, "; } else if (database.equals("mssql")) { // SELECT TOP " + maxRows + " results = "id, "; } } return results; } /** * Used for generating pager sql * @param database * @param orderBy * @return */ public static String insertPagerFrom(String database, String orderBy) { String results = null; if (database.equals("derby")) { results = ""; } else if (database.equals("mysql")) { results = ""; } else if (database.equals("mssql")) { // "FROM (SELECT ROW_NUMBER() OVER (ORDER BY u.updated DESC) AS Row," results = " FROM (SELECT ROW_NUMBER() OVER (ORDER BY " + orderBy + ") AS Row, "; } return results; } /** * Used for generating pager sql * @param database * @param orderBy * @return */ public static String insertPagerEnd(String database, String orderBy, Integer offset, Integer maxRows) { String results = null; if (database.equals("derby")) { // ORDER BY id asc OFFSET " + offset + " ROWS FETCH NEXT " + maxRows + " ROWS ONLY" results = " ORDER BY " + orderBy + " OFFSET " + offset + " ROWS FETCH NEXT " + maxRows + " ROWS ONLY"; } else if (database.equals("mysql")) { // results = " ORDER BY " + orderBy + " OFFSET " + offset + " ROWS FETCH NEXT " + maxRows + " ROWS ONLY"; results = " ORDER BY " + orderBy + " LIMIT " + maxRows + " OFFSET " + offset; } else if (database.equals("mssql")) { // ") AS LogWithRowNumbers WHERE Row >= " + offset + " AND Row <= " + (offset + maxRows) results = ") AS LogWithRowNumbers WHERE Row >= " + offset + " AND Row <= " + maxRows; } return results; } }
[ "chris@vetula.com" ]
chris@vetula.com
9300261ae1a10155b31deb18d0e43b5ec22b4d07
3d28124f3c614d73c39c552efcf3fdd013a30b15
/wwe/modules/exploits/OffHandCrash.java
c139a0f4bcf11298b50c8b257daf96550e1f4a37
[]
no_license
WarriorCrystal/WWE-Deobf-Source-Leak
ac5caff81e96cf1d15e53c7f62f4af20053682df
660a29c3a32a7753299cc8edadf83c109369da1c
refs/heads/master
2022-03-25T08:29:40.333788
2019-11-29T01:09:59
2019-11-29T01:09:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,068
java
package wwe.modules.exploits; import wwe.modules.*; import wwe.utils.*; import net.minecraft.network.play.client.*; import net.minecraft.util.*; import net.minecraft.network.*; import net.minecraft.init.*; import net.minecraft.network.play.server.*; import wwe.*; public class OffHandCrash extends qMIe { public BooleanValue doCrash; public BooleanValue antiCrash; public NumberValue speed; public OffHandCrash() { super("Off Hand Crash", "Prevent and or do the off hand crash exploit", 0, Category.EXPLOITS); } @Override public void HrDr() { this.doCrash = new BooleanValue("Do Crash", this, "Switchs item from your off hand really fast, some times crashing players in render distance or crashing the server", false); this.antiCrash = new BooleanValue("Anti Crash", this, "Doesnt allow them to crash your game/lower your fps", true); this.speed = new NumberValue("Speed", this, "How many times it will switch hands, a tick", 500.0, 1.0, 2000.0); } @oqrr public void Wgpx(final omqH omqH) { if (this.doCrash.OnGi()) { int n = 0; while (n < this.speed.OnGi()) { Wrapper.mc.player.connection.sendPacket((Packet)new CPacketPlayerDigging(CPacketPlayerDigging.Action.SWAP_HELD_ITEMS, Wrapper.mc.player.getPosition(), EnumFacing.UP)); ++n; } } } @oqrr public void DwMG(final LqJY lqJY) { if (this.antiCrash.OnGi()) { if (lqJY.MYlK() instanceof SPacketSoundEffect && ((SPacketSoundEffect)lqJY.MYlK()).getSound() == SoundEvents.ITEM_ARMOR_EQUIP_GENERIC) { lqJY.Ggez(true); } if (lqJY.MYlK() instanceof SPacketCustomSound && ((SPacketCustomSound)lqJY.MYlK()).getSoundName().equals("item.armor.equip_generic")) { lqJY.Ggez(true); } } } @Override public void LPxx() { hSNE.lyvR(this); } @Override public void qBmy() { hSNE.kduK(this); } }
[ "57571957+RIPBackdoored@users.noreply.github.com" ]
57571957+RIPBackdoored@users.noreply.github.com
29dc393677ecf0e02f0ec3364af7738a3678126e
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/18/18_ebac57649d21a3776bc293bf64e43fa6661342af/WavResourceImpl/18_ebac57649d21a3776bc293bf64e43fa6661342af_WavResourceImpl_s.java
40c2ccab216892c023e45ce226946f81548b242b
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,167
java
/** * Copyright (c) 2009-2011 SKRATCHDOT.COM * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * http://www.eclipse.org/legal/epl-v10.html * * Initial modeling finished using information provided by: * http://www.sonicspot.com/guide/wavefiles.html * * Contributors: * JEFF |:at:| SKRATCHDOT |:dot:| COM * * $Id$ */ package com.skratchdot.riff.wav.util; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.ByteOrder; import java.util.Map; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.impl.ResourceImpl; import com.skratchdot.riff.wav.RIFFWave; import com.skratchdot.riff.wav.WavFactory; /** * <!-- begin-user-doc --> * The <b>Resource </b> associated with the package. * <!-- end-user-doc --> * @see com.skratchdot.riff.wav.util.WavResourceFactoryImpl * @generated */ public class WavResourceImpl extends ResourceImpl { /** * Creates an instance of the resource. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param uri the URI of the new resource. * @generated */ public WavResourceImpl(URI uri) { super(uri); } @Override protected void doLoad(InputStream inputStream, Map<?, ?> options) throws IOException { try { ExtendedByteBuffer buf = new ExtendedByteBuffer(WavUtil.inputStreamToByteArray(inputStream)); buf.order(ByteOrder.LITTLE_ENDIAN); RIFFWave riffWave = WavFactory.eINSTANCE.createRIFFWave(); riffWave.init(buf); this.getContents().add(riffWave); } catch (Exception e) { e.printStackTrace(); throw new IOException(e); } } @Override protected void doSave(OutputStream outputStream, Map<?, ?> options) throws IOException { try { RIFFWave riffWave = (RIFFWave) this.getContents().get(0); outputStream.write(riffWave.toByteArray()); } catch (Exception e) { e.printStackTrace(); throw new IOException(e); } } } //WavResourceImpl
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
28461fe7daed5025d752723b9a38ae0a4593c77b
46946342fed948e9f65e22328d14c8f13b857ae1
/mapsdk/src/main/java/com/unistrong/api/mapcore/LocationViewDecode.java
9198b3a06513fcedaec905ef35a2d890dbc22f7d
[]
no_license
UersNOer/AllInLinkApp
a1805816198d12e9d491c8f8af1a58fcc091c4ff
1a75da52e53921060a934bdb653d29708cb1d87d
refs/heads/master
2023-07-09T22:48:05.180754
2021-08-13T06:59:17
2021-08-13T06:59:17
394,186,337
2
0
null
2021-08-13T06:59:18
2021-08-09T07:04:41
Java
UTF-8
Java
false
false
4,270
java
package com.unistrong.api.mapcore; import android.content.Context; import android.graphics.Bitmap; import android.location.Location; import android.view.MotionEvent; import android.view.View; import android.widget.ImageView; import android.widget.LinearLayout; import com.unistrong.api.mapcore.util.Util; import com.unistrong.api.mapcore.util.SDKLogHandler; import com.unistrong.api.maps.model.LatLng; class LocationViewDecode extends LinearLayout { Bitmap a; Bitmap b; Bitmap c; Bitmap d; Bitmap e; Bitmap f; ImageView g; IMapDelegate h; public void a() { try { if (this.a != null) { this.a.recycle(); } if (this.b != null) { this.b.recycle(); } if (this.b != null) { this.c.recycle(); } this.a = null; this.b = null; this.c = null; if (this.d != null) { this.d.recycle(); this.d = null; } if (this.e != null) { this.e.recycle(); this.e = null; } if (this.f != null) { this.f.recycle(); this.f = null; } } catch (Throwable localThrowable) { SDKLogHandler.exception(localThrowable, "LocationView", "destroy"); localThrowable.printStackTrace(); } } public LocationViewDecode(Context paramContext) { super(paramContext); } public LocationViewDecode(Context paramContext, MapMessageQueueDecode paramau, IMapDelegate paramaa) { super(paramContext); this.h = paramaa; initBitmap(); this.g = new ImageView(paramContext); this.g.setImageBitmap(this.a); this.g.setClickable(true); this.g.setPadding(0, 20, 20, 0); this.g.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View paramAnonymousView, MotionEvent paramAnonymousMotionEvent) { if (!LocationViewDecode.this.i) { return false; } if (paramAnonymousMotionEvent.getAction() == MotionEvent.ACTION_DOWN) { LocationViewDecode.this.g.setImageBitmap(LocationViewDecode.this.b); } else if (paramAnonymousMotionEvent.getAction() == MotionEvent.ACTION_UP) { try { LocationViewDecode.this.g.setImageBitmap(LocationViewDecode.this.a); Location localLocation = LocationViewDecode.this.h.getMyLocation(); if (localLocation == null) { return false; } LatLng localLatLng = new LatLng(localLocation.getLatitude(), localLocation.getLongitude()); LocationViewDecode.this.h.showMyLocationOverlay(localLocation); LocationViewDecode.this.h.moveCamera( CameraUpdateFactoryDelegate.a(localLatLng, LocationViewDecode.this.h.getZoomLevel())); } catch (Throwable localThrowable) { SDKLogHandler.exception(localThrowable, "LocationView", "onTouch"); localThrowable.printStackTrace(); } } return false; } }); addView(this.g); } boolean i = false; private void initBitmap(){ try { this.d = Util.fromAsset(getContext(), "map_location_button_selected.png"); this.a = Util.zoomBitmap(this.d, ConfigableConstDecode.Resolution); this.e = Util.fromAsset(getContext(), "map_location_button_pressed.png"); this.b = Util.zoomBitmap(this.e, ConfigableConstDecode.Resolution); this.f = Util.fromAsset(getContext(), "map_location_button_unselected.png"); this.c = Util.zoomBitmap(this.f, ConfigableConstDecode.Resolution); } catch (Throwable localThrowable) { SDKLogHandler.exception(localThrowable, "LocationView", "create"); localThrowable.printStackTrace(); } } public void setLocstionViewBitmap(Bitmap selectedBitmap,Bitmap pressedBitmap){ if(selectedBitmap!=null&&pressedBitmap!=null){ this.a=selectedBitmap; this.b=pressedBitmap; }else{ initBitmap(); } this.g.setImageBitmap(this.a); } public void showSelect(boolean paramBoolean) // a { this.i = paramBoolean; if (paramBoolean) { this.g.setImageBitmap(this.a); } else { this.g.setImageBitmap(this.c); } this.g.invalidate(); } }
[ "782647832@qq.com" ]
782647832@qq.com
7ef93aa50013a4e8e432ae2e30011de6ec2a2d3a
d36b9ff8b62708f939ca535490b0ed6239324dad
/zd-hft-ctp-order/src/main/java/com/zd/engine/event/ZdEventDynamicHandler.java
48c9b1652a174fc0ece4c6c4af8856dedb23aa31
[]
no_license
userKarl/stratagy-trader
c02b5be3b9b5101a7f61761546ddc7cd45b2e6a3
fed2000fb2c994c5172c7ec3e31b3651eb2e1d31
refs/heads/master
2020-03-26T08:36:15.391928
2018-09-13T11:32:14
2018-09-13T11:32:14
144,710,668
3
7
null
null
null
null
UTF-8
Java
false
false
410
java
package com.zd.engine.event; import java.util.Set; import com.lmax.disruptor.EventHandler; import com.lmax.disruptor.LifecycleAware; public interface ZdEventDynamicHandler<T> extends EventHandler<T>, LifecycleAware { void awaitShutdown() throws InterruptedException; public Set<String> getSubscribedEventSet(); public void subscribeEvent(String event); public void unsubscribeEvent(String event); }
[ "yanglin-163.-com@163.com" ]
yanglin-163.-com@163.com
a949ec4568b9c9ceab46274c6a7f8c47c70d844a
e5223eaac7735e378f48009e05df7e4964fbe630
/XML processing/09-xml-demo-exercise/src/main/java/com/example/demo/cardealer/domain/enitity/Customer.java
9d64d9c088b2c0c6e078f677c140cec78e799ada
[]
no_license
GerganaL/spring-data-softuni
fb8e3e67fe43d5db363cd35be69e9c86d4beced5
a4428859bb6ed031a5be3d5baad80ecc3ae72c16
refs/heads/master
2023-04-22T00:58:53.023802
2021-05-11T12:57:25
2021-05-11T12:57:25
362,418,289
1
0
null
null
null
null
UTF-8
Java
false
false
1,124
java
package com.example.demo.cardealer.domain.enitity; import javax.persistence.*; import java.time.LocalDateTime; import java.util.Set; @Entity @Table(name = "customers") public class Customer extends BaseEntity { private String name; private LocalDateTime birthDate; private boolean isYoungDriver; private Set<Sale> sales; public Customer() { } public String getName() { return name; } public void setName(String name) { this.name = name; } @Column(name = "birth_date") public LocalDateTime getBirthDate() { return birthDate; } public void setBirthDate(LocalDateTime birthDate) { this.birthDate = birthDate; } @Column (name = "is_young_driver") public boolean isYoungDriver() { return isYoungDriver; } public void setYoungDriver(boolean youngDriver) { isYoungDriver = youngDriver; } @OneToMany(mappedBy = "customer",fetch = FetchType.EAGER) public Set<Sale> getSales() { return sales; } public void setSales(Set<Sale> sales) { this.sales = sales; } }
[ "lulchevagergana@gmail.com" ]
lulchevagergana@gmail.com
0ceca3bddff2303446b5bef289b121a3ca7e386a
590cebae4483121569983808da1f91563254efed
/Services/eps-services/ForEais1/eps-services-src/utils/src/main/java/ru/acs/fts/eps2/ws/utils/helpers/DocumentProcessor.java
374fd3d1dcfa9a9bb461820bfd6bb53746c4478f
[]
no_license
ke-kontur/eps
8b00f9c7a5f92edeaac2f04146bf0676a3a78e27
7f0580cd82022d36d99fb846c4025e5950b0c103
refs/heads/master
2020-05-16T23:53:03.163443
2014-11-26T07:00:34
2014-11-26T07:01:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,960
java
package ru.acs.fts.eps2.ws.utils.helpers; import java.io.IOException; import java.io.StringReader; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpression; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.InputSource; import org.xml.sax.SAXException; public class DocumentProcessor { public static String getDocumentID( Document doc ) throws XPathExpressionException { XPathFactory xfq = XPathFactory.newInstance( ); XPath xpath = xfq.newXPath( ); XPathExpression expr = xpath.compile( "//*[local-name()='DocumentID']" ); Node res = ( Node )expr.evaluate( doc.getDocumentElement( ), XPathConstants.NODE ); if ( null == res ) return "<unknown>"; return res.getTextContent( ); } public static List< Element > getInnerDocuments( Document doc, String xPath ) throws XPathExpressionException { XPathFactory xfq = XPathFactory.newInstance( ); XPath xpath = xfq.newXPath( ); XPathExpression expr = xpath.compile( xPath ); NodeList inners = ( NodeList )expr.evaluate( doc.getDocumentElement( ), XPathConstants.NODESET ); List< Element > res = new ArrayList< Element >( ); for ( int i = 0; i < inners.getLength( ); ++i ) { Node inner = inners.item( i ); if ( ! ( inner instanceof Element ) ) continue; Element el = ( Element )inner; NodeList possibleDocs = el.getChildNodes( ); for ( int j = 0; j < possibleDocs.getLength( ); ++j ) { Node possibleDoc = possibleDocs.item( j ); if ( ! ( possibleDoc instanceof Element ) ) continue; res.add( ( Element )possibleDoc ); break; } } return res; } // utility private static DocumentBuilderFactory _domFactory = null; public static String unpackFromBase64( String base64 ) throws UnsupportedEncodingException { return Base64Coder.decode( base64, "UTF-8" ); } public static String packToBase64( String doc ) throws UnsupportedEncodingException { return Base64Coder.encodeAsString( doc, "UTF-8" ); } public static DocumentBuilder getDocumentBuilder( ) throws ParserConfigurationException { if ( null == _domFactory ) { _domFactory = DocumentBuilderFactory.newInstance( ); _domFactory.setNamespaceAware( true ); } return _domFactory.newDocumentBuilder( ); } public static Document parse( String xml ) throws SAXException, IOException, ParserConfigurationException { DocumentBuilder bld = getDocumentBuilder( ); return bld.parse( new InputSource( new StringReader( xml ) ) ); } }
[ "m@brel.me" ]
m@brel.me
00d8c64087ec0bcfa015fc2b4be0e7e312215a86
1919757c4107e88ffffbc650cd047976d2d5d9db
/thread/src/test/java/com/study/thread/juc/semaphore/SemaphoreTest2.java
c5d3499aaf18a5d030c773e71e51398c2e72e176
[]
no_license
xxzotk/java8
df4f59369e3e4676dfe6ec770bd483a06bc0509b
8b9b73e325bb90d682e15a464ce03d1eb3a580f6
refs/heads/master
2020-04-13T10:41:50.692616
2018-08-29T16:03:29
2018-08-29T16:03:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,070
java
package com.study.thread.juc.semaphore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; /** * $$ * <p> * 计数信号量。 * 从概念上讲,信号量维护一组许可。如果有必要,每个get()块直到许可证可用,然后取它。 * 每个release()都添加一个许可证,可能释放一个阻塞的收购者。但没有实际使用许可证对象;信号量只是保持可用数量的计数,并采取相应的行动。 * <p> * 信号量通常用于限制线程数量,而不能访问某些(物理或逻辑)资源。 * * @author donggua * @version 1.0 * @create 2018/8/26 */ public class SemaphoreTest2 { public static final Logger LOGGER = LoggerFactory.getLogger(SemaphoreTest2.class); public static void main(String[] args) { Semaphore semaphore = new Semaphore(2); for (int i = 0; i < 2; i++) { new Thread(() -> { LOGGER.info(Thread.currentThread().getName() + "running"); try { /** * 从这个信号量获得许可,阻塞直到一个信号量可用,或者线程被中断。 * * 获得许可证,如果有许可证,立即返回,可获得许可证的数量减少1。 * * 如果没有许可证可用,那么当前线程将为线程调度目的而被禁用并处于休眠状态,直到发生以下两种情况之一: * 1. 其他一些线程调用这个信号量的release()方法,当前线程将被分配一个许可证; * 2. 其他一些线程中断当前线程。 * * 如果当前线程: * 1. 在进入此方法时设置其中断状态; * 2. 在等待许可时被打断 * * 然后抛出InterruptedException,清除当前线程的中断状态。 */ semaphore.acquire(2); LOGGER.info(Thread.currentThread().getName() + "get #semaphore lock ."); TimeUnit.SECONDS.sleep(6); } catch (InterruptedException e) { e.printStackTrace(); } finally { /** * 释放许可证,将其返回到信号量。 * * 发布许可证,增加一个可用许可证的数量。如果有任何线程试图获得许可证,那么将选择一个线程并给予刚刚发布的许可证。该线程为线程调度目的而启用。 * * 没有要求释放许可证的线程必须通过调用acquire()获得该许可证。在应用程序中,通过编程约定确定信号量的正确用法。 * */ semaphore.release(2); LOGGER.info(Thread.currentThread().getName() + "released . "); } }, "T" + i).start(); } // 监控 while (true){ /** * 返回此信号量中可用的许可证的当前数量。 * * 这种方法通常用于调试和测试目的。 */ LOGGER.info("AP -> " + semaphore.availablePermits()); /** * 返回等待获取的线程数量的估计值。这个值只是一个估计值,因为当这个方法遍历内部数据结构时,线程的数量可能会动态变化。 * 该方法用于系统状态的监控,而不是同步控制。 */ LOGGER.info("QL -> " + semaphore.getQueueLength()); System.out.println("========================================="); try { TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } } } }
[ "liudongdong0909@yeah.net" ]
liudongdong0909@yeah.net
5716ba6696869737f4ce84ea50d8c2c89ac0a067
de3c2d89f623527b35cc5dd936773f32946025d2
/src/main/java/com/bytedance/sdk/p145a/p146a/Timeout.java
2833dfb375cad4b9c78d169d4be7d25ed063940c
[]
no_license
ren19890419/lvxing
5f89f7b118df59fd1da06aaba43bd9b41b5da1e6
239875461cb39e58183ac54e93565ec5f7f28ddb
refs/heads/master
2023-04-15T08:56:25.048806
2020-06-05T10:46:05
2020-06-05T10:46:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,403
java
package com.bytedance.sdk.p145a.p146a; import java.io.IOException; import java.io.InterruptedIOException; import java.util.concurrent.TimeUnit; /* renamed from: com.bytedance.sdk.a.a.t */ public class Timeout { /* renamed from: c */ public static final Timeout f5286c = new Timeout() { /* renamed from: a */ public Timeout mo13609a(long j) { return this; } /* renamed from: a */ public Timeout mo13610a(long j, TimeUnit timeUnit) { return this; } /* renamed from: g */ public void mo13614g() throws IOException { } }; /* renamed from: a */ private boolean f5287a; /* renamed from: b */ private long f5288b; /* renamed from: d */ private long f5289d; /* renamed from: a */ public Timeout mo13610a(long j, TimeUnit timeUnit) { if (j < 0) { StringBuilder sb = new StringBuilder(); sb.append("timeout < 0: "); sb.append(j); throw new IllegalArgumentException(sb.toString()); } else if (timeUnit != null) { this.f5289d = timeUnit.toNanos(j); return this; } else { throw new IllegalArgumentException("unit == null"); } } /* renamed from: j_ */ public long mo13615j_() { return this.f5289d; } /* renamed from: k_ */ public boolean mo13616k_() { return this.f5287a; } /* renamed from: d */ public long mo13611d() { if (this.f5287a) { return this.f5288b; } throw new IllegalStateException("No deadline"); } /* renamed from: a */ public Timeout mo13609a(long j) { this.f5287a = true; this.f5288b = j; return this; } /* renamed from: e */ public Timeout mo13612e() { this.f5289d = 0; return this; } /* renamed from: f */ public Timeout mo13613f() { this.f5287a = false; return this; } /* renamed from: g */ public void mo13614g() throws IOException { if (Thread.interrupted()) { Thread.currentThread().interrupt(); throw new InterruptedIOException("interrupted"); } else if (this.f5287a && this.f5288b - System.nanoTime() <= 0) { throw new InterruptedIOException("deadline reached"); } } }
[ "593746220@qq.com" ]
593746220@qq.com
dac6a9b66d25dd52baa1b13315859d7d7ee11421
fa7e89fe2e7ea936ff2634e3c9adf1a6aaf1ad29
/jaxb/extract-data-v2/ch/admin/geo/schemas/v_d/oereb/_1_0/extractdata/WebReference.java
63e9ce80da733a86bf82593c3923893e9c4cc9b1
[ "MIT" ]
permissive
edigonzales-archiv/oereb-rahmenmodell-tests
b3da73e3f74536b97a132325e78cf05d887924d6
292adf552f37bc82d4164b7746884b998fdccc7e
refs/heads/master
2021-09-07T06:09:57.471579
2018-02-18T14:38:22
2018-02-18T14:38:22
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,687
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2017.12.16 at 01:25:39 PM CET // package ch.admin.geo.schemas.v_d.oereb._1_0.extractdata; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; /** * <p>Java class for WebReference complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="WebReference"> * &lt;simpleContent> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>anyURI"> * &lt;/extension> * &lt;/simpleContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "WebReference", propOrder = { "value" }) public class WebReference { @XmlValue @XmlSchemaType(name = "anyURI") protected String value; /** * Gets the value of the value property. * * @return * possible object is * {@link String } * */ public String getValue() { return value; } /** * Sets the value of the value property. * * @param value * allowed object is * {@link String } * */ public void setValue(String value) { this.value = value; } }
[ "edi.gonzales@gmail.com" ]
edi.gonzales@gmail.com
a8266e0a4016d2c49ec724a6c8b303d0103fd988
fb80d88d8cdc81d0f4975af5b1bfb39d194e0d97
/Character_Equipment_Impl/src/net/sf/anathema/character/equipment/impl/character/model/RegisteredNaturalWeapon.java
57e333c05ed0b4e6b25f2b7b63706b48e95b58b3
[]
no_license
mindnsoul2003/Raksha
b2f61d96b59a14e9dfb4ae279fc483b624713b2e
2533cdbb448ee25ff355f826bc1f97cabedfdafe
refs/heads/master
2021-01-17T16:43:35.551343
2014-02-19T19:28:43
2014-02-19T19:28:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
433
java
package net.sf.anathema.character.equipment.impl.character.model; import net.sf.anathema.character.generic.type.CharacterType; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) public @interface RegisteredNaturalWeapon { CharacterType characterType(); }
[ "ursreupke@gmail.com" ]
ursreupke@gmail.com
8a38e9410eef425702b22a4100371deef831c60f
7331916b27061162655e4dd0c2314669ca6d47af
/examples/kickstart/src/java/com/kickstart/Routes.java
0913fc058dc3db703f81c562a0bf3279040eb3dc
[ "Apache-2.0" ]
permissive
chriskchew/RestExpress
732464a67981912531be4c28019449fcaec67f55
989ecc7e09d8b7425c64bc5a193be871e7cc8adc
refs/heads/master
2021-01-17T23:12:32.145650
2011-04-08T19:05:32
2011-04-08T19:05:32
1,507,149
0
0
null
null
null
null
UTF-8
Java
false
false
1,115
java
package com.kickstart; import org.jboss.netty.handler.codec.http.HttpMethod; import com.kickstart.service.KickStartController; import com.strategicgains.restexpress.route.RouteDeclaration; /** * @author toddf * @since May 21, 2010 */ public class Routes extends RouteDeclaration { private KickStartController controller; public Routes() { super(); this.controller = new KickStartController(); } @Override protected void defineRoutes() { // Maps /kickstart uri with optional format ('json' or 'xml'), accepting // POST HTTP method only. Calls KickStartService.create(Request, Reply). uri("/kickstart.{format}", controller) .method(HttpMethod.POST); // Maps /kickstart uri with required orderId and optional format identifier // to the KickStartService. Accepts only GET, PUT, DELETE HTTP methods. // Names this route to allow returning links from read resources in // KickStartService methods via call to LinkUtils.asLinks(). uri("/kickstart/{orderId}.{format}", controller) .method(HttpMethod.GET, HttpMethod.PUT, HttpMethod.DELETE) .name("KickstartOrderUri"); } }
[ "tfredrich@gmail.com" ]
tfredrich@gmail.com
5d3ee09b54f1fb169820ec17999ea822b3e46488
18ecbf7653c8d762fe343fa26d6c44408620c7ea
/c-common/src/main/java/com/cloudwebsoft/framework/template/Token.java
e1024216c0348ba225945f4907b700e62975396b
[]
no_license
cloudwebsoft/ywoa
7ef667de489006a71f697f962a0bac2aa1eec57d
9aee0a5a206e8f5448ba70e14ec429470ba524d7
refs/heads/oa_git6.0
2022-07-28T21:17:06.523669
2021-07-15T00:16:12
2021-07-15T00:16:12
181,577,992
33
10
null
2021-06-15T13:44:46
2019-04-15T23:07:47
Java
UTF-8
Java
false
false
965
java
package com.cloudwebsoft.framework.template; import com.cloudwebsoft.framework.template.plugin.PluginMgr; import java.util.List; /** * <p>Title: 模板解析器中的辅助标签</p> * * <p>Description: </p> * * <p>Copyright: Copyright (c) 2005</p> * * <p>Company: </p> * * @author not attributable * @version 1.0 */ public class Token { public static final int NONE = 0; public static final int VAR = 1; // 变量 public static final int BEGIN = 2; public static final int FIELD = 3; public static final int END = 4; public static final int hasVar = 10; public Token() { } public void setName(String name) { this.name = name; } public void setType(int type) { this.type = type; } public String getName() { return name; } public int getType() { return type; } public String name; public int type = NONE; public List posPairs = null; }
[ "bestfeng@163.com" ]
bestfeng@163.com
fe2bdb1d3b4c6a1853fa4b8a13c1301e2a56f2bf
bccb412254b3e6f35a5c4dd227f440ecbbb60db9
/hl7/model/V2_6/table/Table0868.java
3b867ef7bee14f47e5be07466f2972c73676449c
[]
no_license
nlp-lap/Version_Compatible_HL7_Parser
8bdb307aa75a5317265f730c5b2ac92ae430962b
9977e1fcd1400916efc4aa161588beae81900cfd
refs/heads/master
2021-03-03T15:05:36.071491
2020-03-09T07:54:42
2020-03-09T07:54:42
245,967,680
0
0
null
null
null
null
UTF-8
Java
false
false
698
java
package hl7.model.V2_6.table; import hl7.bean.table.Table; public class Table0868 extends Table{ private static final String VERSION = "2.6"; public static Table getInstance(){ if(table==null) new Table0868(); return table; } public static final String C = "C"; public static final String E = "E"; public static final String M = "M"; public static final String N = "N"; public static final String R = "R"; private Table0868(){ setTableName("Telecommunication expiration reason"); setOID("2.16.840.1.113883.12.868"); putMap("C", "Corrected"); putMap("E", "Added in error"); putMap("M", "Moved"); putMap("N", "No longer in service"); putMap("R", "On request"); } }
[ "terminator800@hanmail.net" ]
terminator800@hanmail.net
ed627a630600aec7260702bedf52533e75308e5d
3f6059749e1f50bec9a39987cd38e7c6aa307bbb
/fv_log4j1x/src/main/java/com/tongyu/log4j/ext/MyDailyRollingFileAppender.java
3d1e0a47fa298534c15b6397424cdd0c5ce6fc1f
[]
no_license
tyyx1228/study_all
7cc7f011322d4b01d14241294034e8a3d72d4e31
f8f808805e52cc9bd47e6105cfb8c60b743d3245
refs/heads/master
2020-03-21T04:40:23.489780
2018-07-31T06:57:20
2018-07-31T06:57:20
138,121,691
0
0
null
null
null
null
UTF-8
Java
false
false
406
java
package com.tongyu.log4j.ext; import org.apache.log4j.DailyRollingFileAppender; import org.apache.log4j.Layout; import org.apache.log4j.Priority; public class MyDailyRollingFileAppender extends DailyRollingFileAppender { @Override public boolean isAsSevereAsThreshold(Priority priority) { return getThreshold().equals(priority); } @Override public void setLayout(Layout layout) { } }
[ "347616185@qq.com" ]
347616185@qq.com
806e0fed54776f52b2b741d72fe91cb2265aa1a4
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module51/src/main/java/module51packageJava0/Foo84.java
accdae645ab49b992f7734892e387ef9b8117665
[ "Apache-2.0" ]
permissive
uber-common/android-build-eval
448bfe141b6911ad8a99268378c75217d431766f
7723bfd0b9b1056892cef1fef02314b435b086f2
refs/heads/master
2023-02-18T22:25:15.121902
2023-02-06T19:35:34
2023-02-06T19:35:34
294,831,672
83
7
Apache-2.0
2021-09-24T08:55:30
2020-09-11T23:27:37
Java
UTF-8
Java
false
false
370
java
package module51packageJava0; import java.lang.Integer; public class Foo84 { Integer int0; public void foo0() { new module51packageJava0.Foo83().foo5(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } public void foo4() { foo3(); } public void foo5() { foo4(); } }
[ "oliviern@uber.com" ]
oliviern@uber.com
0dad3b7fe3d2dcccb6b551c85c7c770edf168ae0
eca4a253fe0eba19f60d28363b10c433c57ab7a1
/apps/jacob.caretaker/java/jacob/model/Faplisaxis.java
a9cdef76736d76eae9ba5af461fa6b5ebd83022f
[]
no_license
freegroup/Open-jACOB
632f20575092516f449591bf6f251772f599e5fc
84f0a6af83876bd21c453132ca6f98a46609f1f4
refs/heads/master
2021-01-10T11:08:03.604819
2015-05-25T10:25:49
2015-05-25T10:25:49
36,183,560
0
0
null
null
null
null
ISO-8859-3
Java
false
false
1,859
java
/************************************************************************** * Project : jacob.caretaker * Date : Sun Jun 08 15:42:20 CEST 2008 * * THIS IS A GENERATED FILE - DO NOT CHANGE! * *************************************************************************/ package jacob.model; public final class Faplisaxis { private Faplisaxis(){} // the name of the table alias public final static String NAME = "faplisaxis"; // All field names of the table alias "faplisaxis" /** required: true<br> type: TEXT<br> */ public final static String pkey = "pkey"; /** required: true<br> type: TEXT<br> */ public final static String name = "name"; /** required: true<br> type: ENUM<br> */ public final static String faplisstatus = "faplisstatus"; /** required: true<br> type: TEXT<br> */ public final static String buildingpart_key = "buildingpart_key"; /** required: true<br> type: INTEGER<br> */ public final static String sequence = "sequence"; /** required: true<br> type: ENUM<br> */ public final static String axistype = "axistype"; /** required: true<br> type: TEXT<br> */ public final static String shortname = "shortname"; public final static class faplisstatus_ENUM { private faplisstatus_ENUM(){}; public final static String _ungueltig = "ungültig"; public final static String _gueltig = "gültig"; } public final static class axistype_ENUM { private axistype_ENUM(){}; public final static String _B = "B"; public final static String _Z = "Z"; } }
[ "a.herz@freegroup.de" ]
a.herz@freegroup.de
9d143478ade8bd84b4b2f9ab686e79fce369ee72
c885ef92397be9d54b87741f01557f61d3f794f3
/results/Math-6/org.apache.commons.math3.optim.BaseOptimizer/BBC-F0-opt-80/tests/27/org/apache/commons/math3/optim/BaseOptimizer_ESTest.java
36a3cdc3ef52719305d1bc36dc94cda7597ba482
[ "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
4,182
java
/* * This file was automatically generated by EvoSuite * Sat Oct 23 14:39:12 GMT 2021 */ package org.apache.commons.math3.optim; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.apache.commons.math3.optim.MaxEval; import org.apache.commons.math3.optim.MaxIter; import org.apache.commons.math3.optim.OptimizationData; import org.apache.commons.math3.optim.univariate.BrentOptimizer; import org.apache.commons.math3.optim.univariate.MultiStartUnivariateOptimizer; import org.apache.commons.math3.random.RandomGenerator; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class BaseOptimizer_ESTest extends BaseOptimizer_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { BrentOptimizer brentOptimizer0 = new BrentOptimizer(632.1640033139164, 632.1640033139164); MultiStartUnivariateOptimizer multiStartUnivariateOptimizer0 = new MultiStartUnivariateOptimizer(brentOptimizer0, 2033, (RandomGenerator) null); OptimizationData[] optimizationDataArray0 = new OptimizationData[2]; MaxIter maxIter0 = MaxIter.unlimited(); optimizationDataArray0[0] = (OptimizationData) maxIter0; // Undeclared exception! try { multiStartUnivariateOptimizer0.optimize(optimizationDataArray0); fail("Expecting exception: IllegalStateException"); } catch(IllegalStateException e) { // // illegal state // verifyException("org.apache.commons.math3.optim.univariate.MultiStartUnivariateOptimizer", e); } } @Test(timeout = 4000) public void test1() throws Throwable { BrentOptimizer brentOptimizer0 = new BrentOptimizer(632.1640033139164, 632.1640033139164); OptimizationData[] optimizationDataArray0 = new OptimizationData[6]; MaxEval maxEval0 = new MaxEval(5); optimizationDataArray0[2] = (OptimizationData) maxEval0; // Undeclared exception! try { brentOptimizer0.optimize(optimizationDataArray0); fail("Expecting exception: NullPointerException"); } catch(NullPointerException e) { // // no message in exception (getMessage() returned null) // verifyException("org.apache.commons.math3.optim.univariate.UnivariateOptimizer", e); } } @Test(timeout = 4000) public void test2() throws Throwable { BrentOptimizer brentOptimizer0 = new BrentOptimizer(632.1640033139164, 632.1640033139164); int int0 = brentOptimizer0.getMaxEvaluations(); assertEquals(0, int0); } @Test(timeout = 4000) public void test3() throws Throwable { BrentOptimizer brentOptimizer0 = new BrentOptimizer(632.1640033139164, 632.1640033139164); OptimizationData[] optimizationDataArray0 = new OptimizationData[1]; try { brentOptimizer0.optimize(optimizationDataArray0); fail("Expecting exception: IllegalStateException"); } catch(IllegalStateException e) { // // illegal state: maximal count (0) exceeded: evaluations // verifyException("org.apache.commons.math3.optim.BaseOptimizer$MaxEvalCallback", e); } } @Test(timeout = 4000) public void test4() throws Throwable { BrentOptimizer brentOptimizer0 = new BrentOptimizer(632.1640033139164, 632.1640033139164); int int0 = brentOptimizer0.getMaxIterations(); assertEquals(0, int0); } @Test(timeout = 4000) public void test5() throws Throwable { BrentOptimizer brentOptimizer0 = new BrentOptimizer(453.440854, 453.440854); int int0 = brentOptimizer0.getEvaluations(); assertEquals(0, int0); } @Test(timeout = 4000) public void test6() throws Throwable { BrentOptimizer brentOptimizer0 = new BrentOptimizer(453.440854, 453.440854); int int0 = brentOptimizer0.getIterations(); assertEquals(0, int0); } }
[ "pderakhshanfar@serg2.ewi.tudelft.nl" ]
pderakhshanfar@serg2.ewi.tudelft.nl
1cc631761baebc8698471cae5d710e2ff907976b
4627d514d6664526f58fbe3cac830a54679749cd
/results/evosuite5/lang-org.apache.commons.lang3.text.translate.CharSequenceTranslator-16/org/apache/commons/lang3/text/translate/CharSequenceTranslator_ESTest.java
ee210280446d6a55b8a61284eca2e7647bcb3f71
[]
no_license
STAMP-project/Cling-application
c624175a4aa24bb9b29b53f9b84c42a0f18631bd
0ff4d7652b434cbfd9be8d8bb38cfc8d8eaa51b5
refs/heads/master
2022-07-27T09:30:16.423362
2022-07-19T12:01:46
2022-07-19T12:01:46
254,310,667
2
2
null
2021-07-12T12:29:50
2020-04-09T08:11:35
null
UTF-8
Java
false
false
2,968
java
/* * This file was automatically generated by EvoSuite * Tue Aug 13 16:16:11 GMT 2019 */ package org.apache.commons.lang3.text.translate; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import java.io.StringWriter; import java.io.Writer; import java.nio.CharBuffer; import org.apache.commons.lang3.text.translate.CharSequenceTranslator; import org.apache.commons.lang3.text.translate.NumericEntityEscaper; import org.apache.commons.lang3.text.translate.NumericEntityUnescaper; import org.apache.commons.lang3.text.translate.UnicodeEscaper; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false, useJEE = true) public class CharSequenceTranslator_ESTest extends CharSequenceTranslator_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { UnicodeEscaper unicodeEscaper0 = UnicodeEscaper.below((-1503)); StringWriter stringWriter0 = new StringWriter(877); unicodeEscaper0.translate((CharSequence) "FFFFFA21", (Writer) stringWriter0); } @Test(timeout = 4000) public void test1() throws Throwable { StringWriter stringWriter0 = new StringWriter(0); NumericEntityUnescaper numericEntityUnescaper0 = new NumericEntityUnescaper(); numericEntityUnescaper0.translate((CharSequence) null, (Writer) stringWriter0); } @Test(timeout = 4000) public void test2() throws Throwable { NumericEntityEscaper numericEntityEscaper0 = NumericEntityEscaper.below(877); // Undeclared exception! try { numericEntityEscaper0.translate((CharSequence) "FFFFFA21", (Writer) null); fail("Expecting exception: IllegalArgumentException"); } catch(IllegalArgumentException e) { // // The Writer must not be null // verifyException("org.apache.commons.lang3.text.translate.CharSequenceTranslator", e); } } @Test(timeout = 4000) public void test3() throws Throwable { NumericEntityUnescaper numericEntityUnescaper0 = new NumericEntityUnescaper(); numericEntityUnescaper0.translate((CharSequence) null); } @Test(timeout = 4000) public void test4() throws Throwable { UnicodeEscaper unicodeEscaper0 = new UnicodeEscaper(); CharSequenceTranslator[] charSequenceTranslatorArray0 = new CharSequenceTranslator[4]; unicodeEscaper0.with(charSequenceTranslatorArray0); } @Test(timeout = 4000) public void test5() throws Throwable { UnicodeEscaper unicodeEscaper0 = UnicodeEscaper.outsideOf(4855, 4855); CharBuffer charBuffer0 = CharBuffer.allocate(4855); String string0 = unicodeEscaper0.translate((CharSequence) charBuffer0); assertNotNull(string0); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
4bbdf99e13d51110510703449f9c1e6658d055ee
43ea6b8fd54f76e49f6e8ed8ec443336cf7db8ac
/uva/UVa12463_LittleNephew.java
8a2736357635164a417d2917ce8cb84e72d57578
[]
no_license
mirzainayat92/competitive-programming
68f6c0a5a10cf8d8f14040a385e22e53d03beb70
2d737fb6f69256f62ea5454888f5687f1814ea7b
refs/heads/master
2020-12-22T20:45:48.789657
2018-03-15T03:52:48
2018-03-15T03:52:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
824
java
package uva; /* USER: 46724 (sfmunera) */ /* PROBLEM: 3906 (12463 - Little Nephew) */ /* SUBMISSION: 10187124 */ /* SUBMISSION TIME: 2012-06-03 19:05:10 */ /* LANGUAGE: 2 */ import java.io.*; public class UVa12463_LittleNephew { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while (true) { String[] parts = in.readLine().split("[ ]+"); int a = Integer.parseInt(parts[0]); int b = Integer.parseInt(parts[1]); int c = Integer.parseInt(parts[2]); int d = Integer.parseInt(parts[3]); int e = Integer.parseInt(parts[4]); if (a == 0 && b == 0 && c == 0 && d == 0 && e == 0) break; System.out.println(a * b * c * d * d * e * e); } in.close(); System.exit(0); } }
[ "sfmunera@gmail.com" ]
sfmunera@gmail.com
b4adb8e5deba169c125201cef185d0a897532817
696f10437e34124d525e4893cd5fe28bd4c312a1
/pgql-lang/src/test/java/oracle/pgql/lang/completions/ExpressionCompletionsTest.java
c61383440e20a9050d0f9930a2fe236dce2c9fda
[ "Apache-2.0", "UPL-1.0" ]
permissive
CPWstatic/pgql-lang
5cfc0b0b712a3b8c1dec4f7d3cc3b2c5e60e0777
506a4ca64e9d7b02caa6fe48155d6d555a798cda
refs/heads/master
2021-01-03T19:33:40.221769
2020-02-05T23:44:14
2020-02-05T23:44:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,431
java
/* * Copyright (C) 2013 - 2019 Oracle and/or its affiliates. All rights reserved. */ package oracle.pgql.lang.completions; import static oracle.pgql.lang.completion.PgqlCompletionGenerator.EMPTY_STRING_COMPLETION; import static oracle.pgql.lang.completion.PgqlCompletionGenerator.aggregations; import static oracle.pgql.lang.completion.PgqlCompletionGenerator.completion; import static oracle.pgql.lang.completion.PgqlCompletionGenerator.completions; import static oracle.pgql.lang.completion.PgqlCompletionGenerator.functions; import static oracle.pgql.lang.completion.PgqlCompletionGenerator.otherExpressions; import java.util.ArrayList; import java.util.List; import org.junit.Test; import oracle.pgql.lang.editor.completion.PgqlCompletion; public class ExpressionCompletionsTest extends AbstractCompletionsTest { private List<PgqlCompletion> expressions() { List<PgqlCompletion> expected = completions(// completion("n", "vertex"), // completion("m", "vertex"), // completion("e", "edge")); expected.addAll(functions()); expected.addAll(aggregations()); expected.addAll(otherExpressions()); return expected; } private List<PgqlCompletion> expressionsExceptAggregations() { List<PgqlCompletion> expected = completions(// completion("n", "vertex"), // completion("m", "vertex"), // completion("e", "edge")); expected.addAll(functions()); expected.addAll(otherExpressions()); return expected; } private List<PgqlCompletion> expressionsExceptVariables() { List<PgqlCompletion> expected = functions(); expected.addAll(aggregations()); expected.addAll(otherExpressions()); return expected; } @Test public void emptySelect1() throws Exception { String query = "SELECT ??? FROM g MATCH (n) -[e]-> (m) WHERE n"; List<PgqlCompletion> expected = expressions(); check(query, expected); } @Test public void emptySelect2() throws Exception { String query = "SELECT ??? MATCH (n) -[e]-> (m) WHERE n"; List<PgqlCompletion> expected = expressionsExceptVariables(); // ultimately, it would suggest vertices and edges here too, // but the parser's error recovery isn't working for this case check(query, expected); } @Test public void nonEmptySelect() throws Exception { String query = "SELECT n.name, ??? MATCH (n) -[e]-> (m) WHERE n"; List<PgqlCompletion> expected = expressions(); check(query, expected); } @Test public void emptyWhere() throws Exception { String query = "SELECT n.name MATCH (n) -[e]-> (m) WHERE ???"; List<PgqlCompletion> expected = expressionsExceptAggregations(); check(query, expected); } @Test public void emptyGroupBy() throws Exception { String query = "SELECT n.name MATCH (n) -[e]-> (m) GROUP BY ???"; List<PgqlCompletion> expected = expressionsExceptAggregations(); check(query, expected); } @Test public void nonEmptyGroupBy() throws Exception { String query = "SELECT n.name MATCH (n) -[e]-> (m) GROUP BY n, ???"; List<PgqlCompletion> expected = expressionsExceptAggregations(); check(query, expected); } @Test public void emptyOrderBy() throws Exception { String query = "SELECT n.name MATCH (n) -[e]-> (m) ORDER BY ???"; List<PgqlCompletion> expected = expressions(); check(query, expected); } @Test public void nonEmptyOrderBy() throws Exception { String query = "SELECT n.name MATCH (n) -[e]-> (m) ORDER BY n.name, ???"; List<PgqlCompletion> expected = expressions(); check(query, expected); } @Test public void emptyAggregation1() throws Exception { String query = "SELECT MIN(???) MATCH (n) -[e]-> (m)"; List<PgqlCompletion> expected = expressionsExceptAggregations(); check(query, expected); } @Test public void emptyAggregation2() throws Exception { String query = "SELECT AVG(n.age) MATCH (n) -[e]-> (m) GROUP BY n.name ORDER BY COUNT(???)"; List<PgqlCompletion> expected = expressionsExceptAggregations(); check(query, expected); } @Test public void emptyString() throws Exception { List<PgqlCompletion> expected = new ArrayList<>(); expected.add(EMPTY_STRING_COMPLETION); String query = ""; check(query, expected); query = " "; check(query, expected); query = "\t"; check(query, expected); query = "\n"; check(query, expected); } }
[ "oskar.van.rest@oracle.com" ]
oskar.van.rest@oracle.com
a674dbefc357aa7ba7687cccbd161ef5bbd27ac9
dd3eec242deb434f76d26b4dc0e3c9509c951ce7
/2018-work/jiuy-biz/jiuy-biz-common/src/main/java/com/jiuy/core/ext/enumeration/EnumCache.java
cc7a45b47cd4df0d70a7f1dc32d7470c51db162a
[]
no_license
github4n/other_workplace
1091e6368abc51153b4c7ebbb3742c35fb6a0f4a
7c07e0d078518bb70399e50b35e9f9ca859ba2df
refs/heads/master
2020-05-31T10:12:37.160922
2019-05-25T15:48:54
2019-05-25T15:48:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,039
java
package com.jiuy.core.ext.enumeration; import java.util.EnumSet; import java.util.HashMap; import java.util.concurrent.ConcurrentHashMap; public class EnumCache { private static final ConcurrentHashMap<Class<?>, HashMap<String, Enum<?>>> cache = new ConcurrentHashMap<Class<?>, HashMap<String, Enum<?>>>(); public static <E extends Enum<E>> E getEnumValue(Class<E> enumClass, String value) { HashMap<String, Enum<?>> lookup = cache.get(enumClass); if (lookup == null) { lookup = new HashMap<String, Enum<?>>(); EnumSet<E> enumValues = EnumSet.allOf(enumClass); for (E enumValue : enumValues) { lookup.put(enumValue.name(), enumValue); } HashMap<String, Enum<?>> oldLookup = cache.putIfAbsent(enumClass, lookup); if(oldLookup != null) { lookup = oldLookup; } } @SuppressWarnings("unchecked") E enumValue = (E) lookup.get(value); return enumValue; } }
[ "nessary@foxmail.com" ]
nessary@foxmail.com
2e90816fb7c0052a0dec5365d31b64e87ee4a6ba
f766baf255197dd4c1561ae6858a67ad23dcda68
/app/src/main/java/com/tencent/liteav/network/a.java
0e989e5dbd1761483f5b751faba6e0aa88456d3c
[]
no_license
jianghan200/wxsrc6.6.7
d83f3fbbb77235c7f2c8bc945fa3f09d9bac3849
eb6c56587cfca596f8c7095b0854cbbc78254178
refs/heads/master
2020-03-19T23:40:49.532494
2018-06-12T06:00:50
2018-06-12T06:00:50
137,015,278
4
2
null
null
null
null
UTF-8
Java
false
false
347
java
package com.tencent.liteav.network; class a { public String a; public String b; public boolean c; public int d; } /* Location: /Users/Han/Desktop/wxall/微信反编译/反编译 6.6.7/dex2jar-2.0/classes5-dex2jar.jar!/com/tencent/liteav/network/a.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "526687570@qq.com" ]
526687570@qq.com
0ac5ebf5305a5821376f77333a07ca080259b76c
1cc41aef9bd36b7ff3245faac79adb569c65a0cf
/java/pebble/src/net/sourceforge/pebble/webservice/PebbleAPIHandler.java
a2340d2c640279b71e3625459dd1db944f5253f7
[]
no_license
seungbeomi/development
fca4d350b31fefd56a9517bcc8c49ea39d6af19e
11c1c6c9f2ec522ce9e90808e1b0876eff5039df
refs/heads/master
2023-03-10T17:57:07.819034
2022-02-16T15:18:39
2022-02-16T15:18:39
1,160,501
2
3
null
2023-03-07T09:08:19
2010-12-12T08:10:56
Java
UTF-8
Java
false
false
6,114
java
/* * Copyright (c) 2003-2006, Simon Brown * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * - Neither the name of Pebble nor the names of its contributors may * be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ package net.sourceforge.pebble.webservice; import java.util.Collection; import java.util.Hashtable; import java.util.Iterator; import java.util.Vector; import net.sourceforge.pebble.api.decorator.ContentDecoratorContext; import net.sourceforge.pebble.domain.Blog; import net.sourceforge.pebble.domain.BlogEntry; import net.sourceforge.pebble.domain.Category; import net.sourceforge.pebble.domain.Tag; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.xmlrpc.XmlRpcException; /** * A handler for the Pebble API (accessed via XML-RPC). * * @author Simon Brown */ public class PebbleAPIHandler extends AbstractAPIHandler { public static final String ID = "id"; public static final String UUID = "uuid"; public static final String DATE = "date"; public static final String AUTHOR = "author"; public static final String TITLE = "title"; public static final String SUBTITLE = "subtitle"; public static final String EXCERPT = "excerpt"; public static final String BODY = "body"; public static final String PERMALINK = "permalink"; public static final String CATEGORIES = "categories"; public static final String TAGS = "tags"; public static final String ATTACHMENT = "attachment"; public static final String ATTACHMENT_URL = "attachment.url"; public static final String ATTACHMENT_SIZE = "attachment.size"; public static final String ATTACHMENT_TYPE = "attachment.type"; /** the log used by this class */ private static Log log = LogFactory.getLog(PebbleAPIHandler.class); /** * Gets a list of the recent blog entries. * * @param blogid the ID of the blog (ignored) * @param username the username used for logging in via XML-RPC * @param password the password used for logging in via XML-RPC * @param numberOfPosts the number of posts to get * @return a Vector of Hashtables (an array of structs) representing blog entries * @throws org.apache.xmlrpc.XmlRpcException if something goes wrong, including an authentication error */ public Vector getRecentBlogEntries(String blogid, String username, String password, int numberOfPosts) throws XmlRpcException { log.debug("pebble.getRecentBlogEntries(" + blogid + ", " + username + ", " + "********)"); Blog blog = getBlogWithBlogId(blogid); authenticate(blog, username, password); Vector posts = new Vector(); Collection coll = blog.getRecentPublishedBlogEntries(numberOfPosts); Iterator it = coll.iterator(); BlogEntry entry; while (it.hasNext()) { entry = (BlogEntry)it.next(); posts.add(adaptBlogEntry(entry)); } return posts; } /** * Helper method to adapt a blog entry into an XML-RPC compatible struct. * * @param entry the BlogEntry to adapt * @return a Hashtable representing the major properties of the entry */ private Hashtable adaptBlogEntry(BlogEntry entry) { // first apply decorators - we don't want to go out naked :-) ContentDecoratorContext context = new ContentDecoratorContext(); context.setView(ContentDecoratorContext.DETAIL_VIEW); context.setMedia(ContentDecoratorContext.XML_RPC); entry.getBlog().getContentDecoratorChain().decorate(context, entry); Hashtable post = new Hashtable(); post.put(TITLE, entry.getTitle()); post.put(SUBTITLE, entry.getSubtitle()); post.put(PERMALINK, entry.getPermalink()); post.put(EXCERPT, entry.getExcerpt()); post.put(BODY, entry.getBody()); post.put(DATE, entry.getDate()); post.put(AUTHOR, entry.getAuthor()); post.put(ID, entry.getId()); post.put(UUID, formatPostId(entry.getBlog().getId(), entry.getId())); Vector categories = new Vector(); Iterator it = entry.getCategories().iterator(); while (it.hasNext()) { Category cat = (Category)it.next(); categories.add(cat.getId()); } post.put(CATEGORIES, categories); Vector tags = new Vector(); it = entry.getTagsAsList().iterator(); while (it.hasNext()) { Tag tag = (Tag)it.next(); tags.add(tag.getName()); } post.put(TAGS, tags); if (entry.getAttachment() != null) { Hashtable attachment = new Hashtable(); attachment.put(ATTACHMENT_URL, entry.getAttachment().getUrl()); attachment.put(ATTACHMENT_SIZE, entry.getAttachment().getSize()); attachment.put(ATTACHMENT_TYPE, entry.getAttachment().getType()); post.put(ATTACHMENT, attachment); } return post; } }
[ "seungbeomi@gmail.com" ]
seungbeomi@gmail.com
bf351ad5d41a0f2a69440fde11e15680cf05c9fb
c40efb977101232d91e99af0b78778bad3e0950a
/game_server/src/com/hifun/soul/gameserver/legionboss/msg/CGChargedLegionBossWar.java
8e25d4b3ba5b38041d40f7494fbbec1094e721b3
[]
no_license
cietwwl/server
2bca79a17be6d5e6fee65e57d0df1fc753fb35e3
d18804f8c182eaa2509666aec10a2212ababc13c
refs/heads/master
2020-06-14T15:12:16.679591
2014-11-19T14:48:04
2014-11-19T14:48:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
699
java
package com.hifun.soul.gameserver.legionboss.msg; import org.springframework.stereotype.Component; import com.hifun.soul.core.msg.MessageType; import com.hifun.soul.gameserver.common.msg.CGMessage; /** * 充能 * * @author SevenSoul */ @Component public class CGChargedLegionBossWar extends CGMessage{ public CGChargedLegionBossWar (){ } @Override protected boolean readImpl() { return true; } @Override protected boolean writeImpl() { return true; } @Override public short getType() { return MessageType.CG_CHARGED_LEGION_BOSS_WAR; } @Override public String getTypeName() { return "CG_CHARGED_LEGION_BOSS_WAR"; } @Override public void execute() { } }
[ "magicstoneljg@163.com" ]
magicstoneljg@163.com
3f0b83d15fdd0a13e6ab17740170448be174b4fd
2aba05173b9955eccdf6c9000057e8d0aff051fc
/PROY-ETAPA2/GRUPO03/Trabajo8/Ejemplo6/src/Numero6/Ejemplo6.java
62ffb1338d88efaa4c9bf766aa9403bb2e038875
[]
no_license
gcoronelc/UCV_PROG-OO_2017-2
eaf995035769629098eb882ed0ac18e29543a5e9
5f82395819e1703e4a5fcf213f26158825d04d6d
refs/heads/master
2021-01-20T10:47:56.480839
2017-12-13T13:15:05
2017-12-13T13:15:05
101,648,320
1
1
null
null
null
null
UTF-8
Java
false
false
725
java
package Numero6; public class Ejemplo6 { // El sangrado sera de un tabulador // Es suficiente entre 2 y 4 Lineas // Si una linea tiene mas d 90 caracteres se divide ///en mas lineas: con una coma(,) // la nueva linea debera alinearse con un sangrado // DIVIDIR TRAS COMA funcion(expresionMuuuuyLarga1, expresionMuuuyyyyLarga2, expresionMuuuyyyLarga3) // MANTENER LA EXPRESION ENTRE PARENTESIS nombreLargo = nombreLargo2* (nombreLargo3 + nombreLArgo4)+4* nombreLargo5; //BLOQUES // Principal mecanismo de encapsulamiento // {} llave de apertura y cierre }
[ "gcoronelc@gmail.com" ]
gcoronelc@gmail.com
059943f0c43fa26dbe1562b2a0475c63ebbfbccb
d4d680301730e70f539675a989f0c5252a847811
/core/src/test/resources/plugin/binding/create/A.java
c3f775f9fa4a38d2f900342ef7708d28e6354587
[]
no_license
nscavell/juzu
90dd3fddb7b0d78ada178cd9136f0838cabacafa
1f59725ec16d9d1a061800f68265be2f153dcaac
refs/heads/master
2021-01-24T16:47:54.629944
2012-10-10T04:29:52
2012-10-10T04:41:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,245
java
/* * Copyright (C) 2012 eXo Platform SAS. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this software; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA, or see the FSF site: http://www.fsf.org. */ package plugin.binding.create; import juzu.Controller; import juzu.Response; import juzu.View; import javax.inject.Inject; import java.io.IOException; /** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */ public class A extends Controller { @Inject Service service; @View public Response.Content index() throws IOException { return Response.ok(service != null ? "pass" : ""); } }
[ "julien@julienviet.com" ]
julien@julienviet.com
da599a42b13b80d841146ec3651d7652f4992138
a128f19f6c10fc775cd14daf740a5b4e99bcd2fb
/middleheaven-utils/src/main/java/org/middleheaven/quantity/math/structure/GroupAdditiveElement.java
1fe6e0c9ac9e115c44177507385835746229f262
[]
no_license
HalasNet/middleheaven
c8bfa6199cb9b320b9cfd17b1f8e4961e3d35e6e
15e3e91c338e359a96ad01dffe9d94e069070e9c
refs/heads/master
2021-06-20T23:25:09.978612
2017-08-12T21:35:56
2017-08-12T21:37:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package org.middleheaven.quantity.math.structure; /** * Represent a mathematical Group Additive structure. * * @param <T> the type of the element in the group. */ public interface GroupAdditiveElement<T extends GroupAdditiveElement<T, A> , A extends GroupAdditive<T,A> > extends MonoidAdditiveElement<T, A> , Decrementable<T,T,A> { /** * Returns the sum of this object with the one specified. * @param other the object to be added * @return this + other */ public T plus(T other); /** * Returns the additive inverse of this object. * @return -this */ public T negate(); /** * Returns the sum of this object with the additive inverse of the one specified. * @param other the object to be added * @return this - other. */ public T minus(T other); }
[ "sergiotaborda@yahoo.com.br" ]
sergiotaborda@yahoo.com.br
4d63d60df51a69a0b6f171b28f7ec0e99932bdb1
b1cdb52067176ffba8c9a1df639f2e292ad971aa
/app/src/main/java/com/syl/snow/view/HackyViewPager.java
17a90758db84e98501c9ce0a687937ee506aa536
[]
no_license
Icarours/snow
37bad64a5cbd0a53bcdd59b4db93b3e7ff75bf89
d0df0cd2d9db176266c7e0ea8a166e7b9c8e641e
refs/heads/master
2021-06-22T04:08:22.992002
2020-12-13T13:30:41
2020-12-13T13:30:41
162,014,860
0
0
null
null
null
null
UTF-8
Java
false
false
1,130
java
package com.syl.snow.view; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import androidx.viewpager.widget.ViewPager; /** * Hacky fix for Issue #4 and * http://code.google.com/p/android/issues/detail?id=18990 * <p/> * ScaleGestureDetector seems to mess up the touch events, which means that * ViewGroups which make use of onInterceptTouchEvent throw a lot of * IllegalArgumentException: pointerIndex out of range. * <p/> * There's not much I can do in my code for now, but we can mask the result by * just catching the problem and ignoring it. * * @author Chris Banes */ public class HackyViewPager extends ViewPager { public HackyViewPager(Context context) { super(context); } public HackyViewPager(Context context, AttributeSet attrs) { super(context, attrs); } @Override public boolean onInterceptTouchEvent(MotionEvent ev) { try { return super.onInterceptTouchEvent(ev); } catch (IllegalArgumentException e) { e.printStackTrace(); return false; } } }
[ "j376787348@163.com" ]
j376787348@163.com
f71cc2835b3a9a2e6ee9842ec30d3479f00aa194
75b0f2fceb9d1786d64cac831326354d431a8a32
/com/planet_ink/coffee_mud/CharClasses/Enchanter.java
b38df4cc26d6b80270e398fcbe8d753cf62717a9
[ "Apache-2.0" ]
permissive
thierrylach/CoffeeMud
f41857a8106706530c794d377bfb81b6458a847a
83101f209d8875ec2bbaf6c623d520a30cd3cc8d
refs/heads/master
2022-09-20T17:14:07.782102
2022-08-29T22:07:57
2022-08-29T22:07:57
113,072,543
0
0
null
2017-12-04T17:20:51
2017-12-04T17:20:51
null
UTF-8
Java
false
false
3,769
java
package com.planet_ink.coffee_mud.CharClasses; 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.Libraries.interfaces.AbilityMapper.SecretFlag; import com.planet_ink.coffee_mud.Locales.interfaces.*; import com.planet_ink.coffee_mud.MOBS.interfaces.*; import com.planet_ink.coffee_mud.Races.interfaces.*; /* Copyright 2003-2022 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. */ public class Enchanter extends SpecialistMage { @Override public String ID() { return "Enchanter"; } private final static String localizedStaticName = CMLib.lang().L("Enchanter"); @Override public String name() { return localizedStaticName; } @Override public int domain() { return Ability.DOMAIN_ENCHANTMENT; } @Override public int opposed() { return Ability.DOMAIN_ABJURATION; } @Override public int availabilityCode() { return Area.THEME_FANTASY; } @Override public void initializeClass() { super.initializeClass(); CMLib.ableMapper().delCharAbilityMapping(ID(),"Spell_ResistMagicMissiles"); CMLib.ableMapper().addCharAbilityMapping(ID(),1,"Spell_InsatiableThirst",false); CMLib.ableMapper().addCharAbilityMapping(ID(),3,"Spell_LightenItem",false); CMLib.ableMapper().addCharAbilityMapping(ID(),5,"Spell_Fatigue",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),7,"Spell_ManaBurn",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),8,"Skill_Spellcraft",false); CMLib.ableMapper().addCharAbilityMapping(ID(),9,"Spell_MindLight",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),11,"Spell_Advancement",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),13,"Spell_MassSleep",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),15,"Spell_Alarm",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),17,"Spell_MindFog",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),19,"Spell_Enthrall",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),20,"Spell_Brainwash",0,"",false,SecretFlag.SECRET); CMLib.ableMapper().addCharAbilityMapping(ID(),21,"Spell_AweOther",0,"",true); CMLib.ableMapper().addCharAbilityMapping(ID(),23,"Spell_LowerResists",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),24,"Spell_MassHold",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),25,"Spell_RogueLimb",25,true); CMLib.ableMapper().addCharAbilityMapping(ID(),30,"Spell_Permanency",true); CMLib.ableMapper().addCharAbilityMapping(ID(),35,"Spell_PlanarEnthrall", 25, "", false, SecretFlag.MASKED, null, "+PLANE \"-Prime Material\""); } }
[ "bo@zimmers.net" ]
bo@zimmers.net
b3a99ec4a9f78063602b04fa9f89d47689cab6b9
2b2e5ac097426b7fc77cb098d4114015ae1fa112
/java/Thmod/vfx/scene/CeremonialTorchEffect.java
a0bcabc77a5f1b84eeedb1163fbf960b86e420b1
[]
no_license
LazurasLong/KomeijiMod
2d0c1b9526cb7947c0b595403b8f20efc0837011
1429d94e6bac796939f4ccaee94b937dce340d26
refs/heads/master
2022-12-07T10:32:51.808255
2018-09-01T11:48:15
2018-09-01T11:48:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,343
java
package Thmod.vfx.scene; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureAtlas; import com.megacrit.cardcrawl.core.CardCrawlGame; import com.megacrit.cardcrawl.core.Settings; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.helpers.Hitbox; import com.megacrit.cardcrawl.helpers.ImageMaster; import com.megacrit.cardcrawl.helpers.input.InputHelper; import com.megacrit.cardcrawl.vfx.AbstractGameEffect; import com.megacrit.cardcrawl.vfx.scene.LightFlareLEffect; import com.megacrit.cardcrawl.vfx.scene.LightFlareMEffect; import com.megacrit.cardcrawl.vfx.scene.LightFlareSEffect; import com.megacrit.cardcrawl.vfx.scene.TorchParticleLEffect; import com.megacrit.cardcrawl.vfx.scene.TorchParticleMEffect; import com.megacrit.cardcrawl.vfx.scene.TorchParticleSEffect; import Thmod.vfx.CeremonyAction; import Thmod.Relics.SpellCardsRule; public class CeremonialTorchEffect extends AbstractGameEffect { private float x; private float y; private Hitbox hb; private boolean activated = true; private float particleTimer1 = 0.0F; private static final float PARTICLE_EMIT_INTERVAL = 0.1F; private static TextureAtlas.AtlasRegion img; private TorchSize size = TorchSize.M; private int num1; private int num2; private boolean started = false; public CeremonialTorchEffect(float x, float y, TorchSize size,int num1,int num2) { if (img == null) { img = ImageMaster.vfxAtlas.findRegion("env/torch"); } this.size = size; this.x = x; this.y = y; this.num1 = num1; this.num2 = num2; this.hb = new Hitbox(50.0F * Settings.scale, 50.0F * Settings.scale); this.hb.move(x, y); this.color = new Color(1.0F, 1.0F, 1.0F, 0.4F); switch (size) { case S: this.scale = (Settings.scale * 0.6F); break; case M: this.scale = Settings.scale; break; case L: this.scale = (Settings.scale * 1.4F); break; } } public static enum TorchSize { S, M, L; private TorchSize() {} } public void update() { this.hb.update(); if ((this.hb.hovered) && (InputHelper.justClickedLeft) && (!(this.size == TorchSize.M))) { this.activated = (!this.activated); if (this.activated) { if (((num1 == 0) && ((num2 == 2) || (num2 == 6))) || ((num1 == 1) && ((num2 == 2) || (num2 == 3) || (num2 == 5) || (num2 == 6))) || ((num1 == 2) && ((num2 == 2) || (num2 == 3) || (num2 == 4) || (num2 == 5) || (num2 == 6))) || ((num1 == 3) && ((num2 == 1) || (num2 == 2) || (num2 == 6) || (num2 == 7))) || ((num1 == 4) && ((num2 == 0) || (num2 == 2) || (num2 == 6) || (num2 == 8))) || ((num1 == 5) && ((num2 == 1) || (num2 == 2) || (num2 == 6) || (num2 == 7))) || ((num1 == 6) && ((num2 == 2) || (num2 == 3) || (num2 == 4) || (num2 == 5) || (num2 == 6))) || ((num1 == 7) && ((num2 == 2) || (num2 == 3) || (num2 == 5) || (num2 == 6))) || ((num1 == 8) && ((num2 == 2) || (num2 == 6)))){ if(this.started) { // CardCrawlGame.sound.playA("ATTACK_FIRE", 0.4F); CardCrawlGame.sound.play("Fire_Remnant2"); } else CardCrawlGame.sound.playA("ATTACK_FIRE", 0.4F); } else CardCrawlGame.sound.playA("ATTACK_FIRE", 0.4F); } else { // if (((num1 == 0) && ((num2 == 2) || (num2 == 6))) // || ((num1 == 1) && ((num2 == 2) || (num2 == 3) || (num2 == 5) || (num2 == 6))) // || ((num1 == 2) && ((num2 == 2) || (num2 == 3) || (num2 == 4) || (num2 == 5) || (num2 == 6))) // || ((num1 == 3) && ((num2 == 1) || (num2 == 2) || (num2 == 6) || (num2 == 7))) // || ((num1 == 4) && ((num2 == 0) || (num2 == 2) || (num2 == 6) || (num2 == 8))) // || ((num1 == 5) && ((num2 == 1) || (num2 == 2) || (num2 == 6) || (num2 == 7))) // || ((num1 == 6) && ((num2 == 2) || (num2 == 3) || (num2 == 4) || (num2 == 5) || (num2 == 6))) // || ((num1 == 7) && ((num2 == 2) || (num2 == 3) || (num2 == 5) || (num2 == 6))) // || ((num1 == 8) && ((num2 == 2) || (num2 == 6)))){ // if(this.started) { //// CardCrawlGame.sound.playA("ATTACK_FIRE", 0.4F); // CardCrawlGame.sound.play("Fire_Remnant2"); // } // else // CardCrawlGame.sound.playA("ATTACK_FIRE", -0.4F); // } // else CardCrawlGame.sound.playA("ATTACK_FIRE", -0.4F); } if(this.started) { SpellCardsRule.torchLight.set(((this.num1 * 9) + this.num2), (!(SpellCardsRule.torchLight.get(((this.num1 * 9) + this.num2))))); AbstractDungeon.effectsQueue.add(new CeremonyAction()); } } if (this.activated) { this.particleTimer1 -= Gdx.graphics.getDeltaTime(); if (this.particleTimer1 < 0.0F) { this.particleTimer1 = 0.1F; switch (this.size) { case S: AbstractDungeon.effectsQueue.add(new TorchParticleSEffect(this.x, this.y - 10.0F * Settings.scale)); AbstractDungeon.effectsQueue.add(new LightFlareSEffect(this.x, this.y - 10.0F * Settings.scale)); break; case M: AbstractDungeon.effectsQueue.add(new TorchParticleMEffect(this.x, this.y)); AbstractDungeon.effectsQueue.add(new LightFlareMEffect(this.x, this.y)); break; case L: AbstractDungeon.effectsQueue.add(new TorchParticleLEffect(this.x, this.y + 14.0F * Settings.scale)); AbstractDungeon.effectsQueue.add(new LightFlareLEffect(this.x, this.y + 14.0F * Settings.scale)); break; } } } } public void startCeremony(boolean sound){ this.activated = false; this.started = true; if(sound) CardCrawlGame.sound.playA("ATTACK_FIRE", -0.4F); SpellCardsRule.torchLight.add(false); } public void midUnactivated(){ this.activated = false; CardCrawlGame.sound.playA("ATTACK_FIRE", -0.4F); } public void render(SpriteBatch sb) { sb.setColor(this.color); sb.draw(img, this.x - img.packedWidth / 2, this.y - img.packedHeight / 2 - 24.0F * Settings.scale, img.packedWidth / 2.0F, img.packedHeight / 2.0F, img.packedWidth, img.packedHeight, this.scale, this.scale, this.rotation); this.hb.render(sb); } }
[ "1500959719@qq.com" ]
1500959719@qq.com