blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 4
410
| content_id
stringlengths 40
40
| detected_licenses
sequencelengths 0
51
| license_type
stringclasses 2
values | repo_name
stringlengths 5
132
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
80
| visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
689M
⌀ | star_events_count
int64 0
209k
| fork_events_count
int64 0
110k
| gha_license_id
stringclasses 22
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 131
values | src_encoding
stringclasses 34
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 3
9.45M
| extension
stringclasses 32
values | content
stringlengths 3
9.45M
| authors
sequencelengths 1
1
| author_id
stringlengths 0
313
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
063494362d0a341305f2bf057da36c9c1f56d969 | 419c1c2a685d96ee939442e1e9bde366dde5a36f | /PBO310117119Latihan52SiapaKamu/src/pbo310117119latihan52siapakamu/Dosen.java | 19d367203d9d06b66fb3c04524797605b38ccbbe | [] | no_license | ARDITYAYS/PBO3-10117119-Latihan52-SiapaKamu | 92de06214d4150f6af647d74e12231de200fca4b | cfbb2099dcf85cf9a0ca2ee787c22c1e3da6fcff | refs/heads/master | 2020-04-03T12:28:36.516992 | 2018-10-29T17:32:28 | 2018-10-29T17:32:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 915 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pbo310117119latihan52siapakamu;
/**
*
* @author Yogaputra
*/
public class Dosen extends Manusia {
private String nip;
private String mataKuliah;
public String getNip() {
return nip;
}
public void setNip(String nip) {
this.nip = nip;
}
public String getMataKuliah() {
return mataKuliah;
}
public void setMataKuliah(String mataKuliah) {
this.mataKuliah = mataKuliah;
}
public void mengajarApa() {
System.out.println("Saya " + nama + " umur " + umur + " tahun sedang mengajar matakuliah " + mataKuliah);
}
public void siapaKamu() {
System.out.println("Saya Dosen");
}
}
| [
"[email protected]"
] | |
04e4c5653c6d46e5a6017203765d33362095a017 | 07ae4b2281292aa7ee1d7ddb320e8bfeb98242ba | /src/dev/tnordquist/LinearIn.java | 285fc80dbde1b34e42387e9d36b24c8b8d56a937 | [] | no_license | tnordquist/liner-in | 37e4ebce3ecbbd2b7e22152b6d06fe1225e5ec0c | 27288a251a829c069c3cd31f2d7bef7df8f34f7f | refs/heads/master | 2020-05-17T20:01:31.487906 | 2019-04-28T19:09:24 | 2019-04-28T19:09:24 | 183,933,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 647 | java | package dev.tnordquist;
public class LinearIn {
public static boolean linearIn(int[] outer, int[] inner) {
int newJ=0;
int j;
int ct = 0;
int newLength = inner.length;
for (int i = 0; i < inner.length; ++i) {
if (i < inner.length - 1 && inner[i] == inner[i + 1]) {
newLength--;
continue;
}
for (j = newJ; j < outer.length; ++j) {
if (j < outer.length - 1 && outer[j] == outer[j + 1]) {
continue;
}
if (inner[i] == outer[j]) {
newJ=j+1;
ct++;
}
}
}
return (ct == newLength);
}
} | [
"[email protected]"
] | |
6e869f494a64617859395f0494cf0fe0932fd0b3 | 815bdc2cea19252e608fe3745ba2ea1de9229b4c | /src/main/java/com/targettrust/imob/bean/ProdutoBean.java | a9757289ec04052392ac1b3f39e3c2f5a0f8bc67 | [] | no_license | darossitg/rossi | 9d5c481a8f522270973ccef78c4a93d4b68ea47b | ad2091c683ef63fd90d9fe875805b5d89adf6270 | refs/heads/master | 2016-09-06T01:50:25.853038 | 2014-03-13T04:35:46 | 2014-03-13T04:35:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,208 | java | package com.targettrust.imob.bean;
public class ProdutoBean {
private int prodCodigo = 0;
private String prodDescricao = "";
private int prodQuantidadeAtual = 0;
private double prodValorUnitario = 0;
private String prodReferencia = "";
private String prodTamanho = "";
private String prodObservacao = "";
private String prodFiltro = "";
private int prodCombobox = 0;
/**
* @return the prodCodigo
*/
public int getProdCodigo() {
return prodCodigo;
}
/**
* @param prodCodigo the prodCodigo to set
*/
public void setProdCodigo(int prodCodigo) {
this.prodCodigo = prodCodigo;
}
/**
* @return the prodDescricao
*/
public String getProdDescricao() {
return prodDescricao;
}
/**
* @param prodDescricao the prodDescricao to set
*/
public void setProdDescricao(String prodDescricao) {
this.prodDescricao = prodDescricao;
}
/**
* @return the prodQuantidadeAtual
*/
public int getProdQuantidadeAtual() {
return prodQuantidadeAtual;
}
/**
* @param prodQuantidadeAtual the prodQuantidadeAtual to set
*/
public void setProdQuantidadeAtual(int prodQuantidadeAtual) {
this.prodQuantidadeAtual = prodQuantidadeAtual;
}
/**
* @return the prodValorUnitario
*/
public double getProdValorUnitario() {
return prodValorUnitario;
}
/**
* @param prodValorUnitario the prodValorUnitario to set
*/
public void setProdValorUnitario(double prodValorUnitario) {
this.prodValorUnitario = prodValorUnitario;
}
/**
* @return the prodReferencia
*/
public String getProdReferencia() {
return prodReferencia;
}
/**
* @param prodReferencia the prodReferencia to set
*/
public void setProdReferencia(String prodReferencia) {
this.prodReferencia = prodReferencia;
}
/**
* @return the prodTamanho
*/
public String getProdTamanho() {
return prodTamanho;
}
/**
* @param prodTamanho the prodTamanho to set
*/
public void setProdTamanho(String prodTamanho) {
this.prodTamanho = prodTamanho;
}
/**
* @return the prodObservacao
*/
public String getProdObservacao() {
return prodObservacao;
}
/**
* @param prodObservacao the prodObservacao to set
*/
public void setProdObservacao(String prodObservacao) {
this.prodObservacao = prodObservacao;
}
/**
* @return the prodFiltro
*/
public String getProdFiltro() {
return prodFiltro;
}
/**
* @param prodFiltro the prodFiltro to set
*/
public void setProdFiltro(String prodFiltro) {
this.prodFiltro = prodFiltro;
}
/**
* @return the prodCombobox
*/
public int getProdCombobox() {
return prodCombobox;
}
/**
* @param prodCombobox the prodCombobox to set
*/
public void setProdCombobox(int prodCombobox) {
System.out.println("prodcombo:"+prodCombobox);
this.prodCombobox = prodCombobox;
}
}
| [
"[email protected]"
] | |
7548507932aac1de9ab3aa6e1cf22bfa48966c26 | 15b260ccada93e20bb696ae19b14ec62e78ed023 | /v2/src/main/java/com/alipay/api/domain/AlipayInsSceneApplicationApplyModel.java | a110c3974fcdaf07efc9da951d1e078680cb3497 | [
"Apache-2.0"
] | permissive | alipay/alipay-sdk-java-all | df461d00ead2be06d834c37ab1befa110736b5ab | 8cd1750da98ce62dbc931ed437f6101684fbb66a | refs/heads/master | 2023-08-27T03:59:06.566567 | 2023-08-22T14:54:57 | 2023-08-22T14:54:57 | 132,569,986 | 470 | 207 | Apache-2.0 | 2022-12-25T07:37:40 | 2018-05-08T07:19:22 | Java | UTF-8 | Java | false | false | 4,759 | java | package com.alipay.api.domain;
import java.util.Date;
import java.util.List;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
import com.alipay.api.internal.mapping.ApiListField;
/**
* 投保受理
*
* @author auto create
* @since 1.0, 2022-10-12 18:35:38
*/
public class AlipayInsSceneApplicationApplyModel extends AlipayObject {
private static final long serialVersionUID = 5716924451913624751L;
/**
* 用户参与的活动ID
*/
@ApiField("activity_id")
private String activityId;
/**
* 投保人
*/
@ApiField("applicant")
private InsPerson applicant;
/**
* 支付账单流水的标题
*/
@ApiField("bill_title")
private String billTitle;
/**
* 投保参数 ,每个产品特有的投保参数,如航空险的航班信息;标准json格式
*/
@ApiField("biz_data")
private String bizData;
/**
* 保险产品销售单元编码
*/
@ApiField("csu_no")
private String csuNo;
/**
* 生效时间
*/
@ApiField("effect_start_time")
private Date effectStartTime;
/**
* 标的信息, 保险标的物,产品责任信息
*/
@ApiListField("ins_objects")
@ApiField("ins_object")
private List<InsObject> insObjects;
/**
* 被保险人
*/
@ApiListField("insureds")
@ApiField("ins_person")
private List<InsPerson> insureds;
/**
* 商户生成的外部投保业务号,必须保证唯一
*/
@ApiField("out_biz_no")
private String outBizNo;
/**
* 险种保障期限,数字+"Y/M/D"结尾,非固定期限险种或多固定期限险种必填
*/
@ApiField("period")
private String period;
/**
* 实际保费,询价接口获取的保费通过投保接口传递进来。投保接口会对传入的保费进行验证。传入的保费和核价的值不一样投保失败
*/
@ApiField("premium")
private Long premium;
/**
* 产品编码;由蚂蚁保险平台分配,商户通过该产品编码投保特定的保险产品(如饿了么外卖延误险)
*/
@ApiField("prod_code")
private String prodCode;
/**
* 推荐流水号
*/
@ApiField("recom_flow_no")
private String recomFlowNo;
/**
* 渠道来源
*/
@ApiField("source")
private String source;
/**
* 跟保单相关的干系人
*/
@ApiListField("stake_holders")
@ApiField("ins_person")
private List<InsPerson> stakeHolders;
/**
* 保额值,保额类型为枚举的时候是一个枚举值,当为金额类型时单位为分
*/
@ApiField("sum_insured")
private Long sumInsured;
public String getActivityId() {
return this.activityId;
}
public void setActivityId(String activityId) {
this.activityId = activityId;
}
public InsPerson getApplicant() {
return this.applicant;
}
public void setApplicant(InsPerson applicant) {
this.applicant = applicant;
}
public String getBillTitle() {
return this.billTitle;
}
public void setBillTitle(String billTitle) {
this.billTitle = billTitle;
}
public String getBizData() {
return this.bizData;
}
public void setBizData(String bizData) {
this.bizData = bizData;
}
public String getCsuNo() {
return this.csuNo;
}
public void setCsuNo(String csuNo) {
this.csuNo = csuNo;
}
public Date getEffectStartTime() {
return this.effectStartTime;
}
public void setEffectStartTime(Date effectStartTime) {
this.effectStartTime = effectStartTime;
}
public List<InsObject> getInsObjects() {
return this.insObjects;
}
public void setInsObjects(List<InsObject> insObjects) {
this.insObjects = insObjects;
}
public List<InsPerson> getInsureds() {
return this.insureds;
}
public void setInsureds(List<InsPerson> insureds) {
this.insureds = insureds;
}
public String getOutBizNo() {
return this.outBizNo;
}
public void setOutBizNo(String outBizNo) {
this.outBizNo = outBizNo;
}
public String getPeriod() {
return this.period;
}
public void setPeriod(String period) {
this.period = period;
}
public Long getPremium() {
return this.premium;
}
public void setPremium(Long premium) {
this.premium = premium;
}
public String getProdCode() {
return this.prodCode;
}
public void setProdCode(String prodCode) {
this.prodCode = prodCode;
}
public String getRecomFlowNo() {
return this.recomFlowNo;
}
public void setRecomFlowNo(String recomFlowNo) {
this.recomFlowNo = recomFlowNo;
}
public String getSource() {
return this.source;
}
public void setSource(String source) {
this.source = source;
}
public List<InsPerson> getStakeHolders() {
return this.stakeHolders;
}
public void setStakeHolders(List<InsPerson> stakeHolders) {
this.stakeHolders = stakeHolders;
}
public Long getSumInsured() {
return this.sumInsured;
}
public void setSumInsured(Long sumInsured) {
this.sumInsured = sumInsured;
}
}
| [
"auto-publish"
] | auto-publish |
a0eaf2e8f739162f780b0aa62da284fbcb65e7d1 | e0381d7b7a80f8b54f414ea7d2c9621ec1fb21b9 | /src/main/java/com/wondersgroup/showcase/client/entity/CourseSelectMember.java | 5ce8508b0e135da0ab6e2247eeb1476b2f488e9c | [] | no_license | zhuimengfb/attendence | 9717d54fa879b4e57061ed7ce2176b21d6d72115 | 1ac44d3de51fc4793a444dd400e9b860b3a1c2e9 | refs/heads/master | 2021-01-10T01:47:20.032729 | 2016-03-11T08:03:44 | 2016-03-11T08:03:44 | 52,778,221 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,803 | java | package com.wondersgroup.showcase.client.entity;
import java.io.Serializable;
public class CourseSelectMember implements Serializable{
public static final String ID="id";
public static final String MEMBER_ACCOUNT="memberAccount";
public static final String MEMBER_NAME="memberName";
public static final String COURSE_ID="courseId";
public static final String COURSE_TITLE="courseTitle";
public static final String MEMBER_APARTMENT="memberApartment";
public static final String FLAG="flag";
public static final int FLAG_NORMAL=1;
/**
*
*/
private static final long serialVersionUID = 1L;
private String id;
private String memberAccount;
private String memberName;
private String courseId;
private String courseTitle;
private String memberApartment;
private int flag;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMemberAccount() {
return memberAccount;
}
public void setMemberAccount(String memberAccount) {
this.memberAccount = memberAccount;
}
public String getMemberName() {
return memberName;
}
public void setMemberName(String memberName) {
this.memberName = memberName;
}
public String getCourseId() {
return courseId;
}
public void setCourseId(String courseId) {
this.courseId = courseId;
}
public String getCourseTitle() {
return courseTitle;
}
public void setCourseTitle(String courseTitle) {
this.courseTitle = courseTitle;
}
public int getFlag() {
return flag;
}
public void setFlag(int flag) {
this.flag = flag;
}
public String getMemberApartment() {
return memberApartment;
}
public void setMemberApartment(String memberApartment) {
this.memberApartment = memberApartment;
}
}
| [
"[email protected]"
] | |
ecb9f318ebdb4eff4267034e05cd670e61c5f148 | 2feeb76469a5a4de44efd91ed0db9669eca18644 | /src/main/java/com.gaems.pnptoolbox/views/activities/HelloAndroidActivity.java | 84b4a13ad2830c65ffb048c745ae37defc44b3bc | [] | no_license | Morrodin/pnp-toolbox | f843fd5381082c589a05309cd3e65ad37ed4e01c | 56d69d7b7350ec73bc035cc76e4cbcbc97447f52 | refs/heads/master | 2021-01-01T18:37:11.766335 | 2013-06-18T20:24:33 | 2013-06-18T20:24:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 934 | java | package com.gaems.pnptoolbox.views.activities;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import com.gaems.pnptoolbox.R;
public class HelloAndroidActivity extends Activity {
/**
* Called when the activity is first created.
* @param savedInstanceState If the activity is being re-initialized after
* previously being shut down then this Bundle contains the data it most
* recently supplied in onSaveInstanceState(Bundle). <b>Note: Otherwise it is null.</b>
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
| [
"[email protected]"
] | |
4c1225a43cb7bbc498dc46b4ebb11fcc43cbb741 | 3e898a0edf2aebd3345c79615d9c533139d6666e | /sdk/compute/mgmt/src/main/java/com/azure/management/compute/models/RollingUpgradeStatusInfoInner.java | 5c7f8db8d3423068ce67d1f0d1c2dbcfec8f4632 | [
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-or-later",
"Apache-2.0",
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-generic-cla"
] | permissive | JasonWHowell/azure-sdk-for-java | 81fd8988895511080b0d1feff5112e1c47dad620 | 346475e8f6ebbcd09047797f7fcef4129c78ce43 | refs/heads/master | 2023-04-16T05:16:52.441674 | 2020-06-03T16:38:26 | 2020-06-03T16:38:26 | 269,185,086 | 0 | 0 | MIT | 2020-06-03T20:14:00 | 2020-06-03T20:14:00 | null | UTF-8 | Java | false | false | 3,283 | java | // Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.management.compute.models;
import com.azure.core.annotation.Immutable;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.management.compute.ApiError;
import com.azure.management.compute.RollingUpgradePolicy;
import com.azure.management.compute.RollingUpgradeProgressInfo;
import com.azure.management.compute.RollingUpgradeRunningStatus;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** The RollingUpgradeStatusInfo model. */
@JsonFlatten
@Immutable
public class RollingUpgradeStatusInfoInner extends Resource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(RollingUpgradeStatusInfoInner.class);
/*
* The rolling upgrade policies applied for this upgrade.
*/
@JsonProperty(value = "properties.policy", access = JsonProperty.Access.WRITE_ONLY)
private RollingUpgradePolicy policy;
/*
* Information about the current running state of the overall upgrade.
*/
@JsonProperty(value = "properties.runningStatus", access = JsonProperty.Access.WRITE_ONLY)
private RollingUpgradeRunningStatus runningStatus;
/*
* Information about the number of virtual machine instances in each
* upgrade state.
*/
@JsonProperty(value = "properties.progress", access = JsonProperty.Access.WRITE_ONLY)
private RollingUpgradeProgressInfo progress;
/*
* Error details for this upgrade, if there are any.
*/
@JsonProperty(value = "properties.error", access = JsonProperty.Access.WRITE_ONLY)
private ApiError error;
/**
* Get the policy property: The rolling upgrade policies applied for this upgrade.
*
* @return the policy value.
*/
public RollingUpgradePolicy policy() {
return this.policy;
}
/**
* Get the runningStatus property: Information about the current running state of the overall upgrade.
*
* @return the runningStatus value.
*/
public RollingUpgradeRunningStatus runningStatus() {
return this.runningStatus;
}
/**
* Get the progress property: Information about the number of virtual machine instances in each upgrade state.
*
* @return the progress value.
*/
public RollingUpgradeProgressInfo progress() {
return this.progress;
}
/**
* Get the error property: Error details for this upgrade, if there are any.
*
* @return the error value.
*/
public ApiError error() {
return this.error;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (policy() != null) {
policy().validate();
}
if (runningStatus() != null) {
runningStatus().validate();
}
if (progress() != null) {
progress().validate();
}
if (error() != null) {
error().validate();
}
}
}
| [
"[email protected]"
] | |
e68984161bd147cdccfc89f7c75a1d16ac5283c9 | 8a821345e73a9aaae12dc2d2f61ec6a151ee95c8 | /src/test/java/de/quinscape/automaton/runtime/data/InteractiveQueryComputedValueTest.java | 292da05ef4942c7e7a6ea58740d13f7e441a4565 | [
"Apache-2.0"
] | permissive | quinscape/automaton | 83fc32cbfdb7e2b391da6882eb47d31dec6c1774 | 438adc8315dc2f575f9128185af601dbb9017dfd | refs/heads/master | 2023-06-24T03:59:31.859413 | 2023-06-23T00:22:15 | 2023-06-23T00:22:15 | 158,684,252 | 2 | 2 | Apache-2.0 | 2023-03-02T22:41:43 | 2018-11-22T10:45:14 | Java | UTF-8 | Java | false | false | 11,411 | java | package de.quinscape.automaton.runtime.data;
import com.google.common.collect.ImmutableMap;
import de.quinscape.automaton.runtime.domain.builder.AutomatonDomain;
import de.quinscape.automaton.runtime.scalar.ConditionBuilder;
import de.quinscape.automaton.runtime.tstimpl.DelegatingInteractiveQueryService;
import de.quinscape.automaton.runtime.tstimpl.IQueryTestLogic;
import de.quinscape.automaton.runtime.tstimpl.TestProvider;
import de.quinscape.automaton.testdomain.Public;
import de.quinscape.automaton.testdomain.tables.pojos.AppUser;
import de.quinscape.automaton.testdomain.tables.pojos.Foo;
import de.quinscape.automaton.testdomain.tables.pojos.Node;
import de.quinscape.domainql.DomainQL;
import de.quinscape.domainql.config.SourceField;
import de.quinscape.domainql.config.TargetField;
import de.quinscape.spring.jsview.util.JSONUtil;
import graphql.ExecutionInput;
import graphql.ExecutionResult;
import graphql.GraphQL;
import org.jooq.DSLContext;
import org.jooq.impl.DSL;
import org.jooq.tools.jdbc.MockResult;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import static de.quinscape.automaton.runtime.scalar.ConditionBuilder.*;
import static de.quinscape.automaton.testdomain.Tables.*;
import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
public class InteractiveQueryComputedValueTest
{
private final static Logger log = LoggerFactory.getLogger(InteractiveQueryComputedValueTest.class);
@BeforeAll
public static void initReproducibleConditions()
{
ConditionBuilder.setMapImpl(LinkedHashMap.class);
}
@Test
public void testComputedValue() throws IOException
{
final DSLContext dslContext = TestProvider.create(ImmutableMap.of(
"select \"foo\".\"id\", \"foo\".\"name\", \"foo\".\"num\", \"foo\".\"description\", \"foo\".\"created\", \"foo\"" +
".\"type\", \"foo\".\"flag\", \"owner\".\"id\", \"owner\".\"login\", \"foo\".\"owner_id\" from \"public\".\"foo\"" +
" as \"foo\" left outer join \"public\".\"app_user\" as \"owner\" on \"owner\".\"id\" = \"foo\".\"owner_id\" " +
"where (\"foo\".\"created\" < current_timestamp and \"foo\".\"created\" > current_date) order by \"foo\".\"id\" " +
"offset ? rows fetch next ? rows only",
(dsl, ctx) -> new MockResult[]{
new MockResult(
0,
dsl.newResult(
FOO.ID,
FOO.NAME,
FOO.NUM,
FOO.DESCRIPTION,
FOO.CREATED,
FOO.TYPE,
FOO.FLAG,
APP_USER.ID,
APP_USER.LOGIN
)
)
},
"select count(*) from \"public\".\"foo\" as \"foo\" left outer join \"public\".\"app_user\" as \"owner\" on \"owner\"" +
".\"id\" = \"foo\".\"owner_id\" where (\"foo\".\"created\" < current_timestamp and \"foo\".\"created\" > " +
"current_date)",
(dsl, ctx) -> new MockResult[]{
new MockResult(
dsl.newRecord(
DSL.param("c", Integer.class)
)
.values(
0
)
)
}
));
final DelegatingInteractiveQueryService svc =
new DelegatingInteractiveQueryService();
final DomainQL domainQL = AutomatonDomain.newDomain(dslContext, Collections.emptyList())
.objectTypes(Public.PUBLIC)
.logicBeans(
Arrays.asList(
new IQueryTestLogic(
dslContext,
svc
)
)
)
.withAdditionalInputTypes(
Foo.class, Node.class, AppUser.class
)
// source variants
.configureRelation(FOO.OWNER_ID, SourceField.OBJECT, TargetField.MANY)
.configureRelation(FOO.TYPE, SourceField.SCALAR, TargetField.NONE)
.configureRelation(NODE.PARENT_ID, SourceField.OBJECT, TargetField.NONE)
.build();
svc.setTarget(
new DefaultInteractiveQueryService(
domainQL,
dslContext,
new FilterTransformer(domainQL)
)
);
//writeGQLSchema(domainQL);
GraphQL graphQL = GraphQL.newGraphQL(domainQL.getGraphQLSchema()).build();
ExecutionInput executionInput = ExecutionInput.newExecutionInput()
// language=GraphQL
.query("query iQueryFoo($config: QueryConfigInput)\n" +
"{\n" +
" iQueryFoo(config: $config)\n" +
" {\n" +
" type\n" +
" columnStates{\n" +
" name\n" +
" enabled\n" +
" sortable\n" +
" }\n" +
" queryConfig{\n" +
" id\n" +
" condition\n" +
" offset\n" +
" pageSize\n" +
" sortFields\n" +
" }\n" +
" rows{\n" +
" id\n" +
" name\n" +
" num\n" +
" description\n" +
" created\n" +
" type\n" +
" flag\n" +
" owner{\n" +
" id\n" +
" login\n" +
" }\n" +
"\n" +
" }\n" +
" }\n" +
"}")
.variables(
ImmutableMap.of(
"config",
ImmutableMap.of(
"condition",
and(
Arrays.asList(
condition(
"lessThan",
Arrays.asList(
field("created"),
value(AutomatonDomain.COMPUTED_VALUE_TYPE, ImmutableMap.of(
"name", "now",
"args", Collections.emptyList()
))
)
),
condition(
"greaterThan",
Arrays.asList(
field("created"),
value(AutomatonDomain.COMPUTED_VALUE_TYPE, ImmutableMap.of(
"name", "today",
"args", Collections.emptyList()
))
)
)
)
)
)
)
)
.build();
ExecutionResult executionResult = graphQL.execute(executionInput);
assertThat(executionResult.getErrors(), is(Collections.emptyList()));
log.info(JSONUtil.DEFAULT_GENERATOR.dumpObjectFormatted(executionResult.getData()));
assertThat(
JSONUtil.DEFAULT_GENERATOR.dumpObjectFormatted(executionResult.getData()),
is(
"{\n" +
" \"iQueryFoo\":{\n" +
" \"type\":\"Foo\",\n" +
" \"columnStates\":[\n" +
" {\n" +
" \"name\":\"id\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"name\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"num\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"description\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"created\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"type\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"flag\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"owner.id\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" },\n" +
" {\n" +
" \"name\":\"owner.login\",\n" +
" \"enabled\":true,\n" +
" \"sortable\":true\n" +
" }\n" +
" ],\n" +
" \"queryConfig\":{\n" +
" \"id\":null,\n" +
" \"condition\":{\n" +
" \"type\":\"Condition\",\n" +
" \"name\":\"and\",\n" +
" \"operands\":[\n" +
" {\n" +
" \"type\":\"Condition\",\n" +
" \"name\":\"lessThan\",\n" +
" \"operands\":[\n" +
" {\n" +
" \"type\":\"Field\",\n" +
" \"name\":\"created\"\n" +
" },\n" +
" {\n" +
" \"type\":\"Value\",\n" +
" \"scalarType\":\"ComputedValue\",\n" +
" \"name\":null,\n" +
" \"value\":{\n" +
" \"args\":[\n" +
" \n" +
" ],\n" +
" \"name\":\"now\"\n" +
" }\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" \"type\":\"Condition\",\n" +
" \"name\":\"greaterThan\",\n" +
" \"operands\":[\n" +
" {\n" +
" \"type\":\"Field\",\n" +
" \"name\":\"created\"\n" +
" },\n" +
" {\n" +
" \"type\":\"Value\",\n" +
" \"scalarType\":\"ComputedValue\",\n" +
" \"name\":null,\n" +
" \"value\":{\n" +
" \"args\":[\n" +
" \n" +
" ],\n" +
" \"name\":\"today\"\n" +
" }\n" +
" }\n" +
" ]\n" +
" }\n" +
" ]\n" +
" },\n" +
" \"offset\":0,\n" +
" \"pageSize\":10,\n" +
" \"sortFields\":[\n" +
" \"id\"\n" +
" ]\n" +
" },\n" +
" \"rows\":[\n" +
" \n" +
" ]\n" +
" }\n" +
"}")
);
}
}
| [
"[email protected]"
] | |
3cfe699f93190e03e72665db05a2f1d3740566d6 | 2df748274f419db6087e8c30a7e4815d92dd7402 | /src/main/java/guerbai/f401_450/PathSum.java | 2f7030b235bca7c381d4bc057ee52a061327ec15 | [
"MIT"
] | permissive | guerbai/leetcode-with-java | 4fdda586804e27f393203169f9503049d383e647 | bb255e273fc5cd8f49a9b515b55f243b2b83b83a | refs/heads/master | 2020-03-19T06:21:12.668540 | 2018-12-11T09:13:20 | 2018-12-11T09:13:20 | 136,012,014 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,796 | java | package guerbai.f401_450;
import guerbai.util.TreeNode;
public class PathSum {
// private static int recursion(TreeNode root, int sum, int sumNow) {
// if (root == null) return 0;
// int count = 0;
// if (sumNow + root.val == sum) {
// System.out.println(sumNow);
// System.out.println(root.val);
// count = 1;
// }
// if (root.left != null) {
// count += recursion(root.left, sum, 0)
// + recursion(root.left, sum, sumNow + root.val);
// }
// if (root.right != null) {
// count += recursion(root.right, sum, 0)
// + recursion(root.right, sum, sumNow + root.val);
// }
// return count;
// }
//
// private static int pathSum(TreeNode root, int sum) {
// if (root == null) return 0;
// return recursion(root, sum, 0);
// }
private static int recursion(TreeNode root, int sum) {
if (root == null) return 0;
return (root.val == sum ? 1 : 0) + recursion(root.left, sum-root.val) + recursion(root.right, sum-root.val);
}
// 这题没看明白,可记为典型的DFS;
private static int pathSum(TreeNode root, int sum) {
if (root == null) return 0;
return recursion(root, sum) + pathSum(root.left, sum) + pathSum(root.right, sum);
}
public static void main(String[] args) {
TreeNode root5 = new TreeNode(5);
TreeNode root4 = new TreeNode(4);
TreeNode root3 = new TreeNode(3);
TreeNode root2 = new TreeNode(2);
TreeNode root1 = new TreeNode(1);
root1.right = root2;
root2.right = root3;
root3.right = root4;
root4.right = root5;
System.out.println(pathSum(root1, 3));
}
}
| [
"[email protected]"
] | |
451c6224e60c0fe44a7561c8cde329136fe0d023 | 2304072250090228cfb687eea1589c4a8d9037bd | /app/src/main/java/com/example/elyseturner/corro/RestClient.java | 75fd328ba79b8d4b481f7a556c87a1d16d36d4e6 | [] | no_license | elyselturner/Corro | 5129db5defb61bc98f384e31b5773f3792d06423 | 7442602938ee8c8caf48339ff5273bf5e348d9be | refs/heads/master | 2016-09-05T23:30:52.394091 | 2015-07-31T15:34:22 | 2015-07-31T15:34:22 | 37,151,558 | 0 | 0 | null | 2015-07-31T15:34:22 | 2015-06-09T18:49:49 | Java | UTF-8 | Java | false | false | 789 | java | package com.example.elyseturner.corro;
import com.squareup.okhttp.OkHttpClient;
import retrofit.RestAdapter;
import retrofit.client.OkClient;
/**
* Created by elyseturner on 7/31/15.
*/
public class RestClient {
private static Api REST_CLIENT;
private static String ROOT = "http://api.openweathermap.org/data/2.5";
static {
setupRestClient();
}
private RestClient() {}
public static Api get() {
return REST_CLIENT;
}
private static void setupRestClient() {
RestAdapter.Builder builder = new RestAdapter.Builder()
.setEndpoint(ROOT)
.setClient(new OkClient(new OkHttpClient()));
RestAdapter restAdapter = builder.build();
REST_CLIENT = restAdapter.create(Api.class);
}
}
| [
"[email protected]"
] | |
2e5acf995c1677da0820ba67cfc18f40477fcc2f | a476190ec8564339e58f78dc54bbcdd4aa64cb0d | /src/main/java/com/PIVAs/constant/OrdersCheckConst.java | f5f4501ad7c791878d8a2bcf8f43fb73619bdf49 | [] | no_license | Chopper-Joba/pivas | 4a530ae25fff3ee46ecb1f6b60f112365316a101 | 1c632245ad305796ab4036de1bc6a57d4a1352ab | refs/heads/master | 2022-05-02T17:40:23.823622 | 2019-12-18T02:28:05 | 2019-12-18T02:28:05 | 224,366,662 | 0 | 0 | null | 2022-03-31T18:58:14 | 2019-11-27T07:05:20 | Java | UTF-8 | Java | false | false | 654 | java | package com.PIVAs.constant;
/**
* @author li_yinghao
* @version 1.0
* @date 2019/12/6 15:25
* @description 医嘱审查状态值
*/
public class OrdersCheckConst {
public enum OrdersCheckEnum{
/**
* 已删除
*/
DELETE(-1),
/**
* 新开
*/
CREATE(1),
/**
* 已审查
*/
CHECK(2);
/**
* 数据库数值
*/
private final Integer value;
private OrdersCheckEnum(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
}
}
| [
"[email protected]"
] | |
8c2fb080014c36daa129db9b5aba2e4e75c168a5 | 9a3c6f4d1fe188b188f9f84c811fac59aeff6fb1 | /CompareStrings.java | 099913e0fca87badc1edcac8fae71b9efdcfcf6f | [] | no_license | srivani-aalampally/Java2020 | ed6e654d21539e5e23e35b91c74a2dd9e081f09b | ba643de9f71d8ddbcf0bdb6390ab1bd9070af600 | refs/heads/master | 2022-12-19T05:59:14.835342 | 2020-09-25T13:28:00 | 2020-09-25T13:28:00 | 281,693,609 | 2 | 0 | null | 2020-09-02T19:54:48 | 2020-07-22T14:03:02 | Java | UTF-8 | Java | false | false | 940 | java | //Compare two strings without using equals method.
//Comparing lexicograpgically
class CompareStrings
{
public static void main(String[] args)
{
String s1 = new String("Corona pandamic");
String s2 = new String("Corona");
String s3 = new String("Corona");
String s4 = new String("pandamic");
System.out.println("Comparing strings "+s1+" and "+s2+":"+compareTwoStrings(s1,s2));
System.out.println("Comparing strings "+s2+" and "+s3+":"+compareTwoStrings(s2,s3));
System.out.println("Comparing strings "+s3+" and "+s4+":"+compareTwoStrings(s3,s4));
}
public static int compareTwoStrings(String s1,String s2)
{
int l1 = s1.length();
int l2 = s2.length();
for(int i=0;i<Math.min(l1,l2);i++)
{
int s1_c = (int) s1.charAt(i);
int s2_c = (int) s2.charAt(i);
if(s1_c!=s2_c)
return s1_c - s2_c;
}
if(l1!=l2)
return l1 - l2;
else
return 0;
}
}
| [
"[email protected]"
] | |
14b8971a41ab6d1195cf395567a3dd3b7482e13a | ef1bd56dd4f44a69e0bd32e1bdb80a98ef990a02 | /src/main/java/ru/linkov/ss/user/serialization/service/user/deserializer/CsvUserDeserializer.java | fa83072eb1e2149a1e9a712e2bfc9dc75a496728 | [] | no_license | StrangeHerring/gb-serialization | 12c25f9ec3724ad04c472718b6555645bc063ba7 | ef0c2cb21aace91acb43588835213ed320ab1ef8 | refs/heads/master | 2022-12-25T17:35:22.680795 | 2020-10-12T21:27:42 | 2020-10-12T21:27:42 | 303,517,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,156 | java | package ru.linkov.ss.user.serialization.service.user.deserializer;
import com.fasterxml.jackson.databind.MappingIterator;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.dataformat.csv.CsvMapper;
import com.fasterxml.jackson.dataformat.csv.CsvSchema;
import ru.linkov.ss.user.serialization.model.User;
import ru.linkov.ss.user.serialization.model.UserCollection;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class CsvUserDeserializer implements UserDeserializer {
public Collection<User> deserialize(String inputFile) throws IOException {
CsvMapper objectMapper = new CsvMapper();
File file = new File(inputFile);
CsvSchema csvSchema = objectMapper
.schemaFor(User.class)
.withHeader();
Object o = objectMapper.reader(csvSchema)
.readValue(file);
UserCollection userCollection = (UserCollection) o;
System.out.println(userCollection);
return new ArrayList<>();
}
}
| [
"[email protected]"
] | |
119b5d71c1c7b6800b7f385b5252b01173f492c5 | 810016d0ef084fdb29fddc2e7f25da9a70444af6 | /src/main/java/com/ft/web/rest/MinioFilesResource.java | ad7ff80a3f7e334d5f27514126e17d78f44f2757 | [] | no_license | dinhtrung/jh6-gateway | 1bbfdde8f51064141bc7af14c9074a700523212a | 395a7bf7fc4a50c2b6deafb368a8f0b1c009bd2f | refs/heads/develop/main | 2022-07-30T03:32:41.492467 | 2020-04-08T01:32:38 | 2020-04-08T01:32:38 | 232,008,576 | 0 | 0 | null | 2022-07-07T15:29:49 | 2020-01-06T02:27:32 | Java | UTF-8 | Java | false | false | 11,029 | java | package com.ft.web.rest;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.io.FilenameUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.io.InputStreamResource;
import org.springframework.data.util.StreamUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;
import org.xmlpull.v1.XmlPullParserException;
import com.ft.config.MinioConfiguration;
import io.github.jhipster.web.util.HeaderUtil;
import io.minio.ErrorCode;
import io.minio.MinioClient;
import io.minio.ObjectStat;
import io.minio.PutObjectOptions;
import io.minio.errors.ErrorResponseException;
import io.minio.errors.InsufficientDataException;
import io.minio.errors.InternalException;
import io.minio.errors.InvalidBucketNameException;
import io.minio.errors.InvalidResponseException;
import io.minio.errors.RegionConflictException;
import io.minio.messages.Item;
@ConditionalOnProperty(prefix = "minio", name = { "endpoint", "bucket-name" })
@Controller
@RequestMapping("/api")
public class MinioFilesResource {
private final Logger log = LoggerFactory.getLogger(MinioFilesResource.class);
@Value("${jhipster.clientApp.name}")
private String applicationName;
@Autowired
MinioClient minioClient;
@Autowired
MinioConfiguration minioConfig;
@PostConstruct
public void initialized() {
log.info("=== MINIO ENDPOINT STARTED: /api/minio");
}
/**
* Browse available object under one bucket
* @param bucketName
* @return
* @throws Exception
*/
@GetMapping("/minio/{bucketName}")
public ResponseEntity<List<Item>> browseFiles(@PathVariable String bucketName) throws Exception {
List<Item> results = StreamUtils.createStreamFromIterator(minioClient.listObjects(bucketName).iterator())
.map(result -> {
try {
return result.get();
} catch (Exception e) {
return null;
}
}).filter(i -> i != null)
.collect(Collectors.toList());
return ResponseEntity.ok(results);
}
/**
* Upload file to default bucket
* @param name
* @param alt
* @param file
* @return
* @throws IOException
* @throws URISyntaxException
* @throws InvalidKeyException
* @throws InvalidBucketNameException
* @throws NoSuchAlgorithmException
* @throws NoResponseException
* @throws ErrorResponseException
* @throws InternalException
* @throws InvalidArgumentException
* @throws InsufficientDataException
* @throws InvalidResponseException
* @throws XmlPullParserException
* @throws RegionConflictException
*/
@PostMapping("/minio")
public ResponseEntity<String> putMinio(
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "alt", required = false) String alt,
@RequestParam("file") MultipartFile file)
throws Exception {
return putMinioWithBucket(minioConfig.getBucketName(), name, alt, file);
}
/**
* Upload file to any bucket
* @param bucketName
* @param name
* @param alt
* @param file
* @return
* @throws IOException
* @throws URISyntaxException
* @throws InvalidKeyException
* @throws InvalidBucketNameException
* @throws NoSuchAlgorithmException
* @throws NoResponseException
* @throws ErrorResponseException
* @throws InternalException
* @throws InvalidArgumentException
* @throws InsufficientDataException
* @throws InvalidResponseException
* @throws XmlPullParserException
* @throws RegionConflictException
*/
@PostMapping("/minio/{bucketName}")
public ResponseEntity<String> putMinioWithBucket(
@PathVariable String bucketName,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "alt", required = false) String alt,
@RequestParam("file") MultipartFile file
)
throws Exception {
name = (name == null ? file.getOriginalFilename() : name);
String basename = FilenameUtils.getBaseName(name).replaceAll("\\W+", "");
String ext = FilenameUtils.getExtension(name);
name = basename + "." + ext;
if (!minioClient.bucketExists(bucketName)) {
minioClient.makeBucket(bucketName);
}
int num = 0;
while(lookupObject(bucketName, name)) {
name = basename + (num++) + "." + ext;
}
log.debug("REST request to save Image : {}", name);
try (InputStream is = file.getInputStream()) {
minioClient.putObject(bucketName, name , is, new PutObjectOptions(file.getSize(), -1));
is.close();
} catch (Exception e) {
log.error("cannot open input stream", e);
}
return ResponseEntity.created(new URI("api/minio/?name=" + name))
.headers(HeaderUtil.createAlert(applicationName, "minio.created", name))
.body(name);
}
/**
* Proxy file back to client
* @param name
* @param alt
* @param file
* @return
* @throws IOException
* @throws URISyntaxException
* @throws InvalidKeyException
* @throws InvalidBucketNameException
* @throws NoSuchAlgorithmException
* @throws NoResponseException
* @throws ErrorResponseException
* @throws InternalException
* @throws InvalidArgumentException
* @throws InsufficientDataException
* @throws InvalidResponseException
* @throws XmlPullParserException
*/
@PostMapping("/public/upload-file")
public ResponseEntity<String> uploadToMinio(
@RequestParam(value = "bucket", required = false) String bucketName,
@RequestParam(value = "name", required = false) String name,
@RequestParam(value = "alt", required = false) String alt,
@RequestParam("file") MultipartFile file,
@RequestParam Map<String, String> params)
throws Exception {
name = (name == null ? file.getOriginalFilename() : name);
bucketName = bucketName == null ? minioConfig.getBucketName() : bucketName;
String basename = FilenameUtils.getBaseName(name).replaceAll("\\W+", "");
String ext = FilenameUtils.getExtension(name);
name = basename + "." + ext;
if (!minioClient.bucketExists(bucketName)) {
minioClient.makeBucket(bucketName);
}
int num = 0;
while(lookupObject(bucketName, name)) {
name = basename + (num++) + "." + ext;
}
log.debug("REST request to save file : {}", name);
try (InputStream is = file.getInputStream()) {
minioClient.putObject(bucketName, name , is, new PutObjectOptions(file.getSize(), -1));
is.close();
} catch (Exception e) {
log.error("cannot open input stream", e);
}
String result = minioClient.getObjectUrl(bucketName, name);
return ResponseEntity.created(new URI(result))
.headers(HeaderUtil.createAlert(applicationName, "minio.created", name))
.body(name);
}
/**
* Download a file from Minio back to client
* @param name
* @return
* @throws Exception
*/
@GetMapping("/public/download-file")
public ResponseEntity<InputStreamResource> downloadObject(@RequestParam String name) throws Exception {
ObjectStat objStat = minioClient.statObject(minioConfig.getBucketName(), name);
log.debug("REST request to download file: {} type {}", name, objStat.contentType());
return ResponseEntity.ok()
.header(HttpHeaders.CONTENT_TYPE, objStat.contentType())
.header("Content-Disposition", "attachment; filename=" + name)
.header(HttpHeaders.ETAG, objStat.etag())
.body(new InputStreamResource(minioClient.getObject(minioConfig.getBucketName(), name)));
}
@GetMapping("/public/static/{name}")
public ResponseEntity<InputStreamResource> downloadStatic(@PathVariable String name) throws Exception {
return downloadObject(name);
}
@RequestMapping(path = "/public/static/{name}", method = { RequestMethod.POST, RequestMethod.PUT })
public ResponseEntity<String> uploadFile(@PathVariable String name, @RequestBody String body, HttpServletRequest request) throws Exception {
String bucketName = minioConfig.getBucketName();
if (!minioClient.bucketExists(bucketName)) {
minioClient.makeBucket(bucketName);
}
ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes());
minioClient.putObject(bucketName, name , bais, new PutObjectOptions(bais.available(), -1));
bais.close();
log.debug("REST request to save object : {}", name);
return ResponseEntity.created(new URI("api/public/static/" + name))
.headers(HeaderUtil.createAlert(applicationName, "minio.created", name))
.body(name);
}
/**
* Generate a 302 redirect to temporary file URL
* @param name
* @return
* @throws Exception
*/
@GetMapping("/files/download-link")
public ResponseEntity<String> getDownloadLink(@RequestParam String name) throws Exception {
return ResponseEntity.status(HttpStatus.FOUND).header("Location", minioClient.presignedGetObject(minioConfig.getBucketName(), name)).build();
}
@GetMapping("/files/upload-link")
public ResponseEntity<String> getObject(@RequestParam String name) throws Exception {
return ResponseEntity.status(HttpStatus.FOUND).header("Location", minioClient.presignedPutObject(minioConfig.getBucketName(), name)).build();
}
public boolean lookupObject(String bucketName, String name) {
try {
minioClient.statObject(bucketName, name);
return true;
} catch (ErrorResponseException e) {
ErrorCode code = e.errorResponse().errorCode();
if (code != ErrorCode.NO_SUCH_KEY && code != ErrorCode.NO_SUCH_OBJECT) {
log.error("Other error occur.", e);
}
} catch (Exception e) {
log.error("Other error occur.", e);
}
return false;
}
}
| [
"[email protected]"
] | |
719f9589c62376bb6607f9568733e69211cf6e9e | c1c68c0bb96dbf8292f0237b10d0e63a7dff0fd1 | /app/src/main/java/com/example/finalproject/Activity/CafeActivity.java | 578cd516872c328747c275182e2ea2e14e0a836a | [] | no_license | ibalm9/CariTutorProject | 6d4efa8637b216f5a3992348488f82b5eb8c6dbd | c5cc44d5de5a93fde2d5a5159fa30de9c6c753ad | refs/heads/master | 2022-03-16T00:34:17.736296 | 2019-12-13T06:31:43 | 2019-12-13T06:31:43 | 211,025,241 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,516 | java | package com.example.finalproject.Activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import com.example.finalproject.R;
import com.example.finalproject.duabelasmodul_MySQL.Downloader;
public class CafeActivity extends AppCompatActivity {
final static String urlAddress2="http://vibrantoo.xyz/menumain/index1.php";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cafe);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar11);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
toolbar.setTitle("Warung Kopi");
toolbar.setTitleTextColor(getResources().getColor(android.R.color.black));
toolbar.setNavigationIcon(R.drawable.ic_icon__back);
final RecyclerView rv11= (RecyclerView) findViewById(R.id.rv11);
rv11.setLayoutManager(new LinearLayoutManager(this));
rv11.setItemAnimator(new DefaultItemAnimator());
new Downloader(CafeActivity.this,urlAddress2,rv11).execute();
}
@Override
public boolean onSupportNavigateUp() {
onBackPressed();
return true;
}
}
| [
"[email protected]"
] | |
8fca902fe738ede54dbfd8487756c96edc282229 | 6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386 | /google/ads/googleads/v6/googleads-java/gapic-googleads-java/src/main/java/com/google/ads/googleads/v6/services/stub/AdParameterServiceStub.java | d32ad98d6077394467c88f6f262b3166bd36182f | [
"Apache-2.0"
] | permissive | oltoco/googleapis-gen | bf40cfad61b4217aca07068bd4922a86e3bbd2d5 | 00ca50bdde80906d6f62314ef4f7630b8cdb6e15 | refs/heads/master | 2023-07-17T22:11:47.848185 | 2021-08-29T20:39:47 | 2021-08-29T20:39:47 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,800 | java | /*
* Copyright 2021 Google LLC
*
* 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 com.google.ads.googleads.v6.services.stub;
import com.google.ads.googleads.v6.resources.AdParameter;
import com.google.ads.googleads.v6.services.GetAdParameterRequest;
import com.google.ads.googleads.v6.services.MutateAdParametersRequest;
import com.google.ads.googleads.v6.services.MutateAdParametersResponse;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.rpc.UnaryCallable;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Base stub class for the AdParameterService service API.
*
* <p>This class is for advanced usage and reflects the underlying API directly.
*/
@Generated("by gapic-generator-java")
public abstract class AdParameterServiceStub implements BackgroundResource {
public UnaryCallable<GetAdParameterRequest, AdParameter> getAdParameterCallable() {
throw new UnsupportedOperationException("Not implemented: getAdParameterCallable()");
}
public UnaryCallable<MutateAdParametersRequest, MutateAdParametersResponse>
mutateAdParametersCallable() {
throw new UnsupportedOperationException("Not implemented: mutateAdParametersCallable()");
}
@Override
public abstract void close();
}
| [
"bazel-bot-development[bot]@users.noreply.github.com"
] | bazel-bot-development[bot]@users.noreply.github.com |
55960ec7489a20aa9d72c2c8476a85ca726c9c07 | 6f66adfb956e323abc5e5a3a3f0376c3e74ba32d | /src/main/java/com/privalia/presentation/annotations3/HelloWorld.java | ab8f9c947f9863b4d2f5634ef13398d5f97a35ae | [] | no_license | loqum/PrivaliaSpringProject | 50dab1251754e063c3af20fe2c83a805c86f6e80 | 49b363bce11566760329879ce98c72ae26ff667b | refs/heads/master | 2020-03-27T03:29:10.423932 | 2018-08-23T15:43:05 | 2018-08-23T15:43:05 | 145,867,126 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 771 | java | package com.privalia.presentation.annotations3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component(value = "helloWorld")
public class HelloWorld {
private String hello;
public String getHello() {
return hello;
}
public void setHello(String hello) {
this.hello = hello;
}
public HelloWorld() {
}
@Autowired
public HelloWorld(@Value("Hello World from constructor") String hello) {
this.hello = hello;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("HelloWorld [hello=");
builder.append(hello);
builder.append("]");
return builder.toString();
}
}
| [
"[email protected]"
] | |
e795a3aa96965c48fb514bba742ac69722872b72 | a4cb372ced240bf1cf0a9d123bdd4a805ff05df6 | /spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/jar/JarUrlProtocolHandler.java | 69367a1f6e0c88abfbc2a4dd8ab587202b65df35 | [] | no_license | ZhaoBinxian/spring-boot-maven-ben | c7ea6a431c3206959009ff5344547436e98d75ca | ebd43548bae1e35fff174c316ad154cd0e5defb3 | refs/heads/master | 2023-07-18T12:53:49.028864 | 2021-09-07T04:55:54 | 2021-09-07T04:55:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,018 | java | /*
* Copyright 2012-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.boot.loader.jar;
import java.io.File;
import java.lang.ref.SoftReference;
import java.util.Map;
import org.junit.jupiter.api.extension.AfterEachCallback;
import org.junit.jupiter.api.extension.BeforeEachCallback;
import org.junit.jupiter.api.extension.Extension;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.springframework.test.util.ReflectionTestUtils;
/**
* JUnit 5 {@link Extension} for tests that interact with Spring Boot's {@link Handler}
* for {@code jar:} URLs. Ensures that the handler is registered prior to test execution
* and cleans up the handler's root file cache afterwards.
*
* @author Andy Wilkinson
*/
class JarUrlProtocolHandler implements BeforeEachCallback, AfterEachCallback {
@Override
public void beforeEach(ExtensionContext context) throws Exception {
JarFile.registerUrlProtocolHandler();
}
@Override
@SuppressWarnings("unchecked")
public void afterEach(ExtensionContext context) throws Exception {
Map<File, JarFile> rootFileCache = ((SoftReference<Map<File, JarFile>>) ReflectionTestUtils
.getField(Handler.class, "rootFileCache")).get();
if (rootFileCache != null) {
for (JarFile rootJarFile : rootFileCache.values()) {
rootJarFile.close();
}
rootFileCache.clear();
}
}
}
| [
"[email protected]"
] | |
594169cc0b5668d2d3ed167f354a898d8bc18510 | 6a02d144ffb183daa9247f44fbc9f5b7e6747e17 | /Module2/Module2-IO-TextFile/src/demo_chi_Chau/TextFile.java | 4ab1aaaf1be75a60387cd589c6188cda1030fb61 | [] | no_license | tungchihuy95/tungGitProject | 861c517f9e0c5a5cee3312325f766969c756534c | 953c6cc1ca5d2f4de2ac31a21fcf97cc61ef0a13 | refs/heads/master | 2023-01-02T00:23:22.705422 | 2020-10-30T08:55:30 | 2020-10-30T08:55:30 | 270,575,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 744 | java | package demo_chi_Chau;
import java.io.*;
public class TextFile {
//Ghi trc hoac doc trc cung dc
//Ghi
public void writeTextFile(String pathname) {
try {
FileWriter fileWriter = new FileWriter(pathname, true); // neu muon ghi noi tiep thi them append
fileWriter.write("\t chao Tung!");
fileWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public void readTextFile(String pathname) {
try {
FileReader fileReader = new FileReader(pathname);
BufferedReader bufferedReader = new BufferedReader(fileReader);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
| [
"[email protected]"
] | |
d6320a362e30ca753123627e2f94934c0d04dbf7 | b9cc85095c1f5ec264d984f61bc34ef54fdbb963 | /hello/src/exam/MonthEnd2.java | 514465a8c40030dcfafd2ca49c2c0b761e081d24 | [] | no_license | selss2/hanbitjse | 236f9ef81019d84d645068c3cec5c353fc83bb42 | ca614315a1eeeef7d92568e05c70bbfdd1535e9a | refs/heads/master | 2021-01-09T20:07:44.133080 | 2016-06-24T07:26:44 | 2016-06-24T07:26:54 | 60,753,866 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,659 | java | /**
*
*/
package exam;
import java.util.Scanner;
/**
* @date :2016. 6. 9.
* @author :오승준
* @file :MonthEnd.java
* @story :
*/
public class MonthEnd2 {
/**
* 개발자님 년, 월을 입력하면 말일이 몇일이 알려주는 프로그램을 만들어 주세요. 단, 윤년 2월은 29일이고, 나머지 해는 28일로
* 마감입니다. 1~12를 벗어난 숫자를 입력하면 잘못된 입력값입니다 라고 뜬다.
**/
/**
* 윤년의 조건 연도를 4로 나눈 값이 0이라면 윤년일 수 있다. 그러나 해당 연수가 100으로 나눠 떨어지면 평년이다. 2000년은
* 4로 나눈값이 0이라서 윤년의 조건은 되는데 다시 이 값이 100으로 나눠 떨어지기 때문에 평년이 되었다. 평년이라해도 다시
* 400으로 나눠떨어지는 년도는 윤년이다.
**/
// if((year % 100 != 0) && (year % 4 == 0))
// else if(year % 400 == 0)
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int day=0,year=2016;
System.out.println("년 입력?(예)2016");
year = scanner.nextInt();
System.out.println("월 입력?(예)2");
int month = 2;
switch (scanner.nextInt()) {
case 1:case 3:case 5:case 7:case 8:case 10:case 12:
day = 31;
break;
case 2:
day = (year%4==0 && year%100!=0 ||year%400==0)?29:28;
break;
case 4:case 6:case 9:case 11:
day = 30;
break;
default:System.out.println("잘못 입력 되었습니다");
return;
}
System.out.println(year+"년\n"+month+"월\n"+day+"일\n");
}
} | [
"hb2016@hb2016-PC"
] | hb2016@hb2016-PC |
2941b824dd3098d564cd1a80d24e247318c7faf6 | 02b93ebb6866092c411a3dcd10ffc8ec30ee25fc | /src/main/java/com/app/exception/BookException.java | 615ab79b418131f79a26df73e1794f1c0874d3af | [] | no_license | barfa02dec/BookApp | 0069e019ec1b516001f5cb9ad539f355cc2216b6 | 06602245f7a6f8391fd829a74211fb425df9ff42 | refs/heads/master | 2021-01-03T18:39:27.301413 | 2020-02-25T06:59:46 | 2020-02-25T06:59:46 | 240,194,297 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | package com.app.exception;
@SuppressWarnings("serial")
public class BookException extends Exception {
public BookException(String msg) {
super(msg);
}
}
| [
"[email protected]"
] | |
c2a8256edefc87132a0a4dc3502bf505dd1d9e67 | e6ca6dc607a8704c6f1d2bb00998f288f1b9996b | /modules/sphms-common-service-module/sphms-common-service-module-api/src/main/java/com/sphms/common/service/model/HordingWrapper.java | f0fe8e22fbc0900f2af2d43b890bb6ac0746ec97 | [] | no_license | rpsandip/sphms | c515efbaf3efae5b531471f5ea474a926d171422 | fc50436bb0d1cb8d8c2e20c6722a7093c33b45d7 | refs/heads/master | 2023-03-03T07:13:42.094670 | 2019-07-14T02:53:22 | 2019-07-14T02:53:22 | 98,117,259 | 0 | 0 | null | 2023-02-27T23:22:53 | 2017-07-23T18:27:49 | Java | UTF-8 | Java | false | false | 17,329 | java | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.sphms.common.service.model;
import aQute.bnd.annotation.ProviderType;
import com.liferay.expando.kernel.model.ExpandoBridge;
import com.liferay.portal.kernel.model.ModelWrapper;
import com.liferay.portal.kernel.service.ServiceContext;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* <p>
* This class is a wrapper for {@link Hording}.
* </p>
*
* @author Brian Wing Shun Chan
* @see Hording
* @generated
*/
@ProviderType
public class HordingWrapper implements Hording, ModelWrapper<Hording> {
public HordingWrapper(Hording hording) {
_hording = hording;
}
@Override
public Class<?> getModelClass() {
return Hording.class;
}
@Override
public String getModelClassName() {
return Hording.class.getName();
}
@Override
public Map<String, Object> getModelAttributes() {
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put("hordingId", getHordingId());
attributes.put("title", getTitle());
attributes.put("location", getLocation());
attributes.put("city", getCity());
attributes.put("district", getDistrict());
attributes.put("state", getState());
attributes.put("hordingType", getHordingType());
attributes.put("mediaVehicle", getMediaVehicle());
attributes.put("size", getSize());
attributes.put("pricePerMonth", getPricePerMonth());
attributes.put("normalImageId", getNormalImageId());
attributes.put("shortImageId", getShortImageId());
attributes.put("longImageId", getLongImageId());
attributes.put("landLordId", getLandLordId());
attributes.put("ownerType", getOwnerType());
attributes.put("upinNo", getUpinNo());
attributes.put("mncTax", getMncTax());
attributes.put("otherExpYear", getOtherExpYear());
attributes.put("status", getStatus());
attributes.put("createDate", getCreateDate());
attributes.put("createdBy", getCreatedBy());
attributes.put("modifiedDate", getModifiedDate());
attributes.put("modifiedBy", getModifiedBy());
return attributes;
}
@Override
public void setModelAttributes(Map<String, Object> attributes) {
Long hordingId = (Long)attributes.get("hordingId");
if (hordingId != null) {
setHordingId(hordingId);
}
String title = (String)attributes.get("title");
if (title != null) {
setTitle(title);
}
String location = (String)attributes.get("location");
if (location != null) {
setLocation(location);
}
String city = (String)attributes.get("city");
if (city != null) {
setCity(city);
}
String district = (String)attributes.get("district");
if (district != null) {
setDistrict(district);
}
String state = (String)attributes.get("state");
if (state != null) {
setState(state);
}
String hordingType = (String)attributes.get("hordingType");
if (hordingType != null) {
setHordingType(hordingType);
}
String mediaVehicle = (String)attributes.get("mediaVehicle");
if (mediaVehicle != null) {
setMediaVehicle(mediaVehicle);
}
String size = (String)attributes.get("size");
if (size != null) {
setSize(size);
}
Double pricePerMonth = (Double)attributes.get("pricePerMonth");
if (pricePerMonth != null) {
setPricePerMonth(pricePerMonth);
}
Long normalImageId = (Long)attributes.get("normalImageId");
if (normalImageId != null) {
setNormalImageId(normalImageId);
}
Long shortImageId = (Long)attributes.get("shortImageId");
if (shortImageId != null) {
setShortImageId(shortImageId);
}
Long longImageId = (Long)attributes.get("longImageId");
if (longImageId != null) {
setLongImageId(longImageId);
}
Long landLordId = (Long)attributes.get("landLordId");
if (landLordId != null) {
setLandLordId(landLordId);
}
Integer ownerType = (Integer)attributes.get("ownerType");
if (ownerType != null) {
setOwnerType(ownerType);
}
String upinNo = (String)attributes.get("upinNo");
if (upinNo != null) {
setUpinNo(upinNo);
}
Double mncTax = (Double)attributes.get("mncTax");
if (mncTax != null) {
setMncTax(mncTax);
}
Double otherExpYear = (Double)attributes.get("otherExpYear");
if (otherExpYear != null) {
setOtherExpYear(otherExpYear);
}
Integer status = (Integer)attributes.get("status");
if (status != null) {
setStatus(status);
}
Date createDate = (Date)attributes.get("createDate");
if (createDate != null) {
setCreateDate(createDate);
}
Long createdBy = (Long)attributes.get("createdBy");
if (createdBy != null) {
setCreatedBy(createdBy);
}
Date modifiedDate = (Date)attributes.get("modifiedDate");
if (modifiedDate != null) {
setModifiedDate(modifiedDate);
}
Long modifiedBy = (Long)attributes.get("modifiedBy");
if (modifiedBy != null) {
setModifiedBy(modifiedBy);
}
}
@Override
public Hording toEscapedModel() {
return new HordingWrapper(_hording.toEscapedModel());
}
@Override
public Hording toUnescapedModel() {
return new HordingWrapper(_hording.toUnescapedModel());
}
@Override
public boolean isCachedModel() {
return _hording.isCachedModel();
}
@Override
public boolean isEscapedModel() {
return _hording.isEscapedModel();
}
@Override
public boolean isNew() {
return _hording.isNew();
}
@Override
public ExpandoBridge getExpandoBridge() {
return _hording.getExpandoBridge();
}
@Override
public com.liferay.portal.kernel.model.CacheModel<Hording> toCacheModel() {
return _hording.toCacheModel();
}
/**
* Returns the mnc tax of this hording.
*
* @return the mnc tax of this hording
*/
@Override
public double getMncTax() {
return _hording.getMncTax();
}
/**
* Returns the other exp year of this hording.
*
* @return the other exp year of this hording
*/
@Override
public double getOtherExpYear() {
return _hording.getOtherExpYear();
}
/**
* Returns the price per month of this hording.
*
* @return the price per month of this hording
*/
@Override
public double getPricePerMonth() {
return _hording.getPricePerMonth();
}
@Override
public int compareTo(Hording hording) {
return _hording.compareTo(hording);
}
/**
* Returns the owner type of this hording.
*
* @return the owner type of this hording
*/
@Override
public int getOwnerType() {
return _hording.getOwnerType();
}
/**
* Returns the status of this hording.
*
* @return the status of this hording
*/
@Override
public int getStatus() {
return _hording.getStatus();
}
@Override
public int hashCode() {
return _hording.hashCode();
}
@Override
public Serializable getPrimaryKeyObj() {
return _hording.getPrimaryKeyObj();
}
@Override
public java.lang.Object clone() {
return new HordingWrapper((Hording)_hording.clone());
}
/**
* Returns the city of this hording.
*
* @return the city of this hording
*/
@Override
public java.lang.String getCity() {
return _hording.getCity();
}
/**
* Returns the district of this hording.
*
* @return the district of this hording
*/
@Override
public java.lang.String getDistrict() {
return _hording.getDistrict();
}
/**
* Returns the hording type of this hording.
*
* @return the hording type of this hording
*/
@Override
public java.lang.String getHordingType() {
return _hording.getHordingType();
}
/**
* Returns the location of this hording.
*
* @return the location of this hording
*/
@Override
public java.lang.String getLocation() {
return _hording.getLocation();
}
/**
* Returns the media vehicle of this hording.
*
* @return the media vehicle of this hording
*/
@Override
public java.lang.String getMediaVehicle() {
return _hording.getMediaVehicle();
}
/**
* Returns the size of this hording.
*
* @return the size of this hording
*/
@Override
public java.lang.String getSize() {
return _hording.getSize();
}
/**
* Returns the state of this hording.
*
* @return the state of this hording
*/
@Override
public java.lang.String getState() {
return _hording.getState();
}
/**
* Returns the title of this hording.
*
* @return the title of this hording
*/
@Override
public java.lang.String getTitle() {
return _hording.getTitle();
}
/**
* Returns the upin no of this hording.
*
* @return the upin no of this hording
*/
@Override
public java.lang.String getUpinNo() {
return _hording.getUpinNo();
}
@Override
public java.lang.String toString() {
return _hording.toString();
}
@Override
public java.lang.String toXmlString() {
return _hording.toXmlString();
}
/**
* Returns the create date of this hording.
*
* @return the create date of this hording
*/
@Override
public Date getCreateDate() {
return _hording.getCreateDate();
}
/**
* Returns the modified date of this hording.
*
* @return the modified date of this hording
*/
@Override
public Date getModifiedDate() {
return _hording.getModifiedDate();
}
/**
* Returns the created by of this hording.
*
* @return the created by of this hording
*/
@Override
public long getCreatedBy() {
return _hording.getCreatedBy();
}
/**
* Returns the hording ID of this hording.
*
* @return the hording ID of this hording
*/
@Override
public long getHordingId() {
return _hording.getHordingId();
}
/**
* Returns the land lord ID of this hording.
*
* @return the land lord ID of this hording
*/
@Override
public long getLandLordId() {
return _hording.getLandLordId();
}
/**
* Returns the long image ID of this hording.
*
* @return the long image ID of this hording
*/
@Override
public long getLongImageId() {
return _hording.getLongImageId();
}
/**
* Returns the modified by of this hording.
*
* @return the modified by of this hording
*/
@Override
public long getModifiedBy() {
return _hording.getModifiedBy();
}
/**
* Returns the normal image ID of this hording.
*
* @return the normal image ID of this hording
*/
@Override
public long getNormalImageId() {
return _hording.getNormalImageId();
}
/**
* Returns the primary key of this hording.
*
* @return the primary key of this hording
*/
@Override
public long getPrimaryKey() {
return _hording.getPrimaryKey();
}
/**
* Returns the short image ID of this hording.
*
* @return the short image ID of this hording
*/
@Override
public long getShortImageId() {
return _hording.getShortImageId();
}
@Override
public void persist() {
_hording.persist();
}
@Override
public void setCachedModel(boolean cachedModel) {
_hording.setCachedModel(cachedModel);
}
/**
* Sets the city of this hording.
*
* @param city the city of this hording
*/
@Override
public void setCity(java.lang.String city) {
_hording.setCity(city);
}
/**
* Sets the create date of this hording.
*
* @param createDate the create date of this hording
*/
@Override
public void setCreateDate(Date createDate) {
_hording.setCreateDate(createDate);
}
/**
* Sets the created by of this hording.
*
* @param createdBy the created by of this hording
*/
@Override
public void setCreatedBy(long createdBy) {
_hording.setCreatedBy(createdBy);
}
/**
* Sets the district of this hording.
*
* @param district the district of this hording
*/
@Override
public void setDistrict(java.lang.String district) {
_hording.setDistrict(district);
}
@Override
public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
_hording.setExpandoBridgeAttributes(expandoBridge);
}
@Override
public void setExpandoBridgeAttributes(
com.liferay.portal.kernel.model.BaseModel<?> baseModel) {
_hording.setExpandoBridgeAttributes(baseModel);
}
@Override
public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
_hording.setExpandoBridgeAttributes(serviceContext);
}
/**
* Sets the hording ID of this hording.
*
* @param hordingId the hording ID of this hording
*/
@Override
public void setHordingId(long hordingId) {
_hording.setHordingId(hordingId);
}
/**
* Sets the hording type of this hording.
*
* @param hordingType the hording type of this hording
*/
@Override
public void setHordingType(java.lang.String hordingType) {
_hording.setHordingType(hordingType);
}
/**
* Sets the land lord ID of this hording.
*
* @param landLordId the land lord ID of this hording
*/
@Override
public void setLandLordId(long landLordId) {
_hording.setLandLordId(landLordId);
}
/**
* Sets the location of this hording.
*
* @param location the location of this hording
*/
@Override
public void setLocation(java.lang.String location) {
_hording.setLocation(location);
}
/**
* Sets the long image ID of this hording.
*
* @param longImageId the long image ID of this hording
*/
@Override
public void setLongImageId(long longImageId) {
_hording.setLongImageId(longImageId);
}
/**
* Sets the media vehicle of this hording.
*
* @param mediaVehicle the media vehicle of this hording
*/
@Override
public void setMediaVehicle(java.lang.String mediaVehicle) {
_hording.setMediaVehicle(mediaVehicle);
}
/**
* Sets the mnc tax of this hording.
*
* @param mncTax the mnc tax of this hording
*/
@Override
public void setMncTax(double mncTax) {
_hording.setMncTax(mncTax);
}
/**
* Sets the modified by of this hording.
*
* @param modifiedBy the modified by of this hording
*/
@Override
public void setModifiedBy(long modifiedBy) {
_hording.setModifiedBy(modifiedBy);
}
/**
* Sets the modified date of this hording.
*
* @param modifiedDate the modified date of this hording
*/
@Override
public void setModifiedDate(Date modifiedDate) {
_hording.setModifiedDate(modifiedDate);
}
@Override
public void setNew(boolean n) {
_hording.setNew(n);
}
/**
* Sets the normal image ID of this hording.
*
* @param normalImageId the normal image ID of this hording
*/
@Override
public void setNormalImageId(long normalImageId) {
_hording.setNormalImageId(normalImageId);
}
/**
* Sets the other exp year of this hording.
*
* @param otherExpYear the other exp year of this hording
*/
@Override
public void setOtherExpYear(double otherExpYear) {
_hording.setOtherExpYear(otherExpYear);
}
/**
* Sets the owner type of this hording.
*
* @param ownerType the owner type of this hording
*/
@Override
public void setOwnerType(int ownerType) {
_hording.setOwnerType(ownerType);
}
/**
* Sets the price per month of this hording.
*
* @param pricePerMonth the price per month of this hording
*/
@Override
public void setPricePerMonth(double pricePerMonth) {
_hording.setPricePerMonth(pricePerMonth);
}
/**
* Sets the primary key of this hording.
*
* @param primaryKey the primary key of this hording
*/
@Override
public void setPrimaryKey(long primaryKey) {
_hording.setPrimaryKey(primaryKey);
}
@Override
public void setPrimaryKeyObj(Serializable primaryKeyObj) {
_hording.setPrimaryKeyObj(primaryKeyObj);
}
/**
* Sets the short image ID of this hording.
*
* @param shortImageId the short image ID of this hording
*/
@Override
public void setShortImageId(long shortImageId) {
_hording.setShortImageId(shortImageId);
}
/**
* Sets the size of this hording.
*
* @param size the size of this hording
*/
@Override
public void setSize(java.lang.String size) {
_hording.setSize(size);
}
/**
* Sets the state of this hording.
*
* @param state the state of this hording
*/
@Override
public void setState(java.lang.String state) {
_hording.setState(state);
}
/**
* Sets the status of this hording.
*
* @param status the status of this hording
*/
@Override
public void setStatus(int status) {
_hording.setStatus(status);
}
/**
* Sets the title of this hording.
*
* @param title the title of this hording
*/
@Override
public void setTitle(java.lang.String title) {
_hording.setTitle(title);
}
/**
* Sets the upin no of this hording.
*
* @param upinNo the upin no of this hording
*/
@Override
public void setUpinNo(java.lang.String upinNo) {
_hording.setUpinNo(upinNo);
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof HordingWrapper)) {
return false;
}
HordingWrapper hordingWrapper = (HordingWrapper)obj;
if (Objects.equals(_hording, hordingWrapper._hording)) {
return true;
}
return false;
}
@Override
public Hording getWrappedModel() {
return _hording;
}
@Override
public boolean isEntityCacheEnabled() {
return _hording.isEntityCacheEnabled();
}
@Override
public boolean isFinderCacheEnabled() {
return _hording.isFinderCacheEnabled();
}
@Override
public void resetOriginalValues() {
_hording.resetOriginalValues();
}
private final Hording _hording;
} | [
"[email protected]"
] | |
da4fc307921c3d11a577124f481b0e61d551746d | 462185916fe2920390abf30626339429e3e54356 | /backend/services/main/src/main/java/pl/aredlisiak/main/name/service/NameService.java | 975ed937800a3e824e09e7bc62043d0dc1bbd264 | [] | no_license | aredlisiak/multi-serve | f158bd32e40e004694b45c6b560337174051d377 | 90b09e00960ccbeb2b511dedf2b16a1d5993b8bc | refs/heads/master | 2022-06-12T12:37:22.122494 | 2020-05-04T17:18:14 | 2020-05-04T17:18:20 | 260,434,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 210 | java | package pl.aredlisiak.main.name.service;
import lombok.Getter;
import org.springframework.stereotype.Component;
@Component
@Getter
public class NameService {
private final String name = "MAIN SERVICE";
}
| [
"[email protected]"
] | |
bf47deef463867e6180504c8a11f8a4a3469e641 | d03125545dc458cdbb4d3809beae1a25a755e2ee | /src/main/java/com/foreseers/tj/util/WebUpload.java | 13b7857da832198f9ce704824ccb0ac38149e518 | [] | no_license | yisongkeji/zhuding_java | 89a27fc5496cc9febbc27218692ce5b95fc9d391 | 98fd5d818da5532e5e137a0a24cc6c22c654f07b | refs/heads/master | 2020-05-18T05:24:45.729493 | 2019-04-26T06:08:04 | 2019-04-26T06:08:04 | 184,202,920 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 604 | java | package com.foreseers.tj.util;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix = "web")
public class WebUpload {
private String uploadpath ;
private String frontpath;
public String getUploadpath() {
return uploadpath;
}
public void setUploadpath(String uploadpath) {
this.uploadpath = uploadpath;
}
public String getFrontpath() {
return frontpath;
}
public void setFrontpath(String frontpath) {
this.frontpath = frontpath;
}
}
| [
"[email protected]"
] | |
3a3a1e2c2137dc9030d4c41673f18f926e10fcba | 545279c348f3794ec6bacbc618b0ba580a5db236 | /app/src/test/java/red/itvirtuoso/pingpong3/app/server/ServerProxyTest.java | b4c4bf3f8d7f80304f305f4657cf2d2f91d8e015 | [
"Apache-2.0"
] | permissive | shuidong/client-android | e3eb1ff9b50e8a9b690e65969f07df8e86a9c670 | a3e55d611a19dd8e7c8416817ceb2f1ecaa94cdf | refs/heads/master | 2020-12-25T04:19:15.030439 | 2015-06-13T15:12:44 | 2015-06-13T15:12:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,424 | java | package red.itvirtuoso.pingpong3.app.server;
import org.junit.Test;
import java.io.IOException;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.nullValue;
/**
* Created by kenji on 15/05/07.
*/
public class ServerProxyTest {
private class TestServerProxy extends ServerProxy {
@Override
public void connect() throws IOException {
/* nop */
}
@Override
public void send(Packet packet) throws IOException {
/* nop */
}
@Override
public void disconnect() {
/* nop */
}
}
@Test
public void 何も追加していないときはnullが返る() throws Exception {
TestServerProxy serverProxy = new TestServerProxy();
assertThat(serverProxy.receive(), is(nullValue()));
}
@Test
public void 追加したパケットが順に取り出せる() throws Exception {
TestServerProxy serverProxy = new TestServerProxy();
Packet packet1 = new Packet(PacketType.ME_READY);
Packet packet2 = new Packet(PacketType.RIVAL_READY);
serverProxy.add(packet1);
serverProxy.add(packet2);
assertThat(serverProxy.receive(), is(packet1));
assertThat(serverProxy.receive(), is(packet2));
assertThat(serverProxy.receive(), is(nullValue()));
}
}
| [
"[email protected]"
] | |
01614f85b60ebef392b3582d0ce17365beb82c99 | f9aff19052f87e931c9a2e4b54274a82426ab2fc | /ibu_service/src/main/java/com/luolong/service/MenuService.java | 2917d2c96ed140fd6ed7e409c8cd55c068615c40 | [] | no_license | 1324516619/ibu_mng | 81e1c5e9c126a79fe28cfb92ed084b5d933d66d5 | 20425a3902b3f89dabb74007955a626a1cf6b973 | refs/heads/master | 2020-04-01T22:36:53.340410 | 2018-10-31T06:45:13 | 2018-10-31T06:45:13 | 153,711,157 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 478 | java | package com.luolong.service;
import java.util.List;
import com.luolong.model.Menu;
import com.luolong.model.User;
import com.luolong.page.Pagination;
public interface MenuService {
List<Menu> queryUserMenu(User user);
List<Menu> queryAllMenu();
/**
* 分页查询
*/
Pagination getPage(Menu menu, int currentPage, int pageSize);
int add(Menu menu);
int edit(Menu menu);
Menu getMenu(Menu menu);
}
| [
"[email protected]"
] | |
fe8cce52958cf4dfe0b4901acc2e468045c90bf6 | f755df733e176386e7dbde8cdc4c2ce50e7ed2f1 | /src/java8/ch01/ex05/CurrentStringTime.java | 305af28e3962b7ea8b4a71e2eb71a2fd547e48d6 | [] | no_license | sabo10o29/java_train | 0709be3071ceb0c1ef4569280ac38c0a55bb55f5 | fc73e97b8d1bcf7012696986d756845f2fb7263c | refs/heads/master | 2021-01-13T10:06:11.776488 | 2017-09-08T00:25:30 | 2017-09-08T00:25:30 | 72,120,168 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,530 | java | package java8.ch01.ex05;
import java.util.Calendar;
/**
* 時計の文字クラス:現在の時刻を取得してString型で返す。
*
* @author YoshikazuMurase
*
*/
public class CurrentStringTime {
public static String[] getFullTime() {
String[] strs = new String[11];
Calendar cal = Calendar.getInstance();
strs[0] = CurrentStringTime.getSec(cal)[0];
strs[1] = CurrentStringTime.getSec(cal)[1];
strs[2] = CurrentStringTime.getMin(cal)[0];
strs[3] = CurrentStringTime.getMin(cal)[1];
strs[4] = CurrentStringTime.getHour(cal)[0];
strs[5] = CurrentStringTime.getHour(cal)[1];
strs[6] = CurrentStringTime.getDay(cal)[0];
strs[7] = CurrentStringTime.getDay(cal)[1];
strs[8] = CurrentStringTime.getMonth(cal)[0];
strs[9] = CurrentStringTime.getMonth(cal)[1];
strs[10] = CurrentStringTime.getYear(cal);
return strs;
}
public static String[] getSec() {
return tenDigitStrings(Calendar.getInstance().get(Calendar.SECOND));
}
public static String[] getMin() {
return tenDigitStrings(Calendar.getInstance().get(Calendar.MINUTE));
}
public static String[] getHour() {
return tenDigitStrings(Calendar.getInstance().get(Calendar.HOUR));
}
public static String[] getDay() {
return tenDigitStrings(Calendar.getInstance().get(Calendar.DATE));
}
public static String[] getMonth() {
return tenDigitStrings(Calendar.getInstance().get(Calendar.MONTH));
}
public static String getYear() {
return String.valueOf(Calendar.getInstance().get(Calendar.YEAR));
}
public static String[] getSec(Calendar cal) {
return tenDigitStrings(cal.get(Calendar.SECOND));
}
public static String[] getMin(Calendar cal) {
return tenDigitStrings(cal.get(Calendar.MINUTE));
}
public static String[] getHour(Calendar cal) {
return tenDigitStrings(cal.get(Calendar.HOUR));
}
public static String[] getDay(Calendar cal) {
return tenDigitStrings(cal.get(Calendar.DATE));
}
public static String[] getMonth(Calendar cal) {
return tenDigitStrings(cal.get(Calendar.MONTH));
}
public static String getYear(Calendar cal) {
return String.valueOf(cal.get(Calendar.YEAR));
}
// 10桁のフォントに変更するメソッド
// 1桁の場合には10桁に変更する
private static String[] tenDigitStrings(int _number) {
String[] strs = new String[2];
// 一桁目:10で割ったあまりが入る
strs[0] = String.valueOf(((int) _number % 10));
// 二桁目:10で割った商が入る
strs[1] = String.valueOf(((int) _number / 10));
return strs;
}
}
| [
"[email protected]"
] | |
e18f7c77e0b6ac52449dbaf13fc06df11730ab63 | c7540ab5532d065fad7830ca460c53f5895985a7 | /java/expression/exceptions/CheckedLog.java | da613d77d7b6bcfec5c2a591635369bf2a6005b3 | [] | no_license | UnrealEugene/paradigms-2020 | 66c636a12c40c2ebbda2667d1ea5a19eaf3b8081 | 907d8d95228d7defca6ae90a20136fb1af6613c5 | refs/heads/master | 2022-11-26T05:00:24.971745 | 2020-07-31T08:10:46 | 2020-07-31T08:12:03 | 245,911,295 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 646 | java | package expression.exceptions;
import expression.Log;
import expression.MultipleExpression;
public class CheckedLog extends Log implements MultipleExpression {
public CheckedLog(MultipleExpression val, MultipleExpression base) {
super(val, base);
}
@Override
protected int calculate(int val, int base) {
if (base <= 1) {
throw new ExpressionLogException("Invalid logarithm base: " + val + " // " + base);
}
if (val <= 0) {
throw new ExpressionLogException("Logarithm of non-positive: " + val + " // " + base);
}
return super.calculate(val, base);
}
}
| [
"[email protected]"
] | |
7cc4d0535a1128628de0c0bdacbf1054e4825438 | 8f6a09847ea6fb13fa89aec2dd9411adfa52d8b6 | /src/main/java/com/aohuan/dodo/java_demo/qiniu/offical/move.java | d64058224b4323574a6d16e65f4f64422fdb5d4b | [] | no_license | 2954722256/java_demo | 2ec206d9fdc4e9aff7c6eaed3458f6532bcacf37 | efb8e9446b67584b1ad06cf9aac34d431b96e469 | refs/heads/master | 2021-01-11T20:52:54.986918 | 2017-03-27T04:03:30 | 2017-03-27T04:21:57 | 79,201,262 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,333 | java | package com.aohuan.dodo.java_demo.qiniu.offical;
import com.qiniu.common.QiniuException;
import com.qiniu.http.Response;
import com.qiniu.storage.BucketManager;
import com.qiniu.util.Auth;
import com.qiniu.common.Zone;
import com.qiniu.storage.Configuration;
public class move {
public static void main(String args[]) {
//设置需要操作的账号的AK和SK
String ACCESS_KEY = "Access_Key";
String SECRET_KEY = "Secret_Key";
Auth auth = Auth.create(ACCESS_KEY, SECRET_KEY);
Zone z = Zone.zone0();
Configuration c = new Configuration(z);
//实例化一个BucketManager对象
BucketManager bucketManager = new BucketManager(auth, c);
//要测试的空间和key,并且这个key在你空间中存在
String bucket = "Bucket_Name";
String key = "Bucket_key";
//将文件从文件key移动到文件key2, 可以在不同bucket移动,同空间移动相当于重命名
String key2 = "yourjavakey";
try {
//调用move方法移动文件
bucketManager.move(bucket, key, bucket, key2);
} catch (QiniuException e) {
//捕获异常信息
Response r = e.response;
System.out.println(r.toString());
}
}
} | [
"[email protected]"
] | |
c3b9e381bb26221b846b759074c0101963cf2395 | 43145c76d8088adb3ea4911735be23108c273f01 | /soot3/src/soot/dexpler/instructions/IfTestInstruction.java | 837a1ade31a307ef4e4b47933ada0808503465db | [] | no_license | sanchuanchen/soot-dex | 207853149ddbbbe43e2a2ff2a411192802f914b5 | 65e50dc293734d5ebeaa366e78817ef86b47b8c4 | refs/heads/master | 2020-12-24T18:03:13.314462 | 2013-12-12T17:54:08 | 2013-12-12T17:54:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,260 | java | /* Soot - a Java Optimization Framework
* Copyright (C) 2012 Michael Markert, Frank Hartmann
*
* (c) 2012 University of Luxembourg - Interdisciplinary Centre for
* Security Reliability and Trust (SnT) - All rights reserved
* Alexandre Bartel
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
package soot.dexpler.instructions;
import org.jf.dexlib.Code.Instruction;
import org.jf.dexlib.Code.Format.Instruction22t;
import soot.Local;
import soot.dexpler.DexBody;
import soot.dexpler.IDalvikTyper;
import soot.jimple.BinopExpr;
import soot.jimple.IfStmt;
import soot.jimple.Jimple;
import soot.jimple.internal.JIfStmt;
public class IfTestInstruction extends ConditionalJumpInstruction {
JIfStmt jif = null;
public IfTestInstruction (Instruction instruction, int codeAdress) {
super(instruction, codeAdress);
}
protected IfStmt ifStatement(DexBody body) {
Instruction22t i = (Instruction22t) instruction;
Local one = body.getRegisterLocal(i.getRegisterA());
Local other = body.getRegisterLocal(i.getRegisterB());
BinopExpr condition = getComparisonExpr(one, other);
jif = (JIfStmt)Jimple.v().newIfStmt(condition, targetInstruction.getUnit());
// setUnit() is called in ConditionalJumpInstruction
return jif;
}
public void getConstraint(IDalvikTyper dalvikTyper) {
BinopExpr condition = (BinopExpr)jif.getCondition();
if (IDalvikTyper.ENABLE_DVKTYPER) {
dalvikTyper.addConstraint(condition.getOp1Box(), condition.getOp2Box());
}
}
}
| [
"[email protected]"
] | |
3fd25347f83b52b1f8c4d5926ec88d244cb6d056 | 86d1e5c91beac6cce96eb93a3c8b7b0f73eaab3b | /src/Reservation.java | cf3a6fac79586a93baf80dd3cd988f3b5769f2ee | [] | no_license | nb8g13/gdp-alignment | 5f5d27a133785d478de13d42cb35d397ceec80f1 | f4ff88a87183b2a8baa0e7f292ff7869b89e3664 | refs/heads/master | 2021-09-07T02:05:15.900592 | 2018-02-15T14:00:41 | 2018-02-15T14:00:41 | 110,748,818 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,708 | java | import java.util.ArrayList;
/**
* Created by Pro on 04/02/2018.
*/
//Reserves parts of the caption as well as splitting delete and insert operations for the bot into small parts
// These small parts for deletes are the original word length split into different parts (and stored in an array) so that the whole delete can take place at different points throughout the simulation
// These small parts for inserts are the original word split into different strings (and stored in an array) so that the whole insert can take place at different points throughout the simulation
// Reservation allows operations for bots to occur at different points in the simulation in order to replicate the type of edits that can be produced through collaberative editing.
public class Reservation {
String OriginalWord;
String newWord;
ArrayList<Integer> deleteNumberList;
ArrayList<String> stringInsertList;
private Integer reservationIndex;
private Integer cursorIndex;
String reservationHolder;
Bot bot;
public Reservation(Integer index, String bot, String O, String N, Bot inst) {
this.reservationIndex = index;
this.cursorIndex = index;
this.reservationHolder = bot;
this.OriginalWord = O;
this.newWord = N;
this.bot = inst;
this.deleteNumberList = createDeleteNums(O);
this.stringInsertList = createInsertStrings(N);
}
public ArrayList<Integer> createDeleteNums(String deleteWord) {
ArrayList<Integer> deleteNums = new ArrayList<>();
if (Math.random() < 0.7 || deleteWord.length() == 1) {
deleteNums.add(deleteWord.length());
}
else {
if (deleteWord.length() % 2 == 0) {
for (Integer i = 0 ; i < 2; i++) {
deleteNums.add(deleteWord.length() / 2);
}
}
else {
for (Integer i = 0 ; i < 2; i++) {
deleteNums.add((deleteWord.length() - 1) / 2);
}
deleteNums.add(deleteWord.length() % 2);
}
}
return deleteNums;
}
// the issue with these are that we would need to make sure that all users finish their last edit
// It shouldnt matter too much given that the candidate selection works the way we need to
public ArrayList<String> createInsertStrings(String newWord) {
ArrayList<String> insertStrings = new ArrayList<>();
if (Math.random() < 0.7 || newWord.length() == 1) {
insertStrings.add(newWord);
}
else {
Integer index = 0;
if (newWord.length() % 2 == 0) {
Integer end = newWord.length() / 2;
for (Integer i = 0 ; i < 2; i++) {
insertStrings.add(newWord.substring(index, end));
index = newWord.length() / 2;
end = newWord.length();
}
}
else {
Integer end = (newWord.length() - 1) / 2;
for (Integer i = 0 ; i < 2; i++) {
insertStrings.add(newWord.substring(index, end));
index = end;
end = (newWord.length() - 1);
}
insertStrings.add(newWord.substring(newWord.length() - 1));
}
}
return insertStrings;
}
public Boolean updateDeleteNumberList() {
this.deleteNumberList.remove(0);
if (deleteNumberList.isEmpty()) {
return false;
}
else {
return true;
}
}
public Boolean updateStringInsertList() {
this.stringInsertList.remove(0);
if (stringInsertList.isEmpty()) {
return false;
}
else {
return true;
}
}
public void updateReservationIndex(int length) {
this.reservationIndex = reservationIndex + length;
}
public void updateCursorIndex(int length) {
this.cursorIndex = cursorIndex + length;
}
public ArrayList<Integer> getDeleteNumberList() {
return deleteNumberList;
}
public ArrayList<String> getStringInsertList() {
return stringInsertList;
}
public Integer getReservationIndex() {
return reservationIndex;
}
public Integer getCursorIndex() {
return cursorIndex;
}
public String getNewWord() {
return newWord;
}
public String getOriginalWord() {
return OriginalWord;
}
public String getReservationHolder() {
return reservationHolder;
}
public Bot getBot() {
return bot;
}
}
| [
"[email protected]"
] | |
9f39ee0a92b2a44704a43fd70f44db419f3877cc | 595ab488128af2fe71242dedf10adff9f91551fd | /backtracking/Combinations.java | b4c4083ab4550fef2811f3bda3d5f87c11d90ba9 | [] | no_license | markov-r/algo-tasks | c35122bdcc24efa18f1d5eccfd37d2522f24fcaf | 9ffdfeee52672d33e51574fa55f3ef8ad407644f | refs/heads/master | 2023-02-18T20:34:05.444529 | 2023-02-13T21:00:09 | 2023-02-13T21:00:09 | 146,206,823 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,219 | java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
InputReader reader = new InputReader();
OutputWriter writer = new OutputWriter();
int n = reader.readInt();
int r = reader.readInt();
List<Integer> combination = new ArrayList<>();
for (int i = 0; i < r; i++) {
combination.add(0);
}
combine(1, 0, combination, n, r, writer);
writer.close();
}
public static void combine(int start, int index, List<Integer> combination, int n, int r, OutputWriter writer) {
if (index == r) {
print(combination, writer);
return;
}
for (int i = start; i < n + 1; i++) {
combination.set(index, i);
combine(i + 1, index + 1, combination, n, r, writer);
}
}
public static void print(List<Integer> combination, OutputWriter writer) {
for (int num : combination) {
writer.print(num + " ");
}
writer.printLine();
}
public static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numChars;
InputReader() {
this.stream = System.in;
}
int read() {
if (numChars == -1)
throw new InputMismatchException();
if (curChar >= numChars) {
curChar = 0;
try {
numChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (numChars <= 0)
return -1;
}
return buf[curChar++];
}
int readInt() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
int res = 0;
do {
if (c < '0' || c > '9') {
throw new InputMismatchException();
}
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
long readLong() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
long res = 0;
do {
if (c < '0' || c > '9') {
throw new InputMismatchException();
}
res *= 10;
res += c - '0';
c = read();
} while (!isSpaceChar(c));
return res * sgn;
}
double readDouble() {
int c = read();
while (isSpaceChar(c)) {
c = read();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = read();
}
double res = 0;
while (!isSpaceChar(c) && c != '.' && c != ',') {
if (c == 'e' || c == 'E') {
return res * Math.pow(10, readInt());
}
if (c < '0' || c > '9') {
throw new InputMismatchException();
}
res *= 10;
res += c - '0';
c = read();
}
if (c == '.' || c == ',') {
c = read();
double m = 1;
while (!isSpaceChar(c)) {
if (c == 'e' || c == 'E') {
return res * Math.pow(10, readInt());
}
if (c < '0' || c > '9') {
throw new InputMismatchException();
}
m /= 10;
res += (c - '0') * m;
c = read();
}
}
return res * sgn;
}
String readLine() {
int c = read();
while (isSpaceChar(c))
c = read();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = read();
} while (!isSpaceChar(c));
return res.toString();
}
boolean isSpaceChar(int c) {
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
}
public static class OutputWriter {
private final PrintWriter writer;
OutputWriter() {
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
}
void print(Object... objects) {
for (int i = 0; i < objects.length; i++) {
if (i != 0)
writer.print(' ');
writer.print(objects[i]);
}
}
void printLine(Object... objects) {
print(objects);
writer.println();
}
void close() {
writer.close();
}
}
}
// SLOW SOLUTION
//
//import java.io.*;
//import java.util.*;
//
//public class Main {
//
//// private static InputReader reader = new InputReader();
//// private static OutputWriter writer = new OutputWriter();
//
// public static void main(String[] args) {
// int n = reader.readInt();
// int r = reader.readInt();
// List<Integer> combination = new ArrayList<>();
// List<Set<Integer>> usedCombos = new ArrayList<>();
// for (int i = 0; i < r; i++) {
// combination.add(0);
// }
// combine(n, r, 0, combination, new HashSet<>(), usedCombos);
// writer.close();
// }
//
// private static void combine(int n, int r, int index, List<Integer> combination, HashSet<Integer> used, List<Set<Integer>> usedCombos) {
// if (index == r) {
// Set<Integer> temp = new HashSet<>(combination);
// if (!usedCombos.contains(temp)) {
// usedCombos.add(temp);
// for (Integer s : combination) {
// writer.print(s + " ");
// }
// writer.printLine();
// }
// return;
// }
// for (int i = 1; i < n + 1; i++) {
// if (used.contains(i)) {
// continue;
// }
// used.add(i);
// combination.set(index, i);
// combine(n, r, index + 1, combination, used, usedCombos);
// used.remove(i);
// }
// }
// ORIGINAL SOLUTION
//
//import java.io.*;
//public class Main {
// public static void main(String[] args) throws IOException {
// BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
// String numbers[] = in.readLine().split(" ");
// int n = Integer.parseInt(numbers[0]);
// int r = Integer.parseInt(numbers[1]);
// int[] arr = new int[n];
// for (int i = 0; i < n; i++) {
// arr[i] = i + 1;
// }
// int data[] = new int[r];
// CombinationGenerate(arr, data, 0, n - 1, 0, r);
// }
//
// public static void CombinationGenerate(int arr[], int data[], int start, int end, int index, int r) {
// if (index == r) {
// for (int i = 0; i < r; i++) {
// System.out.print(data[i] + " ");
// System.out.println();
// }
// return;
// }
// for (int i = start; i <= end && end - i + 1 >= r - index; i++) {
// data[index] = arr[i];
// CombinationGenerate(arr, data, i + 1, end, index + 1, r);
// }
// }
//}
| [
"[email protected]"
] | |
5f2c105b8f42717ee57b63db195ef72f58223c19 | 8387a957baac372690ab1ac1379a850cac8158f1 | /MyShopApplication/Myshop/src/main/java/com/Shopping/Myshop/authentication/JwtRequest.java | 4cc1ddee0b6db4a53d69a1015b6ba5528e3ce7f7 | [] | no_license | cgautam21894/Spring-Boot-Architecture | 11263f15154ead9f1e9bbdfb9d9d8681a7e674b9 | 4410281aa2b8f73a3bcb02e41bdbcce2ba14f110 | refs/heads/master | 2022-12-22T00:59:23.164942 | 2020-10-02T13:27:26 | 2020-10-02T13:27:26 | 300,610,789 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 789 | java | package com.Shopping.Myshop.authentication;
import java.io.Serializable;
public class JwtRequest implements Serializable {
private static final long serialVersionUID = 5926468583005150707L;
private String username;
private String password;
//need default constructor for JSON Parsing
public JwtRequest()
{
}
public JwtRequest(String username, String password) {
this.setUsername(username);
this.setPassword(password);
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return this.password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"[email protected]"
] | |
384d802a79c0a261e6645f16591049f297cad245 | 0aa27c59d902625e15b1c862db4fce7924788bfa | /Seleniumpractise/src/co/Sel/Testng/Dependenciesexample.java | f94763c97938934ea5fe9fd253ae5746634954b2 | [] | no_license | Karthickrajachandramohan/seleniumpractise | 50c4882774cadaa857cb117676232ef448ff296a | 861f17171f7ea610c77675dbebb4ea7a82372d35 | refs/heads/master | 2022-11-09T14:13:36.713703 | 2020-06-23T08:09:23 | 2020-06-23T08:09:23 | 274,350,335 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 404 | java | package co.Sel.Testng;
import org.testng.annotations.Test;
public class Dependenciesexample {
@Test(enabled = false)
public void highSchool() {
System.out.println("a");
}
@Test(dependsOnMethods = "highSchool")
public void higherSecondary() {
System.out.println("b");
}
@Test(dependsOnMethods = "higherSecondary")
public void degree() {
System.out.println("c");
}
}
| [
"Jayapriya@DESKTOP-95I46CV"
] | Jayapriya@DESKTOP-95I46CV |
4f0a75c73f49e311044034b68719a67b333cc85c | 8a0073858ef68a64369bdedfee9899c92e691648 | /AisPanelApp/src/main/java/pl/sviete/dom/BootUpReceiver.java | 8d995a8a685566b755bcabb21b81d96d256e8251 | [
"Apache-2.0"
] | permissive | sviete/AIS-dom | 259ef9a2f6c3d6dff214323d0fbc45edbf46b740 | e651079c096bd9551c2fdf6170b85523359d29b5 | refs/heads/master | 2023-01-03T11:59:36.158824 | 2022-12-28T15:54:58 | 2022-12-28T15:54:58 | 217,454,808 | 2 | 3 | Apache-2.0 | 2021-09-03T08:06:14 | 2019-10-25T05:03:46 | Java | UTF-8 | Java | false | false | 637 | java | package pl.sviete.dom;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
public class BootUpReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
Log.i("AIS", "isServiceRunning -> FALSE -> Starting from BootUpReceiver");
Intent i = new Intent(context, WelcomeActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
} | [
"[email protected]"
] | |
2d04f6808d2a2e665210b95c5956f0f08b75a545 | 82cddc0e033b27e72db844e155f16981382c4745 | /app/src/main/java/com/example/dictionary/MyContentProvider.java | 38af01390b50dbe85a3f8af328a06ab2ff22c569 | [] | no_license | LucasleeCN/MyDiationary | bf1abc58c9685fc8e5d82d9771abb7982c7e0e15 | 23a91d4a4bc48a9e51e13a99095bb35bb0846bff | refs/heads/master | 2020-09-20T05:28:40.180884 | 2019-11-27T09:15:38 | 2019-11-27T09:15:38 | 224,388,197 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,612 | java | package com.example.dictionary;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.UriMatcher;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import com.example.dictionary.analysis_word.WordsSQLiteOpenHelper;
public class MyContentProvider extends ContentProvider {
public static final int WORDS_DIR=0;
public static final int WORDS_ITEM=1;
public static final int MYWORDS_DIR=2;
public static final int MYWORDS_ITEM=3;
public static UriMatcher uriMatcher;
public static final String authority ="com.example.dictionary.provider";
private WordsSQLiteOpenHelper wordsSQLiteOpenHelper ;
static {
uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
uriMatcher.addURI(authority,"Words",WORDS_DIR);
uriMatcher.addURI(authority,"Words/#",WORDS_ITEM);
uriMatcher.addURI(authority,"MyWords",MYWORDS_DIR);
uriMatcher.addURI(authority,"MyWords/#",MYWORDS_ITEM);
}
public MyContentProvider() {
}
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
SQLiteDatabase db = wordsSQLiteOpenHelper.getReadableDatabase();
int deleteRows=0;
switch (uriMatcher.match(uri)){
case WORDS_DIR:
deleteRows=db.delete("Words",selection,selectionArgs);
break;
case WORDS_ITEM:
String wordId1 = uri.getPathSegments().get(1);
deleteRows = db.delete("Words","id=?",new String[]{wordId1});
break;
case MYWORDS_DIR:
deleteRows=db.delete("MyWords",selection,selectionArgs);
break;
case MYWORDS_ITEM:
String wordId2 = uri.getPathSegments().get(1);
deleteRows = db.delete("MyWords","id=?",new String[]{wordId2});
break;
default:
break;
}
return deleteRows;
}
@Override
public String getType(Uri uri) {
String str = "";
switch (uriMatcher.match(uri)){
case WORDS_DIR:
str="vnd.android.cursor.dir/vnd.com.example.dictionary.provider.Words";
break;
case WORDS_ITEM:
str = "vnd.android.cursor.item/vnd.com.example.dictionary.provider.Words";
break;
case MYWORDS_DIR:
str="vnd.android.cursor.dir/vnd.com.example.dictionary.provider.MyWords";
break;
case MYWORDS_ITEM:
str = "vnd.android.cursor.item/vnd.com.example.dictionary.provider.MyWords";
break;
}
return str;
}
@Override
public Uri insert(Uri uri, ContentValues values) {
SQLiteDatabase db = wordsSQLiteOpenHelper.getReadableDatabase();
Uri uriReturn = null;
switch (uriMatcher.match(uri)){
case WORDS_DIR:
case WORDS_ITEM:
long newId1 = db.insert("Words",null,values);
uriReturn=Uri.parse("content://"+authority+"/Words/"+newId1);
break;
case MYWORDS_DIR:
case MYWORDS_ITEM:
long newId2 = db.insert("MyWords",null,values);
uriReturn =Uri.parse("content://"+authority+"/MyWords/"+newId2);
break;
default:
break;
}
return uriReturn;
}
@Override
public boolean onCreate() {
wordsSQLiteOpenHelper = new WordsSQLiteOpenHelper(getContext(),"Words",null,1);
return true;
}
@Override
public Cursor query(Uri uri, String[] projection, String selection,
String[] selectionArgs, String sortOrder) {
SQLiteDatabase db = wordsSQLiteOpenHelper.getReadableDatabase();
Cursor cursor =null;
switch (uriMatcher.match(uri)){
case WORDS_DIR:
cursor= db.query("Words",projection,selection,selectionArgs,null,null,sortOrder);
break;
case WORDS_ITEM:
cursor = db.query("Words",projection,"id=?", new String[]{"id"},null,null,sortOrder);
break;
case MYWORDS_DIR:
cursor= db.query("MyWords",projection,selection,selectionArgs,null,null,sortOrder);
break;
case MYWORDS_ITEM:
cursor = db.query("MyWords",projection,"id=?", new String[]{"id"},null,null,sortOrder);
break;
}
return cursor;
}
@Override
public int update(Uri uri, ContentValues values, String selection,
String[] selectionArgs) {
SQLiteDatabase db = wordsSQLiteOpenHelper.getReadableDatabase();
int updateRows=0;
switch (uriMatcher.match(uri)){
case WORDS_DIR:
updateRows =db.update("Words",values,selection,selectionArgs);
break;
case WORDS_ITEM:
String id1 = uri.getPathSegments().get(1);
updateRows =db.update("Words",values,"id=?",new String[]{id1});
break;
case MYWORDS_DIR:
updateRows =db.update("MyWords",values,selection,selectionArgs);
break;
case MYWORDS_ITEM:
String id2 = uri.getPathSegments().get(1);
updateRows =db.update("MyWords",values,"id=?",new String[]{id2});
break;
default:
break;
}
return updateRows;
}
}
| [
"[email protected]"
] | |
6f2d58780b33c8e0ced4c77273a5afb3326d09e0 | 8b11e556e0b6a8c27fbf836708e789a4a780fe6a | /src/com/helloqiaodan/firstweb/GetGeneratedKeysTest.java | 6a72ef99421d1dc8075483e7457520919ae50881 | [
"MIT"
] | permissive | Jordan150513/JavaDemos | 6e05dd0dbf7967d8f9b4cc033a5d3449d8b3d410 | b8492561aecafe48df9e572bad0f88f654bf2ca9 | refs/heads/master | 2021-01-11T09:18:45.427671 | 2017-04-19T01:55:32 | 2017-04-19T01:55:32 | 77,055,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,768 | java | package com.helloqiaodan.firstweb;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Connection;
import java.sql.Statement;
import com.mysql.jdbc.Driver;
public class GetGeneratedKeysTest {
public static void main(String[] arg0)throws SQLException {
new Driver();
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try{
String sql = "insert into tb_person (name,english_name,age,sex,birthday,description) values (?,?,?,?,?,?)";//('bubu','BuBu','19','female','2001-12-12','')
conn = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/databaseWebQD?characterENcoding=UTF-8&useSSL=false", "qiaodan", "1234");
stmt = conn.createStatement();
// stmt.executeUpdate("insert into tb_person"+" (name,english_name,age,sex,birthday,description)"+" values ('bubu','BuBu','19','female','2001-12-12','')");
// rs = stmt.getGeneratedKeys();
// rs.next();
// System.out.println("id: "+rs.getInt(1));
// Your SQLException clearly states that:
// You need to specify Statement.RETURN_GENERATED_KEYS to the Statement.executeUpdate() or Connection.prepareStatement().
PreparedStatement ps = conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
ps.setString(1, "bubu");
ps.setString(2, "BuBu");
ps.setString(3, "19");
ps.setString(4, "female");
ps.setString(5, "2001-12-12");
ps.setString(6, "");
//('bubu','BuBu','19','female','2001-12-12','')
//now update
ps.executeUpdate();
rs = ps.getGeneratedKeys();
rs.next();
System.out.println("id: "+rs.getInt(1));
}finally{
if(conn != null) conn.close();
if(stmt != null) stmt.close();
if(rs!=null) rs.close();
}
}
}
| [
"[email protected]"
] | |
fb6995000af70e3fee303e53a68f6f4c2288f61d | 17b9f4366df6ede565d60baa6ab90e38b740667f | /app/src/main/java/com/example/hf/menu/MainActivity.java | f9161d4e20926631b444ebd68ec321fddba256d7 | [] | no_license | gdmec07150717/Menu | c869b467045480620319480e2f242d2cfe6e0f72 | c806e9a1bbf2f96b5b7013ecfdf837753aa68f2e | refs/heads/master | 2017-12-15T08:42:28.331689 | 2017-01-02T06:56:40 | 2017-01-02T06:56:40 | 77,816,394 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,138 | java | package com.example.hf.menu;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.ContextMenu;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private TextView tv1;
private int count;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv1=(TextView) findViewById(R.id.textView);
registerForContextMenu(tv1);
count=0;
}
//选项菜单创建
@Override
public boolean onCreateOptionsMenu(Menu menu) {
count++;
// MenuInflater inflater=getMenuInflater();
// inflater.inflate(R.menu.menu,menu);
menu.add(0,1,0,R.string.m1);
menu.add(0,2,0,R.string.m2);
menu.add(0,3,0,R.string.m3);
menu.add(0,count+3,0,"tt"+count);
return super.onCreateOptionsMenu(menu);
}
//选项菜单被选中
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Toast.makeText(this,item.getTitle().toString(),Toast.LENGTH_LONG).show();
return super.onOptionsItemSelected(item);
}
//上下文菜单的创建
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
count++;
menu.add(0,1,0,R.string.m1);
menu.add(0,2,0,R.string.m2);
menu.add(0,3,0,R.string.m3);
menu.add(0,count+3,0,"aa"+count);
super.onCreateContextMenu(menu, v, menuInfo);
}
//上下文菜单被选中
@Override
public boolean onContextItemSelected(MenuItem item) {
Toast.makeText(this,item.getTitle(), Toast.LENGTH_LONG).show();
return super.onContextItemSelected(item);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
count++;
menu.add(0,count+3,0,"cc"+count);
return super.onPrepareOptionsMenu(menu);
}
}
| [
"[email protected]"
] | |
4f0164154920122e9201ec656b3b007fcdaa139b | b59b132033af0b482c2d9154dfcaedce450c2574 | /src/test/resources/GeneratorTest/all/after/src/test/java/org/tomitribe/github/model/StartOrganizationMigrationTest.java | 7c2711164f84fb2a76343ade4cb241f8ccfa6d72 | [
"Apache-2.0"
] | permissive | Deng678/github-api-java | 89078dde67e0fadda0dc81e0e4b156eae1e2d24b | 0c060b9625c4b054bb0810c75782ee06c76be94f | refs/heads/master | 2023-03-16T04:30:01.903330 | 2020-12-03T11:34:56 | 2020-12-03T11:34:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,141 | 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.tomitribe.github.model;
import org.junit.Test;
import java.io.IOException;
import static org.tomitribe.github.app.events.PayloadAsserts.assertPayload;
public class StartOrganizationMigrationTest {
@Test
public void parse() throws IOException {
assertPayload(StartOrganizationMigration.class);
}
}
| [
"[email protected]"
] | |
aee97a0b521a66146c281a796c9661f4091b03c1 | 9f158446765c39432b19d1cfff2cec0d38d368a2 | /3-extensions/registry/dubbo-samples-simplified-registry/dubbo-samples-simplified-registry-properties/src/main/java/org/apache/dubbo/samples/simplified/registry/properties/SimpleRegistryPropertiesConsumer.java | e9c95026bf2907dce0483333f8796e79d7683654 | [
"Apache-2.0"
] | permissive | apache/dubbo-samples | 4bf75c148331bdfcfb8c6b94d9af3d697a192238 | f360b85d2f5282c067a581d7ceff7b4910abc1c7 | refs/heads/master | 2023-09-05T12:59:51.006139 | 2023-08-31T06:17:18 | 2023-08-31T06:17:18 | 131,394,823 | 1,644 | 1,404 | Apache-2.0 | 2023-09-12T12:22:33 | 2018-04-28T09:25:29 | Java | UTF-8 | Java | false | false | 2,737 | 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.dubbo.samples.simplified.registry.properties;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.samples.simplified.registry.properties.api.DemoService;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.util.List;
import static org.apache.dubbo.common.constants.CommonConstants.RELEASE_KEY;
public class SimpleRegistryPropertiesConsumer {
public static void main(String[] args) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/simplified-consumer.xml");
context.start();
DemoService demoService = context.getBean("demoService", DemoService.class);
printServiceData();
String hello = demoService.sayHello("world");
System.out.println(hello);
}
private static void printServiceData() {
List<String> urls = ZkUtil.getChildren(ZkUtil.toUrlPath("consumers"));
System.out.println("*********************************************************");
urls.stream().map(URL::decode).forEach(System.out::println);
System.out.println("not contains 'retries':" + !urls.get(0).contains("retries"));
System.out.println("not contains 'owner':" + !urls.get(0).contains("owner"));
System.out.println("not contains 'actives':" + !urls.get(0).contains("actives"));
System.out.println("not contains 'timeout':" + !urls.get(0).contains("timeout"));
System.out.println("contains 'application':" + urls.get(0).contains("application"));
System.out.println("contains 'version':" + urls.get(0).contains("version"));
System.out.println("contains 'group':" + urls.get(0).contains("group"));
System.out.println("contains 'specVersion(default)':" + urls.get(0).contains(RELEASE_KEY));
System.out.println("*********************************************************");
}
}
| [
"[email protected]"
] | |
61bfea29664df100b3552e8a6341790657b7d69f | b24fa669c4d7bf79c1bcbda87dc61b92a8fd87b8 | /src/main/java/com/nitesh/learn/spring/security/security/JDBCSecurirtyConfiguration.java | 8668eb0ede3b5a8b3ab65e6340e0c8a902042ca4 | [] | no_license | niteshadj/SpringSecurity | c643fdc2fb18f53fb66fabc8d00bd9cceb779f4d | 8eb00acbb37bc17e4343b1cd6a170e7be5c43b2d | refs/heads/main | 2023-06-04T08:08:00.877287 | 2021-06-15T14:13:58 | 2021-06-15T14:13:58 | 377,187,041 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,693 | java | package com.nitesh.learn.spring.security.security;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
//@EnableWebSecurity
public class JDBCSecurirtyConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
DataSource dataSource;
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.jdbcAuthentication().dataSource(dataSource);
/*
* .withUser(User.withUsername("Nitesh").password("pass").roles("User"))
* .withUser(User.withUsername("admin").password("pass").roles("Admin")).
* withDefaultSchema();
*/
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/admin").hasAnyRole("Admin")//Spring appends ROLE_ to all roles
.antMatchers("/user")
.hasAnyRole("User", "Admin").antMatchers("/").permitAll().antMatchers("/h2-console/*").permitAll().and()
.formLogin();
}
@Bean
public PasswordEncoder getPasswordEncoder() {
return NoOpPasswordEncoder.getInstance();
}
}
| [
"[email protected]"
] | |
9e4cb7eb2b2aca660c0b83c2fd5a46e40a81e30d | e73c0adff79059e60d6afc688d004399a7624b15 | /src/samples/E_ForLoop.java | 5f1b61d359fa6a2b6a910ec5925873b1e301d3ad | [] | no_license | vidyaj87/OOPsamples | c4e85ec7ac4dcd171bfe7261aa2f27bc2ed5a58f | dc5e212e45691dd1d902f15d0d58b0ee1e7cf852 | refs/heads/master | 2020-03-22T04:02:27.411625 | 2018-07-02T16:59:32 | 2018-07-02T16:59:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 360 | java | package samples;
// Prints values from 0 to 99 using for-loop
public class E_ForLoop
{
public static void main( String[] args )
{
int loopLimit = 100;
for ( int count = 0; count < loopLimit; count++ )
{
System.out.println( count );
}
}
// TODO: Make the above program print values from 51 to 101
}
| [
"[email protected]"
] | |
dedde8f09d8a20b3c1f035c9745a9620be0a2136 | d7264b3ff6255240a18732635f242dea54fb594d | /java/helidon-mp/backend/api/src/main/java/org/demis27/kickoff/helidon/api/HelloController.java | a26c757fc08f4914e033e23dd76c6ec526ceeced | [
"Apache-2.0"
] | permissive | demis27/microservices-kickoff | f8d7a4fffbf8fc05c65af6db14332a6d76bcf220 | f30b57c5b1cf84605a1f6f8ebf6967431d6e790e | refs/heads/master | 2022-07-07T00:43:43.081449 | 2020-01-23T15:55:36 | 2020-01-23T15:55:36 | 212,784,670 | 1 | 0 | Apache-2.0 | 2023-09-05T22:01:34 | 2019-10-04T09:57:25 | Java | UTF-8 | Java | false | false | 271 | java | package org.demis27.kickoff.helidon.api;
import javax.inject.Singleton;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
/**
*
*/
@Path("/hello")
@Singleton
public class HelloController {
@GET
public String sayHello() {
return "Hello World";
}
}
| [
"[email protected]"
] | |
87a38e2f41064172f7c383fc35c927f7a4dcc1eb | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/dbeaver/2015/12/JDBCTableMetaData.java | b0cb0ee92e236bf0fa44dca152796f3a957ecaea | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 3,184 | java | /*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2015 Serge Rieder ([email protected])
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License (version 2)
* as published by the Free Software Foundation.
*
* 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package org.jkiss.dbeaver.model.impl.jdbc.exec;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.DBUtils;
import org.jkiss.dbeaver.model.exec.DBCEntityMetaData;
import org.jkiss.utils.CommonUtils;
import java.util.ArrayList;
import java.util.List;
/**
* JDBC Table MetaData
*/
public class JDBCTableMetaData implements DBCEntityMetaData {
private final JDBCResultSetMetaDataImpl resultSetMetaData;
private final String catalogName;
private final String schemaName;
private final String tableName;
private final List<JDBCColumnMetaData> columns = new ArrayList<>();
JDBCTableMetaData(@NotNull JDBCResultSetMetaDataImpl resultSetMetaData, String catalogName, String schemaName, @NotNull String tableName)
{
this.resultSetMetaData = resultSetMetaData;
this.catalogName = catalogName;
this.schemaName = schemaName;
this.tableName = tableName;
}
public JDBCResultSetMetaDataImpl getResultSetMetaData()
{
return resultSetMetaData;
}
@Nullable
public String getCatalogName() {
return catalogName;
}
@Nullable
public String getSchemaName() {
return schemaName;
}
@NotNull
@Override
public String getEntityName()
{
return tableName;
}
@NotNull
@Override
public List<JDBCColumnMetaData> getAttributes()
{
return columns;
}
void addAttribute(JDBCColumnMetaData columnMetaData)
{
columns.add(columnMetaData);
}
@Override
public String toString() {
return DBUtils.getSimpleQualifiedName(catalogName, schemaName, tableName);
}
@Override
public int hashCode() {
return (catalogName == null ? 1 : catalogName.hashCode()) *
(schemaName == null ? 2 : schemaName.hashCode()) *
tableName.hashCode();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof JDBCTableMetaData)) {
return false;
}
JDBCTableMetaData md2 = (JDBCTableMetaData) obj;
return CommonUtils.equalObjects(catalogName, md2.catalogName) &&
CommonUtils.equalObjects(schemaName, md2.schemaName) &&
CommonUtils.equalObjects(tableName, md2.tableName);
}
}
| [
"[email protected]"
] | |
54673dfbe8f9487fc421cdeaa0f0e1b951b65b21 | 3ac2095b97aa871b1e6b6c80102e1aa710db4dc7 | /javaproject/FirstJava/src/thread/Adderthread.java | cc9c2b933ae16537c25d93339320760018bd589a | [] | no_license | choejh/class | 7a69ccd060a4017024b7bc07debac7578cc5e847 | 9fd6cd3b2ae0e67c675a515d1596b5377d92303d | refs/heads/master | 2023-03-14T04:15:54.532662 | 2021-03-12T08:20:01 | 2021-03-12T08:20:01 | 299,173,538 | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 270 | java | //1027¾²·¡µå 3-2
package thread;
public class Adderthread extends Sum implements Runnable{
int start;
int end;
Adderthread(int n1, int n2){
start=n1;
end=n2;
}
@Override
public void run() {
for(int i=start; i<=end; i++) {
addNum(i);
}
}
}
| [
"[email protected]"
] | |
6530d9ae36e6f2d9c6ab2a4f4a620675cbae6801 | 01fa9ca893a4e45993bfc546a1b3fee44bf29ec6 | /src/main/java/com/ly/headersfilter/TestHeadersFilter.java | 6cbde94587c38857527f0ff726283b2b0cea4d03 | [] | no_license | aaronuu/api-test | 718af6a33760d318d5d7aa54f594f0cad7a714e4 | 9656ad3dc45b7ffa3a6a53200c8739f8affab194 | refs/heads/main | 2023-02-09T04:43:28.619958 | 2020-12-29T07:36:36 | 2020-12-29T07:36:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 492 | java | package com.ly.headersfilter;
import com.ly.core.listener.HeadersFilterAdapter;
import com.ly.core.utils.MapTool;
import lombok.extern.slf4j.Slf4j;
import java.util.Map;
/**
* @Author: luoy
* @Date: 2019/8/16 17:11.
*/
@Slf4j
public class TestHeadersFilter extends HeadersFilterAdapter {
@Override
public Map<String, String> defHeaders() {
return MapTool.builder()
.put("Content-Type", "application/json;charset=utf-8")
.build();
}
}
| [
"[email protected]"
] | |
08f9137bbdbfcc2e9f7451ec4da05648cd5cbe02 | 281f0c07b25b45cbfb8a3b97072e39b0a8963f08 | /plugins/eu.hyvar.feature.mapping.resource.hymapping/src-gen/eu/hyvar/feature/mapping/resource/hymapping/util/HymappingMinimalModelHelper.java | 742c4016ab174ae2b4763650009147e99a174d6c | [
"Apache-2.0"
] | permissive | hfenske33/DarwinSPL | ed21895c148fe222db130d7fe7355e3b22ddb8d6 | 2d1333819dcb7fd2b06e7b021969422d1f629207 | refs/heads/master | 2020-03-23T15:05:47.843315 | 2018-06-28T11:27:56 | 2018-06-28T11:27:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,641 | java | /**
* <copyright>
* </copyright>
*
*
*/
package eu.hyvar.feature.mapping.resource.hymapping.util;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
/**
* A helper class that is able to create minimal model instances for Ecore models.
*/
public class HymappingMinimalModelHelper {
private final static eu.hyvar.feature.mapping.resource.hymapping.util.HymappingEClassUtil eClassUtil = new eu.hyvar.feature.mapping.resource.hymapping.util.HymappingEClassUtil();
public EObject getMinimalModel(EClass eClass, Collection<EClass> allAvailableClasses) {
return getMinimalModel(eClass, allAvailableClasses.toArray(new EClass[allAvailableClasses.size()]), null);
}
public EObject getMinimalModel(EClass eClass, EClass[] allAvailableClasses) {
return getMinimalModel(eClass, allAvailableClasses, null);
}
public EObject getMinimalModel(EClass eClass, EClass[] allAvailableClasses, String name) {
if (!contains(allAvailableClasses, eClass)) {
return null;
}
EPackage ePackage = eClass.getEPackage();
if (ePackage == null) {
return null;
}
EObject root = ePackage.getEFactoryInstance().create(eClass);
List<EStructuralFeature> features = eClass.getEAllStructuralFeatures();
for (EStructuralFeature feature : features) {
if (feature instanceof EReference) {
EReference reference = (EReference) feature;
if (reference.isUnsettable()) {
continue;
}
if (!reference.isChangeable()) {
continue;
}
EClassifier type = reference.getEType();
if (type instanceof EClass) {
EClass typeClass = (EClass) type;
if (eClassUtil.isNotConcrete(typeClass)) {
// find subclasses
List<EClass> subClasses = eClassUtil.getSubClasses(typeClass, allAvailableClasses);
if (subClasses.size() == 0) {
continue;
} else {
// pick the first subclass
typeClass = subClasses.get(0);
}
}
int lowerBound = reference.getLowerBound();
for (int i = 0; i < lowerBound; i++) {
EObject subModel = null;
if (reference.isContainment()) {
EClass[] unusedClasses = getArraySubset(allAvailableClasses, eClass);
subModel = getMinimalModel(typeClass, unusedClasses);
}
else {
subModel = typeClass.getEPackage().getEFactoryInstance().create(typeClass);
// set some proxy URI to make this object a proxy
String initialValue = "#some" + eu.hyvar.feature.mapping.resource.hymapping.util.HymappingStringUtil.capitalize(typeClass.getName());
URI proxyURI = URI.createURI(initialValue);
((InternalEObject) subModel).eSetProxyURI(proxyURI);
}
if (subModel == null) {
continue;
}
Object value = root.eGet(reference);
if (value instanceof List<?>) {
List<EObject> list = eu.hyvar.feature.mapping.resource.hymapping.util.HymappingListUtil.castListUnchecked(value);
list.add(subModel);
} else {
root.eSet(reference, subModel);
}
}
}
} else if (feature instanceof EAttribute) {
EAttribute attribute = (EAttribute) feature;
if ("EString".equals(attribute.getEType().getName())) {
String initialValue;
if (attribute.getName().equals("name") && name != null) {
initialValue = name;
}
else {
initialValue = "some" + eu.hyvar.feature.mapping.resource.hymapping.util.HymappingStringUtil.capitalize(attribute.getName());
}
Object value = root.eGet(attribute);
if (value instanceof List<?>) {
List<String> list = eu.hyvar.feature.mapping.resource.hymapping.util.HymappingListUtil.castListUnchecked(value);
list.add(initialValue);
} else {
root.eSet(attribute, initialValue);
}
}
}
}
return root;
}
private boolean contains(EClass[] allAvailableClasses, EClass eClass) {
for (EClass nextClass : allAvailableClasses) {
if (eClass == nextClass) {
return true;
}
}
return false;
}
private EClass[] getArraySubset(EClass[] allClasses, EClass eClassToRemove) {
List<EClass> subset = new ArrayList<EClass>();
for (EClass eClass : allClasses) {
if (eClass != eClassToRemove) {
subset.add(eClass);
}
}
return subset.toArray(new EClass[subset.size()]);
}
}
| [
"[email protected]"
] | |
176befd44372db0ceaaaac9cad53564ea321573b | a4b0895b32ecacf02d43d0bf152f00602b390d6d | /Problem/Pro_1206.java | 3d2c92faba693073bf5eb3df36342475678f300c | [] | no_license | wjddnwls918/SWExpertAcademy_Practice | 5e9ba80e9d2eef03677da5a826a2a60ec6ab714a | eeb0d70de64e5c5a3191b5244c977cb012475cb9 | refs/heads/master | 2021-06-13T05:22:34.509721 | 2019-08-30T07:45:41 | 2019-08-30T07:45:41 | 115,017,736 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,093 | java | import java.util.Scanner;
public class Pro_1206 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
for(int i =1; i<=10; i++)
{
int n = in.nextInt();
int cnt=0;
int map [] = new int[n];
for(int j=0; j<map.length; j++)
{
map[j] = in.nextInt();
}
int temp = 0;
for(int j=2; j<map.length-2; j++)
{
temp = map[j];
if(map[j] == 0)
continue;
while (temp>=0)
{
if(temp > map[j+1] && temp > map[j-1] && temp > map[j-2] && temp > map[j+2])
{
cnt++;
temp--;
}
else
{
break;
}
}
}
System.out.println("#"+i +" " + cnt);
}
}
}
//����
/*0 0 225 214 82 73 241 233 179 219
135 62 36 13 6 71 179 77 67 139
31 90 9 37 93 203 150 69 19 137
28 174 32 80 64 54 18 0 158 73
173 20 0 102 107 48 50 161 246 145
225 31 0 153 185 157 44 126 153 233
0 201 83 103 191 0 45 0 131 87
97 105 97 209 157 22 0 29 132 74
2 232 44 203 0 51 0 244 212 212
89 53 50 244 207 144 72 143 0 0*/ | [
"[email protected]"
] | |
7bfc334797941d0c9795eb56b8aec81157ceb254 | 9fb2f61793df313656da039580e6e2635e6311bd | /src/String/Unit12.java | e507fc562e63d0f1610a4b3c85136ea34bd1e9a0 | [] | no_license | oldlmj/java_homework | 0a88c5d13dea5478e4d3af7a53093d5a41ec4a09 | e2914d8e611aaafaae06a0d7b1f5c8c6465f12bb | refs/heads/master | 2023-02-05T13:38:14.917347 | 2020-12-22T11:48:31 | 2020-12-22T11:48:31 | 323,604,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,950 | java | package String;
import java.util.Scanner;
public class Unit12 {
public static void main(String[] args) {
//test6();
// other1();
other2(); // 將先前寫的身分證程式碼,少少部分改用正則表達式
}
public static void test1() {
String[] strUschool = { "Abcdsjosf", "Oosjfo", "School" };
System.out.println("字串總長度: " + strUschool.length);
System.out.print("字串轉大寫英文=");
for (int i = 0; i < strUschool.length; ++i) {
System.out.print(strUschool[i].toUpperCase() + " ");
}
}
public static void test2() {
String str = "abcdefghijklmnopqrsyuvwxyz", srtInput;
Scanner scn = new Scanner(System.in);
srtInput = scn.next();
if (str.indexOf(srtInput) < 0) {
System.out.print("您輸入非小寫英文字");
} else {
System.out.print("索引值位在 " + str.indexOf(srtInput));
}
scn.close();
}
public static void test3() {
String str = "abcdefghijklmnopqrsyuvwxyz", srtInput, strChg;
StringBuffer bstr = new StringBuffer(str);
System.out.print("請輸入想更換的小寫英文: ");
Scanner scn = new Scanner(System.in);
srtInput = scn.next();
System.out.print("請問要更換的小寫英文是: ");
strChg = scn.next();
if (str.indexOf(srtInput) < 0) {
System.out.print("您輸入非小寫英文字!!!");
} else {
System.out.println(srtInput + "的索引值位在 " + str.indexOf(srtInput));
bstr.replace(str.indexOf(srtInput), str.indexOf(srtInput) + 1, strChg);
System.out.println(srtInput + "已更換成" + strChg);
System.out.println(bstr);
}
scn.close();
}
public static void test4() {
String str = "神鵰俠侶是楊過跟小龍女的故事,我喜歡小龍女,也討厭小龍女,巴拉巴拉小龍女,飄飄小龍女";
StringBuffer bstr = new StringBuffer(str);
String strN = "小龍女";
int time = 1;
for (int i = bstr.indexOf(strN); i <= bstr.lastIndexOf(strN); ++i) {
if (bstr.indexOf(strN) != bstr.indexOf(strN, i)) {
bstr.delete(i, i + 1);
time += 1;
}
}
System.out.print("出現次數:" + time);
}
public static void test5() {
String str = "Java 11 ";
StringBuffer bstr = new StringBuffer(str);
bstr.append("I love Java 11");
System.out.print(bstr);
}
public static void test6() {
String str1 = "java";
String str2 = "Java";
if (str1.compareTo(str2) == 0)
System.out.println("用compareTo來比較str1跟str2: true");
else
System.out.println("用compareTo來比較str1跟str2: false");
if (str1.compareToIgnoreCase(str2) == 0)
System.out.println("用compareToIgnoreCase來比較str1跟str2: true");
else
System.out.println("用compareToIgnoreCase來比較str1跟str2: false");
System.out.println("用equals來比較str1跟str2: " + str1.equals(str2));
System.out.println("用equalsIgnoreCase來比較str1跟str2: " + str1.equalsIgnoreCase(str2));
}
public static void other1() {
/*
* 使用者輸入整數 1.請將此整數換成國字大寫 2.不能當機
*/
Scanner scn = new Scanner(System.in);
System.out.print("請輸入整數:");
int intNum = scn.nextInt();
String strI = String.valueOf(intNum);
String strO;
String strnum = "1234567890";
String strNum = "壹貳參肆伍陸柒捌玖零";
String strM = "億仟佰拾萬仟佰拾元";
// System.out.print(strM.substring(1, 1));
for (int i = 0; i < strI.length(); i++) {
int v = Integer.parseInt(strI.substring(i, i + 1));
try {
if (v + 1 >= 10) {
strO = strNum.substring(strnum.indexOf(strI.substring(i, i + 1)), 9);
System.out.print(strO);
} else {
strO = strNum.substring(strnum.indexOf(strI.substring(i, i + 1)), v);
System.out.print(strO);
}
} catch (StringIndexOutOfBoundsException e) {
strO = strNum.substring(strnum.indexOf(strI.substring(i, i - 1)), 9);
System.out.print(strO);
}
// 下方try整個要做修改
try {
if (i >= 9) {
strO = strM.substring(i + 7, 8);
System.out.print(strO);
} else {
strO = strM.substring(i + 7, i + 8);
System.out.print(strO);
}
} catch (StringIndexOutOfBoundsException e) {
strO = strM.substring(i, 9);
System.out.print(strO);
}
}
scn.close();
}
// 輸入身分證並驗證
public static void other2() {
Scanner scn = new Scanner(System.in);
String srtA = "", strB = "",patternTotal="\\w\\d{9}";
int intX, intY, intZ = 0, c = 8;
int[] T = new int[10]; // 用int[]放身分證後9碼的數值
char chrR;
boolean flag; // 旗子
System.out.print("請輸入身分證字號:");
srtA = scn.next();
// 判斷字數是否輸入正確
if (!srtA.matches(patternTotal)) {
System.out.print("身分證輸入長度不夠或沒有開頭英文字!!! \n請重新輸入:");
srtA = scn.next();
}
chrR = srtA.toUpperCase().charAt(0); // 將身份證開頭英文強制轉大寫
do {
flag = false;
for (int x = 1; x < 10; x++) {
intX = Integer.parseInt(srtA.substring(x, x + 1));
T[x] = intX;
// 判斷性別是否輸入正確
if (T[1] < 3) { // 第一個數字小於3,代表是對的則繼續放進int[]
T[x] = intX;
} else {
// 到這代表第一個數字輸入錯誤,因此flag變成true
flag = true;
System.out.println("第一個數字輸入錯誤!!!請重新輸入:");
// 提示錯誤,並要求使用者再次重新輸入
srtA = scn.next();
break; // 直接跳出此迴圈
}
}
} while (flag == true);
// 判斷是哪個地區並給予相對應的值
switch (chrR) {
case 'A':
intY = 10;
strB = String.valueOf(intY);
break;
case 'B':
intY = 11;
strB = String.valueOf(intY);
break;
case 'C':
intY = 12;
strB = String.valueOf(intY);
break;
case 'D':
intY = 13;
strB = String.valueOf(intY);
break;
case 'E':
intY = 14;
strB = String.valueOf(intY);
break;
case 'F':
intY = 15;
strB = String.valueOf(intY);
break;
case 'G':
intY = 16;
strB = String.valueOf(intY);
case 'H':
intY = 17;
strB = String.valueOf(intY);
break;
case 'I':
intY = 34;
strB = String.valueOf(intY);
break;
case 'J':
intY = 18;
strB = String.valueOf(intY);
break;
case 'K':
intY = 19;
strB = String.valueOf(intY);
break;
case 'L':
intY = 20;
strB = String.valueOf(intY);
break;
case 'M':
intY = 21;
strB = String.valueOf(intY);
break;
case 'N':
intY = 22;
strB = String.valueOf(intY);
break;
case 'O':
intY = 35;
strB = String.valueOf(intY);
break;
case 'P':
intY = 23;
strB = String.valueOf(intY);
case 'Q':
intY = 24;
strB = String.valueOf(intY);
break;
case 'R':
intY = 25;
strB = String.valueOf(intY);
break;
case 'S':
intY = 26;
strB = String.valueOf(intY);
break;
case 'T':
intY = 27;
strB = String.valueOf(intY);
break;
case 'U':
intY = 28;
strB = String.valueOf(intY);
break;
case 'V':
intY = 29;
strB = String.valueOf(intY);
break;
case 'W':
intY = 32;
strB = String.valueOf(intY);
break;
case 'X':
intY = 30;
strB = String.valueOf(intY);
break;
case 'Y':
intY = 31;
strB = String.valueOf(intY);
break;
case 'Z':
intY = 32;
strB = String.valueOf(intY);
break;
}
// 把後面數字各別從T[]陣列提取進行加乘
for (int i = 1; i < 9; i++) {
intZ = intZ + T[i] * c;
// System.out.println(T[i]+"-"+intZ);
c = c - 1;
}
// 將一開始找好的地區數字做切割,並乘上相對應的值,再加剛上方迴圈跑完的值
intZ = intZ + (Integer.parseInt(strB.substring(0, 1)) * 1) + (Integer.parseInt(strB.substring(1, 2)) * 9);
// 用if來判斷條件 總和除以10的餘數,再10-於術後是否等於檢查碼,確認檢查碼是否正確
if ((10 - (intZ % 10)) == T[9]) {
System.out.print("檢查碼是相同的");
} else {
System.out.print("身分證有問題!!");
}
scn.close();
}
}
| [
"[email protected]"
] | |
b8dfb5ee9970ff10fc3d272fe4daa17499db9d6a | 6903d3e6bd56fb9708e4b9b29fffd4c57f101cb9 | /com/alipay/oceanbase/3rd/google/common/collect/ImmutableTable.java | 11ffb65773b53977e19d6cb45d8ad824f7565298 | [] | no_license | Qi4ngY/oceanbase-client | 8d12273156ed3477ad5720052880de2640717d48 | 0988f778d2a00800e80d30314ac4ef99344ff70e | refs/heads/master | 2022-11-18T12:58:07.105603 | 2020-07-20T07:52:11 | 2020-07-20T07:52:11 | 281,045,860 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,690 | java | package com.alipay.oceanbase.3rd.google.common.collect;
import java.util.Comparator;
import java.util.List;
import java.util.Set;
import java.util.Collection;
import javax.annotation.Nullable;
import java.util.Map;
import com.alipay.oceanbase.3rd.google.common.base.MoreObjects;
import com.alipay.oceanbase.3rd.google.common.base.Preconditions;
import java.util.Iterator;
import com.alipay.oceanbase.3rd.google.common.annotations.GwtCompatible;
@GwtCompatible
public abstract class ImmutableTable<R, C, V> extends AbstractTable<R, C, V>
{
private static final ImmutableTable<Object, Object, Object> EMPTY;
public static <R, C, V> ImmutableTable<R, C, V> of() {
return (ImmutableTable<R, C, V>)ImmutableTable.EMPTY;
}
public static <R, C, V> ImmutableTable<R, C, V> of(final R rowKey, final C columnKey, final V value) {
return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value);
}
public static <R, C, V> ImmutableTable<R, C, V> copyOf(final Table<? extends R, ? extends C, ? extends V> table) {
if (table instanceof ImmutableTable) {
final ImmutableTable<R, C, V> parameterizedTable = (ImmutableTable<R, C, V>)(ImmutableTable)table;
return parameterizedTable;
}
final int size = table.size();
switch (size) {
case 0: {
return of();
}
case 1: {
final Table.Cell<? extends R, ? extends C, ? extends V> onlyCell = Iterables.getOnlyElement(table.cellSet());
return of((R)onlyCell.getRowKey(), (C)onlyCell.getColumnKey(), (V)onlyCell.getValue());
}
default: {
final ImmutableSet.Builder<Table.Cell<R, C, V>> cellSetBuilder = ImmutableSet.builder();
for (final Table.Cell<? extends R, ? extends C, ? extends V> cell : table.cellSet()) {
cellSetBuilder.add(cellOf((R)cell.getRowKey(), (C)cell.getColumnKey(), (V)cell.getValue()));
}
return RegularImmutableTable.forCells(cellSetBuilder.build());
}
}
}
public static <R, C, V> Builder<R, C, V> builder() {
return new Builder<R, C, V>();
}
static <R, C, V> Table.Cell<R, C, V> cellOf(final R rowKey, final C columnKey, final V value) {
return Tables.immutableCell((R)Preconditions.checkNotNull((R)rowKey), (C)Preconditions.checkNotNull((C)columnKey), (V)Preconditions.checkNotNull((V)value));
}
ImmutableTable() {
}
@Override
public ImmutableSet<Table.Cell<R, C, V>> cellSet() {
return (ImmutableSet<Table.Cell<R, C, V>>)(ImmutableSet)super.cellSet();
}
@Override
abstract ImmutableSet<Table.Cell<R, C, V>> createCellSet();
@Override
final UnmodifiableIterator<Table.Cell<R, C, V>> cellIterator() {
throw new AssertionError((Object)"should never be called");
}
@Override
public ImmutableCollection<V> values() {
return (ImmutableCollection<V>)(ImmutableCollection)super.values();
}
@Override
abstract ImmutableCollection<V> createValues();
@Override
final Iterator<V> valuesIterator() {
throw new AssertionError((Object)"should never be called");
}
@Override
public ImmutableMap<R, V> column(final C columnKey) {
Preconditions.checkNotNull(columnKey);
return MoreObjects.firstNonNull(this.columnMap().get(columnKey), ImmutableMap.of());
}
@Override
public ImmutableSet<C> columnKeySet() {
return this.columnMap().keySet();
}
@Override
public abstract ImmutableMap<C, Map<R, V>> columnMap();
@Override
public ImmutableMap<C, V> row(final R rowKey) {
Preconditions.checkNotNull(rowKey);
return MoreObjects.firstNonNull(this.rowMap().get(rowKey), ImmutableMap.of());
}
@Override
public ImmutableSet<R> rowKeySet() {
return this.rowMap().keySet();
}
@Override
public abstract ImmutableMap<R, Map<C, V>> rowMap();
@Override
public boolean contains(@Nullable final Object rowKey, @Nullable final Object columnKey) {
return this.get(rowKey, columnKey) != null;
}
@Override
public boolean containsValue(@Nullable final Object value) {
return this.values().contains(value);
}
@Deprecated
@Override
public final void clear() {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public final V put(final R rowKey, final C columnKey, final V value) {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public final void putAll(final Table<? extends R, ? extends C, ? extends V> table) {
throw new UnsupportedOperationException();
}
@Deprecated
@Override
public final V remove(final Object rowKey, final Object columnKey) {
throw new UnsupportedOperationException();
}
static {
EMPTY = new SparseImmutableTable<Object, Object, Object>(ImmutableList.of(), ImmutableSet.of(), ImmutableSet.of());
}
public static final class Builder<R, C, V>
{
private final List<Table.Cell<R, C, V>> cells;
private Comparator<? super R> rowComparator;
private Comparator<? super C> columnComparator;
public Builder() {
this.cells = (List<Table.Cell<R, C, V>>)Lists.newArrayList();
}
public Builder<R, C, V> orderRowsBy(final Comparator<? super R> rowComparator) {
this.rowComparator = Preconditions.checkNotNull(rowComparator);
return this;
}
public Builder<R, C, V> orderColumnsBy(final Comparator<? super C> columnComparator) {
this.columnComparator = Preconditions.checkNotNull(columnComparator);
return this;
}
public Builder<R, C, V> put(final R rowKey, final C columnKey, final V value) {
this.cells.add(ImmutableTable.cellOf(rowKey, columnKey, value));
return this;
}
public Builder<R, C, V> put(final Table.Cell<? extends R, ? extends C, ? extends V> cell) {
if (cell instanceof Tables.ImmutableCell) {
Preconditions.checkNotNull(cell.getRowKey());
Preconditions.checkNotNull(cell.getColumnKey());
Preconditions.checkNotNull(cell.getValue());
final Table.Cell<R, C, V> immutableCell = (Table.Cell<R, C, V>)cell;
this.cells.add(immutableCell);
}
else {
this.put(cell.getRowKey(), cell.getColumnKey(), cell.getValue());
}
return this;
}
public Builder<R, C, V> putAll(final Table<? extends R, ? extends C, ? extends V> table) {
for (final Table.Cell<? extends R, ? extends C, ? extends V> cell : table.cellSet()) {
this.put(cell);
}
return this;
}
public ImmutableTable<R, C, V> build() {
final int size = this.cells.size();
switch (size) {
case 0: {
return ImmutableTable.of();
}
case 1: {
return new SingletonImmutableTable<R, C, V>(Iterables.getOnlyElement(this.cells));
}
default: {
return RegularImmutableTable.forCells(this.cells, this.rowComparator, this.columnComparator);
}
}
}
}
}
| [
"[email protected]"
] | |
ddba9a42c5fc8b923350f410ee301eb33c1911d2 | 2eb567cb893850bec197ead1491f3e802cff93e6 | /java-se-samples/base/src/main/java/objects2/finals/FinalLocalVariableTest.java | f02aeb2c8d47d78407760707f2639b269cf3ecd5 | [] | no_license | doubleview/java-awesome-demo | 4ca9971f01ab7b3be6fbefb76f9a7d8c78de0ed0 | 983491df02bf9c83978cbec83b93d1a68b1b2275 | refs/heads/master | 2022-12-22T10:12:26.250184 | 2021-07-25T05:58:22 | 2021-07-25T05:58:22 | 96,692,018 | 0 | 0 | null | 2022-12-16T09:52:49 | 2017-07-09T15:07:56 | Java | UTF-8 | Java | false | false | 682 | java | package objects2.finals;
public class FinalLocalVariableTest {
public void test(final int a) {
// 不能对final修饰的形参赋值,下面语句非法
// a = 5;
}
public static void main(String[] args) {
// 定义final局部变量时指定默认值,则str变量无法重新赋值
final String str = "hello";
// 下面赋值语句非法
// str = "Java";
// 定义final局部变量时没有指定默认值,则d变量可被赋值一次
final double d;
// 第一次赋初始值,成功
d = 5.6;
// 对final变量重复赋值,下面语句非法
// d = 3.4;
}
}
| [
"[email protected]"
] | |
468eaf62b840f2fea1f23cba9204aea31b4cb606 | 2131aed94d6218dfa6528bc05775648ea9f92602 | /_Curso do Edu/src/net/eduard/curso/warp/ComandoDeleteWarp.java | cff07dac36300f1393e52378349b49426dc81300 | [] | no_license | peytondodd/plugins | 9ccef940800e1e09562571828ca0b81966ea4359 | 836241a258e40040cfb914c5af103ca7337027de | refs/heads/master | 2020-04-05T06:10:14.103639 | 2018-10-19T00:24:22 | 2018-10-19T00:24:22 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 550 | java | package net.eduard.curso.warp;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
public class ComandoDeleteWarp implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (args.length == 0) {
sender.sendMessage("§c/deletewarp <nome>");
//
} else {
String nome = args[0];
WarpAPI.removeWarp(nome);
sender.sendMessage("§aA warp " + nome + " foi deletada!");
}
return true;
}
}
| [
"[email protected]"
] | |
593ce93d25d0497e70940d0fe17eddf709058aad | 3fddbe5fbcc51f4e4d092e45ac17a4ac17894d69 | /usef-build/usef-workflow/usef-dso/src/main/java/energy/usef/dso/workflow/validate/acknowledgement/flexorder/package-info.java | 2768a352519042348b99451314fb9f0ff4e79a7f | [
"Apache-2.0"
] | permissive | Drimpac2020eu/usef | a77cd3abc5e3ae9f29b46b65d23778cfceab6498 | 65acaef8248da98df45a4ba7507f017dfc903906 | refs/heads/master | 2022-12-22T16:59:47.959244 | 2020-05-08T11:12:51 | 2020-05-08T11:12:51 | 241,834,155 | 0 | 0 | Apache-2.0 | 2022-12-14T20:26:07 | 2020-02-20T08:43:30 | HTML | UTF-8 | Java | false | false | 748 | java | /*
* Copyright 2015-2016 USEF 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.
*/
/**
* Flexorder validation classes of the Distribution System Operator.
*/
package energy.usef.dso.workflow.validate.acknowledgement.flexorder;
| [
"[email protected]"
] | |
d2fcb013f47c895ac26546cd6f1ec8aa61e0dbcf | b927039608dd42ba41aa20be8f11bce7a2bf4bc7 | /src/STRING/Funny_String.java | 70c5b22e4bc44fc4d22f3a751edcce05fae8b352 | [] | no_license | VincentTr4n/HackerRank | a0eee72671e55875064a40d7123b242da6c2ef0d | 178b3db759317856779daef8c8eef05d9e9dd5cf | refs/heads/master | 2021-09-07T13:16:28.500670 | 2018-02-23T11:02:34 | 2018-02-23T11:02:34 | 111,547,464 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 723 | java | package STRING;
import java.util.Scanner;
public class Funny_String {
public static String funnyString(String s){
boolean ok = true;
String r = new StringBuilder(s).reverse().toString();
for(int i=1;i<s.length();i++){
if(Math.abs(s.charAt(i-1)-s.charAt(i))!=Math.abs(r.charAt(i-1)-r.charAt(i))){
ok = false; break;
}
}
return ok?"Funny":"Not Funny";
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int q = in.nextInt();
for(int a0 = 0; a0 < q; a0++){
String s = in.next();
String result = funnyString(s);
System.out.println(result);
}
in.close();
}
}
| [
"[email protected]"
] | |
ac804e0e241ea78a7914d62cefd2eba7fc2f7e5a | 31d38828171fda7252d13f090c6c04a140550c38 | /src/P8_EvenOrOdd.java | cb76b8df3250baa4767f58fb79a16481fa38ff2b | [] | no_license | waninoko68/Week2CP2 | c032cdff850b8cecb1dcd2432d22e2899351ebec | 7b699e7ff5cbb99c545335d636196716edcaf5db | refs/heads/master | 2020-04-03T09:58:00.349314 | 2016-07-29T07:33:41 | 2016-07-29T07:33:41 | 64,460,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 338 | java |
import java.util.Scanner;
public class P8_EvenOrOdd {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int x = scan.nextInt();
if(x%2==0)
{
System.out.println("even");
}
else
{
System.out.println("odd");
}
}
}
| [
"[email protected]"
] | |
b5651b252154a331e885e9f9d5fe10ab39fc0166 | 7b76adcbdce09f892acce14ab891c7abe30b870a | /main/kafka-producer/src/main/java/edu/indiana/d2i/hadoop/custom/ProvValue.java | 5066a5f4f47a500395e73bb26778bd46e7f5b6d4 | [
"Apache-2.0"
] | permissive | Data-to-Insight-Center/streaming-prov | 4ef0583662117680484819addf1b201fed97c44f | 7957326ee78b588f5398fc0aad5f1fd0a48cd7ae | refs/heads/master | 2020-03-20T20:25:24.556952 | 2020-02-03T13:39:21 | 2020-02-03T13:39:21 | 137,686,952 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,060 | java | /*
* Copyright 2017 The Trustees of Indiana University
*
* 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.
*
* @author [email protected]
*/
package edu.indiana.d2i.hadoop.custom;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
public class ProvValue implements Writable {
private IntWritable sum;
private Text dataId;
public ProvValue() {
this.sum = new IntWritable();
this.dataId = new Text();
}
public ProvValue(IntWritable val, Text id) {
this.sum = val;
this.dataId = id;
}
public void write(DataOutput dataOutput) throws IOException {
sum.write(dataOutput);
dataId.write(dataOutput);
}
public void readFields(DataInput dataInput) throws IOException {
sum.readFields(dataInput);
dataId.readFields(dataInput);
}
public IntWritable getSum() {
return sum;
}
public Text getDataId() {
return dataId;
}
public void setSum(IntWritable sum) {
this.sum = sum;
}
public void setDataId(Text dataId) {
this.dataId = dataId;
}
@Override
public int hashCode() {
// This is used by HashPartitioner, so implement it as per need
// this one shall hash based on request id
return sum.hashCode();
}
public String toString() {
return sum.toString() + ":%%:" + dataId.toString();
}
}
| [
"[email protected]"
] | |
b0dad0d56263087372696f039783b3a469f2e2a9 | c91815da8e87f3d00ecaa919eee77b2a36385949 | /service-user-provide/src/main/java/net/sunwukong/www/user/server/web/SecurityCodeController.java | 236633e7eb843b6dd97308ed5051bbf3a4ec883c | [] | no_license | yht-817/SpringCloud_Manage | 3492e3a6b496d01d9a6fb1a88631bda26f87c258 | 6b8d6eb49caeb33a47973ee1b280054294254621 | refs/heads/master | 2020-05-03T19:01:23.532371 | 2019-04-01T03:10:23 | 2019-04-01T03:10:23 | 178,776,579 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 2,246 | java | package net.sunwukong.www.user.server.web;
import io.swagger.annotations.Api;
import net.sunwukong.www.api.entity.RequestData;
import net.sunwukong.www.api.entity.ResponseData;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* 说明:验证码控制层
*
* @author Mick
* CreateDate 2018/6/9/009 23:03
* Email :[email protected]
* Version 1.0
**/
@RestController
@RequestMapping(value = "/securitycode")
@Api(tags = "验证码控制层", description = "")
public class SecurityCodeController extends BaseController{
@RequestMapping(value="/getcode",produces= MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.POST)
public ResponseData getCode(@RequestBody(required = false) RequestData<Map<String,String>> requestData){
Map<String, String> data = requestData.getData();
return iSecurityCodeService.getCode(data.get("account"),data.get("accountType"));
}
@RequestMapping(value = "/checkacode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.POST)
public ResponseData checkaCode(@RequestBody(required = false) RequestData<Map<String, String>> requestData) {
Map<String, String> data = requestData.getData();
return iSecurityCodeService.checkaCode(data.get("account"),data.get("code"));
}
@RequestMapping(value="/getimgcode",produces= MediaType.APPLICATION_JSON_UTF8_VALUE,method = RequestMethod.POST)
public ResponseData getImgCode(){
return iSecurityCodeService.getImgCode();
}
@RequestMapping(value = "/checkaimgcode", produces = MediaType.APPLICATION_JSON_UTF8_VALUE, method = RequestMethod.POST)
public ResponseData checkaImgCode(@RequestBody(required = false) RequestData<Map<String, String>> requestData) {
Map<String, String> data = requestData.getData();
return iSecurityCodeService.checkaImgCode(data.get("account"),data.get("accountType"),data.get("code"));
}
}
| [
"[email protected]"
] | |
e62074f856bf77fb7b7060f05914e0b82e6fd130 | 7a3ec48dfa1e5aa6c59b1ea1bcac9dc502d5649d | /src/test/java/Task10.java | e0ddfd848e5fcdb15e94ba93b74295948668aa49 | [] | no_license | AlexandrNedilko/lesson-003 | fd58e25816bac7d862c27b30ecfba01fe1ef0a35 | 40f458ddff29f99739b4b179f96ebb7674499d35 | refs/heads/master | 2023-05-27T02:08:58.853795 | 2019-06-03T07:02:14 | 2019-06-03T07:02:14 | 189,895,555 | 0 | 0 | null | 2023-05-09T18:43:41 | 2019-06-02T21:10:22 | Java | UTF-8 | Java | false | false | 633 | java | //10. Write a program which prints the next figure to the console
public class Task10 {
static void drawLineX (int x) {
for (int i=0; i<x; i++)
System.out.print("***");
System.out.println();
}
static void drawLineY (int y, int x) {
for (int i=0; i<y; i++){
System.out.print("*");
for (int j=0; j<(3*x-2);j++ )
System.out.print(" ");
System.out.println("*");
}
}
public static void main(String[] args) {
int x=3;
int y=3;
drawLineX(x);
drawLineY(y, x);
drawLineX(x);
}
}
| [
"[email protected]"
] | |
2247cc1d7c99bc1eb93aef4cff2f8794d10de1f3 | f9560de3440f14fce060aa0adc73647084e75693 | /src/main/java/com/accademia/account/AccountApplication.java | f29957e192eb6227de6e35731938ee7b66993443 | [] | no_license | jeffersonSantos13/gama-accenture-spring-account | 63e06d0f0ff085ead531ec7b979ee2e98cceec3e | 91cc46a511d839f644654ce2a39f5963ff1e813f | refs/heads/master | 2022-12-29T23:29:54.539392 | 2020-10-17T20:36:45 | 2020-10-17T20:36:45 | 304,936,464 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 316 | java | package com.accademia.account;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class AccountApplication {
public static void main(String[] args) {
SpringApplication.run(AccountApplication.class, args);
}
}
| [
"[email protected]"
] | |
6ce98185185cdc2d8a55458167d9944e0ac26006 | b1c2b3af23fc9cc2d0d52e2c151adf9de8128294 | /BinPackin/src/com/bin/App.java | d62f08cdb7d5e2df46d2c665b7e37d4bdba8bfdd | [] | no_license | RahulRazdan/AlgorithmDataStructure | 11b571a6d17b1d7d79f1a9fda99dcec641b3cbc9 | bb221dd9ae6e28c5e178280461cfc1b454c15a9e | refs/heads/master | 2020-03-20T19:59:09.873427 | 2018-09-15T20:48:46 | 2018-09-15T20:48:46 | 137,664,611 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 311 | java | package com.bin;
import java.util.Arrays;
import java.util.List;
public class App {
public static void main(String[] args) {
List<Integer> items = Arrays.asList(10,5,5);
FirstFitDecreasingAlgo algo = new FirstFitDecreasingAlgo(items, 10);
algo.solveBinPackingProblem();
algo.showResults();
}
}
| [
"[email protected]"
] | |
92b0c64c3c6408591a93153b2916f2e71ae6509f | f1fb791eea8fe59b183a333a7dae883bb19cdb9c | /interleaving string.java | 14273ea1fcc41f62e55b567adbc906452b151ca6 | [] | no_license | yiyizhai/LintCode | 901a297c5d55264bc1a5c296ea1d5c203e8eb47b | 46429f4da0d0f06c56caa1d42c2063a48c5165d1 | refs/heads/master | 2020-12-25T16:54:07.303018 | 2016-08-13T01:23:30 | 2016-08-13T01:23:30 | 50,475,621 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,353 | java | public class Solution {
/**
* Determine whether s3 is formed by interleaving of s1 and s2.
* @param s1, s2, s3: As description.
* @return: true or false.
*/
public boolean isInterleave(String s1, String s2, String s3) {
// write your code here
if(s1 == null || s2 == null || s3 == null){
if(s1 == null && s2 == null && s3 == null){
return true;
}else{
return false;
}
}
int len1 = s1.length();
int len2 = s2.length();
boolean[][] result = new boolean[len1 + 1][len2 + 1];
if(len1 + len2 != s3.length()){
return false;
}
result[0][0] = true;
for(int i = 1; i <= len1; i++){
result[i][0] = result[i - 1][0] && (s1.charAt(i - 1) == s3.charAt(i - 1));
}
for(int j = 1; j <= len2; j++){
result[0][j] = result[0][j - 1] && (s2.charAt(j - 1) == s3.charAt(j - 1));
}
for(int i = 1; i <= len1; i++){
for(int j = 1; j <= len2; j++){
result[i][j] = (result[i - 1][j] && (s1.charAt(i - 1) == s3.charAt(i + j - 1))) ||
(result[i][j - 1] && (s2.charAt(j - 1) == s3.charAt(i + j - 1)));
}
}
return result[len1][len2];
}
} | [
"[email protected]"
] | |
61c9f216a7c73d73deb1d8f36e1cdb950b895026 | 8e0f603fb476bf5568fbdda2f0013c838272db6c | /LeXiang-pojo/src/main/java/com/LeXiang/pojo/PaymentmethodExample.java | 215021aee268b34f612170e43538ac0a95be0e3f | [] | no_license | 13399182359/LeXiang | 8b1d1b5dd2762174016edbcc3ef4259051cb4e11 | 7c88fdf29f9e85ce3452686de07896961a61f4f7 | refs/heads/master | 2022-12-21T10:00:48.297708 | 2019-09-22T19:36:44 | 2019-09-22T19:36:44 | 207,739,574 | 0 | 0 | null | 2022-12-16T07:15:23 | 2019-09-11T06:30:06 | JavaScript | UTF-8 | Java | false | false | 28,298 | java | package com.LeXiang.pojo;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class PaymentmethodExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public PaymentmethodExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCreateddateIsNull() {
addCriterion("createdDate is null");
return (Criteria) this;
}
public Criteria andCreateddateIsNotNull() {
addCriterion("createdDate is not null");
return (Criteria) this;
}
public Criteria andCreateddateEqualTo(Date value) {
addCriterion("createdDate =", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateNotEqualTo(Date value) {
addCriterion("createdDate <>", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateGreaterThan(Date value) {
addCriterion("createdDate >", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateGreaterThanOrEqualTo(Date value) {
addCriterion("createdDate >=", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateLessThan(Date value) {
addCriterion("createdDate <", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateLessThanOrEqualTo(Date value) {
addCriterion("createdDate <=", value, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateIn(List<Date> values) {
addCriterion("createdDate in", values, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateNotIn(List<Date> values) {
addCriterion("createdDate not in", values, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateBetween(Date value1, Date value2) {
addCriterion("createdDate between", value1, value2, "createddate");
return (Criteria) this;
}
public Criteria andCreateddateNotBetween(Date value1, Date value2) {
addCriterion("createdDate not between", value1, value2, "createddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateIsNull() {
addCriterion("lastModifiedDate is null");
return (Criteria) this;
}
public Criteria andLastmodifieddateIsNotNull() {
addCriterion("lastModifiedDate is not null");
return (Criteria) this;
}
public Criteria andLastmodifieddateEqualTo(Date value) {
addCriterion("lastModifiedDate =", value, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateNotEqualTo(Date value) {
addCriterion("lastModifiedDate <>", value, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateGreaterThan(Date value) {
addCriterion("lastModifiedDate >", value, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateGreaterThanOrEqualTo(Date value) {
addCriterion("lastModifiedDate >=", value, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateLessThan(Date value) {
addCriterion("lastModifiedDate <", value, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateLessThanOrEqualTo(Date value) {
addCriterion("lastModifiedDate <=", value, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateIn(List<Date> values) {
addCriterion("lastModifiedDate in", values, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateNotIn(List<Date> values) {
addCriterion("lastModifiedDate not in", values, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateBetween(Date value1, Date value2) {
addCriterion("lastModifiedDate between", value1, value2, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andLastmodifieddateNotBetween(Date value1, Date value2) {
addCriterion("lastModifiedDate not between", value1, value2, "lastmodifieddate");
return (Criteria) this;
}
public Criteria andVersionIsNull() {
addCriterion("version is null");
return (Criteria) this;
}
public Criteria andVersionIsNotNull() {
addCriterion("version is not null");
return (Criteria) this;
}
public Criteria andVersionEqualTo(Long value) {
addCriterion("version =", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotEqualTo(Long value) {
addCriterion("version <>", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThan(Long value) {
addCriterion("version >", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThanOrEqualTo(Long value) {
addCriterion("version >=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThan(Long value) {
addCriterion("version <", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThanOrEqualTo(Long value) {
addCriterion("version <=", value, "version");
return (Criteria) this;
}
public Criteria andVersionIn(List<Long> values) {
addCriterion("version in", values, "version");
return (Criteria) this;
}
public Criteria andVersionNotIn(List<Long> values) {
addCriterion("version not in", values, "version");
return (Criteria) this;
}
public Criteria andVersionBetween(Long value1, Long value2) {
addCriterion("version between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andVersionNotBetween(Long value1, Long value2) {
addCriterion("version not between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andOrdersIsNull() {
addCriterion("orders is null");
return (Criteria) this;
}
public Criteria andOrdersIsNotNull() {
addCriterion("orders is not null");
return (Criteria) this;
}
public Criteria andOrdersEqualTo(Integer value) {
addCriterion("orders =", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotEqualTo(Integer value) {
addCriterion("orders <>", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersGreaterThan(Integer value) {
addCriterion("orders >", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersGreaterThanOrEqualTo(Integer value) {
addCriterion("orders >=", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersLessThan(Integer value) {
addCriterion("orders <", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersLessThanOrEqualTo(Integer value) {
addCriterion("orders <=", value, "orders");
return (Criteria) this;
}
public Criteria andOrdersIn(List<Integer> values) {
addCriterion("orders in", values, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotIn(List<Integer> values) {
addCriterion("orders not in", values, "orders");
return (Criteria) this;
}
public Criteria andOrdersBetween(Integer value1, Integer value2) {
addCriterion("orders between", value1, value2, "orders");
return (Criteria) this;
}
public Criteria andOrdersNotBetween(Integer value1, Integer value2) {
addCriterion("orders not between", value1, value2, "orders");
return (Criteria) this;
}
public Criteria andDescriptionIsNull() {
addCriterion("description is null");
return (Criteria) this;
}
public Criteria andDescriptionIsNotNull() {
addCriterion("description is not null");
return (Criteria) this;
}
public Criteria andDescriptionEqualTo(String value) {
addCriterion("description =", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotEqualTo(String value) {
addCriterion("description <>", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThan(String value) {
addCriterion("description >", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
addCriterion("description >=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThan(String value) {
addCriterion("description <", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLessThanOrEqualTo(String value) {
addCriterion("description <=", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionLike(String value) {
addCriterion("description like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotLike(String value) {
addCriterion("description not like", value, "description");
return (Criteria) this;
}
public Criteria andDescriptionIn(List<String> values) {
addCriterion("description in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotIn(List<String> values) {
addCriterion("description not in", values, "description");
return (Criteria) this;
}
public Criteria andDescriptionBetween(String value1, String value2) {
addCriterion("description between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andDescriptionNotBetween(String value1, String value2) {
addCriterion("description not between", value1, value2, "description");
return (Criteria) this;
}
public Criteria andIconIsNull() {
addCriterion("icon is null");
return (Criteria) this;
}
public Criteria andIconIsNotNull() {
addCriterion("icon is not null");
return (Criteria) this;
}
public Criteria andIconEqualTo(String value) {
addCriterion("icon =", value, "icon");
return (Criteria) this;
}
public Criteria andIconNotEqualTo(String value) {
addCriterion("icon <>", value, "icon");
return (Criteria) this;
}
public Criteria andIconGreaterThan(String value) {
addCriterion("icon >", value, "icon");
return (Criteria) this;
}
public Criteria andIconGreaterThanOrEqualTo(String value) {
addCriterion("icon >=", value, "icon");
return (Criteria) this;
}
public Criteria andIconLessThan(String value) {
addCriterion("icon <", value, "icon");
return (Criteria) this;
}
public Criteria andIconLessThanOrEqualTo(String value) {
addCriterion("icon <=", value, "icon");
return (Criteria) this;
}
public Criteria andIconLike(String value) {
addCriterion("icon like", value, "icon");
return (Criteria) this;
}
public Criteria andIconNotLike(String value) {
addCriterion("icon not like", value, "icon");
return (Criteria) this;
}
public Criteria andIconIn(List<String> values) {
addCriterion("icon in", values, "icon");
return (Criteria) this;
}
public Criteria andIconNotIn(List<String> values) {
addCriterion("icon not in", values, "icon");
return (Criteria) this;
}
public Criteria andIconBetween(String value1, String value2) {
addCriterion("icon between", value1, value2, "icon");
return (Criteria) this;
}
public Criteria andIconNotBetween(String value1, String value2) {
addCriterion("icon not between", value1, value2, "icon");
return (Criteria) this;
}
public Criteria andMethodIsNull() {
addCriterion("method is null");
return (Criteria) this;
}
public Criteria andMethodIsNotNull() {
addCriterion("method is not null");
return (Criteria) this;
}
public Criteria andMethodEqualTo(Integer value) {
addCriterion("method =", value, "method");
return (Criteria) this;
}
public Criteria andMethodNotEqualTo(Integer value) {
addCriterion("method <>", value, "method");
return (Criteria) this;
}
public Criteria andMethodGreaterThan(Integer value) {
addCriterion("method >", value, "method");
return (Criteria) this;
}
public Criteria andMethodGreaterThanOrEqualTo(Integer value) {
addCriterion("method >=", value, "method");
return (Criteria) this;
}
public Criteria andMethodLessThan(Integer value) {
addCriterion("method <", value, "method");
return (Criteria) this;
}
public Criteria andMethodLessThanOrEqualTo(Integer value) {
addCriterion("method <=", value, "method");
return (Criteria) this;
}
public Criteria andMethodIn(List<Integer> values) {
addCriterion("method in", values, "method");
return (Criteria) this;
}
public Criteria andMethodNotIn(List<Integer> values) {
addCriterion("method not in", values, "method");
return (Criteria) this;
}
public Criteria andMethodBetween(Integer value1, Integer value2) {
addCriterion("method between", value1, value2, "method");
return (Criteria) this;
}
public Criteria andMethodNotBetween(Integer value1, Integer value2) {
addCriterion("method not between", value1, value2, "method");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andTimeoutIsNull() {
addCriterion("timeout is null");
return (Criteria) this;
}
public Criteria andTimeoutIsNotNull() {
addCriterion("timeout is not null");
return (Criteria) this;
}
public Criteria andTimeoutEqualTo(Integer value) {
addCriterion("timeout =", value, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutNotEqualTo(Integer value) {
addCriterion("timeout <>", value, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutGreaterThan(Integer value) {
addCriterion("timeout >", value, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutGreaterThanOrEqualTo(Integer value) {
addCriterion("timeout >=", value, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutLessThan(Integer value) {
addCriterion("timeout <", value, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutLessThanOrEqualTo(Integer value) {
addCriterion("timeout <=", value, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutIn(List<Integer> values) {
addCriterion("timeout in", values, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutNotIn(List<Integer> values) {
addCriterion("timeout not in", values, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutBetween(Integer value1, Integer value2) {
addCriterion("timeout between", value1, value2, "timeout");
return (Criteria) this;
}
public Criteria andTimeoutNotBetween(Integer value1, Integer value2) {
addCriterion("timeout not between", value1, value2, "timeout");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Integer value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Integer value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Integer value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Integer value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Integer value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Integer> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Integer> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Integer value1, Integer value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Integer value1, Integer value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
} | [
"[email protected]"
] | |
2b07b868b7111267c98f18aac8a376869d6f5b45 | f572408ff3cd4ef0c1dde612daa92a7c69b19fe2 | /ph-ubl-api/src/test/java/com/helger/ubl/api/SPITest.java | dae4c2fee9d1187f7c436e9fadc8682ee702fe7e | [
"Apache-2.0"
] | permissive | Runomu/ph-ubl | e95e994f6a2564d1889075cf7f0b02037a4b4f9a | 41de9bcdeded284988da539f3219a532f9bf8271 | refs/heads/master | 2020-07-07T00:26:43.339444 | 2016-11-14T12:39:52 | 2016-11-14T12:39:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 966 | java | /**
* Copyright (C) 2014-2016 Philip Helger (www.helger.com)
* philip[at]helger[dot]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.helger.ubl.api;
import org.junit.Test;
import com.helger.commons.mock.SPITestHelper;
/**
* Test SPI definitions
*
* @author Philip Helger
*/
public final class SPITest
{
@Test
public void testBasic () throws Exception
{
SPITestHelper.testIfAllSPIImplementationsAreValid ();
}
}
| [
"[email protected]"
] | |
fcffc8a2214f179f54d1d411024c6922d534cdf2 | 3e0bfddb9c29dc2ccdfed424c676ee3cb2e10c61 | /src/main/java/com/spring/boot/wolloxtest/Controllers/AlbumUserController.java | 95e36f4c197cda5efdd2e65aa2b14326fbe718d1 | [] | no_license | DSuyo/ExamenW | af2c8403836fb01c14b62bd46dc4e56858acb648 | 686d68dd0b683f2110a6c34c203d63a29b4d4fab | refs/heads/master | 2023-03-08T18:13:44.459789 | 2021-02-20T00:59:12 | 2021-02-20T00:59:12 | 340,162,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,878 | java | package com.spring.boot.wolloxtest.Controllers;
import com.spring.boot.wolloxtest.Controllers.wrappers.AlbumUserWrapper;
import com.spring.boot.wolloxtest.Exceptions.AlbumUserException;
import com.spring.boot.wolloxtest.Exceptions.AuthorityException;
import com.spring.boot.wolloxtest.Services.AlbumUserService;
import feign.FeignException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ResponseStatusException;
import java.util.logging.Logger;
@RestController
@RequestMapping("api/album-user")
public class AlbumUserController {
private final Logger logger = Logger.getLogger(AlbumUserController.class.toString());
@Autowired
private AlbumUserService albumUserService;
@PostMapping("/create")
public ResponseEntity<?> create (@RequestBody AlbumUserWrapper albumUserWrapper){
logger.info("create album user and authority");
try{
AlbumUserWrapper albumUserWrapperResult = this.albumUserService.createAlbumUser(albumUserWrapper.getAlbum(), albumUserWrapper.getUser(), albumUserWrapper.getAuthorities());
return new ResponseEntity<>(albumUserWrapperResult, HttpStatus.CREATED);
}
catch (FeignException.FeignClientException e){
e.printStackTrace();
logger.info("Error creating album user");
throw new ResponseStatusException( e.status(), "Error creating album user", e );
}
catch (Exception e){
e.printStackTrace();
logger.info("Internal server error");
throw new ResponseStatusException( HttpStatus.INTERNAL_SERVER_ERROR, "Internal server error", e );
}
}
@PutMapping("/update")
public ResponseEntity<?> update (@RequestBody AlbumUserWrapper albumUserWrapper){
logger.info("Update album user and authority");
try{
this.albumUserService.updateAuthorities( albumUserWrapper.getAlbum(), albumUserWrapper.getUser(), albumUserWrapper.getAuthorities());
return new ResponseEntity<>(HttpStatus.CREATED);
} catch (AlbumUserException e) {
e.printStackTrace();
logger.info(e.getMessage());
throw new ResponseStatusException( HttpStatus.NOT_FOUND, e.getMessage(), e );
} catch (AuthorityException e) {
e.printStackTrace();
logger.info(e.getMessage());
throw new ResponseStatusException( HttpStatus.NOT_FOUND, e.getMessage(), e );
} catch (Exception e){
e.printStackTrace();
logger.info("Internal server error");
throw new ResponseStatusException( HttpStatus.INTERNAL_SERVER_ERROR, "Internal server error", e );
}
}
}
| [
"[email protected]"
] | |
eb70fb071935b4d297115b287a4591a52c45141c | b35e42618890b01f01f5408c05741dc895db50a2 | /opentsp-dongfeng-modules/opentsp-dongfeng-monitor/dongfeng-monitor-core/src/main/java/com/navinfo/opentsp/dongfeng/monitor/service/car/IDispatchMessageService.java | 9f4b6cba6b15a892b417ef076635ebc932be7fc2 | [] | no_license | shanghaif/dongfeng-huanyou-platform | 28eb5572a1f15452427456ceb3c7f3b3cf72dc84 | 67bcc02baab4ec883648b167717f356df9dded8d | refs/heads/master | 2023-05-13T01:51:37.463721 | 2018-03-07T14:24:03 | 2018-03-07T14:26:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package com.navinfo.opentsp.dongfeng.monitor.service.car;
import com.navinfo.opentsp.dongfeng.common.result.HttpCommandResultWithData;
import com.navinfo.opentsp.dongfeng.monitor.commands.car.DispatchMessageCommand;
/**
* 短信调度服务
*
* @author tushenghong
* @version 1.0
* @date 2017-03-28
* @modify
* @copyright Navi Tsp
*/
public interface IDispatchMessageService {
/**
* 发送短信
*
* @param command
*/
HttpCommandResultWithData sendMessage(DispatchMessageCommand command);
}
| [
"[email protected]"
] | |
dec04f6db0161cc4fadd5b4bedc27f2e4abbdb11 | d8505e8299914e66ef4da376750ecf0ca434a978 | /com.orange.impl.service.enocean/src/com/orange/impl/service/enocean/utils/Utils.java | 87647a9348f359006990cdeb25aee1a201ebde98 | [
"Apache-2.0"
] | permissive | josesanc/OSGi-EnOcean-base-driver | 0058dd78be6384617da4b0b38b2d9670f9ad1140 | cf5e285a6b9ab15424f1d20c91fd030d59ca0267 | refs/heads/master | 2021-01-18T05:35:00.086250 | 2015-01-20T14:49:22 | 2015-01-20T14:49:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,682 | java | /*
* Software Name : OSGi EnOcean base driver
*
* Module name: com.orange.impl.service.enocean
* Version: 1.0.0
*
* Copyright (C) 2013 - 2015 Orange
*
* 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.
*
* Author(s): Victor PERRON, Mailys ROBIN, Andre BOTTARO, Antonin CHAZALET.
*/
package com.orange.impl.service.enocean.utils;
/**
* Utils.
*/
public class Utils {
private static byte[] crc8_table = new byte[] { (byte) 0x00, (byte) 0x07,
(byte) 0x0e, (byte) 0x09, (byte) 0x1c, (byte) 0x1b, (byte) 0x12,
(byte) 0x15, (byte) 0x38, (byte) 0x3f, (byte) 0x36, (byte) 0x31,
(byte) 0x24, (byte) 0x23, (byte) 0x2a, (byte) 0x2d, (byte) 0x70,
(byte) 0x77, (byte) 0x7e, (byte) 0x79, (byte) 0x6c, (byte) 0x6b,
(byte) 0x62, (byte) 0x65, (byte) 0x48, (byte) 0x4f, (byte) 0x46,
(byte) 0x41, (byte) 0x54, (byte) 0x53, (byte) 0x5a, (byte) 0x5d,
(byte) 0xe0, (byte) 0xe7, (byte) 0xee, (byte) 0xe9, (byte) 0xfc,
(byte) 0xfb, (byte) 0xf2, (byte) 0xf5, (byte) 0xd8, (byte) 0xdf,
(byte) 0xd6, (byte) 0xd1, (byte) 0xc4, (byte) 0xc3, (byte) 0xca,
(byte) 0xcd, (byte) 0x90, (byte) 0x97, (byte) 0x9e, (byte) 0x99,
(byte) 0x8c, (byte) 0x8b, (byte) 0x82, (byte) 0x85, (byte) 0xa8,
(byte) 0xaf, (byte) 0xa6, (byte) 0xa1, (byte) 0xb4, (byte) 0xb3,
(byte) 0xba, (byte) 0xbd, (byte) 0xc7, (byte) 0xc0, (byte) 0xc9,
(byte) 0xce, (byte) 0xdb, (byte) 0xdc, (byte) 0xd5, (byte) 0xd2,
(byte) 0xff, (byte) 0xf8, (byte) 0xf1, (byte) 0xf6, (byte) 0xe3,
(byte) 0xe4, (byte) 0xed, (byte) 0xea, (byte) 0xb7, (byte) 0xb0,
(byte) 0xb9, (byte) 0xbe, (byte) 0xab, (byte) 0xac, (byte) 0xa5,
(byte) 0xa2, (byte) 0x8f, (byte) 0x88, (byte) 0x81, (byte) 0x86,
(byte) 0x93, (byte) 0x94, (byte) 0x9d, (byte) 0x9a, (byte) 0x27,
(byte) 0x20, (byte) 0x29, (byte) 0x2e, (byte) 0x3b, (byte) 0x3c,
(byte) 0x35, (byte) 0x32, (byte) 0x1f, (byte) 0x18, (byte) 0x11,
(byte) 0x16, (byte) 0x03, (byte) 0x04, (byte) 0x0d, (byte) 0x0a,
(byte) 0x57, (byte) 0x50, (byte) 0x59, (byte) 0x5e, (byte) 0x4b,
(byte) 0x4c, (byte) 0x45, (byte) 0x42, (byte) 0x6f, (byte) 0x68,
(byte) 0x61, (byte) 0x66, (byte) 0x73, (byte) 0x74, (byte) 0x7d,
(byte) 0x7a, (byte) 0x89, (byte) 0x8e, (byte) 0x87, (byte) 0x80,
(byte) 0x95, (byte) 0x92, (byte) 0x9b, (byte) 0x9c, (byte) 0xb1,
(byte) 0xb6, (byte) 0xbf, (byte) 0xb8, (byte) 0xad, (byte) 0xaa,
(byte) 0xa3, (byte) 0xa4, (byte) 0xf9, (byte) 0xfe, (byte) 0xf7,
(byte) 0xf0, (byte) 0xe5, (byte) 0xe2, (byte) 0xeb, (byte) 0xec,
(byte) 0xc1, (byte) 0xc6, (byte) 0xcf, (byte) 0xc8, (byte) 0xdd,
(byte) 0xda, (byte) 0xd3, (byte) 0xd4, (byte) 0x69, (byte) 0x6e,
(byte) 0x67, (byte) 0x60, (byte) 0x75, (byte) 0x72, (byte) 0x7b,
(byte) 0x7c, (byte) 0x51, (byte) 0x56, (byte) 0x5f, (byte) 0x58,
(byte) 0x4d, (byte) 0x4a, (byte) 0x43, (byte) 0x44, (byte) 0x19,
(byte) 0x1e, (byte) 0x17, (byte) 0x10, (byte) 0x05, (byte) 0x02,
(byte) 0x0b, (byte) 0x0c, (byte) 0x21, (byte) 0x26, (byte) 0x2f,
(byte) 0x28, (byte) 0x3d, (byte) 0x3a, (byte) 0x33, (byte) 0x34,
(byte) 0x4e, (byte) 0x49, (byte) 0x40, (byte) 0x47, (byte) 0x52,
(byte) 0x55, (byte) 0x5c, (byte) 0x5b, (byte) 0x76, (byte) 0x71,
(byte) 0x78, (byte) 0x7f, (byte) 0x6A, (byte) 0x6d, (byte) 0x64,
(byte) 0x63, (byte) 0x3e, (byte) 0x39, (byte) 0x30, (byte) 0x37,
(byte) 0x22, (byte) 0x25, (byte) 0x2c, (byte) 0x2b, (byte) 0x06,
(byte) 0x01, (byte) 0x08, (byte) 0x0f, (byte) 0x1a, (byte) 0x1d,
(byte) 0x14, (byte) 0x13, (byte) 0xae, (byte) 0xa9, (byte) 0xa0,
(byte) 0xa7, (byte) 0xb2, (byte) 0xb5, (byte) 0xbc, (byte) 0xbb,
(byte) 0x96, (byte) 0x91, (byte) 0x98, (byte) 0x9f, (byte) 0x8a,
(byte) 0x8D, (byte) 0x84, (byte) 0x83, (byte) 0xde, (byte) 0xd9,
(byte) 0xd0, (byte) 0xd7, (byte) 0xc2, (byte) 0xc5, (byte) 0xcc,
(byte) 0xcb, (byte) 0xe6, (byte) 0xe1, (byte) 0xe8, (byte) 0xef,
(byte) 0xfa, (byte) 0xfd, (byte) 0xf4, (byte) 0xf3 };
/**
* Computes the EnOcean ESP3 CRC8 of a byte array. See EnOcean ESP3
* specification for details.
*
* @param data
* @return the computed crc8.
*/
public static byte crc8(byte[] data) {
int output = 0;
for (int i = 0; i < data.length; i++) {
int index = (output ^ data[i]) & 0xff;
output = crc8_table[index];
}
return (byte) (output & 0xff);
}
/**
* Returns a byte[] collection from a single byte
*
* @param x
* @return byteToBytes
*/
public static byte[] byteToBytes(byte x) {
byte[] out = new byte[1];
out[0] = x;
return out;
}
/**
* Concatenates two byte arrays
*
* @param a
* @param b
* @return byteConcat
*/
public static byte[] byteConcat(byte[] a, byte[] b) {
byte[] c = new byte[a.length + b.length];
for (int i = 0; i < a.length; i++) {
c[i] = a[i];
}
for (int i = 0; i < b.length; i++) {
c[i + a.length] = b[i];
}
return c;
}
/**
* @param a
* @param b
* @return byteConcat
*/
public static byte[] byteConcat(byte[] a, byte b) {
byte[] c = new byte[a.length + 1];
for (int i = 0; i < a.length; i++) {
c[i] = a[i];
}
c[a.length] = b;
return c;
}
/**
* @param a
* @param b
* @return byteConcat
*/
public static byte[] byteConcat(byte a, byte[] b) {
byte[] c = new byte[b.length + 1];
for (int i = 0; i < b.length; i++) {
c[1 + i] = b[i];
}
c[0] = a;
return c;
}
/**
* @param a
* @param b
* @return byteConcat
*/
public static byte[] byteConcat(byte a, byte b) {
byte[] c = new byte[2];
c[0] = a;
c[1] = b;
return c;
}
/**
* Concatenates a byte array and an int, up to max bytes from the right
*
* @param a
* @param x
* @param max
* @return intConcat
*/
public static byte[] intConcat(byte[] a, int x, int max) {
byte[] c = new byte[a.length + max];
for (int i = 0; i < max; i++) {
byte b = (byte) ((x >> (8 * i)) & 0xff);
c[a.length + max - i - 1] = b;
}
return c;
}
// Collection of helper functions --> Pay attention to ENDIANNESS
/**
* @param x
* @return intTo1Byte
*/
public static byte[] intTo1Byte(int x) {
byte[] out = new byte[1];
out[0] = (byte) (x & 0xff);
return out;
}
/**
* @param x
* @return intTo2Bytes
*/
public static byte[] intTo2Bytes(int x) {
byte[] out = new byte[2];
out[1] = (byte) (x & 0xff);
out[0] = (byte) ((x >> 8) & 0xff);
return out;
}
/**
* @param x
* @return intTo4Bytes
*/
public static byte[] intTo4Bytes(int x) {
byte[] out = new byte[4];
out[3] = (byte) (x & 0xff);
out[2] = (byte) ((x >> 8) & 0xff);
out[1] = (byte) ((x >> 16) & 0xff);
out[0] = (byte) ((x >> 24) & 0xff);
return out;
}
private static final char[] hexArray = { '0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
/**
* @param bytes
* @return bytesToHexString
*/
public static String bytesToHexString(byte[] bytes) {
char[] hexChars = new char[bytes.length * 2];
int v;
for (int j = 0; j < bytes.length; j++) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
/**
* @param b
* @return byteToHexString
*/
public static String byteToHexString(byte b) {
char[] hexChar = new char[2];
int v = b & 0xFF;
hexChar[0] = hexArray[v >>> 4];
hexChar[1] = hexArray[v & 0x0F];
return new String(hexChar);
}
/**
* @param bytes
* @param offset
* @param len
* @return bytes2intLE
*/
public static int bytes2intLE(byte[] bytes, int offset, int len) {
int sum = 0;
for (int i = 0; i < len; i++) {
byte b = bytes[offset + len - i - 1];
sum = sum + ((b & 0xff) << (i * 8));
}
return sum;
}
/**
* @param bytes
* @param offset
* @param len
* @return byteRange
*/
public static byte[] byteRange(byte[] bytes, int offset, int len) {
byte[] out = new byte[len];
for (int i = 0; i < len; i++) {
out[i] = bytes[offset + i];
}
return out;
}
/**
* @param orig
* @param len
* @return padUpTo
*/
public static byte[] padUpTo(byte[] orig, int len) {
byte[] padded = new byte[len];
if (orig.length < len) {
for (int i = 0; i < orig.length; i++) {
padded[i] = orig[i];
}
}
return padded;
}
}
| [
"[email protected]"
] | |
9647c084e96843f868c8d37e469333a45791c644 | 79f600c1e464de66d1874d5cce1cc3d9c65052f5 | /Demo/SDK-DEMO/src/com/dji/sdkdemo/SelectDroneTypeActivity.java | dd2f70b4b17680fd15368ce3459daad897317d00 | [] | no_license | clover3/DJI_SDKDemo2_3 | a13e86f28f6d1fe574c83a4e35328ce6ca3d2f49 | f982eebfd69edb9181dcac8408a0ba5775cd7420 | refs/heads/master | 2021-01-10T13:10:26.853119 | 2015-09-24T15:32:14 | 2015-09-24T15:32:14 | 43,075,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,022 | java | package com.dji.sdkdemo;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import dji.log.DJILogHelper;
import dji.sdk.api.DJIDrone;
import dji.sdk.api.DJIError;
import dji.sdk.api.DJIDroneTypeDef.DJIDroneType;
import dji.sdk.api.media.DJIMedia;
import dji.sdk.api.Camera.DJICameraSettingsTypeDef.CameraPreviewResolutionType;
import dji.sdk.interfaces.DJIGerneralListener;
import dji.sdk.interfaces.DJIMediaFetchCallBack;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Process;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
@SuppressLint("ViewHolder") public class SelectDroneTypeActivity extends DemoBaseActivity
{
private static final String TAG = "SelectDroneTypeActivity";
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_select_drone_type);
ListView mListView = (ListView)findViewById(R.id.select_drone_listView);
mListView.setAdapter(new SelectDroneTypeAdapter());
mListView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View v, int index, long arg3) {
onListItemClick(index);
}
});
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
}
@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
}
@Override
protected void onDestroy()
{
// TODO Auto-generated method stub
super.onDestroy();
Process.killProcess(Process.myPid());
}
private void onListItemClick(int index) {
Intent intent = null;
intent = new Intent(SelectDroneTypeActivity.this, MainActivity.class);
intent.putExtra("DroneType", index);
this.startActivity(intent);
}
private static final DroneTypeInfo[] DroneTypes = {
new DroneTypeInfo(R.string.drone_type_title_p2v, R.string.drone_type_desc_p2v),
new DroneTypeInfo(R.string.drone_type_title_inspire1, R.string.drone_type_desc_inspire1),
new DroneTypeInfo(R.string.drone_type_title_p3s, R.string.drone_type_desc_p3s),
// new DroneTypeInfo(R.string.drone_type_title_m100, R.string.drone_type_desc_m100)
};
private class SelectDroneTypeAdapter extends BaseAdapter {
public SelectDroneTypeAdapter() {
super();
}
@Override
public View getView(int index, View convertView, ViewGroup parent) {
convertView = View.inflate(SelectDroneTypeActivity.this, R.layout.demo_info_item, null);
TextView title = (TextView)convertView.findViewById(R.id.title);
TextView desc = (TextView)convertView.findViewById(R.id.desc);
title.setText(DroneTypes[index].title);
desc.setText(DroneTypes[index].desc);
return convertView;
}
@Override
public int getCount() {
return DroneTypes.length;
}
@Override
public Object getItem(int index) {
return DroneTypes[index];
}
@Override
public long getItemId(int id) {
return id;
}
}
private static class DroneTypeInfo{
private final int title;
private final int desc;
public DroneTypeInfo(int title , int desc) {
this.title = title;
this.desc = desc;
}
}
private static boolean first = false;
private Timer ExitTimer = new Timer();
class ExitCleanTask extends TimerTask{
@Override
public void run() {
Log.e("ExitCleanTask", "Run in!!!! ");
first = false;
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if (keyCode == KeyEvent.KEYCODE_BACK) {
Log.d(TAG,"onKeyDown KEYCODE_BACK");
if (first) {
first = false;
finish();
}
else
{
first = true;
Toast.makeText(SelectDroneTypeActivity.this, getText(R.string.press_again_exit), Toast.LENGTH_SHORT).show();
ExitTimer.schedule(new ExitCleanTask(), 2000);
}
//finish();
return true;
}
return super.onKeyDown(keyCode, event);
}
}
| [
"[email protected]"
] | |
d9f82d475f6a44a595b5b37672c63d4a1017fca4 | 2a47c172463ad55a8749fce839d70c842f85f4c9 | /tests/org/elixir_lang/reference/callable/Issue517Test.java | e5d5245eb4109dbf9be46b1c4523f1e6aff55bbf | [
"Apache-2.0"
] | permissive | ortex/intellij-elixir | 034491fe356eaa5bfb08705daf9037925dab6502 | 9fdba1020ecc4ba465292c6c7aa04a9f42fb3e67 | refs/heads/master | 2020-09-24T06:00:19.993680 | 2019-12-01T19:24:39 | 2019-12-01T19:24:39 | 225,681,678 | 0 | 0 | NOASSERTION | 2019-12-03T17:48:06 | 2019-12-03T17:48:05 | null | UTF-8 | Java | false | false | 1,162 | java | package org.elixir_lang.reference.callable;
import com.intellij.psi.PsiElement;
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
import org.elixir_lang.psi.UnqualifiedNoArgumentsCall;
import static org.elixir_lang.reference.Callable.variableUseScope;
public class Issue517Test extends LightCodeInsightFixtureTestCase {
/*
* Tests
*/
public void testVariableUseScope() {
myFixture.configureByFiles("variable_use_scope.ex");
@SuppressWarnings("ConstantConditions") PsiElement callable = myFixture
.getFile()
.findElementAt(myFixture.getCaretOffset())
.getParent()
.getParent();
assertInstanceOf(callable, UnqualifiedNoArgumentsCall.class);
assertEquals(
LocalSearchScope.EMPTY,
variableUseScope((UnqualifiedNoArgumentsCall) callable)
);
}
/*
* Protected Instance Methods
*/
@Override
protected String getTestDataPath() {
return "testData/org/elixir_lang/reference/callable/issue_517";
}
}
| [
"[email protected]"
] | |
42ba7bf402aee572a448181a311739595ca42e2e | 6490e64291c2d071a60027dc2c6171b2bd1fe143 | /app/src/main/java/com/philong/lazada/controller/fragment/FragmentThoiTrang.java | c78350162645ec7c5332a169dd2c0359eb612f68 | [] | no_license | dhpl/lazada | 603e0232041e0fa201897c16b1af2575681b32fc | 2ea81dc837175c97a91eddb6793a408cc9b9b50f | refs/heads/master | 2021-01-23T09:39:07.751643 | 2017-09-07T15:18:31 | 2017-09-07T15:18:31 | 102,587,658 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 862 | java | package com.philong.lazada.controller.fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.philong.lazada.R;
/**
* Created by Long on 9/6/2017.
*/
public class FragmentThoiTrang extends Fragment {
public static FragmentThoiTrang newInstance() {
Bundle args = new Bundle();
FragmentThoiTrang fragment = new FragmentThoiTrang();
fragment.setArguments(args);
return fragment;
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_thoi_trang, container, false);
return view;
}
}
| [
"[email protected]"
] | |
f8eb1ada82e871dd71e1c0a038ca4b96055cdedc | bd729ef9fcd96ea62e82bb684c831d9917017d0e | /CHPT/source/tags/V0.8/SspApp/ser_src/com/ctfo/sysmanage/service/impl/AdjustOnOffServiceImpl.java | 826c92604eaef6a286e75c84ae1319f775cfd165 | [] | no_license | shanghaif/workspace-kepler | 849c7de67b1f3ee5e7da55199c05c737f036780c | ac1644be26a21f11a3a4a00319c450eb590c1176 | refs/heads/master | 2023-03-22T03:38:55.103692 | 2018-03-24T02:39:41 | 2018-03-24T02:39:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 689 | java | package com.ctfo.sysmanage.service.impl;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import com.ctfo.sys.beans.TbOnOff;
import com.ctfo.sysmanage.dao.TbOnOffDao;
import com.ctfo.sysmanage.service.AdjustOnOffService;
@Controller
public class AdjustOnOffServiceImpl implements AdjustOnOffService{
@Autowired
TbOnOffDao tbOnOffDao;
@Override
public int updateOnOff(Map map) {
// TODO Auto-generated method stub
return tbOnOffDao.updateOnOff(map);
}
@Override
public TbOnOff selectPK(String onOffId) {
// TODO Auto-generated method stub
return tbOnOffDao.selectPK(onOffId);
}
}
| [
"[email protected]"
] | |
8dcdd59db57297d49dcbe29acc852442473d29c5 | 1454deb1be78be495522415611d681ea339f9754 | /t6/calculadora/calculadora-view/src/ort/t6/calculadora/view/PanelEste.java | 427eee7cc815bdfb78ae1d8fcc9fed8ce8ae0583 | [] | no_license | damianlezcano/svn-ort | ce8b7aa736bc11422edabad555e3513303e25cb1 | ff48820947df3bcdf104dd659523d52c5c66c818 | refs/heads/master | 2021-01-15T19:45:24.120218 | 2012-08-02T21:00:57 | 2012-08-02T21:00:57 | 33,054,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,637 | java | package ort.t6.calculadora.view;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import ort.t6.calculadora.core.fabrica.FabricaOperaciones;
import ort.t6.calculadora.core.modelo.Calculadora;
import ort.t6.calculadora.core.modelo.Operacion;
public class PanelEste extends Panel {
private JButton borrar;
private JButton cambiarSigno;
// private Calculadora calculadora;
private FabricaOperaciones fabrica;
public PanelEste(){
super();
BoxLayout layout = new BoxLayout(this,BoxLayout.PAGE_AXIS);
setLayout(layout);
borrar = new JButton("C");
borrar.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
reiniciar();
}
});
add(borrar);
cambiarSigno = new JButton("+/-");
cambiarSigno.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
cambiarSigno();
}
});
add(cambiarSigno);
agregarOperacionesDinamicas();
}
public PanelEste(Calculadora calculadora){
this();
this.calculadora = calculadora;
}
private void agregarOperacionesDinamicas(){
fabrica = FabricaOperaciones.getInstance();
for (Operacion operacion : fabrica.traerOperaciones()) {
if((operacion.getOperacion() != Operacion.SUMA) && (operacion.getOperacion() != Operacion.RESTA) &&
(operacion.getOperacion() != Operacion.MULTIPLICACION) && (operacion.getOperacion() != Operacion.DIVISION)){
JButton boton = crearBotonOperacion(operacion.getOperacion());
add(boton);
}
}
}
private JButton crearBotonOperacion(String texto){
JButton boton = new JButton(texto);
boton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ejecutarOperacion(e);
}
});
return boton;
}
private void ejecutarOperacion(ActionEvent e){
JButton boton = (JButton) e.getSource();
calculadora.agregarOperador(boton.getText());
}
public void reiniciar(){
calculadora.reiniciar();
}
public void cambiarSigno(){
calculadora.cambiarSigno();
}
//**************************************************
public JButton getBorrar() {
return borrar;
}
public void setBorrar(JButton borrar) {
this.borrar = borrar;
}
public JButton getCambiarSigno() {
return cambiarSigno;
}
public void setCambiarSigno(JButton cambiarSigno) {
this.cambiarSigno = cambiarSigno;
}
} | [
"[email protected]@c3038d21-ecf1-1489-44a9-52e1197a981f"
] | [email protected]@c3038d21-ecf1-1489-44a9-52e1197a981f |
b8327a69dc73b32c1d588b1a38e382caffffcd77 | a6f354ad5ffb11a1543e99230e1e5a5627b56d66 | /src/controller/AccountManager.java | 695f00120f07374d19614a9a2e47e0099a9cb6ba | [] | no_license | xuanthinh2612/CASE_STUDY_MODULE_2 | 35d6a40c47c44ccdb1d9533def85d735159cc6da | 1ad639fa0b845819f8f18bcdcf9be26e94ee9c4a | refs/heads/master | 2023-02-18T20:13:01.311518 | 2021-01-19T06:32:51 | 2021-01-19T06:32:51 | 329,563,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,325 | java | package controller;
import model.account.Account;
import java.util.ArrayList;
import java.util.List;
public class AccountManager {
static List<Account> accountList = new ArrayList<>();
static private final String USER_ACCOUNT_DATA = "src/model/Storage/userData.dat";
public static int writeAccount(Account account) {
int success = 1;
int addedFalse = -1;
accountList = FileWriterReader.fileReader(USER_ACCOUNT_DATA);
for (Account a : accountList){
if (a.getId().equals(account.getId())){
return addedFalse;
}
}
accountList.add(account);
FileWriterReader.fileWriter(accountList, USER_ACCOUNT_DATA);
return success;
}
public static int deleteAccount(String accountID) {
int success = 1;
int fail = -1;
accountList = FileWriterReader.fileReader(USER_ACCOUNT_DATA);
for (Account a : accountList){
if (a.getId().equals(accountID)){
accountList.remove(a);
FileWriterReader.fileWriter(accountList, USER_ACCOUNT_DATA);
return success;
}
}
return fail;
}
public static List<Account> readAccountData() {
return FileWriterReader.fileReader(USER_ACCOUNT_DATA);
}
}
| [
"[email protected]"
] | |
107a375db32fb03d0ca090b5559d717fe815d9c6 | 3cc6bf9702df3090a8278e8cd4e0267e96d39418 | /gsgp-canonical/src/edu/gsgp/population/treebuilder/GrowBuilder.java | ea7291e4e71135f5a9afdea5e0c9ee48341b23c5 | [
"MIT"
] | permissive | joaofbsm/gsgp-struct | 9440d40a4da2f1397b8a886c2a80fd0a433d4647 | 30c6356830c148c4f6ac22e4f701b5531b894b22 | refs/heads/master | 2021-09-06T06:10:58.208053 | 2018-02-02T23:10:55 | 2018-02-02T23:10:55 | 103,163,322 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 972 | java | /*
Copyright 2006 by Sean Luke
Licensed under the Academic Free License version 3.0
See the file "LICENSE" for more information
*/
package edu.gsgp.population.treebuilder;
import edu.gsgp.MersenneTwister;
import edu.gsgp.nodes.Node;
import edu.gsgp.nodes.functions.Function;
import edu.gsgp.nodes.terminals.Terminal;
/**
* @author Luiz Otavio Vilas Boas Oliveira
* http://homepages.dcc.ufmg.br/~luizvbo/
* [email protected]
* Copyright (C) 20014, Federal University of Minas Gerais, Belo Horizonte, Brazil
*/
public class GrowBuilder extends TreeBuilder {
public GrowBuilder(final int maxDepth,
final int minDepth,
final Function[] functions,
final Terminal[] terminals) {
super(maxDepth, minDepth, functions, terminals);
}
@Override
public Node newRootedTree(final int current, MersenneTwister rnd){
return growNode(0, maxDepth, rnd);
}
}
| [
"[email protected]"
] | |
efc38dc5d1f16f0ca73abc26faf30238711e199b | 655ee072037b640ffbdf7996b42eb40b50889b0a | /src/com/cisco/eManager/common/log/ObjectType.java | c85ce7b7c6a6cd02f0c82d86401b21fbd6b30906 | [] | no_license | mamiles/eManager | 23b4d97aeceeb6a34e1bee574a1fc2a48cfc9f68 | 74ec6897e36608001ef11b2946d3f48f2fcf9928 | refs/heads/master | 2016-08-05T00:34:24.885860 | 2012-02-11T21:43:13 | 2012-02-11T21:43:13 | 3,418,100 | 1 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,644 | java | /*
* This class was automatically generated with
* <a href="http://castor.exolab.org">Castor 0.9.4</a>, using an
* XML Schema.
* $Id$
*/
package com.cisco.eManager.common.log;
//---------------------------------/
//- Imported classes and packages -/
//---------------------------------/
import java.io.IOException;
import java.io.Reader;
import java.io.Serializable;
import java.io.Writer;
import org.exolab.castor.xml.*;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.ValidationException;
import org.xml.sax.ContentHandler;
/**
*
*
* @version $Revision$ $Date$
**/
public class ObjectType extends MyObjectType
implements java.io.Serializable
{
//----------------/
//- Constructors -/
//----------------/
public ObjectType() {
super();
} //-- com.cisco.eManager.common.log.ObjectType()
//-----------/
//- Methods -/
//-----------/
/**
**/
public boolean isValid()
{
try {
validate();
}
catch (org.exolab.castor.xml.ValidationException vex) {
return false;
}
return true;
} //-- boolean isValid()
/**
*
*
* @param out
**/
public void marshal(java.io.Writer out)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
{
Marshaller.marshal(this, out);
} //-- void marshal(java.io.Writer)
/**
*
*
* @param handler
**/
public void marshal(org.xml.sax.ContentHandler handler)
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
{
Marshaller.marshal(this, handler);
} //-- void marshal(org.xml.sax.ContentHandler)
/**
*
*
* @param reader
**/
public static com.cisco.eManager.common.log.ObjectType unmarshal(java.io.Reader reader)
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
{
return (com.cisco.eManager.common.log.ObjectType) Unmarshaller.unmarshal(com.cisco.eManager.common.log.ObjectType.class, reader);
} //-- com.cisco.eManager.common.log.ObjectType unmarshal(java.io.Reader)
/**
**/
public void validate()
throws org.exolab.castor.xml.ValidationException
{
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
validator.validate(this);
} //-- void validate()
}
| [
"[email protected]"
] | |
b05f2f6f112f23fb3ac340824743b2e99503680e | b5f1b83240fb89fc803995052bd8116c0b5750bf | /library/src/garlicg/widget/sidecover/LeftCover.java | a49031b5793dacbadb6d17ab8a04ab0e572fd598 | [
"Apache-2.0"
] | permissive | garlicG/SideCover | 33d7da73e5d8c0ddfc3fadfdd8e90b998fe34d4f | bfbbb48307f5c6cb46780ef69644017bf3adf1c8 | refs/heads/master | 2021-01-19T17:48:20.157309 | 2015-07-15T16:25:18 | 2015-07-15T16:25:18 | 9,564,615 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,387 | java | /**
* Copyright 2013 TAKAHIRO GOTO <[email protected]>
*
* 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 garlicg.widget.sidecover;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.VelocityTracker;
public class LeftCover extends SideCover{
public LeftCover(Context context) {
super(context);
}
public LeftCover(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public Drawable getDropShadowColor(int color) {
final int endColor = color & 0x00FFFFFF;
return new GradientDrawable(GradientDrawable.Orientation.LEFT_RIGHT, new int[] {
color,
endColor,
});
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
// final int width = r - l;
final int height = b - t;
final int offsetPixels = mCurrentOffset;
mCoverContainer.layout(0, 0, mCoverWidth, height);
offsetCover(offsetPixels);
}
/**
* Offsets the menu relative to its original position based on the position of the content.
*
* @param offsetPixels The number of pixels the content if offset.
*/
private void offsetCover(int offsetPixels) {
if (mCoverWidth != 0) {
final int menuWidth = mCoverWidth;
final float openRatio = 1.f-(menuWidth - (float) offsetPixels) / menuWidth;
final int oldMenuLeft = mCoverContainer.getLeft();
final int offset = (int) ((-(1.f-openRatio) * menuWidth)) - oldMenuLeft;
mCoverContainer.offsetLeftAndRight(offset);
// if(mIsAlphaAnimation)
// mCoverContainer.getBackground().setAlpha((int) ((0xFF-(0xFF-ON_EDGE_COVER_ALPHA) * (1.f - openRatio))));
}
}
@Override
protected void drawDropShadow(Canvas canvas, int offsetPixels) {
final int height = getHeight();
// final int menuWidth = mCoverWidth;
// final float openRatio = 1.f- ((menuWidth - (float) offsetPixels) / menuWidth);
mDropShadowDrawable.setBounds(offsetPixels, 0, offsetPixels + mDropShadowWidth, height);
// if(mIsAlphaAnimation)
// mDropShadowDrawable.setAlpha((int) (0xFF-(0xFF * (1.f - openRatio))));
mDropShadowDrawable.draw(canvas);
}
@Override
protected void onOffsetPixelsChanged(int offsetPixels) {
offsetCover(offsetPixels);
invalidate();
}
@Override
protected boolean isAirTouch(MotionEvent ev) {
return ev.getX() > mCurrentOffset;
}
@Override
protected boolean onDownAllowDrag(MotionEvent ev , final float initialMotionX) {
return (!mIsCoverVisible && initialMotionX <= mTouchWidth)
|| (mIsCoverVisible && initialMotionX >= mCurrentOffset);
}
@Override
protected boolean onMoveAllowDrag(MotionEvent ev, float diff, final float initialMotionX) {
return (!mIsCoverVisible && initialMotionX <= mTouchWidth && (diff > 0))
|| (mIsCoverVisible && initialMotionX >= mCurrentOffset);
}
@Override
protected void onMoveEvent(float dx) {
setOffsetPixels(Math.min(Math.max(mCurrentOffset + (int) dx, 0), mCoverWidth));
}
@Override
protected void onUpEvent(MotionEvent ev , VelocityTracker tracker) {
final int offsetPixels = mCurrentOffset;
if (mIsDragging) {
final int initialVelocity = (int) tracker.getXVelocity();
animateOffsetTo(tracker.getXVelocity() > 0 ? mCoverWidth : 0, initialVelocity);
} else if (mIsCoverVisible && ev.getX() > offsetPixels) {
closeCover();
}
}
} | [
"[email protected]"
] | |
9630f44eb26d9f1a7f6c25905bb549b2dd8a0a77 | 1a333ddd7e2b0164b7dfc789b14e3ad2c728d90c | /app/src/main/java/com/example/content_provider/Contacts.java | 9e04cee7c6ea7d2554568a45a3119f2e6aeca7da | [] | no_license | Muniir-abdullahi/Phonebook_contacts | a654d7a6d30ad802981d889748e2e7925e213009 | dd60fef70afa7954d6bfbb0bbfb7879cabe77e3a | refs/heads/master | 2022-12-25T10:55:49.063452 | 2020-10-03T14:27:09 | 2020-10-03T14:27:09 | 300,898,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,593 | java | package com.example.content_provider;
import androidx.appcompat.app.AppCompatActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
public class Contacts extends AppCompatActivity {
ListView li;
Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_contacts);
li = (ListView)findViewById(R.id.listvuew);
btn = (Button)findViewById(R.id.button);
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Cursor cursor = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
null,
null,
null,
null
);
startManagingCursor(cursor);
String[] from = {ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,
ContactsContract.CommonDataKinds.Phone.NUMBER,
ContactsContract.CommonDataKinds.Phone._ID
};
int[] to = {android.R.id.text1,android.R.id.text2};
SimpleCursorAdapter simpleCursorAdapter = new SimpleCursorAdapter(Contacts.this,android.R.layout.simple_list_item_2,cursor,from,to);
li.setAdapter(simpleCursorAdapter);
li.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
}
});
}
} | [
"[email protected]"
] | |
a10b1abe77e98079b5a80a1b151d69cd2a9df911 | 875b1a493e3751c34323d4c9fb06894c89ef9c5d | /beer-order-service/src/main/java/com/example/beerorderservice/domain/Customer.java | 5e94cc79330b2835fcb026972fe5225b3e1adebd | [] | no_license | DayvonAllen/mssc-brewery-micro-spring | 3a536b1e7e96aee30c3d9dc0a332d7d4e1a331ca | 30a4c88aac8393335124f5529f7f5f24da81ee89 | refs/heads/main | 2023-05-13T00:29:58.464874 | 2021-05-05T04:43:22 | 2021-05-05T04:43:22 | 363,809,256 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 969 | java | package com.example.beerorderservice.domain;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import java.sql.Timestamp;
import java.util.Set;
import java.util.UUID;
@Getter
@Setter
@NoArgsConstructor
@Entity
public class Customer extends BaseEntity {
@Builder
public Customer(UUID id, Long version, Timestamp createdDate, Timestamp lastModifiedDate, String customerName,
UUID apiKey, Set<BeerOrder> beerOrders) {
super(id, version, createdDate, lastModifiedDate);
this.customerName = customerName;
this.apiKey = apiKey;
this.beerOrders = beerOrders;
}
private String customerName;
@Column(length = 36, columnDefinition = "varchar")
private UUID apiKey;
@OneToMany(mappedBy = "customer")
private Set<BeerOrder> beerOrders;
} | [
"[email protected]"
] | |
28b8147f3745ea2dce736210bb02a3f602becb64 | 6a649709010f35916b58ad639eb24dc9d7452344 | /AL-Game/src/com/aionemu/gameserver/network/aion/serverpackets/SM_ABYSS_ARTIFACT_INFO2.java | 4c5dac182fd4a967dfa0c4cf0d187ae99fc25b15 | [] | no_license | soulxj/aion-cn | 807860611e746d8d4c456a769a36d3274405fd7e | 8a0a53cf8f99233cbee82f341f2b5c33be0364fa | refs/heads/master | 2016-09-11T01:12:19.660692 | 2014-08-11T14:59:38 | 2014-08-11T14:59:38 | 41,342,802 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,839 | java | /*
* This file is part of aion-unique <aion-unique.org>.
*
* aion-unique is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aion-unique is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aion-unique. If not, see <http://www.gnu.org/licenses/>.
*/
package com.aionemu.gameserver.network.aion.serverpackets;
import java.util.Collection;
import javolution.util.FastList;
import com.aionemu.gameserver.model.siege.SiegeLocation;
import com.aionemu.gameserver.model.siege.SiegeType;
import com.aionemu.gameserver.network.aion.AionConnection;
import com.aionemu.gameserver.network.aion.AionServerPacket;
public class SM_ABYSS_ARTIFACT_INFO2 extends AionServerPacket {
private Collection<SiegeLocation> locations;
public SM_ABYSS_ARTIFACT_INFO2(Collection<SiegeLocation> collection) {
this.locations = collection;
}
@Override
protected void writeImpl(AionConnection con) {
FastList<SiegeLocation> validLocations = new FastList<SiegeLocation>();
for (SiegeLocation loc : locations) {
if (((loc.getType() == SiegeType.ARTIFACT) || (loc.getType() == SiegeType.FORTRESS))
&& (loc.getLocationId() >= 1011) && (loc.getLocationId() < 2000))
validLocations.add(loc);
}
writeH(validLocations.size());
for (SiegeLocation loc : validLocations) {
writeD(loc.getLocationId());
writeC(0);
}
}
}
| [
"[email protected]"
] | |
3730090d9e736a1dba668789ca86e8a44cd92752 | ec20d98f468564ac540a04f3ff52df189a6f7c04 | /app/src/androidTest/java/com/lis/bubble_java/ExampleInstrumentedTest.java | 837a373fc0d084caf43330bb585ac1786af81240 | [] | no_license | xunyixiangchao/bubble_java | ee67ae36d0a3965025622858d188f3d364cddec0 | 7bec2dc38c7ff0e367b90a485fa37727e2a5284d | refs/heads/master | 2021-01-19T23:19:32.642399 | 2017-04-25T07:05:46 | 2017-04-25T07:05:46 | 88,955,087 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package com.lis.bubble_java;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.lis.bubble_java", appContext.getPackageName());
}
}
| [
"[email protected]"
] | |
6f1f4df51519a933d0546cc6891523ca8fe9c392 | 456d43c584fb66f65c6a7147cdd22595facf8bd9 | /jpa/deferred/src/main/java/example/model/Customer1166.java | 586739bd8798154bdc4e9d0c8a7bf3b09244789f | [
"Apache-2.0"
] | permissive | niushapaks/spring-data-examples | 283eec991014e909981055f48efe67ff1e6e19e6 | 1ad228b04523e958236d58ded302246bba3c1e9b | refs/heads/main | 2023-08-21T14:25:55.998574 | 2021-09-29T13:14:33 | 2021-09-29T13:14:33 | 411,679,335 | 1 | 0 | Apache-2.0 | 2021-09-29T13:11:03 | 2021-09-29T13:11:02 | null | UTF-8 | Java | false | false | 628 | java | package example.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Customer1166 {
@Id @GeneratedValue(strategy = GenerationType.AUTO) private long id;
private String firstName;
private String lastName;
protected Customer1166() {}
public Customer1166(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
@Override
public String toString() {
return String.format("Customer1166[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName);
}
}
| [
"[email protected]"
] | |
335c15a2fcbbb989e7d4cf5b37b294a017857d24 | 40f5cdcf2bc30beabd272f1880e536da548c64b0 | /src/test/java/stepdefinitions/WebTableStepDefinitions.java | 3748e115a9ad6c815aa4dff591eea9f28cad0cac | [] | no_license | aysekilic34/mycucumberframework | 6159ae08b393b2e2c9f02a27a433761778bf21f8 | 1b78960d055cada2fe0b811db08eb6d20e27b9f8 | refs/heads/master | 2023-02-20T04:34:48.855523 | 2021-01-11T18:33:57 | 2021-01-11T18:33:57 | 328,756,590 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,045 | java | package stepdefinitions;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Then;
import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import pages.WebtablePage;
import utilities.Driver;
import java.util.List;
public class WebTableStepDefinitions {
WebtablePage webtablePage=new WebtablePage();
@Then("Company listesini consola yazdirir")
public void company_listesini_consola_yazdirir() {
for (WebElement w: webtablePage.sirketlerListesiWE
) {
System.out.println(w.getText());
}
}
@And("{string}'in listede oldugunu test eder")
public void inListedeOldugunuTestEder(String sirket) {
int flag=0;
for (WebElement w: webtablePage.sirketlerListesiWE
) {
if (w.getText().equals(sirket)){
flag=1;
}
}
Assert.assertTrue(flag==1);
}
@And("{string} Prev.Close degerini yazdirir")
public void prevCloseDegeriniYazdirir(String sirket) {
int sirketSatirNo=12;
int flag=0;
for (int i=0; i<webtablePage.sirketlerListesiWE.size();i++){
if (webtablePage.sirketlerListesiWE.get(i).getText().equals(sirket)){
sirketSatirNo=i+1;
flag=1;
}
}
if (flag ==1){
//tbody//tr[15]//td[3]
String arananPrevCloseXpath="//tbody//tr[" + sirketSatirNo + "]//td[3]";
String arananPrevClose= Driver.getDriver().findElement(By.xpath(arananPrevCloseXpath)).getText();
System.out.println("aradiginiz " + sirket + " sirketinin Prev.Close degeri : " + arananPrevClose);
} else {
System.out.println("aradiginiz sirket tabloda yok");
}
}
@Then("satir sayisi {string}, sutun sayisi {string} olan elementi yazdirir")
public void satirSayisiSutunSayisiOlanElementiYazdirir(String satir, String sutun) {
//tbody//tr[5]//td[3]
String arananXpath="//tbody//tr["+satir+"]//td["+sutun+"]";
WebElement arananElement=Driver.getDriver().findElement(By.xpath(arananXpath));
System.out.println(satir + ". satir "+ sutun + ".sutundaki yazi : " + arananElement.getText());
}
@Then("basligi {string} olan sutundaki tum bilgileri yazdirir")
public void basligiOlanSutundakiTumBilgileriYazdirir(String baslik) {
int baslikIndex=-1;
for (int i=0;i<webtablePage.basliklarListesi.size();i++){
if (webtablePage.basliklarListesi.get(i).getText().equals(baslik)){
baslikIndex=i+1;
}
}
if (baslikIndex>0){
String sutunXpath="//tbody//tr//td["+baslikIndex+"]";
List<WebElement> istenenSutunListesi=Driver.getDriver().findElements(By.xpath(sutunXpath));
for (WebElement w:istenenSutunListesi
) {
System.out.println(w.getText());
}
}else System.out.println("istediginiz baslik bulunamadi");;
}
}
| [
"[email protected]"
] | |
cab6ee76fdd6843325907da594d22f449aec2a81 | 6a7e7d006071184d4772a5e9d8cabbe53b2a0919 | /SpringBootSkippableDemo/src/main/java/com/cts/hc/configurations/BatchConfiguration.java | aae06f8aeca771d9a43e9e11c5deb0997df09d31 | [] | no_license | gspandy/SpringBatch | 74ac9ab0960590fa3fa982bf30d0aac02f651543 | 1509d915651a7512a8a674491f9a7eae55b4c35a | refs/heads/master | 2023-08-10T02:26:26.566005 | 2018-03-12T11:50:27 | 2018-03-12T11:50:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,477 | java | package com.cts.hc.configurations;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.JobExecutionListener;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.launch.support.RunIdIncrementer;
import org.springframework.batch.core.step.skip.SkipPolicy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.cts.hc.listeners.JobCompletionNotificationListener;
import com.cts.hc.model.Trade;
import com.cts.hc.processors.FxMarketEventProcessor;
import com.cts.hc.readers.FxMarketEvent;
import com.cts.hc.readers.FxMarketEventReader;
import com.cts.hc.writers.TradeWriter;
/**
* The Class BatchConfiguration.
*
* @author
*/
@Configuration
@EnableBatchProcessing
public class BatchConfiguration {
@Autowired
public JobBuilderFactory jobBuilderFactory;
@Autowired
public StepBuilderFactory stepBuilderFactory;
// FxMarketEventReader (Reader)
@Bean
public FxMarketEventReader fxMarketEventReader() {
return new FxMarketEventReader();
}
// FxMarketEventProcessor (Processor)
@Bean
public FxMarketEventProcessor fxMarketEventProcessor() {
return new FxMarketEventProcessor();
}
// TradeWriter (Writer)
@Bean
public TradeWriter tradeWriter() {
return new TradeWriter();
}
// JobCompletionNotificationListener (File loader)
@Bean
public JobExecutionListener jobExecutionListener() {
return new JobCompletionNotificationListener();
}
@Bean
public SkipPolicy fileVerificationSkipper() {
return new FileVerificationSkipper();
}
// Configure job step
@Bean
public Job fxMarketPricesETLJob() {
return jobBuilderFactory.get("FxMarket Prices ETL Job").incrementer(new RunIdIncrementer()).listener(jobExecutionListener())
.flow(etlStep()).end().build();
}
@Bean
public Step etlStep() {
return stepBuilderFactory.get("Extract -> Transform -> Aggregate -> Load").<FxMarketEvent, Trade> chunk(10000)
.reader(fxMarketEventReader()).faultTolerant().skipPolicy(fileVerificationSkipper()).processor(fxMarketEventProcessor())
.writer(tradeWriter())
.build();
}
}
| [
"[email protected]"
] | |
13562fed7a86e38c34b1897c7d0e6f2bcb344f86 | b2d699f3130b90f54dc5b6b520b21f5606792d09 | /Factory/FactoryJava/src/main/java/org/example/App.java | e01a64787e25454564143a5823f6f5746a763ddd | [] | no_license | franka107/DesignPatterns | 64580e5d68ae96041f42b24a6dab0c73ac3a6a93 | 422a3b53b74a359fd56a02e21970846cff473d35 | refs/heads/master | 2023-01-14T11:29:50.437986 | 2020-11-20T18:15:37 | 2020-11-20T18:15:37 | 314,443,413 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 612 | java | package org.example;
import org.example.factory.Dialog;
import org.example.factory.HtmlDialog;
import org.example.factory.WindowsDialog;
/**
* Hello world!
*
*/
public class App
{
private static Dialog dialog;
public static void main( String[] args )
{
configure();
runBusinessLogic();
}
static void configure(){
if(System.getProperty("os.name").equals("Windows 10")){
dialog = new WindowsDialog();
} else {
dialog = new HtmlDialog();
}
}
static void runBusinessLogic(){
dialog.renderWindow();
}
}
| [
"[email protected]"
] | |
a1cad885cd60ea3520b78fe19f3af7a8bf5a52c8 | a5afc496d1acc30c9a74ebe9a7b6561350ceed79 | /other-identifiers/src/main/java/org/reactome/release/otherIdentifiers/Main.java | 233f07d338e99aecdb26855c70c7e8af911cc1fe | [] | no_license | reactome/data-release-pipeline | 51a111da4c7d51621147a7e3dd06e95ed553dd9b | ee606a78675c2f7535ed5f756a6453b3ed3b5578 | refs/heads/main | 2022-07-09T12:05:18.165896 | 2022-03-11T18:48:13 | 2022-03-11T18:48:13 | 130,117,984 | 1 | 1 | null | 2023-08-31T14:34:13 | 2018-04-18T20:25:38 | Java | UTF-8 | Java | false | false | 1,544 | java | package org.reactome.release.otherIdentifiers;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.gk.persistence.MySQLAdaptor;
import java.io.FileInputStream;
import java.nio.file.Paths;
import java.util.Properties;
public class Main {
private static final Logger logger = LogManager.getLogger();
private static final String RESOURCES_DIR = Paths.get("src", "main", "resources").toString();
public static void main(String[] args) throws Exception {
String pathToConfig = args.length > 0 ? args[0] : Paths.get(RESOURCES_DIR ,"config.properties").toString();
Properties props = new Properties();
props.load(new FileInputStream(pathToConfig));
//Set up DB adaptor
String username = props.getProperty("release.database.user");
String password = props.getProperty("release.database.password");
String host = props.getProperty("release.database.host");
int port = Integer.valueOf(props.getProperty("release.database.port"));
String releaseCurrent = props.getProperty("release_current.name");
String releasePrevious = props.getProperty("release_previous.name");
MySQLAdaptor dbAdaptor = new MySQLAdaptor(host, releaseCurrent, username, password, port);
MySQLAdaptor dbAdaptorPrev = new MySQLAdaptor(host, releasePrevious, username, password, port);
logger.info("Executing post-step checks");
PostStepChecks.compareOtherIdentifierCounts(dbAdaptor, dbAdaptorPrev);
}
}
| [
"[email protected]"
] | |
22b016617c103ab38d7373a3955f426263e4a974 | 3552ba5925a2a471c5776325aec590e785ff6b75 | /app/src/main/java/example/com/myapplication/MainActivity.java | a32213e8ba66c372b3ed10d323c5e937034ab64e | [] | no_license | GitHub-Xzhi/MyApplication | 0b1823a5fa26501f773d9778f439f207d7225e63 | 7394801f7e2eed5d3f66c3ee1b7ff1757825ced5 | refs/heads/master | 2021-01-20T13:17:12.885119 | 2017-02-21T13:53:45 | 2017-02-21T13:53:45 | 82,685,165 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 357 | java | package example.com.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
| [
"[email protected]"
] | |
49e3c2a9cf0b58c9a25366c14b16c27057617d97 | 0ac5d2489514416f7640ec75eb10f1dc575230ef | /src/cn/model/common/Inter.java | fab900ab7795b25a1cf43cdc6f24a4c1ddb74ec0 | [] | no_license | liuenci/ShopManageSystem | 2e38f82c5038785a31e2051d09463cab63c51c55 | 9e88eb463738c5e66eb2b7336e3a22294832f7c7 | refs/heads/master | 2021-09-07T08:34:57.731872 | 2018-02-20T10:53:31 | 2018-02-20T10:53:31 | 103,722,529 | 3 | 0 | null | null | null | null | GB18030 | Java | false | false | 721 | java | package cn.model.common;
/**
* 采购计划表和商品表的中间表
*
* @author LuckyJavaCi
*
*/
public class Inter {
// 关系表主键
private int inter_id;
// 采购计划编号
private int inter_planId;
// 商品编号
private int inter_goodsId;
// 设置set和get方法
public int getInter_id() {
return inter_id;
}
public void setInter_id(int inter_id) {
this.inter_id = inter_id;
}
public int getInter_planId() {
return inter_planId;
}
public void setInter_planId(int inter_planId) {
this.inter_planId = inter_planId;
}
public int getInter_goodsId() {
return inter_goodsId;
}
public void setInter_goodsId(int inter_goodsId) {
this.inter_goodsId = inter_goodsId;
}
}
| [
"[email protected]"
] | |
5eb47d1ca18ceae674caaf8c46e3eb2d88501223 | 9049eabb2562cd3e854781dea6bd0a5e395812d3 | /sources/com/google/android/gms/auth/uiflows/addaccount/AddAccountActivity.java | 16879586d8b1a4dc226ee05f3f4e55e49af58689 | [] | no_license | Romern/gms_decompiled | 4c75449feab97321da23ecbaac054c2303150076 | a9c245404f65b8af456b7b3440f48d49313600ba | refs/heads/master | 2022-07-17T23:22:00.441901 | 2020-05-17T18:26:16 | 2020-05-17T18:26:16 | 264,227,100 | 2 | 5 | null | null | null | null | UTF-8 | Java | false | false | 188 | java | package com.google.android.gms.auth.uiflows.addaccount;
/* compiled from: :com.google.android.gms@[email protected] (120300-306758586) */
public class AddAccountActivity extends qkl {
}
| [
"[email protected]"
] | |
beab8b7025086acfba99ccbaaddce041e23d55c1 | f81a2e6518afc829ef827bc3f88d1cacf566bc0c | /android/app/src/debug/java/com/shoppingbook/ReactNativeFlipper.java | 84d1becaa35223be5ad96554fbf4d1e8eef56423 | [] | no_license | yoonseongd/ShoppingBook | a88ca70c088abbdbbcb68604f706a1bc940ff251 | 30592de9e4bd345f7afe9c3e94b9c90e3d658a26 | refs/heads/master | 2022-12-26T11:59:12.617133 | 2020-10-13T09:24:04 | 2020-10-13T09:24:04 | 303,552,597 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,267 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.shoppingbook;
import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;
public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}
| [
"[email protected]"
] | |
c6746d7de3d48697e18d9ba6156bc602a160410a | 2d552840b9f01339ca34729a8354fe1da8c808b8 | /src/main/java/com/example/demo/proxy/RealSubject2.java | 58caa430453adbe539c70f7a9b5921e72908f471 | [] | no_license | hut1210/demo | 18a74a0f506381bb2a3e82b7972cfe90ec604ede | e547dcedd12cf4fede2f9a08d93e8e6fc1f32498 | refs/heads/master | 2022-11-15T23:11:03.578699 | 2020-06-30T15:00:27 | 2020-06-30T15:00:27 | 259,539,692 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package com.example.demo.proxy;
/**
* @Author: Hut
* @Date: 2020/04/21 13:35
**/
public class RealSubject2 implements Subject,Subject2 {
@Override
public void doSomething() {
System.out.println("Subject2doSomething()......");
}
@Override
public void doSomething1() {
System.out.println("Subject2doSomething()1......");
}
@Override
public void doSomething3() {
System.out.println("Subject2doSomething()3......");
}
@Override
public void doSomething4() {
System.out.println("Subject2doSomething()4......");
}
}
| [
"96531210"
] | 96531210 |
7cddd8337720db84b5c904e9552b962d74bec7db | a98625b08432e2e3fd37d8bd6bb6cdf953017999 | /src/main/java/com/dw/controller/OpenTableController.java | 908f705d306f90a0d383f28cdbe1ed2b54f79bb6 | [] | no_license | lodichang/Dwpos | 62f5622de46e83f7bb4a5593d94ca672356ed87b | ddc6049cca73c265abc4e172a16bbfa0fddd84c9 | refs/heads/master | 2020-03-19T07:43:18.981545 | 2018-06-05T08:33:47 | 2018-06-05T08:33:47 | 136,143,385 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 17,727 | java | package com.dw.controller;
import com.ablegenius.netty.client.MessageNonAck;
import com.ablegenius.netty.common.Message;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.dw.Main;
import com.dw.dto.*;
import com.dw.entity.*;
import com.dw.enums.*;
import com.dw.netty.NettyClient;
import com.dw.print.PrintRxTx;
import com.dw.service.*;
import com.dw.util.*;
import com.dw.view.MainView;
import com.dw.view.TakeOrderIndexView;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFutureListener;
import javafx.concurrent.Task;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.ablegenius.netty.common.NettyCommonProtocol.REQUEST;
import static com.dw.util.DateUtil.CM_DATE_FORMAT;
/**
* Created by lodi on 2018/2/24.
*/
@Component
public class OpenTableController {
@Value("${STATION_ID}")
private String stationId;
@Autowired
private TakeOrderIndexView takeOrderIndexView;
@Autowired
private MainView mainView;
private PosTableDto posTableDto;
private int persons = 0;
@Autowired
private PosLogService posLogService;
@Autowired
private PosTranService posTranService;
@Autowired
private PosTranHisService posTranHisService;
@Autowired
private PosTableActionService posTableActionService;
@Autowired
private MainController mainController;
@Autowired
private NettyClient nettyClient;
//默认显示开台时间
private Boolean isShowOpenTableTime = false;
public OpenTableController() {
}
/**
* 執行開台操作
*/
public void init(PosTableDto posTableDto) {
this.posTableDto = posTableDto;
PosTran tran = null;
PosLogDto logDto = null;
boolean checkLeaveSeat = Boolean.parseBoolean(AppUtils.isNotBlank(Main.posSetting.get("checkLeaveSeat")) ? Main.posSetting.get("checkLeaveSeat") : "false");
if (checkLeaveSeat) {
if (AppUtils.isNotBlank(posTableDto) && null != posTableDto.getTableState() && posTableDto.getTableState().equals(TableStateEnum.HASPAYED.getValue())) {
//如果是已经拍脚未离座状态,则弹出框让选择。
Map<String, String> resultMap = new LinkedHashMap<>();
resultMap.put(ResultEnum.YES.getName(), ResultEnum.YES.getValue());
resultMap.put(ResultEnum.NO.getName(), ResultEnum.NO.getValue());
resultMap.put(ResultEnum.REOPEN.getName(), ResultEnum.REOPEN.getValue());
String result = ShowViewUtil.showWarningView(Main.languageMap.get("popups.title.prompt"), Main.languageMap.get("table.leaveseat"), resultMap, null);
if (result.equals(ResultEnum.YES.getValue())) {
updateTranHisLeaveDate();
persons = 0;
} else if (result.equals(ResultEnum.REOPEN.getValue())) {
updateTranHisLeaveDate();
tran = openTable(posTableDto.getRoomNum());
}
MainController mainController = (MainController) mainView.getPresenter();
Main.showInitialView(mainView.getClass());
mainController.refreshTables(mainController.getCurrentTablesPage(), mainController.getCurrentArea());
}
}
if (!checkLeaveSeat || (AppUtils.isNotBlank(posTableDto) && (null == posTableDto.getTableState() || !posTableDto.getTableState().equals(TableStateEnum.HASPAYED.getValue())))) {
if (AppUtils.isNotBlank(posTableDto)) {
// 判断是否已经开台,TRAN表是否有该台的N记录
List<PosTran> posTranDtos = posTranService.queryListByTable(posTableDto.getRoomNum(), TranTypeEnum.N.getValue());
if (AppUtils.isNotBlank(posTranDtos)) {
tran = posTranDtos.get(0);
persons = tran.getPerson();
} else {
persons = 0;
tran = openTable(posTableDto.getRoomNum());
if (isShowOpenTableTime) {
PosTran finalTran = tran;
Task task = new Task<Void>() {
@Override
public Void call() {
try {
PosOrderDetailDto posOrderDetailDto = new PosOrderDetailDto();
posOrderDetailDto.setTel(Main.posOutletDto.getTel());
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
posOrderDetailDto.setDateTime(dateFormat.format(finalTran.getInDate()));
posOrderDetailDto.setSCode(Main.posStaff.getName1());
String tranCode = finalTran.getOutlet() + finalTran.getRefNum() + finalTran.getSubRef() + finalTran.getTranType();
posOrderDetailDto.setOrderCount("0");
posOrderDetailDto.setOrderAmt("0.00");
posOrderDetailDto.setBillAmt("0.00");
posOrderDetailDto.setPerson(finalTran.getPerson().toString());
posOrderDetailDto.setTranCode(tranCode);
posOrderDetailDto.setTableNum(finalTran.getTableNum());
posOrderDetailDto.setTableNo(finalTran.getTableNum());
posOrderDetailDto.setServCost("0.00");
posOrderDetailDto.setDiscAmt("-" + "0.00");
PrintRxTx.printRxTxInstance().printAction(posOrderDetailDto);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
};
new Thread(task).start();
}
isShowOpenTableTime = false;
}
}
}
if (persons > 0) {
PosTableAction posTableAction = isExistOperatorTable(posTableDto.getRoomNum());
if(posTableAction != null){
Map<String, String> map = new HashMap();
map.put(Main.languageMap.get("global.confirm"), ResultEnum.YES.getValue());
ShowViewUtil.showWarningView(Main.languageMap.get("global.prompt"), "编号" + posTableAction.getOpStaff() + " " + posTableAction.getOpStaffName() + "正在操作該檯,請稍候再操作" , map, mainController.getMainStage());
return;
}
TakeOrderIndexController takeOrderIndexController = (TakeOrderIndexController) takeOrderIndexView.getPresenter();
takeOrderIndexController.initData(tran, posTableDto, false, InitDataTypeEnum.SETTLE.getValue());
Main.showInitialView(takeOrderIndexView.getClass());
}
}
/**
* 普通开台和重新开台都需要调用的方法。
*/
public PosTran openTable(String tableNum) {
PosTran tran = new PosTran();
PosLogDto logDto = new PosLogDto();
String result = ShowViewUtil.showNumbericKeyboard(Main.getStage(), "請輸入入座人數", "4", true);
if (!ResultEnum.NO.getValue().equals(result)) {
if (AppUtils.isNotBlank(result)) {
if (result.contains("showTime")) {
isShowOpenTableTime = true;
result = result.trim().substring(8);
}
if (Integer.parseInt(result.trim()) > 0) {
persons = Integer.parseInt(result.trim());
// 獲取單號
String orderNo = AppUtils.autoGenericCode(posTranService.getTranOrderNo(), Integer.parseInt(Main.posSetting.get("refnum_length")));
// 检查账单是否重复,如果重复重新获取
while (posTranService.queryByRefNum(orderNo, DateUtil.getCurrTimeYmd()) > 0) {
orderNo = AppUtils.autoGenericCode(posTranService.getTranOrderNo(), Integer.parseInt(Main.posSetting.get("refnum_length")));
}
try {
// 添加tran賬單
//tran.setRefNum(DateUtil.getCurrTimeYmd() + orderNo);
tran.setRefNum(orderNo);
tran.setSubRef("00");
tran.setStationId(stationId);
tran.setOutlet(Main.posSetting.get("outlet"));
tran.setTableNum(tableNum);
tran.setTranType(TranTypeEnum.N.getValue());
tran.setOpenStaff(Main.posStaff.getCode());
tran.setPerson(persons);
tran.setInDate(new Date());
tran.setInTime(new Date());
tran.setHeadCount(String.valueOf(persons));
tran.setId(IDManager.generateIDs());
tran.setOrderDisc(new BigDecimal("0.00"));
tran.setTIndex(Long.parseLong(orderNo));
tran.setLastUpdateNameId(Main.posStaff.getCode());
posTranService.insertPosTran(tran);
// 添加pos_log
logDto.setOutlet(Main.posSetting.get("outlet"));
logDto.setTDate(tran.getInDate());
logDto.setTTime(tran.getInTime());
logDto.setStaff(tran.getOpenStaff());
logDto.setLogType("STBL");
logDto.setType(TranTypeEnum.N.getValue());
logDto.setRefNum(tran.getRefNum());
logDto.setSubRef(tran.getSubRef());
logDto.setTable1(tran.getTableNum());
logDto.setId(IDManager.generateIDs());
posLogService.insertPosLog(logDto);
//開台上數雲端
apiOpenTable(tran, logDto);
//開臺成功後發送netty去通知其他機器刷新桌臺
// netty通知其他POS端刷新
Task task = new Task<Void>() {
@Override
public Void call() {
Channel channel = nettyClient.getChannel();
NettyMessageDto msgDto = new NettyMessageDto(NettyMessageTypeEnum.OPENTABLE,null);
String text = JSONObject.toJSONString(msgDto);
Message message = new Message();
message.sign(REQUEST);
message.setClientId(NettyClient.NETTY_CLIENT_ID);
message.data(text);
channel.writeAndFlush(message).addListener((ChannelFutureListener) future -> {});
//防止对象处理发生异常的情况
MessageNonAck msgNonAck = new MessageNonAck(message, channel);
nettyClient.getClientConnector().addNeedAckMessageInfo(msgNonAck);
return null;
}
};
new Thread(task).start();
} catch (Exception e) {
e.printStackTrace();
} finally {
}
}
}
}
return tran;
}
private void apiOpenTable(PosTran tran, PosLogDto logDto) {
Task task = new Task<Void>() {
@Override
public Void call() {
try {
// 是否開台上數雲端
// IS_UPDATE_FOR_OPEN_TABLE=TRUE;
String uploadData = Main.posSetting.get("uploadData");
if (AppUtils.isNotBlank(uploadData) && uploadData.equals("TRUE")) {
//向云端插入一条记录,并返回跳转用的URL,分店将此URL打印成二维码
//請求链接返回url用来生成二维码,pos客户端直接访问云端接口,不再访问message进行跳转
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("channel", "HTML"));
params.add(new BasicNameValuePair("outline", Main.outline));
params.add(new BasicNameValuePair("outlet", Main.posSetting.get("outlet")));
params.add(new BasicNameValuePair("refNum", DateUtil.getCurrTimeYmd() + tran.getRefNum()));
params.add(new BasicNameValuePair("subRef", tran.getSubRef()));
params.add(new BasicNameValuePair("stationId", tran.getStationId()));
params.add(new BasicNameValuePair("tableNum", tran.getTableNum()));
params.add(new BasicNameValuePair("tranType", TranTypeEnum.N.getValue()));
params.add(new BasicNameValuePair("openStaff", Main.posStaff.getCode()));
params.add(new BasicNameValuePair("person", persons + ""));
params.add(new BasicNameValuePair("inDate", DateUtil.DateToString(tran.getInDate(), CM_DATE_FORMAT)));
params.add(new BasicNameValuePair("inTime", DateUtil.DateToString(tran.getInTime(), CM_DATE_FORMAT)));
params.add(new BasicNameValuePair("tIndex", tran.getTIndex() + ""));
params.add(new BasicNameValuePair("orders", ""));
String logs = "";
List<PosLogDto> logDtoList = new ArrayList<>();
if (AppUtils.isNotBlank(logDto)) {
net.sf.json.JSONObject logDtoJson = net.sf.json.JSONObject.fromObject(logDto);
logDtoJson.put("TDate", logDto.getTDate().getTime());
logDtoJson.put("TTime", logDto.getTTime().getTime());
logDtoJson.put("version", logDto.getVersion().getTime());
logs = "[" + logDtoJson.toString() + "]";
}
params.add(new BasicNameValuePair("logs", logs));
String url = Main.posSetting.get("apiUrl") + Main.posSetting.get("apiGetQRCodeUrl");
//发送http请求
String responseStr = HttpClientUtil.post(url, params);
JSONObject resultJson = JSONObject.parseObject(responseStr);
if (resultJson != null) {
if (AppUtils.isNotBlank(resultJson.get("code")) && (Integer) resultJson.get("code") == 1) {
System.out.println("上数云端成功");
} else {
System.out.println("上数云端失败" + resultJson.get("msg"));
}
} else {
System.out.println("上数云端失败,无法连接上数接口");
}
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
};
new Thread(task).start();
}
/**
* 更新tran表的leave_date,离座或者重新开台都需要这么操作
*/
private void updateTranHisLeaveDate() {
List<PosTranHis> posTranDtos = posTranHisService.queryListByTable(posTableDto.getRoomNum(), TranTypeEnum.N.getValue());
if (AppUtils.isNotBlank(posTranDtos)) {
PosTranHis posTranHis = posTranDtos.get(0);
posTranHis.setLeaveDate(new Date());
posTranHis.setLeaveTime(new Date());
posTranHisService.updateById(posTranHis);
}
}
/**
* 判断某桌台是否正在被操作,如果不是就插入一条记录后返回null,否则就直接返回存在操作桌台的记录
*/
public PosTableAction isExistOperatorTable(String tableNum) {
Wrapper<PosTableAction> posTableActionWrapper = new EntityWrapper<>();
posTableActionWrapper.eq("TABLE_NUM", tableNum);
PosTableAction posTableAction = posTableActionService.selectOne(posTableActionWrapper);
if (posTableAction != null) {
return posTableAction;
} else {
PosTableAction newPosTableAction = new PosTableAction();
newPosTableAction.setTableNum(tableNum);
newPosTableAction.setOpStaff(Main.posStaff.getCode());
newPosTableAction.setOpStaffName(Main.posStaff.getName1());
newPosTableAction.setStationId(stationId);
newPosTableAction.setTTime(new Date());
posTableActionService.insert(newPosTableAction);
return null;
}
}
}
| [
"[email protected]"
] | |
b4deccb1eb4884e47b0c984a862d1fb20473d930 | 9e4601501c71f6690e0f7bd99f157d7076a481b3 | /vendor/fop/test/java/org/apache/fop/pdf/PDFStreamTestCase.java | 6c59eabfd8f7b8a11bb67b4520dd0567dc56930b | [
"Apache-2.0"
] | permissive | Fallmist42/hq | 5d74ae98d766b16dd047bde7a3433fa22a3643f0 | b67e302b8660318d84583c9138b9b59f56a05787 | refs/heads/master | 2020-12-11T08:06:22.887854 | 2015-10-02T14:22:17 | 2015-10-02T14:22:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,396 | 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.
*/
/* $Id: PDFStreamTestCase.java 1305467 2012-03-26 17:39:20Z vhennebert $ */
package org.apache.fop.pdf;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import org.junit.Before;
import org.junit.Test;
public class PDFStreamTestCase {
private PDFStream stream;
@Before
public void createStream() {
stream = new PDFStream();
stream.setObjectNumber(1);
PDFDocument pdfDocument = new PDFDocument("Apache FOP");
stream.setDocument(pdfDocument);
}
@Test
public void testFilterSetup() {
testGetFilterList();
testSetupFilterList();
}
private void testGetFilterList() {
PDFFilterList filterList = stream.getFilterList();
assertFalse(filterList.isInitialized());
assertEquals(0, filterList.getFilters().size());
}
private void testSetupFilterList() {
stream.setupFilterList();
PDFFilterList filterList = stream.getFilterList();
assertTrue(filterList.isInitialized());
assertEquals(1, filterList.getFilters().size());
PDFFilter filter = filterList.getFilters().get(0);
assertEquals("/FlateDecode", filter.getName());
}
@Test
public void customFilter() {
PDFFilterList filters = stream.getFilterList();
filters.addFilter("null");
assertTrue(filters.isInitialized());
assertEquals(1, filters.getFilters().size());
PDFFilter filter = filters.getFilters().get(0);
assertEquals("", filter.getName());
}
@Test
public void testStream() throws IOException {
PDFFilterList filters = stream.getFilterList();
filters.addFilter("null");
byte[] bytes = createSampleData();
stream.setData(bytes);
ByteArrayOutputStream actual = new ByteArrayOutputStream();
stream.outputRawStreamData(actual);
assertArrayEquals(bytes, actual.toByteArray());
}
@Test
public void testEncodeStream() throws IOException {
PDFFilterList filters = stream.getFilterList();
filters.addFilter("null");
byte[] bytes = createSampleData();
stream.setData(bytes);
ByteArrayOutputStream actual = new ByteArrayOutputStream();
StreamCache streamCache = stream.encodeStream();
streamCache.outputContents(actual);
assertArrayEquals(bytes, actual.toByteArray());
}
@Test
public void testEncodeAndWriteStream() throws IOException {
PDFFilterList filters = stream.getFilterList();
filters.addFilter("null");
byte[] bytes = createSampleData();
stream.setData(bytes);
ByteArrayOutputStream actual = new ByteArrayOutputStream();
PDFNumber number = new PDFNumber();
stream.encodeAndWriteStream(actual, number);
assertArrayEquals(createSampleStreamData(), actual.toByteArray());
}
private byte[] createSampleData() {
byte[] bytes = new byte[10];
for (int i = 0; i < 10; i++) {
bytes[i] = (byte) i;
}
return bytes;
}
private byte[] createSampleStreamData() throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
stream.write("stream\n".getBytes("US-ASCII"));
stream.write(createSampleData());
stream.write("\nendstream".getBytes("US-ASCII"));
return stream.toByteArray();
}
}
| [
"[email protected]"
] | |
eb3abe91efa99ad87a5cb026cd8705093fc6b77f | f67d3c5927c57c7e18701f5cab2513872ebc3074 | /customer-engine/src/main/java/com/pzj/core/customer/bankcard/BankCardWriteEngine.java | bc551ccf9613d7b15db114f982674dd8a01fefd3 | [
"Apache-2.0"
] | permissive | yhysmile/pzjuser | 8ae91a6cf3f6ca71e4ecc23225ef6ddf3dc10807 | 51e3b4e6094fd41f6d60217965ab266d1c1aa4bb | refs/heads/master | 2021-01-19T22:36:10.850719 | 2017-04-20T06:40:52 | 2017-04-20T06:40:52 | 88,829,801 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,959 | java | package com.pzj.core.customer.bankcard;
import com.pzj.core.customer.common.exception.CustomerException;
import com.pzj.core.customer.common.exception.CustomerExceptionCode;
import com.pzj.core.customer.profile.BankCardEntity;
import com.pzj.core.customer.profile.ResellerEntity;
import com.pzj.core.customer.write.BankCardWriteMapper;
import com.pzj.core.customer.write.CustomerWriteMapper;
import com.pzj.framework.idgen.IDGenerater;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Date;
/**
* Created by Administrator on 2017-3-3.
*/
@Component("bankCardWriteEngine")
public class BankCardWriteEngine {
@Resource
private BankCardWriteMapper bankCardWriteMapper;
@Resource
private CustomerWriteMapper customerWriteMapper;
@Resource
private IDGenerater idGenerater;
private ResellerEntity getCustomerById(Long id){
ResellerEntity operatorEntity = customerWriteMapper.selectById(id);
return operatorEntity;
}
private BankCardEntity getBankCardById(Long id){
BankCardEntity originalBankCardEntity = bankCardWriteMapper.selectById(id);
return originalBankCardEntity;
}
/**
*
* @param bankCardEntity
* @return
*/
public Long createMicroshopBankCard(BankCardEntity bankCardEntity) {
// 数据非空校验
nonEmptyCheckForCreate(bankCardEntity);
ResellerEntity operatorEntity = getCustomerById(bankCardEntity.getCreateBy());
// 其它字段初始化
initOtherFieldsForCreate(bankCardEntity, operatorEntity);
// 执行插入
int insert = bankCardWriteMapper.insert(bankCardEntity);
if (insert == 1)
return bankCardEntity.getId();
return null;
}
/*
创建银行卡时,验校一些非空字段
*/
private void nonEmptyCheckForCreate(BankCardEntity entity){
if (entity == null){
throw new CustomerException(CustomerExceptionCode.PARAMETER_EMPTY);
}
if (entity.getAccountHolder() == null){
throw new CustomerException(CustomerExceptionCode.BANKCARD_NULL_ACCOUNT_HOLDER);
}
if (entity.getBank() == null){
throw new CustomerException(CustomerExceptionCode.BANKCARD_NULL_BANK);
}
if (entity.getIdNum() == null){
throw new CustomerException(CustomerExceptionCode.BANKCARD_NULL_ID_NUM);
}
if (entity.getCardNum() == null){
throw new CustomerException(CustomerExceptionCode.BANKCARD_NULL_CARD_NUM);
}
if (entity.getDataSource() == null){
throw new CustomerException(CustomerExceptionCode.DATASOURCE_EMPTY);
}
if (entity.getCreateBy() == null){
throw new CustomerException(CustomerExceptionCode.OPERATOR_NULL);
}
}
/*
创建银行卡时,初始化一些其它字段数据
*/
private void initOtherFieldsForCreate(BankCardEntity bankCardEntity, ResellerEntity operatorEntity){
long newId = idGenerater.nextId();
bankCardEntity.setId(newId);
Long ownerId = ownerIdOf(operatorEntity);
bankCardEntity.setOwnerId(ownerId);
bankCardEntity.setCreateDate(new Date());
}
/*
获取某用户的主账号id
*/
private Long ownerIdOf(ResellerEntity resellerEntity){
if ("1".equals(resellerEntity.getIsRoot())){
return resellerEntity.getId();
} else {
return resellerEntity.getSupplierId();
}
}
/**
*
* @param bankCardEntity
* @return
*/
public Boolean modifyMicroshopBankCard(BankCardEntity bankCardEntity) {
// 数据非空校验
nonEmptyCheckForModify(bankCardEntity);
BankCardEntity originalBankCardEntity = getBankCardById(bankCardEntity.getId());
ResellerEntity operatorEntity = getCustomerById(bankCardEntity.getUpdateBy());
// 操作人修改权限校验
ruleCheckForModify(originalBankCardEntity, operatorEntity);
// 其它字段初始化
initOtherFieldsForModify(bankCardEntity);
// 执行更新
int insert = bankCardWriteMapper.update(bankCardEntity);
return insert == 1;
}
private void nonEmptyCheckForModify(BankCardEntity entity){
if (entity == null){
throw new CustomerException(CustomerExceptionCode.PARAMETER_EMPTY);
}
if (entity.getId() == null){
throw new CustomerException(CustomerExceptionCode.BANKCARD_NULL_ID);
}
if (entity.getUpdateBy() == null){
throw new CustomerException(CustomerExceptionCode.OPERATOR_NULL);
}
// 是否存在可更新的数据
boolean existModifyData = false;
if (entity.getAccountHolder() != null){
existModifyData = true;
}
if (entity.getBank() != null){
existModifyData = true;
}
if (entity.getIdNum() != null){
existModifyData = true;
}
if (entity.getCardNum() != null){
existModifyData = true;
}
if (!existModifyData){
throw new CustomerException(CustomerExceptionCode.MODIFY_DATA_EMPTY);
}
}
/*
修改银行卡时,按一些规则校验
*/
private void ruleCheckForModify(BankCardEntity bankCardEntity, ResellerEntity operatorEntity) {
Long ownerIdOfBankCard = bankCardEntity.getOwnerId();
Long ownerIdOfOperator = ownerIdOf(operatorEntity);
if (!(ownerIdOfBankCard != null && ownerIdOfOperator != null
&& ownerIdOfBankCard.equals(ownerIdOfOperator))){
throw new CustomerException(CustomerExceptionCode.OPERATOR_SUPPLIER_MISMATCH);
}
}
private void initOtherFieldsForModify(BankCardEntity bankCardEntity){
bankCardEntity.setUpdateDate(new Date());
}
}
| [
"[email protected]"
] | |
139650b6d2bc6daa18bb04c274a44597f8bed93c | 0b80bb06ad84faadb6595edfe60417a9d5f35715 | /MeetSys/src/main/java/com/dbkj/meet/utils/ExcelUtil.java | dcce463365009591b105b493e361008875ef6a9d | [] | no_license | qinchunabng/xinhanyutong | 8822cdb91563caa6766e09bd15ac1df56d272417 | 4874914e0be98dc00cb7056b91b8691963ea585f | refs/heads/master | 2021-01-21T20:34:40.902217 | 2017-05-24T07:19:45 | 2017-05-24T07:19:45 | 92,255,100 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 5,679 | java | package com.dbkj.meet.utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import com.jfinal.kit.PathKit;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Record;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.format.Alignment;
import jxl.read.biff.BiffException;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;
public class ExcelUtil {
public static String writeExcel(List<Record> list,String[] heads,String[] columns){
return writeExcel(list,null,heads,columns);
}
/**
* 输出Excel
* @param list 要输出的数据
* @param directory 要输出的目录
* @param heads 表头
* @param columns 数据列名
*/
public static <T> String writeExcel(List<T> list,String directory,String[] heads,String[] columns){
WritableWorkbook workbook=null;
String path = PathKit.getWebRootPath()+"/download/"+(directory!=null?directory:"");
File dir=new File(path);
if(!dir.exists()){
dir.mkdir();
}
SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmss");
String name=sdf.format(new Date())+".xls";
try {
workbook=Workbook.createWorkbook(new File(dir, name));
//创建Excel工作表,制定名称和位置
WritableSheet sheet=workbook.createSheet("sheet1", 0);
//添加表头
createHead(sheet, heads);
//添加内容
WritableFont font=new WritableFont(WritableFont.ARIAL,12);
WritableCellFormat format=new WritableCellFormat(font);
try {
format.setAlignment(Alignment.CENTRE);//居中显示
} catch (WriteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Iterator<T> itr=list.iterator();
int rows=1;
while(itr.hasNext()){
T t=itr.next();
if(t instanceof Record){
Record r= (Record) t;
for(int i=0;i<columns.length;i++){
Object o = r.get(columns[i]);
Label lbl=new Label(i,rows,o==null?"":o.toString(),format);
sheet.addCell(lbl);
}
}else{
Model r= (Model) t;
for(int i=0;i<columns.length;i++){
Object o = r.get(columns[i]);
Label lbl=new Label(i,rows,o==null?"":o.toString(),format);
sheet.addCell(lbl);
}
}
rows++;
}
workbook.write();//写入
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (RowsExceededException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WriteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally{
if(workbook!=null){
try {
workbook.close();
} catch (WriteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
return name;
}
/**
* 创建表头
* @param sheet
* @param heads
*/
private static void createHead(WritableSheet sheet,String[] heads){
WritableFont font=new WritableFont(WritableFont.ARIAL,14,WritableFont.BOLD);
WritableCellFormat format=new WritableCellFormat(font);
try {
format.setAlignment(Alignment.CENTRE);//居中显示
} catch (WriteException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
for(int i=0;i<heads.length;i++){
try {
Label lbl=new Label(i,0,heads[i],format);
sheet.addCell(lbl);
} catch (WriteException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
/**
* 读取excel
* @param file excel文件
* @param list 读取出来的数据
* @param columns 数据字段名
*/
public void readExcel(File file,List<Record> list,String[] columns){
InputStream is=null;
Workbook workbook=null;
try {
is=new FileInputStream(file);
workbook=Workbook.getWorkbook(is);
Sheet sheet=workbook.getSheet(0);
int cols=columns.length;
int rows=sheet.getRows();
for(int i=1;i<rows;i++){//行
Record record=new Record();
for(int n=0;n<cols;n++){//列
Cell cell=sheet.getCell(n, i);
String content=cell.getContents();
content=content!=null?content.trim():"";
record.set(columns[n], content);
}
list.add(record);
}
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (BiffException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
if(workbook!=null){
workbook.close();
}
if(is!=null){
try {
is.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
/**
* 验证电话号码
* @param phone
* @return
*/
public boolean validatePhone(String phone){
Pattern pattern=Pattern.compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
Matcher matcher=pattern.matcher(phone);
return matcher.matches();
}
/**
* 验证email
* @param email
* @return
*/
public boolean validateEmail(String email){
Pattern pattern=Pattern.compile("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$");
Matcher matcher=pattern.matcher(email);
return matcher.matches();
}
}
| [
"[email protected]"
] | |
8c2aba404eda6b69ec6be1dddd91dc0da8b704c7 | 554475037ead1a24209428eaf725938fe655ca16 | /data structure/src/ch12/indexsequentialsearch/SimpleIndexExample.java | 8271f49b3b9047b5f6176e5e71abc8ab205cd4fb | [] | no_license | heeyoungs/study | 1d99dbf9a35c82004d8cbcc2acf6dedf2b706340 | 0ed9a3a9795750270caab7ff2ee87ae6f12b2e2c | refs/heads/master | 2023-08-27T20:46:01.360955 | 2021-11-09T11:17:14 | 2021-11-09T11:17:14 | 346,404,519 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,104 | java | package ch12.indexsequentialsearch;
public class SimpleIndexExample {
public static void main(String[] args) {
SimpleIndex pIndexTable = null;
int indexSize = 3;
int index = 0;
int key = 0;
int ascSortedValues[] = {10, 20, 50, 60, 70, 80};
int arraySzie = 6;
SimpleIndex.showArray(ascSortedValues, arraySzie);
pIndexTable = new SimpleIndex(ascSortedValues, arraySzie, indexSize);
pIndexTable.showIndexTable(indexSize);
key = 60;
index = pIndexTable.sequentialIndexSearch(ascSortedValues, arraySzie, indexSize, key);
if (index >= 0) {
System.out.println("키-" + key + ",위치-" + index);
} else {
System.out.println("키-" + key + ",검색 실패");
}
key = 65;
index = pIndexTable.sequentialIndexSearch(ascSortedValues, arraySzie, indexSize, key);
if (index >= 0) {
System.out.println("키-" + key + ",위치-" + index);
} else {
System.out.println("키-" + key + ",검색 실패");
}
}
}
| [
"[email protected]"
] | |
cab31edba04aff6ad06f8f65c05697b307f76e7f | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/deeplearning4j--deeplearning4j/d91d097b9a27fbf89cd482d312dbc4d47db561fd/after/ArrayUtil.java | 8e4e10713e1155bc9d36c6ccc7cd456aa917edc1 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,824 | java | package org.deeplearning4j.util;
import java.lang.reflect.Array;
import java.util.List;
public class ArrayUtil {
public static int prod(int[] mult) {
int ret = 1;
for(int i = 0; i < mult.length; i++)
ret *= mult[i];
return ret;
}
public static int[] consArray(int a, int[] as) {
int len=as.length;
int[] nas=new int[len+1];
nas[0]=a;
System.arraycopy(as, 0, nas, 1, len);
return nas;
}
public static boolean isZero(int[] as) {
for (int i=0; i<as.length; i++) {
if (as[i]!=0) return false;
}
return true;
}
public static boolean anyMore(int[] target,int[] test) {
assert target.length == test.length : "Unable to compare: different sizes";
for(int i = 0; i < target.length; i++) {
if(target[i] > test[i])
return true;
}
return false;
}
public static boolean anyLess(int[] target,int[] test) {
assert target.length == test.length : "Unable to compare: different sizes";
for(int i = 0; i < target.length; i++) {
if(target[i] < test[i])
return true;
}
return false;
}
public static int dotProduct(int[] xs, int[] ys) {
int result = 0;
int n = xs.length;
if (ys.length != n )
throw new IllegalArgumentException("Different array sizes");
for (int i=0; i < n; i++) {
result += xs[i] * ys[i];
}
return result;
}
public static int[] empty() {
return new int[0];
}
public static int[] of(int...arr) {
return arr;
}
public static int[] copy(int[] copy) {
int[] ret = new int[copy.length];
System.arraycopy(copy,0,ret,0,ret.length);
return ret;
}
public static int[] toArray(List<Integer> list) {
int[] ret = new int[list.size()];
for(int i = 0; i < list.size(); i++)
ret[i] = list.get(i);
return ret;
}
/**
* Return a copy of this array with the
* given index omitted
* @param data the data to copy
* @param index the index of the item to remove
* @return the new array with the omitted
* item
*/
public static int[] removeIndex(int[] data, int index) {
if(index >= data.length)
throw new IllegalArgumentException("Unable to remove index " + index + " was >= data.length");
if(data == null)
return null;
if(data.length < 1)
return data;
if(index < 0)
return data;
if(data.length == 1)
throw new IllegalArgumentException("Unable to remove item from a 1 length array");
int len = data.length;
int[] result = new int[len - 1];
System.arraycopy(data, 0, result, 0, index);
System.arraycopy(data, index+1, result, index, len - index - 1);
return result;
}
/**
* Returns the array with the item in index
* removed, if the array is empty it will return the array itself
* @param data the data to remove data from
* @param index the index of the item to remove
* @return a copy of the array with the removed item,
* or the array itself if empty
*/
public static Integer[] removeIndex(Integer[] data, int index) {
if(data == null)
return null;
if(data.length < 1)
return data;
int len = data.length;
Integer[] result = new Integer[len - 1];
System.arraycopy(data, 0, result, 0, index);
System.arraycopy(data, index+1, result, index, len-index - 1);
return result;
}
/**
* Computes the standard packed array strides for a given shape.
* @param shape the shape of a matrix:
* @return the strides for a matrix of n dimensions
*/
public static int[] calcStrides(int[] shape) {
int dimensions = shape.length;
int[] stride = new int[dimensions];
int st= 1;
for (int j = dimensions - 1; j >= 0; j--) {
stride[j] = st;
st *= shape[j];
}
return stride;
}
public static int[] reverseCopy(int[] e) {
int[] copy = new int[e.length];
for(int i = 0; i <= e.length / 2; i++)
{
int temp = e[i];
copy[i] = e[e.length - i - 1];
copy[e.length - i - 1] = temp;
}
return copy;
}
public static void reverse(int[] e) {
for(int i = 0; i <= e.length / 2; i++)
{
int temp = e[i];
e[i] = e[e.length - i - 1];
e[e.length - i - 1] = temp;
}
}
public static <E> E[] reverseCopy(E[] e) {
E[] copy = (E[]) new Object[e.length];
for(int i = 0; i <= e.length / 2; i++)
{
E temp = e[i];
copy[i] = e[e.length - i - 1];
copy[e.length - i - 1] = temp;
}
return copy;
}
public static <E> void reverse(E[] e) {
for(int i = 0; i <= e.length / 2; i++)
{
E temp = e[i];
e[i] = e[e.length - i - 1];
e[e.length - i - 1] = temp;
}
}
public static int[] flatten(int[][] arr) {
int[] ret = new int[arr.length * arr[0].length];
int count = 0;
for(int i = 0; i < arr.length; i++)
for(int j = 0; j < arr[i].length; j++)
ret[count++] = arr[i][j];
return ret;
}
public static double[] flatten(double[][] arr) {
double[] ret = new double[arr.length * arr[0].length];
int count = 0;
for(int i = 0; i < arr.length; i++)
for(int j = 0; j < arr[i].length; j++)
ret[count++] = arr[i][j];
return ret;
}
public static double[][] toDouble(int[][] arr) {
double[][] ret = new double[arr.length][arr[0].length];
for(int i = 0; i < arr.length; i++) {
for(int j = 0; j < arr[i].length; j++)
ret[i][j] = arr[i][j];
}
return ret;
}
/**
* Combines a set of int arrays in to one flat int array
* @param nums the int arrays to combine
* @return one combined int array
*/
public static float[] combineFloat(List<float[]> nums) {
int length = 0;
for(int i = 0; i < nums.size(); i++)
length += nums.get(i).length;
float[] ret = new float[length];
int count = 0;
for(float[] i : nums) {
for(int j = 0; j < i.length; j++) {
ret[count++] = i[j];
}
}
return ret;
}
/**
* Combines a set of int arrays in to one flat int array
* @param nums the int arrays to combine
* @return one combined int array
*/
public static double[] combine(List<double[]> nums) {
int length = 0;
for(int i = 0; i < nums.size(); i++)
length += nums.get(i).length;
double[] ret = new double[length];
int count = 0;
for(double[] i : nums) {
for(int j = 0; j < i.length; j++) {
ret[count++] = i[j];
}
}
return ret;
}
/**
* Combines a set of int arrays in to one flat int array
* @param ints the int arrays to combine
* @return one combined int array
*/
public static double[] combine(double[]...ints) {
int length = 0;
for(int i = 0; i < ints.length; i++)
length += ints[i].length;
double[] ret = new double[length];
int count = 0;
for(double[] i : ints) {
for(int j = 0; j < i.length; j++) {
ret[count++] = i[j];
}
}
return ret;
}
/**
* Combines a set of int arrays in to one flat int array
* @param ints the int arrays to combine
* @return one combined int array
*/
public static int[] combine(int[]...ints) {
int length = 0;
for(int i = 0; i < ints.length; i++)
length += ints[i].length;
int[] ret = new int[length];
int count = 0;
for(int[] i : ints) {
for(int j = 0; j < i.length; j++) {
ret[count++] = i[j];
}
}
return ret;
}
public static <E> E[] combine(E[]...arrs) {
int length = 0;
for(int i = 0; i < arrs.length; i++)
length += arrs[i].length;
E[] ret = (E[]) Array.newInstance(arrs[0][0].getClass(), length);
int count = 0;
for(E[] i : arrs) {
for(int j = 0; j < i.length; j++) {
ret[count++] = i[j];
}
}
return ret;
}
public static int[] toOutcomeArray(int outcome,int numOutcomes) {
int[] nums = new int[numOutcomes];
nums[outcome] = 1;
return nums;
}
} | [
"[email protected]"
] | |
50dd05747b3d8d0e3e328ce220c5970210695ecc | 6034e8b774d31a450a9acd5507e3cd26c16c82b2 | /Other-projects/SYNCRONIZE_CATALOG/src/main/java/br/com/gvt/eng/sync/thread/AssetSyncThread.java | a5784f30829e2994a94dc7b5a769dcf64f4a4442 | [] | no_license | c4sio/thirdparty | e9428382ad6ce7c185a570ca193a5fe2cc184713 | 702cc251e1551735f77289ad656bde178404f6f6 | refs/heads/master | 2021-01-10T12:55:57.275163 | 2016-03-22T19:49:34 | 2016-03-22T19:49:34 | 54,413,426 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,804 | java | package br.com.gvt.eng.sync.thread;
import java.util.List;
import org.apache.log4j.Logger;
import org.elasticsearch.action.bulk.BulkRequestBuilder;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.client.Client;
import br.com.gvt.eng.sync.model.AssetSyncVO;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
/**
* @author GVT
*
*/
public class AssetSyncThread implements Runnable {
Logger logger = Logger.getLogger(AssetSyncThread.class.getName());
// Variavel para identificar o client elasticsearch
private Client client;
// Variavel para identificar o entity
private List<AssetSyncVO> assetList;
/**
* Cria o construtor com os dados para leitura, recebe a lista de dados e a
* conexao com o servidor do elasticsearch.
*
* @param assetList
* @param client
*/
public AssetSyncThread(List<AssetSyncVO> assetList, Client client) {
this.assetList = assetList;
this.client = client;
}
public void run() {
try {
logger.info("Registros na thread: " + assetList.size());
// Instancia o Gson
Gson gson = new GsonBuilder().serializeNulls().create();
String json = null;
BulkRequestBuilder bulkBuilder = client.prepareBulk();
for (AssetSyncVO asset : assetList) {
// Carrega os dados para execucaoo em lote
json = gson.toJson(asset);
bulkBuilder.add(client.prepareIndex("catalog", "asset",
String.valueOf(asset.getAssetId())).setSource(json));
}
// Grava os dados
BulkResponse bulkRes = bulkBuilder.execute().actionGet();
// Grava o log caso de erro na execucao
if (bulkRes.hasFailures()) {
logger.error(String.format("Error indexing file %s",
bulkRes.buildFailureMessage()));
}
} catch (Exception e) {
logger.error("Erro ao gravar dados ", e);
}
}
}
| [
"[email protected]"
] | |
2eb8910a9e3bf8ecdac867df0fb804c7b7cb4f1b | 9ddf24460ca40f6e0723f733938534dce15b149d | /src/main/java/com/zxd/learning/designpattern/filter/CriteriaPatternDemo.java | b5e689057ed099f2a991852f8b2c9a6d609c998c | [] | no_license | CoderZxd/Design-pattern | 7d5200dd820ed42fe7a7f73d4d109b80cebe61d6 | 72e89396551493348d4122d39ed96b2fd5c6071c | refs/heads/master | 2021-09-06T23:12:54.889259 | 2018-02-13T09:44:59 | 2018-02-13T09:44:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,833 | java | package com.zxd.learning.designpattern.filter;
import java.util.ArrayList;
import java.util.List;
/**
* @Project Design-pattern
* @Package com.zxd.learning.designpattern.filter
* @Author:zouxiaodong
* @Description:
* @Date:Created in 15:37 2018/2/12.
*/
public class CriteriaPatternDemo {
public static void main(String[] args){
List<Person> persons = new ArrayList<Person>(10);
persons.add(new Person("Robert","Male", "Single"));
persons.add(new Person("John","Male", "Married"));
persons.add(new Person("Laura","Female", "Married"));
persons.add(new Person("Diana","Female", "Single"));
persons.add(new Person("Mike","Male", "Single"));
persons.add(new Person("Bobby","Male", "Single"));
Criteria male = new CriteriaMale();
Criteria female = new CriteriaFemale();
Criteria single = new CriteriaSingle();
Criteria singleMale = new AndCriteria(single, male);
Criteria singleOrFemale = new OrCriteria(single, female);
System.out.println("Males: ");
printPersons(male.meetCriteria(persons));
System.out.println("\nFemales: ");
printPersons(female.meetCriteria(persons));
System.out.println("\nSingle And Males: ");
printPersons(singleMale.meetCriteria(persons));
System.out.println("\nSingle Or Females: ");
printPersons(singleOrFemale.meetCriteria(persons));
}
public static void printPersons(List<Person> persons){
for (Person person : persons) {
System.out.println("Person : [ Name : " + person.getName()
+", Gender : " + person.getGender()
+", Marital Status : " + person.getMaritalStatus()
+" ]");
}
}
}
| [
"[email protected]"
] | |
dd2972d12348c88ff41be3c861bb44c0a743248d | b04d128fed0f7a00d74c90ab3984b99e8fa7593f | /源代码/work-system/work-system/work-util/src/main/java/team/work/utils/kit/AnnoKit.java | 03397ae808881d9dee7d74bc46ea1edad0d36eff | [] | no_license | 2368990203/WorkManagementSystem | a11d126a9aaf273d2f574e320d150434d4b98462 | 8ae92e884eada4be22a8e80d808aead096220163 | refs/heads/master | 2020-06-08T08:22:38.250204 | 2019-07-05T02:16:52 | 2019-07-05T02:16:52 | 193,195,527 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,647 | java | package team.work.utils.kit;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotations.TableName;
import team.work.utils.constant.Table;
import team.work.utils.convert.J;
import team.work.utils.constant.Table;
import team.work.utils.convert.J;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
public class AnnoKit {
public static AnnoKit anno = null;
public static AnnoKit getInstance() {
if (anno == null) {
anno = new AnnoKit();
}
return anno;
}
public int getTableId(Class cls){
JSONObject object = J.o2j(AnnoKit.getInstance().getClassAnnotation(cls, TableName.class));
return Table.BUSINESS.get(object.get("value"));
}
/**
* 得到类上面的注解信息
* @param scannerClass
* @param allowInjectClass
* @return
*/
public Annotation getClassAnnotation(Class<?> scannerClass , Class<? extends Annotation> allowInjectClass) {
if(!scannerClass.isAnnotationPresent(allowInjectClass)) {
return null;
}
return scannerClass.getAnnotation(allowInjectClass);
}
/**
* 等到方法级别注解的信息
* @param scannerClass:需要被扫描的class文件
* @param allowInjectClass:注解的文件
* @return
*/
public List<Annotation> getMethodAnnotation(Class<?> scannerClass , Class<? extends Annotation> allowInjectClass) {
List<Annotation> annotations = new ArrayList<Annotation>();
for(Method method : scannerClass.getDeclaredMethods()) {
if(!method.isAnnotationPresent(allowInjectClass)) {
continue;
}
annotations.add(method.getAnnotation(allowInjectClass));
}
return annotations;
}
/**
* 使用Java反射得到注解的信息
* @param annotation
* @param methodName
* @return
* @throws NoSuchMethodException
* @throws SecurityException
* @throws IllegalAccessException
* @throws IllegalArgumentException
* @throws InvocationTargetException
*/
public Object getAnnotationInfo(Annotation annotation , String methodName) throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
if(annotation == null) {
return null;
}
Method method = annotation.getClass().getDeclaredMethod(methodName, null);
return method.invoke(annotation, null);
}
}
| [
"[email protected]"
] | |
9dd34c4a5e4aa4094f3b19f0759c28dbd1d9ace7 | 7dad262fd5a3d9b40361dc448e8a0b0b0a4a5370 | /ruoyi/src/main/java/com/ruoyi/project/party/service/IDjOrgAssessmentyearService.java | 29894a5283aee6c4a166d2b726ad230ac31aea3d | [
"MIT"
] | permissive | 13416494311/gh | f95baef8d63ab1dc36b56066afb78e2882155fb6 | f54bf8fb6d6c686b1ebe272cd4342218fcae08a8 | refs/heads/master | 2023-07-10T12:43:52.589745 | 2021-08-23T12:24:55 | 2021-08-23T12:24:55 | 390,782,667 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,704 | java | package com.ruoyi.project.party.service;
import java.util.List;
import com.ruoyi.project.party.domain.DjOrgAssessmentyear;
/**
* 工会考核年Service接口
*
* @author admin
* @date 2021-03-10
*/
public interface IDjOrgAssessmentyearService
{
/**
* 查询工会考核年
*
* @param id 工会考核年ID
* @return 工会考核年
*/
public DjOrgAssessmentyear selectDjOrgAssessmentyearById(Long id);
/**
* 查询工会考核年
*
* @param assessmentyearUuid 工会考核年UUID
* @return 工会考核年
*/
public DjOrgAssessmentyear selectDjOrgAssessmentyearByUuid(String assessmentyearUuid);
/**
* 查询工会考核年列表
*
* @param djOrgAssessmentyear 工会考核年
* @return 工会考核年集合
*/
public List<DjOrgAssessmentyear> selectDjOrgAssessmentyearList(DjOrgAssessmentyear djOrgAssessmentyear);
/**
* 新增工会考核年
*
* @param djOrgAssessmentyear 工会考核年
* @return 结果
*/
public int insertDjOrgAssessmentyear(DjOrgAssessmentyear djOrgAssessmentyear);
/**
* 修改工会考核年
*
* @param djOrgAssessmentyear 工会考核年
* @return 结果
*/
public int updateDjOrgAssessmentyear(DjOrgAssessmentyear djOrgAssessmentyear);
/**
* 批量删除工会考核年
*
* @param ids 需要删除的工会考核年ID
* @return 结果
*/
public int deleteDjOrgAssessmentyearByIds(Long[] ids);
/**
* 删除工会考核年信息
*
* @param id 工会考核年ID
* @return 结果
*/
public int deleteDjOrgAssessmentyearById(Long id);
}
| [
"[email protected]"
] | |
cbb316ede975bb8f9bade6487b1f02fc0f71a285 | 520eecc1e9b24989fe22cd0e84d4a198293e61dc | /app/src/main/java/com/example/login/presenter/DocumentWaitingDao/IDocumentWaitingDao.java | 61c86bc42394489af3b1ded1cea670cc5ad35777 | [] | no_license | nguyenkiemhieu1/loginVNPT | 985e5450dc5c2a08f1a5bed6fb8121ce664e893b | cc22259bc11232cd708f2935c81e21399b208692 | refs/heads/master | 2023-02-23T02:41:01.434336 | 2021-01-25T14:07:04 | 2021-01-25T14:07:04 | 321,529,283 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 665 | java | package com.example.login.presenter.DocumentWaitingDao;
import com.example.login.model.DocumentWaiting.DocumentWaitingRequest;
import com.example.login.presenter.HandleSyncService;
import com.example.login.presenter.ICallFinishedListener;
public interface IDocumentWaitingDao {
void onGetDetail(int docId, ICallFinishedListener callFinishedListener);
void onMarkDocument(int docId, ICallFinishedListener callFinishedListener);
void onFinish(int id,String comment ,ICallFinishedListener iCallFinishedListener);
void onRecordsDocumentWaitingDao(DocumentWaitingRequest documentWaitingRequest, HandleSyncService.HandleGetRecords handleGetRecords);
}
| [
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.