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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
79050f9789c20363de8e5bcfcd2602ab5a854e2b | 1f2073269378e734b5c9baafa23890558b004673 | /spring2.5/src/com/helloweenvsfei/core/other/PropertyOverrideConfigurer02.java | b2cdbfc2d17c8bc40d923eff19ded0435ea122de | [] | no_license | hungmans6779/Java-Web-integration-development | 7db40c418c13c3efa27e249cdf1e8fe8e39dfa83 | 289d03edd927484e30b053d1e23b218f003d2359 | refs/heads/master | 2020-04-14T01:14:35.712861 | 2018-12-30T02:28:32 | 2018-12-30T02:28:32 | 163,555,635 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,365 | java | package com.helloweenvsfei.core.other;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class PropertyOverrideConfigurer02 {
String name;
String age;
String birth;
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the age
*/
public String getAge() {
return age;
}
/**
* @param age the age to set
*/
public void setAge(String age) {
this.age = age;
}
/**
* @return the birth
*/
public String getBirth() {
return birth;
}
/**
* @param birth the birth to set
*/
public void setBirth(String birth) {
this.birth = birth;
}
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext-core.xml");
PropertyOverrideConfigurer02 poc02 = (PropertyOverrideConfigurer02)context.getBean("kevin");
System.out.println("****************************************");
System.out.println("01.name = "+poc02.getName());
System.out.println("02.age = "+poc02.getAge());
System.out.println("03.birth = "+poc02.getBirth());
System.out.println("****************************************");
}
}
| [
"hungmans6779@msn.com"
] | hungmans6779@msn.com |
dc370f48898e8df84f78936613a134ffd3472e08 | 466a11bec8c8559e3e4e42a20e284d54d8972680 | /requisition/src/main/java/com/tqmars/requisition/test/application/TestFmlMgt.java | 3acc84192d945aaf3d3f40efb1b367c3cd6255d6 | [
"Apache-2.0"
] | permissive | huahuajjh/mvn_requisition | 456e2033e71f757eea4522e1384d7f82a236cfcd | d4c83548f4e68d4619cdec6657cc18ecfe986fd9 | refs/heads/master | 2020-04-02T03:16:48.697670 | 2016-07-22T11:34:28 | 2016-07-22T11:34:28 | 63,935,273 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,280 | java | package com.tqmars.requisition.test.application;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.junit.Before;
import org.junit.Test;
import com.tqmars.requisition.domain.model.share.Gender;
import com.tqmars.requisition.infrastructure.serviceLocator.ServiceLocator;
import com.tqmars.requisition.presentation.dto.rmHousehold.FamilyDto;
import com.tqmars.requisition.presentation.dto.rmHousehold.FamilyItemDto;
import com.tqmars.requisition.presentation.dto.rmHousehold.FamilyQueryModel;
import com.tqmars.requisition.presentation.dto.share.PageModel;
import com.tqmars.requisition.presentation.serviceContract.rmHousehold.IFamilyItemServiceContract;
import com.tqmars.requisition.presentation.serviceContract.rmHousehold.IFamilyMgtServiceContract;
public class TestFmlMgt {
private IFamilyItemServiceContract service;
private IFamilyMgtServiceContract fmlService;
@Before
public void init() {
fmlService = ServiceLocator.instance().getService("fmlService", IFamilyMgtServiceContract.class);
}
@Test
public void add() {
FamilyItemDto dto = new FamilyItemDto();
dto.setAddress("address");
dto.setBirthday(new Date());
dto.setCommunityId(UUID.randomUUID());
dto.setCurrentEducationSituation("受教育情况");
dto.setEducationLevel("受教育程度");
dto.setFarmingTime("20");
dto.setFmlId(UUID.randomUUID());
dto.setGender(Gender.MALE);
dto.setGroupId(UUID.randomUUID());
dto.setHalf(false);
dto.setHouseholdId(UUID.randomUUID());
dto.setHouseholdStr("户口类型");
dto.setIdNumber("21512451445");
dto.setName("name");
dto.setOnlyChildNumber("12255");
dto.setProId(UUID.randomUUID());
dto.setProName("pro name");
dto.setRelationshipId(UUID.randomUUID());
dto.setRelationshipStr("relationship str");
dto.setRemark("remark");
dto.setRemoved(false);
dto.setServeArmySituation("v");
dto.setSS(false);
dto.setSocialsecurityStr(null);
dto.setSocialsecurityTypeId(null);
dto.setStreetId(UUID.randomUUID());
dto.setTel("tel");
dto.setTransfer(false);
List<FamilyItemDto> items = new ArrayList<FamilyItemDto>();
items.add(dto);
FamilyDto fml = FamilyDto.obtain(//
UUID.randomUUID(), //
"head name", //
UUID.randomUUID(), //
UUID.randomUUID(),//
UUID.randomUUID(), //
UUID.randomUUID(),//
"address",//
5,//
0, //
0, //
"description",//
"deal", //
"union suggest", //
"remark", //
"img path",//
items,//
"proname",//
UUID.randomUUID(),
"union path");
String json = fmlService.addFamily(fml);
System.out.println(json);
}
@Test
public void query() {
String json = service.queryByFmlId(UUID.fromString("1bc05f79-67b2-43cb-804d-2d9cd0b5d7c7"));
System.out.println(json);
}
@Test
public void edit() {
FamilyItemDto dto = FamilyItemDto.obtain(//
null, //
"name", //
"id numer", //
new Date(), //
Gender.FEMALE, //
"only children number",//
true, //
"address", //
"relationshipStr", //
"householdStr",//
"socialsecurityStr", //
UUID.randomUUID(), //
UUID.randomUUID(), //
UUID.randomUUID(), //
UUID.randomUUID(), //
UUID.randomUUID(), //
UUID.randomUUID(),//
UUID.randomUUID(), //
"proName",//
true,//
true,//
true);
String json = service.editFmlItem(dto);
System.out.println(json);
}
@Test
public void query4Print() {
String json = fmlService.getFml4Print("'08c785aa-2db4-4a5c-96e4-48e4e57078a8','268304e4-c9e8-4812-9f07-728cb05481d3'");
System.out.println(json);
}
@Test
public void queryByItemId() {
String json = fmlService.getFmlByItemId(UUID.fromString("08c785aa-2db4-4a5c-96e4-48e4e57078a8"));
System.out.println(json);
}
@Test
public void queryBasic() {
FamilyQueryModel queryModel = new FamilyQueryModel();
queryModel.setCommunityId(UUID.randomUUID());
queryModel.setGroupId(UUID.randomUUID());
// queryModel.setIdNumber(UUID.randomUUID());
//queryModel.setProId(UUID.randomUUID());
queryModel.setStreetId(UUID.randomUUID());
PageModel pageModel = new PageModel();
pageModel.pageIndex = 1;
pageModel.pageSize = 10;
String json = fmlService.getFml4HPT(queryModel, pageModel);
System.out.println(json);
}
}
| [
"703825021@qq.com"
] | 703825021@qq.com |
71237a37cc2dbed5b8aaef217ad9afb0b8da8991 | c3cf33e7b9fe20ff3124edcfc39f08fa982b2713 | /pocs/terraform-cdk-fun/src/main/java/imports/kubernetes/ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec.java | 763b8c7d5b40e84b86e652ad9f586cd4e6f9dd43 | [
"Unlicense"
] | permissive | diegopacheco/java-pocs | d9daa5674921d8b0d6607a30714c705c9cd4c065 | 2d6cc1de9ff26e4c0358659b7911d2279d4008e1 | refs/heads/master | 2023-08-30T18:36:34.626502 | 2023-08-29T07:34:36 | 2023-08-29T07:34:36 | 107,281,823 | 47 | 57 | Unlicense | 2022-03-23T07:24:08 | 2017-10-17T14:42:26 | Java | UTF-8 | Java | false | false | 6,225 | java | package imports.kubernetes;
@javax.annotation.Generated(value = "jsii-pacmak/1.30.0 (build adae23f)", date = "2021-06-16T06:12:12.840Z")
@software.amazon.jsii.Jsii(module = imports.kubernetes.$Module.class, fqn = "kubernetes.ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec")
@software.amazon.jsii.Jsii.Proxy(ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec.Jsii$Proxy.class)
public interface ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec extends software.amazon.jsii.JsiiSerializable {
/**
* Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem.
* <p>
* The command is simply exec'd, it is not run inside a shell, so traditional shell instructions. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
* <p>
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/kubernetes/r/replication_controller.html#command ReplicationController#command}
*/
default @org.jetbrains.annotations.Nullable java.util.List<java.lang.String> getCommand() {
return null;
}
/**
* @return a {@link Builder} of {@link ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec}
*/
static Builder builder() {
return new Builder();
}
/**
* A builder for {@link ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec}
*/
public static final class Builder implements software.amazon.jsii.Builder<ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec> {
private java.util.List<java.lang.String> command;
/**
* Sets the value of {@link ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec#getCommand}
* @param command Command is the command line to execute inside the container, the working directory for the command is root ('/') in the container's filesystem.
* The command is simply exec'd, it is not run inside a shell, so traditional shell instructions. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.
* <p>
* Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/kubernetes/r/replication_controller.html#command ReplicationController#command}
* @return {@code this}
*/
public Builder command(java.util.List<java.lang.String> command) {
this.command = command;
return this;
}
/**
* Builds the configured instance.
* @return a new instance of {@link ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec}
* @throws NullPointerException if any required attribute was not provided
*/
@Override
public ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec build() {
return new Jsii$Proxy(command);
}
}
/**
* An implementation for {@link ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec}
*/
@software.amazon.jsii.Internal
final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec {
private final java.util.List<java.lang.String> command;
/**
* Constructor that initializes the object based on values retrieved from the JsiiObject.
* @param objRef Reference to the JSII managed object.
*/
protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
this.command = software.amazon.jsii.Kernel.get(this, "command", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class)));
}
/**
* Constructor that initializes the object based on literal property values passed by the {@link Builder}.
*/
protected Jsii$Proxy(final java.util.List<java.lang.String> command) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
this.command = command;
}
@Override
public final java.util.List<java.lang.String> getCommand() {
return this.command;
}
@Override
@software.amazon.jsii.Internal
public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() {
final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE;
final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
if (this.getCommand() != null) {
data.set("command", om.valueToTree(this.getCommand()));
}
final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
struct.set("fqn", om.valueToTree("kubernetes.ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec"));
struct.set("data", data);
final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode();
obj.set("$jsii.struct", struct);
return obj;
}
@Override
public final boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec.Jsii$Proxy that = (ReplicationControllerSpecTemplateSpecInitContainerLivenessProbeExec.Jsii$Proxy) o;
return this.command != null ? this.command.equals(that.command) : that.command == null;
}
@Override
public final int hashCode() {
int result = this.command != null ? this.command.hashCode() : 0;
return result;
}
}
}
| [
"diego.pacheco.it@gmail.com"
] | diego.pacheco.it@gmail.com |
63173282bca7f079ea9bb56c7e6700fa3c8bcffb | 0d5f33d30c14dee3219140943a6705832536c95d | /src/main/java/com/taylor/ConsumerApplication.java | 2766915b249e2fa57f8c12f6ca0149ecec0549f8 | [] | no_license | zhangmenyucom/ribbon-consumer | 4318bdee7fe2573242b80a2fc3f6c9b0a83ba999 | 5e2100c3a1c959354d360f9ae159dcec104d9fa6 | refs/heads/master | 2020-02-26T13:36:47.522728 | 2018-11-01T10:43:14 | 2018-11-01T10:43:14 | 95,527,111 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 858 | java | package com.taylor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
/**
* @author xiaolu.zhang
* @desc:
* @date: 2017/6/27 11:39
*/
@EnableEurekaClient
@SpringBootApplication
@EnableCircuitBreaker
public class ConsumerApplication {
@Bean
@LoadBalanced
public RestTemplate restTemplate() {
return new RestTemplate();
}
public static void main(String... args) {
SpringApplication.run(ConsumerApplication.class, args);
}
}
| [
"516195940@qq.com"
] | 516195940@qq.com |
837c685feb4b280d29b4060385a53fe946284d35 | c662a1f1f4660cc644b63f417f0911cee5e8fbfb | /connect-it/src/main/java/io/dh/spring/connectit/testutils/testdata/DateGenerator.java | ae83ab765f7ec422915372b4cc8ea54abc1a6c4b | [] | no_license | qdriven/walkthough-backend | c10308b4fb1a3524d9c11f313f5c22620e554432 | df9cb95e814e66eb582c319c983154f36f1acf23 | refs/heads/master | 2022-07-08T11:34:39.424832 | 2021-12-11T03:47:08 | 2021-12-11T03:47:08 | 200,501,198 | 0 | 0 | null | 2022-06-21T04:16:24 | 2019-08-04T14:14:29 | Java | UTF-8 | Java | false | false | 238 | java | package io.dh.spring.connectit.testutils.testdata;
import java.util.Date;
import java.util.Random;
public class DateGenerator implements DataGenerator<Date> {
public Date generate(Object rule) {
return new Date();
}
}
| [
"patrickwuke@163.com"
] | patrickwuke@163.com |
655e4507fd13af985a502d2ddb39726a61926956 | 9821426ca32b707134eee8dbda9ef4ce64a97045 | /MiuiSystemUI/umi/systemui/controls/management/ControlsFavoritingActivity$bindViews$$inlined$apply$lambda$1.java | 06b2cf434dbaca2807727a5aec979681ba853ea9 | [] | no_license | mooseIre/arsc_compare | a28af8205cc75647b3f6e8c1b3310ca2b2140725 | 3df667d4e4d4924e11cbcfd9df29346a3c259e32 | refs/heads/master | 2023-06-21T13:30:23.511293 | 2021-08-12T15:13:08 | 2021-08-12T15:13:08 | 277,633,842 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,364 | java | package com.android.systemui.controls.management;
import com.android.systemui.controls.TooltipManager;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Lambda;
/* access modifiers changed from: package-private */
/* compiled from: ControlsFavoritingActivity.kt */
public final class ControlsFavoritingActivity$bindViews$$inlined$apply$lambda$1 extends Lambda implements Function1<Integer, Unit> {
final /* synthetic */ ControlsFavoritingActivity this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
ControlsFavoritingActivity$bindViews$$inlined$apply$lambda$1(ControlsFavoritingActivity controlsFavoritingActivity) {
super(1);
this.this$0 = controlsFavoritingActivity;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Integer num) {
invoke(num.intValue());
return Unit.INSTANCE;
}
public final void invoke(int i) {
TooltipManager tooltipManager;
if (i != 0 && (tooltipManager = this.this$0.mTooltipManager) != null) {
tooltipManager.hide(true);
}
}
}
| [
"viiplycn@gmail.com"
] | viiplycn@gmail.com |
cf21cd131877d647f0c10af5afc4f4ad85cf64a3 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /DVC-AN20_EMUI10.1.1/src/main/java/vendor/huawei/hardware/qcomradio/V1_0/CellIdentityGsm.java | b00b02b828f6bfca1cd09c68772ee13a102081eb | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,521 | java | package vendor.huawei.hardware.qcomradio.V1_0;
import android.os.HidlSupport;
import android.os.HwBlob;
import android.os.HwParcel;
import java.util.ArrayList;
import java.util.Objects;
public final class CellIdentityGsm {
public int arfcn;
public byte bsic;
public int cid;
public int lac;
public String mcc = new String();
public String mnc = new String();
public final boolean equals(Object otherObject) {
if (this == otherObject) {
return true;
}
if (otherObject == null || otherObject.getClass() != CellIdentityGsm.class) {
return false;
}
CellIdentityGsm other = (CellIdentityGsm) otherObject;
if (HidlSupport.deepEquals(this.mcc, other.mcc) && HidlSupport.deepEquals(this.mnc, other.mnc) && this.lac == other.lac && this.cid == other.cid && this.arfcn == other.arfcn && this.bsic == other.bsic) {
return true;
}
return false;
}
public final int hashCode() {
return Objects.hash(Integer.valueOf(HidlSupport.deepHashCode(this.mcc)), Integer.valueOf(HidlSupport.deepHashCode(this.mnc)), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.lac))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.cid))), Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.arfcn))), Integer.valueOf(HidlSupport.deepHashCode(Byte.valueOf(this.bsic))));
}
public final String toString() {
return "{" + ".mcc = " + this.mcc + ", .mnc = " + this.mnc + ", .lac = " + this.lac + ", .cid = " + this.cid + ", .arfcn = " + this.arfcn + ", .bsic = " + ((int) this.bsic) + "}";
}
public final void readFromParcel(HwParcel parcel) {
readEmbeddedFromParcel(parcel, parcel.readBuffer(48), 0);
}
public static final ArrayList<CellIdentityGsm> readVectorFromParcel(HwParcel parcel) {
ArrayList<CellIdentityGsm> _hidl_vec = new ArrayList<>();
HwBlob _hidl_blob = parcel.readBuffer(16);
int _hidl_vec_size = _hidl_blob.getInt32(8);
HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 48), _hidl_blob.handle(), 0, true);
_hidl_vec.clear();
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
CellIdentityGsm _hidl_vec_element = new CellIdentityGsm();
_hidl_vec_element.readEmbeddedFromParcel(parcel, childBlob, (long) (_hidl_index_0 * 48));
_hidl_vec.add(_hidl_vec_element);
}
return _hidl_vec;
}
public final void readEmbeddedFromParcel(HwParcel parcel, HwBlob _hidl_blob, long _hidl_offset) {
this.mcc = _hidl_blob.getString(_hidl_offset + 0);
parcel.readEmbeddedBuffer((long) (this.mcc.getBytes().length + 1), _hidl_blob.handle(), _hidl_offset + 0 + 0, false);
this.mnc = _hidl_blob.getString(_hidl_offset + 16);
parcel.readEmbeddedBuffer((long) (this.mnc.getBytes().length + 1), _hidl_blob.handle(), _hidl_offset + 16 + 0, false);
this.lac = _hidl_blob.getInt32(_hidl_offset + 32);
this.cid = _hidl_blob.getInt32(_hidl_offset + 36);
this.arfcn = _hidl_blob.getInt32(_hidl_offset + 40);
this.bsic = _hidl_blob.getInt8(_hidl_offset + 44);
}
public final void writeToParcel(HwParcel parcel) {
HwBlob _hidl_blob = new HwBlob(48);
writeEmbeddedToBlob(_hidl_blob, 0);
parcel.writeBuffer(_hidl_blob);
}
public static final void writeVectorToParcel(HwParcel parcel, ArrayList<CellIdentityGsm> _hidl_vec) {
HwBlob _hidl_blob = new HwBlob(16);
int _hidl_vec_size = _hidl_vec.size();
_hidl_blob.putInt32(8, _hidl_vec_size);
_hidl_blob.putBool(12, false);
HwBlob childBlob = new HwBlob(_hidl_vec_size * 48);
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
_hidl_vec.get(_hidl_index_0).writeEmbeddedToBlob(childBlob, (long) (_hidl_index_0 * 48));
}
_hidl_blob.putBlob(0, childBlob);
parcel.writeBuffer(_hidl_blob);
}
public final void writeEmbeddedToBlob(HwBlob _hidl_blob, long _hidl_offset) {
_hidl_blob.putString(0 + _hidl_offset, this.mcc);
_hidl_blob.putString(16 + _hidl_offset, this.mnc);
_hidl_blob.putInt32(32 + _hidl_offset, this.lac);
_hidl_blob.putInt32(36 + _hidl_offset, this.cid);
_hidl_blob.putInt32(40 + _hidl_offset, this.arfcn);
_hidl_blob.putInt8(44 + _hidl_offset, this.bsic);
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
7b2f0d07c8f214b470a8ec3f249655451d2bdc5b | d9b14f351f668b004c4cb05a10d09e7e85243317 | /src/BaekJoon/String/KMP/P23905.java | 96287908abe07b1b8851e50dd829115f1e6a914d | [] | no_license | nn98/Algorithm | 262cbe20c71ff9b5de292c244b95a2a0c25e5bd7 | 55b6db19cb9f2aa5c5056f5cabd2b22715b682fd | refs/heads/main | 2023-08-17T04:39:41.236707 | 2023-08-16T13:04:34 | 2023-08-16T13:04:34 | 178,701,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 528 | java | package BaekJoon.String.KMP;
import java.util.Scanner;
public class P23905 {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
int n=s.nextInt(),i=0,x,y,a[],r,j,k;
for(;i++<n;) {
x=s.nextInt();
y=s.nextInt();
a=new int[x+1];
r=0;
for(j=0;j<x;a[j++]=s.nextInt());
for(j=0;j<x;j++)if(a[j]==y) {
// System.out.println("j: "+j);
for(k=j;++k<x&k-j<y&a[k]==a[k-1]-1;);
// System.out.println(k);
if(k-j==y)r++;
}
System.out.println("Case #"+i+": "+r);
}
}
}
| [
"jkllhgb@gmail.com"
] | jkllhgb@gmail.com |
68a5d0d2e4b98f18f85a0d9ccb8f6709dac7d777 | f22016e5670e437bd7c1338f28aedfe7871580f9 | /axl/src/main/java/ru/cg/cda/axl/generated/GetSIPNormalizationScriptRes.java | 7aff52cac47c9ed0289335938c7f20c01291a41d | [] | no_license | ilgiz-badamshin/cda | 4e3c75407a0b2edbb7321b83b66e4cf455157eae | 0a16d90fc9be74932ef3df682013b444d425741e | refs/heads/master | 2020-05-17T05:34:17.707445 | 2015-12-18T13:38:49 | 2015-12-18T13:38:49 | 39,076,024 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,699 | java |
package ru.cg.cda.axl.generated;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for GetSIPNormalizationScriptRes complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="GetSIPNormalizationScriptRes">
* <complexContent>
* <extension base="{http://www.cisco.com/AXL/API/10.0}APIResponse">
* <sequence>
* <element name="return">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="sIPNormalizationScript" type="{http://www.cisco.com/AXL/API/10.0}RSIPNormalizationScript"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "GetSIPNormalizationScriptRes", propOrder = {
"_return"
})
public class GetSIPNormalizationScriptRes
extends APIResponse
{
@XmlElement(name = "return", required = true)
protected GetSIPNormalizationScriptRes.Return _return;
/**
* Gets the value of the return property.
*
* @return
* possible object is
* {@link GetSIPNormalizationScriptRes.Return }
*
*/
public GetSIPNormalizationScriptRes.Return getReturn() {
return _return;
}
/**
* Sets the value of the return property.
*
* @param value
* allowed object is
* {@link GetSIPNormalizationScriptRes.Return }
*
*/
public void setReturn(GetSIPNormalizationScriptRes.Return value) {
this._return = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="sIPNormalizationScript" type="{http://www.cisco.com/AXL/API/10.0}RSIPNormalizationScript"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sipNormalizationScript"
})
public static class Return {
@XmlElement(name = "sIPNormalizationScript", required = true)
protected RSIPNormalizationScript sipNormalizationScript;
/**
* Gets the value of the sipNormalizationScript property.
*
* @return
* possible object is
* {@link RSIPNormalizationScript }
*
*/
public RSIPNormalizationScript getSIPNormalizationScript() {
return sipNormalizationScript;
}
/**
* Sets the value of the sipNormalizationScript property.
*
* @param value
* allowed object is
* {@link RSIPNormalizationScript }
*
*/
public void setSIPNormalizationScript(RSIPNormalizationScript value) {
this.sipNormalizationScript = value;
}
}
}
| [
"badamshin.ilgiz@cg.ru"
] | badamshin.ilgiz@cg.ru |
28f9e81116e2d416298b6bb1338ae9827d77ba6c | ecb7f517c5641373840c97b9d176597f0455d774 | /PbbReader/src/main/java/tv/danmaku/ijk/media/player/IMediaPlayer.java | 5594e63e76e83f0c660267e7d9be43ea81c0f5d5 | [
"MIT"
] | permissive | leeqiang250/Android_Reader | 6e346b914caac87e934dd4064b5cc6a05bad8e77 | c5ff02b081bb62f6ec04e36b669e583e21a2c18a | refs/heads/master | 2021-08-24T06:22:55.129276 | 2017-12-08T11:13:57 | 2017-12-08T11:13:57 | 113,566,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,962 | java | /*
* Copyright (C) 2013-2014 Zhang Rui <bbcallen@gmail.com>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package tv.danmaku.ijk.media.player;
import android.annotation.TargetApi;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.view.Surface;
import android.view.SurfaceHolder;
import java.io.FileDescriptor;
import java.io.IOException;
import java.util.Map;
import tv.danmaku.ijk.media.player.misc.ITrackInfo;
public interface IMediaPlayer
{
/*
* Do not change these values without updating their counterparts in native
*/
int MEDIA_INFO_UNKNOWN = 1;
int MEDIA_INFO_STARTED_AS_NEXT = 2;
int MEDIA_INFO_VIDEO_RENDERING_START = 3;
int MEDIA_INFO_VIDEO_TRACK_LAGGING = 700;
int MEDIA_INFO_BUFFERING_START = 701;
int MEDIA_INFO_BUFFERING_END = 702;
int MEDIA_INFO_NETWORK_BANDWIDTH = 703;
int MEDIA_INFO_BAD_INTERLEAVING = 800;
int MEDIA_INFO_NOT_SEEKABLE = 801;
int MEDIA_INFO_METADATA_UPDATE = 802;
int MEDIA_INFO_TIMED_TEXT_ERROR = 900;
int MEDIA_INFO_UNSUPPORTED_SUBTITLE = 901;
int MEDIA_INFO_SUBTITLE_TIMED_OUT = 902;
int MEDIA_INFO_VIDEO_ROTATION_CHANGED = 10001;
int MEDIA_INFO_AUDIO_RENDERING_START = 10002;
int MEDIA_ERROR_UNKNOWN = 1;
int MEDIA_ERROR_SERVER_DIED = 100;
int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK = 200;
int MEDIA_ERROR_IO = -1004;
int MEDIA_ERROR_MALFORMED = -1007;
int MEDIA_ERROR_UNSUPPORTED = -1010;
int MEDIA_ERROR_TIMED_OUT = -110;
void setDisplay(SurfaceHolder sh);
void setDataSource(Context context, Uri uri)
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
void setDataSource(Context context, Uri uri, Map<String, String> headers)
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
void setDataSource(FileDescriptor fd)
throws IOException, IllegalArgumentException, IllegalStateException;
void setDataSource(String path, byte[] key, long len, long offset,long fileLen)
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException;
String getDataSource();
void prepareAsync() throws IllegalStateException;
void start() throws IllegalStateException;
void stop() throws IllegalStateException;
void pause() throws IllegalStateException;
void setScreenOnWhilePlaying(boolean screenOn);
int getVideoWidth();
int getVideoHeight();
boolean isPlaying();
void seekTo(long msec) throws IllegalStateException;
long getCurrentPosition();
long getDuration();
void release();
void reset();
void setVolume(float leftVolume, float rightVolume);
int getAudioSessionId();
MediaInfo getMediaInfo();
@Deprecated
void setLogEnabled(boolean enable);
@Deprecated
boolean isPlayable();
void setOnPreparedListener(OnPreparedListener listener);
void setOnCompletionListener(OnCompletionListener listener);
void setOnBufferingUpdateListener(OnBufferingUpdateListener listener);
void setOnSeekCompleteListener(OnSeekCompleteListener listener);
void setOnVideoSizeChangedListener(OnVideoSizeChangedListener listener);
void setOnErrorListener(OnErrorListener listener);
void setOnInfoListener(OnInfoListener listener);
/*--------------------
* Listeners
*/
interface OnPreparedListener
{
void onPrepared(IMediaPlayer mp);
}
interface OnCompletionListener
{
void onCompletion(IMediaPlayer mp);
}
interface OnBufferingUpdateListener
{
void onBufferingUpdate(IMediaPlayer mp, int percent);
}
interface OnSeekCompleteListener
{
void onSeekComplete(IMediaPlayer mp);
}
interface OnVideoSizeChangedListener
{
void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sar_num, int sar_den);
}
interface OnErrorListener
{
boolean onError(IMediaPlayer mp, int what, int extra);
}
interface OnInfoListener
{
boolean onInfo(IMediaPlayer mp, int what, int extra);
}
/*--------------------
* Optional
*/
void setAudioStreamType(int streamtype);
@Deprecated
void setKeepInBackground(boolean keepInBackground);
int getVideoSarNum();
int getVideoSarDen();
@Deprecated
void setWakeMode(Context context, int mode);
void setLooping(boolean looping);
boolean isLooping();
/*--------------------
* AndroidMediaPlayer: ICE_CREAM_SANDWICH:
*/
void setSurface(Surface surface);
/*--------------------
* AndroidMediaPlayer: JELLY_BEAN
*/
ITrackInfo[] getTrackInfo();
}
| [
"leeqiang250@163.com"
] | leeqiang250@163.com |
b9c9fd40d1213ae98c48e67379951ea7cb70ef31 | d043634ae78dd1583dba68a1c4a29761346c711f | /app/src/main/java/com/roje/miao/music/network/scheduler/impl/AndroidSchedulerProvider.java | bd5178b1c9c3e5db77c2591b47eaf2e2db151e0d | [] | no_license | RoJeJJ/miao-music | 86193582414cf15b8ffeb28f811a3912715cf9fb | de6469a1015503a94d3af0982a2ee7bcd42a4e79 | refs/heads/master | 2020-04-19T16:26:05.007967 | 2019-02-14T01:45:50 | 2019-02-14T01:45:50 | 168,304,079 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,282 | java | package com.roje.miao.music.network.scheduler.impl;
import android.support.annotation.NonNull;
import com.roje.miao.music.network.scheduler.SchedulerProvider;
import io.reactivex.ObservableTransformer;
import io.reactivex.Scheduler;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
public class AndroidSchedulerProvider implements SchedulerProvider {
private static SchedulerProvider instance;
public static SchedulerProvider getInstance() {
if (instance == null) {
synchronized (AndroidSchedulerProvider.class) {
if (instance == null) {
instance = new AndroidSchedulerProvider();
}
}
}
return instance;
}
@NonNull
@Override
public Scheduler computation() {
return Schedulers.computation();
}
@NonNull
@Override
public Scheduler io() {
return Schedulers.io();
}
@NonNull
@Override
public Scheduler ui() {
return AndroidSchedulers.mainThread();
}
@NonNull
@Override
public <T> ObservableTransformer<T, T> applySchedulers() {
return observable -> observable.subscribeOn(io())
.observeOn(ui());
}
}
| [
"fiekajie@163.com"
] | fiekajie@163.com |
8c23201ac8c7d6582032e3d752c927791fe15c71 | 9574e50b60b41fc654810c11683875aa3bba4c5a | /postgres-mvc/src/test/java/com/mycompany/myapp/domain/PostTest.java | d7f398ceb89f5a6bdac769c6241eb5a9265a026b | [] | no_license | ehayik/spring-native-examples | 9bb325f4949a711006c106fa7af53a8c1cc76bb5 | cf1fdb5831e41ff6e6bf8e87166d4bd712c83d29 | refs/heads/main | 2023-08-02T13:50:35.618245 | 2021-09-30T20:51:56 | 2021-09-30T20:51:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 621 | java | package com.mycompany.myapp.domain;
import static org.assertj.core.api.Assertions.assertThat;
import com.mycompany.myapp.web.rest.TestUtil;
import org.junit.jupiter.api.Test;
class PostTest {
@Test
void equalsVerifier() throws Exception {
TestUtil.equalsVerifier(Post.class);
Post post1 = new Post();
post1.setId(1L);
Post post2 = new Post();
post2.setId(post1.getId());
assertThat(post1).isEqualTo(post2);
post2.setId(2L);
assertThat(post1).isNotEqualTo(post2);
post1.setId(null);
assertThat(post1).isNotEqualTo(post2);
}
}
| [
"matt.raible@okta.com"
] | matt.raible@okta.com |
6cba96abb7303a5fbd77105376c9cf496aa5b1cd | 6252c165657baa6aa605337ebc38dd44b3f694e2 | /org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-1000-Files/boiler-To-Generate-1000-Files/syncregions-1000Files/BoilerActuator820.java | 056afb74833fba556b56ae9880025b0cb9b704af | [] | no_license | soha500/EglSync | 00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638 | 55101bc781349bb14fefc178bf3486e2b778aed6 | refs/heads/master | 2021-06-23T02:55:13.464889 | 2020-12-11T19:10:01 | 2020-12-11T19:10:01 | 139,832,721 | 0 | 1 | null | 2019-05-31T11:34:02 | 2018-07-05T10:20:00 | Java | UTF-8 | Java | false | false | 264 | java | package syncregions;
public class BoilerActuator820 {
public int execute(int temperatureDifference820, boolean boilerStatus820) {
//sync _bfpnGUbFEeqXnfGWlV2820, behaviour
Half Change - return temperature - targetTemperature;
//endSync
}
}
| [
"sultanalmutairi@172.20.10.2"
] | sultanalmutairi@172.20.10.2 |
b0fcec3a65e07b10b8d05a3eebc440e0bf4b4a73 | c42fbff4df930ae45e97e052b08e7cf8f2f6ff4a | /VideoCubeTest/src/craterstudio/util/PairOperator.java | fcdd353c9dd2afd9688e6cd41e3a0fd63b727c91 | [] | no_license | egold555/TheSpookReturnsWorkspace | 6d432f0056aa91e12aaf2312e3735908a082b081 | 4e93e242bf1d41026bd445e97b666d6666563952 | refs/heads/master | 2021-01-24T18:46:41.591559 | 2018-09-08T18:02:08 | 2018-09-08T18:02:08 | 123,238,063 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 134 | java | /*
* Created on 4 nov 2008
*/
package craterstudio.util;
public interface PairOperator<A, B>
{
public void operate(A a, B b);
} | [
"eric@golde.org"
] | eric@golde.org |
f2a253c42dadec73a283a9b7548994ec14620b6a | ea87e7258602e16675cec3e29dd8bb102d7f90f8 | /fest-swing/src/test/java/org/fest/swing/fixture/FrameFixture_keyboardInput_Test.java | 031369faa33f6c432ba389263c59c63fb6569ca9 | [
"Apache-2.0"
] | permissive | codehaus/fest | 501714cb0e6f44aa1b567df57e4f9f6586311862 | a91c0c0585c2928e255913f1825d65fa03399bc6 | refs/heads/master | 2023-07-20T01:30:54.762720 | 2010-09-02T00:56:33 | 2010-09-02T00:56:33 | 36,525,844 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,830 | java | /*
* Created on Nov 17, 2009
*
* 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.
*
* Copyright @2009-2010 the original author or authors.
*/
package org.fest.swing.fixture;
import static org.easymock.classextension.EasyMock.createMock;
import static org.fest.swing.test.builder.JFrames.frame;
import static org.fest.swing.test.task.WindowDestroyTask.hideAndDisposeInEDT;
import java.awt.Frame;
import org.fest.swing.driver.FrameDriver;
import org.junit.*;
/**
* Tests for methods in <code>{@link FrameFixture}</code> that are inherited from
* {@link KeyboardInputSimulationFixture}.
*
* @author Alex Ruiz
* @author Yvonne Wang
*/
public class FrameFixture_keyboardInput_Test extends KeyboardInputSimulationFixture_TestCase<Frame> {
private static Frame target;
private FrameDriver driver;
private FrameFixture fixture;
@BeforeClass
public static void setUpTarget() {
target = frame().createNew();
}
@AfterClass
public static void disposeTarget() {
hideAndDisposeInEDT(target);
}
@Override void onSetUp() {
driver = createMock(FrameDriver.class);
fixture = new FrameFixture(robot(), target);
fixture.driver(driver);
}
@Override FrameDriver driver() { return driver; }
@Override Frame target() { return target; }
@Override FrameFixture fixture() { return fixture; }
}
| [
"alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc"
] | alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc |
ee288a4c0e83bf110d37e1d5e23af987985b3b02 | a5f68f01b585b0bb167d058a0ed287e6e6706ec9 | /src/main/java/com/briup/apps/poll/service/Impl/AnswersServiceImpl.java | e3b52df9d2476d207e4ce470520818e8a7b1ffdc | [] | no_license | androidstudio123/ssm | c9b347868b34bb021ef8df67c9184fc14173e1e6 | 9479966a51ea3a391ae92342b8b74dc916607d57 | refs/heads/master | 2020-03-21T14:34:45.678447 | 2018-06-25T06:35:09 | 2018-06-25T06:35:09 | 138,664,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | java | package com.briup.apps.poll.service.Impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.briup.apps.poll.bean.Answers;
import com.briup.apps.poll.dao.AnswersMapper;
import com.briup.apps.poll.service.IAnswersService;
@Service
public class AnswersServiceImpl implements IAnswersService{
@Autowired
private AnswersMapper answersMapper;
@Override
public List<Answers> findAll() throws Exception {
// TODO Auto-generated method stub
return answersMapper.findAll();
}
@Override
public void deleteById(long id) throws Exception {
// TODO Auto-generated method stub
answersMapper.deleteById(id);
}
@Override
public void save(Answers answers) throws Exception {
// TODO Auto-generated method stub
answersMapper.save(answers);
}
@Override
public void update(Answers answers) throws Exception {
// TODO Auto-generated method stub
answersMapper.update(answers);
}
}
| [
"Administrator@windows10.microdone.cn"
] | Administrator@windows10.microdone.cn |
0ff52419bc1da8352d200d34e696f634f739d1fa | 4e0e6a1e924db8aa6b57cb24911dd70f15c1c208 | /spring-boot-parent/boot-dubbo-parent Maven Webapp/boot-dubbo-client Maven Webapp/src/main/java/com/mark/demo/security/security/CustomUsernamePasswordAuthenticationFilter.java | 25acc2a109947802196988b494cbde0ff678b954 | [] | no_license | ouyangxiaomin/spring-boot-demoes | 223323b54d53a6d601dfdc501c5a6c216275a9e4 | 886ba60bd4dadec937154409b92ce1e6cf121529 | refs/heads/master | 2020-04-19T08:31:28.702245 | 2017-10-19T11:09:17 | 2017-10-19T11:09:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,956 | java | package com.mark.demo.security.security;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import com.mark.demo.security.entity.User;
import com.mark.demo.security.service.UserService;
import com.mark.demo.security.session.RedisSessionManager;
import com.mark.demo.security.session.RedisSessionManager.SessionKey;
import com.mark.demo.security.utils.StringUtils;
/*
*hxp(hxpwangyi@126.com)
*2017年9月24日
*
*/
public class CustomUsernamePasswordAuthenticationFilter extends UsernamePasswordAuthenticationFilter {
public static final String VALIDATE_CODE = "captcha";
public static final String USERNAME = "userName";
public static final String PASSWORD = "password";
private UserService userService;
private RedisSessionManager redisSessionManager;
public void setUserService(UserService userService) {
this.userService = userService;
}
public void setRedisSessionManager(RedisSessionManager redisSessionManager) {
this.redisSessionManager = redisSessionManager;
}
@Override
public void setAuthenticationManager(AuthenticationManager authenticationManager) {
super.setAuthenticationManager(authenticationManager);
}
@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
if (!request.getMethod().equals("POST")) {
throw new AuthenticationServiceException("Authentication method not supported: " + request.getMethod());
}
//检测验证码
checkValidateCode(request);
String username = obtainUsername(request);
String password = obtainPassword(request);
//验证用户账号与密码是否对应
username = username.trim();
User user = userService.getUserByUserName(username);
if(user == null || !user.getPassword().equals(password)) {
throw new AuthenticationServiceException("用户名或者密码错误!");
}
UsernamePasswordAuthenticationToken authToken = new UsernamePasswordAuthenticationToken(username, password);
setDetails(request, authToken);
return this.getAuthenticationManager().authenticate(authToken);
}
protected void checkValidateCode(HttpServletRequest request) {
String capatcha= redisSessionManager.getString(request, SessionKey.CAPTCHA);
String validateCode = obtainValidateCode(request);
if (StringUtils.isEmpty(validateCode) || !capatcha.equalsIgnoreCase(validateCode)) {
throw new AuthenticationServiceException("验证码错误!");
}
}
private String obtainValidateCode(HttpServletRequest request) {
Object obj = request.getParameter(VALIDATE_CODE);
return null == obj ? "" : obj.toString();
}
@Override
protected String obtainUsername(HttpServletRequest request) {
Object obj = request.getParameter(USERNAME);
return null == obj ? "" : obj.toString();
}
@Override
protected String obtainPassword(HttpServletRequest request) {
Object obj = request.getParameter(PASSWORD);
return null == obj ? "" : obj.toString();
}
}
| [
"hxpwangyi@163.com"
] | hxpwangyi@163.com |
1e961e2a8c0a0c33ab129a7d6e377e50d773df69 | c3b7c7f5d92396462b24698c07e6b43f57f26f3a | /src/main/java/cn/itsource/day9/code-练习/TestConstructor.java | e9cf022a7248b01ad8fbc25c7b767e1aa77c5f3c | [] | no_license | usami-muzugi/javahomework | d0abca56bfd664c042c30b07dc8ba6bf4526b759 | e0010bbfd0885d24db6ac87c671c7429be4b2a26 | refs/heads/master | 2021-09-17T14:07:45.305360 | 2018-07-02T14:28:36 | 2018-07-02T14:28:41 | 106,161,494 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,434 | java | public class TestConstructor{
public static void main(String[] args){
//创建对象
Person person = new Person(); //person -->存的是引用地址
System.out.println(person); //如果没有重写Object类的toString()方法,就会打印这种东西,之后教到重写会学到
person.name = "うさみ";
person.length = 15.0;
System.out.println(person);
System.out.println("name ="+person.name+"\tlength ="+person.length);
Person man = new Person("大好き",18); //使用带参数列表的构造器所传入的值,可以直接初始化
System.out.println("name =" + man.name+"\tlength ="+man.length);
}
}
class Person{
String name;
double length;
//构造方法
public Person(){ //无参构造器
System.out.println("我是Person无参构造器");
}
//构造方法目前的使用方式是用new 调用
//构造方法的另一个作用,创建对象的同时初始化值!
public Person(String s ,int g){ //这里使用s 和 g 有点东西的
//因为如果在一个方法里String类型变量修改为name,name = name 的话由于就近原则,所以就是 形参 赋值给形参,并没有
//赋值给成员变量,现阶段只能用其他变量名来代替,以后会用到this 关键字
System.out.println("我是Person有参构造器");
name = s;
length = g; //自动转型
}
public String toString(){
return "name ="+this.name+"\tlength ="+this.length;
}
} | [
"715759898@qq.com"
] | 715759898@qq.com |
8de59e7630780f1dfa0a019c5010f5113b7d578e | 5598faaaaa6b3d1d8502cbdaca903f9037d99600 | /code_changes/Apache_projects/HDFS-129/05d4daf6ba3e5bd40f46e8003ee12fc7c613453d/IntraSPSNameNodeContext.java | 6654212825c3a3891d9937d2c67a3035a4d7dbf1 | [] | no_license | SPEAR-SE/LogInBugReportsEmpirical_Data | 94d1178346b4624ebe90cf515702fac86f8e2672 | ab9603c66899b48b0b86bdf63ae7f7a604212b29 | refs/heads/master | 2022-12-18T02:07:18.084659 | 2020-09-09T16:49:34 | 2020-09-09T16:49:34 | 286,338,252 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 7,369 | 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.hadoop.hdfs.server.namenode.sps;
import static org.apache.hadoop.hdfs.server.common.HdfsServerConstants.XATTR_SATISFY_STORAGE_POLICY;
import java.io.IOException;
import java.util.function.Supplier;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.ParentNotDirectoryException;
import org.apache.hadoop.fs.StorageType;
import org.apache.hadoop.fs.UnresolvedLinkException;
import org.apache.hadoop.hdfs.protocol.BlockStoragePolicy;
import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.protocol.HdfsConstants.DatanodeReportType;
import org.apache.hadoop.hdfs.protocol.HdfsFileStatus;
import org.apache.hadoop.hdfs.server.blockmanagement.BlockCollection;
import org.apache.hadoop.hdfs.server.blockmanagement.BlockManager;
import org.apache.hadoop.hdfs.server.blockmanagement.DatanodeDescriptor;
import org.apache.hadoop.hdfs.server.common.HdfsServerConstants;
import org.apache.hadoop.hdfs.server.namenode.INode;
import org.apache.hadoop.hdfs.server.namenode.Namesystem;
import org.apache.hadoop.hdfs.server.protocol.DatanodeStorageReport;
import org.apache.hadoop.hdfs.server.protocol.BlockStorageMovementCommand.BlockMovingInfo;
import org.apache.hadoop.net.NetworkTopology;
import org.apache.hadoop.security.AccessControlException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* This class is the Namenode implementation for analyzing the file blocks which
* are expecting to change its storages and assigning the block storage
* movements to satisfy the storage policy.
*/
public class IntraSPSNameNodeContext implements Context {
private static final Logger LOG = LoggerFactory
.getLogger(IntraSPSNameNodeContext.class);
private final Namesystem namesystem;
private final BlockManager blockManager;
private final Configuration conf;
private Supplier<Boolean> isSpsRunning;
public IntraSPSNameNodeContext(Namesystem namesystem,
BlockManager blockManager, Configuration conf) {
this.namesystem = namesystem;
this.blockManager = blockManager;
this.conf = conf;
isSpsRunning = () -> false;
}
@Override
public int getNumLiveDataNodes() {
return blockManager.getDatanodeManager().getNumLiveDataNodes();
}
@Override
public HdfsFileStatus getFileInfo(long inodeID) throws IOException {
String filePath = namesystem.getFilePath(inodeID);
if (StringUtils.isBlank(filePath)) {
LOG.debug("File with inodeID:{} doesn't exists!", inodeID);
return null;
}
HdfsFileStatus fileInfo = null;
try {
fileInfo = namesystem.getFileInfo(filePath, true, true);
} catch (IOException e) {
LOG.debug("File path:{} doesn't exists!", filePath);
}
return fileInfo;
}
@Override
public DatanodeStorageReport[] getLiveDatanodeStorageReport()
throws IOException {
namesystem.readLock();
try {
return blockManager.getDatanodeManager()
.getDatanodeStorageReport(DatanodeReportType.LIVE);
} finally {
namesystem.readUnlock();
}
}
@Override
public boolean hasLowRedundancyBlocks(long inodeID) {
namesystem.readLock();
try {
BlockCollection bc = namesystem.getBlockCollection(inodeID);
return blockManager.hasLowRedundancyBlocks(bc);
} finally {
namesystem.readUnlock();
}
}
@Override
public Configuration getConf() {
return conf;
}
@Override
public boolean isFileExist(long inodeId) {
return namesystem.getFSDirectory().getInode(inodeId) != null;
}
@Override
public void removeSPSHint(long inodeId) throws IOException {
this.namesystem.removeXattr(inodeId, XATTR_SATISFY_STORAGE_POLICY);
}
@Override
public boolean isRunning() {
// TODO : 'isSpsRunning' flag has been added to avoid the NN lock inside
// SPS. Context interface will be further refined as part of HDFS-12911
// modularization task. One idea is to introduce a cleaner interface similar
// to Namesystem for better abstraction.
return namesystem.isRunning() && isSpsRunning.get();
}
@Override
public void setSPSRunning(Supplier<Boolean> spsRunningFlag) {
this.isSpsRunning = spsRunningFlag;
}
@Override
public boolean isInSafeMode() {
return namesystem.isInSafeMode();
}
@Override
public boolean isMoverRunning() {
String moverId = HdfsServerConstants.MOVER_ID_PATH.toString();
return namesystem.isFileOpenedForWrite(moverId);
}
@Override
public void addDropPreviousSPSWorkAtDNs() {
namesystem.readLock();
try {
blockManager.getDatanodeManager().addDropSPSWorkCommandsToAllDNs();
} finally {
namesystem.readUnlock();
}
}
@Override
public BlockStoragePolicy getStoragePolicy(byte policyID) {
return blockManager.getStoragePolicy(policyID);
}
@Override
public NetworkTopology getNetworkTopology() {
return blockManager.getDatanodeManager().getNetworkTopology();
}
@Override
public long getFileID(String path) throws UnresolvedLinkException,
AccessControlException, ParentNotDirectoryException {
namesystem.readLock();
try {
INode inode = namesystem.getFSDirectory().getINode(path);
return inode == null ? -1 : inode.getId();
} finally {
namesystem.readUnlock();
}
}
@Override
public void assignBlockMoveTaskToTargetNode(BlockMovingInfo blkMovingInfo)
throws IOException {
namesystem.readLock();
try {
DatanodeDescriptor dn = blockManager.getDatanodeManager()
.getDatanode(blkMovingInfo.getTarget().getDatanodeUuid());
if (dn == null) {
throw new IOException("Failed to schedule block movement task:"
+ blkMovingInfo + " as target datanode: "
+ blkMovingInfo.getTarget() + " doesn't exists");
}
dn.addBlocksToMoveStorage(blkMovingInfo);
dn.incrementBlocksScheduled(blkMovingInfo.getTargetStorageType());
} finally {
namesystem.readUnlock();
}
}
@Override
public boolean verifyTargetDatanodeHasSpaceForScheduling(DatanodeInfo dn,
StorageType type, long blockSize) {
namesystem.readLock();
try {
DatanodeDescriptor datanode = blockManager.getDatanodeManager()
.getDatanode(dn.getDatanodeUuid());
if (datanode == null) {
LOG.debug("Target datanode: " + dn + " doesn't exists");
return false;
}
return null != datanode.chooseStorage4Block(type, blockSize);
} finally {
namesystem.readUnlock();
}
}
}
| [
"archen94@gmail.com"
] | archen94@gmail.com |
e315346f21c514cfbef94f547b9a60c36ebcea44 | 0205999a193bf670cd9d6e5b37e342b75f4e15b8 | /spring-expression/src/main/java/org/springframework/expression/spel/ast/OpLE.java | 7d4416bfaff319eaaad873caa45006832cc77395 | [
"Apache-2.0"
] | permissive | leaderli/spring-source | 18aa9a8c7c5e22d6faa6167e999ff88ffa211ba0 | 0edd75b2cedb00ad1357e7455a4fe9474b3284da | refs/heads/master | 2022-02-18T16:34:19.625966 | 2022-01-29T08:56:48 | 2022-01-29T08:56:48 | 204,468,286 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,573 | java | /*
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.expression.spel.ast;
import org.springframework.asm.MethodVisitor;
import org.springframework.expression.EvaluationException;
import org.springframework.expression.spel.CodeFlow;
import org.springframework.expression.spel.ExpressionState;
import org.springframework.expression.spel.support.BooleanTypedValue;
import org.springframework.util.NumberUtils;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* Implements the less-than-or-equal operator.
*
* @author Andy Clement
* @author Juergen Hoeller
* @author Giovanni Dall'Oglio Risso
* @since 3.0
*/
public class OpLE extends Operator {
public OpLE(int startPos, int endPos, SpelNodeImpl... operands) {
super("<=", startPos, endPos, operands);
this.exitTypeDescriptor = "Z";
}
@Override
public BooleanTypedValue getValueInternal(ExpressionState state) throws EvaluationException {
Object left = getLeftOperand().getValueInternal(state).getValue();
Object right = getRightOperand().getValueInternal(state).getValue();
this.leftActualDescriptor = CodeFlow.toDescriptorFromObject(left);
this.rightActualDescriptor = CodeFlow.toDescriptorFromObject(right);
if (left instanceof Number && right instanceof Number) {
Number leftNumber = (Number) left;
Number rightNumber = (Number) right;
if (leftNumber instanceof BigDecimal || rightNumber instanceof BigDecimal) {
BigDecimal leftBigDecimal = NumberUtils.convertNumberToTargetClass(leftNumber, BigDecimal.class);
BigDecimal rightBigDecimal = NumberUtils.convertNumberToTargetClass(rightNumber, BigDecimal.class);
return BooleanTypedValue.forValue(leftBigDecimal.compareTo(rightBigDecimal) <= 0);
} else if (leftNumber instanceof Double || rightNumber instanceof Double) {
return BooleanTypedValue.forValue(leftNumber.doubleValue() <= rightNumber.doubleValue());
} else if (leftNumber instanceof Float || rightNumber instanceof Float) {
return BooleanTypedValue.forValue(leftNumber.floatValue() <= rightNumber.floatValue());
} else if (leftNumber instanceof BigInteger || rightNumber instanceof BigInteger) {
BigInteger leftBigInteger = NumberUtils.convertNumberToTargetClass(leftNumber, BigInteger.class);
BigInteger rightBigInteger = NumberUtils.convertNumberToTargetClass(rightNumber, BigInteger.class);
return BooleanTypedValue.forValue(leftBigInteger.compareTo(rightBigInteger) <= 0);
} else if (leftNumber instanceof Long || rightNumber instanceof Long) {
return BooleanTypedValue.forValue(leftNumber.longValue() <= rightNumber.longValue());
} else if (leftNumber instanceof Integer || rightNumber instanceof Integer) {
return BooleanTypedValue.forValue(leftNumber.intValue() <= rightNumber.intValue());
} else if (leftNumber instanceof Short || rightNumber instanceof Short) {
return BooleanTypedValue.forValue(leftNumber.shortValue() <= rightNumber.shortValue());
} else if (leftNumber instanceof Byte || rightNumber instanceof Byte) {
return BooleanTypedValue.forValue(leftNumber.byteValue() <= rightNumber.byteValue());
} else {
// Unknown Number subtypes -> best guess is double comparison
return BooleanTypedValue.forValue(leftNumber.doubleValue() <= rightNumber.doubleValue());
}
}
return BooleanTypedValue.forValue(state.getTypeComparator().compare(left, right) <= 0);
}
@Override
public boolean isCompilable() {
return isCompilableOperatorUsingNumerics();
}
@Override
public void generateCode(MethodVisitor mv, CodeFlow cf) {
generateComparisonCode(mv, cf, IFGT, IF_ICMPGT);
}
}
| [
"429243408@qq.com"
] | 429243408@qq.com |
0ae7301bb35679a268945ec7e1fee0269ba8fa45 | 1b79d486690fbe647ec73e72f7dfe471406b53b0 | /wtk/src/org/apache/pivot/wtk/SuggestionPopupListener.java | 9b761e9760ca127abbf76d8763b55a11dda6d963 | [] | no_license | dmitrykolesnikovich/apache-pivot | 3634001675bc283cfa70e08fa27b413a93234cc1 | 92910f7739d3c699b40425ce98925daacf827e2e | refs/heads/master | 2021-01-01T16:51:37.832286 | 2015-02-10T14:49:17 | 2015-02-10T14:49:17 | 30,595,688 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,427 | 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.pivot.wtk;
import org.apache.pivot.collections.List;
/**
* Suggestion popup listener interface.
*/
public interface SuggestionPopupListener {
/**
* Suggestion popup listener adapter.
*/
public static class Adapter implements SuggestionPopupListener {
@Override
public void suggestionDataChanged(SuggestionPopup suggestionPopup,
List<?> previousSuggestionData) {
// empty block
}
@Override
public void suggestionRendererChanged(SuggestionPopup suggestionPopup,
ListView.ItemRenderer previousSuggestionRenderer) {
// empty block
}
@Override
public void listSizeChanged(SuggestionPopup suggestionPopup, int previousListSize) {
// empty block
}
}
/**
* Called when a suggestion popup's suggestions have changed.
*
* @param suggestionPopup
* @param previousSuggestionData
*/
public void suggestionDataChanged(SuggestionPopup suggestionPopup,
List<?> previousSuggestionData);
/**
* Called when a suggestion popup's item renderer has changed.
*
* @param suggestionPopup
* @param previousSuggestionRenderer
*/
public void suggestionRendererChanged(SuggestionPopup suggestionPopup,
ListView.ItemRenderer previousSuggestionRenderer);
/**
* Called when a suggestion popup's list size has changed.
*
* @param suggestionPopup
* @param previousListSize
*/
public void listSizeChanged(SuggestionPopup suggestionPopup, int previousListSize);
}
| [
"mind_1988"
] | mind_1988 |
81333482b63226b19cb7e98945505912bf3a39f8 | fa93c9be2923e697fb8a2066f8fb65c7718cdec7 | /sources/androidx/appcompat/widget/AppCompatImageView.java | 541511f9583bd86cde2b2bca4a589cbcc759af37 | [] | no_license | Auch-Auch/avito_source | b6c9f4b0e5c977b36d5fbc88c52f23ff908b7f8b | 76fdcc5b7e036c57ecc193e790b0582481768cdc | refs/heads/master | 2023-05-06T01:32:43.014668 | 2021-05-25T10:19:22 | 2021-05-25T10:19:22 | 370,650,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,665 | java | package androidx.appcompat.widget;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Bitmap;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.widget.ImageView;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.TintableBackgroundView;
import androidx.core.widget.TintableImageSourceView;
import l6.b.d.c;
public class AppCompatImageView extends ImageView implements TintableBackgroundView, TintableImageSourceView {
public final c a;
public final AppCompatImageHelper b;
public AppCompatImageView(@NonNull Context context) {
this(context, null);
}
@Override // android.widget.ImageView, android.view.View
public void drawableStateChanged() {
super.drawableStateChanged();
c cVar = this.a;
if (cVar != null) {
cVar.a();
}
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // androidx.core.view.TintableBackgroundView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public ColorStateList getSupportBackgroundTintList() {
c cVar = this.a;
if (cVar != null) {
return cVar.b();
}
return null;
}
@Override // androidx.core.view.TintableBackgroundView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public PorterDuff.Mode getSupportBackgroundTintMode() {
c cVar = this.a;
if (cVar != null) {
return cVar.c();
}
return null;
}
@Override // androidx.core.widget.TintableImageSourceView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public ColorStateList getSupportImageTintList() {
TintInfo tintInfo;
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper == null || (tintInfo = appCompatImageHelper.b) == null) {
return null;
}
return tintInfo.mTintList;
}
@Override // androidx.core.widget.TintableImageSourceView
@Nullable
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public PorterDuff.Mode getSupportImageTintMode() {
TintInfo tintInfo;
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper == null || (tintInfo = appCompatImageHelper.b) == null) {
return null;
}
return tintInfo.mTintMode;
}
@Override // android.widget.ImageView, android.view.View
public boolean hasOverlappingRendering() {
if (!(!(this.b.a.getBackground() instanceof RippleDrawable)) || !super.hasOverlappingRendering()) {
return false;
}
return true;
}
@Override // android.view.View
public void setBackgroundDrawable(Drawable drawable) {
super.setBackgroundDrawable(drawable);
c cVar = this.a;
if (cVar != null) {
cVar.e();
}
}
@Override // android.view.View
public void setBackgroundResource(@DrawableRes int i) {
super.setBackgroundResource(i);
c cVar = this.a;
if (cVar != null) {
cVar.f(i);
}
}
@Override // android.widget.ImageView
public void setImageBitmap(Bitmap bitmap) {
super.setImageBitmap(bitmap);
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // android.widget.ImageView
public void setImageDrawable(@Nullable Drawable drawable) {
super.setImageDrawable(drawable);
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // android.widget.ImageView
public void setImageResource(@DrawableRes int i) {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.setImageResource(i);
}
}
@Override // android.widget.ImageView
public void setImageURI(@Nullable Uri uri) {
super.setImageURI(uri);
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.a();
}
}
@Override // androidx.core.view.TintableBackgroundView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportBackgroundTintList(@Nullable ColorStateList colorStateList) {
c cVar = this.a;
if (cVar != null) {
cVar.h(colorStateList);
}
}
@Override // androidx.core.view.TintableBackgroundView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportBackgroundTintMode(@Nullable PorterDuff.Mode mode) {
c cVar = this.a;
if (cVar != null) {
cVar.i(mode);
}
}
@Override // androidx.core.widget.TintableImageSourceView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportImageTintList(@Nullable ColorStateList colorStateList) {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.b(colorStateList);
}
}
@Override // androidx.core.widget.TintableImageSourceView
@RestrictTo({RestrictTo.Scope.LIBRARY_GROUP_PREFIX})
public void setSupportImageTintMode(@Nullable PorterDuff.Mode mode) {
AppCompatImageHelper appCompatImageHelper = this.b;
if (appCompatImageHelper != null) {
appCompatImageHelper.c(mode);
}
}
public AppCompatImageView(@NonNull Context context, @Nullable AttributeSet attributeSet) {
this(context, attributeSet, 0);
}
public AppCompatImageView(@NonNull Context context, @Nullable AttributeSet attributeSet, int i) {
super(TintContextWrapper.wrap(context), attributeSet, i);
ThemeUtils.checkAppCompatTheme(this, getContext());
c cVar = new c(this);
this.a = cVar;
cVar.d(attributeSet, i);
AppCompatImageHelper appCompatImageHelper = new AppCompatImageHelper(this);
this.b = appCompatImageHelper;
appCompatImageHelper.loadFromAttributes(attributeSet, i);
}
}
| [
"auchhunter@gmail.com"
] | auchhunter@gmail.com |
2663559ba9382504a68324e6e5531f8a9649ffb7 | 834f0107422a2b26c2ee1c2265e13cf594efff3f | /src/test/java/com/neemshade/jhipster/application/service/UserServiceIntTest.java | ba734113b52201c6bd63db43475bf34a34c75d16 | [] | no_license | jbalaji01/jhipsterSampleApplication | ddfba10270c8ca52a08843627c706a1a05c33ab7 | 197d30687dd8a34de8a7eda3c2270a20f10881e1 | refs/heads/master | 2021-05-10T22:21:26.033492 | 2018-01-20T15:29:37 | 2018-01-20T15:29:37 | 118,255,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,528 | java | package com.neemshade.jhipster.application.service;
import com.neemshade.jhipster.application.JhipsterSampleApplicationApp;
import com.neemshade.jhipster.application.config.Constants;
import com.neemshade.jhipster.application.domain.User;
import com.neemshade.jhipster.application.repository.UserRepository;
import com.neemshade.jhipster.application.service.dto.UserDTO;
import com.neemshade.jhipster.application.service.util.RandomUtil;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.Optional;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Test class for the UserResource REST controller.
*
* @see UserService
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = JhipsterSampleApplicationApp.class)
@Transactional
public class UserServiceIntTest {
@Autowired
private UserRepository userRepository;
@Autowired
private UserService userService;
private User user;
@Before
public void init() {
user = new User();
user.setLogin("johndoe");
user.setPassword(RandomStringUtils.random(60));
user.setActivated(true);
user.setEmail("johndoe@localhost");
user.setFirstName("john");
user.setLastName("doe");
user.setImageUrl("http://placehold.it/50x50");
user.setLangKey("en");
}
@Test
@Transactional
public void assertThatUserMustExistToResetPassword() {
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.requestPasswordReset("invalid.login@localhost");
assertThat(maybeUser).isNotPresent();
maybeUser = userService.requestPasswordReset(user.getEmail());
assertThat(maybeUser).isPresent();
assertThat(maybeUser.orElse(null).getEmail()).isEqualTo(user.getEmail());
assertThat(maybeUser.orElse(null).getResetDate()).isNotNull();
assertThat(maybeUser.orElse(null).getResetKey()).isNotNull();
}
@Test
@Transactional
public void assertThatOnlyActivatedUserCanRequestPasswordReset() {
user.setActivated(false);
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.requestPasswordReset(user.getLogin());
assertThat(maybeUser).isNotPresent();
userRepository.delete(user);
}
@Test
@Transactional
public void assertThatResetKeyMustNotBeOlderThan24Hours() {
Instant daysAgo = Instant.now().minus(25, ChronoUnit.HOURS);
String resetKey = RandomUtil.generateResetKey();
user.setActivated(true);
user.setResetDate(daysAgo);
user.setResetKey(resetKey);
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey());
assertThat(maybeUser).isNotPresent();
userRepository.delete(user);
}
@Test
@Transactional
public void assertThatResetKeyMustBeValid() {
Instant daysAgo = Instant.now().minus(25, ChronoUnit.HOURS);
user.setActivated(true);
user.setResetDate(daysAgo);
user.setResetKey("1234");
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey());
assertThat(maybeUser).isNotPresent();
userRepository.delete(user);
}
@Test
@Transactional
public void assertThatUserCanResetPassword() {
String oldPassword = user.getPassword();
Instant daysAgo = Instant.now().minus(2, ChronoUnit.HOURS);
String resetKey = RandomUtil.generateResetKey();
user.setActivated(true);
user.setResetDate(daysAgo);
user.setResetKey(resetKey);
userRepository.saveAndFlush(user);
Optional<User> maybeUser = userService.completePasswordReset("johndoe2", user.getResetKey());
assertThat(maybeUser).isPresent();
assertThat(maybeUser.orElse(null).getResetDate()).isNull();
assertThat(maybeUser.orElse(null).getResetKey()).isNull();
assertThat(maybeUser.orElse(null).getPassword()).isNotEqualTo(oldPassword);
userRepository.delete(user);
}
@Test
@Transactional
public void testFindNotActivatedUsersByCreationDateBefore() {
Instant now = Instant.now();
user.setActivated(false);
User dbUser = userRepository.saveAndFlush(user);
dbUser.setCreatedDate(now.minus(4, ChronoUnit.DAYS));
userRepository.saveAndFlush(user);
List<User> users = userRepository.findAllByActivatedIsFalseAndCreatedDateBefore(now.minus(3, ChronoUnit.DAYS));
assertThat(users).isNotEmpty();
userService.removeNotActivatedUsers();
users = userRepository.findAllByActivatedIsFalseAndCreatedDateBefore(now.minus(3, ChronoUnit.DAYS));
assertThat(users).isEmpty();
}
@Test
@Transactional
public void assertThatAnonymousUserIsNotGet() {
user.setLogin(Constants.ANONYMOUS_USER);
if (!userRepository.findOneByLogin(Constants.ANONYMOUS_USER).isPresent()) {
userRepository.saveAndFlush(user);
}
final PageRequest pageable = new PageRequest(0, (int) userRepository.count());
final Page<UserDTO> allManagedUsers = userService.getAllManagedUsers(pageable);
assertThat(allManagedUsers.getContent().stream()
.noneMatch(user -> Constants.ANONYMOUS_USER.equals(user.getLogin())))
.isTrue();
}
@Test
@Transactional
public void testRemoveNotActivatedUsers() {
user.setActivated(false);
userRepository.saveAndFlush(user);
// Let the audit first set the creation date but then update it
user.setCreatedDate(Instant.now().minus(30, ChronoUnit.DAYS));
userRepository.saveAndFlush(user);
assertThat(userRepository.findOneByLogin("johndoe")).isPresent();
userService.removeNotActivatedUsers();
assertThat(userRepository.findOneByLogin("johndoe")).isNotPresent();
}
}
| [
"jhipster-bot@users.noreply.github.com"
] | jhipster-bot@users.noreply.github.com |
c9ed8ab9e5c8d081f6e647872fe31262b0dfca2b | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Quartz/Quartz865.java | 799115f81c4af41b13fae45ed54f951677820c1f | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 824 | java | public void testQTZ327SimpleTriggerNoRepeat() throws Exception {
Scheduler scheduler = null;
try {
StdSchedulerFactory factory = new StdSchedulerFactory("org/quartz/xml/quartz-test.properties");
scheduler = factory.getScheduler();
ClassLoadHelper clhelper = new CascadingClassLoadHelper();
clhelper.initialize();
XMLSchedulingDataProcessor processor = new XMLSchedulingDataProcessor(clhelper);
processor.processFileAndScheduleJobs("org/quartz/xml/simple-job-trigger-no-repeat.xml", scheduler);
assertEquals(1, scheduler.getJobKeys(GroupMatcher.jobGroupEquals("DEFAULT")).size());
assertEquals(1, scheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals("DEFAULT")).size());
} finally {
if (scheduler != null)
scheduler.shutdown();
}
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
f2b07dba624800d2902270cd2599000af1472249 | 53699b7247e77ae70f4af6b718b05098de08615f | /Netty3.5.5_src/src/main/java/org/jboss/netty/example/echo/EchoClientHandler.java | 216a4617bd8ea6ebec4184a0a03900a601faa667 | [] | no_license | zogwei/allProject | fc758b2aa827c9540b456b0e637392244dbe6225 | 0cb62453d2a4d8c9b6ab8c08dede6e68989934f3 | refs/heads/master | 2021-01-25T06:36:57.899097 | 2013-11-29T09:19:08 | 2013-11-29T09:19:08 | 28,529,921 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,078 | java | /*
* Copyright 2012 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 org.jboss.netty.example.echo;
import java.util.concurrent.atomic.AtomicLong;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
/**
* Handler implementation for the echo client. It initiates the ping-pong
* traffic between the echo client and server by sending the first message to
* the server.
*/
public class EchoClientHandler extends SimpleChannelUpstreamHandler {
private static final Logger logger = Logger.getLogger(
EchoClientHandler.class.getName());
private final ChannelBuffer firstMessage;
private final AtomicLong transferredBytes = new AtomicLong();
/**
* Creates a client-side handler.
*/
public EchoClientHandler(int firstMessageSize) {
if (firstMessageSize <= 0) {
throw new IllegalArgumentException(
"firstMessageSize: " + firstMessageSize);
}
firstMessage = ChannelBuffers.buffer(firstMessageSize);
for (int i = 0; i < firstMessage.capacity(); i ++) {
firstMessage.writeByte((byte) i);
}
}
public long getTransferredBytes() {
return transferredBytes.get();
}
@Override
public void channelConnected(
ChannelHandlerContext ctx, ChannelStateEvent e) {
// Send the first message. Server will not send anything here
// because the firstMessage's capacity is 0.
e.getChannel().write(firstMessage);
}
@Override
public void messageReceived(
ChannelHandlerContext ctx, MessageEvent e) {
// Send back the received message to the remote peer.
transferredBytes.addAndGet(((ChannelBuffer) e.getMessage()).readableBytes());
e.getChannel().write(e.getMessage());
}
@Override
public void exceptionCaught(
ChannelHandlerContext ctx, ExceptionEvent e) {
// Close the connection when an exception is raised.
logger.log(
Level.WARNING,
"Unexpected exception from downstream.",
e.getCause());
e.getChannel().close();
}
}
| [
"zogwei@gmail.com@60187b04-42e5-a1eb-cd66-7b3f5e7d8f8a"
] | zogwei@gmail.com@60187b04-42e5-a1eb-cd66-7b3f5e7d8f8a |
e4453f68864ddfc1fcac0a5a44544f8ad0686ca4 | 8a535b76c6a2420cb2639a2408045c930c751218 | /changgou_parent/changgou_service/changgou-service-goods/src/main/java/com/changgou/goods/controller/SpecController.java | c5367aa1f4ed26de9bd760731441b0d11440f772 | [
"Apache-2.0"
] | permissive | zyz610650/SpringCloud-Shop | cb6300371f632ec22670aefe9f202d47b7875fa6 | b63ed60f31569ca0ff0c8cb74c2ce6c596cacd91 | refs/heads/master | 2023-07-21T05:05:05.870757 | 2021-08-11T09:10:52 | 2021-08-11T09:10:52 | 384,647,121 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,068 | java | package com.changgou.goods.controller;
import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.changgou.goods.pojo.Spec;
import com.changgou.goods.service.SpecService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/****
* @Author:shenkunlin
* @Description:
* @Date 2019/6/14 0:18
*****/
@Api(value = "SpecController")
@RestController
@RequestMapping("/spec")
@CrossOrigin
public class SpecController {
@Autowired
private SpecService specService;
@GetMapping("/category/{id}")
public Result<List<Spec>> findByCategoryId(@PathVariable("id") Integer categoryId)
{
return new Result<List<Spec>>(true,StatusCode.OK,"成功",specService.findByCategoryId(categoryId));
}
/***
* Spec分页条件搜索实现
* @param spec
* @param page
* @param size
* @return
*/
@ApiOperation(value = "Spec条件分页查询",notes = "分页条件查询Spec方法详情",tags = {"SpecController"})
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "page", value = "当前页", required = true, dataType = "Integer"),
@ApiImplicitParam(paramType = "path", name = "size", value = "每页显示条数", required = true, dataType = "Integer")
})
@PostMapping(value = "/search/{page}/{size}" )
public Result<PageInfo> findPage(@RequestBody(required = false) @ApiParam(name = "Spec对象",value = "传入JSON数据",required = false) Spec spec, @PathVariable int page, @PathVariable int size){
//调用SpecService实现分页条件查询Spec
PageInfo<Spec> pageInfo = specService.findPage(spec, page, size);
return new Result(true, StatusCode.OK,"查询成功",pageInfo);
}
/***
* Spec分页搜索实现
* @param page:当前页
* @param size:每页显示多少条
* @return
*/
@ApiOperation(value = "Spec分页查询",notes = "分页查询Spec方法详情",tags = {"SpecController"})
@ApiImplicitParams({
@ApiImplicitParam(paramType = "path", name = "page", value = "当前页", required = true, dataType = "Integer"),
@ApiImplicitParam(paramType = "path", name = "size", value = "每页显示条数", required = true, dataType = "Integer")
})
@GetMapping(value = "/search/{page}/{size}" )
public Result<PageInfo> findPage(@PathVariable int page, @PathVariable int size){
//调用SpecService实现分页查询Spec
PageInfo<Spec> pageInfo = specService.findPage(page, size);
return new Result<PageInfo>(true,StatusCode.OK,"查询成功",pageInfo);
}
/***
* 多条件搜索品牌数据
* @param spec
* @return
*/
@ApiOperation(value = "Spec条件查询",notes = "条件查询Spec方法详情",tags = {"SpecController"})
@PostMapping(value = "/search" )
public Result<List<Spec>> findList(@RequestBody(required = false) @ApiParam(name = "Spec对象",value = "传入JSON数据",required = false) Spec spec){
//调用SpecService实现条件查询Spec
List<Spec> list = specService.findList(spec);
return new Result<List<Spec>>(true,StatusCode.OK,"查询成功",list);
}
/***
* 根据ID删除品牌数据
* @param id
* @return
*/
@ApiOperation(value = "Spec根据ID删除",notes = "根据ID删除Spec方法详情",tags = {"SpecController"})
@ApiImplicitParam(paramType = "path", name = "id", value = "主键ID", required = true, dataType = "Integer")
@DeleteMapping(value = "/{id}" )
public Result delete(@PathVariable Integer id){
//调用SpecService实现根据主键删除
specService.delete(id);
return new Result(true,StatusCode.OK,"删除成功");
}
/***
* 修改Spec数据
* @param spec
* @param id
* @return
*/
@ApiOperation(value = "Spec根据ID修改",notes = "根据ID修改Spec方法详情",tags = {"SpecController"})
@ApiImplicitParam(paramType = "path", name = "id", value = "主键ID", required = true, dataType = "Integer")
@PutMapping(value="/{id}")
public Result update(@RequestBody @ApiParam(name = "Spec对象",value = "传入JSON数据",required = false) Spec spec,@PathVariable Integer id){
//设置主键值
spec.setId(id);
//调用SpecService实现修改Spec
specService.update(spec);
return new Result(true,StatusCode.OK,"修改成功");
}
/***
* 新增Spec数据
* @param spec
* @return
*/
@ApiOperation(value = "Spec添加",notes = "添加Spec方法详情",tags = {"SpecController"})
@PostMapping
public Result add(@RequestBody @ApiParam(name = "Spec对象",value = "传入JSON数据",required = true) Spec spec){
//调用SpecService实现添加Spec
specService.add(spec);
return new Result(true,StatusCode.OK,"添加成功");
}
/***
* 根据ID查询Spec数据
* @param id
* @return
*/
@ApiOperation(value = "Spec根据ID查询",notes = "根据ID查询Spec方法详情",tags = {"SpecController"})
@ApiImplicitParam(paramType = "path", name = "id", value = "主键ID", required = true, dataType = "Integer")
@GetMapping("/{id}")
public Result<Spec> findById(@PathVariable Integer id){
//调用SpecService实现根据主键查询Spec
Spec spec = specService.findById(id);
return new Result<Spec>(true,StatusCode.OK,"查询成功",spec);
}
/***
* 查询Spec全部数据
* @return
*/
@ApiOperation(value = "查询所有Spec",notes = "查询所Spec有方法详情",tags = {"SpecController"})
@GetMapping
public Result<List<Spec>> findAll(){
//调用SpecService实现查询所有Spec
List<Spec> list = specService.findAll();
return new Result<List<Spec>>(true, StatusCode.OK,"查询成功",list) ;
}
}
| [
"zhangyuze724@163.com"
] | zhangyuze724@163.com |
051c5d552242d9c720e43e8f5e182bbaeefa4848 | 5c5da9225cd693734ecb68129ac91c12aee7d14a | /src/main/java/pl/sda/kurs/z11_09_03_2019/task1/T6/T6.java | 14f647161cbcdd749950289e1fcaa47094b10e7e | [] | no_license | Radekj512/KursJava | 08b18adb77fe13eac1ef42325d2c07968b73166b | 92ee21a24ec75106955a7f6c0ef978dc3f1a44ea | refs/heads/master | 2020-04-22T01:13:35.020038 | 2019-04-14T12:17:57 | 2019-04-14T12:17:57 | 170,007,696 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,916 | java | package pl.sda.kurs.z11_09_03_2019.task1.T6;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class T6 {
public static void main(String[] args) throws IOException {
Map<String, String> panstwaMiasta = new HashMap<>();
Path path = Paths.get("src", "main", "resources", "stolice.txt");
Stream<String> lines = Files.lines(path);
List<PanstwoMiasto> lista;
Scanner s = new Scanner(System.in);
lista = lines.map(line -> line.split(":"))
.map(arr -> new PanstwoMiasto(arr[0], arr[1]))
.collect(Collectors.toList());
for (int i = 0; i < lista.size(); i++) {
panstwaMiasta.put(lista.get(i).getPanstwo(), lista.get(i).getMiasto());
}
/* System.out.println("Podaj panstwo: ");
panstwo = s.nextLine();
panstwo = panstwo.substring(0,1).toUpperCase() + panstwo.substring(1).toLowerCase();
if (panstwaMiasta.get(panstwo) == null){
System.out.println("Podanego panstwa nie ma w bazie");
}else{
System.out.println(panstwaMiasta.get(panstwo));
}*/
System.out.print("Chcesz zgadywac Panstwa(1) czy Stolice(2)?: ");
int wybor = s.nextInt();
int wynik = 0;
if (wybor == 1) {
for (Map.Entry<String, String> kv : panstwaMiasta.entrySet()) {
System.out.print("Stolica jakiego Panstwa jest " + kv.getValue() + ": ");
String odp = s.next();
odp = odp.substring(0,1).toUpperCase() + odp.substring(1).toLowerCase();
if (odp.equals(kv.getKey())) {
wynik++;
}
}
System.out.println("Twoj wynik to: " + wynik);
} else if (wybor == 2) {
for (Map.Entry<String, String> kv : panstwaMiasta.entrySet()) {
System.out.print("Co jest stolica " + kv.getKey() + ": ");
String odp = s.next();
odp = odp.substring(0,1).toUpperCase() + odp.substring(1).toLowerCase();
if (odp.equals(kv.getValue())) {
wynik++;
}
}
System.out.println("Twoj wynik to: " + wynik);
} else {
System.out.println("Wprowadzono zla liczbe");
}
}
public static void dodaj(String panstwo, String miasto) throws IOException {
Path path = Paths.get("src", "main", "resources", "stolice.txt");
List<String> lista = new ArrayList<>();
StringBuilder sb = new StringBuilder();
sb.append(panstwo).append(":").append(miasto);
lista.add(sb.toString());
Files.write(path, lista, StandardOpenOption.APPEND);
}
}
| [
"roszko.radek@gmail.com"
] | roszko.radek@gmail.com |
dcd657469466f5ba1295e75e5af687c6a8f1e7d8 | 181fc8bfc2b2a76253f0dd1a3d81acd572247fd7 | /springbeans_modify/src/main/java/org/springframework/beans/factory/xml/ParserContext.java | c36314c0d14babbfdd5c0373032ff77841a4df2a | [
"Apache-2.0"
] | permissive | huguiqi/blog_demos | 3da819f9773f4f96a38355d60f136cbb374067ea | c6d864e91b505fc765835325f904c95ff9257833 | refs/heads/master | 2022-12-25T07:16:56.894155 | 2020-09-30T00:30:59 | 2020-09-30T00:30:59 | 299,854,530 | 1 | 1 | Apache-2.0 | 2020-09-30T08:21:35 | 2020-09-30T08:21:35 | null | UTF-8 | Java | false | false | 3,992 | java | /*
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.xml;
import java.util.Stack;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.parsing.BeanComponentDefinition;
import org.springframework.beans.factory.parsing.ComponentDefinition;
import org.springframework.beans.factory.parsing.CompositeComponentDefinition;
import org.springframework.beans.factory.support.BeanDefinitionReaderUtils;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
/**
* Context that gets passed along a bean definition parsing process,
* encapsulating all relevant configuration as well as state.
* Nested inside an {@link XmlReaderContext}.
*
* @author Rob Harrop
* @author Juergen Hoeller
* @since 2.0
* @see XmlReaderContext
* @see BeanDefinitionParserDelegate
*/
public final class ParserContext {
private final XmlReaderContext readerContext;
private final BeanDefinitionParserDelegate delegate;
private BeanDefinition containingBeanDefinition;
private final Stack<ComponentDefinition> containingComponents = new Stack<ComponentDefinition>();
public ParserContext(XmlReaderContext readerContext, BeanDefinitionParserDelegate delegate) {
this.readerContext = readerContext;
this.delegate = delegate;
}
public ParserContext(XmlReaderContext readerContext, BeanDefinitionParserDelegate delegate,
BeanDefinition containingBeanDefinition) {
this.readerContext = readerContext;
this.delegate = delegate;
this.containingBeanDefinition = containingBeanDefinition;
}
public final XmlReaderContext getReaderContext() {
return this.readerContext;
}
public final BeanDefinitionRegistry getRegistry() {
return this.readerContext.getRegistry();
}
public final BeanDefinitionParserDelegate getDelegate() {
return this.delegate;
}
public final BeanDefinition getContainingBeanDefinition() {
return this.containingBeanDefinition;
}
public final boolean isNested() {
return (this.containingBeanDefinition != null);
}
public boolean isDefaultLazyInit() {
return BeanDefinitionParserDelegate.TRUE_VALUE.equals(this.delegate.getDefaults().getLazyInit());
}
public Object extractSource(Object sourceCandidate) {
return this.readerContext.extractSource(sourceCandidate);
}
public CompositeComponentDefinition getContainingComponent() {
return (!this.containingComponents.isEmpty() ?
(CompositeComponentDefinition) this.containingComponents.lastElement() : null);
}
public void pushContainingComponent(CompositeComponentDefinition containingComponent) {
this.containingComponents.push(containingComponent);
}
public CompositeComponentDefinition popContainingComponent() {
return (CompositeComponentDefinition) this.containingComponents.pop();
}
public void popAndRegisterContainingComponent() {
registerComponent(popContainingComponent());
}
public void registerComponent(ComponentDefinition component) {
CompositeComponentDefinition containingComponent = getContainingComponent();
if (containingComponent != null) {
containingComponent.addNestedComponent(component);
}
else {
this.readerContext.fireComponentRegistered(component);
}
}
public void registerBeanComponent(BeanComponentDefinition component) {
BeanDefinitionReaderUtils.registerBeanDefinition(component, getRegistry());
registerComponent(component);
}
}
| [
"zq2599@gmail.com"
] | zq2599@gmail.com |
f130ca29fb1e6e8be9b6a350095b5601609505b0 | 5f63a60fd029b8a74d2b1b4bf6992f5e4c7b429b | /com/planet_ink/coffee_mud/Items/BasicTech/GenLaserGun.java | 78e5d1fd74d520c6375a8d7405d7e2f16446b250 | [
"Apache-2.0"
] | permissive | bozimmerman/CoffeeMud | 5da8b5b98c25b70554ec9a2a8c0ef97f177dc041 | 647864922e07572b1f6c863de8f936982f553288 | refs/heads/master | 2023-09-04T09:17:12.656291 | 2023-09-02T00:30:19 | 2023-09-02T00:30:19 | 5,267,832 | 179 | 122 | Apache-2.0 | 2023-04-30T11:09:14 | 2012-08-02T03:22:12 | Java | UTF-8 | Java | false | false | 1,942 | java | package com.planet_ink.coffee_mud.Items.BasicTech;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.BasicTech.StdElecWeapon.ModeType;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2013-2023 Bo Zimmerman
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
public class GenLaserGun extends GenElecWeapon
{
@Override
public String ID()
{
return "GenLaserGun";
}
public GenLaserGun()
{
super();
setName("a laser pistol");
basePhyStats.setWeight(5);
setDisplayText("a laser pistol is sitting here");
super.mode = ModeType.LASER;
super.modeTypes = new ModeType[]{ ModeType.LASER };
}
}
| [
"bo@zimmers.net"
] | bo@zimmers.net |
341375b44aa3efbc02ff81ff1a4b2ad64014403d | 01a835cef8885af7701b81333f72fed358fa7bfa | /BBS/src/main/java/com/weikun/dao/IUserDAO.java | f6a3292ac3e30fa78e2c76cb4ba8ac7679349d29 | [] | no_license | ForeverSquid/cienet_exercise | c04e134c5e417bd8ca17b554394c455e7660667c | 9f4c7b0bc33c47c636ac661468f752f2469e23f5 | refs/heads/master | 2021-01-20T22:23:39.618201 | 2017-08-29T23:41:40 | 2017-08-29T23:43:29 | 101,818,184 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 242 | java | package com.weikun.dao;
import java.io.InputStream;
import com.weikun.vo.BBSUser;
public interface IUserDAO {
public BBSUser login(BBSUser user);
public boolean register(BBSUser user);
public InputStream getPic(int id);
}
| [
"wk2003119@163.com"
] | wk2003119@163.com |
33f0719631665ab2cff5200b76e07971cf5ede2f | 5b8f0cbd2076b07481bd62f26f5916d09a050127 | /src/LC337.java | 94e38ac02b25fe45657e02e3206d4f3a58da4e83 | [] | no_license | micgogi/micgogi_algo | b45664de40ef59962c87fc2a1ee81f86c5d7c7ba | 7cffe8122c04059f241270bf45e033b1b91ba5df | refs/heads/master | 2022-07-13T00:00:56.090834 | 2022-06-15T14:02:51 | 2022-06-15T14:02:51 | 209,986,655 | 7 | 3 | null | 2020-10-20T07:41:03 | 2019-09-21T13:06:43 | Java | UTF-8 | Java | false | false | 1,282 | java |
/**
* @author Micgogi
* on 11/23/2020 3:40 PM
* Rahul Gogyani
*/
public class LC337 {
static TreeNode root;
static class TreeNode {
int val;
TreeNode left;
TreeNode right;
public TreeNode(int data) {
this.val = data;
}
}
public static void main(String args[]) {
root = new TreeNode(65);
root.left = new TreeNode(78);
root.right = new TreeNode(75);
root.left.left = new TreeNode(73);
root.left.right = new TreeNode(84);
root.right.left = new TreeNode(65);
System.out.println(rob(root));
}
public static int[] helper(TreeNode root) {
// return [rob this node, not rob this node]
if (root == null) return new int[]{0, 0};
int[] left = helper(root.left);
int[] right = helper(root.right);
// if we rob this node, we cannot rob its children
int rob = root.val + left[1] + right[1];
//else we free to choose rob its children or not
int notROb = Math.max(left[0], left[1]) + Math.max(right[0], right[1]);
return new int[]{rob, notROb};
}
public static int rob(TreeNode root) {
int[] res = helper(root);
return Math.max(res[0], res[1]);
}
}
| [
"rahul.gogyani@gmail.com"
] | rahul.gogyani@gmail.com |
ad696f1d746aef6f4f35531346830a73c9a3f50a | 0dc7b5884df384709a2704a8bd7995058f039a4b | /tesuto-content-services/tesuto-content-core/src/main/java/org/cccnext/tesuto/content/model/competency/CompetencyMap.java | 1801438f70a119917d699d6896fbb0602251a6ff | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"EPL-1.0"
] | permissive | apereo-tesuto/tesuto | b1672fc2ebbd4b5d4647ee15e3e4285c8e3dc0be | 90ed26311b1baa15cd90d67bb55e7d4c613bdc53 | refs/heads/master | 2021-10-08T01:02:49.098929 | 2021-09-24T21:22:52 | 2021-09-24T21:22:52 | 218,090,150 | 4 | 3 | Apache-2.0 | 2021-09-24T21:22:53 | 2019-10-28T16:08:04 | null | UTF-8 | Java | false | false | 3,501 | java | /*******************************************************************************
* Copyright © 2019 by California Community Colleges Chancellor's Office
*
* 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.cccnext.tesuto.content.model.competency;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.cccnext.tesuto.content.model.AbstractAssessment;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.List;
/**
* Created by jasonbrown on 6/17/16.
*/
@Document // This is for Mongo
@CompoundIndexes({
@CompoundIndex(name = "discipline_version_idx", def = "{'discipline' : 1, 'version' : -1}", unique = true),
@CompoundIndex(name = "discipline_version_published_idx_1", def = "{'discipline' : 1, 'version' : -1, 'published' : 1}", unique = true) })
public class CompetencyMap implements AbstractAssessment {
private static final long serialVersionUID = 2l;
@Id
private String id; // needed for Mongo
private String title;
private int version;
private String identifier;
private String discipline;
private List<CompetencyRef> competencyRefs;
private boolean published;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getDiscipline() {
return discipline;
}
public void setDiscipline(String discipline) {
this.discipline = discipline;
}
public List<CompetencyRef> getCompetencyRefs() {
return competencyRefs;
}
public void setCompetencyRefs(List<CompetencyRef> competencyRefs) {
this.competencyRefs = competencyRefs;
}
public boolean isPublished() {
return published;
}
public void setPublished(boolean published) {
this.published = published;
}
@Override
public boolean equals(Object o) {
return EqualsBuilder.reflectionEquals(this, o);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}
| [
"jstanley@unicon.net"
] | jstanley@unicon.net |
492b765838a9a783f2cbc76cb1fb71dce93e20cb | c3478ef75ee159d5cedb4a0cb7e18a8a778beea1 | /app/src/main/java/org/nearbyshops/enduserappnew/API_SDS/MarketReviewService.java | 14a6c78fdd44d4546b746745a028dbd533bb9881 | [
"LicenseRef-scancode-free-unknown",
"LicenseRef-scancode-proprietary-license",
"LicenseRef-scancode-other-permissive",
"MIT"
] | permissive | rksazid/Nearby-Shops-End-User-Android-app | 195df67acacf97696ca95207fe0b2726f5f7890c | 1326b91efcbe7a7a8217de3f81e48094f5c4a9bb | refs/heads/master | 2020-09-08T04:10:21.955606 | 2019-11-10T18:50:13 | 2019-11-10T18:50:13 | 221,012,183 | 2 | 0 | MIT | 2019-11-11T15:33:40 | 2019-11-11T15:33:39 | null | UTF-8 | Java | false | false | 1,360 | java | package org.nearbyshops.enduserappnew.API_SDS;
import okhttp3.ResponseBody;
import org.nearbyshops.enduserappnew.Model.ModelReviewMarket.MarketReview;
import org.nearbyshops.enduserappnew.Model.ModelEndPoints.MarketReviewEndPoint;
import retrofit2.Call;
import retrofit2.http.*;
import java.util.List;
/**
* Created by sumeet on 2/4/16.
*/
public interface MarketReviewService {
@GET("/api/v1/MarketReview")
Call<MarketReviewEndPoint> getReviews(
@Query("ItemID") Integer itemID,
@Query("EndUserID") Integer endUserID,
@Query("GetEndUser") Boolean getEndUser,
@Query("SortBy") String sortBy,
@Query("Limit") Integer limit, @Query("Offset") Integer offset,
@Query("metadata_only") Boolean metaonly
);
@GET("/api/v1/MarketReview/{id}")
Call<MarketReview> getItemReview(@Path("id") int itemReviewID);
@POST("/api/v1/MarketReview")
Call<MarketReview> insertItemReview(@Body MarketReview book);
@PUT("/api/v1/MarketReview/{id}")
Call<ResponseBody> updateItemReview(@Body MarketReview itemReview, @Path("id") int id);
@PUT("/api/v1/MarketReview/")
Call<ResponseBody> updateItemReviewBulk(@Body List<MarketReview> itemReviewList);
@DELETE("/api/v1/MarketReview/{id}")
Call<ResponseBody> deleteItemReview(@Path("id") int id);
}
| [
"sumeet.0587@gmail.com"
] | sumeet.0587@gmail.com |
b608a0138003b751dcfb3594fbae7c111234544c | 3bb9e1a187cb72e2620a40aa208bf94e5cee46f5 | /soa-rest-sec/src/main/java/ong/eu/soon/rest/sec/model/Store_.java | 4b5d29b2c77752d0d852377b371e9125ce1a64d0 | [] | no_license | eusoon/Mobile-Catalog | 2e6f766864ea25f659f87548559502358ac5466c | 869d7588447117b751fcd1387cd84be0bd66ef26 | refs/heads/master | 2021-01-22T23:49:12.717052 | 2013-12-10T08:22:20 | 2013-12-10T08:22:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,145 | java | package ong.eu.soon.rest.sec.model;
import javax.annotation.Generated;
import javax.persistence.metamodel.SetAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
import ong.eu.soon.rest.sec.model.Service;
import ong.eu.soon.rest.sec.model.Store;
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
@StaticMetamodel(Store.class)
public class Store_ {
public static volatile SingularAttribute<Store, Long> id;
public static volatile SingularAttribute<Store, String> address;
public static volatile SingularAttribute<Store, String> city;
public static volatile SingularAttribute<Store, String> country;
public static volatile SingularAttribute<Store, java.math.BigDecimal> latitude;
public static volatile SingularAttribute<Store, java.math.BigDecimal> logititude;
public static volatile SingularAttribute<Store, String> name;
public static volatile SingularAttribute<Store, String> phone;
public static volatile SingularAttribute<Store, String> state;
public static volatile SetAttribute<Store, Service> services;
}
| [
"eusoon@gmail.com"
] | eusoon@gmail.com |
2bbbcd61ceea36a5b0fba1dc35f76acfe09ffb48 | 96dd469b57d3e8ae80b78dafc53b4c710e2168b5 | /super-devops-support/src/main/java/com/wl4g/devops/support/cli/command/RemoteDestroableCommand.java | 4ab9980318472ecd7400211bdd80c35297da8671 | [
"Apache-2.0"
] | permissive | skymysky/super-devops | a29ef48859cc6c0591da6681a44c2e3c1a9c50b4 | 11293ed068c5fe2e2854e26e462b47116661ce0f | refs/heads/master | 2020-12-04T05:07:00.197931 | 2019-12-29T10:37:46 | 2019-12-29T10:37:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,207 | java | /*
* Copyright 2017 ~ 2025 the original author or authors. <wanglsir@gmail.com, 983708408@qq.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.wl4g.devops.support.cli.command;
import static org.springframework.util.Assert.hasText;
import static org.springframework.util.Assert.notNull;
/**
* SSH remote command's wrapper.
*
* @author Wangl.sir <wanglsir@gmail.com, 983708408@qq.com>
* @version v1.0 2019年12月5日
* @since
*/
public class RemoteDestroableCommand extends DestroableCommand {
private static final long serialVersionUID = -5843814202945157321L;
/** Remote host user name to execute the remote command. */
final private String user;
/** Remote host user name to execute the remote host address. */
final private String host;
/** SSH2 (public key) of the remote host. */
final private char[] pemPrivateKey;
public RemoteDestroableCommand(String command, long timeoutMs, String user, String host, char[] pemPrivateKey) {
this(null, command, timeoutMs, user, host, pemPrivateKey);
}
public RemoteDestroableCommand(String processId, String command, long timeoutMs, String user, String host,
char[] pemPrivateKey) {
super(processId, command, timeoutMs);
hasText(user, "Command remote user can't empty.");
hasText(host, "Command remote host can't empty.");
notNull(pemPrivateKey, "Command remote ssh pubkey can't empty.");
this.user = user;
this.host = host;
this.pemPrivateKey = pemPrivateKey;
}
public String getUser() {
return user;
}
public String getHost() {
return host;
}
public char[] getPemPrivateKey() {
return pemPrivateKey;
}
}
| [
"983708408@qq.com"
] | 983708408@qq.com |
abb367fbafdd01c46878473fbada4c7fe36d1423 | b6ea417b48402d85b6fe90299c51411b778c07cc | /spring-web/src/test/java/org/springframework/http/client/Netty4ClientHttpRequestFactoryTests.java | 897bb745fabeb7c108a17c40bb955345994a26f7 | [
"Apache-2.0"
] | permissive | DevHui/spring-framework | 065f24e96eaaed38495b9d87bc322db82b6a046c | 4a2f291e26c6f78c3875dea13432be21bb1c0ed6 | refs/heads/master | 2020-12-04T21:08:18.445815 | 2020-01-15T03:54:42 | 2020-01-15T03:54:42 | 231,526,595 | 1 | 0 | Apache-2.0 | 2020-01-03T06:28:30 | 2020-01-03T06:28:29 | null | UTF-8 | Java | false | false | 1,578 | java | /*
* Copyright 2002-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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.http.client;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.http.HttpMethod;
/**
* @author Arjen Poutsma
*/
public class Netty4ClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTestCase {
private static EventLoopGroup eventLoopGroup;
@BeforeClass
public static void createEventLoopGroup() {
eventLoopGroup = new NioEventLoopGroup();
}
@AfterClass
public static void shutdownEventLoopGroup() throws InterruptedException {
eventLoopGroup.shutdownGracefully().sync();
}
@Override
protected ClientHttpRequestFactory createRequestFactory() {
return new Netty4ClientHttpRequestFactory(eventLoopGroup);
}
@Override
@Test
public void httpMethods() throws Exception {
super.httpMethods();
assertHttpMethod("patch", HttpMethod.PATCH);
}
}
| [
"pengshaohui@markor.com.cn"
] | pengshaohui@markor.com.cn |
8793ba5d787b5defd6568642104d73d5618f11ef | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/6/6_ae8f7e41f8e5e670f397e8f97edd8313fb079506/Pattern/6_ae8f7e41f8e5e670f397e8f97edd8313fb079506_Pattern_t.java | 306fe4a194646c3ad9bf4f0be2b79f1d4b7e087d | [] | 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,612 | java | /*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2013 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.plugins.core.issue.ignore.pattern;
import com.google.common.collect.Sets;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.api.issue.Issue;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.utils.WildcardPattern;
import java.util.Set;
public class Pattern {
private WildcardPattern resourcePattern;
private WildcardPattern rulePattern;
private Set<Integer> lines = Sets.newLinkedHashSet();
private Set<LineRange> lineRanges = Sets.newLinkedHashSet();
private String beginBlockRegexp;
private String endBlockRegexp;
private String allFileRegexp;
private boolean checkLines = true;
public Pattern() {
}
public Pattern(String resourcePattern, String rulePattern) {
this.resourcePattern = WildcardPattern.create(resourcePattern);
this.rulePattern = WildcardPattern.create(rulePattern);
}
public Pattern(String resourcePattern, String rulePattern, Set<LineRange> lineRanges) {
this(resourcePattern, rulePattern);
this.lineRanges = lineRanges;
}
public WildcardPattern getResourcePattern() {
return resourcePattern;
}
public WildcardPattern getRulePattern() {
return rulePattern;
}
public String getBeginBlockRegexp() {
return beginBlockRegexp;
}
public String getEndBlockRegexp() {
return endBlockRegexp;
}
public String getAllFileRegexp() {
return allFileRegexp;
}
Pattern addLineRange(int fromLineId, int toLineId) {
lineRanges.add(new LineRange(fromLineId, toLineId));
return this;
}
Pattern addLine(int lineId) {
lines.add(lineId);
return this;
}
boolean isCheckLines() {
return checkLines;
}
Pattern setCheckLines(boolean b) {
this.checkLines = b;
return this;
}
Pattern setBeginBlockRegexp(String beginBlockRegexp) {
this.beginBlockRegexp = beginBlockRegexp;
return this;
}
Pattern setEndBlockRegexp(String endBlockRegexp) {
this.endBlockRegexp = endBlockRegexp;
return this;
}
Pattern setAllFileRegexp(String allFileRegexp) {
this.allFileRegexp = allFileRegexp;
return this;
}
Set<Integer> getAllLines() {
Set<Integer> allLines = Sets.newLinkedHashSet(lines);
for (LineRange lineRange : lineRanges) {
allLines.addAll(lineRange.toLines());
}
return allLines;
}
public boolean match(Issue issue) {
boolean match = matchResource(issue.componentKey())
&& matchRule(issue.ruleKey());
if (checkLines) {
Integer line = issue.line();
if (line == null) {
match = false;
} else {
match = match && matchLine(line);
}
}
return match;
}
boolean matchLine(int lineId) {
if (lines.contains(lineId)) {
return true;
}
for (LineRange range : lineRanges) {
if (range.in(lineId)) {
return true;
}
}
return false;
}
boolean matchRule(RuleKey rule) {
if (rule == null) {
return false;
}
String key = new StringBuilder().append(rule.repository()).append(':').append(rule.rule()).toString();
return rulePattern.match(key);
}
boolean matchResource(String resource) {
return resource != null && resourcePattern.match(resource);
}
public Pattern forResource(String resource) {
return new Pattern(resource, rulePattern.toString(), lineRanges).setCheckLines(isCheckLines());
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8d046218f8b610c50b7815d7996819d98e648872 | dde804bed2655d40ce4cf4fb65701e652415b7d1 | /ebaysdkcore/src/main/java/com/ebay/sdk/attributes/model/AttributeTypes.java | c6afeefe1bb4ce225c6b6ffbf837e3543ae8a086 | [] | no_license | mamthal/getItemJava | ceccf4a8bab67bab5e9e8a37d60af095f847de44 | d7a1bcc8c7a1f72728973c799973e86c435a6047 | refs/heads/master | 2016-09-05T23:39:46.495096 | 2014-04-21T18:19:21 | 2014-04-21T18:19:21 | 19,001,704 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,320 | java | /*
Copyright (c) 2013 eBay, Inc.
This program is licensed under the terms of the eBay Common Development and
Distribution License (CDDL) Version 1.0 (the "License") and any subsequent version
thereof released by eBay. The then-current version of the License can be found
at http://www.opensource.org/licenses/cddl1.php and in the eBaySDKLicense file that
is under the eBay SDK ../docs directory.
*/
package com.ebay.sdk.attributes.model;
/**
* Defines type of attribute.
* <p>Title: AttributesLib for Java</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: eBay Inc.</p>
* @author Weijun Li
* @version 1.0
*/
abstract public class AttributeTypes {
/**
*
*/
public static final int ATTR_ID = 0;
/**
*
*/
public static final int ATTR_IDS = 1;
/**
*
*/
public static final int ATTR_TEXT = 11;
/**
*
*/
public static final int ATTR_TEXT_DATE = 12;
/**
*
*/
public static final int ATTR_TEXT_DATE_ONE = 13;
/**
*
*/
public static final int ATTR_DATE = 100;
/**
*
*/
public static final int ATTR_DATE_D = 101;
/**
*
*/
public static final int ATTR_DATE_M = 102;
/**
*
*/
public static final int ATTR_DATE_Y = 103;
}
| [
"mamtha@mamtha-Dell.(none)"
] | mamtha@mamtha-Dell.(none) |
b9a1406920fc1a1df45d22b108e4238bdb464beb | e7e497b20442a4220296dea1550091a457df5a38 | /java_workplace/renren_web_framework/commons/xiaonei-core-struts/trunk/src/main/java/com/xiaonei/platform/core/opt/base/chain/impl/handler/UserStatusActivateVerifiedHandler.java | eb4db3dfb915ee2b9a5f28d75ccb383562f086e0 | [] | no_license | gunner14/old_rr_code | cf17a2dedf8dfcdcf441d49139adaadc770c0eea | bb047dc88fa7243ded61d840af0f8bad22d68dee | refs/heads/master | 2021-01-17T18:23:28.154228 | 2013-12-02T23:45:33 | 2013-12-02T23:45:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 995 | java | package com.xiaonei.platform.core.opt.base.chain.impl.handler;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import com.xiaonei.platform.core.opt.OpiConstants;
import com.xiaonei.platform.core.opt.base.chain.BizFilterException;
import com.xiaonei.platform.core.opt.base.chain.WebContext;
/**
* 处理异常BizFilterException.CODE_USER_STATUS_ACTIVATE_VERIFIED。
*
*
* @author Li Weibo
* @since 2009-1-3 下午08:51:02
*/
public class UserStatusActivateVerifiedHandler extends ExceptionHandlerBase {
@Override
public int getHandledExceptionCode() {
return BizFilterException.CODE_USER_STATUS_ACTIVATE_VERIFIED;
}
@Override
public void handleIt(BizFilterException e, WebContext context) {
HttpServletResponse response = context.getResponse();
try {
response.sendRedirect(OpiConstants.urlMain + "/Newbie.do");
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
| [
"liyong19861014@gmail.com"
] | liyong19861014@gmail.com |
fdcee0df61d553dc2b2aae94266a6c882c6f2cef | 0ca8bfc45aab4edd504ca866dc6017293b0fb00c | /tfkc_shop/src/com/koala/foundation/domain/query/TemplateQueryObject.java | 6f79ed4cc970dcd140a020a3a55a96828511fe99 | [] | no_license | kkhsl/MetooRespository | 939969c5627aaec0824394450b00d47a9f222e7b | 920373344a6b4e5dafdf69e06bb3418d9492a8c7 | refs/heads/master | 2022-12-23T13:08:02.019395 | 2019-03-29T11:26:51 | 2019-03-29T11:26:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | package com.koala.foundation.domain.query;
import org.springframework.web.servlet.ModelAndView;
import com.koala.core.query.QueryObject;
public class TemplateQueryObject extends QueryObject {
public TemplateQueryObject(String currentPage, ModelAndView mv,
String orderBy, String orderType) {
super(currentPage, mv, orderBy, orderType);
// TODO Auto-generated constructor stub
}
public TemplateQueryObject(String construct, String currentPage,
ModelAndView mv, String orderBy, String orderType) {
super(construct, currentPage, mv, orderBy, orderType);
// TODO Auto-generated constructor stub
}
public TemplateQueryObject() {
super();
// TODO Auto-generated constructor stub
}
}
| [
"460751446@qq.com"
] | 460751446@qq.com |
4ff84be24cf39e555ba73cdd989f39cf0db2d029 | c2d8181a8e634979da48dc934b773788f09ffafb | /storyteller/output/mazdasalestool/SetResultAndProductivityNonNewprofitAction.java | a6c2f47c3c47cd99b151141e50a98b3fffa13f88 | [] | no_license | toukubo/storyteller | ccb8281cdc17b87758e2607252d2d3c877ffe40c | 6128b8d275efbf18fd26d617c8503a6e922c602d | refs/heads/master | 2021-05-03T16:30:14.533638 | 2016-04-20T12:52:46 | 2016-04-20T12:52:46 | 9,352,300 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,737 | java | package net.mazdasalestool.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.mazdasalestool.model.*;
import net.mazdasalestool.model.crud.*;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.Transaction;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.web.context.support.WebApplicationContextUtils;
import net.enclosing.util.HibernateSession;
import net.enclosing.util.HTTPGetRedirection;
public class SetResultAndProductivityNonNewprofitAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res) throws Exception{
Session session = new HibernateSession().currentSession(this
.getServlet().getServletContext());
Transaction transaction = session.beginTransaction();
Criteria criteria = session.createCriteria(ResultAndProductivity.class);
criteria.add(Restrictions.idEq(Integer.valueOf(req.getParameter("id"))));
ResultAndProductivity resultAndProductivity = (ResultAndProductivity) criteria.uniqueResult();
resultAndProductivity.setNewprofit(false);
session.saveOrUpdate(resultAndProductivity);
transaction.commit();
session.flush();
new HTTPGetRedirection(req, res, "ResultAndProductivitys.do", resultAndProductivity.getId().toString());
return null;
}
} | [
"toukubo@gmail.com"
] | toukubo@gmail.com |
d2d3cf7f97566a2500ae71dd524893725f680bcf | b70ff400527013ee60769c557a19a5727f9fb6b4 | /fhir-logical-profile-generator/src/test/java/org/opencimi/transform/translator/fhir/FhirLogicalProfileGeneratorTest.java | bbaa37696607084e4c78b195964062ee3da9aff7 | [
"Apache-2.0"
] | permissive | opencimi/cimi-to-fhir-translator | 12d76063862501bcff985aeef880ce3f89865c68 | 443afcc8692cddf8b216291184c4719dc2d79530 | refs/heads/master | 2021-05-03T18:20:17.234295 | 2017-09-10T18:57:44 | 2017-09-10T18:57:44 | 71,944,256 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,233 | java | /*
* #%L
* OpenCIMI - OpenCIMI CIMI-to-FHIR Translation Utilities
* %%
* Copyright (C) 2016 - 2017 Cognitive Medical Systems
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
* Author: Claude Nanjo
*/
package org.opencimi.transform.translator.fhir;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.validation.FhirValidator;
import ca.uhn.fhir.validation.SingleValidationMessage;
import ca.uhn.fhir.validation.ValidationResult;
import org.hl7.fhir.r4.model.StructureDefinition;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.fail;
/**
* Created by cnanjo on 10/14/16.
*/
public class FhirLogicalProfileGeneratorTest {
private FhirLogicalProfileGenerator generator;
@Before
public void setUp() throws Exception {
generator = new FhirLogicalProfileGenerator("http://opencimi.org/logical-model/fhir");
}
@After
public void tearDown() throws Exception {
}
@Test
public void testLogicalProfileGeneration() {
List<InputStream> sources = new ArrayList<>();
sources.add(FhirLogicalProfileGeneratorTest.class.getResourceAsStream("/bmm/ballot_may_2017/CIMI_RM_CORE.v.0.0.2.bmm"));
sources.add(FhirLogicalProfileGeneratorTest.class.getResourceAsStream("/bmm/ballot_may_2017/CIMI_RM_FOUNDATION.v.0.0.2.bmm"));
sources.add(FhirLogicalProfileGeneratorTest.class.getResourceAsStream("/bmm/ballot_may_2017/CIMI_RM_CLINICAL.v.0.0.2.bmm"));
List<StructureDefinition> logicalProfiles = generator.generateLogicalProfile(sources);
FhirContext ctx = FhirContext.forDstu3();
IParser jsonParser = ctx.newJsonParser();
jsonParser.setPrettyPrint(true);
FhirValidator validator = ctx.newValidator();
for (StructureDefinition logicalProfile : logicalProfiles) {
String structureDefinition = jsonParser.encodeResourceToString(logicalProfile);
System.out.println(logicalProfile.getName()+"=\n" + structureDefinition);
System.out.println("\n");
ValidationResult validationResult = validator.validateWithResult(logicalProfile);
if (!validationResult.isSuccessful()){
System.out.println("The generated resource can't be validated:");
for (SingleValidationMessage message : validationResult.getMessages()) {
System.out.println("\t["+message.getSeverity()+"] "+message.getMessage());
}
fail();
}
}
}
} | [
"cnanjo@gmail.com"
] | cnanjo@gmail.com |
1236b27f6b5aae28b678249e58807dde648a922c | cfd19cdabb61608bdb5e9b872e840305084aec07 | /SmartUniversity/android/app/build/generated/not_namespaced_r_class_sources/debug/r/org/unimodules/interfaces/filesystem/R.java | 361e0930dd198bec102a029fe93291ca31d68ff0 | [] | no_license | Roshmar/React-Native | bab2661e6a419083bdfb2a44af26d40e0b67786c | 177d8e47731f3a0b82ba7802752976df1ceb78aa | refs/heads/main | 2023-06-24T17:33:00.264894 | 2021-07-19T23:01:12 | 2021-07-19T23:01:12 | 387,580,266 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 128 | java | version https://git-lfs.github.com/spec/v1
oid sha256:3721d7ba0c4ce08924fd1277514122748a8b78e9f243054c714086d3012d7c37
size 276
| [
"martin.roshko@student.tuke.sk"
] | martin.roshko@student.tuke.sk |
58266436a994b5febe412057a4190ffcdf438068 | 40d844c1c780cf3618979626282cf59be833907f | /src/testcases/CWE113_HTTP_Response_Splitting/s02/CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_54a.java | 2ed6354f16c1fd59c95132dccbf69f33e391ac6d | [] | no_license | rubengomez97/juliet | f9566de7be198921113658f904b521b6bca4d262 | 13debb7a1cc801977b9371b8cc1a313cd1de3a0e | refs/heads/master | 2023-06-02T00:37:24.532638 | 2021-06-23T17:22:22 | 2021-06-23T17:22:22 | 379,676,259 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,760 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_54a.java
Label Definition File: CWE113_HTTP_Response_Splitting.label.xml
Template File: sources-sinks-54a.tmpl.java
*/
/*
* @description
* CWE: 113 HTTP Response Splitting
* BadSource: Property Read data from a system property
* GoodSource: A hardcoded string
* Sinks: addHeaderServlet
* GoodSink: URLEncode input
* BadSink : querystring to addHeader()
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE113_HTTP_Response_Splitting.s02;
import testcasesupport.*;
import javax.servlet.http.*;
public class CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_54a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* get system property user.home */
/* POTENTIAL FLAW: Read data from a system property */
data = System.getProperty("user.home");
(new CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_54b()).badSink(data , request, response);
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
goodB2G(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
(new CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_54b()).goodG2BSink(data , request, response);
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* get system property user.home */
/* POTENTIAL FLAW: Read data from a system property */
data = System.getProperty("user.home");
(new CWE113_HTTP_Response_Splitting__Property_addHeaderServlet_54b()).goodB2GSink(data , request, response);
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"you@example.com"
] | you@example.com |
67bb427c3cb7a13c2df80227f3743afbaf9c4892 | 37fee66ca994d70c8b70e4138b2e96fbb877d010 | /rainbow-admin/src/main/java/com/rainbow/model/dto/GetDataByKeyDTO.java | 57a60d7adb7f2e0722d848bec048a1dbdc5bde3c | [] | no_license | LYB-organization/LYB-repository | d501330fd0d34bd062abb2057092759384bfd4a9 | 914e9c33ca3a69ceaffaf63d05825f6dbfccc20a | refs/heads/master | 2021-08-22T00:53:57.538400 | 2020-08-30T03:57:28 | 2020-08-30T03:57:28 | 207,777,972 | 2 | 0 | null | 2020-07-05T07:26:39 | 2019-09-11T09:47:59 | Java | UTF-8 | Java | false | false | 395 | java | package com.rainbow.model.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* 根据key获取redis数据
* author dengjie9527
* date 2019/9/23
*/
@Data
@ApiModel
public class GetDataByKeyDTO implements Serializable {
@ApiModelProperty(value = "redisKey")
private String redisKey;
}
| [
"admin@qq.com"
] | admin@qq.com |
e6a78179a0fa31b0a0cd911fa496983c1122a1f9 | 9e20645e45cc51e94c345108b7b8a2dd5d33193e | /L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/clientpackets/RequestPledgeSetMemberPowerGrade.java | 75b33ddcb21e9c97911e933f6d5adabe251e0a55 | [] | no_license | Enryu99/L2jMobius-01-11 | 2da23f1c04dcf6e88b770f6dcbd25a80d9162461 | 4683916852a03573b2fe590842f6cac4cc8177b8 | refs/heads/master | 2023-09-01T22:09:52.702058 | 2021-11-02T17:37:29 | 2021-11-02T17:37:29 | 423,405,362 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,815 | java | /*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.network.clientpackets;
import org.l2jmobius.commons.network.PacketReader;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.clan.ClanPrivilege;
import org.l2jmobius.gameserver.network.GameClient;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* Format: (ch) Sd
* @author -Wooden-
*/
public class RequestPledgeSetMemberPowerGrade implements IClientIncomingPacket
{
private String _member;
private int _powerGrade;
@Override
public boolean read(GameClient client, PacketReader packet)
{
_member = packet.readS();
_powerGrade = packet.readD();
return true;
}
@Override
public void run(GameClient client)
{
final PlayerInstance player = client.getPlayer();
if (player == null)
{
return;
}
final Clan clan = player.getClan();
if (clan == null)
{
return;
}
if (!player.hasClanPrivilege(ClanPrivilege.CL_MANAGE_RANKS))
{
return;
}
final ClanMember member = clan.getClanMember(_member);
if (member == null)
{
return;
}
if (member.getObjectId() == clan.getLeaderId())
{
return;
}
if (member.getPledgeType() == -1) // Academy - Removed.
{
// also checked from client side
player.sendPacket(SystemMessageId.THAT_PRIVILEGE_CANNOT_BE_GRANTED_TO_A_CLAN_ACADEMY_MEMBER);
return;
}
member.setPowerGrade(_powerGrade);
clan.broadcastToOnlineMembers(new PledgeShowMemberListUpdate(member));
clan.broadcastToOnlineMembers(new SystemMessage(SystemMessageId.CLAN_MEMBER_C1_S_PRIVILEGE_LEVEL_HAS_BEEN_CHANGED_TO_S2).addString(member.getName()).addInt(_powerGrade));
// Fixes sometimes not updating when member privileges change.
clan.broadcastClanStatus();
}
}
| [
"MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b"
] | MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b |
791cdc344b40356f296d05536f9ba5810a4fd8a7 | 27f6a988ec638a1db9a59cf271f24bf8f77b9056 | /Code-Hunt-data/users/User005/Sector2-Level2/attempt044-20140920-224238.java | 04af7b08832e742adb1462ff107d0b05a1f1b6a8 | [] | no_license | liiabutler/Refazer | 38eaf72ed876b4cfc5f39153956775f2123eed7f | 991d15e05701a0a8582a41bf4cfb857bf6ef47c3 | refs/heads/master | 2021-07-22T06:44:46.453717 | 2017-10-31T01:43:42 | 2017-10-31T01:43:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 390 | java | public class Program {
public static int Puzzle(String s) {
if (s.indexOf('\0') > 0 || s.charAt(0) != '(' ) return 0;
int x = s.indexOf("()");
int res = 0;
int start = x-1, end = x + 2;
while (start >= 0 && end < s.length()) {
if (s.charAt(start) == '(' && s.charAt(end) == ')') ++res;
--start;
++end;
}
if (res > 0) ++res;
return res;
}
} | [
"liiabiia@yahoo.com"
] | liiabiia@yahoo.com |
3259c9d3e33b39ec038462e09239da34e828c373 | 377e5e05fb9c6c8ed90ad9980565c00605f2542b | /.gitignore/bin/ext-commerce/financialfacades/src/de/hybris/platform/financialfacades/facades/PolicyFacade.java | 1852ca847a09a1d74b5d45082dc90cda29f0d5bf | [] | no_license | automaticinfotech/HybrisProject | c22b13db7863e1e80ccc29774f43e5c32e41e519 | fc12e2890c569e45b97974d2f20a8cbe92b6d97f | refs/heads/master | 2021-07-20T18:41:04.727081 | 2017-10-30T13:24:11 | 2017-10-30T13:24:11 | 108,957,448 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 466 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with SAP Hybris.
*
*/
package de.hybris.platform.financialfacades.facades;
public interface PolicyFacade
{
}
| [
"santosh.kshirsagar@automaticinfotech.com"
] | santosh.kshirsagar@automaticinfotech.com |
ab02745ceece6532d025b1b0518ce1262593586d | 09c12d179be0ddd27311820dcbc5dc0190b0e1b2 | /jonix-onix2/src/main/java/com/tectonica/jonix/onix2/ImageResolution.java | 4c63360f08f596ce98791282bc51a6f86a4b3788 | [
"Apache-2.0"
] | permissive | zach-m/jonix | 3a2053309d8df96f406b0eca93de6b25b4aa3e98 | c7586ed7669ced7f26e937d98b4b437513ec1ea9 | refs/heads/master | 2023-08-23T19:42:15.570453 | 2023-07-31T19:02:35 | 2023-07-31T19:02:35 | 32,450,400 | 67 | 23 | Apache-2.0 | 2023-06-01T03:43:12 | 2015-03-18T09:47:36 | Java | UTF-8 | Java | false | false | 5,248 | java | /*
* Copyright (C) 2012-2023 Zach Melamed
*
* Latest version available online at https://github.com/zach-m/jonix
* Contact me at zach@tectonica.co.il
*
* 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.tectonica.jonix.onix2;
import com.tectonica.jonix.common.JPU;
import com.tectonica.jonix.common.OnixElement;
import com.tectonica.jonix.common.codelist.Languages;
import com.tectonica.jonix.common.codelist.RecordSourceTypes;
import com.tectonica.jonix.common.codelist.TextCaseFlags;
import com.tectonica.jonix.common.codelist.TextFormats;
import com.tectonica.jonix.common.codelist.TransliterationSchemes;
import java.io.Serializable;
import java.util.function.Consumer;
/*
* NOTE: THIS IS AN AUTO-GENERATED FILE, DO NOT EDIT MANUALLY
*/
/**
* <h1>Image resolution</h1>
* <p>
* The resolution of an image file which is linked by the <MediaFileLink> element, expressed as dots or pixels per
* inch. Optional and non-repeating.
* </p>
* <table border='1' cellpadding='3'>
* <tr>
* <td>Format</td>
* <td>Variable-length integer, suggested maximum length 6 digits</td>
* </tr>
* <tr>
* <td>Reference name</td>
* <td><tt><ImageResolution></tt></td>
* </tr>
* <tr>
* <td>Short tag</td>
* <td><tt><f259></tt></td>
* </tr>
* <tr>
* <td>Example</td>
* <td><tt><ImageResolution>600</ImageResolution></tt></td>
* </tr>
* </table>
* <p/>
* This tag may be included in the following composites:
* <ul>
* <li><{@link MediaFile}></li>
* </ul>
* <p/>
* Possible placements within ONIX message:
* <ul>
* <li>{@link Product} ⯈ {@link MediaFile} ⯈ {@link ImageResolution}</li>
* <li>{@link Product} ⯈ {@link ContentItem} ⯈ {@link MediaFile} ⯈ {@link ImageResolution}</li>
* <li>{@link Product} ⯈ {@link SupplyDetail} ⯈ {@link Reissue} ⯈ {@link MediaFile} ⯈ {@link ImageResolution}</li>
* </ul>
*/
public class ImageResolution implements OnixElement<String>, Serializable {
private static final long serialVersionUID = 1L;
public static final String refname = "ImageResolution";
public static final String shortname = "f259";
/////////////////////////////////////////////////////////////////////////////////
// ATTRIBUTES
/////////////////////////////////////////////////////////////////////////////////
public TextFormats textformat;
public TextCaseFlags textcase;
public Languages language;
public TransliterationSchemes transliteration;
/**
* (type: DateOrDateTime)
*/
public String datestamp;
public RecordSourceTypes sourcetype;
public String sourcename;
/////////////////////////////////////////////////////////////////////////////////
// VALUE MEMBER
/////////////////////////////////////////////////////////////////////////////////
/**
* This is the raw content of ImageResolution. Could be null if {@code exists() == false}. Use {@link #value()}
* instead if you want to get this as an {@link java.util.Optional}.
* <p>
* Raw Format: Variable-length integer, suggested maximum length 6 digits
* <p>
* (type: NonEmptyString)
*/
public String value;
/**
* Internal API, use the {@link #value()} method or the {@link #value} field instead
*/
@Override
public String __v() {
return value;
}
/////////////////////////////////////////////////////////////////////////////////
// SERVICES
/////////////////////////////////////////////////////////////////////////////////
private final boolean exists;
public static final ImageResolution EMPTY = new ImageResolution();
public ImageResolution() {
exists = false;
}
public ImageResolution(org.w3c.dom.Element element) {
exists = true;
textformat = TextFormats.byCode(JPU.getAttribute(element, "textformat"));
textcase = TextCaseFlags.byCode(JPU.getAttribute(element, "textcase"));
language = Languages.byCode(JPU.getAttribute(element, "language"));
transliteration = TransliterationSchemes.byCode(JPU.getAttribute(element, "transliteration"));
datestamp = JPU.getAttribute(element, "datestamp");
sourcetype = RecordSourceTypes.byCode(JPU.getAttribute(element, "sourcetype"));
sourcename = JPU.getAttribute(element, "sourcename");
value = JPU.getContentAsString(element);
}
/**
* @return whether this tag (<ImageResolution> or <f259>) is explicitly provided in the ONIX XML
*/
@Override
public boolean exists() {
return exists;
}
public void ifExists(Consumer<ImageResolution> action) {
if (exists) {
action.accept(this);
}
}
}
| [
"zach@tectonica.co.il"
] | zach@tectonica.co.il |
72c6bc19baf9fdf43b47222ce818e4cc2f573128 | fb41c04a4ead3b79625d0eb30ca85f0fd1c2d4c9 | /demonstrations/src/main/java/boofcv/demonstrations/sfm/d2/FeatureTrackerTypes.java | aceed51ff69ba856caf8fc6f7cd435bf36c4ffd2 | [
"Apache-2.0",
"LicenseRef-scancode-takuya-ooura"
] | permissive | thhart/BoofCV | 899dcf1b4302bb9464520c36a9e54c6fe35969c7 | 43f25488673dc27590544330323c676f61c1a17a | refs/heads/SNAPSHOT | 2023-08-18T10:19:50.269999 | 2023-07-15T23:13:25 | 2023-07-15T23:13:25 | 90,468,259 | 0 | 0 | Apache-2.0 | 2018-10-26T08:47:44 | 2017-05-06T14:24:01 | Java | UTF-8 | Java | false | false | 1,375 | java | /*
* Copyright (c) 2020, 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.demonstrations.sfm.d2;
import java.util.ArrayList;
import java.util.List;
/**
* Different types features and descriptions used in a tracker
*
* @author Peter Abeles
*/
public enum FeatureTrackerTypes {
KLT("KLT"),ST_BRIEF("ST-BRIEF"),FH_SURF("FH-SURF"),ST_SURF_KLT("ST-SURF-KLT");
FeatureTrackerTypes( String name ) {
this.name = name;
}
public String getTrackerName() {
return name;
}
private final String name;
public static List<String> getTrackerNames() {
List<String> output = new ArrayList<>();
FeatureTrackerTypes[] types = values();
for (int i = 0; i < types.length; i++) {
output.add( types[i].getTrackerName() );
}
return output;
}
}
| [
"peter.abeles@gmail.com"
] | peter.abeles@gmail.com |
e23c2d979425c0959ae25087b42ed14744901870 | b5f5c802cc7ef69113fc480a4fc4b109e86cf1d6 | /spring-restdocs-core/src/test/java/org/springframework/restdocs/payload/JsonFieldTypesDiscovererTests.java | 5b39092dec84500aaf610dbd0109614417784aa4 | [
"Apache-2.0"
] | permissive | wilkinsona/spring-restdocs | a5180d3c7149ee57a8918073a303934732cc0c2b | d3a1c0b792433635d034d803f7879a6324b1b1df | refs/heads/master | 2022-01-25T15:34:58.481889 | 2020-09-14T10:33:32 | 2020-09-14T10:33:32 | 24,940,450 | 50 | 9 | null | null | null | null | UTF-8 | Java | false | false | 6,784 | java | /*
* Copyright 2014-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.restdocs.payload;
import java.io.IOException;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link JsonFieldTypesDiscoverer}.
*
* @author Andy Wilkinson
*/
public class JsonFieldTypesDiscovererTests {
private final JsonFieldTypesDiscoverer fieldTypeDiscoverer = new JsonFieldTypesDiscoverer();
@Rule
public ExpectedException thrownException = ExpectedException.none();
@Test
public void arrayField() throws IOException {
assertThat(discoverFieldTypes("[]")).containsExactly(JsonFieldType.ARRAY);
}
@Test
public void topLevelArray() throws IOException {
assertThat(discoverFieldTypes("[]", "[{\"a\":\"alpha\"}]")).containsExactly(JsonFieldType.ARRAY);
}
@Test
public void nestedArray() throws IOException {
assertThat(discoverFieldTypes("a[]", "{\"a\": [{\"b\":\"bravo\"}]}")).containsExactly(JsonFieldType.ARRAY);
}
@Test
public void arrayNestedBeneathAnArray() throws IOException {
assertThat(discoverFieldTypes("a[].b[]", "{\"a\": [{\"b\": [ 1, 2 ]}]}")).containsExactly(JsonFieldType.ARRAY);
}
@Test
public void specificFieldOfObjectInArrayNestedBeneathAnArray() throws IOException {
assertThat(discoverFieldTypes("a[].b[].c", "{\"a\": [{\"b\": [ {\"c\": 5}, {\"c\": 5}]}]}"))
.containsExactly(JsonFieldType.NUMBER);
}
@Test
public void booleanField() throws IOException {
assertThat(discoverFieldTypes("true")).containsExactly(JsonFieldType.BOOLEAN);
}
@Test
public void objectField() throws IOException {
assertThat(discoverFieldTypes("{}")).containsExactly(JsonFieldType.OBJECT);
}
@Test
public void nullField() throws IOException {
assertThat(discoverFieldTypes("null")).containsExactly(JsonFieldType.NULL);
}
@Test
public void numberField() throws IOException {
assertThat(discoverFieldTypes("1.2345")).containsExactly(JsonFieldType.NUMBER);
}
@Test
public void stringField() throws IOException {
assertThat(discoverFieldTypes("\"Foo\"")).containsExactly(JsonFieldType.STRING);
}
@Test
public void nestedField() throws IOException {
assertThat(discoverFieldTypes("a.b.c", "{\"a\":{\"b\":{\"c\":{}}}}")).containsExactly(JsonFieldType.OBJECT);
}
@Test
public void multipleFieldsWithSameType() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{\"id\":1},{\"id\":2}]}"))
.containsExactly(JsonFieldType.NUMBER);
}
@Test
public void multipleFieldsWithDifferentTypes() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{\"id\":1},{\"id\":true}]}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER, JsonFieldType.BOOLEAN);
}
@Test
public void multipleFieldsWithDifferentTypesAndSometimesAbsent() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{\"id\":1},{\"id\":true}, {}]}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER, JsonFieldType.BOOLEAN, JsonFieldType.NULL);
}
@Test
public void multipleFieldsWhenSometimesAbsent() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{\"id\":1},{\"id\":2}, {}]}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER, JsonFieldType.NULL);
}
@Test
public void multipleFieldsWhenSometimesNull() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{\"id\":1},{\"id\":2}, {\"id\":null}]}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER, JsonFieldType.NULL);
}
@Test
public void multipleFieldsWithDifferentTypesAndSometimesNull() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{\"id\":1},{\"id\":true}, {\"id\":null}]}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER, JsonFieldType.BOOLEAN, JsonFieldType.NULL);
}
@Test
public void multipleFieldsWhenEitherNullOrAbsent() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{},{\"id\":null}]}"))
.containsExactlyInAnyOrder(JsonFieldType.NULL);
}
@Test
public void multipleFieldsThatAreAllNull() throws IOException {
assertThat(discoverFieldTypes("a[].id", "{\"a\":[{\"id\":null},{\"id\":null}]}"))
.containsExactlyInAnyOrder(JsonFieldType.NULL);
}
@Test
public void nonExistentSingleFieldProducesFieldDoesNotExistException() throws IOException {
this.thrownException.expect(FieldDoesNotExistException.class);
this.thrownException.expectMessage("The payload does not contain a field with the path 'a.b'");
discoverFieldTypes("a.b", "{\"a\":{}}");
}
@Test
public void nonExistentMultipleFieldsProducesFieldDoesNotExistException() throws IOException {
this.thrownException.expect(FieldDoesNotExistException.class);
this.thrownException.expectMessage("The payload does not contain a field with the path 'a[].b'");
discoverFieldTypes("a[].b", "{\"a\":[{\"c\":1},{\"c\":2}]}");
}
@Test
public void leafWildcardWithCommonType() throws IOException {
assertThat(discoverFieldTypes("a.*", "{\"a\": {\"b\": 5, \"c\": 6}}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER);
}
@Test
public void leafWildcardWithVaryingType() throws IOException {
assertThat(discoverFieldTypes("a.*", "{\"a\": {\"b\": 5, \"c\": \"six\"}}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER, JsonFieldType.STRING);
}
@Test
public void intermediateWildcardWithCommonType() throws IOException {
assertThat(discoverFieldTypes("a.*.d", "{\"a\": {\"b\": {\"d\": 4}, \"c\": {\"d\": 5}}}}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER);
}
@Test
public void intermediateWildcardWithVaryingType() throws IOException {
assertThat(discoverFieldTypes("a.*.d", "{\"a\": {\"b\": {\"d\": 4}, \"c\": {\"d\": \"four\"}}}}"))
.containsExactlyInAnyOrder(JsonFieldType.NUMBER, JsonFieldType.STRING);
}
private JsonFieldTypes discoverFieldTypes(String value) throws IOException {
return discoverFieldTypes("field", "{\"field\":" + value + "}");
}
private JsonFieldTypes discoverFieldTypes(String path, String json) throws IOException {
return this.fieldTypeDiscoverer.discoverFieldTypes(path, new ObjectMapper().readValue(json, Object.class));
}
}
| [
"awilkinson@pivotal.io"
] | awilkinson@pivotal.io |
2b8d712843eeb254b68660dc9617c700cebe0cc4 | bb9140f335d6dc44be5b7b848c4fe808b9189ba4 | /Extra-DS/Corpus/class/aspectj/285.java | d0684521fc4a949df40aac9032ff8542995bf348 | [] | no_license | masud-technope/EMSE-2019-Replication-Package | 4fc04b7cf1068093f1ccf064f9547634e6357893 | 202188873a350be51c4cdf3f43511caaeb778b1e | refs/heads/master | 2023-01-12T21:32:46.279915 | 2022-12-30T03:22:15 | 2022-12-30T03:22:15 | 186,221,579 | 5 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,842 | java | package coordination;
import java.lang.String;
class Mutex implements Exclusion {
String[] methodNames;
MethodState[] methodStates;
String prettyName;
Mutex(String[] _methodNames) {
methodNames = _methodNames;
methodStates = new MethodState[methodNames.length];
for (int i = 0; i < methodNames.length; i++) {
methodStates[i] = new MethodState();
}
}
private boolean isMethodIn(String _methodName) {
for (int i = 0; i < methodNames.length; i++) {
if (_methodName.equals(methodNames[i]))
return (true);
}
return (false);
}
private MethodState getMethodState(String _methodName) {
for (int i = 0; i < methodNames.length; i++) {
if (_methodName.equals(methodNames[i]))
return (methodStates[i]);
}
return (null);
}
public boolean testExclusion(String _methodName) {
Thread ct = Thread.currentThread();
//
for (int i = 0; i < methodNames.length; i++) {
if (!_methodName.equals(methodNames[i])) {
if (methodStates[i].hasOtherThreadThan(ct))
return (false);
}
}
return (true);
}
public void enterExclusion(String _methodName) {
MethodState methodState = getMethodState(_methodName);
methodState.enterInThread(Thread.currentThread());
}
public void exitExclusion(String _methodName) {
MethodState methodState = getMethodState(_methodName);
methodState.exitInThread(Thread.currentThread());
}
public void printNames() {
System.out.print("Mutex names: ");
for (int i = 0; i < methodNames.length; i++) System.out.print(methodNames[i] + " ");
System.out.println();
}
}
| [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
a77488a918c3a76789a4c270e8a719e8ca02bbe0 | b9817829d83df2376c2091863809e1a3361bd49f | /December2020Batch/src/com/hdfc/loans/personallaons/TwoDimensionArray2.java | 0330f1a924919100e7c0a2edec77bf07da9c3b31 | [] | no_license | pandudamera/Dec2020_Selenium_Batch | 7ac8aa7ac8926b2f080a88585a11a48cedd141d9 | 4ab3297105ff6d35febbaedebbae8e4836b3d999 | refs/heads/master | 2023-03-31T18:32:23.875661 | 2021-04-09T05:19:22 | 2021-04-09T05:19:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 531 | java | package com.hdfc.loans.personallaons;
public class TwoDimensionArray2
{
public static void main(String[] args)
{
int p[][] = new int[3][3];
p[0][0]=10;
p[0][1]=20;
p[0][2]=30;
p[1][0]=40;
p[1][1]=50;
p[1][2]=60;
p[2][0]=70;
p[2][1]=80;
p[2][2]=90;
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
System.out.print(p[i][j] + " ");
}
System.out.println();
}
for(int k[]:p)
{
for(int l:k)
{
System.out.print(l +" ");
}
System.out.println();
}
}
}
| [
"maha@gmail.com"
] | maha@gmail.com |
4e705e551b3433a62f175077ff4e27cb8fd2407f | a9a16c8aff5943bc41759bcb1a14886c21916747 | /tools/src/main/java/org/vertexium/tools/GraphRestore.java | f34c5f51b4b8cbcf6d1e8722a29ee9a477d59455 | [
"Apache-2.0"
] | permissive | amccurry/vertexium | 322104e657ab4866fa4ea21575de2a3dc5305b45 | d8338c420f8e6cf7f6e1d5577803df977a830aaf | refs/heads/master | 2020-12-31T03:41:07.063489 | 2015-04-22T13:04:33 | 2015-04-22T13:04:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,162 | java | package org.vertexium.tools;
import com.beust.jcommander.Parameter;
import org.apache.commons.codec.binary.Base64;
import org.json.JSONArray;
import org.json.JSONObject;
import org.vertexium.*;
import org.vertexium.property.StreamingPropertyValue;
import org.vertexium.util.JavaSerializableUtils;
import org.vertexium.*;
import java.io.*;
public class GraphRestore extends GraphToolBase {
@Parameter(names = {"--in", "-i"}, description = "Input filename")
private String inputFileName = null;
public static void main(String[] args) throws Exception {
GraphRestore graphRestore = new GraphRestore();
graphRestore.run(args);
}
protected void run(String[] args) throws Exception {
super.run(args);
InputStream in = createInputStream();
try {
restore(getGraph(), in, getAuthorizations());
} finally {
in.close();
}
}
private InputStream createInputStream() throws FileNotFoundException {
if (inputFileName == null) {
return System.in;
}
return new FileInputStream(inputFileName);
}
public void restore(Graph graph, InputStream in, Authorizations authorizations) throws IOException {
String line;
char lastType = 'V';
Element element = null;
// We can't use a BufferedReader here because when we need to read the streaming property values we need raw bytes not converted bytes
while ((line = readLine(in)) != null) {
try {
char type = line.charAt(0);
JSONObject json = new JSONObject(line.substring(1));
switch (type) {
case 'V':
element = restoreVertex(graph, json, authorizations);
break;
case 'E':
// flush when we make the transition to edges so that we have vertices to lookup and link to.
if (type != lastType) {
graph.flush();
}
element = restoreEdge(graph, json, authorizations);
break;
case 'D':
restoreStreamingPropertyValue(in, graph, json, element, authorizations);
break;
default:
throw new RuntimeException("Unexpected line: " + line);
}
lastType = type;
} catch (Exception ex) {
throw new IOException("Invalid line", ex);
}
}
}
private String readLine(InputStream in) throws IOException {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
while (true) {
int b = in.read();
if (b < 0) {
if (buffer.size() == 0) {
return null;
}
break;
}
if (b == '\n') {
break;
}
buffer.write(b);
}
return new String(buffer.toByteArray());
}
private Vertex restoreVertex(Graph graph, JSONObject json, Authorizations authorizations) {
Visibility visibility = jsonToVisibility(json);
String vertexId = json.getString("id");
VertexBuilder v = graph.prepareVertex(vertexId, visibility);
jsonToProperties(json, v);
return v.save(authorizations);
}
private Edge restoreEdge(Graph graph, JSONObject json, Authorizations authorizations) {
Visibility visibility = jsonToVisibility(json);
String edgeId = json.getString("id");
String outVertexId = json.getString("outVertexId");
String inVertexId = json.getString("inVertexId");
String label = json.getString("label");
Vertex outVertex = graph.getVertex(outVertexId, authorizations);
Vertex inVertex = graph.getVertex(inVertexId, authorizations);
EdgeBuilder e = graph.prepareEdge(edgeId, outVertex, inVertex, label, visibility);
jsonToProperties(json, e);
return e.save(authorizations);
}
protected Visibility jsonToVisibility(JSONObject jsonObject) {
return new Visibility(jsonObject.getString("visibility"));
}
protected void jsonToProperties(JSONObject jsonObject, ElementBuilder e) {
JSONArray propertiesJson = jsonObject.getJSONArray("properties");
for (int i = 0; i < propertiesJson.length(); i++) {
JSONObject propertyJson = propertiesJson.getJSONObject(i);
jsonToProperty(propertyJson, e);
}
}
private void jsonToProperty(JSONObject propertyJson, ElementBuilder e) {
String key = propertyJson.getString("key");
String name = propertyJson.getString("name");
Object value = jsonStringToObject(propertyJson.getString("value"));
Metadata metadata = jsonToPropertyMetadata(propertyJson.optJSONObject("metadata"));
Visibility visibility = new Visibility(propertyJson.getString("visibility"));
e.addPropertyValue(key, name, value, metadata, visibility);
}
private void restoreStreamingPropertyValue(InputStream in, Graph graph, JSONObject propertyJson, Element element, Authorizations authorizations) throws ClassNotFoundException, IOException {
String key = propertyJson.getString("key");
String name = propertyJson.getString("name");
Metadata metadata = jsonToPropertyMetadata(propertyJson.optJSONObject("metadata"));
Visibility visibility = new Visibility(propertyJson.getString("visibility"));
Class valueType = Class.forName(propertyJson.getString("valueType"));
InputStream spvin = new StreamingPropertyValueInputStream(in);
StreamingPropertyValue value = new StreamingPropertyValue(spvin, valueType);
value.searchIndex(propertyJson.optBoolean("searchIndex", false));
value.store(propertyJson.optBoolean("store", true));
element.addPropertyValue(key, name, value, metadata, visibility, authorizations);
}
private Metadata jsonToPropertyMetadata(JSONObject metadataJson) {
Metadata metadata = new Metadata();
if (metadataJson == null) {
return metadata;
}
for (Object key : metadataJson.keySet()) {
String keyString = (String) key;
JSONObject metadataItemJson = metadataJson.getJSONObject(keyString);
Object val = jsonStringToObject(metadataItemJson.getString("value"));
Visibility visibility = new Visibility(metadataItemJson.getString("visibility"));
metadata.add(keyString, val, visibility);
}
return metadata;
}
private Object jsonStringToObject(String str) {
if (str.startsWith(GraphBackup.BASE64_PREFIX)) {
str = str.substring(GraphBackup.BASE64_PREFIX.length());
return JavaSerializableUtils.bytesToObject(Base64.decodeBase64(str));
} else {
return str;
}
}
private class StreamingPropertyValueInputStream extends InputStream {
private final InputStream in;
private int segmentLength;
private boolean done;
public StreamingPropertyValueInputStream(InputStream in) throws IOException {
this.in = in;
readSegmentLengthLine();
}
private void readSegmentLengthLine() throws IOException {
String line = readLine(this.in);
this.segmentLength = Integer.parseInt(line);
if (this.segmentLength == 0) {
this.done = true;
}
}
@Override
public int read() throws IOException {
if (this.done) {
return -1;
}
if (this.segmentLength == 0) {
this.in.read(); // throw away new line character
readSegmentLengthLine();
if (this.done) {
return -1;
}
}
int ret = this.in.read();
this.segmentLength--;
return ret;
}
}
}
| [
"joe@fernsroth.com"
] | joe@fernsroth.com |
e7e4aea9c3cf67b26f04d0aec698495aeabdae0d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_dbf11471215a14dace5f32694b580560b954151c/DbTable/9_dbf11471215a14dace5f32694b580560b954151c_DbTable_t.java | 1c93343dc89921ef31f21e61ce5074f3d6d0bf63 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,042 | java | package dbfit.api;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Map;
import dbfit.util.DbParameterAccessor;
import dbfit.util.NameNormaliser;
public class DbTable implements DbObject {
private DBEnvironment dbEnvironment;
private String tableOrViewName;
private Map<String, DbParameterAccessor> allParams;
public DbTable(DBEnvironment dbEnvironment, String tableName)
throws SQLException {
this.dbEnvironment = dbEnvironment;
this.tableOrViewName = tableName;
allParams = dbEnvironment.getAllColumns(tableName);
if (allParams.isEmpty()) {
throw new SQLException("Cannot retrieve list of columns for "
+ tableName + " - check spelling and access rights");
}
}
public PreparedStatement buildPreparedStatement(
DbParameterAccessor[] accessors) throws SQLException {
PreparedStatement statement = dbEnvironment
.buildInsertPreparedStatement(tableOrViewName, accessors);
for (int i = 0; i < accessors.length; i++) {
accessors[i].bindTo(statement, i + 1);
}
return statement;
}
public DbParameterAccessor getDbParameterAccessor(String paramName,
int expectedDirection) {
String normalisedName = NameNormaliser.normaliseName(paramName);
DbParameterAccessor accessor = allParams.get(normalisedName);
if (null == accessor) {
throw new RuntimeException(
"No such database column or parameter: '" + normalisedName + "'");
}
if (accessor.getDirection() == DbParameterAccessor.INPUT
&& expectedDirection == DbParameterAccessor.OUTPUT) {
accessor = dbEnvironment
.createAutogeneratedPrimaryKeyAccessor(accessor);
}
return accessor;
}
public DBEnvironment getDbEnvironment() {
return dbEnvironment;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
ff1815f8e9be7f804d63d471a74a2a7ec70a5aae | 694d574b989e75282326153d51bd85cb8b83fb9f | /google-ads/src/main/java/com/google/ads/googleads/v1/enums/HotelsPlaceholderFieldProto.java | cdc71d7fc6fc554287297d02851552265271d7ef | [
"Apache-2.0"
] | permissive | tikivn/google-ads-java | 99201ef20efd52f884d651755eb5a3634e951e9b | 1456d890e5c6efc5fad6bd276b4a3cd877175418 | refs/heads/master | 2023-08-03T13:02:40.730269 | 2020-07-17T16:33:40 | 2020-07-17T16:33:40 | 280,845,720 | 0 | 0 | Apache-2.0 | 2023-07-23T23:39:26 | 2020-07-19T10:51:35 | null | UTF-8 | Java | false | true | 3,834 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/ads/googleads/v1/enums/hotel_placeholder_field.proto
package com.google.ads.googleads.v1.enums;
public final class HotelsPlaceholderFieldProto {
private HotelsPlaceholderFieldProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_google_ads_googleads_v1_enums_HotelPlaceholderFieldEnum_descriptor;
static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_google_ads_googleads_v1_enums_HotelPlaceholderFieldEnum_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n;google/ads/googleads/v1/enums/hotel_pl" +
"aceholder_field.proto\022\035google.ads.google" +
"ads.v1.enums\032\034google/api/annotations.pro" +
"to\"\315\003\n\031HotelPlaceholderFieldEnum\"\257\003\n\025Hot" +
"elPlaceholderField\022\017\n\013UNSPECIFIED\020\000\022\013\n\007U" +
"NKNOWN\020\001\022\017\n\013PROPERTY_ID\020\002\022\021\n\rPROPERTY_NA" +
"ME\020\003\022\024\n\020DESTINATION_NAME\020\004\022\017\n\013DESCRIPTIO" +
"N\020\005\022\013\n\007ADDRESS\020\006\022\t\n\005PRICE\020\007\022\023\n\017FORMATTED" +
"_PRICE\020\010\022\016\n\nSALE_PRICE\020\t\022\030\n\024FORMATTED_SA" +
"LE_PRICE\020\n\022\r\n\tIMAGE_URL\020\013\022\014\n\010CATEGORY\020\014\022" +
"\017\n\013STAR_RATING\020\r\022\027\n\023CONTEXTUAL_KEYWORDS\020" +
"\016\022\016\n\nFINAL_URLS\020\017\022\025\n\021FINAL_MOBILE_URLS\020\020" +
"\022\020\n\014TRACKING_URL\020\021\022\024\n\020ANDROID_APP_LINK\020\022" +
"\022\030\n\024SIMILAR_PROPERTY_IDS\020\023\022\020\n\014IOS_APP_LI" +
"NK\020\024\022\024\n\020IOS_APP_STORE_ID\020\025B\360\001\n!com.googl" +
"e.ads.googleads.v1.enumsB\033HotelsPlacehol" +
"derFieldProtoP\001ZBgoogle.golang.org/genpr" +
"oto/googleapis/ads/googleads/v1/enums;en" +
"ums\242\002\003GAA\252\002\035Google.Ads.GoogleAds.V1.Enum" +
"s\312\002\035Google\\Ads\\GoogleAds\\V1\\Enums\352\002!Goog" +
"le::Ads::GoogleAds::V1::Enumsb\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
com.google.api.AnnotationsProto.getDescriptor(),
}, assigner);
internal_static_google_ads_googleads_v1_enums_HotelPlaceholderFieldEnum_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_google_ads_googleads_v1_enums_HotelPlaceholderFieldEnum_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_google_ads_googleads_v1_enums_HotelPlaceholderFieldEnum_descriptor,
new java.lang.String[] { });
com.google.api.AnnotationsProto.getDescriptor();
}
// @@protoc_insertion_point(outer_class_scope)
}
| [
"nwbirnie@gmail.com"
] | nwbirnie@gmail.com |
fc3fc40be4c14162b651133145aaeef16c4b7225 | 3f6f1c09e18b79285ffa7d29be1a02d4dfc8c9ba | /topic17/src/com/courses/spalah/RouletteTable.java | 940377378e2808affd1d81b9830fcfa89320087c | [] | no_license | DenisGladkiy/courses | 9dcced4001f27002d52bebad3983da24475e3224 | e9537819c3163ea34e814ebe59e42dfccff5a256 | refs/heads/master | 2021-01-18T18:30:05.952271 | 2016-05-29T20:08:37 | 2016-05-29T20:08:37 | 51,546,908 | 0 | 0 | null | 2016-02-11T21:04:05 | 2016-02-11T21:04:05 | null | UTF-8 | Java | false | false | 3,578 | java | package com.courses.spalah;
import com.courses.spalah.Bets.Bet;
import com.courses.spalah.memento.TableMemento;
import com.courses.spalah.myExceptions.IncorrectInputException;
import com.courses.spalah.myExceptions.TableIsFullException;
import java.util.*;
/**
* Created by Denis on 24.02.2016.
*/
public class RouletteTable {
private Map<String, Integer> players = new HashMap<>();
private List<Bet> bets = new ArrayList<>();
private String name;
private int value;
public Map<String, Integer> getPlayers() {
return players;
}
public void addBet(Bet bet) {
if (bets.size() == 0) {
checkBalance(bet);
} else {
for (Bet b : bets) {
if (b.getPlayerName().equalsIgnoreCase(bet.getPlayerName())) {
System.out.println("BET NOT ACCEPTED" + "\n");
return;
}
}
checkBalance(bet);
}
}
public void addPlayer(String[] input) throws TableIsFullException, IncorrectInputException {
if (players.size() < 5) {
if (!players.containsKey(input[1])) {
int balance;
try {
balance = Integer.valueOf(input[2]);
} catch (NumberFormatException e) {
throw new IncorrectInputException(Arrays.toString(input));
}
players.put(input[1], balance);
System.out.println("New user with name = " + input[1] + " and balance = " + balance +
" is added to table" + "\n");
} else {
System.out.println("Player " + input[1] + " already at the table");
}
} else {
throw new TableIsFullException("No free place at the table");
}
}
private void checkBalance(Bet b) {
if (players.containsKey(b.getPlayerName()) && players.get(b.getPlayerName()) >= b.getValue()) {
bets.add(b);
Casino.addBetStatistics(b);
System.out.println("BET ACCEPTED" + "\n");
} else {
System.out.println("BET NOT ACCEPTED" + "\n");
}
}
public void calculateGame(RouletteNumber number) {
Casino.addNumberStatistics(number);
for (Bet bet : bets) {
name = bet.getPlayerName();
value = bet.getValue();
int multiplier = bet.getMultiplier();
int balance = players.get(name);
if (bet.isWon(number)) {
players.put(name, (balance + (value * multiplier)));
Casino.addToCasinoBalance(-value);
System.out.println("Player " + name + " +" + value);
} else {
players.put(name, (balance - value));
Casino.addToCasinoBalance(value);
System.out.println("Player " + name + " -" + value);
if (players.get(name) == 0) {
players.remove(name);
System.out.println(name + " quit the game with 0 balance");
}
}
}
bets.clear();
}
public void loadState(TableMemento memento) {
players = memento.getPlayers();
bets = memento.getBets();
}
public TableMemento saveState() {
Map<String, Integer> savedPlayers = new HashMap<>(players);
List<Bet> savedBets = new ArrayList<>();
for (Bet bet : bets) {
savedBets.add(bet);
}
return new TableMemento(savedPlayers, savedBets);
}
}
| [
"gladkiy@gmail.com"
] | gladkiy@gmail.com |
e963b831c91a8a3e0f9b9bf46be71301fc08a2f6 | 5f484ab0a63fc83902df64532dcf23617a2c94b7 | /src/main/java/net/dataforte/commons/collections/Memoizer.java | 9c9bdb6b3d6e5eab7a893ce8b3f8c0333c94e0f0 | [] | no_license | tristantarrant/dataforte-commons | 23381cc96da2fd4f2e6157e17beec21f0893fdc8 | 6f8abc464acd30b643745d7472ec3c7d813a2423 | refs/heads/master | 2020-12-25T17:36:54.645015 | 2012-03-29T09:31:48 | 2012-03-29T09:31:48 | 897,033 | 0 | 4 | null | 2016-08-25T21:28:28 | 2010-09-08T20:00:24 | Java | UTF-8 | Java | false | false | 1,583 | java | package net.dataforte.commons.collections;
import java.util.concurrent.Callable;
import java.util.concurrent.CancellationException;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
public class Memoizer<K, V> implements Computable<K, V> {
private final ConcurrentMap<K, Future<V>> cache = new ConcurrentHashMap<K, Future<V>>();
private final Computable<K, V> computable;
public Memoizer(final Computable<K, V> computable) {
this.computable = computable;
}
public V compute(final K argument) throws ExecutionException, InterruptedException {
while (true) {
Future<V> future = cache.get(argument);
if (future == null) {
final Callable<V> callable = new Callable<V>() {
public V call() throws ExecutionException, InterruptedException {
return computable.compute(argument);
}
};
final FutureTask<V> futureTask = new FutureTask<V>(callable);
future = cache.putIfAbsent(argument, futureTask);
if (future == null) {
future = futureTask;
futureTask.run();
}
}
try {
return future.get();
} catch (final CancellationException e) {
cache.remove(argument, future);
}
}
}
} | [
"tristan.tarrant@gmail.com"
] | tristan.tarrant@gmail.com |
06e65f8eb4049303f3d8377f34e80fb944c13df4 | 071a9fa7cfee0d1bf784f6591cd8d07c6b2a2495 | /corpus/class/sling/2747.java | fc2e79907d653b95bf5cf6b356df5effb2769bd2 | [
"MIT"
] | permissive | masud-technope/ACER-Replication-Package-ASE2017 | 41a7603117f01382e7e16f2f6ae899e6ff3ad6bb | cb7318a729eb1403004d451a164c851af2d81f7a | refs/heads/master | 2021-06-21T02:19:43.602864 | 2021-02-13T20:44:09 | 2021-02-13T20:44:09 | 187,748,164 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,839 | 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.sling.nosql.mongodb.resourceprovider.integration;
import java.util.UUID;
import org.apache.jackrabbit.JcrConstants;
import org.apache.sling.api.resource.PersistenceException;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceProvider;
import org.apache.sling.nosql.generic.resource.impl.AbstractNoSqlResourceProviderTest;
import org.apache.sling.nosql.mongodb.resourceprovider.impl.MongoDBNoSqlResourceProviderFactory;
import com.google.common.collect.ImmutableMap;
/**
* Test basic ResourceResolver and ValueMap with different data types.
*/
public class MongoDBNoSqlResourceProviderIT extends AbstractNoSqlResourceProviderTest {
private Resource testRoot;
@Override
protected void registerResourceProviderFactory() {
context.registerInjectActivateService(new MongoDBNoSqlResourceProviderFactory(), ImmutableMap.<String, Object>builder().put(ResourceProvider.ROOTS, "/test").put("connectionString", System.getProperty("connectionString", "localhost:27017")).put("database", System.getProperty("database", "sling")).put("collection", System.getProperty("collection", "resources")).build());
}
@Override
protected Resource testRoot() {
if (this.testRoot == null) {
try {
Resource root = context.resourceResolver().getResource("/");
Resource providerRoot = root.getChild("test");
if (providerRoot == null) {
providerRoot = context.resourceResolver().create(root, "test", ImmutableMap.<String, Object>of(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED));
}
this.testRoot = context.resourceResolver().create(providerRoot, UUID.randomUUID().toString(), ImmutableMap.<String, Object>of(JcrConstants.JCR_PRIMARYTYPE, JcrConstants.NT_UNSTRUCTURED));
} catch (PersistenceException ex) {
throw new RuntimeException(ex);
}
}
return this.testRoot;
}
}
| [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
c42b30baa58ee2c93fd8240d05c2e0915b5fca94 | 980f9a6e3e27549d6ebf89dc739b2c45c1e3e9cb | /lab/src/main/java/cn/fyypumpkin/manage/lab/dto/export/Win.java | 2845e21ecaaa1e7f3eaf75feb4dbc60f32c60e66 | [] | no_license | Fyypumpkin/Graduation-lab-system | a025561dd441e31ab3942cdec397b8bfe852614e | c39dd76c40713bce0c859fc777c807acb641a161 | refs/heads/master | 2020-03-13T12:15:15.325242 | 2018-06-20T09:10:48 | 2018-06-20T09:10:48 | 131,115,325 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 954 | java | package cn.fyypumpkin.manage.lab.dto.export;
public class Win {
private String username;
private String winName;
private String winInst;
private String winTime;
private String winRank;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getWinName() {
return winName;
}
public void setWinName(String winName) {
this.winName = winName;
}
public String getWinInst() {
return winInst;
}
public void setWinInst(String winInst) {
this.winInst = winInst;
}
public String getWinTime() {
return winTime;
}
public void setWinTime(String winTime) {
this.winTime = winTime;
}
public String getWinRank() {
return winRank;
}
public void setWinRank(String winRank) {
this.winRank = winRank;
}
}
| [
"fyypumpkin@gmail.com"
] | fyypumpkin@gmail.com |
79f81b41a8726cfa5a30d6c9674d8f0e2a601b79 | 09d0ddd512472a10bab82c912b66cbb13113fcbf | /TestApplications/privacy-friendly-netmonitor-2.0/DecompiledCode/JADX/src/main/java/android/support/p000v4/widget/SimpleCursorAdapter.java | e44a490072af812fdc00b7a8c6593ad627e7de0d | [] | no_license | sgros/activity_flow_plugin | bde2de3745d95e8097c053795c9e990c829a88f4 | 9e59f8b3adacf078946990db9c58f4965a5ccb48 | refs/heads/master | 2020-06-19T02:39:13.865609 | 2019-07-08T20:17:28 | 2019-07-08T20:17:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,350 | java | package android.support.p000v4.widget;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.support.annotation.RestrictTo;
import android.support.annotation.RestrictTo.Scope;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
/* renamed from: android.support.v4.widget.SimpleCursorAdapter */
public class SimpleCursorAdapter extends ResourceCursorAdapter {
private CursorToStringConverter mCursorToStringConverter;
@RestrictTo({Scope.LIBRARY_GROUP})
protected int[] mFrom;
String[] mOriginalFrom;
private int mStringConversionColumn = -1;
@RestrictTo({Scope.LIBRARY_GROUP})
protected int[] mTo;
private ViewBinder mViewBinder;
/* renamed from: android.support.v4.widget.SimpleCursorAdapter$CursorToStringConverter */
public interface CursorToStringConverter {
CharSequence convertToString(Cursor cursor);
}
/* renamed from: android.support.v4.widget.SimpleCursorAdapter$ViewBinder */
public interface ViewBinder {
boolean setViewValue(View view, Cursor cursor, int i);
}
@Deprecated
public SimpleCursorAdapter(Context context, int i, Cursor cursor, String[] strArr, int[] iArr) {
super(context, i, cursor);
this.mTo = iArr;
this.mOriginalFrom = strArr;
findColumns(cursor, strArr);
}
public SimpleCursorAdapter(Context context, int i, Cursor cursor, String[] strArr, int[] iArr, int i2) {
super(context, i, cursor, i2);
this.mTo = iArr;
this.mOriginalFrom = strArr;
findColumns(cursor, strArr);
}
public void bindView(View view, Context context, Cursor cursor) {
ViewBinder viewBinder = this.mViewBinder;
int length = this.mTo.length;
int[] iArr = this.mFrom;
int[] iArr2 = this.mTo;
for (int i = 0; i < length; i++) {
View findViewById = view.findViewById(iArr2[i]);
if (findViewById != null) {
if (viewBinder != null ? viewBinder.setViewValue(findViewById, cursor, iArr[i]) : false) {
continue;
} else {
String string = cursor.getString(iArr[i]);
if (string == null) {
string = "";
}
if (findViewById instanceof TextView) {
setViewText((TextView) findViewById, string);
} else if (findViewById instanceof ImageView) {
setViewImage((ImageView) findViewById, string);
} else {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(findViewById.getClass().getName());
stringBuilder.append(" is not a ");
stringBuilder.append(" view that can be bounds by this SimpleCursorAdapter");
throw new IllegalStateException(stringBuilder.toString());
}
}
}
}
}
public ViewBinder getViewBinder() {
return this.mViewBinder;
}
public void setViewBinder(ViewBinder viewBinder) {
this.mViewBinder = viewBinder;
}
public void setViewImage(ImageView imageView, String str) {
try {
imageView.setImageResource(Integer.parseInt(str));
} catch (NumberFormatException unused) {
imageView.setImageURI(Uri.parse(str));
}
}
public void setViewText(TextView textView, String str) {
textView.setText(str);
}
public int getStringConversionColumn() {
return this.mStringConversionColumn;
}
public void setStringConversionColumn(int i) {
this.mStringConversionColumn = i;
}
public CursorToStringConverter getCursorToStringConverter() {
return this.mCursorToStringConverter;
}
public void setCursorToStringConverter(CursorToStringConverter cursorToStringConverter) {
this.mCursorToStringConverter = cursorToStringConverter;
}
public CharSequence convertToString(Cursor cursor) {
if (this.mCursorToStringConverter != null) {
return this.mCursorToStringConverter.convertToString(cursor);
}
if (this.mStringConversionColumn > -1) {
return cursor.getString(this.mStringConversionColumn);
}
return super.convertToString(cursor);
}
private void findColumns(Cursor cursor, String[] strArr) {
if (cursor != null) {
int length = strArr.length;
if (this.mFrom == null || this.mFrom.length != length) {
this.mFrom = new int[length];
}
for (int i = 0; i < length; i++) {
this.mFrom[i] = cursor.getColumnIndexOrThrow(strArr[i]);
}
return;
}
this.mFrom = null;
}
public Cursor swapCursor(Cursor cursor) {
findColumns(cursor, this.mOriginalFrom);
return super.swapCursor(cursor);
}
public void changeCursorAndColumns(Cursor cursor, String[] strArr, int[] iArr) {
this.mOriginalFrom = strArr;
this.mTo = iArr;
findColumns(cursor, this.mOriginalFrom);
super.changeCursor(cursor);
}
}
| [
"crash@home.home.hr"
] | crash@home.home.hr |
9bd4f93f2d7e2877980ba5406b5bcc61cf0e6ee9 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/25/25_1158e98e98848d327d73876b6e8289210a577b7c/PafDimSpec/25_1158e98e98848d327d73876b6e8289210a577b7c_PafDimSpec_s.java | 3233bf61d904f9d5af8125abac5fe5698f5a2557 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,340 | java | /*
* File: @(#)PafDimSpec.java Package: com.pace.base.server.comm Project: PafServer
* Created: Oct 13, 2005 By: JWatkins
* Version: x.xx
*
* Copyright (c) 2005-2006 Palladium Group, Inc. All rights reserved.
*
* This software is the confidential and proprietary information of Palladium Group, Inc.
* ("Confidential Information"). You shall not disclose such Confidential Information and
* should use it only in accordance with the terms of the license agreement you entered into
* with Palladium Group, Inc.
*
*
*
Date Author Version Changes
xx/xx/xx xxxxxxxx x.xx ..............
*
*/
package com.pace.base.app;
import java.util.Arrays;
import org.apache.log4j.Logger;
/**
* Class_description_goes_here
*
* @version x.xx
* @author JWatkins
*
*/
public class PafDimSpec implements Cloneable {
private transient final static Logger logger = Logger.getLogger(PafDimSpec.class);
private transient boolean isSelectable;
private String dimension;
private String[] expressionList;
public PafDimSpec() { }
/**
* @return Returns the dimension.
*/
public String getDimension() {
return dimension;
}
/**
* @param dimension The dimension to set.
*/
public void setDimension(String dimension) {
this.dimension = dimension;
}
/**
* @return Returns the expressionList.
*/
public String[] getExpressionList() {
return expressionList;
}
/**
* @param expressionList The expressionList to set.
*/
public void setExpressionList(String[] expressionList) {
this.expressionList = expressionList;
}
/**
* @return Returns the isSelectable.
*/
public boolean isSelectable() {
return isSelectable;
}
/**
* @param isSelectable The isSelectable to set.
*/
public void setSelectable(boolean isSelectable) {
this.isSelectable = isSelectable;
}
/* (non-Javadoc)
* @see java.lang.PafDimSpec#clone()
*/
@Override
public PafDimSpec clone() {
try {
return (PafDimSpec) super.clone();
} catch (CloneNotSupportedException e) {
//can't happen if implements cloneable
logger.warn(e.getMessage());
}
return null;
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result
+ ((dimension == null) ? 0 : dimension.hashCode());
result = prime * result + Arrays.hashCode(expressionList);
return result;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PafDimSpec other = (PafDimSpec) obj;
if (dimension == null) {
if (other.dimension != null)
return false;
} else if (!dimension.equals(other.dimension))
return false;
if (!Arrays.equals(expressionList, other.expressionList))
return false;
return true;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
45b88412308a86b7ddc211d7767241687f2e6adf | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/LANG-9b-5-10-MOEAD-WeightedSum:TestLen:CallDiversity/org/apache/commons/lang3/time/FastDateParser_ESTest_scaffolding.java | fbfa0bd9f8094d89bdc7fba485bc8494c1eec146 | [] | 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 | 2,827 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Sun Jan 19 14:24:02 UTC 2020
*/
package org.apache.commons.lang3.time;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import static org.evosuite.shaded.org.mockito.Mockito.*;
@EvoSuiteClassExclude
public class FastDateParser_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.lang3.time.FastDateParser";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {}
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(FastDateParser_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.lang3.time.FastDateParser$5",
"org.apache.commons.lang3.time.FastDateParser$4",
"org.apache.commons.lang3.time.FastDateParser$3",
"org.apache.commons.lang3.time.FastDateParser$Strategy",
"org.apache.commons.lang3.time.FastDateParser$2",
"org.apache.commons.lang3.time.FastDateParser$TextStrategy",
"org.apache.commons.lang3.time.FastDateParser$1",
"org.apache.commons.lang3.time.FastDateParser$NumberStrategy",
"org.apache.commons.lang3.time.DateParser",
"org.apache.commons.lang3.time.FastDateParser"
);
}
private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException {
mock(Class.forName("java.util.TimeZone", false, FastDateParser_ESTest_scaffolding.class.getClassLoader()));
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
00681a05573be98b3ecb82c8c7998abae8e36e36 | 3f7b97bf6c8554dff9bd35d8970f66530e426b67 | /src/main/java/me/limeglass/diskord/elements/conditions/CondCategoryIsNSFW.java | 89bee3d37dd6dbc18fd718985b898d3acb5f03a0 | [
"Apache-2.0"
] | permissive | TheLimeGlass/Diskord | 02145d5f87e09b59a7154953d954672570fe18cd | 61cec77b22ddf5ef2facded12c232d4584c51c0f | refs/heads/master | 2021-04-24T22:07:50.049647 | 2018-12-01T18:27:19 | 2018-12-01T18:27:19 | 116,487,423 | 0 | 0 | null | 2018-01-06T14:05:13 | 2018-01-06T14:02:10 | Java | IBM852 | Java | false | false | 724 | java | package me.limeglass.diskord.elements.conditions;
import org.bukkit.event.Event;
import ch.njol.skript.doc.Description;
import ch.njol.skript.doc.Name;
import me.limeglass.diskord.lang.DiskordCondition;
import me.limeglass.diskord.utils.annotations.Patterns;
import sx.blah.discord.handle.obj.ICategory;
@Name("Category - Is NSFW")
@Description("Check if a category is NSFW (not safe for work).")
@Patterns("[category] %discordcategory% (1Žis|2Žis(n't| not)) (NSFW|not safe for work)")
public class CondCategoryIsNSFW extends DiskordCondition {
public boolean check(Event event) {
if (areNull(event)) return false;
return (expressions.getSingle(event, ICategory.class).isNSFW()) ? isNegated() : !isNegated();
}
} | [
"seantgrover@gmail.com"
] | seantgrover@gmail.com |
e68770b614ce3a86e1fd680f75b15d92f7388b9a | e5871ece699da23892937e263068df1378f0a4cd | /Spring-Projects/Football_Exam_28_07_19/src/main/java/softuni/exam/util/ValidatorUtil.java | 8dab1c78e3726b5ddb13d716e67f3a8f3d73d5db | [
"MIT"
] | permissive | DenislavVelichkov/Java-DBS-Module-June-2019 | a047d5f534378b1682410c86595fd40466638cdc | 643422bf41d99af1e0bbd3898fa5adfba8b2c36c | refs/heads/master | 2022-12-22T12:08:47.625449 | 2020-02-10T09:21:15 | 2020-02-10T09:21:15 | 204,847,760 | 0 | 0 | MIT | 2022-12-16T05:03:18 | 2019-08-28T04:26:36 | Java | UTF-8 | Java | false | false | 226 | java | package softuni.exam.util;
import javax.validation.ConstraintViolation;
import java.util.Set;
public interface ValidatorUtil {
<E> boolean isValid(E entity);
<E> Set<ConstraintViolation<E>> violations(E entity);
}
| [
"denislav.velichkov@gmail.com"
] | denislav.velichkov@gmail.com |
903d557da691845d4443d3a4fa22589c22393b40 | f73815ff564c190d3867e1acc41b16d4f428a2d4 | /app/src/main/java/org/jboss/aerogear/memeolist/MemeDetail.java | 6a36e8880542392b1b841d623824e5f0bfab8f20 | [
"Apache-2.0"
] | permissive | salty-pig/memeolist-android | 1cb2d0ede61458301212e1c79895b7c90d15995d | 99eee657e57cbb88be74d8ab30a699cb833ab55c | refs/heads/master | 2021-01-01T18:22:13.990281 | 2015-10-01T15:06:48 | 2015-10-01T15:06:48 | 40,627,708 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,647 | java | package org.jboss.aerogear.memeolist;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.design.widget.CollapsingToolbarLayout;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.util.Pair;
import android.view.View;
import android.widget.ImageView;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import com.squareup.picasso.OkHttpDownloader;
import com.squareup.picasso.Picasso;
import org.jboss.aerogear.android.authorization.AuthorizationManager;
import org.jboss.aerogear.android.pipe.module.ModuleFields;
import org.jboss.aerogear.memeolist.adapter.CommentAdapter;
import org.jboss.aerogear.memeolist.content.vo.Post;
import java.io.IOException;
/**
* Created by summers on 6/27/15.
*/
public class MemeDetail extends AppCompatActivity {
public static final String EXTRA_MEME = "MemeDetails.memeId";
private Post post;
private ImageView memeImage;
private RecyclerView commentsList;
private AlertDialog dialog;
private Picasso picasso;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.meme_details);
loadToolbar();
memeImage = (ImageView) findViewById(R.id.meme_photo);
post = getIntent().getParcelableExtra(EXTRA_MEME);
setupPicasso();
loadMeme();
loadCommentsList();
setupFAB();
}
private void setupPicasso() {
OkHttpClient picassoClient = new OkHttpClient();
picassoClient.interceptors().add(new Interceptor() {
@Override
public Response intercept(Chain chain) throws IOException {
ModuleFields fields = AuthorizationManager.getModule("KeyCloakAuthz").loadModule(null, null, null);
Pair<String, String> header = fields.getHeaders().get(0);
Request newRequest = chain.request().newBuilder()
.addHeader(header.first, header.second)
.build();
return chain.proceed(newRequest);
}
});
picasso = new Picasso.Builder(this).downloader(new OkHttpDownloader(picassoClient)).build();
picasso.setIndicatorsEnabled(true);
picasso.setLoggingEnabled(true);
}
private void setupFAB() {
findViewById(R.id.fab).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog = new AlertDialog.Builder(MemeDetail.this)
.setTitle("Add Comment")
.setPositiveButton("Submit",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
finish();
}
}
)
.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
}
).setView(R.layout.add_comment_dialog)
.create();
dialog.show();
}
});
}
private void loadCommentsList() {
commentsList = (RecyclerView) findViewById(R.id.comments);
commentsList.setLayoutManager(new LinearLayoutManager(this));
commentsList.setAdapter(new CommentAdapter());
}
private void loadToolbar() {
setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
CollapsingToolbarLayout collapsingToolbar =
(CollapsingToolbarLayout) findViewById(R.id.collapsing_toolbar);
collapsingToolbar.setTitle("Memeolist");
}
@Override
protected void onPause() {
super.onPause();
if (dialog != null) {
dialog.dismiss();
dialog = null;
}
}
private void loadMeme() {
picasso
.load(post.getFileUrl().toString())
.noFade()
.into(memeImage);
}
}
| [
"secondsun@gmail.com"
] | secondsun@gmail.com |
82b7e45ff9edeb6089272910e477e6e1b63d89e8 | a569a2a6fde8736ae33467632c75e5b2baa3b38d | /tensorflow-core/tensorflow-core-api/src/gen/java/org/tensorflow/op/tpu/TPURoundRobin.java | a42c4bd1afc4af41f4c750d1b12d775db7e9b8c4 | [
"Apache-2.0"
] | permissive | karllessard/tensorflow-java | c9a44d1c4875a7d8ce9e60496234fe910cfa058b | c8618642dbffe5c672fef3d83edfe3e213142e76 | refs/heads/master | 2023-06-12T20:10:48.520640 | 2023-01-11T04:54:18 | 2023-01-11T04:54:18 | 209,565,214 | 0 | 0 | Apache-2.0 | 2022-11-03T01:37:31 | 2019-09-19T13:45:36 | Java | UTF-8 | Java | false | false | 3,113 | java | /* Copyright 2018-2022 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=======================================================================*/
// This class has been generated, DO NOT EDIT!
package org.tensorflow.op.tpu;
import java.util.Arrays;
import org.tensorflow.GraphOperation;
import org.tensorflow.Operand;
import org.tensorflow.Operation;
import org.tensorflow.OperationBuilder;
import org.tensorflow.Output;
import org.tensorflow.op.RawOp;
import org.tensorflow.op.RawOpInputs;
import org.tensorflow.op.Scope;
import org.tensorflow.op.annotation.Endpoint;
import org.tensorflow.op.annotation.OpInputsMetadata;
import org.tensorflow.op.annotation.OpMetadata;
import org.tensorflow.op.annotation.Operator;
import org.tensorflow.types.TInt32;
/**
* Round-robin load balancing on TPU cores.
* A load balancing op that round-robins among TPU cores.
* <p>This op round-robins between the integers in [0, NumTPUCoresVisiblePerHost]. It
* is useful for interfacing with TensorFlow ops that take as input a TPU core on
* which to execute computations, such as {@code TPUPartitionedCall}.
* <p>device_ordinal: An integer in [0, NumTPUCoresVisiblePerHost].
*/
@OpMetadata(
opType = TPURoundRobin.OP_NAME,
inputsClass = TPURoundRobin.Inputs.class
)
@Operator(
group = "tpu"
)
public final class TPURoundRobin extends RawOp implements Operand<TInt32> {
/**
* The name of this op, as known by TensorFlow core engine
*/
public static final String OP_NAME = "TPURoundRobin";
private Output<TInt32> deviceOrdinal;
public TPURoundRobin(Operation operation) {
super(operation, OP_NAME);
int outputIdx = 0;
deviceOrdinal = operation.output(outputIdx++);
}
/**
* Factory method to create a class wrapping a new TPURoundRobin operation.
*
* @param scope current scope
* @return a new instance of TPURoundRobin
*/
@Endpoint(
describeByClass = true
)
public static TPURoundRobin create(Scope scope) {
OperationBuilder opBuilder = scope.opBuilder(OP_NAME, "TPURoundRobin");
return new TPURoundRobin(opBuilder.build());
}
/**
* Gets deviceOrdinal.
*
* @return deviceOrdinal.
*/
public Output<TInt32> deviceOrdinal() {
return deviceOrdinal;
}
@Override
public Output<TInt32> asOutput() {
return deviceOrdinal;
}
@OpInputsMetadata(
outputsClass = TPURoundRobin.class
)
public static class Inputs extends RawOpInputs<TPURoundRobin> {
public Inputs(GraphOperation op) {
super(new TPURoundRobin(op), op, Arrays.asList());
int inputIndex = 0;
}
}
}
| [
"karl.lessard@gmail.com"
] | karl.lessard@gmail.com |
74c2f28640726f47b7265fbbaaf41c045a5799e8 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/5/org/apache/commons/math3/stat/inference/OneWayAnova_anovaTest_245.java | 5db3cdbc58516b2430d6748dde3b7fffd7fa13c6 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,226 | java |
org apach common math3 stat infer
implement anova analysi varianc statist
test differ categori univari data
bodi mass index account lawyer doctor
comput programm categori equival
link org apach common math3 stat infer test ttest
link org apach common math3 distribut distribut fdistribut
common math distribut implement estim exact valu
implement base descript
http faculti vassar lowri ch13pt1 html
pre
abbrevi group
group
sum squar deviat
pre
version
anova onewayanova
perform anova test evalu hypothesi
differ mean data categori
strong precondit strong
categori data categorydata code collect code
code code arrai
code code arrai
code categori data categorydata code collect arrai
valu
alpha strictli greater equal
implement
link org apach common math3 distribut distribut fdistribut
common math distribut implement estim exact
formula pre
cumul probabl cumulativeprob pre
code code code cumul probabl cumulativeprob code
common math implement distribut
true return iff estim alpha
param categori data categorydata code collect code code code
arrai data categori
param alpha signific level test
hypothesi reject
confid alpha
null argument except nullargumentexcept code categori data categorydata code code code
dimens mismatch except dimensionmismatchexcept length code categori data categorydata code
arrai contain code code arrai
valu
rang except outofrangeexcept code alpha code rang
converg except convergenceexcept comput due converg error
max count exceed except maxcountexceededexcept maximum number iter exceed
anova test anovatest collect categori data categorydata
alpha
null argument except nullargumentexcept dimens mismatch except dimensionmismatchexcept
rang except outofrangeexcept converg except convergenceexcept max count exceed except maxcountexceededexcept
alpha alpha
rang except outofrangeexcept
local format localizedformat bound signific level
alpha
anova anovapvalu categori data categorydata alpha
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
219d51c37d89a70c5d7917d3884af26a88138b73 | 18ada7e1ba05e6ee6781cd58d2cb03ff52bd1077 | /extensions/cast/src/test/java/com/google/android/exoplayer2/ext/cast/CastTimelineTrackerTest.java | cae117ea009666d09b67da463bc24761fa233864 | [
"Apache-2.0"
] | permissive | harmonicinc-com/ExoPlayer | 2ae5200888aca8406238fe777f1604355c5377da | 21b3348e4886dae5cd8e9b6d0340dd5cb686d3bc | refs/heads/harmonic-r2.13 | 2023-05-13T04:12:32.515312 | 2023-05-04T08:47:39 | 2023-05-04T08:47:39 | 252,630,189 | 2 | 1 | Apache-2.0 | 2023-04-28T17:34:52 | 2020-04-03T04:13:33 | Java | UTF-8 | Java | false | false | 4,974 | java | /*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.android.exoplayer2.ext.cast;
import static org.mockito.Mockito.when;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.testutil.TimelineAsserts;
import com.google.android.exoplayer2.util.MimeTypes;
import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaStatus;
import com.google.android.gms.cast.framework.media.MediaQueue;
import com.google.android.gms.cast.framework.media.RemoteMediaClient;
import java.util.Collections;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
/** Tests for {@link CastTimelineTracker}. */
@RunWith(AndroidJUnit4.class)
public class CastTimelineTrackerTest {
private static final long DURATION_2_MS = 2000;
private static final long DURATION_3_MS = 3000;
private static final long DURATION_4_MS = 4000;
private static final long DURATION_5_MS = 5000;
/** Tests that duration of the current media info is correctly propagated to the timeline. */
@Test
public void getCastTimelinePersistsDuration() {
CastTimelineTracker tracker = new CastTimelineTracker();
RemoteMediaClient remoteMediaClient =
mockRemoteMediaClient(
/* itemIds= */ new int[] {1, 2, 3, 4, 5},
/* currentItemId= */ 2,
/* currentDurationMs= */ DURATION_2_MS);
TimelineAsserts.assertPeriodDurations(
tracker.getCastTimeline(remoteMediaClient),
C.TIME_UNSET,
C.msToUs(DURATION_2_MS),
C.TIME_UNSET,
C.TIME_UNSET,
C.TIME_UNSET);
remoteMediaClient =
mockRemoteMediaClient(
/* itemIds= */ new int[] {1, 2, 3},
/* currentItemId= */ 3,
/* currentDurationMs= */ DURATION_3_MS);
TimelineAsserts.assertPeriodDurations(
tracker.getCastTimeline(remoteMediaClient),
C.TIME_UNSET,
C.msToUs(DURATION_2_MS),
C.msToUs(DURATION_3_MS));
remoteMediaClient =
mockRemoteMediaClient(
/* itemIds= */ new int[] {1, 3},
/* currentItemId= */ 3,
/* currentDurationMs= */ DURATION_3_MS);
TimelineAsserts.assertPeriodDurations(
tracker.getCastTimeline(remoteMediaClient), C.TIME_UNSET, C.msToUs(DURATION_3_MS));
remoteMediaClient =
mockRemoteMediaClient(
/* itemIds= */ new int[] {1, 2, 3, 4, 5},
/* currentItemId= */ 4,
/* currentDurationMs= */ DURATION_4_MS);
TimelineAsserts.assertPeriodDurations(
tracker.getCastTimeline(remoteMediaClient),
C.TIME_UNSET,
C.TIME_UNSET,
C.msToUs(DURATION_3_MS),
C.msToUs(DURATION_4_MS),
C.TIME_UNSET);
remoteMediaClient =
mockRemoteMediaClient(
/* itemIds= */ new int[] {1, 2, 3, 4, 5},
/* currentItemId= */ 5,
/* currentDurationMs= */ DURATION_5_MS);
TimelineAsserts.assertPeriodDurations(
tracker.getCastTimeline(remoteMediaClient),
C.TIME_UNSET,
C.TIME_UNSET,
C.msToUs(DURATION_3_MS),
C.msToUs(DURATION_4_MS),
C.msToUs(DURATION_5_MS));
}
private static RemoteMediaClient mockRemoteMediaClient(
int[] itemIds, int currentItemId, long currentDurationMs) {
RemoteMediaClient remoteMediaClient = Mockito.mock(RemoteMediaClient.class);
MediaStatus status = Mockito.mock(MediaStatus.class);
when(status.getQueueItems()).thenReturn(Collections.emptyList());
when(remoteMediaClient.getMediaStatus()).thenReturn(status);
when(status.getMediaInfo()).thenReturn(getMediaInfo(currentDurationMs));
when(status.getCurrentItemId()).thenReturn(currentItemId);
MediaQueue mediaQueue = mockMediaQueue(itemIds);
when(remoteMediaClient.getMediaQueue()).thenReturn(mediaQueue);
return remoteMediaClient;
}
private static MediaQueue mockMediaQueue(int[] itemIds) {
MediaQueue mediaQueue = Mockito.mock(MediaQueue.class);
when(mediaQueue.getItemIds()).thenReturn(itemIds);
return mediaQueue;
}
private static MediaInfo getMediaInfo(long durationMs) {
return new MediaInfo.Builder(/*contentId= */ "")
.setStreamDuration(durationMs)
.setContentType(MimeTypes.APPLICATION_MP4)
.setStreamType(MediaInfo.STREAM_TYPE_NONE)
.build();
}
}
| [
"olly@google.com"
] | olly@google.com |
eeeea1baf5577dad1e0ea922463bcb4290aabc6b | 8d94de48e8ff2b6d279de9fd701bad9cb7bd8d57 | /app/src/test/java/org/amhzing/clusterview/app/infra/repository/RegionCourseStatisticRepositoryCacheTest.java | cc472181a07bbc7c746d2d301c3e43fb207987b8 | [] | no_license | mahanhz/clusterview | b278a78cdeb6020b1a1130dc14ea94594b1fc459 | 0a70a148c9b55adc8d1c4968f15e5077e57821be | refs/heads/main | 2023-02-08T19:39:38.359729 | 2017-04-10T19:59:32 | 2017-04-10T19:59:32 | 74,023,377 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,030 | java | package org.amhzing.clusterview.app.infra.repository;
import org.amhzing.clusterview.app.domain.model.Region;
import org.amhzing.clusterview.app.domain.model.statistic.CourseStatistic;
import org.amhzing.clusterview.app.domain.repository.StatisticRepository;
import org.amhzing.clusterview.app.helper.JpaRepositoryHelper;
import org.amhzing.clusterview.app.infra.jpa.repository.RegionJpaRepository;
import org.amhzing.clusterview.app.testconfig.CacheInvalidateRule;
import org.amhzing.clusterview.app.testconfig.CacheTestConfig;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = CacheTestConfig.class)
public class RegionCourseStatisticRepositoryCacheTest {
private static final String EXISTING_REGION = "existing";
@Autowired
private RegionJpaRepository regionJpaRepository;
@Autowired
private StatisticRepository<Region.Id, CourseStatistic> statisticRepository;
@Rule
@Autowired
public CacheInvalidateRule cacheInvalidatenRule;
@Test
public void should_invoke_cache() throws Exception {
given(regionJpaRepository.findOne(EXISTING_REGION)).willReturn(JpaRepositoryHelper.regionEntity());
final Region.Id regionId = Region.Id.create(EXISTING_REGION);
// First call
final CourseStatistic firstCall = statisticRepository.statistics(regionId);
// Second call
final CourseStatistic secondCall = statisticRepository.statistics(regionId);
assertThat(firstCall).isSameAs(secondCall);
verify(regionJpaRepository, times(1)).findOne(regionId.getId());
}
} | [
"mahanhz@gmail.com"
] | mahanhz@gmail.com |
926ee40e26f18889729a79cb07537632e361b279 | beceba0625e1b93c1d157976b2c486f58e43d134 | /Algorithms/Neeraj/topAmazonQuestions/Turnstile.java | e61bb21686f57e019dc2b24ec0663f0a3d8f330f | [] | no_license | Dinesh94Singh/FAANG | 7395959b4f99607c5e5fc189d383bf3b4c27a9a0 | e8bf8c2fd853afb3f3125bb093cd325e92d05a49 | refs/heads/master | 2023-02-21T14:51:33.864555 | 2021-01-15T14:55:06 | 2021-01-15T14:55:06 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,377 | java | import java.util.*;
import java.io.*;
/**
* Created on: Jan 12, 2021
* Questions: https://leetcode.com/discuss/interview-question/699973/
*/
public class Turnstile {
public static void main(String[] args) {
System.out.println(Arrays.toString(getTimes(new int[]{0, 0, 1, 5}, new int[]{0, 1, 1, 0})));
System.out.println(Arrays.toString(getTimes(new int[]{1, 2, 4}, new int[]{0, 1, 1})));
System.out.println(Arrays.toString(getTimes(new int[]{1, 1}, new int[]{1, 1})));
System.out.println(Arrays.toString(getTimes(new int[]{1, 1, 3, 3, 4, 5, 6, 7, 7}, new int[]{1, 1, 0, 0, 0, 1, 1, 1, 1})));
}
private static int[] getTimes(int[] time, int[] dirs) {
int len = time.length;
int[] persons = new int[len];
Queue<int[]> in = new LinkedList<>(), out = new LinkedList<>();
// collect all the based on the directions.
for (int i = 0; i < len; i++) {
if (dirs[i] == 0) {
in.add(new int[]{time[i], i});
} else {
out.add(new int[]{time[i], i});
}
}
int t = 0, preDir = 1;
// Set the initial direction to out, as that is the directions when pre was not used.
while (!in.isEmpty() || !out.isEmpty()) {
// Loop till both the queue is empty.
boolean hasIn = !in.isEmpty() && in.peek()[0] <= t, hasOut = !out.isEmpty() && out.peek()[0] <= t;
int inTime = Math.max(t, in.isEmpty() ? Integer.MAX_VALUE : in.peek()[0]);
int outTime = Math.max(t, out.isEmpty() ? Integer.MAX_VALUE : out.peek()[0]);
if (hasIn && hasOut) {
// If there are two people at the same moment, then take the one with
if (preDir == 1) {
persons[out.poll()[1]] = t;
t = outTime + 1;
} else {
persons[in.poll()[1]] = t;
t = inTime + 1;
}
} else if (hasIn) {
persons[in.poll()[1]] = t;
preDir = 0;
t = inTime + 1;
} else if (hasOut) {
persons[out.poll()[1]] = t;
preDir = 1;
t = outTime + 1;
} else {
preDir = 1;
t++;
}
}
return persons;
}
}
| [
"43318996+neerazz@users.noreply.github.com"
] | 43318996+neerazz@users.noreply.github.com |
c3e4fc3c95774096b0671a150947d18a345cee51 | eabafc86ab9e823293e9c4f0e0d45adfd27acaac | /ClusterDevicePlatform-server/src/main/java/cc/bitky/clusterdeviceplatform/server/server/ServerCenterProcessor.java | 67fc6c4b2f59171cd213d984aff525e76013f9e0 | [
"MIT"
] | permissive | xingyundeyangzhen/ClusterDeviceControlPlatform | 448cb356a5d5c73b5b2ce0c0b31bc6ffdcb21811 | 759bfd98e626976605566fba92b5b4372fd4c1ba | refs/heads/master | 2020-03-07T04:12:04.154620 | 2018-02-28T07:26:50 | 2018-02-28T07:26:50 | 127,259,259 | 0 | 1 | null | 2018-03-29T08:11:38 | 2018-03-29T08:11:38 | null | UTF-8 | Java | false | false | 7,298 | java | package cc.bitky.clusterdeviceplatform.server.server;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.concurrent.LinkedBlockingDeque;
import cc.bitky.clusterdeviceplatform.messageutils.config.ChargeStatus;
import cc.bitky.clusterdeviceplatform.messageutils.define.base.BaseMsg;
import cc.bitky.clusterdeviceplatform.messageutils.msg.statusreply.MsgReplyDeviceStatus;
import cc.bitky.clusterdeviceplatform.messageutils.msgcodec.device.MsgCodecDeviceRemainChargeTimes;
import cc.bitky.clusterdeviceplatform.server.config.CommSetting;
import cc.bitky.clusterdeviceplatform.server.config.DeviceSetting;
import cc.bitky.clusterdeviceplatform.server.config.WebSetting;
import cc.bitky.clusterdeviceplatform.server.db.DbPresenter;
import cc.bitky.clusterdeviceplatform.server.db.bean.Device;
import cc.bitky.clusterdeviceplatform.server.db.statistic.repo.ProcessedMsgRepo;
import cc.bitky.clusterdeviceplatform.server.server.repo.DeviceStatusRepository;
import cc.bitky.clusterdeviceplatform.server.server.repo.MsgProcessingRepository;
import cc.bitky.clusterdeviceplatform.server.server.repo.TcpFeedBackRepository;
import cc.bitky.clusterdeviceplatform.server.tcp.statistic.except.TcpFeedbackItem;
@Service
public class ServerCenterProcessor {
private static final Logger logger = LoggerFactory.getLogger(ServerCenterProcessor.class);
private final MsgProcessingRepository msgProcessingRepository;
private final TcpFeedBackRepository tcpFeedBackRepository;
private final DeviceStatusRepository deviceStatusRepository;
private final DbPresenter dbPresenter;
private ServerTcpProcessor tcpProcessor;
@Autowired
public ServerCenterProcessor(MsgProcessingRepository msgProcessingRepository, DbPresenter dbPresenter, TcpFeedBackRepository tcpFeedBackRepository, DeviceStatusRepository deviceStatusRepository) {
this.msgProcessingRepository = msgProcessingRepository;
this.tcpFeedBackRepository = tcpFeedBackRepository;
this.dbPresenter = dbPresenter;
this.deviceStatusRepository = deviceStatusRepository;
msgProcessingRepository.setDbPresenter(dbPresenter);
msgProcessingRepository.setServer(this);
addJvmShutDownHook();
}
public DbPresenter getDbPresenter() {
return dbPresenter;
}
public DeviceStatusRepository getDeviceStatusRepository() {
return deviceStatusRepository;
}
public TcpFeedBackRepository getTcpFeedBackRepository() {
return tcpFeedBackRepository;
}
public MsgProcessingRepository getMsgProcessingRepository() {
return msgProcessingRepository;
}
ServerTcpProcessor getTcpProcessor() {
return tcpProcessor;
}
void setTcpProcessor(ServerTcpProcessor tcpProcessor) {
this.tcpProcessor = tcpProcessor;
}
private boolean sendMessage(BaseMsg message) {
return message != null && tcpProcessor.sendMessage(message);
}
/**
* 将「消息对象」下发至 TCP,若为成组消息可自动解包
*
* @param message 欲下发的消息
* @return 是否下发成功
*/
boolean sendMessageGrouped(BaseMsg message) {
int groupId = message.getGroupId();
int deviceId = message.getDeviceId();
if (groupId == WebSetting.BROADCAST_GROUP_ID && deviceId == WebSetting.BROADCAST_DEVICE_ID) {
boolean success = false;
for (int tempGroupId = 1; tempGroupId <= DeviceSetting.MAX_GROUP_ID; tempGroupId++) {
if (tcpProcessor.tcpIsAvailable(tempGroupId)) {
for (int tempDeviceId = 1; tempDeviceId <= DeviceSetting.MAX_DEVICE_ID; tempDeviceId++) {
if (sendMessage(message.clone(tempGroupId, tempDeviceId))) {
success = true;
}
}
}
}
return success;
}
if (groupId == WebSetting.BROADCAST_GROUP_ID) {
boolean success = false;
for (int tempGroupId = 1; tempGroupId <= DeviceSetting.MAX_GROUP_ID; tempGroupId++) {
if (tcpProcessor.tcpIsAvailable(tempGroupId) && sendMessage(message.clone(tempGroupId, deviceId))) {
success = true;
}
}
return success;
}
if (!tcpProcessor.tcpIsAvailable(groupId)) {
return false;
}
if (deviceId == WebSetting.BROADCAST_DEVICE_ID) {
boolean success = true;
for (int tempDeviceId = 1; tempDeviceId <= DeviceSetting.MAX_DEVICE_ID; tempDeviceId++) {
if (!sendMessage(message.clone(groupId, tempDeviceId))) {
success = false;
}
}
return success;
}
return sendMessage(message);
}
/**
* 添加关闭系统的钩子
*/
private void addJvmShutDownHook() {
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
logger.warn("开始关闭服务器");
tcpProcessor.shutDown();
try {
Thread.sleep(CommSetting.ACCESSIBLE_CHANNEL_REPLY_INTERVAL);
} catch (InterruptedException ignored) {
}
logger.warn("服务器优雅关闭成功");
}));
}
public void huntDeviceStatusMsg(MsgReplyDeviceStatus message) {
ProcessedMsgRepo.MSG_COUNT.incrementAndGet();
LinkedBlockingDeque<MsgReplyDeviceStatus> deque = msgProcessingRepository.touchMessageQueue(message.getGroupId());
if (deque == null) {
logger.warn("待处理的「状态消息」执行队列不存在,id:" + message.getGroupId());
return;
}
deque.offer(message);
}
/**
* 部署剩余充电次数
*
* @param device 处理后的 Device
*/
public void deployRemainChargeTimes(Device device) {
//当前充电状态为「充满」,并且剩余充电次数小于或等于阈值时,部署剩余充电次数
if (device.getChargeStatus() == ChargeStatus.FULL && device.getRemainChargeTime() <= CommSetting.DEPLOY_REMAIN_CHARGE_TIMES) {
int remainTimes = device.getRemainChargeTime();
remainTimes = remainTimes > 0 ? remainTimes : 0;
sendMessage(MsgCodecDeviceRemainChargeTimes.create(device.getGroupId(), device.getDeviceId(), remainTimes));
}
}
/**
* 根据条件对List中的Item进行过滤,返回状态异常消息或超时消息
*
* @param type 请求类型
* @return 指定的返回的消息集合
*/
public List<TcpFeedbackItem> getTcpFeedBackItems(TcpFeedBackRepository.ItemType type) {
return getTcpFeedBackRepository().getItems(type);
}
/**
* 根据条件对List中的Item进行过滤,返回状态异常消息或超时消息的数量
*
* @param type 请求类型
* @return 指定的返回的消息的数量
*/
public long getTcpFeedBackItemsCount(TcpFeedBackRepository.ItemType type) {
return getTcpFeedBackRepository().getItemsCount(type);
}
}
| [
"bitkylin@163.com"
] | bitkylin@163.com |
ee1c823b51238a3ffb09300a9f76c2a4f36caf54 | 87c616e8dbfd2b95393029245682535620ef0b45 | /Mage/src/main/java/mage/players/net/UserSkipPrioritySteps.java | 69ced125294847160c49d5fb89491275d1e45c64 | [] | no_license | PedroTav/mage | c625378af8d966b3c0852dfd66dcaf9171a33f23 | 2e551a971cb3fe71bf73e9b01766b1caf394ef10 | refs/heads/master | 2021-01-24T11:44:18.685749 | 2016-12-18T15:08:00 | 2016-12-18T15:08:00 | 70,226,202 | 1 | 2 | null | 2016-10-14T08:09:23 | 2016-10-07T07:55:50 | Java | UTF-8 | Java | false | false | 3,427 | java | /*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``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 BetaSteward_at_googlemail.com 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.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.players.net;
import java.io.Serializable;
/**
*
* @author LevelX2
*/
public class UserSkipPrioritySteps implements Serializable {
SkipPrioritySteps yourTurn;
SkipPrioritySteps opponentTurn;
boolean stopOnDeclareAttackersDuringSkipAction;
boolean stopOnDeclareBlockerIfNoneAvailable;
boolean stopOnAllMainPhases;
boolean stopOnAllEndPhases;
public UserSkipPrioritySteps() {
yourTurn = new SkipPrioritySteps();
opponentTurn = new SkipPrioritySteps();
}
public SkipPrioritySteps getYourTurn() {
return yourTurn;
}
public SkipPrioritySteps getOpponentTurn() {
return opponentTurn;
}
public boolean isStopOnDeclareBlockerIfNoneAvailable() {
return stopOnDeclareBlockerIfNoneAvailable;
}
public void setStopOnDeclareBlockerIfNoneAvailable(boolean stopOnDeclareBlockerIfNoneAvailable) {
this.stopOnDeclareBlockerIfNoneAvailable = stopOnDeclareBlockerIfNoneAvailable;
}
public boolean isStopOnDeclareAttackersDuringSkipAction() {
return stopOnDeclareAttackersDuringSkipAction;
}
public void setStopOnDeclareAttackersDuringSkipActions(boolean stopOnDeclareAttackersDuringSkipActions) {
this.stopOnDeclareAttackersDuringSkipAction = stopOnDeclareAttackersDuringSkipActions;
}
public boolean isStopOnAllMainPhases() {
return stopOnAllMainPhases;
}
public void setStopOnAllMainPhases(boolean stopOnAllMainPhases) {
this.stopOnAllMainPhases = stopOnAllMainPhases;
}
public boolean isStopOnAllEndPhases() {
return stopOnAllEndPhases;
}
public void setStopOnAllEndPhases(boolean stopOnAllEndPhases) {
this.stopOnAllEndPhases = stopOnAllEndPhases;
}
}
| [
"fenhl@fenhl.net"
] | fenhl@fenhl.net |
7d7e1b1c271065ac2400feb143b4087f6584a440 | f0568343ecd32379a6a2d598bda93fa419847584 | /modules/dfp_appengine/src/main/java/com/google/api/ads/dfp/jaxws/v201208/InventoryUnitSizesError.java | 8ac8ff585252246f7ae3076125c5e2e94961303c | [
"Apache-2.0"
] | permissive | frankzwang/googleads-java-lib | bd098b7b61622bd50352ccca815c4de15c45a545 | 0cf942d2558754589a12b4d9daa5902d7499e43f | refs/heads/master | 2021-01-20T23:20:53.380875 | 2014-07-02T19:14:30 | 2014-07-02T19:14:30 | 21,526,492 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java |
package com.google.api.ads.dfp.jaxws.v201208;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
*
* An error specifically for InventoryUnitSizes.
*
*
* <p>Java class for InventoryUnitSizesError complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="InventoryUnitSizesError">
* <complexContent>
* <extension base="{https://www.google.com/apis/ads/publisher/v201208}ApiError">
* <sequence>
* <element name="reason" type="{https://www.google.com/apis/ads/publisher/v201208}InventoryUnitSizesError.Reason" minOccurs="0"/>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "InventoryUnitSizesError", propOrder = {
"reason"
})
public class InventoryUnitSizesError
extends ApiError
{
protected InventoryUnitSizesErrorReason reason;
/**
* Gets the value of the reason property.
*
* @return
* possible object is
* {@link InventoryUnitSizesErrorReason }
*
*/
public InventoryUnitSizesErrorReason getReason() {
return reason;
}
/**
* Sets the value of the reason property.
*
* @param value
* allowed object is
* {@link InventoryUnitSizesErrorReason }
*
*/
public void setReason(InventoryUnitSizesErrorReason value) {
this.reason = value;
}
}
| [
"jradcliff@google.com"
] | jradcliff@google.com |
452bb127598dbd63e7675755eb945acc139a8c63 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_1198.java | d6df81be47d914d870da050acd515b2e70fcb41c | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 521 | java | /**
* Sets FILTER_BITMAP_FLAG flag to Paint. {@link android.graphics.Paint#FILTER_BITMAP_FLAG}<p>This should generally be on when drawing bitmaps, unless performance-bound (rendering to software canvas) or preferring pixelation artifacts to blurriness when scaling significantly.
* @param paintFilterBitmap whether to set FILTER_BITMAP_FLAG flag to Paint.
* @return modified instance
*/
public RoundingParams setPaintFilterBitmap(boolean paintFilterBitmap){
mPaintFilterBitmap=paintFilterBitmap;
return this;
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
bc4b42364d93599861c42d535ba47016c0447e5d | 1081e090fc5107cbdb1bebdef8dacba2d249ec86 | /gboss-gateway-hm-udp/.svn/pristine/7a/7a8282290a93440078b0d23f7f5bba78141b0f3e.svn-base | 4c16318254e13f90fb91bd0269c2e47b41f598e1 | [] | no_license | ysylmqq/segWorkspace | ec9c992ef74897a4078ebd456a605e94d93ac3a1 | 3f621fb57dd285e3a6549f34aa45f4ff1df7098a | refs/heads/master | 2021-05-10T08:27:59.458352 | 2018-01-26T00:39:31 | 2018-01-26T00:39:31 | 118,879,439 | 4 | 1 | null | null | null | null | GB18030 | Java | false | false | 3,414 | package cc.chinagps.gateway.unit.seg.upload.cmds;
import cc.chinagps.gateway.buff.CommandBuff;
import cc.chinagps.gateway.buff.CommandBuff.Command;
import cc.chinagps.gateway.buff.CommandBuff.CommandResponse.Builder;
import cc.chinagps.gateway.seat.cmd.CmdResponseUtil;
import cc.chinagps.gateway.seat.cmd.CmdUtil;
import cc.chinagps.gateway.seat.cmd.ServerToUnitCommand;
import cc.chinagps.gateway.unit.UnitSocketSession;
import cc.chinagps.gateway.unit.UnitServer;
import cc.chinagps.gateway.unit.seg.pkg.SegPackage;
import cc.chinagps.gateway.unit.seg.upload.SegUploadUtil;
import cc.chinagps.gateway.unit.seg.upload.beans.SegGPSInfo;
import cc.chinagps.gateway.unit.seg.util.SegPkgUtil;
/**
* 定时报告(需应答)
* 监听应答
* 设置监听电话号码应答
* 空重车变化上报(GPS)
*/
public class Cmd72 extends CheckLoginHandler{
@Override
public boolean handlerPackageSessionChecked(SegPackage pkg, UnitServer server,
UnitSocketSession session) throws Exception {
byte[] body = pkg.getBody();
String strBody = new String(body, SegPkgUtil.PKG_CHAR_ENCODING);
if(strBody.startsWith("(ITV")){
//定时报告(需应答)
SegGPSInfo gps = SegGPSInfo.parse(strBody, 4);
SegUploadUtil.handleGPS(pkg, server, session, gps);
//应答
SegPkgUtil.commonAckUnit((byte)0x72, session, pkg);
return true;
}else if(strBody.startsWith("(FNS,003,")){
//监听应答
String tel = strBody.substring(9, strBody.length() - 1);
String callLetter = session.getUnitInfo().getCallLetter();
String sn = CmdUtil.getCmdCacheSn(callLetter, CmdUtil.CMD_ID_MONITOR);
ServerToUnitCommand cache = server.getServerToUnitCommandCache().getAndRemoveCommand(sn);
if(cache != null) {
Command usercmd = cache.getUserCommand();
Builder builder = CommandBuff.CommandResponse.newBuilder();
//通用部分
CmdResponseUtil.updateResponseProtoSuccessByUserCommand(builder, callLetter, usercmd);
//params
builder.addParams(tel);
//byte[] data = builder.build().toByteArray();
CmdResponseUtil.simpleCommandResponse(cache, builder);
}
return true;
}else if(strBody.startsWith("(FNS,033,")){
//设置监听电话号码应答
handlerSetMonitorTelAck(pkg, server, session, strBody);
return true;
}else if(strBody.startsWith("(LDR")){
//空重车变化上报
SegGPSInfo gps = SegGPSInfo.parse(strBody, 4);
SegUploadUtil.handleGPS(pkg, server, session, gps);
return true;
}
return false;
}
/**
* 设置监听电话号码应答
*/
public static void handlerSetMonitorTelAck(SegPackage pkg, UnitServer server,
UnitSocketSession session, String strBody){
String callLetter = session.getUnitInfo().getCallLetter();
String sn = CmdUtil.getCmdCacheSn(callLetter, CmdUtil.CMD_ID_SET_MONITOR_TEL);
ServerToUnitCommand cache = server.getServerToUnitCommandCache().getAndRemoveCommand(sn);
if(cache != null) {
Command usercmd = cache.getUserCommand();
Builder builder = CommandBuff.CommandResponse.newBuilder();
//通用部分
CmdResponseUtil.updateResponseProtoSuccessByUserCommand(builder, callLetter, usercmd);
//params
String[] calls = strBody.substring(9, strBody.length() - 1).split(",");
for(String call: calls){
builder.addParams(call);
}
//byte[] data = builder.build().toByteArray();
CmdResponseUtil.simpleCommandResponse(cache, builder);
}
}
} | [
"2268617174@qq.com"
] | 2268617174@qq.com | |
fa1c0403dcf14231bc08601dbcc463472539033a | 92c1674aacda6c550402a52a96281ff17cfe5cff | /module22/module09/module05/src/main/java/com/android/example/module22_module09_module05/ClassAAB.java | 204cde7143bdfa777b761d745a1b89cbd3aa3b6f | [] | no_license | bingranl/android-benchmark-project | 2815c926df6a377895bd02ad894455c8b8c6d4d5 | 28738e2a94406bd212c5f74a79179424dd72722a | refs/heads/main | 2023-03-18T20:29:59.335650 | 2021-03-12T11:47:03 | 2021-03-12T11:47:03 | 336,009,838 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,910 | java | package com.android.example.module22_module09_module05;
public class ClassAAB {
private com.android.example.module06_module262_module4.ClassAAD instance_var_1_0 = new com.android.example.module06_module262_module4.ClassAAD();
private com.android.example.module22_module09_module01.ClassAAE instance_var_1_1 = new com.android.example.module22_module09_module01.ClassAAE();
public void method0(
com.android.example.module22_module09_module01.ClassAAH param0,
com.android.example.module07_module77_module4.ClassAAA param1,
com.android.example.module07_module59_module16_module2.ClassAAD param2,
com.android.example.module07_module13_module3.ClassAAI param3) throws Throwable {
java.util.Collections.emptyList().forEach( lambda0 -> {
try {
for (int iAb = 0; iAb < 5; iAb++) {
if (new java.lang.Object().equals(new java.lang.Object())) {
com.android.example.module15_module02_module1.ClassAAA local_var_5_0 = new com.android.example.module15_module02_module1.ClassAAA();
local_var_5_0.method1(new com.android.example.module15_module01_module1.ClassAAG(), new com.android.example.module15_module53_module1.ClassAAI());
} else {
com.android.example.module07_module83.ClassAAH local_var_5_0 = new com.android.example.module07_module83.ClassAAH();
local_var_5_0.method3(new com.android.example.module05_module08_module2.ClassAAI());
}
com.android.example.module05_module01_module08_module2.ClassAAH local_var_4_0 = new com.android.example.module05_module01_module08_module2.ClassAAH();
local_var_4_0.method1(new com.android.example.module06_module156_module3.ClassAAJ(), new com.android.example.module06_module295_module6.ClassAAD(), new com.android.example.module06_module161_module3.ClassAAJ(), new com.android.example.module05_module01_module04_module4.ClassAAJ());
local_var_4_0.method2(new com.android.example.module05_module01_module08_module1.ClassAAC(), new com.android.example.module05_module01_module04_module4.ClassAAD());
local_var_4_0.method1(new com.android.example.module06_module156_module3.ClassAAJ(), new com.android.example.module06_module295_module6.ClassAAD(), new com.android.example.module06_module161_module3.ClassAAJ(), new com.android.example.module05_module01_module04_module4.ClassAAJ());
}
com.android.example.module06_module129_module2.ClassAAA local_var_3_0 = new com.android.example.module06_module129_module2.ClassAAA();
local_var_3_0.method0(new com.android.example.module06_module129_module5.ClassAAF());
} catch(Throwable e) { } // ignore
});
com.android.example.module04_module21_module3.ClassAAB local_var_2_4 = new com.android.example.module04_module21_module3.ClassAAB();
local_var_2_4.method4("SomeString", "SomeString", "SomeString");
com.android.example.module15_module07_module1.ClassAAI local_var_2_5 = new com.android.example.module15_module07_module1.ClassAAI();
local_var_2_5.method1(new com.android.example.module15_module21_module1.ClassAAC(), new com.android.example.module15_module21_module1.ClassAAB(), new com.android.example.module15_module21_module1.ClassAAC());
param0.method4(new com.android.example.module06_module243.ClassAAB(), new com.android.example.module06_module243.ClassAAJ(), new com.android.example.module06_module243.ClassAAH());
}
public void method1(
com.android.example.module06_module262_module4.ClassAAA param0) throws Throwable {
com.android.example.module06_module341_module1.ClassAAH local_var_2_1 = new com.android.example.module06_module341_module1.ClassAAH();
local_var_2_1.method2(new com.android.example.module06_module341_module2.ClassAAH(), new com.android.example.module06_module341_module2.ClassAAH());
com.android.example.module06_module047_module4.ClassAAB local_var_2_2 = new com.android.example.module06_module047_module4.ClassAAB();
local_var_2_2.method1(new com.android.example.module06_module046_module5.ClassAAJ(), new com.android.example.module06_module046_module5.ClassAAI());
com.android.example.module06_module140_module7.ClassAAA local_var_2_3 = new com.android.example.module06_module140_module7.ClassAAA();
local_var_2_3.method1(new com.android.example.module06_module198_module1.ClassAAG());
}
public void method2(
com.android.example.module07_module59_module16_module2.ClassAAE param0,
com.android.example.module06_module104.ClassAAI param1) throws Throwable {
com.android.example.module06_module020_module5.ClassAAI local_var_2_2 = new com.android.example.module06_module020_module5.ClassAAI();
local_var_2_2.method4(new com.android.example.module15_module53_module1.ClassAAI());
com.android.example.module06_module269_module3.ClassAAD local_var_2_3 = new com.android.example.module06_module269_module3.ClassAAD();
local_var_2_3.method1(new com.android.example.module06_module295_module6.ClassAAC(), new com.android.example.module06_module269_module4.ClassAAH());
}
public void method3(
com.android.example.module22_module01_module20_module1.ClassAAJ param0,
com.android.example.module06_module252.ClassAAI param1,
com.android.example.module07_module31_module2.ClassAAG param2) throws Throwable {
com.android.example.module06_module016_module1.ClassAAA local_var_2_3 = new com.android.example.module06_module016_module1.ClassAAA();
local_var_2_3.method1(new com.android.example.module06_module016_module5.ClassAAG(), new com.android.example.module06_module016_module5.ClassAAD(), new com.android.example.module06_module016_module5.ClassAAI(), new com.android.example.module06_module016_module5.ClassAAG());
param0.method3("SomeString", "SomeString", "SomeString", "SomeString");
com.android.example.module06_module201_module1.ClassAAD local_var_2_4 = new com.android.example.module06_module201_module1.ClassAAD();
local_var_2_4.method0(new io.reactivex.subscribers.TestSubscriber(), new io.reactivex.subscribers.TestSubscriber());
}
}
| [
"bingran@google.com"
] | bingran@google.com |
a3e84cddd16cd333ec201a0d9f1b70d9762ecab3 | bbc265db09b3f315825f22decd958a565fcd8d26 | /src/com/mayhem/rs2/entity/player/net/out/impl/SendTurnCamera.java | 404b9691f148d2cd50145807a1af891dfe938dc4 | [] | no_license | jlabranche/SSL2019 | b175421822d2dc11abaad9f497441ba4ed546cb3 | 6c04fe16fa36ecdcf665b7527f9e0694f55b8fc2 | refs/heads/master | 2020-09-09T20:34:51.222139 | 2020-02-20T00:41:23 | 2020-02-20T00:41:23 | 221,561,429 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,761 | java | package com.mayhem.rs2.entity.player.net.out.impl;
import com.mayhem.core.network.StreamBuffer;
import com.mayhem.rs2.entity.player.net.Client;
import com.mayhem.rs2.entity.player.net.out.OutgoingPacket;
public class SendTurnCamera extends OutgoingPacket {
private final int x;
private final int y;
private final int z;
private final int constantSpeed;
private final int variableSpeed;
/**
* Gradually turns the camera to look at a specified location;
*
* @param location
* The new camera location.
* @param zPos
* The new cameraHeight, in positions.
* @param constantSpeed
* The constant linear camera movement speed as angular units per
* cycle. In the XY angle there are 2048 units in 360 degrees. In
* the Z angle is restricted between 128 and 383, which are the
* min and max ZAngle.
* @param variableSpeed
* The variable linear camera movement speed as promile of what's
* left. Max 99, 100 is instant.
* @return The action sender instance, for chaining.
*/
public SendTurnCamera(int x, int y, int z, int constantSpeed,
int variableSpeed) {
super();
this.x = x / 64;
this.y = y / 64;
this.z = z;
this.constantSpeed = constantSpeed;
this.variableSpeed = variableSpeed;
}
@Override
public void execute(Client client) {
StreamBuffer.OutBuffer out = StreamBuffer.newOutBuffer(7);
out.writeHeader(client.getEncryptor(), 177);
out.writeByte(x);
out.writeByte(y);
out.writeShort(z);
out.writeByte(constantSpeed);
out.writeByte(variableSpeed);
client.send(out.getBuffer());
}
@Override
public int getOpcode() {
return 177;
}
}
| [
"jean.labranche@endurance.com"
] | jean.labranche@endurance.com |
7b36fa1187b90e2cacb4c1913cd7e7a700aafba5 | 6d82f06048d330216b17c19790f29075e62e47d5 | /snapshot/central/laboratory/examples/mutuals/mutuals-pico/src/java/org/apache/avalon/mutuals/PicoMain.java | ed912d90d0a4232ead918a2ffb2dc988a8e38b47 | [] | no_license | IdelsTak/dpml-svn | 7d1fc3f1ff56ef2f45ca5f7f3ae88b1ace459b79 | 9f9bdcf0198566ddcee7befac4a3b2c693631df5 | refs/heads/master | 2022-03-19T15:50:45.872930 | 2009-11-23T08:45:39 | 2009-11-23T08:45:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,666 | java | package org.apache.avalon.mutuals;
/*
* Copyright 2004 Apache Software Foundation
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.*;
import org.apache.avalon.mutuals.model.*;
import org.apache.avalon.mutuals.dao.*;
import org.apache.avalon.mutuals.dao.impl.*;
import org.apache.avalon.mutuals.dao.lifecycle.LoggingDao;
import org.picocontainer.defaults.DefaultPicoContainer;
import org.apache.commons.logging.impl.SimpleLog;
import org.picocontainer.PicoContainer;
import org.apache.commons.logging.Log;
public class PicoMain
{
public PicoContainer m_container;
public Log m_log;
public static void main( String[] args )
{
SimpleLog log = new SimpleLog("pico");
PicoMain m = new PicoMain();
Map users = m.createUsers();
Map funds = m.createFunds();
Map portfolios = m.createPortfolios();
Map balances = m.createBalances();
PicoUserManager userManager = new PicoUserManager(users);
PicoFundManager fundManager = new PicoFundManager(funds);
PicoPortfolioManager portfolioManager = new PicoPortfolioManager(portfolios,balances);
DefaultPicoContainer container = new DefaultPicoContainer();
container.registerComponentInstance("userManager",userManager);
container.registerComponentInstance("fundManager",fundManager);
container.registerComponentInstance("portfolioManager",portfolioManager);
container.registerComponentImplementation("transactionManager",PicoTransactionManager.class);
LoggingDao dao = (LoggingDao) container.getComponentMulticaster();
dao.enableLogging(log);
m.m_container = container;
m.m_log = log;
m.performTransactions();
}
public void performTransactions() {
try {
m_log.info("Logging in as users farra ");
UserManager userManager = (UserManager) getComponent("userManager");
User farra = userManager.login("farra","farra");
if(farra != null){
m_log.info("Successful login");
m_log.info("User Information:");
m_log.info(" User ID: "+farra.getId());
m_log.info(" User Name: "+farra.getName());
}
else{
m_log.warn("Did not properly log in");
}
PortfolioManager portfolioManager = (PortfolioManager) getComponent("portfolioManager");
double balance = portfolioManager.getAccountBalance(farra);
m_log.info(" User Balance: $"+balance);
m_log.info("Depositing $100.00 into account");
portfolioManager.adjustAccountBalance(farra,100.00);
balance = portfolioManager.getAccountBalance(farra);
m_log.info("Balance is now: $"+balance);
m_log.info("User Portfolio:");
List funds = portfolioManager.getPortfolio(farra);
for(int i=0; i < funds.size(); i++){
Fund fund = (Fund) funds.get(i);
m_log.info(" "+fund.getSymbol()+" "+fund.getName()+" $"+fund.getPrice()+" "+fund.getQty());
}
m_log.info("Selling 10 shares of MOON");
FundManager fundManager = (FundManager) getComponent("fundManager");
TransactionManager transactionManager = (TransactionManager) getComponent("transactionManager");
Fund moon = fundManager.getFund("MOON");
transactionManager.sell(farra,moon,10);
balance = portfolioManager.getAccountBalance(farra);
m_log.info("Balance is now: $"+balance);
m_log.info("User Portfolio:");
funds = portfolioManager.getPortfolio(farra);
for(int i=0; i < funds.size(); i++){
Fund fund = (Fund) funds.get(i);
m_log.info(" "+fund.getSymbol()+" "+fund.getName()+" $"+fund.getPrice()+" "+fund.getQty());
}
}
catch (Exception ex) {
m_log.error("Exception occurred during transaction test",ex);
}
}
public Object getComponent(String name) throws Exception{
return m_container.getComponentInstance(name);
}
public Map createUsers(){
HashMap users = new HashMap();
User me = new User();
me.setId("farra");
me.setName("Aaron Farr");
me.setPassword("farra");
User you = new User();
you.setId("lsd");
you.setName("Leo Simons");
you.setPassword("lsd");
users.put(me.getId(),me);
users.put(you.getId(),you);
return users;
}
public Map createFunds(){
HashMap funds = new HashMap();
Fund moon = new Fund();
moon.setSymbol("MOON");
moon.setName("Moon Microsystems");
moon.setPrice(5.39);
Fund ibn = new Fund();
ibn.setSymbol("IBN");
ibn.setName("International Business gNomes");
ibn.setPrice(95.32);
Fund ms = new Fund();
ms.setSymbol("MNFT");
ms.setName("Minisoft");
ms.setPrice(27.81);
funds.put(moon.getSymbol(),moon);
funds.put(ibn.getSymbol(),ibn);
funds.put(ms.getSymbol(),ms);
return funds;
}
public Map createBalances(){
HashMap balances = new HashMap();
balances.put("farra",new Double(1000.00));
balances.put("leo",new Double(5000.00));
return balances;
}
public Map createPortfolios(){
HashMap portfolios = new HashMap();
Fund moon = new Fund();
moon.setSymbol("MOON");
moon.setName("Moon Microsystems");
moon.setPrice(5.39);
moon.setQty(100);
Fund ibn1 = new Fund();
ibn1.setSymbol("IBN");
ibn1.setName("International Business gNomes");
ibn1.setPrice(95.32);
ibn1.setQty(10);
Fund ibn2 = new Fund();
ibn2.setSymbol("IBN");
ibn2.setName("International Business gNomes");
ibn2.setPrice(95.32);
ibn2.setQty(30);
Fund ms = new Fund();
ms.setSymbol("MNFT");
ms.setName("Minisoft");
ms.setPrice(27.81);
ms.setQty(25);
ArrayList port1 = new ArrayList();
port1.add(moon);
port1.add(ibn1);
ArrayList port2 = new ArrayList();
port2.add(ibn2);
port2.add(ms);
portfolios.put("farra",port1);
portfolios.put("leo",port2);
return portfolios;
}
}
| [
"niclas@00579e91-1ffa-0310-aa18-b241b61564ef"
] | niclas@00579e91-1ffa-0310-aa18-b241b61564ef |
decbc57e46e445c26126bca5a6cdc6e63e414c10 | d4aba85df60dae4547c2235af0b8df945f2f1be1 | /lingshi/src/lingshi/getway/token/service/TokenPoolBase.java | 65bd7a5bb54f2d01b566f39505f2de28c87f9c87 | [] | no_license | MyAuntIsPost90s/lingshiframework | 87e27a9e7d518a38a19cbe6c016929ec41901ed5 | acd3ad89cd23c6791f468137cf88726ad7f163ab | refs/heads/master | 2021-05-08T10:12:25.764656 | 2018-06-18T14:52:08 | 2018-06-18T14:52:08 | 119,833,482 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 627 | java | package lingshi.getway.token.service;
import lingshi.getway.token.model.TokenBase;
/**
* 抽象Token池
*
* @author caich
*
*/
public abstract class TokenPoolBase {
/**
* 通过Token获取tokenBase对象
*
* @param token
* @return
*/
public abstract TokenBase get(String token);
/**
* 插入
*
* @param baseToken
*/
public abstract void add(TokenBase baseToken);
/**
* 修改
*
* @param baseToken
*/
public abstract void update(TokenBase baseToken);
/**
* 移除
*
* @param token
*/
public abstract void delete(String token);
}
| [
"1126670571@qq.com"
] | 1126670571@qq.com |
3a41ee05b9f556def109ce34a5fafd8531b1ee75 | 2869fc39e2e63d994d5dd8876476e473cb8d3986 | /Super_passport/src/java/com/lvmama/eplace/web/lvmama/supplyUser/EplacePortUserAddJumpAction.java | b5a17b1cc7c33c20cb3f816e88e60277bb4d060b | [] | no_license | kavt/feiniu_pet | bec739de7c4e2ee896de50962dbd5fb6f1e28fe9 | 82963e2e87611442d9b338d96e0343f67262f437 | refs/heads/master | 2020-12-25T17:45:16.166052 | 2016-06-13T10:02:42 | 2016-06-13T10:02:42 | 61,026,061 | 0 | 0 | null | 2016-06-13T10:02:01 | 2016-06-13T10:02:01 | null | UTF-8 | Java | false | false | 2,127 | java | package com.lvmama.eplace.web.lvmama.supplyUser;
import java.util.List;
import com.lvmama.ZkBaseAction;
import com.lvmama.comm.bee.po.pass.PassPortUser;
import com.lvmama.comm.bee.service.eplace.EPlaceService;
import com.lvmama.comm.utils.StringUtil;
/**
* 通关平台用户增加.
*
* @author huangli
*
*/
@SuppressWarnings("unchecked")
public class EplacePortUserAddJumpAction extends ZkBaseAction {
/**
* 通关平台用户操作服务.
*/
private EPlaceService eplaceService;
/**
* 供应商查询.
*/
private PassPortUser passPortUser=new PassPortUser();
/**
* 用户类型.
*/
private String userType = "";
/**
* 供应商编号.
*/
private String supplierId;
/**
* 供应商编号.
*/
private String eplaceSupplierId;
/**
* 供应商查询.
*/
private List<PassPortUser> passPortUserList;
public void doBefore() {
if (!StringUtil.isEmptyString(eplaceSupplierId)) {
param.put("_startRow",0);
param.put("_endRow",50);
param.put("eplaceSupplierId",eplaceSupplierId);
passPortUserList = this.eplaceService.findPassPortUserByMap(param);
}
}
public void setEplaceService(EPlaceService eplaceService) {
this.eplaceService = eplaceService;
}
public PassPortUser getPassPortUser() {
return passPortUser;
}
public void setPassPortUser(PassPortUser passPortUser) {
this.passPortUser = passPortUser;
}
public String getUserType() {
return userType;
}
public void setUserType(String userType) {
this.userType = userType;
}
public String getSupplierId() {
return supplierId;
}
public void setSupplierId(String supplierId) {
this.supplierId = supplierId;
}
public List<PassPortUser> getPassPortUserList() {
return passPortUserList;
}
public void setPassPortUserList(List<PassPortUser> passPortUserList) {
this.passPortUserList = passPortUserList;
}
public String getEplaceSupplierId() {
return eplaceSupplierId;
}
public void setEplaceSupplierId(String eplaceSupplierId) {
this.eplaceSupplierId = eplaceSupplierId;
}
}
| [
"feiniu7903@163.com"
] | feiniu7903@163.com |
e8ef54fd33ce45ad6e122e891c445e3731d3d460 | 8d7ed82c4239f5bd2228465df5558c64c1c82b12 | /GitHub/onvif/src/org/onvif/ver10/schema/SearchScopeExtension.java | f82b60d6664e9d1013d48357fb8ce3a633a69212 | [] | no_license | RinatB2017/Java_projects | 401c45a6f494ad5cd542689a95d020f5ca68cd16 | 0709fea35029b483919499ba2683365d7d446655 | refs/heads/master | 2023-06-08T03:54:55.329766 | 2023-05-30T09:27:39 | 2023-05-30T09:27:39 | 101,397,023 | 0 | 0 | null | 2021-06-07T17:26:13 | 2017-08-25T11:21:38 | Java | UTF-8 | Java | false | false | 1,875 | java |
package org.onvif.ver10.schema;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
/**
* <p>Java class for SearchScopeExtension complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="SearchScopeExtension">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <any processContents='lax' maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SearchScopeExtension", propOrder = {
"any"
})
public class SearchScopeExtension {
@XmlAnyElement(lax = true)
protected List<java.lang.Object> any;
/**
* Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link java.lang.Object }
* {@link Element }
*
*
*/
public List<java.lang.Object> getAny() {
if (any == null) {
any = new ArrayList<java.lang.Object>();
}
return this.any;
}
}
| [
"tux4096@gmail.com"
] | tux4096@gmail.com |
1bb6f49aa66fcaa7a7564192fc6316808fb6ab01 | 70daf318d027f371ada3abeaaa31dd47651640d7 | /src/jdo/sys/CRMInfo.java | 479316d8941689a8c36cee2be34102bd7ac0f97c | [] | no_license | wangqing123654/web | 00613f6db653562e2e8edc14327649dc18b2aae6 | bd447877400291d3f35715ca9c7c7b1e79653531 | refs/heads/master | 2023-04-07T15:23:34.705954 | 2020-11-02T10:10:57 | 2020-11-02T10:10:57 | 309,329,277 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 3,339 | java | package jdo.sys;
public class CRMInfo {
public CRMInfo(){
}
/**
* 病案号 MR_NO
*/
private String mrNo = "";
/**
* 姓名 PAT_NAME
*/
private String name = "";
public String getMrNo() {
return mrNo;
}
public void setMrNo(String mrNo) {
this.mrNo = mrNo;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValidType() {
return validType;
}
public void setValidType(String validType) {
this.validType = validType;
}
public String getValidNumber() {
return validNumber;
}
public void setValidNumber(String validNumber) {
this.validNumber = validNumber;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getNationality() {
return nationality;
}
public void setNationality(String nationality) {
this.nationality = nationality;
}
public String getNation() {
return nation;
}
public void setNation(String nation) {
this.nation = nation;
}
public String getMarital() {
return marital;
}
public void setMarital(String marital) {
this.marital = marital;
}
public String getResidAddress() {
return residAddress;
}
public void setResidAddress(String residAddress) {
this.residAddress = residAddress;
}
public String getResidAddressEx() {
return residAddressEx;
}
public void setResidAddressEx(String residAddressEx) {
this.residAddressEx = residAddressEx;
}
public String getPresentAddress() {
return presentAddress;
}
public void setPresentAddress(String presentAddress) {
this.presentAddress = presentAddress;
}
public String getPresentAddressEx() {
return presentAddressEx;
}
public void setPresentAddressEx(String presentAddressEx) {
this.presentAddressEx = presentAddressEx;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
/**
* 证件类型ID_TYPE
*/
private String validType = "";
/**
* 身份证号 IDNO
*/
private String validNumber = "";
/**
* 性别 SEX_CODE
*/
private String sex = "";
/**
* 出生日期 BIRTH_DATE
*/
private String birthday = "";
/**
* 国籍 NATION_CODE
*/
private String nationality = "";
/**
* 民族SPECIES_CODE
*/
private String nation = "";
/**
*婚姻MARRIAGE_CODE
*/
private String marital = "";
/**
* 户籍地址RESID_POST_CODE
*/
private String residAddress = "";
/**
* 详细地址RESID_ADDRESS
*/
private String residAddressEx = "";
/**
* 现住址POST_CODE
*/
private String presentAddress = "";
/**
* 现详细地址CURRENT_ADDRESS
*/
private String presentAddressEx = "";
/**
* 备注REMARKS
*/
private String remarks = "";
/**
* 联系方式TEL_HOME
*/
private String phone = "";
private String id="";
}
| [
"1638364772@qq.com"
] | 1638364772@qq.com |
aeb8d0bc951dee3eac97b603c7c6240104e7b0af | 64f787fe31229ac091ab84c302aed3a25d25e061 | /demo1/src/main/java/com/example/demo/authorizationTest.java | dfc560bb0914f0ffe0650a31d949732ee23bdd3c | [] | no_license | ytcer/BMWSME | 63a0204a817c9f7dba729e1f4a55e9c4ea9035bd | 5be9e2d12dc7df1ac3190b2796e68be113adbec5 | refs/heads/main | 2023-01-27T18:00:53.286522 | 2020-12-10T09:48:51 | 2020-12-10T09:48:51 | 314,269,595 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,346 | java | package com.example.demo;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.authz.SimpleAuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.springframework.web.bind.annotation.RestController;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
public class authorizationTest extends AuthorizingRealm {
HashSet<String> getPermissionsByUsers(String username){
HashSet<String> permissions = new HashSet<>();
permissions.add("user:add");
return permissions;
}
HashSet<String> getRolesByUser(String username){
HashSet<String> roles = new HashSet<>();
roles.add("admin");
return roles;
}
String getPasswordbyUsername(String Username){
return objectObjectHashMap.get(Username);
}
HashMap<String, String> objectObjectHashMap = new HashMap<>();
{
objectObjectHashMap.put("admin", "123456");
super.setName("myauthoriaztion");
}
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
String username = (String )principalCollection.getPrimaryPrincipal();
SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();
Set<String> admin = getPermissionsByUsers(username);
HashSet<String> rolesByUser = getRolesByUser(username);
simpleAuthorizationInfo.setRoles(rolesByUser);
simpleAuthorizationInfo.setStringPermissions(admin);
return simpleAuthorizationInfo;
}
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
String username = (String) authenticationToken.getPrincipal();
String passwordbyUsername = getPasswordbyUsername(username);
SimpleAuthenticationInfo simpleAuthorizationInfo = new SimpleAuthenticationInfo("admin", passwordbyUsername,"myauthentication");
return simpleAuthorizationInfo;
}
}
| [
"123"
] | 123 |
00ad45396057fd3be64aa303cb3c2a9930106823 | 130179d1b47e89efb82c0d0e691b113397270e07 | /app/src/main/java/com/six/qb/activitys/JxResultactivity.java | fcf108357df8b3208c058061482410a686179211 | [] | no_license | DavyJohn/Qb | a251218f7c89f4c003293f6570ea6065f7cdeb9e | b7338a330e3c6f6dd1104e2ec9e9d01d93386e8c | refs/heads/master | 2021-01-11T14:10:09.222899 | 2017-06-21T09:32:43 | 2017-06-21T09:32:43 | 94,987,445 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,509 | java | package com.six.qb.activitys;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.saint.netlibrary.ApiWrapper;
import com.saint.netlibrary.model.WqGoods;
import com.six.qb.BaseActivity;
import com.six.qb.R;
import com.six.qb.fragments.all.activity.AllRecordActivity;
import com.six.qb.utils.AppManager;
import com.six.qb.utils.ConstantUtil;
import com.six.qb.utils.DateUtil;
import com.squareup.picasso.Picasso;
import butterknife.BindView;
import butterknife.OnClick;
import rx.Subscription;
import rx.functions.Action1;
/**
* Created by 志浩 on 2016/8/19.
*/
public class JxResultactivity extends BaseActivity {
private String url,id;
@BindView(R.id.results_bar)
Toolbar mToolbar;
@BindView(R.id.result_shop_image)
ImageView goodsView;
@BindView(R.id.results_user_image)
ImageView view;
@BindView(R.id.results_username)
TextView mOwn;
@BindView(R.id.results_user_address)
TextView mOwnAddress;
@BindView(R.id.results_time)
TextView mTextEndTime;
@BindView(R.id.results_qb_time)
TextView mTextTime;
@BindView(R.id.qb_code)
TextView mTextCode;
@BindView(R.id.qb_time2)
TextView mTextTime2;
@BindView(R.id.qb_code2)
TextView mTextCode2;
@BindView(R.id.qiangbao_renshu)
TextView mTextNum;
@BindView(R.id.btn_results)
Button btn3;
@OnClick(R.id.btn_results) void back(){
Intent intent = new Intent(this,ShopDetialActivity.class);
intent.putExtra("shop_id",id);
startActivity(intent);
finish();
}
@OnClick(R.id.all_qbju) void click(){
//id
Intent intent = new Intent(this, AllRecordActivity.class);
intent.putExtra("goods_id",id);
startActivity(intent);
}
@OnClick(R.id.shop_car) void cart(){
MainActivity.showFragment(3);
MainActivity.bottomNavigation.setCurrentItem(3);
finish();
}
Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
switch (msg.what) {
case 0:
shopUrl(url);
break;
}
}
};
Thread thread = new Thread() {
@Override
public void run() {
Message message = new Message();
message.what = 0;
handler.sendMessage(message);
}
};
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.results_revealed_main_layout);
AppManager.getAppManager().addActivity(mContext);
toolbar();
url = getIntent().getStringExtra("url");
}
private void toolbar(){
mToolbar.setTitle("");
setSupportActionBar(mToolbar);
mToolbar.setNavigationIcon(R.drawable.left_icon);
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void shopUrl(String url) {
final ApiWrapper wrapper = new ApiWrapper();
Subscription subscription = wrapper.shopUrl(url)
.subscribe(newSubscriber(new Action1<WqGoods>() {
@Override
public void call(WqGoods shopDetails) {
id = shopDetails.getItem().id;
Picasso.with(getApplicationContext()).load(ConstantUtil.IMAGE_HEAD + shopDetails.getItem().thumb).into(goodsView);
Picasso.with(getApplicationContext()).load(ConstantUtil.IMAGE_HEAD+shopDetails.getGorecode().getUphoto()).into(view);
mOwn.setText(shopDetails.getGorecode().getUsername());
mOwnAddress.setText(shopDetails.getGorecode().getIp());
double endtime =Double.parseDouble(shopDetails.getItem().q_end_time);
double startime = Double.parseDouble(shopDetails.getItem().time);
String start = DateUtil.formatData("yyyy-MM-dd HH:mm:ss",startime);
String resule = DateUtil.formatData("yyyy-MM-dd HH:mm:ss",endtime);
mTextEndTime.setText(resule);
mTextTime.setText(start);
mTextCode.setText("("+shopDetails.getGorecode().getShopqishu()+")"+"幸运抢宝码:"+shopDetails.getGorecode().getHuode());
mTextNum.setText("商品获得者本期总共抢宝"+shopDetails.getGorecode().getGonumber()+"次");
mTextTime2.setText(shopDetails.getGorecode().getTime());
mTextCode2.setText(shopDetails.getGorecode().getGoucode());
btn3.setText(shopDetails.getLoopqishu().get(0).title+"正在进行...");
}
}));
mCompositeSubscription.add(subscription);
}
@Override
protected void onStart() {
super.onStart();
thread.run();
}
@Override
protected void onDestroy() {
super.onDestroy();
handler.removeCallbacksAndMessages(null);
}
}
| [
"1139099003@qq.com"
] | 1139099003@qq.com |
5c755c8896c519a26b61cdc2a0e595ce7bfad9b7 | 0735d7bb62b6cfb538985a278b77917685de3526 | /io/reactivex/observers/ResourceCompletableObserver.java | d2d72ea1c80d6ec38f0a2d27ae84d7b6d68dc188 | [] | no_license | Denoah/personaltrackerround | e18ceaad910f1393f2dd9f21e9055148cda57837 | b38493ccc7efff32c3de8fe61704e767e5ac62b7 | refs/heads/master | 2021-05-20T03:34:17.333532 | 2020-04-02T14:47:31 | 2020-04-02T14:51:01 | 252,166,069 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,339 | java | package io.reactivex.observers;
import io.reactivex.CompletableObserver;
import io.reactivex.disposables.Disposable;
import io.reactivex.internal.disposables.DisposableHelper;
import io.reactivex.internal.disposables.ListCompositeDisposable;
import io.reactivex.internal.functions.ObjectHelper;
import io.reactivex.internal.util.EndConsumerHelper;
import java.util.concurrent.atomic.AtomicReference;
public abstract class ResourceCompletableObserver
implements CompletableObserver, Disposable
{
private final ListCompositeDisposable resources = new ListCompositeDisposable();
private final AtomicReference<Disposable> upstream = new AtomicReference();
public ResourceCompletableObserver() {}
public final void add(Disposable paramDisposable)
{
ObjectHelper.requireNonNull(paramDisposable, "resource is null");
this.resources.add(paramDisposable);
}
public final void dispose()
{
if (DisposableHelper.dispose(this.upstream)) {
this.resources.dispose();
}
}
public final boolean isDisposed()
{
return DisposableHelper.isDisposed((Disposable)this.upstream.get());
}
protected void onStart() {}
public final void onSubscribe(Disposable paramDisposable)
{
if (EndConsumerHelper.setOnce(this.upstream, paramDisposable, getClass())) {
onStart();
}
}
}
| [
"ivanov.a@i-teco.ru"
] | ivanov.a@i-teco.ru |
ab1b69a8f7a5c61f06761a52d6d550eee67a37c0 | c97e56521b9212bc5fbc3001ef335c4567a4c8d3 | /src/com/perl5/lang/perl/parser/moose/psi/impl/PerlMooseInnerKeywordImpl.java | 970fc9fd8cdbd218095b96cc901c59d9622735c8 | [
"Apache-2.0"
] | permissive | ajinkyakulkarni/Perl5-IDEA | 80fd4a1a1e7eedcc7d29f0179e98f999ebd0ab15 | 72e5f6f7c3f62b4ad6c92f4b1cde322b467687c4 | refs/heads/master | 2020-07-19T13:36:44.128001 | 2016-10-15T11:57:29 | 2016-10-15T11:57:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,408 | java | /*
* Copyright 2016 Alexandr Evstigneev
*
* 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.perl5.lang.perl.parser.moose.psi.impl;
import com.intellij.psi.PsiReference;
import com.intellij.psi.tree.IElementType;
import com.perl5.lang.perl.parser.moose.psi.PerlMooseInnerKeyword;
import com.perl5.lang.perl.parser.moose.psi.references.PerlMooseInnerReference;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* Created by hurricup on 19.01.2016.
*/
public class PerlMooseInnerKeywordImpl extends PerlMooseKeywordSubNameElementImpl implements PerlMooseInnerKeyword
{
public PerlMooseInnerKeywordImpl(@NotNull IElementType type, CharSequence text)
{
super(type, text);
}
@Override
public void computeReferences(List<PsiReference> psiReferences)
{
psiReferences.add(new PerlMooseInnerReference(this, null));
super.computeReferences(psiReferences);
}
}
| [
"hurricup@gmail.com"
] | hurricup@gmail.com |
81335e4a68364bc59c70cfcf5700092873e31f58 | e034eadd636b4a43f6c7b97627af7d718dec58ff | /ngpm/com.sap.trex.client/src/com/sap/trex/client/Connection.java | 4e32d1f1b7eeb014d89bf8c71329dc9641e04ca7 | [] | no_license | FURCAS-dev/FURCAS | ed89b3152a56466fee04285fa02b09d3124adf8f | 1f5651283f45666792b4747c5ce97128807761f1 | refs/heads/master | 2020-06-03T21:46:35.150521 | 2017-08-09T10:20:45 | 2017-08-09T10:20:45 | 1,083,639 | 2 | 3 | null | null | null | null | UTF-8 | Java | false | false | 424 | java | package com.sap.trex.client;
public class Connection {
private ConnectionImpl itsConnectionImpl;
public Connection(String theUrl) {
itsConnectionImpl = ConnectionPool.get(theUrl);
}
protected Channel getChannel(String theMethod) throws TrexException, Exception {
return itsConnectionImpl.getChannel(theMethod);
}
public String getUrl() {
return itsConnectionImpl.getUrl();
}
}
| [
"goldschm@.fzi.de"
] | goldschm@.fzi.de |
63f131aa22a4d3d24d15e3157e1600fb33338d81 | 732182a102a07211f7c1106a1b8f409323e607e0 | /gsd/beans/map/msg/FighterCommon.java | 576b1b632cf0163cbf8959577933a3e2df9cc0dd | [] | no_license | BanyLee/QYZ_Server | a67df7e7b4ec021d0aaa41cfc7f3bd8c7f1af3da | 0eeb0eb70e9e9a1a06306ba4f08267af142957de | refs/heads/master | 2021-09-13T22:32:27.563172 | 2018-05-05T09:20:55 | 2018-05-05T09:20:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,101 | java |
package map.msg;
import com.goldhuman.Common.Marshal.Marshal;
import com.goldhuman.Common.Marshal.OctetsStream;
import com.goldhuman.Common.Marshal.MarshalException;
public class FighterCommon implements Marshal {
public int isdead;
public int isrevive;
public int isborn;
public int camp;
public map.msg.Vector3 position;
public map.msg.Vector3 orient;
public map.msg.Vector3 targetposition;
public java.util.HashMap<Integer,Integer> skills;
public java.util.HashMap<Integer,Float> attrs;
public FighterCommon() {
position = new map.msg.Vector3();
orient = new map.msg.Vector3();
targetposition = new map.msg.Vector3();
skills = new java.util.HashMap<Integer,Integer>();
attrs = new java.util.HashMap<Integer,Float>();
}
public FighterCommon(int _isdead_, int _isrevive_, int _isborn_, int _camp_, map.msg.Vector3 _position_, map.msg.Vector3 _orient_, map.msg.Vector3 _targetposition_, java.util.HashMap<Integer,Integer> _skills_, java.util.HashMap<Integer,Float> _attrs_) {
this.isdead = _isdead_;
this.isrevive = _isrevive_;
this.isborn = _isborn_;
this.camp = _camp_;
this.position = _position_;
this.orient = _orient_;
this.targetposition = _targetposition_;
this.skills = _skills_;
this.attrs = _attrs_;
}
public final boolean _validator_() {
if (!position._validator_()) return false;
if (!orient._validator_()) return false;
if (!targetposition._validator_()) return false;
return true;
}
public OctetsStream marshal(OctetsStream _os_) {
_os_.marshal(isdead);
_os_.marshal(isrevive);
_os_.marshal(isborn);
_os_.marshal(camp);
_os_.marshal(position);
_os_.marshal(orient);
_os_.marshal(targetposition);
_os_.compact_uint32(skills.size());
for (java.util.Map.Entry<Integer, Integer> _e_ : skills.entrySet()) {
_os_.marshal(_e_.getKey());
_os_.marshal(_e_.getValue());
}
_os_.compact_uint32(attrs.size());
for (java.util.Map.Entry<Integer, Float> _e_ : attrs.entrySet()) {
_os_.marshal(_e_.getKey());
_os_.marshal(_e_.getValue());
}
return _os_;
}
public OctetsStream unmarshal(OctetsStream _os_) throws MarshalException {
isdead = _os_.unmarshal_int();
isrevive = _os_.unmarshal_int();
isborn = _os_.unmarshal_int();
camp = _os_.unmarshal_int();
position.unmarshal(_os_);
orient.unmarshal(_os_);
targetposition.unmarshal(_os_);
for (int size = _os_.uncompact_uint32(); size > 0; --size) {
int _k_;
_k_ = _os_.unmarshal_int();
int _v_;
_v_ = _os_.unmarshal_int();
skills.put(_k_, _v_);
}
for (int size = _os_.uncompact_uint32(); size > 0; --size) {
int _k_;
_k_ = _os_.unmarshal_int();
float _v_;
_v_ = _os_.unmarshal_float();
attrs.put(_k_, _v_);
}
return _os_;
}
public boolean equals(Object _o1_) {
if (_o1_ == this) return true;
if (_o1_ instanceof FighterCommon) {
FighterCommon _o_ = (FighterCommon)_o1_;
if (isdead != _o_.isdead) return false;
if (isrevive != _o_.isrevive) return false;
if (isborn != _o_.isborn) return false;
if (camp != _o_.camp) return false;
if (!position.equals(_o_.position)) return false;
if (!orient.equals(_o_.orient)) return false;
if (!targetposition.equals(_o_.targetposition)) return false;
if (!skills.equals(_o_.skills)) return false;
if (!attrs.equals(_o_.attrs)) return false;
return true;
}
return false;
}
public int hashCode() {
int _h_ = 0;
_h_ += isdead;
_h_ += isrevive;
_h_ += isborn;
_h_ += camp;
_h_ += position.hashCode();
_h_ += orient.hashCode();
_h_ += targetposition.hashCode();
_h_ += skills.hashCode();
_h_ += attrs.hashCode();
return _h_;
}
public String toString() {
StringBuilder _sb_ = new StringBuilder();
_sb_.append("(");
_sb_.append(isdead).append(",");
_sb_.append(isrevive).append(",");
_sb_.append(isborn).append(",");
_sb_.append(camp).append(",");
_sb_.append(position).append(",");
_sb_.append(orient).append(",");
_sb_.append(targetposition).append(",");
_sb_.append(skills).append(",");
_sb_.append(attrs).append(",");
_sb_.append(")");
return _sb_.toString();
}
}
| [
"hadowhadow@gmail.com"
] | hadowhadow@gmail.com |
d4fc1c23591a22088319f0c5ffcd5bd99c605188 | bfc84a406c9f05630cc2dd4a2c3d1e849a66d8cd | /src/main/java/com/bytatech/ayoos/config/AsyncConfiguration.java | cd01106657491bf770722924d038a2d147277e16 | [] | no_license | AyoosByta/PATIENT-GATEWAY | 66a4b3535bfdd81fa72f69d41c584d342c5fbd39 | 3d24fe99403f4442ecd7ee2f660515b554ae991b | refs/heads/master | 2022-08-17T08:04:27.224176 | 2019-11-07T04:04:54 | 2019-11-07T04:04:54 | 217,455,318 | 0 | 1 | null | 2022-07-07T13:29:05 | 2019-10-25T05:08:21 | Java | UTF-8 | Java | false | false | 2,303 | java | package com.bytatech.ayoos.config;
import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor;
import io.github.jhipster.config.JHipsterProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.*;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@Configuration
@EnableAsync
@EnableScheduling
public class AsyncConfiguration implements AsyncConfigurer, SchedulingConfigurer {
private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class);
private final JHipsterProperties jHipsterProperties;
public AsyncConfiguration(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}
@Override
@Bean(name = "taskExecutor")
public Executor getAsyncExecutor() {
log.debug("Creating Async Task Executor");
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
executor.setThreadNamePrefix("patientgateway-Executor-");
return new ExceptionHandlingAsyncTaskExecutor(executor);
}
@Override
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
return new SimpleAsyncUncaughtExceptionHandler();
}
@Override
public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
taskRegistrar.setScheduler(scheduledTaskExecutor());
}
@Bean
public Executor scheduledTaskExecutor() {
return Executors.newScheduledThreadPool(jHipsterProperties.getAsync().getCorePoolSize());
}
}
| [
"abdul.rafeek@lxisoft.com"
] | abdul.rafeek@lxisoft.com |
ae27aa99911a181d7d9afdf493e193301b4537e9 | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/neo4j/learning/1890/IndexCountsRemover.java | 88f6e91906568f984530efc9edcf206df421d767 | [] | 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 | 1,173 | java | /*
* Copyright (c) 2002-2018 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.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.kernel.impl.api.index;
public class IndexCountsRemover
{
private final IndexStoreView storeView;
private final long indexId;
public IndexCountsRemover( final IndexStoreView storeView, final long indexId )
{
this.storeView = storeView;
this.indexId = indexId;
}
public void remove()
{
storeView.replaceIndexCounts( indexId, 0, 0, 0 );
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
899e7b8bfc1b4fa74279e6ba1d0c2b1950954123 | 76a83c3030f8f9faf2d92cecbef9bc96d7100b67 | /MultiLayer_XOR/src/multilayer_xor/MultiLayer_XOR.java | 4d9b60677556e0931bd1df320e83839c5238d16b | [] | no_license | impROS/Netbeans_Projelerim_2017 | 2deba80bc39edf9972fd3b4e4e6a0236dc504e7b | 5abfb12dd32316d58533e7303dffb7da5f9a61e3 | refs/heads/master | 2020-05-05T05:27:53.112744 | 2019-04-05T20:52:06 | 2019-04-05T20:52:06 | 179,753,398 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,933 | java | package multilayer_xor;
import java.util.ArrayList;
public class MultiLayer_XOR {
static ArrayList<String> arrInput = new ArrayList<>();
static ArrayList<Integer> arrOutput = new ArrayList<>();
static double alfa, beta, sonuc, sonucA, sonucB;
static double weightA1 = .5, weightA2 = .5, weightB1 = .5, weightB3 = .5;
static double thresholdA = .5, thresholdB = .75, thresholdSon = .25;
public static void main(String[] args) {
arrInput.add("0.0");
arrInput.add("0.1");
arrInput.add("1.0");
arrInput.add("1.1");
arrOutput.add(0);
arrOutput.add(1);
arrOutput.add(1);
arrOutput.add(0);
karsilastir();
}
public static void karsilastir() {
for (int i = 0; i < arrInput.size(); i++) {
String strInput = arrInput.get(i) + "";
int noktaIndex = strInput.indexOf(".");
int a = Integer.parseInt(strInput.substring(0, noktaIndex));
int b = Integer.parseInt(strInput.substring(noktaIndex + 1, strInput.length()));
System.out.println("A : " + a);
System.out.println("B : " + b);
sonucA = ((a * weightA1) + (b * weightA1)) >= thresholdA ? 1 : 0;
sonucB = ((b * weightB1) + (a * weightB1)) >= thresholdB ? 1 : 0;
System.out.println("SonucA : " + sonucA);
System.out.println("SonucB : " + sonucB);
sonuc = ((sonucA * .5) + (sonucB * -.5)) >= .25 ? 1 : 0;
if (arrOutput.get(i) == sonuc) {
System.out.println("Input =" + a + "," + b + " ==> Beklenen : " + arrOutput.get(i) + " ==> Output : " + (int) sonuc + " True");
} else {
System.out.println("Input =" + a + "," + b + " ==> Beklenen : " + arrOutput.get(i) + " ==> Output : " + (int) sonuc + " False");
}
System.out.println("----------------");
}
}
}
| [
"improsyazilim@gmail.com"
] | improsyazilim@gmail.com |
e42301308a8d66e7268d4ce8435e48a7494b5022 | 96f8d42c474f8dd42ecc6811b6e555363f168d3e | /baike/sources/qsbk/app/im/cg.java | f44a0c57d3ab7f178851be4c639c6bd5897a5ca1 | [] | no_license | aheadlcx/analyzeApk | 050b261595cecc85790558a02d79739a789ae3a3 | 25cecc394dde4ed7d4971baf0e9504dcb7fabaca | refs/heads/master | 2020-03-10T10:24:49.773318 | 2018-04-13T09:44:45 | 2018-04-13T09:44:45 | 129,332,351 | 6 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,985 | java | package qsbk.app.im;
import android.text.TextUtils;
import java.util.List;
import qsbk.app.Constants;
import qsbk.app.http.HttpTask;
import qsbk.app.model.relationship.Relationship;
class cg implements Runnable {
final /* synthetic */ List a;
final /* synthetic */ cf b;
cg(cf cfVar, List list) {
this.b = cfVar;
this.a = list;
}
public void run() {
this.b.a.as = this.a.size() == 20;
if (!this.b.a.as) {
this.b.a.d.stopPullToRefresh();
}
this.b.a.g.appendItem(this.a);
if (this.a.size() > 0 && this.b.a.mRelationship != Relationship.FRIEND) {
int size = this.a.size() - 1;
while (size >= 0) {
ChatMsg chatMsg = (ChatMsg) this.a.get(size);
if (chatMsg.inout != 1) {
size--;
} else if (!TextUtils.isEmpty(chatMsg.msgsrc)) {
IMChatMsgSource msgSourceFromChatMsg = IMChatMsgSource.getMsgSourceFromChatMsg(chatMsg.msgsrc);
if (msgSourceFromChatMsg.type == 7) {
CharSequence presentText = msgSourceFromChatMsg.getPresentText();
if (TextUtils.isEmpty(presentText)) {
String str = msgSourceFromChatMsg.valueObj.group_id;
if (!(msgSourceFromChatMsg.valueObj == null || str == null)) {
String str2 = String.format(Constants.URL_GROUP_DETAIL, new Object[]{str}) + "?tid=" + str;
new HttpTask(str2, str2, new ch(this)).execute(new Void[0]);
}
} else {
this.b.a.A.setSubTitle(presentText);
}
}
}
}
}
this.b.a.g.notifyDataSetChanged();
if (this.b.a.g.getCount() > 0) {
this.b.a.d.post(new ci(this));
}
}
}
| [
"aheadlcxzhang@gmail.com"
] | aheadlcxzhang@gmail.com |
bf459c7da4c017ea57173e661a0812d45b0dd092 | 9560c3b8ba825f49c1e9b8440b7905cfe9c7ef78 | /module-examples/document/demo/src/main/java/org/incode/example/document/demo/usage/dom/spiimpl/DocumentAttachmentAdvisorForDemo.java | 575882e1989cb8193e26b0548612cac41d59eb6f | [
"Apache-2.0"
] | permissive | incodehq/incode-examples | 756e447a7ac2f84a750571548aed85eb133f8f28 | 911497115d5d049ea1edd3f703c0ccd052db5f9c | refs/heads/master | 2020-03-26T16:35:38.058452 | 2018-08-22T08:13:36 | 2018-08-22T08:13:36 | 145,111,756 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,016 | java | package org.incode.example.document.demo.usage.dom.spiimpl;
import java.util.List;
import javax.inject.Inject;
import com.google.common.collect.Lists;
import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.NatureOfService;
import org.incode.example.document.demo.usage.fixture.seed.DocumentTypeAndTemplatesApplicableForDemoObjectFixture;
import org.incode.example.document.dom.impl.docs.Document;
import org.incode.example.document.dom.impl.types.DocumentType;
import org.incode.example.document.dom.impl.types.DocumentTypeRepository;
import org.incode.example.document.dom.spi.DocumentAttachmentAdvisor;
@DomainService(nature = NatureOfService.DOMAIN)
public class DocumentAttachmentAdvisorForDemo implements DocumentAttachmentAdvisor {
private static final String ROLE_NAME = "receipt";
@Override
public List<DocumentType> documentTypeChoicesFor(final Document document) {
final List<DocumentType> documentTypes = Lists.newArrayList();
append(DocumentTypeAndTemplatesApplicableForDemoObjectFixture.DOC_TYPE_REF_TAX_RECEIPT, documentTypes);
append(DocumentTypeAndTemplatesApplicableForDemoObjectFixture.DOC_TYPE_REF_SUPPLIER_RECEIPT, documentTypes);
return documentTypes;
}
private void append(final String docTypeRef, final List<DocumentType> documentTypes) {
final DocumentType documentType = documentTypeRepository
.findByReference(docTypeRef);
documentTypes.add(documentType);
}
@Override
public DocumentType documentTypeDefaultFor(final Document document) {
return documentTypeChoicesFor(document).get(0);
}
@Override
public List<String> roleNameChoicesFor(final Document document) {
return Lists.newArrayList(ROLE_NAME);
}
@Override
public String roleNameDefaultFor(final Document document) {
return roleNameChoicesFor(document).get(0);
}
@Inject
DocumentTypeRepository documentTypeRepository;
}
| [
"dan@haywood-associates.co.uk"
] | dan@haywood-associates.co.uk |
517dbab96f51439b9c8d976e2d1e1f6ddad60757 | c6457fa18dd602ea18b006564840f3f3096146be | /management/monitoring-service-api/src/main/java/org/terracotta/management/service/monitoring/registry/provider/ClientBinding.java | 7a2864952b6eefb9de5aa6ac8729f6ee855d0690 | [
"Apache-2.0"
] | permissive | anthonydahanne/terracotta-platform | 445f7ea3dc0e30070fffbe22524fdb275abfaafc | 60ab2169cf76b937a406268c307d4ad92875902d | refs/heads/master | 2020-12-25T18:00:17.697370 | 2017-09-13T18:23:42 | 2017-09-13T18:23:42 | 47,419,621 | 0 | 0 | null | 2017-09-13T18:23:43 | 2015-12-04T17:39:47 | Java | UTF-8 | Java | false | false | 1,996 | java | /*
* Copyright Terracotta, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.terracotta.management.service.monitoring.registry.provider;
import com.tc.classloader.CommonComponent;
import org.terracotta.entity.ClientDescriptor;
import org.terracotta.management.model.cluster.ClientIdentifier;
import java.util.Objects;
@CommonComponent
public class ClientBinding {
private final ClientDescriptor clientDescriptor;
private final Object value;
volatile ClientIdentifier resolvedClientIdentifier;
public ClientBinding(ClientDescriptor clientDescriptor, Object value) {
this.clientDescriptor = Objects.requireNonNull(clientDescriptor);
this.value = Objects.requireNonNull(value);
}
public ClientDescriptor getClientDescriptor() {
return clientDescriptor;
}
public Object getValue() {
return value;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ClientBinding that = (ClientBinding) o;
return clientDescriptor.equals(that.clientDescriptor);
}
@Override
public int hashCode() {
return clientDescriptor.hashCode();
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{");
sb.append("clientDescriptor=").append(clientDescriptor);
sb.append(", value=").append(value);
sb.append('}');
return sb.toString();
}
}
| [
"mathieu.carbou@gmail.com"
] | mathieu.carbou@gmail.com |
b69e4ea6f5cbff8f738f597b356885ace98ac51e | 4c19b724f95682ed21a82ab09b05556b5beea63c | /XMSYGame/java2/server/web-manager/src/main/java/com/xmsy/server/zxyy/manager/modules/manager/cashpriceconfig/service/impl/CashPriceConfigServiceImpl.java | aa7376c0a54b9b3fe252828befa7a84745609eed | [] | no_license | angel-like/angel | a66f8fda992fba01b81c128dd52b97c67f1ef027 | 3f7d79a61dc44a9c4547a60ab8648bc390c0f01e | refs/heads/master | 2023-03-11T03:14:49.059036 | 2022-11-17T11:35:37 | 2022-11-17T11:35:37 | 222,582,930 | 3 | 5 | null | 2023-02-22T05:29:45 | 2019-11-19T01:41:25 | JavaScript | UTF-8 | Java | false | false | 659 | java | package com.xmsy.server.zxyy.manager.modules.manager.cashpriceconfig.service.impl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.xmsy.server.zxyy.manager.modules.manager.cashpriceconfig.dao.CashPriceConfigDao;
import com.xmsy.server.zxyy.manager.modules.manager.cashpriceconfig.entity.CashPriceConfigEntity;
import com.xmsy.server.zxyy.manager.modules.manager.cashpriceconfig.service.CashPriceConfigService;
@Service("cashPriceConfigService")
public class CashPriceConfigServiceImpl extends ServiceImpl<CashPriceConfigDao, CashPriceConfigEntity> implements CashPriceConfigService {
}
| [
"163@qq.com"
] | 163@qq.com |
0da140105f03633722571caf11e81e6d54312e2a | 122161f032b16bfbc6e1ee8dcf5fbfceca253b28 | /src/main/java/com/mycompany/mysvc/config/ApplicationProperties.java | 4f0de3553170740447728ef409c806f0f81a61be | [] | no_license | tparet/jhipster-sample-application | 36baaea23683975c9016cc1c4673db60e5d389f1 | a9c5b9f821c57e5f6d87e3061510ba6436283eda | refs/heads/master | 2022-04-15T15:16:17.890108 | 2020-04-13T07:19:33 | 2020-04-13T07:19:33 | 255,258,301 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 446 | java | package com.mycompany.mysvc.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Properties specific to Jhipster Sample Application.
* <p>
* Properties are configured in the {@code application.yml} file.
* See {@link io.github.jhipster.config.JHipsterProperties} for a good example.
*/
@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
public class ApplicationProperties {}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
06ea31424f091946252abc703962ebd805165592 | 775891f7be4fb2bef28159dca02d4b52cc69b340 | /lts-jobtracker/src/main/java/com/github/ltsopensource/jobtracker/JobTrackerBuilder.java | 8266e2729501fb5716b1d121f1584d3151a56379 | [
"Apache-2.0"
] | permissive | skyrunner001/light-task-scheduler | 84a9b83a34d07cf57058417ad87842e6a3fcbb51 | caed4824fbade828cb3a4b5c1f471212e9b0d7df | refs/heads/master | 2021-01-17T07:29:37.489051 | 2016-04-21T15:35:46 | 2016-04-21T15:35:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,813 | java | package com.github.ltsopensource.jobtracker;
import com.github.ltsopensource.autoconfigure.PropertiesConfigurationFactory;
import com.github.ltsopensource.core.cluster.AbstractNodeBuilder;
import com.github.ltsopensource.core.commons.utils.CollectionUtils;
import com.github.ltsopensource.core.commons.utils.StringUtils;
import java.util.Map;
/**
* @author Robert HG (254963746@qq.com) on 4/21/16.
*/
public class JobTrackerBuilder extends AbstractNodeBuilder<JobTracker, JobTrackerBuilder> {
@Override
protected JobTracker build0() {
JobTrackerProperties properties = PropertiesConfigurationFactory.createPropertiesConfiguration(JobTrackerProperties.class, locations);
return buildByProperties(properties);
}
public static JobTracker buildByProperties(JobTrackerProperties properties) {
properties.checkProperties();
JobTracker jobTracker = new JobTracker();
jobTracker.setRegistryAddress(properties.getRegistryAddress());
if (StringUtils.isNotEmpty(properties.getClusterName())) {
jobTracker.setClusterName(properties.getClusterName());
}
if (properties.getListenPort() != null) {
jobTracker.setListenPort(properties.getListenPort());
}
if (StringUtils.isNotEmpty(properties.getIdentity())) {
jobTracker.setIdentity(properties.getIdentity());
}
if (StringUtils.isNotEmpty(properties.getBindIp())) {
jobTracker.setBindIp(properties.getBindIp());
}
if (CollectionUtils.isNotEmpty(properties.getConfigs())) {
for (Map.Entry<String, String> entry : properties.getConfigs().entrySet()) {
jobTracker.addConfig(entry.getKey(), entry.getValue());
}
}
return jobTracker;
}
}
| [
"254963746@qq.com"
] | 254963746@qq.com |
c551a18a7f9b070d89e6e4d837270417dd9e1f50 | 59953550b5c96051b102f35b75daaddafd352141 | /jwt-subsystem/src/main/java/org/soulwing/jwt/extension/deployment/AbstractDescriptorReader.java | 61f14136e7b85257281819ef59b331d00bf9b73a | [
"Apache-2.0"
] | permissive | soulwing/wildfly-jwt-extension | 95c30163988701ec65ba9ff2a94ed31264a1ba30 | 38d2785ffa0a29ed8eea641a7cb33b0c6c14102b | refs/heads/master | 2023-05-14T00:53:53.246903 | 2023-04-28T11:40:02 | 2023-04-28T11:40:02 | 170,519,157 | 2 | 4 | NOASSERTION | 2023-04-28T11:40:04 | 2019-02-13T14:13:15 | Java | UTF-8 | Java | false | false | 3,372 | java | /*
* File created on Apr 3, 2019
*
* Copyright (c) 2019 Carl Harris, Jr
* and others as noted
*
* 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.soulwing.jwt.extension.deployment;
import java.util.Arrays;
import java.util.List;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import org.soulwing.jwt.extension.model.Namespace;
/**
* An abstract base for {@link DescriptorReader} implementations.
*
* @author Carl Harris
*/
abstract class AbstractDescriptorReader implements DescriptorReader {
private final String namespaceUri;
private final String localName;
private final List<AbstractDescriptorReader> children;
protected DescriptorParser parser;
AbstractDescriptorReader(String localName,
AbstractDescriptorReader... children) {
this(Namespace.VERSION_1_0.getUri(), localName, children);
}
private AbstractDescriptorReader(String namespaceUri, String localName,
AbstractDescriptorReader... children) {
this.namespaceUri = namespaceUri;
this.localName = localName;
this.children = Arrays.asList(children);
}
@Override
public void init(DescriptorParser parser) {
this.parser = parser;
}
private boolean supports(String namespaceUri, String localName) {
return this.namespaceUri.equals(namespaceUri)
&& this.localName.equals(localName);
}
@Override
public void startElement(XMLStreamReader reader, String namespaceUri,
String localName, AppConfiguration config) throws XMLStreamException {
for (AbstractDescriptorReader child : children) {
if (child.supports(namespaceUri, localName)) {
parser.push(child);
child.attributes(reader, config);
return;
}
}
}
@Override
public void endElement(XMLStreamReader reader, String namespaceUri,
String localName, AppConfiguration config) throws XMLStreamException {
if (!this.namespaceUri.equals(namespaceUri)
&& this.localName.equals(localName)) {
throw new XMLStreamException("unexpected end element",
reader.getLocation());
}
parser.pop();
}
/**
* Notifies the recipient of attributes associated with the start element.
* @param reader XML stream being parsed
* @param config application configuration
* @throws XMLStreamException
*/
protected void attributes(XMLStreamReader reader, AppConfiguration config)
throws XMLStreamException {
if (reader.getAttributeCount() > 0) {
throw new XMLStreamException("unexpected attributes(s)",
reader.getLocation());
}
}
@Override
public void characters(XMLStreamReader reader,
AppConfiguration config) throws XMLStreamException {
if (!reader.getText().trim().isEmpty()) {
throw new XMLStreamException("unexpected text", reader.getLocation());
}
}
}
| [
"ceharris@vt.edu"
] | ceharris@vt.edu |
65c2f2f2cf4f49383223a08ba4614d69fc4627a8 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/5/5_28ef39d666238ae6c16d7bdbf57b63c1ea3ac058/VCPENetworkController/5_28ef39d666238ae6c16d7bdbf57b63c1ea3ac058_VCPENetworkController_t.java | b85f31bfe890830a85d30e157d8afc73e4b406c0 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 6,350 | java | package org.opennaas.web.controllers;
import java.util.Locale;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import org.apache.log4j.Logger;
import org.opennaas.web.bos.VCPENetworkBO;
import org.opennaas.web.entities.VCPENetwork;
import org.opennaas.web.services.rest.RestServiceException;
import org.opennaas.web.utils.TemplateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
/**
* @author Jordi
*/
@Controller
public class VCPENetworkController {
private static final Logger LOGGER = Logger.getLogger(VCPENetworkController.class);
@Autowired
private VCPENetworkBO vcpeNetworkBO;
@Autowired
private ReloadableResourceBundleMessageSource messageSource;
@Autowired
private TemplateUtils templateUtils;
/**
* Redirect to the form to create a VCPENetwork
*
* @param model
* @return
*/
@RequestMapping(method = RequestMethod.GET)
public String getCreateForm(Model model) {
LOGGER.debug("form to create a VCPENetwork");
model.addAttribute(templateUtils.getDefaultVCPENetwork());
return "createVCPENetwork";
}
/**
* Create a VCPE Network
*
* @param vcpeNetwork
* @param result
* @return
* @throws RestServiceException
*/
@RequestMapping(method = RequestMethod.POST, value = "/secure/noc/vcpeNetwork/create")
public String create(@Valid VCPENetwork vcpeNetwork, BindingResult result, Model model, Locale locale) {
LOGGER.debug("add entity: " + vcpeNetwork);
try {
if (!result.hasErrors()) {
vcpeNetwork.setId(vcpeNetworkBO.create(vcpeNetwork));
model.addAttribute("infoMsg", messageSource
.getMessage("vcpenetwork.create.message.info", null, locale));
} else {
model.addAttribute("errorMsg", messageSource
.getMessage("vcpenetwork.create.message.error", null, locale));
}
} catch (RestServiceException e) {
model.addAttribute("errorMsg", messageSource
.getMessage("vcpenetwork.create.message.error", null, locale) + ": " + e.getResponse());
}
return "createVCPENetwork";
}
/**
* Create a VCPE Network
*
* @param vcpeNetwork
* @param result
* @return
* @throws RestServiceException
*/
@RequestMapping(method = RequestMethod.GET, value = "/secure/noc/vcpeNetwork/delete")
public String delete(String vcpeNetworkId, Model model, Locale locale) {
LOGGER.debug("delete entity with id: " + vcpeNetworkId);
try {
vcpeNetworkBO.delete(vcpeNetworkId);
model.addAttribute("infoMsg", messageSource
.getMessage("vcpenetwork.delete.message.info", null, locale));
model.addAttribute("vcpeNetworkList", vcpeNetworkBO.getAllVCPENetworks());
} catch (RestServiceException e) {
model.addAttribute("errorMsg", messageSource
.getMessage("vcpenetwork.delete.message.error", null, locale));
}
return "listVCPENetwork";
}
/**
* Edit a VCPE Network
*
* @param vcpeNetwork
* @param result
* @return
*/
@RequestMapping(method = RequestMethod.GET, value = "/secure/noc/vcpeNetwork/edit")
public String edit(String vcpeNetworkId, Model model, Locale locale) {
LOGGER.debug("edit entity with id: " + vcpeNetworkId);
try {
model.addAttribute(vcpeNetworkBO.getById(vcpeNetworkId));
} catch (RestServiceException e) {
model.addAttribute("errorMsg", messageSource
.getMessage("vcpenetwork.edit.message.error", null, locale));
}
return "createVCPENetwork";
}
/**
* List all the VCPENetwork
*
* @param model
* @return
*/
@RequestMapping(method = RequestMethod.GET, value = "/secure/vcpeNetwork/list")
public String list(Model model, Locale locale) {
LOGGER.debug("list all entities");
try {
model.addAttribute("vcpeNetworkList", vcpeNetworkBO.getAllVCPENetworks());
} catch (RestServiceException e) {
model.addAttribute("errorMsg", messageSource
.getMessage("vcpenetwork.list.message.error", null, locale));
}
return "listVCPENetwork";
}
/**
* View a VCPENetwork
*
* @param model
* @return
*/
@RequestMapping(method = RequestMethod.GET, value = "/secure/vcpeNetwork/view")
public String view(Model model) {
// TODO
LOGGER.debug("view all entities");
return "viewVCPENetwork";
}
/**
* Redirect to the form to modify the ip's
*
* @param model
* @return
*/
@RequestMapping(method = RequestMethod.GET, value = "/secure/vcpeNetwork/updateIpsForm")
public String updateIpsForm(String vcpeNetworkId, Model model, Locale locale) {
LOGGER.debug("updateIpsForm entity with id: " + vcpeNetworkId);
try {
model.addAttribute(vcpeNetworkBO.getById(vcpeNetworkId));
} catch (RestServiceException e) {
model.addAttribute("errorMsg", messageSource
.getMessage("vcpenetwork.edit.message.error", null, locale));
}
return "updateIpsVCPENetwork";
}
/**
* Redirect to the form to modify the ip's
*
* @param model
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/secure/vcpeNetwork/updateIps")
public String updateIps(VCPENetwork vcpeNetwork, Model model, Locale locale) {
LOGGER.debug("updateIps of VCPENetwork" + vcpeNetwork);
try {
model.addAttribute(vcpeNetworkBO.updateIps(vcpeNetwork));
model.addAttribute("infoMsg", messageSource
.getMessage("vcpenetwork.updateIps.message.info", null, locale));
} catch (RestServiceException e) {
model.addAttribute("errorMsg", messageSource
.getMessage("vcpenetwork.updateIps.message.error", null, locale));
}
return "updateIpsVCPENetwork";
}
/**
* Handle the Exception and subclasses
*
* @param ex
* @param request
* @return
*/
@ExceptionHandler(Exception.class)
public String exception(Exception ex, HttpServletRequest request) {
request.setAttribute("exception", ex.getMessage());
return "exception";
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.