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
78096ce10039f5896f08e05ad35ad365ac3c49ec
161ec1a505611bc45cfedce2b8159f1207fe1fda
/api/src/main/java/com/xiaohe/mapshow/modules/cloudwaterdeposit/entity/CloudWaterDeposit.java
4452a6297ff9742e51314f7b489b5af1b88874a1
[]
no_license
HomCatch/mapshow
1dc0fc5daea6ed5b56d0b7bc21ae2b3872b2213b
522301577e5ad8d0fa2149fa0d339378c763dbe0
refs/heads/master
2023-01-10T03:25:37.813504
2019-08-12T00:32:18
2019-08-12T00:32:18
200,155,834
0
1
null
2023-01-04T06:06:45
2019-08-02T03:08:41
TSQL
UTF-8
Java
false
false
4,510
java
package com.xiaohe.mapshow.modules.cloudwaterdeposit.entity; import cn.afterturn.easypoi.excel.annotation.Excel; import java.io.Serializable; import java.util.Date; import java.math.BigDecimal; import javax.persistence.*; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; import com.fasterxml.jackson.annotation.JsonFormat; /** * <p> * * </p> * * @author gmq * @since 2019-04-19 */ @Entity @Table(name="cloud_water_deposit") @DynamicInsert @DynamicUpdate public class CloudWaterDeposit implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Excel(name = "编号") private Integer id; /** * 订单编号 */ @Excel(name = "订单编号") private String orderNumber; /** * 用户昵称 */ @Excel(name = "用户昵称") private String userName; /** * 注册手机 */ @Excel(name = "注册手机") private String phoneNumber; /** * 收货人 */ @Excel(name = "收货人") private String receiver; /** * 收货地址 */ @Excel(name = "收货地址") private String receivAddress; /** * 收货手机号 */ @Excel(name = "收货手机号") private String receivPhoneNumber; /** * 套餐类型 */ @Excel(name = "套餐类型") private Integer type; /** * 单价 */ @Excel(name = "单价") private BigDecimal price; /** * 支付方式 */ @Excel(name = "支付方式") private Integer payType; /** * 押金 */ @Excel(name = "押金") private BigDecimal deposit; /** * 订单状态 */ @Excel(name = "订单状态") private Integer orderType; /** * 下单时间 */ @Excel(name = "下单时间", format = "yyyy-MM-dd HH:mm:ss") @Temporal(value = TemporalType.TIMESTAMP) @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date orderDate; /** * 第三方流水号 */ @Excel(name = "第三方流水号") private String thirdNumber; /** * 设备编号 */ @Excel(name = "设备编号") private String deviceId; public Integer getId() {return id;} public void setId(Integer id) {this.id = id;} public String getOrderNumber() { return orderNumber; } public void setOrderNumber(String orderNumber) { this.orderNumber = orderNumber; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getPhoneNumber() { return phoneNumber; } public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; } public String getReceiver() { return receiver; } public void setReceiver(String receiver) { this.receiver = receiver; } public String getReceivAddress() { return receivAddress; } public void setReceivAddress(String receivAddress) { this.receivAddress = receivAddress; } public String getReceivPhoneNumber() { return receivPhoneNumber; } public void setReceivPhoneNumber(String receivPhoneNumber) { this.receivPhoneNumber = receivPhoneNumber; } public Integer getType() { return type; } public void setType(Integer type) { this.type = type; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public Integer getPayType() { return payType; } public void setPayType(Integer payType) { this.payType = payType; } public BigDecimal getDeposit() { return deposit; } public void setDeposit(BigDecimal deposit) { this.deposit = deposit; } public Integer getOrderType() { return orderType; } public void setOrderType(Integer orderType) { this.orderType = orderType; } public Date getOrderDate() { return orderDate; } public void setOrderDate(Date orderDate) { this.orderDate = orderDate; } public String getThirdNumber() { return thirdNumber; } public void setThirdNumber(String thirdNumber) { this.thirdNumber = thirdNumber; } public String getDeviceId() { return deviceId; } public void setDeviceId(String deviceId) { this.deviceId = deviceId; } }
[ "2424962073@qq.com" ]
2424962073@qq.com
c0dacc2a70099553b5cd801fa95b39a81f2b7e25
aeceebd88c27c3d9a692b39b3fd970c63fc1c9c8
/day_19/src/tje/component2/ToolTipEx.java
f014d910c72c921f56ff17e7d3fcd7b31c59c9a7
[]
no_license
shsewonitw/study_Java
15a5a6dc0f80e021536749a08eface4f7995866a
cea49b84b209c8b2e8220b270f2db8bf25df88e2
refs/heads/master
2020-06-13T21:59:37.627150
2019-07-02T06:25:15
2019-07-02T06:25:15
194,801,164
0
0
null
null
null
null
UHC
Java
false
false
1,105
java
package tje.component2; import javax.swing.*; import java.awt.*; public class ToolTipEx extends JFrame { Container contentPane; ToolTipEx() { setTitle("툴팁 예제"); setDefaultCloseOperation(EXIT_ON_CLOSE); contentPane = getContentPane(); createToolBar(); setSize(400,200); setVisible(true); } void createToolBar() { JToolBar bar = new JToolBar("seokwoo Menu"); bar.setBackground(Color.LIGHT_GRAY); JButton newBtn = new JButton("New"); newBtn.setToolTipText("파일을 생성합니다."); bar.add(newBtn); JButton openBtn = new JButton(new ImageIcon("open.jpg")); openBtn.setToolTipText("파일을 엽니다."); bar.add(openBtn); bar.addSeparator(); JButton saveBtn = new JButton("save.jpg"); saveBtn.setToolTipText("파일을 저장합니다."); bar.add(saveBtn); bar.add(new JLabel("search")); JTextField tf = new JTextField("text field"); tf.setToolTipText("찾고자하는 문자열을 입력하세요"); bar.add(tf); contentPane.add(bar,BorderLayout.NORTH); } public static void main(String[] args) { new ToolTipEx(); } }
[ "shsewonitw@gmail.com" ]
shsewonitw@gmail.com
30be98599f8b86c55f1fe32cd93f79e0920f4053
8bd4cd295806cb42af7bac6120f376e6a4e4f288
/com/google/android/gms/internal/fy.java
492e7bd75670c631a2c029fcea33875f47ed9bae
[]
no_license
awestlake87/dapath
74d95d27854bc75b5d26456621d45eae79d5995b
8e83688c9ec6ab9d5b0def17e9dc5b2c6896ea0b
refs/heads/master
2020-03-13T10:40:49.896330
2018-04-26T02:22:12
2018-04-26T02:22:12
131,088,145
0
0
null
null
null
null
UTF-8
Java
false
false
5,851
java
package com.google.android.gms.internal; import android.app.Activity; import android.content.Intent; import android.net.Uri; import android.net.Uri.Builder; import android.os.ParcelFileDescriptor; import android.os.RemoteException; import com.google.android.gms.appindexing.AppIndexApi; import com.google.android.gms.appindexing.AppIndexApi.AppIndexingLink; import com.google.android.gms.common.api.C0153a.C0152d; import com.google.android.gms.common.api.C0153a.C1002b; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.api.PendingResult; import com.google.android.gms.common.api.Result; import com.google.android.gms.common.api.Status; import com.google.android.gms.internal.ft.C0731a; import java.util.List; public final class fy implements AppIndexApi, ft { private static abstract class C0736a<T> implements Result { protected final T yA; private final Status yz; public C0736a(Status status, T t) { this.yz = status; this.yA = t; } public Status getStatus() { return this.yz; } } static class C1085b extends C0736a<ParcelFileDescriptor> implements C0731a { public C1085b(Status status, ParcelFileDescriptor parcelFileDescriptor) { super(status, parcelFileDescriptor); } } private static abstract class C1177c<T extends Result> extends C1002b<T, fx> { public C1177c() { super(ff.xI); } protected abstract void mo3152a(fu fuVar) throws RemoteException; protected final void m4059a(fx fxVar) throws RemoteException { mo3152a(fxVar.dR()); } } private static final class C1178e extends fw<Status> { public C1178e(C0152d<Status> c0152d) { super(c0152d); } public void mo1703a(Status status) { this.yu.mo911a(status); } } class C12371 extends C1177c<C0731a> { protected void mo3152a(fu fuVar) throws RemoteException { fuVar.mo1699a(new fw<C0731a>(this, this) { final /* synthetic */ C12371 yv; public void mo1704a(Status status, ParcelFileDescriptor parcelFileDescriptor) { this.yu.mo911a(new C1085b(status, parcelFileDescriptor)); } }); } public C0731a m4246b(Status status) { return new C1085b(status, null); } public /* synthetic */ Result mo2535c(Status status) { return m4246b(status); } } private static abstract class C1238d<T extends Result> extends C1177c<Status> { private C1238d() { } protected /* synthetic */ Result mo2535c(Status status) { return m4249d(status); } protected Status m4249d(Status status) { return status; } } static Uri m2595a(String str, Uri uri) { if (!"android-app".equals(uri.getScheme())) { throw new IllegalArgumentException("Uri scheme must be android-app: " + uri); } else if (str.equals(uri.getHost())) { List pathSegments = uri.getPathSegments(); if (pathSegments.isEmpty() || ((String) pathSegments.get(0)).isEmpty()) { throw new IllegalArgumentException("Uri path must exist: " + uri); } String str2 = (String) pathSegments.get(0); Builder builder = new Builder(); builder.scheme(str2); if (pathSegments.size() > 1) { builder.authority((String) pathSegments.get(1)); for (int i = 2; i < pathSegments.size(); i++) { builder.appendPath((String) pathSegments.get(i)); } } builder.encodedQuery(uri.getEncodedQuery()); builder.encodedFragment(uri.getEncodedFragment()); return builder.build(); } else { throw new IllegalArgumentException("Uri host must match package name: " + uri); } } public PendingResult<Status> m2596a(GoogleApiClient googleApiClient, final fr... frVarArr) { final String packageName = ((fx) googleApiClient.mo925a(ff.xI)).getContext().getPackageName(); return googleApiClient.mo926a(new C1238d<Status>(this) { final /* synthetic */ fy yy; protected void mo3152a(fu fuVar) throws RemoteException { fuVar.mo1700a(new C1178e(this), packageName, frVarArr); } }); } public PendingResult<Status> view(GoogleApiClient apiClient, Activity activity, Intent viewIntent, String title, Uri webUrl, List<AppIndexingLink> outLinks) { return m2596a(apiClient, new fr(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), viewIntent, title, webUrl, null, (List) outLinks)); } public PendingResult<Status> view(GoogleApiClient apiClient, Activity activity, Uri appIndexingUrl, String title, Uri webUrl, List<AppIndexingLink> outLinks) { return view(apiClient, activity, new Intent("android.intent.action.VIEW", m2595a(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), appIndexingUrl)), title, webUrl, (List) outLinks); } public PendingResult<Status> viewEnd(GoogleApiClient apiClient, Activity activity, Intent viewIntent) { fr frVar = new fr(fr.m2581a(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), viewIntent), System.currentTimeMillis(), 3); return m2596a(apiClient, frVar); } public PendingResult<Status> viewEnd(GoogleApiClient apiClient, Activity activity, Uri appIndexingUrl) { return viewEnd(apiClient, activity, new Intent("android.intent.action.VIEW", m2595a(((fx) apiClient.mo925a(ff.xI)).getContext().getPackageName(), appIndexingUrl))); } }
[ "kelixes@gmail.com" ]
kelixes@gmail.com
7fa7dff42e20d4cabd39eb50dcd1fbda3bebccf5
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
/Fantastle5/src/net/worldwizard/fantastle5/objects/NPlug.java
861025a3a40922508ed177a86839736882b03bec
[ "Unlicense" ]
permissive
retropipes/older-java-games
777574e222f30a1dffe7936ed08c8bfeb23a21ba
786b0c165d800c49ab9977a34ec17286797c4589
refs/heads/master
2023-04-12T14:28:25.525259
2021-05-15T13:03:54
2021-05-15T13:03:54
235,693,016
0
0
null
null
null
null
UTF-8
Java
false
false
986
java
/* Fantastle: A Maze-Solving Game Copyright (C) 2008-2010 Eric Ahnell This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Any questions should be directed to the author via email at: fantastle@worldwizard.net */ package net.worldwizard.fantastle5.objects; import net.worldwizard.fantastle5.generic.GenericPlug; public class NPlug extends GenericPlug { // Constructors public NPlug() { super('N'); } }
[ "eric.ahnell@puttysoftware.com" ]
eric.ahnell@puttysoftware.com
a6bf504a5f825b2dac9a096ebd63302d940fb441
b75cc09bda54e7b50aeb66770195cdc541f68314
/booting-server/src/main/java/com/booting/order/dto/OrderDetailDTO.java
80442db981219e9c72dd1e10f391beae37649bc2
[]
no_license
284288787/px
46de9f5c57daaaee2084ca350065910e8164c053
f78f88c6c076ef1861e6adf2ace1322c8e271abb
refs/heads/master
2022-11-22T04:29:55.019609
2020-08-27T09:42:14
2020-08-27T09:42:14
161,508,370
0
0
null
2022-11-16T06:28:23
2018-12-12T15:34:49
JavaScript
UTF-8
Java
false
false
1,733
java
/**create by liuhua at 2017年7月13日 下午2:21:40**/ package com.booting.order.dto; import java.io.Serializable; import com.star.framework.aop.annotation.Description; @Description(name = "订单详情") public class OrderDetailDTO implements Serializable { private static final long serialVersionUID = -8730327166078371217L; private Long id; private Long orderId; private Long productId; //购买的产品 private Integer productType; //产品的类型 1套餐 2场地 3优惠券 private String productName; //产品的名称 private Integer price; //单价:实际金额*100 private Integer quantity; //购买的数量 private Integer amount; //总价:单价*数量 public Long getId() { return id; } public Long getOrderId() { return orderId; } public Long getProductId() { return productId; } public Integer getProductType() { return productType; } public String getProductName() { return productName; } public Integer getPrice() { return price; } public Integer getQuantity() { return quantity; } public Integer getAmount() { return amount; } public void setId(Long id) { this.id = id; } public void setOrderId(Long orderId) { this.orderId = orderId; } public void setProductId(Long productId) { this.productId = productId; } public void setProductType(Integer productType) { this.productType = productType; } public void setProductName(String productName) { this.productName = productName; } public void setPrice(Integer price) { this.price = price; } public void setQuantity(Integer quantity) { this.quantity = quantity; } public void setAmount(Integer amount) { this.amount = amount; } }
[ "3158459@qq.com" ]
3158459@qq.com
013143718bd7ac0aa74321a3ef5e937eed5639f7
c6f145685b7d5de6b4d9b9460edc9e52d54b9f81
/test_cases/CWE259/CWE259_Hard_Coded_Password_connectionFactoryCreateContext/CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53a.java
0a6762fa13590083dbed49b0d2ef482c63e2cd28
[]
no_license
Johndoetheone/new-test-repair
531ca91dab608abd52eb474c740c0a211ba8eb9f
7fa0e221093a60c340049e80ce008e233482269c
refs/heads/master
2022-04-26T03:44:51.807603
2020-04-25T01:10:47
2020-04-25T01:10:47
258,659,310
0
0
null
null
null
null
UTF-8
Java
false
false
4,823
java
/* * TEMPLATE GENERATED TESTCASE FILE * @description * CWE: 259 Hard Coded Password * BadSource: hardcodedPassword Set data to a hardcoded string * Flow Variant: 53 Data flow: data passed as an argument from one method through two others to a fourth; all four functions are in different classes in the same package * */ package test_cases.CWE259.CWE259_Hard_Coded_Password_connectionFactoryCreateContext; import testcasesupport.*; import java.util.Arrays; import java.util.Properties; import java.util.logging.Level; import java.io.*; import javax.jms.ConnectionFactory; import javax.jms.Destination; import javax.jms.JMSContext; import javax.jms.JMSProducer; import javax.jms.Message; import org.apache.activemq.ActiveMQConnectionFactory; public class CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53a extends AbstractTestCase { public void bad() throws Throwable { String data; /* FLAW: Set data to a hardcoded string */ data = "7e5tc4s3"; (new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).badSink(data); } /* goodG2B() - use goodsource and badsink */ private void goodG2B() throws Throwable { String data; data = ""; /* init data */ /* FIX */ try { InputStreamReader readerInputStream = new InputStreamReader(System.in, "UTF-8"); BufferedReader readerBuffered = new BufferedReader(readerInputStream); /* POTENTIAL FLAW: Read data from the console using readLine */ data = readerBuffered.readLine(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } (new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).goodG2BSink(data); } /* goodChar() - uses the expected Properties file and a char[] data variable*/ private void goodChar() throws Throwable { char[] data = null; Properties properties = new Properties(); FileInputStream streamFileInput = null; try { streamFileInput = new FileInputStream("src/juliet_test/resources/config.properties"); properties.load(streamFileInput); data = properties.getProperty("password").toCharArray(); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (streamFileInput != null) { streamFileInput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } (new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).goodCharSink(data); } /* goodExpected() - uses the expected Properties file and uses the password directly from it*/ private void goodExpected() throws Throwable { Properties properties = new Properties(); FileInputStream streamFileInput = null; try { streamFileInput = new FileInputStream("src/juliet_test/resources/config.properties"); properties.load(streamFileInput); } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error with stream reading", exceptIO); } finally { /* clean up stream reading objects */ try { if (streamFileInput != null) { streamFileInput.close(); } } catch (IOException exceptIO) { IO.logger.log(Level.WARNING, "Error closing FileInputStream", exceptIO); } } (new CWE259_Hard_Coded_Password_connectionFactoryCreateContext_53b()).goodExpectedSink(properties); } public void good() throws Throwable { goodG2B(); goodChar(); goodExpected(); } /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException { mainFromParent(args); } }
[ "root@Delta.localdomain" ]
root@Delta.localdomain
055fb3d406c120ee200a45c7f0c52e63a08f1b1e
4e6473153ecde7c7451c94b60bac8836c94e424f
/baseio-jms/src/main/java/com/generallycloud/nio/container/jms/server/MQSubscribeServlet.java
d9bd4be6643bfe9e749a0887ede9468d01a58bf2
[]
no_license
pengp/baseio
df07daee2dd2d25c7dbf03f3f6eba0a1768af897
dfb5215f4f22f451d80f2435c3e47fc37b4da5cc
refs/heads/master
2020-06-10T17:16:45.090864
2016-12-06T06:13:02
2016-12-06T06:13:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
518
java
package com.generallycloud.nio.container.jms.server; import com.generallycloud.nio.codec.protobase.future.ProtobaseReadFuture; import com.generallycloud.nio.component.SocketSession; public class MQSubscribeServlet extends MQServlet { public static final String SERVICE_NAME = MQSubscribeServlet.class.getSimpleName(); public void doAccept(SocketSession session, ProtobaseReadFuture future, MQSessionAttachment attachment) throws Exception { getMQContext().subscribeMessage(session, future, attachment); } }
[ "8738115@qq.com" ]
8738115@qq.com
7efa9c5a4908e1dac0f7501ebde6bdfc353f6845
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/an/aa.java
a436147f958f630c1ff83dd57b9ff26997622af3
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
2,861
java
package com.tencent.mm.an; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.am.c; import com.tencent.mm.am.c.a; import com.tencent.mm.am.c.c; import com.tencent.mm.am.h; import com.tencent.mm.am.p; import com.tencent.mm.model.cn; import com.tencent.mm.network.g; import com.tencent.mm.network.m; import com.tencent.mm.network.s; import com.tencent.mm.protocal.protobuf.cqt; import com.tencent.mm.protocal.protobuf.cqu; import com.tencent.mm.sdk.platformtools.Log; public final class aa extends p implements m { private h callback; private cqu owP; private a<aa> owQ; private final c rr; public aa() { AppMethodBeat.i(239429); Log.i("MicroMsg.NetSceneGetReceiptAssisPluginMenu", "NetSceneGetReceiptAssisPluginMenu begin"); c.a locala = new c.a(); locala.funcId = 1769; locala.uri = "/cgi-bin/mmpay-bin/getreceiptassismenu"; cqt localcqt = new cqt(); localcqt.timestamp = cn.bDv(); locala.otE = localcqt; locala.otF = new cqu(); locala.otG = 0; locala.respCmdId = 0; this.rr = locala.bEF(); AppMethodBeat.o(239429); } public aa(a<aa> parama) { this(); this.owQ = parama; } public final cqu bHa() { AppMethodBeat.i(239437); if (this.owP == null) { localcqu = new cqu(); AppMethodBeat.o(239437); return localcqu; } cqu localcqu = this.owP; AppMethodBeat.o(239437); return localcqu; } public final int doScene(g paramg, h paramh) { AppMethodBeat.i(239432); this.callback = paramh; int i = dispatch(paramg, this.rr, this); AppMethodBeat.o(239432); return i; } public final int getType() { return 1769; } public final void onGYNetEnd(int paramInt1, int paramInt2, int paramInt3, String paramString, s params, byte[] paramArrayOfByte) { AppMethodBeat.i(239433); Log.w("MicroMsg.NetSceneGetReceiptAssisPluginMenu", "errType = %s errCode = %s errMsg = %s", new Object[] { Integer.valueOf(paramInt2), Integer.valueOf(paramInt3), paramString }); if ((paramInt2 == 0) && (paramInt3 == 0)) { this.owP = ((cqu)c.c.b(((c)params).otC)); } if (this.callback != null) { this.callback.onSceneEnd(paramInt2, paramInt3, paramString, this); } if (this.owQ != null) { this.owQ.onNetSceneEndCallback(paramInt2, paramInt3, paramString, this); } AppMethodBeat.o(239433); } public static abstract interface a<T extends p> { public abstract void onNetSceneEndCallback(int paramInt1, int paramInt2, String paramString, T paramT); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes2.jar * Qualified Name: com.tencent.mm.an.aa * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
c5c2f9876f70fb5a6c58a9afe56dc4b05ac30a19
4312a71c36d8a233de2741f51a2a9d28443cd95b
/RawExperiments/TB/Math95/AstorMain-math_95/src/variant-972/org/apache/commons/math/distribution/FDistributionImpl.java
a47b7c6e6699ffa7041451a0ff95b65a3583a517
[]
no_license
SajjadZaidi/AutoRepair
5c7aa7a689747c143cafd267db64f1e365de4d98
e21eb9384197bae4d9b23af93df73b6e46bb749a
refs/heads/master
2021-05-07T00:07:06.345617
2017-12-02T18:48:14
2017-12-02T18:48:14
112,858,432
0
0
null
null
null
null
UTF-8
Java
false
false
2,683
java
package org.apache.commons.math.distribution; public class FDistributionImpl extends org.apache.commons.math.distribution.AbstractContinuousDistribution implements java.io.Serializable , org.apache.commons.math.distribution.FDistribution { private static final long serialVersionUID = -8516354193418641566L; private double numeratorDegreesOfFreedom; private double denominatorDegreesOfFreedom; public FDistributionImpl(double numeratorDegreesOfFreedom ,double denominatorDegreesOfFreedom) { super(); setNumeratorDegreesOfFreedom(numeratorDegreesOfFreedom); setDenominatorDegreesOfFreedom(denominatorDegreesOfFreedom); } public double cumulativeProbability(double x) throws org.apache.commons.math.MathException { double ret; if (x <= 0.0) { ret = 0.0; } else { double n = getNumeratorDegreesOfFreedom(); double m = getDenominatorDegreesOfFreedom(); ret = org.apache.commons.math.special.Beta.regularizedBeta(((n * x) / (m + (n * x))), (0.5 * n), (0.5 * m)); } return ret; } public double inverseCumulativeProbability(final double p) throws org.apache.commons.math.MathException { if (p == 0) { return 0.0; } if (p == 1) { return java.lang.Double.POSITIVE_INFINITY; } return (getGamma().getAlpha()) * 2.0; } protected double getDomainLowerBound(double p) { return 0.0; } protected double getDomainUpperBound(double p) { return java.lang.Double.MAX_VALUE; } protected double getInitialDomain(double p) { double ret; double d = getDenominatorDegreesOfFreedom(); ret = d / (d - 2.0); return ret; } public void setNumeratorDegreesOfFreedom(double degreesOfFreedom) { if (degreesOfFreedom <= 0.0) { throw new java.lang.IllegalArgumentException("degrees of freedom must be positive."); } org.apache.commons.math.distribution.FDistributionImpl.this.numeratorDegreesOfFreedom = degreesOfFreedom; } public double getNumeratorDegreesOfFreedom() { return numeratorDegreesOfFreedom; } public void setDenominatorDegreesOfFreedom(double degreesOfFreedom) { if (degreesOfFreedom <= 0.0) { throw new java.lang.IllegalArgumentException("degrees of freedom must be positive."); } org.apache.commons.math.distribution.FDistributionImpl.this.denominatorDegreesOfFreedom = degreesOfFreedom; } public double getDenominatorDegreesOfFreedom() { return denominatorDegreesOfFreedom; } }
[ "sajjad.syed@ucalgary.ca" ]
sajjad.syed@ucalgary.ca
ccfd8e3632eb672002fd7982a41520210ed7afa9
20eb03455a83dec5a1bcabf5eb6ed1a6cbc8c46e
/src/automenta/netention/edge/Becomes.java
30f97fcbe6bdf0afc4e92c779150b188c6a3bd1b
[]
no_license
automenta/old-netention2
e7a5871ad45e06d29ceeb3fedc5fd74735607096
9f7639e9f95ae354e8b2d8eddd65557c2c56daef
refs/heads/master
2020-05-18T16:22:51.618885
2010-02-13T13:48:11
2010-02-13T13:48:11
null
0
0
null
null
null
null
UTF-8
Java
false
false
402
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package automenta.netention.edge; /** indicates that something has transformed (become) something else */ public final class Becomes { private final String name; public Becomes(String t) { this.name = t; } @Override public String toString() { return name; } }
[ "seh999@gmail.com" ]
seh999@gmail.com
8212733817324d0de019016e11a2653451d5ee07
ff7e107a5068b07436342353dbf912d587c3840b
/flow-master0925---处理/flow-master0925/flow/flow-server/src/main/java/com/zres/project/localnet/portal/cloudNetWork/service/CloudNetAutoCheckService.java
b1315d8aca2143d3cb203691480944a6b73b8eb5
[]
no_license
lichao20000/resflow-master
0f0668c7a6cb03cafaca153b9e9b882b2891b212
78217aa31f17dd5c53189e695a3a0194fced0d0a
refs/heads/master
2023-01-27T19:15:40.752341
2020-12-10T02:07:32
2020-12-10T02:07:32
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,922
java
package com.zres.project.localnet.portal.cloudNetWork.service; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashMap; import java.util.Map; /** * MCPE设备资源自动核查接口 * * @author caomm on 2020/11/25 */ @Service public class CloudNetAutoCheckService { private static final Logger logger = LoggerFactory.getLogger(CloudNetAutoCheckService.class); @Autowired private CloudNetCommonService cloudNetCommonService; public Map<String, Object> autoCheck(String request){ Map<String, Object> retMap = new HashMap<>(); Map<String, Object> logMap = new HashMap<>(); try{ logMap.put("interfName", "MCPE设备资源自动核查接口"); logMap.put("url", "/cloudNetWork/interfaceBDW/autoCheck.spr"); logMap.put("content", request); logMap.put("remark", "接收MCPE设备资源自动核查报文"); JSONObject json = JSON.parseObject(request); String PROVINCE = json.getString("PROVINCE"); String CITY = json.getString("CITY"); String ADDRESS = json.getString("ADDRESS"); String CUST_ID = json.getString("CUST_ID"); logMap.put("orderNo", CUST_ID); cloudNetCommonService.insertLogInfo(logMap); retMap.put("CODE", "0"); retMap.put("MESSAGE", "MCPE设备资源自动核查成功!"); }catch (Exception e){ logger.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>MCPE设备资源自动核查发生异常:{}", e.getMessage()); retMap.put("CODE", "1"); retMap.put("MESSAGE", "MCPE设备资源自动核查发生异常:" + e.getMessage()); } return retMap; } }
[ "2832383563@qq.com" ]
2832383563@qq.com
ceb1ac3c02d660e81d5061a4709b1310e33c38d4
647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4
/com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/cgi/f.java
8358f7ec9578a238d225b81ec2f97e97bd503992
[]
no_license
tsuzcx/qq_apk
0d5e792c3c7351ab781957bac465c55c505caf61
afe46ef5640d0ba6850cdefd3c11badbd725a3f6
refs/heads/main
2022-07-02T10:32:11.651957
2022-02-01T12:41:38
2022-02-01T12:41:38
453,860,108
36
9
null
2022-01-31T09:46:26
2022-01-31T02:43:22
Java
UTF-8
Java
false
false
2,322
java
package com.tencent.mm.plugin.finder.cgi; import com.tencent.matrix.trace.core.AppMethodBeat; import com.tencent.mm.am.c.a; import com.tencent.mm.bx.a; import com.tencent.mm.plugin.findersdk.b.c; import com.tencent.mm.protocal.protobuf.ati; import com.tencent.mm.protocal.protobuf.atj; import com.tencent.mm.protocal.protobuf.etl; import com.tencent.mm.protocal.protobuf.kd; import com.tencent.mm.sdk.platformtools.Log; import kotlin.Metadata; @Metadata(d1={""}, d2={"Lcom/tencent/mm/plugin/finder/cgi/CgiFinderAdLiveNotice;", "Lcom/tencent/mm/plugin/findersdk/cgi/FinderCgi;", "Lcom/tencent/mm/protocal/protobuf/FinderAdLiveNoticeResponse;", "userName", "", "noticeId", "contextObj", "Lcom/tencent/mm/protocal/protobuf/FinderReportContextObj;", "(Ljava/lang/String;Ljava/lang/String;Lcom/tencent/mm/protocal/protobuf/FinderReportContextObj;)V", "TAG", "getNoticeId", "()Ljava/lang/String;", "request", "Lcom/tencent/mm/protocal/protobuf/FinderAdLiveNoticeRequest;", "getUserName", "onCgiEnd", "", "errType", "", "errCode", "errMsg", "resp", "scene", "Lcom/tencent/mm/modelbase/NetSceneBase;", "plugin-finder_release"}, k=1, mv={1, 5, 1}, xi=48) public final class f extends c<atj> { private ati Ayx; private final String TAG; private final String hAR; private final String userName; public f(String paramString1, String paramString2) { super(null); AppMethodBeat.i(336373); this.userName = paramString1; this.hAR = paramString2; this.TAG = "Finder.CgiFinderAdLiveNotice"; this.Ayx = new ati(); this.Ayx.finderUsername = this.userName; this.Ayx.hAR = this.hAR; paramString1 = new c.a(); paramString1.otE = ((a)this.Ayx); paramString2 = new atj(); paramString2.setBaseResponse(new kd()); paramString2.getBaseResponse().akjO = new etl(); paramString1.otF = ((a)paramString2); paramString1.uri = "/cgi-bin/micromsg-bin/finderadlivenotice"; paramString1.funcId = 4164; c(paramString1.bEF()); Log.i(this.TAG, "init userName:" + this.userName + ", noticeId:" + this.hAR); AppMethodBeat.o(336373); } } /* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes13.jar * Qualified Name: com.tencent.mm.plugin.finder.cgi.f * JD-Core Version: 0.7.0.1 */
[ "98632993+tsuzcx@users.noreply.github.com" ]
98632993+tsuzcx@users.noreply.github.com
63e41f73d961def2a24d315bfaf464ebba8ee1e1
6500848c3661afda83a024f9792bc6e2e8e8a14e
/gp_JADX/com/google/android/libraries/performance/primes/ca.java
7991bb783f221d61dcd927ca40ef7f7bd5955aec
[]
no_license
enaawy/gproject
fd71d3adb3784d12c52daf4eecd4b2cb5c81a032
91cb88559c60ac741d4418658d0416f26722e789
refs/heads/master
2021-09-03T03:49:37.813805
2018-01-05T09:35:06
2018-01-05T09:35:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,570
java
package com.google.android.libraries.performance.primes; import android.os.Debug; import android.os.Process; import android.os.SystemClock; import com.google.android.libraries.p326c.p327a.C5916a; import com.google.android.libraries.performance.primes.metriccapture.C6016h; import com.google.android.libraries.performance.primes.p337d.C5987a; import java.io.File; import java.util.Arrays; import java.util.Collections; final class ca implements Runnable { public final /* synthetic */ bz f29864a; ca(bz bzVar) { this.f29864a = bzVar; } public final void run() { int i; C5987a c5987a; C5949a c5949a = this.f29864a.f29849a; int totalPss = C6016h.m27888a(this.f29864a.f29849a.f29613b).getProcessMemoryInfo(new int[]{Process.myPid()})[0].getTotalPss(); c5949a.f29842h.m27811a(totalPss); if (!ek.f30037a.f30040d) { long j = c5949a.f29845k.get(); if (j == 0 || j + 86400000 <= SystemClock.elapsedRealtime()) { i = 1; if (i != 0) { c5987a = c5949a.f29842h; double d = c5949a.f29841g; if (c5987a.f29935a.size() == 100 || c5987a.f29937c * ((double) ((Integer) Collections.min(c5987a.f29935a)).intValue()) > ((double) ((Integer) Collections.max(c5987a.f29935a)).intValue())) { i = 0; } else { Integer[] numArr = (Integer[]) c5987a.f29935a.toArray(new Integer[c5987a.f29935a.size()]); Arrays.sort(numArr); i = numArr[Math.min(numArr.length + -1, (int) ((d * ((double) numArr.length)) - 1.0d))].intValue() <= totalPss ? 1 : 0; } if (i != 0 && c5949a.f29844j.tryLock()) { c5949a.f29845k.set(SystemClock.elapsedRealtime()); try { Debug.dumpHprofData(dl.m27819b(c5949a.f29613b).getAbsolutePath()); c5949a.f29843i = totalPss; File b = dl.m27819b(c5949a.f29613b); Object obj = c5949a.f29613b; C5916a.m27406a(obj); File cacheDir = obj.getCacheDir(); String d2 = C6016h.m27892d(obj); if (d2 != null) { d2 = d2.replaceAll("[^a-zA-Z0-9\\._]", "_"); d2 = d2.substring(0, Math.min(32, d2.length())); } else { d2 = ""; } c5949a.m27754a(b, new File(cacheDir, new StringBuilder(String.valueOf(d2).length() + 11).append(d2).append("_primes_mhd").toString())); dl.m27820c(c5949a.f29613b); } catch (Throwable e) { C5989do.m27826a("MiniHeapDumpMetric", "Failed to dump hprof data", e, new Object[0]); } finally { dl.m27820c(c5949a.f29613b); c5949a.f29844j.unlock(); } return; } } } } i = 0; if (i != 0) { c5987a = c5949a.f29842h; double d3 = c5949a.f29841g; if (c5987a.f29935a.size() == 100) { } i = 0; if (i != 0) { } } } }
[ "genius.ron@gmail.com" ]
genius.ron@gmail.com
e7b47af76c029db3dfb8a7df4c7750722cb07faa
6bd14132416cf75b4cb8b06485b2406aa581ed18
/cashloan-core/src/main/java/com/xindaibao/cashloan/core/common/util/NidGenerator.java
f9b8193613830947c85808e551be793d428ba5cc
[]
no_license
tanglongjia/cashloan
b21e6a5e4dc1c5629fc7167c5fb727a6033ba619
9b55e7f1b51b89016750b6d9a732d1e895209877
refs/heads/master
2020-06-18T06:51:12.348238
2018-12-14T03:12:07
2018-12-14T03:12:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,757
java
package com.xindaibao.cashloan.core.common.util; import java.text.SimpleDateFormat; import java.util.UUID; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * 编号生成器 * @author * */ public class NidGenerator { public static final Logger logger = LoggerFactory.getLogger(NidGenerator.class); protected final SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); private static int getHashCode() { int hashCode = UUID.randomUUID().toString().hashCode(); if (hashCode < 0) { hashCode = -hashCode; } return hashCode; } public static String getOrderNo(){ int hashCode = getHashCode(); return String.format("%011d", hashCode); } /** * 评分卡nid * @return */ public static String getCardNid() { int hashCode = getHashCode(); return "CC" + String.format("%011d", hashCode); } /** *评分项目nid * @return */ public static String getItemNid() { int hashCode = getHashCode(); return "CI" + String.format("%011d", hashCode); } /** * 评分卡因子nid * @return */ public static String getFactorNid() { int hashCode = getHashCode(); return "CF" + String.format("%011d", hashCode); } /** * 评分参数nid * @return */ public static String getParamNid() { int hashCode = getHashCode(); return "CFP" + String.format("%010d", hashCode); } public static void main(String[] args) { logger.info(getCardNid()); logger.info(getItemNid()); logger.info(getFactorNid()); logger.info(getParamNid()); logger.info(getOrderNo()); } }
[ "15237815570@126.com" ]
15237815570@126.com
d56127b2bc19847128c9d839df57b1f30d10a98d
f353942026e47e491b8b4b28c640e466cd3b8fd1
/common/eunit-testfwk/src/main/java-excel/com/ebay/eunit/report/excel/model/Constants.java
94151d510dbe5bae2d546745d9ce922ed41198c4
[]
no_license
qmwu2000/workshop
392c952f7ef66c4da492edd929c47b7a1db3e5fa
9c1cc55122f78045aa996d5714635391847ae212
refs/heads/master
2021-01-17T08:55:54.655925
2012-11-13T13:31:14
2012-11-13T13:31:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,609
java
package com.ebay.eunit.report.excel.model; public class Constants { public static final String ATTR_BOLD = "bold"; public static final String ATTR_COLS = "cols"; public static final String ATTR_CREATE = "create"; public static final String ATTR_FORMAT = "format"; public static final String ATTR_ID = "id"; public static final String ATTR_ITALIC = "italic"; public static final String ATTR_NAME = "name"; public static final String ATTR_OFFSET = "offset"; public static final String ATTR_OUTPUT = "output"; public static final String ATTR_ROWS = "rows"; public static final String ATTR_SIZE = "size"; public static final String ATTR_START_COL = "start-col"; public static final String ATTR_START_ROW = "start-row"; public static final String ATTR_TEMPLATE = "template"; public static final String ATTR_TYPE = "type"; public static final String ELEMENT_TEXT = "text"; public static final String ENTITY_COL = "col"; public static final String ENTITY_DATE_TIME = "date-time"; public static final String ENTITY_EMPTY = "empty"; public static final String ENTITY_FONT = "font"; public static final String ENTITY_FORMAT = "format"; public static final String ENTITY_LABEL = "label"; public static final String ENTITY_NUMBER = "number"; public static final String ENTITY_PATTERN = "pattern"; public static final String ENTITY_ROW = "row"; public static final String ENTITY_SHEET = "sheet"; public static final String ENTITY_WORKBOOK = "workbook"; }
[ "qmwu2000@gmail.com" ]
qmwu2000@gmail.com
b5dfe972ec97c4f3e5c3e81c46e1310cbbcefe6d
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/boot/svg/a/a/yt.java
5af9e25448277f860b8f10d82cf9b074cebad49b
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
3,697
java
package com.tencent.mm.boot.svg.a.a; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Paint.Cap; import android.graphics.Paint.Join; import android.graphics.Paint.Style; import android.graphics.Path; import android.os.Looper; import com.tencent.mm.svg.WeChatSVGRenderC2Java; import com.tencent.mm.svg.c; public final class yt extends c { private final int height = 36; private final int width = 36; public final int a(int paramInt, Object[] paramArrayOfObject) { switch (paramInt) { default: case 0: case 1: case 2: } while (true) { paramInt = 0; while (true) { return paramInt; paramInt = 36; continue; paramInt = 36; } Canvas localCanvas = (Canvas)paramArrayOfObject[0]; paramArrayOfObject = (Looper)paramArrayOfObject[1]; Object localObject = c.h(paramArrayOfObject); float[] arrayOfFloat = c.g(paramArrayOfObject); Paint localPaint1 = c.k(paramArrayOfObject); localPaint1.setFlags(385); localPaint1.setStyle(Paint.Style.FILL); Paint localPaint2 = c.k(paramArrayOfObject); localPaint2.setFlags(385); localPaint2.setStyle(Paint.Style.STROKE); localPaint1.setColor(-16777216); localPaint2.setStrokeWidth(1.0F); localPaint2.setStrokeCap(Paint.Cap.BUTT); localPaint2.setStrokeJoin(Paint.Join.MITER); localPaint2.setStrokeMiter(4.0F); localPaint2.setPathEffect(null); c.a(localPaint2, paramArrayOfObject).setStrokeWidth(1.0F); localCanvas.save(); localPaint1 = c.a(localPaint1, paramArrayOfObject); localPaint1.setColor(-1); arrayOfFloat = c.a(arrayOfFloat, 1.0F, 0.0F, -3864.0F, 0.0F, 1.0F, -2672.0F); ((Matrix)localObject).reset(); ((Matrix)localObject).setValues(arrayOfFloat); localCanvas.concat((Matrix)localObject); localCanvas.save(); arrayOfFloat = c.a(arrayOfFloat, 1.0F, 0.0F, 3855.0F, 0.0F, 1.0F, 2663.0F); ((Matrix)localObject).reset(); ((Matrix)localObject).setValues(arrayOfFloat); localCanvas.concat((Matrix)localObject); localCanvas.save(); localPaint1 = c.a(localPaint1, paramArrayOfObject); localObject = c.l(paramArrayOfObject); ((Path)localObject).moveTo(42.0F, 12.0F); ((Path)localObject).lineTo(42.0F, 24.0F); ((Path)localObject).lineTo(45.0F, 24.0F); ((Path)localObject).lineTo(45.0F, 10.5F); ((Path)localObject).lineTo(45.0F, 9.0F); ((Path)localObject).lineTo(30.0F, 9.0F); ((Path)localObject).lineTo(30.0F, 12.0F); ((Path)localObject).lineTo(42.0F, 12.0F); ((Path)localObject).close(); ((Path)localObject).moveTo(12.0F, 42.0F); ((Path)localObject).lineTo(12.0F, 30.0F); ((Path)localObject).lineTo(9.0F, 30.0F); ((Path)localObject).lineTo(9.0F, 43.5F); ((Path)localObject).lineTo(9.0F, 45.0F); ((Path)localObject).lineTo(24.0F, 45.0F); ((Path)localObject).lineTo(24.0F, 42.0F); ((Path)localObject).lineTo(12.0F, 42.0F); ((Path)localObject).close(); WeChatSVGRenderC2Java.setFillType((Path)localObject, 2); localCanvas.drawPath((Path)localObject, localPaint1); localCanvas.restore(); localCanvas.restore(); localCanvas.restore(); c.j(paramArrayOfObject); } } } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes2-dex2jar.jar * Qualified Name: com.tencent.mm.boot.svg.a.a.yt * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
6ee7a37ac21314c53c31a03c60d922730548a8a5
502f548aba3cc269540db67e46710f358e452444
/src/main/java/com/fivewh/deploy/html/action/OperationAction.java
1dff595c08b729507875a3370a8360c8d242bc1f
[]
no_license
liu67224657/besl-deploy
6c68f25087415826cf49cc7d68f4e755186efc01
cf4e9009b0cb3b5f5b7a6cb41fdcdb0da7e8e078
refs/heads/master
2021-08-06T09:20:41.407243
2017-11-04T18:24:25
2017-11-04T18:24:25
109,518,750
0
0
null
null
null
null
UTF-8
Java
false
false
3,329
java
/** * (c) 2008 Fivewh.com */ package com.fivewh.deploy.html.action; import com.fivewh.deploy.*; import java.util.ArrayList; import java.util.Collection; /** * @Auther: <a mailto:yinpengyi@gmail.com>Yin Pengyi</a> */ public abstract class OperationAction extends AccessCheckAction { private String env; private String oper; private String args; private String exec; private String[] hosts = new String[]{}; protected Operation operation; protected OperationKey operKey; private OperationEnv operationEnv; private ExecType execType = ExecType.REFRESH; private Collection<OperationHost> envAllHosts; protected Collection<OperationHost> formSelectHosts = new ArrayList<OperationHost>(); private Collection<OperationHost> toolsPlatformHosts; ////////////////////////////////////////////////////////// public void setEnv(String env) { this.env = env; operationEnv = OperationManager.get().getOperationEnv(this.env); envAllHosts = OperationManager.get().getHostsByEnv(operationEnv).values(); toolsPlatformHosts = OperationManager.get().getToolsplatformHostsByEnv(operationEnv).values(); } public String getEnv() { return env; } public String getOper() { return oper; } public void setOper(String oper) { this.oper = oper; } public String getExec() { return exec; } public ExecType getExecType() { return execType; } public void setExec(String exec) { this.exec = exec; execType = ExecType.getTypeByCode(exec); } public String[] getHosts() { return hosts; } public void setHosts(String[] hosts) { this.hosts = hosts; } public String getArgs() { return args; } public void setArgs(String args) { this.args = args; } public boolean isPreview() { return ExecType.PREVIEW.equals(execType); } public boolean isRefresh() { return ExecType.REFRESH.equals(execType); } public boolean isExecute() { return ExecType.EXECUTE.equals(execType); } public boolean isRemove() { return ExecType.REMOVE.equals(execType); } public OperationEnv getOperationEnv() { return operationEnv; } public void setOperationEnv(OperationEnv operationEnv) { this.operationEnv = operationEnv; } public Collection<OperationHost> getEnvAllHosts() { return envAllHosts; } public void setEnvAllHosts(Collection<OperationHost> envAllHosts) { this.envAllHosts = envAllHosts; } public Collection<OperationHost> getToolsPlatformHosts() { return toolsPlatformHosts; } public void setToolsPlatformHosts(Collection<OperationHost> toolsPlatformHosts) { this.toolsPlatformHosts = toolsPlatformHosts; } public Collection<OperationHost> getFormSelectHosts() { return formSelectHosts; } public Operation getOperation() { return operation; } public void setOperation(Operation operation) { this.operation = operation; } public OperationKey getOperKey() { return operKey; } public void setOperKey(OperationKey operKey) { this.operKey = operKey; } }
[ "ericliu@staff.joyme.com" ]
ericliu@staff.joyme.com
c5426fd69ab424ec5acf73bd1c7bdfb907e3e1f0
111d2588c39f6ab2f74498a988ab6fde641f2362
/roncoo-education-user/roncoo-education-user-service/src/main/java/com/roncoo/education/user/dao/impl/mapper/LogLoginMapper.java
984e5d7fb38abf01537117c0d9f26a01f570cec7
[ "MIT" ]
permissive
JardelCheung/roncoo-education
fe61c76a1c9b8bf1d6813c2a578e60a0430b8f27
fde8109a028909b74ee234310697fbf79ad7ac15
refs/heads/master
2023-07-24T22:49:21.619061
2023-06-05T08:22:32
2023-06-05T08:22:32
394,108,638
0
0
MIT
2021-08-09T01:22:20
2021-08-09T01:22:19
null
UTF-8
Java
false
false
983
java
package com.roncoo.education.user.dao.impl.mapper; import com.roncoo.education.user.dao.impl.mapper.entity.LogLogin; import com.roncoo.education.user.dao.impl.mapper.entity.LogLoginExample; import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @Mapper public interface LogLoginMapper { int countByExample(LogLoginExample example); int deleteByExample(LogLoginExample example); int deleteByPrimaryKey(Long id); int insert(LogLogin record); int insertSelective(LogLogin record); List<LogLogin> selectByExample(LogLoginExample example); LogLogin selectByPrimaryKey(Long id); int updateByExampleSelective(@Param("record") LogLogin record, @Param("example") LogLoginExample example); int updateByExample(@Param("record") LogLogin record, @Param("example") LogLoginExample example); int updateByPrimaryKeySelective(LogLogin record); int updateByPrimaryKey(LogLogin record); }
[ "fengyw@roncoo.com" ]
fengyw@roncoo.com
7384bceaef84112dc20d63367cbf848069b5cb39
139960e2d7d55e71c15e6a63acb6609e142a2ace
/mobile_app1/module1147/src/main/java/module1147packageJava0/Foo84.java
3ae9f9ac841e0fef77e97ec461d9c9b01a90df5f
[ "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
391
java
package module1147packageJava0; import java.lang.Integer; public class Foo84 { Integer int0; Integer int1; public void foo0() { new module1147packageJava0.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
87a043f8e456f2d4528adcb93f513906e6cb88be
2ecef5908c27f392cd9ef3f77884d81b0064be1a
/src/test/java/info/jultest/test/interpret/PlatformErrorTests.java
d8ecc7122c6a4c906e45af72d72a73956264b8a4
[]
no_license
zhoux738/JSE
478b2419b2fea54890947989a8492489e34b4746
3b1d3f9ee4150213fb1589e95db64d375d920539
refs/heads/master
2022-07-08T12:08:14.006918
2021-06-29T20:41:25
2021-06-29T20:41:25
128,875,987
3
1
null
2022-07-01T22:17:26
2018-04-10T04:59:22
Java
UTF-8
Java
false
false
1,046
java
package info.jultest.test.interpret; import static info.jultest.test.Commons.getScriptFile; import static info.jultest.test.Commons.makeSimpleEngine; import org.junit.Test; import info.jultest.test.Commons; import info.jultest.test.ExceptionTestsBase; import info.jultest.test.TestExceptionHandler; import info.julang.execution.simple.SimpleScriptEngine; import info.julang.execution.symboltable.VariableTable; import info.julang.external.exceptions.EngineInvocationError; public class PlatformErrorTests extends ExceptionTestsBase { private static final String FEATURE = "PlatformError"; @Test public void stackOverflowTest() throws EngineInvocationError { VariableTable gvt = new VariableTable(null); SimpleScriptEngine engine = makeSimpleEngine(gvt); engine.getContext().addModulePath(Commons.SRC_REPO_ROOT); TestExceptionHandler teh = installExceptionHandler(engine); engine.run(getScriptFile(Commons.Groups.IMPERATIVE, FEATURE, "stackoverflow.jul")); assertException(teh, "System.StackOverflowException"); } }
[ "zhoux738@umn.edu" ]
zhoux738@umn.edu
3a435d7d5fe2799fb9835bc7138bc930f224b50b
95e1d755e34a3da8f1627cc1326b419cf2848ad8
/spring-netty-client/src/main/java/cn/intellif/springnettyclient/handler/Byte2MessageHandler.java
65429139ddf9afacb6595981effc7534d48b9634
[]
no_license
yinbucheng/spring-cloud-test
fe4263293636efa2f0fff089223123a5468390d2
b4ec003f7d4e7ae678c7ed1006967e5195761c0c
refs/heads/master
2020-03-25T11:26:12.035404
2018-12-05T12:05:11
2018-12-05T12:05:11
143,732,301
0
0
null
null
null
null
UTF-8
Java
false
false
1,270
java
package cn.intellif.springnettyclient.handler; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.ByteToMessageDecoder; import java.util.LinkedList; import java.util.List; public class Byte2MessageHandler extends ByteToMessageDecoder { @Override protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteBuf, List<Object> list) throws Exception { System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>进入到 Byte2Message中"); //这里我们认为 \n为结束符 byteBuf.markReaderIndex(); List<Byte> buf = new LinkedList<>(); int len = byteBuf.writerIndex()-byteBuf.readerIndex(); int i=0; boolean flag = false; while(i<len){ i++; byte data = byteBuf.readByte(); if(data==10){ flag = true; break; } buf.add(data); } if(flag){ int size = buf.size(); byte[] result = new byte[size]; for( i=0;i<size;i++){ result[i]=buf.get(i); } list.add(new String(result)); }else{ byteBuf.resetReaderIndex(); } } }
[ "yin.chong@intellif.com" ]
yin.chong@intellif.com
c70b55433d3939db68df4982cbe9ff7d5e63e1ef
e910113e034d4c8a73834d3a57bb60ef1abf5e44
/writePreApp_Vertical/src/main/java/com/sj/autolayout/attr/Attrs.java
35be8f7929fac9478df42aa4ed54d6bf97995896
[]
no_license
ElevenSJ/WritePre
70304fb3e2e291d8c0235eb33f4fe7581955bcc5
00b1e9ccfe20cc4ed43853d5637cc03dee72ed74
refs/heads/master
2020-03-10T10:40:53.087020
2018-04-13T02:49:00
2018-04-13T02:49:00
129,338,578
0
0
null
null
null
null
UTF-8
Java
false
false
1,102
java
package com.sj.autolayout.attr; /** * Created by zhy on 15/12/5. * <p/> * 与attrs.xml中数值对应 */ public interface Attrs { public static final int WIDTH = 1; public static final int HEIGHT = WIDTH << 1; public static final int TEXTSIZE = HEIGHT << 1; public static final int PADDING = TEXTSIZE << 1; public static final int MARGIN = PADDING << 1; public static final int MARGIN_LEFT = MARGIN << 1; public static final int MARGIN_TOP = MARGIN_LEFT << 1; public static final int MARGIN_RIGHT = MARGIN_TOP << 1; public static final int MARGIN_BOTTOM = MARGIN_RIGHT << 1; public static final int PADDING_LEFT = MARGIN_BOTTOM << 1; public static final int PADDING_TOP = PADDING_LEFT << 1; public static final int PADDING_RIGHT = PADDING_TOP << 1; public static final int PADDING_BOTTOM = PADDING_RIGHT << 1; public static final int MIN_WIDTH = PADDING_BOTTOM << 1; public static final int MAX_WIDTH = MIN_WIDTH << 1; public static final int MIN_HEIGHT = MAX_WIDTH << 1; public static final int MAX_HEIGHT = MIN_HEIGHT << 1; }
[ "3121792836@qq.com" ]
3121792836@qq.com
689b4b9eadb67ed13721a80f664c2678341ca4f8
33d5b98eea9568a783c979a7b726b47ffc95320c
/Fa7.Esp.Arq.Software.NonConventionalDatabase/pos/src/main/java/trabalhoBanco/UpdatTabelas.java
093e3ef366999388eb84ab63b6540bd41cb39223
[]
no_license
charles-marques/old-repos
152073dd1a89397f583ee247f402ac5a84c3af79
bc118df3dc98cfdbb99a5513ed511549da0673ed
refs/heads/main
2022-12-28T05:24:37.976348
2020-10-11T17:36:33
2020-10-11T17:36:33
303,175,993
0
0
null
null
null
null
UTF-8
Java
false
false
2,917
java
package trabalhoBanco; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.sql.Statement; public class UpdatTabelas { static final String JDBC_DRIVER = "org.postgresql.Driver"; static final String DB_URL = "jdbc:postgresql://localhost:5432/db_nosqlapp"; static final String USER = "postgres"; static final String PASS = "@dmin123"; static Connection conn = null; static Statement stmt = null; public void UpdateAlunos() throws SQLException{ conn = DriverManager.getConnection(DB_URL, USER, PASS); stmt = conn.createStatement(); Long in = System.currentTimeMillis(); for (int i = 0; i < 100000; i++) { String sql = "UPDATE ALUNOS SET NOME= 'Maria das Graças"+ i +"' WHERE ID_ALUNO =" +i; stmt.executeUpdate(sql); } Long out = System.currentTimeMillis(); System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 alunos"); } public void UpdateAulas() throws SQLException{ conn = DriverManager.getConnection(DB_URL, USER, PASS); stmt = conn.createStatement(); Long in = System.currentTimeMillis(); for (int i = 0; i < 100000; i++) { String sql = "UPDATE AULA SET DESCRICAO = 'Aula 0"+ i +"' WHERE ID_AULA =" +i; stmt.executeUpdate(sql); } Long out = System.currentTimeMillis(); System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 aulas"); } public void UpdateCursos() throws SQLException{ conn = DriverManager.getConnection(DB_URL, USER, PASS); stmt = conn.createStatement(); Long in = System.currentTimeMillis(); for (int i = 0; i < 100000; i++) { String sql = "UPDATE CURSOS SET DESCRICAO = 'Curso 0"+ i +"' WHERE ID_CURSO =" +i; stmt.executeUpdate(sql); } Long out = System.currentTimeMillis(); System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 cursos"); } public void UpdateMatriculas() throws SQLException{ conn = DriverManager.getConnection(DB_URL, USER, PASS); stmt = conn.createStatement(); Long in = System.currentTimeMillis(); for (int i = 0; i < 100000; i++) { String sql = "UPDATE MATRICULAS SET ID_ALUNO = '2' WHERE ID_ALUNO = 30"; stmt.executeUpdate(sql); } Long out = System.currentTimeMillis(); System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 matriculas"); } public void UpdateProfessores() throws SQLException{ conn = DriverManager.getConnection(DB_URL, USER, PASS); stmt = conn.createStatement(); Long in = System.currentTimeMillis(); for(int i = 0; i< 100000; i++){ String sql = "UPDATE PROFESSORES SET NOME = 'José da Silva' WHERE ID_PROFESSOR=" +i; stmt.executeUpdate(sql); } Long out = System.currentTimeMillis(); System.out.println("Demorou "+ ((out-in)/1000)+" seg para alterar 1000000 professores"); } }
[ "suporte@localhost.localdomain" ]
suporte@localhost.localdomain
df0850da42b794ca033506664f9569eec4a5a6f8
7cdff80497df675b971afe6cb4f4c5a42761d93e
/budgeteer-web-interface/src/main/java/org/wickedsource/budgeteer/service/imports/PlanRecordDatabaseImporter.java
5cd0de0b3dc60c73083d8eeeaae7b99754af2d4b
[]
no_license
schreumann/budgeteer
c28a05a240576295678cd84dc9b2deb29b850645
01c3c84f037b8bf51d82311130f969c601d6095b
refs/heads/master
2020-12-11T05:27:51.592808
2014-12-09T13:47:58
2014-12-09T13:47:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,456
java
package org.wickedsource.budgeteer.service.imports; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.joda.money.Money; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; import org.wickedsource.budgeteer.imports.api.ImportedPlanRecord; import org.wickedsource.budgeteer.persistence.budget.BudgetEntity; import org.wickedsource.budgeteer.persistence.person.DailyRateEntity; import org.wickedsource.budgeteer.persistence.person.DailyRateRepository; import org.wickedsource.budgeteer.persistence.person.PersonEntity; import org.wickedsource.budgeteer.persistence.record.PlanRecordEntity; import org.wickedsource.budgeteer.persistence.record.PlanRecordRepository; import javax.annotation.PostConstruct; import java.util.*; @Component @Scope("prototype") public class PlanRecordDatabaseImporter extends RecordDatabaseImporter { @Autowired private PlanRecordRepository planRecordRepository; @Autowired private DailyRateRepository dailyRateRepository; public PlanRecordDatabaseImporter(long projectId, String importType) { super(projectId, importType); } @PostConstruct public void init() { super.init(); } private Map<RecordKey, List<ImportedPlanRecord>> groupedRecords = new HashMap<RecordKey, List<ImportedPlanRecord>>(); public void importRecords(List<ImportedPlanRecord> records) { groupRecords(records); for (RecordKey key : groupedRecords.keySet()) { importRecordGroup(key, groupedRecords.get(key)); } } private void groupRecords(List<ImportedPlanRecord> records) { for (ImportedPlanRecord record : records) { RecordKey key = new RecordKey(record.getPersonName(), record.getBudgetName(), record.getDailyRate()); List<ImportedPlanRecord> keyList = groupedRecords.get(key); if (keyList == null) { keyList = new ArrayList<ImportedPlanRecord>(); groupedRecords.put(key, keyList); } keyList.add(record); } } /** * Imports a list of records with the same person, budget and daily rate. */ private void importRecordGroup(RecordKey groupKey, List<ImportedPlanRecord> records) { Date earliestDate = new Date(Long.MAX_VALUE); Date latestDate = new Date(0); BudgetEntity budget = getBudget(groupKey.getBudgetName()); PersonEntity person = getPerson(groupKey.getPersonName()); List<PlanRecordEntity> entitiesToImport = new ArrayList<PlanRecordEntity>(); for (ImportedPlanRecord record : records) { PlanRecordEntity recordEntity = new PlanRecordEntity(); recordEntity.setDate(record.getDate()); recordEntity.setPerson(person); recordEntity.setBudget(budget); recordEntity.setMinutes(record.getMinutesPlanned()); recordEntity.setImportRecord(getImportRecord()); recordEntity.setDailyRate(record.getDailyRate()); entitiesToImport.add(recordEntity); if (record.getDate().after(latestDate)) { latestDate = record.getDate(); } if (record.getDate().before(earliestDate)) { earliestDate = record.getDate(); } } planRecordRepository.save(entitiesToImport); if (!entitiesToImport.isEmpty()) { // creating daily rate or updating it with new start and end dates DailyRateEntity dailyRate = dailyRateRepository.findByBudgetAndPersonInDateRange(budget.getId(), person.getId(), earliestDate, latestDate); if (dailyRate == null) { dailyRate = new DailyRateEntity(); dailyRate.setBudget(budget); dailyRate.setPerson(person); } dailyRate.setRate(groupKey.getDailyRate()); dailyRate.setDateStart(earliestDate); dailyRate.setDateEnd(latestDate); dailyRateRepository.save(dailyRate); } // updating start and end date for import record if (getImportRecord().getStartDate() == null || getImportRecord().getStartDate().after(earliestDate)) { getImportRecord().setStartDate(earliestDate); } if (getImportRecord().getEndDate() == null || getImportRecord().getEndDate().before(latestDate)) { getImportRecord().setEndDate(latestDate); } } class RecordKey { private String personName; private String budgetName; private Money dailyRate; public RecordKey(String personName, String budgetName, Money dailyRate) { this.personName = personName; this.budgetName = budgetName; this.dailyRate = dailyRate; } public String getPersonName() { return personName; } public String getBudgetName() { return budgetName; } public Money getDailyRate() { return dailyRate; } @Override public boolean equals(Object o) { return EqualsBuilder.reflectionEquals(this, o); } @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } } }
[ "tom.hombergs@gmail.com" ]
tom.hombergs@gmail.com
f95ba3804244f3364fa4e274053bb8c9c1ea682e
8d4d2ab440a236a3ab4d4bda20f855ff86df2ebd
/src/main/java/com/randude14/hungergames/commands/admin/StopCommand.java
775399995456b3241400f82bb53732706431f499
[]
no_license
AtomicCraft/AtomicGames
5fe4f7c884d3ab28677c0fd730d93c74068150bf
a7a07b268ff559f3dd3b34f2647de039fce67def
refs/heads/master
2021-01-16T21:04:57.177000
2012-10-26T00:36:01
2012-10-26T00:36:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,155
java
package com.randude14.hungergames.commands.admin; import com.randude14.hungergames.Config; import com.randude14.hungergames.Defaults.Perm; import com.randude14.hungergames.GameManager; import com.randude14.hungergames.HungerGames; import com.randude14.hungergames.commands.Command; import com.randude14.hungergames.utils.ChatUtils; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class StopCommand extends Command { public StopCommand() { super(Perm.ADMIN_STOP, "stop", ADMIN_COMMAND); } @Override public void handle(CommandSender cs, String label, String[] args) { String name = (args.length < 1) ? Config.getDefaultGame() : args[0]; if (name == null) { ChatUtils.helpCommand(cs, getUsage(), HungerGames.CMD_ADMIN); return; } game = GameManager.INSTANCE.getRawGame(name); if (game == null) { ChatUtils.error(cs, "%s does not exist.", name); return; } if (!game.checkForGameOver(false)) game.stopGame(cs, false); } @Override public String getInfo() { return "manually stop a game"; } @Override public String getUsage() { return "/%s stop [game name]"; } }
[ "kitskub@gmail.com" ]
kitskub@gmail.com
9917390bb4ec5a0b73f59e5e78ddff42e1d50e72
7f63911cbabdf9a29ddf9105b132a6316b7596d8
/app/src/main/java/rohit/com/loginform2/AdminLoginActivity.java
133ddfb52221c3fa51cde8972c2b406964364aff
[]
no_license
singhbhavna/LoginForm2
24a4fd2c6776af679beef79f312e2697ceb99b47
e93240b22afece87d5ba14345c28ef1f670cb617
refs/heads/master
2020-03-25T05:01:35.362325
2018-06-23T03:39:48
2018-06-23T03:39:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package rohit.com.loginform2; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class AdminLoginActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_admin_login); } }
[ "rohit9075@gmail.com" ]
rohit9075@gmail.com
afb85e5ea6d13afd7182a9d481f99fb7b45bae3d
64e76c7291601b96ca8542c6b307a6b299f28dc5
/app/src/main/java/com/example/json/ui/ListaContactos.java
ed790985349f6e040372bb229248b5f42787941d
[]
no_license
Mamorky/JSON-Examples
0fc1d1bea5242d8641743a521165d1f18d29c0b5
857aada5799bbc3c33713f9642b9543a46a575f5
refs/heads/master
2021-05-05T08:04:31.393706
2018-02-08T13:40:43
2018-02-08T13:40:43
118,916,212
0
0
null
null
null
null
UTF-8
Java
false
false
4,040
java
package com.example.json.ui; import android.app.ProgressDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ListView; import android.widget.Toast; import com.example.json.R; import com.example.json.network.RestClient; import com.example.json.pojo.Contacto; import com.example.json.utils.Analisis; import com.loopj.android.http.JsonHttpResponseHandler; import org.json.JSONException; import org.json.JSONObject; import java.util.ArrayList; import cz.msebera.android.httpclient.Header; public class ListaContactos extends AppCompatActivity { //public static final String WEB = "192.168.3.57/acceso/contactos.json"; public static final String WEB = "http://portadaalta.mobi/acceso/contactos.json"; //public static final String WEB = "https://alumno.mobi/~alumno/superior/casielles/contactos.json"; //public static final String WEB = "http://192.168.0.139/acceso/contactos.json"; Button boton; ListView lista; ArrayList<Contacto> contactos; ArrayAdapter<Contacto> adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_lista_contactos); boton = findViewById(R.id.button); lista = findViewById(R.id.listView); lista.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) { Toast.makeText(ListaContactos.this, "Móvil: " + contactos.get(position).getTelefono().getMovil(), Toast.LENGTH_SHORT ).show(); } }); boton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { descarga(WEB); } }); } //usar JsonHttpResponseHandler() private void descarga(String web) { final ProgressDialog progreso = new ProgressDialog(this); RestClient.get(web, new JsonHttpResponseHandler() { @Override public void onStart() { super.onStart(); progreso.setProgressStyle(ProgressDialog. STYLE_SPINNER ); progreso.setMessage("Conectando . . ."); progreso.setCancelable(true); progreso.show(); } @Override public void onSuccess(int statusCode, Header[] headers, JSONObject response) { super.onSuccess(statusCode, headers, response); progreso.dismiss(); try { contactos = Analisis.analizarContactos(response); Toast.makeText(ListaContactos.this, "Descarga con éxito", Toast.LENGTH_SHORT).show(); mostrar(); } catch (JSONException e) { Toast.makeText(ListaContactos.this, "Error en el documento: " + e.getMessage(), Toast.LENGTH_SHORT).show(); } } @Override public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) { super.onFailure(statusCode, headers, throwable, errorResponse); progreso.dismiss(); } }); } private void mostrar() { if (contactos != null) if (adapter == null) { adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, contactos); lista.setAdapter(adapter); } else { adapter.clear(); adapter.addAll(contactos); } else Toast.makeText(getApplicationContext(), "Error al crear la lista", Toast. LENGTH_SHORT ).show(); } }
[ "andres_ball@hotmail.com" ]
andres_ball@hotmail.com
32549220bd63067c6daececf34f91d9d21ed4886
2d1c51fbf54c69e4a8e5bf01190c53d8ab719efd
/service_rc/src/main/java/com/run/app/generate/swagger/base/BaseSwgApp.java
e7818f4da1be51db663f0ea11e5c274d8d4f6649
[]
no_license
aixiaoqie/Tools
fa2077856532eae617f9a08aff9c4795aaa2582f
5c79c946c191f11e2f5f8d63b4f007a41ce30502
refs/heads/master
2022-07-15T04:24:34.144909
2019-12-10T12:51:09
2019-12-10T12:51:09
227,120,564
0
0
null
2022-06-30T14:46:56
2019-12-10T12:53:43
Java
UTF-8
Java
false
false
6,050
java
package com.run.app.generate.swagger.base; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.net.URLEncoder; import java.util.List; import java.util.Map; import javax.annotation.Resource; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFFont; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.beans.factory.annotation.Value; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.util.FileCopyUtils; import com.run.app.base.BaseApp; import com.run.ent.custom.ResultModel; import com.run.ent.extend.gp.GpUser; import com.run.utl.SymbolicConstant; import net.sf.json.JSONArray; public class BaseSwgApp extends BaseApp { @Value("${upload.diskPath}") public String diskPath;// 硬盘存放地址 @Value("${upload.linkPath}") public String linkPath;// 访问地址 @Resource public JdbcTemplate jdbcTemplate; protected GpUser getCurrentUser() { Object object = request.getAttribute(SymbolicConstant.REQUEST_CURRENT_USER); return object == null ? null : (GpUser) object; } protected String[] getResourcePathArray(String resourcePath) { if (StringUtils.isBlank(resourcePath)) return new String[] {}; String[] resourcePathArray = resourcePath.split("\\|"); for (int i = 0; i < resourcePathArray.length; i++) { resourcePathArray[i] = linkPath + resourcePathArray[i]; } return resourcePathArray; } @SuppressWarnings({ "unchecked" }) protected Object exportExcel(String fileName, JSONArray titleArray, ResultModel resultModel) throws IOException { HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); HSSFSheet sheet = hssfWorkbook.createSheet("统计表"); HSSFRow titleHssfRow = sheet.createRow(0); for (int i = 0; i < titleArray.size(); i++) { sheet.setColumnWidth((i + 1), 17 * 256); } HSSFCellStyle titleHssfCellStyle = hssfWorkbook.createCellStyle(); HSSFFont hssfFont = hssfWorkbook.createFont(); hssfFont.setBold(true); titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); titleHssfCellStyle.setFont(hssfFont); HSSFCell contentHssfCell = null; for (int i = 0; i < titleArray.size(); i++) { contentHssfCell = titleHssfRow.createCell(i); contentHssfCell.setCellValue(titleArray.getJSONObject(i).getString("columnText")); contentHssfCell.setCellStyle(titleHssfCellStyle); } List<Map<String, Object>> list = (List<Map<String, Object>>) resultModel.getData(); titleHssfCellStyle = hssfWorkbook.createCellStyle(); titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); hssfFont.setBold(false); titleHssfCellStyle.setFont(hssfFont); int rowNum = 1; for (Map<String, Object> map : list) { HSSFRow row = sheet.createRow(rowNum); for (int i = 0; i < titleArray.size(); i++) { contentHssfCell = row.createCell(i); { Object value = map.get(titleArray.getJSONObject(i).getString("columnName")); String cellValue = value == null ? "" : value.toString(); contentHssfCell.setCellValue(cellValue); } } rowNum++; } ByteArrayOutputStream out = new ByteArrayOutputStream(); hssfWorkbook.write(out); out.close(); hssfWorkbook.close(); ByteArrayInputStream inputStream = new ByteArrayInputStream(out.toByteArray()); final String userAgent = request.getHeader("USER-AGENT"); if (StringUtils.contains(userAgent, "MSIE")) {// IE浏览器 fileName = URLEncoder.encode(fileName, "UTF8"); } else if (StringUtils.contains(userAgent, "Mozilla")) {// google,火狐浏览器 fileName = new String(fileName.getBytes(), "ISO8859-1"); } else { fileName = URLEncoder.encode(fileName, "UTF8");// 其他浏览器 } response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); return FileCopyUtils.copy(inputStream, response.getOutputStream()); } @SuppressWarnings({ "unchecked" }) protected Object exportExcel(String fileName, JSONArray titleArray) throws IOException { HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); HSSFSheet sheet = hssfWorkbook.createSheet("统计表"); HSSFRow titleHssfRow = sheet.createRow(0); for (int i = 0; i < titleArray.size(); i++) { sheet.setColumnWidth((i + 1), 17 * 256); } HSSFCellStyle titleHssfCellStyle = hssfWorkbook.createCellStyle(); HSSFFont hssfFont = hssfWorkbook.createFont(); hssfFont.setBold(true); titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); titleHssfCellStyle.setFont(hssfFont); HSSFCell contentHssfCell = null; for (int i = 0; i < titleArray.size(); i++) { contentHssfCell = titleHssfRow.createCell(i); contentHssfCell.setCellValue(titleArray.getJSONObject(i).getString("columnText")); contentHssfCell.setCellStyle(titleHssfCellStyle); } titleHssfCellStyle = hssfWorkbook.createCellStyle(); titleHssfCellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); hssfFont.setBold(false); titleHssfCellStyle.setFont(hssfFont); ByteArrayOutputStream out = new ByteArrayOutputStream(); hssfWorkbook.write(out); out.close(); hssfWorkbook.close(); ByteArrayInputStream inputStream = new ByteArrayInputStream(out.toByteArray()); final String userAgent = request.getHeader("USER-AGENT"); if (StringUtils.contains(userAgent, "MSIE")) {// IE浏览器 fileName = URLEncoder.encode(fileName, "UTF8"); } else if (StringUtils.contains(userAgent, "Mozilla")) {// google,火狐浏览器 fileName = new String(fileName.getBytes(), "ISO8859-1"); } else { fileName = URLEncoder.encode(fileName, "UTF8");// 其他浏览器 } response.setContentType("application/vnd.ms-excel"); response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\""); return FileCopyUtils.copy(inputStream, response.getOutputStream()); } }
[ "2390734879@qq.com" ]
2390734879@qq.com
bd8098d632d31fe491e0fb8be34fb4d9c90ac292
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MOCKITO-3b-3-15-FEMO-WeightedSum:TestLen:CallDiversity/org/mockito/internal/invocation/InvocationMarker_ESTest_scaffolding.java
b17ac04fa6609c30764a71740a8221d3d05bb35f
[]
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
452
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Fri Apr 03 13:55:54 UTC 2020 */ package org.mockito.internal.invocation; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class InvocationMarker_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
29a72d018fcc65022d4e74baab51ad87f4d89dfe
d5644e529f2c067b6f3c3783e9782cf6df7c1611
/bitcamp-project-client/v33_2/src/main/java/com/eomcs/lms/dao/proxy/BoardDaoProxy.java
fd0d0bcc64a44b6569335189f02fad46a9b159b3
[]
no_license
JUNE-29/bitcamp-study
1806c5f392a41580268b62fbbf6d846d3d4d502b
d53b079f29bce74d2d67a31061b74fdc5972dcc0
refs/heads/master
2022-08-02T12:24:18.732053
2020-05-27T04:03:39
2020-05-27T04:03:39
225,501,857
0
0
null
null
null
null
UTF-8
Java
false
false
3,397
java
package com.eomcs.lms.dao.proxy; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.Socket; import java.util.List; import com.eomcs.lms.dao.BoardDao; import com.eomcs.lms.domain.Board; // 프록시 객체는 항상 작업 객체와 동일한 인터페이스를 구현해야 한다. // => 마치 자신이 작업 객체인양 보이기 위함이다. // public class BoardDaoProxy implements BoardDao { String host; int port; public BoardDaoProxy(String host, int port) { this.host = host; this.port = port; } @Override public int insert(Board board) throws Exception { // 호출 하는 시점에서 연결된다. try (Socket socket = new Socket(host, port); // 입출력 준비 ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) { out.writeUTF("/board/add"); out.writeObject(board); out.flush(); String response = in.readUTF(); if (response.equals("FAIL")) { throw new Exception(in.readUTF()); // 이유를 읽고 Exception으로 해서 클라이언트에게 던진다. } return 1; } } @SuppressWarnings("unchecked") @Override public List<Board> findAll() throws Exception { try (Socket socket = new Socket(host, port); ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) { out.writeUTF("/board/list"); // 서버에 요청! out.flush(); String response = in.readUTF(); if (response.equals("FAIL")) { throw new Exception(in.readUTF()); } return (List<Board>) in.readObject(); } } @Override public Board findByNo(int no) throws Exception { try (Socket socket = new Socket(host, port); ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) { out.writeUTF("/board/detail"); out.writeInt(no); out.flush(); String response = in.readUTF(); if (response.equals("FAIL")) { throw new Exception(in.readUTF()); } return (Board) in.readObject(); } } @Override public int update(Board board) throws Exception { try (Socket socket = new Socket(host, port); ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) { out.writeUTF("/board/update"); out.writeObject(board); out.flush(); String response = in.readUTF(); if (response.equals("FAIL")) { throw new Exception(in.readUTF()); } return 1; // 한 개 업데이트 했다. } } @Override public int delete(int no) throws Exception { try (Socket socket = new Socket(host, port); ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream()); ObjectInputStream in = new ObjectInputStream(socket.getInputStream())) { out.writeUTF("/board/delete"); out.writeInt(no); out.flush(); String response = in.readUTF(); if (response.equals("FAIL")) { throw new Exception(in.readUTF()); } return 1; } } }
[ "jiyuni529@gmail.com" ]
jiyuni529@gmail.com
23dc3fc78b69570e2ba1aa27d622e96fa13a5369
487739942e747ea005d001ceb439e53cd0d215c7
/src/net/kagani/game/npc/others/HarpieBug.java
cdd2399586a381518248755cd8aac9c1deb46f10
[]
no_license
99max99/PhoenixRisingServer
fbdc61eff78de3a4d29caa1eaa8c67837b73840f
1815a47c071b7351baa1eb0178ffe6b965e8ccf4
refs/heads/master
2021-01-11T10:29:06.968358
2016-12-29T02:01:23
2016-12-29T02:01:23
76,208,559
0
0
null
null
null
null
UTF-8
Java
false
false
659
java
package net.kagani.game.npc.others; import net.kagani.game.Hit; import net.kagani.game.WorldTile; import net.kagani.game.npc.NPC; import net.kagani.game.player.Player; @SuppressWarnings("serial") public class HarpieBug extends NPC { public HarpieBug(int id, WorldTile tile, int mapAreaNameHash, boolean canBeAttackFromOutOfArea) { super(id, tile, mapAreaNameHash, canBeAttackFromOutOfArea); } @Override public void handleIngoingHit(Hit hit) { if (hit.getSource() instanceof Player) { Player player = (Player) hit.getSource(); if (player.getEquipment().getShieldId() != 7053) hit.setDamage(0); } super.handleIngoingHit(hit); } }
[ "emrosswarone@gmail.com" ]
emrosswarone@gmail.com
1656b43c4163e2324f40069e146d43772f21b6cd
7463bfa04676c561ff009f7d9c155caae3fc42b6
/CookingInTranslation/src/main/java/io/trtong/web/rest/errors/EmailAlreadyUsedException.java
8d5c9ac860fd9020f73498bedc12d4bd7325e03d
[]
no_license
trtong/CookingInTranslation
1487b04742106a053e7e867347e5b6ab8815eb73
08f306fff6bd3b7a3ad766a037e3d74bae35a78e
refs/heads/master
2021-06-28T23:06:29.042439
2019-01-06T01:21:31
2019-01-06T01:21:31
157,254,546
0
1
null
2020-09-18T12:27:47
2018-11-12T18:00:42
Java
UTF-8
Java
false
false
330
java
package io.trtong.web.rest.errors; public class EmailAlreadyUsedException extends BadRequestAlertException { private static final long serialVersionUID = 1L; public EmailAlreadyUsedException() { super(ErrorConstants.EMAIL_ALREADY_USED_TYPE, "Email is already in use!", "userManagement", "emailexists"); } }
[ "trt.tong@gmail.com" ]
trt.tong@gmail.com
2bd6665f0e1d852c979ef3b428e02fb44f53f5a5
4abd603f82fdfa5f5503c212605f35979b77c406
/html/Programs/hw11/5456594640742e6288667d71353ef9e4/CriticalDis.java
865f67a5c3b07d908ae3a01256a354b4e5934a93
[]
no_license
dn070017/1042-PDSA
b23070f51946c8ac708d3ab9f447ab8185bd2a34
5e7d7b1b2c9d751a93de9725316aa3b8f59652e6
refs/heads/master
2020-03-20T12:13:43.229042
2018-06-15T01:00:48
2018-06-15T01:00:48
137,424,305
0
0
null
null
null
null
UTF-8
Java
false
false
3,450
java
import java.io.BufferedReader; import java.io.FileReader; import java.text.DecimalFormat; import java.util.Arrays; public class CriticalDis { public static void main(String[] args) throws Exception { // TODO code application logic here double d = 0.250; try (BufferedReader br = new BufferedReader(new FileReader(args[0]))) { int DotNumber = Integer.parseInt(br.readLine()); double[][] distance = new double[DotNumber][DotNumber]; Point2D[] dot = new Point2D[DotNumber]; double[] value = new double[DotNumber]; int e = 0; while (true) { String header = br.readLine(); if (header == null) { break; } String[] place = header.split("" ""); double x = Double.parseDouble(place[0]); double y = Double.parseDouble(place[1]); value[e] = x + y; dot[e] = new Point2D(x, y); // StdDraw.filledCircle(dot[e].x(), dot[e].y(),0.01); // StdDraw.text(dot[e].x(), dot[e].y()+0.03,String.valueOf(e+1)); e++; } Arrays.sort(value); double s = value[0]; double t = value[DotNumber - 1]; // System.out.print(""s: ""); // System.out.print(s); // System.out.printf(""\n""); // System.out.print(""t: ""); // System.out.print(t); // System.out.printf(""\n""); int dotmin = 0; int dotmax = 0; for (int m = 0; m < DotNumber; m++) { if (dot[m].x() + dot[m].y() == s) { dotmin = m; // StdDraw.setPenColor(Color.RED); // StdDraw.text(dot[m].x(), dot[m].y()+0.03,String.valueOf(m+1)); } else if (dot[m].x() + dot[m].y() == t) { dotmax = m; // StdDraw.setPenColor(Color.GREEN); // StdDraw.text(dot[m].x(), dot[m].y()+0.03,String.valueOf(m+1)); } } while (d < 1.414) { Digraph G = new Digraph(DotNumber); for (int i = 0; i < DotNumber; i++) { for (int k = 1; k < DotNumber; k++) { double b = dot[k].x() - dot[i].x(); double c = dot[k].y() - dot[i].y(); if ((dot[k].x() + dot[k].y()) - (dot[i].x() + dot[i].y()) > 0 && dot[k].x() - dot[i].x() > 0 && dot[k].y() - dot[i].y() > 0 && Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2)) < d) { G.addEdge(i, k); // StdDraw.line(dot[k].x(),dot[k].y() , dot[i].x(), dot[i].y()); // StdDraw.text((dot[k].x()+dot[i].x())/2, (dot[k].y()+dot[i].y())/2, String.valueOf(Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2)))); } } } DirectedDFS dfs = new DirectedDFS(G, dotmin); if (dfs.marked(dotmax) == true) { break; } d = d + 0.001; } } d = d - 0.001; System.out.printf(""%1.3f\n"", d); // StdOut.println(G); } }
[ "dn070017@gmail.com" ]
dn070017@gmail.com
197c6aeb879b8ce1771a3d551c610d65542b16c5
de4b7ec66bf8502fe090d45b76ebd5817a88ab1f
/src/main/java/com/futao/springmvcdemo/annotation/listener/OnlineHttpSessionListener.java
6b3d037beee47cecc1aecf51d0621051492d1b37
[ "MIT" ]
permissive
FutaoSmile/SpringMvcStudyBaseXML
2fdb4aec98fdd8abd8f58b59ce71e7aa22ccb62e
ebf6cf0d3e476962d1cb6a33f373285870e4225a
refs/heads/master
2022-12-22T07:17:10.262179
2022-07-24T03:49:22
2022-07-24T03:49:22
176,199,070
2
0
MIT
2022-12-16T04:47:05
2019-03-18T03:37:07
Java
UTF-8
Java
false
false
1,618
java
//package com.futao.springmvcdemo.annotation.listener; // //import com.futao.springmvcdemo.model.system.SystemConfig; //import org.springframework.stereotype.Component; // //import javax.annotation.Resource; //import javax.servlet.annotation.WebListener; //import javax.servlet.http.HttpSessionEvent; //import javax.servlet.http.HttpSessionListener; //import java.util.concurrent.atomic.AtomicInteger; // ///** // * HttpSession监听器,统计在线人数 // * // * @author futao // * Created on 2018/10/11. // */ //@Component //@WebListener("onlinePeopleQuantity") //public class OnlineHttpSessionListener implements HttpSessionListener { // // @Resource // private SystemConfig systemConfig; // // /** // * 在线人数量 // */ // private AtomicInteger onlinePeopleQuantity = new AtomicInteger(); // // /** // * Notification that a session was created. // * // * @param se the notification event // */ // @Override // public void sessionCreated(HttpSessionEvent se) { // onlinePeopleQuantity.addAndGet(systemConfig.getOnlinePeopleQuantityScale()); // } // // /** // * Notification that a session is about to be invalidated. // * // * @param se the notification event // */ // @Override // public void sessionDestroyed(HttpSessionEvent se) { // onlinePeopleQuantity.addAndGet(-systemConfig.getOnlinePeopleQuantityScale()); // } // // /** // * 获取在线人数 // * // * @return 在线人数 // */ // public AtomicInteger getOnlinePeopleQuantity() { // return onlinePeopleQuantity; // } //}
[ "1185172056@qq.com" ]
1185172056@qq.com
1099d0fe67875974e687671b14ee81782a206661
297aa14030ca7a285229d4096ef526c2d8c0cee9
/src/main/java/spring/condition/WindowsListService.java
7e5e157bd39f4a79865190945be9e5c562603824
[]
no_license
1064447034/thinkjava
2311cd84f7b30d401daae7ca4ac6f6d63b73e1c5
c08e4c3635fa068f9bae485ea18209c7fd502b03
refs/heads/master
2020-04-06T13:22:26.096788
2019-01-02T05:48:48
2019-01-02T05:48:48
157,496,979
0
0
null
null
null
null
UTF-8
Java
false
false
302
java
package spring.condition; import org.springframework.context.annotation.Conditional; import org.springframework.stereotype.Service; @Service @Conditional(WindowsCondition.class) public class WindowsListService implements ListService { @Override public String showListCmd() { return "dir"; } }
[ "zbs39170@ly.com" ]
zbs39170@ly.com
fa67650aaef22f0c4d80c4dfc5bfcbab68fdb8f0
cc1b47db2b25d7f122d0fb48a4917fd01f129ff8
/integration/domino-jnx-jakarta-security/src/main/java/com/hcl/domino/jnx/jakarta/security/NotesDirectoryIdentityStore.java
1f5573c1e4c7a0b2037614efb363bef6aa0a26d1
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
savlpavel/domino-jnx
666f7e12abdf5e36b471cdd7c99086db589f923f
2d94e42cdfa56de3b117231f4488685f8e084e83
refs/heads/main
2023-09-04T10:20:43.968949
2023-07-31T16:41:34
2023-07-31T16:41:34
392,598,440
0
1
Apache-2.0
2021-08-04T07:49:29
2021-08-04T07:49:29
null
UTF-8
Java
false
false
3,917
java
/* * ========================================================================== * Copyright (C) 2019-2022 HCL America, Inc. ( http://www.hcl.com/ ) * All rights reserved. * ========================================================================== * Licensed under the Apache License, Version 2.0 (the "License"). You may * not use this file except in compliance with the License. You may obtain a * copy of the License at <http://www.apache.org/licenses/LICENSE-2.0>. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * ========================================================================== */ package com.hcl.domino.jnx.jakarta.security; import java.util.LinkedHashSet; import java.util.Set; import javax.naming.AuthenticationException; import javax.naming.AuthenticationNotSupportedException; import javax.naming.NameNotFoundException; import com.hcl.domino.BuildVersionInfo; import com.hcl.domino.DominoClient; import com.hcl.domino.DominoClientBuilder; import com.hcl.domino.misc.NotesConstants; import jakarta.enterprise.context.ApplicationScoped; import jakarta.security.enterprise.credential.Credential; import jakarta.security.enterprise.credential.UsernamePasswordCredential; import jakarta.security.enterprise.identitystore.CredentialValidationResult; import jakarta.security.enterprise.identitystore.IdentityStore; @ApplicationScoped public class NotesDirectoryIdentityStore implements IdentityStore { @Override public Set<String> getCallerGroups(final CredentialValidationResult validationResult) { final String dn = validationResult.getCallerDn(); return this.getGroups(dn); } private Set<String> getGroups(final String dn) { try (DominoClient client = DominoClientBuilder.newDominoClient().asUser(dn).build()) { // TODO filter out non-glob names return new LinkedHashSet<>(client.getEffectiveUserNamesList(null).toList()); } } @Override public int priority() { return 70; } @Override public CredentialValidationResult validate(final Credential credential) { return IdentityStore.super.validate(credential); } public CredentialValidationResult validate(final UsernamePasswordCredential credential) { try (DominoClient client = DominoClientBuilder.newDominoClient().build()) { try { final String dn = client.validateCredentials(null, credential.getCaller(), credential.getPasswordAsString()); return new CredentialValidationResult(null, dn, dn, dn, this.getGroups(dn)); } catch(AuthenticationException e) { // On 12.0.1+, we may only get an AuthenticationException based on the single API call. // In this case, try to look up the user to see if it's invalid or not a valid name at all BuildVersionInfo buildVersion = client.getBuildVersion(null); if(buildVersion != null && buildVersion.isAtLeast(12, 0, 1, 0, 0)) { if(client.openUserDirectory(null).lookupUserValue(credential.getCaller(), NotesConstants.MAIL_FULLNAME_ITEM).isPresent()) { return CredentialValidationResult.INVALID_RESULT; } else { return CredentialValidationResult.NOT_VALIDATED_RESULT; } } return CredentialValidationResult.INVALID_RESULT; } } catch (final NameNotFoundException e) { return CredentialValidationResult.NOT_VALIDATED_RESULT; } catch (AuthenticationNotSupportedException e) { return CredentialValidationResult.INVALID_RESULT; } } @Override public Set<ValidationType> validationTypes() { return IdentityStore.DEFAULT_VALIDATION_TYPES; } }
[ "jesse@secondfoundation.org" ]
jesse@secondfoundation.org
c12ae2d052f28691db67dc259c03c38bcbcc06a0
4d9d48359286b55e1d01ada39b4a5286add2eae6
/src/main/java/weka/gui/beans/ImageListener.java
ec672dd7d5cad8749c7f8680d033ecdfb35763a2
[]
no_license
Mihir2/HCoreDist
969ead235abf42aa3c6779482a80caae61acbcca
c23eebc1777e95398308909506bad75308412874
refs/heads/master
2021-04-15T18:06:08.584262
2018-03-24T17:18:43
2018-03-24T17:18:43
126,339,452
0
0
null
null
null
null
UTF-8
Java
false
false
1,220
java
/* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ /* * ImageListener.java * Copyright (C) 2011-2012 University of Waikato, Hamilton, New Zealand * */ package weka.gui.beans; import java.util.EventListener; /** * Interface to something that can process an ImageEvent * * @author Mark Hall (mhall{[at]}pentaho{[dot]}com) * @version $Revision$ */ public interface ImageListener extends EventListener { /** * Accept and process an ImageEvent * * @param image the image to process */ void acceptImage(ImageEvent image); }
[ "mihirchauhan9@gmail.com" ]
mihirchauhan9@gmail.com
00d898f45199b1788418d39add4019c9a35f0976
007364d2a8803853f41534d547bd9e66ab66e240
/app/src/main/java/com/maple/demo/myarms/mvp/ui/activity/RegisteActivity.java
b1cf14bba8de01cc125821a51a8e384ba33a7beb
[]
no_license
gaoguanqi/MyArms
70657a2d69460a4c56587aee3773bc8ba497f229
efb61d72b99c81aa654b5945322ac1baea95abdf
refs/heads/master
2020-04-11T21:15:07.343476
2019-04-12T09:42:44
2019-04-12T09:42:44
162,099,707
0
0
null
null
null
null
UTF-8
Java
false
false
2,813
java
package com.maple.demo.myarms.mvp.ui.activity; import android.content.Intent; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.jess.arms.di.component.AppComponent; import com.jess.arms.utils.ArmsUtils; import com.jess.arms.utils.RxLifecycleUtils; import com.maple.demo.myarms.R; import com.maple.demo.myarms.app.base.BaseViewActivity; import com.maple.demo.myarms.app.manager.toolbar.ToolbarConfig; import com.maple.demo.myarms.di.component.DaggerRegisteComponent; import com.maple.demo.myarms.di.module.RegisteModule; import com.maple.demo.myarms.mvp.contract.RegisteContract; import com.maple.demo.myarms.mvp.model.api.ApiService; import com.maple.demo.myarms.mvp.presenter.RegistePresenter; import com.maple.demo.myarms.utils.LogUtils; import com.maple.demo.myarms.utils.ToastUtil; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.functions.Consumer; import io.reactivex.schedulers.Schedulers; import me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber; import static com.jess.arms.utils.Preconditions.checkNotNull; public class RegisteActivity extends BaseViewActivity<RegistePresenter> implements RegisteContract.View { @Override public void setupActivityComponent(@NonNull AppComponent appComponent) { DaggerRegisteComponent //如找不到该类,请编译一下项目 .builder() .appComponent(appComponent) .registeModule(new RegisteModule(this)) .build() .inject(this); } @Override public int initView(@Nullable Bundle savedInstanceState) { return R.layout.activity_registe; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0 } @Override public void initData(@Nullable Bundle savedInstanceState) { String id = "10011"; mPresenter.getTest(id); } @Override public void showLoading() { } @Override public void hideLoading() { } @Override public void showMessage(@NonNull String message) { checkNotNull(message); ToastUtil.showToast(message); } @Override public void launchActivity(@NonNull Intent intent) { checkNotNull(intent); ArmsUtils.startActivity(intent); } @Override public void killMyself() { finish(); } @Override protected ToolbarConfig getToolbarConfig() { return ToolbarConfig.builder() .setTitle("注册") .setToolbarLitener(this) .build(); } @Override protected void onToolbarBack() { killMyself(); } @Override protected boolean useMultipleStatusView() { return false; } }
[ "307590625@qq.com" ]
307590625@qq.com
66d4bb420f5f942390bdad79778ac13a6c27df5d
0fddaec8e389712107e99fb40a32903809416d7d
/plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/virtual/VirtualAttributeDeleteAction.java
68708dae65bee319edec9f803e5adfd61c663b4c
[ "EPL-1.0", "Apache-2.0", "LGPL-2.0-or-later" ]
permissive
kai-morich/dbeaver
83dce3057f510fe110380300c7eb51e5d5b5de21
0694ed136ddf089a5a01a0ceebd6e67585a7b2ee
refs/heads/devel
2022-02-19T00:07:03.733415
2022-02-11T14:35:37
2022-02-11T14:35:37
255,131,238
4
0
Apache-2.0
2020-04-12T17:08:35
2020-04-12T17:08:34
null
UTF-8
Java
false
false
2,255
java
/* * DBeaver - Universal Database Manager * Copyright (C) 2010-2022 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jkiss.dbeaver.ui.controls.resultset.virtual; import org.eclipse.jface.action.Action; import org.jkiss.dbeaver.model.data.DBDAttributeBinding; import org.jkiss.dbeaver.model.data.DBDAttributeBindingCustom; import org.jkiss.dbeaver.model.virtual.DBVEntity; import org.jkiss.dbeaver.model.virtual.DBVEntityAttribute; import org.jkiss.dbeaver.ui.UIUtils; import org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer; public class VirtualAttributeDeleteAction extends Action { private ResultSetViewer resultSetViewer; private DBDAttributeBinding attr; public VirtualAttributeDeleteAction(ResultSetViewer resultSetViewer, DBDAttributeBinding attr) { super("Delete virtual column '" + attr.getName() + "'"); this.resultSetViewer = resultSetViewer; this.attr = attr; } @Override public boolean isEnabled() { return (attr instanceof DBDAttributeBindingCustom); } @Override public void run() { if (!(attr instanceof DBDAttributeBindingCustom)) { return; } DBVEntityAttribute vAttr = ((DBDAttributeBindingCustom)attr).getEntityAttribute(); if (!UIUtils.confirmAction(resultSetViewer.getControl().getShell(), "Delete column '" + vAttr.getName() + "'", "Are you sure you want to delete virtual column '" + vAttr.getName() + "'?")) { return; } DBVEntity vEntity = resultSetViewer.getModel().getVirtualEntity(false); vEntity.removeVirtualAttribute(vAttr); vEntity.persistConfiguration(); resultSetViewer.refreshMetaData(); } }
[ "serge@jkiss.org" ]
serge@jkiss.org
649a67fa4f03ddbc6bd32134500e52cd9b0a2c85
18d47c6761d7b5ff298aa550ba73113d724531b2
/firstdemo/src/com/neuedu/api/object0728/three/Goods.java
fddcbb538c7a26f04c3e1ca7ace79cce07555d26
[]
no_license
jeaniely/taili204
135c04c78ab20e407b6ad44b57f00098e2501067
68c8e1f42f4e84918b7c11c6d5d6e726ab754cb1
refs/heads/master
2022-12-04T10:22:55.383875
2020-08-17T04:52:04
2020-08-17T04:52:04
288,086,255
0
0
null
null
null
null
UTF-8
Java
false
false
803
java
package com.neuedu.api.object0728.three; import java.math.BigDecimal; public class Goods { private String name; private BigDecimal price; private Integer stock; public String getName() { return name; } public void setName(String name) { this.name = name; } public BigDecimal getPrice() { return price; } public void setPrice(BigDecimal price) { this.price = price; } public Integer getStock() { return stock; } public void setStock(Integer stock) { this.stock = stock; } @Override public String toString() { return "Goods{" + "name='" + name + '\'' + ", price=" + price + ", stock=" + stock + '}'; } }
[ "574156761@qq.com" ]
574156761@qq.com
c9a6e6d7f2a69acb243c5815ca2c4866167a99d5
a6a6fb681bc0222e16454bb3ddb79696e6ea1ad5
/disassembly_2020-07-06/sources/com/samsung/android/sdk/cover/LegacyLedSystemEventListenerDelegate.java
c5d8d9cd0a234d2728a897c99bb98337f6fc2320
[]
no_license
ThePBone/GalaxyBudsLive-Disassembly
6f9c1bf03c0fd27689dcc2440f754039ac54b7a1
ad119a91b20904f8efccc797f3084005811934c8
refs/heads/master
2022-11-23T13:20:54.555338
2020-07-28T21:33:30
2020-07-28T21:33:30
282,281,940
3
2
null
null
null
null
UTF-8
Java
false
false
4,158
java
package com.samsung.android.sdk.cover; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.util.Log; import com.samsung.android.cover.INfcLedCoverTouchListenerCallback; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; class LegacyLedSystemEventListenerDelegate extends INfcLedCoverTouchListenerCallback.Stub { private static final int MSG_SYSTEM_COVER_EVENT = 0; private static final String SYSTEM_EVENT_LED_OFF_COMMAND = "led_off_command"; /* access modifiers changed from: private */ public static final String TAG = LegacyLedSystemEventListenerDelegate.class.getSimpleName(); private ListenerDelegateHandler mHandler; private Object mListener; public void onCoverTouchAccept() throws RemoteException { } public void onCoverTouchReject() throws RemoteException { } LegacyLedSystemEventListenerDelegate(Object obj, Handler handler, Context context) { this.mListener = obj; this.mHandler = new ListenerDelegateHandler(handler == null ? context.getMainLooper() : handler.getLooper(), this.mListener); } public Object getListener() { return this.mListener; } public void onSystemCoverEvent(int i, int[] iArr) throws RemoteException { Message obtainMessage = this.mHandler.obtainMessage(0); obtainMessage.arg1 = i; obtainMessage.obj = iArr; obtainMessage.sendToTarget(); } private static class ListenerDelegateHandler extends Handler { private final Object mListener; public ListenerDelegateHandler(Looper looper, Object obj) { super(looper); this.mListener = obj; } public void handleMessage(Message message) { if (this.mListener != null && message.what == 0) { int[] iArr = (int[]) message.obj; Method method = null; try { method = this.mListener.getClass().getMethod("onSystemCoverEvent", new Class[]{Integer.TYPE, Bundle.class}); } catch (SecurityException e) { Log.e(LegacyLedSystemEventListenerDelegate.TAG, "Error getting onSystemCoverEvent method", e); } catch (NoSuchMethodException e2) { Log.e(LegacyLedSystemEventListenerDelegate.TAG, "Error getting onSystemCoverEvent method", e2); } if (method != null) { if (iArr != null) { try { if (iArr.length >= 1) { Bundle bundle = new Bundle(); bundle.putInt(LegacyLedSystemEventListenerDelegate.SYSTEM_EVENT_LED_OFF_COMMAND, iArr[0]); method.invoke(this.mListener, new Object[]{Integer.valueOf(message.arg1), bundle}); return; } } catch (IllegalAccessException e3) { String access$000 = LegacyLedSystemEventListenerDelegate.TAG; Log.e(access$000, "Error invoking " + method.getName(), e3); return; } catch (IllegalArgumentException e4) { String access$0002 = LegacyLedSystemEventListenerDelegate.TAG; Log.e(access$0002, "Error invoking " + method.getName(), e4); return; } catch (InvocationTargetException e5) { String access$0003 = LegacyLedSystemEventListenerDelegate.TAG; Log.e(access$0003, "Error invoking " + method.getName(), e5); return; } } String access$0004 = LegacyLedSystemEventListenerDelegate.TAG; Log.e(access$0004, "Error: system event args empty: " + iArr); } } } } }
[ "thebone.main@gmail.com" ]
thebone.main@gmail.com
b94bcaffcd22918ba87e53c88acb68a725ac8b14
f27f09e4b4b2302e33b84417a16fbb5c698b1cdc
/gwtent/src/main/java/com/gwtent/reflection/client/annotations/Reflect_SubClasses.java
0e6ef6261b283e03cba7508b0258a9b9bde7a8ab
[ "Apache-2.0" ]
permissive
nikelin/gwtent
f24b63fb49c698d561cca12bf83e72ee61dad7f8
e42ac106ad1b51e5d9764a86f9a9588c2a289410
refs/heads/master
2020-04-19T10:18:50.905010
2014-09-12T15:24:58
2014-09-12T15:24:59
23,965,815
2
3
null
null
null
null
UTF-8
Java
false
false
545
java
package com.gwtent.reflection.client.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.gwtent.reflection.client.Reflectable; /** * Just sub classes, limit to without relationTypes * * @author JamesLuo.au@gmail.com * */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Reflectable(relationTypes=false, superClasses=false, assignableClasses=true) public @interface Reflect_SubClasses { }
[ "self@nikelin.ru" ]
self@nikelin.ru
fb7a70bf41dfccc3e68fae2fcd01ac90372db2c3
9122cf28169b2d053a26e5d5cefacda018fb95b9
/algorithm/amazononlineassessment/src/main/java/com/amazon/question/MergeKSortedLists.java
9915ce2b3feeaaea34ed2aa178916a8c7117fc3d
[]
no_license
siddhantaws/DataStructure-Algorithm
661f8ab75bcb2d5c68616b1e71a25e459b6a797a
cbd5398f24e075320eedcb7a83807954509e9467
refs/heads/master
2023-04-08T03:32:31.791195
2023-03-19T13:26:42
2023-03-19T13:26:42
88,467,251
1
1
null
2022-05-16T17:39:19
2017-04-17T04:13:41
Java
UTF-8
Java
false
false
2,347
java
package com.amazon.question; import org.w3c.dom.NodeList; public class MergeKSortedLists { private ListNode[] lists ; public MergeKSortedLists(ListNode[] lists) { this.lists = lists; } private ListNode mergeKLists(){ mergeKLists(0 , lists.length-1); for(int i=0;i<lists.length;i++) if(lists[i]!=null) return lists[i]; return null; } private void mergeKLists(int l ,int r) { if(l>r) return; else{ int mid = l + (r-l)/2; mergeKLists(l,mid); mergeKLists(mid+1,r); ListNode first =null;ListNode second =null; int fIndex =-1; int secondIndex =-1; while(l<mid){ if(first==null && lists[l]!=null){ first =lists[l]; fIndex=l; break; } } l=mid+1; while(l<r){ if(second==null && lists[l]!=null){ second =lists[l]; secondIndex=l; break; } } ListNode nodeList1 =merge(first , second); lists[secondIndex]=null; lists[fIndex]=nodeList1; } } private ListNode merge(ListNode first, ListNode second){ if(first==null) return second; if(second==null) return first; else{ if(first.val<second.val){ first.next =merge(first.next,second); return first; }else { second.next =merge(first,second.next); return second; } } } public static void main(String[] args) { ListNode node[] =new ListNode[3]; node[0]= new ListNode(1);node[0].next =new ListNode(4);node[0].next.next =new ListNode(5); node[1]= new ListNode(1);node[1].next =new ListNode(3);node[1].next.next =new ListNode(4); node[2]= new ListNode(2);node[2].next =new ListNode(6); MergeKSortedLists sortedLists =new MergeKSortedLists(node); ListNode node1 =sortedLists.mergeKLists(); } static class ListNode { int val; ListNode next; ListNode(int x) { val = x; } } }
[ "siddhantaws@gmail.com" ]
siddhantaws@gmail.com
f69e507525351878e7d7ac8a5fa62f06ef86e48a
d0d9ba9fd4e3d88fc7d739649c1d51e2aa56bc6a
/ac.simons.bikingFX/main/java/ac/simons/bikingFX/bikingPictures/FlipImageService.java
9bd09b184fb408fe0e8990a405a5f40f2dd966c8
[ "Apache-2.0" ]
permissive
IdelsTak/bikingFX
2e2a14a5b91c7429861cfd43b1f6dca46699d19a
c066ecc73e72bc68b595358f5af85dc986b897a7
refs/heads/master
2023-04-03T13:10:32.748700
2021-03-31T20:04:48
2021-03-31T20:04:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,073
java
/* * Copyright 2014-2020 michael-simons.eu. * * 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 ac.simons.bikingFX.bikingPictures; import ac.simons.bikingFX.RootController.LoadedImageFilter; import javafx.animation.ScaleTransition; import javafx.collections.ObservableList; import javafx.concurrent.ScheduledService; import javafx.concurrent.Task; import javafx.scene.Node; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.util.Duration; import java.util.List; import java.util.Random; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import java.util.stream.Collectors; /** * @author Michael J. Simons * @since 2014-10-17 */ public class FlipImageService extends ScheduledService<ImageView> { private static final Logger logger = Logger.getLogger(FlipImageService.class.getName()); private final ObservableList<BikingPicture> bikingPictures; private final Random random; private final Pane container; public FlipImageService(ObservableList<BikingPicture> bikingPictures, final Pane container, final Random random) { this.bikingPictures = bikingPictures; this.container = container; this.random = random; this.setPeriod(Duration.seconds(10)); this.setDelay(this.getPeriod()); this.setOnSucceeded(state -> { // Check if images are loaded... final List<Node> currentImageViews = this.container.getChildren().filtered( node -> node instanceof StackPane && ((StackPane) node).getChildren().get(0) instanceof ImageView); if (currentImageViews.size() > 0) { final StackPane pickedNoded = (StackPane) currentImageViews .get(this.random.nextInt(currentImageViews.size())); final Node back = (Node) state.getSource().getValue(); back.setScaleX(0); pickedNoded.getChildren().add(back); final Duration animDuration = Duration.millis(500); final ScaleTransition hideFront = new ScaleTransition(animDuration, pickedNoded.getChildren().get(0)); hideFront.setFromX(1); hideFront.setToX(0); final ScaleTransition showBack = new ScaleTransition(animDuration, back); showBack.setFromX(0); showBack.setToX(1); hideFront.setOnFinished(event -> showBack.play()); showBack.setOnFinished(event -> pickedNoded.getChildren().remove(0)); hideFront.play(); } }); this.setOnFailed(state -> logger .log(Level.INFO, "Could not create ImageView: {0}.", state.getSource().getException().getMessage())); } @Override protected Task<ImageView> createTask() { return new Task<ImageView>() { @Override protected ImageView call() throws Exception { // Create fresh filtered list final Set<BikingPicture> loadedBikingPictures = container .getChildren().stream() .filter(new LoadedImageFilter()) .map(node -> (BikingPicture) ((StackPane) node).getChildren().get(0).getUserData()) .collect(Collectors.toSet()); final List<BikingPicture> availableBikingPictures = bikingPictures .filtered(bikingPicture -> !loadedBikingPictures.contains(bikingPicture)); if (availableBikingPictures.size() <= 0) { throw new RuntimeException("No more pictures available"); } final BikingPicture bikingPicture = availableBikingPictures .get(random.nextInt(availableBikingPictures.size())); final ImageView imageView = new ImageView( new Image(bikingPicture.getSrc(), 150, 113, true, true, false)); imageView.setUserData(bikingPicture); return imageView; } }; } }
[ "michael@simons.ac" ]
michael@simons.ac
a5a1d035c78ab7162c444378508353e8058021de
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MOCKITO-7b-7-9-MOEAD-WeightedSum:TestLen:CallDiversity/org/mockito/internal/handler/InvocationNotifierHandler_ESTest_scaffolding.java
9e61d5bcc3ad1c0ae7318334c141efaf07c0024a
[]
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
458
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Wed Apr 08 12:07:19 UTC 2020 */ package org.mockito.internal.handler; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class InvocationNotifierHandler_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
d4b900bfe205c78f6aa7b4b471242f47e23202f3
cfe621e8c36e6ac5053a2c4f7129a13ea9f9f66b
/AndroidApplications/com.zeptolab.ctr.ads-912244/src/com/google/android/gms/location/LocationStatusCodes.java
04b50c0fbc0dacb6b7523071af72ec416e4ac728
[]
no_license
linux86/AndoirdSecurity
3165de73b37f53070cd6b435e180a2cb58d6f672
1e72a3c1f7a72ea9cd12048d9874a8651e0aede7
refs/heads/master
2021-01-11T01:20:58.986651
2016-04-05T17:14:26
2016-04-05T17:14:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
552
java
package com.google.android.gms.location; public final class LocationStatusCodes { public static final int ERROR = 1; public static final int GEOFENCE_NOT_AVAILABLE = 1000; public static final int GEOFENCE_TOO_MANY_GEOFENCES = 1001; public static final int GEOFENCE_TOO_MANY_PENDING_INTENTS = 1002; public static final int SUCCESS = 0; private LocationStatusCodes() { } public static int bl(int i) { if (i >= 0 && i <= 1) { return i; } return (1000 > i || i > 1002) ? 1 : i; } }
[ "jack.luo@mail.utoronto.ca" ]
jack.luo@mail.utoronto.ca
20992e9d4159e2a52e10b89c351408f57862bfe9
0529524c95045b3232f6553d18a7fef5a059545e
/app/src/androidTest/java/TestCase_au_net_atfvision_app__912897552.java
910e42d64bc41e58884d0d35902e283ce8d14f3a
[]
no_license
sunxiaobiu/BasicUnitAndroidTest
432aa3e10f6a1ef5d674f269db50e2f1faad2096
fed24f163d21408ef88588b8eaf7ce60d1809931
refs/heads/main
2023-02-11T21:02:03.784493
2021-01-03T10:07:07
2021-01-03T10:07:07
322,577,379
0
0
null
null
null
null
UTF-8
Java
false
false
284
java
import androidx.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public class TestCase_au_net_atfvision_app__912897552 { @Test public void testCase() throws Exception { // $FF: Couldn't be decompiled } }
[ "sunxiaobiu@gmail.com" ]
sunxiaobiu@gmail.com
9a1a61f04fb69cd5cda8c5f9facf2c8af5f391a4
2ac1a9cf4b8a59f784206f218d601874fe1b01cf
/gear-monitor/gear-monitor-core/src/test/java/cn/howardliu/gear/monitor/core/os/OsProbeTest.java
4945bcf8d8d144df9e2b4537ec2e6ab001d8ffe3
[ "Apache-2.0" ]
permissive
howardliu-cn/my-gear
a173911c2997ddcabfcd72dd929aa7e22a28bc37
e81448ed01964b5d6f30cfbf36afd6f7b66c78be
refs/heads/master
2022-12-21T00:22:06.925972
2020-05-05T15:12:58
2020-05-05T15:12:58
74,741,047
1
2
Apache-2.0
2022-12-16T07:29:21
2016-11-25T08:48:57
Java
UTF-8
Java
false
false
1,203
java
package cn.howardliu.gear.monitor.core.os; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertTrue; /** * <br>created at 17-5-4 * * @author liuxh * @version 1.0.0 * @since 1.0.0 */ public class OsProbeTest { private OsProbe probe; @Before public void setUp() throws Exception { probe = new OsProbe(); } @Test public void getCommittedVirtualMemorySize() throws Exception { } @Test public void getTotalSwapSpaceSize() throws Exception { } @Test public void getFreeSwapSpaceSize() throws Exception { } @Test public void getProcessCpuTime() throws Exception { } @Test public void getFreePhysicalMemorySize() throws Exception { } @Test public void getTotalPhysicalMemorySize() throws Exception { } @Test public void getSystemCpuLoad() throws Exception { } @Test public void getSystemLoadAverage() throws Exception { } @Test public void readProcLoadavg() throws Exception { } @Test public void getSystemCpuPercent() throws Exception { } @Test public void getProcessCpuLoad() throws Exception { } }
[ "liuxinghao1988@gmail.com" ]
liuxinghao1988@gmail.com
3ef485b9fe534e8fe0630acb2e1be114f7781470
fc05322703594e40548f8e738449b9418efb7518
/src/main/java/org/basex/query/func/fn/FnExactlyOne.java
a7196f5af05fffffaa6cfd71fe56721dc72cbc23
[]
no_license
mauricioscastro/basex-lmdb
0028994871be99ec1f5d86738adfad18983d3046
bb8f32b800cb0f894c398c0019bc501196a1a801
refs/heads/master
2021-01-21T00:08:36.905964
2017-09-26T17:39:31
2017-09-26T17:39:31
41,042,448
1
1
null
2017-09-26T14:58:24
2015-08-19T15:24:11
Java
UTF-8
Java
false
false
990
java
package org.basex.query.func.fn; import static org.basex.query.QueryError.*; import org.basex.query.*; import org.basex.query.expr.*; import org.basex.query.func.*; import org.basex.query.iter.*; import org.basex.query.value.item.*; import org.basex.query.value.type.*; import org.basex.query.var.*; import org.basex.util.*; /** * Function implementation. * * @author BaseX Team 2005-15, BSD License * @author Christian Gruen */ public final class FnExactlyOne extends StandardFunc { @Override public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { final Iter ir = exprs[0].iter(qc); final Item it = ir.next(); if(it == null || ir.next() != null) throw EXACTLYONE.get(info); return it; } @Override protected Expr opt(final QueryContext qc, final VarScope scp) { final Expr e = exprs[0]; final SeqType st = e.seqType(); if(st.one()) return e; seqType = SeqType.get(st.type, seqType.occ); return this; } }
[ "mauricioscastro@hotmail.com" ]
mauricioscastro@hotmail.com
0b99c59a0f67daae077eff4ae3e37e8e64d2ff77
09b7f281818832efb89617d6f6cab89478d49930
/root/modules/dod-5015/source/java/org/alfresco/module/org_alfresco_module_dod5015/notification/RecordsManagementNotificationService.java
4cb13d71223bd13cebdbb679d617f3fa91a2117d
[]
no_license
verve111/alfresco3.4.d
54611ab8371a6e644fcafc72dc37cdc3d5d8eeea
20d581984c2d22d5fae92e1c1674552c1427119b
refs/heads/master
2023-02-07T14:00:19.637248
2020-12-25T10:19:17
2020-12-25T10:19:17
323,932,520
1
1
null
null
null
null
UTF-8
Java
false
false
2,516
java
/* * Copyright (C) 2009-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco 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 Alfresco. If not, see <http://www.gnu.org/licenses/>. */ package org.alfresco.module.org_alfresco_module_dod5015.notification; import java.util.Map; import java.util.Set; import org.alfresco.service.cmr.repository.NodeRef; /** * Records Management Notification Service * * @author Roy Wetherall */ public interface RecordsManagementNotificationService { /** TODO Temporary constants */ public static final String NT_EMAIL = "email"; public static final String NE_DUE_FOR_REVIEW = "dueForReview"; public static final String NE_SUPERSEDED = "superseded"; /** * Get notification events * * @return */ Set<String> getNotificationEvents(); /** * Get notification types * * @return */ Set<String> getNotificationTypes(); /** * Send notification to user * * @param notificationEvent * @param notificationType * @param userName * @param notificationData */ void sendNotificationToUser(String notificationEvent, String notificationType, String userName, Map<String, Object> notificationData); /** * Send notification to group * * @param notificationEvent * @param notificationType * @param groupName * @param notificationData */ void sendNotificationToGroup(String notificationEvent, String notificationType, String groupName, Map<String, Object> notificationData); /** * Send notification to role * * @param notificationEvent * @param notificationType * @param rmRootNode * @param roleName * @param notificationData */ void sendNotificationToRole(String notificationEvent, String notificationType, NodeRef rmRootNode, String roleName, Map<String, Object> notificationData); }
[ "verve111@mail.ru" ]
verve111@mail.ru
e8c4dcf216f563ba6da92c501a77f70dc62bb04b
8502e1e47522318bf3539d5ef057f124e2e75166
/1.4/src/org/apache/axis/utils/cache/MethodCache.java
1c4976c7ded9a2f99894ede8098301e358066810
[ "Apache-2.0" ]
permissive
YellowfinBI/apache-axis
5833d3b86ab9fef3f3264c05592ef7ed66e6970a
e7640afc686fb3f48a211bc956e03820c345c4ba
refs/heads/master
2023-05-24T17:22:30.715882
2023-05-18T00:56:42
2023-05-18T00:56:42
78,585,682
0
1
null
2023-05-18T00:56:43
2017-01-10T23:56:51
Java
UTF-8
Java
false
false
7,424
java
/* * Copyright 2001-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.axis.utils.cache; import java.lang.reflect.Method; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import org.apache.axis.utils.ClassUtils; /** * A cache for methods. * Used to get methods by their signature and stores them in a local * cache for performance reasons. * This class is a singleton - so use getInstance to get an instance of it. * * @author Davanum Srinivas <dims@yahoo.com> * @author Sebastian Dietrich <sebastian.dietrich@anecon.com> */ public class MethodCache { /** * The only instance of this class */ transient private static MethodCache instance; /** * Cache for Methods * In fact this is a map (with classes as keys) of a map (with method-names as keys) */ transient private static ThreadLocal cache; /** * The <i>private</i> constructor for this class. * Use getInstance to get an instance (the only one). */ private MethodCache() { cache = new ThreadLocal(); } /** * Gets the only instance of this class * @return the only instance of this class */ public static MethodCache getInstance() { if (instance == null) { instance = new MethodCache(); } return instance; } /** * Returns the per thread hashmap (for method caching) */ private Map getMethodCache() { Map map = (Map) cache.get(); if (map == null) { map = new HashMap(); cache.set(map); } return map; } /** * Class used as the key for the method cache table. * */ static class MethodKey { /** the name of the method in the cache */ private final String methodName; /** the list of types accepted by the method as arguments */ private final Class[] parameterTypes; /** * Creates a new <code>MethodKey</code> instance. * * @param methodName a <code>String</code> value * @param parameterTypes a <code>Class[]</code> value */ MethodKey(String methodName, Class[] parameterTypes) { this.methodName = methodName; this.parameterTypes = parameterTypes; } public boolean equals(Object other) { MethodKey that = (MethodKey) other; return this.methodName.equals(that.methodName) && Arrays.equals(this.parameterTypes, that.parameterTypes); } public int hashCode() { // allow overloaded methods to collide; we'll sort it out // in equals(). Note that String's implementation of // hashCode already caches its value, so there's no point // in doing so here. return methodName.hashCode(); } } /** used to track methods we've sought but not found in the past */ private static final Object NULL_OBJECT = new Object(); /** * Returns the specified method - if any. * * @param clazz the class to get the method from * @param methodName the name of the method * @param parameterTypes the parameters of the method * @return the found method * * @throws NoSuchMethodException if the method can't be found */ public Method getMethod(Class clazz, String methodName, Class[] parameterTypes) throws NoSuchMethodException { String className = clazz.getName(); Map cache = getMethodCache(); Method method = null; Map methods = null; // Strategy is as follows: // construct a MethodKey to represent the name/arguments // of a method's signature. // // use the name of the class to retrieve a map of that // class' methods // // if a map exists, use the MethodKey to find the // associated value object. if that object is a Method // instance, return it. if that object is anything // else, then it's a reference to our NULL_OBJECT // instance, indicating that we've previously tried // and failed to find a method meeting our requirements, // so return null // // if the map of methods for the class doesn't exist, // or if no value is associated with our key in that map, // then we perform a reflection-based search for the method. // // if we find a method in that search, we store it in the // map using the key; otherwise, we store a reference // to NULL_OBJECT using the key. // Check the cache first. MethodKey key = new MethodKey(methodName, parameterTypes); methods = (Map) cache.get(clazz); if (methods != null) { Object o = methods.get(key); if (o != null) { // cache hit if (o instanceof Method) { // good cache hit return (Method) o; } else { // bad cache hit // we hit the NULL_OBJECT, so this is a search // that previously failed; no point in doing // it again as it is a worst case search // through the entire classpath. return null; } } else { // cache miss: fall through to reflective search } } else { // cache miss: fall through to reflective search } try { method = clazz.getMethod(methodName, parameterTypes); } catch (NoSuchMethodException e1) { if (!clazz.isPrimitive() && !className.startsWith("java.") && !className.startsWith("javax.")) { try { Class helper = ClassUtils.forName(className + "_Helper"); method = helper.getMethod(methodName, parameterTypes); } catch (ClassNotFoundException e2) { } } } // first time we've seen this class: set up its method cache if (methods == null) { methods = new HashMap(); cache.put(clazz, methods); } // when no method is found, cache the NULL_OBJECT // so that we don't have to repeat worst-case searches // every time. if (null == method) { methods.put(key, NULL_OBJECT); } else { methods.put(key, method); } return method; } }
[ "deepak.narayan@yellowfin.bi" ]
deepak.narayan@yellowfin.bi
e711e6bf8d9f2a5feddba9164e217ea51e355b84
233e63710e871ef841ff3bc44d3660a0c8f8564d
/trunk/gameserver/src/gameserver/dataholders/loadingutils/XmlDataLoader.java
b796f75ad5e1f53385bf50ff1a878a82e82fb2a1
[]
no_license
Wankers/Project
733b6a4aa631a18d28a1b5ba914c02eb34a9f4f6
da6db42f127d5970522038971a8bebb76baa595d
refs/heads/master
2016-09-06T10:46:13.768097
2012-08-01T23:19:49
2012-08-01T23:19:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,495
java
/* * This file is part of Aion Extreme Emulator <aion-core.net>. * * Aion Extreme Emulator is a free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Aion Extreme Emulator is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Aion Extreme Emulator. If not, see <http://www.gnu.org/licenses/>. */ package gameserver.dataholders.loadingutils; import gameserver.dataholders.StaticData; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.xml.sax.SAXException; import javax.xml.XMLConstants; import javax.xml.bind.JAXBContext; import javax.xml.bind.Unmarshaller; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import java.io.File; import java.io.FileReader; /** * This class is responsible for loading xml files. It uses JAXB to do the job.<br> * In addition, it uses @{link {@link XmlMerger} to create input file from all xml files. * * @author Luno */ public class XmlDataLoader { private static final Logger log = LoggerFactory.getLogger(XmlDataLoader.class); /** File containing xml schema declaration */ private final static String XML_SCHEMA_FILE = "./data/static_data/static_data.xsd"; private static final String CACHE_DIRECTORY = "./cache/"; private static final String CACHE_XML_FILE = "./cache/static_data.xml"; private static final String MAIN_XML_FILE = "./data/static_data/static_data.xml"; public static final XmlDataLoader getInstance() { return SingletonHolder.instance; } private XmlDataLoader() { } /** * Creates {@link StaticData} object based on xml files, starting from static_data.xml * * @return StaticData object, containing all game data defined in xml files */ public StaticData loadStaticData() { makeCacheDirectory(); File cachedXml = new File(CACHE_XML_FILE); File cleanMainXml = new File(MAIN_XML_FILE); mergeXmlFiles(cachedXml, cleanMainXml); try { JAXBContext jc = JAXBContext.newInstance(StaticData.class); Unmarshaller un = jc.createUnmarshaller(); un.setEventHandler(new XmlValidationHandler()); un.setSchema(getSchema()); return (StaticData) un.unmarshal(new FileReader(CACHE_XML_FILE)); } /* catch (IllegalAnnotationsException e) { log.error("Error while loading static data", e); throw new Error("Error while loading static data", e); } catch (FileNotFoundException e) { log.error("Error while loading static data", e); throw new Error("Error while loading static data", e); } catch (JAXBException e) { log.error("Error while loading static data", e); throw new Error("Error while loading static data", e); }*/ catch (Exception e) { return null; } } /** * Creates and returns {@link Schema} object representing xml schema of xml files * * @return a Schema object. */ private Schema getSchema() { Schema schema = null; SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); try { schema = sf.newSchema(new File(XML_SCHEMA_FILE)); } catch (SAXException saxe) { log.error("Error while getting schema", saxe); throw new Error("Error while getting schema", saxe); } return schema; } /** Creates directory for cache files if it doesn't already exist */ private void makeCacheDirectory() { File cacheDir = new File(CACHE_DIRECTORY); if (!cacheDir.exists()) cacheDir.mkdir(); } /** * Merges xml files(if are newer than cache file) and puts output to cache file. * * @see XmlMerger * @param cachedXml * @param cleanMainXml * @throws Error * is thrown if some problem occured. */ private void mergeXmlFiles(File cachedXml, File cleanMainXml) throws Error { XmlMerger merger = new XmlMerger(cleanMainXml, cachedXml); try { merger.process(); } catch (Exception e) { log.error("Error while merging xml files", e); throw new Error("Error while merging xml files", e); } } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final XmlDataLoader instance = new XmlDataLoader(); } }
[ "sylvanodu14gmail.com" ]
sylvanodu14gmail.com
ef0346def0c9565f53a72fb223e109bb7ffffe2f
bc5e6d9483c5b94878310a7c2a3e1dcb8d644202
/core/src/main/java/org/lineage/gameserver/network/clientpackets/RequestFriendList.java
f8eb1297f41b1e68944e519816ffaa24ff263487
[]
no_license
finfan222/l2hf
17ecedb581c2f3f28d1b51229722082fa94560ae
bd3731afdac4791e19281790f47806fdcf6f11ae
refs/heads/master
2023-03-03T06:50:32.060299
2021-01-05T01:26:56
2021-01-05T01:26:56
326,816,095
0
0
null
2021-01-14T21:53:24
2021-01-04T21:50:23
Java
UTF-8
Java
false
false
2,382
java
/* * This file is part of the L2J Mobius project. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.lineage.gameserver.network.clientpackets; import org.lineage.commons.network.PacketReader; import org.lineage.gameserver.data.sql.impl.CharNameTable; import org.lineage.gameserver.model.World; import org.lineage.gameserver.model.actor.instance.PlayerInstance; import org.lineage.gameserver.network.GameClient; import org.lineage.gameserver.network.SystemMessageId; import org.lineage.gameserver.network.serverpackets.SystemMessage; /** * @version $Revision: 1.3.4.3 $ $Date: 2005/03/27 15:29:30 $ */ public class RequestFriendList implements IClientIncomingPacket { @Override public boolean read(GameClient client, PacketReader packet) { return true; } @Override public void run(GameClient client) { final PlayerInstance player = client.getPlayer(); if (player == null) { return; } SystemMessage sm; // ======<Friend List>====== player.sendPacket(SystemMessageId.FRIENDS_LIST); PlayerInstance friend = null; for (int id : player.getFriendList()) { // int friendId = rset.getInt("friendId"); final String friendName = CharNameTable.getInstance().getNameById(id); if (friendName == null) { continue; } friend = World.getInstance().getPlayer(friendName); if ((friend == null) || !friend.isOnline()) { // (Currently: Offline) sm = new SystemMessage(SystemMessageId.S1_CURRENTLY_OFFLINE); sm.addString(friendName); } else { // (Currently: Online) sm = new SystemMessage(SystemMessageId.S1_CURRENTLY_ONLINE); sm.addString(friendName); } player.sendPacket(sm); } // ========================= player.sendPacket(SystemMessageId.EMPTY_3); } }
[ "finex.dev@gmail.com" ]
finex.dev@gmail.com
9203aeaf3d2987e5391b8143009654c73d02c8bf
55dca62e858f1a44c2186774339823a301b48dc7
/code/my-app/functions/13/readChild_OptionGroup.java
482fba32c9aa09c6ed6ff3e3a4c809f3492180ae
[]
no_license
jwiszowata/code_reaper
4fff256250299225879d1412eb1f70b136d7a174
17dde61138cec117047a6ebb412ee1972886f143
refs/heads/master
2022-12-15T14:46:30.640628
2022-02-10T14:02:45
2022-02-10T14:02:45
84,747,455
0
0
null
2022-12-07T23:48:18
2017-03-12T18:26:11
Java
UTF-8
Java
false
false
413
java
public void readChild(FreeColXMLReader xr) throws XMLStreamException { String optionId = xr.readId(); Option option = getOption(optionId); if (option == null) { AbstractOption abstractOption = readOption(xr); if (abstractOption != null) { add(abstractOption); abstractOption.setGroup(this.getId()); } } else { option.readFromXML(xr); } }
[ "wiszowata.joanna@gmail.com" ]
wiszowata.joanna@gmail.com
2819ab5b83437b1750ad30a4b495467dd55efa0c
b3143b62fbc869674392b3f536b1876af0b2611f
/jsf-registry-parent/jsf-registry-service/src/test/java/com/ipd/jsf/sqllite/test/domain/TestObj.java
d4571419252dcd6cbca0c2d3726a522c076ed0a3
[ "Apache-2.0" ]
permissive
Mr-L7/jsf-core
6630b407caf9110906c005b2682d154da37d4bfd
90c8673b48ec5fd9349e4ef5ae3b214389a47f65
refs/heads/master
2020-03-18T23:26:17.617172
2017-12-14T05:52:55
2017-12-14T05:52:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,212
java
/** * Copyright 2004-2048 . * * 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.ipd.jsf.sqllite.test.domain; public class TestObj { private String name; private String occupation; /** * @return the name */ public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the occupation */ public String getOccupation() { return occupation; } /** * @param occupation the occupation to set */ public void setOccupation(String occupation) { this.occupation = occupation; } }
[ "yangzhiwei@jd.com" ]
yangzhiwei@jd.com
b9011b632f7c2cee96b2d5f19326016c329b21a5
882a1a28c4ec993c1752c5d3c36642fdda3d8fad
/src/test/java/com/microsoft/bingads/v12/api/test/entities/adgroup_remarketing_list_association/read/BulkAdGroupRemarketingListAssociationReadTests.java
8c8426731dcd5cf7a2964d0d039eb133fd525150
[ "MIT" ]
permissive
BazaRoi/BingAds-Java-SDK
640545e3595ed4e80f5a1cd69bf23520754c4697
e30e5b73c01113d1c523304860180f24b37405c7
refs/heads/master
2020-07-26T08:11:14.446350
2019-09-10T03:25:30
2019-09-10T03:25:30
null
0
0
null
null
null
null
UTF-8
Java
false
false
940
java
package com.microsoft.bingads.v12.api.test.entities.adgroup_remarketing_list_association.read; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) @SuiteClasses({ BulkAdGroupRemarketingListAssociationReadFromRowValuesIdTest.class, BulkAdGroupRemarketingListAssociationReadFromRowValuesAdGroupIdTest.class, BulkAdGroupRemarketingListAssociationReadFromRowValuesAdGroupNameTest.class, BulkAdGroupRemarketingListAssociationReadFromRowValuesCampaignNameTest.class, BulkAdGroupRemarketingListAssociationReadFromRowValuesBidAdjustmentTest.class, BulkAdGroupRemarketingListAssociationReadFromRowValuesAudienceIdTest.class, BulkAdGroupRemarketingListAssociationReadFromRowValuesAudienceTest.class, BulkAdGroupRemarketingListAssociationReadFromRowValuesStatusTest.class }) public class BulkAdGroupRemarketingListAssociationReadTests { }
[ "qitia@microsoft.com" ]
qitia@microsoft.com
72ef122794ebb9c160ae8bd05c76a31bb638db4e
1fa7200a80bea0f0355dae4c3b463f4da3eda7f3
/src/test/java/com/ryan/gateway/web/rest/ClientForwardControllerIT.java
3efa01a09fe9fdb56a5432f15b74ae98b948c372
[]
no_license
Ryanvaziri/gateway
e7f3b95ac1532968ee19199b6dc8fa6c944a00b8
de9c0ef180b0eadbe4687c69d2847e5347fb679f
refs/heads/master
2022-12-22T02:40:38.224284
2019-12-17T18:02:35
2019-12-17T18:02:35
228,411,540
0
0
null
2019-12-16T15:05:54
2019-12-16T14:59:27
Java
UTF-8
Java
false
false
2,348
java
package com.ryan.gateway.web.rest; import com.ryan.gateway.GatewayApp; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Integration tests for the {@link ClientForwardController} REST controller. */ @SpringBootTest(classes = GatewayApp.class) public class ClientForwardControllerIT { private MockMvc restMockMvc; @BeforeEach public void setup() { ClientForwardController clientForwardController = new ClientForwardController(); this.restMockMvc = MockMvcBuilders .standaloneSetup(clientForwardController, new TestController()) .build(); } @Test public void getBackendEndpoint() throws Exception { restMockMvc.perform(get("/test")) .andExpect(status().isOk()) .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN_VALUE)) .andExpect(content().string("test")); } @Test public void getClientEndpoint() throws Exception { ResultActions perform = restMockMvc.perform(get("/non-existant-mapping")); perform .andExpect(status().isOk()) .andExpect(forwardedUrl("/")); } @Test public void getNestedClientEndpoint() throws Exception { restMockMvc.perform(get("/admin/user-management")) .andExpect(status().isOk()) .andExpect(forwardedUrl("/")); } @RestController public static class TestController { @RequestMapping(value = "/test") public String test() { return "test"; } } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
d3f5cb7b4c464cc000c209fe77107b397db7d862
21bcd1da03415fec0a4f3fa7287f250df1d14051
/sources/androidx/core/provider/FontRequest.java
7679ab2bc7141103433b368e85f44acab380a516
[]
no_license
lestseeandtest/Delivery
9a5cc96bd6bd2316a535271ec9ca3865080c3ec8
bc3fae8f30804a2520e6699df92c2e6a4a0a7cfc
refs/heads/master
2022-04-24T12:14:22.396398
2020-04-25T21:50:29
2020-04-25T21:50:29
258,875,870
0
1
null
null
null
null
UTF-8
Java
false
false
3,619
java
package androidx.core.provider; import android.util.Base64; import androidx.annotation.C0186e; import androidx.annotation.C0193h0; import androidx.annotation.C0195i0; import androidx.annotation.C0207n0; import androidx.annotation.C0207n0.C0208a; import androidx.core.p033k.C0944i; import java.util.List; public final class FontRequest { private final List<List<byte[]>> mCertificates; private final int mCertificatesArray; private final String mIdentifier; private final String mProviderAuthority; private final String mProviderPackage; private final String mQuery; public FontRequest(@C0193h0 String str, @C0193h0 String str2, @C0193h0 String str3, @C0193h0 List<List<byte[]>> list) { this.mProviderAuthority = (String) C0944i.m5337a(str); this.mProviderPackage = (String) C0944i.m5337a(str2); this.mQuery = (String) C0944i.m5337a(str3); this.mCertificates = (List) C0944i.m5337a(list); this.mCertificatesArray = 0; StringBuilder sb = new StringBuilder(this.mProviderAuthority); String str4 = "-"; sb.append(str4); sb.append(this.mProviderPackage); sb.append(str4); sb.append(this.mQuery); this.mIdentifier = sb.toString(); } @C0195i0 public List<List<byte[]>> getCertificates() { return this.mCertificates; } @C0186e public int getCertificatesArrayResId() { return this.mCertificatesArray; } @C0207n0({C0208a.LIBRARY_GROUP_PREFIX}) public String getIdentifier() { return this.mIdentifier; } @C0193h0 public String getProviderAuthority() { return this.mProviderAuthority; } @C0193h0 public String getProviderPackage() { return this.mProviderPackage; } @C0193h0 public String getQuery() { return this.mQuery; } public String toString() { StringBuilder sb = new StringBuilder(); StringBuilder sb2 = new StringBuilder(); sb2.append("FontRequest {mProviderAuthority: "); sb2.append(this.mProviderAuthority); sb2.append(", mProviderPackage: "); sb2.append(this.mProviderPackage); sb2.append(", mQuery: "); sb2.append(this.mQuery); sb2.append(", mCertificates:"); sb.append(sb2.toString()); for (int i = 0; i < this.mCertificates.size(); i++) { sb.append(" ["); List list = (List) this.mCertificates.get(i); for (int i2 = 0; i2 < list.size(); i2++) { sb.append(" \""); sb.append(Base64.encodeToString((byte[]) list.get(i2), 0)); sb.append("\""); } sb.append(" ]"); } sb.append("}"); StringBuilder sb3 = new StringBuilder(); sb3.append("mCertificatesArray: "); sb3.append(this.mCertificatesArray); sb.append(sb3.toString()); return sb.toString(); } public FontRequest(@C0193h0 String str, @C0193h0 String str2, @C0193h0 String str3, @C0186e int i) { this.mProviderAuthority = (String) C0944i.m5337a(str); this.mProviderPackage = (String) C0944i.m5337a(str2); this.mQuery = (String) C0944i.m5337a(str3); this.mCertificates = null; C0944i.m5339a(i != 0); this.mCertificatesArray = i; StringBuilder sb = new StringBuilder(this.mProviderAuthority); String str4 = "-"; sb.append(str4); sb.append(this.mProviderPackage); sb.append(str4); sb.append(this.mQuery); this.mIdentifier = sb.toString(); } }
[ "zsolimana@uaedomain.local" ]
zsolimana@uaedomain.local
892a4ef9acb22423c43366a20124099fd7a88680
0d504a0088c38775544dd885a818ff9ea2a42748
/app/src/main/java/com/musicbase/ui/view/ProgressWebview.java
9ce0df5e5785b3eef8304d12653045b130b067a6
[]
no_license
wzyxzy/MusicBase2
c3ac4881579bedd01a97812194616ba328d89c7d
fd981715fbb60ee60432b10cc0ac57d4f9019bc0
refs/heads/master
2022-06-14T12:15:33.443401
2020-05-09T11:37:22
2020-05-09T11:37:22
262,557,400
0
0
null
null
null
null
UTF-8
Java
false
false
1,497
java
package com.musicbase.ui.view; import android.content.Context; import android.util.AttributeSet; import android.webkit.WebView; import android.widget.ProgressBar; public class ProgressWebview extends WebView { private ProgressBar progressbar; public ProgressWebview(Context context, AttributeSet attrs) { super(context, attrs); progressbar = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal); progressbar.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, 8, 0, 0)); int tv_progess = context.getResources().getIdentifier("webprogress_color", "drawable", context.getPackageName()); progressbar.setProgressDrawable(context.getResources().getDrawable(tv_progess)); addView(progressbar); // setWebViewClient(new WebViewClient(){}); setWebChromeClient(new WebChromeClient()); } public class WebChromeClient extends android.webkit.WebChromeClient { @Override public void onProgressChanged(WebView view, int newProgress) { if (newProgress == 100) { progressbar.setVisibility(GONE); } else { if (progressbar.getVisibility() == GONE) progressbar.setVisibility(VISIBLE); progressbar.setProgress(newProgress); } super.onProgressChanged(view, newProgress); } } @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { LayoutParams lp = (LayoutParams) progressbar.getLayoutParams(); lp.x = l; lp.y = t; progressbar.setLayoutParams(lp); super.onScrollChanged(l, t, oldl, oldt); } }
[ "xzywzy@gmail.com" ]
xzywzy@gmail.com
1061762144139b9b28ab837637ba52ee5efa384f
d60e287543a95a20350c2caeabafbec517cabe75
/LACCPlus/HBase/13330_1.java
3efc1158362e1aaaa3b16f3fe900cfc54171cba7
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
1,544
java
//,temp,THBaseService.java,6581,6608,temp,THBaseService.java,6517,6544 //,2 public class xxx { public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TSerializable msg; createTable_result result = new createTable_result(); if (e instanceof TIOError) { result.io = (TIOError) e; result.setIoIsSet(true); msg = result; } else if (e instanceof org.apache.thrift.transport.TTransportException) { _LOGGER.error("TTransportException inside handler", e); fb.close(); return; } else if (e instanceof org.apache.thrift.TApplicationException) { _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = (org.apache.thrift.TApplicationException)e; } else { _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); } catch (java.lang.Exception ex) { _LOGGER.error("Exception writing to internal frame buffer", ex); fb.close(); } } };
[ "sgholami@uwaterloo.ca" ]
sgholami@uwaterloo.ca
64086540388bf07ac97f58b282aa9ecefaefbe44
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_16933.java
ad948216ee689f8b69edeb79a25a56368dca3fbb
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
227
java
private FieldSpec newKeyField(){ FieldSpec.Builder fieldSpec=isStrongKeys() ? FieldSpec.builder(kTypeVar,"key",Modifier.VOLATILE) : FieldSpec.builder(keyReferenceType(),"key",Modifier.VOLATILE); return fieldSpec.build(); }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
a3b4deb34ff949c67b62ac763b395c693575c4c1
c4d1992bbfe4552ad16ff35e0355b08c9e4998d6
/releases/2.1.1/src/java/org/apache/poi/ss/formula/functions/Hlookup.java
c46fadbb8d88cdb0fcf061f323c801633a53ea03
[]
no_license
BGCX261/zkpoi-svn-to-git
36f2a50d2618c73e40f24ddc2d3df5aadc8eca30
81a63fb1c06a2dccff20cab1291c7284f1687508
refs/heads/master
2016-08-04T08:42:59.622864
2015-08-25T15:19:51
2015-08-25T15:19:51
41,594,557
0
1
null
null
null
null
UTF-8
Java
false
false
3,834
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.zkoss.poi.ss.formula.functions; import org.zkoss.poi.ss.formula.eval.BoolEval; import org.zkoss.poi.ss.formula.eval.EvaluationException; import org.zkoss.poi.ss.formula.eval.OperandResolver; import org.zkoss.poi.ss.formula.eval.ValueEval; import org.zkoss.poi.ss.formula.functions.LookupUtils.ValueVector; import org.zkoss.poi.ss.formula.TwoDEval; /** * Implementation of the HLOOKUP() function.<p/> * * HLOOKUP finds a column in a lookup table by the first row value and returns the value from another row.<br/> * * <b>Syntax</b>:<br/> * <b>HLOOKUP</b>(<b>lookup_value</b>, <b>table_array</b>, <b>row_index_num</b>, range_lookup)<p/> * * <b>lookup_value</b> The value to be found in the first column of the table array.<br/> * <b>table_array</b> An area reference for the lookup data. <br/> * <b>row_index_num</b> a 1 based index specifying which row value of the lookup data will be returned.<br/> * <b>range_lookup</b> If TRUE (default), HLOOKUP finds the largest value less than or equal to * the lookup_value. If FALSE, only exact matches will be considered<br/> * * @author Josh Micich */ public final class Hlookup extends Var3or4ArgFunction { private static final ValueEval DEFAULT_ARG3 = BoolEval.TRUE; public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2) { return evaluate(srcRowIndex, srcColumnIndex, arg0, arg1, arg2, DEFAULT_ARG3); } public ValueEval evaluate(int srcRowIndex, int srcColumnIndex, ValueEval arg0, ValueEval arg1, ValueEval arg2, ValueEval arg3) { try { // Evaluation order: // arg0 lookup_value, arg1 table_array, arg3 range_lookup, find lookup value, arg2 row_index, fetch result ValueEval lookupValue = OperandResolver.getSingleValue(arg0, srcRowIndex, srcColumnIndex); TwoDEval tableArray = LookupUtils.resolveTableArrayArg(arg1); boolean isRangeLookup = LookupUtils.resolveRangeLookupArg(arg3, srcRowIndex, srcColumnIndex); int colIndex = LookupUtils.lookupIndexOfValue(lookupValue, LookupUtils.createRowVector(tableArray, 0), isRangeLookup); int rowIndex = LookupUtils.resolveRowOrColIndexArg(arg2, srcRowIndex, srcColumnIndex); ValueVector resultCol = createResultColumnVector(tableArray, rowIndex); return resultCol.getItem(colIndex); } catch (EvaluationException e) { return e.getErrorEval(); } } /** * Returns one column from an <tt>AreaEval</tt> * * @param rowIndex assumed to be non-negative * * @throws EvaluationException (#REF!) if colIndex is too high */ private ValueVector createResultColumnVector(TwoDEval tableArray, int rowIndex) throws EvaluationException { if(rowIndex >= tableArray.getHeight()) { throw EvaluationException.invalidRef(); } return LookupUtils.createRowVector(tableArray, rowIndex); } }
[ "you@example.com" ]
you@example.com
eac10958767af2be61693d25afc1915cfdf7e22c
10378c580b62125a184f74f595d2c37be90a5769
/com/google/common/base/Strings.java
baf4ebc0e8d780f780705962499bea1d4856f668
[]
no_license
ClientPlayground/Melon-Client
4299d7f3e8f2446ae9f225c0d7fcc770d4d48ecb
afc9b11493e15745b78dec1c2b62bb9e01573c3d
refs/heads/beta-v2
2023-04-05T20:17:00.521159
2021-03-14T19:13:31
2021-03-14T19:13:31
347,509,882
33
19
null
2021-03-14T19:13:32
2021-03-14T00:27:40
null
UTF-8
Java
false
false
3,272
java
package com.google.common.base; import com.google.common.annotations.GwtCompatible; import com.google.common.annotations.VisibleForTesting; import javax.annotation.Nullable; @GwtCompatible public final class Strings { public static String nullToEmpty(@Nullable String string) { return (string == null) ? "" : string; } @Nullable public static String emptyToNull(@Nullable String string) { return isNullOrEmpty(string) ? null : string; } public static boolean isNullOrEmpty(@Nullable String string) { return (string == null || string.length() == 0); } public static String padStart(String string, int minLength, char padChar) { Preconditions.checkNotNull(string); if (string.length() >= minLength) return string; StringBuilder sb = new StringBuilder(minLength); for (int i = string.length(); i < minLength; i++) sb.append(padChar); sb.append(string); return sb.toString(); } public static String padEnd(String string, int minLength, char padChar) { Preconditions.checkNotNull(string); if (string.length() >= minLength) return string; StringBuilder sb = new StringBuilder(minLength); sb.append(string); for (int i = string.length(); i < minLength; i++) sb.append(padChar); return sb.toString(); } public static String repeat(String string, int count) { Preconditions.checkNotNull(string); if (count <= 1) { Preconditions.checkArgument((count >= 0), "invalid count: %s", new Object[] { Integer.valueOf(count) }); return (count == 0) ? "" : string; } int len = string.length(); long longSize = len * count; int size = (int)longSize; if (size != longSize) throw new ArrayIndexOutOfBoundsException("Required array size too large: " + longSize); char[] array = new char[size]; string.getChars(0, len, array, 0); int n; for (n = len; n < size - n; n <<= 1) System.arraycopy(array, 0, array, n, n); System.arraycopy(array, 0, array, n, size - n); return new String(array); } public static String commonPrefix(CharSequence a, CharSequence b) { Preconditions.checkNotNull(a); Preconditions.checkNotNull(b); int maxPrefixLength = Math.min(a.length(), b.length()); int p = 0; while (p < maxPrefixLength && a.charAt(p) == b.charAt(p)) p++; if (validSurrogatePairAt(a, p - 1) || validSurrogatePairAt(b, p - 1)) p--; return a.subSequence(0, p).toString(); } public static String commonSuffix(CharSequence a, CharSequence b) { Preconditions.checkNotNull(a); Preconditions.checkNotNull(b); int maxSuffixLength = Math.min(a.length(), b.length()); int s = 0; while (s < maxSuffixLength && a.charAt(a.length() - s - 1) == b.charAt(b.length() - s - 1)) s++; if (validSurrogatePairAt(a, a.length() - s - 1) || validSurrogatePairAt(b, b.length() - s - 1)) s--; return a.subSequence(a.length() - s, a.length()).toString(); } @VisibleForTesting static boolean validSurrogatePairAt(CharSequence string, int index) { return (index >= 0 && index <= string.length() - 2 && Character.isHighSurrogate(string.charAt(index)) && Character.isLowSurrogate(string.charAt(index + 1))); } }
[ "Hot-Tutorials@users.noreply.github.com" ]
Hot-Tutorials@users.noreply.github.com
51e1a0efd425b40a61acf2ca4082a8a416c5ea53
38ad02955e1b536f3ed44168497aa9883767684e
/src/util/ariba/util/core/GlobalLockingService.java
08dea2275cf1196317bf5378dcf062f205c1fb31
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
kabassociates/aribaweb
576e3b10759ecd484b967af8f4f8affb66630c3c
1b71afcff218ce53ec3a903d31dc36e1c86cfe88
refs/heads/master
2021-01-01T06:10:30.599588
2013-06-09T19:24:24
2013-06-09T19:24:24
10,587,828
0
2
null
null
null
null
UTF-8
Java
false
false
6,786
java
/* Copyright 1996-2008 Ariba, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. $Id: //ariba/platform/util/core/ariba/util/core/GlobalLockingService.java#5 $ */ package ariba.util.core; /** provide services for acquiring global locks and creating lock groups. Global Locks provide cluster-wide synchronization. . A lock is identified by its name. The name must be unique. . A lock is represented by a lock object. There can be only one valid (i.e. locked and unexpired) lock object for the lock throughout the cluster. . You can obtain a lock only if it is currently unlocked. . A lock is created if it does not exist. It is created in the locked state. . Each lock has a specific lifetime. If that lifetime is exceeded, the lock expires, and becomes unlocked. . A lock is acquired with the default lifetime (currently 2 minutes). The lifetime must be extended if the lock is to be held longer than that. . If a lock expires, a cleanup notification will be sent when the lock is next acquired. The notification is posted on a local topic to the default Notification Center. . All lock operations other than acquiring the lock are performed on the lock object. . All operations on an invalid (expired or released) lock object throw an exception. . No synchronization is done on any of these methods. If the user wishes to share a lock object between threads on a node, the user is responsible for proper synchronization. . An acquired lock can be added to a Lock Group. Once added, the lock can be later acquired through a request to the Lock Group. . When a node goes down, all locks acquired by that node become expired. However, the lock may not become available until the node restarts. This means that a lock that becomes available due to a node crashing will always have the cleanup notification sent when the lock is next acquired. . On Cluster Restart, Global Locking is initialized (i.e. there are no locks, and there are no lock groups). This is necessary, or else creating new Lock Groups with different numbers of locks becomes unnecessarily complicated. @aribaapi ariba */ public interface GlobalLockingService { /** Acquire requested GlobalLock. If the lock does not exist, it is created and obtained. Return immediately if the lock is not available. @param lockName The name of the lock. Must be unique @return The lock object, or null if the lock is not free */ public GlobalLock acquireLock (String lockName); /** Aacquire requested GlobalLock with an acquistion timeout. If the lock does not exist, it is created and obtained. Try to obtain the lock for specified number of milliseconds, then return a null if the lock is not available. @param lockName The name of the lock. Must be unique @param acquireTimeout The number of milliseconds to try for @return The lock object, or null if the lock is not free */ public GlobalLock acquireLock (String lockName, long acquireTimeout); /** Acquire a lock from the requested lock group. The lock group must exist, and there must be locks assigned to it. Returns immediatley if no lock is available @param groupName The lock group @return The lock object if one is available, null otherwise @exception GlobalLockingException thrown if the lock group does not exist, or if there are no locks assigned to the group. */ public GlobalLock acquireLockFromGroup (String groupName) throws GlobalLockingException; /** Acquire a lock from the requested lock group. The lock group must exist, and there must be locks assigned to it. Try to obtain the lock for acquireTimeOut milliseconds before returning. @param groupName The lock group @param acquireTimeout The number of milliseconds to try to obtain the lock @return The lock object if one is available, null otherwise @exception GlobalLockingException thrown if the lock group does not exist, or if there are no locks assigned to the group. */ public GlobalLock acquireLockFromGroup (String groupName, long acquireTimeout) throws GlobalLockingException; /** Create a new lock group, and allow numLocks locks to be assigned to it. The name must be unique @param groupName The name of the group @param numLocks How many locks can be in this group @exception GlobalLockingException if the group already exists */ public void createLockGroup (String groupName, int numLocks) throws GlobalLockingException; /** Create a new lockgroup, and a pool of locks for it. The locks are given the name <groupName>Lock<n>, and are added to the group. Each lock is then released. When this call successfully completes, you may immediately acquire locks by calling acquireLockFromGroup. @param groupName The name of the group to create @param numLocks How many locks to create @exception GlobalLockingException if the group already exists, or if any of the locks associated with the group already exits and are assigned to the group. */ public void createLockPool (String groupName, int numLocks) throws GlobalLockingException; /** Delete the specified lock group. The lock group can be deleted only if all the locks in the group are free. If any of the locks are not free, the lockgroup is not deleted. @param groupName The name of the group to delete @exception GlobalLockingException if the group does not exist, or if any of the locks within the group are locked or expired. */ public void deleteLockGroup (String groupName) throws GlobalLockingException; public final static String CleanupTopic = "ariba.util.GlobalLocking.Cleanup"; }
[ "srbala@gmail.com" ]
srbala@gmail.com
713c3247e6c98b95222a3e80a3af4ce4f420247f
1932efbc90243a528380eee5393a26f253120d26
/src/main/java/ru/home/jspr/task2/App.java
0e3f51057b24ae323dcfd084e3c5d5ca65f8e328
[]
no_license
nikolaydmukha/netology-jspr
ef14884257259038d6ddbbce12e5fe4f986d8c32
877edd429b5ff54c9fb2c923149381adf49eaa13
refs/heads/master
2023-03-25T01:53:02.588083
2021-03-25T10:48:25
2021-03-25T10:48:25
345,029,752
0
0
null
null
null
null
UTF-8
Java
false
false
2,635
java
package ru.home.jspr.task2; import ru.home.jspr.task2.http.Request; import java.io.BufferedOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; public class App { public static void main(String[] args) { AppConfig appConfig = AppConfig.getInstance(); JsprServer server = new JsprServer(64); // добавление GET handler'ов server.addHandler("GET", "/index.html", (request, responseStream) -> { // TODO: handlers code addHandlerProcessor(request, responseStream); }); server.addHandler("GET", "/thread.html", (request, responseStream) -> { // TODO: handlers code try { Thread.sleep(3000); } catch (InterruptedException ex) { ex.printStackTrace(); } addHandlerProcessor(request, responseStream); }); // добавление POST handler'ов server.addHandler("POST", "/index.html", (request, responseStream) -> { // TODO: handlers code addHandlerProcessor(request, responseStream); }); server.addHandler("POST", "/thread.html", (request, responseStream) -> { // TODO: handlers code addHandlerProcessor(request, responseStream); }); server.runServer((appConfig.getPort())); } private static void addHandlerProcessor(Request request, BufferedOutputStream responseStream) { try { if (!JsprServer.validPaths.contains(request.getPath())) { responseStream.write(( "HTTP/1.1 404 Not Found\r\n" + "Content-Length: 0\r\n" + "Connection: close\r\n" + "\r\n" ).getBytes()); responseStream.flush(); } final Path filePath = Path.of(".", "public", request.getPath()); final String mimeType = Files.probeContentType((filePath)); final long length = Files.size(filePath); responseStream.write(( "HTTP/1.1 200 OK\r\n" + "Content-Type: " + mimeType + "\r\n" + "Content-Length: " + length + "\r\n" + "Connection: close\r\n" + "\r\n" ).getBytes()); Files.copy(filePath, responseStream); responseStream.flush(); } catch (IOException ex) { ex.printStackTrace(); } } }
[ "dmukha@mail.ru" ]
dmukha@mail.ru
aeb43ed0b79c5188b5c375cc13a1178ac331222e
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/uk/gov/gchq/gaffer/federatedstore/operation/FederatedOperationChainTest.java
e405f5e103cfb0eddb5f75ecb484f332e1813e80
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
5,310
java
/** * Copyright 2017-2019 Crown Copyright * * 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 uk.gov.gchq.gaffer.federatedstore.operation; import org.junit.Assert; import org.junit.Test; import uk.gov.gchq.gaffer.commonutil.StringUtil; import uk.gov.gchq.gaffer.commonutil.iterable.CloseableIterable; import uk.gov.gchq.gaffer.data.element.Element; import uk.gov.gchq.gaffer.operation.OperationChain; import uk.gov.gchq.gaffer.operation.OperationTest; import uk.gov.gchq.gaffer.operation.impl.get.GetAllElements; public class FederatedOperationChainTest extends OperationTest<FederatedOperationChain> { @Test @Override public void shouldShallowCloneOperation() { // Given final OperationChain<CloseableIterable<? extends Element>> opChain = new OperationChain.Builder().first(new GetAllElements()).build(); final FederatedOperationChain op = new FederatedOperationChain.Builder<>().operationChain(opChain).option("key", "value").build(); // When final FederatedOperationChain clone = op.shallowClone(); // Then Assert.assertNotSame(op.getOperationChain(), clone.getOperationChain()); Assert.assertEquals(1, clone.getOperationChain().getOperations().size()); Assert.assertEquals(GetAllElements.class, clone.getOperationChain().getOperations().get(0).getClass()); Assert.assertEquals("value", clone.getOption("key")); } @Test public void shouldThrowAnErrorIfJsonDeserialiseWithoutOperationChain() { // Given final String json = String.format(("{%n" + ((((" \"class\" : \"uk.gov.gchq.gaffer.federatedstore.operation.FederatedOperationChain\",%n" + " \"options\" : {%n") + " \"key\" : \"value\"%n") + " }%n") + "}"))); // When / Then try { fromJson(StringUtil.toBytes(json)); Assert.fail("Exception expected"); } catch (final RuntimeException e) { Assert.assertTrue(e.getMessage().contains("operationChain is required")); } } @Test public void shouldJsonDeserialiseWithInvalidOperationChainClassName() { // Given final String json = String.format(("{%n" + ((((((((((" \"class\" : \"uk.gov.gchq.gaffer.federatedstore.operation.FederatedOperationChain\",%n" + " \"operationChain\" : {%n") + " \"class\" : \"uk.gov.gchq.gaffer.operation.OperationChainInvalidClassName\",%n") + " \"operations\" : [ {%n") + " \"class\" : \"uk.gov.gchq.gaffer.operation.impl.get.GetAllElements\"%n") + " } ]%n") + " },%n") + " \"options\" : {%n") + " \"key\" : \"value\"%n") + " }%n") + "}"))); // When / Then try { fromJson(StringUtil.toBytes(json)); Assert.fail("Exception expected"); } catch (final RuntimeException e) { Assert.assertTrue(e.getMessage().contains("Class name should be")); } } @Test public void shouldJsonDeserialiseWithOperationChainClassName() { // Given final String json = String.format(("{%n" + ((((((((((" \"class\" : \"uk.gov.gchq.gaffer.federatedstore.operation.FederatedOperationChain\",%n" + " \"operationChain\" : {%n") + " \"class\" : \"uk.gov.gchq.gaffer.operation.OperationChain\",%n") + " \"operations\" : [ {%n") + " \"class\" : \"uk.gov.gchq.gaffer.operation.impl.get.GetAllElements\"%n") + " } ]%n") + " },%n") + " \"options\" : {%n") + " \"key\" : \"value\"%n") + " }%n") + "}"))); // When final FederatedOperationChain deserialisedOp = fromJson(StringUtil.toBytes(json)); // Then Assert.assertEquals(1, deserialisedOp.getOperationChain().getOperations().size()); Assert.assertEquals(GetAllElements.class, deserialisedOp.getOperationChain().getOperations().get(0).getClass()); Assert.assertEquals("value", deserialisedOp.getOption("key")); } @Test public void shouldJsonDeserialiseWithoutOperationChainClassName() { // Given final String json = String.format(("{%n" + (((((((((" \"class\" : \"uk.gov.gchq.gaffer.federatedstore.operation.FederatedOperationChain\",%n" + " \"operationChain\" : {%n") + " \"operations\" : [ {%n") + " \"class\" : \"uk.gov.gchq.gaffer.operation.impl.get.GetAllElements\"%n") + " } ]%n") + " },%n") + " \"options\" : {%n") + " \"key\" : \"value\"%n") + " }%n") + "}"))); // When final FederatedOperationChain deserialisedOp = fromJson(StringUtil.toBytes(json)); // Then Assert.assertEquals(1, deserialisedOp.getOperationChain().getOperations().size()); Assert.assertEquals(GetAllElements.class, deserialisedOp.getOperationChain().getOperations().get(0).getClass()); Assert.assertEquals("value", deserialisedOp.getOption("key")); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
2a1e8cc75b847ca84b90109ad7f4592392ef08a7
b647fa78fd6c4e46bcaf11ab21d9b880e0c83f24
/src/designPatterns/command/classic/Main.java
c74c86d502060636f715249c59b256c37a435be7
[]
no_license
Garazd/DesignPatterns
88b8f15816dec1346122fe267ba28ceddadda9f8
0df55b69e5791e4a4b45f7b8cec7c0702b40da75
refs/heads/master
2021-01-17T13:43:07.664499
2016-06-24T19:36:34
2016-06-24T19:36:34
36,253,867
2
0
null
null
null
null
UTF-8
Java
false
false
2,199
java
package designPatterns.command.classic; // наш конфиг public class Main { public static void main(String[] args) { // эти алгоритмы мы хотим как-то run'ать из Invoker // но при этом мы не хотим, чтобы Invoker про них знал лично ReceiverA receiverA = new ReceiverA(); ReceiverB receiverB = new ReceiverB(); // это "как-то" (то, как мы будем выполнять алгоритмы) // мы инкапсулируем в команды // по одному кейзу использования на 1 команду Command commandA = new ConcreteCommandA(receiverA); Command commandB = new ConcreteCommandB(receiverB); Command commandC = new ConcreteCommandC(receiverA); // вот наш запускатор Invoker invoker = new Invoker(); // печать разделителя для красивого вывода (не обращай внимания :)) printBreak(); // вставляем в него команду, под видом абстракциии invoker.setCommand(commandA); // и выполняем invoker.doit(); // Вывод // Processed by ReceiverA: data printBreak(); // потом переключили команду invoker.setCommand(commandB); // и выполнение будет совсем другим invoker.doit(); // Вывод // ReceiverB got a: data // CommandB result printBreak(); // и так далее invoker.setCommand(commandC); invoker.doit(); // Вывод // Processed by ReceiverA: Changed in CommandC: data printBreak(); // в любой момент можем вернуть назад invoker.setCommand(commandA); invoker.doit(); // Вывод // Processed by ReceiverA: data printBreak(); } private static void printBreak() { System.out.println("--------------------"); } }
[ "GarazdVZ@gmail.com" ]
GarazdVZ@gmail.com
e46c4e258726e2d6ab529581e43a3054af61cc84
e7e276ece390306ac721b0603a080cf842aa8f90
/app/src/main/java/com/sss/car/dao/SearchHistoryMessageOperationCallBack.java
ab7cd62eaf881e7b6e5766b02f5f8eed20f83808
[]
no_license
michael007js/JuXiangChe
9b1b872063fcb5cdf00f22386b8ec4111bd53d90
9cca55b533d65d1e7c68e3ebbd46a3146545bb20
refs/heads/master
2020-03-08T08:11:04.352956
2018-04-27T05:24:44
2018-04-27T05:24:44
128,015,077
1
0
null
null
null
null
UTF-8
Java
false
false
291
java
package com.sss.car.dao; import com.sss.car.model.SearchHistoryMessageModel; import java.util.List; /** * Created by leilei on 2017/8/30. */ public interface SearchHistoryMessageOperationCallBack { void onClickHistroyMessage(int position, List<SearchHistoryMessageModel> list); }
[ "616425434@qq.com" ]
616425434@qq.com
426d5443a89224ec4d6532135565b83b34685117
225011bbc304c541f0170ef5b7ba09b967885e95
/mf/org/apache/html/dom/HTMLOptGroupElementImpl.java
8be62bfe965fe7d34a8695513b7af4a7ee2b552b
[]
no_license
sebaudracco/bubble
66536da5367f945ca3318fecc4a5f2e68c1df7ee
e282cda009dfc9422594b05c63e15f443ef093dc
refs/heads/master
2023-08-25T09:32:04.599322
2018-08-14T15:27:23
2018-08-14T15:27:23
140,444,001
1
1
null
null
null
null
UTF-8
Java
false
false
812
java
package mf.org.apache.html.dom; import com.google.android.gms.plus.PlusShare; import mf.org.w3c.dom.html.HTMLOptGroupElement; public class HTMLOptGroupElementImpl extends HTMLElementImpl implements HTMLOptGroupElement { private static final long serialVersionUID = -8807098641226171501L; public boolean getDisabled() { return getBinary("disabled"); } public void setDisabled(boolean disabled) { setAttribute("disabled", disabled); } public String getLabel() { return capitalize(getAttribute(PlusShare.KEY_CALL_TO_ACTION_LABEL)); } public void setLabel(String label) { setAttribute(PlusShare.KEY_CALL_TO_ACTION_LABEL, label); } public HTMLOptGroupElementImpl(HTMLDocumentImpl owner, String name) { super(owner, name); } }
[ "sebaudracco@gmail.com" ]
sebaudracco@gmail.com
dcc576eaa8ae65aeee8c810fd9fb3136bbd9464e
80c66cca63cebffdd1f397d79bfc040ed188c1c8
/gomint-server/src/main/java/io/gomint/server/util/LongList.java
e90f49ef869375afa0b4ccf2bd82b1aec0e5eb6b
[ "BSD-3-Clause" ]
permissive
severinkehding/GoMint
0902df4f3612cd9dd3d1b01a2e80636449e712fa
a70aeae53dc03803fb37241123b602da027844d5
refs/heads/master
2021-07-02T08:45:25.673228
2017-06-09T12:22:18
2017-06-09T12:22:18
104,562,044
0
0
null
2017-09-23T11:17:00
2017-09-23T11:17:00
null
UTF-8
Java
false
false
2,750
java
package io.gomint.server.util; import java.util.Arrays; /** * @author geNAZt * @version 1.0 */ public class LongList { /** * Default initial capacity. */ private static final int DEFAULT_CAPACITY = 10; /** * Shared empty array instance used for default sized empty instances. We * distinguish this from EMPTY_ELEMENTDATA to know how much to inflate when * first element is added. */ private static final long[] DEFAULTCAPACITY_EMPTY_ELEMENTDATA = {}; /** * The maximum size of array to allocate. * Some VMs reserve some header words in an array. * Attempts to allocate larger arrays may result in * OutOfMemoryError: Requested array size exceeds VM limit */ private static final int MAX_ARRAY_SIZE = Integer.MAX_VALUE - 8; private long[] elementData; private int size; public LongList() { this.elementData = DEFAULTCAPACITY_EMPTY_ELEMENTDATA; } public void add( long element ) { ensureCapacityInternal( this.size + 1 ); elementData[size++] = element; } private static int hugeCapacity( int minCapacity ) { if ( minCapacity < 0 ) { throw new OutOfMemoryError(); } return ( minCapacity > MAX_ARRAY_SIZE ) ? Integer.MAX_VALUE : MAX_ARRAY_SIZE; } private void grow( int minCapacity ) { // overflow-conscious code int oldCapacity = this.elementData.length; int newCapacity = oldCapacity + ( oldCapacity >> 1 ); if ( newCapacity - minCapacity < 0 ) { newCapacity = minCapacity; } if ( newCapacity - MAX_ARRAY_SIZE > 0 ) { newCapacity = hugeCapacity( minCapacity ); } // minCapacity is usually close to size, so this is a win: this.elementData = Arrays.copyOf( this.elementData, newCapacity ); } private void ensureExplicitCapacity( int minCapacity ) { // overflow-conscious code if ( minCapacity - this.elementData.length > 0 ) { grow( minCapacity ); } } private void ensureCapacityInternal( int minCapacity ) { if ( this.elementData == DEFAULTCAPACITY_EMPTY_ELEMENTDATA ) { minCapacity = Math.max( DEFAULT_CAPACITY, minCapacity ); } ensureExplicitCapacity( minCapacity ); } /** * Return the size of the data stored in the list * * @return amount of data stored */ public int size() { return this.size; } /** * Remove the last element in the array * * @return the removed element */ public long remove() { return this.elementData[--size]; } }
[ "fabian.fassbender42@googlemail.com" ]
fabian.fassbender42@googlemail.com
8e4ecd8b025892b82ea91bad2a2016f91a9fdc15
c0b312c7418f22ccbe1b1b3358667838e00b6243
/src/com/gridscape/sep/org/zigbee/sep/TargetReduction.java
cef44704529d021fb59c4484a63358a5c09f5da4
[]
no_license
rahul-me/e-ope
cb8005ad93dfe9b5b2f792379f33b678c1bc76a3
3b2e76c3c0109ab10eb2caf013ed541ed54fb260
refs/heads/master
2022-04-16T18:17:45.953574
2020-04-10T17:44:41
2020-04-10T17:44:41
254,696,703
0
0
null
null
null
null
UTF-8
Java
false
false
2,180
java
package com.gridscape.sep.org.zigbee.sep; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * The TargetReduction object is used by a Demand Response service provider to provide a RECOMMENDED threshold that a device/premises should maintain its consumption below. For example, a service provider can provide a RECOMMENDED threshold of some kWh for a 3-hour event. This means that the device/premises would maintain its consumption below the specified limit for the specified period. * * <p>Java class for TargetReduction complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="TargetReduction"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="type" type="{http://zigbee.org/sep}UnitType"/> * &lt;element name="value" type="{http://zigbee.org/sep}UInt16"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "TargetReduction", propOrder = { "type", "value" }) public class TargetReduction { @XmlElement(required = true) protected UnitType type; protected int value; /** * Gets the value of the type property. * * @return * possible object is * {@link UnitType } * */ public UnitType getType() { return type; } /** * Sets the value of the type property. * * @param value * allowed object is * {@link UnitType } * */ public void setType(UnitType value) { this.type = value; } /** * Gets the value of the value property. * */ public int getValue() { return value; } /** * Sets the value of the value property. * */ public void setValue(int value) { this.value = value; } }
[ "crahul10101991@gmail.com" ]
crahul10101991@gmail.com
72c97ec69faad4c9345729d98b8bab03019ce8d1
95e944448000c08dd3d6915abb468767c9f29d3c
/sources/com/p280ss/android/ugc/aweme/metrics/C33263e.java
7ebd9a81b9fb03b362bbe1da34677ce861bdf6bb
[]
no_license
xrealm/tiktok-src
261b1faaf7b39d64bb7cb4106dc1a35963bd6868
90f305b5f981d39cfb313d75ab231326c9fca597
refs/heads/master
2022-11-12T06:43:07.401661
2020-07-04T20:21:12
2020-07-04T20:21:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package com.p280ss.android.ugc.aweme.metrics; /* renamed from: com.ss.android.ugc.aweme.metrics.e */ final /* synthetic */ class C33263e implements Runnable { /* renamed from: a */ private final C33259d f86772a; C33263e(C33259d dVar) { this.f86772a = dVar; } public final void run() { this.f86772a.mo85254g(); } }
[ "65450641+Xyzdesk@users.noreply.github.com" ]
65450641+Xyzdesk@users.noreply.github.com
36add849b22d9024038601791dd48121ac29a667
1b0c578992559628dc9b5f7c3abaf0d467a23899
/src/chapter08/FindNearestPoints.java
ad93625f329ab8feb951c50cb86680964ee6ad4a
[]
no_license
RomaniEzzatYoussef/Exercises
c9897b92507abf2d7ddc79f7e05b8b3d208f1dad
396900c05dac95954f7ddbc424c5023deb562242
refs/heads/master
2020-09-25T05:52:16.701228
2019-12-13T19:26:12
2019-12-13T19:26:12
225,932,027
1
1
null
null
null
null
UTF-8
Java
false
false
1,378
java
package chapter08; import java.util.Scanner; /** * * 07/12/2017 11:45:10 PM * * @author roman * * * FindNearestPoints * */ public class FindNearestPoints { /** * @param args */ public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter the number of points: "); int numPoints = input.nextInt(); double[][] points = new double[numPoints][2]; for (int r = 0; r < points.length; r++) { points[r][0] = Math.random() * 100; points[r][1] = Math.random() * 100; } int p1 = 0; int p2 = 1; // Initial two points double shortestDistance = distance(points[p1][0], points[p1][1], points[p2][0], points[p2][1]); for (int i = 0; i < points.length; i++) { for (int j = i + 1; j < points.length; j++) { double distance = distance(points[i][0], points[i][1], points[j][0], points[j][1]); if (shortestDistance > distance) { p1 = i; // Update p1 p2 = j; // Update p2 shortestDistance = distance; } } } System.out.println("The closest two points are " + "(" + points[p1][0] + ", " + points[p1][1] + ") and (" + points[p2][0] + ", " + points[p2][1] + ")"); input.close(); } public static double distance(double x1, double y1, double x2, double y2) { return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); } }
[ "romaniezzat@hotmail.com" ]
romaniezzat@hotmail.com
0dc8b87210ba05586ec178a4a7d2578f7755c1e1
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_7740.java
86ddc4cd1e27ed69092584661dc6c8b2e35197c1
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,224
java
@Override public int getItemViewType(int section,int position){ HashMap<String,ArrayList<TLRPC.TL_contact>> usersSectionsDict=onlyUsers == 2 ? ContactsController.getInstance(currentAccount).usersMutualSectionsDict : ContactsController.getInstance(currentAccount).usersSectionsDict; ArrayList<String> sortedUsersSectionsArray=onlyUsers == 2 ? ContactsController.getInstance(currentAccount).sortedUsersMutualSectionsArray : ContactsController.getInstance(currentAccount).sortedUsersSectionsArray; if (onlyUsers != 0 && !isAdmin) { ArrayList<TLRPC.TL_contact> arr=usersSectionsDict.get(sortedUsersSectionsArray.get(section)); return position < arr.size() ? 0 : 3; } else { if (section == 0) { if ((needPhonebook || isAdmin) && position == 1 || position == 3) { return 2; } } else { if (sortType == 2) { if (section == 1) { return position < onlineContacts.size() ? 0 : 3; } } else { if (section - 1 < sortedUsersSectionsArray.size()) { ArrayList<TLRPC.TL_contact> arr=usersSectionsDict.get(sortedUsersSectionsArray.get(section - 1)); return position < arr.size() ? 0 : 3; } } } } return 1; }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
5fbb60b6a70d80a02ebc1874b6bd7c287784f4fd
ea11080a72772415150160bc0755fde5f4c8e367
/dbflute-runtime/src/main/java/org/seasar/dbflute/helper/token/file/exception/FileMakingRequiredOptionNotFoundException.java
9455e5524ef84cd6ee4578d2c83357db7c6b1522
[ "Apache-2.0" ]
permissive
seasarorg/dbflute
d68ce1dacecfe98610a48de218596544cb0b5327
9cb32db332d7c73208abf1aa102997cfcb021209
refs/heads/master
2020-04-06T07:02:01.733311
2019-01-01T05:45:41
2019-01-01T05:45:41
13,241,864
14
9
null
2016-08-08T09:57:28
2013-10-01T11:27:10
Java
UTF-8
Java
false
false
1,331
java
/* * Copyright 2004-2014 the Seasar Foundation and the Others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, * either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ package org.seasar.dbflute.helper.token.file.exception; /** * @author jflute */ public class FileMakingRequiredOptionNotFoundException extends RuntimeException { /** Serial version UID. (Default) */ private static final long serialVersionUID = 1L; /** * Constructor. * @param msg The message for the exception. (NotNull) */ public FileMakingRequiredOptionNotFoundException(String msg) { super(msg); } /** * Constructor. * @param msg Exception message. (NotNull) * @param cause The wrapped exception. (NotNull) */ public FileMakingRequiredOptionNotFoundException(String msg, Throwable cause) { super(msg, cause); } }
[ "dbflute@gmail.com" ]
dbflute@gmail.com
e43f9ae5af8e58174ee065d7151ea6c7b8810ccc
83893946a9daaa90d1a06f5e1398e1490eefd92b
/app/src/main/java/appdebugdemo/lyb/com/appdebugdemo/util/BitmapCache.java
7af3ec0240a9afa3b7dec11277ba617d0d9200bf
[]
no_license
jiafenggit/APPDebugDemo
54ccc5004e2349f50465046c4e9f427f4c5614f9
89d627e52ffd129cbf6181f45aa8ff341d469200
refs/heads/master
2021-01-15T10:41:51.115529
2015-05-06T09:39:03
2015-05-06T09:39:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,629
java
/* * Copyright 2011 - AndroidQuery.com (tinyeeliu@gmail.com) * * 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 appdebugdemo.lyb.com.appdebugdemo.util; import android.graphics.Bitmap; import java.util.Iterator; import java.util.LinkedHashMap; /** * AQuery internal use only. * */ public class BitmapCache extends LinkedHashMap<String, Bitmap>{ private static final long serialVersionUID = 1L; private int maxCount; private int maxPixels; private int maxTotalPixels; private int pixels; public BitmapCache(int mc, int mp, int mtp){ super(8, 0.75F, true); this.maxCount = mc; this.maxPixels = mp; this.maxTotalPixels = mtp; } @Override public Bitmap put(String key, Bitmap bm){ Bitmap old = null; int px = pixels(bm); if(px <= maxPixels){ pixels += px; old = super.put(key, bm); if(old != null){ pixels -= pixels(old); } //AQUtility.debug("put", key); }else{ //AQUtility.debug("reject", px + ":" + bm.getWidth() + ":" + bm.getHeight() + ":" + key); } return old; } @Override public Bitmap remove(Object key){ Bitmap old = super.remove(key); if(old != null){ pixels -= pixels(old); } //AQUtility.debug("remove pixels", key + ":" + size() + ":" + pixels); return old; } @Override public void clear(){ super.clear(); pixels = 0; } private int pixels(Bitmap bm){ if(bm == null) return 0; return bm.getWidth() * bm.getHeight(); } private void shrink(){ if(pixels > maxTotalPixels){ Iterator<String> keys = keySet().iterator(); while(keys.hasNext()){ keys.next(); keys.remove(); if(pixels <= maxTotalPixels){ break; } } } } @Override public boolean removeEldestEntry(Entry<String, Bitmap> eldest) { if(pixels > maxTotalPixels || size() > maxCount){ /* if(pixels > maxTotalPixels){ AQUtility.debug("evict by max size"); }else{ AQUtility.debug("evict by count", maxCount); } */ remove(eldest.getKey()); } shrink(); return false; } }
[ "342161360@qq.com" ]
342161360@qq.com
1c65dc273db199660322b59aba936c81e7d09627
4fab44e9f3205863c0c4e888c9de1801919dc605
/AL-Game/src/com/aionemu/gameserver/dataholders/TeleLocationData.java
303e5809936798404a00d7ed226e2bf0f310657b
[]
no_license
YggDrazil/AionLight9
fce24670dcc222adb888f4a5d2177f8f069fd37a
81f470775c8a0581034ed8c10d5462f85bef289a
refs/heads/master
2021-01-11T00:33:15.835333
2016-07-29T19:20:11
2016-07-29T19:20:11
70,515,345
2
0
null
null
null
null
UTF-8
Java
false
false
1,922
java
/** * This file is part of Aion-Lightning <aion-lightning.org>. * * Aion-Lightning is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Aion-Lightning is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Aion-Lightning. * If not, see <http://www.gnu.org/licenses/>. */ package com.aionemu.gameserver.dataholders; import com.aionemu.gameserver.model.templates.teleport.TelelocationTemplate; import gnu.trove.map.hash.TIntObjectHashMap; import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import java.util.List; /** * @author orz */ @XmlRootElement(name = "teleport_location") @XmlAccessorType(XmlAccessType.FIELD) public class TeleLocationData { @XmlElement(name = "teleloc_template") private List<TelelocationTemplate> tlist; /** * A map containing all teleport location templates */ private TIntObjectHashMap<TelelocationTemplate> loctlistData = new TIntObjectHashMap<TelelocationTemplate>(); void afterUnmarshal(Unmarshaller u, Object parent) { for (TelelocationTemplate loc : tlist) { loctlistData.put(loc.getLocId(), loc); } } public int size() { return loctlistData.size(); } public TelelocationTemplate getTelelocationTemplate(int id) { return loctlistData.get(id); } }
[ "michelgorter@outlook.com" ]
michelgorter@outlook.com
b1c991b62a7937b94dcc3b604f55ae55301cb1a5
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
/src/testcases/CWE566_Authorization_Bypass_Through_SQL_Primary/CWE566_Authorization_Bypass_Through_SQL_Primary__Servlet_54e.java
0d3c9a5491d28b674c33846b03aff1f05308425b
[]
no_license
bqcuong/Juliet-Test-Case
31e9c89c27bf54a07b7ba547eddd029287b2e191
e770f1c3969be76fdba5d7760e036f9ba060957d
refs/heads/master
2020-07-17T14:51:49.610703
2019-09-03T16:22:58
2019-09-03T16:22:58
206,039,578
1
2
null
null
null
null
UTF-8
Java
false
false
5,226
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE566_Authorization_Bypass_Through_SQL_Primary__Servlet_54e.java Label Definition File: CWE566_Authorization_Bypass_Through_SQL_Primary__Servlet.label.xml Template File: sources-sink-54e.tmpl.java */ /* * @description * CWE: 566 Authorization Bypass through SQL primary * BadSource: user id taken from url parameter * GoodSource: hardcoded user id * Sinks: writeConsole * BadSink : user authorization not checked * Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package * * */ package testcases.CWE566_Authorization_Bypass_Through_SQL_Primary; import testcasesupport.*; import javax.servlet.http.*; import java.sql.*; import java.util.logging.Level; public class CWE566_Authorization_Bypass_Through_SQL_Primary__Servlet_54e { public void badSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable { Connection dBConnection = IO.getDBConnection(); PreparedStatement preparedStatement = null; ResultSet resultSet = null; int id = 0; try { id = Integer.parseInt(data); } catch ( NumberFormatException nfx ) { id = -1; /* Assuming this id does not exist */ } try { preparedStatement = dBConnection.prepareStatement("select * from invoices where uid=?"); preparedStatement.setInt(1, id); resultSet = preparedStatement.executeQuery(); /* POTENTIAL FLAW: no check to see whether the user has privileges to view the data */ IO.writeString("bad() - result requested: " + data +"\n"); } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error executing query", exceptSql); } finally { try { if (resultSet != null) { resultSet.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Could not close ResultSet", exceptSql); } try { if (preparedStatement != null) { preparedStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Could not close PreparedStatement", exceptSql); } try { if (dBConnection != null) { dBConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Could not close Connection", exceptSql); } } } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(String data , HttpServletRequest request, HttpServletResponse response) throws Throwable { Connection dBConnection = IO.getDBConnection(); PreparedStatement preparedStatement = null; ResultSet resultSet = null; int id = 0; try { id = Integer.parseInt(data); } catch ( NumberFormatException nfx ) { id = -1; /* Assuming this id does not exist */ } try { preparedStatement = dBConnection.prepareStatement("select * from invoices where uid=?"); preparedStatement.setInt(1, id); resultSet = preparedStatement.executeQuery(); /* POTENTIAL FLAW: no check to see whether the user has privileges to view the data */ IO.writeString("bad() - result requested: " + data +"\n"); } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error executing query", exceptSql); } finally { try { if (resultSet != null) { resultSet.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Could not close ResultSet", exceptSql); } try { if (preparedStatement != null) { preparedStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Could not close PreparedStatement", exceptSql); } try { if (dBConnection != null) { dBConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Could not close Connection", exceptSql); } } } }
[ "bqcuong2212@gmail.com" ]
bqcuong2212@gmail.com
23d48b4014f5357bb073dc578fc02c212b0aa25b
675cbffa1d3e6716f0f89db8ac0ca637105967cf
/RtmpResourceLib/src/main/java/net/lucode/hackware/magicindicator/FragmentContainerHelper.java
7640841cdc26e33ddf63f4a503263506fdc3a803
[]
no_license
led-os/HTWorks
d5bd33e7fddf99930c318ced94869c17f7a97836
ee94e8a2678b8a2ea79e73026d665d57f312f7e2
refs/heads/master
2022-04-05T02:56:14.051111
2020-01-21T07:38:25
2020-01-21T07:38:25
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,298
java
package net.lucode.hackware.magicindicator; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.annotation.TargetApi; import android.os.Build; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Interpolator; import net.lucode.hackware.magicindicator.buildins.commonnavigator.model.PositionData; import java.util.ArrayList; import java.util.List; /** * 使得MagicIndicator在FragmentContainer中使用 * Created by hackware on 2016/9/4. */ @TargetApi(Build.VERSION_CODES.HONEYCOMB) public class FragmentContainerHelper { private List<MagicIndicator> mMagicIndicators = new ArrayList<MagicIndicator>(); private ValueAnimator mScrollAnimator; private int mLastSelectedIndex; private int mDuration = 150; private Interpolator mInterpolator = new AccelerateDecelerateInterpolator(); private Animator.AnimatorListener mAnimatorListener = new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { dispatchPageScrollStateChanged(ScrollState.SCROLL_STATE_IDLE); mScrollAnimator = null; } }; private ValueAnimator.AnimatorUpdateListener mAnimatorUpdateListener = new ValueAnimator.AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animation) { float positionOffsetSum = (Float) animation.getAnimatedValue(); int position = (int) positionOffsetSum; float positionOffset = positionOffsetSum - position; if (positionOffsetSum < 0) { position = position - 1; positionOffset = 1.0f + positionOffset; } dispatchPageScrolled(position, positionOffset, 0); } }; public FragmentContainerHelper() { } public FragmentContainerHelper(MagicIndicator magicIndicator) { mMagicIndicators.add(magicIndicator); } /** * IPagerIndicator支持弹性效果的辅助方法 * * @param positionDataList * @param index * @return */ public static PositionData getImitativePositionData(List<PositionData> positionDataList, int index) { if (index >= 0 && index <= positionDataList.size() - 1) { // 越界后,返回假的PositionData return positionDataList.get(index); } else { PositionData result = new PositionData(); PositionData referenceData; int offset; if (index < 0) { offset = index; referenceData = positionDataList.get(0); } else { offset = index - positionDataList.size() + 1; referenceData = positionDataList.get(positionDataList.size() - 1); } result.mLeft = referenceData.mLeft + offset * referenceData.width(); result.mTop = referenceData.mTop; result.mRight = referenceData.mRight + offset * referenceData.width(); result.mBottom = referenceData.mBottom; result.mContentLeft = referenceData.mContentLeft + offset * referenceData.width(); result.mContentTop = referenceData.mContentTop; result.mContentRight = referenceData.mContentRight + offset * referenceData.width(); result.mContentBottom = referenceData.mContentBottom; return result; } } public void handlePageSelected(int selectedIndex) { handlePageSelected(selectedIndex, true); } public void handlePageSelected(int selectedIndex, boolean smooth) { if (mLastSelectedIndex == selectedIndex) { return; } if (smooth) { if (mScrollAnimator == null || !mScrollAnimator.isRunning()) { dispatchPageScrollStateChanged(ScrollState.SCROLL_STATE_SETTLING); } dispatchPageSelected(selectedIndex); float currentPositionOffsetSum = mLastSelectedIndex; if (mScrollAnimator != null) { currentPositionOffsetSum = (Float) mScrollAnimator.getAnimatedValue(); mScrollAnimator.cancel(); mScrollAnimator = null; } mScrollAnimator = new ValueAnimator(); mScrollAnimator.setFloatValues(currentPositionOffsetSum, selectedIndex); // position = selectedIndex, positionOffset = 0.0f mScrollAnimator.addUpdateListener(mAnimatorUpdateListener); mScrollAnimator.addListener(mAnimatorListener); mScrollAnimator.setInterpolator(mInterpolator); mScrollAnimator.setDuration(mDuration); mScrollAnimator.start(); } else { dispatchPageSelected(selectedIndex); if (mScrollAnimator != null && mScrollAnimator.isRunning()) { dispatchPageScrolled(mLastSelectedIndex, 0.0f, 0); } dispatchPageScrollStateChanged(ScrollState.SCROLL_STATE_IDLE); dispatchPageScrolled(selectedIndex, 0.0f, 0); } mLastSelectedIndex = selectedIndex; } public void setDuration(int duration) { mDuration = duration; } public void setInterpolator(Interpolator interpolator) { if (interpolator == null) { mInterpolator = new AccelerateDecelerateInterpolator(); } else { mInterpolator = interpolator; } } public void attachMagicIndicator(MagicIndicator magicIndicator) { mMagicIndicators.add(magicIndicator); } private void dispatchPageSelected(int pageIndex) { for (MagicIndicator magicIndicator : mMagicIndicators) { // magicIndicator.onPageSelected(pageIndex); } } private void dispatchPageScrollStateChanged(int state) { for (MagicIndicator magicIndicator : mMagicIndicators) { // magicIndicator.onPageScrollStateChanged(state); } } private void dispatchPageScrolled(int position, float positionOffset, int positionOffsetPixels) { for (MagicIndicator magicIndicator : mMagicIndicators) { // magicIndicator.onPageScrolled(position, positionOffset, positionOffsetPixels); } } }
[ "yaohu2011@163.com" ]
yaohu2011@163.com
2830d97a673485900a8d85916edc0d16555e48ee
d015ccd17f917fbb2446f211977fd78a96ec0591
/cp-book/ch3/dp/_836_LargestSubmatrix.java
2b99c4304f5bcfa6ad2a8ea5474568794a32a2fd
[ "MIT" ]
permissive
andrey-yemelyanov/competitive-programming
f74d4f35c527b80f4ef0b5fc17d1a4aedbc36ff3
f5c5fc9a5951a81dbae1250e17cd3d51a96b7a47
refs/heads/master
2021-01-12T17:29:32.384671
2018-08-03T08:57:00
2018-08-03T08:57:00
71,582,272
1
0
null
null
null
null
UTF-8
Java
false
false
2,695
java
import java.util.*; import static java.lang.Math.*; import java.util.stream.*; /* Problem name: 836 Largest Submatrix Problem url: https://uva.onlinejudge.org/external/8/836.pdf Author: Andrey Yemelyanov */ public class _836_LargestSubmatrix { public static void main(String[] args){ Scanner s = new Scanner(System.in); int nTests = s.nextInt(); s.nextLine(); s.nextLine(); while(nTests-- > 0){ List<int[]> m = new ArrayList<>(); while(true){ String line = ""; if(s.hasNext()){ line = s.nextLine(); } if(!line.isEmpty()){ int[] row = new int[line.length()]; for(int i = 0; i < row.length; i++){ row[i] = Character.getNumericValue(line.charAt(i)); } m.add(row); }else{ int[][] matrix = new int[m.size()][m.get(0).length]; for(int i = 0; i < matrix.length; i++){ for(int j = 0; j < matrix[i].length; j++){ matrix[i][j] = m.get(i)[j]; } } int largest = largestSubmatrix(matrix); if(largest == NEG_INF) System.out.println(0); else System.out.println(largest); if(nTests > 0) System.out.println(); break; } } } } static final int NEG_INF = -1000000; static int largestSubmatrix(int[][] matrix){ for(int i = 0; i < matrix.length; i++){ for(int j = 0; j < matrix[0].length; j++){ if(matrix[i][j] == 0) matrix[i][j] = NEG_INF; } } return largestSubRectSum(buildSums(matrix)); } static int largestSubRectSum(int[][] sums){ int n = sums.length; int m = sums[0].length; int largestSubRect = Integer.MIN_VALUE; for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ for(int k = i; k < n; k++){ for(int l = j; l < m; l++){ largestSubRect = max(largestSubRect, getSubRectSum(sums, i, j, k, l)); } } } } return largestSubRect; } static int[][] buildSums(int[][] matrix){ int[][] sums = new int[matrix.length][matrix[0].length]; for(int i = 0; i < matrix.length; i++){ for(int j = 0; j < matrix[i].length; j++){ sums[i][j] = matrix[i][j]; if(i > 0) sums[i][j] += sums[i - 1][j]; if(j > 0) sums[i][j] += sums[i][j - 1]; if(i > 0 && j > 0) sums[i][j] -= sums[i - 1][j - 1]; } } return sums; } static int getSubRectSum(int[][] sums, int i, int j, int k, int l){ int subRect = sums[k][l]; if(i > 0) subRect -= sums[i - 1][l]; if(j > 0) subRect -= sums[k][j - 1]; if(i > 0 && j > 0) subRect += sums[i - 1][j - 1]; return subRect; } }
[ "andrey.yemelyanov@gmail.com" ]
andrey.yemelyanov@gmail.com
d5f5ee4afc456a314ccc69fcd3becc4844603c0c
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/apache/ignite/spi/discovery/tcp/ipfinder/s3/encrypt/SymmetricKeyEncryptionServiceTest.java
e162044c1624a230a3fad9c45cb7f3eea490cb8d
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
1,662
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.ignite.spi.discovery.tcp.ipfinder.s3.encrypt; import java.nio.charset.StandardCharsets; import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.junit.Assert; import org.junit.Test; /** * Class to test {@link SymmetricKeyEncryptionService}. */ public class SymmetricKeyEncryptionServiceTest extends GridCommonAbstractTest { /** * Symmetric key encryption service. */ private SymmetricKeyEncryptionService encryptionSvc; /** * Test whether encryption and decryption. */ @Test public void testEncryptDecrypt() { byte[] testData = "test string".getBytes(StandardCharsets.UTF_8); byte[] encData = encryptionSvc.encrypt(testData); byte[] decData = encryptionSvc.decrypt(encData); Assert.assertArrayEquals(testData, decData); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
dfb83f9b5ebb69c607b859a1cb3c3273ce2ebaf1
6063b28a3cc691b4c8a05c7364a8729ea9759f49
/src/main/java/com/alipay/api/domain/MybankCreditSceneprodPaymentQueryModel.java
477c5aaecbb865bc202bcfb84d9ea68a6d62cc5c
[]
no_license
citi123/test-obj
f68b69c5bbf0dad4dcbfc4ff078645caa98e9084
83ee779f010fd1f3f42436d073c6a602407a0222
refs/heads/master
2022-10-29T14:02:02.200643
2019-07-01T07:20:05
2019-07-01T07:20:05
127,399,103
0
0
null
2022-10-12T19:51:52
2018-03-30T07:52:54
Java
UTF-8
Java
false
false
667
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-23 11:37:34 */ public class MybankCreditSceneprodPaymentQueryModel extends AlipayObject { private static final long serialVersionUID = 4747793719231647882L; /** * 网商内部代收付申请单编号,外部机构根据此编号查询申请状态。 */ @ApiField("in_apply_no") private String inApplyNo; public String getInApplyNo() { return this.inApplyNo; } public void setInApplyNo(String inApplyNo) { this.inApplyNo = inApplyNo; } }
[ "tao.chen@guanaitong.com" ]
tao.chen@guanaitong.com
d4df69e0d03734bab3415a4b96dd5a34aa8266c0
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_402be9a45b1f9baf94d75aaffa5f20b38188fa9f/WlAvatarContext/8_402be9a45b1f9baf94d75aaffa5f20b38188fa9f_WlAvatarContext_t.java
a813e0455a6196adf771de342ede5e7d95990970
[]
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,979
java
/** * Project Wonderland * * Copyright (c) 2004-2009, Sun Microsystems, Inc., All Rights Reserved * * Redistributions in source code form must reproduce the above * copyright and this condition. * * The contents of this file are subject to the GNU General Public * License, Version 2 (the "License"); you may not use this file * except in compliance with the License. A copy of the License is * available at http://www.opensource.org/licenses/gpl-license.php. * * Sun designates this particular file as subject to the "Classpath" * exception as provided by Sun in the License file that accompanied * this code. */ package org.jdesktop.wonderland.modules.avatarbase.client.jme.cellrenderer; import imi.character.avatar.Avatar; import imi.character.statemachine.corestates.ActionInfo; import imi.character.statemachine.corestates.ActionState; import imi.character.statemachine.corestates.CycleActionState; import java.util.HashMap; /** * * Overload AvatarContext to add playMiscAnimation * * @author paulby */ public class WlAvatarContext extends imi.character.avatar.AvatarContext { private HashMap<String, ActionInfo> actionMap = new HashMap(); private ActionInfo currentActionInfo = null; public WlAvatarContext(Avatar avatar) { super(avatar); if (avatar.getCharacterParams().isAnimateBody()) for(ActionInfo actionInfo : getGenericAnimations()) { actionMap.put(actionInfo.getAnimationName(), actionInfo); } } /** * Return the names of the animations available to this character * @return */ public Iterable<String> getAnimationNames() { return actionMap.keySet(); } public void playMiscAnimation(String name) { if (getavatar().getCharacterParams().isAnimateBody()) { setMiscAnimation(name); // Force the trigger, note that this transition is so fast that the // state machine may not actually change state. Therefore in triggerAlert // we check for the trigger and force the state change. triggerReleased(TriggerNames.MiscAction.ordinal()); triggerPressed(TriggerNames.MiscAction.ordinal()); triggerReleased(TriggerNames.MiscAction.ordinal()); } } public void setMiscAnimation(String animationName) { currentActionInfo = actionMap.get(animationName); ActionState action = (ActionState) gameStates.get(CycleActionState.class); action.setAnimationSetBoolean(false); currentActionInfo.apply(action); } @Override protected void triggerAlert(int trigger, boolean pressed) { if (pressed && trigger==TriggerNames.MiscAction.ordinal()) { // Force animation to play if this is a Misc trigger setCurrentState((ActionState) gameStates.get(CycleActionState.class)); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ab08ca9fa0b65a3c18440a41e4426f1c2aabc0f7
66220fbb2b7d99755860cecb02d2e02f946e0f23
/src/net/sourceforge/plantuml/ugraphic/tikz/DriverLineTikz.java
4ac35b9ae077942c9498a6d935e2f15b1b4df413
[ "MIT" ]
permissive
isabella232/plantuml-mit
27e7c73143241cb13b577203673e3882292e686e
63b2bdb853174c170f304bc56f97294969a87774
refs/heads/master
2022-11-09T00:41:48.471405
2020-06-28T12:42:10
2020-06-28T12:42:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,550
java
/* ======================================================================== * PlantUML : a free UML diagram generator * ======================================================================== * * (C) Copyright 2009-2020, Arnaud Roques * * Project Info: https://plantuml.com * * If you like this project or if you find it useful, you can support us at: * * https://plantuml.com/patreon (only 1$ per month!) * https://plantuml.com/paypal * * This file is part of PlantUML. * * Licensed under The MIT License (Massachusetts Institute of Technology License) * * See http://opensource.org/licenses/MIT * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * Original Author: Arnaud Roques */ package net.sourceforge.plantuml.ugraphic.tikz; import net.sourceforge.plantuml.tikz.TikzGraphics; import net.sourceforge.plantuml.ugraphic.UDriver; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UParam; import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; public class DriverLineTikz implements UDriver<TikzGraphics> { public void draw(UShape shape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) { final ULine line = (ULine) shape; double x2 = x + line.getDX(); double y2 = y + line.getDY(); tikz.setStrokeColor(mapper.toColor(param.getColor())); tikz.setStrokeWidth(param.getStroke().getThickness(), param.getStroke().getDashTikz()); tikz.line(x, y, x2, y2); } }
[ "plantuml@gmail.com" ]
plantuml@gmail.com
0bbc0be94b7ab24ada3665f885d0227cc4a63e51
9019dadbcb6dbc57272182e9f0d04cb4793ecbc9
/robobinding/src/test/java/org/robobinding/viewattribute/listview/SetCheckedItemPositionsAttributeTest.java
d18428d018151c42fb9295e0962a8c084654d159
[ "Apache-2.0" ]
permissive
romanlum/RoboBinding
fdbb855581195a8f5694f6fc4d8c76f914e111d9
570274320d0119db09c8e3d1224b6bfa3aff7139
refs/heads/master
2021-01-12T21:53:30.678186
2013-09-25T10:19:54
2013-09-25T10:19:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,135
java
/** * Copyright 2012 Cheng Wei, Robert Taylor * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions * and limitations under the License. */ package org.robobinding.viewattribute.listview; import static org.hamcrest.CoreMatchers.equalTo; import static org.junit.Assert.assertThat; import java.util.Set; import org.junit.Before; import org.junit.Test; import org.robobinding.property.ValueModel; import org.robobinding.viewattribute.listview.CheckedItemPositionsAttribute.SetCheckedItemPositionsAttribute; import android.widget.ListView; import com.google.common.collect.Sets; /** * * @since 1.0 * @version $Revision: 1.0 $ * @author Cheng Wei */ public class SetCheckedItemPositionsAttributeTest extends AbstractCheckedItemPositionsAttributeTest<ListView, SetCheckedItemPositionsAttribute> { private Set<Integer> checkedItemPositions; @Before public void setUp() { super.setUp(); checkedItemPositions = SparseBooleanArrayUtils.toSet(anySparseBooleanArray()); } @Test public void whenValueModelUpdated_thenViewShouldReflectChanges() { attribute.valueModelUpdated(checkedItemPositions); assertThat(SparseBooleanArrayUtils.toSet(view.getCheckedItemPositions()), equalTo(checkedItemPositions)); } @Test public void whenCheckedItemPositionChanged_thenValueModelUpdatedAccordingly() { @SuppressWarnings({ "unchecked", "rawtypes" }) ValueModel<Set<Integer>> valueModel = (ValueModel) twoWayBindToProperty(Set.class, Sets.newHashSet()); setItemsChecked(checkedItemPositions); assertThat(valueModel.getValue(), equalTo(checkedItemPositions)); } }
[ "weicheng112@gmail.com" ]
weicheng112@gmail.com
27b483c964892deda5ea8511a611e31e119788c4
7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b
/Crawler/data/DvmField.java
2fd99babbb552295d1f12c61d2e33e6dfc56db36
[]
no_license
NayrozD/DD2476-Project
b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0
94dfb3c0a470527b069e2e0fd9ee375787ee5532
refs/heads/master
2023-03-18T04:04:59.111664
2021-03-10T15:03:07
2021-03-10T15:03:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,345
java
16 https://raw.githubusercontent.com/wmm1996528/unidbg_douyin10/master/src/main/java/com/github/unidbg/linux/android/dvm/DvmField.java package com.github.unidbg.linux.android.dvm; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; class DvmField implements Hashable { private static final Log log = LogFactory.getLog(DvmField.class); private final DvmClass dvmClass; final String fieldName; final String fieldType; DvmField(DvmClass dvmClass, String fieldName, String fieldType) { this.dvmClass = dvmClass; this.fieldName = fieldName; this.fieldType = fieldType; } DvmObject<?> getStaticObjectField() { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("getStaticObjectField dvmClass=" + dvmClass + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature); } BaseVM vm = dvmClass.vm; return vm.jni.getStaticObjectField(vm, dvmClass, signature); } int getStaticIntField() { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("getStaticIntField dvmClass=" + dvmClass + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature); } BaseVM vm = dvmClass.vm; return dvmClass.vm.jni.getStaticIntField(vm, dvmClass, signature); } DvmObject<?> getObjectField(DvmObject<?> dvmObject) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("getObjectField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature); } BaseVM vm = dvmClass.vm; return vm.jni.getObjectField(vm, dvmObject, signature); } int getIntField(DvmObject<?> dvmObject) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("getIntField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature); } return dvmClass.vm.jni.getIntField(dvmClass.vm, dvmObject, signature); } long getLongField(DvmObject<?> dvmObject) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("getLongField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature); } return dvmClass.vm.jni.getLongField(dvmClass.vm, dvmObject, signature); } void setObjectField(DvmObject<?> dvmObject, DvmObject<?> value) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("setObjectField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature + ", value=" + value); } dvmClass.vm.jni.setObjectField(dvmClass.vm, dvmObject, signature, value); } int getBooleanField(DvmObject<?> dvmObject) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("getBooleanField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature); } return dvmClass.vm.jni.getBooleanField(dvmClass.vm, dvmObject, signature) ? VM.JNI_TRUE : VM.JNI_FALSE; } void setIntField(DvmObject<?> dvmObject, int value) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("setIntField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature + ", value=" + value); } dvmClass.vm.jni.setIntField(dvmClass.vm, dvmObject, signature, value); } void setLongField(DvmObject<?> dvmObject, long value) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("setLongField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature + ", value=" + value); } dvmClass.vm.jni.setLongField(dvmClass.vm, dvmObject, signature, value); } void setBooleanField(DvmObject<?> dvmObject, boolean value) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("setBooleanField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature + ", value=" + value); } dvmClass.vm.jni.setBooleanField(dvmClass.vm, dvmObject, signature, value); } void setDoubleField(DvmObject<?> dvmObject, double value) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("setDoubleField dvmObject=" + dvmObject + ", fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature + ", value=" + value); } dvmClass.vm.jni.setDoubleField(dvmClass.vm, dvmObject, signature, value); } void setStaticLongField(long value) { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("setStaticLongField fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature + ", value=" + value); } dvmClass.vm.jni.setStaticLongField(dvmClass.vm, signature, value); } long getStaticLongField() { String signature = dvmClass.getClassName() + "->" + fieldName + ":" + fieldType; if (log.isDebugEnabled()) { log.debug("getStaticLongField fieldName=" + fieldName + ", fieldType=" + fieldType + ", signature=" + signature); } return dvmClass.vm.jni.getStaticLongField(dvmClass.vm, signature); } }
[ "veronika.cucorova@gmail.com" ]
veronika.cucorova@gmail.com
3a87450644c357b727fde70a7eeacc0497b7b263
d16f17f3b9d0aa12c240d01902a41adba20fad12
/src/leetcode/leetcode19xx/leetcode1921/SolutionTest.java
ee89f2a65ffd1e10fe1e8d72a3f3da16d814060f
[]
no_license
redsun9/leetcode
79f9293b88723d2fd123d9e10977b685d19b2505
67d6c16a1b4098277af458849d352b47410518ee
refs/heads/master
2023-06-23T19:37:42.719681
2023-06-09T21:11:39
2023-06-09T21:11:39
242,967,296
38
3
null
null
null
null
UTF-8
Java
false
false
645
java
package leetcode.leetcode19xx.leetcode1921; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; class SolutionTest { @Test void test1() { int[] dist = {1, 3, 4}, speed = {1, 1, 1}; assertEquals(3, new Solution().eliminateMaximum(dist, speed)); } @Test void test2() { int[] dist = {1, 1, 2, 3}, speed = {1, 1, 1, 1}; assertEquals(1, new Solution().eliminateMaximum(dist, speed)); } @Test void test3() { int[] dist = {3, 2, 4}, speed = {5, 3, 2}; assertEquals(1, new Solution().eliminateMaximum(dist, speed)); } }
[ "mokeev.vladimir@gmail.com" ]
mokeev.vladimir@gmail.com
4769ad527fd08bde81ab6d973ac4ef3610f842ee
44e59e28d0f8dda15a2d88db49d69d97898cf685
/src/main/java/com/pengu/lostthaumaturgy/core/block/BlockLyingItem.java
f4cc0b33eddc024402306788e5abcd2f07bc2f66
[]
no_license
limuness/LostThaumaturgy
661ed826f5aed86ab1ab60d5ed07af33b3b92d82
f50b540aac6d0af2bc53db0a5681716263893133
refs/heads/1.12
2021-06-25T23:17:08.522775
2017-09-06T12:39:54
2017-09-06T12:39:54
103,036,052
1
0
null
2017-09-10T14:31:48
2017-09-10T14:31:47
null
UTF-8
Java
false
false
4,015
java
package com.pengu.lostthaumaturgy.core.block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumBlockRenderType; import net.minecraft.util.NonNullList; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import com.pengu.hammercore.api.ITileBlock; import com.pengu.hammercore.common.utils.WorldUtil; import com.pengu.lostthaumaturgy.api.event.LyingItemPickedUpEvent; import com.pengu.lostthaumaturgy.core.block.def.BlockRendered; import com.pengu.lostthaumaturgy.core.tile.TileLyingItem; import com.pengu.lostthaumaturgy.init.BlocksLT; public class BlockLyingItem extends BlockRendered implements ITileEntityProvider, ITileBlock<TileLyingItem> { public BlockLyingItem() { super(Material.ROCK); setUnlocalizedName("lying_item"); } @Override public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) { TileLyingItem item = WorldUtil.cast(world.getTileEntity(pos), TileLyingItem.class); return item != null ? item.lying.get().copy() : ItemStack.EMPTY; } public static TileLyingItem place(World world, BlockPos pos, ItemStack stack) { if(world.isBlockLoaded(pos) && world.getBlockState(pos).getBlock().isReplaceable(world, pos)) { world.setBlockState(pos, BlocksLT.LYING_ITEM.getDefaultState()); TileLyingItem tile = WorldUtil.cast(world.getTileEntity(pos), TileLyingItem.class); if(tile == null) world.setTileEntity(pos, tile = new TileLyingItem()); tile.lying.set(stack.copy()); return tile; } return null; } public static final AxisAlignedBB aabb = new AxisAlignedBB(0, 0, 0, 0, 0, 0); @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return aabb; } @Override public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { if(entityIn instanceof EntityPlayer) { TileLyingItem tile = WorldUtil.cast(worldIn.getTileEntity(pos), TileLyingItem.class); if(tile != null) { try { LyingItemPickedUpEvent evt = new LyingItemPickedUpEvent((EntityPlayer) entityIn, pos, tile.lying.get().copy(), tile.placedByPlayer.get() != Boolean.TRUE); if(MinecraftForge.EVENT_BUS.post(evt)) return; EntityItem ei = ((EntityPlayer) entityIn).dropItem(evt.drop, true); if(ei != null) ei.setNoPickupDelay(); } finally { worldIn.setBlockToAir(pos); } } } } @Override public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) { } @Override public boolean isOpaqueCube(IBlockState state) { return false; } public boolean isFullCube(IBlockState state) { return false; } @Override public EnumBlockRenderType getRenderType(IBlockState state) { return EnumBlockRenderType.ENTITYBLOCK_ANIMATED; } @Override public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) { return false; } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new TileLyingItem(); } @Override public Class<TileLyingItem> getTileClass() { return TileLyingItem.class; } @Override public String getParticleSprite(World world, BlockPos pos) { return "minecraft:blocks/stone_andesite"; } }
[ "mrdimka@yahoo.com" ]
mrdimka@yahoo.com
2da64252d10f49efa6a8ba48cfb0f421252d2c72
a533dd7ccf94fc838da4f88fea0be4fb16fa77db
/testgreendao/src/main/java/com/example/testgreendao/entity/dao/GunDao.java
58a5badea121fe2707d77c3a1e6ba5685f9c160c
[]
no_license
androidxiejun/demoworkspace
2ff2235eb9a2e204c6116f684059e8c23c2911c0
f5b8d5903ac4a4e92ea4f2e8186bb5839742303c
refs/heads/master
2020-05-07T21:44:46.189361
2019-08-26T03:53:11
2019-08-26T03:53:11
180,914,859
1
0
null
null
null
null
UTF-8
Java
false
false
5,634
java
package com.example.testgreendao.entity.dao; import java.util.List; import android.database.Cursor; import android.database.sqlite.SQLiteStatement; import org.greenrobot.greendao.AbstractDao; import org.greenrobot.greendao.Property; import org.greenrobot.greendao.internal.DaoConfig; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.DatabaseStatement; import org.greenrobot.greendao.query.Query; import org.greenrobot.greendao.query.QueryBuilder; import com.example.testgreendao.entity.bean.Gun; // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. /** * DAO for table "db_gun". */ public class GunDao extends AbstractDao<Gun, Long> { public static final String TABLENAME = "db_gun"; /** * Properties of entity Gun.<br/> * Can be used for QueryBuilder and for referencing column names. */ public static class Properties { public final static Property Id = new Property(0, Long.class, "id", true, "_id"); public final static Property GunName = new Property(1, String.class, "gunName", false, "gun_name"); public final static Property GunNo = new Property(2, String.class, "gunNo", false, "gun_no"); public final static Property CustomId = new Property(3, Long.class, "customId", false, "custom_id"); } private Query<Gun> user_GunsQuery; public GunDao(DaoConfig config) { super(config); } public GunDao(DaoConfig config, DaoSession daoSession) { super(config, daoSession); } /** Creates the underlying database table. */ public static void createTable(Database db, boolean ifNotExists) { String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "\"db_gun\" (" + // "\"_id\" INTEGER PRIMARY KEY ," + // 0: id "\"gun_name\" TEXT," + // 1: gunName "\"gun_no\" TEXT," + // 2: gunNo "\"custom_id\" INTEGER);"); // 3: customId } /** Drops the underlying database table. */ public static void dropTable(Database db, boolean ifExists) { String sql = "DROP TABLE " + (ifExists ? "IF EXISTS " : "") + "\"db_gun\""; db.execSQL(sql); } @Override protected final void bindValues(DatabaseStatement stmt, Gun entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String gunName = entity.getGunName(); if (gunName != null) { stmt.bindString(2, gunName); } String gunNo = entity.getGunNo(); if (gunNo != null) { stmt.bindString(3, gunNo); } Long customId = entity.getCustomId(); if (customId != null) { stmt.bindLong(4, customId); } } @Override protected final void bindValues(SQLiteStatement stmt, Gun entity) { stmt.clearBindings(); Long id = entity.getId(); if (id != null) { stmt.bindLong(1, id); } String gunName = entity.getGunName(); if (gunName != null) { stmt.bindString(2, gunName); } String gunNo = entity.getGunNo(); if (gunNo != null) { stmt.bindString(3, gunNo); } Long customId = entity.getCustomId(); if (customId != null) { stmt.bindLong(4, customId); } } @Override public Long readKey(Cursor cursor, int offset) { return cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0); } @Override public Gun readEntity(Cursor cursor, int offset) { Gun entity = new Gun( // cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0), // id cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1), // gunName cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2), // gunNo cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3) // customId ); return entity; } @Override public void readEntity(Cursor cursor, Gun entity, int offset) { entity.setId(cursor.isNull(offset + 0) ? null : cursor.getLong(offset + 0)); entity.setGunName(cursor.isNull(offset + 1) ? null : cursor.getString(offset + 1)); entity.setGunNo(cursor.isNull(offset + 2) ? null : cursor.getString(offset + 2)); entity.setCustomId(cursor.isNull(offset + 3) ? null : cursor.getLong(offset + 3)); } @Override protected final Long updateKeyAfterInsert(Gun entity, long rowId) { entity.setId(rowId); return rowId; } @Override public Long getKey(Gun entity) { if(entity != null) { return entity.getId(); } else { return null; } } @Override public boolean hasKey(Gun entity) { return entity.getId() != null; } @Override protected final boolean isEntityUpdateable() { return true; } /** Internal query to resolve the "guns" to-many relationship of User. */ public List<Gun> _queryUser_Guns(Long customId) { synchronized (this) { if (user_GunsQuery == null) { QueryBuilder<Gun> queryBuilder = queryBuilder(); queryBuilder.where(Properties.CustomId.eq(null)); user_GunsQuery = queryBuilder.build(); } } Query<Gun> query = user_GunsQuery.forCurrentThread(); query.setParameter(0, customId); return query.list(); } }
[ "1019163135@qq.com" ]
1019163135@qq.com
01966df5dda2c1791ea78efdeaa6550333757ac2
7d7718936e2daf900e62ef183ff72bd4336ce6fd
/src/main/java/com/robertx22/age_of_exile/database/data/stats/datapacks/stats/spell_related/PerSpellCooldownStat.java
e69800d84b90a67c51f5366945f8c12c5e8671f6
[]
no_license
SF-s-Translation-repository/Age-of-Exile
75d1543736a4fc792066afd32f9a34efa0b6ba36
df075178517584c2b16fa5877a96e48aa4fc109e
refs/heads/master
2023-04-15T22:51:03.276732
2021-04-23T14:00:24
2021-04-23T14:00:24
282,349,542
0
0
null
2021-04-23T13:48:29
2020-07-25T01:42:42
Java
UTF-8
Java
false
false
2,338
java
package com.robertx22.age_of_exile.database.data.stats.datapacks.stats.spell_related; import com.robertx22.age_of_exile.database.data.spells.components.Spell; import com.robertx22.age_of_exile.database.data.spells.spell_classes.SpellModEnum; import com.robertx22.age_of_exile.database.data.stats.Stat; import com.robertx22.age_of_exile.database.data.stats.datapacks.stats.base.DatapackSpellStat; import com.robertx22.age_of_exile.database.data.stats.effects.base.BaseSpellCalcEffect; import com.robertx22.age_of_exile.database.data.stats.name_regex.StatNameRegex; import com.robertx22.age_of_exile.saveclasses.unit.StatData; import com.robertx22.age_of_exile.uncommon.effectdatas.SpellStatsCalcEffect; import com.robertx22.age_of_exile.uncommon.interfaces.IExtraStatEffect; import com.robertx22.age_of_exile.uncommon.interfaces.IStatEffect; public class PerSpellCooldownStat extends DatapackSpellStat implements IExtraStatEffect { public static String SER_ID = "spell_cooldown"; public PerSpellCooldownStat(Spell spell) { super(SER_ID); this.spell = spell.GUID(); this.spellname = spell.locNameForLangFile(); this.id = spell.GUID() + "_cooldown"; this.is_percent = true; } public PerSpellCooldownStat(String spell) { super(SER_ID); this.spell = spell; this.is_percent = true; } @Override public StatNameRegex getStatNameRegex() { return StatNameRegex.BASIC; } @Override public String locDescForLangFile() { return "Changes cooldown of spell"; } @Override public String locNameForLangFile() { return spellname + " Cooldown"; } @Override public IStatEffect getEffect() { return EFF; } static Effect EFF = new Effect(); private static class Effect extends BaseSpellCalcEffect { @Override public SpellStatsCalcEffect activate(SpellStatsCalcEffect effect, StatData data, Stat stat) { try { DatapackSpellStat es = (DatapackSpellStat) stat; if (es.spell.equals(effect.spell_id)) { effect.data.add(SpellModEnum.COOLDOWN, data); } } catch (Exception e) { e.printStackTrace(); } return effect; } } }
[ "treborx555@gmail.com" ]
treborx555@gmail.com
1e587b9cda367e8d669e6ff9ece12ca14ef74ff1
b6450cc5c18068a99bc3e2bc7064e119ed026fa6
/steel-store/api-gateway-server/src/main/java/com/ryit/gateway/config/RateLimiterConfig.java
d8f67709f8d92c2f1b50e85afde6a5d685dbb6bf
[ "Apache-2.0" ]
permissive
samphin/finish-projects
0f36eec553d49c04454a3871e85bd385f46173ae
19d2cb352e8c8209867573e6de00f144ddbe124e
refs/heads/master
2022-12-28T05:51:02.774038
2020-04-03T09:13:52
2020-04-03T09:13:52
225,137,147
1
2
Apache-2.0
2022-12-16T00:39:36
2019-12-01T09:38:16
Java
UTF-8
Java
false
false
1,434
java
package com.ryit.gateway.config; import com.ryit.commons.constants.JwtConstant; import org.springframework.cloud.gateway.filter.ratelimit.KeyResolver; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; import reactor.core.publisher.Mono; /** * 限流配置 */ @Configuration public class RateLimiterConfig { /** * 根据远程请求地址 * * @return */ @Bean public KeyResolver remoteAddrKeyResolver() { return exchange -> Mono.just(exchange.getRequest().getRemoteAddress().getAddress().getHostAddress()); } /** * 按URL限流,即以每秒内请求数按URL分组统计,超出限流的url请求都将返回429状态 * * @return */ @Bean KeyResolver apiKeyResolver() { return exchange -> Mono.just(exchange.getRequest().getPath().toString()); } /** * 按用户限流(现阶段以用户来限流) * * @return */ @Bean @Primary KeyResolver tokenResolver() { return exchange -> Mono.just(exchange.getRequest().getQueryParams().getFirst(JwtConstant.AUTHORIZATION)); } /** * 按IP来限流 * * @return */ @Bean KeyResolver ipResolver() { return exchange -> Mono.just(exchange.getRequest().getRemoteAddress().getHostName()); } }
[ "670610973@qq.com" ]
670610973@qq.com
f431d0085154693906a33e0a8ba04ac046f25b52
fbb7278a81374cb962df4150ffd592d55644d845
/samples/client/petstore/android-java/src/main/java/com/wordnik/client/JsonUtil.java
3d96fa3ac71cb69287bbcb7b82469124d363dc6b
[ "Apache-2.0" ]
permissive
isabella232/swagger-codegen
6b292d8211efeb718707e77a533a78c0aa45726d
2ea6c2a3a7520f35ac4aa135e6135525b144423a
refs/heads/master
2023-03-10T14:44:33.639406
2014-05-30T21:25:57
2014-05-30T21:25:57
310,349,732
0
0
NOASSERTION
2021-02-23T12:43:00
2020-11-05T16:00:41
null
UTF-8
Java
false
false
567
java
package com.wordnik.client; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.core.JsonGenerator.Feature; public class JsonUtil { public static ObjectMapper mapper; static { mapper = new ObjectMapper(); mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); } public static ObjectMapper getJsonMapper() { return mapper; } }
[ "fehguy@gmail.com" ]
fehguy@gmail.com
fad10354c064c296944dcd9aa3d8a9b250731acf
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/org/springframework/batch/sample/JobOperatorFunctionalTests.java
e43783355b198eea51c0b887ee1118a13082de02
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
4,187
java
/** * Copyright 2008-2009 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.batch.sample; import java.util.List; import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.configuration.JobRegistry; import org.springframework.batch.core.launch.JobOperator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/jobs/infiniteLoopJob.xml" }) public class JobOperatorFunctionalTests { private static final Log LOG = LogFactory.getLog(JobOperatorFunctionalTests.class); @Autowired private JobOperator operator; @Autowired private Job job; @Autowired private JobRegistry jobRegistry; @Test public void testStartStopResumeJob() throws Exception { String params = new JobParametersBuilder().addLong("jobOperatorTestParam", 7L).toJobParameters().toString(); long executionId = operator.start(job.getName(), params); Assert.assertEquals(params, operator.getParameters(executionId)); stopAndCheckStatus(executionId); long resumedExecutionId = operator.restart(executionId); Assert.assertEquals(params, operator.getParameters(resumedExecutionId)); stopAndCheckStatus(resumedExecutionId); List<Long> instances = operator.getJobInstances(job.getName(), 0, 1); Assert.assertEquals(1, instances.size()); long instanceId = instances.get(0); List<Long> executions = operator.getExecutions(instanceId); Assert.assertEquals(2, executions.size()); // latest execution is the first in the returned list Assert.assertEquals(resumedExecutionId, executions.get(0).longValue()); Assert.assertEquals(executionId, executions.get(1).longValue()); } @Test public void testMultipleSimultaneousInstances() throws Exception { String jobName = job.getName(); Set<String> names = operator.getJobNames(); Assert.assertEquals(1, names.size()); Assert.assertTrue(names.contains(jobName)); long exec1 = operator.startNextInstance(jobName); long exec2 = operator.startNextInstance(jobName); Assert.assertTrue((exec1 != exec2)); Assert.assertTrue((!(operator.getParameters(exec1).equals(operator.getParameters(exec2))))); // Give the asynchronous task executor a chance to start executions Thread.sleep(1000); Set<Long> executions = operator.getRunningExecutions(jobName); Assert.assertTrue(executions.contains(exec1)); Assert.assertTrue(executions.contains(exec2)); int count = 0; boolean running = (operator.getSummary(exec1).contains("STARTED")) && (operator.getSummary(exec2).contains("STARTED")); while (((count++) < 10) && (!running)) { Thread.sleep(100L); running = (operator.getSummary(exec1).contains("STARTED")) && (operator.getSummary(exec2).contains("STARTED")); } Assert.assertTrue(String.format("Jobs not started: [%s] and [%s]", operator.getSummary(exec1), operator.getSummary(exec1)), running); operator.stop(exec1); operator.stop(exec2); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
3df241fafd9a4e5db0f1e673f609bc76a401624c
bc794d54ef1311d95d0c479962eb506180873375
/keren_sms/smsgateway/src/main/java/com/keren/smsgateway/modem/athandler/ATHandler_Siemens_S55.java
d5ce224009d09ce04f2231a012bd653ce90fc147
[]
no_license
Teratech2018/Teratech
d1abb0f71a797181630d581cf5600c50e40c9663
612f1baf9636034cfa5d33a91e44bbf3a3f0a0cb
refs/heads/master
2021-04-28T05:31:38.081955
2019-04-01T08:35:34
2019-04-01T08:35:34
122,177,253
0
0
null
null
null
null
UTF-8
Java
false
false
1,123
java
// SMSLib for Java v3 // A Java API library for sending and receiving SMS via a GSM modem // or other supported gateways. // Web Site: http://www.smslib.org // // Copyright (C) 2002-2009, Thanasis Delenikas, Athens/GREECE. // SMSLib is distributed under the terms of the Apache License version 2.0 // // 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.keren.smsgateway.modem.athandler; import com.keren.smsgateway.modem.ModemGateway; public class ATHandler_Siemens_S55 extends ATHandler { public ATHandler_Siemens_S55(ModemGateway myGateway) { super(myGateway); setStorageLocations("MTSMMESR"); } }
[ "bekondo_dieu@yahoo.fr" ]
bekondo_dieu@yahoo.fr
dea09489674c9cdeb99d3f59d07afb1b6543e868
5b64082c97895bd41c9bb7913bcaa69165165c57
/src/main/java/designPattern/prototypePattern/Square.java
5206f654e047f58da37369f6f562d7364d7af511
[]
no_license
pmk2429/java_ocean
8481c9f1b32f0eaca8d5530b1d693337a3a9fddf
2607c7f8417a7fc41de2e74ab5e67812ce5bd3ee
refs/heads/master
2023-08-22T05:16:18.451077
2023-08-20T21:33:32
2023-08-20T21:33:32
29,897,133
2
1
null
2023-07-30T17:20:32
2015-01-27T04:23:55
Java
UTF-8
Java
false
false
212
java
package designPattern.prototypePattern; public class Square extends Shape { public Square() { type = "Square"; } @Override public void draw() { System.out.println("Inside Square::draw() method."); } }
[ "pmk.2429@gmail.com" ]
pmk.2429@gmail.com
6b8331044ef9cf893141dea68870ad6be2a33df6
11b9a30ada6672f428c8292937dec7ce9f35c71b
/src/main/java/com/sun/org/apache/xml/internal/security/signature/reference/ReferenceNodeSetData.java
c3291bc512b4702ed052fb5810909e72d5765a49
[]
no_license
bogle-zhao/jdk8
5b0a3978526723b3952a0c5d7221a3686039910b
8a66f021a824acfb48962721a20d27553523350d
refs/heads/master
2022-12-13T10:44:17.426522
2020-09-27T13:37:00
2020-09-27T13:37:00
299,039,533
0
0
null
null
null
null
UTF-8
Java
false
false
2,986
java
/***** Lobxxx Translate Finished ******/ /* * Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ /** * 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. * <p> *  根据一个或多个贡献者许可协议授予Apache软件基金会(ASF)。有关版权所有权的其他信息,请参阅随此作品分发的NOTICE文件。 * ASF根据Apache许可证2.0版("许可证")向您授予此文件;您不能使用此文件,除非符合许可证。您可以通过获取许可证的副本。 * *  http://www.apache.org/licenses/LICENSE-2.0 * *  除非适用法律要求或书面同意,否则根据许可证分发的软件按"原样"分发,不附带任何明示或暗示的担保或条件。请参阅管理许可证下的权限和限制的特定语言的许可证。 * */ /* * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * <p> *  版权所有(c)2005,2013,Oracle和/或其附属公司。版权所有。 * */ /* * $Id$ * <p> *  $ Id $ * */ package com.sun.org.apache.xml.internal.security.signature.reference; import java.util.Iterator; import org.w3c.dom.Node; /** * An abstract representation of a <code>ReferenceData</code> type containing a node-set. * <p> *  包含节点集的<code> ReferenceData </code>类型的抽象表示。 * */ public interface ReferenceNodeSetData extends ReferenceData { /** * Returns a read-only iterator over the nodes contained in this * <code>NodeSetData</code> in * <a href="http://www.w3.org/TR/1999/REC-xpath-19991116#dt-document-order"> * document order</a>. Attempts to modify the returned iterator * via the <code>remove</code> method throw * <code>UnsupportedOperationException</code>. * * <p> *  在<code> NodeSetData </code>中包含的节点上返回只读迭代器 * <a href="http://www.w3.org/TR/1999/REC-xpath-19991116#dt-document-order"> * * @return an <code>Iterator</code> over the nodes in this * <code>NodeSetData</code> in document order */ Iterator<Node> iterator(); }
[ "zhaobo@MacBook-Pro.local" ]
zhaobo@MacBook-Pro.local
10eccf78f8721af4a13cec8a67543adfd3b798e5
e41c4cae18b75536432cc5ad862ee179a47e6b0f
/src/BankApp/challenge9/Challenge9.java
bacf9c7f1c6978324b63a80b653bf71fdac8fdbc
[]
no_license
LukaszDusza/treads
b4162efb1f3afc0f1be87c78359aa2e694757078
8efe96d383ae8552341d8ed0d208b57331b53936
refs/heads/master
2020-03-12T01:15:17.801132
2018-04-20T14:13:36
2018-04-20T14:13:36
130,371,295
0
0
null
null
null
null
UTF-8
Java
false
false
1,953
java
package BankApp.challenge9; /** * Created by timbuchalka on 16/08/2016. */ public class Challenge9 { public static void main(String[] args) { final NewTutor tutor = new NewTutor(); final NewStudent student = new NewStudent(tutor); tutor.setStudent(student); Thread tutorThread = new Thread(new Runnable() { @Override public void run() { tutor.studyTime(); } }); Thread studentThread = new Thread(new Runnable() { @Override public void run() { student.handInAssignment(); } }); tutorThread.start(); studentThread.start(); } } class NewTutor { private NewStudent student; public void setStudent(NewStudent student) { this.student = student; } public void studyTime() { synchronized (this) { System.out.println("Tutor has arrived"); synchronized (student) { try { // wait for student to arrive this.wait(); } catch (InterruptedException e) { } student.startStudy(); System.out.println("Tutor is studying with student"); } } } public void getProgressReport() { // get progress report System.out.println("Tutor gave progress report"); } } class NewStudent { private NewTutor tutor; NewStudent(NewTutor tutor) { this.tutor = tutor; } public void startStudy() { // study System.out.println("Student is studying"); } public void handInAssignment() { synchronized (tutor) { tutor.getProgressReport(); synchronized (this) { System.out.println("Student handed in assignment"); tutor.notifyAll(); } } } }
[ "lukaszdusza280@gmail.com" ]
lukaszdusza280@gmail.com
04bec7e853e24e8e6fee1d147d30f61c21d6c3a0
26af96749dd96608a6f8afa720077842aa193d8a
/src/main/java/com/lhjl/tzzs/proxy/dto/SearchLimitDto.java
3cf64d17c6d4453260e1634fcedbf4b0499345c5
[]
no_license
SyuuTou/wlspacecraft
f2030f7ab70c09818c979cffa7613cd28150baf1
78a78861cb4e95e1a468f1d0a1f5682dc0e0b99f
refs/heads/master
2020-03-23T13:58:08.788678
2018-08-22T02:41:33
2018-08-22T02:41:33
141,648,032
1
0
null
null
null
null
UTF-8
Java
false
false
398
java
package com.lhjl.tzzs.proxy.dto; public class SearchLimitDto { String user_id; Integer limits; public String getUser_id() { return user_id; } public void setUser_id(String user_id) { this.user_id = user_id; } public Integer getLimits() { return limits; } public void setLimits(Integer limits) { this.limits = limits; } }
[ "1152750238@qq.com" ]
1152750238@qq.com
04d8aa224ed6e1c1ff3b3de254eb909002e23959
ab30df4b1585692472d32a9cbcf6c8ae107dc9a7
/generated-test-cases/Optimization/19-run/Evosuite_Optimization_ESTest.java
36bff7eb31cd16ec3372903018d77be8ae5b71ee
[ "Apache-2.0" ]
permissive
fpalomba/issta16-test-code-quality-matters
8d87b51ce1ca8305cf9ff67b2eb71899cbfb7d46
b18697fb7f3ed77a8875d39c6b81a1afa82d7245
refs/heads/master
2020-12-24T21:27:40.669676
2016-04-22T21:38:36
2016-04-22T21:38:36
56,882,946
0
0
null
null
null
null
UTF-8
Java
false
false
6,022
java
/* * This file was automatically generated by EvoSuite * Fri Dec 18 21:32:23 GMT 2015 */ package weka.core; import static org.junit.Assert.*; import org.junit.Test; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.evosuite.runtime.testdata.EvoSuiteFile; import org.evosuite.runtime.testdata.EvoSuiteLocalAddress; import org.evosuite.runtime.testdata.EvoSuiteRemoteAddress; import org.evosuite.runtime.testdata.EvoSuiteURL; import org.junit.runner.RunWith; import weka.core.Optimization; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true) public class Optimization_ESTest extends Optimization_ESTest_scaffolding { //Test case number: 0 /* * 8 covered goals: * Goal 1. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I187 Branch 192 IFEQ L1136 - true * Goal 2. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I203 Branch 193 IFLT L1138 - false * Goal 3. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I223 Branch 194 IFLT L1141 - true * Goal 4. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I223 Branch 194 IFLT L1141 - false * Goal 5. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I232 Branch 195 IFNE L1142 - true * Goal 6. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I232 Branch 195 IFNE L1142 - false * Goal 7. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I251 Branch 196 IF_ICMPGE L1144 - true * Goal 8. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I251 Branch 196 IF_ICMPGE L1144 - false */ @Test public void test0() throws Throwable { weka.core.matrix.Matrix matrix0 = new weka.core.matrix.Matrix(620, 620); double[] doubleArray0 = new double[6]; boolean[] booleanArray0 = new boolean[12]; booleanArray0[0] = true; double[] doubleArray1 = Optimization.solveTriangle(matrix0, doubleArray0, false, booleanArray0); assertArrayEquals(new double[] {0.0, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN}, doubleArray1, 0.01); } //Test case number: 1 /* * 5 covered goals: * Goal 1. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I28 Branch 184 IFEQ L1115 - true * Goal 2. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I180 Branch 191 IFLT L1136 - true * Goal 3. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I180 Branch 191 IFLT L1136 - false * Goal 4. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I187 Branch 192 IFEQ L1136 - false * Goal 5. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I203 Branch 193 IFLT L1138 - true */ @Test public void test1() throws Throwable { double[] doubleArray0 = new double[1]; boolean[] booleanArray0 = new boolean[9]; booleanArray0[0] = true; double[] doubleArray1 = Optimization.solveTriangle((weka.core.matrix.Matrix) null, doubleArray0, false, booleanArray0); assertArrayEquals(new double[] {0.0}, doubleArray1, 0.01); } //Test case number: 2 /* * 8 covered goals: * Goal 1. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I47 Branch 186 IFEQ L1117 - true * Goal 2. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I64 Branch 187 IF_ICMPGE L1119 - false * Goal 3. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I85 Branch 188 IF_ICMPGE L1122 - true * Goal 4. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I85 Branch 188 IF_ICMPGE L1122 - false * Goal 5. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I94 Branch 189 IFNE L1123 - true * Goal 6. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I94 Branch 189 IFNE L1123 - false * Goal 7. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I111 Branch 190 IF_ICMPGE L1125 - true * Goal 8. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I111 Branch 190 IF_ICMPGE L1125 - false */ @Test public void test2() throws Throwable { double[][] doubleArray0 = new double[15][8]; weka.core.matrix.Matrix matrix0 = new weka.core.matrix.Matrix(doubleArray0, (-27), (-27)); boolean[] booleanArray0 = new boolean[17]; booleanArray0[2] = true; double[] doubleArray1 = Optimization.solveTriangle(matrix0, doubleArray0[6], true, booleanArray0); assertArrayEquals(new double[] {Double.NaN, Double.NaN, 0.0, Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN}, doubleArray1, 0.01); } //Test case number: 3 /* * 6 covered goals: * Goal 1. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I16 Branch 183 IFNONNULL L1112 - true * Goal 2. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I28 Branch 184 IFEQ L1115 - false * Goal 3. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I40 Branch 185 IF_ICMPGE L1117 - true * Goal 4. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I40 Branch 185 IF_ICMPGE L1117 - false * Goal 5. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I47 Branch 186 IFEQ L1117 - false * Goal 6. weka.core.Optimization.solveTriangle(Lweka/core/matrix/Matrix;[DZ[Z)[D: I64 Branch 187 IF_ICMPGE L1119 - true */ @Test public void test3() throws Throwable { double[] doubleArray0 = new double[1]; boolean[] booleanArray0 = new boolean[16]; booleanArray0[0] = true; double[] doubleArray1 = Optimization.solveTriangle((weka.core.matrix.Matrix) null, doubleArray0, true, booleanArray0); assertArrayEquals(new double[] {0.0}, doubleArray1, 0.01); } }
[ "fabio.palomba.89@gmail.com" ]
fabio.palomba.89@gmail.com
37ddf1edc5faab7c64f0aba6961163bb16ae9d29
bb097f23913615f7d2f58ce60b781d271e423652
/vizmap-gui-core-impl/src/main/java/org/cytoscape/view/vizmap/gui/core/internal/CyActivator.java
262db7ef108a3f0a0d831c02be51114c0b76a5a9
[]
no_license
ashishtiwarigsoc/cytoscape-impl
2f52af2f1eac6df914314c0855e3622494caff72
a1e477c958c575fa503470cae5b57b135982df29
refs/heads/develop
2021-01-18T09:51:15.887416
2016-05-06T00:25:02
2016-05-06T00:25:02
58,349,821
0
1
null
2016-05-09T05:08:50
2016-05-09T05:08:50
null
UTF-8
Java
false
false
1,623
java
package org.cytoscape.view.vizmap.gui.core.internal; /* * #%L * Cytoscape VizMap GUI Core Impl (vizmap-gui-core-impl) * $Id:$ * $HeadURL:$ * %% * Copyright (C) 2006 - 2013 The Cytoscape Consortium * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 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 Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ import java.util.Properties; import org.cytoscape.service.util.AbstractCyActivator; import org.cytoscape.view.vizmap.gui.core.internal.cellrenderer.ContinuousMappingCellRendererFactoryImpl; import org.cytoscape.view.vizmap.gui.editor.ContinuousMappingCellRendererFactory; import org.osgi.framework.BundleContext; public class CyActivator extends AbstractCyActivator { @Override public void start(BundleContext context) throws Exception { ContinuousMappingCellRendererFactory continuousMappingCellRendererFactoryImpl = new ContinuousMappingCellRendererFactoryImpl(); registerService(context, continuousMappingCellRendererFactoryImpl, ContinuousMappingCellRendererFactory.class, new Properties()); } }
[ "jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5" ]
jm@0ecc0d97-ab19-0410-9704-bfe1a75892f5