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
30a49914392f84509adee9d22fec7aae03f2c0ab
70542cea430f8cd0b6b792b31d3b8d35b6a9bebb
/src/main/java/invoice/Invoice.java
a77fbf3174b491a4b0460dce829a7d6f0e34070d
[]
no_license
behnaaz/2017-course
8288e807839ccb3f185861201c7807817a7e346c
6e4ac083a5674b3ff56e036f2782fb8c70c27acc
refs/heads/master
2021-07-04T02:24:47.393477
2017-09-26T11:29:48
2017-09-26T11:29:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
818
java
package invoice; public class Invoice { private int id; private double amount; private double taxes; public Invoice(int id, double amount, double taxes) { this.id = id; this.amount = amount; this.taxes = taxes; } public Invoice(double amount, double taxes) { this(0, amount, taxes); } public int getId() { return id; } public void setId(int id) { this.id = id; } public double getAmount() { return amount; } public void setAmount(double amount) { this.amount = amount; } public double getTaxes() { return taxes; } public void setTaxes(double taxes) { this.taxes = taxes; } public double getNetValue() { return this.amount - this.taxes; } }
[ "mauricioaniche@gmail.com" ]
mauricioaniche@gmail.com
b1d430c37ce46d7d12214e1d0698f9767394dac7
471a1d9598d792c18392ca1485bbb3b29d1165c5
/jadx-MFP/src/main/java/io/requery/sql/platform/SQLServer.java
e679ede285e53fb25a0abe34bcaa35dd2df632a0
[]
no_license
reed07/MyPreferencePal
84db3a93c114868dd3691217cc175a8675e5544f
365b42fcc5670844187ae61b8cbc02c542aa348e
refs/heads/master
2020-03-10T23:10:43.112303
2019-07-08T00:39:32
2019-07-08T00:39:32
129,635,379
2
0
null
null
null
null
UTF-8
Java
false
false
5,031
java
package io.requery.sql.platform; import io.requery.meta.Attribute; import io.requery.meta.Type; import io.requery.query.Expression; import io.requery.query.element.LimitedElement; import io.requery.query.element.OrderByElement; import io.requery.query.element.QueryElement; import io.requery.query.function.Function.Name; import io.requery.query.function.Now; import io.requery.sql.BaseType; import io.requery.sql.GeneratedColumnDefinition; import io.requery.sql.Keyword; import io.requery.sql.Mapping; import io.requery.sql.QueryBuilder; import io.requery.sql.gen.Generator; import io.requery.sql.gen.OffsetFetchGenerator; import io.requery.sql.gen.OrderByGenerator; import io.requery.sql.gen.Output; import io.requery.sql.gen.UpsertMergeGenerator; import io.requery.sql.type.PrimitiveBooleanType; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Map; import java.util.Set; public class SQLServer extends Generic { private final GeneratedColumnDefinition generatedColumnDefinition = new IdentityColumnDefinition(); private static class BitBooleanType extends BaseType<Boolean> implements PrimitiveBooleanType { public Object getIdentifier() { return "bit"; } BitBooleanType() { super(Boolean.class, -7); } public Boolean read(ResultSet resultSet, int i) throws SQLException { Boolean valueOf = Boolean.valueOf(resultSet.getBoolean(i)); if (resultSet.wasNull()) { return null; } return valueOf; } public boolean readBoolean(ResultSet resultSet, int i) throws SQLException { return resultSet.getBoolean(i); } public void writeBoolean(PreparedStatement preparedStatement, int i, boolean z) throws SQLException { preparedStatement.setBoolean(i, z); } } private static class IdentityColumnDefinition implements GeneratedColumnDefinition { public boolean postFixPrimaryKey() { return false; } public boolean skipTypeIdentifier() { return false; } private IdentityColumnDefinition() { } public void appendGeneratedSequence(QueryBuilder queryBuilder, Attribute attribute) { queryBuilder.keyword(Keyword.IDENTITY); queryBuilder.openParenthesis().value(Integer.valueOf(1)).comma().value(Integer.valueOf(1)).closeParenthesis(); } } private static class MergeGenerator extends UpsertMergeGenerator { private MergeGenerator() { } public void write(Output output, Map<Expression<?>, Object> map) { super.write(output, map); output.builder().append(";"); } } private static class OrderByOffsetFetchLimit extends OffsetFetchGenerator { private OrderByOffsetFetchLimit() { } public void write(QueryBuilder queryBuilder, Integer num, Integer num2) { super.write(queryBuilder, num, Integer.valueOf(num2 == null ? 0 : num2.intValue())); } } private class OrderByWithLimitGenerator extends OrderByGenerator { private OrderByWithLimitGenerator() { } private void forceOrderBy(QueryElement<?> queryElement) { if (queryElement.getLimit() == null) { return; } if (queryElement.getOrderByExpressions() == null || queryElement.getOrderByExpressions().isEmpty()) { Set entityTypes = queryElement.entityTypes(); if (entityTypes != null && !entityTypes.isEmpty()) { for (Attribute attribute : ((Type) entityTypes.iterator().next()).getAttributes()) { if (attribute.isKey()) { queryElement.orderBy((Expression) attribute); return; } } } } } public void write(Output output, OrderByElement orderByElement) { if (orderByElement instanceof QueryElement) { forceOrderBy((QueryElement) orderByElement); } super.write(output, orderByElement); } } public boolean supportsIfExists() { return false; } public void addMappings(Mapping mapping) { super.addMappings(mapping); mapping.replaceType(16, new BitBooleanType()); mapping.aliasFunction(new Name("getutcdate"), Now.class); } public GeneratedColumnDefinition generatedColumnDefinition() { return this.generatedColumnDefinition; } public Generator<LimitedElement> limitGenerator() { return new OrderByOffsetFetchLimit(); } public Generator<Map<Expression<?>, Object>> upsertGenerator() { return new MergeGenerator(); } public Generator<OrderByElement> orderByGenerator() { return new OrderByWithLimitGenerator(); } }
[ "anon@ymous.email" ]
anon@ymous.email
5bfb46674e2c5b4dd97c69f33dca47a086a66d80
b39d7e1122ebe92759e86421bbcd0ad009eed1db
/sources/android/view/animation/TranslateXAnimation.java
221525f7d89e0c13a053cd70540ca9647312e3ae
[]
no_license
AndSource/miuiframework
ac7185dedbabd5f619a4f8fc39bfe634d101dcef
cd456214274c046663aefce4d282bea0151f1f89
refs/heads/master
2022-03-31T11:09:50.399520
2020-01-02T09:49:07
2020-01-02T09:49:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
848
java
package android.view.animation; public class TranslateXAnimation extends TranslateAnimation { float[] mTmpValues; public TranslateXAnimation(float fromXDelta, float toXDelta) { super(fromXDelta, toXDelta, 0.0f, 0.0f); this.mTmpValues = new float[9]; } public TranslateXAnimation(int fromXType, float fromXValue, int toXType, float toXValue) { super(fromXType, fromXValue, toXType, toXValue, 0, 0.0f, 0, 0.0f); this.mTmpValues = new float[9]; } /* Access modifiers changed, original: protected */ public void applyTransformation(float interpolatedTime, Transformation t) { t.getMatrix().getValues(this.mTmpValues); t.getMatrix().setTranslate(this.mFromXDelta + ((this.mToXDelta - this.mFromXDelta) * interpolatedTime), this.mTmpValues[5]); } }
[ "shivatejapeddi@gmail.com" ]
shivatejapeddi@gmail.com
6dcbc62b7ff5e65da1a5cc170bbb85743456de85
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_4565923beb9f890184349d03981914a2e726970d/File/9_4565923beb9f890184349d03981914a2e726970d_File_s.java
8707f9f8f1e5729623d2fd6e277d606d593a50c7
[]
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
4,759
java
package org.jboss.pressgang.ccms.model; import javax.persistence.Cacheable; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Transient; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.envers.Audited; import org.hibernate.validator.constraints.NotBlank; import org.jboss.pressgang.ccms.model.base.AuditedEntity; import org.jboss.pressgang.ccms.model.constants.Constants; @Entity @Audited @Cacheable @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @Table(name = "File") public class File extends AuditedEntity implements Serializable { private static final long serialVersionUID = -5557699207265609562L; private Integer fileId = null; private String fileName = null; private String filePath = null; private String description = null; private Boolean explodeArchive = false; private Set<LanguageFile> languageFiles = new HashSet<LanguageFile>(); @Override public Integer getId() { return fileId; } @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "FileID", unique = true, nullable = false) public Integer getFileId() { return fileId; } public void setFileId(Integer fileId) { this.fileId = fileId; } @Column(name = "FileName", nullable = false, length = 255) @Size(max = 255) @NotNull(message = "file.filename.notBlank") @NotBlank(message = "file.filename.notBlank") public String getFileName() { return fileName; } public void setFileName(String fileName) { this.fileName = fileName; } @Column(name = "FilePath", length = 512) @Size(max = 512) public String getFilePath() { return filePath; } public void setFilePath(String filePath) { if (filePath == null) { this.filePath = null; } else if (filePath.trim().isEmpty() || filePath.endsWith("/") || filePath.endsWith("\\")) { this.filePath = filePath.trim(); } else { this.filePath = filePath.trim() + "/"; } } @Column(name = "Description", length = 512) @Size(max = 512) public String getDescription() { return description; } public void setDescription(final String description) { this.description = description; } @Column(name = "ExplodeArchive", columnDefinition = "BIT", length = 1) public Boolean getExplodeArchive() { return explodeArchive; } public void setExplodeArchive(Boolean explodeArchive) { this.explodeArchive = explodeArchive; } @OneToMany(fetch = FetchType.LAZY, mappedBy = "file", cascade = CascadeType.ALL, orphanRemoval = true) @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @BatchSize(size = Constants.DEFAULT_BATCH_SIZE) public Set<LanguageFile> getLanguageFiles() { return languageFiles; } public void setLanguageFiles(Set<LanguageFile> languageFiles) { this.languageFiles = languageFiles; } @Transient public List<LanguageFile> getLanguageFilesArray() { final List<LanguageFile> retValue = new ArrayList<LanguageFile>(languageFiles); Collections.sort(retValue, new Comparator<LanguageFile>() { @Override public int compare(final LanguageFile o1, final LanguageFile o2) { if (o1.getLocale() == null && o2.getLocale() == null) return 0; if (o1.getLocale() == null) return -1; if (o2.getLocale() == null) return 1; return o1.getLocale().compareTo(o2.getLocale()); } }); return retValue; } public void addLanguageFile(final LanguageFile languageFile) { languageFiles.add(languageFile); languageFile.setFile(this); } public void removeLanguageFile(final LanguageFile languageFile) { languageFiles.remove(languageFile); languageFile.setFile(null); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
0e01a75ca008209d9f892c57e90092b8772db996
dc4abe5cbc40f830725f9a723169e2cc80b0a9d6
/src/main/java/com/sgai/property/wy/service/SelfSendOrderService.java
683e626c96cb95d2b75ed80326a90d9cbe85c7e1
[]
no_license
ppliuzf/sgai-training-property
0d49cd4f3556da07277fe45972027ad4b0b85cb9
0ce7bdf33ff9c66f254faec70ea7eef9917ecc67
refs/heads/master
2020-05-27T16:25:57.961955
2019-06-03T01:12:51
2019-06-03T01:12:51
188,697,303
0
1
null
null
null
null
UTF-8
Java
false
false
1,495
java
/** * @Title: SelfSendOrderService.java * @Package com.sgai.property.wy.service * (用一句话描述该文件做什么) * @author XJ9001 * @date 2018年2月24日 * @Company 首自信--智慧城市创新中心 * @version V1.0 */ package com.sgai.property.wy.service; import com.sgai.modules.login.jwt.bean.LoginUser; import com.sgai.property.wy.dto.SelfSendOrders; /** * @ClassName: SelfSendOrderService * (自动派单执行) * @author XJ9001 * @date 2018年2月24日 * @Company 首自信--智慧城市创新中心 */ public class SelfSendOrderService { /** * 初始化自定义定时线程 */ public static void initMyTimer() { SelfSendOrders timer= new SelfSendOrders(); timer.start(); System.out.println("初始化自定义定时线程"); } /** * 开启自定义定时线程 */ public static void startMyTimer(LoginUser loginUser, RepairInformationService repairInformationService) { SelfSendOrders.flag = true; //SelfSendOrders.period = period; SelfSendOrders.loginUser = loginUser; SelfSendOrders.repairInformationService = repairInformationService; System.out.println("开启自定义定时线程"); } /** * 停止自定义定时线程 */ public static void stopMyTimer() { SelfSendOrders.flag = false; System.out.println("停止自定义定时线程"); } }
[ "ppliuzf@sina.com" ]
ppliuzf@sina.com
3a5209fa6a78623a9b31ed5f146bf1be947d9076
e437e71c761c88665f0174133a3c2a7c0a73846f
/inject/src/main/java/io/micronaut/inject/annotation/internal/TimedAnnotationMapper.java
029dac62e3fff14c126bb459a3adde5ce3d07b5a
[ "Apache-2.0" ]
permissive
gaecom/micronaut-core
f4e9081322308b04bbaa44208ef56efab95832ee
d4a5f4a4a52da7ad88f782f3e0765aaacee3b4ae
refs/heads/master
2020-09-29T21:37:11.581695
2019-12-10T11:06:52
2019-12-10T11:06:52
227,128,310
1
0
Apache-2.0
2019-12-10T13:29:57
2019-12-10T13:29:57
null
UTF-8
Java
false
false
1,619
java
/* * Copyright 2017-2019 original 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 io.micronaut.inject.annotation.internal; import io.micronaut.core.annotation.AnnotationValue; import io.micronaut.core.annotation.Internal; import io.micronaut.inject.annotation.NamedAnnotationMapper; import io.micronaut.inject.visitor.VisitorContext; import java.lang.annotation.Annotation; import java.util.Collections; import java.util.List; /** * Maps Micrometer's {@code Timed} annotation in order to support AOP. * * @author graemerocher * @since 1.1.0 */ @Internal public class TimedAnnotationMapper implements NamedAnnotationMapper { @Override public String getName() { return "io.micrometer.core.annotation.Timed"; } @Override public List<AnnotationValue<?>> map(AnnotationValue<Annotation> annotation, VisitorContext visitorContext) { return Collections.singletonList( AnnotationValue.builder( "io.micronaut.configuration.metrics.micrometer.annotation.MircometerTimed" ).build() ); } }
[ "graeme.rocher@gmail.com" ]
graeme.rocher@gmail.com
4374069abe83b0cbca91d4ea673e23fc16f6e8fe
e30cfa9770cde37a926e09bd6500d4c78057eb06
/Test_all/src/main/java/com/lx/test/GetLisInfoMzResponse.java
43826ddbb2fcdf40d771eb2228c5a20bc4ed49f2
[]
no_license
yinqianhui1990/Test_all
df04f27dc9b7d02adb088b5ce147edfe588634e0
077469a7a56beb28cf114977898896b380ebda05
refs/heads/master
2021-04-29T09:39:44.788360
2019-04-11T12:58:27
2019-04-11T12:58:27
77,657,869
0
0
null
null
null
null
GB18030
Java
false
false
1,568
java
package com.lx.test; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; /** * <p>anonymous complex type的 Java 类。 * * <p>以下模式片段指定包含在此类中的预期内容。 * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element name="GetLisInfo_mzResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "getLisInfoMzResult" }) @XmlRootElement(name = "GetLisInfo_mzResponse") public class GetLisInfoMzResponse { @XmlElement(name = "GetLisInfo_mzResult") protected String getLisInfoMzResult; /** * 获取getLisInfoMzResult属性的值。 * * @return * possible object is * {@link String } * */ public String getGetLisInfoMzResult() { return getLisInfoMzResult; } /** * 设置getLisInfoMzResult属性的值。 * * @param value * allowed object is * {@link String } * */ public void setGetLisInfoMzResult(String value) { this.getLisInfoMzResult = value; } }
[ "qianhui.yin@lachesis-mh.com" ]
qianhui.yin@lachesis-mh.com
faa485a08aba4be740839d7efb902a675c284bd3
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/repairnator/validation/261/Build.java
a46f9452e29bfe7bc29f305455af916975de988e
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
486
java
package fr.inria.spirals.repairnator.process.inspectors.properties.builds; import java.util.Date; public class Build { private long id; private String url; private Date date; public Build(long id, String url, Date date) { this.id = id; this.url = url; this.date = date; } public long getId() { return id; } public String getUrl() { return url; } public Date getDate() { return date; } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
df4f013d3dcefbbca30b7b1ff31668d7488f9502
07d7b8203178dc0623c6f8792d99f581ab7439a9
/src/main/java/com/hcl/fundtransfer/service/ConfirmOtpServiceImpl.java
41f3aa571dffe075cd38c98fe1c5734f6c9602a0
[]
no_license
lakshman17/fundTransferApp
782469fd0d9ad44f0868dc90b5304de2f53c997f
29b24f16528636102a6b5322e9efcc135a1401b2
refs/heads/master
2020-09-25T16:55:38.517421
2019-12-05T08:25:30
2019-12-05T08:25:30
226,048,412
0
0
null
2019-12-05T08:05:04
2019-12-05T08:05:04
null
UTF-8
Java
false
false
2,331
java
package com.hcl.fundtransfer.service; import java.util.Optional; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import com.hcl.fundtransfer.dto.ApplicationResponse; import com.hcl.fundtransfer.dto.ConfirmPayeeRequestDto; import com.hcl.fundtransfer.entity.Customer; import com.hcl.fundtransfer.entity.Otp; import com.hcl.fundtransfer.entity.Payee; import com.hcl.fundtransfer.exception.CommonException; import com.hcl.fundtransfer.exception.CustomerNotFoundException; import com.hcl.fundtransfer.repository.ICustomerRepository; import com.hcl.fundtransfer.repository.OtpRepository; import com.hcl.fundtransfer.repository.PayeeRepository; @Service public class ConfirmOtpServiceImpl implements ConfirmOtpService { @Autowired RestTemplate restTemplate; @Autowired OtpRepository otpRepository; @Autowired PayeeRepository payeeRepository; @Autowired ICustomerRepository iCustomerRepository; @Override public ApplicationResponse confirmPayee(ConfirmPayeeRequestDto confirmPayeeRequestDto) { String status = null; Optional<Payee> payee = payeeRepository.findById(confirmPayeeRequestDto.getPayeeId()); Optional<Customer> customer = iCustomerRepository.findById(confirmPayeeRequestDto.getCustomerId()); Optional<Otp> optDb = otpRepository.getPayeeOtpNumber(confirmPayeeRequestDto.getPayeeId()); if (!payee.isPresent()) throw new CustomerNotFoundException("payee not found"); if (!customer.isPresent()) throw new CustomerNotFoundException("Customer not found"); if (!optDb.isPresent()) throw new CustomerNotFoundException("payee not found"); if (!confirmPayeeRequestDto.getOtpNumber().equals(optDb.get().getOtpNumber())) throw new CommonException("Please enter valid otp"); if (confirmPayeeRequestDto.getStatus().equalsIgnoreCase("add")) { payee.get().setStatus("Payee addedd"); status = "Payee added successfully"; } else if (confirmPayeeRequestDto.getStatus().equalsIgnoreCase("update")) { payee.get().setStatus("Payee updated"); status = "Payee updated successfully"; } else { payee.get().setStatus("Payee deleted"); status = "Payee deleted successfully"; } payeeRepository.save(payee.get()); return new ApplicationResponse(status); } }
[ "nithin2889@gmail.com" ]
nithin2889@gmail.com
3ebfde4a00402d308006591bafecaee315753e46
0ea271177f5c42920ac53cd7f01f053dba5c14e4
/5.3.5/sources/com/google/firebase/iid/zzn.java
3514607c2aa86c05d7f6cbb9434544ce3c75f672
[]
no_license
alireza-ebrahimi/telegram-talaeii
367a81a77f9bc447e729b2ca339f9512a4c2860e
68a67e6f104ab8a0888e63c605e8bbad12c4a20e
refs/heads/master
2020-03-21T13:44:29.008002
2018-12-09T10:30:29
2018-12-09T10:30:29
138,622,926
12
1
null
null
null
null
UTF-8
Java
false
false
340
java
package com.google.firebase.iid; import android.os.Handler.Callback; import android.os.Message; final /* synthetic */ class zzn implements Callback { private final zzm zzola; zzn(zzm zzm) { this.zzola = zzm; } public final boolean handleMessage(Message message) { return this.zzola.zzc(message); } }
[ "alireza.ebrahimi2006@gmail.com" ]
alireza.ebrahimi2006@gmail.com
f5a224da898f5d48a3977886013a6d41347eed9b
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project98/src/test/java/org/gradle/test/performance98_3/Test98_276.java
de0a6383c2cc8ce2b65e4dfb104ccf1f993a9bd9
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
292
java
package org.gradle.test.performance98_3; import static org.junit.Assert.*; public class Test98_276 { private final Production98_276 production = new Production98_276("value"); @org.junit.Test public void test() { assertEquals(production.getProperty(), "value"); } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
c2c3c053838d50a914e569b000f0f6bcb5579b1b
dd91160574613bda26b84634982dfbb668f9cd4e
/src/main/java/postcoursegyak/eniko/CsipkeRose.java
ca1081d1c9860eb16aa25db43dccef5a4c9db492
[]
no_license
djtesla/training-solutions
fbaa6216e151be39e0ceef7bcb1466652d56f9e4
4d54a4d5573ae897bef7bcd55cc779d92414d57b
refs/heads/master
2023-07-15T21:38:59.893443
2021-09-06T06:02:13
2021-09-06T06:02:13
308,435,314
0
0
null
null
null
null
UTF-8
Java
false
false
2,066
java
package postcoursegyak.eniko; import java.io.BufferedReader; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.HashMap; import java.util.Map; public class CsipkeRose { public Map<Character, Integer> createStatOfTale(String filename) { Map<Character, Integer> statOfTale = new HashMap<>(); try (BufferedReader reader = Files.newBufferedReader(Path.of(filename))) { String line; while ((line = reader.readLine()) != null) { processLine(line, statOfTale); skipEmptyRow(reader); } return statOfTale; } catch (IOException ioe) { throw new IllegalStateException("Cannot read file", ioe); } } private void processLine(String line, Map<Character, Integer> statOfTale) { for (char c : line.toLowerCase().toCharArray()) { if (isLetter(c)) { modifyMap(statOfTale, c); } } } private void modifyMap(Map<Character, Integer> statOfTale, char c) { if (!statOfTale.containsKey(c)) { statOfTale.put(c, 0); } statOfTale.put(c, statOfTale.get(c) + 1); } private boolean isLetter(char c) { return (int) c > 96 && (int) c < 123; } private void skipEmptyRow(BufferedReader reader) throws IOException { reader.readLine(); } public static void main(String[] args) { System.out.println(new CsipkeRose().createStatOfTale("src\\main\\java\\postcoursegyak\\eniko\\beauty.txt")); } } /* A sleepingbeauty.txt fájlban találod a Csipkerózsika című mesét. A feladat az, hogy készíts belőle statisztikát: melyik betűből hány darab található benne. Fontos, hogy csak a betűk számítanak, az egyéb karakterek nem kellenek, valamint hogy a nagy- és kisbetűk között ne tégy különbséget! (Tehát az "A" és az "a" egy helyre számolandó.) (A fájl az src/main/resources könyvtárban található.)*/
[ "djtesla@gmailcom" ]
djtesla@gmailcom
708aaaa0cb15890a9765d457e798e2adda046137
77e35fd24cf1a219b688d901cc2e0c226ba164cc
/src/langs/bevent/Machine.java
4873b24a824a2e13add7f209d3fb16223a01a337
[]
no_license
stratosphr/exotest
cf83c28172fc8271470f20d85e6fd349259ed47c
57d897d5ee00428aaeb42745a4fc8fdff70738f3
refs/heads/master
2020-03-18T14:55:21.092051
2018-06-11T11:29:18
2018-06-11T11:29:18
134,875,315
0
0
null
null
null
null
UTF-8
Java
false
false
4,760
java
package langs.bevent; import errors.UninitializedMachineError; import langs.AObject; import langs.bevent.exprs.arith.AAssignable; import langs.bevent.exprs.arith.Fun; import langs.bevent.exprs.arith.Var; import langs.bevent.exprs.bool.*; import langs.bevent.exprs.defs.*; import langs.bevent.exprs.sets.Z; import langs.bevent.substitutions.ASubstitution; import visitors.computers.SetElementsComputer; import visitors.formatters.object.IObjectFormatter; import java.util.Collection; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.stream.Stream; /** * Created by gvoiron on 08/06/18. * Time : 09:42 */ public final class Machine extends AObject { private static Machine singleton; private final String name; private final LinkedHashSet<ConstDef> constsDefs; private final LinkedHashSet<SetDef> setsDefs; private final LinkedHashSet<VarDef> varsDefs; private final LinkedHashSet<FunDef> funsDefs; private final LinkedHashMap<String, ADef> defs; private final Invariant invariant; private final ASubstitution initialisation; private final LinkedHashSet<Event> events; private final LinkedHashSet<AAssignable> assignables; private Machine(String name, List<ConstDef> constsDefs, List<SetDef> setsDefs, List<VarDef> varsDefs, List<FunDef> funsDefs, Invariant invariant, ASubstitution initialisation, List<Event> events) { this.name = name; this.constsDefs = new LinkedHashSet<>(constsDefs); this.setsDefs = new LinkedHashSet<>(setsDefs); this.varsDefs = new LinkedHashSet<>(varsDefs); this.funsDefs = new LinkedHashSet<>(funsDefs); this.defs = new LinkedHashMap<>(); Stream.of(getConstsDefs(), getSetsDefs(), getVarsDefs(), getFunsDefs()).flatMap(Collection::stream).forEach(def -> { if (defs.containsKey(def.getName())) { throw new Error("Symbol \"" + def.getName() + "\" was already defined in this scope."); } else { defs.put(def.getName(), def); } }); this.invariant = new Invariant(new And( new And(getConstsDefs().stream().map(constDef -> new Equals(constDef.getConst(), constDef.getValue())).toArray(ABoolExpr[]::new)), new And(getVarsDefs().stream().map(varDef -> new VarIn(varDef.getVar(), varDef.getDomain())).toArray(ABoolExpr[]::new)), new And(getFunsDefs().stream().map(funDef -> new ForAll( new Equiv( new VarIn(new Var("i!"), funDef.getDomain()), new FunIn(new Fun(funDef.getName(), new Var("i!")), funDef.getCodomain()) ), new VarIn(new Var("i!"), new Z()) )).toArray(ABoolExpr[]::new)), invariant )); this.initialisation = initialisation; this.events = new LinkedHashSet<>(events); this.assignables = new LinkedHashSet<>(); } public static Machine build(String name, List<ConstDef> constsDefs, List<SetDef> setsDefs, List<VarDef> varsDefs, List<FunDef> funsDefs, Invariant invariant, ASubstitution initialisation, List<Event> events) { singleton = new Machine(name, constsDefs, setsDefs, varsDefs, funsDefs, invariant, initialisation, events); singleton.getVarsDefs().forEach(varDef -> singleton.assignables.add(varDef.getVar())); singleton.getFunsDefs().forEach(funDef -> funDef.getDomain().accept(new SetElementsComputer()).forEach(expr -> singleton.assignables.add(new Fun(funDef.getName(), expr)))); return singleton; } public static Machine getSingleton() { if (singleton == null) { throw new UninitializedMachineError(); } return singleton; } public String getName() { return name; } public LinkedHashSet<ConstDef> getConstsDefs() { return constsDefs; } public LinkedHashSet<SetDef> getSetsDefs() { return setsDefs; } public LinkedHashSet<VarDef> getVarsDefs() { return varsDefs; } public LinkedHashSet<FunDef> getFunsDefs() { return funsDefs; } public Invariant getInvariant() { return invariant; } public ASubstitution getInitialisation() { return initialisation; } public LinkedHashSet<Event> getEvents() { return events; } public LinkedHashSet<AAssignable> getAssignables() { return assignables; } public LinkedHashMap<String, ADef> getDefs() { return defs; } @Override public String accept(IObjectFormatter formatter) { return formatter.visit(this); } }
[ "stratosphr@gmail.com" ]
stratosphr@gmail.com
c4481c2afb1efdbe7f5a7a1e0742d55e7165e687
455bd7664223ec5f063430f97f69a665815833ad
/src/tmall/test/Test.java
d62a5b76de38709565d7df95750aa825d21352fd
[]
no_license
Lightwing-Ng/TMall_J2EE-master
1de74e2c2c9e78f55136f8e37b3e06784f856ce0
d0bc0427da1b6f453d43b048de50116154e6c672
refs/heads/master
2020-03-26T18:13:58.219243
2018-08-22T09:13:00
2018-08-22T09:13:00
145,202,582
0
0
null
null
null
null
UTF-8
Java
false
false
1,451
java
package tmall.test; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import tmall.bean.Category; import tmall.bean.Product; import tmall.bean.ProductImage; import tmall.dao.CategoryDAO; import tmall.dao.ProductDAO; import tmall.dao.ProductImageDAO; import java.io.File; import java.io.IOException; import java.util.List; /** * @ClassName Test * @Description TODO * @Author Lightwing Ng * @DateTime 2018/8/15, 14:14 * @Version 1.0 **/ public class Test { public static void main(String[] args) throws IOException { List<Category> cs = new CategoryDAO().list(); for (Category c : cs) { List<Product> ps = new ProductDAO().list(c.getId(), 0, Short.MAX_VALUE); for (Product p : ps) { List<ProductImage> pis1 = new ProductImageDAO().list(p, ProductImageDAO.type_single); List<ProductImage> pis2 = new ProductImageDAO().list(p, ProductImageDAO.type_detail); for (ProductImage pi : pis2) { String fileNameFormat = "/Users/lightwingng/Desktop/tmall/web/img/productDetail/%d.jpg"; String srcFileName = String.format(fileNameFormat, pi.getId()); String destFileName = StringUtils.replace(srcFileName, "tmall_original", "tmall"); FileUtils.copyFile(new File(srcFileName), new File(destFileName)); } } } } }
[ "rodney_ng@icloud.com" ]
rodney_ng@icloud.com
8069b3accb0f2ae7bc0d97cb1c7375ae005be81a
8ce7a60fcca1482fbe000a1ee48f57a4875c8edb
/src/test/java/com/rabbit/web/rest/AuditResourceIntTest.java
56b840fabcaba58e4d1e833b683ec0ba0e05b8ec
[]
no_license
rabbit-butterfly/spring-boot-jooq
ff3ab071404615d16b253822d38e6a49508c63ad
6e63c071bf70d3850b0102e8fc008bfe061bcc44
refs/heads/master
2021-06-26T02:29:11.719465
2017-09-04T06:31:19
2017-09-04T06:31:19
101,987,318
1
1
null
2020-09-18T11:31:36
2017-08-31T10:02:10
Java
UTF-8
Java
false
false
5,866
java
package com.rabbit.web.rest; import com.rabbit.JhipsterApp; import com.rabbit.config.audit.AuditEventConverter; import com.rabbit.domain.PersistentAuditEvent; import com.rabbit.repository.PersistenceAuditEventRepository; import com.rabbit.service.AuditEventService; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.MockitoAnnotations; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.web.PageableHandlerMethodArgumentResolver; import org.springframework.format.support.FormattingConversionService; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import static org.hamcrest.Matchers.hasItem; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; /** * Test class for the AuditResource REST controller. * * @see AuditResource */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhipsterApp.class) @Transactional public class AuditResourceIntTest { private static final String SAMPLE_PRINCIPAL = "SAMPLE_PRINCIPAL"; private static final String SAMPLE_TYPE = "SAMPLE_TYPE"; private static final LocalDateTime SAMPLE_TIMESTAMP = LocalDateTime.parse("2015-08-04T10:11:30"); private static final DateTimeFormatter FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd"); @Autowired private PersistenceAuditEventRepository auditEventRepository; @Autowired private AuditEventConverter auditEventConverter; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; @Autowired private FormattingConversionService formattingConversionService; @Autowired private PageableHandlerMethodArgumentResolver pageableArgumentResolver; private PersistentAuditEvent auditEvent; private MockMvc restAuditMockMvc; @Before public void setup() { MockitoAnnotations.initMocks(this); AuditEventService auditEventService = new AuditEventService(auditEventRepository, auditEventConverter); AuditResource auditResource = new AuditResource(auditEventService); this.restAuditMockMvc = MockMvcBuilders.standaloneSetup(auditResource) .setCustomArgumentResolvers(pageableArgumentResolver) .setConversionService(formattingConversionService) .setMessageConverters(jacksonMessageConverter).build(); } @Before public void initTest() { auditEventRepository.deleteAll(); auditEvent = new PersistentAuditEvent(); auditEvent.setAuditEventType(SAMPLE_TYPE); auditEvent.setPrincipal(SAMPLE_PRINCIPAL); auditEvent.setAuditEventDate(SAMPLE_TIMESTAMP); } @Test public void getAllAudits() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get all the audits restAuditMockMvc.perform(get("/management/audits")) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getAudit() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", auditEvent.getId())) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.principal").value(SAMPLE_PRINCIPAL)); } @Test public void getAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will contain the audit String fromDate = SAMPLE_TIMESTAMP.minusDays(1).format(FORMATTER); String toDate = SAMPLE_TIMESTAMP.plusDays(1).format(FORMATTER); // Get the audit restAuditMockMvc.perform(get("/management/audits?fromDate="+fromDate+"&toDate="+toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(jsonPath("$.[*].principal").value(hasItem(SAMPLE_PRINCIPAL))); } @Test public void getNonExistingAuditsByDate() throws Exception { // Initialize the database auditEventRepository.save(auditEvent); // Generate dates for selecting audits by date, making sure the period will not contain the sample audit String fromDate = SAMPLE_TIMESTAMP.minusDays(2).format(FORMATTER); String toDate = SAMPLE_TIMESTAMP.minusDays(1).format(FORMATTER); // Query audits but expect no results restAuditMockMvc.perform(get("/management/audits?fromDate=" + fromDate + "&toDate=" + toDate)) .andExpect(status().isOk()) .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE)) .andExpect(header().string("X-Total-Count", "0")); } @Test public void getNonExistingAudit() throws Exception { // Get the audit restAuditMockMvc.perform(get("/management/audits/{id}", Long.MAX_VALUE)) .andExpect(status().isNotFound()); } }
[ "fans_2046@126.com" ]
fans_2046@126.com
dae74f28c585c3eb23df4c0e0ba7d81738116e42
689cdf772da9f871beee7099ab21cd244005bfb2
/classes/com/alipay/c/h/a.java
ca59b8a688d3af7dd614542f33486f0bcb3346c5
[]
no_license
waterwitness/dazhihui
9353fd5e22821cb5026921ce22d02ca53af381dc
ad1f5a966ddd92bc2ac8c886eb2060d20cf610b3
refs/heads/master
2020-05-29T08:54:50.751842
2016-10-08T08:09:46
2016-10-08T08:09:46
70,314,359
2
4
null
null
null
null
UTF-8
Java
false
false
7,504
java
package com.alipay.c.h; import android.content.Context; import java.util.HashMap; import java.util.Map; import org.json.JSONObject; public final class a { public static String a(Context paramContext, String paramString1, String paramString2) { if ((paramContext == null) || (com.alipay.d.a.a.a.a.a(paramString1)) || (com.alipay.d.a.a.a.a.a(paramString2))) {} for (;;) { return null; try { paramContext = com.alipay.d.a.a.d.c.a(paramContext, paramString1, paramString2, ""); if (!com.alipay.d.a.a.a.a.a(paramContext)) { paramContext = com.alipay.d.a.a.a.a.c.b(com.alipay.d.a.a.a.a.c.a(), paramContext); return paramContext; } } catch (Exception paramContext) {} } return null; } public static String a(String paramString1, String paramString2) { if ((com.alipay.d.a.a.a.a.a(paramString1)) || (com.alipay.d.a.a.a.a.a(paramString2))) {} for (;;) { return null; try { paramString1 = com.alipay.d.a.a.d.a.a(paramString1); if (!com.alipay.d.a.a.a.a.a(paramString1)) { paramString1 = new JSONObject(paramString1).getString(paramString2); if (!com.alipay.d.a.a.a.a.a(paramString1)) { paramString1 = com.alipay.d.a.a.a.a.c.b(com.alipay.d.a.a.a.a.c.a(), paramString1); return paramString1; } } } catch (Exception paramString1) {} } return null; } public static void a(Context paramContext, String paramString1, String paramString2, String paramString3) { if ((com.alipay.d.a.a.a.a.a(paramString1)) || (com.alipay.d.a.a.a.a.a(paramString2)) || (paramContext == null)) { return; } try { paramString3 = com.alipay.d.a.a.a.a.c.a(com.alipay.d.a.a.a.a.c.a(), paramString3); HashMap localHashMap = new HashMap(); localHashMap.put(paramString2, paramString3); com.alipay.d.a.a.d.c.a(paramContext, paramString1, localHashMap); return; } catch (Exception paramContext) {} } /* Error */ public static void a(String paramString1, String paramString2, String paramString3) { // Byte code: // 0: aload_0 // 1: invokestatic 13 com/alipay/d/a/a/a/a:a (Ljava/lang/String;)Z // 4: ifne +10 -> 14 // 7: aload_1 // 8: invokestatic 13 com/alipay/d/a/a/a/a:a (Ljava/lang/String;)Z // 11: ifeq +4 -> 15 // 14: return // 15: invokestatic 25 com/alipay/d/a/a/a/a/c:a ()Ljava/lang/String; // 18: aload_2 // 19: invokestatic 47 com/alipay/d/a/a/a/a/c:a (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; // 22: astore_2 // 23: new 37 org/json/JSONObject // 26: dup // 27: invokespecial 67 org/json/JSONObject:<init> ()V // 30: astore_3 // 31: aload_3 // 32: aload_1 // 33: aload_2 // 34: invokevirtual 70 org/json/JSONObject:put (Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject; // 37: pop // 38: aload_3 // 39: invokevirtual 73 org/json/JSONObject:toString ()Ljava/lang/String; // 42: astore_2 // 43: aload_2 // 44: invokestatic 13 com/alipay/d/a/a/a/a:a (Ljava/lang/String;)Z // 47: ifne +9 -> 56 // 50: aload_0 // 51: aload_2 // 52: invokestatic 78 java/lang/System:setProperty (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; // 55: pop // 56: invokestatic 83 com/alipay/d/a/a/d/b:a ()Z // 59: ifeq -45 -> 14 // 62: new 85 java/lang/StringBuilder // 65: dup // 66: ldc 87 // 68: invokespecial 88 java/lang/StringBuilder:<init> (Ljava/lang/String;)V // 71: getstatic 94 java/io/File:separator Ljava/lang/String; // 74: invokevirtual 98 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 77: aload_0 // 78: invokevirtual 98 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; // 81: invokevirtual 99 java/lang/StringBuilder:toString ()Ljava/lang/String; // 84: astore_0 // 85: invokestatic 83 com/alipay/d/a/a/d/b:a ()Z // 88: ifeq -74 -> 14 // 91: new 90 java/io/File // 94: dup // 95: invokestatic 105 android/os/Environment:getExternalStorageDirectory ()Ljava/io/File; // 98: aload_0 // 99: invokespecial 108 java/io/File:<init> (Ljava/io/File;Ljava/lang/String;)V // 102: astore_0 // 103: aload_0 // 104: invokevirtual 111 java/io/File:exists ()Z // 107: ifne +11 -> 118 // 110: aload_0 // 111: invokevirtual 114 java/io/File:getParentFile ()Ljava/io/File; // 114: invokevirtual 117 java/io/File:mkdirs ()Z // 117: pop // 118: new 90 java/io/File // 121: dup // 122: aload_0 // 123: invokevirtual 120 java/io/File:getAbsolutePath ()Ljava/lang/String; // 126: invokespecial 121 java/io/File:<init> (Ljava/lang/String;)V // 129: astore_0 // 130: aconst_null // 131: astore_1 // 132: new 123 java/io/FileWriter // 135: dup // 136: aload_0 // 137: iconst_0 // 138: invokespecial 126 java/io/FileWriter:<init> (Ljava/io/File;Z)V // 141: astore_0 // 142: aload_0 // 143: aload_2 // 144: invokevirtual 129 java/io/FileWriter:write (Ljava/lang/String;)V // 147: aload_0 // 148: invokevirtual 132 java/io/FileWriter:close ()V // 151: return // 152: astore_0 // 153: return // 154: astore_0 // 155: aconst_null // 156: astore_0 // 157: aload_0 // 158: ifnull -144 -> 14 // 161: aload_0 // 162: invokevirtual 132 java/io/FileWriter:close ()V // 165: return // 166: astore_0 // 167: return // 168: astore_0 // 169: aload_1 // 170: ifnull +7 -> 177 // 173: aload_1 // 174: invokevirtual 132 java/io/FileWriter:close ()V // 177: aload_0 // 178: athrow // 179: astore_0 // 180: return // 181: astore_1 // 182: goto -5 -> 177 // 185: astore_0 // 186: return // 187: astore_2 // 188: aload_0 // 189: astore_1 // 190: aload_2 // 191: astore_0 // 192: goto -23 -> 169 // 195: astore_1 // 196: goto -39 -> 157 // 199: astore_1 // 200: goto -144 -> 56 // Local variable table: // start length slot name signature // 0 203 0 paramString1 String // 0 203 1 paramString2 String // 0 203 2 paramString3 String // 30 9 3 localJSONObject JSONObject // Exception table: // from to target type // 147 151 152 java/io/IOException // 132 142 154 java/lang/Exception // 161 165 166 java/io/IOException // 132 142 168 finally // 85 118 179 java/lang/Exception // 118 130 179 java/lang/Exception // 147 151 179 java/lang/Exception // 161 165 179 java/lang/Exception // 173 177 179 java/lang/Exception // 177 179 179 java/lang/Exception // 173 177 181 java/io/IOException // 15 43 185 java/lang/Exception // 43 56 185 java/lang/Exception // 56 85 185 java/lang/Exception // 142 147 187 finally // 142 147 195 java/lang/Exception // 43 56 199 java/lang/Throwable } } /* Location: E:\apk\dazhihui2\classes-dex2jar.jar!\com\alipay\c\h\a.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
7aacdff8c7db33d28544b774f554b654f3cfa469
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/org/apache/flink/client/program/ExecutionPlanCreationTest.java
46afc17bd5f7cbfd33b64b455142259366bc43ed
[]
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,234
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.flink.client.program; import JobManagerOptions.ADDRESS; import JobManagerOptions.PORT; import java.net.InetAddress; import java.net.InetSocketAddress; import org.apache.flink.api.common.ProgramDescription; import org.apache.flink.api.java.DataSet; import org.apache.flink.api.java.ExecutionEnvironment; import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.configuration.Configuration; import org.apache.flink.optimizer.DataStatistics; import org.apache.flink.optimizer.Optimizer; import org.apache.flink.optimizer.costs.DefaultCostEstimator; import org.apache.flink.optimizer.plan.OptimizedPlan; import org.apache.flink.optimizer.plandump.PlanJSONDumpGenerator; import org.junit.Assert; import org.junit.Test; /** * Tests for the generation of execution plans. */ public class ExecutionPlanCreationTest { @Test public void testGetExecutionPlan() { try { PackagedProgram prg = new PackagedProgram(ExecutionPlanCreationTest.TestOptimizerPlan.class, "/dev/random", "/tmp"); Assert.assertNotNull(prg.getPreviewPlan()); InetAddress mockAddress = InetAddress.getLocalHost(); InetSocketAddress mockJmAddress = new InetSocketAddress(mockAddress, 12345); Configuration config = new Configuration(); config.setString(ADDRESS, mockJmAddress.getHostName()); config.setInteger(PORT, mockJmAddress.getPort()); Optimizer optimizer = new Optimizer(new DataStatistics(), new DefaultCostEstimator(), config); OptimizedPlan op = ((OptimizedPlan) (ClusterClient.getOptimizedPlan(optimizer, prg, (-1)))); Assert.assertNotNull(op); PlanJSONDumpGenerator dumper = new PlanJSONDumpGenerator(); Assert.assertNotNull(dumper.getOptimizerPlanAsJSON(op)); // test HTML escaping PlanJSONDumpGenerator dumper2 = new PlanJSONDumpGenerator(); dumper2.setEncodeForHTML(true); String htmlEscaped = dumper2.getOptimizerPlanAsJSON(op); Assert.assertEquals((-1), htmlEscaped.indexOf('\\')); } catch (Exception e) { e.printStackTrace(); Assert.fail(e.getMessage()); } } /** * A test job. */ public static class TestOptimizerPlan implements ProgramDescription { @SuppressWarnings("serial") public static void main(String[] args) throws Exception { if ((args.length) < 2) { System.err.println("Usage: TestOptimizerPlan <input-file-path> <output-file-path>"); return; } ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); DataSet<Tuple2<Long, Long>> input = env.readCsvFile(args[0]).fieldDelimiter("\t").types(Long.class, Long.class); DataSet<Tuple2<Long, Long>> result = input.map(new org.apache.flink.api.common.functions.MapFunction<Tuple2<Long, Long>, Tuple2<Long, Long>>() { public Tuple2<Long, Long> map(Tuple2<Long, Long> value) { return new Tuple2<Long, Long>(value.f0, ((value.f1) + 1)); } }); result.writeAsCsv(args[1], "\n", "\t"); env.execute(); } @Override public String getDescription() { return "TestOptimizerPlan <input-file-path> <output-file-path>"; } } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
b955141ddd660db30fbbc8e7a74480925fea12c7
4729bbfd2702933b8449d08a37cc91794aa705cf
/app/src/main/java/im/boss66/com/http/PageDataRequest.java
6fe6fae3dfd0c56ee9cb77f3312c7abdf4611699
[]
no_license
duanjisi/IMProject
c56ee43e2ed021129227cbc9162ea4871602bbcf
05f85a21abe426ecb97b1295bfdb2d6c5627cec8
refs/heads/master
2021-01-11T11:59:47.362517
2017-04-15T05:31:35
2017-04-15T05:31:35
79,533,533
0
0
null
null
null
null
UTF-8
Java
false
false
354
java
package im.boss66.com.http; import com.alibaba.fastjson.TypeReference; /** * Summary: 带分页参数的上传数据对象 */ public abstract class PageDataRequest<T> extends BaseDataRequest<T> { protected PageDataRequest(String tag, Object... params) { super(tag, params); } protected abstract TypeReference getSubPojoType(); }
[ "576248427@qq.com" ]
576248427@qq.com
1cda769a2ccf062133f7f120d2a456b7fafda482
c900f4eeec0935138b082c5621f6ecf500962c61
/common/mattparks/mods/MattparksCore/util/EnumColor.java
ad839baf678ebb1e168d173db239b4bb371a5f5a
[]
no_license
dacenter/Mattparks-Core
1f3fc0d364a2d6e89d6093366951762c8d4aff46
f04665e107e3da652c7db320096c57cc0ac9dfb7
refs/heads/master
2021-01-21T06:00:24.814157
2014-07-24T20:41:57
2014-07-24T20:41:57
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,589
java
package mattparks.mods.MattparksCore.util; import net.minecraft.util.StatCollector; /** * Simple color enum for adding colors to in-game GUI strings of text. * @author AidanBrady * */ public enum EnumColor { BLACK("\u00a70", "black", new int[] {0, 0, 0}, 0), DARK_BLUE("\u00a71", "darkBlue", new int[] {0, 0, 170}, 4), DARK_GREEN("\u00a72", "darkGreen", new int[] {0, 170, 0}, 2), DARK_AQUA("\u00a73", "darkAqua", new int[] {0, 170, 170}, 6), DARK_RED("\u00a74", "darkRed", new int[] {170, 0, 0}, 1), PURPLE("\u00a75", "purple", new int[] {170, 0, 170}, 5), ORANGE("\u00a76", "orange", new int[] {255, 170, 0}, 14), GREY("\u00a77", "grey", new int[] {170, 170, 170}, 7), DARK_GREY("\u00a78", "darkGrey", new int[] {85, 85, 85}, 8), INDIGO("\u00a79", "indigo", new int[] {85, 85, 255}, 12), BRIGHT_GREEN("\u00a7a", "brightGreen", new int[] {85, 255, 85}, 10), AQUA("\u00a7b", "aqua", new int[] {85, 255, 255}, -1), RED("\u00a7c", "red", new int[] {255, 85, 85}, 13), PINK("\u00a7d", "pink", new int[] {255, 85, 255}, 9), YELLOW("\u00a7e", "yellow", new int[] {255, 255, 85}, 11), WHITE("\u00a7f", "white", new int[] {255, 255, 255}, 15); public static EnumColor[] DYES = new EnumColor[] {BLACK, DARK_RED, DARK_GREEN, null, DARK_BLUE, PURPLE, DARK_AQUA, GREY, DARK_GREY, PINK, BRIGHT_GREEN, YELLOW, INDIGO, RED, ORANGE, WHITE}; /** The color code that will be displayed */ public final String code; public final int[] rgbCode; public final int mcMeta; /** A friendly name of the color. */ public String unlocalizedName; private EnumColor(String s, String n, int[] rgb, int meta) { code = s; unlocalizedName = n; rgbCode = rgb; mcMeta = meta; } /** * Gets the localized name of this color by translating the unlocalized name. * @return localized name */ public String getLocalizedName() { return StatCollector.translateToLocal("color." + unlocalizedName); } /** * Gets the name of this color with it's color prefix code. * @return the color's name and color prefix */ public String getName() { return code + getLocalizedName(); } /** * Gets the 0-1 of this color's RGB value by dividing by 255 (used for OpenGL coloring). * @param index - R:0, G:1, B:2 * @return the color value */ public float getColor(int index) { return (float)rgbCode[index]/255F; } /** * Gets the value of this color mapped to MC in-game item colors present in dyes and wool. * @return mc meta value */ public int getMetaValue() { return mcMeta; } @Override public String toString() { return code; } }
[ "mattparks5855@gmail.com" ]
mattparks5855@gmail.com
f3b7acc84c43deee8f6f5d8a78ad22a465ca2c7a
f60d91838cc2471bcad3784a56be2aeece101f71
/spring-framework-4.3.15.RELEASE/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/AbstractHttpReceivingTransportHandler.java
98e9f0fcbb6a24c1e1f93a2a1f8c827661a39478
[ "Apache-2.0" ]
permissive
fisher123456/spring-boot-1.5.11.RELEASE
b3af74913eb1a753a20c3dedecea090de82035dc
d3c27f632101e8be27ea2baeb4b546b5cae69607
refs/heads/master
2023-01-07T04:12:02.625478
2019-01-26T17:44:05
2019-01-26T17:44:05
167,649,054
0
0
Apache-2.0
2022-12-27T14:50:58
2019-01-26T04:21:05
Java
UTF-8
Java
false
false
3,719
java
/* * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.socket.sockjs.transport.handler; import java.io.IOException; import java.util.Arrays; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.server.ServerHttpRequest; import org.springframework.http.server.ServerHttpResponse; import org.springframework.util.Assert; import org.springframework.web.socket.WebSocketHandler; import org.springframework.web.socket.sockjs.SockJsException; import org.springframework.web.socket.sockjs.transport.SockJsSession; import org.springframework.web.socket.sockjs.transport.session.AbstractHttpSockJsSession; /** * Base class for HTTP transport handlers that receive messages via HTTP POST. * * @author Rossen Stoyanchev * @since 4.0 */ public abstract class AbstractHttpReceivingTransportHandler extends AbstractTransportHandler { @Override public boolean checkSessionType(SockJsSession session) { return (session instanceof AbstractHttpSockJsSession); } @Override public final void handleRequest(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, SockJsSession wsSession) throws SockJsException { Assert.notNull(wsSession, "No session"); AbstractHttpSockJsSession sockJsSession = (AbstractHttpSockJsSession) wsSession; handleRequestInternal(request, response, wsHandler, sockJsSession); } protected void handleRequestInternal(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, AbstractHttpSockJsSession sockJsSession) throws SockJsException { String[] messages; try { messages = readMessages(request); } catch (IOException ex) { logger.error("Failed to read message", ex); if (ex.getClass().getName().contains("Mapping")) { // e.g. Jackson's JsonMappingException, indicating an incomplete payload handleReadError(response, "Payload expected.", sockJsSession.getId()); } else { handleReadError(response, "Broken JSON encoding.", sockJsSession.getId()); } return; } catch (Throwable ex) { logger.error("Failed to read message", ex); handleReadError(response, "Failed to read message(s)", sockJsSession.getId()); return; } if (messages == null) { handleReadError(response, "Payload expected.", sockJsSession.getId()); return; } if (logger.isTraceEnabled()) { logger.trace("Received message(s): " + Arrays.asList(messages)); } response.setStatusCode(getResponseStatus()); response.getHeaders().setContentType(new MediaType("text", "plain", UTF8_CHARSET)); sockJsSession.delegateMessages(messages); } private void handleReadError(ServerHttpResponse response, String error, String sessionId) { try { response.setStatusCode(HttpStatus.INTERNAL_SERVER_ERROR); response.getBody().write(error.getBytes(UTF8_CHARSET)); } catch (IOException ex) { throw new SockJsException("Failed to send error: " + error, sessionId, ex); } } protected abstract String[] readMessages(ServerHttpRequest request) throws IOException; protected abstract HttpStatus getResponseStatus(); }
[ "171509086@qq.com" ]
171509086@qq.com
69754b484013cbcd52fdd2970a6152994022674b
2d1230a8fef33d76e5abb591766e505b564e7a6d
/src/me/david/timbernocheat/listener/ChatHandler.java
5fb4a9be77a1577fbfbd3225a19fd6733e477938
[]
no_license
SplotyCode/TimberNoCheat
2e01487b7361b5b92fed92c0ad3849ca12b4926b
45c4775f5cb723dc149e884e389372a54b06259d
refs/heads/master
2020-05-24T23:44:21.394312
2018-10-29T18:26:37
2018-10-29T18:26:37
187,518,207
1
0
null
null
null
null
UTF-8
Java
false
false
859
java
package me.david.timbernocheat.listener; import me.david.timbernocheat.TimberNoCheat; import me.david.timbernocheat.gui.settings.CustomSettingsGui; import me.david.timbernocheat.gui.settings.SettingsGui; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; import org.bukkit.event.player.AsyncPlayerChatEvent; public class ChatHandler implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onChat(AsyncPlayerChatEvent event){ String node = CustomSettingsGui.players.get(event.getPlayer().getUniqueId()); if(node == null)return; SettingsGui.currentCheck.get(event.getPlayer().getUniqueId()).set(node, event.getMessage()); TimberNoCheat.getInstance().getGuiManager().startMultidefaultStage(event.getPlayer(), "ReloadMulti"); } }
[ "davidscandurra@gmail.com" ]
davidscandurra@gmail.com
59c70ff22c8bd83f1cca406db09040d65af4ebc6
fbeeb4cc331c5618ff96e15dfe91bc5271a3b687
/src/com/xt/bcloud/test/TestEchoClient.java
049c74647caaa2ce439f66d03a63ff48db1d86e6
[]
no_license
AlbertZheng66/B-Cloud
3d01bd1708455548bd169bb9d74f85cba9fd2f6b
a3f8d380b6a9e08005c56122a505e2fd19ff2a6a
refs/heads/master
2021-01-22T07:38:59.181855
2015-02-09T07:58:17
2015-02-09T07:58:17
29,894,799
0
0
null
null
null
null
UTF-8
Java
false
false
5,316
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.xt.bcloud.test; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.InetAddress; import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.SocketChannel; import java.nio.charset.Charset; import java.util.Date; import java.util.Iterator; import java.util.Set; public class TestEchoClient { private SocketChannel socketChannel = null; private ByteBuffer sendBuffer = ByteBuffer.allocate(32 * 1024); private ByteBuffer receiveBuffer = ByteBuffer.allocate(32 * 1024); private Charset charset = Charset.forName("UTF-8"); private Selector selector; private boolean isSend = false; public TestEchoClient() throws IOException { socketChannel = SocketChannel.open(); InetAddress ia = InetAddress.getLocalHost(); InetSocketAddress isa = new InetSocketAddress(ia, 8000); socketChannel.connect(isa); socketChannel.configureBlocking(false); log("Client: connection establish[" + isa.getHostName() + ":" + isa.getPort() + "]", false); selector = Selector.open(); } public static void main(String args[]) throws IOException { final TestEchoClient client = new TestEchoClient(); Thread receiver = new Thread() { public void run() { client.receiveFromUser(); } }; receiver.start(); client.talk(); } public void receiveFromUser() { try { BufferedReader localReader = new BufferedReader(new InputStreamReader(System.in)); String msg = null; while ((msg = localReader.readLine()) != null) { log("Read From System Console: " + msg, false); isSend = true; log("Command line thread set isSend: " + isSend, false); synchronized (sendBuffer) { sendBuffer.put(encode(msg + "\r\n")); } if (msg.equals("bye")) { log("Client Exit", false); break; } } } catch (IOException e) { e.printStackTrace(); } } public void talk() throws IOException { log("SocketChannel register [" + SelectionKey.OP_READ + "] and [" + SelectionKey.OP_WRITE + "] to selector", false); socketChannel.register(selector, SelectionKey.OP_READ | SelectionKey.OP_WRITE); while (selector.select() > 0) { Set readyKeys = selector.selectedKeys(); Iterator it = readyKeys.iterator(); while (it.hasNext()) { SelectionKey key = null; try { key = (SelectionKey) it.next(); it.remove(); if (key.isReadable()) { receive(key); } if (key.isWritable()) { send(key); } } catch (IOException e) { e.printStackTrace(); try { if (key != null) { key.cancel(); key.channel().close(); } } catch (Exception ex) { e.printStackTrace(); } } } } } public void send(SelectionKey key) throws IOException { if (!isSend) { return; } SocketChannel socketChannel = (SocketChannel) key.channel(); synchronized (sendBuffer) { sendBuffer.flip(); socketChannel.write(sendBuffer); sendBuffer.compact(); } isSend = false; log("Send method set isSend: " + isSend, false); } public void receive(SelectionKey key) throws IOException { SocketChannel socketChannel = (SocketChannel) key.channel(); socketChannel.read(receiveBuffer); receiveBuffer.flip(); String receiveData = decode(receiveBuffer); if (receiveData.indexOf("\n") == -1) { return; } String outputData = receiveData.substring(0, receiveData.indexOf("\n") + 1); log("Recieve Data: " + outputData, false); if (outputData.equals("echo:bye\r\n")) { key.cancel(); socketChannel.close(); System.out.println("Exit"); selector.close(); System.exit(0); } ByteBuffer temp = encode(outputData); receiveBuffer.position(temp.limit()); receiveBuffer.compact(); } public String decode(ByteBuffer buffer) { CharBuffer charBuffer = charset.decode(buffer); return charBuffer.toString(); } public ByteBuffer encode(String str) { return charset.encode(str); } public void log(String msg, boolean err) { String type = err ? "[WARN]" : "[INFO]"; msg = new Date() + " --> " + type + " " + msg; System.out.println(msg); } }
[ "albert_zheng66@hotmail.com" ]
albert_zheng66@hotmail.com
d422c9d6b2d30033a3943e7169a45a62a55e4f10
ab2fd960a295be52786b8d9394a7fd63e379b340
/dao/src/main/java/org/thingsboard/server/dao/sql/event/EventRepository.java
11e423d559b28b9469dbe216cfc0f6caee08f60e
[ "Apache-2.0" ]
permissive
ltcong1411/SmartDeviceFrameworkV2
654f7460baa00d8acbc483dddf46b62ce6657eea
6f1bbbf3a2a15d5c0527e68feebea370967bce8a
refs/heads/master
2020-04-22T02:46:44.240516
2019-02-25T08:19:43
2019-02-25T08:19:43
170,062,547
0
0
null
null
null
null
UTF-8
Java
false
false
2,806
java
/** * Copyright © 2016-2019 The Thingsboard 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.thingsboard.server.dao.sql.event; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.query.Param; import org.thingsboard.server.common.data.EntityType; import org.thingsboard.server.dao.model.sql.EventEntity; import org.thingsboard.server.dao.util.SqlDao; import java.util.List; /** * Created by Valerii Sosliuk on 5/3/2017. */ @SqlDao public interface EventRepository extends CrudRepository<EventEntity, String>, JpaSpecificationExecutor<EventEntity> { EventEntity findByTenantIdAndEntityTypeAndEntityIdAndEventTypeAndEventUid(String tenantId, EntityType entityType, String entityId, String eventType, String eventUid); EventEntity findByTenantIdAndEntityTypeAndEntityId(String tenantId, EntityType entityType, String entityId); @Query("SELECT e FROM EventEntity e WHERE e.tenantId = :tenantId AND e.entityType = :entityType " + "AND e.entityId = :entityId AND e.eventType = :eventType ORDER BY e.eventType DESC, e.id DESC") List<EventEntity> findLatestByTenantIdAndEntityTypeAndEntityIdAndEventType( @Param("tenantId") String tenantId, @Param("entityType") EntityType entityType, @Param("entityId") String entityId, @Param("eventType") String eventType, Pageable pageable); }
[ "ltcong1411@gmail.com" ]
ltcong1411@gmail.com
79884d9da0836c7f7d558a1352902866d6a8f352
255ff79057c0ff14d0b760fc2d6da1165f1806c8
/08Advanced/24资料-并发编程volatile精讲/案例/src/com/itheima/concurrent/OutOfOrderDemo06.java
dd0bc138e72834f6b8a8630bd62cc2fb5144eb05
[]
no_license
wjphappy90/Resource
7f1f817d323db5adae06d26da17dfc09ee5f9d3a
6574c8399f3cdfb6d6b39cd64dc9507e784a2549
refs/heads/master
2022-07-30T03:33:59.869345
2020-08-10T02:31:35
2020-08-10T02:31:35
285,701,650
2
6
null
null
null
null
UTF-8
Java
false
false
1,339
java
package com.itheima.concurrent; /** 目标:研究重排序情况下可能带来的问题。 */ public class OutOfOrderDemo06 { // 新建几个静态变量 public static int a = 0 , b = 0; public static int i = 0 , j = 0; public static void main(String[] args) throws Exception { int count = 0; while(true){ count++; a = 0 ; b = 0 ; i = 0 ; j = 0 ; // 定义两个线程。 // 线程A Thread t1 = new Thread(new Runnable() { @Override public void run() { a = 1; i = b; } }); // 线程B Thread t2 = new Thread(new Runnable() { @Override public void run() { b = 1; j = a; } }); t1.start(); t2.start(); t1.join(); // 让t1线程优先执行完毕 t2.join(); // 让t2线程优先执行完毕 // 得到线程执行完毕以后 变量的结果。 System.out.println("第"+count+"次输出结果:i = " +i +" , j = "+j); if(i == 0 && j == 0){ break; } } } }
[ "981146457@qq.com" ]
981146457@qq.com
f87cadcf86a2d8ba14a3ffecd751dadf71f7594a
e2f67d65069bbe1a6e30de4eeb9aa6dca06e0ebd
/src/main/java/com/rok93/book/springboot/domain/user/Role.java
47021c85535f0077fa114b0482482e8660a97424
[]
no_license
Rok93/springboot-webservice
2c1387b8189b28971b561f56863f7e00be2260f0
1cf591521397c9b28d21398128259121ed1022a4
refs/heads/master
2020-09-28T01:53:21.541604
2020-01-15T10:56:18
2020-01-15T10:56:18
226,661,014
0
0
null
null
null
null
UTF-8
Java
false
false
304
java
package com.rok93.book.springboot.domain.user; import lombok.Getter; import lombok.RequiredArgsConstructor; @Getter @RequiredArgsConstructor public enum Role { GUEST("ROLE_GUEST","손님"), USER("ROLE_USER","일반 사용자"); private final String key; private final String title; }
[ "goodboy3421@gmail.com" ]
goodboy3421@gmail.com
ea219c1dce114461b95c75595dd2fc76549b37dd
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/62_dom4j-org.dom4j.tree.FlyweightCDATA-1.0-8/org/dom4j/tree/FlyweightCDATA_ESTest.java
4ecfc59315e73186410670473fc94a118d5f2610
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
648
java
/* * This file was automatically generated by EvoSuite * Fri Oct 25 23:41:26 GMT 2019 */ package org.dom4j.tree; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class FlyweightCDATA_ESTest extends FlyweightCDATA_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
c8827626c4617a11fb9facc359886eb57eed5797
ded4433725623926785b073a92504b158f684db0
/wit-servlet/src/main/java/org/febit/wit/servlet/loaders/ServletContextResource.java
90b9f3c146d4f3ba2c45af06fb175788822b907f
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
restmad/wit
2bb9d5b34b0edeb98eb86a6268daa74c0dfb4207
7b15f42529d1f0d365a9eaae3d3487046baa808a
refs/heads/master
2021-01-01T17:09:04.614845
2017-07-01T16:08:19
2017-07-01T16:10:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,040
java
// Copyright (c) 2013-2016, febit.org. All Rights Reserved. package org.febit.wit.servlet.loaders; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import javax.servlet.ServletContext; import org.febit.wit.exceptions.ResourceNotFoundException; import org.febit.wit.loaders.Resource; /** * * @author zqq90 */ public class ServletContextResource implements Resource { protected final String path; protected final String encoding; protected final ServletContext servletContext; protected final boolean codeFirst; /** * * @param path * @param encoding * @param servletContext */ public ServletContextResource(String path, String encoding, ServletContext servletContext) { this(path, encoding, servletContext, false); } /** * * @param path * @param encoding * @param servletContext * @param codeFirst * @since 2.0.0 */ public ServletContextResource(String path, String encoding, ServletContext servletContext, boolean codeFirst) { this.path = path; this.encoding = encoding; this.servletContext = servletContext; this.codeFirst = codeFirst; } @Override public boolean isModified() { return false; } @Override public Reader openReader() throws IOException { final InputStream in = servletContext.getResourceAsStream(path); if (in != null) { return new InputStreamReader(in, encoding); } throw new ResourceNotFoundException("Resource Not Found: ".concat(path)); } /** * @since 1.4.1 */ @Override public boolean exists() { try { if (servletContext.getResource(path) != null) { return true; } } catch (Exception ignore) { } return false; } /** * @since 2.0.0 */ @Override public boolean isCodeFirst() { return codeFirst; } }
[ "zqq_90@163.com" ]
zqq_90@163.com
1bb8634fa4c5c49d8b4f03e06fa3e0c8d4ef9bf2
939eca99c5b48cc2c15b9699e6cbb0f13c8ce6d5
/DatBot.Interface/src/protocol/network/messages/game/context/fight/SlaveNoLongerControledMessage.java
430fd6366c8f8907e70eebeb6cf709fb2b8166e0
[ "MIT" ]
permissive
ProjectBlackFalcon/DatBot
032a2ec70725ed497556480fd2d10907347dce69
1dd1af94c550272417a4b230e805988698cfbf3c
refs/heads/master
2022-07-22T11:01:58.837303
2022-07-12T09:10:30
2022-07-12T09:10:30
111,686,347
7
1
null
null
null
null
UTF-8
Java
false
false
1,466
java
package protocol.network.messages.game.context.fight; import java.io.IOException; import java.util.ArrayList; import java.util.List; import protocol.utils.ProtocolTypeManager; import protocol.network.util.types.BooleanByteWrapper; import protocol.network.NetworkMessage; import protocol.network.util.DofusDataReader; import protocol.network.util.DofusDataWriter; import protocol.network.Network; import protocol.network.NetworkMessage; @SuppressWarnings("unused") public class SlaveNoLongerControledMessage extends NetworkMessage { public static final int ProtocolId = 6807; private double masterId; private double slaveId; public double getMasterId() { return this.masterId; } public void setMasterId(double masterId) { this.masterId = masterId; }; public double getSlaveId() { return this.slaveId; } public void setSlaveId(double slaveId) { this.slaveId = slaveId; }; public SlaveNoLongerControledMessage(){ } public SlaveNoLongerControledMessage(double masterId, double slaveId){ this.masterId = masterId; this.slaveId = slaveId; } @Override public void Serialize(DofusDataWriter writer) { try { writer.writeDouble(this.masterId); writer.writeDouble(this.slaveId); } catch (Exception e){ e.printStackTrace(); } } @Override public void Deserialize(DofusDataReader reader) { try { this.masterId = reader.readDouble(); this.slaveId = reader.readDouble(); } catch (Exception e){ e.printStackTrace(); } } }
[ "baptiste.beduneau@reseau.eseo.fr" ]
baptiste.beduneau@reseau.eseo.fr
7a6a3293c65bae3277b3432acfbccf547ce660e8
e1450a329c75a55cf6ccd0ce2d2f3517b3ee51c5
/src/main/java/home/javarush/javaCore/task12/task1225/Solution.java
d19c9397edfcf8e4154c6a9c334154b759061be6
[]
no_license
nikolaydmukha/netology-java-base-java-core
afcf0dd190f4c912c5feb2ca8897bc17c09a9ec1
eea55c27bbbab3b317c3ca5b0719b78db7d27375
refs/heads/master
2023-03-18T13:33:24.659489
2021-03-25T17:31:52
2021-03-25T17:31:52
326,259,412
0
0
null
null
null
null
UTF-8
Java
false
false
1,574
java
package home.javarush.javaCore.task12.task1225; /* Посетители */ public class Solution { public static void main(String[] args) { System.out.println(getObjectType(new Cat())); System.out.println(getObjectType(new Tiger())); System.out.println(getObjectType(new Lion())); System.out.println(getObjectType(new Bull())); System.out.println(getObjectType(new Cow())); System.out.println(getObjectType(new Animal())); } public static String getObjectType(Object o) { //напишите тут ваш код System.out.println(o.getClass().getSimpleName()); if (o instanceof Cat && !o.getClass().getSimpleName().equals("Tiger") && !o.getClass().getSimpleName().equals("Lion")){ return "Кот"; }else if (o instanceof Tiger && o.getClass().getSimpleName().equals("Tiger")) { return "Тигр"; }else if (o instanceof Lion && o.getClass().getSimpleName().equals("Lion")) { return "Лев"; }else if (o instanceof Bull) { return "Бык"; }else if (o instanceof Cow) { return "Корова"; } return "Животное"; } public static class Cat extends Animal //<--Классы наследуются!! { } public static class Tiger extends Cat { } public static class Lion extends Cat { } public static class Bull extends Animal { } public static class Cow extends Animal { } public static class Animal { } }
[ "dmukha@mail.ru" ]
dmukha@mail.ru
1fe60294e8d57a39fc818d967d2c3354db365eb0
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/JetBrains--kotlin/044f7b61569826c86f5811fc31cc0649a04a5ea7/after/LineMarkersTestGenerated.java
bd32b97c740606eb266b9277fce05be84a62808a
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
7,216
java
/* * Copyright 2010-2015 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jetbrains.kotlin.idea.codeInsight; import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.InnerTestClasses; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; import org.jetbrains.kotlin.test.JetTestUtils; import org.jetbrains.kotlin.test.TestMetadata; import org.junit.runner.RunWith; import java.io.File; import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("idea/testData/codeInsight/lineMarker") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class LineMarkersTestGenerated extends AbstractLineMarkersTest { public void testAllFilesPresentInLineMarker() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/codeInsight/lineMarker"), Pattern.compile("^(.+)\\.kt$"), true); } @TestMetadata("BadCodeNoExceptions.kt") public void testBadCodeNoExceptions() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/BadCodeNoExceptions.kt"); doTest(fileName); } @TestMetadata("Class.kt") public void testClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/Class.kt"); doTest(fileName); } @TestMetadata("ClassObjectInStaticNestedClass.kt") public void testClassObjectInStaticNestedClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/ClassObjectInStaticNestedClass.kt"); doTest(fileName); } @TestMetadata("DelegatedFun.kt") public void testDelegatedFun() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/DelegatedFun.kt"); doTest(fileName); } @TestMetadata("DelegatedProperty.kt") public void testDelegatedProperty() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/DelegatedProperty.kt"); doTest(fileName); } @TestMetadata("FakeOverrideForClasses.kt") public void testFakeOverrideForClasses() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/FakeOverrideForClasses.kt"); doTest(fileName); } @TestMetadata("FakeOverrideFun.kt") public void testFakeOverrideFun() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/FakeOverrideFun.kt"); doTest(fileName); } @TestMetadata("FakeOverrideFunWithMostRelevantImplementation.kt") public void testFakeOverrideFunWithMostRelevantImplementation() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/FakeOverrideFunWithMostRelevantImplementation.kt"); doTest(fileName); } @TestMetadata("FakeOverrideProperty.kt") public void testFakeOverrideProperty() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/FakeOverrideProperty.kt"); doTest(fileName); } @TestMetadata("FakeOverrideToStringInTrait.kt") public void testFakeOverrideToStringInTrait() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/FakeOverrideToStringInTrait.kt"); doTest(fileName); } @TestMetadata("FakeOverridesForTraitFunWithImpl.kt") public void testFakeOverridesForTraitFunWithImpl() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/FakeOverridesForTraitFunWithImpl.kt"); doTest(fileName); } @TestMetadata("NavigateToSeveralSuperElements.kt") public void testNavigateToSeveralSuperElements() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/NavigateToSeveralSuperElements.kt"); doTest(fileName); } @TestMetadata("NoOverridingMarkerOnDefaultTraitImpl.kt") public void testNoOverridingMarkerOnDefaultTraitImpl() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/NoOverridingMarkerOnDefaultTraitImpl.kt"); doTest(fileName); } @TestMetadata("Overloads.kt") public void testOverloads() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/Overloads.kt"); doTest(fileName); } @TestMetadata("OverrideFunction.kt") public void testOverrideFunction() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/OverrideFunction.kt"); doTest(fileName); } @TestMetadata("OverrideIconForOverloadMethodBug.kt") public void testOverrideIconForOverloadMethodBug() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/OverrideIconForOverloadMethodBug.kt"); doTest(fileName); } @TestMetadata("OverridenTraitDeclarations.kt") public void testOverridenTraitDeclarations() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/OverridenTraitDeclarations.kt"); doTest(fileName); } @TestMetadata("OverridingTooltipOnDefaultTraitImpl.kt") public void testOverridingTooltipOnDefaultTraitImpl() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/OverridingTooltipOnDefaultTraitImpl.kt"); doTest(fileName); } @TestMetadata("PropertyOverride.kt") public void testPropertyOverride() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/PropertyOverride.kt"); doTest(fileName); } @TestMetadata("ToStringInTrait.kt") public void testToStringInTrait() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/ToStringInTrait.kt"); doTest(fileName); } @TestMetadata("Trait.kt") public void testTrait() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/codeInsight/lineMarker/Trait.kt"); doTest(fileName); } }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
3f5530d4c285678cc25e6695e24781b2ac9ccadb
51fa3cc281eee60058563920c3c9059e8a142e66
/Java/src/testcases/CWE89_SQL_Injection/s03/CWE89_SQL_Injection__getQueryString_Servlet_prepareStatement_71b.java
49b9a715ab60d39a90f219bd6616e90cd3dedaba
[]
no_license
CU-0xff/CWE-Juliet-TestSuite-Java
0b4846d6b283d91214fed2ab96dd78e0b68c945c
f616822e8cb65e4e5a321529aa28b79451702d30
refs/heads/master
2020-09-14T10:41:33.545462
2019-11-21T07:34:54
2019-11-21T07:34:54
223,105,798
1
4
null
null
null
null
UTF-8
Java
false
false
6,320
java
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE89_SQL_Injection__getQueryString_Servlet_prepareStatement_71b.java Label Definition File: CWE89_SQL_Injection.label.xml Template File: sources-sinks-71b.tmpl.java */ /* * @description * CWE: 89 SQL Injection * BadSource: getQueryString_Servlet Parse id param out of the URL query string (without using getParameter()) * GoodSource: A hardcoded string * Sinks: prepareStatement * GoodSink: Use prepared statement and execute (properly) * BadSink : data concatenated into SQL statement used in prepareStatement() call, which could result in SQL Injection * Flow Variant: 71 Data flow: data passed as an Object reference argument from one method to another in different classes in the same package * * */ package testcases.CWE89_SQL_Injection.s03; import testcasesupport.*; import javax.servlet.http.*; import java.sql.*; import java.util.logging.Level; public class CWE89_SQL_Injection__getQueryString_Servlet_prepareStatement_71b { public void badSink(Object dataObject , HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = (String)dataObject; Connection dbConnection = null; PreparedStatement sqlStatement = null; try { /* POTENTIAL FLAW: data concatenated into SQL statement used in prepareStatement() call, which could result in SQL Injection */ dbConnection = IO.getDBConnection(); sqlStatement = dbConnection.prepareStatement("insert into users (status) values ('updated') where name='"+data+"'"); Boolean result = sqlStatement.execute(); if (result) { IO.writeLine("Name, " + data + ", updated successfully"); } else { IO.writeLine("Unable to update records for user: " + data); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (sqlStatement != null) { sqlStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql); } try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } /* goodG2B() - use goodsource and badsink */ public void goodG2BSink(Object dataObject , HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = (String)dataObject; Connection dbConnection = null; PreparedStatement sqlStatement = null; try { /* POTENTIAL FLAW: data concatenated into SQL statement used in prepareStatement() call, which could result in SQL Injection */ dbConnection = IO.getDBConnection(); sqlStatement = dbConnection.prepareStatement("insert into users (status) values ('updated') where name='"+data+"'"); Boolean result = sqlStatement.execute(); if (result) { IO.writeLine("Name, " + data + ", updated successfully"); } else { IO.writeLine("Unable to update records for user: " + data); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (sqlStatement != null) { sqlStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql); } try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } /* goodB2G() - use badsource and goodsink */ public void goodB2GSink(Object dataObject , HttpServletRequest request, HttpServletResponse response) throws Throwable { String data = (String)dataObject; Connection dbConnection = null; PreparedStatement sqlStatement = null; try { /* FIX: Use prepared statement and execute (properly) */ dbConnection = IO.getDBConnection(); sqlStatement = dbConnection.prepareStatement("insert into users (status) values ('updated') where name=?"); sqlStatement.setString(1, data); Boolean result = sqlStatement.execute(); if (result) { IO.writeLine("Name, " + data + ", updated successfully"); } else { IO.writeLine("Unable to update records for user: " + data); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error getting database connection", exceptSql); } finally { try { if (sqlStatement != null) { sqlStatement.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing PreparedStatement", exceptSql); } try { if (dbConnection != null) { dbConnection.close(); } } catch (SQLException exceptSql) { IO.logger.log(Level.WARNING, "Error closing Connection", exceptSql); } } } }
[ "frank@fischer.com.mt" ]
frank@fischer.com.mt
3a768914ed5880eae94621de1f42f04569d7b69c
f70b716fbe8eed903cf842698c89bdf8b0ef43b6
/notifier/smtp/src/main/java/com/epam/pipeline/notifier/service/task/SMTPNotificationManager.java
b78a40ef4c21c3f509c84bf55194efd069fe0f36
[ "Apache-2.0" ]
permissive
jaideepjoshi/cloud-pipeline
7e7d9cc9ff7912745ed1f9fd346b49a29769bdcd
2d5081c2f2ceb55213f92e8c6da242c80fff03fa
refs/heads/master
2022-12-04T18:42:46.212873
2019-03-26T11:23:17
2019-03-26T11:23:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
8,102
java
/* * Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.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 com.epam.pipeline.notifier.service.task; import com.epam.pipeline.entity.notification.NotificationMessage; import com.epam.pipeline.entity.notification.NotificationTemplate; import com.epam.pipeline.entity.user.PipelineUser; import com.epam.pipeline.notifier.repository.UserRepository; import org.apache.commons.mail.DefaultAuthenticator; import org.apache.commons.mail.Email; import org.apache.commons.mail.EmailException; import org.apache.commons.mail.HtmlEmail; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.Velocity; import org.apache.velocity.tools.generic.NumberTool; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import javax.mail.internet.InternetAddress; import java.io.StringWriter; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.List; import java.util.Optional; import java.util.TimeZone; import java.util.stream.Collectors; /** * SMTP realization of {@link NotificationManager}. * {@link SMTPNotificationManager} sends message to all target users from {@link NotificationMessage#getToUserId()} and * {@link NotificationMessage#getCopyUserIds()} */ @Component public class SMTPNotificationManager implements NotificationManager { private static final Logger LOGGER = LoggerFactory.getLogger(SMTPNotificationManager.class); public static final String MESSAGE_TAG = "message"; @Value(value = "${notification.enable.smtp}") private boolean isEnabled; @Value(value = "${email.notification.retry.count:3}") private int notifyRetryCount; @Value(value = "${email.smtp.server.host.name}") private String smtpServerHostName; @Value(value = "${email.smtp.port}") private int smtpPort; @Value(value = "${email.ssl.on.connect}") private boolean sslOnConnect; @Value(value = "${email.start.tls.enabled}") private boolean startTlsEnabled; @Value(value = "${email.from}") private String emailFrom; @Value(value = "${email.user}") private String username; @Value(value = "${email.password}") private String password; @Value(value = "${email.notification.letter.delay:-1}") private long emailDelay; @Value(value = "${email.notification.retry.delay:-1}") private long retryDelay; @Autowired private UserRepository userRepository; /** * Sends a notification to all specified recipients. * * If {@link NotificationMessage#template} is specified then it will be used. Otherwise * {@link NotificationMessage#subject} and {@link NotificationMessage#body} will be used instead. * * Both subject and body are filled with {@link NotificationMessage#templateParameters} regardless the way they * were retrieved (from template or directly from fields). */ @Override public void notifySubscribers(NotificationMessage message) { if (!isEnabled) { return; } for (int i = 0; i < notifyRetryCount; i++) { try { Optional<Email> email = buildEmail(message); if (email.isPresent()) { email.get().send(); } LOGGER.info("Message with id: {} was successfully send", message.getId()); sleepIfRequired(emailDelay); return; } catch (EmailException e) { LOGGER.warn(String.format("Fail to send message with id %d. Attempt %d/%d. %n Cause: %n ", message.getId(), i + 1, notifyRetryCount), e); sleepIfRequired(retryDelay); } } LOGGER.error(String.format("All attempts are failed. Message with id: %d will not be sent.", message.getId())); } private Optional<Email> buildEmail(NotificationMessage message) throws EmailException { HtmlEmail email = new HtmlEmail(); email.setHostName(smtpServerHostName); email.setSmtpPort(smtpPort); email.setSSLOnConnect(sslOnConnect); email.setStartTLSEnabled(startTlsEnabled); // check that credentials are provided, otherwise try to proceed without authentication if (!StringUtils.isEmpty(username) && !StringUtils.isEmpty(password)) { email.setAuthenticator(new DefaultAuthenticator(username, password)); } email.setFrom(emailFrom); Optional<NotificationTemplate> template = Optional.ofNullable(message.getTemplate()); String subject = template.map(NotificationTemplate::getSubject).orElse(message.getSubject()); String body = template.map(NotificationTemplate::getBody).orElse(message.getBody()); VelocityContext velocityContext = getVelocityContext(message); velocityContext.put("numberTool", new NumberTool()); StringWriter subjectOut = new StringWriter(); StringWriter bodyOut = new StringWriter(); Velocity.evaluate(velocityContext, subjectOut, MESSAGE_TAG + message.hashCode(), subject); Velocity.evaluate(velocityContext, bodyOut, MESSAGE_TAG + message.hashCode(), body); email.setSubject(subjectOut.toString()); email.setHtmlMsg(bodyOut.toString()); if (message.getToUserId() != null) { PipelineUser targetUser = userRepository.findOne(message.getToUserId()); email.addTo(targetUser.getEmail()); } else { if (CollectionUtils.isEmpty(message.getCopyUserIds())) { LOGGER.info("Email with message {} won't be sent: no recipients found", message.getId()); return Optional.empty(); } } List<PipelineUser> keepInformedUsers = userRepository.findByIdIn(message.getCopyUserIds()); for (PipelineUser user : keepInformedUsers) { String address = user.getEmail(); if (address != null) { email.addCc(address); } } LOGGER.info("Email from message {} formed and will be send to: {}", message.getId(), email.getToAddresses() .stream() .map(InternetAddress::getAddress) .collect(Collectors.toList()) ); return Optional.of(email); } private VelocityContext getVelocityContext(NotificationMessage message) { VelocityContext velocityContext = new VelocityContext(); velocityContext.put("templateParameters", message.getTemplateParameters()); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC")); velocityContext.put("calendar", calendar); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); velocityContext.put("dateFormat", dateFormat); return velocityContext; } private void sleepIfRequired(final long delay) { if (delay <= 0) { return; } try { Thread.sleep(delay); } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOGGER.error(e.getMessage(), e); } } }
[ "aleksandr_sidoruk@epam.com" ]
aleksandr_sidoruk@epam.com
51ae12f4668e672887dcac913015c629ec627ff6
c87e152078599f36c2b16edaa37803f2b571b76d
/super-devops-iam/super-devops-iam-security/src/main/java/com/wl4g/devops/iam/realm/SinaAuthorizingRealm.java
1695610a20077be9dacb0030359afdbbf05cf34e
[ "Apache-2.0" ]
permissive
weizai118/super-devops
a3ce4c8522f5e4b6f351a524e477390125e3f660
7eca21c9f0c8455cfa41be0cefbd25c16f274b2c
refs/heads/master
2020-08-01T13:36:17.894115
2019-09-25T08:59:31
2019-09-25T08:59:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,226
java
/* * Copyright 2017 ~ 2025 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 com.wl4g.devops.iam.realm; import org.apache.shiro.realm.AuthorizingRealm; import com.wl4g.devops.iam.authc.SinaAuthenticationToken; import com.wl4g.devops.iam.authc.credential.IamBasedMatcher; /** * This realm implementation acts as a CAS client to a CAS server for * authentication and basic authorization. * <p/> * This realm functions by inspecting a submitted * {@link org.apache.shiro.cas.CasToken CasToken} (which essentially wraps a CAS * service ticket) and validates it against the CAS server using a configured * CAS {@link org.jasig.cas.client.validation.TicketValidator TicketValidator}. * <p/> * The {@link #getValidationProtocol() validationProtocol} is {@code CAS} by * default, which indicates that a a * {@link org.jasig.cas.client.validation.Cas20ServiceTicketValidator * Cas20ServiceTicketValidator} will be used for ticket validation. You can * alternatively set or * {@link org.jasig.cas.client.validation.Saml11TicketValidator * Saml11TicketValidator} of CAS client. It is based on {@link AuthorizingRealm * AuthorizingRealm} for both authentication and authorization. User id and * attributes are retrieved from the CAS service ticket validation response * during authentication phase. Roles and permissions are computed during * authorization phase (according to the attributes previously retrieved). * * @since 1.2 */ public class SinaAuthorizingRealm extends Oauth2SnsAuthorizingRealm<SinaAuthenticationToken> { public SinaAuthorizingRealm(IamBasedMatcher matcher) { super(matcher); } }
[ "983708408@qq.com" ]
983708408@qq.com
1358c5601905623e5590c0f97174182beb6ac6eb
5a34e3550bdcd16d957d3bc7dddcf936f8771e1f
/src/test/java/org/scijava/util/DigestUtilsTest.java
4610931ae131ba6b8396af0d781473894025dca0
[ "BSD-2-Clause" ]
permissive
bonej-org/scijava-common
e3215721911c6c9d0eb2d1438887336020f04500
5768490c3f9e5e2e106b5faa242769f82b62851b
refs/heads/master
2020-12-11T07:38:39.859116
2017-05-06T01:47:46
2017-05-06T01:47:46
65,455,234
0
0
null
2016-08-11T09:05:23
2016-08-11T09:05:23
null
UTF-8
Java
false
false
6,562
java
/* * #%L * SciJava Common shared library for SciJava software. * %% * Copyright (C) 2009 - 2017 Board of Regents of the University of * Wisconsin-Madison, Broad Institute of MIT and Harvard, and Max Planck * Institute of Molecular Cell Biology and Genetics. * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * #L% */ package org.scijava.util; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import org.junit.Test; /** * Tests {@link DigestUtils}. * * @author Curtis Rueden */ public class DigestUtilsTest { private static final byte[] CAFEBABE_SHA1 = { 20, 101, -38, -47, 38, -45, 43, -9, -86, 93, 59, -107, -91, -57, -61, 49, -51, -1, 52, -33 }; private static final byte[] CAFEBABE_MD5 = { 45, 27, -67, -30, -84, -84, 10, -3, 7, 100, 109, -104, 21, 79, 64, 46 }; private static final byte[] HELLO_WORLD_SHA1 = { 123, 80, 44, 58, 31, 72, -56, 96, -102, -30, 18, -51, -5, 99, -99, -18, 57, 103, 63, 94 }; private static final String HELLO_WORLD_SHA1_HEX = "7b502c3a1f48c8609ae212cdfb639dee39673f5e"; private static final String CAFEBABE_SHA1_HEX = "1465dad126d32bf7aa5d3b95a5c7c331cdff34df"; private static final String HELLO_WORLD_SHA1_BASE64 = "e1AsOh9IyGCa4hLN+2Od7jlnP14="; private static final String CAFEBABE_SHA1_BASE64 = "FGXa0SbTK/eqXTuVpcfDMc3/NN8="; /** Tests {@link DigestUtils#bytes(String)}. */ @Test public void testBytesString() { final String s = "Hello world"; final byte[] bytes = DigestUtils.bytes(s); final byte[] expected = { 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100 }; assertArrayEquals(expected, bytes); } /** Tests {@link DigestUtils#bytes(int)}. */ @Test public void testBytesInt() { final byte[] bytes = DigestUtils.bytes(0xcafebabe); final byte[] expected = { -54, -2, -70, -66 }; assertArrayEquals(expected, bytes); } /** Tests {@link DigestUtils#hex(byte[])}. */ @Test public void testHex() { assertEquals("cafebabe", DigestUtils.hex(DigestUtils.bytes(0xcafebabe))); assertEquals("deadbeef", DigestUtils.hex(DigestUtils.bytes(0xdeadbeef))); assertEquals("00000000", DigestUtils.hex(DigestUtils.bytes(0x00000000))); assertEquals("ffffffff", DigestUtils.hex(DigestUtils.bytes(0xffffffff))); } /** Tests {@link DigestUtils#base64(byte[])}. */ @Test public void testBase64() { assertEquals("yv66vg==", DigestUtils.base64(DigestUtils.bytes(0xcafebabe))); assertEquals("3q2+7w==", DigestUtils.base64(DigestUtils.bytes(0xdeadbeef))); assertEquals("AAAAAA==", DigestUtils.base64(DigestUtils.bytes(0x00000000))); assertEquals("/////w==", DigestUtils.base64(DigestUtils.bytes(0xffffffff))); } /** Tests {@link DigestUtils#hash(String)}. */ @Test public void testHashString() { final byte[] hash = DigestUtils.hash("Hello world"); final byte[] expected = { -50, 89, -118, -92 }; assertArrayEquals(expected, hash); } /** Tests {@link DigestUtils#hash(byte[])}. */ @Test public void testHashBytes() { final byte[] bytes = DigestUtils.bytes("Hello world"); final byte[] hash = DigestUtils.hash(bytes); final byte[] expected = { -50, 89, -118, -92 }; assertArrayEquals(expected, hash); } /** Tests {@link DigestUtils#sha1(byte[])}. */ @Test public void testSHA1() { final byte[] bytes = DigestUtils.bytes(0xcafebabe); final byte[] sha1 = DigestUtils.sha1(bytes); assertArrayEquals(CAFEBABE_SHA1, sha1); } /** Tests {@link DigestUtils#md5(byte[])}. */ @Test public void testMD5() { final byte[] bytes = DigestUtils.bytes(0xcafebabe); final byte[] md5 = DigestUtils.md5(bytes); assertArrayEquals(CAFEBABE_MD5, md5); } /** Tests {@link DigestUtils#digest(String, byte[])}. */ @Test public void testDigest() { final byte[] bytes = DigestUtils.bytes(0xcafebabe); final byte[] sha1 = DigestUtils.digest("SHA-1", bytes); final byte[] expectedSHA1 = DigestUtils.sha1(bytes); assertArrayEquals(expectedSHA1, sha1); final byte[] md5 = DigestUtils.digest("MD5", bytes); final byte[] expectedMD5 = DigestUtils.md5(bytes); assertArrayEquals(expectedMD5, md5); } /** Tests {@link DigestUtils#best(String)}. */ @Test public void testBestString() { final byte[] best = DigestUtils.best("Hello world"); assertArrayEquals(HELLO_WORLD_SHA1, best); } /** Tests {@link DigestUtils#best(byte[])}. */ @Test public void testBestBytes() { final byte[] bytes = DigestUtils.bytes(0xcafebabe); final byte[] best = DigestUtils.best(bytes); assertArrayEquals(CAFEBABE_SHA1, best); } /** Tests {@link DigestUtils#bestHex(String)}. */ @Test public void testBestHexString() { assertEquals(HELLO_WORLD_SHA1_HEX, DigestUtils.bestHex("Hello world")); } /** Tests {@link DigestUtils#hex(byte[])}. */ @Test public void testBestHexBytes() { final byte[] bytes = DigestUtils.bytes(0xcafebabe); assertEquals(CAFEBABE_SHA1_HEX, DigestUtils.bestHex(bytes)); } /** Tests {@link DigestUtils#bestBase64(String)}. */ @Test public void testBestBase64String() { assertEquals(HELLO_WORLD_SHA1_BASE64, DigestUtils.bestBase64("Hello world")); } /** Tests {@link DigestUtils#bestBase64(byte[])}. */ @Test public void testBestBase64Bytes() { final byte[] bytes = DigestUtils.bytes(0xcafebabe); assertEquals(CAFEBABE_SHA1_BASE64, DigestUtils.bestBase64(bytes)); } }
[ "ctrueden@wisc.edu" ]
ctrueden@wisc.edu
fe17e07d64d95e66bafd9fc6dc79f1051edb0244
2eca9254d4f1097dce2dc6074401bc7e09e303b8
/cold-runner/src/consulo/cold/runner/execute/target/BuildPluginArtifactsTarget.java
082507ae9f853133a569e147ee53488d26e2077c
[ "Apache-2.0" ]
permissive
consulo/cold
5fec1ebf0c255d4654d3d6afdcf7e164cad80ece
cd699356c77cd241b03afbf6cc99617868002c00
refs/heads/master
2020-12-24T06:57:24.799382
2017-11-12T17:49:30
2017-11-12T17:49:30
56,103,234
0
0
null
null
null
null
UTF-8
Java
false
false
4,460
java
package consulo.cold.runner.execute.target; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.AbstractMap; import java.util.Map; import java.util.zip.ZipOutputStream; import org.apache.commons.compress.archivers.ArchiveEntry; import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream; import org.apache.commons.compress.utils.IOUtils; import org.jdom.Document; import org.jdom.Element; import org.jdom.JDOMException; import org.jdom.input.SAXBuilder; import org.jetbrains.annotations.NotNull; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.UserDataHolder; import com.intellij.openapi.util.io.FileUtilRt; import com.intellij.util.io.ZipUtil; import consulo.cold.runner.execute.ExecuteFailedException; import consulo.cold.runner.execute.ExecuteLogger; import consulo.cold.runner.execute.ExecuteTarget; /** * @author VISTALL * @since 09-Feb-17 */ public class BuildPluginArtifactsTarget implements ExecuteTarget { @Override public void execute(@NotNull ExecuteLogger executeLogger, @NotNull UserDataHolder executeContext) throws ExecuteFailedException { try { File workingDirectory = executeContext.getUserData(ExecuteTarget.WORKING_DIRECTORY); File distPath = new File(workingDirectory, "out/artifacts/dist"); if(!distPath.exists()) { executeLogger.error("'out/artifacts/dist' is not exists"); return; } File[] filePaths = distPath.listFiles(); if(filePaths == null) { return; } for(File pluginPath : filePaths) { // pair ID + NAME Map.Entry<String, String> pluginInfo = new AbstractMap.SimpleImmutableEntry<>(null, null); File libDir = new File(pluginPath, "lib"); if(!libDir.exists()) { throw new ExecuteFailedException("'lib' dir is not exists"); } File[] libs = libDir.listFiles(pathname -> Comparing.equal("jar", FileUtilRt.getExtension(pathname.getName()))); mainLoop: for(File someJar : libs) { ZipArchiveInputStream zipArchiveInputStream = new ZipArchiveInputStream(new FileInputStream(someJar)); ArchiveEntry entry = null; while((entry = zipArchiveInputStream.getNextEntry()) != null) { String name = entry.getName(); if(name.equals("META-INF/plugin.xml")) { byte[] data = IOUtils.toByteArray(zipArchiveInputStream); Map.Entry<String, String> temp = findPluginId(new ByteArrayInputStream(data)); if(temp != null) { pluginInfo = temp; } break mainLoop; } } zipArchiveInputStream.close(); } if(pluginInfo.getKey() == null && pluginInfo.getValue() == null) { throw new ExecuteFailedException("Path " + pluginPath + " is not plugin"); } if(pluginInfo.getKey() == null) { throw new ExecuteFailedException("Plugin with name: " + pluginInfo.getValue() + " don't have pluginId"); } if(pluginInfo.getValue() == null) { throw new ExecuteFailedException("Plugin with id: " + pluginInfo.getKey() + " don't have pluginName"); } if(!pluginInfo.getKey().equals(pluginPath.getName())) { throw new ExecuteFailedException(String.format("Plugin dir(%s) is not equal pluginId(%s)", pluginPath.getName(), pluginInfo.getKey())); } File zipFile = new File(distPath, pluginInfo.getKey() + "_" + executeContext.getUserData(ExecuteTarget.BUILD_NUMBER) + ".zip"); try(ZipOutputStream zipOutputStream = new ZipOutputStream(new FileOutputStream(zipFile))) { ZipUtil.addDirToZipRecursively(zipOutputStream, null, pluginPath, pluginInfo.getKey(), null, null); } } } catch(IOException e) { throw new ExecuteFailedException(e); } } private static Map.Entry<String, String> findPluginId(InputStream inputStream) throws IOException { String id = null; String name = null; try { SAXBuilder reader = new SAXBuilder(); Document document = reader.build(inputStream); Element rootElement = document.getRootElement(); Element temp = rootElement.getChild("id"); if(temp != null) { id = temp.getTextTrim(); } temp = rootElement.getChild("name"); if(temp != null) { name = temp.getTextTrim(); } } catch(JDOMException e) { throw new IOException(e); } return new AbstractMap.SimpleImmutableEntry<>(id, name); } }
[ "vistall.valeriy@gmail.com" ]
vistall.valeriy@gmail.com
9cb6f435fb991d8970976e5f9005dd0d1fc6bfb2
7f11edb96d0eacf0227faecdf34804adebd08265
/src/main/java/com/yzbbanban/tast/User2Task.java
84926f52dc9d435cec905c0cb7a5c9aafdc564da
[]
no_license
yzbbanban/uuabbsc
97399a42eb1e26a1d16458c64f611d9e3f8df07d
805cd31440ff95e1947b1c34c531bd259d4c959a
refs/heads/master
2020-03-22T02:42:28.853795
2018-09-03T15:35:29
2018-09-03T15:35:29
139,388,243
0
0
null
null
null
null
UTF-8
Java
false
false
2,496
java
package com.yzbbanban.tast; import com.google.common.collect.Lists; import com.yzbbanban.common.objectPool.GenericObjectPoolFactory; import com.yzbbanban.common.component.CallBack; import com.yzbbanban.common.component.QueueThreadUtils; import com.yzbbanban.domain.User; import org.apache.commons.pool2.impl.GenericObjectPool; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.List; /** * Created by ban on 2018/7/6. * * @author ban */ @Component @EnableScheduling public class User2Task implements CallBack<String, Integer> { @Autowired private QueueThreadUtils queueThreadUtils; private GenericObjectPool<User> pool; private GenericObjectPoolFactory<User> genericObjectPoolFactory = new GenericObjectPoolFactory<>(); // @Scheduled(cron = "0/10 * * * * ?") public void test() { pool = genericObjectPoolFactory.createObjectPool(User.class); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSS"); String time = format.format(Calendar.getInstance().getTime()); System.out.println("-------User2Task------>" + time); List<Integer> integerList = Lists.newArrayList(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100); try { queueThreadUtils.executeDataIn(11, integerList, this); } catch (Exception e) { e.printStackTrace(); } } @Override public void solve(String result, Integer info) { List<User> userList = Lists.newArrayList(); for (int i = 0; i < 100000; i++) { try { User u = pool.borrowObject(); // User u = new User(); u.setId(i); u.setName("banppppp22222ppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp" + i); u.setAge(i + 1); userList.add(u); //一定要回池 pool.returnObject(u); // returnObject(pool, u); } catch (Exception e) { e.printStackTrace(); } } // System.out.println("-------userList------>" + time + " c:" + pool.getCreatedCount() + ":" + userList); // System.out.println("-------userList------>" + userList); // getMemInfo(); } }
[ "yzbbanban@live.com" ]
yzbbanban@live.com
f91615ad9c027ace911793992b3d32d0743ecba2
0133d1fe8b0c6548fba9bcc0f06e35fb851c6d24
/doc/main-wa/java/com/hpe/cmwa/auditTask/controller/sjk/Yjkzsjzdyc_qgController.java
4fe3859af863746772933821b04584313ab92ea6
[]
no_license
libing070/vj
60d91d64624760775dfe6c68f539abb7c5c30151
4762d000fda7f10cb8a215d888d4f9b317eb4070
refs/heads/master
2022-08-24T01:53:38.841664
2020-01-17T12:05:42
2020-01-17T12:05:42
162,565,378
2
0
null
2022-08-05T05:00:58
2018-12-20T10:41:26
Vue
UTF-8
Java
false
false
3,913
java
package com.hpe.cmwa.auditTask.controller.sjk; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.hpe.cmwa.auditTask.service.sjk.Yjkzsjzdyc_qgService; import com.hpe.cmwa.common.Pager; import com.hpe.cmwa.controller.BaseController; import com.hpe.cmwa.util.HelperDate; /** *(全国) * @author yuzn1 */ @Controller @RequestMapping("/yjkzsjzdyc_qg/") public class Yjkzsjzdyc_qgController extends BaseController{ @Autowired private Yjkzsjzdyc_qgService yjkzsjzdyc_qgService; /** * 初始化界面 * @return */ @RequestMapping(value = "/index") public String index() { return "auditTask/sjk/yjkzsxgjzdyc_qg/yjkzsjzdyc_qg"; } /** * 柱形图 数据 * @param request * @return */ @ResponseBody @RequestMapping(value = "/load_column_chart") public List<Map<String, Object>> load_column_chart(HttpServletRequest request){ Map<String, Object> parameterMap = this.getParameterMap(request); //柱形图 , 地图 数据 List<Map<String, Object>> list_Column_map = yjkzsjzdyc_qgService.load_column_chart(parameterMap); return list_Column_map; } /** * 柱形图 数据 * * @param request * @return */ @ResponseBody @RequestMapping(value = "/load_map_chart") public List<Map<String, Object>> load_map_chart(HttpServletRequest request) { Map<String, Object> parameterMap = this.getParameterMap(request); // 柱形图 , 地图 数据 List<Map<String, Object>> list_Column_map = yjkzsjzdyc_qgService.load_map_chart(parameterMap); return list_Column_map; } /** *折线 * @param request * @return */ @ResponseBody @RequestMapping(value = "load_line_chart") public List<Map<String, Object>> load_line_chart(HttpServletRequest request) { Map<String, Object> params = this.getParameterMap(request); List<Map<String, Object>> list = yjkzsjzdyc_qgService.load_line_chart(formatParameter(params)); System.out.println("==================="+list.size()); return list; } /** * 汇总页-统计分析-趋势图-数据表 * @param response * @param request * @param pager * @return */ @RequestMapping(value = "load_table") @ResponseBody public Object load_table(HttpServletResponse response, HttpServletRequest request,Pager pager) { pager.setParams(formatParameter(this.getParameterMap(request))); List<Map<String, Object>> cityMapList = yjkzsjzdyc_qgService.load_table(pager); pager.setDataRows(cityMapList); return pager; } /** * 导出 汇总页-统计分析-趋势图-数据表 * @param response * @param request * @param pager * @return */ @ResponseBody @RequestMapping(value = "exportTable") public void exportTable(HttpServletRequest request, HttpServletResponse response) throws Exception { Map<String, Object> parameterMap = this.getParameterMap(request); yjkzsjzdyc_qgService.exportTable(request, response, parameterMap); } /** * <pre> * Desc 根据需要对页面参数进行格式化 * @param requestParamsMap * @author peter.fu * Nov 25, 2016 5:27:07 PM * </pre> */ private Map<String, Object> formatParameter(Map<String, Object> requestParamsMap) { if (requestParamsMap == null) { return null; } else { // 格式化时间等 for (String key : requestParamsMap.keySet()) { if (key.equals("currSumBeginDate") || key.equals("currSumEndDate") || key.equals("currDetBeginDate") || key.equals("currDetEndDate")) { HelperDate.formatDateStrToStr(requestParamsMap.get(key).toString(), "yyyyMM"); } } } return requestParamsMap; } }
[ "18680506315@163.com" ]
18680506315@163.com
55173c5ff08e4d7610393aca0998a9f845bc8c5c
8f9a319cef11a3013c72f6dcee8a0844d085b5ea
/arachnidium-app-model/src/test/java/com/github/arachnidium/web/google/SearchBar.java
b3287e535cb0970552a960a77c00d9b552354c61
[]
no_license
arjunbm13/arachnidium-java
fb201d15e412c07cdf1029716655d9aacd4b4daf
6366eb184e621c6c5dd3470eb4e47535a8b67a88
refs/heads/master
2021-01-14T10:03:25.380816
2015-04-15T22:04:48
2015-04-15T22:04:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package com.github.arachnidium.web.google; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import com.github.arachnidium.core.Handle; import com.github.arachnidium.model.common.FunctionalPart; import com.github.arachnidium.core.HowToGetByFrames; public class SearchBar<T extends Handle> extends FunctionalPart<T> implements IPerformsSearch{ @FindBy(name = "q") private WebElement searchInput; @FindBy(name="btnG") private WebElement searchButton; protected SearchBar(T handle, HowToGetByFrames path, By by) { super(handle, path, by); } @InteractiveMethod public void performSearch(String searchString) { searchInput.sendKeys(searchString); searchButton.click(); } }
[ "tichomirovsergey@gmail.com" ]
tichomirovsergey@gmail.com
bbae4d2f2bd512cdfae0275f18ef21be7c3e50b2
208ba847cec642cdf7b77cff26bdc4f30a97e795
/h/src/main/java/org.wp.h/models/CategoryModel.java
64dfb2238005ac1b829708b21d584127eacd763e
[]
no_license
kageiit/perf-android-large
ec7c291de9cde2f813ed6573f706a8593be7ac88
2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8
refs/heads/master
2021-01-12T14:00:19.468063
2016-09-27T13:10:42
2016-09-27T13:10:42
69,685,305
0
0
null
2016-09-30T16:59:49
2016-09-30T16:59:48
null
UTF-8
Java
false
false
2,205
java
package org.wp.h.models; import android.content.ContentValues; import android.database.Cursor; /** * Represents WordPress post Category data and handles local database (de)serialization. */ public class CategoryModel { // Categories table column names public static final String ID_COLUMN_NAME = "ID"; public static final String NAME_COLUMN_NAME = "name"; public static final String SLUG_COLUMN_NAME = "slug"; public static final String DESC_COLUMN_NAME = "description"; public static final String PARENT_ID_COLUMN_NAME = "parent"; public static final String POST_COUNT_COLUMN_NAME = "post_count"; public int id; public String name; public String slug; public String description; public int parentId; public int postCount; public boolean isInLocalTable; public CategoryModel() { id = -1; name = ""; slug = ""; description = ""; parentId = -1; postCount = 0; isInLocalTable = false; } /** * Sets data from a local database {@link Cursor}. */ public void deserializeFromDatabase(Cursor cursor) { if (cursor == null) return; id = cursor.getInt(cursor.getColumnIndex(ID_COLUMN_NAME)); name = cursor.getString(cursor.getColumnIndex(NAME_COLUMN_NAME)); slug = cursor.getString(cursor.getColumnIndex(SLUG_COLUMN_NAME)); description = cursor.getString(cursor.getColumnIndex(DESC_COLUMN_NAME)); parentId = cursor.getInt(cursor.getColumnIndex(PARENT_ID_COLUMN_NAME)); postCount = cursor.getInt(cursor.getColumnIndex(POST_COUNT_COLUMN_NAME)); isInLocalTable = true; } /** * Creates the {@link ContentValues} object to store this category data in a local database. */ public ContentValues serializeToDatabase() { ContentValues values = new ContentValues(); values.put(ID_COLUMN_NAME, id); values.put(NAME_COLUMN_NAME, name); values.put(SLUG_COLUMN_NAME, slug); values.put(DESC_COLUMN_NAME, description); values.put(PARENT_ID_COLUMN_NAME, parentId); values.put(POST_COUNT_COLUMN_NAME, postCount); return values; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
21e336f49f9a1e0b24f20616bf82e53d0f2491fc
f5570e50bd91b70498bd38217c02da9c0e26aa45
/app/src/main/java/GifViewer/load/model/GenericLoaderFactory.java
01d5760e6d87818515d563b539eb124b6b8e1b11
[]
no_license
dey2929/GifViewer
63707524a2800a32f073b133b29e35fdb0ac33b8
c31cf8c0d0cd2b697d0fa32fb9f63462ef6d6125
refs/heads/master
2021-01-19T01:25:03.408276
2016-07-11T09:06:11
2016-07-11T09:06:13
63,050,991
0
0
null
null
null
null
UTF-8
Java
false
false
5,512
java
package GifViewer.load.model; /** * Created by jabong on 7/7/16. */ import android.content.Context; import GifViewer.load.data.DataFetcher; import GifViewer.load.model.ModelLoader; import GifViewer.load.model.ModelLoaderFactory; import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class GenericLoaderFactory { private final Map<Class, Map<Class, ModelLoaderFactory>> modelClassToResourceFactories = new HashMap(); private final Map<Class, Map<Class, ModelLoader>> cachedModelLoaders = new HashMap(); private static final ModelLoader NULL_MODEL_LOADER = new ModelLoader() { public DataFetcher getResourceFetcher(Object model, int width, int height) { throw new NoSuchMethodError("This should never be called!"); } public String toString() { return "NULL_MODEL_LOADER"; } }; private final Context context; public GenericLoaderFactory(Context context) { this.context = context.getApplicationContext(); } public synchronized <T, Y> ModelLoaderFactory<T, Y> unregister(Class<T> modelClass, Class<Y> resourceClass) { this.cachedModelLoaders.clear(); ModelLoaderFactory result = null; Map resourceToFactories = (Map)this.modelClassToResourceFactories.get(modelClass); if(resourceToFactories != null) { result = (ModelLoaderFactory)resourceToFactories.remove(resourceClass); } return result; } public synchronized <T, Y> ModelLoaderFactory<T, Y> register(Class<T> modelClass, Class<Y> resourceClass, ModelLoaderFactory<T, Y> factory) { this.cachedModelLoaders.clear(); Object resourceToFactories = (Map)this.modelClassToResourceFactories.get(modelClass); if(resourceToFactories == null) { resourceToFactories = new HashMap(); this.modelClassToResourceFactories.put(modelClass, resourceToFactories); } ModelLoaderFactory previous = (ModelLoaderFactory)((Map)resourceToFactories).put(resourceClass, factory); if(previous != null) { Iterator i$ = this.modelClassToResourceFactories.values().iterator(); while(i$.hasNext()) { Map factories = (Map)i$.next(); if(factories.containsValue(previous)) { previous = null; break; } } } return previous; } /** @deprecated */ @Deprecated public synchronized <T, Y> ModelLoader<T, Y> buildModelLoader(Class<T> modelClass, Class<Y> resourceClass, Context context) { return this.buildModelLoader(modelClass, resourceClass); } public synchronized <T, Y> ModelLoader<T, Y> buildModelLoader(Class<T> modelClass, Class<Y> resourceClass) { ModelLoader result = this.getCachedLoader(modelClass, resourceClass); if(result != null) { return NULL_MODEL_LOADER.equals(result)?null:result; } else { ModelLoaderFactory factory = this.getFactory(modelClass, resourceClass); if(factory != null) { result = factory.build(this.context, this); this.cacheModelLoader(modelClass, resourceClass, result); } else { this.cacheNullLoader(modelClass, resourceClass); } return result; } } private <T, Y> void cacheNullLoader(Class<T> modelClass, Class<Y> resourceClass) { this.cacheModelLoader(modelClass, resourceClass, NULL_MODEL_LOADER); } private <T, Y> void cacheModelLoader(Class<T> modelClass, Class<Y> resourceClass, ModelLoader<T, Y> modelLoader) { Object resourceToLoaders = (Map)this.cachedModelLoaders.get(modelClass); if(resourceToLoaders == null) { resourceToLoaders = new HashMap(); this.cachedModelLoaders.put(modelClass, resourceToLoaders); } ((Map)resourceToLoaders).put(resourceClass, modelLoader); } private <T, Y> ModelLoader<T, Y> getCachedLoader(Class<T> modelClass, Class<Y> resourceClass) { Map resourceToLoaders = (Map)this.cachedModelLoaders.get(modelClass); ModelLoader result = null; if(resourceToLoaders != null) { result = (ModelLoader)resourceToLoaders.get(resourceClass); } return result; } private <T, Y> ModelLoaderFactory<T, Y> getFactory(Class<T> modelClass, Class<Y> resourceClass) { Map resourceToFactories = (Map)this.modelClassToResourceFactories.get(modelClass); ModelLoaderFactory result = null; if(resourceToFactories != null) { result = (ModelLoaderFactory)resourceToFactories.get(resourceClass); } if(result == null) { Iterator i$ = this.modelClassToResourceFactories.keySet().iterator(); while(i$.hasNext()) { Class registeredModelClass = (Class)i$.next(); if(registeredModelClass.isAssignableFrom(modelClass)) { Map currentResourceToFactories = (Map)this.modelClassToResourceFactories.get(registeredModelClass); if(currentResourceToFactories != null) { result = (ModelLoaderFactory)currentResourceToFactories.get(resourceClass); if(result != null) { break; } } } } } return result; } }
[ "deyanand2929@gmail.com" ]
deyanand2929@gmail.com
38a5737249109bad12648939515470a30eede5c4
e6c51943104fa6b1350935dd24e0e31fe04da406
/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/Bti7000DeviceDescriptionProvider.java
d779e0a9401bcadf81b3c896856e7f517a6e0f9d
[ "Apache-2.0" ]
permissive
onfsdn/atrium-onos
bf7feed533b4e210a47312cbf31c614e036375ac
cd39c45d4ee4b23bd77449ac326148d3f6a23ef4
refs/heads/support/atrium-16A
2021-01-17T22:06:52.781691
2016-02-09T18:13:31
2016-02-09T18:13:31
51,386,951
3
4
null
2016-07-19T19:28:21
2016-02-09T18:03:47
Java
UTF-8
Java
false
false
3,078
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.onosproject.provider.snmp.device.impl; import com.btisystems.mibbler.mibs.bti7000.bti7000_13_2_0.I_Device; import com.btisystems.mibbler.mibs.bti7000.bti7000_13_2_0._OidRegistry; import com.btisystems.pronx.ems.core.model.ClassRegistry; import com.btisystems.pronx.ems.core.model.IClassRegistry; import com.btisystems.pronx.ems.core.model.NetworkDevice; import com.btisystems.pronx.ems.core.snmp.ISnmpSession; import java.io.IOException; import java.util.Arrays; import org.onosproject.net.device.DefaultDeviceDescription; import org.onosproject.net.device.DeviceDescription; import org.slf4j.Logger; import static org.slf4j.LoggerFactory.getLogger; import org.snmp4j.smi.OID; /** * A vendor-specific implementation supporting BTI Systems BTI-7000 equipment. */ public class Bti7000DeviceDescriptionProvider implements SnmpDeviceDescriptionProvider { private final Logger log = getLogger(getClass()); protected static final IClassRegistry CLASS_REGISTRY = new ClassRegistry(_OidRegistry.oidRegistry, I_Device.class); private static final String UNKNOWN = "unknown"; @Override public DeviceDescription populateDescription(ISnmpSession session, DeviceDescription description) { NetworkDevice networkDevice = new NetworkDevice(CLASS_REGISTRY, session.getAddress().getHostAddress()); try { session.walkDevice(networkDevice, Arrays.asList(new OID[]{ CLASS_REGISTRY.getClassToOidMap().get( com.btisystems.mibbler.mibs.bti7000.bti7000_13_2_0.mib_2.System.class)})); com.btisystems.mibbler.mibs.bti7000.bti7000_13_2_0.mib_2.System systemTree = (com.btisystems.mibbler.mibs.bti7000.bti7000_13_2_0.mib_2.System) networkDevice.getRootObject().getEntity(CLASS_REGISTRY.getClassToOidMap().get( com.btisystems.mibbler.mibs.bti7000.bti7000_13_2_0.mib_2.System.class)); if (systemTree != null) { String[] systemComponents = systemTree.getSysDescr().split(";"); return new DefaultDeviceDescription(description.deviceUri(), description.type(), systemComponents[0], systemComponents[2], systemComponents[3], UNKNOWN, description.chassisId()); } } catch (IOException ex) { log.error("Error reading details for device {}.", session.getAddress(), ex); } return description; } }
[ "gerrit@onlab.us" ]
gerrit@onlab.us
b17d7233350bc40c25d7d09c88d8d631f1b74439
84eb7030b2b1edf17a2fe75c7113940f51532726
/app/src/main/java/com/zhongou/adapter/MapAttendListAdapter.java
5077261c74e1295eac646b7438ab35e062b01eda
[]
no_license
lsc949982212/ZOERP
21b5f4d4f016d6d44833e1e0e0be7e5621d2592e
0315aa33fb16ccaaca8eab793a6219a48659d24d
refs/heads/master
2020-08-09T19:09:45.685653
2019-10-11T10:46:03
2019-10-11T10:46:03
214,151,385
0
0
null
2019-10-10T10:16:59
2019-10-10T10:16:58
null
UTF-8
Java
false
false
2,411
java
package com.zhongou.adapter; import android.content.Context; import android.view.View; import android.widget.TextView; import com.nostra13.universalimageloader.core.DisplayImageOptions; import com.nostra13.universalimageloader.core.ImageLoader; import com.nostra13.universalimageloader.core.ImageLoaderConfiguration; import com.zhongou.R; import com.zhongou.base.BaseListAdapter; import com.zhongou.common.ImageLoadingConfig; import com.zhongou.model.MapAttendModel; import java.util.Random; /** * 地图考勤 适配 * * @author */ public class MapAttendListAdapter extends BaseListAdapter { private ImageLoader imgLoader; private DisplayImageOptions imgOptions; public class WidgetHolder { TextView tv_local; TextView tv_time; } public MapAttendListAdapter(Context context) { super(context); imgLoader = ImageLoader.getInstance(); imgLoader.init(ImageLoaderConfiguration.createDefault(context)); imgOptions = ImageLoadingConfig.generateDisplayImageOptions(R.mipmap.ic_launcher); } @Override protected View inflateConvertView() { //一条记录的布局 View view = inflater.inflate(R.layout.item_mapattendrecord, null); //该布局上的控件 WidgetHolder holder = new WidgetHolder(); holder.tv_local = (TextView) view.findViewById(R.id.tv_local); holder.tv_time = (TextView) view.findViewById(R.id.tv_time); view.setTag(holder); return view; } @Override protected void initViewData(final int position, View convertView) { WidgetHolder holder = (WidgetHolder) convertView.getTag();//获取控件管理实例 //获取一条信息 //?java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.yvision.model.VisitorBModel MapAttendModel model = (MapAttendModel) entityList.get(position); holder.tv_local.setText(model.getAddress()); holder.tv_time.setText(model.getAttendCapTime()); } //设置一条记录的随机颜色 private int randomColor(){ int [] colorArray = new int[]{R.color.pink,R.color.lightgreen,R.color.gray,R.color.yellow,R.color.common_color,R.color.aquamarine,R.color.brown}; return colorArray[new Random().nextInt(6)]; } public void destroy() { imgLoader.clearMemoryCache(); imgLoader.destroy(); } }
[ "sjy0118atsn@163.com" ]
sjy0118atsn@163.com
328c23fb652263ea691cefe3d48422b0b5e74ee8
29b71940edd98b7e016fcdfee832200ed7803568
/ASMAIL/Java_2EE_Example/MyMagasin/src/model/Television.java
22a7ee97b1c59fe75f2cec7d6427619675986635
[]
no_license
manelBHM/java
257771a08eb49f9003d25fdbdc5b5fe0794f3682
a5e5e1e91ca5b709360bd2348d357e29a6c24e03
refs/heads/master
2022-12-25T07:27:29.668413
2019-06-04T08:05:53
2019-06-04T08:05:53
158,882,973
0
5
null
2022-12-16T00:54:49
2018-11-23T22:26:13
HTML
UTF-8
Java
false
false
473
java
package model; public class Television extends Product { public int model; public Television(String name, String desc, int model, double price) { super(name, desc, price); this.model = model; } public int getModel() { return model; } public void setModel(int model) { this.model = model; } public void buy() { System.out.println("Info Product - Name: "+this.getName()+ " Desc: "+this.getDescription()+ " Price: "+this.getPrice()+ " Model: "+this.getModel()); } }
[ "imdrmas@gmail.com" ]
imdrmas@gmail.com
9d0873a3b0e6fb83ca0e203c7564e4dbac65037e
fd9ac605cea95712db89ba12692e72f115eec5ed
/src/fsGuns/recipe/RecipeHanger_Manager.java
ad5503f96f32556f33d0b968305d003896b4702a
[ "Unlicense" ]
permissive
fstabin/fsGuns
67cae39e51d548d47eb716631a9e2a64fdb95579
e27768a60f9e8ed37f27f81f4d1d69f4a885d889
refs/heads/master
2021-05-06T12:07:05.899383
2017-12-06T03:06:01
2017-12-06T03:06:01
113,020,793
0
0
null
null
null
null
UTF-8
Java
false
false
498
java
package fsGuns.recipe; import java.util.HashMap; import java.util.Map; import org.bukkit.NamespacedKey; public class RecipeHanger_Manager { Map<NamespacedKey, RecipeHanger> mrec; public RecipeHanger_Manager() { mrec = new HashMap<NamespacedKey, RecipeHanger>(); } //key = "namespace:" + "name" public void addRecipieHanger(NamespacedKey key,RecipeHanger recipie) { mrec.put(key, recipie); } public RecipeHanger getRecipeHanger(NamespacedKey key) { return mrec.get(key); } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
b8af6fb318b0ac57798e3f147fddd735653e0e2b
1057e1a99a88fb8055d783324db04f86ef670636
/app/src/main/java/com/aite/a/activity/FavoriteListFargmentActivity.java
57db45624432096c646c1912659e72dfe466cb2c
[]
no_license
surpreme/JiananMall1.0.3
ffcd72ece5b43b398daaf3061f7fa9044d157043
d5cd2659248200aeccc3b117dc62cb2d48fa621b
refs/heads/master
2020-12-07T21:05:55.729096
2019-10-31T10:17:19
2019-10-31T10:17:19
232,801,112
0
0
null
null
null
null
UTF-8
Java
false
false
5,899
java
package com.aite.a.activity; import java.util.ArrayList; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentPagerAdapter; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.util.DisplayMetrics; import android.view.Display; import android.view.View; import android.view.animation.Animation; import android.view.animation.TranslateAnimation; import android.widget.ImageView; import android.widget.TextView; import com.aiteshangcheng.a.R; import com.aite.a.base.BaseFargmentActivity; import com.aite.a.fargment.FavoriteFargment; /** * 收藏列表 * * @author CAOYOU * */ public class FavoriteListFargmentActivity extends BaseFargmentActivity { private ImageView roller; // 动画滚动图片 private int imageWidth; private int offset = 0; // 图片偏移量 private int currentIndex = 0; // 当前页卡编号 private ViewPager viewPager; private ArrayList<Fragment> fragmentList; // 装载显示内容 private TextView goods_tx; private TextView store_tx; private ImageView iv_back; private ImageView iv_right; private TextView tv_name; private TextView _tx_right; private FavoriteFargment goodsFargment; private FavoriteFargment storeFargment; public ArrayList<Fragment> getFragmentList() { return fragmentList; } @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); setContentView(R.layout.favorite_list_activity); findViewById(); initView(); initCursor(2); } protected void findViewById() { iv_back = (ImageView) findViewById(R.id._iv_back); iv_back.setOnClickListener(new MyOnclickListener()); iv_right = (ImageView) findViewById(R.id._iv_right); iv_right.setOnClickListener(new MyOnclickListener()); _tx_right = (TextView) findViewById(R.id._tx_right); // _tx_right.setVisibility(View.VISIBLE); _tx_right.setText(getI18n(R.string.edit)); _tx_right.setTextColor(getResources().getColor(R.color.white)); _tx_right.setOnClickListener(new MyOnclickListener()); tv_name = (TextView) findViewById(R.id._tv_name); tv_name.setText(getI18n(R.string.collection_list)); roller = (ImageView) findViewById(R.id.goods_list_iv_cursor); goods_tx = (TextView) findViewById(R.id.goods_tx); store_tx = (TextView) findViewById(R.id.store_tx); viewPager = (ViewPager) findViewById(R.id.favorite_list_viewpager); goods_tx.setOnClickListener(new MyOnclickListener(0)); store_tx.setOnClickListener(new MyOnclickListener(1)); } @SuppressWarnings("static-access") private void initView() { fragmentList = new ArrayList<Fragment>(); viewPager = (ViewPager) findViewById(R.id.favorite_list_viewpager); goodsFargment = new FavoriteFargment().newInstance(1); storeFargment = new FavoriteFargment().newInstance(2); fragmentList.add(goodsFargment); fragmentList.add(storeFargment); } /** * 根据tagd的数量初始化游标的位置 * * @param tagNum */ public void initCursor(int tagNum) { imageWidth = BitmapFactory.decodeResource(getResources(), R.drawable.cursor).getWidth(); DisplayMetrics displayMetrics = getResources().getDisplayMetrics(); Display display = getWindowManager().getDefaultDisplay(); display.getMetrics(displayMetrics); offset = (displayMetrics.widthPixels / tagNum - imageWidth) / 2; Matrix matrix = new Matrix(); matrix.postTranslate(offset, 0); roller.setImageMatrix(matrix); viewPager.setAdapter(new MyPagerAdapter(getSupportFragmentManager(), fragmentList)); viewPager.setOffscreenPageLimit(2); viewPager.setOnPageChangeListener(new PageChangeListener()); Bundle bundle = getIntent().getExtras(); if (bundle != null) { if (bundle.getInt("i", 0) == 1) { viewPager.setCurrentItem(0); } else { viewPager.setCurrentItem(1); } } else { viewPager.setCurrentItem(0); } } class PageChangeListener implements OnPageChangeListener { int one = offset * 2 + imageWidth; // 一个页卡占的偏移量 @Override public void onPageSelected(int position) { Animation animation = new TranslateAnimation(one * currentIndex, one * position, 0, 0); currentIndex = position; animation.setFillAfter(true); animation.setDuration(300); roller.startAnimation(animation); switch (position) { case 0: goods_tx.setTextColor(getResources().getColor(R.color.cursor_text)); store_tx.setTextColor(getResources().getColor(R.color.black)); break; case 1: goods_tx.setTextColor(getResources().getColor(R.color.black)); store_tx.setTextColor(getResources().getColor(R.color.cursor_text)); break; } } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { // 当前页面被滑动时调用 } @Override public void onPageScrollStateChanged(int arg0) { // 当前状态改变时调用 } } class MyPagerAdapter extends FragmentPagerAdapter { ArrayList<Fragment> list; public MyPagerAdapter(FragmentManager fm, ArrayList<Fragment> list) { super(fm); // 必须调用 this.list = list; } @Override public Fragment getItem(int arg0) { return list.get(arg0); } @Override public int getCount() { return list.size(); } } private boolean is_compile; class MyOnclickListener implements View.OnClickListener { int index = 0; public MyOnclickListener() { super(); } public MyOnclickListener(int i) { this.index = i; } @Override public void onClick(View v) { switch (v.getId()) { case R.id.store_tx: viewPager.setCurrentItem(index); break; case R.id.goods_tx: viewPager.setCurrentItem(index); break; case R.id._iv_back: finish(); break; case R.id._tx_right: goodsFargment.goodsAdapter.isShow(); break; } } } }
[ "1740747328@qq.com" ]
1740747328@qq.com
9388270b40705a4d9841f90254ad1ce805ae7df1
28b75c5263d4d03398de7cedbdf59a75bae8f2ce
/reservations-service/src/main/java/io/agilehandy/reservation/flight/Flight.java
f70b64f8c275325165f93e0225e1c667328c3656
[]
no_license
Haybu/RA-OAuth2-Gen1
1392e08d4bd03078c327dcd1691edae43231f1db
09807df6cdd75748741b7136e24988a900605cfd
refs/heads/master
2020-03-29T06:59:22.455703
2018-09-20T21:48:35
2018-09-20T21:48:35
149,648,773
0
0
null
null
null
null
UTF-8
Java
false
false
1,371
java
/* * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.agilehandy.reservation.flight; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; import lombok.ToString; import java.io.Serializable; import java.util.Date; /** * @author Haytham Mohamed */ @Data @NoArgsConstructor @AllArgsConstructor @ToString public class Flight implements Serializable { private Long id; private String nbr; private String airline; private String origin; private String destination; private Integer stops; private Double price; private Integer capacity; private String plane; @JsonFormat(pattern="yyyy-MM-dd") private Date departure; @JsonFormat(pattern="yyyy-MM-dd") private Date arrival; }
[ "haybu@hotmail.com" ]
haybu@hotmail.com
6412e1c2ffcf57820cc475374b02e748a966a4c2
56ca291048e226509d5d259efc5bfe03a43445ac
/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/ChildNode.java
954bc4840b7fa14b6620b1ca8eeb8c49b5945435
[ "BSD-3-Clause" ]
permissive
Scootkali14001/chromium
7a5259716eb124a72a3b689c9ba552b1e48fa882
b922abbb37d7651bc553bfd8dda3fb7c1071950d
refs/heads/master
2023-03-04T09:35:05.533934
2018-06-06T14:10:32
2018-06-06T14:10:32
136,340,614
1
0
null
2018-06-06T14:28:21
2018-06-06T14:28:21
null
UTF-8
Java
false
false
3,697
java
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.ntp.cards; import android.support.annotation.Nullable; import org.chromium.chrome.browser.modelutil.ListObservable; import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback; /** * A node in the tree that has a parent and can notify it about changes. * * This class mostly serves as a convenience base class for implementations of {@link TreeNode}. */ public abstract class ChildNode extends ListObservable<PartialBindCallback> implements TreeNode { private int mNumItems = 0; @Override public int getItemCount() { assert mNumItems == getItemCountForDebugging() : "cached number of items: " + mNumItems + "; actual number of items: " + getItemCountForDebugging(); return mNumItems; } @Override protected void notifyItemRangeChanged( int index, int count, @Nullable PartialBindCallback callback) { assert isRangeValid(index, count); super.notifyItemRangeChanged(index, count, callback); } // TODO(bauerb): Push these convenience methods to the base class once they're only called // from subclasses. protected void notifyItemRangeChanged(int index, int count) { notifyItemRangeChanged(index, count, null); } @Override protected void notifyItemRangeInserted(int index, int count) { mNumItems += count; assert mNumItems == getItemCountForDebugging(); assert isRangeValid(index, count); super.notifyItemRangeInserted(index, count); } @Override protected void notifyItemRangeRemoved(int index, int count) { assert isRangeValid(index, count); mNumItems -= count; assert mNumItems == getItemCountForDebugging(); super.notifyItemRangeRemoved(index, count); } protected void notifyItemChanged(int index, @Nullable PartialBindCallback callback) { notifyItemRangeChanged(index, 1, callback); } /** * @deprecated Change notifications without payload recreate the view holder. Is that on * purpose? Use {@link #notifyItemChanged(int, PartialBindCallback)} if the item to be notified * should not be entirely replaced. (see https://crbug.com/704130) */ @Deprecated // Can be valid in specific cases, but marked as deprecated to provide the warning. protected void notifyItemChanged(int index) { notifyItemRangeChanged(index, 1); } protected void notifyItemInserted(int index) { notifyItemRangeInserted(index, 1); } protected void notifyItemRemoved(int index) { notifyItemRangeRemoved(index, 1); } protected void checkIndex(int position) { if (!isRangeValid(position, 1)) { throw new IndexOutOfBoundsException(position + "/" + getItemCount()); } } private boolean isRangeValid(int index, int count) { // Uses |mNumItems| to be able to call the method when checking deletion range, as we still // have the previous number of items. return index >= 0 && index + count <= mNumItems; } /** * @return The actual (non-cached) number of items under this node. The implementation of this * method should not rely on {@link #getItemCount}, but instead derive the number of items * directly from the underlying data model. Any time this value changes, an appropriate * notification should be sent. */ protected abstract int getItemCountForDebugging(); }
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
ab7ee2e53d316e3ad6a8b3f37c7c1438bb67ce3b
ed5159d056e98d6715357d0d14a9b3f20b764f89
/src/irvine/oeis/a021/A021108.java
0b3225cf96fdb3549bc4952abd275a27b4b32793
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
342
java
package irvine.oeis.a021; import irvine.oeis.PeriodicSequence; import irvine.oeis.PrependSequence; /** * A021108 Decimal expansion of 1/104. * @author Sean A. Irvine */ public class A021108 extends PrependSequence { /** Construct the sequence. */ public A021108() { super(new PeriodicSequence(6, 1, 5, 3, 8, 4), 0, 0, 9); } }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
c7e3a649643e11c1a5f9005488ccf62e13c90268
d691183b432441e9fbda6b28d9d52f284798924c
/subprojects/griffon-pivot/src/main/java/griffon/pivot/support/adapters/TextAreaBindingAdapter.java
7287df114743a2d450759bdc7086df32220f666d
[ "Apache-2.0" ]
permissive
aalmiray/griffon2
70c0d0e2cc9abb604e77b8fd426b8fbf5689204b
f3d230ce06d148b40746646bc28615dc73b603d7
refs/heads/master
2023-09-01T20:25:16.249310
2014-02-24T20:02:11
2014-02-24T20:02:11
14,066,577
3
2
null
null
null
null
UTF-8
Java
false
false
2,452
java
/* * Copyright 2008-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package griffon.pivot.support.adapters; import griffon.core.CallableWithArgs; /** * @author Andres Almiray * @since 2.0.0 */ public class TextAreaBindingAdapter implements GriffonPivotAdapter, org.apache.pivot.wtk.TextAreaBindingListener { private CallableWithArgs<Void> textKeyChanged; private CallableWithArgs<Void> textBindTypeChanged; private CallableWithArgs<Void> textBindMappingChanged; public CallableWithArgs<Void> getTextKeyChanged() { return this.textKeyChanged; } public CallableWithArgs<Void> getTextBindTypeChanged() { return this.textBindTypeChanged; } public CallableWithArgs<Void> getTextBindMappingChanged() { return this.textBindMappingChanged; } public void setTextKeyChanged(CallableWithArgs<Void> textKeyChanged) { this.textKeyChanged = textKeyChanged; } public void setTextBindTypeChanged(CallableWithArgs<Void> textBindTypeChanged) { this.textBindTypeChanged = textBindTypeChanged; } public void setTextBindMappingChanged(CallableWithArgs<Void> textBindMappingChanged) { this.textBindMappingChanged = textBindMappingChanged; } public void textKeyChanged(org.apache.pivot.wtk.TextArea arg0, java.lang.String arg1) { if (textKeyChanged != null) { textKeyChanged.call(arg0, arg1); } } public void textBindTypeChanged(org.apache.pivot.wtk.TextArea arg0, org.apache.pivot.wtk.BindType arg1) { if (textBindTypeChanged != null) { textBindTypeChanged.call(arg0, arg1); } } public void textBindMappingChanged(org.apache.pivot.wtk.TextArea arg0, org.apache.pivot.wtk.TextArea.TextBindMapping arg1) { if (textBindMappingChanged != null) { textBindMappingChanged.call(arg0, arg1); } } }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
cc1c0711307cc6e13c49101907ee6437cd638b77
3650ed995c0c1a3835e1905a66bc45d8850d2be0
/maxdenytcz/src/com/taocz/citystory/txweibo/exceptions/QweibosdkException.java
14509f0dddafafd48e3422b6e0f89125f57660f4
[]
no_license
maxdeny/test
7d38f42296822dc4174e25f2e056ef09c2374d9f
1408429cbf5cc896cf4dfaeb21c6c6faaa9932c7
refs/heads/master
2021-01-10T07:25:33.543500
2016-04-08T06:00:10
2016-04-08T06:00:10
55,743,264
0
0
null
null
null
null
UTF-8
Java
false
false
824
java
package com.taocz.citystory.txweibo.exceptions; /** * 用于记录针对 QweiboSDK 的异常信息 */ public class QweibosdkException extends Exception { private static final long serialVersionUID = -1096752997048057364L; private String errcode; private String errmsg; /** * @param errcode * @param errmsg */ public QweibosdkException(String errcode, String errmsg) { super(); this.errcode = errcode; this.errmsg = errmsg; } public String getErrcode() { return errcode; } public void setErrcode(String errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } }
[ "iamzhuolei@gmail.com" ]
iamzhuolei@gmail.com
c069f2e432a561295b81b6e9d94ac8629cc0a2c7
fe0b6d0d4c14965808a4b38aa91d0c5cef1f69f6
/languages/elevator/org.tetrabox.example.xelevator.scenario/src/org/tetrabox/example/xelevator/scenario/xelevatorscenario/XElevatorProperty/impl/ButtonPressPropertyImpl.java
66b1d5d79ac7ac20a6dd44b8193b1e7247681de5
[]
no_license
tetrabox/examples-behavioral-interface
f05b9bf1d3a8414ffc5eef3560f72f3719e09f28
3a5df4b8ec4ed13a39712269487f07d09479ec99
refs/heads/master
2020-12-02T16:23:03.869890
2019-10-22T08:59:20
2019-10-22T08:59:20
96,529,344
0
1
null
null
null
null
UTF-8
Java
false
false
1,519
java
/** */ package org.tetrabox.example.xelevator.scenario.xelevatorscenario.XElevatorProperty.impl; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EOperation; import org.tetrabox.example.xelevator.elevator.Button; import org.tetrabox.example.xelevator.scenario.xelevatorscenario.XElevatorProperty.ButtonPressProperty; import org.tetrabox.example.xelevator.scenario.xelevatorscenario.XElevatorProperty.XElevatorPropertyPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Button Press Property</b></em>'. * <!-- end-user-doc --> * * @generated */ public class ButtonPressPropertyImpl extends XElevatorStepPropertyImpl<Button> implements ButtonPressProperty { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ButtonPressPropertyImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return XElevatorPropertyPackage.Literals.BUTTON_PRESS_PROPERTY; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EOperation getOperation() { java.util.Iterator<EOperation> it = org.tetrabox.example.xelevator.elevator.ElevatorPackage.Literals.BUTTON.getEOperations().iterator(); EOperation result = null; while (it.hasNext() && result == null) { EOperation op = it.next(); if (op.getName().equals("press")) { result = op; } } return result; } } //ButtonPressPropertyImpl
[ "dorian.leroy@irisa.fr" ]
dorian.leroy@irisa.fr
993e556dc94794490efe3d788d4c9b94a5a7982a
c6e5e082b4c485bc0cecc2dfb4dffa2337e1057c
/src/main/java/com/github/yingzhuo/fastdfs/springboot/domain/proto/storage/enums/StorageMetadataSetType.java
175c90a839cd32dc9e72673b597a2b3cb2b43ecb
[ "Apache-2.0" ]
permissive
yingzhuo/fastdfs-spring-boot-starter
70d2498ac5ea1ddafe099ed12d4e3c4e4ce47b97
66e07e6c796bba07929fb8700ca5507c280ba1c0
refs/heads/main
2023-03-28T19:36:41.398659
2021-03-12T07:35:28
2021-03-12T07:35:28
346,890,358
0
0
null
null
null
null
UTF-8
Java
false
false
531
java
package com.github.yingzhuo.fastdfs.springboot.domain.proto.storage.enums; /** * 元数据设置方式 * * @author tobato */ public enum StorageMetadataSetType { /** * 覆盖 */ STORAGE_SET_METADATA_FLAG_OVERWRITE((byte) 'O'), /** * 没有的条目增加,有则条目覆盖 */ STORAGE_SET_METADATA_FLAG_MERGE((byte) 'M'); private byte type; private StorageMetadataSetType(byte type) { this.type = type; } public byte getType() { return type; } }
[ "yingzhor@gmail.com" ]
yingzhor@gmail.com
7a6c590574dd70bc641fadb6000ff3509b5245e0
36db8ea6d43f04fd15b3168bcbdf1c86147f0dc6
/ali-pay-web/src/main/java/com/panli/alipay/TradeNotifyControl.java
be5d3336c8ab39602a54245d647b6a7e4157b888
[]
no_license
sunning9001/AllInOneSample
79685de54a8af2f85b1bf6d5dea93d8e8d4602f7
e5809b840d125e801989d60aab770c43d0648cc8
refs/heads/master
2022-12-22T21:13:30.880178
2020-11-10T08:10:13
2020-11-10T08:10:13
96,510,636
0
0
null
2022-12-16T03:08:00
2017-07-07T07:14:52
Java
UTF-8
Java
false
false
3,268
java
package com.panli.alipay; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import javax.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.request.WebRequest; import com.alibaba.fastjson.JSONObject; import com.alipay.api.AlipayApiException; import com.alipay.api.internal.util.AlipaySignature; import com.panli.alipay.util.AlipayConfig; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool; @RestController public class TradeNotifyControl { /** * notify_id 在redis的存储键 */ private final String ALIPAY_NOTIFY_ID = "ALIPAY_NOTIFY_ID"; /** * 通知校验Id */ private final String parameter_notify_id = "notify_id"; @Autowired private JedisPool jedisPool; private Logger logger = org.slf4j.LoggerFactory.getLogger(TradeNotifyControl.class); /** * 支付宝异步回调接口 * * @param response * @param request */ @RequestMapping("/trade_notify") public void trade_notify(HttpServletResponse response, WebRequest request) { Map<String, String> parametersMap = new HashMap<>(); Iterator<String> parameterNames = request.getParameterNames(); while (parameterNames.hasNext()) { String parameterName = parameterNames.next(); parametersMap.putIfAbsent(parameterName, request.getParameter(parameterName)); } logger.debug(" trade_notify jsonString :{}", JSONObject.toJSON(parametersMap)); // 调用SDK验证签名 boolean signVerified; Jedis jedis = null; try { signVerified = AlipaySignature.rsaCheckV1(parametersMap, AlipayConfig.alipay_public_key, AlipayConfig.charset, AlipayConfig.sign_type); // 验证签名成功 if (signVerified) { // 判断是否已经处理该消息 String parameterNotifyId = parametersMap.get(parameter_notify_id); if (parameterNotifyId != null) { jedis = jedisPool.getResource(); String parameterJson = jedis.get(ALIPAY_NOTIFY_ID + parameterNotifyId); //第一次通知 if(parameterJson ==null) { jedis.set(ALIPAY_NOTIFY_ID + parameterNotifyId, JSONObject.toJSONString(parametersMap)); logger.debug(" trade_notify set to redis , key = {} ,value ={ }",parameterNotifyId,parameterJson); //通知alipay success response.getOutputStream().write("success".getBytes()); response.getOutputStream().flush(); response.getOutputStream().close(); }else { //多次通知 logger.debug(" trade_notify find notify id in redis , key = {} ,value ={ }",parameterNotifyId,parameterJson); } } else { logger.debug(" trade_notify parse error, can not find notify id"); } } else { // 记录验证签名失败 logger.debug(" trade_notify Verified Fail :{}", JSONObject.toJSON(parametersMap)); } } catch (AlipayApiException e) { logger.debug(" trade_notify AlipayApiException :{}", e); } catch (IOException e) { logger.debug(" trade_notify IOException :{}", e); }finally { if(jedis!=null) { jedis.close(); } } } }
[ "sunning@auto-fis.com" ]
sunning@auto-fis.com
cba976c7d50f207d9c8def24ae75cfd028d8b1bd
5aaeb916752023ae1033cb434b3475237d3fe631
/hubotek/src/org/hubotek/model/cse/attributes/AttributeTypeEnum.java
66a2fcf719b930992f7fc7040875199514b24077
[]
no_license
josecarloscanova/hubotek
308e37b8aced4de0e4281b5fa978ccb77a41d2c7
1a649bc329115eec351800bb36d809f71452bcd2
refs/heads/master
2020-12-25T14:14:42.018591
2016-10-03T20:31:44
2016-10-03T20:31:44
66,493,198
0
1
null
2016-09-13T14:04:35
2016-08-24T19:28:14
HTML
UTF-8
Java
false
false
197
java
package org.hubotek.model.cse.attributes; public enum AttributeTypeEnum { DEFAULT_QUERY_PARAMETER, QUERY_PARAMETER, HEADER_PARAMETER; private AttributeTypeEnum(){} }
[ "jose.carlos.canova@gmail.com" ]
jose.carlos.canova@gmail.com
86620756ca090153d4b8bb997d2b76b099844478
c2c6d3edf03c29ea0009bc7e3169c7f96b5f9c59
/chapter5/src/main/java/com/course/testng/suite/PayTest.java
a13834e44b6fd86a8fa0cf4dbad1c1bc51beaa88
[]
no_license
lucky-star-2020/AutoTest
f65756e084bc3274778090d56d574a724e538cf8
bb315ce533e2ebf179e682fbc5aa3725e82a03d8
refs/heads/master
2023-05-11T02:30:23.785552
2020-07-21T09:43:37
2020-07-21T09:43:37
278,288,178
0
0
null
2023-05-09T18:49:33
2020-07-09T06:59:37
Java
UTF-8
Java
false
false
278
java
package com.course.testng.suite; import org.testng.annotations.Test; public class PayTest { @Test public void PayTest1(){ System.out.println("支付成功2"); } @Test public void PayTest2(){ System.out.println("支付成功2"); } }
[ "your email" ]
your email
9d318b480c5b00c621e815eafb03d8aac17b09c0
460805f5ce256852e96da8a02dadc4a220313901
/original-java/com/ifengyu/intercom/b/c.java
d84fd492fb9248b3824931850503fa0e43213679
[]
no_license
Mi-Walkie-Talkie-by-Darkhorse/Mi-Walkie-Talkie-Plus
bab78cd8cea85af901d1bab6dc9f68f673727419
d47857800bb3a9f1deae5b4b6c6a3c44c1a78748
refs/heads/2.9.34-plus
2023-05-29T20:00:38.390971
2022-02-22T11:03:47
2022-02-22T11:03:47
221,777,793
49
10
null
2019-12-13T12:13:29
2019-11-14T20:07:47
Smali
UTF-8
Java
false
false
352
java
package com.ifengyu.intercom.b; import android.os.Build.VERSION; /* compiled from: APIUtils */ public final class c { public static boolean a() { return VERSION.SDK_INT >= 21; } public static boolean b() { return VERSION.SDK_INT >= 23; } public static boolean c() { return VERSION.SDK_INT >= 24; } }
[ "Mi-Walkie-Talkie-by-Darkhorse@der-ball-ist-rund.net" ]
Mi-Walkie-Talkie-by-Darkhorse@der-ball-ist-rund.net
58e9e4efb42447d0dd612afff698a63d28ec8904
9ebd03126f42351050dfaa4f2e51c16bb12f3884
/src/mx/ipn/cidetec/virtual/entities/EvaluacionCriterio.java
def4773fb85b46837493c59061c04c29a2e77d84
[]
no_license
sergioceron/control
2917e9cdf10cb8abd18ec539dfc17dc6bb696aea
32d8cb49ba3a7e2c548caf1923e2fd7124cb4cc3
refs/heads/master
2020-04-06T06:29:12.518344
2016-04-13T03:11:36
2016-04-13T03:11:36
23,526,801
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
package mx.ipn.cidetec.virtual.entities; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; /** * Created by sergio on 12/06/2014. */ @Entity public class EvaluacionCriterio { private Long id; private String texto; private String categoria; @Id @GeneratedValue(strategy= GenerationType.AUTO) public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTexto() { return texto; } public void setTexto(String texto) { this.texto = texto; } public String getCategoria() { return categoria; } public void setCategoria(String categoria) { this.categoria = categoria; } }
[ "sceronf@gmail.com" ]
sceronf@gmail.com
1d15000dc20490c8bb2b2f8f0b7ecebe4c6e0c26
3dc737a1d2bfe3b53724616ef6b88038b4e6cdb9
/src/main/java/com/microsoft/graph/models/generated/Enablement.java
8e027f08d5c76ddfe43c6243e6d1db1876474669
[ "MIT" ]
permissive
kitherill/msgraph-sdk-java
2a549e1b65f8d1fdf509eacb048d6fffabaa597b
16cfeb7675cb311a8af9c6272915b96f718a1e5d
refs/heads/dev
2021-07-03T00:56:33.097329
2020-04-20T16:16:48
2020-04-20T16:16:48
159,879,325
0
1
MIT
2020-04-20T16:16:50
2018-11-30T21:13:51
Java
UTF-8
Java
false
false
670
java
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.models.generated; /** * The Enum Enablement. */ public enum Enablement { /** * not Configured */ NOT_CONFIGURED, /** * enabled */ ENABLED, /** * disabled */ DISABLED, /** * For Enablement values that were not expected from the service */ UNEXPECTED_VALUE }
[ "caitbal@microsoft.com" ]
caitbal@microsoft.com
c96a546a6c67364c0d9c84ef34f189c0180b799c
de47391655e864ca3853fddc0a5835c6bb618148
/src/main/java/com/hd/manager/vo/HTProStatementVO.java
40a179fdb010681d62ee2d19eb2531e8a017e35b
[]
no_license
changbaolong1989/HANTTEN-WEB
ea4b6dd2025bc80f4a6dd846d1998fc9b61cf1f7
b0016bbd28141a704f60a4a1c5b4d5f4017a6719
refs/heads/master
2020-12-27T11:46:12.511852
2020-02-03T05:03:09
2020-02-03T05:04:41
237,890,828
1
0
null
null
null
null
UTF-8
Java
false
false
7,124
java
package com.hd.manager.vo; import com.hd.base.vo.BaseVO; public class HTProStatementVO extends BaseVO { /** * 结算ID */ private String statementId; /** * 合同ID */ private String contractId; /** * */ private String projectId; /** * 结算金额 */ private Double statementAmount; /** * 图纸方案 */ private Double drawingScheme; /** * 变更洽商 */ private Double alterDiscuss; /** * 签证 */ private Double visa; /** * 材料设配调差 */ private Double adjustPrice; /** * 物价波动调差 */ private Double surgePrice; /** * 总包服务费 */ private Double serviceFee; /** * 税金调差 */ private Double taxPrice; /** * 其他 */ private Double otherThing; /** * 备注 */ private String remark; /** * 创建时间 */ private String createDate; /** * 创建人 */ private String createUserId; /** * 修改时间 */ private String updateDate; /** * 修改人 */ private String updateUserId; /** * 是否删除 */ private String isDelFlg; /** * 结算ID * @return statement_id 结算ID */ public String getStatementId() { return statementId; } /** * 结算ID * @param statementId 结算ID */ public void setStatementId(String statementId) { this.statementId = statementId == null ? null : statementId.trim(); } /** * 合同ID * @return contract_id 合同ID */ public String getContractId() { return contractId; } /** * 合同ID * @param contractId 合同ID */ public void setContractId(String contractId) { this.contractId = contractId == null ? null : contractId.trim(); } /** * * @return project_id */ public String getProjectId() { return projectId; } /** * * @param projectId */ public void setProjectId(String projectId) { this.projectId = projectId == null ? null : projectId.trim(); } /** * 结算金额 * @return statement_amount 结算金额 */ public Double getStatementAmount() { return statementAmount; } /** * 结算金额 * @param statementAmount 结算金额 */ public void setStatementAmount(Double statementAmount) { this.statementAmount = statementAmount; } /** * 图纸方案 * @return drawing_scheme 图纸方案 */ public Double getDrawingScheme() { return drawingScheme; } /** * 图纸方案 * @param drawingScheme 图纸方案 */ public void setDrawingScheme(Double drawingScheme) { this.drawingScheme = drawingScheme; } /** * 变更洽商 * @return alter_discuss 变更洽商 */ public Double getAlterDiscuss() { return alterDiscuss; } /** * 变更洽商 * @param alterDiscuss 变更洽商 */ public void setAlterDiscuss(Double alterDiscuss) { this.alterDiscuss = alterDiscuss; } /** * 签证 * @return visa 签证 */ public Double getVisa() { return visa; } /** * 签证 * @param visa 签证 */ public void setVisa(Double visa) { this.visa = visa; } /** * 材料设配调差 * @return adjust_price 材料设配调差 */ public Double getAdjustPrice() { return adjustPrice; } /** * 材料设配调差 * @param adjustPrice 材料设配调差 */ public void setAdjustPrice(Double adjustPrice) { this.adjustPrice = adjustPrice; } /** * 物价波动调差 * @return surge_price 物价波动调差 */ public Double getSurgePrice() { return surgePrice; } /** * 物价波动调差 * @param surgePrice 物价波动调差 */ public void setSurgePrice(Double surgePrice) { this.surgePrice = surgePrice; } /** * 总包服务费 * @return service_fee 总包服务费 */ public Double getServiceFee() { return serviceFee; } /** * 总包服务费 * @param serviceFee 总包服务费 */ public void setServiceFee(Double serviceFee) { this.serviceFee = serviceFee; } /** * 税金调差 * @return tax_price 税金调差 */ public Double getTaxPrice() { return taxPrice; } /** * 税金调差 * @param taxPrice 税金调差 */ public void setTaxPrice(Double taxPrice) { this.taxPrice = taxPrice; } /** * 其他 * @return other_thing 其他 */ public Double getOtherThing() { return otherThing; } /** * 其他 * @param otherThing 其他 */ public void setOtherThing(Double otherThing) { this.otherThing = otherThing; } /** * 备注 * @return remark 备注 */ public String getRemark() { return remark; } /** * 备注 * @param remark 备注 */ public void setRemark(String remark) { this.remark = remark == null ? null : remark.trim(); } /** * 创建时间 * @return create_date 创建时间 */ public String getCreateDate() { return createDate; } /** * 创建时间 * @param createDate 创建时间 */ public void setCreateDate(String createDate) { this.createDate = createDate; } /** * 创建人 * @return create_user_id 创建人 */ public String getCreateUserId() { return createUserId; } /** * 创建人 * @param createUserId 创建人 */ public void setCreateUserId(String createUserId) { this.createUserId = createUserId == null ? null : createUserId.trim(); } /** * 修改时间 * @return update_date 修改时间 */ public String getUpdateDate() { return updateDate; } /** * 修改时间 * @param updateDate 修改时间 */ public void setUpdateDate(String updateDate) { this.updateDate = updateDate; } /** * 修改人 * @return update_user_id 修改人 */ public String getUpdateUserId() { return updateUserId; } /** * 修改人 * @param updateUserId 修改人 */ public void setUpdateUserId(String updateUserId) { this.updateUserId = updateUserId == null ? null : updateUserId.trim(); } /** * 是否删除 * @return is_del_flg 是否删除 */ public String getIsDelFlg() { return isDelFlg; } /** * 是否删除 * @param isDelFlg 是否删除 */ public void setIsDelFlg(String isDelFlg) { this.isDelFlg = isDelFlg == null ? null : isDelFlg.trim(); } }
[ "13940572922@163.com" ]
13940572922@163.com
08dd0fd04b4d34937086801ebd3869f86daeb2ec
7802e86c18679418838d53846b714b86c6510c3a
/ocs/src/main/java/com/it/ocs/listener/OrderListener.java
109d5909a93091cc3f70bef437769d0a877f0b11
[]
no_license
397946820/project
5d15886dd25b3ee9b6d8c2c7cb3273fa39b0de3d
c2c42103484c7c73c7f45069acdd8211c161cacf
refs/heads/master
2022-01-27T03:38:25.781786
2019-07-22T07:31:17
2019-07-22T07:31:17
198,165,241
0
0
null
null
null
null
UTF-8
Java
false
false
3,412
java
package com.it.ocs.listener; import java.text.ParseException; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.stereotype.Component; import com.it.ocs.cache.OrderCache; import com.it.ocs.cache.TimeCache; import com.it.ocs.common.util.CollectionUtil; import com.it.ocs.salesStatistics.dao.ISalesStatisticsDao; import com.it.ocs.salesStatistics.model.SalesStatisticsModel; import com.it.ocs.salesStatistics.utils.TimeTools; @Component public class OrderListener implements ApplicationListener<ContextRefreshedEvent> { private String AMAZON_KEY = "amazon"; private String EBAY_KEY = "ebay"; private String LIGHT_KEY = "light"; @Autowired private ISalesStatisticsDao dao; @Override public void onApplicationEvent(ContextRefreshedEvent arg0) { try { /* if (CollectionUtil.isNullOrEmpty(OrderCache.getOrder(EBAY_KEY))) { System.out.println("------------ebay order init start ------------------"); long time = System.currentTimeMillis(); List<SalesStatisticsModel> datas = dao.ebayQuery(); if (!CollectionUtil.isNullOrEmpty(datas)) { OrderCache.setAmazonOrder(EBAY_KEY, datas); } System.out.println("------------ebay order init end ------------------"); System.out.println("-------------order count : " + datas.size() + " ----------------------"); System.out .println("---------------共耗费:" + (System.currentTimeMillis() - time) + "ms ------------------"); } if (CollectionUtil.isNullOrEmpty(OrderCache.getOrder(LIGHT_KEY))) { System.out.println("------------light order init start ------------------"); long time = System.currentTimeMillis(); List<SalesStatisticsModel> datas = dao.lightQuery(); if (!CollectionUtil.isNullOrEmpty(datas)) { OrderCache.setAmazonOrder(LIGHT_KEY, datas); // 取出大于2017年的数据 List<SalesStatisticsModel> list = getOrdersByList(datas, LIGHT_KEY); OrderCache.setAmazonOrder(LIGHT_KEY + "2017", list); List<String> strings = new ArrayList<>(); for (SalesStatisticsModel model : list) { strings.add(TimeTools.dateToString(model.getCreatedat())); } TimeCache.setTimeMap(LIGHT_KEY + "time", strings); } System.out.println("------------light order init end ------------------"); System.out.println("-------------order count : " + datas.size() + " ----------------------"); System.out .println("---------------共耗费:" + (System.currentTimeMillis() - time) + "ms ------------------"); } */ } catch (Exception e) { e.printStackTrace(); } } private List<SalesStatisticsModel> getOrdersByList(List<SalesStatisticsModel> list, String string) throws ParseException { List<SalesStatisticsModel> result = new ArrayList<>(); Date time = TimeTools.getTime("2017-01-01"); if (string.equals("amazon")) { for (SalesStatisticsModel model : list) { if (model.getPurchaseat().getTime() >= time.getTime()) { result.add(model); } } } else if (string.equals("light")) { for (SalesStatisticsModel model : list) { if (model.getCreatedat().getTime() >= time.getTime()) { result.add(model); } } } return result; } }
[ "linxianxiong@cnest.net" ]
linxianxiong@cnest.net
1aab74cac2cd34a39a11f6253e2d79bd6a65af59
447520f40e82a060368a0802a391697bc00be96f
/apks/malware/app49/source/com/google/android/gms/internal/qa.java
74e061dfaa67e669a87f0e11435667e82090b0bc
[ "Apache-2.0" ]
permissive
iantal/AndroidPermissions
7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465
d623b732734243590b5f004d167e542e2e2ae249
refs/heads/master
2023-07-19T01:29:26.689186
2019-09-30T19:01:42
2019-09-30T19:01:42
107,239,248
0
0
Apache-2.0
2023-07-16T07:41:38
2017-10-17T08:22:57
null
UTF-8
Java
false
false
326
java
package com.google.android.gms.internal; public final class qa { public static final qb a = new qb("created"); public static final qc b = new qc("lastOpenedTime"); public static final qe c = new qe("modified"); public static final qd d = new qd("modifiedByMe"); public static final qf e = new qf("sharedWithMe"); }
[ "antal.micky@yahoo.com" ]
antal.micky@yahoo.com
1fbbfd4168bd2847f83e6faf166c8b5452828111
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/neo4j/2017/4/StoredProcedureVisitor.java
04bb4eead5a472e083ea61ae87196197f45dae58
[]
no_license
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
Java
false
false
4,692
java
/* * Copyright (c) 2002-2017 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j 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.neo4j.tooling.procedure.visitors; import org.neo4j.tooling.procedure.compilerutils.TypeMirrorUtils; import org.neo4j.tooling.procedure.messages.CompilationMessage; import org.neo4j.tooling.procedure.messages.ReturnTypeError; import java.util.List; import java.util.function.Function; import java.util.stream.Stream; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.ElementVisitor; import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.VariableElement; import javax.lang.model.type.TypeKind; import javax.lang.model.type.TypeMirror; import javax.lang.model.type.TypeVisitor; import javax.lang.model.util.Elements; import javax.lang.model.util.SimpleElementVisitor8; import javax.lang.model.util.Types; import org.neo4j.procedure.Name; public class StoredProcedureVisitor extends SimpleElementVisitor8<Stream<CompilationMessage>,Void> { private final Types typeUtils; private final Elements elementUtils; private final ElementVisitor<Stream<CompilationMessage>,Void> classVisitor; private final TypeVisitor<Stream<CompilationMessage>,Void> recordVisitor; private final ElementVisitor<Stream<CompilationMessage>,Void> parameterVisitor; public StoredProcedureVisitor( Types typeUtils, Elements elementUtils, boolean skipContextWarnings ) { TypeMirrorUtils typeMirrors = new TypeMirrorUtils( typeUtils, elementUtils ); this.typeUtils = typeUtils; this.elementUtils = elementUtils; this.classVisitor = new StoredProcedureClassVisitor( typeUtils, elementUtils, skipContextWarnings ); this.recordVisitor = new RecordTypeVisitor( typeUtils, typeMirrors ); this.parameterVisitor = new ParameterVisitor( new ParameterTypeVisitor( typeUtils, typeMirrors ) ); } /** * Validates method parameters and return type */ @Override public Stream<CompilationMessage> visitExecutable( ExecutableElement executableElement, Void ignored ) { return Stream.of( classVisitor.visit( executableElement.getEnclosingElement() ), validateParameters( executableElement.getParameters(), ignored ), validateReturnType( executableElement ) ).flatMap( Function.identity() ); } private Stream<CompilationMessage> validateParameters( List<? extends VariableElement> parameters, Void ignored ) { return parameters.stream().flatMap( var -> parameterVisitor.visit( var, ignored ) ); } private Stream<CompilationMessage> validateReturnType( ExecutableElement method ) { String streamClassName = Stream.class.getCanonicalName(); TypeMirror streamType = typeUtils.erasure( elementUtils.getTypeElement( streamClassName ).asType() ); TypeMirror returnType = method.getReturnType(); TypeMirror erasedReturnType = typeUtils.erasure( returnType ); TypeMirror voidType = typeUtils.getNoType( TypeKind.VOID ); if ( typeUtils.isSameType( returnType, voidType ) ) { return Stream.empty(); } if ( !typeUtils.isSubtype( erasedReturnType, streamType ) ) { return Stream.of( new ReturnTypeError( method, "Return type of %s#%s must be %s", method.getEnclosingElement().getSimpleName(), method.getSimpleName(), streamClassName ) ); } return recordVisitor.visit( returnType ); } private AnnotationMirror annotationMirror( List<? extends AnnotationMirror> mirrors ) { AnnotationTypeVisitor nameVisitor = new AnnotationTypeVisitor( Name.class ); return mirrors.stream().filter( mirror -> nameVisitor.visit( mirror.getAnnotationType().asElement() ) ) .findFirst().orElse( null ); } private String nameOf( VariableElement parameter ) { return parameter.getSimpleName().toString(); } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
c38d1f55658859a0a9af660dd3c03e1f3b35e5d6
53d5cbad5c0118d7c4ee80944c8b86efd91af0a9
/server/src/main/java/org/jzb/execution/domain/TaskGroup.java
f2c2bb89bddcfd686c0fb241805fe32ff486d4ba
[]
no_license
ixtf/japp-execution
bc54e41bdda09e6cf18fa39904a1126336fd040e
b387f725a5293f353fe052fbb7b742d72b506332
refs/heads/master
2021-01-18T23:56:12.982708
2019-03-22T07:49:52
2019-03-22T07:49:52
40,085,653
0
0
null
null
null
null
UTF-8
Java
false
false
1,424
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package org.jzb.execution.domain; import org.hibernate.validator.constraints.NotBlank; import javax.persistence.Entity; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * @author jzb */ @Entity @Table(name = "T_TASKGROUP") public class TaskGroup extends AbstractLogable implements Comparable<TaskGroup> { @NotBlank private String name; @ManyToOne private UploadFile logo; @ManyToOne private UploadFile sign; @Lob private String signString; public String getName() { return name; } public void setName(String name) { this.name = name; } public UploadFile getLogo() { return logo; } public void setLogo(UploadFile logo) { this.logo = logo; } public UploadFile getSign() { return sign; } public void setSign(UploadFile sign) { this.sign = sign; } public String getSignString() { return signString; } public void setSignString(String signString) { this.signString = signString; } @Override public int compareTo(TaskGroup o) { return this.getModifyDateTime().compareTo(o.getModifyDateTime()); } }
[ "ixtf1984@gmail.com" ]
ixtf1984@gmail.com
85b0763ec072d32b8364e81ab97accb69b128f09
ffd5cceaedfafe48c771f3d8f8841be9773ae605
/main/boofcv-geo/src/main/java/boofcv/alg/distort/FlipVerticalNorm2_F32.java
a277294db085eb3fcd013d4373b0565599550bad
[ "LicenseRef-scancode-takuya-ooura", "Apache-2.0" ]
permissive
Pandinosaurus/BoofCV
7ea1db317570b2900349e2b44cc780efc9bf1269
fc75d510eecf7afd55383b6aae8f01a92b1a47d3
refs/heads/SNAPSHOT
2023-08-31T07:29:59.845934
2019-11-03T17:46:24
2019-11-03T17:46:24
191,161,726
0
0
Apache-2.0
2019-11-03T23:57:13
2019-06-10T12:13:55
Java
UTF-8
Java
false
false
1,544
java
/* * Copyright (c) 2011-2019, Peter Abeles. All Rights Reserved. * * This file is part of BoofCV (http://boofcv.org). * * 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 boofcv.alg.distort; import boofcv.struct.distort.Point2Transform2_F32; import georegression.struct.point.Point2D_F32; /** * <p> * Flips the image along the vertical axis and convert to normalized image coordinates using the * provided transform. * </p> * * @author Peter Abeles */ public class FlipVerticalNorm2_F32 implements Point2Transform2_F32 { Point2Transform2_F32 pixelToNormalized; int height; public FlipVerticalNorm2_F32(Point2Transform2_F32 pixelToNormalized, int imageHeight) { this.pixelToNormalized = pixelToNormalized; this.height = imageHeight - 1; } @Override public void compute(float x, float y, Point2D_F32 out) { pixelToNormalized.compute(x, height - y, out); } @Override public FlipVerticalNorm2_F32 copyConcurrent() { return new FlipVerticalNorm2_F32(pixelToNormalized.copyConcurrent(),height); } }
[ "peter.abeles@gmail.com" ]
peter.abeles@gmail.com
5217787eb01298c15816a6d9e3f607938f91cc0f
b31120cefe3991a960833a21ed54d4e10770bc53
/modules/org.clang.staticanalyzer/src/org/clang/staticanalyzer/checkers/ento/impl/FixedAddressCheckerEntoGlobals.java
fba739beb80ced11d416abede691520b5b07e98b
[]
no_license
JianpingZeng/clank
94581710bd89caffcdba6ecb502e4fdb0098caaa
bcdf3389cd57185995f9ee9c101a4dfd97145442
refs/heads/master
2020-11-30T05:36:06.401287
2017-10-26T14:15:27
2017-10-26T14:15:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,256
java
/** * This file was converted to Java from the original LLVM source file. The original * source file follows the LLVM Release License, outlined below. * * ============================================================================== * LLVM Release License * ============================================================================== * University of Illinois/NCSA * Open Source License * * Copyright (c) 2003-2017 University of Illinois at Urbana-Champaign. * All rights reserved. * * Developed by: * * LLVM Team * * University of Illinois at Urbana-Champaign * * http://llvm.org * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal with * 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: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimers. * * * Redistributions in binary form must reproduce the above copyright notice * this list of conditions and the following disclaimers in the * documentation and/or other materials provided with the distribution. * * * Neither the names of the LLVM Team, University of Illinois at * Urbana-Champaign, nor the names of its contributors may be used to * endorse or promote products derived from this Software without specific * prior written permission. * * 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 * CONTRIBUTORS 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 WITH THE * SOFTWARE. * * ============================================================================== * Copyrights and Licenses for Third Party Software Distributed with LLVM: * ============================================================================== * The LLVM software contains code written by third parties. Such software will * have its own individual LICENSE.TXT file in the directory in which it appears. * This file will describe the copyrights, license, and restrictions which apply * to that code. * * The disclaimer of warranty in the University of Illinois Open Source License * applies to all code in the LLVM Distribution, and nothing in any of the * other licenses gives permission to use the names of the LLVM Team or the * University of Illinois to endorse or promote products derived from this * Software. * * The following pieces of software have additional or alternate copyrights, * licenses, and/or restrictions: * * Program Directory * ------- --------- * Autoconf llvm/autoconf * llvm/projects/ModuleMaker/autoconf * Google Test llvm/utils/unittest/googletest * OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} * pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} * ARM contributions llvm/lib/Target/ARM/LICENSE.TXT * md5 contributions llvm/lib/Support/MD5.cpp llvm/include/llvm/Support/MD5.h */ package org.clang.staticanalyzer.checkers.ento.impl; import org.clank.support.*; import org.clang.staticanalyzer.checkers.impl.*; import org.clang.staticanalyzer.core.ento.*; //<editor-fold defaultstate="collapsed" desc="static type FixedAddressCheckerEntoGlobals"> @Converted(kind = Converted.Kind.AUTO, cmd="jclank.sh -java-options=${SPUTNIK}/contrib/JConvert/llvmToClankType -print -java-options=${SPUTNIK}/modules/org.clang.staticanalyzer/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp -nm=_ZN5clang4ento27registerFixedAddressCheckerERNS0_14CheckerManagerE; -static-type=FixedAddressCheckerEntoGlobals -package=org.clang.staticanalyzer.checkers.ento.impl") //</editor-fold> public final class FixedAddressCheckerEntoGlobals { //<editor-fold defaultstate="collapsed" desc="clang::ento::registerFixedAddressChecker"> @Converted(kind = Converted.Kind.AUTO, source = "${LLVM_SRC}/llvm/tools/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp", line = 66, FQN="clang::ento::registerFixedAddressChecker", NM="_ZN5clang4ento27registerFixedAddressCheckerERNS0_14CheckerManagerE", cmd="jclank.sh -java-options=${SPUTNIK}/modules/org.clang.staticanalyzer/llvmToClangType ${LLVM_SRC}/llvm/tools/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp -nm=_ZN5clang4ento27registerFixedAddressCheckerERNS0_14CheckerManagerE") //</editor-fold> public static void registerFixedAddressChecker(final CheckerManager /*&*/ mgr) { mgr.<FixedAddressChecker>registerChecker(FixedAddressChecker.class); } } // END OF class FixedAddressCheckerEntoGlobals
[ "voskresensky.vladimir@gmail.com" ]
voskresensky.vladimir@gmail.com
7218201e7b7efba7b1600b94ef059d97c3d1a495
e390f178c3bd3c8460649ee4514e6178f8d709f4
/replit/scanner/charIf.java
04587b29c1f9ed4dbbe1b0621c76ff92e369dafa
[]
no_license
Nasratullahsarabi/UltimateJavaPrograming_B23
353d9c25a3b65c27376b88f8009870f2c63ff91e
e401107d947d94ae2e8b7a395575668f24bf44a3
refs/heads/master
2023-06-25T04:18:41.233004
2021-07-27T16:14:38
2021-07-27T16:14:38
387,659,984
0
0
null
null
null
null
UTF-8
Java
false
false
612
java
package scanner; import java.util.Scanner; public class charIf { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("enter your command"); char yes = scan.next().charAt(0); if (yes=='y'){ System.out.println("Your request is being processed"); }else if (yes=='n'){ System.out.println("thank you any way"); }else if (yes=='h'){ System.out.println("sorry no help is available at the momen"); }else { System.out.println("invalid attempt"); } } }
[ "Nasratullah_sarabi@yahoo.com" ]
Nasratullah_sarabi@yahoo.com
7b24ed11903dbc56bb35fbfac11c759f8e686409
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/MATH-32b-4-9-PESA_II-WeightedSum:TestLen:CallDiversity/org/apache/commons/math3/geometry/euclidean/threed/PolyhedronsSet$FacetsContributionVisitor_ESTest_scaffolding.java
abcbcd8fd1f875d257615f7e2587148974ae259b
[]
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
495
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Thu Apr 02 12:22:15 UTC 2020 */ package org.apache.commons.math3.geometry.euclidean.threed; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class PolyhedronsSet$FacetsContributionVisitor_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
7311b26d34da77687c0f3035ba18e801958b0a36
a6311976e6eaa6ad075624e40a3763d938ee5fe2
/app/src/main/java/com/zhiyuan3g/androidweather/utils/OkHttpCallBack.java
2470aa91acc73cfe53aa2affdb4f7010708bc57a
[]
no_license
Galvatron0521/AndroidWeather
860d73c02b78e2a8690e4cd129f641df9f011d36
45e6090eb2b6bf0c8fbd104dd51d9d16d40d346a
refs/heads/master
2021-06-23T18:33:26.052773
2017-08-24T05:02:48
2017-08-24T05:02:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
191
java
package com.zhiyuan3g.androidweather.utils; /** * Created by kkkkk on 2017/8/9. */ public interface OkHttpCallBack { void Success(String result); void Failure(String failure); }
[ "18353847303@163.com" ]
18353847303@163.com
4db4727cdb6be5292d6faa66a551f0ce4e1398cf
94c1358525fc195e7e03c7f7a539c0855b3ace9c
/app/src/main/java/com/pmmq/pmmqproject/util/FileUtils.java
b7cb7c442117e60de90dd13292ec84fe2c48ad36
[]
no_license
ControlToday/AndroidtagView
ba2e63133aef70bd2b982ee35e69db40993ca7d7
e2a2503f804014c05933581f6d1cf64093d9ddb1
refs/heads/master
2020-09-04T16:41:20.136181
2018-05-10T10:37:40
2018-05-10T10:37:40
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,300
java
package com.pmmq.pmmqproject.util; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.BitmapFactory; import android.os.Environment; public class FileUtils { /** * sd卡的根目录 */ private static String mSdRootPath = Environment.getExternalStorageDirectory().getPath(); /** * 手机的缓存根目录 */ private static String mDataRootPath = null; /** * 保存Image的目录名 */ private final static String FOLDER_NAME = "/LoveCity"; private final static String IMAGE_NAME = "/cache"; public FileUtils(Context context){ mDataRootPath = context.getCacheDir().getPath(); } public String makeAppDir(){ String path = getStorageDirectory(); File folderFile = new File(path); if(!folderFile.exists()){ folderFile.mkdir(); } path = path + IMAGE_NAME; folderFile = new File(path); if(!folderFile.exists()){ folderFile.mkdir(); } return path; } /** * 获取储存Image的目录 * @return */ private String getStorageDirectory(){ return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) ? mSdRootPath + FOLDER_NAME : mDataRootPath + FOLDER_NAME; } /** * 保存Image的方法,有sd卡存储到sd卡,没有就存储到手机目录 * @param fileName * @param bitmap * @throws IOException */ public void savaBitmap(String fileName, Bitmap bitmap) throws IOException{ if(bitmap == null){ return; } String path = getStorageDirectory(); Logger.d("FileUtils", "savaBitmap path = " + path); Logger.d("FileUtils", "savaBitmap fileName = " + fileName); Logger.d("FileUtils", "savaBitmap mSdRootPath = " + mSdRootPath); Logger.d("FileUtils", "savaBitmap mDataRootPath = " + mDataRootPath); File folderFile = new File(path); if(!folderFile.exists()){ folderFile.mkdir(); } path = path + IMAGE_NAME; folderFile = new File(path); if(!folderFile.exists()){ folderFile.mkdir(); } File file = new File(path + File.separator + fileName); file.createNewFile(); FileOutputStream fos = new FileOutputStream(file); bitmap.compress(CompressFormat.JPEG, 100, fos); fos.flush(); fos.close(); } /** * 从手机或者sd卡获取Bitmap * @param fileName * @return */ public Bitmap getBitmap(String fileName){ return BitmapFactory.decodeFile(getStorageDirectory() + File.separator + fileName); } /** * 判断文件是否存在 * @param fileName * @return */ public boolean isFileExists(String fileName){ return new File(getStorageDirectory() + File.separator + fileName).exists(); } /** * 获取文件的大小 * @param fileName * @return */ public long getFileSize(String fileName) { return new File(getStorageDirectory() + File.separator + fileName).length(); } /** * 删除SD卡或者手机的缓存图片和目录 */ public void deleteFile() { File dirFile = new File(getStorageDirectory()); if(! dirFile.exists()){ return; } if (dirFile.isDirectory()) { String[] children = dirFile.list(); for (int i = 0; i < children.length; i++) { new File(dirFile, children[i]).delete(); } } dirFile.delete(); } }
[ "896672661@qq.com" ]
896672661@qq.com
f78536cfd2f7ce3c3d288ac7a2fd4039b5df2791
305f415e3dc3282ec53df77c76f927b8e00d1c5c
/SpringBoot_Api/Api/src/main/java/Api/Api/Repositories/CarRepository.java
cba0f8ccf4e46b22acbcfcbb05e48a7c6a23c054
[]
no_license
LetMeCode12/CarPlateRecognizonSystem
845b03c8e69924aae3ea6e719cfa3f1f16913355
a329ec856e4864693b9e07e80a7580a5de51a626
refs/heads/master
2023-03-20T11:42:47.642432
2021-03-12T12:24:42
2021-03-12T12:24:42
347,057,457
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package Api.Api.Repositories; import Api.Api.Dto.Car; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.UUID; @Repository public interface CarRepository extends JpaRepository<Car, UUID> { }
[ "you@example.com" ]
you@example.com
9aa5ffa493ac307d37596e615a6072e065291563
421f0a75a6b62c5af62f89595be61f406328113b
/generated_tests/model_seeding/81_javathena-org.javathena.core.data.Item-0.5-9/org/javathena/core/data/Item_ESTest.java
de2a2c81778b1a1ed6a52b41f279188ac7717223
[]
no_license
tigerqiu712/evosuite-model-seeding-empirical-evaluation
c78c4b775e5c074aaa5e6ca56bc394ec03c2c7c6
11a920b8213d9855082d3946233731c843baf7bc
refs/heads/master
2020-12-23T21:04:12.152289
2019-10-30T08:02:29
2019-10-30T08:02:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
637
java
/* * This file was automatically generated by EvoSuite * Tue Oct 29 17:36:20 GMT 2019 */ package org.javathena.core.data; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) public class Item_ESTest extends Item_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pderakhshanfar@bsr01.win.tue.nl" ]
pderakhshanfar@bsr01.win.tue.nl
3c0569c72f364867894e50ddf59fcca5848aae9c
0af8b92686a58eb0b64e319b22411432aca7a8f3
/large-multiproject/project1/src/main/java/org/gradle/test/performance1_5/Production1_424.java
8e83c77f435665ce9d63f07a163ce4b708a9afbf
[]
no_license
gradle/performance-comparisons
b0d38db37c326e0ce271abebdb3c91769b860799
e53dc7182fafcf9fedf07920cbbea8b40ee4eef4
refs/heads/master
2023-08-14T19:24:39.164276
2022-11-24T05:18:33
2022-11-24T05:18:33
80,121,268
17
15
null
2022-09-30T08:04:35
2017-01-26T14:25:33
null
UTF-8
Java
false
false
246
java
package org.gradle.test.performance1_5; public class Production1_424 { private final String property; public Production1_424() { this.property = "foo"; } public String getProperty() { return property; } }
[ "cedric.champeau@gmail.com" ]
cedric.champeau@gmail.com
209098a07196c43820d3d02ac59328d1f43269d8
2ee9a8936f889bade976b475d5ed257f49f8a32f
/core/src/main/java/com/huawei/openstack4j/model/telemetry/Alarm.java
5aa14d105cddeccabec06811647f1437b590d25b
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
huaweicloud/huaweicloud-sdk-java
f44532a5e6eae867e9620923a9467ed431d13611
c1372d4be2d86382dfd20ccc084ae66c5ca4a4ce
refs/heads/master
2023-09-01T06:10:00.487173
2022-09-01T01:50:12
2022-09-01T01:50:12
148,595,939
49
45
NOASSERTION
2023-07-18T02:12:39
2018-09-13T07:01:08
Java
UTF-8
Java
false
false
7,369
java
/******************************************************************************* * Copyright 2016 ContainX and OpenStack4j * * 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. *******************************************************************************/ /******************************************************************************* * Huawei has modified this source file. * Copyright 2018 Huawei Technologies Co.,Ltd. * * 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.huawei.openstack4j.model.telemetry; import java.util.List; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; import com.huawei.openstack4j.common.Buildable; import com.huawei.openstack4j.model.ModelEntity; import com.huawei.openstack4j.model.common.BasicResource; import com.huawei.openstack4j.model.telemetry.builder.AlarmBuilder; import com.huawei.openstack4j.openstack.telemetry.domain.CeilometerAlarm.CeilometerQuery; import com.huawei.openstack4j.openstack.telemetry.domain.CeilometerAlarm.CeilometerThresholdRule; /** * An Alarm is triggered when a specificied rule is satisfied * * @author Massimiliano Romano */ public interface Alarm extends ModelEntity,BasicResource, Buildable<AlarmBuilder> { List<String> getAlarmActions(); String getAlarmId(); String getDescription(); boolean isEnabled(); void isEnabled(boolean newValue); List<String> getInsufficientDataActions(); /** * @return the unique name of the alarm */ String getName(); List<String> getOkActions(); /** * @return the ID of the project/tenant that owns the resource */ String getProjectId(); boolean getRepeatActions(); String getState(); String getStateTimestamp(); ThresholdRule getThresholdRule(); CombinationRule getCombinationRule(); String getTimestamp(); /** * @return the alarm type */ Type getType(); /** * @return The user id who last modified the resource */ String getUserId(); /** * The Alarm Type */ public enum Type { THRESHOLD, COMBINATION, UNRECOGNIZED; @JsonValue public String value() { return this.name().toLowerCase(); } @Override public String toString() { return value(); } @JsonCreator public static Type fromValue(String type) { try { return valueOf(type.toUpperCase()); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } } public interface CombinationRule{ List<String> getAlarmIds(); Operator getOperator(); void setAlarmIds(List<String> alarmIds); void setOperator(Operator operator); public enum Operator { AND, OR, UNRECOGNIZED; @JsonValue public String value() { return this.name().toLowerCase(); } @Override public String toString() { return value(); } @JsonCreator public static Operator fromValue(String operator) { try { return valueOf(operator.toUpperCase()); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } } } public interface ThresholdRule{ String getMeterName(); int getEvaluationPeriods(); Statistic getStatistic(); int getPeriod(); float getThreshold(); List<? extends Query> getQuery(); ComparisonOperator getComparisonOperator(); boolean getExcludeOutliers(); void setMeterName(String meterName); void setEvaluationPeriods(int evaluationPeriod); void setStatistic(Statistic statistic); void setPeriod(int period); void setThreshold(float threshold); void setQuery(List<CeilometerQuery> query); void setComparisonOperator(ComparisonOperator comparisonOperator); void setExcludeOutliers(boolean excludeOutliers); public enum Statistic { MAX, MIN, AVG, SUM, COUNT, UNRECOGNIZED; @JsonValue public String value() { return this.name().toLowerCase(); } @Override public String toString() { return value(); } @JsonCreator public static Statistic fromValue(String statistic) { try { return valueOf(statistic.toUpperCase()); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } } public enum ComparisonOperator { LT, LE, EQ, NE, GE, GT, UNRECOGNIZED; @JsonValue public String value() { return this.name().toLowerCase(); } @Override public String toString() { return value(); } @JsonCreator public static ComparisonOperator fromValue(String operator) { try { return valueOf(operator.toUpperCase()); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } } } public interface Query{ String getField(); String getValue(); ComparisonOperator getOp(); void setField(String field); void setValue(String value); void setOp(ComparisonOperator comparisonOperator); } } void setName(String name); void setType(Type type); void setUserId(String userId); void setAlarmActions(List<String> alarmActions); void setDescription(String description); void setInsufficientDataActions(List<String> insufficientDataActions); void setOkActions(List<String> okActions); void setRepeateActions(Boolean repeatActions); void setThresholdRule(CeilometerThresholdRule tr); }
[ "289228042@qq.com" ]
289228042@qq.com
25a2ceb08a4c4bb0b0ded0978115fe67c5bff403
70898639fc2862c4782d1721c237bdd1dc0fe33c
/src/java/dao/Standart.java
a97a996ce887e3630b31439c781841245141b3a2
[]
no_license
eliasdevel/mvcTslJava
0166d63c42bd88923a356998370e73b44f38a195
aa432a10573f821cd6981c6c674bf58bec292ba7
refs/heads/master
2020-03-26T14:44:06.016399
2018-09-14T20:09:41
2018-09-14T20:09:41
145,002,186
0
0
null
null
null
null
UTF-8
Java
false
false
2,017
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package dao; import db.ConexaoBD; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import javax.servlet.ServletException; /** * * @author elias */ public class Standart { protected String table; protected Connection con; protected String query; public Standart() { ConexaoBD conexao = new ConexaoBD(); try { if (conexao.abriuConexao()) { System.out.println("Abriu Normalmente"); } else { System.out.println("erro de conexao"); } } catch (Exception e) { System.out.println("erro de conexao"); } try { this.con = conexao.obterConexao(); } catch (Exception e) { } } public void setTable(String table) { this.table = table; } public ResultSet getById(String table, String id) throws SQLException { PreparedStatement ps = this.con.prepareStatement("Select * from " + table + " where id = ?;"); int idInt = 0; try { idInt = Integer.parseInt(id); ps.setInt(1, idInt); } catch (Exception e) { ps.setString(1, id); } return ps.executeQuery(); // return this.con.createStatement().executeQuery("Select * from "+ table + " Where id ='"+id+"'"); } public boolean delete(String table, String id) throws SQLException { PreparedStatement ps = this.con.prepareStatement("DELETE FROM " + table + " where id = ?;"); int idInt = 0; try { idInt = Integer.parseInt(id); ps.setInt(1, idInt); } catch (Exception e) { ps.setString(1, id); } return ps.execute(); } }
[ "you@example.com" ]
you@example.com
e5310807827a341a4fc293cefa4b367a4fc25b83
47a1618c7f1e8e197d35746639e4480c6e37492e
/src/oracle/retail/stores/pos/services/instantcredit/enrollment/ModifyTransactionDiscountPercentReturnShuttle.java
33822046ecdcbc041d2db872c696e3825b0dd542
[]
no_license
dharmendrams84/POSBaseCode
41f39039df6a882110adb26f1225218d5dcd8730
c588c0aa2a2144aa99fa2bbe1bca867e008f47ee
refs/heads/master
2020-12-31T07:42:29.748967
2017-03-29T08:12:34
2017-03-29T08:12:34
86,555,051
0
1
null
null
null
null
UTF-8
Java
false
false
7,975
java
/* =========================================================================== * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * =========================================================================== * $Header: rgbustores/applications/pos/src/oracle/retail/stores/pos/services/instantcredit/enrollment/ModifyTransactionDiscountPercentReturnShuttle.java /main/18 2011/02/16 09:13:32 cgreene Exp $ * =========================================================================== * NOTES * <other useful comments, qualifications, etc.> * * MODIFIED (MM/DD/YY) * cgreen 02/15/11 - move constants into interfaces and refactor * abhayg 09/29/10 - FIX FOR EJOURNAL SHOWS WRONG POS DISCOUNT VALUE * cgreen 05/26/10 - convert to oracle packaging * cgreen 04/27/10 - XbranchMerge cgreene_refactor-duplicate-pos-classes * from st_rgbustores_techissueseatel_generic_branch * jswan 03/24/10 - Fix an issue with instant credit enrollment discount * with special orders. * abonda 01/03/10 - update header date * deghos 12/23/08 - EJ i18n changes * acadar 11/03/08 - localization of reason codes for discounts and merging * to tip * acadar 10/30/08 - use localized reason codes for item and transaction * discounts * * =========================================================================== $Log: 4 360Commerce 1.3 1/22/2006 11:45:11 AM Ron W. Haight removed references to com.ibm.math.BigDecimal 3 360Commerce 1.2 3/31/2005 4:29:04 PM Robert Pearse 2 360Commerce 1.1 3/10/2005 10:23:35 AM Robert Pearse 1 360Commerce 1.0 2/11/2005 12:12:41 PM Robert Pearse $ Revision 1.4 2004/04/09 16:56:02 cdb @scr 4302 Removed double semicolon warnings. Revision 1.3 2004/02/12 16:50:42 mcs Forcing head revision Revision 1.2 2004/02/11 21:51:22 rhafernik @scr 0 Log4J conversion and code cleanup Revision 1.1.1.1 2004/02/11 01:04:16 cschellenger updating to pvcs 360store-current * * Rev 1.2 Nov 24 2003 19:46:14 nrao * Code Review Changes. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package oracle.retail.stores.pos.services.instantcredit.enrollment; import java.math.BigDecimal; import oracle.retail.stores.utility.I18NConstantsIfc; import oracle.retail.stores.utility.I18NHelper; import oracle.retail.stores.utility.JournalConstantsIfc; import org.apache.log4j.Logger; import oracle.retail.stores.common.utility.LocaleMap; import oracle.retail.stores.domain.discount.DiscountRuleConstantsIfc; import oracle.retail.stores.domain.utility.LocaleConstantsIfc; import oracle.retail.stores.pos.services.common.FinancialCargoShuttle; import oracle.retail.stores.domain.discount.TransactionDiscountStrategyIfc; import oracle.retail.stores.domain.transaction.RetailTransactionIfc; import oracle.retail.stores.domain.transaction.SaleReturnTransactionIfc; import oracle.retail.stores.foundation.manager.ifc.JournalManagerIfc; import oracle.retail.stores.foundation.tour.gate.Gateway; import oracle.retail.stores.foundation.tour.ifc.BusIfc; import oracle.retail.stores.foundation.utility.Util; import oracle.retail.stores.pos.services.instantcredit.InstantCreditCargo; import oracle.retail.stores.pos.services.modifytransaction.discount.ModifyTransactionDiscountCargo; /** * Shuttles data from ModifyTransacationDiscountPercent service to * ModifyTransaction service. * * @version $Revision: /main/18 $ */ public class ModifyTransactionDiscountPercentReturnShuttle extends FinancialCargoShuttle { private static final long serialVersionUID = 5003179871467691604L; /** * The logger to which log messages will be sent. */ protected static final Logger logger = Logger.getLogger(ModifyTransactionDiscountPercentReturnShuttle.class); /** * revision number of this class */ public static final String revisionNumber = ""; // transaction protected RetailTransactionIfc transaction = null; // flag to see if there was a discount done in the service protected boolean doDiscount = false; // flag to see if a discount has to be cleared protected boolean clearDiscount = false; protected TransactionDiscountStrategyIfc discountPercent; protected TransactionDiscountStrategyIfc oldDiscountPercent; /** * employee ID */ protected String discountEmployeeID = ""; /** * Loads data from ModifyTransactionDiscountPercent service. * * @param bus Service Bus */ @Override public void load(BusIfc bus) { super.load(bus); ModifyTransactionDiscountCargo cargo = (ModifyTransactionDiscountCargo) bus.getCargo(); doDiscount = cargo.getDoDiscount(); discountPercent = cargo.getDiscount(); oldDiscountPercent = cargo.getOldDiscount(); transaction = cargo.getTransaction(); discountEmployeeID = cargo.getEmployeeDiscountID(); } /** * Unloads data to ModifyTransaction service. * * @param bus Service Bus */ @Override public void unload(BusIfc bus) { super.unload(bus); InstantCreditCargo cargo = (InstantCreditCargo)bus.getCargo(); JournalManagerIfc mgr = (JournalManagerIfc)Gateway.getDispatcher().getManager(JournalManagerIfc.TYPE); String discountPercentStr = ""; // Current discount. Might be null if user leaves % field blank if (discountPercent != null) { BigDecimal discountRate = discountPercent.getDiscountRate(); discountRate = discountRate.movePointRight(2); discountPercentStr = discountRate.toString(); } // set transaction if (transaction != null) { cargo.setTransaction(transaction); } SaleReturnTransactionIfc trans = (SaleReturnTransactionIfc)cargo.getTransaction(); // check to see if the clear key has been set if (clearDiscount == true && trans != null) { trans.clearTransactionDiscounts(DiscountRuleConstantsIfc.DISCOUNT_METHOD_PERCENTAGE, DiscountRuleConstantsIfc.ASSIGNMENT_MANUAL); } // else if a new discount apply it to the transaction else if (doDiscount == true && trans != null) { StringBuilder message = new StringBuilder(); Object[] dataArgs = new Object[2]; message.append(Util.EOL) .append(I18NHelper.getString(I18NConstantsIfc.EJOURNAL_TYPE, JournalConstantsIfc.TRANS_DISCOUNT_TAG_LABEL, null)).append(Util.EOL); dataArgs[0] = discountPercentStr; message.append(I18NHelper.getString(I18NConstantsIfc.EJOURNAL_TYPE, JournalConstantsIfc.DISCOUNT_TAG_LABEL, dataArgs)) .append(Util.EOL); if(discountPercent.getReason().getText(LocaleMap.getLocale(LocaleConstantsIfc.JOURNAL)) == null) { dataArgs[0] = discountPercent.getReason().getCode(); } else { dataArgs[0] = discountPercent.getReason().getText(LocaleMap.getLocale(LocaleConstantsIfc.JOURNAL)); } message.append(I18NHelper.getString(I18NConstantsIfc.EJOURNAL_TYPE, JournalConstantsIfc.DISCOUNT_RSN_TAG_LABEL, dataArgs)); mgr.journal(trans.getCashier().getEmployeeID(), trans.getTransactionID(), message.toString()); trans.addTransactionDiscountDuringTender(discountPercent); } } }
[ "Ignitiv021@Ignitiv021-PC" ]
Ignitiv021@Ignitiv021-PC
a438b1fcacbb61b12d30a5131eb0574f29b59279
204d80af21c91be323fd607feb334bb76c72cecc
/evector-web/evector-web/src/univ/evector/beans/book/GramWordType.java
19a2abb3f835e6e64d653cc8daafc67cc9ec4ad5
[]
no_license
lukasonokoleg/evector
3cb708f93de05b5e1944339ffed472f50ad89ca9
942855db30b3210485beebb84789b7043f407af2
refs/heads/master
2021-01-10T19:41:00.324499
2015-01-07T09:17:09
2015-01-07T09:17:09
25,296,524
1
0
null
null
null
null
UTF-8
Java
false
false
709
java
package univ.evector.beans.book; import java.io.Serializable; @SuppressWarnings("serial") public class GramWordType implements Serializable { private Long gwt_id; private String gwt_value; public GramWordType() { } public Long getGwt_id() { return gwt_id; } public void setGwt_id(Long gwt_id) { this.gwt_id = gwt_id; } public String getGwt_value() { return gwt_value; } public void setGwt_value(String gwt_value) { this.gwt_value = gwt_value; } @Override public String toString() { return "GramWordType [gwt_id=" + gwt_id + ", gwt_value=" + gwt_value + "]"; } }
[ "lukasonokoleg@gmail.com" ]
lukasonokoleg@gmail.com
0a7a8f639f2af27c82234d46aff0c6f1cba0e914
69c597b1afda7c448b1470d29c3f05936b350561
/YiBo/src/net/dev123/yibo/PublicTimelineActivity.java
9aaa2b8aed90f6a374a513ca14dd07eedde87083
[]
no_license
dawndiy/YiBo
c7fc89cc0992f1f8c4a4ac790961e49b486e9966
ad9e1c43c006e29f3a5a562c6e3ce7222332ee54
refs/heads/master
2021-01-18T13:14:15.775845
2013-03-02T14:19:13
2013-03-02T14:19:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,301
java
package net.dev123.yibo; import net.dev123.yibo.common.theme.ThemeUtil; import net.dev123.yibo.service.adapter.PublicTimelineListAdapter; import net.dev123.yibo.service.listener.GoBackClickListener; import net.dev123.yibo.service.listener.MicroBlogContextMenuListener; import net.dev123.yibo.service.listener.MicroBlogItemClickListener; import net.dev123.yibo.service.listener.StatusRecyclerListener; import net.dev123.yibo.service.task.PublicTimelineTask; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.TextView; public class PublicTimelineActivity extends BaseActivity { private PublicTimelineListAdapter adapter = null; private YiBoApplication yibo; private ListView lvMicroBlog = null; private View listFooter = null; private StatusRecyclerListener recyclerListener; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.public_timeline); yibo = (YiBoApplication) getApplication(); adapter = new PublicTimelineListAdapter(this, yibo.getCurrentAccount()); initComponents(); bindEvent(); executeTask(); } private void initComponents() { LinearLayout llHeaderBase = (LinearLayout)findViewById(R.id.llHeaderBase); lvMicroBlog = (ListView)this.findViewById(R.id.lvMicroBlog); ThemeUtil.setSecondaryHeader(llHeaderBase); ThemeUtil.setContentBackground(lvMicroBlog); ThemeUtil.setListViewStyle(lvMicroBlog); TextView tvTitle = (TextView) this.findViewById(R.id.tvTitle); tvTitle.setText(R.string.title_public_timeline); showMoreFooter(); lvMicroBlog.setAdapter(adapter); lvMicroBlog.setFastScrollEnabled(yibo.isSliderEnabled()); setBack2Top(lvMicroBlog); recyclerListener = new StatusRecyclerListener(); lvMicroBlog.setRecyclerListener(recyclerListener); } private void bindEvent() { MicroBlogItemClickListener itemClickListener = new MicroBlogItemClickListener(this); lvMicroBlog.setOnItemClickListener(itemClickListener); MicroBlogContextMenuListener contextMenuListener = new MicroBlogContextMenuListener(lvMicroBlog); lvMicroBlog.setOnCreateContextMenuListener(contextMenuListener); Button btnBack = (Button) this.findViewById(R.id.btnBack); btnBack.setOnClickListener(new GoBackClickListener()); } private void executeTask() { new PublicTimelineTask(this, adapter, yibo.getCurrentAccount()).execute(); } public void showLoadingFooter() { if (listFooter != null) { lvMicroBlog.removeFooterView(listFooter); } listFooter = getLayoutInflater().inflate(R.layout.list_item_loading, null); ThemeUtil.setListViewLoading(listFooter); lvMicroBlog.addFooterView(listFooter); } public void showMoreFooter() { if (listFooter != null) { lvMicroBlog.removeFooterView(listFooter); } listFooter = getLayoutInflater().inflate(R.layout.list_item_more, null); ThemeUtil.setListViewMore(listFooter); listFooter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { executeTask(); } }); lvMicroBlog.addFooterView(listFooter); } }
[ "cattong@cattong-THINK" ]
cattong@cattong-THINK
2a14a99e32aeaf4410880ef791bd88519baf3a9b
dc24bb78f60a413993af938359bd2c8e744d5c75
/pod-fundamental-services-java/SDK/src/main/java/com/fanap/SsoService/data/modelVo/AccessTokenVo.java
05dee2d4f191ebcee99233700fddd253cca58f3f
[]
no_license
FanapSoft/pod-java-sdk
aa63c3a13d0357b8d44e0bec4094d374487780c6
6141c62945e9a98304b0993a63e297e9bdab29b7
refs/heads/master
2021-12-14T21:40:01.515531
2020-11-18T09:25:25
2020-11-18T09:25:25
198,595,351
1
2
null
2021-12-09T22:47:03
2019-07-24T08:47:23
Java
UTF-8
Java
false
false
3,179
java
package com.fanap.SsoService.data.modelVo; import com.fanap.SsoService.exception.PodException; /** * Created by Shahab Askarian on 5/28/2019. */ public class AccessTokenVo { private final static String REQUIRED_PARAMETER_ERROR_MESSAGE = "Grant_type, redirect_uri, code and clientInfoVo (client_id and client_secret) are required parameters!"; private String grant_type; private String redirect_uri; private String code; private String code_verifier; private ClientInfoVo clientInfoVo = new ClientInfoVo(); public AccessTokenVo(Builder builder) { this.grant_type = builder.getGrant_type(); this.redirect_uri = builder.getRedirect_uri(); this.code = builder.getCode(); this.code_verifier = builder.getCode_verifier(); this.clientInfoVo.setClient_id(builder.getClientInfoVo().getClient_id()); this.clientInfoVo.setClient_secret(builder.getClientInfoVo().getClient_secret()); } public ClientInfoVo getClientInfoVo() { return clientInfoVo; } public String getGrant_type() { return grant_type; } public String getRedirect_uri() { return redirect_uri; } public String getCode() { return code; } public String getCode_verifier() { return code_verifier; } public static class Builder { private String grant_type; private String redirect_uri; private String code; private String code_verifier; private ClientInfoVo clientInfoVo; public Builder() { } public ClientInfoVo getClientInfoVo() { return clientInfoVo; } public Builder setClientInfoVo(ClientInfoVo clientInfoVo) { this.clientInfoVo = clientInfoVo; return this; } public String getGrant_type() { return grant_type; } public Builder setGrant_type(String grant_type) { this.grant_type = grant_type; return this; } public String getRedirect_uri() { return redirect_uri; } public Builder setRedirect_uri(String redirect_uri) { this.redirect_uri = redirect_uri; return this; } public String getCode() { return code; } public Builder setCode(String code) { this.code = code; return this; } public String getCode_verifier() { return code_verifier; } public Builder setCode_verifier(String code_verifier) { this.code_verifier = code_verifier; return this; } public AccessTokenVo build() throws PodException { if (this.getGrant_type() != null && this.getRedirect_uri() != null && this.getCode() != null && this.getClientInfoVo() != null && this.getClientInfoVo().getClient_id() != null && this.getClientInfoVo().getClient_secret() != null) return new AccessTokenVo(this); else throw PodException.invalidParameter(REQUIRED_PARAMETER_ERROR_MESSAGE); } } }
[ "zahra.gholinia76@gmail.com" ]
zahra.gholinia76@gmail.com
71112187bae1df5e78bc89daf6d2b247f8c87cdb
54d212428f7464ab5238a5aac134281d81405bba
/src/main/java/com/mokylin/cabal/modules/tools/entity/Activity.java
16c0d470602b7e17a4fe5d70b400e73f36485ad5
[]
no_license
qq289736032/admin-tools-new
846efcf7f69ddf625a6ee4987ec322e81a6e363d
9494ea5f63f277a4eef28c1da9c8bc292eda49b8
refs/heads/master
2021-05-09T21:41:18.998840
2018-01-25T01:14:39
2018-01-25T01:14:39
118,733,281
1
0
null
null
null
null
UTF-8
Java
false
false
1,503
java
package com.mokylin.cabal.modules.tools.entity; import com.mokylin.cabal.common.persistence.MybatisBaseBean; /** * 作者: 日期: 2014/11/6 15:40 项目: cabal-tools */ public class Activity extends MybatisBaseBean { private static final long serialVersionUID = -541576818287671637L; private int isGlobal;// 是否全服方式 private String serverIds; private String name; private String md5; private String activityName; private String activityDesc; private String originalFile; public int getIsGlobal() { return isGlobal; } public void setIsGlobal(int isGlobal) { this.isGlobal = isGlobal; } public String getServerIds() { return serverIds; } public void setServerIds(String serverIds) { this.serverIds = serverIds; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getActivityName() { return activityName; } public void setActivityName(String activityName) { this.activityName = activityName; } public String getActivityDesc() { return activityDesc; } public void setActivityDesc(String activityDesc) { this.activityDesc = activityDesc; } public boolean isGlobal() { return this.isGlobal == 1 ? true : false; } public String getMd5() { return md5; } public void setMd5(String md5) { this.md5 = md5; } public String getOriginalFile() { return originalFile; } public void setOriginalFile(String originalFile) { this.originalFile = originalFile; } }
[ "289736032@qq.com" ]
289736032@qq.com
2c445f4a23f9e0b2a290aed168408da31c833e96
1a4770c215544028bad90c8f673ba3d9e24f03ad
/second/quark/src/main/java/com/ucpro/feature/webwindow/o/c.java
f0c7437e4e06864bfad0f194ea138179d7425f57
[]
no_license
zhang1998/browser
e480fbd6a43e0a4886fc83ea402f8fbe5f7c7fce
4eee43a9d36ebb4573537eddb27061c67d84c7ba
refs/heads/master
2021-05-03T06:32:24.361277
2018-02-10T10:35:36
2018-02-10T10:35:36
120,590,649
8
10
null
null
null
null
UTF-8
Java
false
false
811
java
package com.ucpro.feature.webwindow.o; /* compiled from: ProGuard */ final class c { String a; long b; long c; long d; long e; long f; private c() { this.b = -1; this.c = -1; this.d = -1; this.e = -1; this.f = -1; } public final String toString() { StringBuffer stringBuffer = new StringBuffer("StatBean{"); stringBuffer.append("id='").append(this.a).append('\''); stringBuffer.append(", tStart=").append(this.b); stringBuffer.append(", t0=").append(this.c); stringBuffer.append(", t1=").append(this.d); stringBuffer.append(", t2=").append(this.e); stringBuffer.append(", t3=").append(this.f); stringBuffer.append('}'); return stringBuffer.toString(); } }
[ "2764207312@qq.com" ]
2764207312@qq.com
18b21d458ebcc7ccb7dd363e6e8f76aec711de0b
3b8690b659fffe81298f91d39c4d5e38e8ffea15
/wc18-back/wc18-api/src/test/java/com/github/mjeanroy/wc18/api/services/AdminApiServiceTest.java
0015695a35c3d6b81f909cefcc57692e1ec08f56
[]
no_license
mjeanroy/wc18
ce0a6924d5a193e0d2c1ed5ef98d7e7d08d00fdf
aea9e8a0ddf3ef4ad67dbbde6fac84a421707068
refs/heads/master
2020-03-21T03:53:49.338315
2018-09-19T14:28:26
2018-09-19T15:08:28
138,079,874
2
0
null
null
null
null
UTF-8
Java
false
false
2,408
java
/** * The MIT License (MIT) * * Copyright (c) 2018 Mickael Jeanroy * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.github.mjeanroy.wc18.api.services; import com.github.mjeanroy.wc18.api.dto.CommitDto; import com.github.mjeanroy.wc18.api.tests.junit.AbstractApiServiceTest; import org.assertj.core.api.Condition; import org.junit.jupiter.api.Test; import javax.inject.Inject; import java.util.List; import static com.github.mjeanroy.wc18.domain.tests.commons.IterableTestUtils.toList; import static org.assertj.core.api.Assertions.assertThat; class AdminApiServiceTest extends AbstractApiServiceTest { @Inject private AdminApiService adminApiService; @Test void it_should_read_changelog() { List<CommitDto> changelog = toList(adminApiService.readChangeLog()); assertThat(changelog) .isNotEmpty() .are(new Condition<CommitDto>() { @Override public boolean matches(CommitDto value) { return value.getAuthorName() != null && !value.getAuthorName().isEmpty(); } }) .are(new Condition<CommitDto>() { @Override public boolean matches(CommitDto value) { return value.getMessage() != null && !value.getMessage().isEmpty(); } }) .are(new Condition<CommitDto>() { @Override public boolean matches(CommitDto value) { return value.getId() != null && !value.getId().isEmpty(); } }); } }
[ "mickael.jeanroy@gmail.com" ]
mickael.jeanroy@gmail.com
ead1a23a10fd9856327f34ed2f709e22b3b01252
d61f077520895174a6c03e5d8db2c6196a76e9eb
/src/test/java/test/testFile.java
23ad0d57d99389cd77fda6030210a566365bf9b3
[]
no_license
pnoker/Sia
0fd965bab406ff5a66509adcc83073648a061c23
4e596bb0beb91c031a583ebfca74203371cdf25c
refs/heads/master
2021-01-12T00:24:27.829656
2017-07-10T11:10:28
2017-07-10T11:10:28
78,720,798
2
0
null
null
null
null
UTF-8
Java
false
false
1,881
java
package test; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; public class testFile { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub // file(内存)----输入流---->【程序】----输出流---->file(内存) File file = new File("d:/temp", "addfile.txt"); try { file.createNewFile(); // 创建文件 } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } // 向文件写入内容(输出流) String str = "亲爱的小南瓜!"; byte bt[] = new byte[1024]; bt = str.getBytes(); try { FileOutputStream in = new FileOutputStream(file); try { in.write(bt, 0, bt.length); in.close(); // boolean success=true; // System.out.println("写入文件成功"); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { // 读取文件内容 (输入流) FileInputStream out = new FileInputStream(file); InputStreamReader isr = new InputStreamReader(out); int ch = 0; while ((ch = isr.read()) != -1) { System.out.print((char) ch); } } catch (Exception e) { // TODO: handle exception } } }
[ "peter-no@foxmail.com" ]
peter-no@foxmail.com
48238bcf1e3c02c3aec09ad11e9991a8b3693a19
13a248a094910d308dcbe772e92229ed2ee682b6
/src/main/java/arrays/SplitArrSumEqualTo.java
3af2912a1e5822ab91c13ff4e84e44db75abedac
[]
no_license
gadzikk/algorithms
cca18ab79b8e1e766f7d6fc9b9097db2077cb93b
cb6607ad19b43357c225e9531d3ebc115ef1de3a
refs/heads/master
2022-12-07T16:22:36.958374
2020-08-23T21:35:56
2020-08-23T21:35:56
273,081,100
0
0
null
null
null
null
UTF-8
Java
false
false
1,784
java
package arrays; /** * Created by gadzik on 08.07.20. */ public class SplitArrSumEqualTo { // https://www.geeksforgeeks.org/split-the-given-array-into-k-sub-arrays-such-that-maximum-sum-of-all-sub-arrays-is-minimum/ static boolean check(int mid, int array[], int n, int K) { int count = 0; int sum = 0; for (int i = 0; i < n; i++) { // If individual element is greater maximum possible sum if (array[i] > mid) { return false; } // Increase sum of current sub - array sum += array[i]; // If the sum is greater than mid increase count if (sum > mid) { count++; sum = array[i]; } } count++; // Check condition if (count <= K) { return true; } return false; } // Function to find maximum subarray sum // which is minimum static int solve(int array[], int n, int K) { int start = 1; int end = 0; for (int i = 0; i < n; i++) { end += array[i]; } // Answer stores possible maximum sub array sum int answer = 0; while (start <= end) { int mid = (start + end) / 2; // If mid is possible solution Put answer = mid; if (check(mid, array, n, K)) { answer = mid; end = mid - 1; } else { start = mid + 1; } } return answer; } public static void main (String[] args) { int array[] = { 1, 2, 3, 4 }; int n = array.length ; int K = 3; System.out.println(solve(array, n, K)); } }
[ "glina41@o2.pl" ]
glina41@o2.pl
7ee2c7151f020a6f86a0aee9a2feda5b737bfc0a
5b6c7069b41e9d281b1f277389c4142b7df6fbf9
/streampipes-performance-tests/src/main/java/org/apache/streampipes/performance/util/ParameterTool.java
4c8976189d18e0daa91afb5f2be3195a0e71c0aa
[ "Apache-2.0", "BSD-3-Clause" ]
permissive
anushkrishnav/incubator-streampipes
1ce61d67bda05898bda79cedf46579c0620fc634
22e98b2656f1ad1ea2cbc74e36da942e75af706c
refs/heads/dev
2023-04-20T19:32:35.283336
2021-05-04T18:48:23
2021-05-04T18:48:23
342,628,747
0
0
Apache-2.0
2021-02-26T16:20:09
2021-02-26T16:08:32
null
UTF-8
Java
false
false
1,354
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.streampipes.performance.util; import org.apache.streampipes.performance.model.PerformanceTestSettings; public class ParameterTool { public static PerformanceTestSettings fromArgs(String[] args) { return new PerformanceTestSettings(toInt(args[0]), toInt(args[1]), toInt(args[2]), toLong(args[3]), toLong (args[4]), toInt(args[5]), args[6]); } private static Long toLong(String arg) { return Long.parseLong(arg); } private static Integer toInt(String arg) { return Integer.parseInt(arg); } }
[ "riemer@fzi.de" ]
riemer@fzi.de
aa6e8b96b1dd182e859e882fe1f77e2798e129f3
95039bd9d72911d2a992fe0f7880d3df98b70f24
/ControvolEngine/src/main/java/accessgit/MRepositoryManager.java
36aea50557c084bbb2f0c6b85d3c9e4255d7af9b
[]
no_license
DennisSchmidtOTHRegensburg/ControVolEclipsePlugin
98e8468783278cdcffb1acad3f9ea56548f5b15e
929c17c5f5e6fb303f9f0c1d96bd452bc9203c93
refs/heads/master
2021-01-11T03:16:13.097429
2016-10-25T20:06:16
2016-10-25T20:06:16
71,079,160
1
0
null
null
null
null
UTF-8
Java
false
false
876
java
package accessgit; import java.io.File; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.storage.file.FileRepositoryBuilder; /** * Manager for implementing AutoCloseable */ public class MRepositoryManager implements AutoCloseable{ Repository rep = null; public Repository getRepository() throws Exception { return rep; } /** * Retrieve repository by file */ public MRepositoryManager(File f) throws Exception { FileRepositoryBuilder builder = new FileRepositoryBuilder(); rep = builder.findGitDir(f).build(); } public static MRepositoryManager getManager(File f) throws Exception { return new MRepositoryManager(f); } /* (non-Javadoc) * @see java.lang.AutoCloseable#close() */ @Override public void close() throws Exception { rep.close(); } }
[ "pc@pc-PC" ]
pc@pc-PC
702123f837e665d8b40d120e67acb4c19ab0badd
43e4f1839f82833cdcc9774c0a69a49f256465e6
/cdp4j/src/main/java/io/webfolder/cdp/type/network/ResourceTiming.java
06a58f47f8ad8e7a643892adbc8bbee81768b9e4
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
iMaksimkin/selenium_java
8a840d3a23f169a60e45c4fb73f753f5da7f3f05
8f640f7f29b8d7229a56d688e6b3ff1bd2e045ce
refs/heads/master
2020-11-25T07:43:09.473004
2019-12-16T02:00:28
2019-12-16T02:00:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,145
java
/** * cdp4j Commercial License * * Copyright 2017, 2018 WebFolder OÜ * * Permission is hereby granted, to "____" 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 and sublicense of the Software, and to permit persons to whom * the Software is furnished to do so, subject to the following conditions: * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package io.webfolder.cdp.type.network; /** * Timing information for the request */ public class ResourceTiming { private Double requestTime; private Double proxyStart; private Double proxyEnd; private Double dnsStart; private Double dnsEnd; private Double connectStart; private Double connectEnd; private Double sslStart; private Double sslEnd; private Double workerStart; private Double workerReady; private Double sendStart; private Double sendEnd; private Double pushStart; private Double pushEnd; private Double receiveHeadersEnd; /** * Timing's requestTime is a baseline in seconds, while the other numbers are ticks in * milliseconds relatively to this requestTime. */ public Double getRequestTime() { return requestTime; } /** * Timing's requestTime is a baseline in seconds, while the other numbers are ticks in * milliseconds relatively to this requestTime. */ public void setRequestTime(Double requestTime) { this.requestTime = requestTime; } /** * Started resolving proxy. */ public Double getProxyStart() { return proxyStart; } /** * Started resolving proxy. */ public void setProxyStart(Double proxyStart) { this.proxyStart = proxyStart; } /** * Finished resolving proxy. */ public Double getProxyEnd() { return proxyEnd; } /** * Finished resolving proxy. */ public void setProxyEnd(Double proxyEnd) { this.proxyEnd = proxyEnd; } /** * Started DNS address resolve. */ public Double getDnsStart() { return dnsStart; } /** * Started DNS address resolve. */ public void setDnsStart(Double dnsStart) { this.dnsStart = dnsStart; } /** * Finished DNS address resolve. */ public Double getDnsEnd() { return dnsEnd; } /** * Finished DNS address resolve. */ public void setDnsEnd(Double dnsEnd) { this.dnsEnd = dnsEnd; } /** * Started connecting to the remote host. */ public Double getConnectStart() { return connectStart; } /** * Started connecting to the remote host. */ public void setConnectStart(Double connectStart) { this.connectStart = connectStart; } /** * Connected to the remote host. */ public Double getConnectEnd() { return connectEnd; } /** * Connected to the remote host. */ public void setConnectEnd(Double connectEnd) { this.connectEnd = connectEnd; } /** * Started SSL handshake. */ public Double getSslStart() { return sslStart; } /** * Started SSL handshake. */ public void setSslStart(Double sslStart) { this.sslStart = sslStart; } /** * Finished SSL handshake. */ public Double getSslEnd() { return sslEnd; } /** * Finished SSL handshake. */ public void setSslEnd(Double sslEnd) { this.sslEnd = sslEnd; } /** * Started running ServiceWorker. */ public Double getWorkerStart() { return workerStart; } /** * Started running ServiceWorker. */ public void setWorkerStart(Double workerStart) { this.workerStart = workerStart; } /** * Finished Starting ServiceWorker. */ public Double getWorkerReady() { return workerReady; } /** * Finished Starting ServiceWorker. */ public void setWorkerReady(Double workerReady) { this.workerReady = workerReady; } /** * Started sending request. */ public Double getSendStart() { return sendStart; } /** * Started sending request. */ public void setSendStart(Double sendStart) { this.sendStart = sendStart; } /** * Finished sending request. */ public Double getSendEnd() { return sendEnd; } /** * Finished sending request. */ public void setSendEnd(Double sendEnd) { this.sendEnd = sendEnd; } /** * Time the server started pushing request. */ public Double getPushStart() { return pushStart; } /** * Time the server started pushing request. */ public void setPushStart(Double pushStart) { this.pushStart = pushStart; } /** * Time the server finished pushing request. */ public Double getPushEnd() { return pushEnd; } /** * Time the server finished pushing request. */ public void setPushEnd(Double pushEnd) { this.pushEnd = pushEnd; } /** * Finished receiving response headers. */ public Double getReceiveHeadersEnd() { return receiveHeadersEnd; } /** * Finished receiving response headers. */ public void setReceiveHeadersEnd(Double receiveHeadersEnd) { this.receiveHeadersEnd = receiveHeadersEnd; } }
[ "kouzmine_serguei@yahoo.com" ]
kouzmine_serguei@yahoo.com
d2168090a1b29105edf070c0416538ab1637a907
8727b1cbb8ca63d30340e8482277307267635d81
/PolarServer/src/com/game/buff/structs/BuffConst.java
a2e14aa73805a83e458e7257db92a40a4175041a
[]
no_license
taohyson/Polar
50026903ded017586eac21a7905b0f1c6b160032
b0617f973fd3866bed62da14f63309eee56f6007
refs/heads/master
2021-05-08T12:22:18.884688
2015-12-11T01:44:18
2015-12-11T01:44:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,297
java
package com.game.buff.structs; public interface BuffConst { public static int SINGLEMEDITATION=1200;//单人打座 public static int PETEMEDITATION=1201;//与宠物双修BUFF public static int ROLESMEDITATION=1202;//与玩家双修 //盟战BUFF public static int KINGCITY_NORMAL=1119;//王城普通成员 public static int KINGCITY_KING=1185;//占领的王座盟主 获得BUFF public static int KINGCITY_KING1=1186;//占领的王座盟主 获得BUFF public static int KINGCITY_KING2=1187;//占领的王座盟主 获得BUFF /*盟战 用不上的 BUFF ID 被我关了 汪振瀚 // public static int KINGCITY_NORMAL=22210;//王城普通成员 // public static int KINGCITY_KING=22211;//王城秦王 // public static int KINGCITY_HEGEMONY=22212;//秦王霸权 // public static int KINGCITY_RENDE=22213;//秦王仁德 */ public static int DINGSHEN=10010;//定身BUFF public static int LONGYUAN_ZQ_BUFF=1404;//龙元心法 减少真气20%使用量 public static int HORSE_MONEY_BUFF=1405;//坐骑升级免金币 public static int HORSE_FORMONEY_BUFF=1410;//坐骑升级永久免金币 public static int GOUHUN_BUFF=21010;//半步勾魂 public static int ZHEYING_BUFF=21011;//醉风遮影 public static int LINGLONG_BUFF=21012;//玲珑霸体 public static int FLAG_BUFF=22215;//领地争夺占攻击者 public static int FLAG_DEF_BUFF=22216;//领地争夺占守卫 public static int MEIHUA_BUFF=24013;//梅花破甲减防buff public static int WEIDUAN_LOGIN = 1165;//微端登陆的时候所用的Buff public static int TRANSFER_WUDI = 1173;//传送时无敌Buff // 1070 生命之光 对应新增效果类型(102)MAXHP = 8; // 1071 守护之魂 对应新增效果类型(103)//reduce_injure 103 // 1072 战神之力 对应新增效果类型(104) ATTACK = 11; // 1073 守护之光 对应新增效果类型(105)DEFENSE = 12; // 1074 治愈之光 对应新增效果类型(106)int HP = 5; // 1075 风行者 对应新增效果类型(107)加2个buff,SPEED = 17;和 DODGE = 13; public static int LIGHTOFLIFE = 1070; public static int GUARDIANSPIRIT = 1071; public static int BATTLEFORCE = 1072; public static int GUARDIANOFLIGHT = 1073; public static int HEALINGLIGHT = 1074; public static int WINDRUNNER= 1075; }
[ "zhuyuanbiao@ZHUYUANBIAO.rd.com" ]
zhuyuanbiao@ZHUYUANBIAO.rd.com
d227e45ff2828ac5fd10e70d4432950b569ae8fc
6f36fc4a0f9c680553f8dd64c5df55c403f8f2ed
/src/main/java/it/csi/siac/siacbilser/integration/entitymapping/converter/ImpegnoSiopeAssenzaMotivazioneConverter.java
a923442d37557f4d0119e6683a00f44f7eb22e77
[]
no_license
unica-open/siacbilser
b46b19fd382f119ec19e4e842c6a46f9a97254e2
7de24065c365564b71378ce9da320b0546474130
refs/heads/master
2021-01-06T13:25:34.712460
2020-03-04T08:44:26
2020-03-04T08:44:26
241,339,144
0
0
null
null
null
null
UTF-8
Java
false
false
2,001
java
/* *SPDX-FileCopyrightText: Copyright 2020 | CSI Piemonte *SPDX-License-Identifier: EUPL-1.2 */ package it.csi.siac.siacbilser.integration.entitymapping.converter; import org.springframework.stereotype.Component; import it.csi.siac.siacbilser.integration.entity.SiacTMovgest; import it.csi.siac.siacbilser.integration.entity.SiacTMovgestT; import it.csi.siac.siacbilser.integration.entitymapping.BilMapId; import it.csi.siac.siacfinser.model.Impegno; import it.csi.siac.siacfinser.model.siopeplus.SiopeAssenzaMotivazione; /** * The Class ImpegnoSiopeAssenzaMotivazioneConverter. */ @Component public class ImpegnoSiopeAssenzaMotivazioneConverter extends ExtendedDozerConverter<Impegno, SiacTMovgest> { /** * Instantiates a new impegno - siope assenza motivazione converter. */ public ImpegnoSiopeAssenzaMotivazioneConverter() { super(Impegno.class, SiacTMovgest.class); } @Override public Impegno convertFrom(SiacTMovgest src, Impegno dest) { SiacTMovgestT siacTMovgestT = getSiacTMovgestT(src); if(siacTMovgestT == null || siacTMovgestT.getSiacDSiopeAssenzaMotivazione() == null || dest == null){ return dest; } SiopeAssenzaMotivazione siopeAssenzaMotivazione = map(siacTMovgestT.getSiacDSiopeAssenzaMotivazione(), SiopeAssenzaMotivazione.class, BilMapId.SiacDSiopeAssenzaMotivazione_SiopeAssenzaMotivazione); dest.setSiopeAssenzaMotivazione(siopeAssenzaMotivazione); return dest; } /** * Trova il ts corrispondente alla testata * @param src la testata * @return il ts */ private SiacTMovgestT getSiacTMovgestT(SiacTMovgest src) { if(src == null || src.getSiacTMovgestTs() == null) { return null; } for(SiacTMovgestT siacTMovgestT : src.getSiacTMovgestTs()){ if(siacTMovgestT.getDataCancellazione() == null && "T".equals(siacTMovgestT.getSiacDMovgestTsTipo().getMovgestTsTipoCode())) { return siacTMovgestT; } } return null; } @Override public SiacTMovgest convertTo(Impegno src, SiacTMovgest dest) { return dest; } }
[ "barbara.malano@csi.it" ]
barbara.malano@csi.it
28aa54e4df06492ad86a75b4d4baa8b8c868380e
2c319d505e8f6a21708be831e9b5426aaa86d61e
/web/core/src/main/java/leap/web/cookie/AbstractCookieBean.java
4978324652b5f439493832bedeeb3894a6ba731f
[ "Apache-2.0" ]
permissive
leapframework/framework
ed0584a1468288b3a6af83c1923fad2fd228a952
0703acbc0e246519ee50aa9957f68d931fab10c5
refs/heads/dev
2023-08-17T02:14:02.236354
2023-08-01T09:39:07
2023-08-01T09:39:07
48,562,236
47
23
Apache-2.0
2022-12-14T20:36:57
2015-12-25T01:54:52
Java
UTF-8
Java
false
false
3,583
java
/* * Copyright 2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package leap.web.cookie; import javax.servlet.http.Cookie; import leap.core.annotation.Inject; import leap.lang.Strings; import leap.lang.convert.Converts; import leap.web.Request; import leap.web.Response; import leap.web.config.WebConfig; public abstract class AbstractCookieBean { protected @Inject WebConfig webConfig; public AbstractCookieBean() { super(); } protected int getCookieMaxAge(Request request) { String expiresParameter = getCookieExpiresParameter(); if(null != expiresParameter) { String expires = request.getParameter(expiresParameter); if(!Strings.isEmpty(expires)){ return Converts.toInt(expires); } } return getCookieExpires(); } protected String getCookieName(Request request) { if(isCookieCrossContext()) { return getCookieName(); }else{ String contextPath = request.getContextPath(); if(contextPath.length() == 0) { return getCookieName() + "_root"; }else{ return getCookieName() + "_" + contextPath.substring(1); } } } protected String getCookiePath(Request request) { if(isCookieCrossContext()) { return "/"; }else{ return request.getContextPath() + "/"; } } protected String getCookieDomain(Request request) { String domain = getCookieDomain(); if(Strings.isEmpty(domain)) { return null; } String domainWithDot = domain.startsWith(".") ? domain : "." + domain; String host = "." + request.getServletRequest().getServerName(); if(Strings.endsWith(host, domainWithDot)) { return domain; } return null; } public Cookie getCookie(Request request) { return request.getCookie(getCookieName(request)); } public void setCookie(Request request, Response response, String value) { setCookie(request, response, value, getCookieMaxAge(request)); } public void setCookie(Request request, Response response, String value, int maxAge) { Cookie cookie = new Cookie(getCookieName(request), value); cookie.setPath(getCookiePath(request)); cookie.setMaxAge(maxAge); cookie.setHttpOnly(isCookieHttpOnly()); cookie.setSecure(request.isSecure()); String domain = getCookieDomain(request); if(null != domain) { cookie.setDomain(domain); } response.addCookie(cookie); } public boolean removeCookie(Request request, Response response) { Cookie cookie = getCookie(request); if(null != cookie){ removeCookie(request, response, cookie); return true; } return false; } protected void removeCookie(Request request, Response response, Cookie cookie) { cookie.setPath(getCookiePath(request)); response.removeCookie(cookie); } public boolean isCookieHttpOnly() { return true; } public String getCookieDomain() { return webConfig.getCookieDomain(); } public boolean isCookieCrossContext() { return false; } public String getCookieExpiresParameter() { return null; } public int getCookieExpires() { return -1; } public abstract String getCookieName(); }
[ "live.evan@gmail.com" ]
live.evan@gmail.com
910535229781993753d6dcd1c1cfc82cc1447556
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-14263-91-1-NSGA_II-LineCoverage:ExceptionType:StackTraceSimilarity/com/xpn/xwiki/web/XWikiAction_ESTest.java
1fb7c93906fd46be3a950898e433d2703d893847
[]
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
546
java
/* * This file was automatically generated by EvoSuite * Mon Apr 06 23:29:01 UTC 2020 */ package com.xpn.xwiki.web; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class XWikiAction_ESTest extends XWikiAction_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
4ab1927564dc035a66a2667902eb33f7259ec8bc
4089af4c1578b7c0499a889585142bbe311b2f34
/common/src/main/java/com/bly/common/support/cache/jedis/Executor.java
b4b19c6991ae316c3aac3d2da44e6f41c6f8c277
[ "Apache-2.0" ]
permissive
himalayaRange/power
ac6c9de6f6ebfe5181a72f8fa9d28da7485d7a2f
fa8148751d803e123841a0a848da22b9a0d4ae8d
refs/heads/master
2020-04-24T06:53:22.476318
2019-02-21T02:02:32
2019-02-21T02:02:32
171,780,900
1
0
null
null
null
null
UTF-8
Java
false
false
162
java
package com.bly.common.support.cache.jedis; import redis.clients.jedis.ShardedJedis; public interface Executor<K> { public K execute(ShardedJedis jedis); }
[ "2531592408@qq.com" ]
2531592408@qq.com
797bc46bdacea01a50f0c762d1c8e8e8651ceb02
9e64d53b69c90e582fd8d8d79fb8a7e7dc93fb17
/com.hilotec.elexis.messwerte.v2/src/com/hilotec/elexis/messwerte/v2/data/typen/MesswertTypScale.java
3a340fce538a0035b4b38607c75fa0b24bba362d
[]
no_license
jsigle/elexis-base
e89e277516f2eb94d870f399266560700820dcc5
fbda2efb49220b61ef81da58c1fa4b68c28bbcd4
refs/heads/master
2021-01-17T00:08:29.782414
2013-05-05T18:12:15
2013-05-05T18:12:15
6,995,370
0
1
null
null
null
null
UTF-8
Java
false
false
3,615
java
/******************************************************************************* * Copyright (c) 2009-2010, A. Kaufmann and Elexis * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * A. Kaufmann - initial implementation * P. Chaubert - adapted to Messwerte V2 * medshare GmbH - adapted to Messwerte V2.1 in February 2012 * * $Id: MesswertTypNum.java 5386 2009-06-23 11:34:17Z rgw_ch $ *******************************************************************************/ package com.hilotec.elexis.messwerte.v2.data.typen; import java.text.MessageFormat; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Spinner; import org.eclipse.swt.widgets.Widget; import ch.elexis.selectors.ActiveControl; import ch.elexis.selectors.SpinnerField; import ch.elexis.util.SWTHelper; import ch.rgw.tools.Log; import com.hilotec.elexis.messwerte.v2.data.Messwert; import com.hilotec.elexis.messwerte.v2.data.MesswertBase; /** * @author Antoine Kaufmann */ public class MesswertTypScale extends MesswertBase implements IMesswertTyp { int defVal = 0; /** * Kleinster auswaehlbarer Wert */ int min = 0; /** * Groesster auswaehlbarer Wert */ int max = 0; public MesswertTypScale(String n, String t, String u){ super(n, t, u); } public String erstelleDarstellungswert(Messwert messwert){ return messwert.getWert(); } public String getDefault(Messwert messwert){ Integer retVal = defVal; if (formula != null) { String sWert = evalateFormula(formula, messwert, retVal.toString()); try { retVal = Integer.parseInt(sWert); } catch (Exception e) { log.log(MessageFormat.format(Messages.MesswertTypScale_CastFailure, sWert), Log.ERRORS); } } return retVal.toString(); } public void setDefault(String str){ defVal = Integer.parseInt(str); } /** * Groesster auswaehlbarer Wert setzen */ public void setMax(int m){ max = m; } /** * Kleinster auswaehlbarer Wert setzen */ public void setMin(int m){ min = m; } public Widget createWidget(Composite parent, Messwert messwert){ widget = new Spinner(parent, SWT.NONE); ((Spinner) widget).setMinimum(min); ((Spinner) widget).setMaximum(max); ((Spinner) widget).setSelection(Integer.parseInt(messwert.getWert())); ((Spinner) widget).setLayoutData(SWTHelper.getFillGridData(1, true, 1, false)); setShown(true); return widget; } public String getDarstellungswert(String wert){ return wert; } @Override public void saveInput(Messwert messwert){ messwert.setWert(Integer.toString(((Spinner) widget).getSelection())); } @Override public boolean checkInput(Messwert messwert, String pattern){ super.checkInput(messwert, pattern); String value = ((Spinner) widget).getText(); if (value.matches(pattern) || pattern == null) { return true; } return false; } public ActiveControl createControl(Composite parent, Messwert messwert, boolean bEditable){ IMesswertTyp dft = messwert.getTyp(); String labelText = dft.getTitle(); if (!dft.getUnit().equals("")) { //$NON-NLS-1$ labelText += " [" + dft.getUnit() + "]"; //$NON-NLS-1$ //$NON-NLS-2$ } SpinnerField sf = new SpinnerField(parent, 0, labelText, min, max); sf.setText(messwert.getDarstellungswert()); return sf; } @Override public String getActualValue(){ return ((Spinner) widget).getText(); } }
[ "jsigle@think3.sc.de" ]
jsigle@think3.sc.de
23a3c20b139c5042faeaf65f25199f97853db3d9
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/25/25_1312258d5527f297e03bf7ebd87b20b50311e5ef/AmbiguousValue/25_1312258d5527f297e03bf7ebd87b20b50311e5ef_AmbiguousValue_t.java
136e0db937104362016d7585464c76c80f686925
[]
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
4,860
java
/* * ============================================================================ * GNU General Public License * ============================================================================ * * Copyright (C) 2006-2011 Serotonin Software Technologies Inc. http://serotoninsoftware.com * @author Matthew Lohbihler * * 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/>. * * When signing a commercial license with Serotonin Software Technologies Inc., * the following extension to GPL is made. A special exception to the GPL is * included to allow you to distribute a combined work that includes BAcnet4J * without being obliged to provide the source code for any proprietary components. */ package com.serotonin.bacnet4j.type; import com.serotonin.bacnet4j.exception.BACnetException; import com.serotonin.bacnet4j.type.primitive.Boolean; import com.serotonin.util.queue.ByteQueue; public class AmbiguousValue extends Encodable { private static final long serialVersionUID = -1554703777454557893L; private final ByteQueue data = new ByteQueue(); public AmbiguousValue(ByteQueue queue) { TagData tagData = new TagData(); peekTagData(queue, tagData); readAmbiguousData(queue, tagData); } public AmbiguousValue(ByteQueue queue, int contextId) throws BACnetException { popStart(queue, contextId); TagData tagData = new TagData(); while (true) { peekTagData(queue, tagData); if (tagData.isEndTag(contextId)) break; readAmbiguousData(queue, tagData); } popEnd(queue, contextId); } @Override public void write(ByteQueue queue, int contextId) { throw new RuntimeException("Don't write ambigous values, convert to actual types first"); } @Override public void write(ByteQueue queue) { throw new RuntimeException("Don't write ambigous values, convert to actual types first"); } private void readAmbiguousData(ByteQueue queue, TagData tagData) { if (!tagData.contextSpecific) { // Application class. if (tagData.tagNumber == Boolean.TYPE_ID) copyData(queue, 1); else copyData(queue, tagData.getTotalLength()); } else { // Context specific class. if (tagData.isStartTag()) { // Copy the start tag copyData(queue, 1); // Remember the context id int contextId = tagData.tagNumber; // Read ambiguous data until we find the end tag. while (true) { peekTagData(queue, tagData); if (tagData.isEndTag(contextId)) break; readAmbiguousData(queue, tagData); } // Copy the end tag copyData(queue, 1); } else copyData(queue, tagData.getTotalLength()); } } @Override public String toString() { return "Ambiguous(" + data + ")"; } private void copyData(ByteQueue queue, int length) { while (length-- > 0) data.push(queue.pop()); } public boolean isNull() { return data.size() == 1 && data.peek(0) == 0; } public <T extends Encodable> T convertTo(Class<T> clazz) throws BACnetException { return read(new ByteQueue(data.peekAll()), clazz); } @Override public int hashCode() { final int PRIME = 31; int result = 1; result = PRIME * result + ((data == null) ? 0 : data.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof Encodable)) return false; Encodable eobj = (Encodable) obj; try { return convertTo(eobj.getClass()).equals(obj); } catch (BACnetException e) { return false; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
bf9d82259497336249ed3ffc18e2dc990038dcf4
ab9a84a90baa4d11e6fdd78d4ac7a67890d0ca92
/plugins/gradle/src/org/jetbrains/plugins/gradle/model/data/BuildParticipant.java
e2228afcb465a5287a42e604d1d148f95f94e959
[ "Apache-2.0" ]
permissive
noti0na1/intellij-community
ccf1b2f66814b2fa17774cdd4a0b949d2b482d52
b8af29ff552e564d23ee97cec93d5f4f51636be9
refs/heads/master
2020-06-04T07:15:35.256773
2017-02-21T23:56:33
2017-02-22T00:00:23
82,760,271
1
0
null
2017-02-22T04:23:37
2017-02-22T04:23:37
null
UTF-8
Java
false
false
1,884
java
/* * Copyright 2000-2017 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.jetbrains.plugins.gradle.model.data; import com.intellij.util.xmlb.annotations.AbstractCollection; import com.intellij.util.xmlb.annotations.Attribute; import com.intellij.util.xmlb.annotations.OptionTag; import com.intellij.util.xmlb.annotations.Tag; import org.jetbrains.annotations.NotNull; import java.io.Serializable; import java.util.HashSet; import java.util.Set; /** * @author Vladislav.Soroka * @since 2/18/2017 */ @Tag("build") public class BuildParticipant implements Serializable { private String myRootPath; @NotNull private Set<String> myProjects = new HashSet<>(); @Attribute("path") public String getRootPath() { return myRootPath; } public void setRootPath(String rootPath) { myRootPath = rootPath; } @AbstractCollection(surroundWithTag = false, elementTag = "project", elementValueAttribute = "path") @OptionTag(tag = "projects", nameAttribute = "") @NotNull public Set<String> getProjects() { return myProjects; } public void setProjects(@NotNull Set<String> projects) { myProjects = projects; } public BuildParticipant copy() { BuildParticipant result = new BuildParticipant(); result.myRootPath = myRootPath; result.myProjects = new HashSet<>(myProjects); return result; } }
[ "Vladislav.Soroka@jetbrains.com" ]
Vladislav.Soroka@jetbrains.com
01997fc18b5a5f4ecb45191498e6dbf19e4b2d6e
69ad45b51f6367ee626e42cc58e47121b2248bc6
/src/main/java/scp/entities/SCPFilterRatAttack.java
8c3c9f293b09a1036cc226b1db3015b7f3b17178
[]
no_license
IsoMSMS/SecureCraftProtect
cf60d5ff73380eb46275229fd0fa86580af29776
3fc0ae0883e95bd48b9ef6ab0c7e182c87c5f810
refs/heads/master
2021-01-21T08:01:42.723945
2013-11-19T07:17:44
2013-11-19T07:17:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
432
java
package scp.entities; import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import scp.SCPPotion; final class SCPFilterRatAttack implements IEntitySelector { public boolean isEntityApplicable(Entity par1Entity) { return par1Entity instanceof EntityLiving && ((EntityLiving)par1Entity).isPotionActive(SCPPotion.verminGod); } }
[ "ntzrmtthihu777@gmail.com" ]
ntzrmtthihu777@gmail.com
ef1442eac7c32c97973163f4048a829d79bda13e
77499ab233b7766e14fffac6ffa698e7cd8650a3
/OSATE-AADL2_projects/osate.tests/src/aadl2/tests/ModeTest.java
33587818467c11990ddbd58c6314e4cfe36fdd5b
[ "MIT" ]
permissive
carduswork/SmartFireAlarm
a15fb2857810742521c6976466f5fdea54143b8b
6085b3998d106cd030974f887ae1f428bdd5d3cd
refs/heads/master
2022-01-09T14:52:42.523976
2019-06-22T06:55:47
2019-06-22T06:55:47
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,771
java
/** */ package aadl2.tests; import aadl2.Aadl2Factory; import aadl2.Mode; import junit.textui.TestRunner; /** * <!-- begin-user-doc --> * A test case for the model object '<em><b>Mode</b></em>'. * <!-- end-user-doc --> * <p> * The following features are tested: * <ul> * <li>{@link aadl2.Mode#isDerived() <em>Derived</em>}</li> * </ul> * </p> * @generated */ public class ModeTest extends ModeFeatureTest { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static void main(String[] args) { TestRunner.run(ModeTest.class); } /** * Constructs a new Mode test case with the given name. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ModeTest(String name) { super(name); } /** * Returns the fixture for this Mode test case. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected Mode getFixture() { return (Mode)fixture; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see junit.framework.TestCase#setUp() * @generated */ @Override protected void setUp() throws Exception { setFixture(Aadl2Factory.eINSTANCE.createMode()); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see junit.framework.TestCase#tearDown() * @generated */ @Override protected void tearDown() throws Exception { setFixture(null); } /** * Tests the '{@link aadl2.Mode#isDerived() <em>Derived</em>}' feature getter. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see aadl2.Mode#isDerived() * @generated */ public void testIsDerived() { // TODO: implement this feature getter test method // Ensure that you remove @generated or mark it @generated NOT fail(); } } //ModeTest
[ "renangreca@gmail.com" ]
renangreca@gmail.com
10af6f66416274bd16ef1a1fcc66c950f4e44478
8af1164bac943cef64e41bae312223c3c0e38114
/results-java/netty--netty/9da4250917a709085ac064904db8253f00693dee/before/IntObjectMap.java
760a7925cf6791cf3232104c2aefc16babf63a07
[]
no_license
fracz/refactor-extractor
3ae45c97cc63f26d5cb8b92003b12f74cc9973a9
dd5e82bfcc376e74a99e18c2bf54c95676914272
refs/heads/master
2021-01-19T06:50:08.211003
2018-11-30T13:00:57
2018-11-30T13:00:57
87,353,478
0
0
null
null
null
null
UTF-8
Java
false
false
2,979
java
/* * Copyright 2014 The Netty Project * * The Netty Project licenses this file to you under the Apache License, version 2.0 (the * "License"); you may not use this file except in compliance with the License. You may obtain a * copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under the License * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express * or implied. See the License for the specific language governing permissions and limitations under * the License. */ package io.netty.util.collection; /** * Interface for a primitive map that uses {@code int}s as keys. * * @param <V> the value type stored in the map. */ public interface IntObjectMap<V> { /** * An Entry in the map. * * @param <V> the value type stored in the map. */ interface Entry<V> { /** * Gets the key for this entry. */ int key(); /** * Gets the value for this entry. */ V value(); /** * Sets the value for this entry. */ void setValue(V value); } /** * Gets the value in the map with the specified key. * * @param key the key whose associated value is to be returned. * @return the value or {@code null} if the key was not found in the map. */ V get(int key); /** * Puts the given entry into the map. * * @param key the key of the entry. * @param value the value of the entry. * @return the previous value for this key or {@code null} if there was no previous mapping. */ V put(int key, V value); /** * Puts all of the entries from the given map into this map. */ void putAll(IntObjectMap<V> sourceMap); /** * Removes the entry with the specified key. * * @param key the key for the entry to be removed from this map. * @return the previous value for the key, or {@code null} if there was no mapping. */ V remove(int key); /** * Returns the number of entries contained in this map. */ int size(); /** * Indicates whether or not this map is empty (i.e {@link #size()} == {@code 0]). */ boolean isEmpty(); /** * Clears all entries from this map. */ void clear(); /** * Indicates whether or not this map contains a value for the specified key. */ boolean containsKey(int key); /** * Indicates whether or not the map contains the specified value. */ boolean containsValue(V value); /** * Gets an iterable collection of the entries contained in this map. */ Iterable<Entry<V>> entries(); /** * Gets the keys contained in this map. */ int[] keys(); /** * Gets the values contained in this map. */ V[] values(Class<V> clazz); }
[ "fraczwojciech@gmail.com" ]
fraczwojciech@gmail.com
83901f9775a61ab7104ffce8454e1c90d9ac8140
cc65e10feea55bfa97cade23176cd6e574d3bbea
/commons/commons-dicts/src/main/java/com/imall/commons/dicts/DeviceTypeCodeEnum.java
f30b87769de072549ec3a97441cb678429b37966
[]
no_license
weishihuai/imallCloudc
ef5a0d7e4866ad7e63251dff512afede7246bd4f
f3163208eaf539aa63dc9e042d2ff6c7403aa405
refs/heads/master
2021-08-20T05:42:23.717707
2017-11-28T09:10:36
2017-11-28T09:10:36
112,305,704
2
4
null
null
null
null
UTF-8
Java
false
false
1,666
java
package com.imall.commons.dicts; /** * 设备 类型 */ public enum DeviceTypeCodeEnum implements ICodeEnum{ TEMPERATURE_AND_HUMIDITY_TESTING("TEMPERATURE_AND_HUMIDITY_TESTING", "温湿度检测设备"), REFRIGERATION("REFRIGERATION", "冷藏设备"), CHINESE_HERBAL_PIECES_DISPENSING("CHINESE_HERBAL_PIECES_DISPENSING", "中药饮片调配设备"), PHARMACEUTICAL_DISMANTLE("PHARMACEUTICAL_DISMANTLE", "药品拆零设备"), SPECIAL_FOR_DRUG_MANAGEMENT("SPECIAL_FOR_DRUG_MANAGEMENT", "特殊管理药品专用设备"), LIGHT_AVOIDING("LIGHT_AVOIDING", "避光设备"), VENTILATION("VENTILATION", "通风设备"), FIRE_FIGHTING("FIRE_FIGHTING", "消防设备"), LIGHTING("LIGHTING", "照明设备"), ACCEPTANCE_MAINTENANCE("ACCEPTANCE_MAINTENANCE", "验收养护设备"); private String code; private String name; DeviceTypeCodeEnum(String code, String name){ this.code = code; this.name = name; } public static DeviceTypeCodeEnum fromCode(String code) { for (DeviceTypeCodeEnum deviceTypeCodeEnum : DeviceTypeCodeEnum.values()) { if (deviceTypeCodeEnum.code.equals(code)) { return deviceTypeCodeEnum; } } String error = code == null ? GlobalExt.ENUM_FROM_CODE_NULL : "".equals(code) ? GlobalExt.ENUM_FROM_CODE_BLANK : "code=" + code; throw new RuntimeException(DeviceTypeCodeEnum.class.getName() + ":" + GlobalExt.ENUM_FROM_CODE_ERROR + error); } @Override public String toName() { return name; } @Override public String toCode() { return code; } }
[ "34024258+weishihuai@users.noreply.github.com" ]
34024258+weishihuai@users.noreply.github.com
56483d0a8586ae36a3263de124a9bcbfa8a81d0b
f7770e21f34ef093eb78dae21fd9bde99b6e9011
/src/main/java/com/hengyuan/hicash/parameters/response/user/SupplierInfoByCityMsgResp.java
fc749c2f8299f60b8ce3c92efa6d63b0c38172ea
[]
no_license
webvul/HicashAppService
9ac8e50c00203df0f4666cd81c108a7f14a3e6e0
abf27908f537979ef26dfac91406c1869867ec50
refs/heads/master
2020-03-22T19:58:41.549565
2017-12-26T08:30:04
2017-12-26T08:30:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
680
java
package com.hengyuan.hicash.parameters.response.user; import java.util.List; import com.hengyuan.hicash.entity.mer.SupplierEntity; import com.hengyuan.hicash.parameters.response.ParmResponse; /** * 根据城市code查询商户 * * @author lihua.Ren * @create date 2016-01-26 * */ public class SupplierInfoByCityMsgResp extends ParmResponse { private List<SupplierEntity> supplierList; /** * @return the supplierList */ public List<SupplierEntity> getSupplierList() { return supplierList; } /** * @param supplierList the supplierList to set */ public void setSupplierList(List<SupplierEntity> supplierList) { this.supplierList = supplierList; } }
[ "hanlu@dpandora.cn" ]
hanlu@dpandora.cn
a5b5335f26a63c17bc7bce7dd959ea42bac6a902
2edbc7267d9a2431ee3b58fc19c4ec4eef900655
/AL-Game/data/scripts/system/handlers/quest/ascension/_2904Dispatch_To_Altgard_Chanter_Cleric.java
30369184545bdd9871363a539f6d7e633cb49477
[]
no_license
EmuZONE/Aion-Lightning-5.1
3c93b8bc5e63fd9205446c52be9b324193695089
f4cfc45f6aa66dfbfdaa6c0f140b1861bdcd13c5
refs/heads/master
2020-03-08T14:38:42.579437
2018-04-06T04:18:19
2018-04-06T04:18:19
128,191,634
1
1
null
null
null
null
UTF-8
Java
false
false
3,116
java
/* * This file is part of Encom. **ENCOM FUCK OTHER SVN** * * Encom is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Encom 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 Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with Encom. If not, see <http://www.gnu.org/licenses/>. */ package quest.ascension; import com.aionemu.gameserver.model.gameobjects.Npc; import com.aionemu.gameserver.model.gameobjects.player.Player; import com.aionemu.gameserver.network.aion.serverpackets.SM_DIALOG_WINDOW; import com.aionemu.gameserver.questEngine.handlers.QuestHandler; import com.aionemu.gameserver.questEngine.model.QuestEnv; import com.aionemu.gameserver.questEngine.model.QuestState; import com.aionemu.gameserver.questEngine.model.QuestStatus; import com.aionemu.gameserver.services.teleport.TeleportService2; import com.aionemu.gameserver.utils.PacketSendUtility; /****/ /** Author Rinzler (Encom) /****/ public class _2904Dispatch_To_Altgard_Chanter_Cleric extends QuestHandler { private final static int questId = 2904; public _2904Dispatch_To_Altgard_Chanter_Cleric() { super(questId); } @Override public boolean onLvlUpEvent(QuestEnv env) { return defaultOnLvlUpEvent(env, 2009); } @Override public void register() { qe.registerOnLevelUp(questId); qe.registerQuestNpc(204191).addOnTalkEvent(questId); qe.registerQuestNpc(203559).addOnTalkEvent(questId); } @Override public boolean onDialogEvent(QuestEnv env) { final Player player = env.getPlayer(); final QuestState qs = player.getQuestStateList().getQuestState(questId); if (qs == null) return false; int var = qs.getQuestVarById(0); int targetId = 0; if (env.getVisibleObject() instanceof Npc) targetId = ((Npc) env.getVisibleObject()).getNpcId(); if (qs.getStatus() == QuestStatus.START) { switch (targetId) { case 204191: { switch (env.getDialog()) { case START_DIALOG: if (var == 0) return sendQuestDialog(env, 1352); break; case STEP_TO_1: if (var == 0) { qs.setQuestVarById(0, var + 1); updateQuestStatus(env); TeleportService2.teleportTo(player, 220030000, player.getInstanceId(), 1748f, 1807f, 255f); PacketSendUtility.sendPacket(player, new SM_DIALOG_WINDOW(env.getVisibleObject().getObjectId(), 0)); return true; } } } case 203559: switch (env.getDialog()) { case START_DIALOG: if (var == 1) { qs.setStatus(QuestStatus.REWARD); updateQuestStatus(env); return sendQuestDialog(env, 2375); } } } } else if (qs.getStatus() == QuestStatus.REWARD) { if (targetId == 203559) { return sendQuestEndDialog(env); } } return false; } }
[ "naxdevil@gmail.com" ]
naxdevil@gmail.com